功能优化
This commit is contained in:
@@ -445,6 +445,7 @@
|
||||
<el-button type="primary" icon="el-icon-arrow-left" size="mini" @click="getPrevious_current_workorder">上一个工单</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<el-button type="success" size="medium" @click="setWorkOrderStartTime">同步开始时间</el-button>
|
||||
<el-button type="primary" size="medium" @click="workOrderCompleted">本工单完成</el-button>
|
||||
<table>
|
||||
<tr>
|
||||
@@ -769,14 +770,41 @@
|
||||
},
|
||||
//todo 工单完成
|
||||
workOrderCompleted() {
|
||||
const oldWorkorderId = this.CurrentWorkorder.clientWorkorder;
|
||||
this.$modal.confirm('是否确认完成本工单?').then(() => {
|
||||
this.getNext_current_workorder()
|
||||
|
||||
this.$confirm('是否确认完成本工单?', '操作提示', { type: 'warning', closeOnClickModal: false }).then(() => {
|
||||
this.getNext_current_workorder(false);
|
||||
|
||||
}).catch(() => {
|
||||
this.$message.info("操作取消");
|
||||
})
|
||||
},
|
||||
// 设置工单开始时间
|
||||
setWorkOrderStartTime() {
|
||||
const workorderId = this.CurrentWorkorder.clientWorkorder;
|
||||
writeProcessFlow_first({ workorderID: workorderId, time: new Date() });
|
||||
const data = {
|
||||
workOrderId: workorderId
|
||||
}
|
||||
GetQcQualityStatisticsFirstStartTime(data).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.workOrderStartTime = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
//todo 获取下一个工单号
|
||||
getNext_current_workorder() {
|
||||
getNext_current_workorder(check = true) {
|
||||
if (!this.checkHasStartTime() && check) {
|
||||
this.$confirm("当前工单未点击本工单完成,无工单开始时间,是否进入下一个工单?", '操作提示', { type: 'warning', closeOnClickModal: false }).then(() => {
|
||||
this.getNextWorkOrder();
|
||||
}).catch(() => {
|
||||
this.$message.info("操作取消");
|
||||
})
|
||||
} else {
|
||||
this.getNextWorkOrder();
|
||||
}
|
||||
},
|
||||
getNextWorkOrder() {
|
||||
const oldWorkorderId = this.CurrentWorkorder.clientWorkorder;
|
||||
get_next_current_workorder()
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
@@ -810,10 +838,9 @@
|
||||
|
||||
this.team = result.data.team
|
||||
this.publishNowOrderRetain(this.CurrentWorkorder.clientWorkorder)
|
||||
this.setWorkOrderStartTime();
|
||||
this.$loading().close()
|
||||
}
|
||||
|
||||
return writeProcessFlow_first({ workorderID: this.CurrentWorkorder.clientWorkorder, time: new Date() });
|
||||
})
|
||||
},
|
||||
//todo 获取上一个工单号
|
||||
@@ -852,6 +879,15 @@
|
||||
})
|
||||
},
|
||||
|
||||
//TODO 检查===
|
||||
//1.非完成切换工单时检查是否含有开始时间
|
||||
checkHasStartTime() {
|
||||
if (this.workOrderStartTime === "" || this.workOrderStartTime === "工单无开始时间!") {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
//todo 累加器 这里是值传递还是引用传递??????????????????????????????
|
||||
Accumulator(item, type, index) {
|
||||
let query = {}
|
||||
@@ -1146,6 +1182,8 @@
|
||||
|
||||
::v-deep .el-button {
|
||||
float: right;
|
||||
margin-bottom: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -455,7 +455,9 @@
|
||||
<el-button type="primary" icon="el-icon-arrow-left" size="mini" @click="getPrevious_current_workorder">上一个工单</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<el-button type="primary" size="medium" @click="workOrderCompleted">本工单完成</el-button>
|
||||
<div style="height: 40px;">
|
||||
<el-button type="primary" size="medium" @click="workOrderCompleted">本工单完成</el-button>
|
||||
</div>
|
||||
<table>
|
||||
<tr>
|
||||
<td>产品描述</td>
|
||||
@@ -574,7 +576,7 @@
|
||||
created() {
|
||||
this.initMqtt();
|
||||
this.getcurrentWorkorder()
|
||||
|
||||
|
||||
// this.startTimer()
|
||||
},
|
||||
mounted() {},
|
||||
@@ -776,39 +778,50 @@
|
||||
this.$modal
|
||||
.confirm('是否确认完成本工单?')
|
||||
.then(() => {
|
||||
this.getNext_current_workorder()
|
||||
|
||||
this.$notify.success(`已完成工单${saveWorkorderInfo.clientWorkorder},即将跳转下一个工单`);
|
||||
//todo 更改这个工单状态为2
|
||||
return update_workorder_status({ workorderID: saveWorkorderInfo.clientWorkorder })
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$notify.success('工单完成')
|
||||
//todo 生成质量统计表 !!!!需要工单和班组
|
||||
let query = {
|
||||
workorderID: saveWorkorderInfo.clientWorkorder,
|
||||
team: saveWorkorderInfo.team,
|
||||
firstquality_time: this.$store.state.quality.firstquality_time,
|
||||
}
|
||||
return generateQualityStatisticsTable(query)
|
||||
this.getNext_current_workorder().then(() => {
|
||||
setTimeout(() => {
|
||||
update_workorder_status({ workorderID: saveWorkorderInfo.clientWorkorder })
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$notify.success(`工单${saveWorkorderInfo.clientWorkorder},开始生成相关数据……`)
|
||||
//todo 生成质量统计表 !!!!需要工单和班组
|
||||
let query = {
|
||||
workorderID: saveWorkorderInfo.clientWorkorder,
|
||||
team: saveWorkorderInfo.team,
|
||||
firstquality_time: this.$store.state.quality.firstquality_time,
|
||||
}
|
||||
return generateQualityStatisticsTable(query)
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$notify.success(`工单${saveWorkorderInfo.clientWorkorder}质量统计表生成成功`)
|
||||
}
|
||||
// 入库检验数据转换
|
||||
const quest = { workorder: saveWorkorderInfo.clientWorkorder }
|
||||
return convertToIncomingInspectionData(quest)
|
||||
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$notify.success('质量统计表生成成功')
|
||||
}
|
||||
// 入库检验数据转换
|
||||
const quest = { workorder: saveWorkorderInfo.clientWorkorder }
|
||||
return convertToIncomingInspectionData(quest)
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$notify.success(`工单${saveWorkorderInfo.clientWorkorder}生成入库检验数量为${res.data}`);
|
||||
}
|
||||
})
|
||||
}, 500);
|
||||
setTimeout(() => {
|
||||
location.reload();
|
||||
}, 2000);
|
||||
})
|
||||
|
||||
}).catch(() => {
|
||||
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$notify.success("生成入库检验数量为" + res.data);
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
//todo 获取下一个工单号
|
||||
getNext_current_workorder() {
|
||||
get_next_current_workorder()
|
||||
return get_next_current_workorder()
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
if (res.data != null) {
|
||||
@@ -819,11 +832,11 @@
|
||||
this.publishOrderChange();
|
||||
return GetcheckItemTable({ workorderID: this.CurrentWorkorder.clientWorkorder })
|
||||
} else {
|
||||
this.$notify.warning('已经是最后一个工单,没有工单了')
|
||||
this.$notify.warning('当前为列表最后工单,请刷新尝试获取最新工单!');
|
||||
return null;
|
||||
}
|
||||
} else if (res.code == 210) {
|
||||
this.$notify.warning('已经是最后一个工单,没有工单了')
|
||||
this.$notify.warning('当前无更多数据,请刷新尝试获取最新工单!');
|
||||
return null;
|
||||
}
|
||||
})
|
||||
@@ -833,17 +846,12 @@
|
||||
}
|
||||
if (result.code == 200) {
|
||||
this.paint = result.data.paint
|
||||
|
||||
this.device = result.data.device
|
||||
|
||||
this.blank = result.data.blank
|
||||
|
||||
this.program = result.data.program
|
||||
|
||||
this.team = result.data.team
|
||||
this.$loading().close()
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
//todo 获取上一个工单号
|
||||
@@ -858,11 +866,11 @@
|
||||
this.publishOrderChange();
|
||||
return GetcheckItemTable({ workorderID: this.CurrentWorkorder.clientWorkorder })
|
||||
} else {
|
||||
this.$notify.warning('没有生产工单')
|
||||
this.$notify.warning('当前为列表第一个工单,请刷新尝试获取最新工单!')
|
||||
return null;
|
||||
}
|
||||
} else if (res.code == 210) {
|
||||
this.$notify.warning('没有生产工单')
|
||||
this.$notify.warning('当前为列表第一个工单,请刷新尝试获取最新工单!')
|
||||
return null;
|
||||
}
|
||||
})
|
||||
@@ -1134,7 +1142,7 @@
|
||||
this.$nextTick(() => {
|
||||
this.$refs.elImageRef.clickHandler();
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
},
|
||||
// 退出后关闭计时器
|
||||
@@ -1143,7 +1151,7 @@
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user