From 7b38cbd5c0af64e2f11e02d4d2e0ea6cbb1c09f5 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期一, 09 十一月 2026 17:05:06 +0800
Subject: [PATCH] 测试完成

---
 src/views/followvisit/discharge/index.vue |  128 +++++++++++++++++++++++++++++++++---------
 1 files changed, 101 insertions(+), 27 deletions(-)

diff --git a/src/views/followvisit/discharge/index.vue b/src/views/followvisit/discharge/index.vue
index fb47a9e..17ec103 100644
--- a/src/views/followvisit/discharge/index.vue
+++ b/src/views/followvisit/discharge/index.vue
@@ -75,7 +75,7 @@
         <el-form-item label="缁忕鍖荤敓" prop="managementDoctor">
           <el-input
             v-model="topqueryParams.managementDoctor"
-            placeholder="璇疯緭鍏ヤ富娌诲尰鐢�"
+            placeholder="璇疯緭鍏ョ粡绠″尰鐢�"
           ></el-input>
         </el-form-item>
         <el-form-item label="鏃ユ湡闄愬埗" prop="status">
@@ -117,6 +117,24 @@
           <el-select v-model="topqueryParams.sort" placeholder="璇烽�夋嫨">
             <el-option
               v-for="item in topicoptionssort"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="褰撳墠鎵ц鏂瑰紡" prop="currentPreachforms">
+          <el-select
+            v-model="topqueryParams.currentPreachforms"
+            placeholder="璇烽�夋嫨"
+            multiple
+            clearable
+            collapse-tags
+          >
+            <el-option
+              v-for="item in currentPreachformOptions"
               :key="item.value"
               :label="item.label"
               :value="item.value"
@@ -1249,9 +1267,12 @@
             { value: 1, label: "琚鍙�" },
             { value: 2, label: "寰呭彂閫�" },
             { value: 3, label: "宸插彂閫�" },
-            { value: 5, label: "鍙戦�佸け璐�" },
             { value: 7, label: "瓒呮椂" },
           ],
+        },
+        {
+          value: 40, // 涓�绾э細鍙戦�佸け璐ワ紙鍗曠嫭鍒楀嚭锛屾柟渚跨洿鎺ョ瓫锛�
+          label: "鍙戦�佸け璐�",
         },
         {
           value: 20, // 涓�绾э細宸插畬鎴�
@@ -1306,6 +1327,10 @@
           value: 0,
         },
         {
+          name: "鍙戦�佸け璐�",
+          value: 0,
+        },
+        {
           name: "宸插畬鎴�",
           value: 0,
         },
@@ -1329,7 +1354,7 @@
       },
       // endOut: 1,
       endOut:
-        localStorage.getItem("orgname") == "鏅畞鐣叉棌鑷不鍘夸汉姘戝尰闄�" ? 0 : 1, //0 鍑洪櫌鏃堕棿(姝e簭)    1 鍑洪櫌鏃堕棿(鍊掑簭)   2 鍙戦�佹椂闂�(姝e簭)    3 鍙戦�佹椂闂�(鍊掑簭)  7搴旈殢璁挎棩鏈�(鍊掑簭) 搴旈殢璁挎棩鏈�(姝e簭)
+        localStorage.getItem("orgname") == "涓芥按甯備腑鍖婚櫌" ? 0 : 1, //0 鍑洪櫌鏃堕棿(姝e簭)    1 鍑洪櫌鏃堕棿(鍊掑簭)   2 鍙戦�佹椂闂�(姝e簭)    3 鍙戦�佹椂闂�(鍊掑簭)  7搴旈殢璁挎棩鏈�(鍊掑簭) 搴旈殢璁挎棩鏈�(姝e簭)
       endOuts: [
         {
           value: 0,
@@ -1393,6 +1418,7 @@
             : "",
         leaveldeptcodes: [],
         leavehospitaldistrictcodes: [],
+        currentPreachforms: [],
       },
       orgname: "",
       propss: { multiple: true },
@@ -1423,6 +1449,16 @@
           value: 5,
           label: "鏃犻渶闅忚",
         },
+      ],
+
+      currentPreachformOptions: [
+        { value: "1", label: "浜哄伐" },
+        { value: "2", label: "绾歌川" },
+        { value: "3", label: "鏅鸿兘璇煶" },
+        { value: "4", label: "鐭俊" },
+        { value: "5", label: "寰俊鍏紬鍙�" },
+        { value: "6", label: "寰俊灏忕▼搴�" },
+        { value: "7", label: "鏈悗闅忚" },
       ],
 
       sextype: [
@@ -1641,9 +1677,12 @@
       }
 
       try {
-        // 椤堕儴鍗$墖鐐瑰嚮鐨勪复鏃舵潯浠跺彧鍔犲湪鏈璇锋眰涓婏紝涓嶅啓鍥炶〃鍗�
-        const query = this.applyCardFilter({ ...this.topqueryParams });
-        const response = await getTaskservelist(query);
+        // 褰撳墠鎵ц鏂瑰紡涓哄閫夛紝闇�杞垚閫楀彿鍒嗛殧瀛楃涓诧紙濡� 1,2,5锛�
+        const params = { ...this.topqueryParams };
+        if (Array.isArray(params.currentPreachforms)) {
+          params.currentPreachforms = params.currentPreachforms.join(",");
+        }
+        const response = await getTaskservelist(params);
 
         // 鉁� 绗竴姝ワ細鍏堥攣瀹氭仮澶嶇姸鎬�
         this.isRestoring = true;
@@ -1685,10 +1724,11 @@
             });
           }
           if (item.currentPreachform) {
+
+
             item.currentPreachform = this.checkboxlist.find(
-              (item) => item.value == item.currentPreachform
-            )?.value;
-            console.log(item.currentPreachform, "mi");
+              (items) => items.value == item.currentPreachform
+            )?.label;
           }
         });
 
