From bbbc478129f72b26e2ec4a2e981ed8698a96880c Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期四, 22 十月 2026 00:28:18 +0800
Subject: [PATCH] 当service_type=6时,需要根据传入的入院还是离院病区(病区)去后端查询

---
 src/views/patient/patient/behospitalized.vue |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/src/views/patient/patient/behospitalized.vue b/src/views/patient/patient/behospitalized.vue
index b099067..f1f22c6 100644
--- a/src/views/patient/patient/behospitalized.vue
+++ b/src/views/patient/patient/behospitalized.vue
@@ -819,12 +819,33 @@
     /** 鏌ヨ鎮h�呭垪琛� */
     getList() {
       this.loading = true;
-      listpatient(this.queryParams).then((response) => {
+      listpatient(this.buildListQueryParams()).then((response) => {
         console.log(response);
         this.userList = response.rows;
         this.total = response.total;
         this.loading = false;
       });
+    },
+    /**
+     * 缁勮 listpatient 鍏ュ弬锛�
+     * cry = 0 涓旂櫥褰曟満鏋勪负銆岀渷绔嬪悓寰风繝鑻戦櫌鍖� / 鍗楀崕澶у闄勫睘绗竴鍖婚櫌銆嶆椂锛�
+     * 绉戝/鐥呭尯瀛楁 leaveldeptcodes銆乴eavehospitaldistrictcodes 闇�鎹㈡垚
+     * deptcodeList銆乭ospitaldistrictcodeList銆�
+     */
+    buildListQueryParams() {
+      const params = { ...this.queryParams };
+      const orgname = localStorage.getItem("orgname");
+      const needRename =
+        params.cry === 0 &&
+        (orgname === "鐪佺珛鍚屽痉缈犺嫅闄㈠尯" ||
+          orgname === "鍗楀崕澶у闄勫睘绗竴鍖婚櫌");
+      if (needRename) {
+        params.deptcodeList = params.leaveldeptcodes;
+        params.hospitaldistrictcodeList = params.leavehospitaldistrictcodes;
+        delete params.leaveldeptcodes;
+        delete params.leavehospitaldistrictcodes;
+      }
+      return params;
     },
     /** 琛ㄦ牸琛屾牱寮� */
     tableRowClassName({ row, rowIndex }) {
@@ -860,6 +881,10 @@
         this.queryParams.leaveldeptcodes.push(code);
         this.queryParams.leavehospitaldistrictcodes = [];
         this.queryParams.searchscope = 1;
+      } else if (type == 2) {
+        this.queryParams.leavehospitaldistrictcodes.push(code);
+        this.queryParams.leaveldeptcodes = [];
+        this.queryParams.searchscope = 2;
       } else if (type == 3) {
         this.queryParams.leaveldeptcodes = store.getters.belongDepts.map(
           (obj) => obj.deptCode

--
Gitblit v1.9.3