过滤商品重复商品和采购单位

jg-waiwang-pro
mhsnet 6 months ago
parent 21d1710ff7
commit 539f4817f2

@ -2427,7 +2427,6 @@ export default {
}, },
watch: { watch: {
// "dataForm.contractType": function(val, oldVal) { // "dataForm.contractType": function(val, oldVal) {
// console.log(val);
// this.dataForm.subject = undefined; // this.dataForm.subject = undefined;
// this.dataForm.subject2 = undefined; // this.dataForm.subject2 = undefined;
// this.dataForm.subject3 = undefined; // this.dataForm.subject3 = undefined;
@ -2571,11 +2570,21 @@ export default {
break; break;
} }
this.dataForm.contractLCommodityList.push(item); this.dataForm.contractLCommodityList.push(item);
let filterArr = [];
this.dataForm.contractLCommodityList = this.dataForm.contractLCommodityList.filter(
val => {
if (filterArr.includes(val.commodityCode + val.procureUnit)) {
return false;
} else {
filterArr.push(val.commodityCode + val.procureUnit);
return true;
}
}
);
} }
}, },
choiceRaw() { choiceRaw() {
this.BomgoodsBoxRawVisible = true; this.BomgoodsBoxRawVisible = true;
// console.log('55555', this.dataForm.workOrderProductList)
let excludeIdList = []; let excludeIdList = [];
for (let i = 0; i < this.dataForm.contractLCommodityList.length; i++) { for (let i = 0; i < this.dataForm.contractLCommodityList.length; i++) {
excludeIdList.push(this.dataForm.contractLCommodityList[i].productId); excludeIdList.push(this.dataForm.contractLCommodityList[i].productId);
@ -2683,16 +2692,12 @@ export default {
this.dataForm.contractLCommodityList[index][ this.dataForm.contractLCommodityList[index][
"contractlcommodityprocureUnitOptions" "contractlcommodityprocureUnitOptions"
] = procureUnitOptionsArr; ] = procureUnitOptionsArr;
// console.log(procureUnitOptionsArr)
// this.contractlcommodityprocureUnitOptions = procureUnitOptionsArr
} }
}) })
.catch(() => {}); .catch(() => {});
} }
}, },
changeData(model, index) { changeData(model, index) {
console.log("changeData:");
console.log(model);
this.fnChgTotalRate(); this.fnChgTotalRate();
if (model == "contractlcommodity-productId") { if (model == "contractlcommodity-productId") {
this.getProductInfoChg(index); this.getProductInfoChg(index);
@ -2703,6 +2708,19 @@ export default {
if (model == "businessId") { if (model == "businessId") {
this.chgBusinessId(); this.chgBusinessId();
} }
if (model == "contractlcommodity-procureUnit") {
let filterArr = [];
this.dataForm.contractLCommodityList = this.dataForm.contractLCommodityList.filter(
val => {
if (filterArr.includes(val.commodityCode + val.procureUnit)) {
return false;
} else {
filterArr.push(val.commodityCode + val.procureUnit);
return true;
}
}
);
}
this.isEdit = false; this.isEdit = false;
this.childIndex = index; this.childIndex = index;
let modelAll = model.split("-"); let modelAll = model.split("-");
@ -2838,7 +2856,6 @@ export default {
}); });
return; return;
} }
console.log(e);
} }
return isOk; return isOk;
}, },

Loading…
Cancel
Save