From ea2b6775c278d8990e858a309a966b82b36f4d40 Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期六, 13 七月 2024 15:11:25 +0800
Subject: [PATCH] 设备数采配置提交

---
 src/components/do/b1-ins-order/add.vue |   50 +++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 37 insertions(+), 13 deletions(-)

diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index 346e0b1..bae9b02 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -458,6 +458,8 @@
             </div>
           </template>
         </el-table-column>
+        <el-table-column prop="inspectionItemClass" v-if="PROJECT === '瑁呭鐢电紗'" label="妫�楠岄」鍒嗙被" min-width="140" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="inspectionItemClassEn" v-if="PROJECT === '瑁呭鐢电紗'" label="妫�楠岄」鍒嗙被(EN)" min-width="140" show-overflow-tooltip></el-table-column>
         <el-table-column prop="sonLaboratory" label="瀛愬疄楠屽" min-width="130" show-overflow-tooltip :filters="filters"
           :filter-method="filterHandler"></el-table-column>
         <el-table-column prop="methodS" label="璇曢獙鏂规硶" min-width="120" show-overflow-tooltip>
@@ -802,7 +804,7 @@
         </div>
         <div class="temperatureList">
           <div class="temperatureListTitle">
-            <span>娓╁害鐐归泦鍚�(璇锋寜鐓ч『搴忓~鍐欙紝20鈩冨繀椤讳负棣栦綅)</span>
+            <span>娓╁害鐐归泦鍚�</span>
             <span>
               <el-button type="primary" size="mini" @click="addTemperatureData">鏂板</el-button>
               <el-button size="mini" @click="deleteTemperatureData">鍒犻櫎</el-button>
@@ -834,6 +836,7 @@
         </div>
       </div>
       <span slot="footer" class="dialog-footer">
+        <el-button @click="cleanSpliceData">鍙栨秷</el-button>
         <el-button type="primary" @click="spliceData">淇濆瓨</el-button>
       </span>
     </el-dialog>
@@ -1112,6 +1115,9 @@
               throw this.$message.error('璇峰~鍐欏畬鏁存暟鎹�')
             }
           })
+          if (!o.temperatureData.some(item => item.temperaturePoint == '20')) {
+            throw this.$message.error(`${o.value + '娉㈤暱娌℃湁閰嶇疆20鈩冩俯搴︾偣'}`)
+          }
         })
         let entrustTime = this.circulateForm.entrustTime
         let entrustNum = this.circulateForm.entrustNum
@@ -1123,7 +1129,7 @@
           o.temperatureData.unshift({temperaturePoint: 20})
           o.temperatureData.forEach(t => {
             if (!t.askSymbol) {
-                  const askObj = t.temperaturePoint + '鈩�' + ',' + o.value + ',' + null
+                  const askObj = t.temperaturePoint + '鈩�(甯告俯)' + ',' + o.value + ',' + null
                   askArr.push(askObj)
                 } else {
                   const askObj = t.temperaturePoint + '鈩�' + ',' + o.value + ',' + t.askSymbol + t.askNum
@@ -1149,7 +1155,7 @@
         })
         temperaturePointList = Array.from(new Set(temperaturePointList))
         temperaturePointList2 = Array.from(new Set(temperaturePointList2))
-        temperaturePointList2.unshift(20 + '鈩�')
+        temperaturePointList2.unshift(20 + '鈩�(甯告俯)')
         let additionArr = []
         askNum.forEach(a => {
           additionArr.push(temperaturePointList.join(',') + a)
@@ -1167,17 +1173,33 @@
         console.log('tell---', tell)
         this.circulateShow = false
       },
+      cleanSpliceData () {
+        this.circulateForm.entrustNum = null
+        this.circulateForm.entrustTime = null
+        this.circulateForm.entrustPoint = null
+        this.opticalProjectList = []
+        this.$refs.multipleTable.clearSelection()
+        this.temperatureData = []
+        this.circulateShow = false
+      },
       beforeCirculateShowClose () {
-        if (!this.circulateForm.entrustNum || !this.circulateForm.entrustTime || !this.circulateForm.entrustPoint || this.opticalProjectList.length === 0 || this.temperatureData.length === 0) {
-          this.$message.error('璇峰~鍐欏畬鏁存暟鎹�')
-          return
-        }
-        let temperaturePoint1 = JSON.parse(JSON.stringify(this.temperatureData))
-        temperaturePoint1.forEach(t => {
-          if (!t.temperaturePoint || !t.askSymbol || !t.askNum) {
-            throw this.$message.error('璇峰~鍐欏畬鏁存暟鎹�')
+          if (!this.circulateForm.entrustNum || !this.circulateForm.entrustTime || !this.circulateForm.entrustPoint || this.opticalProjectList.length === 0 || this.temperatureData.length === 0) {
+            this.$message.error('璇峰~鍐欏畬鏁存暟鎹�')
+            return
           }
-        })
+          // 鎷兼帴瑕佹眰鍊糰sk
+          const opticalProjectList = JSON.parse(JSON.stringify(this.opticalProjectList))
+          opticalProjectList.forEach(o => {
+            o.temperatureData.forEach(t => {
+              if (!t.temperaturePoint || !t.askSymbol || !t.askNum) {
+                throw this.$message.error('璇峰~鍐欏畬鏁存暟鎹�')
+              }
+            })
+            if (!o.temperatureData.some(item => item.temperaturePoint == '20')) {
+              throw this.$message.error(`${o.value + '娉㈤暱娌℃湁閰嶇疆20鈩冩俯搴︾偣'}`)
+            }
+          })
+          this.spliceData()
       },
       handleSelectionChange(val) {
         this.opticalProjectList = val;
@@ -2199,7 +2221,9 @@
       handleAll(e) {
         if (e.length > 0) {
           this.productList.map(m => {
-            m.state = 1
+            if(e.find(a=>a.id == m.id)){
+              m.state = 1
+            }
             return m
           })
         } else {

--
Gitblit v1.9.3