From 1edda375a85207639b3be124ec20efdc625eba22 Mon Sep 17 00:00:00 2001 From: chenhao Date: Fri, 14 Nov 2025 16:55:18 +0800 Subject: [PATCH] =?UTF-8?q?feat(order):=20=E8=87=AA=E5=8A=A8=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E6=80=BB=E4=BB=A3=E5=87=BA=E8=B4=A7=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E8=A1=A8=E5=8D=95=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将总代出货金额字段设为只读,并自动填充计算结果 - 新增 totalConfigAmount 计算属性,用于汇总软硬件及维护产品总价- 表单初始化时深拷贝订单数据以避免引用问题-优化付款方式相关选项的加载与回显逻辑,确保原始值正确恢复 - 在产品信息变更后自动更新总代出货金额字段 --- .../src/views/project/order/OrderDetail.vue | 39 +++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) 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 } } };