gaoluyang
2025-04-12 5d2f451118fe4a2b4076972e3269ce93882e5cb9
src/views/business/inspectionTask/components/InspectionWord.vue
@@ -17,8 +17,8 @@
            </el-radio-group>
          </div>
          <div style="display: flex;align-items: center;">
            <span v-if="typeSource == '1'">&nbsp;&nbsp;复测次数:</span>
            <el-select v-if="typeSource == '1'" v-model="retestTag" placeholder="请选择" size="small"
            <span>&nbsp;&nbsp;复测次数:</span>
            <el-select v-model="retestTag" placeholder="请选择" size="small"
              @change="m => handleChangeCableTag(currentSample.id, 4, 'cableTag', m)">
              <el-option v-for="item in unPassNumList" :key="item.retestTag" :label="item.retestTag"
                :value="item.retestTag">
@@ -33,16 +33,16 @@
            <tbody>
              <tr v-for="(m, i) in item.arr" :key="i">
                <td v-for="(n, j) in m" v-if="n.v.mc == undefined || Object.keys(n.v.mc).length === 4"
                  :id='item.templateId + "-" + n.i + "-" + n.r + "-" + n.c' :key="j" :colspan="n.v.mc && n.v.mc.cs ? n.v.mc.cs : 1"
                  :rowspan="n.v.mc && n.v.mc.rs ? n.v.mc.rs : 1"
                  :id='item.templateId + "-" + n.i + "-" + n.r + "-" + n.c' :key="j"
                  :colspan="n.v.mc && n.v.mc.cs ? n.v.mc.cs : 1" :rowspan="n.v.mc && n.v.mc.rs ? n.v.mc.rs : 1"
                  :style="`background:${n.v.bg ? n.v.bg : ''};color:${n.v.fc};font-size:${n.v.fs}px;width:${handleWidth(n)}px !important;height:${item.style.rowlen[n.r]}px;font-wight:${n.v.bl ? 'bold' : ''};`">
                  <div :class="`content-h-${n.v.ht} content-v-${n.v.vt}`"
                    :style="`width:${handleWidth(n)}px !important;min-height:${item.style.rowlen[n.r]}px;`"
                    class="content">
                    <template
                      v-if="n.v.ps != undefined && typeof n.v.ps.value === 'string' && n.v.ps.value.includes('检验值') && state == 1">
                      <el-input v-if="getInspectionValueType(n.i) == 1" :key="'abc-' + '000' + index + '000' + i + '000' + j"
                        v-model="n.v.v"
                      <el-input v-if="getInspectionValueType(n.i) == 1"
                        :key="'abc-' + '000' + index + '000' + i + '000' + j" v-model="n.v.v"
                        :disabled="(getInspectionItemType(n.i) == 1 && !dataAcquisitionEidtAble) || (n.u != userId && n.u != undefined && n.u != '')"
                        class="table_input"
                        @change="m => changeInput(m, `${item.templateId}-${n.r}-${n.c}-${n.i}`, n, 'getDataType')"
@@ -125,7 +125,8 @@
                    </template>
                    <template v-else-if="n.v.ps != undefined && n.v.ps.value === '套管'">
                      <div style="display: flex;flex-wrap: nowrap;align-items: center;">
                        <div :style="`font-family:${n.v.ff} !important;`">{{ currentBushing ? currentBushing.color : '' }}
                        <div :style="`font-family:${n.v.ff} !important;`">{{ currentBushing ? currentBushing.color : ''
                          }}
                        </div>
                      </div>
                    </template>
