WXL (wul)
5 天以前 39c8b288ec8294e026459dfb1955f0bbc49ebb52
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>
@@ -477,18 +482,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 +696,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 == "南华大学附属第一医院") {
@@ -1238,6 +1248,8 @@
    },
    // 查看任务执行详情(countByCondition 直接返回聚合 Map)
    showCountDetail(row) {
      console.log(11);
      this.countTaskName = row.taskName || "";
      this.countData = {};
      this.countDialogVisible = true;
@@ -1269,6 +1281,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 +1460,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;
    }
  }
}