|
|
@ -4,6 +4,7 @@ |
|
|
|
<div class="tab-header webtop"> |
|
|
|
<div>{{ viewTitle }}</div> |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small" @click="toExport()">导出</el-button> |
|
|
|
<el-button type="danger" size="small" @click="openRevoke()">撤回</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -172,6 +173,33 @@ export default { |
|
|
|
}, '*') |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
toExport() { |
|
|
|
if (this.formobj.records.length > 0) { |
|
|
|
const loading = this.$loading({ |
|
|
|
lock: true, |
|
|
|
text: 'Loading', |
|
|
|
spinner: 'el-icon-loading', |
|
|
|
background: 'rgba(0, 0, 0, 0.7)' |
|
|
|
}) |
|
|
|
req.exportExcel({ sid: this.formobj.sid }).then((res) => { |
|
|
|
loading.close() |
|
|
|
const blob = new Blob([res], { |
|
|
|
type: 'application/vnd.ms-excel' |
|
|
|
}) |
|
|
|
const fileName = '本月应还记录' + '.xls' |
|
|
|
const elink = document.createElement('a') |
|
|
|
elink.download = fileName |
|
|
|
elink.style.display = 'nonde' |
|
|
|
elink.href = URL.createObjectURL(blob) |
|
|
|
document.body.appendChild(elink) |
|
|
|
elink.click() |
|
|
|
URL.revokeObjectURL(elink.href) |
|
|
|
document.body.removeChild(elink) |
|
|
|
}).catch(() => { |
|
|
|
loading.close() |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|