fix:玻纤若输出物料检测时没有带的检测表,此时需要根据输出物料查询其绑定的检测表(防止中投产后加入新工序)
This commit is contained in:
parent
35235ba788
commit
acf701bf6a
|
|
@ -580,7 +580,11 @@ export default {
|
|||
if(that.mode == 'outs'&&qct!==''&&qct!==null){//输出
|
||||
that.getdefects();
|
||||
}else{
|
||||
that.getList();
|
||||
that.$API.qm.qct.getQct.req({ material: that.material_out,type:'out',tag:'process' }).then((res) => {
|
||||
console.log(res)
|
||||
that.testdefectss(res);
|
||||
})
|
||||
// that.getList();
|
||||
}
|
||||
that.visible = true;
|
||||
setTimeout(() => {
|
||||
|
|
@ -677,41 +681,45 @@ export default {
|
|||
if(that.qct!==''){
|
||||
that.$API.qm.qct.item.req(that.qct).then((res) => {
|
||||
that.qct_defects = [];
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.addTemplate[item.defect_name] = false;
|
||||
let obj = Object.assign({}, item);
|
||||
obj.canEdit = that.processType=='20'?false:true;
|
||||
that.qct_defects.push(obj);
|
||||
})
|
||||
that.qct_defects_origin = that.qct_defects;
|
||||
that.qct_testitems = [];
|
||||
res.qct_testitems.forEach((item2) => {
|
||||
if(item2.testitem_type!=='20'){
|
||||
let obj2 = Object.assign({}, item2);
|
||||
obj2.value = '';
|
||||
obj2.canEdit = that.processType=='20'?false:true;
|
||||
|
||||
obj2.addto_wpr = item2.addto_wpr;
|
||||
if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){
|
||||
obj2.value = null;
|
||||
that.addTemplate[item2.testitem_name] = null;
|
||||
}
|
||||
if(item2.testitem_field_type=='select-text'||item2.testitem_field_type=='selects-text'){
|
||||
let str = obj2.testitem_choices.replace(/'/g, '"');
|
||||
let arr = JSON.parse(str);
|
||||
obj2.testitem_choices = arr;
|
||||
that.addTemplate[item2.testitem_name] = null;
|
||||
}
|
||||
that.qct_testitems.push(obj2);
|
||||
}
|
||||
})
|
||||
that.qct_testitems_origin = that.qct_testitems;
|
||||
that.getList();
|
||||
that.testdefectss(res);
|
||||
})
|
||||
}else{
|
||||
that.getList();
|
||||
}
|
||||
},
|
||||
testdefectss(res){
|
||||
let that = this;
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.addTemplate[item.defect_name] = false;
|
||||
let obj = Object.assign({}, item);
|
||||
obj.canEdit = that.processType=='20'?false:true;
|
||||
that.qct_defects.push(obj);
|
||||
})
|
||||
that.qct_defects_origin = that.qct_defects;
|
||||
that.qct_testitems = [];
|
||||
res.qct_testitems.forEach((item2) => {
|
||||
if(item2.testitem_type!=='20'){
|
||||
let obj2 = Object.assign({}, item2);
|
||||
obj2.value = '';
|
||||
obj2.canEdit = that.processType=='20'?false:true;
|
||||
|
||||
obj2.addto_wpr = item2.addto_wpr;
|
||||
if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){
|
||||
obj2.value = null;
|
||||
that.addTemplate[item2.testitem_name] = null;
|
||||
}
|
||||
if(item2.testitem_field_type=='select-text'||item2.testitem_field_type=='selects-text'){
|
||||
let str = obj2.testitem_choices.replace(/'/g, '"');
|
||||
let arr = JSON.parse(str);
|
||||
obj2.testitem_choices = arr;
|
||||
that.addTemplate[item2.testitem_name] = null;
|
||||
}
|
||||
that.qct_testitems.push(obj2);
|
||||
}
|
||||
})
|
||||
that.qct_testitems_origin = that.qct_testitems;
|
||||
that.getList();
|
||||
},
|
||||
getOptions(){
|
||||
let that = this;
|
||||
that.$API.wpm.wpr.list.req({wm:that.wm,page:0,query:"{id,number}"}).then((res) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue