From e8d745358d823ed0a5586ce9d52dd32342ce6bba Mon Sep 17 00:00:00 2001 From: xielue Date: Tue, 15 Aug 2023 16:35:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BathroomQuotation/Edit.vue | 22 +++++++++++++++---- .../BathroomQuotation/drawer.vue | 2 +- .../BathroomScheme/BathroomScheme/Edit.vue | 12 ++++++---- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/Edit.vue b/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/Edit.vue index 1e52a2a..d56a584 100644 --- a/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/Edit.vue +++ b/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/Edit.vue @@ -365,12 +365,13 @@ isEnter: false, isTab: true, isEdit: true, isChecked: true }" :mouse-config="{ selected: true }" @pulldownSelected="drawer_onPulldownSelected" @popupSelected="drawer_onPopupSelected" :export-config="{}" @edit-closed="drawer_afterEditEvent" - @edit-actived="drawer_beforeEditEvent" show-footer :footer-method="drawer_footerMethod" + @edit-actived="drawer_beforeEditEvent" :footer-cell-class-name="drawer_footerCellClassName" :edit-config="{ trigger: 'click', mode: 'cell', icon: 'vxe-icon-edit', showStatus: false, beforeEditMethod: drawer_beforeEditMethod }"> - + @@ -2322,6 +2323,12 @@ export default { }, drawer_afterEditEvent({ column, row }) { console.log(row, column); + + + row.amount = parseFloat(row.quantity ||0) * parseFloat(row.expense ||0) ; + row.paint_amount = parseFloat(row.quantity ||0) * parseFloat(row.paint_expense ||0) ; + + this.calculateAll(); }, drawer_beforeEditEvent({ column, row }) { @@ -2793,18 +2800,25 @@ export default { + this.calculateTotal(); + }, + + calculateTotal(){ + this.formOptions.data.expense = parseFloat(this.formOptions.data.expense_total_amount || 0) + parseFloat(this.formOptions.data.material_total_amount || 0) + parseFloat(this.formOptions.data.labor_total_amount || 0) + parseFloat(this.formOptions.data.parts_total_amount || 0) + - parseFloat(this.formOptions.data.packaging_total_amount || 0); + parseFloat(this.formOptions.data.packaging_total_amount || 0)+ + parseFloat(this.formOptions.data.drawer_total_amount || 0); this.formOptions.data.paint_expense = parseFloat(this.formOptions.data.paintExpense_total_amount || 0) + parseFloat(this.formOptions.data.paintMaterial_total_amount || 0) + parseFloat(this.formOptions.data.paintLabor_total_amount || 0)+ parseFloat(this.formOptions.data.parts_total_amount || 0) + - parseFloat(this.formOptions.data.packaging_total_amount || 0); + parseFloat(this.formOptions.data.packaging_total_amount || 0)+ + parseFloat(this.formOptions.data.drawer_total_amount || 0); this.formOptions.data.show_expense = parseFloat(this.formOptions.data.expense || 0).toFixed(2); // 计算所有 费用 diff --git a/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/drawer.vue b/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/drawer.vue index 27fbcab..77c2500 100644 --- a/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/drawer.vue +++ b/src/pages/Middle/bathroom/BathroomQuotation/BathroomQuotation/drawer.vue @@ -870,7 +870,7 @@ export default { items: [ { field: 'name', title: '抽屉名', span: 6, itemRender: { name: '$input' } }, - { field: 'quantity', title: '数量', span: 6, itemRender: { name: '$input', props: { type: "number" }, events: { change: this.calculateAll } } }, + //{ field: 'quantity', title: '数量', span: 6, itemRender: { name: '$input', props: { type: "number" }, events: { change: this.calculateAll } } }, { field: 'show_expense', title: '单价(免漆)', span: 6, itemRender: { name: '$input' } }, { field: 'show_paint_expense', title: '单价(油漆)', span: 6, itemRender: { name: '$input' } }, diff --git a/src/pages/Middle/bathroom/BathroomScheme/BathroomScheme/Edit.vue b/src/pages/Middle/bathroom/BathroomScheme/BathroomScheme/Edit.vue index 0cc2dec..3007f3c 100644 --- a/src/pages/Middle/bathroom/BathroomScheme/BathroomScheme/Edit.vue +++ b/src/pages/Middle/bathroom/BathroomScheme/BathroomScheme/Edit.vue @@ -228,7 +228,7 @@ - + +