From bb1edca3bf351497495e270014b229605e4460dc Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 17 十月 2024 09:24:51 +0800
Subject: [PATCH] 修改下单、电路试验多样品时的bug

---
 src/components/do/b1-inspect-order-plan/circuit-parameters1.vue |   35 +++++++++--
 src/components/do/b1-ins-order/add.vue                          |   20 ++++++
 src/components/do/b1-inspect-order-plan/circuit-parameters2.vue |   29 ++++++++-
 src/components/do/b1-inspect-order-plan/Inspection.vue          |   72 +++++++++++++-----------
 src/components/view/b1-inspect-order-plan.vue                   |    6 +
 src/components/view/b1-sample.vue                               |    4 
 src/components/view/b1-inspection-order.vue                     |    3 
 7 files changed, 118 insertions(+), 51 deletions(-)

diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index c235e47..723a043 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -1906,6 +1906,22 @@
           //   }
           // }
           let sampleList = this.HaveJson(this.sampleList)
+          for (let i = 0; i < sampleList.length; i++) {
+            if (sampleList[i].insProduct.length > 0) {
+              let set = new Set()
+              for (let j = 0; j < sampleList[i].insProduct.length; j++) {
+                if(sampleList[i].insProduct[j].state == 1){
+                  let num0 = set.size
+                  set.add(sampleList[i].insProduct[j].inspectionItem+'-'+sampleList[i].insProduct[j].inspectionItemSubclass)
+                  let num1 = set.size
+                  if(num0==num1){
+                    this.$message.error(sampleList[i].insProduct[j].inspectionItem+'-'+sampleList[i].insProduct[j].inspectionItemSubclass+'閲嶅')
+                    return
+                  }
+                }
+              }
+            }
+          }
           let projectNum = this.totalArr.filter(a => a.state == 1).length
           if(projectNum==0){
             this.$confirm('妫�楠岄」鐩负绌猴紝鏄惁纭鎻愪氦?', "鎻愮ず", {
@@ -1916,7 +1932,7 @@
               this.saveMethod(sampleList)
             }).catch(() => {})
           }else{
-            let isRTS = this.totalArr.find(a => a.ask != null && this.symbolList.find(b=>a.ask.includes(b)) && a.state == 1)
+            let isRTS = this.totalArr.find(a => a.ask != null && this.symbolList.find(b=>a.ask&&a.ask.includes(b)) && a.state == 1)
             if (isRTS&&this.PROJECT=='妫�娴嬩腑蹇�') {
               this.editTable = this.handleData(sampleList,this.containsValue, 0)
               this.editTable.forEach(item => {
@@ -2075,7 +2091,7 @@
                   let arr = this.editTable.filter(b => b.sampleId == item.id)
                   for (var i=0;i<arr.length;i++){
                     if(a.ask){
-                      if(a.ask.includes(arr[i].symbolItem)){
+                      if(a.ask&&a.ask.includes(arr[i].symbolItem)){
                         let ask = calBack(a.ask, arr[i].symbolItem,arr[i].value)
                         if (ask) {
                           a.ask = ask
diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 2735646..e276763 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -863,41 +863,43 @@
       </span>
     </el-dialog>
     <el-dialog title="璇曢獙淇℃伅" :visible.sync="experimentDia" width="50%">
-      <div class="body" style="display: flex;padding: 10px;align-items: center;" v-if="experimentDia0">
-        <div class="search_label" style="width: 150px;"><span class="required-span">*</span>瀹為獙闃舵</div>
-        <div class="search_input" style="width: 100%;">
-          <el-input clearable v-model="experimentInfo.term" size="small" placeholder=""></el-input>
+      <div style="height: 80vh;overflow-y: auto;">
+        <div class="body" style="display: flex;padding: 10px;align-items: center;" v-if="experimentDia0">
+          <div class="search_label" style="width: 150px;"><span class="required-span">*</span>瀹為獙闃舵</div>
+          <div class="search_input" style="width: 100%;">
+            <el-input clearable v-model="experimentInfo.term" size="small" placeholder=""></el-input>
+          </div>
         </div>
-      </div>
-      <div class="body" style="display: flex;padding: 10px;align-items: center;" v-if="experimentDia0">
-        <div class="search_label" style="width: 150px;"><span class="required-span">*</span>瀹為獙鎿嶄綔</div>
-        <div class="search_input" style="width: 100%;">
-          <el-input clearable v-model="experimentInfo.note" size="small" placeholder="" type="textarea"
-          :rows="2"></el-input>
+        <div class="body" style="display: flex;padding: 10px;align-items: center;" v-if="experimentDia0">
+          <div class="search_label" style="width: 150px;"><span class="required-span">*</span>瀹為獙鎿嶄綔</div>
+          <div class="search_input" style="width: 100%;">
+            <el-input clearable v-model="experimentInfo.note" size="small" placeholder="" type="textarea"
+            :rows="2"></el-input>
+          </div>
         </div>
+        <table border="1" cellpadding="10" class="thermal-table">
+          <tr style="font-size: 18px;font-weight: 500;background-color: #F0F1F5;padding: 10px 0;box-sizing: border-box;">
+            <td>鏍峰搧</td>
+            <td>鏍峰搧缂栧彿</td>
+            <td>鍨嬪彿</td>
+            <td>妫�楠岄」</td>
+            <td>妫�楠屽瓙椤�</td>
+            <td>宸ユ椂</td>
+          </tr>
+          <template v-for="(item,index) in sampleProduct">
+            <tr>
+              <td :rowspan="item.insProduct.length+1">{{ item.sample }}</td>
+              <td :rowspan="item.insProduct.length+1">{{ item.sampleCode }}</td>
+              <td :rowspan="item.insProduct.length+1">{{ item.model }}</td>
+            </tr>
+            <tr v-for="(m,i) in item.insProduct" :key="item.id+i">
+              <td>{{ m.inspectionItem }}</td>
+              <td>{{ m.inspectionItemSubclass }}</td>
+              <td><el-input-number v-model="m.outputWorkTime" :min="0" :max="100" label="宸ユ椂" size="small"></el-input-number></td>
+            </tr>
+          </template>
+        </table>
       </div>
-      <table border="1" cellpadding="10" class="thermal-table">
-        <tr style="font-size: 18px;font-weight: 500;background-color: #F0F1F5;padding: 10px 0;box-sizing: border-box;">
-          <td>鏍峰搧</td>
-          <td>鏍峰搧缂栧彿</td>
-          <td>鍨嬪彿</td>
-          <td>妫�楠岄」</td>
-          <td>妫�楠屽瓙椤�</td>
-          <td>宸ユ椂</td>
-        </tr>
-        <template v-for="(item,index) in sampleProduct">
-          <tr>
-            <td :rowspan="item.insProduct.length+1">{{ item.sample }}</td>
-            <td :rowspan="item.insProduct.length+1">{{ item.sampleCode }}</td>
-            <td :rowspan="item.insProduct.length+1">{{ item.model }}</td>
-          </tr>
-          <tr v-for="(m,i) in item.insProduct" :key="item.id+i">
-            <td>{{ m.inspectionItem }}</td>
-            <td>{{ m.inspectionItemSubclass }}</td>
-            <td><el-input-number v-model="m.outputWorkTime" :min="0" :max="100" label="宸ユ椂" size="small"></el-input-number></td>
-          </tr>
-        </template>
-      </table>
       <span slot="footer" class="dialog-footer">
         <el-button @click="experimentDia = false">鍙� 娑�</el-button>
         <el-button type="primary" @click="submit0">纭� 瀹�</el-button>
@@ -3743,7 +3745,8 @@
         this.lookFileVisible = true
       },
       handleBack(){
-        if(this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('鐢佃矾璇曢獙')){
+        try {
+          if(!this.isLook&&this.state==1&&this.tableLists.find(m=>m.templateId==this.currentTable).templateName.includes('鐢佃矾璇曢獙')){
           this.$confirm('璇风‘璁ゅ綋鍓嶆暟鎹槸鍚﹀叏閮ㄤ繚瀛橈紝鏄惁杩斿洖锛�', '鎻愮ず', {
             confirmButtonText: '纭畾',
             cancelButtonText: '鍙栨秷',
@@ -3754,6 +3757,9 @@
         }else{
           this.$emit('goback')
         }
+        } catch (error) {
+          this.$emit('goback')
+        }
       }
     }
   }
diff --git a/src/components/do/b1-inspect-order-plan/circuit-parameters1.vue b/src/components/do/b1-inspect-order-plan/circuit-parameters1.vue
index 756c6b1..9f0b31e 100644
--- a/src/components/do/b1-inspect-order-plan/circuit-parameters1.vue
+++ b/src/components/do/b1-inspect-order-plan/circuit-parameters1.vue
@@ -116,7 +116,7 @@
               </div>
             </el-col>
             <el-col :span="2">
-              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'涓嶅悎鏍�':(n.result===1?'鍚堟牸':'寰呭畾') }}
+              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'涓嶅悎鏍�':(n.result===1?'鍚堟牸':(n.result===3?'涓嶅垽瀹�':(n.result===3?'涓嶅垽瀹�':'寰呭畾'))) }}
               </div>
             </el-col>
           </el-row>
@@ -167,7 +167,7 @@
               </div>
             </el-col>
             <el-col :span="2">
-              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'涓嶅悎鏍�':(n.result===1?'鍚堟牸':'寰呭畾') }}
+              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'涓嶅悎鏍�':(n.result===1?'鍚堟牸':(n.result===3?'涓嶅垽瀹�':(n.result===3?'涓嶅垽瀹�':'寰呭畾'))) }}
               </div>
             </el-col>
           </el-row>
@@ -210,7 +210,7 @@
               </div>
             </el-col>
             <el-col :span="2">
-              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'涓嶅悎鏍�':(n.result===1?'鍚堟牸':'寰呭畾') }}
+              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'涓嶅悎鏍�':(n.result===1?'鍚堟牸':(n.result===3?'涓嶅垽瀹�':'寰呭畾')) }}
               </div>
             </el-col>
           </el-row>
@@ -248,7 +248,7 @@
               </div>
             </el-col>
             <el-col :span="2">
-              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'涓嶅悎鏍�':(n.result===1?'鍚堟牸':'寰呭畾') }}
+              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'涓嶅悎鏍�':(n.result===1?'鍚堟牸':(n.result===3?'涓嶅垽瀹�':'寰呭畾')) }}
               </div>
             </el-col>
           </el-row>
@@ -394,7 +394,8 @@
     },
     insProduct:{
       deep:true,
-      handler:()=>{
+      handler:function(val){
+        // console.log('鏇存柊椤甸潰鍟�')
         this.initData()
       }
     }
@@ -414,6 +415,7 @@
     },
     // 鍒濆鍖栨暟鎹�
     initData(){
+      this.allBandList = []
       // 澶勭悊椤圭洰
       this.insProductNew = JSON.parse(JSON.stringify(this.insProduct)).filter(m=>m.inspectionItem.includes('鐢佃矾璇曢獙'))
       this.insProductNew.forEach(async item => {
@@ -421,7 +423,7 @@
             this.intermodulationNum++
           }
         // 鑾峰彇璁惧鍒楄〃
-        item.equipOptions = await this.getEquipOptions(item)
+        item.equipOptions = []
       })
       if(this.insProductNew[0].insProductResult2&&this.insProductNew[0].insProductResult2.length>0){
         // 宸茬粡瀛樺湪鍊兼椂锛岃祴鍊�
@@ -494,12 +496,32 @@
           })
         }
       }else{
+        console.log(2222)
         // 娌℃湁鍊兼椂锛屽垵濮嬪寲椤甸潰
         this.insProductNew.forEach(async item => {
           // 璧嬪�艰澶�
           item.equipName = ''
           item.equipValue = ''
           // 璧嬪�肩鍙e拰瑙掑害
+          this.portList = [
+            {
+              value:'1',
+            },
+            {
+              value:'2',
+            },
+            {
+              value:'3',
+            },
+            {
+              value:'4',
+            },
+          ]
+          this.angleList = [
+            {
+              value:''
+            }
+          ]
           item.portList = JSON.parse(JSON.stringify(this.portList))
           item.angleList = JSON.parse(JSON.stringify(this.angleList))
           // 璧嬪�肩粨璁�
@@ -526,6 +548,7 @@
             projectList: JSON.parse(JSON.stringify(this.insProductNew))
           }
         )
+        console.log(this.allBandList)
       }
     },
     // 鍒犻櫎鏁扮粍
diff --git a/src/components/do/b1-inspect-order-plan/circuit-parameters2.vue b/src/components/do/b1-inspect-order-plan/circuit-parameters2.vue
index 84f89f5..5afe6f5 100644
--- a/src/components/do/b1-inspect-order-plan/circuit-parameters2.vue
+++ b/src/components/do/b1-inspect-order-plan/circuit-parameters2.vue
@@ -116,7 +116,7 @@
               </div>
             </el-col>
             <el-col :span="2">
-              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'涓嶅悎鏍�':(n.result===1?'鍚堟牸':'寰呭畾') }}
+              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'涓嶅悎鏍�':(n.result===1?'鍚堟牸':(n.result===3?'涓嶅垽瀹�':'寰呭畾')) }}
               </div>
             </el-col>
           </el-row>
@@ -167,7 +167,7 @@
               </div>
             </el-col>
             <el-col :span="2">
-              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'涓嶅悎鏍�':(n.result===1?'鍚堟牸':'寰呭畾') }}
+              <div style="text-align: center;" :class="{red:n.result===0,green:n.result===1}">{{ n.result===0?'涓嶅悎鏍�':(n.result===1?'鍚堟牸':(n.result===3?'涓嶅垽瀹�':'寰呭畾')) }}
               </div>
             </el-col>
           </el-row>
