licp
2024-06-28 771699a2a85aecde95a4393ef6016b28f73a551e
检验任务bug修复
已修改2个文件
37 ■■■■ 文件已修改
src/components/do/b1-inspect-order-plan/Inspection.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/util/excelFountion.js 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -253,7 +253,7 @@
      </el-form>
    </div>
    <div class="center">
      <div class="search">
      <div class="search" style="text-align: left;">
        <el-radio-group v-model="currentTable" size="small">
          <el-radio-button :label="item.templateId" v-for="(item,index) in tableLists" :key="index"
            size="small">{{ item.templateName }}</el-radio-button>
@@ -272,7 +272,7 @@
                  <template v-if="n.v.ps!=undefined && n.v.ps.value==='检验值' && state==1">
                    <el-input v-if="getInspectionValueType(n.i) == 1" class="table_input" v-model="n.v.v"
                      :disabled="getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '')"
                      @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`)" type="number" @mousewheel.native.prevent>
                      @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`)" type="number" @mousewheel.native.prevent :key="'abc-'+'000'+index+'000'+i+'000'+j">
                      <el-button slot="append" type="primary" icon="el-icon-edit" size="mini"
                        v-if="getInspectionItemType(n.i) == 1" @click="getSystemValue(n)"></el-button>
                    </el-input>
@@ -1204,6 +1204,9 @@
                let ask = this.currentSample.insProduct.find(m => m.id == item.i).ask?this.currentSample.insProduct.find(m => m.id == item.i).ask.split('&'):null;
                let res = Object.values(comValue)[0]
                let comp = []
                if(res==''||res==null||res==undefined||res=='Infinity'){
                  item.v.v = ''
                }else{
                if(ask){
                  comp = ask.map((m, i) => {
                  if (m.includes('=')) {
@@ -1242,6 +1245,7 @@
                } else {
                  item.v.v = 0
                }
                }
                this.saveInsContext()
              }
            } else {
src/util/excelFountion.js
@@ -1,7 +1,7 @@
function SUM(...val){
  let num = 0;
  let num = null;
  if(val&&val.length>0){
    val.forEach(item=>{
      num+=item;
@@ -10,33 +10,44 @@
  return num;
}
function MAX(...val){
  let max = 0;
  let max = null;
  if(val&&val.length>0){
    val = val.filter(item=>item!=null&&item!=='')
    if(val.length>0){
    max = Math.max(...val)
    }else{
      max = null;
    }
  }
  return max;
}
function MIN(...val){
  let min = 0;
  let min = null;
  if(val&&val.length>0){
    val = val.filter(item=>item!=null&&item!=='')
    console.log(val)
    if(val.length>0){
    min = Math.min(...val)
    }
  }
  return min;
}
function AVERAGE(...val){
  let num = 0;
  let num = null;
  let arr = [];
  if(val&&val.length>0){
    arr = val.filter(item=>item!=null&&item!=='')
    arr.forEach(item=>{
      num+=item;
    })
    if(arr.length>0){
    return num/arr.length;
  }else{
    return 0;
      return null;
    }
  }else{
    return null;
  }
}
@@ -51,6 +62,7 @@
 * @param {Object} cellId
 */
function getColumnNameFromId(cellId){
  try{
    if (! Array.isArray(cellId)) {
        cellId = cellId.split('-');
    }
@@ -64,6 +76,9 @@
    }
    letter += String.fromCharCode(65 + (i % 26));
    return letter + (parseInt(cellId[1]) + 1);
  }catch(e){
    console.log('error',cellId)
  }
}
/**
 * 根据列名获取坐标
@@ -71,6 +86,7 @@
 * @param {Object} arr
 */
function getIdFromColumnName(id, arr) {
  try{
    // Get the letters
    var t = /^[a-zA-Z]+/.exec(id);
    if (t) {
@@ -102,6 +118,9 @@
        }
    }
    return id;
  }catch(e){
    console.log('error',id)
  }
}
// 获取参数列表