Browse Source

出入库记录 跨页多选导出

master
x_ying 3 years ago
parent
commit
c1d8f9850f
  1. 9
      src/api/archivesManage/outInStorage.js
  2. 28
      src/views/archivesManage/outInStorage/outInHistory/index.vue

9
src/api/archivesManage/outInStorage.js

@ -32,4 +32,11 @@ export function grant(params) {
method: 'post'
})
}
export default { initCaseByArchives, isOccupy, collect, grant }
// 出入库记录 导出
export function exportStorageLogList(params) {
return request({
url: 'api/storage/exportStorageLogList' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export default { initCaseByArchives, isOccupy, collect, grant, exportStorageLogList }

28
src/views/archivesManage/outInStorage/outInHistory/index.vue

@ -2,7 +2,7 @@
<div>
<div class="head-container">
<!-- <crudOperation /> -->
<el-button v-permission="permission.download" :loading="crud.downloadLoading" 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="handleExport">导出</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>
@ -34,12 +34,13 @@
height="calc(100vh - 357px)"
:data="crud.data"
:loading="crud.downloadLoading"
:row-key="getRowKey"
:cell-class-name="cell"
@row-click="clickRowHandler"
@row-dblclick="handleDbClick"
@selection-change="selectionChangeHandler"
>
<el-table-column type="selection" width="55" />
<el-table-column type="selection" :reserve-selection="true" width="55" />
<el-table-column type="index" label="序号" align="center" width="80" />
<el-table-column prop="storageType" label="状态" align="center" width="90">
<template slot-scope="scope">
@ -73,8 +74,10 @@ 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 { exportFile } from '@/utils/index'
import detailDialog from '../module/detailDialog.vue'
// import { mapGetters } from 'vuex'
import { initCaseByArchives } from '@/api/archivesManage/outInStorage'
// exportFile
export default {
@ -97,7 +100,7 @@ export default {
data() {
return {
permission: {
download: ['admin', 'permission:download']
download: ['admin', 'outInHistory:download']
},
msgVisible: false,
selections: [],
@ -120,6 +123,11 @@ export default {
]
}
},
// computed: {
// ...mapGetters([
// 'baseApi'
// ])
// },
created() {
this.getData()
},
@ -143,9 +151,12 @@ export default {
clickRowHandler(row) {
this.$refs.table.toggleRowSelection(row) //
},
getRowKey(row) {
return row.id
},
selectionChangeHandler(val) {
this.selections = val
// console.log(val, '-----')
console.log(this.selections, '-----')
},
//
cell({ row, columnIndex }) {
@ -162,7 +173,12 @@ export default {
//
handleExport() {
this.crud.downloadLoading = true
exportFile(this.baseApi + '/api/storage/exportStorageLogList')
// exportFile(this.baseApi + '/api/storage/exportStorageLogList')
// console.log(this.baseApi)
const params = this.selections.map(item => { return item.id })
initCaseByArchives(params).then(res => {
console.log(res, '导出成功')
})
this.crud.downloadLoading = false
},
//

Loading…
Cancel
Save