diff --git a/src/views/wpm_bx/mlogbw_check.vue b/src/views/wpm_bx/mlogbw_check.vue index a8d5551e..bda39093 100644 --- a/src/views/wpm_bx/mlogbw_check.vue +++ b/src/views/wpm_bx/mlogbw_check.vue @@ -83,42 +83,106 @@ {{ scope.row.equip_name }} - + - {{ scope.row.work_start_time }} + + {{ scope.row.work_start_time.split(' ')[0]}} + - + + + + + + {{ scope.row.wave_number }} + + + + + + {{ scope.row[item.testitem_name] }} + + + + + + + + + @@ -430,6 +494,10 @@ export default { type:String, default:"", }, + material_in:{ + type:String, + default:"", + }, processType:{ type:String, default:"", @@ -477,6 +545,7 @@ export default { qct_defects:[], qct_testitems:[], mlogbwlist:[], + testitems:[], equipmentOptions:[], addTemplate:{ mlogb: "", @@ -519,9 +588,9 @@ export default { mounted() { let that = this; this.route_code = this.$route.path.split("/")[2]; - // if(this.route_code=='niuzhuan'){ - // this.getEquipment4(); - // } + if(this.route_code=='niuzhuan'&&that.mode == 'ins'){ + // that.gettestitem(); + } that.hideAdd = that.isSubmit; if(that.mgroupName=='排一次棒'||that.mgroupName=='排板'){ // that.getNewNumber(); @@ -549,6 +618,23 @@ export default { that.tableHeight = document.getElementById('mlogbwMain').clientHeight-20; },500) }, + //获取输入的testItem + gettestitem(){ + let that = this; + that.$API.qm.qct.getQct.req({ material: that.material_in,type:'in',tag:'process' }).then((res) => { + console.log('gettestitem',res); + // that.qct = res[0].id; + that.testitems = []; + // let list = res[0].qct_testitems; + // list.forEach(item=>{ + // let obj = Object.assign({}, item); + // obj.value = null; + // obj.canEdit = true; + // obj.addto_wpr = item.addto_wpr; + // that.testitems.push(obj) + // }) + }); + }, getNewNumber(){ let that = this; let date = new Date(); @@ -590,8 +676,6 @@ export default { }else if(num<1000){ num = "0"+num; } - console.log('num',num); - console.log('data.number:',data.number); if(that.mgroupName=='排一次棒'){ that.addTemplate.number = years+months+num; } @@ -599,18 +683,10 @@ export default { that.addTemplate.number = years+ months + that.material_model+num; } }, - workTimeCountSun(row){ - let that = this; - let time = row.work_time*60*1000; - let index = that.mlogbwlist.indexOf(row); - let end = new Date(row.work_start_time).getTime()+time; - let end_time = that.$TOOL.dateFormat(new Date(end), 'yyyy-MM-dd hh:mm:ss'); - that.mlogbwlist[index].work_end_time = end_time; - }, getEquipment4() { let that = this; that.$API.em.equipment.list.req({page:0,cate__code:"4",query:"{id,name,number}"}).then((res) => { - that.optionsEq = res; + that.optionsEq = res.reverse(); }) }, getEquipments(){ @@ -681,12 +757,6 @@ export default { let obj = {}; obj = Object.assign({},item); obj.isEdit = false; - if(obj.work_start_time!==null&&obj.work_start_time!==''&&obj.work_end_time!==null&&obj.work_end_time!==''){ - let start = new Date(obj.work_start_time).getTime(); - let end = new Date(obj.work_end_time).getTime(); - let time = (end-start)/60000; - obj.work_time = time; - } if(that.qct!=''){ if(item.ftest!=null){ if(item.ftest.ftestdefects!==undefined&&item.ftest.ftestdefects!==''&&item.ftest.ftestdefects!==null&&item.ftest.ftestdefects.length>0){ @@ -722,7 +792,7 @@ export default { obj.wpr = row.wpr; obj.note = row.note; //qct不为空,有检验表 - if(that.qct!==''){ + if(that.qct!==''&&that.qct!==null){ that.qct_defects_origin.forEach(item => { if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){ let str = item.rule_expression.replace(/`/g, ''); @@ -765,13 +835,14 @@ export default { obj.ftest.ftestitems.push(itemObj1); }) } + }else{ + obj.ftest = null; } - // console.log('obj',obj); if(that.mode == 'ins'&&that.route_code=='niuzhuan'){ obj.equip = row.equip; obj.work_start_time = row.work_start_time; - obj.work_end_time = row.work_end_time; obj.work_time = row.work_time; + obj.wave_number = row.wave_number; } if(row.id!==''&&row.id!==undefined&&row.id!==null){ obj.id = row.id; @@ -807,8 +878,6 @@ export default { that.mlogbwlist.forEach((item, index) => { if (item.id == row.id) { that.mlogbwlist[index].isEdit = true; - console.log('row',row); - console.log('that.qct_testitems',that.qct_testitems); 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'); @@ -855,7 +924,6 @@ export default { let that = this; let index = that.mlogbwlist.indexOf(row); that.qct_defects_origin.forEach(item => { - // console.log('item.rule_expression',item.rule_expression); if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){ let str = item.rule_expression.replace(/`/g, ''); str = str.replace(/\${(.*?)}/g, 'row.\$1') @@ -960,6 +1028,7 @@ export default { }, checkSetting(){ let that = this; + that.isSaveing = true; that.$refs.dialogForm.validate((valid) => { if (valid) { Object.assign(that.setForm,that.form); @@ -1020,8 +1089,10 @@ export default { that.qct_testitems = []; that.qct_testitems = that.testitemlists; that.tableHeight = document.getElementById('mlogbwMain').clientHeight-80; + that.isSaveing = false; that.getList(); }).catch((err) => { + that.isSaveing = false; return err; }); } @@ -1046,7 +1117,6 @@ export default { that.mlogbwlist.forEach((item,index) => { let indexs = item.number.indexOf(that.wprInputText) if(indexs>-1&&that.wprInputText !== ""){ - // console.log(item.number,that.wprInputText,indexs,indexs>-1); // if(item.number == that.wprInputText){ let obj = Object.assign({},item); obj.isEdit = true;