| | |
| | | requiredAdd: [], |
| | | requiredUp: [] |
| | | }, |
| | | addFileVisible:false, |
| | | entityCopy1: {}, |
| | | upIndex1:100, |
| | | weekList:[ |
| | |
| | | }, |
| | | handleOut(){ |
| | | this.outLoading = true |
| | | this.$axios.post(this.$api.auxiliaryOutputWorkingHours.exportWorkingHours,{responseType: 'blob'}).then(res => { |
| | | this.$axios.get(this.$api.auxiliaryOutputWorkingHours.exportWorkingHours,{responseType: "blob"}).then(res => { |
| | | this.outLoading = false |
| | | this.$message.success('导出成功') |
| | | // let fileName="日工时汇总表"; |
| | | // const blob = new Blob([res], { |
| | | // type: 'application/force-download' |
| | | // }) |
| | | // const filename = decodeURI(fileName+'.xlsx') |
| | | // // 创建一个超链接,将文件流赋进去,然后实现这个超链接的单击事件 |
| | | // const elink = document.createElement('a') |
| | | // elink.download = filename |
| | | // elink.style.display = 'none' |
| | | // elink.href = URL.createObjectURL(blob) |
| | | // document.body.appendChild(elink) |
| | | // elink.click() |
| | | // URL.revokeObjectURL(elink.href) // 释放URL 对象 |
| | | // document.body.removeChild(elink) |
| | | const blob = new Blob([res], { |
| | | type: 'application/force-download' |
| | | }) |
| | | const link = document.createElement('a') |
| | | link.href = URL.createObjectURL(blob) |
| | | link.download = decodeURI('日工时汇总表'+'.xlsx') |
| | | document.body.appendChild(link) |
| | | link.click() |
| | | window.setTimeout(function () { |
| | | URL.revokeObjectURL(blob) |
| | | document.body.removeChild(link) |
| | | }, 0) |
| | | const blob = new Blob([res]); |
| | | console.log(blob) |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | link.download = '日工时汇总表.xlsx'; |
| | | link.click(); |
| | | }) |
| | | }, |
| | | } |