From f806aff5702fc6be9c9348d51964366cbf434bf7 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期四, 11 六月 2026 09:43:39 +0800
Subject: [PATCH] 维护

---
 src/views/business/decide/DecideInfo.vue |  151 ++++++++++++++++++++++++++++++++------------------
 1 files changed, 96 insertions(+), 55 deletions(-)

diff --git a/src/views/business/decide/DecideInfo.vue b/src/views/business/decide/DecideInfo.vue
index ee6b80a..cdc5db6 100644
--- a/src/views/business/decide/DecideInfo.vue
+++ b/src/views/business/decide/DecideInfo.vue
@@ -1,7 +1,7 @@
 <template>
   <div class="death-judgment-detail">
     <case-basic-info :case-id="caseId" :show-attachment="true" />
-<!-- 鍏叡淇℃伅妯″潡锛堢嫭绔嬫樉绀猴級 -->
+    <!-- 鍏叡淇℃伅妯″潡锛堢嫭绔嬫樉绀猴級 -->
 
     <!-- 鍒ゅ畾绫诲瀷鏍囩椤� -->
     <el-card class="type-card">
@@ -24,7 +24,7 @@
         </el-tab-pane>
       </el-tabs>
     </el-card>
-<el-card class="detail-card common-info-card">
+    <!-- <el-card class="detail-card common-info-card">
       <div slot="header" class="clearfix">
         <span class="detail-title">鍏叡淇℃伅</span>
       </div>
@@ -46,33 +46,10 @@
               <el-input v-model="form.gainhospitalname" :readonly="!isEdit" />
             </el-form-item>
           </el-col>
-          <el-col :span="8">
-            <el-form-item label="鏄惁榛樺搥缂呮��" prop="isspendremember">
-              <el-select
-                v-model="form.isspendremember"
-                :disabled="!isEdit"
-                style="width: 100%"
-              >
-                <el-option label="鏄�" :value="1" />
-                <el-option label="鍚�" :value="0" />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="鎭㈠閬椾綋浠" prop="isrestoreremains">
-              <el-select
-                v-model="form.isrestoreremains"
-                :disabled="!isEdit"
-                style="width: 100%"
-              >
-                <el-option label="鏄�" :value="1" />
-                <el-option label="鍚�" :value="0" />
-              </el-select>
-            </el-form-item>
-          </el-col>
+
         </el-row>
       </el-form>
-    </el-card>
+    </el-card> -->
     <!-- 鑴戞浜″垽瀹氭ā鍧� -->
     <el-card v-if="activeJudgmentType === 'brain'" class="detail-card">
       <div slot="header" class="clearfix">
@@ -85,6 +62,15 @@
           :loading="saveLoading"
         >
           淇濆瓨淇℃伅
+        </el-button>
+        <el-button
+          v-if="isEdit"
+          style="float: right; margin-left: 10px;"
+          type="success"
+          @click="accomplish"
+          :loading="saveLoading"
+        >
+          瀹屾垚鍒ゅ畾
         </el-button>
         <el-button
           v-else
@@ -103,7 +89,6 @@
               <el-input v-model="form.deathreason" :readonly="!isEdit" />
             </el-form-item>
           </el-col>
-
         </el-row>
 
         <el-row :gutter="20">
@@ -430,8 +415,6 @@
       </div>
     </el-card>
 
-
-
     <!-- 涓婁紶瀵硅瘽妗嗭紙鑴戞浜★級 -->
     <el-dialog
       :title="`涓婁紶${getCurrentBrainDeathTypeLabel}璇勪及琛╜"
@@ -519,6 +502,13 @@
         </el-button>
       </div>
     </el-dialog>
+    <!-- 闄勪欢棰勮 -->
+    <FilePreviewDialog
+      :visible="previewVisible"
+      :file="currentPreviewFile"
+      @close="previewVisible = false"
+      @download="handleDownload"
+    />
   </div>
 </template>
 
@@ -530,10 +520,11 @@
 } from "@/api/businessApi";
 import { getToken } from "@/utils/auth";
 import CaseBasicInfo from "@/components/CaseBasicInfo";
