diff --git a/oms_web/oms_vue/src/views/project/order/OrderDetail.vue b/oms_web/oms_vue/src/views/project/order/OrderDetail.vue index 890cbf89..4d5a46af 100644 --- a/oms_web/oms_vue/src/views/project/order/OrderDetail.vue +++ b/oms_web/oms_vue/src/views/project/order/OrderDetail.vue @@ -90,7 +90,7 @@ - + @@ -544,6 +544,19 @@ export default { return null; } return this.groupedContractFiles[this.activeContractVersionTab].bakFile; + }, + totalConfigAmount() { + let total = 0; + if (this.form.softwareProjectProductInfoList) { + total += this.form.softwareProjectProductInfoList.reduce((sum, item) => sum + (item.allPrice || 0), 0); + } + if (this.form.hardwareProjectProductInfoList) { + total += this.form.hardwareProjectProductInfoList.reduce((sum, item) => sum + (item.allPrice || 0), 0); + } + if (this.form.maintenanceProjectProductInfoList) { + total += this.form.maintenanceProjectProductInfoList.reduce((sum, item) => sum + (item.allPrice || 0), 0); + } + return total; } }, watch: { @@ -608,7 +621,9 @@ export default { this.reset(); if (this.isEdit) { getOrder(this.orderId).then(response => { - this.form = response.data.projectOrderInfo; + + this.form = {...response.data.projectOrderInfo}; + this.isProjectSelected = true; // 兼容版本号为空的情况 if (!this.form.versionCode) { @@ -652,8 +667,25 @@ export default { } // 手动触发联动 this.handleBgChange(this.form.bgProperty); + // 先调用 handleChannelChange 设置 paymentMethodOptions this.handleChannelChange(this.form.orderChannel); - this.handlePaymentMethodChange(this.form.paymentMethod); + // 存储原始的付款方式、付款比例和付款条件 + const originalPaymentMethod = response.data.projectOrderInfo.paymentMethod; + const originalPaymentRatio = response.data.projectOrderInfo.paymentRatio; + const originalPaymentDescription = response.data.projectOrderInfo.paymentDescription; + + // 重新设置付款方式,并触发其change事件以更新付款条件描述 + if (originalPaymentMethod) { + this.form.paymentMethod = originalPaymentMethod; + this.handlePaymentMethodChange(originalPaymentMethod); + } + // 恢复原始的付款比例和付款条件,以防被 handlePaymentMethodChange 覆盖 + if (originalPaymentRatio !== null) { + this.form.paymentRatio = originalPaymentRatio; + } + if (originalPaymentDescription) { + this.form.paymentDescription = originalPaymentDescription; + } }); } else { // 设置新增时的默认值 @@ -987,6 +1019,7 @@ export default { this.form.softwareProjectProductInfoList = productData.softwareProjectProductInfoList; this.form.hardwareProjectProductInfoList = productData.hardwareProjectProductInfoList; this.form.maintenanceProjectProductInfoList = productData.maintenanceProjectProductInfoList; + this.form.shipmentAmount = this.totalConfigAmount; // Update shipmentAmount } } };