From 9903954c85f651dd5cc6d4b538cfe66b17fc5baa Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 28 十月 2026 18:23:45 +0800
Subject: [PATCH] 提交

---
 src/views/followvisit/discharge/outpatientService.vue |   85 ++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 80 insertions(+), 5 deletions(-)

diff --git a/src/views/followvisit/discharge/outpatientService.vue b/src/views/followvisit/discharge/outpatientService.vue
index f9811f2..243496d 100644
--- a/src/views/followvisit/discharge/outpatientService.vue
+++ b/src/views/followvisit/discharge/outpatientService.vue
@@ -400,8 +400,8 @@
         <el-table-column
           label="绉戝"
           align="center"
-          key="deptname"
-          prop="deptname"
+          key="leaveldeptname"
+          prop="leaveldeptname"
           width="120"
         >
         </el-table-column>
@@ -758,7 +758,7 @@
           <el-input
             style="width: 400px"
             disabled
-            v-model="zcform.deptname"
+            v-model="zcform.leaveldeptname"
           ></el-input>
         </el-form-item>
         <el-form-item label="鐥呭尯">
@@ -1117,7 +1117,21 @@
       rules: {},
     };
   },
-  watch: {},
+  watch: {
+    // 鍙充笅瑙掋�屽緟澶勭悊闅忚浠诲姟銆嶅崱鐗囧啀娆$偣鍑伙紙褰撳墠宸插湪鏈〉锛�
+    "$route.query": {
+      handler(newQuery) {
+        if (
+          newQuery?.month &&
+          newQuery?.fromPendingTask === "1" &&
+          this.taskQueryReady
+        ) {
+          this.applyPendingTaskQuery();
+        }
+      },
+      immediate: true,
+    },
+  },
   created() {
     this.serviceState = store.getters.serviceState;
     this.checkboxlist = store.getters.checkboxlist;
@@ -1136,7 +1150,9 @@
         value: dept.districtCode,
       };
     });
-    if (this.errtype) {
+    if (this.applyPendingTaskQuery()) {
+      // 鍙充笅瑙掋�屽緟澶勭悊闅忚浠诲姟銆嶅崱鐗囪烦杞細宸叉寜骞存湀 + 寰呴殢璁挎潯浠舵煡璇�
+    } else if (this.errtype) {
       this.toleadExport(2);
     } else {
       this.getList(1);
@@ -1144,8 +1160,13 @@
     this.getConfigKey("sys.user.initPassword").then((response) => {
       this.initPassword = response.msg;
     });
+    // created 鍒濆鍖栧畬鎴愶紝涔嬪悗璺敱 query 鍙樺寲鎵嶆寜鍗$墖鏉′欢閲嶆柊鏌ヨ
+    this.taskQueryReady = true;
   },
   activated() {
+    if (this.applyPendingTaskQuery()) {
+      return;
+    }
     this.getList(1);
   },
   methods: {
@@ -1350,6 +1371,60 @@
       };
       this.resetForm("form");
     },
+    /**
+     * 鍙充笅瑙掋�屽緟澶勭悊闅忚浠诲姟銆嶅崱鐗囩偣鍑绘暟瀛楄烦杞繃鏉ワ細
+     * 鎸夊嚭闄㈠勾鏈� + 寰呴殢璁匡紙sendstate 1/2/3/5/7锛�+ 鍑洪櫌婊� 7 澶� 杩囨护锛屽彛寰勪笌鍗$墖涓�鑷�
+     * @returns {boolean} 鏄惁宸叉寜鍗$墖鏉′欢鍙戣捣鏌ヨ
+     */
+    applyPendingTaskQuery() {
+      const query = this.$route.query || {};
+      if (!query.month || query.fromPendingTask !== "1") {
+        return false;
+      }
+      // 椤甸潰琚� keep-alive 澶嶇敤鏃朵細閲嶅瑙﹀彂 activated锛屽悓涓�娆$偣鍑诲彧澶勭悊涓�娆�
+      if (this.pendingTaskToken && this.pendingTaskToken === query._t) {
+        return false;
+      }
+      this.pendingTaskToken = query._t;
+
+      const month = String(query.month);
+      const serviceType = Number(query.serviceType) === 3 ? 3 : 2;
+      this.errtype = undefined;
+      const start = month + "-01";
+      let end = this.pendingTaskMonthEnd(month);
+      // 鏈堝垵 7 澶╁唴锛�"浠婂ぉ-7澶�" 浼氭棭浜庢湀鍒濓紝鍏滃簳鎴愭湀鍒濓紝閬垮厤鏃ユ湡鍖洪棿鍊掓寕
+      if (end < start) {
+        end = start;
+      }
+      this.dateRange = [start, end];
+      this.topqueryParams.serviceType = serviceType;
+      this.topqueryParams.sendstateView = 1;
+      this.topqueryParams.sendstate = null;
+      // 鍗$墖缁熻鐨勬槸鍏ㄩ儴寰呴殢璁夸换鍔★紙涓嶅尯鍒嗛杞�/澶嶈瘖锛夛紝鍒楄〃杩欓噷鍚屾鏀惧紑
+      this.topqueryParams.visitCount = null;
+      this.topqueryParams.pageNum = 1;
+      this.handleQuery(1);
+      return true;
+    },
+    /**
+     * 鍗$墖鍙e緞鐨勬湀浠界粨鏉熸棩锛�
+     * 褰撴湀鍙粺璁″嚭闄㈡弧 7 澶╃殑锛屾墍浠ュ彇銆屼粖澶� - 7 澶┿�嶏紱鍘嗗彶鏈堜唤鍙栧綋鏈堟渶鍚庝竴澶�
+     */
+    pendingTaskMonthEnd(month) {
+      const parts = String(month).split("-");
+      const year = Number(parts[0]);
+      const mon = Number(parts[1]);
+      const now = new Date();
+      let date;
+      if (year === now.getFullYear() && mon === now.getMonth() + 1) {
+        date = new Date(year, mon - 1, now.getDate() - 7);
+      } else {
+        date = new Date(year, mon, 0);
+      }
+      const mm = String(date.getMonth() + 1).padStart(2, "0");
+      const dd = String(date.getDate()).padStart(2, "0");
+      return date.getFullYear() + "-" + mm + "-" + dd;
+    },
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery(refresh) {
       if (this.topqueryParams.searchscope == 3) {

--
Gitblit v1.9.3