From fbfaa7ff0fa38793f0eb8b4f1b86aa686e59347d Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期一, 05 八月 2024 13:45:08 +0800
Subject: [PATCH] 添加0.00,解决设备名称绑定失败的问题

---
 src/components/do/b1-inspect-order-plan/Inspection.vue |  140 +++++++++++++++++++++++-----------------------
 1 files changed, 69 insertions(+), 71 deletions(-)

diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 655d45b..779e09f 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -22,7 +22,7 @@
 
   .search .form-inline {
     padding-top: 20px;
-    padding-left: 50px;
+    padding-left: 0px;
   }
 
   .center {
@@ -259,13 +259,13 @@
           <el-input clearable v-model="insOrder.entrustCode" disabled size="small" placeholder="璇疯緭鍏�"></el-input>
         </el-form-item>
         <el-form-item label="鏍峰搧缂栧彿:">
-          <el-input clearable v-model="currentSample.sampleCode" disabled size="small" placeholder="璇疯緭鍏�"></el-input>
+          <el-input clearable v-model="currentSample.sampleCode" disabled size="small" placeholder="璇疯緭鍏�" style="width: 100px;"></el-input>
         </el-form-item>
         <el-form-item label="鏍峰搧鍚嶇О:">
           <el-input clearable v-model="currentSample.sample" disabled size="small" placeholder="璇疯緭鍏�"></el-input>
         </el-form-item>
         <el-form-item label="鏍峰搧鏁伴噺:">
-          <el-input clearable v-model="sampleProduct.length" disabled size="small" placeholder="璇疯緭鍏�"></el-input>
+          <el-input clearable v-model="sampleProduct.length" disabled size="small" placeholder="璇疯緭鍏�" style="width: 70px;"></el-input>
         </el-form-item>
         <el-form-item label="涓嬪彂鏃堕棿:">
           <el-input clearable v-model="insOrder.sendTime" disabled size="small" placeholder="璇疯緭鍏�"></el-input>
@@ -274,10 +274,14 @@
           <el-input clearable v-model="insOrder.typeName" disabled size="small" placeholder="璇疯緭鍏�"></el-input>
         </el-form-item>
         <el-form-item label="绾﹀畾鏃堕棿:">
-          <el-input clearable v-model="insOrder.appointed" disabled size="small" placeholder="璇疯緭鍏�"></el-input>
+          <el-input clearable v-model="insOrder.appointed" disabled size="small" placeholder="璇疯緭鍏�" style="width: 100px;"></el-input>
         </el-form-item>
         <el-form-item label="褰撳墠鏍峰搧浣嶆暟:">
           <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-tag v-if="currentKey">{{ insOrder.remark }}</el-tag> -->
         </el-form-item>
       </el-form>
     </div>
@@ -806,7 +810,7 @@
               <td>{{ item.child[0].name }}</td>
               <td style="text-align: left;">
                 <el-checkbox-group
-                  v-model="item.child[0].value" :max="item.child[0].maxNum" @change="n=>handleChangeGetDia(n,item.child[0])">
+                  v-model="getDataIndex" :max="item.child[0].maxNum">
                   <el-checkbox v-for="(n,j) in item.child[0].arr" :label="j" :key="j+'ppppppppp'">{{n}}</el-checkbox>
                 </el-checkbox-group>
               </td>
@@ -815,8 +819,8 @@
               <td>{{ m.name }}</td>
               <td style="text-align: left;">
                 <el-checkbox-group
-                  v-model="m.value" :max="m.maxNum" @change="n=>handleChangeGetDia(n,m)">
-                  <el-checkbox v-for="(n,j) in m.arr" :label="j" :key="j+'bbbbbbbbbbbbbb'" >{{n}}</el-checkbox>
+                  v-model="getDataIndex" :max="m.maxNum">
+                  <el-checkbox v-for="(n,j) in m.arr" :label="j" :key="j+'bbbbbbbbbbbbbb'">{{n}}</el-checkbox>
                 </el-checkbox-group>
               </td>
             </tr>
@@ -1301,10 +1305,10 @@
                     if(str0==str){
                       maxNum = num
                     }
-                    if(data[i][j].equipName&&data[i][j].equipValue){
-                      if(!m.v.v){
-                        this.changeEquip(data[i][j].equipValue,m)
-                      }
+                  }
+                  if(data[i][j].equipName&&data[i][j].equipValue&&m.v&&m.v.ps&&m.v.ps.value=='璁惧缂栫爜'&&str0==str){
+                    if(!m.v.v){
+                      this.changeEquip(data[i][j].equipValue,m,data[i][j].equipName)
                     }
                   }
                 })
