From ab87478ba941f90cd60252cf4d34aa585dc1a63f Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期一, 22 七月 2024 18:29:10 +0800
Subject: [PATCH] 设备数采配置 调整

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

diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 28d912b..b27d4eb 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -209,9 +209,6 @@
   <div v-loading="loading" class="inspection">
     <el-row class="title">
       <el-col :span="12" style="padding-left: 20px;text-align: left;">妫�楠屽崟璇︽儏
-        <!-- <span style="color: #3A7BFA;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;鏍峰搧</span>
-        <span v-if="currentFiberOpticTape" style="color: #3A7BFA;"> - 鍏夌氦甯�</span>
-        <span v-if="currentFiberOptic" style="color: #3A7BFA;"> - 鍏夌氦</span> -->
       </el-col>
       <el-col :span="12" style="text-align: right;">
         <!-- <el-button size="small" type="primary" @click="fiberOpticVisible=true" v-if="fiberOptic.length>0">鍏夌氦鍒囨崲</el-button>
@@ -689,6 +686,7 @@
   import ValueTable from '../../tool/value-table.vue'
   import file from '../../../util/file'
   import excelFunction from '../../../util/excelFountion'
+import { number } from 'echarts'
   export default {
     props: ['sonLaboratory', 'orderId', 'state'],
     components: {
@@ -1009,13 +1007,13 @@
     methods: {
       getDataAcquisitionDevice(){
         this.dataAcquisitionLoading = true
-        this.$axios.get(this.$api.deviceScope.dataCollection+'?entrustCode='+this.insOrder.entrustCode+'&sampleCode='+this.currentSample.sampleCode).then(res=>{
+        this.$axios.get(this.$api.deviceScope.dataCollection+'?entrustCode='+this.insOrder.entrustCode+'&sampleCode='+this.currentSample.sampleCode + '&id=' + this.currentSample.id).then(res=>{
           this.dataAcquisitionLoading = false
           if(res.code!=200){
             return
           }
           this.dataAcquisitionInfo = res.data
-          let list = this.currentSample.insProduct[0].arr
+          let list = this.tableList[0].arr
           list.forEach((item,index)=>{
             item.forEach(m=>{
               if(m.v.ps&&(m.v.ps.value=='妫�楠屽瓙椤�'||m.v.ps.value=='妫�楠岄」')){
@@ -1026,19 +1024,21 @@
                       num++
                     }
                   })
-                  list[index].forEach(n=>{
+                  list[index].forEach((n,i)=>{
                     if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('妫�楠屽��')){
-                      if(n.v.ps.value.includes(this.dataAcquisitionInfo.frequency)){
+                      if(n.v.ps.value.includes(this.dataAcquisitionInfo.frequency)&&!n.v.ps.value.includes(this.dataAcquisitionInfo.frequency+'0')){
                         setTimeout(()=>{
-                          n.v.v = this.dataAcquisitionInfo[m.v.m]
+                          this.$delete(n.v,'v')
+                          this.$set(n.v,'v',this.dataAcquisitionInfo[m.v.m])
                           this.changeInput('',`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,n)
                         },1000)
-                      }else if(this.dataAcquisitionInfo.frequency>num){
+                      }else if(Number(this.dataAcquisitionInfo.frequency)>num){
                         if(n.v.ps.value.includes(num)){
                           setTimeout(()=>{
-                            n.v.v = this.dataAcquisitionInfo[m.v.m]
+                            this.$delete(n.v,'v')
+                            this.$set(n.v,'v',this.dataAcquisitionInfo[m.v.m])
                             this.changeInput('',`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,n)
-                          },200)
+                          },1000)
                         }
                       }
                     }
@@ -1256,7 +1256,6 @@
             }
             arr2.push(obj)
           })
-          console.log(arr2)
           this.wareTableData = arr2
         })
         this.getEquipOptions(true,this.currentSample.insProduct[0].id)
@@ -1796,18 +1795,19 @@
                 if(equipValue[i].v){
                   let isItADataAcquisitionDevice = await this.determineWhetherToCollectData(equipValue[i].v)
                   this.param[a.id].equipValue[i].isItADataAcquisitionDevice = isItADataAcquisitionDevice
-                  this.dataAcquisitionEidt = 0
-                  if(this.param){
-                    for (let key in this.param) {
-                      this.param[key].equipValue.forEach(m=>{
-                        if(m.isItADataAcquisitionDevice){
-                          this.dataAcquisitionEidt++
-                        }
-                      })
-                    }
-                  }
+
                 }else{
                   this.param[a.id].equipValue[i].isItADataAcquisitionDevice = false
+                }
+                this.dataAcquisitionEidt = 0
+                if(this.param){
+                  for (let key in this.param) {
+                    this.param[key].equipValue.forEach(m=>{
+                      if(m.isItADataAcquisitionDevice){
+                        this.dataAcquisitionEidt++
+                      }
+                    })
+                  }
                 }
               }
             }
@@ -1831,7 +1831,6 @@
         this.handleExcelMethod()
       },
       changeInput(m, code, n) {
-        console.log(m, code)
         if (n) {
           // if (this.PROJECT === '瑁呭鐢电紗') {
           //   let num2 = new this.$Big(n.v.v)
@@ -1864,7 +1863,8 @@
           switch (this.result.method){
             case 'saveInsContext':
               this.$nextTick(()=>{
-                this.tableList = this.result.value.tableList
+                this.$delete(this.tableList[0],'arr')
+                this.$set(this.tableList[0],'arr',this.result.value.tableList[0].arr)
                 this.param = this.result.value.param
                 for (var i in this.param){
                   if(this.param[i].insResult&&this.param[i].insResult.v&&this.param[i].insResult.v.v){
@@ -1880,16 +1880,14 @@
               break;
             case 'tableList':
               this.$nextTick(()=>{
-                this.tableList = this.result.value
+                this.$delete(this.tableList[0],'arr')
+                this.$set(this.tableList[0],'arr',this.result.value[0].arr)
               })
               break;
             case 'getCurrentInsProduct':
               this.getCurrentInsProduct(this.result.value)
               break;
           }
-          // if(this.result.method=='saveInsContext'){
-          //   this.stopWorker(); // 澶勭悊瀹屾垚鍚庡仠姝� Worker
-          // }
         };
       },
       async determineWhetherToCollectData(managementNumber){
@@ -2178,7 +2176,9 @@
               this.$axios.post(this.$api.insOrderPlan.submitPlan, {
                 orderId: this.orderId,
                 laboratory: this.sonLaboratory,
-                verifyUser: this.verifyUser
+                verifyUser: this.verifyUser,
+                entrustCode: this.insOrder.entrustCode,
+                sampleCode: this.currentSample.sampleCode
               }).then(res => {
                 if (res.code === 200) {
                   this.$message.success("鎿嶄綔鎴愬姛")
@@ -2231,7 +2231,7 @@
         return
       },
       saveInsContext() {
-        console.log(1111,this.param)
+        // console.log(1111,this.param)
         if(this.param){
           this.$axios.post(this.$api.insOrderPlan.saveInsContext, {
             param: JSON.stringify(this.param)

--
Gitblit v1.9.3