From 5b8894b1f6c439b10a93fbf14ecec50c10cc2ef0 Mon Sep 17 00:00:00 2001 From: xuhuajiao <13476289682@163.com> Date: Tue, 19 Jul 2022 10:42:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=85=A5=E5=BA=93=E8=AE=B0=E5=BD=95-?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../outInStorage/outInHistory/index.vue | 41 +++++++------------ 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/src/views/archivesManage/outInStorage/outInHistory/index.vue b/src/views/archivesManage/outInStorage/outInHistory/index.vue index b19440b..9adaf5a 100644 --- a/src/views/archivesManage/outInStorage/outInHistory/index.vue +++ b/src/views/archivesManage/outInStorage/outInHistory/index.vue @@ -74,10 +74,11 @@ import rrOperation from '@crud/RR.operation' import CRUD, { presenter, crud } from '@crud/crud' import pagination from '@crud/Pagination' // import crudOperation from '@crud/CRUD.operation' -// import { exportFile } from '@/utils/index' +import qs from 'qs' +import { exportFile } from '@/utils/index' import detailDialog from '../module/detailDialog.vue' -// import { mapGetters } from 'vuex' -import { exportStorageLogList } from '@/api/archivesManage/outInStorage' +import { mapGetters } from 'vuex' +// import { exportStorageLogList } from '@/api/archivesManage/outInStorage' // exportFile内容 export default { @@ -123,11 +124,11 @@ export default { ] } }, - // computed: { - // ...mapGetters([ - // 'baseApi' - // ]) - // }, + computed: { + ...mapGetters([ + 'baseApi' + ]) + }, created() { this.getData() }, @@ -177,24 +178,12 @@ export default { this.crud.downloadLoading = false }, // 导出接口调用 - async downloadApi() { - const params = this.selections.map(item => { return item.id }) - console.log(params, '======') - await exportStorageLogList({ logIds: params }).then(res => { - this.downloadExcel(res, '出入库记录.xls') - console.log(res, '导出成功') - }) - }, - 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 + downloadApi() { + const ids = this.selections.map(item => { return item.id }) + const params = { + 'logIds': ids + } + exportFile(this.baseApi + '/api/storage/exportStorageLogList?' + qs.stringify(params, { indices: false })) }, // 双击 详情 handleDbClick(row) {