From e3686634452289d43e750a44f30f72b0e7754866 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期六, 07 十一月 2026 00:26:56 +0800
Subject: [PATCH] 修复人员管理模块各标签页问题并完善设备、文件受控页面

---
 src/views/CNAS/resourceDemand/device/component/equipmentMaintenancePlan.vue |   39 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/device/component/equipmentMaintenancePlan.vue b/src/views/CNAS/resourceDemand/device/component/equipmentMaintenancePlan.vue
index 2eea398..7e94000 100644
--- a/src/views/CNAS/resourceDemand/device/component/equipmentMaintenancePlan.vue
+++ b/src/views/CNAS/resourceDemand/device/component/equipmentMaintenancePlan.vue
@@ -74,6 +74,17 @@
         <el-table-column label="澶囨敞" min-width="140" show-overflow-tooltip>
           <template #default="scope">{{ scope.row.recordRemark || '鈥�' }}</template>
         </el-table-column>
+        <el-table-column label="闄勪欢" min-width="130">
+          <template #default="scope">
+            <el-link v-if="scope.row.attachmentCount > 0" type="primary" @click="handleAttachment(scope.row)">
+              鏌ョ湅闄勪欢锛坽{ scope.row.attachmentCount }}锛�
+            </el-link>
+            <el-link v-else-if="canUploadAttachment(scope.row)" type="primary" @click="handleAttachment(scope.row)">
+              涓婁紶闄勪欢
+            </el-link>
+            <span v-else>鈥�</span>
+          </template>
+        </el-table-column>
         <el-table-column align="center" fixed="right" label="鎿嶄綔" min-width="300">
           <template #default="scope">
             <el-button size="small" link type="primary"
@@ -95,6 +106,10 @@
         @current-change="handleCurrentChange1">
       </el-pagination>
     </div>
+    <lims-attachment ref="rowAttachment" upload-url="/deviceMaintenancePlan/uploadAttachment"
+      select-url="/deviceMaintenancePlan/selectAttachments" delete-url="/deviceMaintenancePlan/deleteAttachment"
+      id-param="maintenancePlanDetailId" name-field="deviceName" title="淇濆吇璁板綍闄勪欢"
+      :readonly="attachmentReadonly" @closed="getTableList"></lims-attachment>
     <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="dialogVisible"
       :title="dialogTitle" width="880px" @close="resetForm">
       <el-form ref="modelForm" :model="form" :rules="rules" label-width="150px" size="small">
@@ -155,6 +170,13 @@
           <el-input v-model="form.reviewRemark" :rows="2" placeholder="鍙~鍐欏鏍告剰瑙�"
             type="textarea"></el-input>
         </el-form-item>
+        <div class="form-section-title">闄勪欢璧勬枡</div>
+        <el-form-item label-width="0">
+          <lims-attachment inline upload-url="/deviceMaintenancePlan/uploadAttachment"
+            select-url="/deviceMaintenancePlan/selectAttachments" delete-url="/deviceMaintenancePlan/deleteAttachment"
+            id-param="maintenancePlanDetailId" name-field="deviceName" title="淇濆吇璁板綍闄勪欢"
+            :main-id="form.maintenancePlanDetailId" :readonly="!isEdit"></lims-attachment>
+        </el-form-item>
         <div class="check-note">澶囨敞锛氭甯搞�佽壇濂芥墦鈥溾垰鈥濓紝涓嶆甯稿強鍚︽墦鈥溍椻�濄��</div>
         <div v-if="cycleNote" class="check-note">{{ cycleNote }}</div>
       </el-form>
@@ -182,6 +204,7 @@
   reviewDeviceMaintenance,
 } from '@/api/cnas/resourceDemand/device.js'
 import { selectUserCondition } from '@/api/system/user'
+import LimsAttachment from '@/components/Attachment/lims-attachment.vue'
 import dayjs from 'dayjs'
 import { formatDateOnly } from './dateFormat'
 import { saveBlobOrShowError } from '@/utils/saveBlob'
@@ -201,6 +224,7 @@
 
 export default {
   name: "equipment-maintenance-plan",
+  components: { LimsAttachment },
   props: {
     clickNodeVal: {
       type: Object,
@@ -238,6 +262,7 @@
       outLoading: false,
       reviewLoading: false,
       userOptions: [],
+      attachmentReadonly: false,
     }
   },
   mounted() {
@@ -426,10 +451,11 @@
         });
       });
     },
-    // 瀵煎嚭
+    // 瀵煎嚭鏁翠唤淇濆吇璁″垝
     handleDownOne() {
       this.outLoading = true
-      exportDeviceMaintenancePlan({ maintenancePlanId: this.planInfo.maintenancePlanId }).then(res => {
+      const params = { maintenancePlanId: this.planInfo.maintenancePlanId }
+      exportDeviceMaintenancePlan(params).then(res => {
         this.outLoading = false
         saveBlobOrShowError(res, '璁惧淇濆吇璁″垝琛�.docx', 'application/msword')
       }).catch(() => {
@@ -440,6 +466,15 @@
     handleReview(row) {
       this.handleForm('review', row)
     },
+    // 宸插鏍搁�氳繃/涓嶉�氳繃鐨勮鍙锛屽叾浣欏彲涓婁紶闄勪欢
+    canUploadAttachment(row) {
+      return !row || (row.recordStatus !== 2 && row.recordStatus !== 3)
+    },
+    // 鎵撳紑琛岄檮浠跺脊绐楋細鍙紪杈戠殑琛屽厑璁哥洿鎺ヤ笂浼�/鍒犻櫎锛屽凡瀹℃牳鐨勮鍙
+    handleAttachment(row) {
+      this.attachmentReadonly = !this.canUploadAttachment(row)
+      this.$refs.rowAttachment.open(row)
+    },
     // 鎻愪氦瀹℃牳缁撴灉锛�1 閫氳繃锛�0 涓嶉�氳繃
     submitReview(status) {
       this.reviewLoading = true

--
Gitblit v1.9.3