Commit b237daa6 authored by chenzj's avatar chenzj

领料生产修复bug

parent d1029e67
...@@ -2076,7 +2076,12 @@ export default { ...@@ -2076,7 +2076,12 @@ export default {
}); });
this.$u.api.listMaterialRequest({ taskId: taskInfo.taskId }).then((res) => { this.$u.api.listMaterialRequest({ taskId: taskInfo.taskId }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.materialRequestList = res.data; this.materialRequestList = res.data.map(item => {
return {
...item,
workorderCode: this.curTaskInfo.workorderCode
}
})
this.materialRequestArrays = this.materialRequestList.concat([]); this.materialRequestArrays = this.materialRequestList.concat([]);
} }
}); });
...@@ -2099,8 +2104,8 @@ export default { ...@@ -2099,8 +2104,8 @@ export default {
const rst = []; const rst = [];
const taskInfo = this.tableSelectData[0]; const taskInfo = this.tableSelectData[0];
const t = this; const t = this;
const items = this.curTaskInfo.workorderOption.find((item) => item.text === this.curTaskInfo.workorderCode); // const items = this.curTaskInfo.workorderOption.find((item) => item.value === this.curTaskInfo.workorderCode);
console.log(this.curTaskInfo.workorderOption, this.curTaskInfo.workorderCode, items); // console.log(this.curTaskInfo.workorderOption, this.curTaskInfo.workorderCode);
this.materialRequestArrays.forEach((s) => { this.materialRequestArrays.forEach((s) => {
if (s.applyNum != null) { if (s.applyNum != null) {
rst.push({ rst.push({
...@@ -2109,7 +2114,7 @@ export default { ...@@ -2109,7 +2114,7 @@ export default {
workunitCode: this.curTaskInfo.workunitCode, workunitCode: this.curTaskInfo.workunitCode,
workunitName: this.curTaskInfo.workunitName, workunitName: this.curTaskInfo.workunitName,
taskWorkunitId: this.curTaskInfo.taskWorkunitId, taskWorkunitId: this.curTaskInfo.taskWorkunitId,
workorderCode: items?.text, workorderCode: s.workorderCode,
taskId: taskInfo.taskId, taskId: taskInfo.taskId,
applyNum: s.applyNum, applyNum: s.applyNum,
applyType: 1 applyType: 1
...@@ -2161,9 +2166,17 @@ export default { ...@@ -2161,9 +2166,17 @@ export default {
if (!id) { if (!id) {
this.materialRequestArrays = this.materialRequestList.concat([]); this.materialRequestArrays = this.materialRequestList.concat([]);
} else { } else {
const items = this.curTaskInfo.workorderOption.find((item) => item.value === this.curTaskInfo.workorderCode);
console.log(items)
this.$u.api.getWproworkOrderProcessItem({ workorderId: id, processId: this.curTaskInfo.processId }).then((res) => { this.$u.api.getWproworkOrderProcessItem({ workorderId: id, processId: this.curTaskInfo.processId }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.materialRequestArrays = this.materialRequestList.concat(res.rows); const list = res.rows.map(item=> {
return {
...item,
workorderCode: items.text
}
})
this.materialRequestArrays = this.materialRequestList.concat(list);
} }
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment