| | |
| | | isHaveBushing = false |
| | | } |
| | | }) |
| | | // console.log('isHaveBushing===', this.totalArr) |
| | | //过滤检测项:去除特殊项(bsm=1), |
| | | let filterProductList = this.productListSelected.filter(ele=>ele.bsm==0&&/[0-9]/.test(ele.ask)).filter(ele=>{ |
| | | if(select[1].indexOf('通信')>=0 && ['光缆','光纤'].includes(select[2])){ |
| | | return !['温度循环','光纤接头损耗'].includes(ele.inspectionItem) |
| | | } |
| | | return true |
| | | }).filter(ele=>{ |
| | | if(select[1].indexOf('电力')>=0){ |
| | | return !['温升试验','热循环'].includes(ele.inspectionItem) |
| | | } |
| | | return true |
| | | }) |
| | | //校验检验项的要求值和要求描述 |
| | | const isTrue = this.checkRequiredValueAndRemark(filterProductList) |
| | | if(!isTrue){ |
| | | this.$message.error('检验项的要求值与要求描述不匹配, 请检查') |
| | | return |
| | | } |
| | | |
| | | console.log('isHaveBushing===', this.totalArr) |
| | | // inspectionItem |
| | | let spcialItem = null//this.totalArr.find(a => a.state == 1 && a.inspectionItem.includes('松套管')) |
| | | // console.log('isHaveBushing===', isHaveBushing) |
| | |
| | | } |
| | | } |
| | | }, |
| | | checkRequiredValueAndRemark(data){ |
| | | let isTrue = true |
| | | try{ |
| | | data.forEach(ele=>{ |
| | | if(['≤','≥','>','<','='].includes(ele.ask[0])){ |
| | | const askVal = ele.ask.substring(1,ele.ask.length) |
| | | if(isNaN(askVal) || ele.tell.indexOf(askVal)<0){ |
| | | isTrue = false |
| | | } |
| | | } |
| | | if(ele.ask.indexOf('-')>0 && ele.ask.length>1){ |
| | | const splits = ele.ask.split('-') |
| | | if(splits.length==2 && !isNaN(splits[0]) && !isNaN(splits[1])){ |
| | | let min = Math.min(...splits) |
| | | let max = Math.max(...splits) |
| | | if(ele.tell.indexOf('±')<0&&ele.tell!=ele.ask){ |
| | | isTrue = false |
| | | }else if(ele.tell.indexOf('±')>0&&ele.tell!=ele.ask){ |
| | | let splitNums = ele.tell.split('±') |
| | | if(splitNums.length<2){ |
| | | isTrue = false |
| | | }else{ |
| | | let minTell = Number(splitNums[0])-Number(splitNums[1]) |
| | | let maxTell = Number(splitNums[0])+Number(splitNums[1]) |
| | | if(minTell!=min || maxTell!=max){ |
| | | isTrue = false |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | isTrue = false |
| | | } |
| | | } |
| | | }) |
| | | }catch(error){ |
| | | console.log(error); |
| | | isTrue = false |
| | | } |
| | | return isTrue |
| | | }, |
| | | save0(){ |
| | | if(this.editTable.every(m=>m.value)){ |
| | | let sampleList = this.handleData(this.HaveJson(this.sampleList),this.handleAsk,1) |