From 3c6566a26c6bb6f68deed9f2c8e7b6eab1209134 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期五, 28 八月 2026 15:42:42 +0800
Subject: [PATCH] feat(order): 添加产品检验项选择功能并增加导入导出功能 - 实现产品检验项的选择状态管理和计数显示功能 - 添加标准物质和设备管理模块的导入导出功能 - 新增导入模板下载和上传验证机制 - 调整表单验证规则,移除生产单位必填限制

---
 src/api/cnas/resourceDemand/device.js                             |    9 +
 src/views/CNAS/resourceDemand/device/index.vue                    |    2 
 src/views/CNAS/resourceDemand/device/component/deviceOverview.vue |   72 ++++++++++++
 src/views/business/productOrder/components/addOrder.vue           |  145 ++++++++++++++++++-----
 src/api/cnas/resourceDemand/standardMaterial/standardMaterial.js  |    9 +
 src/views/business/productOrder/components/addView.vue            |    3 
 src/views/CNAS/resourceDemand/standardMaterial/index.vue          |   73 ++++++++++++
 7 files changed, 274 insertions(+), 39 deletions(-)

diff --git a/src/api/cnas/resourceDemand/device.js b/src/api/cnas/resourceDemand/device.js
index cf12e71..bd162b7 100644
--- a/src/api/cnas/resourceDemand/device.js
+++ b/src/api/cnas/resourceDemand/device.js
@@ -38,6 +38,15 @@
   });
 }
 
+// 涓嬭浇璁惧瀵煎叆妯℃澘
+export function downloadDeviceImportTemplate() {
+  return request({
+    url: "/deviceScope/importTemplate",
+    method: "get",
+    responseType: "blob",
+  });
+}
+
 //璁惧閲岄潰閫夋嫨妫�楠岄」鐩�(鏍戝舰缁撴瀯)
 export function getInsProduction(query) {
   return request({
diff --git a/src/api/cnas/resourceDemand/standardMaterial/standardMaterial.js b/src/api/cnas/resourceDemand/standardMaterial/standardMaterial.js
index 71f88a9..0ff088d 100644
--- a/src/api/cnas/resourceDemand/standardMaterial/standardMaterial.js
+++ b/src/api/cnas/resourceDemand/standardMaterial/standardMaterial.js
@@ -37,6 +37,15 @@
   });
 }
 