@@ -1331,9 +1335,10 @@
         if(this.getData.length>0){
           this.dataGetDia = true
         }else{
-          console.log(555555555555)
           try {
             // 鍚� Worker 鍙戦�佹秷鎭紝寮�濮嬪鐞嗛�昏緫
+            this.getDataIndexLoading = false
+            this.dataGetDia = false
             this.worker0.postMessage(JSON.stringify({
               dataAcquisitionInfo: this.dataAcquisitionInfo,
               list:this.tableList[0].arr
@@ -1354,54 +1359,21 @@
       },
       submitDataGet(){
         if(this.getDataIndex.length==0){
-          this.$message.error('璇烽�夋嫨闇�瑕佽绠楃殑鏁版嵁')
+          this.$message.error('璇烽�夋嫨闇�瑕侀噰闆嗙殑鏁版嵁')
           return
         }
-        // this.getDataIndex.sort((a, b) => a - b);
-        // for (let i in this.dataAcquisitionInfoNew){
-        //   for(let j in this.dataAcquisitionInfoNew[i]){
-        //     if(j!='frequency'&&this.dataAcquisitionInfoNew[i]&&this.dataAcquisitionInfoNew[i][j]&&this.dataAcquisitionInfoNew[i][j].isCalculation){
-        //       let arr = []
-        //       for(let k = 0;k<this.dataAcquisitionInfoNew[i][j].result.length;k++){
-        //         if(this.getDataIndex.includes(k)){
-        //           arr.push(this.dataAcquisitionInfoNew[i][j].result[k])
-        //         }
-        //       }
-        //       if(arr.length>0){
-        //         this.dataAcquisitionInfoNew[i][j].result = arr
-        //       }
-        //     }
-        //   }
-        // }
-        // this.getDataIndexLoading = true;
-        // this.$axios.post(this.$api.deviceScope.formulaCalculation,{
-        //   ...this.dataAcquisitionInfoNew
-        // }, {
-        //   headers: {
-        //     'Content-Type': 'application/json'
-        //   },
-        //   noQs:true
-        // }).then(res=>{
-        //   this.getDataIndexLoading = false;
-        //   if(res.code!=200){
-        //     return
-        //   }
-        //   this.dataGetDia = false
-        //   this.handleDataAcquisition(res.data)
-        //   this.getDataIndex = []
-        // })
-      },
-      handleChangeGetDia(n,m){
-        console.log(22222,n,m);
-        for (let i in this.getData){
-          for(let j in this.getData[i].child){
-            let len = this.getData[i].child[j].arr.length
-            let value = this.getData[i].child[j].value
-            let maxNum = this.getData[i].child[j].maxNum
-            if(len){}
-            // if(){}
+        this.getDataIndex.sort((a, b) => a - b);
+        for (let i=0;i<this.getData.length;i++){
+          for(let j=0;j<this.getData[i].child.length;j++){
+            let arr = []
+            for(let k=0;k<this.getDataIndex.length;k++){
+              arr.push( this.dataAcquisitionInfoNew[this.getData[i].faName][this.getData[i].child[j].name].result[this.getDataIndex[k]])
+            }
+            this.dataAcquisitionInfoNew[this.getData[i].faName][this.getData[i].child[j].name].result = arr
           }
         }
+        this.getDataIndexLoading = true
+        this.handleDataAcquisition(this.dataAcquisitionInfoNew)
       },
       // 澶氱嚎绋�
       startWorker() {
@@ -1545,6 +1517,23 @@
                       ]
                       obj.value0 = insValue[0].v
                       obj.value1 = insValue[1].v
+                    }else if(insValue&&insValue.length==1){
+                      this.param[obj.id].insValue = [
+                        {
+                          i:obj.id,
+                          v:{
+                            v:insValue[0].v
+                          }
+                        },
+                        {
+                          i:obj.id,
+                          v:{
+                            v:''
+                          }
+                        }
+                      ]
+                      obj.value0 = insValue[0].v
+                      obj.value1 = ''
                     }
                     break;
                   case 'comValue':
@@ -2650,18 +2639,6 @@
                     }
                   }
                 }
-                // let obj = this.param[code.split('-')[3]]
-                // this.tableList[0].arr.forEach(item=>{
-                //   item.forEach(m=>{
-                //     if(obj&&obj.insResult&&m.c==obj.insResult.c&&m.r==obj.insResult.r){
-                //       m.v.v = obj.insResult.v.v
-                //     }
-                //     if(obj&&obj.resValue&&m.c==obj.resValue.c&&m.r==obj.resValue.r){
-                //       m.v.v = obj.resValue.v.v
-                //     }
-                //   })
-                // })
-                // console.log(this.tableList,this.param)
                 this.saveInsContext()
               })
               break;
