zouyu
昨天 2e4a6c4526b6c22808d5877f2050da852bfaebe7
src/views/business/inspectionTask/inspection.vue
@@ -1,7 +1,7 @@
<template>
  <div v-loading="loading" class="inspection" style="background-color: rgb(245, 247, 251);">
    <el-row class="title">
      <el-col :span="8" style="text-align: left">
      <el-col v-if="insOrder.ifsOrderType!=='02wg'" :span="8" style="text-align: left">
        <el-form :inline="true" :model="otherForm" class="form-inline" label-width="50px"
          style="text-align: right; padding-top: 0; display: inline">
          <el-form-item label="温度:" style="margin-bottom: 0">
@@ -16,12 +16,14 @@
          </el-form-item>
        </el-form>
      </el-col>
      <el-col :span="16" style="text-align: right">
      <el-col :span="insOrder.ifsOrderType!=='02wg'?16:24" style="text-align: right">
        <el-button v-if="insOrder.ifsOrderType && insOrder.ifsOrderType==='02wg'" size="small" type="primary" @click="showMaterialPropsDialog">IFS物料属性更新</el-button>
        <el-button size="small" type="primary" @click="refreshView">刷新</el-button>
        <el-button v-if="typeSource == 1" size="small" type="primary" @click="openPurchase">进货验证</el-button>
        <el-button v-if="state == 1 && typeSource == 1" size="small" type="primary" @click="openUnPassDialog('add')">不合格处理</el-button>
        <el-button size="small" type="primary" @click="sampleVisible = true;uploadSample();">样品切换</el-button>
<!--        <el-button v-if="state == 1" size="small" type="primary" @click="taskVisible = true">任务切换</el-button>-->
        <el-button v-if="state == 1 && [0,1].includes(Number(typeSource))" size="small" type="primary"
          @click="openUnPassDialog('add')">不合格处理</el-button>
        <el-button size="small" type="primary" @click="sampleVisible = true; uploadSample();">样品切换</el-button>
        <!--        <el-button v-if="state == 1" size="small" type="primary" @click="taskVisible = true">任务切换</el-button>-->
        <el-button v-if="state == 1" size="small" type="primary" @click="addVerifyDia = true">提交</el-button>
        <!-- 复核 -->
        <el-button v-if="state == 2" size="medium" type="primary" @click="openAddCheck">通过</el-button>
@@ -31,49 +33,94 @@
      </el-col>
    </el-row>
    <div class="search">
      <el-form :inline="true" :model="searchForm" class="form-inline" label-position="right" label-width="100px">
        <el-form-item label="委托编号:">
          <el-input v-model="insOrder.entrustCode" clearable disabled placeholder="请输入" size="small"></el-input>
        </el-form-item>
        <el-form-item label="样品编号:">
          <el-tooltip :content="currentSample.sampleCode" :disabled="!currentSample.sampleCode">
            <el-input v-model="currentSample.sampleCode" clearable disabled placeholder="请输入" size="small"></el-input>
          </el-tooltip>
        </el-form-item>
        <el-form-item label="样品名称:">
          <el-input v-model="currentSample.sample" clearable disabled placeholder="请输入" size="small"></el-input>
        </el-form-item>
        <el-form-item label="样品数量:">
          <el-input v-model="sampleProduct.length" clearable disabled placeholder="请输入" size="small"></el-input>
        </el-form-item>
        <el-form-item label="样品型号:">
          <el-input v-model="currentSample.model" clearable disabled placeholder="请输入" size="small"></el-input>
        </el-form-item>
        <el-form-item label="下发时间:">
          <el-input v-model="insOrder.sendTime" clearable disabled placeholder="请输入" size="small"></el-input>
        </el-form-item>
        <el-form-item label="紧急程度:">
          <el-input v-model="insOrder.typeName" clearable disabled placeholder="请输入" size="small"></el-input>
        </el-form-item>
        <el-form-item label="约定时间:">
          <el-input v-model="insOrder.appointed" clearable disabled placeholder="请输入" size="small"></el-input>
        </el-form-item>
        <el-form-item v-if="typeSource === 1" label="抽检数量:">
          <el-input v-model="insOrder.testQuantity" clearable disabled placeholder="请输入" size="small"></el-input>
        </el-form-item>
        <el-form-item v-if="typeSource === 1" label="厂家密度:">
          <el-input v-model="supplierDensity" clearable disabled placeholder="请输入" size="small"></el-input>
        </el-form-item>
        <el-form-item label="当前样品位数:" label-width="120px">
          <el-tag v-if="currentKey">{{ `NO.${currentKey}` }}</el-tag>
        </el-form-item>
        <el-form-item label="备注:">
          <!--          <span style="color:red">{{ insOrder.remark?insOrder.remark:'-' }}</span>-->
