From 8925a21e020cdaee64924f3243898c4d86038fa2 Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期四, 05 六月 2025 13:56:52 +0800
Subject: [PATCH] 1

---
 src/views/doctor/pacsCheck/index.vue |   90 +++++++++++++++++++++++++++++---------------
 1 files changed, 59 insertions(+), 31 deletions(-)

diff --git a/src/views/doctor/pacsCheck/index.vue b/src/views/doctor/pacsCheck/index.vue
index daf5306..3b51f49 100644
--- a/src/views/doctor/pacsCheck/index.vue
+++ b/src/views/doctor/pacsCheck/index.vue
@@ -6,6 +6,7 @@
       size="small"
       :inline="true"
       label-width="68px"
+      @submit.native.prevent
     >
       <el-form-item label="浣撴鍙�" prop="reportDoctorCode">
         <el-input
@@ -15,9 +16,10 @@
           clearable
           @keyup.enter.native="handleQuery"
           style="width: 170px"
+          @input="onInput"
         />
       </el-form-item>
-     <!--  <el-form-item label="濮撳悕" prop="name">
+      <!--  <el-form-item label="濮撳悕" prop="name">
         <el-input
           v-model="queryParams.name"
           placeholder="璇疯緭鍏ュ鍚�"
@@ -88,7 +90,7 @@
       :data="exaLists"
       v-loading="loading"
       border
-      max-height="350"
+      height="350"
       @current-change="handleCurrentChange"
       @selection-change="handleSelectionChange"
       :row-class-name="tableRowClassName"
@@ -99,8 +101,8 @@
         align="center"
         label="閫夋嫨"
         width="40"
-        :selectable="isSelectable"
       >
+        <!--   :selectable="isSelectable" -->
       </el-table-column>
 
       <el-table-column label="濮撳悕" align="center" prop="name" width="80px" />
@@ -125,11 +127,13 @@
         prop="checkParts"
         width="150px"
       />
+      <!--   :formatter="formatDate" -->
       <el-table-column
         label="鎶ュ憡鏃堕棿"
         align="center"
         prop="examinationDate"
-        width="150px"
+        width="153px"
+      
       />
 
       <el-table-column label="闂ㄨ瘖鍙�" align="center" prop="mzh" width="140px" />
@@ -329,45 +333,59 @@
     });
   },
   methods: {
-   
-    handleDateChange(val){
+    onInput(val) {
+      this.inputVal = val.replace(/\s+/g, ""); // 娓呴櫎鎵�鏈夌┖鏍�
+    },
+    handleDateChange(val) {
       if (val && val.length === 2) {
         this.queryParams.start = val[0]; // 璁剧疆寮�濮嬫椂闂�
-        this.queryParams.end = val[1];   // 璁剧疆缁撴潫鏃堕棿
+        this.queryParams.end = val[1]; // 璁剧疆缁撴潫鏃堕棿
       } else {
         this.queryParams.start = null;
         this.queryParams.end = null;
       }
-      console.log('Query Params:', this.queryParams);
-
+      console.log("Query Params:", this.queryParams);
     },
-    isSelectable(row) {
-      return !!row.mzh;
-    },
+    // isSelectable(row) {
+    //   return !!row.mzh;
+    // },
     tableRowClassName({ row }) {
       return !row.mzh ? "row-disabled" : "";
     },
+    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");
+    },
 
     handleSelectionChange(val) {
-      console.log(val);
+     /*  console.log(val);
       if (val.length > 1) {
         let del_row = val.shift();
         this.$refs.tb.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑
-      }
-      console.log(val, 999);
+      } */
 
       if (val.length > 0) {
-        const selectedRow = val[0];
-        console.log(val[0], 555);
-        /*  if (!selectedRow.mzh) {
-          this.$refs.tb.toggleRowSelection(selectedRow, false);
-          this.$message.warning("褰撳墠琛屾棤鏈夋晥闂ㄨ瘖鍙凤紝涓嶈兘閫変腑");
-          return;
-        } */
+        // const selectedRow = val[0];
 
-        this.selectedFirstTable = selectedRow;
-        console.log("褰撳墠閫変腑鐨勮鏁版嵁:", this.selectedFirstTable);
-        this.fetchRightTableData(selectedRow);
+        this.selectedFirstTable = val;
+        // console.log("褰撳墠閫変腑鐨勮鏁版嵁:", this.selectedFirstTable);
+        const code = this.queryParams.tjNum;
+        if (!code) {
+          this.$message.warning("浣撴鍙蜂笉鑳戒负绌�!");
+          return; // 鐩存帴杩斿洖锛岄伩鍏嶇户缁墽琛岃姹�
+        }
+        this.loading = true;
+        getRightList(code).then((response) => {
+          this.checkList = response.data;
+          this.loading = false;
+        });
       } else {
         this.selectedFirstTable = null;
         this.checkList = [];
@@ -375,8 +393,9 @@
     },
     // 鏍规嵁閫変腑鐨勮鏁版嵁璇锋眰鍙宠竟琛ㄦ牸鏁版嵁
     fetchRightTableData(selectedRow) {
-      const code = selectedRow.mzh;
-      if (!code) return;
+      const code = this.queryParams.tjNum;
+      // const code = selectedRow.mzh;
+      // if (!code) return;
       this.loading = true;
       getRightList(code).then((response) => {
         this.checkList = response.data;
@@ -386,6 +405,10 @@
 
     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() {
@@ -408,7 +431,7 @@
           if (res.code == 200) {
             this.loading = false;
             this.exaLists = res.data;
-            this.code = this.exaLists.mzh;
+            // this.code = this.exaLists.mzh;
           }
         })
         .catch((error) => {
@@ -448,9 +471,14 @@
     tongbu(row) {
       this.$modal.loading("姝e湪鍚屾锛岃绋嶅��...");
       this.setTime();
-      // console.log(val, 66);
+      this.selectedFirstTable.tjnum = this.queryParams.tjNum;
+      console.log(this.selectedFirstTable,this.selectedSecondTable[0],455555);
+      
       const requestData = {
-        pacs: this.selectedFirstTable, // 宸︿晶琛ㄦ牸閫変腑鏁版嵁
+        pacs: this.selectedFirstTable.map((item) => ({
+          ...item,
+          tjNum: this.queryParams.tjNum,
+        })),// 宸︿晶琛ㄦ牸閫変腑鏁版嵁
         tj: this.selectedSecondTable[0], // 鍙充晶琛ㄦ牸閫変腑鏁版嵁
       };
 
@@ -476,7 +504,7 @@
           this.clearTimeSet = null;
           this.$modal.closeLoading();
           // this.$modal.error("鎿嶄綔澶辫触锛岃绋嶅悗閲嶈瘯");
-        })
+        });
     },
   },
 };

--
Gitblit v1.8.0