diff --git a/src/views/purchase/purchasingrequisition/accept/PurchasingAcceptModal.vue b/src/views/purchase/purchasingrequisition/accept/PurchasingAcceptModal.vue index b5353b9..cbd489a 100644 --- a/src/views/purchase/purchasingrequisition/accept/PurchasingAcceptModal.vue +++ b/src/views/purchase/purchasingrequisition/accept/PurchasingAcceptModal.vue @@ -147,30 +147,26 @@ const loadData = async () => { loading.value = true; try { const configRes = await getCommonConfigWithBatches(currentId); - // 防止快速切换:若已打开其他申请单,忽略本次结果 if (String(purchaseId.value) !== currentId) return; const config = configRes?.data; if (config?.common) { applyInfo.value = config.common; - // 采购人员和资产管理员始终回填 commonForm.value.purchaserId = config.common.purchaserId || ''; commonForm.value.purchaserName = config.common.purchaserName || ''; commonForm.value.assetAdminId = config.common.assetAdminId || ''; commonForm.value.assetAdminName = config.common.assetAdminName || ''; - - // 其他字段仅当存在已保存批次时回填 - if (config?.batches?.length) { - Object.assign(commonForm.value, { - hasContract: config.common.hasContract || '0', - contractId: config.common.contractId || '', - isInstallment: config.common.isInstallment || '0', - totalPhases: config.common.totalPhases || 1, - supplierName: config.common.supplierName || '', - transactionAmount: config.common.transactionAmount || null, - }); - } + commonForm.value.hasContract = config.common.hasContract || '0'; + commonForm.value.contractId = config.common.contractId || ''; + commonForm.value.contractName = config.common.contractName || ''; + commonForm.value.contractNo = config.common.contractNo || ''; + commonForm.value.contractMoney = config.common.contractMoney || null; + commonForm.value.contractFlowStatus = config.common.contractFlowStatus || ''; + commonForm.value.supplierName = config.common.supplierName || ''; + commonForm.value.isInstallment = config.common.isInstallment || '0'; + commonForm.value.totalPhases = config.common.totalPhases || 1; + commonForm.value.transactionAmount = config.common.transactionAmount || null; } if (config?.batches?.length) { @@ -327,6 +323,10 @@ const handleClose = () => { const DEFAULT_COMMON_FORM = { hasContract: '0', contractId: '', + contractName: '', + contractNo: '', + contractMoney: null, + contractFlowStatus: '', isInstallment: '0', totalPhases: 1, supplierName: '',