From 6fb687a41130dc517538c91d1a6ed554e6617eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Sat, 9 Oct 2021 00:49:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E6=89=80=E6=9C=89=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E9=83=BD=E5=A2=9E=E5=8A=A0=E6=89=AB=E7=A0=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/bill/mixins/BillModalMixin.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/jshERP-web/src/views/bill/mixins/BillModalMixin.js b/jshERP-web/src/views/bill/mixins/BillModalMixin.js index 66382b5e..ca99eff8 100644 --- a/jshERP-web/src/views/bill/mixins/BillModalMixin.js +++ b/jshERP-web/src/views/bill/mixins/BillModalMixin.js @@ -525,6 +525,7 @@ export const BillModalMixin = { getMaterialByBarCode(param).then((res) => { if (res && res.code === 200) { let hasFinished = false + let allLastMoney = 0 let allTaxLastMoney = 0 //获取单据明细列表信息 let detailArr = allValues.tablesValue[0].values @@ -594,6 +595,7 @@ export const BillModalMixin = { this.materialTable.dataSource = newDetailArr //更新优惠后金额、本次付款等信息 for(let newDetail of newDetailArr){ + allLastMoney = allLastMoney + (newDetail.allPrice-0) allTaxLastMoney = allTaxLastMoney + (newDetail.taxLastMoney-0) } let discount = this.form.getFieldValue('discount')-0 @@ -601,10 +603,16 @@ export const BillModalMixin = { let discountMoney = (discount*0.01*allTaxLastMoney).toFixed(2)-0 let discountLastMoney = (allTaxLastMoney-discountMoney).toFixed(2)-0 let changeAmountNew = (discountLastMoney + otherMoney).toFixed(2)-0 - this.$nextTick(() => { - this.form.setFieldsValue({'discount':discount,'discountMoney':discountMoney,'discountLastMoney':discountLastMoney, - 'changeAmount':changeAmountNew,'debt':0}) - }); + if(this.prefixNo === 'LSCK' || this.prefixNo === 'LSTH') { + this.$nextTick(() => { + this.form.setFieldsValue({'changeAmount':allLastMoney,'getAmount':allLastMoney,'backAmount':0}) + }); + } else { + this.$nextTick(() => { + this.form.setFieldsValue({'discount':discount,'discountMoney':discountMoney,'discountLastMoney':discountLastMoney, + 'changeAmount':changeAmountNew,'debt':0}) + }); + } //置空扫码的内容 this.scanBarCode = '' }