|
|
@ -2,7 +2,7 @@ |
|
|
|
<div> |
|
|
|
<div class="head-container"> |
|
|
|
<!-- <crudOperation /> --> |
|
|
|
<el-button v-permission="permission.download" :loading="crud.downloadLoading" :disabled="!selections.length" size="mini" icon="el-icon-download" @click="handleExport">导出</el-button> |
|
|
|
<el-button v-permission="permission.download" :loading="crud.downloadLoading" :disabled="!selections.length" size="mini" icon="el-icon-download" @click="handleDownload">导出</el-button> |
|
|
|
<el-select v-model="storageType" class="filter-item" style="width: 100px; height: 30px;margin:0 0 0 10px" @change="crud.toQuery"> |
|
|
|
<el-option v-for="item in storageTypeOptions" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
</el-select> |
|
|
@ -77,7 +77,7 @@ import pagination from '@crud/Pagination' |
|
|
|
// import { exportFile } from '@/utils/index' |
|
|
|
import detailDialog from '../module/detailDialog.vue' |
|
|
|
// import { mapGetters } from 'vuex' |
|
|
|
import { initCaseByArchives } from '@/api/archivesManage/outInStorage' |
|
|
|
import { exportStorageLogList } from '@/api/archivesManage/outInStorage' |
|
|
|
|
|
|
|
// exportFile内容 |
|
|
|
export default { |
|
|
@ -171,15 +171,30 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
// 导出 |
|
|
|
handleExport() { |
|
|
|
handleDownload() { |
|
|
|
this.crud.downloadLoading = true |
|
|
|
// exportFile(this.baseApi + '/api/storage/exportStorageLogList') |
|
|
|
// console.log(this.baseApi) |
|
|
|
this.downloadApi() |
|
|
|
this.crud.downloadLoading = false |
|
|
|
}, |
|
|
|
// 导出接口调用 |
|
|
|
async downloadApi() { |
|
|
|
const params = this.selections.map(item => { return item.id }) |
|
|
|
initCaseByArchives(params).then(res => { |
|
|
|
console.log(params, '======') |
|
|
|
await exportStorageLogList({ logIds: params }).then(res => { |
|
|
|
this.downloadExcel(res, '出入库记录.xls') |
|
|
|
console.log(res, '导出成功') |
|
|
|
}) |
|
|
|
this.crud.downloadLoading = false |
|
|
|
}, |
|
|
|
downloadExcel(res, fileName) { |
|
|
|
const content = res |
|
|
|
const blob = new Blob([content]) |
|
|
|
const elink = document.createElement('a') |
|
|
|
elink.style.display = 'none' |
|
|
|
elink.download = fileName |
|
|
|
elink.href = URL.createObjectURL(blob) |
|
|
|
document.body.appendChild(elink) |
|
|
|
elink.click() |
|
|
|
URL.revokeObjectURL(elink.href) // 释放URL |
|
|
|
}, |
|
|
|
// 双击 详情 |
|
|
|
handleDbClick(row) { |
|
|
|