From 53bc8cc8fd330d5e2a4a3698967548a0b74a395a Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期五, 23 十月 2026 18:09:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue |  283 +++++++++++++++++++++-----------------------------------
 1 files changed, 108 insertions(+), 175 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue b/src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue
index 028e5e2..26aceb1 100644
--- a/src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue
+++ b/src/views/CNAS/resourceDemand/device/component/equipmentVerificationPlan.vue
@@ -10,11 +10,8 @@
           </el-select>
         </div>
         <div>
+          <el-button size="small" type="primary" @click="handleAddRecord">鏂板鏍告煡璁板綍</el-button>
           <el-button size="small" type="primary" @click="loadPlan">鍒锋柊</el-button>
-          <el-button size="small" type="primary" :disabled="planInfo.ratifyStatus === 1"
-            @click="tellApprove">鎵瑰噯閫氱煡</el-button>
-          <el-button size="small" type="primary"
-            :disabled="planInfo.ratifyStatus === 1 || userId != planInfo.ratifyUserId" @click="handleApprove">鎵瑰噯</el-button>
           <el-button size="small" type="primary" @click="downLoadPost">瀵煎嚭</el-button>
         </div>
       </div>
@@ -77,17 +74,31 @@
           </template>
         </el-table-column>
         <el-table-column label="澶囨敞" min-width="130" prop="remark"></el-table-column>
-        <!-- 鎿嶄綔鎸夐挳 -->
-        <el-table-column align="center" fixed="right" label="鎿嶄綔" min-width="260">
+        <el-table-column label="闄勪欢" min-width="140">
           <template #default="scope">
-            <el-button size="small" link type="primary" :disabled="planInfo.ratifyStatus === 1"
+            <el-link v-if="scope.row.fileUrl" type="primary" @click="openAttachment(scope.row)">
+              {{ scope.row.fileName || '鏌ョ湅闄勪欢' }}
+            </el-link>
+            <span v-else>鈥�</span>
+          </template>
+        </el-table-column>
+        <!-- 鎿嶄綔鎸夐挳 -->
+        <el-table-column align="center" fixed="right" label="鎿嶄綔" min-width="320">
+          <template #default="scope">
+            <el-button size="small" link type="primary"
               @click="handleForm('edit', scope.row)">缂栬緫</el-button>
             <el-button size="small" link type="primary" @click="handleForm('view', scope.row)">鏌ョ湅</el-button>
-            <el-button size="small" link type="primary" @click="handleRecord(scope.row)">璁板綍</el-button>
-            <el-button size="small" link type="primary" @click="handleCheck(scope.row)">瀵规瘮</el-button>
+            <el-button v-if="scope.row.recordStatus === 1" size="small" link type="primary"
+              @click="handleRecord(scope.row)">瀹℃牳</el-button>
+            <el-upload class="row-upload" :action="javaApi + '/deviceScope/uploadFile'"
+              :headers="uploadHeader" :show-file-list="false" :before-upload="beforeAttachmentUpload"
+              :on-success="(res) => handleAttachmentSuccess(res, scope.row)"
+              :on-error="handleAttachmentError">
+              <el-button size="small" link type="primary">涓婁紶闄勪欢</el-button>
+            </el-upload>
             <el-button size="small" link type="primary" @click="handleDown(scope.row)">瀵煎嚭</el-button>
-            <el-button size="small" link type="danger" :disabled="planInfo.ratifyStatus === 1"
-              @click="deleteFun1(scope.row.planDetailsId)">鍒犻櫎</el-button>
+            <el-button v-if="scope.row.recordStatus === 0 && scope.row.recordContrastStatus === 0"
+              size="small" link type="danger" @click="deleteFun1(scope.row.planDetailsId)">鍒犻櫎</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -98,71 +109,48 @@
       </el-pagination>
     </div>
     <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-model="dialogVisible" title="璁惧鏍告煡璁″垝"
-      width="80%" @close="resetForm">
+      width="50%" @close="resetForm">
       <el-form ref="modelForm" :model="form" :rules="rules" label-width="110px">
