From 06b2be3bbb48e0275fbd25624c1cce54a7cac2b1 Mon Sep 17 00:00:00 2001
From: 董国庆 <364620639@qq.com>
Date: 星期二, 20 五月 2025 16:44:34 +0800
Subject: [PATCH] Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/leshan-laboratory

---
 culture/src/views/strain-library/strain-library-manage/components/RecordDetailDialog.vue |   82 ++++++++++++++++++++---------------------
 1 files changed, 40 insertions(+), 42 deletions(-)

diff --git a/culture/src/views/strain-library/strain-library-manage/components/RecordDetailDialog.vue b/culture/src/views/strain-library/strain-library-manage/components/RecordDetailDialog.vue
index dbff104..ffe34f8 100644
--- a/culture/src/views/strain-library/strain-library-manage/components/RecordDetailDialog.vue
+++ b/culture/src/views/strain-library/strain-library-manage/components/RecordDetailDialog.vue
@@ -1,28 +1,20 @@
 <template>
-    <el-dialog
-        title="出/入库详情"
-        :visible.sync="visible"
-        width="520px"
-        :close-on-click-modal="false"
-        custom-class="record-detail-dialog"
-        @close="handleClose"
-    >
+    <el-dialog :title="type == 'detail' ? '出/入库详情' : '确认出入库'" :visible.sync="visible" width="550px"
+        :close-on-click-modal="false" custom-class="record-detail-dialog" @close="handleClose" @opened="opened">
         <div class="dialog-content">
             <el-form :model="formData" label-position="top">
                 <el-form-item label="出库/入库" required>
                     <div class="type-buttons">
-                        <el-button 
-                            type="primary" 
-                            @click="handleOutbound"
-                        >出库</el-button>
+                        <el-button v-if="formData.type == '1'" type="primary">出库</el-button>
+                        <el-button v-if="formData.type == '2'" type="primary">入库</el-button>
                     </div>
                 </el-form-item>
 
                 <div class="signature-row">
                     <el-form-item label="操作人签字" required class="signature-item">
-                        <div class="signature-area" :class="{ 'waiting': !formData.operatorSignature }">
-                            <template v-if="formData.operatorSignature">
-                                <img :src="formData.operatorSignature" alt="操作人签字" />
+                        <div class="signature-area" :class="{ 'waiting': !formData.handleSignature }">
+                            <template v-if="formData.handleSignature">
+                                <img :src="formData.handleSignature" alt="操作人签字" />
                             </template>
                             <template v-else>
                                 <span class="waiting-text">等待确认</span>
@@ -30,13 +22,8 @@
                         </div>
                     </el-form-item>
 
-                    <el-form-item 
-                        v-if="formData.operatorSignature"
-                        label="出库时间" 
-                        required 
-                        class="time-item"
-                    >
-                        <div class="time-value">{{ formData.operateTime }}</div>
+                    <el-form-item v-if="formData.handleSignature" label="出库时间" required class="time-item">
+                        <div class="time-value">{{ formData.boundTime }}</div>
                     </el-form-item>
                 </div>
 
@@ -44,11 +31,12 @@
                     <el-form-item required class="signature-item">
                         <template #label>
                             <span>保藏人签字</span>
-                            <el-button type="primary" class="edit-sign-btn" @click="showSignature = true">修改签名</el-button>
+                            <el-button v-if="type != 'detail'" type="primary" class="edit-sign-btn"
+                                @click="showSignature = true">修改签名</el-button>
                         </template>
-                        <div class="signature-area" :class="{ 'waiting': !formData.reviewerSignature }">
-                            <template v-if="formData.reviewerSignature">
-                                <img :src="formData.reviewerSignature" alt="保藏人签字" />
+                        <div class="signature-area" :class="{ 'waiting': !formData.preserveSignature }">
+                            <template v-if="formData.preserveSignature">
+                                <img :src="formData.preserveSignature" alt="保藏人签字" />
                             </template>
                             <template v-else>
                                 <span class="waiting-text">等待确认</span>
@@ -56,18 +44,18 @@
                         </div>
                     </el-form-item>
 
-                    <el-form-item 
-                        v-if="formData.reviewerSignature"
-                        label="确认时间" 
-                        required 
-                        class="time-item"
-                    >
+                    <el-form-item v-if="formData.preserveSignature && type == 'detail'" label="确认时间" required
+                        class="time-item">
                         <div class="time-value">{{ formData.confirmTime }}</div>
                     </el-form-item>
                 </div>
             </el-form>
+            <div class="confirm-btn" v-if="type != 'detail'" style="text-align: center;margin-top: 20px;">
+                <el-button type="primary" style="width: 80px;" @click="handleOutbound">确认</el-button>
+            </div>
         </div>
-        <signature-canvas :visible.sync="showSignature" @confirm="handleSignatureConfirm" @cancel="showSignature = false" />
+        <signature-canvas :visible.sync="showSignature" @confirm="handleSignatureConfirm"
+            @cancel="showSignature = false" />
     </el-dialog>
 </template>
 
@@ -84,11 +72,17 @@
         recordData: {
             type: Object,
             default: () => ({})
+        },
+        type: {
+            type: String,
+            default: 'detail'
         }
     },
     data() {
         return {
-            formData: {},
+            formData: {
+                type: '1',
+            },
             showSignature: false
         }
     },
@@ -101,12 +95,14 @@
         }
     },
     methods: {
+        opened() {
+            this.formData.type = this.recordData.type
+        },
         handleClose() {
-            this.$emit('update:visible', false)
             this.$emit('close')
         },
         handleOutbound() {
-            if (!this.formData.operatorSignature || !this.formData.reviewerSignature) {
+            if (!this.formData.preserveSignature) {
                 this.$message.warning('请等待所有签字确认后再进行出库操作')
                 return
             }
@@ -114,7 +110,7 @@
             this.handleClose()
         },
         handleSignatureConfirm(dataUrl) {
-            this.formData.reviewerSignature = dataUrl
+            this.formData.preserveSignature = dataUrl
             this.showSignature = false
             // 可选:this.formData.confirmTime = new Date().toLocaleString()
         }
@@ -128,7 +124,7 @@
         padding: 20px 24px;
         margin: 0;
         border-bottom: 1px solid #DCDFE6;
-        
+
         .el-dialog__title {
             font-size: 16px;
             font-weight: 600;
@@ -156,11 +152,13 @@
     }
 
     .type-buttons {
+        display: flex;
+
+        gap: 12px;
+
         .el-button {
             width: 80px;
-            background: #409EFF;
-            border-color: #409EFF;
-            color: #FFFFFF;
+
 
             &:hover {
                 opacity: 0.8;
@@ -232,4 +230,4 @@
 .edit-sign-btn {
     margin-left: 12px;
 }
-</style> 
\ No newline at end of file
+</style>
\ No newline at end of file

--
Gitblit v1.7.1