给所有单据都增加扫码功能
This commit is contained in:
@@ -525,6 +525,7 @@ export const BillModalMixin = {
|
|||||||
getMaterialByBarCode(param).then((res) => {
|
getMaterialByBarCode(param).then((res) => {
|
||||||
if (res && res.code === 200) {
|
if (res && res.code === 200) {
|
||||||
let hasFinished = false
|
let hasFinished = false
|
||||||
|
let allLastMoney = 0
|
||||||
let allTaxLastMoney = 0
|
let allTaxLastMoney = 0
|
||||||
//获取单据明细列表信息
|
//获取单据明细列表信息
|
||||||
let detailArr = allValues.tablesValue[0].values
|
let detailArr = allValues.tablesValue[0].values
|
||||||
@@ -594,6 +595,7 @@ export const BillModalMixin = {
|
|||||||
this.materialTable.dataSource = newDetailArr
|
this.materialTable.dataSource = newDetailArr
|
||||||
//更新优惠后金额、本次付款等信息
|
//更新优惠后金额、本次付款等信息
|
||||||
for(let newDetail of newDetailArr){
|
for(let newDetail of newDetailArr){
|
||||||
|
allLastMoney = allLastMoney + (newDetail.allPrice-0)
|
||||||
allTaxLastMoney = allTaxLastMoney + (newDetail.taxLastMoney-0)
|
allTaxLastMoney = allTaxLastMoney + (newDetail.taxLastMoney-0)
|
||||||
}
|
}
|
||||||
let discount = this.form.getFieldValue('discount')-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 discountMoney = (discount*0.01*allTaxLastMoney).toFixed(2)-0
|
||||||
let discountLastMoney = (allTaxLastMoney-discountMoney).toFixed(2)-0
|
let discountLastMoney = (allTaxLastMoney-discountMoney).toFixed(2)-0
|
||||||
let changeAmountNew = (discountLastMoney + otherMoney).toFixed(2)-0
|
let changeAmountNew = (discountLastMoney + otherMoney).toFixed(2)-0
|
||||||
this.$nextTick(() => {
|
if(this.prefixNo === 'LSCK' || this.prefixNo === 'LSTH') {
|
||||||
this.form.setFieldsValue({'discount':discount,'discountMoney':discountMoney,'discountLastMoney':discountLastMoney,
|
this.$nextTick(() => {
|
||||||
'changeAmount':changeAmountNew,'debt':0})
|
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 = ''
|
this.scanBarCode = ''
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user