| | |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | <el-table-column |
| | | label="总任务/已随访" |
| | | label="执行详情" |
| | | align="center" |
| | | key="nickName" |
| | | key="taskDetail" |
| | | width="120" |
| | | prop="nickName" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span |
| | | >{{ |
| | | scope.row.wfs || scope.row.wfs == 0 |
| | | ? scope.row.wfs + scope.row.yfs |
| | | : "" |
| | | }}/{{ scope.row.yfs }}</span |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click="showCountDetail(scope.row)" |
| | | ><span class="button-xq" |
| | | ><i class="el-icon-s-data"></i>执行详情</span |
| | | ></el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | |
| | | > |
| | | </div> |
| | | </el-dialog> |
| | | <!-- 任务执行详情弹窗 --> |
| | | <el-dialog |
| | | :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 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> |
| | | </div> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="countDialogVisible = false">关 闭</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!-- 选择患者弹框 --> |
| | | <Patient-Selection |
| | | ref="Patient" |
| | |
| | | import { |
| | | getTasklist, |
| | | delTaskInfo, |
| | | countByCondition, |
| | | TaskTemplateSendExecution, |
| | | scanGenerateSubtask, |
| | | goSfRelay, |
| | |
| | | qrDialogVisible: false, |
| | | qrCodeUrl: "", // 中间页链接 |
| | | qrCodeCanvas: null, // 存储canvas引用 |
| | | // 任务执行详情弹窗 |
| | | countDialogVisible: false, |
| | | countLoading: false, |
| | | countTaskName: "", |
| | | countData: {}, |
| | | countFields: [ |
| | | { 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: [], |
| | | // 岗位选项 |
| | |
| | | }; |
| | | }, |
| | | 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 == "南华大学附属第一医院") { |
| | |
| | | const container = this.$refs.qrCodeContainer; |
| | | if (container) container.innerHTML = ""; |
| | | }, |
| | | // 查看任务执行详情(countByCondition 直接返回聚合 Map) |
| | | showCountDetail(row) { |
| | | console.log(11); |
| | | |
| | | this.countTaskName = row.taskName || ""; |
| | | this.countData = {}; |
| | | this.countDialogVisible = true; |
| | | this.countLoading = true; |
| | | countByCondition({ taskid: row.taskid }) |
| | | .then((res) => { |
| | | this.countData = this.normalizeCount(res || {}); |
| | | }) |
| | | .catch(() => { |
| | | this.countData = {}; |
| | | this.$modal.msgError("获取任务执行详情失败"); |
| | | }) |
| | | .finally(() => { |
| | | this.countLoading = false; |
| | | }); |
| | | }, |
| | | // 归一键名(聚合 SQL 别名可能带空格) |
| | | normalizeCount(data) { |
| | | const out = {}; |
| | | Object.keys(data || {}).forEach((k) => { |
| | | out[String(k).trim()] = data[k]; |
| | | }); |
| | | return out; |
| | | }, |
| | | // 读取统计值(key 优先,altKey 兜底,缺失显示 0) |
| | | countVal(f) { |
| | | const d = this.countData || {}; |
| | | if (d[f.key] != null && d[f.key] !== "") return d[f.key]; |
| | | 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; |
| | | this.countData = {}; |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | font-size: 24px; |
| | | } |
| | | } |
| | | |
| | | .count-dialog-title { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #67afab; |
| | | } |
| | | .count-detail { |
| | | .count-task-name { |
| | | font-size: 14px; |
| | | color: #67afab; |
| | | font-weight: 600; |
| | | margin-bottom: 16px; |
| | | } |
| | | .count-grid { |
| | | 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; |
| | | border-radius: 4px; |
| | | .count-label { |
| | | font-size: 13px; |
| | | opacity: 0.9; |
| | | } |
| | | .count-value { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | } |
| | | } |
| | | } |
| | | </style> |