| | |
| | | { value: 1, label: "被领取" }, |
| | | { value: 2, label: "待发送" }, |
| | | { value: 3, label: "已发送" }, |
| | | { value: 5, label: "发送失败" }, |
| | | { value: 7, label: "超时" }, |
| | | ], |
| | | }, |
| | | { |
| | | value: 40, // 一级:发送失败(单独列出,方便直接筛) |
| | | label: "发送失败", |
| | | }, |
| | | { |
| | | value: 20, // 一级:已完成 |
| | |
| | | }, |
| | | { |
| | | name: "待随访", |
| | | value: 0, |
| | | }, |
| | | { |
| | | name: "发送失败", |
| | | value: 0, |
| | | }, |
| | | { |
| | |
| | | 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) => { |
| | |
| | | }, |
| | | /** |
| | | * 右下角「待处理随访任务」卡片点击数字跳转过来: |
| | | * 按出院年月 + 待随访(sendstate 1/2/3/5/7)+ 出院满 7 天 过滤,口径与卡片一致 |
| | | * 按出院年月 + 待随访(sendstate 1/2/3/7)+ 出院满 7 天 过滤,口径与卡片一致 |
| | | * @returns {boolean} 是否已按卡片条件发起查询 |
| | | */ |
| | | applyPendingTaskQuery() { |
| | |
| | | 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; |
| | |
| | | // 卡片统计的是全部待随访任务(不区分首轮/复诊),列表这里同步放开 |
| | | 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; |
| | | }, |
| | | /** |
| | | * 卡片口径的月份结束日: |
| | | * 当月只统计出院满 7 天的,所以取「今天 - 7 天」;历史月份取当月最后一天 |
| | | * 该月最后一天(yyyy-MM-dd),只用于「当月还没有满 7 天任务」时展示正常月份区间 |
| | | */ |
| | | 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; |
| | | }, |
| | | /** |
| | | * 卡片口径的月份结束日:卡片只统计「出院满 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; |
| | |
| | | break; |
| | | } |
| | | this.topqueryParams.sendstate = null; |
| | | // 一级「发送失败」:按状态 5 直接过滤(不等同于待随访) |
| | | if (value === 40) { |
| | | this.topqueryParams.sendstateView = null; |
| | | this.topqueryParams.sendstate = 5; |
| | | } |
| | | } else { |
| | | // 选中了二级(具体状态) |
| | | this.topqueryParams.sendstateView = null; |
| | |
| | | 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) { |
| | |
| | | query.sendstateView = 3; |
| | | } else if (name === "待随访") { |
| | | query.sendstateView = 1; |
| | | } else if (name === "发送失败") { |
| | | query.sendstates = [5]; |
| | | } else if (name === "已完成") { |
| | | query.sendstateView = 2; |
| | | } else if (name === "需随访") { |