From ed62678cd16042506bad5e5f75665a822f2d5717 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期二, 30 十二月 2025 10:28:18 +0800
Subject: [PATCH] 数据更新推送

---
 src/views/business/course/components/DeathJudgmentStage.vue |  194 +++++++++++++++++++++++++++++-------------------
 1 files changed, 116 insertions(+), 78 deletions(-)

diff --git a/src/views/business/course/components/DeathJudgmentStage.vue b/src/views/business/course/components/DeathJudgmentStage.vue
index a1d2bc4..b72f626 100644
--- a/src/views/business/course/components/DeathJudgmentStage.vue
+++ b/src/views/business/course/components/DeathJudgmentStage.vue
@@ -36,10 +36,17 @@
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="鍒ゅ畾鍖荤敓" prop="judgmentDoctor">
-              <el-input v-model="form.judgmentDoctor" :readonly="!isEdit" />
+            <el-form-item label="鍒ゅ畾鍖荤敓涓�" prop="judgmentDoctor">
+              <el-input v-model="form.judgmentDoctorone" :readonly="!isEdit" />
             </el-form-item>
           </el-col>
+          <el-col :span="8">
+            <el-form-item label="鍒ゅ畾鍖荤敓浜�" prop="judgmentDoctor">
+              <el-input v-model="form.judgmentDoctortwo" :readonly="!isEdit" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
           <el-col :span="8">
             <el-form-item label="鐧昏浜�" prop="registrant">
               <el-input v-model="form.registrant" :readonly="!isEdit" />
@@ -118,7 +125,9 @@
 
               <el-table-column label="鏂囦欢绫诲瀷" width="100" align="center">
                 <template slot-scope="scope">
-                  <el-tag size="small">{{ getFileType(scope.row.fileName) }}</el-tag>
+                  <el-tag size="small">{{
+                    getFileType(scope.row.fileName)
+                  }}</el-tag>
                 </template>
               </el-table-column>
 
@@ -140,11 +149,7 @@
                 </template>
               </el-table-column>
 
-              <el-table-column
-                label="鎿嶄綔"
-                width="180"
-                align="center"
-              >
+              <el-table-column label="鎿嶄綔" width="180" align="center">
                 <template slot-scope="scope">
                   <el-button
                     size="mini"
@@ -177,7 +182,10 @@
               v-if="getAttachmentsByType(type.value).length === 0"
               class="empty-attachment"
             >
-              <el-empty description="鏆傛棤璇勪及琛ㄩ檮浠�" :image-size="80"></el-empty>
+              <el-empty
+                description="鏆傛棤璇勪及琛ㄩ檮浠�"
+                :image-size="80"
+              ></el-empty>
             </div>
           </div>
         </el-tab-pane>
@@ -204,7 +212,9 @@
         :auto-upload="false"
       >
         <i class="el-icon-upload"></i>
-        <div class="el-upload__text">灏嗚瘎浼拌〃鏂囦欢鎷栧埌姝ゅ锛屾垨<em>鐐瑰嚮涓婁紶</em></div>
+        <div class="el-upload__text">
+          灏嗚瘎浼拌〃鏂囦欢鎷栧埌姝ゅ锛屾垨<em>鐐瑰嚮涓婁紶</em>
+        </div>
         <div class="el-upload__tip" slot="tip">
           鏀寔涓婁紶pdf銆乯pg銆乸ng銆乨oc銆乨ocx銆亁ls銆亁lsx鏍煎紡鏂囦欢锛屽崟涓枃浠朵笉瓒呰繃10MB
         </div>
@@ -226,7 +236,10 @@
 </template>
 
 <script>
