From 42f17b759cc69f44a8d200934117daaaa703d87d Mon Sep 17 00:00:00 2001
From: wwl <xchao828@163.com>
Date: 星期三, 25 十二月 2024 17:59:53 +0800
Subject: [PATCH] his科室ID

---
 src/views/doctor/check/index.vue   |  145 ++++++++++++++----------
 src/views/system/dept/index.vue    |   42 +++++--
 src/components/Packagese/index.vue |  135 +++++++++++++--------
 3 files changed, 197 insertions(+), 125 deletions(-)

diff --git a/src/components/Packagese/index.vue b/src/components/Packagese/index.vue
index 298bcc9..ecf67a9 100644
--- a/src/components/Packagese/index.vue
+++ b/src/components/Packagese/index.vue
@@ -50,6 +50,7 @@
           >
         </el-form-item>
       </el-form>
+      
       <el-table
         :data="dataList"
         ref="elTable"
@@ -76,6 +77,7 @@
         <el-table-column label="鍐呭" align="center" prop="pacRemark" />
         <el-table-column label="澶囨敞" align="center" prop="price" />
       </el-table>
+
       <div class="pag">
         <div class="pag1">
           <pagination
@@ -87,6 +89,7 @@
           />
         </div>
       </div>
+
       <span slot="footer" class="dialog-footer">
         <el-button @click="open = false">鍙� 娑�</el-button>
         <el-button type="primary" @click="handleOk">纭� 瀹�</el-button>
@@ -94,30 +97,24 @@
     </el-dialog>
   </div>
 </template>
-  
+
 <script>
 import { getTjHyBgList } from "@/api/hosp/project";