<!--      <el-form :inline="true" :model="searchForm" class="form-inline" label-position="right" label-width="100px">-->
<!--        <el-form-item label="委托编号:">-->
<!--          <el-input v-model="insOrder.entrustCode" clearable disabled placeholder="请输入" size="small"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="样品编号:">-->
<!--          <el-tooltip :content="currentSample.sampleCode" :disabled="!currentSample.sampleCode">-->
<!--            <el-input v-model="currentSample.sampleCode" clearable disabled placeholder="请输入" size="small"></el-input>-->
<!--          </el-tooltip>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="样品名称:">-->
<!--          <el-input v-model="currentSample.sample" clearable disabled placeholder="请输入" size="small"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="样品数量:">-->
<!--          <el-input v-model="sampleProduct.length" clearable disabled placeholder="请输入" size="small"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="样品型号:">-->
<!--          <el-input v-model="currentSample.model" clearable disabled placeholder="请输入" size="small"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="下发时间:">-->
<!--          <el-input v-model="insOrder.sendTime" clearable disabled placeholder="请输入" size="small"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="紧急程度:">-->
<!--          <el-input v-model="insOrder.typeName" clearable disabled placeholder="请输入" size="small"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="约定时间:">-->
<!--          <el-input v-model="insOrder.appointed" clearable disabled placeholder="请输入" size="small"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item v-if="typeSource === 1" label="抽检数量:">-->
<!--          <el-input v-model="insOrder.testQuantity" clearable disabled placeholder="请输入" size="small"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item v-if="typeSource === 1" label="厂家密度:">-->
<!--          <el-input v-model="supplierDensity" clearable disabled placeholder="请输入" size="small"></el-input>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="当前样品位数:" label-width="120px">-->
<!--          <el-tag v-if="currentKey">{{ `NO.${currentKey}` }}</el-tag>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="备注:">-->
<!--          &lt;!&ndash;          <span style="color:red">{{ insOrder.remark?insOrder.remark:'-' }}</span>&ndash;&gt;-->
<!--          <el-input v-model="insOrder.remark" :disabled="state != 1" clearable placeholder="请输入" size="small"-->
<!--            @blur="subOtherForm(insOrder.remark, 'remark')"></el-input>-->
<!--          &lt;!&ndash; <el-tag v-if="currentKey">{{ insOrder.remark }}</el-tag> &ndash;&gt;-->
<!--        </el-form-item>-->
<!--        <template v-if="insOrder.isSplitOrder && insOrder.isSplitOrder===1">-->
<!--          <el-form-item label="外护颜色:">-->
<!--            <el-input v-model="insOrder.outerColor" clearable disabled placeholder="" size="small"></el-input>-->
<!--          </el-form-item>-->
<!--          <el-form-item label="绝缘颜色:">-->
<!--            <el-input v-model="insOrder.insulationColor" clearable disabled placeholder="" size="small"></el-input>-->
<!--          </el-form-item>-->
<!--          <el-form-item label="盘号:">-->
<!--            <el-input v-model="insOrder.drumNo" clearable disabled placeholder="" size="small"></el-input>-->
<!--          </el-form-item>-->
<!--        </template>-->
<!--      </el-form>-->
      <el-descriptions title="检验单概况" :column="4" border>
        <template v-if="insOrder.ifsOrderType">
          <el-descriptions-item label="零件号">{{insOrder.partNo}}</el-descriptions-item>
          <el-descriptions-item label="零件名称">{{insOrder.partDetail}}</el-descriptions-item>
          <el-descriptions-item label="批次号">{{ insOrder.lotBatchNo }}</el-descriptions-item>
          <el-descriptions-item label="样品型号" >{{currentSample.model}}</el-descriptions-item>
          <el-descriptions-item label="抽检数量">{{insOrder.testQuantity}}</el-descriptions-item>
          <el-descriptions-item label="厂家密度">{{supplierDensity}}</el-descriptions-item>
          <template v-if="insOrder.ifsOrderType && insOrder.ifsOrderType==='02wg'">
            <el-descriptions-item label="载具编号">{{insOrder.drumNo}}</el-descriptions-item>
            <el-descriptions-item label="起始米标(km)">{{insOrder.startMeterMark}}</el-descriptions-item>
            <el-descriptions-item label="截止米标(km)">{{insOrder.endMeterMark}}</el-descriptions-item>
            <el-descriptions-item label="入库长度(km)">{{calcInbondLength(insOrder.startMeterMark,insOrder.endMeterMark)}}</el-descriptions-item>
            <el-descriptions-item label="绝缘颜色">{{insOrder.insulationColor}}</el-descriptions-item>
            <el-descriptions-item label="外护颜色">{{insOrder.outerColor}}</el-descriptions-item>
            <el-descriptions-item label="印字信息">{{insOrder.letteringInfo}}</el-descriptions-item>
          </template>
        </template>
        <template v-else>
          <el-descriptions-item label="委托编号">{{ insOrder.entrustCode }}</el-descriptions-item>
          <el-descriptions-item label="样品编号">{{ currentSample.sampleCode }}</el-descriptions-item>
          <el-descriptions-item label="样品名称">{{ currentSample.sample }}</el-descriptions-item>
          <el-descriptions-item label="样品数量">{{ sampleProduct.length }}</el-descriptions-item>
          <el-descriptions-item label="样品型号">{{ currentSample.model }}</el-descriptions-item>
          <el-descriptions-item label="下发时间">{{ insOrder.sendTime }}</el-descriptions-item>
          <el-descriptions-item label="紧急程度">{{ insOrder.typeName }}</el-descriptions-item>
          <el-descriptions-item label="约定时间">{{ insOrder.appointed }}</el-descriptions-item>
        </template>
        <el-descriptions-item label="当前样品位数"><el-tag v-if="currentKey">{{ `NO.${currentKey}` }}</el-tag></el-descriptions-item>
        <el-descriptions-item label="备注">
          <el-input v-model="insOrder.remark" :disabled="state != 1" clearable placeholder="请输入" size="small"
            @blur="subOtherForm(insOrder.remark, 'remark')"></el-input>
          <!-- <el-tag v-if="currentKey">{{ insOrder.remark }}</el-tag> -->
        </el-form-item>
      </el-form>
                    @blur="subOtherForm(insOrder.remark, 'remark')"></el-input>
        </el-descriptions-item>
      </el-descriptions>
    </div>
    <div class="center">
      <div class="search" style="
