福利收货地址导出

This commit is contained in:
=
2025-12-09 13:56:33 +08:00
parent 075af05eb6
commit b28a3a81c9
5 changed files with 202 additions and 30 deletions
@@ -130,6 +130,9 @@ layout("/layouts/platform.html"){
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="福利名单">
<el-button :disabled="!pageForm.projectId" @click="exportAddress" icon="el-icon-download" size="small" type="primary">
导出收货地址
</el-button>
<el-button :disabled="!pageForm.projectId" @click="openExport" icon="el-icon-download" size="small" type="primary">
导出名单
</el-button>
@@ -145,6 +148,38 @@ layout("/layouts/platform.html"){
>
添加人员
</el-button>
<el-popover
placement="bottom"
trigger="click"
width="200">
<div style="padding:4px 0;border-bottom:1px solid #eee;">
<el-button size="mini" @click="checkAll">全选</el-button>
<el-button size="mini" @click="invertCheck">反选</el-button>
</div>
<div style="max-height:40vh;overflow-y:auto;padding:6px 0;">
<el-checkbox-group v-model="checkedFields">
<el-checkbox
v-for="f in tableColumns"
:key="f.prop"
:label="f.prop"
style="display:block;margin:6px 0;">
{{ f.label }}
</el-checkbox>
</el-checkbox-group>
</div>
<el-button
slot="reference"
type="text"
icon="el-icon-s-operation"
size="small"
style="margin-left:12px;">
列设置
</el-button>
</el-popover>
</table-tool>
<el-table
@@ -159,15 +194,16 @@ layout("/layouts/platform.html"){
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
<el-table-column
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
v-if="checkedFields.includes(column.prop)"
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='isChoose'">
<span class="text-primary" v-if="row.isChoose">已选择</span>
@@ -241,8 +277,14 @@ layout("/layouts/platform.html"){
return null
}
return null
},
showColumns() {
return this.tableColumns.filter(c => this.checkedFields.includes(c.prop));
}
},
mounted() {
this.checkedFields = this.tableColumns.filter(c => c.checked !== 0).map(c => c.prop);
},
components: {
add_welfare_list_by_select: ADD_WELFARE_LIST_BY_SELECT,
"file-import": httpVueLoader("/components/plugins/sysImport/index.vue?v=" + new Date().getTime()),
@@ -251,6 +293,7 @@ layout("/layouts/platform.html"){
},
data() {
return {
checkedFields: [],
pageForm: {
searchName: "username",
year: new Date().getFullYear().toString()
@@ -282,13 +325,26 @@ layout("/layouts/platform.html"){
}
},
methods: {
// 导出收货地址
exportAddress() {
this.$downLoad("/platform/welfare/list/mange/exportAddress", this.pageForm)
},
// 导出名单
openExport() {
this.$downLoad("/platform/welfare/list/mange/exportXlsx", {
pageForm: JSON.stringify(this.pageForm)
const pageForm = clone(this.pageForm)
const data = this.tableColumns.filter(item => this.checkedFields.includes(item.prop)).map(item => {
return {prop: item.prop, label: item.label}
})
pageForm.columns = JSON.stringify(data)
this.$downLoad("/platform/welfare/list/mange/exportXlsx", pageForm)
},
checkAll() {
this.checkedFields = this.tableColumns.map(c => c.prop);
},
invertCheck() {
const all = this.tableColumns.map(c => c.prop);
this.checkedFields = all.filter(p => !this.checkedFields.includes(p));
},
successImport() {
this.doSearch()
this.importDialog = false