|
@@ -153,7 +153,7 @@
|
|
that.handleDownload(res.data.MFY,that.formState.type,"马菲羊");
|
|
that.handleDownload(res.data.MFY,that.formState.type,"马菲羊");
|
|
}
|
|
}
|
|
if(res.data.NBSY){
|
|
if(res.data.NBSY){
|
|
- that.handleDownload(res.data.NBSY,that.formState.type,"宁波森宇");
|
|
|
|
|
|
+ that.handleDownload(res.data.NBSY,that.formState.type,"宁波森语");
|
|
}
|
|
}
|
|
|
|
|
|
this.$message.success(res.message);
|
|
this.$message.success(res.message);
|
|
@@ -178,14 +178,22 @@
|
|
this.$message.warning('文件下载失败')
|
|
this.$message.warning('文件下载失败')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ let datePar = "";
|
|
|
|
+ if(type == '年休工资单'){
|
|
|
|
+ datePar = moment(this.formState.yearWith).format('YYYY');
|
|
|
|
+ }else{
|
|
|
|
+ datePar = moment(this.formState.yearWithMonth).format('YYYY-MM');
|
|
|
|
+ }
|
|
|
|
+
|
|
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
|
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
|
- window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), name+type + '.xlsx')
|
|
|
|
|
|
+ window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), name+datePar+type + '.xlsx')
|
|
} else {
|
|
} else {
|
|
let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
|
|
let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
|
|
let link = document.createElement('a')
|
|
let link = document.createElement('a')
|
|
link.style.display = 'none'
|
|
link.style.display = 'none'
|
|
link.href = url
|
|
link.href = url
|
|
- link.setAttribute('download', name+type+'.xlsx')
|
|
|
|
|
|
+ link.setAttribute('download', name+datePar+type+'.xlsx')
|
|
document.body.appendChild(link)
|
|
document.body.appendChild(link)
|
|
link.click()
|
|
link.click()
|
|
document.body.removeChild(link) // 下载完成移除元素
|
|
document.body.removeChild(link) // 下载完成移除元素
|