-        <el-col :span="12">
-          <el-form-item label="璁惧缂栧彿锛�" prop="deviceNumber">
-            <el-input v-model="form.deviceNumber" :disabled="operationType === 'view'" clearable
-              size="small"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="璁惧鍚嶇О锛�" prop="deviceName">
-            <el-input v-model="form.deviceName" :disabled="operationType === 'view'" clearable size="small"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="鏍告煡鏃堕棿锛�" prop="checkTime">
-            <el-date-picker v-model="form.checkTime" :disabled="operationType === 'view'" clearable format="YYYY-MM"
-              placeholder="閫夋嫨鏃ユ湡" size="small" style="width:100%" type="month" value-format="YYYY-MM">
-            </el-date-picker>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="鏍告煡鎸囨爣锛�" prop="checkIndex">
-            <el-input v-model="form.checkIndex" :disabled="operationType === 'view'" clearable size="small"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="鏍告煡鏂规硶锛�" prop="checkMethod">
-            <el-input v-model="form.checkMethod" :disabled="operationType === 'view'" clearable size="small"
-              type="textarea"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="缁撴灉濡備綍鍒ゅ畾锛�" prop="howResults">
-            <el-input v-model="form.howResults" :disabled="operationType === 'view'" clearable size="small"
-              type="textarea"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="鏍告煡璐d换浜猴細" prop="checkChargerUserId">
-            <el-select v-model="form.checkChargerUserId" @change="setCheckChargerUser"
-              :disabled="operationType === 'view'" placeholder="璇烽�夋嫨" size="small" style="width: 100%">
-              <el-option v-for="item in chargerOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
-            </el-select>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item label="澶囨敞锛�" prop="remark">
-            <el-input v-model="form.remark" :disabled="operationType === 'view'" clearable size="small"></el-input>
-          </el-form-item>
-        </el-col>
+        <el-form-item label="璁惧缂栧彿锛�" prop="deviceNumber">
+          <el-input v-model="form.deviceNumber" :disabled="operationType === 'view'" clearable
+            size="small"></el-input>
+        </el-form-item>
+        <el-form-item label="璁惧鍚嶇О锛�" prop="deviceName">
+          <el-input v-model="form.deviceName" :disabled="operationType === 'view'" clearable
+            size="small"></el-input>
+        </el-form-item>
+        <el-form-item label="鏍告煡鏃堕棿锛�" prop="checkTime">
+          <el-date-picker v-model="form.checkTime" :disabled="operationType === 'view'" clearable format="YYYY-MM"
+            placeholder="閫夋嫨鏃ユ湡" size="small" style="width:100%" type="month" value-format="YYYY-MM">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="鏍告煡鎸囨爣锛�" prop="checkIndex">
+          <el-input v-model="form.checkIndex" :disabled="operationType === 'view'" clearable
+            size="small"></el-input>
+        </el-form-item>
+        <el-form-item label="鏍告煡鏂规硶锛�" prop="checkMethod">
+          <el-input v-model="form.checkMethod" :disabled="operationType === 'view'" clearable size="small"
+            type="textarea"></el-input>
+        </el-form-item>
+        <el-form-item label="缁撴灉濡備綍鍒ゅ畾锛�" prop="howResults">
+          <el-input v-model="form.howResults" :disabled="operationType === 'view'" clearable size="small"
+            type="textarea"></el-input>
+        </el-form-item>
+        <el-form-item label="鏍告煡璐d换浜猴細" prop="checkChargerUserId">
+          <el-select v-model="form.checkChargerUserId" @change="setCheckChargerUser"
+            :disabled="operationType === 'view'" placeholder="璇烽�夋嫨" size="small" style="width: 100%">
+            <el-option v-for="item in chargerOptions" :key="item.id" :label="item.name"
+              :value="item.id"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="澶囨敞锛�" prop="remark">
+          <el-input v-model="form.remark" :disabled="operationType === 'view'" clearable size="small"></el-input>
+        </el-form-item>
       </el-form>
       <template #footer><span class="dialog-footer">
         <el-button @click="resetForm">鍙� 娑�</el-button>
         <el-button :loading="submitFormLoading" type="primary" @click="submitForm"
           v-if="operationType !== 'view'">纭� 璁�</el-button>
-      </span></template>
-    </el-dialog>
-    <el-dialog v-model="approvalDialog" title="鎵瑰噯" width="30%" @close="approvalDialog = false">
-      <span>
-        鎵瑰噯澶囨敞锛�
-        <el-input v-model="ratifyRemark" type="textarea"></el-input>
-      </span>
-      <template #footer><span class="dialog-footer">
-        <el-button :loading="approvalLoading" @click="handleApproval(0)">涓嶆壒鍑�</el-button>
-        <el-button :loading="approvalLoading" type="primary" @click="handleApproval(1)">鎵� 鍑�</el-button>
       </span></template>
     </el-dialog>
     <el-dialog v-model="downloadDialog" title="瀵煎嚭" width="600px">