+
 export default {
   name: "Packagese",
-  // props: {
-  //   pacCode: {
-  //         type: String,
-          
-  //     }
-
-  // },
+  props: {
+    selectedId: {
+      type: String,
+      default: "",  // 鐖剁粍浠朵紶閫掔殑閫変腑ID
+    },
+  },
   data() {
     return {
       open: false,
-      openone: false,
-      // 寮瑰嚭灞傛爣棰�
       title: "",
       dataList: [],
-      // 閬僵灞�
       loading: false,
-      form: {
-        desc: "",
-      },
       queryParams: {
         pid: "",
         pname: "",
@@ -126,73 +123,106 @@
         page: 1,
         pageSize: 10,
       },
+      total: 0,
       list: [],
-      fList: {},
     };
   },
+  
   watch: {
-    // 'row'(val, newVla) {
-    //     console.log(val,newVla)
-    //     this.fList = val
-    //     console.log(this.fList);
-    // }
-  },
-  mounted() {
-    // this.getList()
+    // 鐩戝惉鐖剁粍浠朵紶閫掔殑 selectedId
+    selectedId(newVal) {
+      // 濡傛灉 selectedId 涓虹┖锛屾竻绌烘墍鏈夐�変腑鐨勯」
+      if (!newVal) {
+        this.clearSelection();
+      } else {
+        this.handleSelectionEcho(newVal);
+      }
+    },
   },
 
-  created() {
-    // this.getList()
-  },
   methods: {
+    // 鑾峰彇鏁版嵁
     getAllList() {
       this.loading = true;
-      this.openone = true;
       getTjHyBgList(this.queryParams).then((res) => {
         this.dataList = res.data.list;
+        this.total = res.data.total;
         this.loading = false;
+        
+        // 鍦ㄨ幏鍙栨暟鎹悗鍥炴樉閫変腑椤�
+        this.handleSelectionEcho(this.selectedId);
       });
     },
-    // getList() {
-    //   this.loading = true;
-    //   this.openone = false;
-    //   Packagestlist(this.queryParams).then((res) => {
-    //     this.dataList = res.rows;
-    //     this.loading = false;
-    //   });
-    // },
-    handleQuery() {
-   
-      this.getAllList();
- 
+
+    // 鏍规嵁 selectedId 鏌ユ壘瀵瑰簲鐨勯」骞跺洖鏄鹃�夋嫨
+    handleSelectionEcho(selectedId) {
+      if (this.dataList.length > 0 && selectedId) {
+        const selectedItem = this.dataList.find(
+          (item) => item.pacCode === selectedId
+        );
+        if (selectedItem) {
+          this.$nextTick(() => {
+            this.$refs.elTable.clearSelection();  // 娓呴櫎涔嬪墠鐨勯�夋嫨
+            this.$refs.elTable.toggleRowSelection(selectedItem, true); // 閫変腑瀵瑰簲椤�
+            this.list = [selectedItem];  // 璁剧疆閫変腑鐨勯」
+          });
+        }
+      }
     },
+
+    // 娓呯┖鎵�鏈夐�変腑鐨勯」
+    clearSelection() {
+      this.$nextTick(() => {
+        this.$refs.elTable.clearSelection();  // 娓呯┖鎵�鏈夐�変腑鐨勯」
+        this.list = [];  // 娓呯┖閫変腑鐨勫垪琛�
+      });
+    },
+
+    // 澶勭悊閫夋嫨鍙樺寲
     handleSelectionChange(selection) {
       if (selection.length > 1) {
-        this.$refs.elTable.clearSelection(); // 娓呯┖鎵�鏈夐�夋嫨
-        this.$refs.elTable.toggleRowSelection(selection.pop()); // 璁剧疆閫夋嫨椤�
+        // 濡傛灉閫夋嫨浜嗗琛岋紝淇濈暀鏈�鍚庝竴琛�
+        this.$refs.elTable.clearSelection();  // 娓呯┖鎵�鏈夐�夋嫨
+        this.$refs.elTable.toggleRowSelection(selection[selection.length - 1]);  // 閲嶆柊閫夋嫨鏈�鍚庝竴椤�
       }
-      this.list = selection;
-      console.log(this.list);
+
+      // 鑾峰彇鏈�鍚庨�夋嫨鐨勮
+      this.list = [selection[selection.length - 1]];
     },
+
+    // 纭畾閫夋嫨
     handleOk() {
       this.open = false;
-   
-      if (this.list.length === 1) {
+      this.queryParams = {
+        pid: "",
+        pname: "",
+        pym: "",
+        checktype: "deptdict",
+        page: 1,
+        pageSize: 10,
+      };
+
+      if (this.list.length > 0) {
         const pac = [
-         {
-          pacCode: this.list[0].pacCode,
-          pacName: this.list[0].pacName
-         }
-      ];
+          {
+            pacCode: this.list[this.list.length - 1].pacCode,
+            pacName: this.list[this.list.length - 1].pacName,
+          },
+        ];
         this.$emit("add", pac);
       } else {
         this.$message.warning("璇烽�夋嫨涓�涓」鐩�");
       }
     },
+
+    // 瑙﹀彂鏌ヨ
+    handleQuery() {
+      this.getAllList();
+    },
   },
 };
 </script>
-  
+
 <style scoped>
 .pag {
   width: 100%;
@@ -201,7 +231,6 @@
 }
 
 .pag1 {
-  width: 30%;
+  width: 60%;
 }
 </style>
-  
\ No newline at end of file
diff --git a/src/views/doctor/check/index.vue b/src/views/doctor/check/index.vue
index 87c3a37..b1dc633 100644
--- a/src/views/doctor/check/index.vue
+++ b/src/views/doctor/check/index.vue
@@ -518,6 +518,7 @@
                   border
                   height="460px"
                   style="width: 96%; margin: 10px 10px"
+                  :row-class-name="tableRowClassName"
                 >
                   <el-table-column
                     prop="project.proName"
@@ -547,6 +548,18 @@
                       ></el-input>
                     </template>
                   </el-table-column>
+                  <el-table-column
+                    prop="exceptionDesc"
+                    label="寮傚父"
+                    width="80px"
+                    align="center"
+                  >
+                    <template slot-scope="scope">
+                      <el-checkbox
+                        v-model="scope.row.exceptionDesc"
+                      ></el-checkbox>
+                    </template>
+                  </el-table-column>
                   <el-table-column label="瑙勫垯" width="55">
                     <template slot-scope="scope">
                       <el-button
@@ -556,12 +569,20 @@
                       >
                     </template>
                   </el-table-column>
-                  <el-table-column prop="project.proMetering" label="鍗曚綅">
+                  <el-table-column
+                    prop="project.proMetering"
+                    label="鍗曚綅"
+                    width="55"
+                  >
                     <!-- <template slot-scope="scope">
             {{ scope.row.standard.company }}
           </template> -->
                   </el-table-column>
-                  <el-table-column prop="project.proScope" label="鍙傝�冭寖鍥�">
+                  <el-table-column
+                    prop="project.proScope"
+                    label="鍙傝�冭寖鍥�"
+                    width="70"
+                  >
                   </el-table-column>
                   <el-table-column
                     prop="conclusion"
@@ -580,37 +601,23 @@
                       ></el-input>
                     </template>
                   </el-table-column>
-                  <el-table-column
-                    prop="exceptionDesc"
-                    label="鏄惁寮傚父"
-                    width="80px"
-                    align="center"
-                  >
-                    <template slot-scope="scope">
-                      <el-checkbox
-                        v-model="scope.row.exceptionDesc"
-                      ></el-checkbox>
-                    </template>
-                  </el-table-column>
+
                   <el-table-column
                     prop="isReturn"
-                    label="鏄惁澶嶈瘖"
-                    width="80px"
+                    label="澶嶈瘖"
+                    width="60px"
                     align="center"
                   >
                     <template slot-scope="scope">
                       <el-checkbox v-model="scope.row.isReturn"></el-checkbox>
                     </template>
                   </el-table-column>
-                  <el-table-column prop="resultType" label="缁撴灉绫诲瀷">
-                    <template slot-scope="scope">
-                      <dict-tag
-                        :options="dict.type.tj_result_type"
-                        :value="scope.row.resultType"
-                      />
-                    </template>
-                  </el-table-column>
-                  <el-table-column prop="isPositive" label="閲嶅ぇ闃虫��">
+
+                  <el-table-column
+                    prop="isPositive"
+                    label="閲嶅ぇ闃虫��"
+                    width="55"
+                  >
                     <template slot-scope="scope">
                       <el-switch
                         v-model="scope.row.isPositive"
@@ -618,6 +625,16 @@
                         inactive-value="0"
                         @change="checkboxchange(scope.row)"
                       ></el-switch>
+                    </template>
+                  </el-table-column>
+                  <el-table-column prop="resultType" label="缁撴灉寤鸿">
+                    <template>
+                      <el-popover placement="top" trigger="click" width="400">
+                        <div>寤鸿璁粨鏋滃缓璁粨鏋滃缓璁粨寤鸿寤鸿璁粨鏋滃缓璁粨鏋滃缓璁粨寤鸿寤鸿璁粨鏋滃缓璁粨鏋滃缓璁粨寤鸿寤鸿璁粨鏋滃缓璁粨鏋滃缓璁粨寤鸿寤鸿璁粨鏋滃缓璁粨鏋滃缓璁粨寤鸿</div>
+                        <div slot="reference" class="jianyi">
+                          鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙� 鐨勬墜娉曢鍙�
+                        </div>
+                      </el-popover>
                     </template>
                   </el-table-column>
                 </el-table>
@@ -807,11 +824,12 @@
                   border
                   height="460px"
                   style="width: 96%; margin: 10px 10px"
+                  :row-class-name="tableRowClassName"
                 >
                   <el-table-column
                     prop="project.proName"
                     label="妫�娴嬮」鐩�"
-                    width="150"
+                    width="100"
                     fixed="left"
                   >
                     <!-- <template slot-scope="scope">
@@ -821,7 +839,7 @@
                   <el-table-column
                     prop="proResult"
                     label="妫�娴嬬粨鏋�"
-                    width="200"
+                    width="150"
                   >
                     <template slot-scope="scope">
                       <el-input
@@ -845,34 +863,18 @@
                       >
                     </template>
                   </el-table-column>
-                  <el-table-column prop="project.proMetering" label="鍗曚綅">
+                  <el-table-column prop="project.proMetering" label="鍗曚綅" width="55">
                     <!-- <template slot-scope="scope">
             {{ scope.row.standard.company }}
           </template> -->
                   </el-table-column>
-                  <el-table-column prop="project.proScope" label="鍙傝�冭寖鍥�">
+                  <el-table-column prop="project.proScope" label="鍙傝�冭寖鍥�" width="80">
                   </el-table-column>
-                  <el-table-column
-                    prop="conclusion"
-                    label="缁撴灉缁撹"
-                    width="200"
-                  >
-                    <template slot-scope="scope">
-                      <el-input
-                        size="mini"
-                        type="textarea"
-                        autosize
-                        v-model="scope.row.conclusion"
-                        autocomplete="off"
-                        placeholder="璇疯緭鍏ユ娴嬬粨鏋�"
-                        disabled
-                      ></el-input>
-                    </template>
-                  </el-table-column>
+            
                   <el-table-column
                     prop="exceptionDesc"
-                    label="鏄惁寮傚父"
-                    width="80px"
+                    label="寮傚父"
+                    width="55px"
                     align="center"
                   >
                     <template slot-scope="scope">
@@ -883,23 +885,16 @@
                   </el-table-column>
                   <el-table-column
                     prop="isReturn"
-                    label="鏄惁澶嶈瘖"
-                    width="80px"
+                    label="澶嶈瘖"
+                    width="55px"
                     align="center"
                   >
                     <template slot-scope="scope">
                       <el-checkbox v-model="scope.row.isReturn"></el-checkbox>
                     </template>
                   </el-table-column>
-                  <el-table-column prop="resultType" label="缁撴灉绫诲瀷">
-                    <template slot-scope="scope">
-                      <dict-tag
-                        :options="dict.type.tj_result_type"
-                        :value="scope.row.resultType"
-                      />
-                    </template>
-                  </el-table-column>
-                  <el-table-column prop="isPositive" label="閲嶅ぇ闃虫��">
+          
+                  <el-table-column prop="isPositive" label="閲嶅ぇ闃虫��" width="55">
                     <template slot-scope="scope">
                       <el-switch
                         v-model="scope.row.isPositive"
@@ -907,6 +902,16 @@
                         inactive-value="0"
                         @change="checkboxchange(scope.row)"
                       ></el-switch>
+                    </template>
+                  </el-table-column>
+                  <el-table-column prop="resultType" label="缁撴灉寤鸿">
+                    <template>
+                      <el-popover placement="top" trigger="click" width="400">
+                        <div></div>
+                        <div slot="reference" class="jianyi">
+                        
+                        </div>
+                      </el-popover>
                     </template>
                   </el-table-column>
                 </el-table>
@@ -1498,6 +1503,12 @@
   },
 
   methods: {
+    tableRowClassName({ row }) {
+      if (row.exceptionDesc) {
+        return "warning-row";
+      }
+      return "";
+    },
     getbzlist() {
       getDeptAdvice(this.queryParam1).then((response) => {
         this.deptAdviceList = response.data.list;
@@ -1729,11 +1740,11 @@
       this.focusrow = datas;
       this.proResult = datas;
       var pattern3 = new RegExp("[0-9]+");
+      console.log(typeof this.proResult.proResult);
       if (pattern3.test(this.proResult)) {
         let data = {
           proId: this.focusrow.proId,
           cusId: this.tableAll.cusId,
-          keyNum: this.proResult,
           tjNum: this.tableAll.tjNumber,
           keyNum: this.proResult.proResult,
         };
@@ -2891,4 +2902,18 @@
   display: flex;
   justify-content: center;
 }
+.el-table__body tr:hover > td {
+  background-color: transparent !important; /* 绉婚櫎榛樿鐨� hover 鏁堟灉 */
+}
+.el-table .warning-row {
+  background: #ffe6e6 !important; /* 杞诲井鐨勭孩鑹茶儗鏅� */
+}
+.jianyi {
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  cursor: pointer;  /* 榧犳爣鎮仠鏃舵樉绀烘墜鍨嬶紝鎻愮ず鍙互鐐瑰嚮 */
+}
 </style>
diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue
index 9e0298b..d71e42f 100644
--- a/src/views/system/dept/index.vue
+++ b/src/views/system/dept/index.vue
@@ -322,7 +322,11 @@
           </el-input>
         </el-form-item>
         <el-form-item label="his绉戝鍚�" prop="hisksmc">
-          <el-input v-model="form.hisksmc" placeholder="his绉戝鍚�" style="width: 202px;">
+          <el-input
+            v-model="form.hisksmc"
+            placeholder="his绉戝鍚�"
+            style="width: 202px"
+          >
           </el-input>
         </el-form-item>
         <!-- <el-form-item label="閲嶇偣绉戝" prop="deptFcusTypeCode">
@@ -362,10 +366,12 @@
       </el-form>
 
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
+
         <el-button @click="cancel">鍙� 娑�</el-button>
+        <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
       </div>
-      <Packagese ref="aaa" @add="handleChanges" />
+      <!-- 鍦ㄧ埗缁勪欢涓� -->
+      <Packagese ref="aaa" :visible="showPackagese" @add="handleChanges" :selectedId="form.hisksid" />
     </el-dialog>
   </div>
 </template>
@@ -389,7 +395,7 @@
 export default {
   name: "Dept",
   dicts: ["sys_normal_disable", "dict_user_orgtype", "dict_dept_type"],
-  components: { Treeselect,Packagese },
+  components: { Treeselect, Packagese },
   data() {
     let checkPhoneNum = (rule, value, callback) => {
       let patter = new RegExp(/^1\s*[3456789]\s*(\d\s*){9}$/);
@@ -402,12 +408,14 @@
       }
     };
     return {
+      showPackagese: false,
       // 閮ㄩ棬鍚嶇О
       deptName: undefined,
       // 閬僵灞�
       loading: true,
       hospList: [],
       parentNameList: [],
+      total: 0,
       // 鏄剧ず鎼滅储鏉′欢
       showSearch: true,
       // 琛ㄦ牸鏍戞暟鎹�
@@ -500,18 +508,28 @@
     this.getDeptTree();
   },
   methods: {
-    handlePacCode(data) {
-  // 澶勭悊pacCode鐨勯�昏緫
-  console.log('Received pacCode:', data);
-},
     handleQuerys() {
+
+      this.showPackagese = true;
+      if (this.form.hisksid) {
+        this.$refs.aaa.list = [
+          {
+            pacCode: this.form.hisksid,
+            pacName: this.form.hisksmc,
+          },
+        ];
+      }
+
       this.$refs.aaa.open = true;
       this.$refs.aaa.getAllList();
       this.$refs.aaa.title = "鏁版嵁瀛楀吀";
     },
     handleChanges(param1) {
-      this.form.lisXmbm = param1[0].pacCode;
-      this.form.lisXmmc = param1[0].pacName;
+      this.form = {
+        ...this.form,
+        hisksid: param1[0].pacCode,
+        hisksmc: param1[0].pacName,
+      };
     },
     /** 鏌ヨ閮ㄩ棬鍒楄〃 */
     getList() {
@@ -658,14 +676,15 @@
       });
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
+
     handleUpdate(row) {
-      // console.log(11111)
       // this.reset();
       this.form = row;
       this.form.parentId = this.form.parentId.toString();
       if (this.form.parentId == 0) {
         this.deptOption.push({ id: 0, label: "涓荤被鐩�" });
       }
+
       this.open = true;
       this.title = "绉戝淇℃伅缁存姢  ";
       // getDept(row.deptId).then((response) => {
@@ -691,7 +710,6 @@
         if (valid) {
           if (this.form.deptId != undefined) {
             if (this.form.hospId) {
-              // console.log(this.form);
               updateDept(this.form).then((response) => {
                 this.$modal.msgSuccess("淇敼鎴愬姛");
                 this.open = false;

--
Gitblit v1.8.0