From d2e867966539004b6b5a73ae3566a659ac6f8b6d Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 30 十月 2025 11:55:34 +0800
Subject: [PATCH] 检验任务数据分类查询问题修复

---
 src/views/business/inspectionTask/inspection.vue |  518 +++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 336 insertions(+), 182 deletions(-)

diff --git a/src/views/business/inspectionTask/inspection.vue b/src/views/business/inspectionTask/inspection.vue
index d32723c..780fbc4 100644
--- a/src/views/business/inspectionTask/inspection.vue
+++ b/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,10 +16,11 @@
           </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"
+        <el-button v-if="state == 1 && [0,1].includes(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>-->
@@ -32,49 +33,95 @@
       </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="
@@ -406,24 +453,24 @@
         <el-button :loading="submitLoading" type="primary" @click="submit()">纭� 瀹�</el-button>
       </span>
     </el-dialog>
-     <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
-    :visible.sync="dataGetDia" title="鏁版嵁閲囬泦" width="80%">
-    <div>
-      <table border="1" cellpadding="10" class="thermal-table">
-        <tr>
-          <td style="width: 120px">妫�楠岄」鍒嗙被</td>
-          <td style="width: 120px">妫�楠岄」</td>
-          <td style="width: 120px">妫�楠屽瓙椤�</td>
-          <td>鏁伴噰鏁版嵁</td>
-        </tr>
-        <template v-for="(item, index) in getData">
+    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
+      :visible.sync="dataGetDia" title="鏁版嵁閲囬泦" width="80%">
+      <div>
+        <table border="1" cellpadding="10" class="thermal-table">
           <tr>
-            <td :rowspan="item.child.length">{{ item.sortName }}</td>
-            <td :rowspan="item.child.length">{{ item.faName }}</td>
-            <td>{{ item.child[0].name }}</td>
-            <td style="text-align: left">
-              <!-- 娣诲姞瀹瑰櫒 div -->
-              <div class="data-collection-items">
+            <td style="width: 120px">妫�楠岄」鍒嗙被</td>
+            <td style="width: 120px">妫�楠岄」</td>
+            <td style="width: 120px">妫�楠屽瓙椤�</td>
+            <td>鏁伴噰鏁版嵁</td>
+          </tr>
+          <template v-for="(item, index) in getData">
+            <tr>
+              <td :rowspan="item.child.length">{{ item.sortName }}</td>
+              <td :rowspan="item.child.length">{{ item.faName }}</td>
+              <td>{{ item.child[0].name }}</td>
+              <td style="text-align: left">
+                <!-- 娣诲姞瀹瑰櫒 div -->
+                <div class="data-collection-items">
                 <el-select v-if="item.child[0].isShowSelect" v-model="item.child[0].getDataIndex1"
                   :multiple-limit="item.child[0].maxNum" clearable filterable multiple placeholder="璇烽�夋嫨"
                   @change="setData(item)">
@@ -526,7 +573,49 @@
       :purchaseDialog="purchaseDialog" @resetPurchaseDialog="resetPurchaseDialog"></purchase-verification>
     <!--鏌ョ湅宸ユ椂寮规-->
     <viewManHourDia ref="viewManHourDia" @submit="openAddVerifyDia"></viewManHourDia>
-    <button @click="sss">杩炴帴涓插彛</button>
+<!--    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>
 
@@ -537,8 +626,6 @@
 import AddUnPass from "../unpass/components/addUnPass.vue";
 import InspectionWord from "./components/InspectionWord.vue";
 import PurchaseVerification from "../unpass/components/PurchaseVerification.vue";
-
-
 import {
   doInsOrder,
   getCableTag,
@@ -562,8 +649,10 @@
 import DataWorker from '@/workers/DataWorker.worker.js';
 import html2canvas from "html2canvas";
 import { mapGetters } from "vuex";
-import { connect,disconnect,weightList } from "@/utils/connect.js";
 import viewManHourDia from "@/views/business/inspectionTask/components/viewManHourDia.vue";
+import {connect,disconnect,weightList} from "@/utils/connect";
+import {getOneByIfsId,saveOrUpdateProps} from "@/api/business/ifsPartProps.js";
+import {getDicts} from "@/api/system/dict/data";
 export default {
   name: 'Inspection',
   components: {
@@ -576,6 +665,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,
@@ -667,18 +771,10 @@
             {
               name: "1285nm~1330nm",
               arr: [12, 13, 14, 15],
-              // 鍒濆鍖� getDataIndex1 涓烘暟缁�
-              getDataIndex1: [],
-              isShowSelect: false,
-              maxNum: 5
             },
             {
               name: "1525nm~1575nm",
               arr: [12, 13, 14, 15],
-              // 鍒濆鍖� getDataIndex1 涓烘暟缁�
-              getDataIndex1: [],
-              isShowSelect: false,
-              maxNum: 5
             },
           ],
         },
@@ -688,10 +784,6 @@
             {
               name: "鎴嚦娉㈤暱",
               arr: [12, 13, 14, 15],
-              // 鍒濆鍖� getDataIndex1 涓烘暟缁�
-              getDataIndex1: [],
-              isShowSelect: false,
-              maxNum: 5
             },
           ],
         },