@@ -176,47 +164,29 @@
         <el-button @click="downloadDialog = false">鍙� 娑�</el-button>
       </span></template>
     </el-dialog>
-    <el-dialog v-model="notificationDia" title="鎻愪氦鎵瑰噯" width="30%" @close="closeNotificationDia">
-      <span style="margin-top: 10px;display: inline-block">
-        璇烽�夋嫨鎵瑰噯浜猴細
-        <el-select v-model="ratifyUserId" clearable filterable size="small" style="width: 90%;">
-          <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id">
-          </el-option>
-        </el-select>
-      </span>
-      <template #footer><span class="dialog-footer">
-        <el-button :loading="notificationLoading" @click="closeNotificationDia">鍙� 娑�</el-button>
-        <el-button :loading="notificationLoading" type="primary" @click="notification">鎻� 浜�</el-button>
-      </span></template>
-    </el-dialog>
-    <equipment-check v-if="equipmentCheck" ref="equipmentCheck" @closeDialog="closeDialog"></equipment-check>
     <check-record v-if="checkRecord" ref="checkRecord" @closeDialog1="closeDialog1"></check-record>
   </div>
 </template>
 
 <script>
-import EquipmentCheck from "./equipmentCheck.vue";
 import CheckRecord from "./checkRecord.vue";
 import {
   pageDeviceExaminePlan,
   getExaminePlanByYear,
-  submitRatifyDeviceExaminePlan,
   exportDeviceExaminePlanDetail,
   delDeviceExaminePlanDetail,
   pageDeviceExaminePlanDetail,
   updateDeviceExaminePlanDetail,
-  ratifyDeviceExaminePlan,
   exportReviewExamineRecordDetail,
   exportReviewExamineRecordContrast,
 } from '@/api/cnas/resourceDemand/device.js'
 import { selectUserCondition } from "@/api/performance/class";
-import { mapGetters } from "@/utils/store-compat";
 import draftSave from '@/mixins/draftSave'
 import { formatListDate } from './dateFormat'
 export default {
   name: "equipment-verification-plan",
   // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
-  components: { CheckRecord, EquipmentCheck },
+  components: { CheckRecord },
   mixins: [draftSave],
   props: {
     clickNodeVal: {
@@ -262,21 +232,12 @@
         checkMethod: [{ required: true, message: '璇峰~鍐欐牳鏌ユ柟娉�', trigger: 'blur' }],
       },
       yearTableDetailDataLoading: false,
-      approvalDialog: false,
-      approvalLoading: false,
       submitFormLoading: false,
-      ratifyRemark: '',
-      currentRowId: '',
       userList: [],
-      equipmentCheck: false,
       checkRecord: false,
       downloadDialog: false,
       outLoading: false,
       downRow: {},
-      responsibleOptions: [],
-      notificationDia: false,
-      notificationLoading: false,
-      ratifyUserId: '',
     }
   },
   mounted() {
@@ -435,60 +396,6 @@
         });
       });
     },
