zss
2024-08-08 12dceacf931f4f29b1613eb06da8fd46d6375ebb
认领修改+松套管修改+不判定结论
已修改5个文件
224 ■■■■ 文件已修改
src/components/do/b1-ins-order/add.vue 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/Inspection.vue 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b1-inspect-order-plan.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/view/timer.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/worker.js 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-ins-order/add.vue
@@ -1585,16 +1585,24 @@
              }
              return true
          })
          //校验检验项的要求值和要求描述
          /* //校验检验项的要求值和要求描述
          const isTrue = this.checkRequiredValueAndRemark(filterProductList)
          if(!isTrue){
            this.$message.error('检验项的要求值与要求描述不匹配, 请检查')
            return
          } */
           //校验检验项的要求值和要求描述,仅委托要求
          if(this.isAskOnlyRead){
            const isTrue = this.checkRequiredValueAndRemark(filterProductList)
              if(!isTrue){
                this.$message.error('检验项的要求值与要求描述不匹配, 请检查')
                return
              }
          }
          console.log('isHaveBushing===', this.totalArr)
          // inspectionItem
          let spcialItem = null//this.totalArr.find(a => a.state == 1 && a.inspectionItem.includes('松套管'))
          let spcialItem = this.totalArr.find(a => a.state == 1 && a.inspectionItem.includes('松套管'))
          // console.log('isHaveBushing===', isHaveBushing)
          if (productListSelected && select[2] === '光缆' && isHaveBushing === false) {
            this.$message.error('光缆温度循环项目必须进行光纤配置')
@@ -1635,7 +1643,7 @@
          }
        }
      },
      checkRequiredValueAndRemark(data){
      /* checkRequiredValueAndRemark(data){
        let isTrue = true
        try{
          data.forEach(ele=>{
@@ -1678,7 +1686,62 @@
          isTrue = false
        }
        return isTrue
      }, */
      /**
       * 校验委托要求的检验项的要求描述和要求值
       *
       */
      checkRequiredValueAndRemark(data){
          let isTrue = true
        try{
          data.forEach(ele=>{
            //判断(≤,≥,>,<,=)这几种情况
            //判断要求值中的数字是否包含在要求描述中
            if(['≤','≥','>','<','='].includes(ele.ask[0])){
              const askVal = ele.ask.substring(1,ele.ask.length)
              if(isNaN(askVal) || ele.tell.indexOf(askVal)<0){
                isTrue = false
              }
            }
            //判断范围(10-25),要求值必须是-
            if(ele.ask.indexOf('-')>0 && ele.ask.length>1){
            //要求描述的~和要求值的-,等效
              let tell = ele.tell
              if(ele.tell.indexOf('~')>0){
                tell = ele.tell.replace('~','-')
              }
              const splits = ele.ask.split('-')
              //满足格式要求,并且两个都是数字
              if(splits.length==2 && !isNaN(splits[0]) && !isNaN(splits[1])){
              let min = Math.min(...splits)
              let max = Math.max(...splits)
              //判断±的情况
                if(ele.tell.indexOf('±')<0&&tell.indexOf(ele.ask)<0){
                  isTrue = false
                }else if(ele.tell.indexOf('±')>0&&ele.tell!=ele.ask){
                  let splitNums = ele.tell.split('±')
                  if(splitNums.length<2){
                    isTrue = false
                  }else{
                    let minTell = Number(splitNums[0])-Number(splitNums[1])
                    let maxTell = Number(splitNums[0])+Number(splitNums[1])
                    if(minTell!=min || maxTell!=max){
                      isTrue = false
                    }
                  }
                }
              }else{
                isTrue = false
              }
            }
          })
        }catch(error){
          console.log(error);
          isTrue = false
        }
        return isTrue
      },
      save0(){
        if(this.editTable.every(m=>m.value)){
          let sampleList = this.handleData(this.HaveJson(this.sampleList),this.handleAsk,1)
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -384,6 +384,7 @@
                    <template v-if="PROJECT=='检测中心'||PROJECT=='装备电缆'&&getInspectionValueType(n.i) != 2 ">
                      <span v-if="n.v.v===1" :style="`font-family:${n.v.ff} !important;color: green;`">合格</span>
                      <span v-else-if="n.v.v===0" :style="`font-family:${n.v.ff} !important;color: red;`">不合格</span>
                      <span v-else-if="n.v.v===3" :style="`font-family:${n.v.ff} !important;color: #3A7BFA;`">不判定</span>
                      <span v-else :style="`font-family:${n.v.ff} !important;`">待定</span>
                    </template>
                  </template>
@@ -612,6 +613,7 @@
              <template slot-scope="scope">
                <span v-if="scope.row.arr[index].insResult===1" style="color: green;">合格</span>
                <span v-else-if="scope.row.arr[index].insResult===0" style="color: red;">不合格</span>
                <span v-else-if="scope.row.arr[index].insResult===3" style="color: #3A7BFA;">不判定</span>
                <span v-else>待定</span>
              </template>
            </el-table-column>
@@ -691,6 +693,7 @@
                <template v-else>
                  <span v-if="item.insResult===1" style="color: green;">合格</span>
                  <span v-else-if="item.insResult===0" style="color: red;">不合格</span>
                  <span v-else-if="item.insResult===3" style="color: #3A7BFA;">不判定</span>
                  <span v-else>待定</span>
                </template>
              </td>
@@ -943,6 +946,7 @@
          requiredUp: []
        },
        upIndex: 0,
        changeType:null,
        getReportModelLoading:false,
        insOrder: {},
        sampleProduct: [],
@@ -1051,7 +1055,8 @@
          }
        ],
        getDataIndex:[],
        getDataIndexLoading:false
        getDataIndexLoading:false,
        changeType:null,
      }
    },
    computed: {
@@ -1109,15 +1114,18 @@
          }
          let list = await this.getCurrentProduct(this.currentSample.id,0)
          this.currentSample.insProduct = this.HaveJson(list)
          // console.log(this.currentSample)
          this.param = {}
          this.changeType = 0;
          this.currentSample.insProduct.forEach(a => {
            this.param[a.id] = {
              insValue: [],
              comValue: [],
              resValue: null,
              equipValue: [],
              equipName: [],
              insResult: null
            if(this.handleCasing(a.inspectionItem)){
              this.param[a.id] = {
                insValue: [],
                comValue: [],
                resValue: null,
                equipValue: [],
                equipName: [],
                insResult: null
              }
            }
          })
          this.determineWhetherToCollectData()
@@ -1143,19 +1151,30 @@
      },
      currentTable(val1, val0) {
        if (val0 != null && val1 != val0) {
          if(this.tableLists.find(m=>m.templateId==val1)&&(this.tableLists.find(m=>m.templateId==val1).templateName=='成品缆检验原始记录')){
            if(this.casing.length>0){
              this.handleChange(this.casing[0].id,3)
            }
            return
          }
          if(this.changeType&&this.changeType>0){
            return
          }
          this.tableLists.forEach(async (m, i) => {
            if (m.templateId == val1) {
              let list = await this.getCurrentProduct(this.currentSample.id,0)
              this.currentSample.insProduct = this.HaveJson(list)
              // console.log(this.currentSample)
              this.param = {}
              this.currentSample.insProduct.forEach(a => {
                this.param[a.id] = {
                  insValue: [],
                  comValue: [],
                  resValue: null,
                  equipValue: [],
                  equipName: [],
                  insResult: null
                if(this.handleCasing(a.inspectionItem)){
                  this.param[a.id] = {
                    insValue: [],
                    comValue: [],
                    resValue: null,
                    equipValue: [],
                    equipName: [],
                    insResult: null
                  }
                }
              })
              this.getReportModel(this.currentSample.id)
@@ -1184,12 +1203,6 @@
              }
            }
          })
          this.handleCasing()
          if(this.tableLists.find(m=>m.templateId==val1)&&(this.tableLists.find(m=>m.templateId==val1).templateName=='成品缆检验原始记录')){
            if(this.casing.length>0){
              this.handleChange(this.casing[0].id,3)
            }
          }
        }
      },
      equipForm:{
@@ -1351,7 +1364,6 @@
                      maxNum = num
                    }
                  }
                  console.log('data[i][j].equipName',data[i][j].equipName,'data[i][j].equipValue',data[i][j].equipValue,'m.v',m.v,'m.v.ps',m.v.ps,'m.v.ps.value',m.v.ps.value,'str0',str0,'str',str,'m.v.v',m.v.v)
                  if(data[i][j].equipName&&data[i][j].equipValue&&m.v&&m.v.ps&&m.v.ps.value=='设备编码'&&str0==str){
                    if(!m.v.v){
                      this.changeEquip(data[i][j].equipValue,m,data[i][j].equipName)
@@ -2049,15 +2061,18 @@
        this.currentSample = this.HaveJson(row)
        let list = await this.getCurrentProduct(row.id,0)
        this.currentSample.insProduct = this.HaveJson(list)
        this.handleCasing()
        this.param = {}
        this.changeType = 0;
        this.currentSample.insProduct.forEach(a => {
          this.param[a.id] = {
            insValue: [],
            comValue: [],
            resValue: null,
            equipValue: [],
            equipName: [],
            insResult: null
          if(this.handleCasing(a.inspectionItem)){
            this.param[a.id] = {
              insValue: [],
              comValue: [],
              resValue: null,
              equipValue: [],
              equipName: [],
              insResult: null
            }
          }
        })
        this.getReportModel(row.id)
@@ -2076,9 +2091,15 @@
          currentTable:this.currentTable
        }));
      },
      handleCasing(){
        if(this.tableLists.find(m=>m.templateId==this.currentTable)&&(this.tableLists.find(m=>m.templateId==this.currentTable).templateName!='成品缆检验原始记录')){
          this.currentSample.insProduct = this.currentSample.insProduct.filter(m=>!m.inspectionItem.includes('松套管'))
      handleCasing(inspectionItem){
        if(this.changeType!=3){
          if(inspectionItem.includes('松套管')){
            return false
          }else{
            return true
          }
        }else{
          return true
        }
      },
      getReportModel(id){
@@ -2094,9 +2115,11 @@
        })
      },
      async handleChange(m,type){
        this.changeType = type
        if(m){
          let list = await this.getCurrentProduct(m,type)
          if(list.length>0){
            this.param = {}
            list.forEach(a => {
              this.param[a.id] = {
                insValue: [],
@@ -2646,6 +2669,23 @@
        //     return
        //   }
        // }
        let str = code.split('-')
        let pId = str[3]
        for(let i =0;i<this.currentSample.insProduct.length;i++){
          if(this.currentSample.insProduct[i].id==pId&&(this.currentSample.insProduct[i].ask=='-'||this.currentSample.insProduct[i].ask=='/')){
            this.tableList[0].arr.forEach(item=>{
              item.forEach(m=>{
                if(m.i==pId&&m.v.ps&&m.v.ps.value=='结论'){
                    this.$set(m.v,'v',3)
                }
              })
            })
            if(this.param[pId].insResult&&this.param[pId].insResult.v){
            }
            this.saveInsContext()
            return
          }
        }
        if (n) {
          // if (this.PROJECT === '装备电缆') {
          //   let num2 = new this.$Big(n.v.v)
@@ -3216,16 +3256,18 @@
        this.currentSample = this.HaveJson(this.sampleProduct[index - 1])
        let list = await this.getCurrentProduct(this.currentSample.id,0)
        this.currentSample.insProduct = this.HaveJson(list)
        this.handleCasing()
        this.param = {}
        this.changeType = 0;
        this.currentSample.insProduct.forEach(a => {
          this.param[a.id] = {
            insValue: [],
            comValue: [],
            resValue: null,
            equipValue: [],
            equipName: [],
            insResult: null
          if(this.handleCasing(a.inspectionItem)){
            this.param[a.id] = {
              insValue: [],
              comValue: [],
              resValue: null,
              equipValue: [],
              equipName: [],
              insResult: null
            }
          }
        })
        this.getTableLists()
src/components/view/b1-inspect-order-plan.vue
@@ -303,14 +303,14 @@
                        font: '数据查看',
                        type: 'text',
                        method: 'handleDataLook',
            disabFun: (row, index) => {
            /* disabFun: (row, index) => {
              const user = JSON.parse(localStorage.getItem('user'))
              let currentUserName = ''
              if(user){
                currentUserName = user.name
              }
                            return row.userName!=currentUserName && row.checkName!=currentUserName
                        }
                        } */
                    },{
                            id: '',
                            font: '检验',
@@ -345,7 +345,7 @@
                            type: 'text',
                            method: 'claimFun',
                            disabFun: (row, index) => {
                                return row.userName != null||(row.userName&&!row.userName.includes(JSON.parse(localStorage.getItem("user")).name))
                                return row.userName != null || row.checkName!=null
                            }
                        }
                    ],
@@ -452,6 +452,7 @@
                }
            },
            changeCheckBox(val) {
                console.log(111,val)
                this.componentData.entity.userId = val?0:null
                this.refreshTable()
            },
@@ -468,7 +469,7 @@
                    this.sampleUserForm = {
                        entrustCode: row.entrustCode,
                        insSampleId: row.id,
            sonLaboratory: row.sonLaboratory,
                        sonLaboratory: this.componentData.entity.sonLaboratory,
                    }
                    this.claimVisible = true
                }
src/view/timer.vue
@@ -35,7 +35,7 @@
      const hours = now.getHours();
      const minutes = now.getMinutes();
      if (hours === 20 && minutes === 0) {
      if (hours === 22 && minutes === 0) {
        this.performTask();
        // 设置20分钟后提示关闭
        this.closeTimeout = setTimeout(() => {
static/js/worker.js
@@ -361,7 +361,7 @@
                      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)
                    // console.log('a[b].v.v', a[b])
                  }catch(error){
                    a[b].v.v = comResult
                    console.log('error---', error)
@@ -486,7 +486,7 @@
        b.i &&b.v.v&& param[b.i].insValue.push(b)
      }
      if (b.v.ps != undefined && b.v.ps.value === '计算值') {
        b.i &&b.v.v&& param[b.i].comValue.push(b)
        b.i &&b.v.v&&b.valueList&&b.valueList.length>0&& param[b.i].comValue.push(b)
      }
      if (b.v.ps != undefined && b.v.ps.value === '设备编码') {
        b.i &&b.v&& param[b.i].equipValue.push(b)
@@ -495,7 +495,7 @@
        b.i &&b.v&& param[b.i].equipName.push(b)
      }
      if (b.v.ps != undefined && b.v.ps.value === '最终值') {
        b.i &&b.v&& (param[b.i].resValue = b)
        b.i &&b.v&&b.valueList&&b.valueList.length>0&& (param[b.i].resValue = b)
      }
      if (b.v.ps != undefined && b.v.ps.value === '结论') {
        if(b.i &&(b.v.v||b.v.v===0||b.v.v==='0')){
@@ -519,7 +519,7 @@
function SUM(...val){
  try {
    let num = null;
    if(val!=null&&val!=undefined&&val!='undefined'&&val.length>0){
    if(val!=null&&val!=undefined&&val!='undefined'&&val!='NaN'&&val.length>0){
      val.forEach(item=>{
        num+=item;
      })
@@ -538,7 +538,7 @@
function MAX(...val){
  try {
    let max = null;
    if(val!=null&&val!=undefined&&val!='undefined'&&val.length>0){
    if(val!=null&&val!=undefined&&val!='undefined'&&val!='NaN'&&val.length>0){
      val = val.filter(item=>item!=null&&item!=='')
      if(val.length>0){
        max = Math.max(...val)
@@ -560,7 +560,7 @@
function MIN(...val){
  try {
    let min = null;
    if(val!=null&&val!=undefined&&val!='undefined'&&val.length>0){
    if(val!=null&&val!=undefined&&val!='undefined'&&val!='NaN'&&val.length>0){
      val = val.filter(item=>item!=null&&item!=='')
      if(val.length>0){
        min = Math.min(...val)
@@ -581,7 +581,7 @@
  try {
    let num = null;
    let arr = [];
    if(val!=null&&val!=undefined&&val!='undefined'&&val.length>0){
    if(val!=null&&val!=undefined&&val!='undefined'&&val!='NaN'&&val.length>0){
      arr = val.filter(item=>item!==null&&item!==''&&item!=undefined)
      arr.forEach(item=>{
        num+=item;
@@ -884,7 +884,7 @@
    } else if (isPoint) {
      return str.replace('ABS', '').replace(/\(|\)/g, '')
    }else {
      console.log('str', str,eval(str))
      console.log('str', str)
      return eval(str)
    }
  } catch (error) {