From 574b449a39019a59dc90ecc19dda9f63d3aa9636 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期三, 18 十一月 2026 15:35:47 +0800
Subject: [PATCH] 测试完成

---
 src/views/followvisit/tasklist/index.vue |   85 ++++++++++++++++++++++++++++++------------
 1 files changed, 61 insertions(+), 24 deletions(-)

diff --git a/src/views/followvisit/tasklist/index.vue b/src/views/followvisit/tasklist/index.vue
index 069c195..7528df3 100644
--- a/src/views/followvisit/tasklist/index.vue
+++ b/src/views/followvisit/tasklist/index.vue
@@ -387,15 +387,20 @@
     </el-dialog>
     <!-- 浠诲姟鎵ц璇︽儏寮圭獥 -->
     <el-dialog
-      title="浠诲姟鎵ц璇︽儏"
       :visible.sync="countDialogVisible"
       width="600px"
       :before-close="handleCountClose"
     >
+      <span slot="title" class="count-dialog-title">浠诲姟鎵ц璇︽儏</span>
       <div v-loading="countLoading" class="count-detail">
         <div class="count-task-name">浠诲姟鍚嶇О锛歿{ countTaskName || "-" }}</div>
-        <div class="count-grid">
-          <div v-for="f in countFields" :key="f.key" class="count-item">
+        <div v-for="(row, ri) in countRows" :key="ri" class="count-grid">
+          <div
+            v-for="f in row"
+            :key="f.key"
+            class="count-item"
+            :style="countItemStyle(f)"
+          >
             <span class="count-label">{{ f.label }}</span>
             <span class="count-value">{{ countVal(f) }}</span>
           </div>
