From 2e9370979f871bf47f6dc145c49d7bf32ffa4b51 Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期一, 03 六月 2024 09:08:02 +0800
Subject: [PATCH] 完成光纤配置进行检验

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

diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 7f56a52..f0d7503 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -175,6 +175,9 @@
     <el-row class="title">
       <el-col :span="12" style="padding-left: 20px;">妫�楠屽崟璇︽儏</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>
+        <el-button size="small" type="primary" @click="fiberOpticTapeVisible=true" v-if="fiberOpticTape.length>0">鍏夌氦甯﹀垏鎹�</el-button>
+        <el-button size="small" type="primary" @click="bushingVisible=true" v-if="bushing.length>0">濂楃鍒囨崲</el-button>
         <el-button size="small" type="primary" @click="sampleVisible=true">鏍峰搧鍒囨崲</el-button>
         <el-button size="small" type="primary" @click="taskVisible=true">浠诲姟鍒囨崲</el-button>
         <el-button size="small" type="primary" @click="addVerifyDia = true" v-show="state==1"
@@ -241,9 +244,10 @@
                     <el-input v-else-if="getInspectionValueType(n.i) == 2" class="table_input" type="textarea"
                       v-model="n.v.v"
                       :disabled="getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '')"
-                      @change="saveInsContext()" />
+                      @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`)" />
                     <el-select v-else-if="getInspectionValueType(n.i) == 5" class="table_input" v-model="n.v.v"
-                      :disabled="state>1" @visible-change="e=>getDic(e,n.i)" @change="saveInsContext()">
+                      :disabled="state>1" @visible-change="e=>getDic(e,n.i)"
+                       @change="m=>changeInput(m,`${item.templateId}-${n.r}-${n.c}-${n.i}`)">
                       <el-option v-for="(e, i) in enumList" :key="i" :label="e.label" :value="e.value"></el-option>
                     </el-select>
                     <span :style="`font-family:${n.v.ff} !important;`"
@@ -272,14 +276,14 @@
                     <span :style="`font-family:${n.v.ff} !important;`">{{getTell(n.i)}}</span>
                   </template>
                   <template v-else-if="n.v.ps!=undefined && n.v.ps.value==='鏈�缁堝��' && state==1">
-                    <el-input class="table_input" type="textarea"
+                    <!-- <el-input class="table_input" type="textarea"
                       :disabled="getInspectionItemType(n.i) == 1 || (n.u != userId && n.u != undefined && n.u != '')"
                       v-model="n.v.v" @change="saveInsContext()" v-if="getInspectionValueType(n.i) == 2"></el-input>
                     <el-select v-else-if="getInspectionValueType(n.i) == 5" class="table_input" v-model="n.v.v"
                       :disabled="state>1" @visible-change="e=>getDic(e,n.i)" @change="saveInsContext()">
                       <el-option v-for="(e, i) in enumList" :key="i" :label="e.label" :value="e.value"></el-option>
-                    </el-select>
-                    <span v-else :style="`font-family:${n.v.ff} !important;`">{{n.v.v}}</span>
+                    </el-select> -->
+                    <span :style="`font-family:${n.v.ff} !important;`">{{n.v.v}}</span>
                   </template>
                   <span v-else :style="`font-family:${n.v.ff} !important;`">{{n.v.v}}</span>
                 </div>
@@ -289,6 +293,43 @@
         </table>
       </div>
     </div>
+    <el-drawer title="鍏夌氦鍒囨崲" :visible.sync="fiberOpticVisible" :size="500">
+      <el-table class="el-table" ref="fiberOpticTable" :data="fiberOptic" height="100%" tooltip-effect="dark" border
+        highlight-current-row @row-click="handleChangeOptic" :row-class-name="tableRowClassName"
+        :current-row-key="currentKey" :row-key="record=>record.index" v-if="fiberOpticVisible">
+        <el-table-column type="index" align="center" label="搴忓彿" width="70px" :key="Math.random()">
+        </el-table-column>
+        <el-table-column prop="bushColor" label="绠″鑹叉爣" min-width="100px" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="color" label="鍏夌氦鑹叉爣" min-width="100px" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="model" label="鍏夌氦瑙勬牸" min-width="130px" show-overflow-tooltip
+         ></el-table-column>
+        <el-table-column prop="standard" label="鍙傝�冩爣鍑�" width="100px" show-overflow-tooltip></el-table-column>
+      </el-table>
+    </el-drawer>
+    <el-drawer title="鍏夌氦甯﹀垏鎹�" :visible.sync="fiberOpticTapeVisible" :size="500">
+      <el-table class="el-table" ref="fiberOpticTapeTable" :data="fiberOpticTape" height="100%" tooltip-effect="dark" border
+        highlight-current-row @row-click="handleChangeTape" :row-class-name="tableRowClassName"
+        :current-row-key="currentKey" :row-key="record=>record.index" v-if="fiberOpticTapeVisible">
+        <el-table-column type="index" align="center" label="搴忓彿" width="70px" :key="Math.random()">
+        </el-table-column>
+        <el-table-column prop="code" label="鍏夌氦甯︾紪鍙�" min-width="110px" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="model" label="鍏夌氦甯﹁鏍�" min-width="110px" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="standard" label="鍙傝�冩爣鍑�" width="90px" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="num" label="鍏夌氦妫�娴嬮噺" min-width="110px" show-overflow-tooltip
+          ></el-table-column>
+      </el-table>
+    </el-drawer>
+    <el-drawer title="濂楃鍒囨崲" :visible.sync="bushingVisible" :size="500">
+      <el-table class="el-table" ref="bushingTable" :data="bushing" height="100%" tooltip-effect="dark" border
+        highlight-current-row @row-click="handleChangeBushing" :row-class-name="tableRowClassName"
+        :current-row-key="currentKey" :row-key="record=>record.index" v-if="bushingVisible">
+        <el-table-column type="index" align="center" label="搴忓彿" width="70px" :key="Math.random()">
+        </el-table-column>
+        <el-table-column prop="color" label="绠¤壊鏍�" min-width="100px" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="standNum" label="鏍囬噺" min-width="100px" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="testNum" label="娴嬭瘯閲�" min-width="100px" show-overflow-tooltip></el-table-column>
+      </el-table>
+    </el-drawer>
     <el-drawer title="鏍峰搧鍒囨崲" :visible.sync="sampleVisible" :size="500">
       <el-table class="el-table" ref="productTable" :data="sampleProduct" height="100%" tooltip-effect="dark" border
         highlight-current-row @row-click="handleChangeSample" :row-class-name="tableRowClassName"
@@ -318,7 +359,7 @@
       </el-table>
     </el-drawer>
     <el-drawer title="浠诲姟鍒囨崲" :visible.sync="taskVisible" :size="500">
-      <ValueTable class="value-table" ref="insOrderPlan" :url="$api.insOrderPlan.selectInsOrderPlanList"
+      <ValueTable class="value-table" ref="insOrderPlan" :url="$api.insOrderPlan.inspectionOrderDetailsTaskSwitching"
         :componentData="componentData" :key="upIndex" style="height: 100%;"/>
     </el-drawer>
     <el-dialog title="妫�楠屽鏍�" :visible.sync="reviewDia" width="500px">
@@ -352,9 +393,6 @@
 </template>
 
 <script>
-  import {
-    set
-  } from 'shelljs';
   import ValueTable from '../../tool/value-table.vue'
   export default {
     props: ['sonLaboratory', 'orderId', 'state'],
@@ -422,7 +460,16 @@
         addVerifyDia: false,
         verifyUser: null,
         personList: [],
-        enumList: []
+        enumList: [],
+        fiberOpticVisible:false,
+        fiberOpticTapeVisible:false,
+        bushingVisible:false,
+        fiberOpticTape:[],//鍏夌氦甯﹀垪琛�
+        fiberOptic:[],//鍏夌氦鍒楄〃
+        bushing:[],//濂楃鍒楄〃
+        currentFiberOpticTape:null,//褰撳墠鍏夌氦甯�
+        currentFiberOptic:null,//褰撳墠鍏夌氦
+        currentBushing:null,//褰撳墠濂楃
       }
     },
     created() {
@@ -451,7 +498,7 @@
             }
           })
           this.sampleProduct = res.data.sampleProduct
-          this.currentSample = this.sampleProduct[0]
+          this.currentSample = this.HaveJson(this.sampleProduct[0])
           this.currentSample.insProduct.forEach(a => {
             this.param[a.id] = {
               insValue: [],
@@ -463,11 +510,23 @@
             }
           })
           if (this.currentSample.index == undefined) this.currentSample['index'] = 1
+          let bushing = this.currentSample.bushing
           this.loading = false
           // this.handleTableData()
           this.getTableLists();
           this.componentData.currentId = val;
           this.currentKey = 1;
+
+          // 娓呯┖鍏夌氦閰嶇疆鐩稿叧鏁版嵁
+          this.fiberOpticTape = []
+          this.currentFiberOpticTape = null;
+          this.fiberOptic = []
+          this.currentFiberOptic = null;
+          this.bushing = []
+          this.currentBushing = null;
+          if(bushing&&bushing.length>0){
+            this.bushing = bushing
+          }
         })
       },
       currentTable(val1, val0) {
@@ -483,9 +542,70 @@
       }
     },
     methods: {
-      handleChangeSample(row, column, event) {
-        this.currentSample = row;
+      handleChangeBushing(row, column, event){
+        this.currentBushing = row;
+        this.fiberOpticTape = []
+        this.currentFiberOpticTape = null;
+        this.fiberOptic = []
+        this.currentFiberOptic = null;
+        if(row.fiber&&row.fiber.length>0){
+          // 鐩存帴閰嶇疆鍏夌氦
+          this.fiberOptic = row.fiber;
+        }else if(row.fibers&&row.fibers.length>0){
+          // 閰嶇疆鍏夌氦甯﹀悗锛屽啀閰嶇疆鍏夌氦
+          this.fiberOpticTape = row.fibers;
+        }
+        this.bushingVisible = false;
+      },
+      handleChangeOptic(row, column, event){
+        this.currentFiberOptic = row;
+        this.currentFiberOptic.productList.forEach(a => {
+          this.param[a.id] = {
+            insValue: [],
+            comValue: [],
+            resValue: null,
+            equipValue: [],
+            equipName: [],
+            insResult: null
+          }
+        })
+        this.getTableLists0(row)
+        this.fiberOpticVisible = false;
+        this.currentKey = row.index
+      },
+      handleChangeTape(row, column, event){
+        this.currentFiberOpticTape = row;
         this.param = {}
+        this.fiberOptic = []
+        this.currentFiberOptic = null;
+        this.currentFiberOpticTape.productList.forEach(a => {
+          this.param[a.id] = {
+            insValue: [],
+            comValue: [],
+            resValue: null,
+            equipValue: [],
+            equipName: [],
+            insResult: null
+          }
+        })
+        this.getTableLists0(row)
+        if(row.fiber&&row.fiber.length>0){
+          // 閰嶇疆鍏夌氦
+          this.fiberOptic = row.fiber;
+        }
+        this.fiberOpticTapeVisible = false;
+        this.currentKey = row.index
+      },
+      handleChangeSample(row, column, event) {
+        this.param = {}
+        // 娓呯┖鍏夌氦閰嶇疆鐩稿叧鏁版嵁
+        this.fiberOpticTape = []
+        this.currentFiberOpticTape = null;
+        this.fiberOptic = []
+        this.currentFiberOptic = null;
+        this.bushing = []
+        this.currentBushing = null;
+        this.currentSample.insProduct = this.HaveJson(row.insProduct)
         this.currentSample.insProduct.forEach(a => {
           this.param[a.id] = {
             insValue: [],
@@ -496,6 +616,10 @@
             insResult: null
           }
         })
+        let bushing = this.currentSample.bushing
+        if(bushing&&bushing.length>0){
+          this.bushing = bushing
+        }
         // this.handleTableData()
         this.getTableLists();
         this.sampleVisible = false;
@@ -586,6 +710,30 @@
           this.tableList = null;
           this.tableList = [this.tableLists[0]]
           this.currentTable = this.tableLists[0].templateId;
+          this.handleTableData()
+        }
+      },
+      // 鍏夌氦閰嶇疆鐩稿叧妯℃澘table鍒楄〃
+      getTableLists0(obj){
+        const mySet1 = new Set();
+        this.tableLists = obj.productList.filter(m => {
+          let num0 = mySet1.size;
+          if (m.templateId != null&&m.template != null) {
+            mySet1.add(JSON.stringify({
+              template: m.template,
+              templateId: m.templateId
+            }))
+          }
+          let num1 = mySet1.size;
+          if (num1 > num0) {
+            return m
+          }
+        });
+        if (this.tableLists && this.tableLists.length > 0) {
+          this.tableList = null;
+          this.tableList = [this.tableLists[0]]
+          this.currentTable = this.tableLists[0].templateId;
+          this.currentSample.insProduct = this.HaveJson(obj.productList)
           this.handleTableData()
         }
       },
@@ -843,15 +991,19 @@
                 if (b[0].r == a.r) {
                   b.forEach(c => {
                     if (c.c == a.c) {
-                      if (!isNaN(parseFloat(c.v.v))) {
-                        var tableCode = ''
-                        for (var d in this.comparisonList) {
-                          if (c.c == this.comparisonList[d].value) {
-                            tableCode = this.comparisonList[d].label
-                            break
-                          }
+                      var tableCode = ''
+                      for (var d in this.comparisonList) {
+                        if (c.c == this.comparisonList[d].value) {
+                          tableCode = this.comparisonList[d].label
+                          break
                         }
-                        comValue[(tableCode + (c.r + 1))] = parseFloat(c.v.v)
+                      }
+                      if(this.getInspectionValueType(item.i)==1){
+                        if (!isNaN(parseFloat(c.v.v))) {
+                          comValue[(tableCode + (c.r + 1))] = parseFloat(c.v.v)
+                        }
+                      }else{
+                        comValue[(tableCode + (c.r + 1))] = c.v.v
                       }
                     }
                   })
@@ -865,24 +1017,22 @@
                 let comp = ask.map((m, i) => {
                   if (m.includes('=')) {
                     return res == m.split('=')[1]
-                  }
-                  if (m.includes('鈮�')) {
+                  } else if (m.includes('鈮�')) {
                     return res >= m.split('鈮�')[1]
-                  }
-                  if (m.includes('鈮�')) {
+                  }else if (m.includes('鈮�')) {
                     return res <= m.split('鈮�')[1]
-                  }
-                  if (m.includes('<')) {
+                  }else if (m.includes('<')) {
                     return res < m.split('<')[1]
-                  }
-                  if (m.includes('>')) {
+                  }else if (m.includes('>')) {
                     return res > m.split('>')[1]
                   }
                 })
-                if (comp.every(m => m)) {
-                  item.v.v = 1
-                } else {
-                  item.v.v = 0
+                if(this.getInspectionValueType(item.i)==1){
+                  if (comp.every(m => m)) {
+                    item.v.v = 1
+                  } else {
+                    item.v.v = 0
+                  }
                 }
                 this.saveInsContext()
               }
@@ -922,14 +1072,18 @@
                   valueList.forEach(b => {
                     str = str.replace(b.name, b.value)
                   })
-                  if (item.v.f.includes('/') > -1) {
+                  if (item.v.f.includes('/')) {
                     if (Object.getOwnPropertyNames(comValue).length == valueList.length) {
                       comResult = eval(str)
                     } else {
                       comResult = ''
                     }
                   } else {
-                    comResult = eval(str)
+                    if(this.getInspectionValueType(item.i)==1){
+                      comResult = eval(str)
+                    }else{
+                      comResult = str
+                    }
                   }
                   break;
               }
@@ -937,8 +1091,12 @@
                 if (a[0].r == item.r && comResult != '') {
                   for (var b in a) {
                     if (a[b].c == item.c) {
-                      let val = parseFloat(comResult.toFixed(3))
-                      a[b].v.v = isNaN(val) ? '' : val
+                      try{
+                        let val = parseFloat(comResult.toFixed(3))
+                        a[b].v.v = isNaN(val) ? '' : val
+                      }catch(e){
+                        a[b].v.v = comResult
+                      }
                       break
                     }
                   }

--
Gitblit v1.9.3