+// 涓嬭浇鏍囧噯鐗╄川瀵煎叆妯℃澘
+export function downloadStandardSubstanceImportTemplate() {
+  return request({
+    url: '/feStandardSubstance/importTemplate',
+    method: 'get',
+    responseType: 'blob'
+  })
+}
+
 //鏍囧噯鐗╄川娓呭崟鍊熺敤
 export function borrowSubstance(query) {
   return request({
diff --git a/src/views/CNAS/resourceDemand/device/component/deviceOverview.vue b/src/views/CNAS/resourceDemand/device/component/deviceOverview.vue
index edae3ac..b64653b 100644
--- a/src/views/CNAS/resourceDemand/device/component/deviceOverview.vue
+++ b/src/views/CNAS/resourceDemand/device/component/deviceOverview.vue
@@ -20,6 +20,7 @@
         <div style="line-height: 30px;">
           <el-button size="mini" type="primary" @click="currentPage = 1, keyMap = {}, list = [], finishLoding = false, refreshTable()">鏌ヨ</el-button>
           <el-button size="mini" @click="refresh()">閲嶇疆</el-button>
+          <el-button size="mini" type="primary" @click="importVisible = true">瀵煎叆</el-button>
         </div>
       </div>
     </div>
@@ -73,6 +74,22 @@
         鏆傛棤鏁版嵁
       </div>
     </div>
+    <el-dialog title="璁惧瀵煎叆" :visible.sync="importVisible" width="500px" @closed="resetImport">
+      <div style="margin-bottom: 12px;">
+        璇蜂娇鐢ㄨ澶囧鍏ユā鏉垮~鍐欐暟鎹紝鍗曚釜鏂囦欢涓嶈秴杩�10MB銆�
+        <el-button type="text" @click="downloadTemplate">涓嬭浇瀵煎叆妯℃澘</el-button>
+      </div>
+      <el-upload ref="deviceUpload" drag name="file" accept=".xlsx" :action="importAction"
+                 :headers="uploadHeader" :auto-upload="false" :limit="1" :file-list="importFiles"
+                 :before-upload="beforeImport" :on-success="importSuccess" :on-error="importError">
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
+      </el-upload>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="importVisible = false">鍙栨秷</el-button>
+        <el-button type="primary" :loading="importing" @click="submitImport">瀵煎叆</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -80,6 +97,7 @@
 import ScrollPagination from '@/components/index/scroll-paging.vue'
 import {
   selectDeviceParameter,
+  downloadDeviceImportTemplate,
 } from '@/api/cnas/resourceDemand/device.js'
 export default {
   props: {
@@ -108,6 +126,14 @@
       finishLoding: false, // 鍔犺浇瀹屾垚锛屾樉绀哄凡缁忔病鏈夋洿澶氫簡
       keyMap: {},
       laboratoryNameIsNull: false,
+      importVisible: false,
+      importing: false,
+      importFiles: [],
+    }
+  },
+  computed: {
+    importAction() {
+      return this.javaApi + '/deviceScope/importDevice'
     }
   },
   created() {
@@ -118,6 +144,52 @@
     this.clickSidebar(this.clickNodeVal)
   },
   methods: {
+    downloadTemplate() {
+      downloadDeviceImportTemplate().then(res => {
+        this.$download.saveAs(new Blob([res]), '璁惧瀵煎叆妯℃澘.xlsx')
+      })
+    },
+    submitImport() {
+      if (!this.$refs.deviceUpload.uploadFiles.length) {
+        this.$message.warning('璇烽�夋嫨闇�瑕佸鍏ョ殑Excel鏂囦欢')
+        return
+      }
+      this.$refs.deviceUpload.submit()
+    },
+    beforeImport(file) {
+      if (!file.name.toLowerCase().endsWith('.xlsx')) {
+        this.$message.error('浠呮敮鎸�.xlsx鏍煎紡鏂囦欢')
+        return false
+      }
+      if (file.size > 10 * 1024 * 1024) {
+        this.$message.error('瀵煎叆鏂囦欢涓嶈兘瓒呰繃10MB')
+        return false
+      }
+      this.importing = true
+      return true
+    },
+    importSuccess(response) {
+      this.importing = false
+      if (response.code !== 200) {
+        this.$message.error(response.message || response.msg || '瀵煎叆澶辫触')
+        return
+      }
+      this.$message.success(`鎴愬姛瀵煎叆${response.data}鏉¤澶嘸)
+      this.importVisible = false
+      this.refresh()
+      this.$emit('refresh-tree')
+    },
+    importError() {
+      this.importing = false
+      this.$message.error('瀵煎叆澶辫触')
+    },
+    resetImport() {
+      this.importing = false
+      this.importFiles = []
+      if (this.$refs.deviceUpload) {
+        this.$refs.deviceUpload.clearFiles()
+      }
+    },
     refreshTable() {
       const key = `_${this.currentPage}`
       const value = this.keyMap[key]
diff --git a/src/views/CNAS/resourceDemand/device/index.vue b/src/views/CNAS/resourceDemand/device/index.vue
index e01dc60..9f9a4d7 100644
--- a/src/views/CNAS/resourceDemand/device/index.vue
+++ b/src/views/CNAS/resourceDemand/device/index.vue
@@ -38,7 +38,7 @@
       <div v-if="isShowAll" style="height: 100%;">
         <el-tabs v-model="menuListActiveName" class="main_right" type="border-card">
           <el-tab-pane label="璁惧鎬昏" name="璁惧鎬昏">
-            <overview v-if="menuListActiveName == '璁惧鎬昏'" :clickNodeVal="clickNodeVal" />
+            <overview v-if="menuListActiveName == '璁惧鎬昏'" :clickNodeVal="clickNodeVal" @refresh-tree="geList" />
           </el-tab-pane>
           <el-tab-pane label="璁惧宸ュ叿鏄庣粏" name="璁惧宸ュ叿鏄庣粏">
             <management v-if="menuListActiveName == '璁惧宸ュ叿鏄庣粏'" :clickNodeVal="clickNodeVal" />
diff --git a/src/views/CNAS/resourceDemand/standardMaterial/index.vue b/src/views/CNAS/resourceDemand/standardMaterial/index.vue
index 4daf629..79cf6dc 100644
--- a/src/views/CNAS/resourceDemand/standardMaterial/index.vue
+++ b/src/views/CNAS/resourceDemand/standardMaterial/index.vue
@@ -19,6 +19,7 @@
       </div>
       <div>
         <el-button size="small" @click="exportFun">瀵� 鍑�</el-button>
+        <el-button size="small" type="primary" @click="importVisible = true">瀵� 鍏�</el-button>
         <el-button size="small" type="primary" @click="openFormDia('add')">鏂� 澧�</el-button>
       </div>
     </div>
@@ -29,6 +30,22 @@
     <form-dia v-if="formDia" ref="formDia" @closeYearDia="closeYearDia"></form-dia>
     <borrow-dia v-if="borrowDia" ref="borrowDia" @closeYearDia="closeBorrowDia"></borrow-dia>
     <return-dia v-if="returnDia" ref="returnDia" @closeYearDia="closeReturnDia"></return-dia>
+    <el-dialog title="鏍囧噯鐗╄川瀵煎叆" :visible.sync="importVisible" width="500px" @closed="resetImport">
+      <div style="margin-bottom: 12px;">
+        璇蜂娇鐢ㄦ爣鍑嗙墿璐ㄥ鍏ユā鏉垮~鍐欐暟鎹紝鍗曚釜鏂囦欢涓嶈秴杩�10MB銆�
+        <el-button type="text" @click="downloadTemplate">涓嬭浇瀵煎叆妯℃澘</el-button>
+      </div>
+      <el-upload ref="standardSubstanceUpload" drag name="file" accept=".xlsx" :action="importAction"
+                 :headers="uploadHeader" :auto-upload="false" :limit="1" :file-list="importFiles"
+                 :before-upload="beforeImport" :on-success="importSuccess" :on-error="importError">
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
+      </el-upload>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="importVisible = false">鍙栨秷</el-button>
+        <el-button type="primary" :loading="importing" @click="submitImport">瀵煎叆</el-button>
+      </span>
+    </el-dialog>
   </div>
 
 </template>
@@ -39,7 +56,8 @@
 import {
   getPageStandardSubstance,
   removeStandardSubstance,
-  exportOfStandardSubstanceList
+  exportOfStandardSubstanceList,
+  downloadStandardSubstanceImportTemplate
 } from '@/api/cnas/resourceDemand/standardMaterial/standardMaterial'
 import FormDia from '../standardMaterial/component/formDia.vue';
 import BorrowDia from '../standardMaterial/component/borrowDia.vue';
@@ -173,12 +191,65 @@
       formDia: false,
       borrowDia: false,
       returnDia: false,
+      importVisible: false,
+      importing: false,
+      importFiles: [],
+    }
+  },
+  computed: {
+    importAction() {
+      return this.javaApi + '/feStandardSubstance/importStandardSubstance'
     }
   },
   mounted() {
     this.searchList()
   },
   methods: {
+    downloadTemplate() {
+      downloadStandardSubstanceImportTemplate().then(res => {
+        this.$download.saveAs(new Blob([res]), '鏍囧噯鐗╄川瀵煎叆妯℃澘.xlsx')
+      })
+    },
+    submitImport() {
+      if (!this.$refs.standardSubstanceUpload.uploadFiles.length) {
+        this.$message.warning('璇烽�夋嫨闇�瑕佸鍏ョ殑Excel鏂囦欢')
+        return
+      }
+      this.$refs.standardSubstanceUpload.submit()
+    },
+    beforeImport(file) {
+      if (!file.name.toLowerCase().endsWith('.xlsx')) {
+        this.$message.error('浠呮敮鎸�.xlsx鏍煎紡鏂囦欢')
+        return false
+      }
+      if (file.size > 10 * 1024 * 1024) {
+        this.$message.error('瀵煎叆鏂囦欢涓嶈兘瓒呰繃10MB')
+        return false
+      }
+      this.importing = true
+      return true
+    },
+    importSuccess(response) {
+      this.importing = false
+      if (response.code !== 200) {
+        this.$message.error(response.message || response.msg || '瀵煎叆澶辫触')
+        return
+      }
+      this.$message.success(`鎴愬姛瀵煎叆${response.data}鏉℃爣鍑嗙墿璐╜)
+      this.importVisible = false
+      this.searchList()
+    },
+    importError() {
+      this.importing = false
+      this.$message.error('瀵煎叆澶辫触')
+    },
+    resetImport() {
+      this.importing = false
+      this.importFiles = []
+      if (this.$refs.standardSubstanceUpload) {
+        this.$refs.standardSubstanceUpload.clearFiles()
+      }
+    },
     exportFun() {
       this.outLoading = true
       exportOfStandardSubstanceList(this.searchForm).then(res => {
diff --git a/src/views/business/productOrder/components/addOrder.vue b/src/views/business/productOrder/components/addOrder.vue
index 7a01f3e..c880056 100644
--- a/src/views/business/productOrder/components/addOrder.vue
+++ b/src/views/business/productOrder/components/addOrder.vue
@@ -300,19 +300,27 @@
             </template>
           </el-table-column>
         </el-table>
+        <div v-if="canSelectProduct" style="display: flex; align-items: center; gap: 12px; padding: 10px 0;">
+          <span>妫�娴嬭寖鍥达細</span>
+          <el-radio-group v-model="inspectionScope" size="small" @change="changeInspectionScope">
+            <el-radio-button label="all">鍏ㄩ儴妫�楠�</el-radio-button>
+            <el-radio-button label="specified">鎸囧畾妫�楠岄」</el-radio-button>
+          </el-radio-group>
+          <span>宸查�� {{ selectedProductCount }} / 鍏� {{ productList.length }} 椤�</span>
+        </div>
         <el-table ref="productTable" v-loading="getProductLoad" :data="productList"
                   :row-class-name="tableRowClassName" border class="el-table"
                   :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }"
           max-height="400px" style="margin-bottom: 10px;" tooltip-effect="dark"
           @select="selectOne" @selection-change="selectProduct" @select-all="handleAll">
-          <el-table-column v-if="active==1" :selectable="selectable0" type="selection" width="65"></el-table-column>
+          <el-table-column v-if="canSelectProduct" :selectable="selectable0" type="selection" width="65"></el-table-column>
           <el-table-column label="妫�楠岄」鍒嗙被" min-width="140" prop="inspectionItemClass" show-overflow-tooltip></el-table-column>
           <el-table-column label="妫�楠岄」" min-width="140" prop="inspectionItem" show-overflow-tooltip>
             <template slot="header" slot-scope="scope">
               <div style="display: flex;align-items: center;flex-direction: column;font-size: 14px">
                 <span>妫�楠岄」</span>
                 <el-input
-                  v-if="active==1"
+                  v-if="canSelectProduct"
                 v-model="inspectionItem"
                 placeholder="璇疯緭鍏�"
                 size="mini"
@@ -326,7 +334,7 @@
               <div style="display: flex;align-items: center;flex-direction: column;font-size: 14px">
                 <span>妫�楠岄」瀛愰」</span>
                 <el-input
-                  v-if="active==1"
+                  v-if="canSelectProduct"
                   v-model="inspectionItemSubclass"
                   placeholder="璇疯緭鍏�"
                   size="mini"
@@ -368,7 +376,7 @@
               <div style="display: flex;align-items: center;flex-direction: column;font-size: 14px">
                 <span>璇曢獙鏂规硶</span>
                 <el-input
-                  v-if="active==1"
+                  v-if="canSelectProduct"
                   v-model="methodS"
                   placeholder="璇疯緭鍏�"
                   size="mini"
@@ -614,6 +622,12 @@
   },
   computed:{
     ...mapGetters(["nickName", 'nameEn', 'userName']),
+    canSelectProduct() {
+      return this.active == 1 || (this.tabIndex == 4 && this.active == 2)
+    },
+    selectedProductCount() {
+      return this.productList.filter(item => item.state == 1).length
+    },
     newJuLaboratoryList() {
       return (this.dict.type.sys_sub_lab || []).filter(item => item.label === '鏂拌仛')
     },
@@ -691,9 +705,6 @@
         ],
         testQuantity: [
           { required: true, message: '璇峰~鍐欐娊妫�鏁伴噺', trigger: 'blur' }
-        ],
-        production: [
-          { required: true, message: '璇峰~鍐欑敓浜у崟浣�', trigger: 'blur' }
         ],
       },
       sample: {
@@ -796,6 +807,7 @@
       quarterItemOptions: [], // 鏌ヨ瀛e害淇℃伅
       specialStandardMethod: '',
       isSpecial: false,
+      inspectionScope: 'all',
     }
   },
   watch: {
@@ -906,16 +918,22 @@
             ...res.data.insOrder
           };
           this.addObj.type = String(this.addObj.type)
-          this.sampleList = this.HaveJson(res.data.sampleProduct);
-          this.specialStandardMethod = this.sampleList[0].specialStandardMethod
-          this.getProNum()
-          this.addObj.sampleNum = this.sampleList.length
-          this.$nextTick(() => {
-            this.$refs.sampleTable.doLayout()
-            if (this.addObj.sampleNum > 0) {
-              this.$refs.sampleTable.setCurrentRow(this.sampleList[0], true)
-              this.rowClick(this.sampleList[0])
-            }
+          const samples = this.HaveJson(res.data.sampleProduct)
+          const loadSamples = this.canSelectProduct
+            ? Promise.all(samples.map(sample => this.loadSelectableProducts(sample)))
+            : Promise.resolve(samples)
+          loadSamples.then(sampleList => {
+            this.sampleList = sampleList
+            this.specialStandardMethod = this.sampleList[0].specialStandardMethod
+            this.getProNum()
+            this.addObj.sampleNum = this.sampleList.length
+            this.$nextTick(() => {
+              this.$refs.sampleTable.doLayout()
+              if (this.addObj.sampleNum > 0) {
+                this.$refs.sampleTable.setCurrentRow(this.sampleList[0], true)
+                this.rowClick(this.sampleList[0])
+              }
+            })
           })
         })
       }
@@ -1166,22 +1184,23 @@
                   if (this.tabIndex != 4) {
                     delete c.id
                   }
+                  if (c.isNew) {
+                    c.id = null
+                    delete c.isNew
+                  }
                 })
               }
               if (a.endModels) {
                 a.model = a.endModels
               }
