From 5c8aaba66c16b1a143fdec27e29ad36eaefd1e3a Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 31 十二月 2024 14:33:25 +0800
Subject: [PATCH] 无源器件检验开发

---
 src/components/view/a7-sample-registration.vue |   39 +++++++++++++++++++++++++++++----------
 1 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/src/components/view/a7-sample-registration.vue b/src/components/view/a7-sample-registration.vue
index 3c308b3..0c59dc9 100644
--- a/src/components/view/a7-sample-registration.vue
+++ b/src/components/view/a7-sample-registration.vue
@@ -3,10 +3,10 @@
     <el-row class="title">
       <el-col :span="20" style="padding-left: 20px;text-align: left;">鏍峰搧鎺ユ敹</el-col>
     </el-row>
-    <el-tabs type="border-card" v-model="activeName" style="height: 100%;" @tab-click="componentData0.entity.totalSampleId=''">
+    <el-tabs type="border-card" v-model="activeName" style="height: 100%;" @tab-click="tabClick">
       <el-tab-pane label="濉啓" name="濉啓" style="height: 100%;" :key="1">
-        <el-button size="small" type="primary" @click="handleAdd0" style="margin-left: 20px;" v-if="addPower">鏂板</el-button>
-        <div class="table" style="height: calc(100% - 200px)" F>
+        <el-button size="small" type="primary" @click="handleAdd0" style="margin-left: 20px;" v-if="addPower&&currentInfo.submitState!='宸叉彁浜�'">鏂板</el-button>
+        <div class="table" style="height: calc(100% - 200px)" v-if="activeName=='濉啓'">
           <ValueTable ref="ValueTable0" :url="$api.processSample.pageProcessSample"
       :componentData="componentData0" :key="upIndex0" :delUrl="$api.processSample.delProcessSample" />
         </div>
@@ -29,8 +29,8 @@
             <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
           </div>
         </div>
-        <div class="table">
-          <ValueTable ref="ValueTable" v-if="activeName=='鍘嗗彶璁板綍'" :url="$api.processSample.pageProcessTotalSample"
+        <div class="table" v-if="activeName=='鍘嗗彶璁板綍'">
+          <ValueTable ref="ValueTable" :url="$api.processSample.pageProcessTotalSample"
             :componentData="componentData" :key="upIndex"/>
         </div>
       </el-tab-pane>
@@ -232,7 +232,7 @@
   name: "SampleDisposal",
   data() {
     return {
-      activeName:'濉啓',
+      activeName:'鍘嗗彶璁板綍',
       title:'鏂板',
       addDialogVisible:false,
       addLoading:false,
@@ -291,7 +291,7 @@
             type: 'text',
             method: 'handleCheck',
             disabFun: (row, index) => {
-						return row.examineState=='閫氳繃'||row.submitState=='寰呮彁浜�'
+						return row.examineState=='閫氳繃'||row.submitState=='寰呮彁浜�'||!row.submitState
             }
           }, {
             id: 'handleApproval',
@@ -299,7 +299,7 @@
             type: 'text',
             method: 'handleApproval',
             disabFun: (row, index) => {
-						return row.ratifyState=='閫氳繃'||row.submitState=='寰呮彁浜�'
+						return row.ratifyState=='閫氳繃'||row.submitState=='寰呮彁浜�'||!row.submitState
             }
           }],
           tagField: {},
@@ -325,12 +325,12 @@
             id: 'handleAdd0',
             font: '淇敼',
             type: 'text',
-            method: 'handleAdd0'
+            method: 'handleAdd0',
           },{
             id: 'delete',
             font: '鍒犻櫎',
             type: 'text',
-            method: 'doDiy'
+            method: 'doDiy',
           }],
           tagField: {},
           selectField: {},
@@ -350,6 +350,17 @@
       outPower:true,
       addPower:true,
     };
+  },
+  watch: {
+    'activeName' (val1, val2) {
+      if(val1=='濉啓'){
+        this.componentData0.do.forEach((item)=>{
+          item.disabFun = (row, index) => {
+            return !this.addPower||this.currentInfo.submitState=='宸叉彁浜�'
+          }
+        })
+      }
+    }
   },
   mounted() {
     this.entityCopy = this.HaveJson(this.componentData.entity);
@@ -503,6 +514,7 @@
       // console.log(row)
       // this.title0 = '鏌ョ湅'
       // this.commonFun(row)
+      this.currentInfo = row
       this.activeName = '濉啓'
       this.componentData0.entity.totalSampleId = row.id
       this.$nextTick(()=>{
@@ -600,6 +612,13 @@
       link.href = url;
       link.download = row.month+' 鏍峰搧鎺ユ敹琛�';
       link.click();
+    },
+    tabClick(e){
+      console.log(e)
+      if(e.index==0){
+        this.currentInfo = this.$refs['ValueTable'].tableData[0]
+        this.componentData0.entity.totalSampleId=''
+      }
     }
   },
 }

--
Gitblit v1.9.3