+import FilePreviewDialog from "@/components/FilePreviewDialog";
 
 export default {
   name: "DeathJudgmentDetail",
-  components: { CaseBasicInfo },
+  components: { CaseBasicInfo, FilePreviewDialog },
 
   data() {
     return {
@@ -544,7 +535,9 @@
 
       // 鍒ゅ畾绫诲瀷鏍囩
       activeJudgmentType: "brain", // 榛樿鏄剧ず鑴戞浜�
-
+      // 棰勮鐩稿叧
+      previewVisible: false,
+      currentPreviewFile: null,
       // 琛ㄥ崟鏁版嵁
       form: {
         id: undefined,
@@ -659,7 +652,7 @@
     this.infoid = this.$route.query.infoid;
     this.caseId = this.infoid;
     this.isEdit = this.$route.query.isEdit === "true";
-
+    this.activeJudgmentType = this.$route.query.type;
     // 浠庤矾鐢卞弬鏁拌幏鍙栭粯璁ゆ樉绀虹被鍨�
     if (this.$route.query.judgmentType) {
       this.activeJudgmentType = this.$route.query.judgmentType;
@@ -1017,37 +1010,82 @@
     },
 
     // 棰勮闄勪欢
-    handlePreview(attachment) {
-      if (attachment.fileName.endsWith(".pdf")) {
-        window.open(attachment.fileUrl, "_blank");
-      } else if (attachment.fileName.match(/\.(jpg|jpeg|png)$/i)) {
-        this.$alert(
-          `<img src="${attachment.fileUrl}" style="max-width: 100%;" alt="${attachment.fileName}">`,
-          "鍥剧墖棰勮",
-          {
-            dangerouslyUseHTMLString: true,
-            customClass: "image-preview-dialog"
-          }
-        );
-      } else {
-        this.$message.info("璇ユ枃浠剁被鍨嬫殏涓嶆敮鎸佸湪绾块瑙堬紝璇蜂笅杞藉悗鏌ョ湅");
-      }
-    },
+    handlePreview(file) {
+      console.log(file, "file");
 
+      this.currentPreviewFile = {
+        fileName: file.fileName,
+        fileUrl: file.path || file.fileUrl,
+        fileType: this.getFileType(file.fileName)
+      };
+      this.previewVisible = true;
+      // if (attachment.fileName.endsWith(".pdf")) {
+      //   window.open(attachment.fileUrl, "_blank");
+      // } else if (attachment.fileName.match(/\.(jpg|jpeg|png)$/i)) {
+      //   this.$alert(
+      //     `<img src="${attachment.fileUrl}" style="max-width: 100%;" alt="${attachment.fileName}">`,
+      //     "鍥剧墖棰勮",
+      //     {
+      //       dangerouslyUseHTMLString: true,
+      //       customClass: "image-preview-dialog"
+      //     }
+      //   );
+      // } else {
+      //   this.$message.info("璇ユ枃浠剁被鍨嬫殏涓嶆敮鎸佸湪绾块瑙堬紝璇蜂笅杞藉悗鏌ョ湅");
+      // }
+    },
+    getFileType(fileName) {
+      if (!fileName) return "other";
+
+      const extension = fileName
+        .split(".")
+        .pop()
+        .toLowerCase();
+      const imageTypes = ["jpg", "jpeg", "png", "gif", "bmp", "webp"];
+      const pdfTypes = ["pdf"];
+      const officeTypes = ["doc", "docx", "xls", "xlsx", "ppt", "pptx"];
+
+      if (imageTypes.includes(extension)) return "image";
+      if (pdfTypes.includes(extension)) return "pdf";
+      if (officeTypes.includes(extension)) return "office";
+      return "other";
+    },
     // 涓嬭浇闄勪欢
-    handleDownload(attachment) {
-      const link = document.createElement("a");
-      link.href = attachment.fileUrl;
-      link.download = attachment.fileName;
-      link.click();
-      this.$message.success(`寮�濮嬩笅杞�: ${attachment.fileName}`);
+    handleDownload(file) {
+      const fileUrl = file.path || file.fileUrl;
+      const fileName = file.fileName;
+
+      if (fileUrl) {
+        const link = document.createElement("a");
+        link.href = fileUrl;
+        link.download = fileName;
+        link.style.display = "none";
+        document.body.appendChild(link);
+        link.click();
+        document.body.removeChild(link);
+        this.$message.success("寮�濮嬩笅杞芥枃浠�");
+      } else {
+        this.$message.warning("鏂囦欢璺緞涓嶅瓨鍦紝鏃犳硶涓嬭浇");
+      }
     },
 
     // 缂栬緫淇℃伅
     handleEdit() {
       this.isEdit = true;
     },
+    accomplish() {
+      this.$confirm("鏄惁纭瀹屾垚璇ユ渚嬫浜″垽瀹氬叏閮ㄤ俊鎭紵", "鎻愰啋", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+        .then(() => {
+          this.form.state = 3;
+          this.handleSave();
+        })
 
+        .catch(() => {});
+    },
     // 淇濆瓨淇℃伅
     async handleSave() {
       // 鏍规嵁褰撳墠鏍囩閫夋嫨楠岃瘉瑙勫垯
@@ -1067,6 +1105,9 @@
               rememberAnnex: this.buildBrainDeathAttachmentJson(),
               heartdeathjudgeannex: this.buildHeartDeathAttachmentJson()
             };
+            if (submitData.state == 1 || !submitData.state) {
+              submitData.state = 2;
+            }
             let response = null;
 
             if (submitData.id) {

--
Gitblit v1.9.3