-import { getDeathJudgmentDetail, updateDeathJudgment } from "./api/mockDeathJudgmentApi";
+import {
+  getDeathJudgmentDetail,
+  updateDeathJudgment
+} from "./api/mockDeathJudgmentApi";
 
 export default {
   name: "DeathJudgmentDetail",
@@ -299,20 +312,21 @@
   },
   created() {
     const id = this.$route.query.id;
-    this.isEdit = this.$route.path.includes('/edit') || this.$route.path.includes('/add');
-    if (id && !this.$route.path.includes('/add')) {
+    this.isEdit =
+      this.$route.path.includes("/edit") || this.$route.path.includes("/add");
+    if (id && !this.$route.path.includes("/add")) {
       this.getDetail(id);
-    } else if (this.$route.path.includes('/add')) {
+    } else if (this.$route.path.includes("/add")) {
       this.generateHospitalNo();
     }
     this.getAttachmentList();
   },
   methods: {
-    // 鐢熸垚妗堜緥缂栧彿
+    // 鐢熸垚浣忛櫌鍙�
     generateHospitalNo() {
-      // 妯℃嫙鐢熸垚妗堜緥缂栧彿锛欴 + 鏃堕棿鎴冲悗6浣�
+      // 妯℃嫙鐢熸垚浣忛櫌鍙凤細D + 鏃堕棿鎴冲悗6浣�
       const timestamp = Date.now().toString();
-      this.form.hospitalNo = 'D' + timestamp.slice(-6);
+      this.form.hospitalNo = "D" + timestamp.slice(-6);
     },
     // 鑾峰彇璇︽儏
     getDetail(id) {
@@ -358,16 +372,19 @@
     },
     // 鑾峰彇鏂囦欢绫诲瀷
     getFileType(fileName) {
-      const ext = fileName.split('.').pop().toLowerCase();
+      const ext = fileName
+        .split(".")
+        .pop()
+        .toLowerCase();
       const typeMap = {
-        'pdf': 'PDF',
-        'doc': 'DOC',
-        'docx': 'DOCX',
-        'xls': 'XLS',
-        'xlsx': 'XLSX',
-        'jpg': 'JPG',
-        'jpeg': 'JPEG',
-        'png': 'PNG'
+        pdf: "PDF",
+        doc: "DOC",
+        docx: "DOCX",
+        xls: "XLS",
+        xlsx: "XLSX",
+        jpg: "JPG",
+        jpeg: "JPEG",
+        png: "PNG"
       };
       return typeMap[ext] || ext.toUpperCase();
     },
@@ -385,36 +402,39 @@
     // 涓婁紶鍓嶆牎楠�
     beforeUpload(file) {
       const allowedTypes = [
-        'application/pdf',
-        'image/jpeg',
-        'image/png',
-        'application/msword',
-        'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
-        'application/vnd.ms-excel',
-        'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+        "application/pdf",
+        "image/jpeg",
+        "image/png",
+        "application/msword",
+        "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
+        "application/vnd.ms-excel",
+        "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
       ];
 
       const maxSize = 10 * 1024 * 1024; // 10MB
 
       // 鏍¢獙鏂囦欢绫诲瀷
-      const isTypeOk = allowedTypes.includes(file.type) ||
-                      file.name.endsWith('.pdf') ||
-                      file.name.endsWith('.jpg') ||
-                      file.name.endsWith('.jpeg') ||
-                      file.name.endsWith('.png') ||
-                      file.name.endsWith('.doc') ||
-                      file.name.endsWith('.docx') ||
-                      file.name.endsWith('.xls') ||
-                      file.name.endsWith('.xlsx');
+      const isTypeOk =
+        allowedTypes.includes(file.type) ||
+        file.name.endsWith(".pdf") ||
+        file.name.endsWith(".jpg") ||
+        file.name.endsWith(".jpeg") ||
+        file.name.endsWith(".png") ||
+        file.name.endsWith(".doc") ||
+        file.name.endsWith(".docx") ||
+        file.name.endsWith(".xls") ||
+        file.name.endsWith(".xlsx");
 
       if (!isTypeOk) {
-        this.$message.error('鏂囦欢鏍煎紡涓嶆敮鎸侊紝璇蜂笂浼爌df銆乯pg銆乸ng銆乨oc銆乨ocx銆亁ls鎴杧lsx鏍煎紡鏂囦欢');
+        this.$message.error(
+          "鏂囦欢鏍煎紡涓嶆敮鎸侊紝璇蜂笂浼爌df銆乯pg銆乸ng銆乨oc銆乨ocx銆亁ls鎴杧lsx鏍煎紡鏂囦欢"
+        );
         return false;
       }
 
       // 鏍¢獙鏂囦欢澶у皬
       if (file.size > maxSize) {
-        this.$message.error('鏂囦欢澶у皬涓嶈兘瓒呰繃10MB');
+        this.$message.error("鏂囦欢澶у皬涓嶈兘瓒呰繃10MB");
         return false;
       }
 
@@ -431,7 +451,7 @@
     // 鎻愪氦涓婁紶
     async submitUpload() {
       if (this.tempFileList.length === 0) {
-        this.$message.warning('璇峰厛閫夋嫨瑕佷笂浼犵殑鏂囦欢');
+        this.$message.warning("璇峰厛閫夋嫨瑕佷笂浼犵殑鏂囦欢");
         return;
       }
 
@@ -447,55 +467,62 @@
             fileName: file.name,
             fileSize: file.size,
             uploadTime: new Date().toISOString(),
-            uploader: '褰撳墠鐢ㄦ埛',
+            uploader: "褰撳墠鐢ㄦ埛",
             fileUrl: URL.createObjectURL(file.raw)
           };
 
           this.attachmentList.push(newAttachment);
         }
 
-        this.$message.success('鏂囦欢涓婁紶鎴愬姛');
+        this.$message.success("鏂囦欢涓婁紶鎴愬姛");
         this.uploadDialogVisible = false;
         this.tempFileList = [];
       } catch (error) {
-        this.$message.error('鏂囦欢涓婁紶澶辫触');
-        console.error('涓婁紶澶辫触:', error);
+        this.$message.error("鏂囦欢涓婁紶澶辫触");
+        console.error("涓婁紶澶辫触:", error);
       } finally {
         this.uploadLoading = false;
       }
     },
     // 鍒犻櫎闄勪欢
     handleRemoveAttachment(attachment) {
-      this.$confirm('纭畾瑕佸垹闄よ繖涓瘎浼拌〃闄勪欢鍚楋紵', '鎻愮ず', {
-        confirmButtonText: '纭畾',
-        cancelButtonText: '鍙栨秷',
-        type: 'warning'
-      }).then(() => {
-        const index = this.attachmentList.findIndex(item => item.id === attachment.id);
-        if (index !== -1) {
-          this.attachmentList.splice(index, 1);
-          this.$message.success('璇勪及琛ㄥ垹闄ゆ垚鍔�');
-        }
-      }).catch(() => {});
+      this.$confirm("纭畾瑕佸垹闄よ繖涓瘎浼拌〃闄勪欢鍚楋紵", "鎻愮ず", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
+      })
+        .then(() => {
+          const index = this.attachmentList.findIndex(
+            item => item.id === attachment.id
+          );
+          if (index !== -1) {
+            this.attachmentList.splice(index, 1);
+            this.$message.success("璇勪及琛ㄥ垹闄ゆ垚鍔�");
+          }
+        })
+        .catch(() => {});
     },
     // 棰勮闄勪欢
     handlePreview(attachment) {
-      if (attachment.fileName.endsWith('.pdf')) {
-        window.open(attachment.fileUrl, '_blank');
+      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}">`,
-          '鍥剧墖棰勮', {
+        this.$alert(
+          `<img src="${attachment.fileUrl}" style="max-width: 100%;" alt="${attachment.fileName}">`,
+          "鍥剧墖棰勮",
+          {
             dangerouslyUseHTMLString: true,
-            customClass: 'image-preview-dialog'
-          });
+            customClass: "image-preview-dialog"
+          }
+        );
       } else {
-        this.$message.info('璇ユ枃浠剁被鍨嬫殏涓嶆敮鎸佸湪绾块瑙堬紝璇蜂笅杞藉悗鏌ョ湅');
+        this.$message.info("璇ユ枃浠剁被鍨嬫殏涓嶆敮鎸佸湪绾块瑙堬紝璇蜂笅杞藉悗鏌ョ湅");
       }
     },
     // 涓嬭浇闄勪欢
     handleDownload(attachment) {
       // 瀹為檯椤圭洰涓皟鐢ㄤ笅杞芥帴鍙�
-      const link = document.createElement('a');
+      const link = document.createElement("a");
       link.href = attachment.fileUrl;
       link.download = attachment.fileName;
       link.click();
@@ -511,17 +538,17 @@
           updateDeathJudgment(this.form)
             .then(response => {
               if (response.code === 200) {
-                this.$message.success('淇濆瓨鎴愬姛');
-                if (this.$route.path.includes('/add')) {
-                  this.$router.push('/case/deathJudgment');
+                this.$message.success("淇濆瓨鎴愬姛");
+                if (this.$route.path.includes("/add")) {
+                  this.$router.push("/case/deathJudgment");
                 } else {
                   this.isEdit = false;
                 }
               }
             })
             .catch(error => {
-              console.error('淇濆瓨澶辫触:', error);
-              this.$message.error('淇濆瓨澶辫触');
+              console.error("淇濆瓨澶辫触:", error);
+              this.$message.error("淇濆瓨澶辫触");
             })
             .finally(() => {
               this.saveLoading = false;
@@ -531,17 +558,28 @@
     },
     // 鏂囦欢澶у皬鏍煎紡鍖�
     formatFileSize(size) {
-      if (size === 0) return '0 B';
+      if (size === 0) return "0 B";
       const k = 1024;
-      const sizes = ['B', 'KB', 'MB', 'GB'];
+      const sizes = ["B", "KB", "MB", "GB"];
       const i = Math.floor(Math.log(size) / Math.log(k));
-      return parseFloat((size / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
+      return parseFloat((size / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
     },
     // 鏃堕棿鏍煎紡鍖�
     parseTime(time) {
-      if (!time) return '';
+      if (!time) return "";
       const date = new Date(time);
-      return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
+      return `${date.getFullYear()}-${(date.getMonth() + 1)
+        .toString()
+        .padStart(2, "0")}-${date
+        .getDate()
+        .toString()
+        .padStart(2, "0")} ${date
+        .getHours()
+        .toString()
+        .padStart(2, "0")}:${date
+        .getMinutes()
+        .toString()
+        .padStart(2, "0")}`;
     }
   }
 };

--
Gitblit v1.9.3