-              a.insProduct = a.insProduct.filter(b=>b.state === 1)
+              if (!this.canSelectProduct || this.active == 1) {
+                a.insProduct = a.insProduct.filter(b=>b.state === 1)
+              }
             })
             let projectNum = this.totalArr.filter(a => a.state == 1).length
             if(projectNum==0){
-              this.$confirm('妫�楠岄」鐩负绌猴紝鏄惁纭鎻愪氦?', "鎻愮ず", {
-                confirmButtonText: "纭畾",
-                cancelButtonText: "鍙栨秷",
-                type: "warning"
-              }).then(() => {
-                this.saveMethod(sampleList)
-              }).catch(() => {})
+              this.$message.warning('璇疯嚦灏戦�夋嫨涓�涓楠岄」')
+              return
             }else{
               let isRTS = this.totalArr.find(a => a.ask != null && this.symbolList.find(b=>a.ask.includes(b)) && a.state == 1)
               if (isRTS) {
@@ -1206,12 +1225,18 @@
                 if (this.tabIndex != 4) {
                   delete c.id
                 }
+                if (c.isNew) {
+                  c.id = null
+                  delete c.isNew
+                }
               })
             }
             if (a.endModels) {
               a.model = a.endModels
             }
-            a.insProduct = a.insProduct.filter(b=>b.state === 1)
+            if (!this.canSelectProduct || this.active == 1) {
+              a.insProduct = a.insProduct.filter(b=>b.state === 1)
+            }
           })
           this.saveMethod(sampleList)
         }else{
@@ -1625,6 +1650,9 @@
         }
         this.productList = row.insProduct
         this.productList0 = JSON.parse(JSON.stringify(this.productList))
