From f12b3e4c7c8d55217cc1d21f814a9a3d5fc57251 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期二, 03 十一月 2026 16:02:21 +0800
Subject: [PATCH] 提交Merge branch 'subtask' of http://116.62.18.175:6699/r/~yxh/smartor-web into subtask

---
 src/views/followvisit/discharge/outpatientService.vue |   48 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 34 insertions(+), 14 deletions(-)

diff --git a/src/views/followvisit/discharge/outpatientService.vue b/src/views/followvisit/discharge/outpatientService.vue
index 243496d..e6fc7d9 100644
--- a/src/views/followvisit/discharge/outpatientService.vue
+++ b/src/views/followvisit/discharge/outpatientService.vue
@@ -1373,7 +1373,7 @@
     },
     /**
      * 鍙充笅瑙掋�屽緟澶勭悊闅忚浠诲姟銆嶅崱鐗囩偣鍑绘暟瀛楄烦杞繃鏉ワ細
-     * 鎸夊嚭闄㈠勾鏈� + 寰呴殢璁匡紙sendstate 1/2/3/5/7锛�+ 鍑洪櫌婊� 7 澶� 杩囨护锛屽彛寰勪笌鍗$墖涓�鑷�
+     * 鎸夊嚭闄㈠勾鏈� + 寰呴殢璁匡紙sendstate 1/2/3/7锛�+ 鍑洪櫌婊� 7 澶� 杩囨护锛屽彛寰勪笌鍗$墖涓�鑷�
      * @returns {boolean} 鏄惁宸叉寜鍗$墖鏉′欢鍙戣捣鏌ヨ
      */
     applyPendingTaskQuery() {
@@ -1391,11 +1391,8 @@
       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;
-      }
+      // 鍗$墖缁熻鐨勬槸銆屽嚭闄㈡弧 7 澶┿�嶇殑浠诲姟锛屾埅姝㈡棩 = min(璇ユ湀鏈�鍚庝竴澶�, 浠婂ぉ-7 澶�)
+      const end = this.pendingTaskMonthEnd(month);
       this.dateRange = [start, end];
       this.topqueryParams.serviceType = serviceType;
       this.topqueryParams.sendstateView = 1;
@@ -1403,24 +1400,47 @@
       // 鍗$墖缁熻鐨勬槸鍏ㄩ儴寰呴殢璁夸换鍔★紙涓嶅尯鍒嗛杞�/澶嶈瘖锛夛紝鍒楄〃杩欓噷鍚屾鏀惧紑
       this.topqueryParams.visitCount = null;
       this.topqueryParams.pageNum = 1;
+      // 褰撴湀杩樻病鍒扮 8 澶╂椂锛岃鏈堜笉鍙兘鏈夈�屽嚭闄㈡弧 7 澶┿�嶇殑浠诲姟锛堝崱鐗囨樉绀� 0锛夛紝鍒楄〃鐩存帴缁欑┖銆�
+      // 鏃ユ湡妗嗕粛鏄剧ず璇ユ湀鐨勮嚜鐒跺尯闂达紝閬垮厤鍑虹幇銆岃捣姝㈠�掓寕銆嶇殑绛涢�夋潯浠躲��
+      if (end < start) {
+        this.dateRange = [start, this.pendingTaskMonthLastDay(month)];
+        this.userList = [];
+        this.total = 0;
+        this.loading = false;
+        this.$message.info("璇ユ湀鏆傛棤鍑洪櫌婊� 7 澶╃殑寰呴殢璁夸换鍔�");
+        return true;
+      }
       this.handleQuery(1);
       return true;
     },
     /**
-     * 鍗$墖鍙e緞鐨勬湀浠界粨鏉熸棩锛�
-     * 褰撴湀鍙粺璁″嚭闄㈡弧 7 澶╃殑锛屾墍浠ュ彇銆屼粖澶� - 7 澶┿�嶏紱鍘嗗彶鏈堜唤鍙栧綋鏈堟渶鍚庝竴澶�
+     * 璇ユ湀鏈�鍚庝竴澶╋紙yyyy-MM-dd锛夛紝鍙敤浜庛�屽綋鏈堣繕娌℃湁婊� 7 澶╀换鍔°�嶆椂灞曠ず姝e父鏈堜唤鍖洪棿
+     */
+    pendingTaskMonthLastDay(month) {
+      const parts = String(month).split("-");
+      const date = new Date(Number(parts[0]), Number(parts[1]), 0);
+      const mm = String(date.getMonth() + 1).padStart(2, "0");
+      const dd = String(date.getDate()).padStart(2, "0");
+      return date.getFullYear() + "-" + mm + "-" + dd;
+    },
+    /**
+     * 鍗$墖鍙e緞鐨勬湀浠界粨鏉熸棩锛氬崱鐗囧彧缁熻銆屽嚭闄㈡弧 7 澶╀粛鏈殢璁裤�嶇殑浠诲姟锛�
+     * 鎵�浠ユ埅姝㈡棩姘歌繙鏄� min(璇ユ湀鏈�鍚庝竴澶�, 浠婂ぉ-7 澶�)锛�
+     * 鍘嗗彶鏈堜唤鍚屾牱瑕佹寜銆屼粖澶�-7 澶┿�嶆埅鏂紝鍚﹀垯鏈堟湯鍑犲ぉ鍑洪櫌鐨勬偅鑰呬細琚畻杩涙潵锛堝崱鐗� 49銆佸垪琛� 77锛夈��
      */
     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);
-      }
+      // 鍑洪櫌婊� 7 澶╋細鍑洪櫌鏃ユ湡 <= 浠婂ぉ-7锛堜笌鍚庣 endtime < 浠婂ぉ-6 00:00 绛変环锛�
+      const cutoff = new Date(
+        now.getFullYear(),
+        now.getMonth(),
+        now.getDate() - 7
+      );
+      const monthEnd = new Date(year, mon, 0);
+      const date = cutoff < monthEnd ? cutoff : monthEnd;
       const mm = String(date.getMonth() + 1).padStart(2, "0");
       const dd = String(date.getDate()).padStart(2, "0");
       return date.getFullYear() + "-" + mm + "-" + dd;

--
Gitblit v1.9.3