From 2bd9b32aa6378ff6a841780628b844a42dbd8f01 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 31 十月 2025 16:39:29 +0800
Subject: [PATCH] 下载采集器功能

---
 src/views/business/materialOrder/customsInspectionOrder.vue |  146 ++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 133 insertions(+), 13 deletions(-)

diff --git a/src/views/business/materialOrder/customsInspectionOrder.vue b/src/views/business/materialOrder/customsInspectionOrder.vue
index 2fe4edd..949c6b5 100644
--- a/src/views/business/materialOrder/customsInspectionOrder.vue
+++ b/src/views/business/materialOrder/customsInspectionOrder.vue
@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <div>
+    <div v-show="!cableConfigShow&&!auxiliaryShow">
       <div class="header">
         <div>
           <span>閲囪喘璁㈠崟淇℃伅</span>
@@ -24,6 +24,8 @@
           <el-button v-show="active==1" size="small" @click="templateDia=true">
             <span style="color: #3A7BFA;">淇濆瓨妯℃澘</span>
           </el-button>
+          <el-button v-if="active==1&&addObj.sample!=undefined&&(addObj.sample.indexOf('鐢电紗')>-1 ||addObj.sample.indexOf('缁煎悎')>-1)" size="small" type="primary" @click="openCableConfig">鐢电紗閰嶇疆</el-button>
+          <el-button v-if="active==1&&addObj.sample!=undefined&&addObj.sample.indexOf('鐢电紗')>-1" size="small" type="primary" @click="openAuxiliaryCore">杈呭姪绾胯姱閰嶇疆</el-button>
           <el-button v-show="active==1 && addObj.orderType === '杩涘巶妫�楠�'" :loading="noNeedCheckLoad" size="small" type="primary" @click="noNeedCheck">鍏嶆</el-button>
           <el-button v-show="active==1" :loading="saveLoad" size="small" type="primary" @click="save">鎻愪氦</el-button>
           <el-button size="small" @click="goBack">
@@ -32,7 +34,7 @@
         </div>
       </div>
     </div>
-    <div class="search">
+    <div class="search"  v-show="!cableConfigShow&&!auxiliaryShow">
       <el-form ref="addObj" :inline="true" :model="addObj" :rules="addObjRules" label-width="90px">
         <el-row>
           <el-col :span="6">
@@ -145,7 +147,7 @@
         </el-row>
       </el-form>
     </div>
-    <div>
+    <div  v-show="!cableConfigShow&&!auxiliaryShow">
       <div style="display: flex;justify-content: space-between;background-color: #F5F7FB;margin-bottom: 6px">
         <div v-if="active==1">
           <el-form :inline="true" :model="addObj1" label-width="90px">
@@ -169,7 +171,8 @@
           </el-form>
         </div>
         <div style="margin-bottom: 6px;margin-top: 6px">
-          <el-button v-show="active==1" :disabled="sampleList.length === 3" size="small" type="primary" @click="handleSplitCountNum">鎷嗗垎</el-button>
+          <el-button v-show="active==1" size="small" type="primary" @click="handleSplitCountNum">鎷嗗垎</el-button>
+          <el-button v-show="active==1" :disabled="sampleList.length<=1" size="small" type="danger" @click="handleDeleteSplitCountNum">鍒犻櫎鎷嗗垎</el-button>
         </div>
       </div>
 
@@ -325,7 +328,7 @@
         <el-table-column :filter-method="filterHandler" :filters="filters" label="瀛愬疄楠屽" min-width="130" prop="sonLaboratory"
                          show-overflow-tooltip></el-table-column>
       </el-table>
-    </div>
+    </div >
     <!--鐗规畩鍊煎鐞嗘-->
     <el-dialog :before-close="beforeClose" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
                :visible.sync="bsm1DiaAll"
@@ -433,6 +436,10 @@
         <el-button :loading="noNeedCheckLoad" type="primary" @click="handleNoNeedCheck">纭� 瀹�</el-button>
       </span>
     </el-dialog>
+    <!--鐢电紗閰嶇疆-->
+    <cableConfig v-if="cableConfigShow" ref="cableConfigShow" :active="active" :isSpecial="isSpecial" :sampleSelectionList="sampleSelectionList" @goBackAdd="goBackAdd"/>
+    <!--杈呭姪绾胯姱閰嶇疆-->
+    <auxiliary-wire-core v-if="auxiliaryShow" :active="active" :isSpecial="isSpecial" :sampleSelectionList="sampleSelectionList" @goBackAdd2="goBackAdd2"></auxiliary-wire-core>
   </div>
 </template>
 
@@ -444,22 +451,30 @@
   delRawMaterOrderTemplate,
   getInsOrder,
   getUserNow,