+        this.inspectionScope = this.productList.length === 0
+          ? (this.active == 1 ? 'all' : 'specified')
+          : (this.productList.every(item => item.state == 1) ? 'all' : 'specified')
         setTimeout(() => {
           this.productList.forEach(a => {
             if (a.state == 1) {
@@ -1694,6 +1722,9 @@
         })
         this.changeProductList0()
         this.currentMethod.insProduct = this.productList0
+        this.inspectionScope = this.productList.length > 0 && this.productList.every(item => item.state == 1)
+          ? 'all'
+          : 'specified'
         this.getProNum()
       },
       permute(nums) {
@@ -1814,7 +1845,7 @@
           conductorType: row.conductorType,
         }).then(res => {
           res.data.forEach(a => {
-            a.state = 0
+            a.state = this.inspectionScope === 'all' ? 1 : 0
           })
           row.insProduct = this.HaveJson(res.data)
           this.getProductLoad = false
@@ -1829,6 +1860,9 @@
             this.productList.forEach(a => {
               if (a.state == 1) this.toggleSelection(a)
             })
+            if (this.inspectionScope === 'all') {
+              this.handleAll(this.productList.filter(item => this.selectable0(item)))
+            }
           }, 200)
         })
       },
@@ -1876,7 +1910,7 @@
           factory: selectTreeList.join(" - "),
         }).then(res => {
           res.data.forEach(a => {
-            a.state = 0
+            a.state = this.inspectionScope === 'all' ? 1 : 0
           })
           row.insProduct = this.HaveJson(res.data)
           this.getProductLoad = false
@@ -1887,6 +1921,9 @@
             this.productList.forEach(a => {
               if (a.state == 1) this.toggleSelection(a)
             })
+            if (this.inspectionScope === 'all') {
+              this.handleAll(this.productList.filter(item => this.selectable0(item)))
+            }
           }, 200)
         })
       },
