From 4163a1afd6fc4c787db36d53dc40c4b1f3f9b916 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期三, 11 九月 2024 13:38:19 +0800
Subject: [PATCH] x新增历史记录查看功能

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

diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index 2806de1..f6ee9fe 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -181,6 +181,10 @@
     display: inline-flex;
     align-items: center;
   }
+  .history-btn{
+    display: flex;
+    align-items: center;
+  }
 </style>
 <style>
   .inspection .el-form-item__label {
@@ -254,18 +258,18 @@
       </el-col>
       <el-col :span="12" style="text-align: right;">
         <el-button size="small" type="primary" @click="sampleVisible=true;uploadSample()">鏍峰搧鍒囨崲</el-button>
-        <el-button size="small" type="primary" @click="taskVisible=true">浠诲姟鍒囨崲</el-button>
+        <el-button size="small" type="primary" @click="taskVisible=true" v-show="!isLook">浠诲姟鍒囨崲</el-button>
         <el-button size="small" type="primary" @click="handleSubmit" v-if="state==1"
           :loading="submitLoading">鎻愪氦</el-button>
         <!-- 澶嶆牳 -->
         <el-button size="small" type="primary" @click="upInsReview(1)" :loading="reviewLoading"
-          v-if="state>1">缁х画璇曢獙</el-button>
-        <el-button size="small" @click="upInsReview(0)" v-if="state>1" type="danger">鍐嶆璇曢獙</el-button>
-        <el-button size="small" @click="upInsReview(2)" v-if="state>1">缁撴潫璇曢獙</el-button>
+          v-if="state>1&&!isLook">缁х画璇曢獙</el-button>
+        <el-button size="small" @click="upInsReview(0)" v-if="state>1&&!isLook" type="danger">鍐嶆璇曢獙</el-button>
+        <el-button size="small" @click="upInsReview(2)" v-if="state>1&&!isLook">缁撴潫璇曢獙</el-button>
         <el-button size="small" @click="$emit('goback')">杩斿洖</el-button>
       </el-col>
     </el-row>
-    <div class="search">
+    <div class="search" v-show="!isLook">
       <el-form :inline="true" :model="searchForm" class="form-inline" label-width="100px" label-position="right">
         <el-form-item label="濮旀墭缂栧彿:">
           <el-input clearable v-model="insOrder.entrustCode" disabled size="small" placeholder="璇疯緭鍏�"></el-input>
@@ -351,6 +355,11 @@
           </el-select>
           <el-button type="primary" size="small" v-if="(isGet||tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName=='娓╁害寰幆妫�楠屽師濮嬭褰�'&&temDataAcquisition)&&PROJECT=='妫�娴嬩腑蹇�'&&state==1" @click="getDataAcquisitionDevice" :loading="dataAcquisitionLoading">鏁版嵁閲囬泦</el-button>
           <el-button :type="dataAcquisitionEidtAble?'':'primary'" size="small" v-if="(isGet||(tableLists.find(m=>m.templateId==currentTable)&&tableLists.find(m=>m.templateId==currentTable).templateName=='娓╁害寰幆妫�楠屽師濮嬭褰�'))&&PROJECT=='妫�娴嬩腑蹇�'&&collected&&state==1" @click="dataAcquisitionEidtAble=!dataAcquisitionEidtAble">{{dataAcquisitionEidtAble?'鍏抽棴缂栬緫':'缂栬緫鏁伴噰'}}</el-button>
+        </div>
+        <div class="history-btn" v-if="isLook">
+          <el-button type="primary" icon="el-icon-arrow-left" size="small" @click="goHistory(-1)">涓婁竴鏉¤褰�</el-button>
+          <span style="font-size: 14px;margin: 0 10px;">褰撳墠绗瑊{num}}鏉�</span>
+          <el-button type="primary" size="small" @click="goHistory(1)">涓嬩竴鏉¤褰�<i class="el-icon-arrow-right el-icon--right"></i></el-button>
         </div>
       </div>
       <!-- 甯歌妫�楠屽師濮嬭褰� -->
@@ -800,8 +809,8 @@
       <!-- 鐢佃矾璇曢獙 -->
       <div v-else-if="tableLists.find(m=>m.templateId==currentTable).templateName.includes('鐢佃矾璇曢獙')" style="width: 100%;overflow-x: auto;overflow-y: visible;">
         <!-- <Circuit></Circuit> -->
