Browse Source

modify code

tags/v1.21.12.1
Gitea 3 years ago
parent
commit
da490398df
1 changed files with 25 additions and 10 deletions
  1. +25
    -10
      web_src/js/components/ProAnalysis.vue

+ 25
- 10
web_src/js/components/ProAnalysis.vue View File

@@ -30,7 +30,8 @@
<span style="float:right; margin-right: 20px;">
<div style="display:inline-block;margin-left: 20px; ">
<i class="el-icon-download"></i>
<span ><a id = "download_file" :href= "'../api/v1/projectboard/downloadAll/?type='+this.params.type+'&beginTime='+this.params.beginTime+'&endTime='+this.params.endTime+'&q='+this.params.q+'&sort=openi'" >下载报告</a> </span>
<span ><a id = "download_file" :href= "'../api/v1/projectboard/downloadAll/?type='+this.params.type+'&beginTime='+this.params.beginTime+'&endTime='+this.params.endTime+'&q='+this.params.q+'&sort=openi'" @click="isExport();return false;" >下载报告</a> </span>
<!-- <span ><a id = "download_file" :href= "downLoadSrc" @click="jugeExport();" target="_black">下载报告</a> </span> -->
</div>


@@ -361,6 +362,7 @@
search:'',
dynamic:7,
download_a:"",
downLoadSrc:'',

//单个项目参数
@@ -389,6 +391,16 @@
// download_file(){
// this.params.type='all'
// },
jugeExport(){
if(typeof this.tableData=="undefined" || this.tableData=="null" || this.tableData==""){
// let self=this;
return
}
else{
// let self=this;
this.downLoadSrc= '../api/v1/projectboard/downloadAll/?type='+this.params.type+'&beginTime='+this.params.beginTime+'&endTime='+this.params.endTime+'&q='+this.params.q+'&sort=openi';
}
},
exportData(){
// this.getOneProList(this.pro_id,'all',true,7)
@@ -410,11 +422,7 @@
var yesterday = this.saveFormatDate(tmp.getFullYear(),tmp.getMonth()+1,tmp.getDate());
var yesterday_tmp = this.formatDate(tmp.getFullYear(),tmp.getMonth()+1,tmp.getDate())

let lastMonthDate = new Date(); // 上月日期
lastMonthDate.setDate(1);
lastMonthDate.setMonth(lastMonthDate.getMonth()-1);
let lastYear = lastMonthDate.getYear();
let lastMonth = lastMonthDate.getMonth();
var startDate=''
var endDate=''
var saveFileName = ''
@@ -462,15 +470,22 @@
break
}
case "last_month":{
startDate=this.formatDate(nowYear, lastMonth, 1);

let lastMonthDate = new Date(); // 上月日期
lastMonthDate.setDate(1);
lastMonthDate.setMonth(lastMonthDate.getMonth()-1);
let lastYear = lastMonthDate.getFullYear();
let lastMonth = lastMonthDate.getMonth();

startDate=this.formatDate(lastYear, lastMonth+1, 1);
startDate = this.comparedate(startDate,this.recordBeginTime)


var monthStartDate = new Date(nowYear, lastMonth, 1);
var monthEndDate = new Date(nowYear, nowMonth, 1);
var monthStartDate = new Date(lastYear, lastMonth, 1);
var monthEndDate = new Date(lastYear, lastMonth+1, 1);
var days = (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24)

endDate=this.saveFormatDate(nowYear, nowMonth, days);
endDate=this.saveFormatDate(lastYear, lastMonth+1, days); //月份从0开始,所以+1保存月份
saveFileName = this.pro_name+"_"+startDate+'_'+ endDate
break
}


Loading…
Cancel
Save