@@ -1955,7 +1992,7 @@
         }
       },
       selectable0(row,index) {
-        if (this.active > 1||row.repetitionTag) {
+        if (!this.canSelectProduct||row.repetitionTag) {
           return false
         } else {
           return true
@@ -2026,18 +2063,58 @@
             return item
           })
         }
-        this.productList.forEach(item => {
-          if (item.id == row.id) {
-            item.state = row.state;
-          }
-        })
         this.changeProductList0()
         this.currentMethod.insProduct = this.productList0
+        this.inspectionScope = e.length > 0 ? 'all' : 'specified'
         this.getProNum()
         this.$nextTick(() => {
           this.$refs.productTable.doLayout()
         })
       },
+      changeInspectionScope(scope) {
+        if (scope !== 'all' || this.productList.length === 0) return
+        this.$refs.productTable.clearSelection()
+        this.productList.forEach(item => {
+          if (this.selectable0(item)) this.$refs.productTable.toggleRowSelection(item, true)
+        })
+        this.handleAll(this.productList.filter(item => this.selectable0(item)))
+      },
+      inspectionProductKey(product) {
+        return [
+          product.structureItemParameterId,
+          product.inspectionItemClass,
+          product.inspectionItem,
+          product.inspectionItemSubclass
+        ].join('|')
+      },
+      loadSelectableProducts(sample) {
+        const selectedProducts = sample.insProduct || []
+        if (!sample.standardMethodListId) return Promise.resolve(sample)
+        const product = selectedProducts[0] || {}
+        const factory = [
+          product.factory || this.addObj.factory,
+          product.laboratory || this.addObj.laboratory,
+          product.sampleType || this.addObj.sampleType,
+          product.sample || sample.sample,
+          product.model || sample.model
+        ].join(' - ')
+        return selectStandardProductList({
+          model: sample.model,
+          modelNum: sample.modelNum,
+          standardMethodListId: sample.standardMethodListId,
+          factory,
+          cores: sample.cores,
+          conductorMaterial: sample.conductorMaterial,
+          conductorType: sample.conductorType
+        }).then(res => {
+          const selectedKeys = new Set(selectedProducts.map(item => this.inspectionProductKey(item)))
+          const availableProducts = (res.data || [])
+            .filter(item => !selectedKeys.has(this.inspectionProductKey(item)))
+            .map((item, index) => ({...item, id: `new-${sample.id}-${index}`, state: 0, isNew: true}))
+          sample.insProduct = selectedProducts.concat(availableProducts)
+          return sample
+        }).catch(() => sample)
+      },
       submitTell() {
         if (!this.tell) {
           this.$message.error('璇疯緭鍏ヤ笉閫氳繃鍘熷洜')
diff --git a/src/views/business/productOrder/components/addView.vue b/src/views/business/productOrder/components/addView.vue
index 4f1d05b..3f39632 100644
--- a/src/views/business/productOrder/components/addView.vue
+++ b/src/views/business/productOrder/components/addView.vue
@@ -686,9 +686,6 @@
         testQuantity: [
           { required: true, message: '璇峰~鍐欐娊妫�鏁伴噺', trigger: 'blur' }
         ],
-        production: [
-          { required: true, message: '璇峰~鍐欑敓浜у崟浣�', trigger: 'blur' }
-        ],
       },
       sample: {
         sampleCode: null,

--
Gitblit v1.9.3