@@ -287,7 +334,7 @@
                      state == 1
                    "><span :style="`font-family:${n.v.ff} !important;`">{{
                      toFixed(n.v.v, n.v.ct)
                        }}</span></template>
                    }}</span></template>
                    <template v-else-if="
                      n.v.ps != undefined &&
                      n.v.ps.value === '最终值' &&
@@ -343,6 +390,7 @@
    </div>
    <el-drawer :size="550" :visible.sync="sampleVisible" title="样品切换">
      <el-table v-if="sampleVisible" ref="productTable" :current-row-key="currentKey" :data="sampleProduct"
                :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border
        :row-class-name="tableRowClassName" :row-key="(record) => record.index" border class="el-table" height="100%"
        highlight-current-row tooltip-effect="dark" @row-click="handleChangeSample">
        <el-table-column :key="Math.random()" align="center" label="序号" type="index" width="70px">
@@ -499,25 +547,76 @@
        <el-button :loading="reviewLoading" type="primary" @click="upInsReview(1)">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 添加不合格复测弹框-->
    <add-un-pass v-if="addUnPassDialog" ref="addUnPassDialog" :addUnPassDialog="addUnPassDialog"
      @resetAddUnPass="resetAddUnPass"></add-un-pass>
    <!-- 不合格处理弹框-->
    <UnPassDialog v-if="unPassDialog" ref="unPassDialog" :orderId="orderId" :unPassDialog="unPassDialog"
      @resetForm="resetForm"></UnPassDialog>
    <!-- 不合格复测弹框-->
    <InspectionWord v-if="unPassCheck" :inspectorList="inspectorList" :orderId="orderId"
                    :cableTag="temCableTag" :repetitionTag="repetitionTag"
      :rawMaterialTag="rawMaterialTag" :sonLaboratory="sonLaboratory" :state="state" :typeSource="typeSource"
      :unPassCheck="unPassCheck" @closeUnPassCheckDialog="closeUnPassCheckDialog" @refreshView="refreshView" />
    <!-- 进货验证弹框-->
    <purchase-verification v-if="purchaseDialog" ref="purchaseDialog" :orderId="orderId"
      :purchaseDialog="purchaseDialog" @resetPurchaseDialog="resetPurchaseDialog"></purchase-verification>
    <!--查看工时弹框-->
    <viewManHourDia ref="viewManHourDia" @submit="openAddVerifyDia"></viewManHourDia>
    <!--    IFS物料属性编辑弹框-->
    <el-dialog
      title="更新IFS库存物料批次属性"
      :visible.sync="ifsMaterialPropsVisible"
      width="20%">
      <el-form style="width:100%" :model="ifsMaterialPropsForm">
        <el-form-item label="载具编号(Attr1):">
          <el-input placeholder="载具编号" size="small" v-model="ifsMaterialPropsForm.drumNo"></el-input>
        </el-form-item>
        <el-form-item label="起始米标(Attr2):">
          <el-input @blur="validateQuality()" placeholder="起始米标" size="small" v-model="ifsMaterialPropsForm.startMeterMark">
            <span slot="suffix">km</span>
          </el-input>
        </el-form-item>
        <el-form-item label="截止米标(Attr3):">
          <el-input @blur="validateQuality()" placeholder="截止米标" size="small" v-model="ifsMaterialPropsForm.endMeterMark">
            <span slot="suffix">km</span>
          </el-input>
        </el-form-item>
        <!--        <el-form-item label="入库长度">-->
        <!--          <el-input v-model="ifsMaterialPropsForm.inboundLength"></el-input>-->
        <!--        </el-form-item>-->
        <el-form-item label="外护颜色(Attr4):">
          <el-select size="small" v-model="ifsMaterialPropsForm.outerColor">
            <el-option v-for="(item,index) in outerColorList" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="绝缘颜色(Attr5):">
          <el-select size="small" v-model="ifsMaterialPropsForm.insulationColor">
            <el-option v-for="(item,index) in insulationColorList" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="印字信息(Attr8):">
          <el-select size="small" v-model="ifsMaterialPropsForm.letteringInfo" placeholder="请选择">
            <el-option v-for="(item,index) in letteringInfoList" :label="item.dictLabel" :value="item.dictValue" :key="index"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
    <el-button @click="closePartPropDialog()">取 消</el-button>
    <el-button type="primary" @click="saveOrUpdatePartProp()">确 定</el-button>
  </span>
    </el-dialog>
  </div>
