| | |
| | | }else{ |
| | | if(ask){ |
| | | comp = ask.map((m, i) => { |
| | | if (m.includes('RTS')) { |
| | | m = m.replace('RTS*', '') |
| | | } |
| | | if (m.includes('=')) { |
| | | let str = this.handleFraction(m.split('=')[1]) |
| | | if(typeof res == 'string'&&typeof str == 'string'){ |
| | |
| | | let comResult = '' |
| | | try { |
| | | if(this.getInspectionValueType(item.i)==1){ |
| | | let ask = this.currentSample.insProduct.find(m => m.id == item.i).ask?this.currentSample.insProduct.find(m => m.id == item.i).ask.split('&'):null; |
| | | comResult = excelFunction.compute(item.v.f.replace(/=/g, ' '),comValue) |
| | | // 装备项目检验值转化 |
| | | if (this.PROJECT === '装备电缆' && ask[0].includes('RTS')) { |
| | | let num2 = new this.$Big(comResult) |
| | | comResult = num2.toExponential() |
| | | } |
| | | }else{ |
| | | let valueList = []; |
| | | item.valueList.forEach(a => { |
| | |
| | | handleFraction(str){ |
| | | if(str&&typeof(str)=='string'&&str.includes('/')){ |
| | | return eval(str.split('/')[0]/str.split('/')[1]) |
| | | }else{ |
| | | } else if (str && typeof(str) == 'string' && str.includes('*') && str.includes('^')) { |
| | | const num1 = str.split('*') |
| | | const num2 = num1[1].split('^') |
| | | let num3 = new this.$Big(num2[0]); |
| | | let num4 = new this.$Big(num2[1]); |
| | | let num5 = Math.pow(num3, num4) // 计算次方 |
| | | return num1[0] * num5 // 最后计算乘法 |
| | | } else{ |
| | | return str |
| | | } |
| | | }, |