From 137bf2c0666b60cfc0d98b1a9ca7ead860ee4e7c Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期三, 28 十月 2026 17:57:29 +0800
Subject: [PATCH] feat(device,supply,satisfaction): 设备计划改造、耗材采购调整与满意度照片上传

---
 src/views/CNAS/resourceDemand/device/component/checkRecord.vue |  101 ++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 97 insertions(+), 4 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/device/component/checkRecord.vue b/src/views/CNAS/resourceDemand/device/component/checkRecord.vue
index 214d943..0c50e49 100644
--- a/src/views/CNAS/resourceDemand/device/component/checkRecord.vue
+++ b/src/views/CNAS/resourceDemand/device/component/checkRecord.vue
@@ -11,7 +11,7 @@
           <div class="form-section-title">鍩烘湰淇℃伅</div>
           <el-row :gutter="12">
             <el-col :span="12">
-              <el-form-item label="浠櫒鍚嶇О锛�" prop="deviceName">
+              <el-form-item label="璁惧鍚嶇О锛�" prop="deviceName">
                 <el-select v-if="currentStep === 0" v-model="selectedDeviceId" clearable filterable
                   placeholder="璇烽�夋嫨璁惧" size="small" style="width: 100%" @change="changeMachineName">
                   <el-option v-for="item in equipOptions" :key="item.id" :label="item.label + '-' + item.value"
@@ -141,6 +141,7 @@
   findExaminePlanDetail,
   resolveExaminePlanDetail,
   updateDeviceExaminePlanDetail,
+  getDeviceById,
 } from '@/api/cnas/resourceDemand/device.js'
 import { selectUserCondition } from "@/api/performance/class";
 import LimsAttachment from '@/components/Attachment/lims-attachment.vue'
@@ -178,6 +179,7 @@
       selectedDeviceId: '',
       submitFormLoading: false,
       userList: [],
+      planDueDate: '',
       rules: {
         checkMethod: [{ required: true, message: '璇峰~鍐欐牳鏌ユ柟寮�', trigger: 'blur' }],
       },
@@ -209,6 +211,15 @@
         fileName: row.fileName || '',
         fileUrl: row.fileUrl || '',
         planDetailsId: row.planDetailsId,
+      }
+      this.planDueDate = ''
+      if (row.deviceId && /^\d{4}-\d{2}$/.test(this.form.checkTime)) {
+        getDeviceById({ deviceId: row.deviceId }).then(res => {
+          const due = res.data && res.data.nextExamineDate
+          if (due && String(due).slice(0, 7) === this.form.checkTime) {
+            this.planDueDate = String(due).slice(0, 10)
+          }
+        }).catch(() => {})
       }
     },
     // 鏂板鏍告煡璁板綍锛氳嚜閫夎澶囷紝鎻愪氦鏃惰嚜鍔ㄥ尮閰�/鍒涘缓鏈疆璁″垝鏄庣粏
