From b9e6b361bdb8cd26b9768602734b3a078dcdee26 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期三, 31 七月 2024 12:18:14 +0800
Subject: [PATCH] 修改检验任务bug

---
 static/js/worker.js                                    |    7 ++++++-
 src/components/do/b1-ins-order/add.vue                 |   19 +++++++++++++++++--
 src/main.js                                            |    2 +-
 src/components/do/b1-inspect-order-plan/Inspection.vue |   14 +++++++++-----
 4 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index 6ca49cf..650f2f4 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -2063,15 +2063,30 @@
       upProductSelect(selection, row) {
         this.bsm1DiaList = []
         row.state = row.state == 1 ? 0 : 1
-        if (row.bsm === '1' && row.section !== '' && row.section !== null && row.state === 1) {
+        let arr = this.productList.filter(m=>m.state==1&&row.section.includes(m.section)&&m.ask&&m.section.indexOf('[')==-1)
+        if (row.bsm === '1' && row.section !== '' && row.section !== null && row.state === 1&&arr.length==0) {
           if (row.section.indexOf('[') > -1) {
             row.bsmRow = this.HaveJson(row)
           }
           row.bsm1 = true
           this.bsm1DiaList.push(row)
           this.bsm1DiaAll = true
-        } else if (row.bsm === '1' && row.section !== '' && row.section !== null && row.state === 0) {
+        } else if (row.bsm === '1' && row.section !== '' && row.section !== null && row.state === 0&&arr.length==0) {
           row.bsm1 = false
+        }else if(arr.length>0){
+          row.bsmRow = this.HaveJson(row)
+          let section = arr[0].section
+          let arr0 = JSON.parse(row.section)
+          let arr1 = JSON.parse(row.ask)
+          let arr2 = JSON.parse(row.manHour)
+          let arr3 = JSON.parse(row.price)
+          let arr4 = JSON.parse(row.tell)
+          let index = arr0.indexOf(section)
+          row.section = section
+          row.ask = arr1[index]
+          row.manHour = arr2[index]
+          row.price = arr3[index]
+          row.tell = arr4[index]
         }
         if (row.bsm === '1' && row.inspectionItem === '鍏夌氦鎺ュご鎹熻��' && this.sampleList.length > 1 && row.state === 1&&!this.isBsm2Val2) {
           this.bsm2 = true
diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 73bde1c..bd0d974 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -322,7 +322,7 @@
         </div>
       </div>
       <div class="center-box" id="nav" v-loading="tableLoading" v-if="!tableLists.find(m=>m.templateId==currentTable)||(tableLists.find(m=>m.templateId==currentTable).templateName!='娓╁害寰幆妫�楠屽師濮嬭褰�'&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('鐑惊鐜�')&&!tableLists.find(m=>m.templateId==currentTable).templateName.includes('娓╁崌璇曢獙'))">
-        <table border="1" class="tables" cellpadding="10" v-for="(item,index) in tableList" :key="index">
+        <table border="1" class="tables" cellpadding="10" v-for="(item,index) in tableList" :key="index+currentTable">
           <tbody>
             <tr v-for="(m,i) in item.arr" :key="i">
               <td :id='item.templateId+"-"+n.i+"-"+n.r+"-"+n.c' v-for="(n,j) in m" :key="j"
@@ -1052,8 +1052,10 @@
         if (val0 != null && val1 != val0) {
           this.tableLists.forEach((m, i) => {
             if (m.templateId == val1) {
-              this.tableList = null;
-              this.tableList = [(this.tableLists[i])];
+              // this.tableList = null;
+              // this.tableList = [(this.tableLists[i])];
+              this.$delete(this.tableList, 0)
+              this.$set(this.tableList, 0, this.tableLists[i])
               this.handleTableData()
             }
           })
@@ -2363,7 +2365,8 @@
             comparisonList:this.comparisonList,
             currentSample:this.currentSample,
             PROJECT:this.PROJECT,
-            param:this.param
+            param:this.param,
+            currentTable:this.currentTable
           }));
         } catch (error) {
           console.log(444,error);
@@ -2799,7 +2802,8 @@
             this.worker.postMessage(JSON.stringify({
               type: 'saveData',
               tableList:this.tableList,
-              param:this.param
+              param:this.param,
+              currentTable:this.currentTable
             }));
           }
         }catch (error) {
diff --git a/src/main.js b/src/main.js
index 2ac230c..01126d7 100644
--- a/src/main.js
+++ b/src/main.js
@@ -20,7 +20,7 @@
 //鏈湴
 // Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80";
 // const javaApi = 'http://127.0.0.1:8001';
-const javaApi = 'http://192.168.92.2:8001';
+const javaApi = 'http://192.168.92.249:8001';
 
 //浜�
 // Vue.prototype.LOCATIONVUE = "http://114.132.189.42:8080";
diff --git a/static/js/worker.js b/static/js/worker.js
index 28c9c74..08e8046 100644
--- a/static/js/worker.js
+++ b/static/js/worker.js
@@ -10,8 +10,13 @@
   value:null
 }
 let param = null
+let currentTable = ''
 self.onmessage = function(event) {
   const data = JSON.parse(event.data);
+  if(currentTable!=data.currentTable){
+    tableList = data.tableList;
+  }
+  currentTable = data.currentTable;
   if(data.type&&data.type=='saveData'){
     tableList = data.tableList;
     param = data.param;
@@ -341,7 +346,7 @@
                       a[b].v.v = 0
                     }else if(a[b].v.ct&&a[b].v.ct.fa&&typeof a[b].v.ct.fa == 'string'&&a[b].v.ct.fa.includes('.')){
                       let num = 0
-                      let str = n.v.ct.fa.split('.')[1]
+                      let str = a[b].v.ct.fa.split('.')[1]
                       num = str.length
                       a[b].v.v = comResult?Number(comResult).toFixed(num):0
                     }else{

--
Gitblit v1.9.3