@@ -441,12 +446,15 @@
 import QRCode from "qrcode";
 export default {
   name: "Tasklist",
-  dicts: ["sys_normal_disable", "sys_user_sex", "task_status"],
+  // 椤甸潰鍙敤鍒� task_status锛屽幓鎺夋湭浣跨敤鐨勫瓧鍏稿彲灏戝彂 2 涓姹�
+  dicts: ["task_status"],
   components: { Treeselect, PatientSelection },
   data() {
     return {
       // 閬僵灞�
       loading: true,
+      // 棣栨鎸傝浇鏃� created 宸茬粡鏌ヨ繃锛岃烦杩囩揣鎺ョ潃瑙﹀彂鐨� activated锛岄伩鍏嶉噸澶嶈姹�
+      activatedOnce: false,
       // 閫変腑鏁扮粍
       ids: [],
       // 闈炲崟涓鐢�
@@ -477,18 +485,11 @@
       countTaskName: "",
       countData: {},
       countFields: [
-        { key: "total", label: "浠诲姟鎬婚噺" },
-        { key: "blq", label: "寰呴鍙�" },
-        { key: "wfs", label: "鏈彂閫�" },
-        { key: "yfs", label: "宸插彂閫�", altKey: "ysf" },
-        { key: "fssb", label: "鍙戦�佸け璐�" },
-        { key: "dsf", label: "寰呴殢璁�" },
-        { key: "xsf", label: "闇�闅忚" },
-        { key: "wxsf", label: "鏃犻渶闅忚" },
-        { key: "wzx", label: "鏈墽琛�" },
-        { key: "ywc", label: "宸插畬鎴�" },
-        { key: "yc", label: "寮傚父" },
-        { key: "jg", label: "璀﹀憡" },
+        { key: "total", label: "鎬婚噺", color: "#67afab", bg: "#e6f4f3" },
+        { key: "dsf", label: "寰呴殢璁�", color: "#409eff", bg: "#ecf5ff" },
+        { key: "ywc", label: "宸插畬鎴�", color: "#67c23a", bg: "#f0f9eb" },
+        { key: "yc", label: "寮傚父", color: "#f56c6c", bg: "#fef0f0" },
+        { key: "jg", label: "璀﹀憡", color: "#e6a23c", bg: "#fdf6ec" },
       ],
       // 鏃ユ湡鑼冨洿
       dateRange: [],
@@ -698,6 +699,18 @@
     };
   },
   watch: {},
+  computed: {
+    // 浠诲姟鎵ц璇︽儏锛氭寜涓よ鍒嗙粍锛屽�间负 0 鐨勯」涓嶅睍绀�
+    countRows() {
+      const row1 = this.countFields
+        .slice(0, 3)
+        .filter((f) => this.countNum(f) !== 0);
+      const row2 = this.countFields
+        .slice(3)
+        .filter((f) => this.countNum(f) !== 0);
+      return [row1, row2].filter((r) => r.length > 0);
+    },
+  },
   created() {
     this.orgname = localStorage.getItem("orgname");
     if (this.orgname == "鍗楀崕澶у闄勫睘绗竴鍖婚櫌") {
@@ -718,6 +731,11 @@
     this.checkboxlist = store.getters.checkboxlist;
   },
   activated() {
+    // 棣栨鎸傝浇鏃� created 宸茬粡璇锋眰杩囷紝閬垮厤閲嶅璇锋眰
+    if (!this.activatedOnce) {
+      this.activatedOnce = true;
+      return;
+    }
     this.getList();
   },
   // 鎼滅储
@@ -791,7 +809,6 @@
       getTasklist(this.topqueryParams).then((response) => {
         this.userList = response.rows;
         this.total = response.total;
-        this.$forceUpdate();
         this.loading = false;
       });
     },
@@ -1143,7 +1160,7 @@
       // 1. 鏋勯�犺姹傚弬鏁�
       const params = {
         taskId: row.taskid,
-        deptcode: row.deptcode || "", // 褰撳墠鐢ㄦ埛閮ㄩ棬缂栫爜锛岃纭繚 store 涓湁璇� getter
+        deptcode: row.leaveldeptcode || "", // 鍑洪櫌绉戝缂栫爜锛堝瓙浠诲姟瀛楁宸茬敱 deptcode 鏀瑰悕涓� leaveldeptcode锛�
         leavehospitaldistrictcode: row.leavehospitaldistrictcode || "", // 杞负閫楀彿鍒嗛殧瀛楃涓诧紝瑙嗘帴鍙i渶姹�
         // 濡傛灉鏈夊叾浠栧弬鏁板 hospitalDistrictCode 涔熷彲琛ュ厖
       };
@@ -1238,6 +1255,8 @@
     },
     // 鏌ョ湅浠诲姟鎵ц璇︽儏锛坈ountByCondition 鐩存帴杩斿洖鑱氬悎 Map锛�
     showCountDetail(row) {
+      console.log(11);
+
       this.countTaskName = row.taskName || "";
       this.countData = {};
       this.countDialogVisible = true;
@@ -1269,6 +1288,17 @@
       if (f.altKey && d[f.altKey] != null && d[f.altKey] !== "")
         return d[f.altKey];
       return 0;
+    },
+    // 缁熻鍊艰浆涓烘暟瀛楋紙鐢ㄤ簬鍒ゆ柇鏄惁涓� 0锛�
+    countNum(f) {
+      return Number(this.countVal(f)) || 0;
+    },
+    // 姣忛」鐨勮儗鏅壊涓庡瓧浣撻鑹�
+    countItemStyle(f) {
+      return {
+        background: f.bg || "#f5f7fa",
+        color: f.color || "#303133",
+      };
     },
     handleCountClose() {
       this.countDialogVisible = false;
@@ -1437,33 +1467,40 @@
   }
 }
 
+.count-dialog-title {
+  font-size: 16px;
+  font-weight: 600;
+  color: #67afab;
+}
 .count-detail {
   .count-task-name {
     font-size: 14px;
-    color: #303133;
+    color: #67afab;
     font-weight: 600;
     margin-bottom: 16px;
   }
   .count-grid {
-    display: grid;
-    grid-template-columns: repeat(3, 1fr);
+    display: flex;
     gap: 12px;
+    margin-bottom: 12px;
+    &:last-child {
+      margin-bottom: 0;
+    }
   }
   .count-item {
+    flex: 1;
     display: flex;
     justify-content: space-between;
     align-items: center;
     padding: 12px 14px;
-    background: #f5f7fa;
     border-radius: 4px;
     .count-label {
       font-size: 13px;
-      color: #606266;
+      opacity: 0.9;
     }
     .count-value {
       font-size: 16px;
       font-weight: 600;
-      color: #303133;
     }
   }
 }

--
Gitblit v1.9.3