@@ -275,7 +275,7 @@
     },
     insProduct:{
       deep:true,
-      handler:()=>{
+      handler:function(val){
         this.initData()
       }
     }
@@ -283,7 +283,6 @@
   mounted() {
     this.getTypeDicts()
     this.initData()
-    console.log(2222,this.currentNum)
   },
   methods: {
     // 瀛楀吀鑾峰彇鏁版嵁
@@ -296,11 +295,12 @@
     },
     // 鍒濆鍖栨暟鎹�
     initData(){
+      this.allBandList = []
       // 澶勭悊椤圭洰
       this.insProductNew = JSON.parse(JSON.stringify(this.insProduct)).filter(m=>m.inspectionItem.includes('鐢佃矾璇曢獙'))
       this.insProductNew.forEach(async item => {
         // 鑾峰彇璁惧鍒楄〃
-        item.equipOptions = await this.getEquipOptions(item)
+        item.equipOptions = []
       })
       if(this.insProductNew[0].insProductResult2&&this.insProductNew[0].insProductResult2.length>0){
         // 宸茬粡瀛樺湪鍊兼椂锛岃祴鍊�
@@ -384,6 +384,25 @@
           // 璧嬪�艰澶�
           item.equipName = ''
           item.equipValue = ''
+          this.portList = [
+            {
+              value:'1',
+            },
+            {
+              value:'2',
+            },
+            {
+              value:'3',
+            },
+            {
+              value:'4',
+            },
+          ]
+          this.angleList = [
+            {
+              value:''
+            }
+          ]
           // 璧嬪�肩鍙e拰瑙掑害
           item.portList = JSON.parse(JSON.stringify(this.portList))
           item.angleList = JSON.parse(JSON.stringify(this.angleList))
diff --git a/src/components/view/b1-inspect-order-plan.vue b/src/components/view/b1-inspect-order-plan.vue
index f57ccbf..bec7b50 100644
--- a/src/components/view/b1-inspect-order-plan.vue
+++ b/src/components/view/b1-inspect-order-plan.vue
@@ -373,7 +373,7 @@
         <el-col class="search_thing" :span="24">
           <div class="search_label" style="width: 90px"><span class="required-span">* </span>鏍峰搧缂栧彿锛�</div>
           <div class="search_input">
-            <el-input v-model="sampleCode" size="small"></el-input>
+            <el-input v-model="sampleCode" size="small" clearable></el-input>
           </div>
         </el-col>
       </el-row>
@@ -803,7 +803,8 @@
       keyup(e){
         var code = ''
         try{
-          code = JSON.parse(this.codeInfo)
+          // console.log(2222,this.codeInfo)
+          code = this.codeInfo.substring()
           if(code==null||code==undefined||code==''){
             this.$message.error('璇ヤ簩缁寸爜鏈夎')
           }else{
@@ -811,6 +812,7 @@
           }
         }catch(e){
           this.$message.error('璇疯皟鑷宠嫳鏂囬敭鐩�')
+          console.log(e)
         }
         this.codeInfo = null
       },
diff --git a/src/components/view/b1-inspection-order.vue b/src/components/view/b1-inspection-order.vue
index acf7a90..dde0aa7 100644
--- a/src/components/view/b1-inspection-order.vue
+++ b/src/components/view/b1-inspection-order.vue
@@ -429,7 +429,7 @@
         </el-row>
       </span>
     </el-dialog>
-    <div class="el-dialog__body" style="overflow-y: auto;position: fixed;top:0;right: 20px;z-index: 9999;">
+    <div class="el-dialog__body" style="overflow-y: auto;position: fixed;top:60px;right: 20px;z-index: 9999;">
         <div id="printMOrder" class="printMOrder" ref="printMOrder">
           <el-card class="box-card" v-for="(item, i) in checkDataList" :key="i+'uuuuu'" style="font-size: 16px !important;page-break-after: always;color: #000;box-shadow: none;margin: 0 !important;padding: 0 !important;">
             <div>
@@ -908,6 +908,7 @@
             a.item = [...new Set(arr1)].join(',')
           })
           this.qrData = arr
+          // console.log(this.qrData)
 				})
       },
       //閫夋嫨瑕佹墦鍗扮殑浜岀淮鐮�
diff --git a/src/components/view/b1-sample.vue b/src/components/view/b1-sample.vue
index 6afb89d..537951d 100644
--- a/src/components/view/b1-sample.vue
+++ b/src/components/view/b1-sample.vue
@@ -287,7 +287,7 @@
         <el-col class="search_thing" :span="24">
           <div class="search_label"><span class="required-span">* </span>鏍峰搧缂栧彿锛�</div>
           <div class="search_input">
-            <el-input v-model="sampleCode" size="small" @change="sampleCodeChange"></el-input>
+            <el-input v-model="sampleCode" size="small" @change="sampleCodeChange" clearable></el-input>
           </div>
         </el-col>
       </el-row>
@@ -447,7 +447,7 @@
       keyup(e){
         var code = ''
         try{
-            code = JSON.parse(this.codeInfo)
+            code = this.codeInfo.substring()
             if(code==null||code==undefined||code==''){
                 this.$message.error('璇ヤ簩缁寸爜鏈夎')
             }else{

--
Gitblit v1.9.3