支持选择多商品(优化)
This commit is contained in:
@@ -185,63 +185,34 @@ export const BillModalMixin = {
|
|||||||
mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
|
mpList: getMpListShort(Vue.ls.get('materialPropertyList')), //扩展属性
|
||||||
prefixNo: this.prefixNo
|
prefixNo: this.prefixNo
|
||||||
}
|
}
|
||||||
if(value.indexOf(',')>-1) {
|
getMaterialByBarCode(param).then((res) => {
|
||||||
//多个条码
|
if (res && res.code === 200) {
|
||||||
getMaterialByBarCode(param).then((res) => {
|
let mList = res.data
|
||||||
if (res && res.code === 200) {
|
if (value.indexOf(',') > -1) {
|
||||||
let mList = res.data
|
//多个条码
|
||||||
let mArr = []
|
let mArr = this.materialTable.dataSource
|
||||||
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 = {
|
let mObj = this.parseInfoToObj(mInfo)
|
||||||
depotId: mInfo.depotId,
|
mObj.depotId = mInfo.depotId
|
||||||
barCode: mInfo.mBarCode,
|
mObj.stock = mInfo.stock
|
||||||
name: mInfo.name,
|
mArr.push(mObj)
|
||||||
standard: mInfo.standard,
|
|
||||||
model: mInfo.model,
|
|
||||||
materialOther: mInfo.materialOther,
|
|
||||||
stock: mInfo.stock,
|
|
||||||
unit: mInfo.commodityUnit,
|
|
||||||
sku: mInfo.sku,
|
|
||||||
operNumber: 1,
|
|
||||||
unitPrice: mInfo.billPrice,
|
|
||||||
taxUnitPrice: mInfo.billPrice,
|
|
||||||
allPrice: mInfo.billPrice,
|
|
||||||
taxRate: 0,
|
|
||||||
taxMoney: 0,
|
|
||||||
taxLastMoney: mInfo.billPrice
|
|
||||||
}
|
|
||||||
mArr.push(mObj)
|
|
||||||
}
|
|
||||||
this.materialTable.dataSource = mArr
|
|
||||||
}
|
}
|
||||||
});
|
let taxLastMoneyTotal = 0
|
||||||
} else {
|
for (let j = 0; j < mArr.length; j++) {
|
||||||
//单个条码
|
taxLastMoneyTotal += mArr[j].taxLastMoney
|
||||||
getMaterialByBarCode(param).then((res) => {
|
}
|
||||||
if (res && res.code === 200) {
|
this.materialTable.dataSource = mArr
|
||||||
let mList = res.data
|
target.statisticsColumns.taxLastMoney = taxLastMoneyTotal
|
||||||
|
that.autoChangePrice(target)
|
||||||
|
} else {
|
||||||
|
//单个条码
|
||||||
let mArr = []
|
let mArr = []
|
||||||
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 = {
|
let mObj = {
|
||||||
rowKey: row.id,
|
rowKey: row.id,
|
||||||
values: {
|
values: this.parseInfoToObj(mInfo)
|
||||||
barCode: mInfo.mBarCode,
|
|
||||||
name: mInfo.name,
|
|
||||||
standard: mInfo.standard,
|
|
||||||
model: mInfo.model,
|
|
||||||
materialOther: mInfo.materialOther,
|
|
||||||
unit: mInfo.commodityUnit,
|
|
||||||
sku: mInfo.sku,
|
|
||||||
operNumber: 1,
|
|
||||||
unitPrice: mInfo.billPrice,
|
|
||||||
taxUnitPrice: mInfo.billPrice,
|
|
||||||
allPrice: mInfo.billPrice,
|
|
||||||
taxRate: 0,
|
|
||||||
taxMoney: 0,
|
|
||||||
taxLastMoney: mInfo.billPrice
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
mArr.push(mObj)
|
mArr.push(mObj)
|
||||||
}
|
}
|
||||||
@@ -250,8 +221,8 @@ export const BillModalMixin = {
|
|||||||
target.recalcAllStatisticsColumns()
|
target.recalcAllStatisticsColumns()
|
||||||
that.autoChangePrice(target)
|
that.autoChangePrice(target)
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
break;
|
break;
|
||||||
case "operNumber":
|
case "operNumber":
|
||||||
operNumber = value-0
|
operNumber = value-0
|
||||||
@@ -315,6 +286,25 @@ export const BillModalMixin = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//转为商品对象
|
||||||
|
parseInfoToObj(mInfo) {
|
||||||
|
return {
|
||||||
|
barCode: mInfo.mBarCode,
|
||||||
|
name: mInfo.name,
|
||||||
|
standard: mInfo.standard,
|
||||||
|
model: mInfo.model,
|
||||||
|
materialOther: mInfo.materialOther,
|
||||||
|
unit: mInfo.commodityUnit,
|
||||||
|
sku: mInfo.sku,
|
||||||
|
operNumber: 1,
|
||||||
|
unitPrice: mInfo.billPrice,
|
||||||
|
taxUnitPrice: mInfo.billPrice,
|
||||||
|
allPrice: mInfo.billPrice,
|
||||||
|
taxRate: 0,
|
||||||
|
taxMoney: 0,
|
||||||
|
taxLastMoney: mInfo.billPrice
|
||||||
|
}
|
||||||
|
},
|
||||||
//删除一行或多行的时候触发
|
//删除一行或多行的时候触发
|
||||||
onDeleted(ids, target) {
|
onDeleted(ids, target) {
|
||||||
target.recalcAllStatisticsColumns()
|
target.recalcAllStatisticsColumns()
|
||||||
|
|||||||
Reference in New Issue
Block a user