-  notificationRawOrder, selectRawMaterOrderTemplate,
+  notificationRawOrder,
+  selectRawMaterOrderTemplate,
   selectRawMaterOrderTemplateById,
   selectsStandardMethodByFLSSM,
   selectStandardMethodEnum,
   selectStandardProductList,
   selectStandardTreeListByPartNo
 } from "@/api/business/rawMaterialOrder";
-
+import {dateFormat} from "@/utils/date";
+import AuxiliaryWireCore from "../productOrder/components/auxiliaryWireCore.vue";
+import cableConfig from "../productOrder/components/cable-config.vue";
 export default {
   name: "CustomsInspectionOrder",
   dicts: ['check_type', 'urgency_level'],
-  components: {},
+  components: {cableConfig, AuxiliaryWireCore},
   props: {
   },
   data() {
     return {
+      cableConfigShow: false,
+      auxiliaryShow: false,
+      isSpecial: false,
+      sampleSelectionList: [],//鏍峰搧琛ㄦ牸閫変腑鏁版嵁
+      isOutsourcing: 'f',//鏄惁澶栬喘鎴愬搧
       customsInspection: {},
       orderType: '',
       active: 0,
@@ -483,8 +498,8 @@
         sample: null, // 鏍峰搧鍚嶇О
         qtyArrived: '', // 鏍峰搧鎬绘暟
         testQuantity: '', // 鎶芥鏁伴噺
-        company: '涓ぉ绉戞妧瑁呭鐢电紗鏈夐檺鍏徃', // 濮旀墭鍗曚綅
-        companyId: '1233268751', // 濮旀墭鍗曚綅id
+        company: '涓ぉ鑰愪笣鏈夐檺鍏徃', // 濮旀墭鍗曚綅
+        companyId: '1233268761', // 濮旀墭鍗曚綅id
         receiverDate: '', // 鎺ユ敹鏃堕棿
         appointed: '', // 绾﹀畾鏃堕棿
         buyUnitMeas: '', // 鍗曚綅
@@ -614,6 +629,17 @@
     //   this.addObj.method = null
     //   this.productList = []
     // },
+    isOutsourcing:{
+      deep:  true,
+      handler(newVal){
+        if(newVal && newVal==='t'){
+          this.addObj.appointed = dateFormat(new Date(),'yyyy-MM-dd')
+          this.addObj.testQuantity = this.customsInspection.qtyArrived
+          this.addObj.orderType = '杩涘巶妫�楠�'
+          this.addObj.typeSource = 0
+        }
+      }
+    },
     productList: {
       deep: true,
       handler(val) {
@@ -643,6 +669,7 @@
   created() {
     this.active = this.$route.query.active
     this.orderType = this.$route.query.orderType
+    this.isOutsourcing = this.$route.query.isOutsourcing
     this.currentId = this.$route.query.currentId
     this.isReport = this.$route.query.isReport
     this.customsInspection = this.$route.query.customsInspection
@@ -651,6 +678,7 @@
   activated() {
     this.active = this.$route.query.active
     this.orderType = this.$route.query.orderType
+    this.isOutsourcing = this.$route.query.isOutsourcing
     this.currentId = this.$route.query.currentId
     this.isReport = this.$route.query.isReport
     this.customsInspection = this.$route.query.customsInspection
@@ -660,6 +688,82 @@
   //   this.getInfo() // 鑾峰彇鏁版嵁
   // },
   methods: {
+    goBackAdd () {
+      this.cableConfigShow = false
+    },
+    goBackAdd2 () {
+      this.auxiliaryShow = false
+    },
+    // 缂栬緫瑕佹眰鍊艰〃鏍�
+    editSpecial () {
+      this.isSpecial = true
+      this.$nextTick(() => {
+        this.$refs.productTable.doLayout();
+      });
+    },
+    areObjectsValuesEqual (objects, property) {
+      if (!objects || objects.length === 0) return false;
+      const firstValue = objects[0][property];
+      return objects.every(obj => obj[property] === firstValue);
+    },
+    // 杈呭姪绾胯姱閰嶇疆
+    openAuxiliaryCore () {
+      if (this.active == 1) {
+        if (this.sampleIds.length === 0) {
+          this.$message.error("鏈�夋嫨鏍峰搧")
+        } else if (this.sampleIds.length === 1) {
+          if (!this.sampleSelectionList[0].standardMethodListId) {
+            this.$message.error("鏍峰搧鏈�夋嫨妫�楠屾爣鍑�")
+            return
+          }
+          this.auxiliaryShow = true
+        } else {
+          // 鍚屾椂閰嶇疆澶氫釜鏍峰搧鐨勭數缂嗛厤缃椂蹇呴』閫夋嫨鐩稿悓鐨勬楠屾爣鍑�
+          if (!this.sampleSelectionList.every(value => value.standardMethodListId)) {
+            this.$message.error("鏍峰搧鏈�夋嫨妫�楠屾爣鍑�")
+          } else {
+            if (!this.areObjectsValuesEqual(this.sampleSelectionList, 'standardMethodListId')) {
+              this.$message.error("璇烽�夋嫨鐩稿悓鐨勬楠屾爣鍑�")
+              return
+            }
+            this.auxiliaryShow = true
+          }
+        }
+      } else {
+        if (this.sampleId === null) {
+          this.$message.error('鏈�変腑鏍峰搧')
+        }
+      }
+    },
+    //鎵撳紑鐢电紗閰嶇疆寮规
+    openCableConfig() {
+      if (this.active == 1) {
+        if (this.sampleIds.length === 0) {
+          this.$message.error("鏈�夋嫨鏍峰搧")
+        } else if (this.sampleIds.length === 1) {
+          if (!this.sampleSelectionList[0].standardMethodListId) {
+            this.$message.error("鏍峰搧鏈�夋嫨妫�楠屾爣鍑�")
+            return
+          }
+          this.cableConfigShow = true
+        } else {
+          // 鍚屾椂閰嶇疆澶氫釜鏍峰搧鐨勭數缂嗛厤缃椂蹇呴』閫夋嫨鐩稿悓鐨勬楠屾爣鍑�
+          if (!this.sampleSelectionList.every(value => value.standardMethodListId)) {
+            this.$message.error("鏍峰搧鏈�夋嫨妫�楠屾爣鍑�")
+          } else {
+            if (!this.areObjectsValuesEqual(this.sampleSelectionList, 'standardMethodListId')) {
+              this.$message.error("璇烽�夋嫨鐩稿悓鐨勬楠屾爣鍑�")
+              return
+            }
+            this.cableConfigShow = true
+          }
+        }
+      } else {
+        if (this.sampleId === null) {
+          this.$message.error('鏈�変腑鏍峰搧')
+        }
+      }
+    },
     save1 () {
       if (this.bsm1DiaList.length > 0) {
         this.bsm1DiaList.forEach(item => {
@@ -747,7 +851,7 @@
             })
           }
         })
-      } else {
+      } else{
         notificationRawOrder({ifsInventoryId:this.customsInspection.id}).then(res => {
           if (res.code === 200) {
             if (res.data === 1) {
@@ -771,7 +875,9 @@
             this.$set(this.addObj, 'receiverDate', this.customsInspection.receiverDate)
             this.$set(this.addObj, 'orderNo', this.customsInspection.orderNo)
             this.$set(this.addObj, 'declareUser', this.customsInspection.declareUser)
-            this.$set(this.addObj, 'testQuantity', this.customsInspection.testQuantity)
+            if(this.isOutsourcing==='f'){
+              this.$set(this.addObj, 'testQuantity', this.customsInspection.testQuantity)
+            }
             this.$set(this.addObj, 'buyUnitMeas', this.customsInspection.buyUnitMeas)
             this.$set(this.addObj, 'updateBatchNo', this.customsInspection.updateBatchNo)
             this.$set(this.addObj, 'partDetail', this.customsInspection.partDesc)
@@ -848,6 +954,12 @@
       selectRawMaterOrderTemplate({partNo:this.addObj.partNo}).then(res => {
         this.templates = res.data
       })
+    },
+    //鍒犻櫎鎷嗗垎琛�
+    handleDeleteSplitCountNum(){
+      this.count--;
+      this.sampleList.pop()
+      this.computationalPairing(this.sampleList.length)
     },
     // 鎷嗗垎
     handleSplitCountNum () {
@@ -1442,6 +1554,9 @@
       })
     },
     getProNum() {
+      this.sampleSelectionList.forEach((m, i) => {
+        this.$set(this.sampleSelectionList[i], 'proNum', m.insProduct.filter(a => a.state == 1).length)
+      })
       this.$refs.sampleTable.doLayout()
     },
     methodFocus() {
@@ -1511,6 +1626,7 @@
       val.forEach(a => {
         this.sampleIds.push(a.id)
       })
+      this.sampleSelectionList = val
     },
     // 閫変腑琛ㄦ牸琛岀殑鍥炶皟
     rowClick(row, column, event) {
@@ -1524,7 +1640,11 @@
       this.sampleId = row.id
       if (this.active !== 1) {
         this.sampleIds = []
-        this.sampleIds.push(row.id)
+        this.sampleSelectionList.forEach(ele=>{
+          if(ele.id == row.id){
+            this.sampleIds.push(row.id)
+          }
+        })
       }
       // this.productList = row.insProduct
       if (this.productList !== null) {

--
Gitblit v1.9.3