@@ -240,8 +241,6 @@
</template>
<script>
// import ValueTable from '../../tool/value-table.vue'
import file from '@/utils/file'
import excelFunction from '@/utils/excelFountion'
import UnPassDialog from "@/views/business/unpass/components/unPassDialog.vue";
import AddUnPass from "@/views/business/unpass/components/addUnPass.vue";
@@ -254,8 +253,10 @@
  verifyPlan
} from "@/api/business/inspectionTask";
import { getUserNow, saveUnqualifiedContext } from "@/api/business/rawMaterialOrder";
import InspectionWorker from '@/workers/InspectionWorker.worker';
import DataWorker from '@/workers/DataWorker.worker';
export default {
  props: ['sonLaboratory', 'orderId', 'state', 'inspectorList', 'typeSource', 'unPassCheck', 'rawMaterialTag'],
  props: ['sonLaboratory', 'orderId', 'state', 'inspectorList', 'typeSource', 'unPassCheck', 'rawMaterialTag','cableTag', 'repetitionTag'],
  components: {
    AddUnPass,
    UnPassDialog
@@ -428,7 +429,7 @@
      getDataTypeId: '',
      getDataType: null,
      unPassDialog: false, // 不合格处理弹框
      retestTag: '', // 复测次数
      retestTag: '1', // 复测次数
      addCheck: false, // 指定审核人员弹框
      checkUser: '',
      type: '',
@@ -515,7 +516,7 @@
            }
          }
        })
        await this.determineWhetherToCollectData()//是否需要数采
        // await this.determineWhetherToCollectData()//是否需要数采
        if (this.currentSample.index == undefined) this.currentSample['index'] = 1
        let bushing = this.currentSample.bushing
        this.getTableLists();//处理模板列表信息
@@ -818,12 +819,12 @@
        this.stopWorker(); // 确保之前的 Worker 已停止
      }
      // 创建 Worker 实例
      this.worker = new Worker('/static/js/worker.js');
      this.worker = new InspectionWorker();
      if (this.worker0) {
        this.stopWorker(); // 确保之前的 Worker 已停止
      }
      // 创建 Worker 实例
      this.worker0 = new Worker('/static/js/worker0.js');
      this.worker0 = new DataWorker();
    },
    // 停止多线程
    stopWorker() {
@@ -847,8 +848,11 @@
        laboratory: this.sonLaboratory,
        retestTag: this.retestTag,
        rawMaterialTag: this.rawMaterialTag,
        repetitionTag: this.repetitionTag,
        cableTag: this.cableTag,
      }
      let res = getInsProductUnqualifiedRetest(params)
      let res = await getInsProductUnqualifiedRetest(params)
      console.log('res---', res)
      if (res.code === 200 && res.data.length > 0) {
        this.tableLoading = false;
        this.scrollInit()
@@ -1282,7 +1286,8 @@
          }
        })
        // 以下是样式处理逻辑
        set = Array.sort(set)
        // set = Array.sort(set)
        set = [...set]
        set.forEach(b => {
          let arr = []
          a.template.forEach(c => {
@@ -1478,10 +1483,10 @@
      }, 200)
    },
    // 是否需要数采
    async determineWhetherToCollectData() {
      let res = determineWhetherToCollectData({ managementNumber: '' })
      this.isGet = res.data
    },
    // async determineWhetherToCollectData() {
    //   let res = determineWhetherToCollectData({ managementNumber: '' })
    //   this.isGet = res.data
    // },
    // 根据后端传参更新页面数据   param => this.tableList[0].insProductResult
    getCurrentInsProduct(pId) {
      if (!this.tableList[0].insProductResult) {
@@ -1848,10 +1853,6 @@
            currentTable: this.currentTable,
            sampleId: this.currentSample.id
          }).then(res => {
            if (res.code == 201) {
              this.$message.error('保存失败')
              return
            }
            this.$message.success('已保存')
          })
          // 向 Worker 发送消息,开始处理逻辑
@@ -1924,7 +1925,7 @@
      }
    },
    getAuthorizedPerson() {
      selectUserCondition({ type: 0 }).then((res) => {
      selectUserCondition({ type: 1 }).then((res) => {
        let data = [];
        res.data.forEach((a) => {
          data.push({
@@ -2036,7 +2037,7 @@
      downFile({
        id: row.id,
      }).then(res => {
        this.$download.downloadFileFromUrl(res.data.fileUrl, row.fileName);
        this.$download.saveAs(res.data.fileUrl, row.fileName);
      }).catch(error => {
      })
@@ -2194,7 +2195,7 @@
}
.content-h-2 {
  justify-content: end;
  justify-content: flex-end;
}
.content-v-0 {