feat:wpr工装调整放到pre_info中,以及日志中把工装tooling保存到mlobw中
This commit is contained in:
parent
c7d79b12df
commit
27c8dd3139
|
|
@ -47,6 +47,7 @@
|
|||
<th class="w_140 sticky-cell sticky-left-number">物料编号</th>
|
||||
<th class="w_150" v-if="route_code=='niuzhuan'">生产设备</th>
|
||||
<th class="w_180" v-if="route_code=='niuzhuan'">扭转日期</th>
|
||||
<th class="w_150" v-if="mgroupName=='喷码'">工装</th>
|
||||
<th class="w_80" v-for="item in qct_testitems" :key="item.id">{{ item.testitem_name }}</th>
|
||||
<th class="w_80" v-for="item in qct_defects" :key="item.id">{{ item.defect_name }}</th>
|
||||
<th class="w_80">备注</th>
|
||||
|
|
@ -83,6 +84,14 @@
|
|||
<div v-else>
|
||||
<span v-if="row.work_start_time!==null">{{ row.work_start_time}}</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="w_150 " v-if="mgroupName=='喷码'">
|
||||
<select name="tooling" id="tooling-select" v-if="row.isEdit" style="width: 100%;" v-model="row.tooling" :value="row.tooling">
|
||||
<option v-for="item in optionsTooling" :key="item.id" :value="item.id">
|
||||
{{ item.name }}
|
||||
</option>
|
||||
</select>
|
||||
<span v-else>{{ getToolingName(row.wpr_pre_info?.tooling) || row.tooling_name }}</span>
|
||||
</td>
|
||||
<td class="w_80 " v-for="item in qct_testitems" :key="item.id">
|
||||
<span v-if="!row.isEdit || !item.canEdit">{{ row[item.testitem_name] }}</span>
|
||||
|
|
@ -432,6 +441,7 @@ export default {
|
|||
|
||||
},
|
||||
optionsEq:[],
|
||||
optionsTooling:[],
|
||||
defectlists:[],
|
||||
testitemlists:[],
|
||||
selectWprList:[],
|
||||
|
|
@ -460,6 +470,9 @@ export default {
|
|||
if(that.route_code=='niuzhuan'){
|
||||
that.getEquipment4();
|
||||
}
|
||||
if(that.mgroupName=='喷码'){
|
||||
that.getToolings();
|
||||
}
|
||||
if(that.qct!==''&&that.qct!==null){//输出
|
||||
that.getdefects();
|
||||
}else{
|
||||
|
|
@ -551,6 +564,31 @@ export default {
|
|||
that.optionsEq = res.reverse();
|
||||
})
|
||||
},
|
||||
getToolings() {
|
||||
let that = this;
|
||||
that.$API.em.equipment.list.req({page:0,type:10,cate__code:"7",query:"{id,name,number}"}).then((res) => {
|
||||
that.optionsTooling = Array.isArray(res) ? res : (res.results || []);
|
||||
})
|
||||
},
|
||||
getToolingName(id) {
|
||||
if (!id) return '';
|
||||
const item = this.optionsTooling.find(t => t.id == id);
|
||||
return item ? item.name : id;
|
||||
},
|
||||
autoSyncTooling() {
|
||||
const that = this;
|
||||
if (that.mgroupName !== '喷码') return;
|
||||
that.mlogbwlist.forEach((row) => {
|
||||
const wprTooling = row.wpr_pre_info?.tooling;
|
||||
if (wprTooling && row.tooling != wprTooling && row.id) {
|
||||
that.$API.wpm.mlogbw.update.req(row.id, { tooling: wprTooling,number:row.number,mlogb:row.mlogb }).then((res) => {
|
||||
row.tooling = res.tooling;
|
||||
row.tooling_name = res.tooling_name;
|
||||
row.tooling_number = res.tooling_number;
|
||||
}).catch(() => {});
|
||||
}
|
||||
});
|
||||
},
|
||||
getEquipments(){
|
||||
let that = this;
|
||||
that.$API.em.equipment.list.req({page:0,cate__code:"6"}).then((res) => {
|
||||
|
|
@ -690,6 +728,9 @@ export default {
|
|||
that.mlogbwlist.push(obj);
|
||||
})
|
||||
}
|
||||
that.$nextTick(() => {
|
||||
that.autoSyncTooling();
|
||||
});
|
||||
})
|
||||
},
|
||||
widthFun(item){
|
||||
|
|
@ -719,6 +760,9 @@ export default {
|
|||
if(row.equip){
|
||||
obj.equip = row.equip;
|
||||
}
|
||||
if(row.tooling){
|
||||
obj.tooling = row.tooling;
|
||||
}
|
||||
//qct不为空,有检验表
|
||||
if((that.qct!==''&&that.qct!==null)||(that.qctId!==''&&that.qctId!==null)){
|
||||
obj.ftest = {};
|
||||
|
|
@ -762,6 +806,8 @@ export default {
|
|||
that.mlogbwlist[editIndex].isEdit = false;
|
||||
that.mlogbwlist[editIndex].equip_name = res.equip_name;
|
||||
that.mlogbwlist[editIndex].equip_number = res.equip_number;
|
||||
that.mlogbwlist[editIndex].tooling_name = res.tooling_name;
|
||||
that.mlogbwlist[editIndex].tooling_number = res.tooling_number;
|
||||
that.mlogbwlist[editIndex].work_start_time = res.work_start_time;
|
||||
// that.getList();
|
||||
return res;
|
||||
|
|
@ -778,6 +824,8 @@ export default {
|
|||
that.mlogbwlist[editIndex].isEdit = false;
|
||||
that.mlogbwlist[editIndex].equip_name = res.equip_name;
|
||||
that.mlogbwlist[editIndex].equip_number = res.equip_number;
|
||||
that.mlogbwlist[editIndex].tooling_name = res.tooling_name;
|
||||
that.mlogbwlist[editIndex].tooling_number = res.tooling_number;
|
||||
that.mlogbwlist[editIndex].work_start_time = res.work_start_time;
|
||||
// that.getList();
|
||||
return res;
|
||||
|
|
@ -796,6 +844,12 @@ export default {
|
|||
formTableEdit(index) {
|
||||
let that = this;
|
||||
that.mlogbwlist[index].isEdit = true;
|
||||
if(that.mgroupName=='喷码'){
|
||||
const wprTooling = that.mlogbwlist[index].wpr_pre_info?.tooling;
|
||||
if(wprTooling && that.mlogbwlist[index].tooling != wprTooling){
|
||||
that.mlogbwlist[index].tooling = wprTooling;
|
||||
}
|
||||
}
|
||||
let date = new Date();
|
||||
if(that.mlogbwlist[index].work_start_time==''||that.mlogbwlist[index].work_start_time==null){
|
||||
that.mlogbwlist[index].work_start_time = that.$TOOL.dateFormat(date, 'yyyy-MM-dd hh:mm:ss');
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@
|
|||
<el-table-column label="工装" min-width="80px" v-if="mgroupName=='喷码'">
|
||||
<template #default="scope">
|
||||
<el-select
|
||||
v-model="scope.row.pre_info.val"
|
||||
v-model="scope.row.pre_info.tooling"
|
||||
placeholder="选择工装"
|
||||
clearable
|
||||
size="small"
|
||||
|
|
@ -205,7 +205,10 @@ export default {
|
|||
getRowWpr(){
|
||||
let that = this;
|
||||
that.$API.wpm.wpr.list.req(that.params).then((res) => {
|
||||
that.wprList = res;
|
||||
that.wprList = (Array.isArray(res) ? res : []).map(row => ({
|
||||
...row,
|
||||
pre_info: row.pre_info || {},
|
||||
}));
|
||||
})
|
||||
},
|
||||
getToolingOptions(){
|
||||
|
|
@ -216,7 +219,7 @@ export default {
|
|||
},
|
||||
handleToolingChange(row){
|
||||
let that = this;
|
||||
that.$API.wpm.wpr.update.req(row.id,{pre_info:{val:row.pre_info.val,name:"工装"}}).then(() => {
|
||||
that.$API.wpm.wpr.update.req(row.id,{pre_info:{tooling:row.pre_info.tooling}}).then(() => {
|
||||
that.$message.success("工装更新成功");
|
||||
});
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue