gaoluyang
2024-07-04 347030895032792e730394b362ce1473c0df6b03
1.表格要求值计算
2.温度循环下单逻辑修改
已修改2个文件
25 ■■■■ 文件已修改
src/components/do/b1-ins-order/add.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/Inspection.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-ins-order/add.vue
@@ -1112,6 +1112,9 @@
              throw this.$message.error('请填写完整数据')
            }
          })
          if (!o.temperatureData.some(item => item.temperaturePoint == '20')) {
            throw this.$message.error(`${o.value + '波长没有配置20℃温度点'}`)
          }
        })
        let entrustTime = this.circulateForm.entrustTime
        let entrustNum = this.circulateForm.entrustNum
@@ -1123,7 +1126,7 @@
          o.temperatureData.unshift({temperaturePoint: 20})
          o.temperatureData.forEach(t => {
            if (!t.askSymbol) {
                  const askObj = t.temperaturePoint + '℃' + ',' + o.value + ',' + null
                  const askObj = t.temperaturePoint + '℃(常温)' + ',' + o.value + ',' + null
                  askArr.push(askObj)
                } else {
                  const askObj = t.temperaturePoint + '℃' + ',' + o.value + ',' + t.askSymbol + t.askNum
@@ -1149,7 +1152,7 @@
        })
        temperaturePointList = Array.from(new Set(temperaturePointList))
        temperaturePointList2 = Array.from(new Set(temperaturePointList2))
        temperaturePointList2.unshift(20 + '℃')
        temperaturePointList2.unshift(20 + '℃(常温)')
        let additionArr = []
        askNum.forEach(a => {
          additionArr.push(temperaturePointList.join(',') + a)
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -1697,6 +1697,9 @@
                }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'){
@@ -1750,7 +1753,13 @@
              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 => {
@@ -1809,7 +1818,14 @@
      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
        }
      },