From 48e38a0a41dfbaa2776dade107101ea439c17a22 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期四, 20 六月 2024 11:48:53 +0800 Subject: [PATCH] 添加检验方法 --- src/components/do/b1-ins-order/add.vue | 49 +++++++++++----- src/main.js | 8 +- src/components/do/b1-inspect-order-plan/Inspection.vue | 86 +++++++++++++++++++++++++++- 3 files changed, 119 insertions(+), 24 deletions(-) diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue index 03bbca0..b75659e 100644 --- a/src/components/do/b1-ins-order/add.vue +++ b/src/components/do/b1-ins-order/add.vue @@ -163,7 +163,7 @@ </el-select> </div> </el-col> - <el-col class="search_thing" :span="6"> + <el-col class="search_thing" :span="6" style="display: none;"> <div class="search_label"><span class="required-span">* </span>濮旀墭浜猴細</div> <div class="search_input"> <el-input size="small" clearable disabled v-model="addObj.custom"></el-input> @@ -171,6 +171,12 @@ <template slot="append"><el-button slot="append" icon="el-icon-search" @click="selectUserDia = true" :disabled="active>1"></el-button></template> </el-input> --> + </div> + </el-col> + <el-col class="search_thing" :span="6"> + <div class="search_label">鍒跺崟浜猴細</div> + <div class="search_input"> + <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addObj.prepareUser" :readonly="active>1"></el-input> </div> </el-col> <el-col class="search_thing" :span="6"> @@ -303,12 +309,6 @@ <div class="search_label">OTC璁㈠崟鍙凤細</div> <div class="search_input"> <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addObj.otcCode" :readonly="active>1"></el-input> - </div> - </el-col> - <el-col class="search_thing" :span="6"> - <div class="search_label">鍒跺崟浜猴細</div> - <div class="search_input"> - <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="addObj.prepareUser" :readonly="active>1"></el-input> </div> </el-col> <el-col class="search_thing" :span="6" style="align-items: flex-start;margin: 8px 0;"> @@ -801,6 +801,8 @@ totalArr: [], model: null, standardMethodListId: null, + symbolList:[ + 'RTS','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] } }, watch: { @@ -906,9 +908,8 @@ this.selectUserDia = false }, containsValue(str) { - let arr = ['RTS','D','W','X','H','L'] let symbolItem = '' - arr.some(value =>{ + this.symbolList.some(value =>{ if(str.includes(value)){ symbolItem = value return true @@ -942,6 +943,12 @@ return code[index] + '' + num } } + }catch(e){} + }, + handleTell(tell,symbolItem, value){ + try{ + let num = this.replaceAll(tell, symbolItem, value) + return num }catch(e){} }, replaceAll(str,find,value) { @@ -985,9 +992,7 @@ this.saveMethod(sampleList) }).catch(() => {}) }else{ - let isRTS = this.totalArr.find(a => a.ask != null && (a.ask.includes('RTS') || a.ask.includes('D') || a.ask - .includes('W') || - a.ask.includes('X') || a.ask.includes('H') || a.ask.includes('L')) && a.state == 1) + let isRTS = this.totalArr.find(a => a.ask != null && this.symbolList.find(b=>a.ask.includes(b)) && a.state == 1) if (isRTS) { this.editTable = this.handleData(sampleList,this.containsValue, 0) this.bsm3Dia = true; @@ -1024,6 +1029,10 @@ if (ask) { a.ask = ask } + let tell = this.handleTell(a.tell, f.symbolItem,f.value) + if (tell) { + a.tell = tell + } } }) } @@ -1042,16 +1051,16 @@ let str = calBack(c.ask) str&&obj.symbolList.push(str) }else if(type==1){ - // let ask = calBack(c.ask, c.rts) - // if (ask && c.state == 1) { - // c.ask = csk - // } let arr = this.editTable.filter(b => b.sampleId == item.id) arr.forEach(f => { if(c.ask.includes(f.symbolItem)){ let ask = calBack(c.ask, f.symbolItem,f.value) if (ask) { c.ask = ask + } + let tell = this.handleTell(c.tell, f.symbolItem,f.value) + if (tell) { + c.tell = tell } } }) @@ -1081,6 +1090,10 @@ if (ask) { c.ask = ask } + let tell = this.handleTell(c.tell, f.symbolItem,f.value) + if (tell) { + c.tell = tell + } } }) } @@ -1107,6 +1120,10 @@ if (ask) { d.ask = ask } + let tell = this.handleTell(d.tell, f.symbolItem,f.value) + if (tell) { + d.tell = tell + } } }) } diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue index 489bd8d..7f4494f 100644 --- a/src/components/do/b1-inspect-order-plan/Inspection.vue +++ b/src/components/do/b1-inspect-order-plan/Inspection.vue @@ -1161,7 +1161,6 @@ } this.excelMethodList.forEach(item => { if (item.valueList.find(m => m.r == r && m.c == c)) { - console.log(item) var comValue = {} item.valueList.forEach(a => { list.forEach(b => { @@ -1254,8 +1253,22 @@ for (var a in comValue) { arr0.push(comValue[a]) } - comResult = Math.abs(arr[0]) + comResult = Math.abs(arr0[0]) break; + // case 'MAX': + // let arr1 = [] + // for (var a in comValue) { + // arr1.push(eval(comValue[a])) + // } + // comResult = Math.max(...arr1) + // break; + // case 'MIN': + // let arr2 = [] + // for (var a in comValue) { + // arr2.push(eval(comValue[a])) + // } + // comResult = Math.median(...arr2) + // break; default: let valueList = []; item.valueList.forEach(a => { @@ -1275,6 +1288,9 @@ valueList.forEach(b => { str = str.replace(b.name, b.value) }) + str = str.replaceAll('MAX', 'Math.max') + str = str.replaceAll('MIN', 'Math.min') + str = str.replaceAll('锛�', ',') try { if(this.getInspectionValueType(item.i)==1){ comResult = eval(str) @@ -1286,7 +1302,6 @@ } break; } - console.log(comResult) list.forEach(a => { if (a[0].r == item.r && comResult != '') { for (var b in a) { @@ -1379,7 +1394,70 @@ item.methodName = item.v.f.split('=').length > 1 && item.v.f.split('=')[1].split('(') && item.v.f.split( '=')[1].split('(')[0] ? item.v.f.split('=')[1].split('(')[0] : '鑷畾涔夋柟娉�'; let valueList = []; - if (item.v.f.includes(':')) { + if(item.v.f.includes('MAX') || item.v.f.includes('MIN')){ + item.methodName = '鑷畾涔夋柟娉�' + let regex = /[=\+\-\*\%\/\^\s]/g + let mode = item.v.f.replace(regex, ' ').split(' '); + let that = this + if(item.v.f.includes('MAX')){ + item.v.f = Judgment(item.v.f, 'MAX') + } + if(item.v.f.includes('MIN')){ + item.v.f = Judgment(item.v.f, 'MIN') + } + function Judgment(f,type) { + let newF = f + let mode4 = mode.filter(m => m&&m.includes(type)) + mode4.forEach(m => { + let mode0 = m + if(mode0.includes(':')){ + let r0 = null; + let c0 = null; + let r1 = null; + let c1 = null; + let mode1 = mode0.split('(')[1].split(')')[0]; + let start = mode1.split(':')[0] + let end = mode1.split(':')[1] + c0 = that.comparisonList.find(j => j.label == start.split('')[0]).value + r0 = start.replace(/[a-zA-Z]/g, "") - 1 + c1 = that.comparisonList.find(j => j.label == end.split('')[0]).value + r1 = end.replace(/[a-zA-Z]/g, "") - 1 + let valueList0 = [] + for (let i = Number(r0); i <= Number(r1); i++) { + for (let u = Number(c0); u <= Number(c1); u++) { + valueList0.push({ + r: i, + c: u + }) + } + } + let valueList1 = [] + valueList0.forEach(v => { + let r = ''; + let c = ''; + r = v.r +1; + c = that.comparisonList.find(j => j.value == v.c).label + valueList1.push(c+r) + }) + let mode3 = type+'('+valueList1.join(',')+')' + newF = newF.replace(mode0, mode3) + valueList = [...valueList,...valueList0] + }else{ + let mode1 = mode0.replace(type, '').replace(/[=\+\-\*\%\(\)\/\^\s]/g, ''); + let modeList = mode1.split(','); + modeList.filter(m => m && !Number(m)).forEach(m => { + let r = m.replace(/[a-zA-Z]/g, "") - 1 + let c = that.comparisonList.find(j => j.label == m.split('')[0]).value + valueList.push({ + c, + r + }) + }) + } + }) + return newF + } + }else if (item.v.f.includes(':')) { valueList = []; let r0 = null; let c0 = null; diff --git a/src/main.js b/src/main.js index e11ae3b..1325d46 100644 --- a/src/main.js +++ b/src/main.js @@ -15,17 +15,17 @@ Vue.prototype.PROJECT = '妫�娴嬩腑蹇�' // Vue.prototype.PROJECT = '瑁呭鐢电紗' //鏈湴 -// Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80"; +Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80"; // const javaApi = 'http://127.0.0.1:8001'; -// const javaApi = 'http://192.168.0.104:8001'; +const javaApi = 'http://192.168.0.104:8001'; //浜� // Vue.prototype.LOCATIONVUE = "http://114.132.189.42:8080"; // const javaApi = 'http://114.132.189.42:1234'; //妫�娴嬩腑蹇冩寮忓簱 -Vue.prototype.LOCATIONVUE = "http://10.1.200.86:8080"; -const javaApi = 'http://10.1.200.86:8001'; +// Vue.prototype.LOCATIONVUE = "http://10.1.200.86:8080"; +// const javaApi = 'http://10.1.200.86:8001'; //瑁呭鐢电紗娴嬭瘯搴� // Vue.prototype.LOCATIONVUE = "http://10.16.173.59"; -- Gitblit v1.9.3