From bad2bc143be3f8ddb93a1c9f984127b3ccf43e8f Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期一, 31 三月 2025 17:47:14 +0800
Subject: [PATCH] 11

---
 src/views/doctor/inspectCheck/index.vue |   83 +++++++++++++++++++++++------------------
 1 files changed, 46 insertions(+), 37 deletions(-)

diff --git a/src/views/doctor/inspectCheck/index.vue b/src/views/doctor/inspectCheck/index.vue
index baeaa7f..4733eb7 100644
--- a/src/views/doctor/inspectCheck/index.vue
+++ b/src/views/doctor/inspectCheck/index.vue
@@ -6,6 +6,7 @@
       size="small"
       :inline="true"
       label-width="68px"
+      @submit.native.prevent
     >
       <el-form-item label="浣撴鍙�" prop="reportDoctorCode">
         <el-input
@@ -39,7 +40,6 @@
           size="mini"
           style="margin-right: 15px"
           @click="tongbu"
-          :disabled="!selectedFirstTable"
           >鍚屾</el-button
         >
       </el-form-item>
@@ -62,6 +62,7 @@
           style="width: 100%"
           @selection-change="handleSelectionChange"
           :header-cell-style="{ background: '#aad8df' }"
+          height="350"
         >
           <el-table-column
             fixed
@@ -69,7 +70,6 @@
             align="center"
             label="閫夋嫨"
             width="40"
-            :selectable="isSelectable"
           >
           </el-table-column>
           <el-table-column
@@ -102,7 +102,8 @@
             label="妫�楠岄」鐩�"
             align="center"
             prop="checkParts"
-            width="150px"
+            width="350px"
+            :show-overflow-tooltip="true"
           />
           <el-table-column
             label="椤圭洰缂栧彿"
@@ -121,6 +122,7 @@
             align="center"
             prop="examinationDate"
             width="150px"
+            :formatter="formatDate"
           />
 
           <el-table-column
@@ -282,10 +284,11 @@
     </div>
     <el-table
       border
-      max-height="280"
+      height="350"
       ref="tab1"
       :data="checkList"
       v-loading="loading"
+      style="width: 100%"
       @selection-change="handleSelectionChangeSecond"
     >
       <el-table-column type="selection" width="55"> </el-table-column>
@@ -346,6 +349,7 @@
   
   <script>
 import { getlisList, getJyTjList, asyncPacs } from "@/api/doctor/pacsCheck";
+import moment from "moment";
 
 export default {
   dicts: ["dict_tj_status"],
@@ -431,9 +435,20 @@
       }
       console.log("Query Params:", this.queryParams);
     },
-    isSelectable(row) {
-      return !!row.mzh;
+    formatDate(row) {
+      if (!row.examinationDate) return "";
+
+      // 浣跨敤 moment 瑙f瀽鎸囧畾鏍煎紡鐨勬棩鏈熷瓧绗︿覆
+      const date = moment(row.examinationDate, "MM DD YYYY hh:mmA");
+
+      if (!date.isValid()) return "鏃犳晥鏃ユ湡";
+
+      // 鏍煎紡鍖栦负鎵�闇�鏍煎紡
+      return date.format("YYYY-MM-DD HH:mm");
     },
+    // isSelectable(row) {
+    //   return !!row.mzh;
+    // },
     tableRowClassName({ row }) {
       return !row.mzh ? "row-disabled" : "";
     },
@@ -446,31 +461,34 @@
       }
       console.log(val, 999); */
 
-      /* if (val.length > 0) {
-        const selectedRow = val[0];
-        console.log(val[0], 555);
+      if (val.length > 0) {
+        // const selectedRow = val[0];
+        // console.log(val[0], 555);
 
-        this.selectedFirstTable = selectedRow;
+        this.selectedFirstTable = val;
         console.log("褰撳墠閫変腑鐨勮鏁版嵁:", this.selectedFirstTable);
         // this.fetchRightTableData(selectedRow);
       } else {
         this.selectedFirstTable = null;
         this.checkList = [];
-      } */
+      }
     },
     // 鏍规嵁閫変腑鐨勮鏁版嵁璇锋眰鍙宠竟琛ㄦ牸鏁版嵁
-    /* fetchRightTableData() {
-      const code = selectedRow.mzh;
-      if (!code) return;
-
-       getJyTjList(code).then((response) => {
+    fetchRightTableData() {
+      const code = queryParams.tjNum;
+      // if (!code) return;
+      getJyTjList(code).then((response) => {
         this.checkList = response.data;
         this.loading = false;
       });
-    }, */
+    },
 
     handleSelectionChangeSecond(selectedRows) {
       this.selectedSecondTable = selectedRows;
+      if (selectedRows.length > 1) {
+        let del_row = selectedRows.shift();
+        this.$refs.tab1.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑
+      }
       console.log("褰撳墠閫変腑鐨勮鏁版嵁:", this.selectedSecondTable);
     },
     getList() {
@@ -498,22 +516,10 @@
             this.loading = false;
             this.exaLists = res.data;
             // const code = this.exaLists[0].mzh;
-            if (
-              this.exaLists &&
-              this.exaLists.length > 0 &&
-              this.exaLists[0].mzh
-            ) {
-              const code = this.exaLists[0].mzh;
-
-              getJyTjList(code).then((response) => {
-                this.checkList = response.data;
-              });
-            } else {
-              this.$message.error("鏈壘鍒版湁鏁堢殑 mzh 鍊硷紝鏃犳硶鑾峰彇鐩稿叧鏁版嵁");
-            }
-            /*  getJyTjList(code).then((response) => {
+            const code = this.queryParams.tjNum;
+            getJyTjList(code).then((response) => {
               this.checkList = response.data;
-            }); */
+            });
           }
         })
         .catch((error) => {
@@ -554,21 +560,24 @@
       this.$modal.loading("姝e湪鍚屾锛岃绋嶅��...");
       this.setTime();
       const requestData = {
-        lis: [this.selectedFirstTable], // 宸︿晶琛ㄦ牸閫変腑鏁版嵁
+        lis: this.selectedFirstTable.map((item) => ({
+          ...item,
+          tjNum: this.queryParams.tjNum,
+        })),
         jcxmid: this.selectedFirstTable.jcxmid,
         shys: this.selectedFirstTable.shys,
         tj: this.selectedSecondTable[0], // 鍙充晶琛ㄦ牸閫変腑鏁版嵁
       };
 
-      if (!this.selectedSecondTable || this.selectedSecondTable.length === 0) {
+      /*   if (!this.selectedSecondTable || this.selectedSecondTable.length === 0) {
         this.$message.error("鑷冲皯閫変竴鏉℃暟鎹紒");
         return;
-      }
+      } */
 
       asyncPacs(requestData)
         .then((res) => {
           if (res.code == 200) {
-            // this.fetchRightTableData(this.selectedFirstTable);
+            this.fetchRightTableData(this.selectedFirstTable);
             clearInterval(this.clearTimeSet);
             this.clearTimeSet = null;
             this.$modal.closeLoading();
@@ -601,7 +610,7 @@
 
 .table-title {
   text-align: center;
-  margin-bottom: 15px;
+  margin-bottom: 10px;
 }
 .row-disabled {
   color: #ccc; /* 璁剧疆绂佺敤琛岀殑瀛椾綋棰滆壊 */

--
Gitblit v1.8.0