问题修改

master
zhangdi 2 days ago
parent 4c20de2d4a
commit 8309a2e0c6
  1. 52
      src/views/firstOrder/components/outDialog.vue
  2. 2
      src/views/secondOrder/components/inDialog.vue

@ -580,7 +580,7 @@ export default {
item.materialCode === stat.materialCode &&
item.materialName === stat.materialName
);
console.log(898989,detailList)
console.log(898989, detailList);
detail.theOutboundQuantity = detailList.reduce(
(acc, cur) => acc + cur.num,
0
@ -601,6 +601,7 @@ export default {
});
},
changeDepartment() {
this.getStatistics();
},
batchclose() {
@ -767,7 +768,7 @@ export default {
);
const deptName = selectedDept ? selectedDept.department : "";
// this.sizeForm.inTableData = res.data.result.map((item) => ({
// this.sizeForm.inTableData = res.data.result.map((item) => ({
// ...item,
// IdDemandEndld: this.inBatchForm.batchType,
// department: deptName,
@ -778,13 +779,13 @@ export default {
const appQty = Number(item.applicationQuantity || 0);
const outQty = Number(item.outboundQuantity || 0);
const defaultQty = appQty - outQty;
return {
...item,
IdDemandEndld: this.inBatchForm.batchType,
department: deptName, // IDsubmit
// department: deptName, // IDsubmit
// 0
theOutboundQuantity: defaultQty > 0 ? defaultQty : 0
theOutboundQuantity: defaultQty > 0 ? defaultQty : 0,
};
});
this.sizeForm.inTableData = processedData;
@ -914,26 +915,27 @@ export default {
this.sizeForm.status = index;
this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData;
let arr = this.list.find(
(item) => item.departmentId === this.inBatchForm.department || {}
(item) => item.departmentId === this.inBatchForm.department
);
this.sizeForm.ldOneOutStorageDetailVOList = this.sizeForm.inTableData.map(
(row) => {
const deptId = row.department;
const dept = this.list.find((item) => item.departmentId === deptId);
let select = this.materials.find(
let select = this.statisticsList.find(
(item) => item.materialId === row.materialId
);
const oneFormId = (this.sizeForm.options === 1&&this.outDialogTiltle == "编辑")? row.oneFormId:row.id;
console.log(99999,select)
const oneFormId =
this.sizeForm.options === 1 && this.outDialogTiltle == "编辑"
? row.oneFormId
: select.id;
return {
...row,
department:
this.sizeForm.options == "1" ? arr.departmentId : deptId,
departmentName:
this.sizeForm.options == "1" ? arr.department : dept.department,
department: deptId,
departmentName: dept.department,
oneFormId: oneFormId,
};
}
@ -941,10 +943,13 @@ export default {
if (this.outDialogTiltle == "编辑") {
this.sizeForm.id = this.id;
}
if (this.sizeForm.options === 1) {
if (this.sizeForm.options == 1) {
this.sizeForm.optionType = this.inBatchForm.optionType;
}
try {
console.log(this.sizeForm, "提交数据");
this.saveLoading = true;
const res = await submitData(this.sizeForm);
if (res.data.success) {
@ -980,7 +985,7 @@ export default {
this.sizeForm.options = Number(ldOneOutStorage.options);
this.sizeForm.optionType = ldOneOutStorage.optionType;
this.batchSelectionVisible = false;
this.inBatchForm.optionType = ldOneOutStorage.optionType
if (this.sizeForm.options == 2 && this.sizeForm.optionType == "YH") {
this.getMaterialList();
}
@ -999,16 +1004,16 @@ export default {
this.consumableVisible = false;
this.inBatchDialogVisible = false;
this.batchSelectionVisible = false;
this.sizeForm.optionType = "";
this.batchTableData = [];
this.inBatchForm.batchType = ""
this.inBatchForm.department = ""
this.sizeForm.demandEndInfo = ''
// this.inBatchForm.batchType = ""
// this.inBatchForm.department = ""
this.sizeForm.demandEndInfo = "";
if (this.sizeForm.options === 1) {
this.getQuarterList();
this.inBatchDialogVisible = true;
(this.inBatchForm.batchType = ""), (this.inBatchForm.department = "");
this.inBatchForm.optionType = "";
this.inBatchForm.optionType = "";
}
},
@ -1016,6 +1021,7 @@ export default {
handleDelete(index, row) {
this.sizeForm.inTableData.splice(index, 1);
this.$message.success("已成功删除该条记录");
this.getStatistics();
},
},
watch: {

@ -73,7 +73,7 @@
</el-table-column>
<el-table-column prop="unitPrice" label="单价"> </el-table-column>
<el-table-column prop="demandDepartment" label="需求部门">
<el-table-column prop="demandDepartmentName" label="需求部门">
</el-table-column>
</el-table>
</el-form>

Loading…
Cancel
Save