-        <CircuitParameters1 v-if="currentTableState==0" :insProduct="currentSample.insProduct" :orderId="id" :sampleId="currentSample.id" :state="state" :num="currentSample.num1"></CircuitParameters1>
-        <CircuitParameters2 v-if="currentTableState==1" :insProduct="currentSample.insProduct" :orderId="id" :sampleId="currentSample.id" :state="state" :num="currentSample.num1"></CircuitParameters2>
+        <CircuitParameters1 v-if="currentTableState==0" :insProduct="currentSample.insProduct" :orderId="id" :sampleId="currentSample.id" :state="state" :num="currentSample.num1" :isLook="isLook" :currentNum="currentNum"></CircuitParameters1>
+        <CircuitParameters2 v-if="currentTableState==1" :insProduct="currentSample.insProduct" :orderId="id" :sampleId="currentSample.id" :state="state" :num="currentSample.num1" :isLook="isLook" :currentNum="currentNum"></CircuitParameters2>
       </div>
       <el-upload :action="action"
       :data="{
@@ -939,7 +948,7 @@
   import CircuitParameters1 from './circuit-parameters1.vue'
   import CircuitParameters2 from './circuit-parameters2.vue'
   export default {
-    props: ['sonLaboratory', 'orderId', 'state','inspectorList','version','orderStateId'],
+    props: ['sonLaboratory', 'orderId', 'state','inspectorList','version','orderStateId','isLook','num1'],
     components: {
       ValueTable,
       Circuit,
@@ -948,6 +957,7 @@
     },
     data() {
       return {
+        currentNum:0,
         versionLoading:false,
         versionDialogVisible:false,
         currentTableState:0,
@@ -1128,6 +1138,7 @@
         changeType:null,
         getDataTypeId:'',
         getDataType:null,
+        num:0
       }
     },
     // 鐢ㄤ簬涓婁紶鏂囦欢鐨勪俊鎭�
@@ -1144,6 +1155,8 @@
     created() {
       this.componentData.entity.sonLaboratory = this.sonLaboratory;
       this.id = this.orderId;
+      this.currentTableState = this.version
+      this.num = this.num1
       this.getUserInfo()
     },
     mounted() {
@@ -1154,7 +1167,6 @@
       this.scrollInit()
       this.getPower()
       this.startWorker()
-      this.currentTableState = this.version
     },
     watch: {
       // 鐩戝惉浠诲姟id锛岃幏鍙栦换鍔′俊鎭�
@@ -2171,7 +2183,12 @@
       // 鏍规嵁绫诲瀷銆佷换鍔d銆佸疄楠屽鏉ヨ幏鍙栨牱鍝佺殑妫�楠岄」淇℃伅
       async getCurrentProduct(id,type){
         this.tableLoading = true;
-        let res = await this.$axios.post(this.$api.insOrderPlan.getInsProduct+'?id='+id+'&type='+type+'&laboratory='+this.sonLaboratory)
+        let res = null;
+        if(!this.isLook){
+          res = await this.$axios.post(this.$api.insOrderPlan.getInsProduct+'?id='+id+'&type='+type+'&laboratory='+this.sonLaboratory)
+        }else{
+          res = await this.$axios.post(this.$api.insOrderPlan.getInsProduct2+'?id='+id+'&type='+type+'&laboratory='+this.sonLaboratory+'&num='+this.num)
+        }
         this.tableLoading = false;
         return res.data
       },
@@ -2215,7 +2232,7 @@
         }
         // 澶勭悊椤甸潰鍒楄〃鏁版嵁
         this.getTableLists();
-        this.currentKey = row.index
+        this.currentKey = row.index?row.index:0
         this.currentTab = null;
         // 鍚戝绾跨▼鍘讳繚瀛橀〉闈㈠垪琛ㄦ暟鎹�,鍚庣浼犲弬,褰撳墠妯℃澘淇℃伅
         this.worker.postMessage(JSON.stringify({
@@ -3632,6 +3649,20 @@
           }
           this.versionDialogVisible = false
         })
+      },
+      async goHistory(num){
+        if(this.num==1&&num==-1){
+          this.$message.error('褰撳墠鏄涓�鏉¤褰�')
+          return
+        }else if(this.num1==this.num&&num==1){
+          this.$message.error('褰撳墠鏄渶鍚庝竴鏉¤褰�')
+          return
+        }
+        this.num = this.num + num
+        this.tableLoading = true
+        await this.handleChangeSample(this.currentSample)
+        this.currentNum++
+        this.tableLoading = false
       }
     }
   }

--
Gitblit v1.9.3