</template>
<script>
import excelFunction from "@/utils/excelFountion";
import limsTable from "@/components/Table/lims-table.vue";
import UnPassDialog from "../unpass/components/addUnPass.vue";
import UnPassDialog from "../unpass/components/unPassDialog.vue";
import AddUnPass from "../unpass/components/addUnPass.vue";
import InspectionWord from "./components/InspectionWord.vue";
import PurchaseVerification from "../unpass/components/PurchaseVerification.vue";
import {getOneByIfsId,saveOrUpdateProps} from "@/api/business/ifsPartProps.js";
import {
  doInsOrder,
  getCableTag,
@@ -537,13 +636,16 @@
  delfile,
  inspectionOrderDetailsTaskSwitching
} from "@/api/business/inspectionTask.js";
import InspectionWorker from '../../../InspectionWorker.worker';
import DataWorker from '../../../DataWorker.worker';
import InspectionWorker from '@/workers/InspectionWorker.worker.js';
import DataWorker from '@/workers/DataWorker.worker.js';
import html2canvas from "html2canvas";
import { mapGetters } from "vuex";
import viewManHourDia from "@/views/business/inspectionTask/components/viewManHourDia.vue";
import {getDicts} from "@/api/system/dict/data";
export default {
  name: 'inspection',
  name: 'Inspection',
  components: {
    viewManHourDia,
    PurchaseVerification,
    AddUnPass,
    limsTable,
@@ -552,6 +654,21 @@
  },
  data() {
    return {
      outerColorList:[],
      insulationColorList:[],
      letteringInfoList: [],
      ifsMaterialPropsForm:{
        id:null,
        ifsInventoryId: null,
        drumNo: '', // 载具编号
        startMeterMark: '', // 起始米标
        endMeterMark: '', // 截止米标
        insulationColor: '', // 绝缘颜色
        outerColor: '', // 外护颜色
        inboundLength: '', // 入库长度
        letteringInfo: '', // 印字信息
      },
      ifsMaterialPropsVisible:false,
      sonLaboratory: null,
      orderId: null,
      state: null,
@@ -724,7 +841,6 @@
        size: 10,
        current: 0,
      },
      tableLoading: false,
      // 文件列表相关--结束
      // 任务切换列表--开始
      tableData0: [],
@@ -759,6 +875,7 @@
      },
      tableLoading0: false,
      // 任务切换列表--结束
      isSplit: 0, // 是否是拆单过来的
    };
  },
  // 用于上传文件的信息
