This commit is contained in:
2026-02-02 10:30:15 +08:00
parent 1ab7c6c998
commit e76d8123cb
9 changed files with 362 additions and 34 deletions
@@ -50,7 +50,7 @@ const AID_FUND_INFO = {
</el-table>
</el-tab-pane>
<el-tab-pane label="缴费记录" name="three">
<pay_record ref="payRecord"></pay_record>
<pay_record ref="payRecord" :max-height="650"></pay_record>
</el-tab-pane>
</el-tabs>
@@ -2,9 +2,9 @@ const PAY_RECORD = {
template: /*language=HTML*/
`
<div>
<el-table :data="payRecordList" row-key="id" style="width: 100%"max-height="300">
<el-table-column label="序号"
type="index"></el-table-column>
<el-table :data="payRecordList" row-key="id" style="width: 100%" :max-height="maxHeight" show-summary
:summary-method="getSummaries">
<el-table-column label="序号" type="index" width="80"></el-table-column>
<el-table-column label="缴费年份" prop="year"></el-table-column>
@@ -14,7 +14,7 @@ const PAY_RECORD = {
</template>
</el-table-column>
<el-table-column label="是否扣款"prop="isPayed">
<el-table-column label="是否扣款" prop="isPayed">
<template scope="{row:{isPayed}}">
<el-tag v-if="isPayed" type="success">已扣款</el-tag>
<el-tag v-else-if="!isPayed" type="info">未扣款</el-tag>
@@ -23,14 +23,49 @@ const PAY_RECORD = {
</el-table>
</div>
`,
props: {
maxHeight: {
type: String,
default: '300'
}
},
data() {
return {
payRecordList: [],
}
},
methods: {
getSummaries(param) {
const {columns, data} = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if ([1, 3].includes(index)) {
sums[index] = '';
} else {
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += ' 元';
} else {
sums[index] = '';
}
}
});
return sums;
},
getUserPayRecordList(userId) {
this.$axios.post('/platform/medicalMutualAid/aidFund/apply/getUserPayRecordList',{userId}).then(resp => {
this.$axios.post('/platform/medicalMutualAid/aidFund/apply/getUserPayRecordList', {userId}).then(resp => {
if (resp.code === 0) {
this.payRecordList = resp.data
}
@@ -50,6 +50,12 @@ layout("/layouts/platform.html"){
批量设置为退会
</el-button>
<el-button @click="openBatchChangeType" size="small"
type="primary"
v-if="$auth.hasPermission('medicalMutualAid.aidFund.manage.createPayList')">
批量变更
</el-button>
<el-button @click="exportNewMember" icon="el-icon-download" size="small" type="primary"
v-if="$auth.hasPermission('medicalMutualAid.aidFund.manage.exportNewMember')" class="mr10">
导出{{new
@@ -168,6 +174,39 @@ layout("/layouts/platform.html"){
</span>
</el-dialog>
<el-dialog
:visible.sync="batchChangeTypeVisible"
title="会员批量变更"
width="40%">
<el-form :model="formData" :rules="formRules" label-width="100px"
ref="form">
<el-form-item>
<el-table :data="changeTableData" ref="changeTable" row-key="id" style="width: 100%" max-height="300">
<el-table-column label="序号" type="index" width="60px"></el-table-column>
<el-table-column label="工号" prop="loginname"></el-table-column>
<el-table-column label="姓名" prop="username"></el-table-column>
<el-table-column label="操作" fixed="right" width="100">
<template slot-scope="{row}">
<el-button @click="rowTableDelete(row)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item label="变更类型" prop="changeType">
<dict-select v-model="formData.changeType" clearable code="AIDFUND_MEMBER_CHANGE_TYPE"
placeholder="请选择变更类型"
style="width: 100%"></dict-select>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="batchChangeTypeVisible = false">取 消</el-button>
<el-button @click="doBatchChangeType" type="primary">提 交</el-button>
</span>
</el-dialog>
<el-dialog
:visible.sync="changeTypeVisible"
title="会员变更"
@@ -242,13 +281,67 @@ layout("/layouts/platform.html"){
changeType: [
{required: true, message: '请选择变更类型', trigger: 'change'}
]
}
},
batchChangeTypeVisible: false,
changeTableData: []
}
},
components: {
'info': AID_FUND_INFO,
},
methods: {
doBatchChangeType() {
const selection = this.$refs.table.selection
if (selection.length === 0) {
this.$message.warning('请勾选需要变更的人员')
return
}
this.$refs.form.validate(valid => {
if (!valid) {
return
}
this.$confirm('确定要变更【' + selection.map(v => v.username) + '】吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const ids = selection.map(v => v.id)
this.$axios.post('/platform/medicalMutualAid/aidFund/manage/doBatchChangeType', {
ids: JSON.stringify(ids),
changeType: this.formData.changeType
}).then(resp => {
if (resp.code === 0) {
this.$message.success(resp.msg)
this.doSearch()
this.$refs.table.clearSelection()
this.batchChangeTypeVisible = false
}
})
})
})
},
rowTableDelete(row) {
this.$confirm('确定要删除【' + row.username + '】吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$refs.table.toggleRowSelection(row, false)
})
},
openBatchChangeType() {
const selection = this.$refs.table.selection
if (selection.length === 0) {
this.$message.warning('请勾选需要变更的人员')
return
}
this.changeTableData = selection
this.batchChangeTypeVisible = true
},
onEditChangeType(row) {
this.formData = clone(row)
this.changeTypeVisible = true
@@ -69,6 +69,12 @@ layout("/layouts/platform.html"){
type="primary">导出名单
</el-button>
<el-button @click="exportYearPayRecord"
size="small"
icon="el-icon-download"
type="primary">导出会员缴费金额
</el-button>
<el-button :disabled="tableData.length==0" :loading="tableLoading" @click="clearPayRecord"
icon="el-icon-delete"
size="small"
@@ -113,7 +119,6 @@ layout("/layouts/platform.html"){
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #edit>
@@ -125,12 +130,17 @@ layout("/layouts/platform.html"){
></file-import>
</template>
<template #view>
<info ref="infoRef"></info>
</template>
</guava>
</div>
<script nonce="${cspNonce!}">
<!--#include("../common/aidFundInfo.js"){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
@@ -160,17 +170,27 @@ layout("/layouts/platform.html"){
}
},
components: {
'info': AID_FUND_INFO,
"file-import": httpVueLoader("/components/plugins/sysImport/index.vue"),
},
methods: {
onView(row) {
this.$refs.guava.view(() => {
this.showApprovalForm = false
this.$refs.infoRef.onOpen({"id": row.userId})
})
},
openImport() {
this.$refs.guava.edit(()=>{
this.$refs.guava.edit(() => {
setTimeout(() => {
this.$refs.viewImport.resetImportData()
this.$refs.viewImport.importData.year = this.pageForm.year
}, 500)
})
},
exportYearPayRecord(){
this.$downLoad('/platform/medicalMutualAid/aidFund/payRecord/exportYearPayRecord', this.pageForm)
},
exportPayRecord() {
this.$downLoad('/platform/medicalMutualAid/aidFund/payRecord/exportPayRecord', this.pageForm)
},
@@ -214,11 +234,6 @@ layout("/layouts/platform.html"){
})
})
},
onView(row) {
this.$refs.guava.view(() => {
this.$refs.infoRef.onOpen(row)
})
},
async unionChange(val) {
this.pageForm.unitId = null
this.unitList = await this.$businessTool.listUnit(val)