Files
UNION_HUTB/target/classes/views/platform/diseaseaid/aidfund/Manage.html
T
2026-09-09 09:14:28 +08:00

389 lines
16 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<style>
</style>
<div id="app" class="platform" v-cloak>
<guava ref="guava" padding="0 5%">
<template>
<search v-model="pageForm" @search="doSearch">
</search>
<el-card shadow="never" class="mt10">
<table-tool label="基金会员" :app="this">
<template #func>
<!--#if(@shiro.hasPermission('aid.fund.manage.backup')){#-->
<el-dropdown @command="dropdownCommand">
<el-button type="primary" size="small" plain>
备份会员名单<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="year in yearOptions" v-key="year"
:command="{action:backupMember,value:year}">
{{year}}年
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!--#}#-->
<!--#if(@shiro.hasPermission('aid.fund.manage.importUserStateChangeRecords')){#-->
<el-button type="primary" plain icon="el-icon-upload2" size="small" @click="openImport"
class="ml5">
导入会员退休去世记录
</el-button>
<!--#}#-->
<!--#if(@shiro.hasPermission('aid.fund.manage.exportNewMember')){#-->
<el-button type="primary" plain icon="el-icon-download" size="small" @click="exportNewMember">
导出{{new
Date().getFullYear()}}年新会员名单
</el-button>
<!--#}#-->
<!--#if(@shiro.hasPermission('aid.fund.manage.createPayList')){#-->
<el-button :loading="createPayListLoading" type="primary" plain icon="el-icon-tickets"
size="small" @click="createPayList">
生成{{new
Date().getFullYear()+1}}年缴费名单
</el-button>
<!--#}#-->
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder" :size="tableSize"
v-loading="tableLoading" ref="table" class="vi-table">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:sortable="column.sortable"
:label="column.label"
:prop="column.prop" :width="column.width" min-width="100px">
<template v-if="column.prop==='aidFundMemberJoinTime'" scope="{row:{aidFundMemberJoinTime}}">
{{aidFundMemberJoinTime|date}}
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作" fixed="right">
<template scope="{row}">
<el-dropdown @command="dropdownCommand">
<el-button plain size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{action:view,value:row}">
查看
</el-dropdown-item>
<!--#if(@shiro.hasPermission('aid.fund.manage.change')){#-->
<el-dropdown-item :command="{action:memberChange,value:row}">
变更
</el-dropdown-item>
<!--#}#-->
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit_func>
<!-- <el-button type="primary" @click="">提交</el-button>-->
</template>
<template #edit>
</template>
<template #view>
<el-tabs v-model="activeName" class="aidPay_view">
<el-tab-pane label="用户信息" :name="1">
<info ref="info" :userid="info.id"></info>
</el-tab-pane>
<el-tab-pane label="变更记录" :name="2">
<app_record :userid="info.id" ref="app_record"></app_record>
</el-tab-pane>
<el-tab-pane label="缴费记录" :name="3">
<pay_record :userid="info.id" ref="pay_record"></pay_record>
</el-tab-pane>
</el-tabs>
</template>
</guava>
<el-dialog
title="会员变更"
:visible.sync="changeVisible"
width="40%">
<vi-title title="变更信息"></vi-title>
<el-form :model="formData" ref="form" :rules="formRules"
label-width="100px">
<el-form-item label="变更类型" prop="changeType">
<el-select v-model="formData.changeType" placeholder="请选择" style="width: 100%"
@change="changeTypeChange">
<el-option
v-for="item in changeTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<div v-if="formData.changeType==2">
<el-form-item label="变更单位" prop="changeUnit">
<el-select v-model="formData.changeUnit" @change="unitChange" placeholder="请选择" filterable
style="width: 100%">
<el-option
v-for="item in units"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属工会" prop="unionname">
<el-input
placeholder=""
v-model="formData.unionname"
disabled>
</el-input>
</el-form-item>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="changeVisible = false" :disabled="changeSubmitLoading">取 消</el-button>
<el-button type="primary" @click="memberChangeHandle" :loading="changeSubmitLoading">提 交</el-button>
</span>
</el-dialog>
<el-dialog
title="退休去世记录导入"
:visible.sync="importVisible"
:close-on-click-modal="false"
width="50%"
>
<el-timeline>
<el-timeline-item timestamp="下载模板" placement="top">
<el-card>
<el-button size="medium" type="" style="width: 200px"
@click="location.href='/platform/basics/downloadTemplate?filePath=diseaseaid/aidfund/UserStateChangeTemplate.xls&fileName=会员退休去世记录.xls'"
icon="el-icon-download">下载模板
</el-button>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="上传文件" placement="top">
<el-card>
<el-upload
name="file"
ref="upload"
:on-remove="(file, fileList) => {
importData.fileList = fileHandleRemove(file, fileList)
}"
:on-change="(file, fileList) => {
importData.fileList = fileHandleChange(file, fileList,{type:['xls','xlsx']})
}"
:auto-upload="false"
:limit="1"
:file-list="importData.fileList">
<el-button size="medium" type="" icon="el-icon-upload" style="width: 200px">选择文件
</el-button>
</el-upload>
</el-card>
</el-timeline-item>
</el-timeline>
<span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false" :disabled="importLoading">取 消</el-button>
<el-button type="primary" @click="doImport" :loading="importLoading">确定</el-button>
</span>
</el-dialog>
</div>
<script>
<!--#include("/platform/diseaseaid/common/AidFund.js"){}#-->
const getYearOptions = () => {
let year = new Date().getFullYear();
let arr = []
for (let i = year; i >= year - 3; i--) {
arr.push(i)
}
return arr
}
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data: function () {
return {
yearOptions: getYearOptions(),
createPayListLoading: false,
changeSubmitLoading: false,
units: [],
info: {},
activeName: 1,
importData: {},
importLoading: false,
importVisible: false,
changeVisible: false,
pageForm: {
searchName: 'username',
aidFundMemberJoinTime: new Date().getFullYear() + "",
},
tableColumns: commonColumns,
changeTypeOptions: [
{label: '单位变更', value: 2},
{label: '自愿退出', value: 1},
{label: '退休', value: 3},
{label: '去世', value: 4},
],
formRules: {
changeType: [{required: true, message: '请选择变更类型', trigger: ['blur', 'change']}],
changeUnit: [{required: true, message: '请选择变更单位', trigger: ['blur', 'change']}],
}
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue?v=1.0.0'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
'user-select': httpVueLoader('/components/plugins/UserTableSelect.vue?v=1.0.0'),
'search': httpVueLoader('/components/diseaseaid/aidfund/Search.vue?v=1.0.0'),
'info': httpVueLoader('/components/diseaseaid/aidfund/info.vue'),
'app_record': httpVueLoader('/components/diseaseaid/aidfund/AppRecord.vue'),
'pay_record': httpVueLoader('/components/diseaseaid/aidfund/PayRecord.vue'),
},
methods: {
backupMember(year) {
this.$confirm('您确定要备份' + year + '年的数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
this.doBackupLoading = true
const resp = await $.post("/platform/aidfund/historyledger/backupMember", {year})
requestLaterMsgFun(this, resp, () => {
this.pageData()
}, null, () => {
this.doBackupLoading = false
})
})
},
changeTypeChange(val) {
const userState = this.changeTypeOptions.find(v => v.value === val)
if (userState) this.formData.userState = userState.label
},
createPayList() {
this.$confirm('请确认是否生成缴费名单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
this.createPayListLoading = true
const response = await $.post(loc() + "/createPayList")
AssertResponseMessage({
app: this,
response,
final: () => {
this.createPayListLoading = false
}
})
});
},
async memberChangeHandle() {
const v = await this.$refs["form"].validate()
if (!v) return
this.changeSubmitLoading = true
const response = await $.post(loc() + '/memberChange', this.formData)
AssertResponseMessage({
app: this,
response,
success: () => {
this.changeVisible = false
this.pageData()
},
final: () => {
this.changeSubmitLoading = false
}
})
},
unitChange(id) {
const unit = this.units.find(v => v.id === id)
if (unit) this.$set(this.formData, "unionname", unit.unionname)
},
memberChange({id}) {
this.formData = {id}
this.changeVisible = true
if (this.$refs['form']) {
this.$refs['form'].resetFields()
}
},
exportNewMember() {
location.href = loc() + '/exportNewMember'
},
view(row) {
this.activeName = 1
this.info = row
this.$refs.guava.view()
},
openImport() {
this.importData = {
fileList: []
}
this.importVisible = true;
},
doImport() {
if (!this.importData.fileList.length) {
this.notifyWarning("请选择文件!")
return
}
const data = new FormData();
this.importData.fileList.forEach((val) => {
data.append("file", val.raw, val.raw.name);
});
this.importLoading = true
$.ajax({
url: loc() + "/importUserStateChangeRecords?year=" + this.importData.year,
type: "post",
data: data,
processData: false,
contentType: false,
success: (data) => {
if (!data.code) {
this.notifySuccess("导入成功!");
this.pageData();
this.importVisible = false
} else {
this.notifyWarning("导入失败")
}
this.importLoading = false
},
error: (data) => {
this.notifyWarning("导入失败")
this.importLoading = false
}
});
},
},
async created() {
this.pageData();
this.units = await getUnits()
}
})
</script>
<!--#
}
#-->