@@ -769,7 +886,7 @@
    },
  },
  created() {
    let { sonLaboratory, orderId, state, inspectorList, typeSource } =
    let { sonLaboratory, orderId, state, inspectorList, typeSource,isSplit } =
      this.$route.query;
    this.sonLaboratory = sonLaboratory;
    this.orderId = orderId;
@@ -777,13 +894,22 @@
    this.state = state;
    this.inspectorList = inspectorList;
    this.typeSource = typeSource;
    this.isSplit = isSplit;
  },
  mounted() {
    this.getTypeDicts(); // 获取紧急程度下拉框选项
    this.getInsStateDicts();
    this.getComparisonList();
    this.getAuthorizedPerson();
    // this.getPower();
    this.startWorker();
    // this.getList0() // 任务切换
    this.scrollInit();
  },
  activated() {
    this.getTypeDicts(); // 获取紧急程度下拉框选项
    this.getInsStateDicts();
    this.getComparisonList();
    this.getAuthorizedPerson();
    this.startWorker();
    // this.getList0() // 任务切换
    this.scrollInit();
@@ -859,6 +985,87 @@
    this.stopWorker();
  },
  methods: {
    validateQuality(){
      let inboundLength = Number(this.calcInbondLength(this.ifsMaterialPropsForm.startMeterMark,this.ifsMaterialPropsForm.endMeterMark));
      let testQuantity = Number(this.insOrder.testQuantity);
      if(inboundLength!=null && testQuantity!==inboundLength){
        this.$message.warning(`入库长度(${inboundLength}km)与检验数量(${testQuantity}km)不符,请确认!`);
      }
    },
    calcInbondLength(startMeterMark,endMeterMark){
      let inboundLength = null;
      if((startMeterMark!=null && startMeterMark!=='') && (endMeterMark!=null&&endMeterMark!=='')){
        let minus = this.$Big(endMeterMark).minus(this.$Big(startMeterMark));
        inboundLength = Math.abs(minus)
      }
      return inboundLength;
    },
    getLetteringInfoDicts(){
      getDicts("lettering_info_type").then(res=>{
        if(res.code==200){
          this.letteringInfoList = res.data
        }
      })
    },
    getInsulationColorDicts(){
      getDicts("insulation_color_type").then(res=>{
        if(res.code==200){
          this.insulationColorList = res.data
        }
      })
    },
    getOuterColorDicts(){
      getDicts("outer_color_type").then(res=>{
        if(res.code==200){
          this.outerColorList = res.data
        }
      })
    },
    closePartPropDialog(){
      this.ifsMaterialPropsForm = {
        id:null,
        ifsInventoryId: null,
        drumNo: '', // 载具编号
        startMeterMark: '', // 起始米标
        endMeterMark: '', // 截止米标
        insulationColor: '', // 绝缘颜色
        outerColor: '', // 外护颜色
        inboundLength: '', // 入库长度
        letteringInfo: '', // 印字信息
      }
      this.ifsMaterialPropsVisible = false;
    },
    getPartProps(ifsId){
      getOneByIfsId(ifsId).then((res)=>{
        if(res.code==200 && res.data){
          this.ifsMaterialPropsForm = res.data;
        }
      })
    },
    saveOrUpdatePartProp(){
      this.ifsMaterialPropsForm.ifsInventoryId = this.insOrder.ifsInventoryId
      saveOrUpdateProps({
        ...this.ifsMaterialPropsForm,
        partNo: this.insOrder.partNo,
        lotBatchNo: this.insOrder.lotBatchNo,
      }).then((res)=>{
        if(res.code==200){
          this.$message.success("保存成功");
          this.ifsMaterialPropsVisible = false;
          this.refreshView()
        }
      })
    },
    //打开IFS物料属性弹框
    showMaterialPropsDialog(){
      this.getPartProps(this.insOrder.ifsInventoryId)
      this.getOuterColorDicts()
      this.getInsulationColorDicts()
      this.getLetteringInfoDicts()
      this.$nextTick(()=>{
        this.ifsMaterialPropsVisible = true;
      })
    },
    // 文件管理--开始
    getList() {
      this.tableLoading = true;
@@ -886,15 +1093,12 @@
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          delfile({ id: row.id }).then((res) => {
            if (res.code == 201) return;
            this.$message.success("删除成功");
            this.refresh();
          });
        })
        .catch(() => { });
      }).then(() => {
        delfile({ id: row.id }).then((res) => {
          this.$message.success("删除成功");
          this.getList();
        });
      }).catch(() => { });
    },
    // 文件管理--结束
