From 58ae8af50d140622314e7d643e3c43d374ef6244 Mon Sep 17 00:00:00 2001 From: shijing Date: Tue, 25 Feb 2025 17:40:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=A3=80=E9=AA=8C=E5=B7=A5=E5=BA=8F?= =?UTF-8?q?=E6=A3=80=E9=AA=8C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wpm_bx/mlogbw_check.vue | 94 ++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 33 deletions(-) diff --git a/src/views/wpm_bx/mlogbw_check.vue b/src/views/wpm_bx/mlogbw_check.vue index 21f85b36..fa1ec1ec 100644 --- a/src/views/wpm_bx/mlogbw_check.vue +++ b/src/views/wpm_bx/mlogbw_check.vue @@ -4,6 +4,7 @@ v-model="visible" :size="'90%'" destroy-on-close + :close-on-click-modal="false" @closed="$emit('closed')" > @@ -24,8 +25,9 @@ - 检验 + 检验 批量操作 + 批量操作 @@ -275,7 +278,7 @@ @@ -288,14 +291,15 @@ label-width="150px" > - + + - + + @@ -309,9 +313,9 @@ - + {{ item2.value }} @@ -391,6 +395,7 @@ export default { qct:"", values:"", wprNumber:"", + wprInputText:"", params: {mlogb:'',page:0}, hideAdd: true, visible: false, @@ -403,6 +408,7 @@ export default { qct_testitems:[], mlogbwlist:[], equipmentOptions:[], + process_type:"", addTemplate:{ mlogb: "", number: "", @@ -437,20 +443,25 @@ export default { } that.params.mlogb = that.addTemplate.mlogb = that.mlogb; that.currentDate = this.$TOOL.dateFormat2(new Date()); - console.log(that.currentDate); + // console.log(that.currentDate); }, methods: { open(mode = "ins",qct = '') { let that = this; this.mode = mode; this.qct = qct; - that.getOptions(); - that.getdefects(); + if(that.mode == 'ins'){//输入 + that.getOptions(); + } + that.$API.mtm.mgroup.item.req(that.mgroup).then((res) => { + that.process_type=res.process_type; + // console.log('res',res); + that.getdefects(); + }) this.visible = true; - // setTimeout(() => { - // this.tableHeight = document.getElementById('mlogbwMain').clientHeight-20; - // },500) - + setTimeout(() => { + this.tableHeight = document.getElementById('mlogbwMain').clientHeight-20; + },500) }, getEquipments(){ let that = this; @@ -465,12 +476,16 @@ export default { that.qct_defects = []; res.qct_defects.forEach((item) => { that.addTemplate[item.defect_name] = false; + let obj = Object.assign({}, item); + obj.canEdit = that.process_type=='20'?false:true; + that.qct_defects.push(obj); }) - that.qct_defects = res.qct_defects; that.qct_testitems = []; res.qct_testitems.forEach((item2) => { let obj2 = Object.assign({}, item2); obj2.value = ''; + obj2.canEdit = that.process_type=='20'?false:true; + obj2.addto_wpr = item2.addto_wpr; if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){ obj2.value = 0; @@ -492,17 +507,15 @@ export default { }, getOptions(){ let that = this; - if(that.mode == 'ins'){//输入 - that.$API.wpm.wpr.list.req({wm:that.wm,page:0}).then((res) => { - that.options = res; - }) - } + that.$API.wpm.wpr.list.req({wm:that.wm,page:0}).then((res) => { + that.options = res; + }) }, optionChange(row){ let that = this; that.options.forEach((item) => { if(item.id == row.wpr){ - console.log('item',item); + // console.log('item',item); let index = that.mlogbwlist.indexOf(row); that.mlogbwlist[index].number = item.number; } @@ -517,7 +530,6 @@ export default { let obj = {}; obj = Object.assign({},item); obj.isEdit = false; - obj.canEdit = false; if(that.qct!=null&&that.qct!=''&&item.ftest!=null){ if(item.ftest.ftestdefects!==undefined&&item.ftest.ftestdefects!==''&&item.ftest.ftestdefects!==null&&item.ftest.ftestdefects.length>0){ item.ftest.ftestdefects.forEach((item1) => { @@ -566,7 +578,7 @@ export default { row.ftest.ftestitems.forEach((item1) => { item1.test_val_json = row[item1.testitem_name]; }) - console.log('obj',obj); + // console.log('obj',obj); }else{//检验表未填过 console.log('未填过'); obj.ftest = {}; @@ -621,7 +633,7 @@ export default { formTableEdit(row) { this.mlogbwlist.forEach((item, index) => { if (item.id == row.id) { - console.log('row',row); + // console.log('row',row); this.mlogbwlist[index].isEdit = true; } }); @@ -666,7 +678,7 @@ export default { let that = this; let index = that.mlogbwlist.indexOf(row); that.qct_defects.forEach(item => { - console.log('item.rule_expression',item.rule_expression); + // 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') @@ -806,6 +818,11 @@ export default { that.checkVisible = false; this.multipleSet = true; that.descriptionVisible = true; + that.qct_defects = []; + that.qct_defects = that.defectlists; + that.qct_testitems = []; + that.qct_testitems = that.testitemlists; + that.tableHeight = document.getElementById('mlogbwMain').clientHeight-80; that.getList(); }).catch((err) => { return err; @@ -824,11 +841,25 @@ export default { check_set(){ this.setVisible=true; }, + //扫描物料将这一行放到第一行并编辑这一行 + wprinputChange(){ + let that = this; + that.mlogbwlist.forEach((item,index) => { + if(item.number == that.wprInputText){ + let obj = Object.assign({},item); + obj.isEdit = true; + that.mlogbwlist.splice(index,1); + that.mlogbwlist.unshift(obj); + that.wprInputText = ""; + } + }) + }, wprChange(wprNumber){ let that = this; that.mlogbwlist.forEach(item => { if(item.number == wprNumber){ that.selectWpr.push(item); + that.wprNumber = ""; } }); }, @@ -854,17 +885,14 @@ export default { item.ftest.ftestitems.forEach(testitem => { let testitemindex = that.setForm.testitemids.indexOf(testitem.testitem); if( testitemindex > -1){ - console.log('that.testitemlists[testitemindex].value',that.testitemlists[testitemindex].value) testitem.test_val_json = that.testitemlists[testitemindex].value; } }) }); - console.log('that.selectWpr',that.selectWpr); that.$API.wpm.mlogbw.update.req("bulk",that.selectWpr).then((res) => { - console.log('blukres',res); that.setVisible = false; - that.descriptionVisible = false; - that.setForm = {}; + // that.descriptionVisible = false; + // that.setForm = {}; that.getList(); }).catch((err) => { return err;