|
@@ -12,6 +12,7 @@
|
|
|
:style="{ height: tableHeight+'px' }"
|
|
|
:className="'van-calendar__top-info'"
|
|
|
@select="selectDate"
|
|
|
+ @month-show="onMonthShow"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -107,32 +108,51 @@
|
|
|
this.showPicker = false;
|
|
|
this.getReport();
|
|
|
},
|
|
|
-
|
|
|
- // 获取日报
|
|
|
- getReport() {
|
|
|
+ onMonthShow(data) {
|
|
|
this.hasWaiting = false;
|
|
|
const toast = this.$toast.loading({
|
|
|
forbidClick: true,
|
|
|
duration: 0
|
|
|
});
|
|
|
- var startDate = new Date();
|
|
|
- startDate.setMonth(startDate.getMonth() -2);
|
|
|
- this.$axios.post("/report/getReportFillStatus", {startDate: this.format(startDate), endDate:this.format(this.maxDate), userId: this.user.id})
|
|
|
+ var startDate = data.date;
|
|
|
+ var endDate = new Date(startDate);
|
|
|
+ endDate.setMonth(endDate.getMonth() + 1, 0);
|
|
|
+ this.$axios.post("/report/getReportFillStatus", {startDate: this.format(startDate), endDate:this.format(endDate), userId: this.user.id})
|
|
|
.then(res => {
|
|
|
if(res.code == "ok") {
|
|
|
this.$toast.clear();
|
|
|
- this.report = res.data;
|
|
|
-
|
|
|
+ this.report = this.report.concat(res.data);
|
|
|
} else {
|
|
|
this.$toast.clear();
|
|
|
this.$toast.fail('获取失败');
|
|
|
}
|
|
|
}).catch(err=> {this.$toast.clear();});
|
|
|
},
|
|
|
+ // 获取日报
|
|
|
+ // getReport() {
|
|
|
+ // this.hasWaiting = false;
|
|
|
+ // const toast = this.$toast.loading({
|
|
|
+ // forbidClick: true,
|
|
|
+ // duration: 0
|
|
|
+ // });
|
|
|
+ // var startDate = new Date();
|
|
|
+ // startDate.setMonth(startDate.getMonth() -1);
|
|
|
+ // this.$axios.post("/report/getReportFillStatus", {startDate: this.format(startDate), endDate:this.format(this.maxDate), userId: this.user.id})
|
|
|
+ // .then(res => {
|
|
|
+ // if(res.code == "ok") {
|
|
|
+ // this.$toast.clear();
|
|
|
+ // this.report = res.data;
|
|
|
+
|
|
|
+ // } else {
|
|
|
+ // this.$toast.clear();
|
|
|
+ // this.$toast.fail('获取失败');
|
|
|
+ // }
|
|
|
+ // }).catch(err=> {this.$toast.clear();});
|
|
|
+ // },
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
|
- this.getReport();
|
|
|
+ // this.getReport();
|
|
|
}
|
|
|
};
|
|
|
</script>
|