库存问题修改

master
zhangdi 2 weeks ago
parent beb09ad270
commit 701a54e4b6
  1. 32
      src/views/firstOrder/components/outDialog.vue

@ -563,7 +563,11 @@ export default {
}
},
getStatistics() {
getStatistics(this.sizeForm.inTableData).then((res) => {
let arr = JSON.parse(JSON.stringify(this.sizeForm.inTableData));
arr.forEach((row) => {
row.id = row.oneFormId;
});
getStatistics(arr).then((res) => {
this.statisticsList = res.data.result;
this.statisticsList = this.statisticsList.map((stat) => {
const detail = this.sizeForm.inTableData.find(
@ -580,8 +584,9 @@ export default {
item.materialCode === stat.materialCode &&
item.materialName === stat.materialName
);
console.log(8989898989,detailList)
detail.theOutboundQuantity = detailList.reduce(
(acc, cur) => acc + cur.num,
(acc, cur) => acc + cur.theOutboundQuantity,
0
);
}
@ -600,7 +605,6 @@ export default {
});
},
changeDepartment() {
this.getStatistics();
},
batchclose() {
@ -917,14 +921,15 @@ export default {
}
}
}
if(this.sizeForm.options==2 ){
console.log(898989,'易耗是否选择部门!')
const invalidRow = this.sizeForm.inTableData.find(row => !row.department);
if (this.sizeForm.options == 2) {
console.log(898989, "易耗是否选择部门!");
const invalidRow = this.sizeForm.inTableData.find(
(row) => !row.department
);
if (invalidRow) {
this.$message.error("存在未选择部门的物资,请补充完整");
return;
}
}
// status == 1 2
this.sizeForm.status = index;
@ -941,11 +946,8 @@ export default {
let select = this.sizeForm.inTableData.find(
(item) => item.materialId === row.materialId
);
console.log(99999,select,this.sizeForm.inTableData)
const oneFormId =
this.sizeForm.options === 1 && this.outDialogTiltle == "编辑"
? row.oneFormId
: select.id;
console.log(99999, select, this.sizeForm.inTableData);
const oneFormId = row.oneFormId
return {
...row,
@ -1001,13 +1003,11 @@ export default {
this.sizeForm.options = Number(ldOneOutStorage.options);
this.sizeForm.optionType = ldOneOutStorage.optionType;
this.batchSelectionVisible = false;
this.inBatchForm.optionType = ldOneOutStorage.optionType
this.inBatchForm.optionType = ldOneOutStorage.optionType;
if (this.sizeForm.options == 2 && this.sizeForm.optionType == "YH") {
this.getMaterialList();
}
this.sizeForm.inTableData.forEach((row) => {
row.id = row.oneFormId;
});
this.$set(this.sizeForm, "inTableData", ldOneOutStorageDetails);
this.getStatistics();
});

Loading…
Cancel
Save