@@ -928,6 +1132,10 @@
        laboratory: this.sonLaboratory,
      }).then(async (res) => {
        this.insOrder = res.data.insOrder;
        if(res.data.insOrder.ifsOrderType==='02wg'){
          //查询零件属性
          this.getPartProps(res.data.insOrder.ifsInventoryId)
        }
        this.supplierDensity = res.data.supplierDensity;
        this.getList()
        this.urgentList.forEach((m) => {
@@ -1027,8 +1235,9 @@
        id: this.currentSample.id,
        type: this.type,
        laboratory: this.sonLaboratory,
        cableTag: "",
        cableTag: this.temCableTag,
        rawMaterialTag: this.rawMaterialTag,
        repetitionTag: this.repetitionTag,
      };
      this.$nextTick(() => {
        this.$refs.addUnPassDialog.getInsOrder(info);
@@ -1122,7 +1331,6 @@
      this.dataAcquisitionInfo = {};
      this.getData = [];
      for (let i in this.objectOrder(data)) {
        console.log("i---", i);
        let obj = {};
        if (i.includes("@")) {
          obj = {
@@ -1465,12 +1673,10 @@
    },
    // 保存湿度、温度数据
    subOtherForm(m, type) {
      console.log("m---", m);
      write({
        [type]: type === "remark" ? m : Number(m),
        id: this.insOrder.id,
      }).then((res) => {
        if (res.code == 201) return;
        this.$message.success("保存成功");
      });
    },
@@ -1489,34 +1695,6 @@
        a.download = "table.png";
        a.click();
      });
    },
    // 权限获取
    getPower() {
      let power = JSON.parse(sessionStorage.getItem("power"));
      let fileDel = false;
      let fileAdd = false;
      let collected = false;
      let temDataAcquisition = false;
      for (var i = 0; i < power.length; i++) {
        if (power[i].menuMethod == "uploadFile") {
          fileAdd = true;
        }
        if (power[i].menuMethod == "delfile") {
          fileDel = true;
        }
        if (power[i].menuMethod == "isItAllowedToModifyTheCollectedValues") {
          collected = true;
        }
        if (power[i].menuMethod == "temDataAcquisition") {
          temDataAcquisition = true;
        }
      }
      if (!fileDel) {
        // this.componentData0.do.splice(1, 1);
      }
      this.fileAdd = fileAdd;
      this.collected = collected;
      this.temDataAcquisition = temDataAcquisition;
    },
    uploadSample() {
      doInsOrder({
@@ -1655,20 +1833,6 @@
        this.comparisonList = this.dictToValue(response.data);
      });
    },
    // 获取检验值为下拉时的下拉列表
    // selectEnumByCategoryOfSelect(val) {
    //   this.enumList = [];
    //   if (val === undefined || val === null) {
    //     return;
    //   }
    //   this.$axios
    //     .post(this.$api.enums.selectEnumByCategory, {
    //       category: val,
    //     })
    //     .then((res) => {
    //       this.enumList = res.data;
    //     });
    // },
    tableRowClassName({ row, rowIndex }) {
      row.index = rowIndex + 1;
    },
@@ -2574,17 +2738,48 @@
        this.$message.error("未输入不通过原因");
      }
    },
    // 查看工时
    viewManHour() {
      this.$refs.viewManHourDia.showDialog(this.id, 99);
    },
    openAddVerifyDia() {
      this.addVerifyDia = true;
    },
    confirmSubmit(registerInsResults){
      submitPlan({
        orderId: this.orderId,
        laboratory: this.sonLaboratory,
        verifyUser: this.verifyUser,
        entrustCode: this.insOrder.entrustCode,
        registerInsResults: registerInsResults
      }).then((res) => {
        if (res.code === 200) {
          this.$message.success("操作成功");
          this.goback();
          this.submitLoading = false;
          this.addVerifyDia = false;
        }
      })
        .catch((error) => {
          console.error(error);
          this.submitLoading = false;
        });
    },
    submit() {
      if (this.verifyUser === null || this.verifyUser === "") {
        this.$message.error("请指定复核人员");
        return;
      }
      if (!this.otherForm.humidity) {
      if (!this.otherForm.humidity && this.insOrder.ifsOrderType!=='02wg') {
        this.$message.error("请输入湿度");
        return;
      }
      if (!this.otherForm.temperature) {
      if (!this.otherForm.temperature && this.insOrder.ifsOrderType!=='02wg') {
        this.$message.error("请输入温度");
        return;
      }
      if (!this.insOrder.lotPartId && this.insOrder.ifsOrderType==='02wg') {
        this.$message.error("请填写IFS库存物料批次属性");
        return;
      }
      this.submitLoading = true;
@@ -2593,38 +2788,37 @@
        laboratory: this.sonLaboratory,
      }).then((res) => {
        if (res.code === 200) {
          if (!res.data || res.data.length == 0) {
          if (!res.data || res.data.errorMsg.length == 0) {
            this.submitLoading = true;
            submitPlan({
              orderId: this.orderId,
              laboratory: this.sonLaboratory,
              verifyUser: this.verifyUser,
              entrustCode: this.insOrder.entrustCode,
            }).then((res) => {
              if (res.code === 200) {
                this.$message.success("操作成功");
                this.goback();
                this.submitLoading = false;
                this.addVerifyDia = false;
              }
            })
              .catch((error) => {
                console.error(error);
                this.submitLoading = false;
            //检验类型为原材料
            if(this.typeSource==1 && res.data.unInsOrderCount==0 && this.isSplit==1){
              const htmlStr = "是否登记IFS采购检验结果并移库?该操作会登记<span style='color:#ff4949'>同一零件同一订单的所有拆分批次</span>,请谨慎选择。"
              this.$confirm(htmlStr, '提示', {
                confirmButtonText: '是',
                cancelButtonText: '否',
                type: 'warning',
                dangerouslyUseHTMLString: true
              }).then(() => {
                this.confirmSubmit(true)
              }).catch(() => {
                this.confirmSubmit(false)
              });
            }else{
              this.confirmSubmit(true)
            }
          } else {
            let newData = [];
            const h = this.$createElement;
            for (let i in res.data) {
              const lastChar = res.data[i].slice(-1);
            for (let i in res.data.errorMsg) {
              const lastChar = res.data.errorMsg[i].slice(-1);
              if (lastChar == "-") {
                res.data[i] = res.data[i].slice(0, -1);
                res.data.errorMsg[i] = res.data.errorMsg[i].slice(0, -1);
              }
              newData.push(
                h(
                  "p",
                  { style: "font-size: 14px;color: red;" },
                  Number(i) + 1 + "、" + res.data[i]
                  Number(i) + 1 + "、" + res.data.errorMsg[i]
                )
              );
            }
@@ -2647,22 +2841,23 @@
            })
              .then(() => {
                this.submitLoading = true;
                submitPlan({
                  orderId: this.orderId,
                  laboratory: this.sonLaboratory,
                  verifyUser: this.verifyUser,
                }).then((res) => {
                  if (res.code === 200) {
                    this.$message.success("操作成功");
                    this.addVerifyDia = false;
                    this.goback();
                  }
                  this.submitLoading = false;
                })
                  .catch((error) => {
                    console.error(error);
                    this.submitLoading = false;
                  });
                this.confirmSubmit(false)
                // submitPlan({
                //   orderId: this.orderId,
                //   laboratory: this.sonLaboratory,
                //   verifyUser: this.verifyUser,
                // }).then((res) => {
                //   if (res.code === 200) {
                //     this.$message.success("操作成功");
                //     this.addVerifyDia = false;
                //     this.goback();
                //   }
                //   this.submitLoading = false;
                // })
                //   .catch((error) => {
                //     console.error(error);
                //     this.submitLoading = false;
                //   });
              })
              .catch(() => { });
          }
@@ -2684,17 +2879,24 @@
          } else {
            param = this.param;
          }
          let isNoTestValue = ''
          for (let key in param) {
            if (param[key]) {
              if (param[key].insValue?.length === 0) {
                isNoTestValue = 1
              } else {
                isNoTestValue = ''
              }
            }
          }
          saveInsContext({
            param: JSON.stringify(param),
            currentTable: this.currentTable,
            sampleId: this.currentSample.id,
            orderId: this.orderId,
            sonLaboratory: this.sonLaboratory
            sonLaboratory: this.sonLaboratory,
            isNoTestValue: isNoTestValue
          }).then((res) => {
            if (res.code == 201) {
              this.$message.error("保存失败");
              return;
            }
            this.$message.success("已保存");
          });
          // 向 Worker 发送消息,开始处理逻辑
@@ -2762,7 +2964,7 @@
      }
    },
    getAuthorizedPerson() {
      selectUserCondition({ type: 0 }).then((res) => {
      selectUserCondition({ type: 1 }).then((res) => {
        let data = [];
        res.data.forEach((a) => {
          data.push({
@@ -2846,7 +3048,7 @@
      this.upLoading = false;
      if (response.code == 200) {
        this.$message.success("上传成功");
        this.$refs.fileList.selectList();
        this.getList();
      }
    },
    beforeUpload(file) {
@@ -2865,16 +3067,7 @@
    },
    handleDown(row) {
      downFile({ id: row.id }).then((res) => {
        if (res.code === 200) {
          let url = "";
          if (res.data.type == 1) {
            url = this.javaApi + "/img/" + res.data.fileUrl;
            this.$download.saveAs(url, row.fileName)
          } else {
            url = this.javaApi + "/word/" + res.data.fileUrl;
            this.$download.saveAs(url, row.fileName)
          }
        }
        this.$download.saveAs(res.data.fileUrl, row.fileName)
      })
        .catch((error) => { });
    },
@@ -2941,6 +3134,7 @@
  background-color: #fff;
  border-radius: 3px;
  margin-bottom: 10px;
  padding: 10px;
}
.search .form-inline {
@@ -3036,7 +3230,7 @@
}
.content-h-2 {
  justify-content: end;
  justify-content: flex-end;
}
.content-v-0 {