|
@@ -2954,10 +2954,25 @@
|
|
//下载填报工时占比报表
|
|
//下载填报工时占比报表
|
|
downloadProjectRatio() {
|
|
downloadProjectRatio() {
|
|
this.exportUserRatio = true;
|
|
this.exportUserRatio = true;
|
|
- let now = new Date();
|
|
|
|
- let month = now.getMonth();//默认看上个月的
|
|
|
|
- let monthStr = month<10? ('0'+month): month;
|
|
|
|
- this.ratioYmonth = now.getFullYear()+''+monthStr;
|
|
|
|
|
|
+ // let now = new Date();
|
|
|
|
+ // let month = now.getMonth();//默认看上个月的
|
|
|
|
+ // let monthStr = month<10? ('0'+month): month;
|
|
|
|
+ // this.ratioYmonth = now.getFullYear()+''+monthStr;
|
|
|
|
+ const today = new Date();
|
|
|
|
+ const year = today.getFullYear();
|
|
|
|
+ const month = today.getMonth() + 1;
|
|
|
|
+
|
|
|
|
+ let lastMonthYear, lastMonth;
|
|
|
|
+
|
|
|
|
+ if (month === 1) {
|
|
|
|
+ lastMonthYear = year - 1;
|
|
|
|
+ lastMonth = 12;
|
|
|
|
+ } else {
|
|
|
|
+ lastMonthYear = year;
|
|
|
|
+ lastMonth = month - 1;
|
|
|
|
+ }
|
|
|
|
+ this.ratioYmonth = lastMonthYear+''+(lastMonth < 10 ? '0' + lastMonth : lastMonth)
|
|
|
|
+ console.log('赋值 ==>', this.ratioYmonth)
|
|
},
|
|
},
|
|
confirmDownloadRatio() {
|
|
confirmDownloadRatio() {
|
|
this.startRatioExporting = true;
|
|
this.startRatioExporting = true;
|