licp
2024-07-11 05285426b21495a66a9650f96ed3a1175c32cabf
Merge branch 'master' of http://114.132.189.42:9002/r/center-lims-before into master
已修改2个文件
28 ■■■■ 文件已修改
src/components/do/b1-inspect-order-plan/Inspection.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/worker.js 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -1670,10 +1670,10 @@
      },
      changeInput(m, code, n) {
        if (n) {
          if (n.v.v > 10000 && this.PROJECT === '装备电缆') {
            let num2 = new this.$Big(n.v.v)
            n.v.v = num2.toExponential()
          }
          // if (this.PROJECT === '装备电缆') {
          //   let num2 = new this.$Big(n.v.v)
          //   n.v.v = num2.toExponential()
          // }
          // 定义一个函数来验证分数是否有效
          function isValidFraction(fraction) {
            const [numerator, denominator] = fraction.split('/'); // 分子和分母
static/js/worker.js
@@ -35,6 +35,9 @@
      break
    }
  }
  let isToExponential = ''
  let list2 = []
  excelMethodList.forEach(item => {
    if (item.valueList.find(m => m.r == r && m.c == c)) {
      var comValue = {}
@@ -50,6 +53,7 @@
                    break
                  }
                }
                list2.push(c.v.v)
                if(getInspectionValueType(item.i)==1&&!isNaN(parseFloat(c.v.v))){
                  let n = String(c.v.v)
                  if(n.includes('/')){
@@ -85,6 +89,7 @@
              }
            })
          }else{
            // console.log(ask,res,item.v.f)
            if(ask){
              comp = ask.map((m, i) => {
                if (m.includes('RTS')) {
@@ -142,6 +147,7 @@
                    return handleMoreParam(res,m,'-')
                  }else{
                    let k = m.split('-')
                    // console.log(k,eval(res),eval(res) >= eval(handleFraction(k[0])) && eval(res) <= eval(handleFraction(k[1])))
                    return  eval(res) >= eval(handleFraction(k[0])) && eval(res) <= eval(handleFraction(k[1]))
                  }
                }else if(m.includes('±')){
@@ -212,10 +218,17 @@
        let comResult = ''
        try {
          if(getInspectionValueType(item.i)==1){
            let ask = currentSample.insProduct.find(m => m.id == item.i).ask?currentSample.insProduct.find(m => m.id == item.i).ask.split('&'):null;
            // let ask = currentSample.insProduct.find(m => m.id == item.i).ask?currentSample.insProduct.find(m => m.id == item.i).ask.split('&'):null;
            // let tell = currentSample.insProduct.find(m => m.id == item.i).tell?currentSample.insProduct.find(m => m.id == item.i).tell.split('&'):null;
            comResult = compute(item.v.f.replace(/=/g, ' '),comValue)
            let list3 = []
            list2.forEach(val => {
              val = val.toString()
              list3.push(val)
            })
            isToExponential = list3.some(val => val.includes('e+'))
            // 装备项目检验值转化
            if (PROJECT === '装备电缆' && ask[0].includes('RTS')) {
            if (PROJECT === '装备电缆' && isToExponential) {
              let num2 = new Big(comResult)
              comResult = num2.toExponential()
            }
@@ -241,6 +254,7 @@
            comResult = str
          }
        } catch (error) {
          console.log('error---', error)
        }
        try {
          list.forEach(a => {
@@ -260,7 +274,7 @@
          })
          changeInput(comResult, `${id}-${item.r}-${item.c}-${pId}`) //改变最终值
        } catch (error) {
          console.log('error---', error)
        }
      }
    }