优化单据多选商品的功能

This commit is contained in:
季圣华
2021-08-07 23:07:00 +08:00
parent d75b504852
commit 6bcc25e137

View File

@@ -190,7 +190,9 @@ export const BillModalMixin = {
let mList = res.data let mList = res.data
if (value.indexOf(',') > -1) { if (value.indexOf(',') > -1) {
//多个条码 //多个条码
let mArr = this.materialTable.dataSource this.$refs.materialDataTable.getValues((error, values) => {
values.pop() //移除最后一行数据
let mArr = values
for (let i = 0; i < mList.length; i++) { for (let i = 0; i < mList.length; i++) {
let mInfo = mList[i] let mInfo = mList[i]
let mObj = this.parseInfoToObj(mInfo) let mObj = this.parseInfoToObj(mInfo)
@@ -200,11 +202,12 @@ export const BillModalMixin = {
} }
let taxLastMoneyTotal = 0 let taxLastMoneyTotal = 0
for (let j = 0; j < mArr.length; j++) { for (let j = 0; j < mArr.length; j++) {
taxLastMoneyTotal += mArr[j].taxLastMoney taxLastMoneyTotal += mArr[j].taxLastMoney-0
} }
this.materialTable.dataSource = mArr this.materialTable.dataSource = mArr
target.statisticsColumns.taxLastMoney = taxLastMoneyTotal target.statisticsColumns.taxLastMoney = taxLastMoneyTotal
that.autoChangePrice(target) that.autoChangePrice(target)
})
} else { } else {
//单个条码 //单个条码
let mArr = [] let mArr = []