fix:清除多余请求
This commit is contained in:
parent
a49ea52d90
commit
b128751889
|
@ -600,9 +600,9 @@ export default {
|
|||
that.isSubmit = res.submit_time==null?false:true;
|
||||
if(that.processType=='10'&&that.mlogItem.material_out_&&that.mlogItem.material_out_.tracking==20){
|
||||
that.getMlogbw();
|
||||
if(that.mlogItem.qct!==null){
|
||||
that.getdefects(that.mlogItem.qct);
|
||||
}
|
||||
// if(that.mlogItem.qct!==null){
|
||||
// that.getdefects(that.mlogItem.qct);
|
||||
// }
|
||||
}
|
||||
if(res.route!==null){
|
||||
that.hasRoute = true;
|
||||
|
@ -649,51 +649,51 @@ export default {
|
|||
that.shiftOtions = res;
|
||||
});
|
||||
},
|
||||
getdefects(qct){
|
||||
let that = this;
|
||||
if(qct!==''&&qct!==null){//输出
|
||||
that.$API.qm.qct.item.req(qct).then((res) => {
|
||||
that.qct_defects = [];
|
||||
that.testdefectss(res);
|
||||
})
|
||||
}else{
|
||||
that.$API.qm.qct.getQct.req({ material: that.mlogItem.material_out,type:'out',tag:'process' }).then((res) => {
|
||||
that.testdefectss(res);
|
||||
}).catch(()=>{
|
||||
// that.getList();
|
||||
})
|
||||
}
|
||||
},
|
||||
testdefectss(res){
|
||||
let that = this;
|
||||
res.qct_defects.forEach((item) => {
|
||||
that.addTemplate[item.defect_name] = false;
|
||||
let obj = Object.assign({}, item);
|
||||
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.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();
|
||||
},
|
||||
// getdefects(qct){
|
||||
// let that = this;
|
||||
// if(qct!==''&&qct!==null){//输出
|
||||
// that.$API.qm.qct.item.req(qct).then((res) => {
|
||||
// that.qct_defects = [];
|
||||
// that.testdefectss(res);
|
||||
// })
|
||||
// }else{
|
||||
// that.$API.qm.qct.getQct.req({ material: that.mlogItem.material_out,type:'out',tag:'process' }).then((res) => {
|
||||
// that.testdefectss(res);
|
||||
// }).catch(()=>{
|
||||
// // that.getList();
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// testdefectss(res){
|
||||
// let that = this;
|
||||
// res.qct_defects.forEach((item) => {
|
||||
// that.addTemplate[item.defect_name] = false;
|
||||
// let obj = Object.assign({}, item);
|
||||
// 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.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();
|
||||
// },
|
||||
//获取生产工序的mlogbw
|
||||
getMlogbw(){
|
||||
let that = this;
|
||||
|
|
Loading…
Reference in New Issue