| | |
| | | <el-option label="合格" :value="1"></el-option> |
| | | <el-option label="不合格" :value="0"></el-option> |
| | | </el-select> |
| | | <template v-if="PROJECT=='检测中心'||PROJECT=='装备电缆'&&((!getInspectionValueType(n.i) == 2 && !getInspectionValueType(n.i) == 5))||state!=1"> |
| | | <template v-if="PROJECT=='检测中心'||PROJECT=='装备电缆'&&getInspectionValueType(n.i) != 2 "> |
| | | <span v-if="n.v.v===1" :style="`font-family:${n.v.ff} !important;color: green;`">合格</span> |
| | | <span v-else-if="n.v.v===0" :style="`font-family:${n.v.ff} !important;color: red;`">不合格</span> |
| | | <span v-else :style="`font-family:${n.v.ff} !important;`">待定</span> |
| | |
| | | break |
| | | } |
| | | } |
| | | if(this.getInspectionValueType(item.i)==1){ |
| | | if (!isNaN(parseFloat(c.v.v))) { |
| | | if(c.v.v.includes('^') || c.v.v.includes('/')){ |
| | | comValue[(tableCode + (c.r + 1))] = c.v.v |
| | | }else{ |
| | | comValue[(tableCode + (c.r + 1))] = parseFloat(c.v.v) |
| | | } |
| | | } |
| | | if(this.getInspectionValueType(item.i)==1&&!isNaN(parseFloat(c.v.v))){ |
| | | comValue[(tableCode + (c.r + 1))] = parseFloat(c.v.v) |
| | | }else{ |
| | | comValue[(tableCode + (c.r + 1))] = c.v.v |
| | | } |
| | |
| | | if(ask){ |
| | | comp = ask.map((m, i) => { |
| | | if (m.includes('=')) { |
| | | let str = m.split('=')[1] |
| | | console.log(res,str) |
| | | let str = this.handleFraction(m.split('=')[1]) |
| | | if(typeof res == 'string'&&typeof str == 'string'){ |
| | | console.log(res,str) |
| | | return res.trim() == str.trim() |
| | | }else{ |
| | | return eval(res) == eval(str) |
| | | } |
| | | } else if (m.includes('≥')) { |
| | | return eval(res) >= eval(m.split('≥')[1]) |
| | | let str = this.handleFraction(m.split('≥')[1]) |
| | | return eval(res) >= eval(str) |
| | | }else if (m.includes('≤')) { |
| | | return eval(res) <= eval(m.split('≤')[1]) |
| | | let str = this.handleFraction(m.split('≤')[1]) |
| | | return eval(res) <= eval(str) |
| | | }else if (m.includes('<')) { |
| | | return eval(res) < eval(m.split('<')[1]) |
| | | let str = this.handleFraction(m.split('<')[1]) |
| | | return eval(res) < eval(str) |
| | | }else if (m.includes('>')) { |
| | | return eval(res) > eval(m.split('>')[1]) |
| | | let str = this.handleFraction(m.split('>')[1]) |
| | | return eval(res) > eval(str) |
| | | }else if (m.includes('~')) { |
| | | let k = m.split('~') |
| | | return eval(res) >= eval(k[0]) && eval(res) <= eval(k[1]) |
| | | return eval(res) >= eval(this.handleFraction((k[0]))) && eval(res) <= eval(this.handleFraction(k[1])) |
| | | }else if(m.includes('-')){ |
| | | let k = m.split('-') |
| | | return eval(res) >= eval(k[0]) && eval(res) <= eval(k[1]) |
| | | return eval(res) >= eval(this.handleFraction(k[0])) && eval(res) <= eval(this.handleFraction(k[1])) |
| | | }else if(m.includes('±')){ |
| | | let k = m.split('±') |
| | | return eval(res) >= eval((k[0] - k[1])) && eval(res) <= eval((k[0] + k[1])) |
| | | return eval(res) >= eval((this.handleFraction(k[0]) - this.handleFraction(k[1]))) && eval(res) <= eval((this.handleFraction(k[0]) + this.handleFraction(k[1]))) |
| | | }else if(m.includes('>')){ |
| | | return eval(res) > eval(m.split('>')[1]) |
| | | let str = this.handleFraction(m.split('>')[1]) |
| | | return eval(res) > eval(str) |
| | | }else if(m.includes('<')){ |
| | | return eval(res) < eval(m.split('<')[1]) |
| | | let str = this.handleFraction(m.split('<')[1]) |
| | | return eval(res) < eval(str) |
| | | } |
| | | }) |
| | | } |
| | |
| | | this.getCurrentInsProduct(pId) |
| | | } catch (error) { |
| | | |
| | | } |
| | | }, |
| | | handleFraction(str){ |
| | | if(str&&typeof(str)=='string'&&str.includes('/')){ |
| | | return eval(str.split('/')[0]/str.split('/')[1]) |
| | | }else{ |
| | | return str |
| | | } |
| | | }, |
| | | getCurrentInsProduct(pId) { |
| | |
| | | return sum |
| | | }, |
| | | handleInput (n) { |
| | | n.v.v = n.v.v.replace(/[^\d.^e\-/]/g, ''); |
| | | n.v.v = n.v.v.replace(/[^\d.^e\-/+]/g, ''); |
| | | }, |
| | | bigNum (n) { |
| | | if (n.v.v > 10000 && this.PROJECT === '装备电缆') { |