|
|
@ -54,8 +54,11 @@ |
|
|
|
</el-form> |
|
|
|
</el-card> |
|
|
|
<el-card class="resi-card-table"> |
|
|
|
<!-- <div class="resi-row-btn">--> |
|
|
|
<!-- <el-button type="warning" size="small" class="diy-button--add" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>--> |
|
|
|
<!-- </div>--> |
|
|
|
<div class="resi-row-btn"> |
|
|
|
<el-button type="warning" size="small" class="diy-button--add" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
|
|
|
<el-button type="warning" size="small" class="diy-button--reset" @click="exportHandle()">{{ $t('export') }}</el-button> |
|
|
|
</div> |
|
|
|
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%"> |
|
|
|
<!--<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>--> |
|
|
@ -145,7 +148,8 @@ export default { |
|
|
|
getDataListURL: '/epmetuser/changeWelfare/page', |
|
|
|
getDataListIsPage: true, |
|
|
|
deleteURL: '/epmetuser/changeWelfare', |
|
|
|
deleteIsBatch: true |
|
|
|
deleteIsBatch: true, |
|
|
|
exportURL: '/epmetuser/changeWelfare/export' |
|
|
|
}, |
|
|
|
dataForm: { |
|
|
|
id: '' |
|
|
@ -178,6 +182,34 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
exportHandle () { |
|
|
|
const url = this.mixinViewModuleOptions.exportURL |
|
|
|
this.$http({ |
|
|
|
method: 'GET', |
|
|
|
url, |
|
|
|
responseType: 'blob', |
|
|
|
params: this.dataForm |
|
|
|
}).then(res => { |
|
|
|
// this.download(res.data, title + '.xls') |
|
|
|
if (res.headers["content-disposition"]) { |
|
|
|
let fileName = window.decodeURI(res.headers["content-disposition"].split(";")[1].split("=")[1]) |
|
|
|
console.log('filename', fileName) |
|
|
|
let blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) |
|
|
|
var url = window.URL.createObjectURL(blob) |
|
|
|
var aLink = document.createElement('a') |
|
|
|
aLink.style.display = 'none' |
|
|
|
aLink.href = url |
|
|
|
aLink.setAttribute('download', fileName) |
|
|
|
document.body.appendChild(aLink) |
|
|
|
aLink.click() |
|
|
|
document.body.removeChild(aLink) //下载完成移除元素 |
|
|
|
window.URL.revokeObjectURL(url) //释放掉blob对象 |
|
|
|
} else this.$message.error('下载失败') |
|
|
|
}).catch(err => { |
|
|
|
console.log('err', err) |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
}, |
|
|
|
resetForm(formName) { |
|
|
|
for(const n in this.dataForm) { |
|
|
|
this.dataForm[n] = '' |
|
|
|