提交
This commit is contained in:
1 parent
dd1acdc787
commit
4222eaa593
47 files changed
+1054350
-9663
No files matched your search
@@ -24,6 +24,13 @@
|
||||
>{{ dictStore.getLabel('crm_contract_status', detailContract?.status) }}</el-tag>
|
||||
</div>
|
||||
<div class="detail-actions">
|
||||
<el-button
|
||||
v-if="manageActions"
|
||||
class="btn-ghost"
|
||||
@click="handleDetailCopy()"
|
||||
>
|
||||
<el-icon><DocumentCopy /></el-icon>合同复制
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="manageActions && isContractEditableStatus(detailContract?.status)"
|
||||
class="btn-ghost"
|
||||
@@ -844,6 +851,7 @@
|
||||
<ContractFormDialog
|
||||
v-model:visible="formDialogVisible"
|
||||
:edit-id="formDialogEditId"
|
||||
:copy-source="formDialogCopySource"
|
||||
@success="handleFormSuccess"
|
||||
/>
|
||||
<CustomerDetailDialog v-if="customerDialogActive" ref="customerDetailRef" />
|
||||
@@ -853,10 +861,14 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted, defineAsyncComponent, nextTick } from 'vue';
|
||||
import { ref, reactive, computed, onMounted, defineAsyncComponent, nextTick, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { isFrameworkContractType, isContractEditableStatus, getContractReeditConfirmMessage } from '../contractType'
|
||||
import { displayFrameworkMoney, displayFrameworkQuantity } from '../frameworkProductPricing'
|
||||
import {
|
||||
displayFrameworkMoney,
|
||||
displayFrameworkQuantity,
|
||||
formatFrameworkQuantityForPrint
|
||||
} from '../frameworkProductPricing'
|
||||
import {
|
||||
CircleCheck,
|
||||
CircleClose,
|
||||
@@ -865,6 +877,7 @@ import {
|
||||
Close,
|
||||
Delete,
|
||||
Document,
|
||||
DocumentCopy,
|
||||
DocumentChecked,
|
||||
Download,
|
||||
Edit,
|
||||
@@ -984,6 +997,18 @@ const currentContractId = ref<string | number>();
|
||||
|
||||
const formDialogVisible = ref(false);
|
||||
const formDialogEditId = ref<string | null>(null);
|
||||
const formDialogCopySource = ref<ContractVO | null>(null);
|
||||
|
||||
const resetFormDialogState = () => {
|
||||
formDialogEditId.value = null
|
||||
formDialogCopySource.value = null
|
||||
}
|
||||
|
||||
watch(formDialogVisible, (open) => {
|
||||
if (!open) {
|
||||
resetFormDialogState()
|
||||
}
|
||||
})
|
||||
|
||||
const approvalDialogRef = ref();
|
||||
const executeDialogRef = ref();
|
||||
@@ -1050,6 +1075,7 @@ function handleActionSuccess() {
|
||||
|
||||
function handleFormSuccess() {
|
||||
formDialogVisible.value = false;
|
||||
resetFormDialogState();
|
||||
loadDetailData();
|
||||
emit('success');
|
||||
}
|
||||
@@ -1258,6 +1284,18 @@ const handleDetailDrawerClose = () => {
|
||||
detailAttachmentFileList.value = [];
|
||||
};
|
||||
|
||||
/** 详情抽屉 - 合同复制 */
|
||||
const handleDetailCopy = () => {
|
||||
if (!detailContract.value?.id) {
|
||||
$modal.msgWarning('未找到合同数据')
|
||||
return
|
||||
}
|
||||
visible.value = false
|
||||
formDialogEditId.value = null
|
||||
formDialogCopySource.value = detailContract.value
|
||||
formDialogVisible.value = true
|
||||
}
|
||||
|
||||
/** 详情抽屉 - 编辑 */
|
||||
const handleDetailEdit = async () => {
|
||||
if (!detailContract.value?.id) return
|
||||
@@ -1274,7 +1312,8 @@ const handleDetailEdit = async () => {
|
||||
}
|
||||
}
|
||||
visible.value = false
|
||||
formDialogEditId.value = detailContract.value.id
|
||||
resetFormDialogState()
|
||||
formDialogEditId.value = String(detailContract.value.id)
|
||||
formDialogVisible.value = true
|
||||
}
|
||||
|
||||
@@ -1874,7 +1913,7 @@ const replacePlaceholders = (htmlContent: string, contractData: ContractVO | und
|
||||
<td style="padding: 4px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${product.model || product.productModel || ''}</td>
|
||||
<td style="padding: 4px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${formatBrandForPrint(product.brandMode, product.brandName)}</td>
|
||||
<td style="padding: 4px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${getUnitLabel(product.unit)}</td>
|
||||
<td style="padding: 4px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; overflow: hidden; word-break: break-all;">${product.quantity || 0}</td>
|
||||
<td style="padding: 4px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; overflow: hidden; word-break: break-all;">${formatFrameworkQuantityForPrint(product, isFrameworkContract)}</td>
|
||||
<td style="padding: 4px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${taxRateText}</td>
|
||||
${pricingCells}
|
||||
<td style="padding: 4px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${product.packageSpec || ''}</td>
|
||||
@@ -2252,6 +2291,8 @@ const generateContractTemplate = (contractData: ContractVO | undefined): string
|
||||
return unitLabel || unitValue || '';
|
||||
};
|
||||
|
||||
const isFrameworkContract = isFrameworkContractType(contractData.contractType);
|
||||
|
||||
// 构建产品明细表格行(使用 0.3px 边框)
|
||||
const productRows =
|
||||
contractData.products
|
||||
@@ -2268,7 +2309,7 @@ const generateContractTemplate = (contractData: ContractVO | undefined): string
|
||||
<td style="padding: 4px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${product.model || product.productModel || ''}</td>
|
||||
<td style="padding: 4px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${formatBrandForPrint(product.brandMode, product.brandName)}</td>
|
||||
<td style="padding: 4px 6px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${getUnitLabel(product.unit)}</td>
|
||||
<td style="padding: 4px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; overflow: hidden; word-break: break-all;">${product.quantity || 0}</td>
|
||||
<td style="padding: 4px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; overflow: hidden; word-break: break-all;">${formatFrameworkQuantityForPrint(product, isFrameworkContract)}</td>
|
||||
<td style="padding: 4px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px;">${taxRateText}</td>
|
||||
<td style="padding: 4px 3px; border: 0.3px solid #000; text-align: center; font-size: 12px; overflow: hidden; word-break: break-all;">${formatNumber(product.price)}</td>
|
||||
<td style="padding: 4px 3px; border: 0.3px solid #000; text-align: right; font-size: 12px; overflow: hidden; word-break: break-all;">${formatNumber(beforeTax)}</td>
|
||||
|
||||
Reference in new issue
Block a user