@@ -328,6 +339,41 @@
     },
     // 鎻愪氦瀹℃牳
     examine(statue) {
+      const checkTime = this.form.checkTime || ''
+      const now = new Date()
+      const nowMonth = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}`
+      const checkMonth = checkTime.slice(0, 7)
+      const isEarlyReview = statue === 1 && /^\d{4}-\d{2}/.test(checkTime) && checkMonth > nowMonth
+      if (!isEarlyReview) {
+        this.submitReview(statue)
+        return
+      }
+      const isMonthOnly = /^\d{4}-\d{2}$/.test(checkTime)
+      const todayStr = `${nowMonth}-${String(now.getDate()).padStart(2, '0')}`
+      const plannedText = isMonthOnly
+        ? (this.planDueDate ? `${this.planDueDate}锛堣鍒掓湀浠� ${checkTime}锛塦 : `${checkTime}锛堢郴缁熺櫥璁板彧鍒版湀浠斤級`)
+        : checkTime
+      const head = `<div class="er-head">璇ユ潯璁板綍鐨勮鍒掓鏌ユ棩鏈熶负 <b>${plannedText}</b>锛屽綋鍓嶅鏍告棩鏈熸槸 <b>${todayStr}</b>锛屽睘浜�<b>鎻愬墠瀹℃牳</b>銆�</div>`
+      const items = [
+        `鏈疆璁板綍鐨勮鍒掓鏌ユ棩鏈熶繚鐣欎负 <b>${plannedText}</b> 涓嶅彉锛涘鏍搁�氳繃鍚庯紝銆屾牳鏌ユ椂闂淬�嶈褰曚负瀹為檯瀹℃牳鏃ユ湡 <b>${todayStr}</b>銆俙,
+        `璁惧妗f鐨勬渶杩戞牳鏌ユ棩鏈熸洿鏂颁负 <b>${todayStr}</b>锛屼笅娆℃牳鏌ユ棩鏈熸寜鏍告煡鍛ㄦ湡鑷姩璁$畻銆俙,
+        `绯荤粺浼氭寜璁惧鐨勬牳鏌ュ懆鏈熻嚜鍔ㄧ敓鎴愪笅涓�杞緟鏍告煡浠诲姟锛堝湪涓嬫鏍告煡鏃ユ湡鎵�灞炲勾浠界殑璁″垝涓級锛屽垵濮嬬姸鎬佲�滄湭寮�濮嬧�濓紝杩欐槸姝e父鐜拌薄锛屼笉鏄鏍告病鐢熸晥銆俙
+      ]
+      const content = `${head}<div class="er-title">閫氳繃鍚庣郴缁熶細鍋氫笁浠朵簨锛�</div>` +
+        `<ol class="er-list">${items.map(item => `<li>${item}</li>`).join('')}</ol>` +
+        `<div class="er-question">鏄惁纭閫氳繃锛�</div>`
+      this.$confirm(content, '鎻愬墠瀹℃牳鎻愰啋', {
+        confirmButtonText: '纭閫氳繃',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning',
+        dangerouslyUseHTMLString: true,
+        customClass: 'early-review-message',
+      }).then(() => {
+        this.submitReview(statue)
+      }).catch(() => {})
+    },
+    // 鐪熸鎻愪氦瀹℃牳
+    submitReview(statue) {
       this.submitFormLoading = true
       const params = {
         planDetailsId: this.form.planDetailsId,
@@ -335,7 +381,7 @@
       }
       reviewExamineRecord(params).then(res => {
         if (res.code == 200) {
-          this.$message.success(statue === 1 ? '瀹℃牳閫氳繃' : '宸查��鍥�')
+          this.$message.success(statue === 1 ? '瀹℃牳閫氳繃' : '瀹℃牳涓嶉�氳繃')
           this.resetForm()
         }
         this.submitFormLoading = false
@@ -393,8 +439,7 @@
       if (!this.form.fileUrl) {
         return
       }
-      const isImage = /\.(jpg|jpeg|png|gif)$/i.test(this.form.fileUrl)
-      window.open(this.javaApi + (isImage ? '/img/' : '/word/') + this.form.fileUrl, '_blank')
+      return this.$download.saveAs(this.form.fileUrl, this.form.fileName)
     },
   },
   computed: {
@@ -447,3 +492,51 @@
   margin-bottom: 12px;
 }
 </style>
+
+<style>
+.early-review-message {
+  width: 560px !important;
+  max-width: calc(100vw - 40px);
+}
+
+.early-review-message .el-message-box__message {
+  line-height: 1.8;
+}
+
+.early-review-message .er-head {
+  padding: 10px 14px;
+  margin-bottom: 16px;
+  line-height: 1.8;
+  color: #303133;
+  background: #fdf6ec;
+  border-left: 4px solid #e6a23c;
+  border-radius: 4px;
+}
+
+.early-review-message .er-title {
+  margin-bottom: 8px;
+  font-weight: 600;
+  color: #303133;
+}
+
+.early-review-message .er-list {
+  margin: 0 0 0 4px;
+  padding-left: 20px;
+  list-style: decimal;
+}
+
+.early-review-message .er-list li {
+  margin-bottom: 10px;
+  line-height: 1.8;
+  color: #303133;
+}
+
+.early-review-message .er-list li:last-child {
+  margin-bottom: 0;
+}
+
+.early-review-message .er-question {
+  margin-top: 16px;
+  color: #606266;
+}
+</style>

--
Gitblit v1.9.3