From 0d3b8c0790fd5bc47cf6a49e1ab3adf42d59855b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Tue, 10 May 2022 22:40:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8D=95=E6=8D=AE=E4=B8=AD?= =?UTF-8?q?=E6=94=B9=E4=BC=98=E6=83=A0=E7=8E=87=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E9=87=91=E9=A2=9D=E8=AE=A1=E7=AE=97bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/bill/mixins/BillModalMixin.js | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/jshERP-web/src/views/bill/mixins/BillModalMixin.js b/jshERP-web/src/views/bill/mixins/BillModalMixin.js index 7646390b..38b1ccb9 100644 --- a/jshERP-web/src/views/bill/mixins/BillModalMixin.js +++ b/jshERP-web/src/views/bill/mixins/BillModalMixin.js @@ -556,10 +556,8 @@ export const BillModalMixin = { //改变优惠率 onKeyUpDiscount(e) { const value = e.target.value-0 - let discountMoney = this.form.getFieldValue('discountMoney')-0 - let discountLastMoney = this.form.getFieldValue('discountLastMoney')-0 let otherMoney = this.form.getFieldValue('otherMoney')-0 - let allTaxLastMoney = (discountMoney + discountLastMoney).toFixed(2)-0 + let allTaxLastMoney = this.$refs.materialDataTable.statisticsColumns.taxLastMoney-0 let discountMoneyNew = (allTaxLastMoney*value*0.01).toFixed(2)-0 let discountLastMoneyNew = (allTaxLastMoney - discountMoneyNew).toFixed(2)-0 let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2)-0 @@ -571,19 +569,15 @@ export const BillModalMixin = { //改变付款优惠 onKeyUpDiscountMoney(e) { const value = e.target.value-0 - let discount = this.form.getFieldValue('discount')-0 - let discountLastMoney = this.form.getFieldValue('discountLastMoney')-0 let otherMoney = this.form.getFieldValue('otherMoney')-0 - if(discount !== 100) { - let allTaxLastMoney = (discountLastMoney/(1-discount/100)).toFixed(2)-0 - let discountNew = (value/allTaxLastMoney*100).toFixed(2)-0 - let discountLastMoneyNew = (allTaxLastMoney - value).toFixed(2)-0 - let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2)-0 - this.$nextTick(() => { - this.form.setFieldsValue({'discount':discountNew,'discountLastMoney':discountLastMoneyNew, - 'changeAmount':changeAmountNew,'debt':0}) - }); - } + let allTaxLastMoney = this.$refs.materialDataTable.statisticsColumns.taxLastMoney-0 + let discountNew = (value/allTaxLastMoney*100).toFixed(2)-0 + let discountLastMoneyNew = (allTaxLastMoney - value).toFixed(2)-0 + let changeAmountNew = (discountLastMoneyNew + otherMoney).toFixed(2)-0 + this.$nextTick(() => { + this.form.setFieldsValue({'discount':discountNew,'discountLastMoney':discountLastMoneyNew, + 'changeAmount':changeAmountNew,'debt':0}) + }); }, //其它费用 onKeyUpOtherMoney(e) {