licp
2024-08-01 a133429e9c1dbe107e34646cdf859eafe166ab34
班次时间设置修改、多样品切换数据携带等bug更新
已修改5个文件
92 ■■■■ 文件已修改
src/components/do/b1-inspect-order-plan/Inspection.vue 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b1-report-preparation.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/view/b3-classes.vue 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/worker.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/worker0.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -1959,6 +1959,12 @@
            })
            this.getTableLists0(list)
            this.getReportModel(this.currentSample.id)
            this.worker.postMessage(JSON.stringify({
              type: 'saveData',
              tableList:this.tableList,
              param:this.param,
              currentTable:this.currentTable
            }));
          }else{
            this.tableLists = []
            this.tableList = []
@@ -2393,14 +2399,14 @@
          try {
            let comValue = JSON.parse(a.insProductResult.comValue)
            for (var i = 0; i < comValue.length; i++) {
              this.param[a.id].comValue[i].v.v = comValue[i].v
              this.param[a.id].comValue[i].v.v = this.toFixed(comValue[i].v,this.param[a.id].comValue[i].v.ct)
            }
          } catch (e) {}
          try {
            let insValue = JSON.parse(a.insProductResult.insValue)
            for (let i = 0; i < insValue.length; i++) {
              if(this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r)){
                this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).v.v = insValue[i].v
                this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).v.v = this.toFixed(insValue[i].v,this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).v.ct)
                this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).u = insValue[i].u
                // this.param[a.id].insValue[i].v.v = insValue[i].v
                // this.param[a.id].insValue[i].u = insValue[i].u
@@ -2469,7 +2475,7 @@
            }
          } catch (e) {}
          try {
            this.param[a.id].resValue.v.v = a.lastValue
            this.param[a.id].resValue.v.v = this.toFixed(a.lastValue,this.param[a.id].resValue.v.ct)
            this.param[a.id].insResult.v.v = a.insResult
          } catch (e) {}
        })
@@ -2675,6 +2681,15 @@
      },
      getValue(v){
        let str = v.v?v.v:(v.v===0?v.v:(v.ct&&v.ct.s?v.ct.s.length>0&&v.ct.s[0].v.replace(new RegExp('\n', 'g'), '<br/>').replace(new RegExp('@', 'g'), '<br/>'):''))
        if(v.ct&&v.ct.fa&&v.ct.fa.includes('.')&&str){
          let num = 0
          let str0 = v.ct.fa.split('.')[1]
          num = str0.length
          str = Number(str).toFixed(num)
        }
        if(v.v&&typeof v.v == 'string'&&v.v.includes('@')){
          str = v.v.replace(new RegExp('@', 'g'), '<br/>')
        }
        return str
      },
      getInspectionValueType(id) {
@@ -3052,6 +3067,12 @@
          }
        })
        this.getTableLists()
        this.worker.postMessage(JSON.stringify({
          type: 'saveData',
          tableList:this.tableList,
          param:this.param,
          currentTable:this.currentTable
        }));
      },
      caretBushing(num){
        let index = this.currentKey0 + num
@@ -3183,12 +3204,12 @@
       * @returns 格式化后的字符串或原始数值(若配置不符合要求)
       */
      toFixed(v,ct){
        if(v&&ct&&ct.fa&&ct.fa.includes('##')){
        if(v&&ct&&ct.fa){
          if(ct.fa.includes('.')){
            let num = ct.fa.slice(4).length
            return Number(v).toFixed(num)
          }else{
            return Number(v).toFixed(0)
            return v
          }
        }else{
          return v
src/components/view/b1-report-preparation.vue
@@ -86,7 +86,7 @@
        </div>
        <div class="btns">
          <el-button size="small" type="primary" @click="handleDowns" :loading="outLoading" style="margin-right: 16px;">批量下载</el-button>
          <!-- <el-upload
          <el-upload
            class="upload-demo"
            :action="action"
            :headers="headers"
@@ -97,8 +97,8 @@
            :on-success="handleSuccess"
            ref="upload"
            :on-error="onError">
            <el-button size="small" type="primary">批量上传</el-button>
          </el-upload> -->
            <el-button size="small" type="primary" :loading="inLoading">批量上传</el-button>
          </el-upload>
        </div>
      </div>
      <!-- <input id="input" type="file" accept=".doc,.docx"></input> -->
@@ -320,7 +320,8 @@
        currentInfo: null,
        option:null,
        mutiList:[],
        outLoading:false
        outLoading:false,
        inLoading:false
      }
    },
    computed: {
@@ -396,12 +397,18 @@
        if (!isZip) {
          this.$message.error('上传文件只能是 ZIP 格式!');
        }
        if(isZip){
          this.inLoading = true;
        }
        return isZip;
      },
      handleSuccess(response,){
        this.inLoading = false;
        if (response.code == 200) {
          this.$message.success('导入成功')
                }
                }else{
          this.$message.error(response.message)
        }
      },
      onError(err, file, fileList,type) {
                this.$message.error('上传失败')
src/components/view/b3-classes.vue
@@ -265,9 +265,9 @@
          </div>
          <div style="width: calc(100% - 260px);">
            <span class="form_label">时间:</span>
            <span v-if="!item.isEdit"> {{item.time === null ? '' : item.time[0] + '~' + item.time[1]}} </span>
            <span v-if="!item.isEdit"> {{item.startTime&&item.endTime ? item.startTime + '~' + item.endTime:''}} </span>
            <span class="form_input" v-if="item.isEdit">
            <el-time-picker
            <!-- <el-time-picker
              style="width: 200px;"
              is-range
              size="small"
@@ -278,7 +278,28 @@
              start-placeholder="开始时间"
              end-placeholder="结束时间"
              placeholder="选择时间范围">
            </el-time-picker>
            </el-time-picker> -->
            <el-time-select
              placeholder="起始时间"
              v-model="item.startTime"
              size="small"
              :picker-options="{
                start: '00:00',
                step: '00:15',
                end: '24:00'
              }" style="width: 120px;">
            </el-time-select>
            <el-time-select
              style="width: 120px;"
              placeholder="结束时间"
              v-model="item.endTime"
              size="small"
              :picker-options="{
                start: '00:00',
                step: '00:15',
                end: '24:00'
              }">
            </el-time-select>
          </span>
          </div>
          <span>
