Browse Source

出入库记录-导出

master
xuhuajiao 3 years ago
parent
commit
5b8894b1f6
  1. 41
      src/views/archivesManage/outInStorage/outInHistory/index.vue

41
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 CRUD, { presenter, crud } from '@crud/crud'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
// import crudOperation from '@crud/CRUD.operation' // 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 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 // exportFile
export default { export default {
@ -123,11 +124,11 @@ export default {
] ]
} }
}, },
// computed: {
// ...mapGetters([
// 'baseApi'
// ])
// },
computed: {
...mapGetters([
'baseApi'
])
},
created() { created() {
this.getData() this.getData()
}, },
@ -177,24 +178,12 @@ export default {
this.crud.downloadLoading = false 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) { handleDbClick(row) {

Loading…
Cancel
Save