-    // 鎵撳紑鎻愪氦鎵瑰噯寮规
-    tellApprove() {
-      this.getUserList1()
-      this.notificationDia = true
-    },
-    // 鍏抽棴鎻愪氦鎵瑰噯寮规
-    closeNotificationDia() {
-      this.notificationDia = false
-      this.ratifyUserId = ''
-    },
-    // 鎻愪氦鎵瑰噯閫氱煡
-    notification() {
-      if (!this.ratifyUserId) {
-        this.$message.warning('璇烽�夋嫨鎵瑰噯浜�')
-        return
-      }
-      this.notificationLoading = true
-      submitRatifyDeviceExaminePlan({
-        ratifyUserId: this.ratifyUserId,
-        planId: this.planInfo.planId,
-      }).then(res => {
-        this.notificationLoading = false
-        if (res.code == 200) {
-          this.closeNotificationDia()
-          this.loadPlan()
-        }
-      }).catch(err => {
-        this.notificationLoading = false
-      })
-    },
-    // 鎵瑰噯
-    handleApprove() {
-      this.currentRowId = this.planInfo.planId
-      this.approvalDialog = true
-    },
-    // 鎻愪氦鎵瑰噯缁撴灉
-    handleApproval(status) {
-      const personTrainingUpdateDto = {
-        planId: this.currentRowId,
-        ratifyRemark: this.ratifyRemark,
-        ratifyStatus: status
-      }
-      this.approvalLoading = true
-      ratifyDeviceExaminePlan(personTrainingUpdateDto).then(res => {
-        if (res.code === 200) {
-          this.$message.success('鎻愪氦鎴愬姛锛�');
-          this.approvalDialog = false
-          this.loadPlan()
-        }
-        this.approvalLoading = false
-      }).catch(() => {
-        this.approvalLoading = false
-      })
-    },
     // 瀵煎嚭骞村害璁″垝琛�
     downLoadPost() {
       exportDeviceExaminePlanDetail({ planId: this.planInfo.planId }).then(res => {
@@ -500,24 +407,53 @@
       this.$refs.modelForm.resetFields();
       this.dialogVisible = false
     },
-    // 鎵撳紑瀵规瘮娴佺▼寮规
-    handleCheck(row) {
-      this.equipmentCheck = true
-      this.$nextTick(() => {
-        this.$refs.equipmentCheck.openDialog(row)
-      })
-    },
-    // 鍏抽棴瀵规瘮寮规
-    closeDialog() {
-      this.equipmentCheck = false
-      this.getYearTableDetailData()
-    },
-    // 鎵撳紑璁板綍寮规
+    // 鎵撳紑鏍告煡璁板綍锛堝緟鎵瑰噯鏃剁敤浜庡鏍革級
     handleRecord(row) {
       this.checkRecord = true
       this.$nextTick(() => {
         this.$refs.checkRecord.openDialog(row)
       })
+    },
+    // 鏂板鏍告煡璁板綍锛堝彲鑷�夎澶囷級
+    handleAddRecord() {
+      this.checkRecord = true
+      this.$nextTick(() => {
+        this.$refs.checkRecord.openAddDialog()
+      })
+    },
+    // 鎵撳紑闄勪欢
+    openAttachment(row) {
+      const isImage = /\.(jpg|jpeg|png|gif)$/i.test(row.fileUrl)
+      window.open(this.javaApi + (isImage ? '/img/' : '/word/') + row.fileUrl, '_blank')
+    },
+    beforeAttachmentUpload(file) {
+      if (file.size > 1024 * 1024 * 10) {
+        this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M')
+        return false
+      }
+      return true
+    },
+    // 闄勪欢涓婁紶鎴愬姛鍚庝繚瀛樺埌璁″垝鏄庣粏
+    handleAttachmentSuccess(response, row) {
+      if (response.code == 200) {
+        updateDeviceExaminePlanDetail({
+          planDetailsId: row.planDetailsId,
+          fileName: response.data.name,
+          fileUrl: response.data.url
+        }).then(res => {
+          if (res.code == 200) {
+            this.$message.success('闄勪欢涓婁紶鎴愬姛')
+            this.getYearTableDetailData()
+          } else {
+            this.$message.error(res.msg || '闄勪欢淇濆瓨澶辫触')
+          }
+        })
+      } else {
+        this.$message.error(response.msg || '闄勪欢涓婁紶澶辫触')
+      }
+    },
+    handleAttachmentError() {
+      this.$message.error('闄勪欢涓婁紶澶辫触')
     },
     // 鍏抽棴璁板綍寮规
     closeDialog1() {
@@ -568,7 +504,7 @@
       })
     },
     getUserList() {
-      selectUserCondition().then(res => {
+      selectUserCondition({ type: 4 }).then(res => {
         this.userList = res.data
       })
     },
@@ -577,18 +513,9 @@
       if (index > -1) {
         this.form.checkChargerUser = this.userList[index].name
       }
-    },
-    // 鑾峰彇璐熻矗浜轰俊鎭帴鍙�
-    getUserList1() {
-      selectUserCondition().then(res => {
-        if (res.code == 200) {
-          this.responsibleOptions = res.data
-        }
-      });
     }
   },
   computed: {
-    ...mapGetters(["userId"]),
     // 鏄惁宸插畬鎴愬鎵癸紙鎵瑰噯/涓嶆壒鍑嗭級
     isRatified() {
       return this.planInfo.ratifyStatus === 0 || this.planInfo.ratifyStatus === 1;
@@ -661,4 +588,10 @@
 :deep(.red-row td) {
   background: #ffcccc !important;
 }
+
+.row-upload {
+  display: inline-block;
+  margin-left: 10px;
+  vertical-align: middle;
+}
 </style>

--
Gitblit v1.9.3