| | |
| | | label: "正常", |
| | | }, |
| | | ], |
| | | orgname: "", |
| | | |
| | | url: "http://9.208.2.190:8090/smartor/serviceExternal/query360PatInfo", |
| | | postData: { |
| | | XiaoXiTou: { |
| | |
| | | rules: {}, |
| | | }; |
| | | }, |
| | | watch: {}, |
| | | watch: { |
| | | // 右下角「待处理随访任务」卡片再次点击(当前已在本页) |
| | | "$route.query": { |
| | | handler(newQuery) { |
| | | if ( |
| | | newQuery?.month && |
| | | newQuery?.fromPendingTask === "1" && |
| | | this.taskQueryReady |
| | | ) { |
| | | this.applyPendingTaskQuery(); |
| | | } |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | }, |
| | | created() { |
| | | this.serviceState = store.getters.serviceState; |
| | | this.checkboxlist = store.getters.checkboxlist; |
| | | this.orgname = localStorage.getItem("orgname"); |
| | | this.errtype = this.$route.query.errtype; |
| | | this.leavehospitaldistrictcode = |
| | | this.$route.query.leavehospitaldistrictcode; |
| | |
| | | value: dept.districtCode, |
| | | }; |
| | | }); |
| | | if (this.errtype) { |
| | | if (this.applyPendingTaskQuery()) { |
| | | // 右下角「待处理随访任务」卡片跳转:已按年月 + 待随访条件查询 |
| | | } else if (this.errtype) { |
| | | this.toleadExport(2); |
| | | } else { |
| | | this.getList(1); |
| | |
| | | this.getConfigKey("sys.user.initPassword").then((response) => { |
| | | this.initPassword = response.msg; |
| | | }); |
| | | // created 初始化完成,之后路由 query 变化才按卡片条件重新查询 |
| | | this.taskQueryReady = true; |
| | | }, |
| | | activated() { |
| | | if (this.applyPendingTaskQuery()) { |
| | | return; |
| | | } |
| | | this.getList(1); |
| | | }, |
| | | methods: { |
| | |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** |
| | | * 右下角「待处理随访任务」卡片点击数字跳转过来: |
| | | * 按出院年月 + 待随访(sendstate 1/2/3/7)+ 出院满 7 天 过滤,口径与卡片一致 |
| | | * @returns {boolean} 是否已按卡片条件发起查询 |
| | | */ |
| | | applyPendingTaskQuery() { |
| | | const query = this.$route.query || {}; |
| | | if (!query.month || query.fromPendingTask !== "1") { |
| | | return false; |
| | | } |
| | | // 页面被 keep-alive 复用时会重复触发 activated,同一次点击只处理一次 |
| | | if (this.pendingTaskToken && this.pendingTaskToken === query._t) { |
| | | return false; |
| | | } |
| | | this.pendingTaskToken = query._t; |
| | | |
| | | const month = String(query.month); |
| | | const serviceType = Number(query.serviceType) === 3 ? 3 : 2; |
| | | this.errtype = undefined; |
| | | const start = month + "-01"; |
| | | // 卡片统计的是「出院满 7 天」的任务,截止日 = min(该月最后一天, 今天-7 天) |
| | | const end = this.pendingTaskMonthEnd(month); |
| | | this.dateRange = [start, end]; |
| | | this.topqueryParams.serviceType = serviceType; |
| | | this.topqueryParams.sendstateView = 1; |
| | | this.topqueryParams.sendstate = null; |
| | | // 卡片统计的是全部待随访任务(不区分首轮/复诊),列表这里同步放开 |
| | | 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; |
| | | }, |
| | | /** |
| | | * 该月最后一天(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(); |
| | | // 出院满 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; |
| | | }, |
| | | /** 搜索按钮操作 */ |
| | | handleQuery(refresh) { |
| | | if (this.topqueryParams.searchscope == 3) { |