@@ -2928,7 +2905,7 @@
         this.$axios.get(this.$api.user.getUserInfo).then(res => {
           this.userId = res.data.id
           this.componentData.entity.userId = res.data.id
-          console.log(1111,this.userId)
+          // console.log(1111,this.userId)
         })
       },
       // 澶嶆牳
@@ -3080,11 +3057,15 @@
           console.log(999,error);
         }
       },
-      changeEquip(val, n) {
+      changeEquip(val, n,v) {
+        this.$set(n.v,'v',val)
         this.tableList[0].arr.forEach((item,index)=>{
           item.forEach((m,i)=>{
             if(this.param[m.i]){
               this.param[m.i].state = 1
+            }
+            if(m.i==n.i&&m.v.ps&&m.v.ps.value=='璁惧鍚嶇О'&&v){
+              this.$set(m.v,'v',v)
             }
           })
         })
@@ -3093,14 +3074,31 @@
             delete this.param[i]
           }
         }
+        if(val&&v){
+          for (let i1 in this.param[n.i].equipName) {
+            if (this.param[n.i].equipName[i1].i === n.i && this.param[n.i].equipName[i1].r === n.r) {
+              this.$delete(this.param[n.i].equipValue[i1].v,'v')
+              this.$set(this.param[n.i].equipValue[i1].v,'v',val)
+              this.$delete(this.param[n.i].equipName[i1].v,'v')
+              this.$set(this.param[n.i].equipName[i1].v,'v',v)
+            }
+          }
+        }
         for (let i in this.equipOptions) {
-          if (this.equipOptions[i].value === val) {
+          if (this.equipOptions[i].value == val) {
             for (let i1 in this.param[n.i].equipName) {
               if (this.param[n.i].equipName[i1].i === n.i && this.param[n.i].equipName[i1].r === n.r) {
                 this.$delete(this.param[n.i].equipValue[i1].v,'v')
                 this.$set(this.param[n.i].equipValue[i1].v,'v',val)
                 this.$delete(this.param[n.i].equipName[i1].v,'v')
                 this.$set(this.param[n.i].equipName[i1].v,'v',this.equipOptions[i].label)
+                this.tableList[0].arr.forEach((item,index)=>{
+                  item.forEach((m)=>{
+                    if(m.i==n.i&&m.v.ps&&m.v.ps.value=='璁惧鍚嶇О'){
+                      this.$set(m.v,'v',this.equipOptions[i].label)
+                    }
+                  })
+                })
               }
             }
           }

--
Gitblit v1.9.3