diff --git a/src/views/enm_coal/report.vue b/src/views/enm_coal/report.vue index 87321185..bfee0086 100644 --- a/src/views/enm_coal/report.vue +++ b/src/views/enm_coal/report.vue @@ -638,18 +638,29 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取小时数据 diff --git a/src/views/enm_coalbase/report.vue b/src/views/enm_coalbase/report.vue index 356e730c..48651ce3 100644 --- a/src/views/enm_coalbase/report.vue +++ b/src/views/enm_coalbase/report.vue @@ -661,18 +661,29 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取小时数据 diff --git a/src/views/enm_cogeneration/report.vue b/src/views/enm_cogeneration/report.vue index 832a3cee..4c68f0a1 100644 --- a/src/views/enm_cogeneration/report.vue +++ b/src/views/enm_cogeneration/report.vue @@ -816,18 +816,29 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取小时数据 diff --git a/src/views/enm_kiln/report.vue b/src/views/enm_kiln/report.vue index 4b9ebbb2..34590649 100644 --- a/src/views/enm_kiln/report.vue +++ b/src/views/enm_kiln/report.vue @@ -902,18 +902,29 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取小时数据 diff --git a/src/views/enm_kilnbase/report.vue b/src/views/enm_kilnbase/report.vue index b85d11aa..325e56d9 100644 --- a/src/views/enm_kilnbase/report.vue +++ b/src/views/enm_kilnbase/report.vue @@ -873,18 +873,29 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取小时数据 diff --git a/src/views/enm_limestone/report.vue b/src/views/enm_limestone/report.vue index 596bd1fe..6dd171f0 100644 --- a/src/views/enm_limestone/report.vue +++ b/src/views/enm_limestone/report.vue @@ -649,13 +649,22 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取天数据 diff --git a/src/views/enm_mill/report.vue b/src/views/enm_mill/report.vue index 9d3c935f..5d21cacb 100644 --- a/src/views/enm_mill/report.vue +++ b/src/views/enm_mill/report.vue @@ -813,20 +813,30 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } - this.searchDate; }, //获取小时数据 getHourData(year, month, days) { diff --git a/src/views/enm_pack/report.vue b/src/views/enm_pack/report.vue index d47879ac..b55f1af7 100644 --- a/src/views/enm_pack/report.vue +++ b/src/views/enm_pack/report.vue @@ -554,15 +554,23 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } - this.searchDate; }, //获取天数据 getDayData(year, month) { diff --git a/src/views/enm_rm/report.vue b/src/views/enm_rm/report.vue index 6cad020f..e946a1bf 100644 --- a/src/views/enm_rm/report.vue +++ b/src/views/enm_rm/report.vue @@ -1010,18 +1010,29 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取小时数据 diff --git a/src/views/enm_rmbase/report.vue b/src/views/enm_rmbase/report.vue index b8fc34c1..b1c23d11 100644 --- a/src/views/enm_rmbase/report.vue +++ b/src/views/enm_rmbase/report.vue @@ -798,18 +798,29 @@ export default { this.searchDate = ""; }, dateChange(val) { + let that = this; console.log(val); - if (this.typeRadio == "day") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - let days = val.split("-")[2]; - this.getHourData(year, month, days); - } else if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "day") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + let days = val.split("-")[2]; + this.getHourData(year, month, days); + } else if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "day") { + that.getHourData(that.year, that.month, that.days); + } else if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取小时数据 diff --git a/src/views/enm_slag/report.vue b/src/views/enm_slag/report.vue index 49efafce..0be86eca 100644 --- a/src/views/enm_slag/report.vue +++ b/src/views/enm_slag/report.vue @@ -574,13 +574,21 @@ export default { dateChange(val) { let that = this; console.log(val); - if (this.typeRadio == "month") { - let year = val.split("-")[0]; - let month = val.split("-")[1]; - month = Number(month); - this.getDayData(year, month); + if (val !== null) { + if (this.typeRadio == "month") { + let year = val.split("-")[0]; + let month = val.split("-")[1]; + month = Number(month); + this.getDayData(year, month); + } else { + this.getMonthData(val); + } } else { - this.getMonthData(val); + if (this.typeRadio == "month") { + this.getDayData(that.year, that.month); + } else { + this.getMonthData(that.year); + } } }, //获取天数据