@@ -762,7 +854,6 @@
         size: 10,
         current: 0,
       },
-      tableLoading: false,
       // 鏂囦欢鍒楄〃鐩稿叧--缁撴潫
       // 浠诲姟鍒囨崲鍒楄〃--寮�濮�
       tableData0: [],
@@ -797,6 +888,7 @@
       },
       tableLoading0: false,
       // 浠诲姟鍒囨崲鍒楄〃--缁撴潫
+      isSplit: 0, // 鏄惁鏄媶鍗曡繃鏉ョ殑
     };
   },
   // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
@@ -807,7 +899,7 @@
     },
   },
   created() {
-    let { sonLaboratory, orderId, state, inspectorList, typeSource } =
+    let { sonLaboratory, orderId, state, inspectorList, typeSource,isSplit } =
       this.$route.query;
     this.sonLaboratory = sonLaboratory;
     this.orderId = orderId;
@@ -815,6 +907,7 @@
     this.state = state;
     this.inspectorList = inspectorList;
     this.typeSource = typeSource;
+    this.isSplit = isSplit;
   },
   mounted() {
     this.getTypeDicts(); // 鑾峰彇绱ф�ョ▼搴︿笅鎷夋閫夐」
@@ -824,7 +917,6 @@
     this.startWorker();
     // this.getList0() // 浠诲姟鍒囨崲
     this.scrollInit();
-    disconnect()
   },
   activated() {
     this.getTypeDicts(); // 鑾峰彇绱ф�ョ▼搴︿笅鎷夋閫夐」
@@ -911,8 +1003,87 @@
     }
   },
   methods: {
-    sss() {
-      console.log(this.$store.state.weightList) // 
+    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!=='')){
+        inboundLength = Math.abs(endMeterMark - startMeterMark)
+      }
+      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;
+        }
+      })
+    },
+    //鎵撳紑IFS鐗╂枡灞炴�у脊妗�
+    showMaterialPropsDialog(){
+      this.getPartProps(this.insOrder.ifsInventoryId)
+      this.getOuterColorDicts()
+      this.getInsulationColorDicts()
+      this.getLetteringInfoDicts()
+      this.$nextTick(()=>{
+        this.ifsMaterialPropsVisible = true;
+      })
+    },
+    disconnect() {
+      return disconnect
     },
     // 鏂囦欢绠$悊--寮�濮�
     getList() {
@@ -996,6 +1167,10 @@
         laboratory: this.sonLaboratory,
       }).then(async (res) => {
         this.insOrder = res.data.insOrder;
+        if(res.data.insOrder.ifsOrderType){
+          //鏌ヨ闆朵欢灞炴��
+          this.getPartProps(res.data.insOrder.ifsInventoryId)
+        }
         this.supplierDensity = res.data.supplierDensity;
         this.getList()
         this.urgentList.forEach((m) => {
@@ -1152,17 +1327,24 @@
   getDataAcquisitionDevice() {
       (async () => {
         try {
-          // 妫�鏌ユ槸鍚︽敮鎸� Web Serial API
-          if ('serial' in navigator) {
-            // 璇锋眰鍙敤涓插彛
-            const ports = await navigator.serial.getPorts();
-            if (ports.length > 0) {
-              await connect();
+          // 妫�鏌ラ〉闈腑妫�娴嬮」鏄惁鍖呭惈瀵嗗害
+          const hasDensityItem = this.currentSample.insProduct.some(item => {
+            // 鍋囪瀵嗗害鐩稿叧鐨勬娴嬮」鍚嶇О鍖呭惈 "瀵嗗害" 鍏抽敭瀛楋紝鍙寜闇�淇敼
+            return item.inspectionItem && item.inspectionItem.includes('瀵嗗害');
+          });
+          if (hasDensityItem) {
+            // 妫�鏌ユ槸鍚︽敮鎸� Web Serial API
+            if ('serial' in navigator) {
+              // 璇锋眰鍙敤涓插彛
+              const ports = await navigator.serial.getPorts();
+              if (ports.length > 0) {
+                await connect();
+              } else {
+                console.log('娌℃湁鍙敤鐨勪覆鍙�');
+              }
             } else {
-              console.log('娌℃湁鍙敤鐨勪覆鍙�');
+              console.log('褰撳墠娴忚鍣ㄤ笉鏀寔 Web Serial API');
             }
-          } else {
-            console.log('褰撳墠娴忚鍣ㄤ笉鏀寔 Web Serial API');
           }
         } catch (error) {
           console.error('妫�娴嬩覆鍙f椂鍑洪敊:', error);
@@ -1194,41 +1376,6 @@
         });
       });
     },
-    // getDataAcquisitionDevice() {
-    //   if (this.isSerialConnected) {
-    //     connect();
-    //   }
-    //   // return
-    //   let itemIds = [];
-    //   this.currentSample.insProduct.forEach((item) => {
-    //     if (item.inspectionItemType === "1") {
-    //       itemIds.push(item.id);
-    //     }
-    //   });
-    //   const params = {
-    //     entrustCode: this.insOrder.entrustCode,
-    //     sampleCode: this.currentSample.sampleCode,
-    //     id: this.currentSample.id,
-    //     itemIds: itemIds,
-    //   };
-    //   this.dataAcquisitionLoading = true;
-    //   dataCollection(params).then((res) => {
-    //     this.dataAcquisitionLoading = false;
-    //     if (res.code != 200) {
-    //       return;
-    //     }
-    //     this.dataAcquisitionInfoNew = this.HaveJson(res.data);
-    //     // 瀵规暟閲囧洖鏉ョ殑鍊艰繘琛屽鐞�
-    //     this.handleDataAcquisition(res.data);
-    //   }).catch(err => {
-    //     this.dataAcquisitionLoading = false;
-    //   });
-    // },
-    // 鍋囪瀛樺湪涓�涓柟娉曠敤浜庢洿鏂颁覆鍙h繛鎺ョ姸鎬�
-    // updateSerialConnectionStatus(status) {
-    //   this.isSerialConnected = status;
-    // },
-
     objectOrder(obj) {
       let newkey = Object.keys(obj).sort();
       let newObj = {};
@@ -1238,7 +1385,6 @@
       return newObj;
     },
     handleDataAcquisition(data, noDialog) {
-      console.log(data);
       // 鏄惁鍙互缂栬緫鏁伴噰鏁版嵁
       if (this.dataAcquisitionEidtAble) {
         this.getDataType = 1;
@@ -1291,7 +1437,6 @@
               };
             }
             let list = this.tableList[0].arr;
-            console.log(this.tableList[0]);
             // 寰幆椤甸潰鍒楄〃淇℃伅锛屽垽鏂暟閲囨暟鎹搴旈〉闈㈠垪琛ㄤ俊鎭殑妫�楠岄」鏄摢涓紝骞剁粰褰撳墠妫�楠岄」缁戝畾璁惧淇℃伅
             list.forEach((item, index) => {
               let num0 = 0;
@@ -1359,7 +1504,6 @@
               }
             };
             let list = this.tableList[0].arr;
-            console.log(this.tableList[0]);
             let maxNum = 0;
             list.forEach((item, index) => {
               let num0 = 0;
@@ -1391,7 +1535,6 @@
                   }
                   let num = 0;
                   list[index].forEach((n) => {
-                    // console.log(n.v.ps.value);
                     if (
                       n.v.ps &&
                       n.v.ps.value &&
@@ -1464,7 +1607,6 @@
       } else {
         // 濡傛灉閮戒笉瀛樺湪锛屽垯锛岃繘鍏ュ鐞嗘暟閲囩嚎绋嬮噷鍘诲鐞嗘暟鎹�
         try {
-          console.log(this.dataAcquisitionInfo);
           // 鍚� Worker 鍙戦�佹秷鎭紝寮�濮嬪鐞嗛�昏緫
           this.getDataIndexLoading = false;
           this.dataGetDia = false;
@@ -1893,7 +2035,7 @@
                   if (c.v.ps != undefined && c.v.ps.value === "妫�楠岄」") {
                     if (count4 === 0) {
                       if (c.v.v) {
-                        c.v.v = c.v.v.replace(/\s*/g, "");
+                        c.v.v = c.v.v.replace(/[\n\r\s]*/g, "");
                       }
                       str += c.v.v;
                       count4 += 1;
@@ -1904,7 +2046,7 @@
                   ) {
                     if (count4 === 1) {
                       if (c.v.v) {
-                        c.v.v = c.v.v.replace(/\s*/g, "");
+                        c.v.v = c.v.v.replace(/[\n\r\s]*/g, "");
                       }
                       str += c.v.v;
                       count4 += 1;
@@ -1914,7 +2056,7 @@
                   if (c.v.ps != undefined && c.v.ps.value === "妫�楠岄」鍒嗙被") {
                     if (count4 === 0) {
                       if (c.v.v) {
-                        c.v.v = c.v.v.replace(/\s*/g, "");
+                        c.v.v = c.v.v.replace(/[\n\r\s]*/g, "");
                       }
                       str += c.v.v;
                       count4 += 1;
@@ -1922,7 +2064,7 @@
                   } else if (c.v.ps != undefined && c.v.ps.value === "妫�楠岄」") {
                     if (count4 === 1) {
                       if (c.v.v) {
-                        c.v.v = c.v.v.replace(/\s*/g, "");
+                        c.v.v = c.v.v.replace(/[\n\r\s]*/g, "");
                       }
                       str += c.v.v;
                       count4 += 1;
@@ -1933,7 +2075,7 @@
                   ) {
                     if (count4 === 2) {
                       if (c.v.v) {
-                        c.v.v = c.v.v.replace(/\s*/g, "");
+                        c.v.v = c.v.v.replace(/[\n\r\s]*/g, "");
                       }
                       str += c.v.v;
                       count4 += 1;
@@ -1943,7 +2085,7 @@
                 if (str === "鏈烘鎬ц兘骞叉�佹媺浼稿己搴�(绾靛悜)") {
                   if (c.v.ps != undefined && c.v.ps.value === "鍗曚綅") {
                     if (c.v.v) {
-                      c.v.v = c.v.v.replace(/\s*/g, "");
+                      c.v.v = c.v.v.replace(/[\n\r\s]*/g, "");
                     }
                     str2 = str + c.v.v;
                     unit2 = c.v.v;
@@ -1961,13 +2103,13 @@
                     undefined
                     ? ""
                     : this.currentSample.insProduct[i].inspectionItemClass;
-                inspectionItemClass = inspectionItemClass.replace(/\s*/g, "");
+                inspectionItemClass = inspectionItemClass.replace(/[\n\r\s]*/g, "");
                 let inspectionItem =
                   this.currentSample.insProduct[i].inspectionItem == null ||
                     this.currentSample.insProduct[i].inspectionItem == undefined
                     ? ""
                     : this.currentSample.insProduct[i].inspectionItem;
-                inspectionItem = inspectionItem.replace(/\s*/g, "");
+                inspectionItem = inspectionItem.replace(/[\n\r\s]*/g, "");
                 let inspectionItemSubclass =
                   this.currentSample.insProduct[i].inspectionItemSubclass ==
                     null ||
@@ -1976,7 +2118,7 @@
                     ? ""
                     : this.currentSample.insProduct[i].inspectionItemSubclass;
                 inspectionItemSubclass = inspectionItemSubclass.replace(
-                  /\s*/g,
+                  /[\n\r\s]*/g,
                   ""
                 );
                 if (inspectionItemSubclass === "骞叉�佹媺浼稿己搴�(绾靛悜)") {
@@ -2007,6 +2149,9 @@
                   }
                 } else {
                   // 濡傛灉鐩哥瓑,閭d箞璇存槑鎵惧埌浜�,骞朵笖鎶奿d瀛樿捣鏉�,鍚庣画妫�楠岄」涔熶細鍦ㄩ〉闈腑鏄剧ず鍑烘潵
+                  let aa = inspectionItemClass +
+                    inspectionItem +
+                    inspectionItemSubclass;
                   if (
                     this.currentSample.insProduct[i].templateId ===
                     a.templateId &&
@@ -2666,17 +2811,41 @@
     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("璇峰~鍐橧FS搴撳瓨鐗╂枡鎵规灞炴��");
         return;
       }
       this.submitLoading = true;
@@ -2685,38 +2854,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]
                 )
               );
             }
@@ -2739,22 +2907,7 @@
             })
               .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)
               })
               .catch(() => { });
           }
@@ -3034,6 +3187,7 @@
   background-color: #fff;
   border-radius: 3px;
   margin-bottom: 10px;
+  padding: 10px;
 }
 
 .search .form-inline {
@@ -3271,11 +3425,11 @@
 
 .data-collection-items {
   display: flex;
-  flex-wrap: wrap; 
+  flex-wrap: wrap;
 }
 .data-collection-items .el-select,
 .data-collection-items .el-checkbox {
-  flex-basis: 20% ; 
+  flex-basis: 20% ;
   box-sizing: border-box;
   padding: 5px 2%;
 }

--
Gitblit v1.9.3