licp
2024-07-31 cc702f8d62c082c8f4b97b44e094fb8b8c7b97d8
修改检验任务bug
已修改2个文件
96 ■■■■ 文件已修改
src/components/do/b1-inspect-order-plan/Inspection.vue 70 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/worker.js 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -230,9 +230,9 @@
<template>
  <div v-loading="loading" class="inspection">
    <el-row class="title">
      <el-col :span="12" style="padding-left: 20px;text-align: left;" v-once>检验单详情
      <el-col :span="12" style="padding-left: 20px;text-align: left;" >检验单详情
      </el-col>
      <el-col :span="12" style="text-align: right;" v-once>
      <el-col :span="12" style="text-align: right;">
        <!-- <el-button size="small" type="primary" @click="fiberOpticVisible=true" v-if="fiberOptic.length>0">光纤切换</el-button>
        <el-button size="small" type="primary" @click="fiberOpticTapeVisible=true" v-if="fiberOpticTape.length>0">光纤带切换</el-button>
        <el-button size="small" type="primary" @click="bushingVisible=true" v-if="bushing.length>0">套管切换</el-button> -->
@@ -322,7 +322,7 @@
        </div>
      </div>
      <div class="center-box" id="nav" v-loading="tableLoading" v-if="!tableLists.find(m=>m.templateId==currentTable)||(tableLists.find(m=>m.templateId==currentTable).templateName!='温度循环检验原始记录'&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('热循环')&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('温升试验'))">
        <table border="1" class="tables" cellpadding="10" v-for="(item,index) in tableList" :key="index+currentTable">
        <table border="1" class="tables" cellpadding="10" v-for="(item,index) in tableList" :key="index+currentTable+currentSample.id">
          <tbody>
            <tr v-for="(m,i) in item.arr" :key="i">
              <td :id='item.templateId+"-"+n.i+"-"+n.r+"-"+n.c' v-for="(n,j) in m" :key="j"
@@ -376,6 +376,7 @@
                  <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='要求值' && state==1">
                    <span :style="`font-family:${n.v.ff} !important;`">{{getTell(n.i)}}</span>
                  </template>
                  <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='计算值' && state==1"><span :style="`font-family:${n.v.ff} !important;`">{{ toFixed(n.v.v,n.v.ct) }}</span></template>
                  <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='最终值' && state==1">
                    <!-- <el-input class="table_input" type="textarea"
                      :disabled="getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '')"
@@ -424,7 +425,7 @@
                      v-if="currentFiberOptic" class="el-icon-caret-right table_caret" @click="caretOptic(1)"></i>
                    </div>
                  </template>
                  <span v-else :style="`font-family:${n.v.ff} !important;`" v-html="getValue(n.v)" v-once></span>
                  <span v-else :style="`font-family:${n.v.ff} !important;`" v-html="getValue(n.v)" ></span>
                </div>
              </td>
            </tr>
@@ -1050,13 +1051,48 @@
      },
      currentTable(val1, val0) {
        if (val0 != null && val1 != val0) {
          this.tableLists.forEach((m, i) => {
          this.tableLists.forEach(async (m, i) => {
            if (m.templateId == val1) {
              // this.tableList = null;
              // this.tableList = [(this.tableLists[i])];
              this.$delete(this.tableList, 0)
              this.$set(this.tableList, 0, this.tableLists[i])
              this.handleTableData()
              let list = await this.getCurrentProduct(this.currentSample.id,0)
              this.currentSample.insProduct = this.HaveJson(list)
              // console.log(this.currentSample)
              this.currentSample.insProduct.forEach(a => {
                this.param[a.id] = {
                  insValue: [],
                  comValue: [],
                  resValue: null,
                  equipValue: [],
                  equipName: [],
                  insResult: null
                }
              })
              this.getReportModel(this.currentSample.id)
              const mySet1 = new Set();
              this.tableLists = this.currentSample.insProduct.filter(m => {
                let num0 = mySet1.size;
                if (m.templateId != null&&m.template != null) {
                  try {
                    mySet1.add(JSON.stringify({
                      template: m.template,
                      templateId: m.templateId
                    }))
                  } catch (error) {
                    console.log(222,error);
                  }
                }
                let num1 = mySet1.size;
                if (num1 > num0) {
                  return m
                }
              });
              if (this.tableLists && this.tableLists.length > 0) {
                this.tableList = null;
                this.tableList = this.tableLists.filter(m => m.templateId == val1)
                this.handleTableData()
              }
              // this.$delete(this.tableList,0)
              // this.$set(this.tableList, 0, m)
              // this.handleTableData()
            }
          })
        }
@@ -2785,7 +2821,7 @@
        return
      },
      saveInsContext() {
        // console.log(1111,this.param)
        console.log(1111,this.param)
        try {
          if(this.param){
            this.$axios.post(this.$api.insOrderPlan.saveInsContext, {
@@ -2810,6 +2846,18 @@
        }
      },
      changeEquip(val, n) {
        this.tableList[0].arr.forEach((item,index)=>{
          item.forEach((m,i)=>{
            if(this.param[m.i]){
              this.param[m.i].state = 1
            }
          })
        })
        for (let i in this.param) {
          if(this.param[i].state!=1){
            delete this.param[i]
          }
        }
        for (let i in this.equipOptions) {
          if (this.equipOptions[i].value === val) {
            for (let i1 in this.param[n.i].equipName) {
static/js/worker.js
@@ -351,8 +351,10 @@
                      a[b].v.v = comResult?Number(comResult).toFixed(num):0
                    }else{
                      let val = parseFloat(Number(comResult).toFixed(3))
                      a[b].v.v = isNaN(val) ? '' : val
                      a[b].v.v = isNaN(val) ? comResult : val
                    }
                    // console.log('a[b].v.ct', comResult)
                    // console.log('a[b].v.v', a[b].v.v)
                  }catch(error){
                    a[b].v.v = comResult
                    console.log('error---', error)
@@ -459,14 +461,18 @@
 * @returns 返回处理后的参数对象
 */
function getParam(){
  for (var b in param){
    param[b].insValue = []
    param[b].comValue = []
    param[b].equipValue = []
    param[b].equipName = []
    param[b].resValue = null
    param[b].insResult = null
  }
  tableList[0].arr.forEach(a=>{
    a.forEach(b=>{
      if(param[b.i]){
        param[b.i].insValue = []
        param[b.i].comValue = []
        param[b.i].equipValue = []
        param[b.i].equipName = []
        param[b.i].resValue = null
        param[b.i].insResult = null
      }
    })
  })
  tableList[0].arr.forEach(a => {
    a.forEach(b=>{
      if (b.v.ps != undefined &&typeof b.v.ps.value =='string'&& b.v.ps.value.includes('检验值')) {
@@ -867,7 +873,7 @@
    } else if (isPoint) {
      return str.replace('ABS', '').replace(/\(|\)/g, '')
    }else {
      // console.log('str', str)
      console.log('str', str,eval(str))
      return eval(str)
    }
  } catch (error) {