| | |
| | | }, |
| | | }, |
| | | created() { |
| | | // 当前机构为丽水市中医院时,建档日期默认最近一个月 |
| | | if (localStorage.getItem("orgname") == "丽水市中医院") { |
| | | this.dateRange = this.getLastMonthRange(); |
| | | this.queryParams.createTimeStart = this.dateRange[0]; |
| | | this.queryParams.createTimeEnd = this.dateRange[1]; |
| | | } |
| | | this.getList(); |
| | | this.gettabList(); |
| | | this.Filterreason = store.getters.Filterreason; |
| | | }, |
| | | methods: { |
| | | /** 获取最近一个月时间范围 */ |
| | | getLastMonthRange() { |
| | | const end = new Date(); |
| | | const start = new Date(); |
| | | start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); |
| | | |
| | | const formatDate = (date) => { |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(date.getDate()).padStart(2, "0"); |
| | | return `${year}-${month}-${day} 00:00:00`; |
| | | }; |
| | | |
| | | const formatEndDate = (date) => { |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(date.getDate()).padStart(2, "0"); |
| | | return `${year}-${month}-${day} 23:59:59`; |
| | | }; |
| | | |
| | | return [formatDate(start), formatEndDate(end)]; |
| | | }, |
| | | /** 查询患者列表 */ |
| | | getList() { |
| | | this.loading = true; |