Commit 3e44ba1c authored by 张海景's avatar 张海景

update:修改工作单、开始刷新的问题

parent b554c254
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
<u-row> <u-row v-if="!feedback.isLastProcess">
<u-col span="6"> <u-col span="6">
<u-form-item label="是否打印:" prop="print"> <u-form-item label="是否打印:" prop="print">
<view class="uni-list-item__extra"> <view class="uni-list-item__extra">
...@@ -611,7 +611,6 @@ ...@@ -611,7 +611,6 @@
<!-- //查询图片生产工单 --> <!-- //查询图片生产工单 -->
<u-modal <u-modal
title="生产工单" title="生产工单"
@confirm="materialReturnSave()"
show-cancel-button show-cancel-button
:show-confirm-button="false" :show-confirm-button="false"
cancel-text="返回" cancel-text="返回"
...@@ -1148,7 +1147,7 @@ export default { ...@@ -1148,7 +1147,7 @@ export default {
} else { } else {
this.$u.api.changeCheckMachineTool({ this.$u.api.changeCheckMachineTool({
taskWorkunitId: item.taskWorkunitId taskWorkunitId: item.taskWorkunitId
}).then(res => { }).then((res) => {
// console.log(res, '刀模板') // console.log(res, '刀模板')
if (res.code === 500) { if (res.code === 500) {
this.$u.toast(res.msg) this.$u.toast(res.msg)
...@@ -1161,7 +1160,6 @@ export default { ...@@ -1161,7 +1160,6 @@ export default {
this.$u.toast('该任务已开工,请勿重复开工'); this.$u.toast('该任务已开工,请勿重复开工');
return; return;
} }
this.getTaskList();
break; break;
case 'StopTask': case 'StopTask':
this.stopCause(); this.stopCause();
...@@ -1172,7 +1170,6 @@ export default { ...@@ -1172,7 +1170,6 @@ export default {
this.tableSelectData.forEach((item) => { this.tableSelectData.forEach((item) => {
this.changeStatus(item.taskId, item.taskWorkunitId,'FINISHED',item.workunitId); this.changeStatus(item.taskId, item.taskWorkunitId,'FINISHED',item.workunitId);
}); });
this.getTaskList();
break; break;
case 'Prod': case 'Prod':
this.doFeedback(); this.doFeedback();
...@@ -1543,7 +1540,6 @@ export default { ...@@ -1543,7 +1540,6 @@ export default {
if(showToast) { if(showToast) {
this.$u.toast('变更成功'); this.$u.toast('变更成功');
} }
uni.$emit('taskStatusChanged'); //任务状态变更
this.getTaskList(); this.getTaskList();
} }
}); });
...@@ -1563,7 +1559,6 @@ export default { ...@@ -1563,7 +1559,6 @@ export default {
.then((res) => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.$u.toast('变更成功'); this.$u.toast('变更成功');
uni.$emit('taskStatusChanged'); //任务状态变更
this.getTaskList(); this.getTaskList();
} }
}); });
...@@ -2050,30 +2045,31 @@ export default { ...@@ -2050,30 +2045,31 @@ export default {
}, },
materialReturnSave() { materialReturnSave() {
const taskInfo = this.tableSelectData[0]; const taskInfo = this.tableSelectData[0];
const rst = []; const rst = this.materialReturnList.map((s) => {
const t = this; let data = {
this.materialReturnList.forEach((s) => { itemId: s.itemId,
if (s.applyNum) { taskId: taskInfo.taskId,
rst.push({ backNum: s.applyNum,
itemId: s.itemId, issueLineId: s.lineId,
taskId: taskInfo.taskId, taskWorkunitId: this.curTaskInfo.taskWorkunitId,
backNum: s.applyNum, workOrderId: s.workorderId,
issueLineId: s.lineId, batchNo: s.batchCode,
taskWorkunitId: this.curTaskInfo.taskWorkunitId, packNo: s.packNo,
workOrderId: s.workorderId, isQualified: s.isQualified,
batchNo: s.batchCode, workorderCode: this.materialReturnFormData.workorderCode,
packNo: s.packNo, }
isQualified: s.isQualified, if (this.materialReturnFormData.workorderCode) {
workorderCode: t.materialReturnFormData.workorderCode data.workorderCodes = this.materialReturnFormData.workorderCode
}); } else {
data.workorderCodes = this.curTaskInfo.workorderOption.flatMap(it => it.value).join(',')
} }
return data
}); });
if (rst.length === 0) { if (this.materialReturnList.length === 0) {
this.$u.toast('数量不存在,无法保存')
return return
} }
this.$u.api.addMaterialReturn(rst).then((res) => { this.$u.api.addMaterialReturn(rst).then((res) => {
t.materialReturnFormVisible = false; this.materialReturnFormVisible = false;
if (res.code === 200) { if (res.code === 200) {
t.$u.toast('保存成功'); t.$u.toast('保存成功');
} }
......
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