fix:清除多余请求

This commit is contained in:
shijing 2025-09-17 09:25:14 +08:00
parent a49ea52d90
commit b128751889
1 changed files with 48 additions and 48 deletions

View File

@ -600,9 +600,9 @@ export default {
that.isSubmit = res.submit_time==null?false:true; that.isSubmit = res.submit_time==null?false:true;
if(that.processType=='10'&&that.mlogItem.material_out_&&that.mlogItem.material_out_.tracking==20){ if(that.processType=='10'&&that.mlogItem.material_out_&&that.mlogItem.material_out_.tracking==20){
that.getMlogbw(); that.getMlogbw();
if(that.mlogItem.qct!==null){ // if(that.mlogItem.qct!==null){
that.getdefects(that.mlogItem.qct); // that.getdefects(that.mlogItem.qct);
} // }
} }
if(res.route!==null){ if(res.route!==null){
that.hasRoute = true; that.hasRoute = true;
@ -649,51 +649,51 @@ export default {
that.shiftOtions = res; that.shiftOtions = res;
}); });
}, },
getdefects(qct){ // getdefects(qct){
let that = this; // let that = this;
if(qct!==''&&qct!==null){// // if(qct!==''&&qct!==null){//
that.$API.qm.qct.item.req(qct).then((res) => { // that.$API.qm.qct.item.req(qct).then((res) => {
that.qct_defects = []; // that.qct_defects = [];
that.testdefectss(res); // that.testdefectss(res);
}) // })
}else{ // }else{
that.$API.qm.qct.getQct.req({ material: that.mlogItem.material_out,type:'out',tag:'process' }).then((res) => { // that.$API.qm.qct.getQct.req({ material: that.mlogItem.material_out,type:'out',tag:'process' }).then((res) => {
that.testdefectss(res); // that.testdefectss(res);
}).catch(()=>{ // }).catch(()=>{
// that.getList(); // // that.getList();
}) // })
} // }
}, // },
testdefectss(res){ // testdefectss(res){
let that = this; // let that = this;
res.qct_defects.forEach((item) => { // res.qct_defects.forEach((item) => {
that.addTemplate[item.defect_name] = false; // that.addTemplate[item.defect_name] = false;
let obj = Object.assign({}, item); // let obj = Object.assign({}, item);
that.qct_defects.push(obj); // that.qct_defects.push(obj);
}) // })
that.qct_defects_origin = that.qct_defects; // that.qct_defects_origin = that.qct_defects;
that.qct_testitems = []; // that.qct_testitems = [];
res.qct_testitems.forEach((item2) => { // res.qct_testitems.forEach((item2) => {
if(item2.testitem_type!=='20'){ // if(item2.testitem_type!=='20'){
let obj2 = Object.assign({}, item2); // let obj2 = Object.assign({}, item2);
obj2.value = ''; // obj2.value = '';
obj2.addto_wpr = item2.addto_wpr; // obj2.addto_wpr = item2.addto_wpr;
if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){ // if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){
obj2.value = null; // obj2.value = null;
that.addTemplate[item2.testitem_name] = null; // that.addTemplate[item2.testitem_name] = null;
} // }
if(item2.testitem_field_type=='select-text'||item2.testitem_field_type=='selects-text'){ // if(item2.testitem_field_type=='select-text'||item2.testitem_field_type=='selects-text'){
let str = obj2.testitem_choices.replace(/'/g, '"'); // let str = obj2.testitem_choices.replace(/'/g, '"');
let arr = JSON.parse(str); // let arr = JSON.parse(str);
obj2.testitem_choices = arr; // obj2.testitem_choices = arr;
that.addTemplate[item2.testitem_name] = null; // that.addTemplate[item2.testitem_name] = null;
} // }
that.qct_testitems.push(obj2); // that.qct_testitems.push(obj2);
} // }
}) // })
that.qct_testitems_origin = that.qct_testitems; // that.qct_testitems_origin = that.qct_testitems;
// that.getList(); // // that.getList();
}, // },
//mlogbw //mlogbw
getMlogbw(){ getMlogbw(){
let that = this; let that = this;