| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form |
| | | class="opo-query-form" |
| | | :model="queryParams" |
| | | ref="queryForm" |
| | | :inline="true" |
| | |
| | | this.queryParams.pabegtime = this.selecttime[0]; |
| | | this.queryParams.paendtime = this.selecttime[1]; |
| | | // if (this.queryParams.paendtime == this.queryParams.pabegtime) { |
| | | let num = Number(this.queryParams.paendtime.slice(5, 7)); |
| | | if (num < 9) { |
| | | let mon = Number(this.queryParams.paendtime.slice(6, 7)); |
| | | this.queryParams.paendtime = |
| | | this.queryParams.paendtime.slice(0, 5) + |
| | | "0" + |
| | | (mon + 1) + |
| | | "-" + |
| | | "01" + |
| | | " " + |
| | | "00" + |
| | | ":" + |
| | | "00" + |
| | | ":" + |
| | | "00"; |
| | | } |
| | | // this.queryParams.paendtime=this.queryParams.paendtime.slice(0,5)年 |
| | | else if (num >= 10) { |
| | | this.queryParams.paendtime = |
| | | this.queryParams.paendtime.slice(0, 5) + |
| | | (num + 1) + |
| | | "-" + |
| | | "01" + |
| | | " " + |
| | | "00" + |
| | | ":" + |
| | | "00" + |
| | | ":" + |
| | | "00"; |
| | | } else { |
| | | this.queryParams.paendtime = |
| | | this.queryParams.paendtime.slice(0, 5) + |
| | | "10" + |
| | | "-" + |
| | | "01" + |
| | | " " + |
| | | "00" + |
| | | ":" + |
| | | "00" + |
| | | ":" + |
| | | "00"; |
| | | } |
| | | // 结束时间取"所选结束月的次月 1 号",以包含整个结束月。 |
| | | // 原实现把月份 +1 后直接拼字符串,12 月会得到 13 月(2026-13-01), |
| | | // MySQL 报 Incorrect datetime value,存储过程直接 500。 |
| | | this.queryParams.paendtime = this.$moment(this.queryParams.paendtime) |
| | | .startOf("month") |
| | | .add(1, "month") |
| | | .format("YYYY-MM") |
| | | .concat("-01 00:00:00"); |
| | | this.queryParams.pabegtime = |
| | | this.queryParams.pabegtime + " " + "00" + ":" + "00" + ":" + "00"; |
| | | // } |