@@ -1816,9 +1856,9 @@
         this.cardlist[2].value = response.rows[0].ysf;
         this.ycvalue = Number(response.rows[0].yc) || 0;
         this.jgvalue = response.rows[0].jg;
-        this.cardlist[3].value = response.rows[0].fssb;
-        this.cardlist[4].value = response.rows[0].dsf;
-        // this.cardlist[5].value = response.rows[0].yfs2;
+        this.cardlist[3].value = response.rows[0].dsf;
+        this.cardlist[4].value = response.rows[0].fssb;
+        this.cardlist[5].value = response.rows[0].ywc;
         this.yfsvalue = response.rows[0].yfs;
         this.loading = false;
         this.userList.forEach((item) => {
@@ -1927,7 +1967,7 @@
     },
     /**
      * 鍙充笅瑙掋�屽緟澶勭悊闅忚浠诲姟銆嶅崱鐗囩偣鍑绘暟瀛楄烦杞繃鏉ワ細
-     * 鎸夊嚭闄㈠勾鏈� + 寰呴殢璁匡紙sendstate 1/2/3/5/7锛�+ 鍑洪櫌婊� 7 澶� 杩囨护锛屽彛寰勪笌鍗$墖涓�鑷�
+     * 鎸夊嚭闄㈠勾鏈� + 寰呴殢璁匡紙sendstate 1/2/3/7锛�+ 鍑洪櫌婊� 7 澶� 杩囨护锛屽彛寰勪笌鍗$墖涓�鑷�
      * @returns {boolean} 鏄惁宸叉寜鍗$墖鏉′欢鍙戣捣鏌ヨ
      */
     applyPendingTaskQuery() {
@@ -1945,11 +1985,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;
@@ -1957,24 +1994,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;
@@ -2060,6 +2120,11 @@
             break;
         }
         this.topqueryParams.sendstate = null;
+        // 涓�绾с�屽彂閫佸け璐ャ�嶏細鎸夌姸鎬� 5 鐩存帴杩囨护锛堜笉绛夊悓浜庡緟闅忚锛�
+        if (value === 40) {
+          this.topqueryParams.sendstateView = null;
+          this.topqueryParams.sendstate = 5;
+        }
       } else {
         // 閫変腑浜嗕簩绾э紙鍏蜂綋鐘舵�侊級
         this.topqueryParams.sendstateView = null;
@@ -2083,6 +2148,7 @@
         scopetype: [],
         leaveldeptcodes: [],
         leavehospitaldistrictcodes: [],
+        currentPreachforms: [],
       };
       this.handleQuery(1);
     },
@@ -2103,6 +2169,7 @@
         scopetype: [],
         leaveldeptcodes: [],
         leavehospitaldistrictcodes: [],
+        currentPreachforms: [],
       };
     },
     handleSelectionChange(rows) {
@@ -2438,11 +2505,16 @@
       try {
         const res = await getTaskservelist(query);
         const row = (res && res.rows && res.rows[0]) || {};
+        // 鎺ュ彛娌¤繑鍥炵粺璁¤鏃朵繚鎸佸師鍊硷紝閬垮厤涓�娆″紓甯告妸鍗$墖鍏ㄥ埛鎴� 0
+        if (!res || !res.rows || !res.rows.length) {
+          return;
+        }
         this.cardlist[0].value = Number(row.wxsf || 0) + Number(row.xsf || 0);
         this.cardlist[1].value = Number(row.wxsf) || 0;
         this.cardlist[2].value = Number(row.xsf) || 0;
         this.cardlist[3].value = Number(row.dsf) || 0;
-        this.cardlist[4].value = Number(row.ywc) || 0;
+        this.cardlist[4].value = Number(row.fssb) || 0;
+        this.cardlist[5].value = Number(row.ywc) || 0;
         this.ycvalue = Number(row.yc) || 0;
         this.jgvalue = Number(row.jg) || 0;
       } catch (e) {
@@ -2472,6 +2544,8 @@
         query.sendstateView = 3;
       } else if (name === "寰呴殢璁�") {
         query.sendstateView = 1;
+      } else if (name === "鍙戦�佸け璐�") {
+        query.sendstates = [5];
       } else if (name === "宸插畬鎴�") {
         query.sendstateView = 2;
       } else if (name === "闇�闅忚") {

--
Gitblit v1.9.3