| | |
| | | <script> |
| | | import ValueTable from '../../tool/value-table.vue' |
| | | import fiberOpticConfig from './fiberoptic-config.vue' |
| | | import fiberOpticConfigTwo from './fiberoptic-config-two.vue' |
| | | import equipConfig from './equip-config.vue' |
| | | import cableConfig from './cable-config.vue' |
| | | import Vue from 'vue' |
| | |
| | | components: { |
| | | ValueTable, |
| | | fiberOpticConfig, |
| | | fiberOpticConfigTwo, |
| | | equipConfig, |
| | | cableConfig |
| | | }, |
| | | props: { |
| | | examine: { |
| | | type: Number, |
| | | default: () => 0 |
| | | }, |
| | | active: { |
| | | type: Number, |
| | | default: () => 0 |
| | |
| | | } |
| | | return true |
| | | }) |
| | | /* //校验检验项的要求值和要求描述 |
| | | const isTrue = this.checkRequiredValueAndRemark(filterProductList) |
| | | if(!isTrue){ |
| | | this.$message.error('检验项的要求值与要求描述不匹配, 请检查') |
| | | return |
| | | } */ |
| | | //校验检验项的要求值和要求描述,仅委托要求 |
| | | if(this.isAskOnlyRead){ |
| | | //校验检验项的要求值和要求描述,仅委托要求 |
| | | if(this.active==1&&this.isAskOnlyRead){ |
| | | const isTrue = this.checkRequiredValueAndRemark(filterProductList) |
| | | if(!isTrue){ |
| | | this.$message.error('检验项的要求值与要求描述不匹配, 请检查') |
| | | return |
| | | } |
| | | if(!isTrue){ |
| | | this.$message.error('检验项的要求值与要求描述不匹配, 请检查') |
| | | return |
| | | } |
| | | } |
| | | |
| | | console.log('isHaveBushing===', this.totalArr) |
| | | // inspectionItem |
| | | let spcialItem = this.totalArr.find(a => a.state == 1 && a.inspectionItem.includes('松套管')) |
| | | let spcialItem = null//this.totalArr.find(a => a.state == 1 && a.inspectionItem.includes('松套管')) |
| | | // console.log('isHaveBushing===', isHaveBushing) |
| | | if (productListSelected && select[2] === '光缆' && isHaveBushing === false) { |
| | | this.$message.error('光缆温度循环项目必须进行光纤配置') |
| | |
| | | } |
| | | } |
| | | }, |
| | | /* 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){ |
| | | let tell = ele.tell |
| | | if(ele.tell.indexOf('~')>0){ |
| | | tell = ele.tell.replace('~','-') |
| | | } |
| | | 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&&tell.indexOf(ele.ask)<0){ |
| | | 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 |
| | | }, */ |
| | | /** |
| | | * 校验委托要求的检验项的要求描述和要求值 |
| | | * |
| | | */ |
| | | * 校验委托要求的检验项的要求描述和要求值 |
| | | * |
| | | */ |
| | | checkRequiredValueAndRemark(data){ |
| | | let isTrue = true |
| | | let isTrue = true |
| | | try{ |
| | | data.forEach(ele=>{ |
| | | //判断(≤,≥,>,<,=)这几种情况 |
| | |
| | | } |
| | | //判断范围(10-25),要求值必须是- |
| | | if(ele.ask.indexOf('-')>0 && ele.ask.length>1){ |
| | | //要求描述的~和要求值的-,等效 |
| | | //要求描述的~和要求值的-,等效 |
| | | let tell = ele.tell |
| | | if(ele.tell.indexOf('~')>0){ |
| | | tell = ele.tell.replace('~','-') |
| | |
| | | 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&&tell.indexOf(ele.ask)<0){ |
| | | /** |
| | | * 判断情况 |
| | | * 1.要求描述与要求描述相同 |
| | | * 2.要求描述包含要求值 |
| | | * 3.要求描述为3N-10N这种情况 |
| | | * 4.要求描述为10±5这种情况 |
| | | * 5. |
| | | */ |
| | | let min = Math.min(...splits) |
| | | let max = Math.max(...splits) |
| | | if(min==max){ |
| | | isTrue = false |
| | | }else if(ele.tell.indexOf('±')>0&&ele.tell!=ele.ask){ |
| | | } |
| | | //要求描述中不包含±以及区间的数字,则返回false |
| | | if((tell.indexOf('±')<0&&tell.indexOf('-')<0)){ |
| | | isTrue = false |
| | | }else if(ele.tell.indexOf('-')==0){ |
| | | isTrue = false |
| | | }else if(tell.indexOf('-')>0){ |
| | | const splitTells = tell.split('-') |
| | | if(splitTells[0].indexOf(min)<0 || splitTells[1].indexOf(max)<0){ |
| | | isTrue = false |
| | | } |
| | | }else if(tell.indexOf('±')>0&&tell!=ele.ask){ |
| | | //校验要求描述为10±5这种写法的情况 |
| | | let splitNums = ele.tell.split('±') |
| | | if(splitNums.length<2){ |
| | | isTrue = false |
| | |
| | | } |
| | | return isTrue |
| | | }, |
| | | |
| | | save0(){ |
| | | if(this.editTable.every(m=>m.value)){ |
| | | let sampleList = this.handleData(this.HaveJson(this.sampleList),this.handleAsk,1) |