问题修改

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

@ -73,7 +73,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="unitPrice" label="单价"> </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-column>
</el-table> </el-table>
</el-form> </el-form>

Loading…
Cancel
Save