@@ -695,9 +716,9 @@
        if (res.data.length > 0) {
          res.data.forEach(item => {
            item.isEdit = false
            item.time = []
            item.time.push(item.startTime)
            item.time.push(item.endTime)
            // item.time = []
            // item.time.push(item.startTime)
            // item.time.push(item.endTime)
            const index = this.timeTypeList.findIndex(val => val.value === item.shift)
            if (index > -1) {
              item.type = this.timeTypeList[index].label
@@ -727,6 +748,7 @@
        }
      }
      delete item.orderBy
      delete item.time
      const isEmpty = this.isObjectEmpty(item)
      if (isEmpty) {
        this.$message.error('请填写完整')
@@ -735,8 +757,8 @@
      let newObj = {}
      let url = ''
      newObj.shift = item.shift
      newObj.startTime = item.time[0]
      newObj.endTime = item.time[1]
      newObj.startTime = item.startTime
      newObj.endTime = item.endTime
      url = this.$api.performanceShift.shiftAdd
      if (item.id) {
        // 有id为修改
static/js/worker.js
@@ -348,7 +348,7 @@
                      let num = 0
                      let str = a[b].v.ct.fa.split('.')[1]
                      num = str.length
                      a[b].v.v = comResult?Number(comResult).toFixed(num):0
                      a[b].v.v = comResult?Number(comResult).toFixed(num):comResult
                    }else{
                      let val = parseFloat(Number(comResult).toFixed(3))
                      a[b].v.v = isNaN(val) ? comResult : val
static/js/worker0.js
@@ -46,7 +46,7 @@
                  if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){
                    let str = n.v.ct.fa.split('.')[1]
                    num = str.length
                    n.v.v = dataAcquisitionInfo[str]?dataAcquisitionInfo[str].toFixed(num):0
                    n.v.v = dataAcquisitionInfo[str]?dataAcquisitionInfo[str].toFixed(num):dataAcquisitionInfo[str]
                  }else{
                    n.v.v = dataAcquisitionInfo[str]
                  }
@@ -66,7 +66,7 @@
                    if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){
                      let str = n.v.ct.fa.split('.')[1]
                      num = str.length
                      n.v.v = dataAcquisitionInfo[str]?Number(dataAcquisitionInfo[str]).toFixed(num):0
                      n.v.v = dataAcquisitionInfo[str]?Number(dataAcquisitionInfo[str]).toFixed(num):dataAcquisitionInfo[str]
                    }else{
                      n.v.v = dataAcquisitionInfo[str]
                    }