| | |
| | | <div> |
| | | <el-row class="title"> |
| | | <el-col :span="12" style="padding-left: 20px;text-align: left;">费用统计</el-col> |
| | | <el-col :span="12" style="text-align: right;"> |
| | | <!-- <el-col :span="12" style="text-align: right;"> |
| | | <el-button size="small" type="primary">OA推送</el-button> |
| | | </el-col> |
| | | </el-col> --> |
| | | </el-row> |
| | | </div> |
| | | <div class="search"> |
| | |
| | | } |
| | | ,responseType: "blob"}).then(res => { |
| | | this.outLoading = false |
| | | this.$message.success('导出成功') |
| | | const blob = new Blob([res],{ type: 'application/octet-stream' }); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | let date = JSON.parse(entity.dates) |
| | | link.download = (entity.company?entity.company+' ':'')+date[0]+' - '+date[1]+'费用统计.xlsx'; |
| | | link.click(); |
| | | //将Blob 对象转换成字符串 |
| | | let reader = new FileReader(); |
| | | reader.readAsText(blob, 'utf-8'); |
| | | reader.onload = () => { |
| | | try { |
| | | let result = JSON.parse(reader.result); |
| | | if (result.message) { |
| | | this.$message.error(result.message); |
| | | } else { |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | let date = JSON.parse(entity.dates) |
| | | link.download = (entity.company?entity.company+' ':'')+date[0]+' - '+date[1]+'费用统计.xlsx'; |
| | | link.click(); |
| | | this.$message.success('导出成功') |
| | | } |
| | | } catch (err) { |
| | | console.log(err); |
| | | const url = URL.createObjectURL(blob); |
| | | const link = document.createElement('a'); |
| | | link.href = url; |
| | | let date = JSON.parse(entity.dates) |
| | | link.download = (entity.company?entity.company+' ':'')+date[0]+' - '+date[1]+'费用统计.xlsx'; |
| | | link.click(); |
| | | this.$message.success('导出成功') |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | getTotal(){ |