This commit is contained in:
=
2025-03-06 20:41:51 +08:00
parent 8d2f7a09bb
commit 61357693b8
15 changed files with 760 additions and 53 deletions
@@ -36,6 +36,11 @@ public class MobileMemberCostListController {
public void paySuccess() { public void paySuccess() {
} }
@At("/summary")
@Ok("beetl:/mobile/memberCost/summary.html")
public void summary() {
}
@At @At
@ViReturn @ViReturn
@@ -4,9 +4,11 @@ import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus; import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm; import io.v.nutz.base.query.PageForm;
import io.v.nutz.zhgh.memberCost.model.MemberPaymentConfig; import io.v.nutz.zhgh.memberCost.model.MemberPaymentConfig;
import io.v.nutz.zhgh.memberCost.model.MemberPaymentProject;
import io.v.nutz.zhgh.memberCost.service.MemberPaymentService; import io.v.nutz.zhgh.memberCost.service.MemberPaymentService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls; import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
@@ -56,6 +58,29 @@ public class MemberPaymentConfigController {
return memberPaymentService.getConfig(); return memberPaymentService.getConfig();
} }
@At
@ViReturn
public Object getPaymentConfigList(){
return memberPaymentService.getPaymentConfigList();
}
@At
@ViReturn
public Object doRemove(String id){
memberPaymentService.dao().clear(MemberPaymentConfig.class, Cnd.where("id", "=", id));
return null;
}
@At
@ViReturn
public Object openClosedConfig(String id){
//位运算 取反
memberPaymentService.dao().update(MemberPaymentConfig.class,
Chain.makeSpecial("isDisabled", "isDisabled ^ 1"),
Cnd.where("id", "=", id));
return null;
}
@At @At
@ViReturn @ViReturn
@@ -30,11 +30,13 @@ import org.nutz.mvc.annotation.Param;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -122,13 +124,15 @@ public class MemberPaymentProjectController {
memberPaymentService.clear(Cnd.where("paymentProjectId", "=", id)); memberPaymentService.clear(Cnd.where("paymentProjectId", "=", id));
} }
//获取缴费项目
MemberPaymentProject project = memberPaymentService.dao().fetch(MemberPaymentProject.class, id);
//获取缴费配置 //获取缴费配置
MemberPaymentConfig config = memberPaymentService.getConfig(); MemberPaymentConfig config = memberPaymentService.getConfigById(project.getConfigId());
List<MemberPaymentConfig.PayStandards> payStandards = config.getPayStandards(); List<MemberPaymentConfig.PayStandards> payStandards = config.getPayStandards();
//缴费人员类型 //缴费人员类型
List<String> personTypeList = new ArrayList<>(); List<String> personTypeList = new ArrayList<>();
payStandards.forEach(v->{ payStandards.forEach(v->{
personTypeList.addAll(v.getPersonTypes()); personTypeList.add(v.getPersonType());
}); });
//获取所有有入会时间的会员 //获取所有有入会时间的会员
@@ -138,23 +142,37 @@ public class MemberPaymentProjectController {
//过滤出需要新增到记录表中的人员 //过滤出需要新增到记录表中的人员
List<Sys_user> needInsertUserIds = memberList.stream().filter(v -> !paymentUserIdList.contains(v.getId())).collect(Collectors.toList()); List<Sys_user> needInsertUserIds = memberList.stream().filter(v -> !paymentUserIdList.contains(v.getId())).collect(Collectors.toList());
//获取缴费项目
MemberPaymentProject project = memberPaymentService.dao().fetch(MemberPaymentProject.class, id); //该缴费配置的缴费月份是几月到几月,转为数组
//该项目的缴费月份是几月到几月,转为数组,判断新入职教工应缴费几个月 String[] strings = {config.getPaymentStartMonth(),config.getPaymentEndMonth()};
String[] strings = project.getPaymentStartMonth().substring(0, project.getPaymentStartMonth().length() - 1).split("-"); DateTime beginDate = DateUtil.parse(strings[0] + "-01");
DateTime beginDate = DateUtil.parse(project.getYear() + "-" + strings[0] + "-01");
//获取月份的最后一天 //获取月份的最后一天
DateTime endDate = DateUtil.endOfMonth(DateUtil.parse(project.getYear() + "-" + strings[1] + "-01")); DateTime endDate = DateUtil.endOfMonth(DateUtil.parse(strings[1] + "-01"));
List<MemberPaymentInfo> memberPaymentInfos = new ArrayList<>(); List<MemberPaymentInfo> memberPaymentInfos = new ArrayList<>();
needInsertUserIds.forEach(v -> { needInsertUserIds.forEach(v -> {
MemberPaymentInfo paymentInfo = new MemberPaymentInfo(); MemberPaymentInfo paymentInfo = new MemberPaymentInfo();
paymentInfo.setPersonType(v.getPersonType());
long differMonth = 0;
//如果是新入职教工,计算需要缴纳的月数 //如果是新入职教工,计算需要缴纳的月数
if (v.getMemberJoinTime().after(beginDate) && v.getMemberJoinTime().before(endDate)){ if (v.getMemberJoinTime().after(beginDate) && v.getMemberJoinTime().before(endDate)){
long differMonth = DateUtil.betweenMonth(v.getMemberJoinTime(), endDate, false); differMonth = DateUtil.betweenMonth(v.getMemberJoinTime(), endDate, false)+1;
paymentInfo.setPaymentMonth(String.valueOf(differMonth)); paymentInfo.setPaymentMonth(String.valueOf(differMonth));
} else { paymentInfo.setPayPersonnel("新进会员");
paymentInfo.setPaymentMonth(config.getPaidDuration()); //getPayment(v, payStandards, paymentInfo, differMonth,"新进会员");
}else if(v.getRetireDate()!=null&&v.getRetireDate().after(beginDate)&&v.getRetireDate().before(endDate)){
//如果是退休会员
differMonth = DateUtil.betweenMonth(beginDate, v.getRetireDate(), false)+1;
paymentInfo.setPaymentMonth(String.valueOf(differMonth));
paymentInfo.setPayPersonnel("退休会员");
//getPayment(v, payStandards, paymentInfo, differMonth,"退休会员");
}else {
//如果是普通会员
differMonth = DateUtil.betweenMonth(beginDate, endDate, false)+1;
paymentInfo.setPaymentMonth(String.valueOf(differMonth));
paymentInfo.setPayPersonnel("普通会员");
//getPayment(v, payStandards, paymentInfo, differMonth,"普通会员");
} }
paymentInfo.setUserId(v.getId()); paymentInfo.setUserId(v.getId());
paymentInfo.setLoginname(v.getLoginname()); paymentInfo.setLoginname(v.getLoginname());
@@ -195,6 +213,24 @@ public class MemberPaymentProjectController {
return null; return null;
} }
private static void getPayment(Sys_user v, List<MemberPaymentConfig.PayStandards> payStandards, MemberPaymentInfo paymentInfo, long differMonth,String payPersonnel) {
List<MemberPaymentConfig.PayStandards> list = payStandards.stream().filter(v1 -> v1.getPersonType().equals(v.getPersonType()) && payPersonnel.equals(v1.getPayPersonnel())).collect(Collectors.toList());
MemberPaymentConfig.PayStandards standards = null;
if (list!=null&&list.size()>0){
standards = list.get(0);
}
if ("在编".equals(v.getPersonType())&&standards!=null){
AtomicReference<Integer> value= new AtomicReference<>(0);
standards.getPayModeValueList().forEach(v1->{
value.set(value.get()+v1.getInt("value"));
});
paymentInfo.setPaymentMoney(String.valueOf(value.get()*0.05* differMonth));
}
if ("非编".equals(v.getPersonType())&&standards!=null){
paymentInfo.setPaymentMoney(String.valueOf(Integer.valueOf(standards.getPayModeValue())* differMonth));
}
}
/** /**
* 删除 * 删除
@@ -85,7 +85,6 @@ public class MemberPaymentSummaryController {
u.sex, u.sex,
u.member, u.member,
u.welfareMember, u.welfareMember,
u.personType,
u.userState, u.userState,
u.unionname, u.unionname,
u.unionid, u.unionid,
@@ -111,7 +110,7 @@ public class MemberPaymentSummaryController {
if (StrUtil.isNotBlank(searchName) && StrUtil.isNotBlank(searchKeyword)) { if (StrUtil.isNotBlank(searchName) && StrUtil.isNotBlank(searchKeyword)) {
cnd.and(Cnd.likeEX(searchName, searchKeyword)); cnd.and(Cnd.likeEX(searchName, searchKeyword));
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,H03")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,H04")) {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
cnd.and("u.unionid", "=", Vi.getUnionId()); cnd.and("u.unionid", "=", Vi.getUnionId());
} else { } else {
@@ -173,7 +172,7 @@ public class MemberPaymentSummaryController {
public Object modify(@Param("ids") String[] ids, String paymentMoney, boolean isPay, String remark) { public Object modify(@Param("ids") String[] ids, String paymentMoney, boolean isPay, String remark) {
List<String> idList = Arrays.asList(ids); List<String> idList = Arrays.asList(ids);
if (Lang.isNotEmpty(idList)) { if (Lang.isNotEmpty(idList)) {
if (isPay) { if (!isPay) {
//未缴费设为已缴费 //未缴费设为已缴费
memberPaymentService.update(Chain.make("paymentMoney", paymentMoney) memberPaymentService.update(Chain.make("paymentMoney", paymentMoney)
.add("remark", remark).add("isPayment", 1) .add("remark", remark).add("isPayment", 1)
@@ -0,0 +1,89 @@
package io.v.nutz.zhgh.memberCost.controller.payment;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.memberCost.model.MemberPaymentInfo;
import io.v.nutz.zhgh.memberCost.model.MemberPaymentProject;
import io.v.nutz.zhgh.memberCost.service.MemberPaymentService;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 个人缴费管理
* @author hpf
*/
@IocBean
@Slf4j
@Ok("json:full")
@At("/platform/member/payment/user")
public class MemberPaymentUserController {
@Inject
private MemberPaymentService memberPaymentService;
@At("")
@Ok("beetl:/platform/memberCost/payment/user.html")
@RequiresPermissions("member.payment.user")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("member.payment.user")
public Object pageData(PageForm pageForm,@Param(value = "year", required = false) String year,@Param(value = "projectName", required = false) String projectName){
Sql sql = Sqls.create("SELECT" +
" mpi.*," +
" mpp.`year`," +
" mpp.projectName," +
" mpp.startTime," +
" mpp.endTime," +
" mpp.configId," +
" mpc.payStandards," +
" mpc.paymentStartMonth," +
" mpc.paymentEndMonth" +
" FROM" +
" member_payment_info mpi" +
" LEFT JOIN member_payment_project mpp ON mpi.paymentProjectId = mpp.id " +
" LEFT JOIN member_payment_config mpc ON mpc.id = mpp.configId $condition");
CndPlus cnd = CndPlus.create();
cnd.andEX("mpp.isDisabled", "=", '0');
cnd.andEX("mpp.year", "=", year);
cnd.and("mpi.userId", "=", ShiroUtil.getUserId());
if (Strings.isNotBlank(projectName)) {
cnd.and(Cnd.likeEX("mpp.projectName", projectName));
}
cnd.desc("mpp.createTime");
sql.setCondition(cnd);
return memberPaymentService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@ViReturn
@RequiresPermissions("member.payment.user")
public Object doSave(MemberPaymentInfo memberPaymentInfo) {
memberPaymentService.insertOrUpdate(memberPaymentInfo);
return null;
}
}
@@ -50,11 +50,21 @@ public class MemberPaymentConfig extends BaseModel {
@ColDefine(type = ColType.BOOLEAN) @ColDefine(type = ColType.BOOLEAN)
private boolean isDisabled; private boolean isDisabled;
@Column
@Comment("开始缴费月份")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String paymentStartMonth;
@Column
@Comment("结束缴费月份")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String paymentEndMonth;
@Data @Data
public static class PayStandards implements Serializable { public static class PayStandards implements Serializable {
private String payPersonnel; private String payPersonnel;
private String payMode; private String payMode;
private List<String> personTypes; private String personType;
private String payModeValue; private String payModeValue;
private List<NutMap> payModeValueList; private List<NutMap> payModeValueList;
} }
@@ -87,4 +87,15 @@ public class MemberPaymentInfo {
@Comment("缴费月份") @Comment("缴费月份")
@ColDefine(type = ColType.VARCHAR, width = 10) @ColDefine(type = ColType.VARCHAR, width = 10)
private String paymentMonth; private String paymentMonth;
@Column
@Comment("人员类型")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String personType;
@Column
@Comment("会员类型")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String payPersonnel;
} }
@@ -58,4 +58,9 @@ public class MemberPaymentProject extends BaseModel {
@Comment("结束缴费时间") @Comment("结束缴费时间")
@ColDefine(type = ColType.VARCHAR,width = 32) @ColDefine(type = ColType.VARCHAR,width = 32)
private String endTime; private String endTime;
@Column
@Comment("缴费配置id")
@ColDefine(type = ColType.VARCHAR,width = 32)
private String configId;
} }
@@ -17,4 +17,8 @@ public interface MemberPaymentService extends ViService<MemberPaymentInfo> {
Workbook exportOrZip(List<NutMap> list, OutputStream outputStream)throws Exception; Workbook exportOrZip(List<NutMap> list, OutputStream outputStream)throws Exception;
MemberPaymentConfig getConfig(); MemberPaymentConfig getConfig();
List<MemberPaymentConfig> getPaymentConfigList();
MemberPaymentConfig getConfigById(String configId);
} }
@@ -11,6 +11,7 @@ import io.v.nutz.zhgh.memberCost.model.MemberPaymentProject;
import io.v.nutz.zhgh.memberCost.service.MemberPaymentService; import io.v.nutz.zhgh.memberCost.service.MemberPaymentService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
@@ -61,4 +62,14 @@ public class MemberPaymentServiceImpl extends ViServiceImpl<MemberPaymentInfo> i
public MemberPaymentConfig getConfig() { public MemberPaymentConfig getConfig() {
return dao().fetch(MemberPaymentConfig.class); return dao().fetch(MemberPaymentConfig.class);
} }
@Override
public List<MemberPaymentConfig> getPaymentConfigList() {
return dao().query(MemberPaymentConfig.class, Cnd.NEW().and("isDisabled","=","0"));
}
@Override
public MemberPaymentConfig getConfigById(String configId) {
return dao().fetch(MemberPaymentConfig.class,configId);
}
} }
@@ -267,7 +267,7 @@ layout("/mobile/platform.html"){
const payStandards = this.configData.payStandards const payStandards = this.configData.payStandards
resp.data.forEach((r) => { resp.data.forEach((r) => {
payStandards.map((p) => { payStandards.map((p) => {
if (p.personTypes.includes(personType)) { if (p.personType===personType) {
r.selectMode = p.payMode r.selectMode = p.payMode
if (p.c === "1") { if (p.c === "1") {
r.modeValue = p.payModeValue r.modeValue = p.payModeValue
@@ -0,0 +1,101 @@
<!--#
layout("/mobile/platform.html"){
#-->
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="pjaxReplace('/mobile/index')" left-arrow title="缴费汇总"></van-nav-bar>
</van-sticky>
<div>
<van-search v-model="pageForm.searchKeyword" placeholder="请输入搜索关键词" @search="doSearch">
</van-search>
</div>
<div>
<van-tabs @change="doSearch" v-model="pageForm.isPay">
<van-tab title="未缴费" :name="false"></van-tab>
<van-tab title="已缴费" :name="true"></van-tab>
</van-tabs>
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="pageData"
>
<van-cell-group inset>
<van-cell v-for="item in tableData" :value="item.isPayment?'已缴':'未缴'">
<template #title>
<span class="custom-title">{{item.username}}</span>
<van-tag type="danger">{{item.isPayment?'已缴':'未缴'}}</van-tag>
</template>
<template #label>
<div class="custom-title">工会:{{item.unionname}}</div>
<div class="custom-title">单位:{{item.unitname}}</div>
</template>
</van-cell>
</van-cell-group>
</van-list>
<van-empty
class="custom-image"
description="暂无缴费记录"
image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
v-if="tableData&&tableData.length===0"
></van-empty>
</div>
</div>
<script>
const vue = new Vue({
el: "#app",
data() {
return {
tableData: [],
memberActive: 0,
loading: false,
finished: false,
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
username: "",
isPay:false,
searchName:'u.username',
searchKeyword:''
},
option1: [
{ text: '姓名', value: 'u.username' },
{ text: '工号', value: 'u.loginname' },
]
}
},
methods: {
async pageData() {
const resp = await $.post("/platform/member/payment/summary/pageData", this.pageForm)
if (resp.code === 0) {
this.tableData = this.tableData.concat(resp.data.list)
this.pageForm.totalCount = resp.data.totalCount
console.log(this.tableData.length >= this.pageForm.totalCount)
if (this.tableData.length >= this.pageForm.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
this.loading = false
}
},
doSearch(){
this.pageForm.pageNumber = 1
this.tableData = []
this.finished = false
this.pageData()
}
},
async created() {
await this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -18,7 +18,7 @@ layout("/layouts/platform.html"){
<div class="search-item-option"> <div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容" <el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
style="width: 100%" style="width: 100%"
v-model="pageForm.projectName"> v-model="pageForm.name">
</el-input> </el-input>
</div> </div>
</div> </div>
@@ -60,7 +60,7 @@ layout("/layouts/platform.html"){
<el-switch <el-switch
:active-value="false" :active-value="false"
:inactive-value="true" :inactive-value="true"
@change="(val)=>{projectStatusChange(row.id)}" @change="(val)=>{configStatusChange(row.id)}"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949" inactive-color="#ff4949"
v-model="row.isDisabled"> v-model="row.isDisabled">
@@ -100,9 +100,22 @@ layout("/layouts/platform.html"){
style="margin: 10px 0 0 0"> style="margin: 10px 0 0 0">
<vi-title title="缴费配置"></vi-title> <vi-title title="缴费配置"></vi-title>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="12">
<el-form-item label="配置名称" prop="paidDuration"> <el-form-item label="配置名称" prop="name">
<el-input v-model="formData.paidDuration"></el-input> <el-input v-model="formData.name"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="缴费月份" prop="paymentMonth" size="medium">
<el-date-picker
v-model="formData.paymentMonth"
type="monthrange"
range-separator="至"
style="width: 100%"
value-format="yyyy-MM"
start-placeholder="开始月份"
end-placeholder="结束月份">
</el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -178,12 +191,8 @@ layout("/layouts/platform.html"){
<div style="display:flex;justify-content: space-between;margin-left: 30px"> <div style="display:flex;justify-content: space-between;margin-left: 30px">
( (
<template v-for="(o,i) in row.payModeValueList" > <template v-for="(o,i) in row.payModeValueList" >
<el-input maxlength="5" placeholder="" style="width: 200px;" <el-input placeholder="" style="width: 100px;"
v-model="o.value"> v-model="o.name">
<el-select style="width: 105px;" v-model="o.name" slot="prepend" placeholder="请选择">
<el-option label="岗位工资" value="1"></el-option>
<el-option label="薪级工资" value="2"></el-option>
</el-select>
<el-button @click="row.payModeValueList.splice(i, 1)" slot="append" style="padding: 0 7px;" <el-button @click="row.payModeValueList.splice(i, 1)" slot="append" style="padding: 0 7px;"
icon="el-icon-circle-close"></el-button> icon="el-icon-circle-close"></el-button>
</el-input> </el-input>
@@ -294,6 +303,8 @@ layout("/layouts/platform.html"){
payStandards: [{payPersonnel: null, payMode: null, personTypes: null, payModeValue: null,payModeValueList:[{name:'',value:''}]}] payStandards: [{payPersonnel: null, payMode: null, personTypes: null, payModeValue: null,payModeValueList:[{name:'',value:''}]}]
}, },
rules: { rules: {
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
paymentMonth: [{required: true, message: '必填', trigger: ['blur', 'change']}],
exit: [{required: true, message: '必填', trigger: ['blur', 'change']}], exit: [{required: true, message: '必填', trigger: ['blur', 'change']}],
}, },
personTypeList:[], personTypeList:[],
@@ -303,23 +314,70 @@ layout("/layouts/platform.html"){
tableData:[], tableData:[],
tableColumns:[ tableColumns:[
{prop: 'name', label: '配置名称'}, {prop: 'name', label: '配置名称'},
{prop: 'unPaidExitDuration', label: '未缴费退会时长'}, {prop: 'paymentStartMonth', label: '缴费起始月份'},
{prop: 'exitMode', label: '退会模式'}, {prop: 'paymentEndMonth', label: '缴费截止月份'},
{prop: 'paidDuration', label: '缴费时长'},
{prop: 'isDisabled', label: '开启状态'}, {prop: 'isDisabled', label: '开启状态'},
], ],
isSubmit: true, isSubmit: true,
} }
}, },
methods: { methods: {
dropdownCommand(command) {
const {type, data} = command
if (type === 'view') {
this.openView(data)
} else if (type === 'edit') {
this.openEdit(data)
} else if (type === 'remove') {
this.doRemove(data.id)
}
},
openAdd(){ openAdd(){
this.$refs.guava.view() this.$refs.guava.view()
}, },
async doRemove(id) {
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === 'confirm') {
const resp = await $.get(loc() + '/doRemove', {id: id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.pageData()
} else {
this.notifyWarning(resp.msg)
}
}
},
async configStatusChange(id) {
const resp = await $.post(loc() + '/openClosedConfig', { id: id })
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.pageData()
} else {
this.notifyWarning(resp.msg)
}
},
openEdit(data) {
this.formData = {}
this.formData = {
...data,
paymentMonth:[data.paymentStartMonth, data.paymentEndMonth],
}
this.formData.payStandards= JSON.parse(this.formData.payStandards)
this.isSubmit = true
this.$refs.guava.view()
},
async doSubmit(){ async doSubmit(){
this.formData.paymentStartMonth = this.formData.paymentMonth[0]
this.formData.paymentEndMonth = this.formData.paymentMonth[1]
const formData = clone(this.formData) const formData = clone(this.formData)
formData.payStandards = JSON.stringify(this.formData.payStandards) formData.payStandards = JSON.stringify(this.formData.payStandards)
const resp = await $.post(loc() + '/doAddOrModify',formData) const resp = await $.post(loc() + '/doAddOrModify',formData)
if (resp.code === 0){ if (resp.code === 0){
this.$refs.guava.index()
await this.getPaymentConfig() await this.getPaymentConfig()
this.notifySuccess(resp.msg) this.notifySuccess(resp.msg)
} else { } else {
@@ -83,9 +83,6 @@ layout("/layouts/platform.html"){
v-model="row.isDisabled"> v-model="row.isDisabled">
</el-switch> </el-switch>
</template> </template>
<template scope="{row}" v-if="column.prop==='paymentMonth'">
<span>{{row.paymentStartMonth}} 至 {{row.paymentEndMonth}}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" <el-table-column prop="userOnline" align="center" header-align="center"
@@ -163,20 +160,16 @@ layout("/layouts/platform.html"){
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="缴费月份" prop="paymentMonth" size="medium"> <el-form-item label="缴费配置" prop="configId" size="medium">
<!--<el-radio-group v-model="formData.paymentMonth"> <el-select placeholder="请选择缴费配置" v-model="formData.configId"
<el-radio-button v-for="item in monthSelect" :label="item.label" style="width: 100%" clearable>
:disabled="item.code===1"></el-radio-button> <el-option
</el-radio-group>--> v-for="item in configList"
<el-date-picker :key="item.id"
v-model="formData.paymentMonth" :label="item.name"
type="monthrange" :value="item.id">
range-separator="至" </el-option>
style="width: 100%" </el-select>
value-format="yyyy-MM"
start-placeholder="开始月份"
end-placeholder="结束月份">
</el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@@ -220,7 +213,6 @@ layout("/layouts/platform.html"){
tableColumns: [ tableColumns: [
{prop: 'year', label: '年度', sortable: true}, {prop: 'year', label: '年度', sortable: true},
{prop: 'projectName', label: '项目名称', sortable: true}, {prop: 'projectName', label: '项目名称', sortable: true},
{prop: 'paymentMonth', label: '缴费月份', sortable: true},
{prop: 'startTime', label: '缴费开始时间', sortable: true}, {prop: 'startTime', label: '缴费开始时间', sortable: true},
{prop: 'endTime', label: '缴费截止时间', sortable: true}, {prop: 'endTime', label: '缴费截止时间', sortable: true},
{prop: 'createTime', label: '创建时间', sortable: true}, {prop: 'createTime', label: '创建时间', sortable: true},
@@ -234,9 +226,11 @@ layout("/layouts/platform.html"){
year: [{required: true, message: '必填', trigger: ['blur', 'change']}], year: [{required: true, message: '必填', trigger: ['blur', 'change']}],
paymentMonth: [{required: true, message: '必填', trigger: ['blur', 'change']}], paymentMonth: [{required: true, message: '必填', trigger: ['blur', 'change']}],
paymentTime: [{required: true, message: '必填', trigger: ['blur', 'change']}], paymentTime: [{required: true, message: '必填', trigger: ['blur', 'change']}],
configId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
}, },
paymentConfig: {}, paymentConfig: {},
monthSelect: [] monthSelect: [],
configList:[]
} }
}, },
components: { components: {
@@ -265,7 +259,10 @@ layout("/layouts/platform.html"){
}, },
openView(data) { openView(data) {
this.formData = {} this.formData = {}
this.formData = {...data} this.formData = {
...data,
paymentTime:[data.startTime, data.endTime],
}
this.isSubmit = false this.isSubmit = false
this.$refs.guava.view() this.$refs.guava.view()
}, },
@@ -273,7 +270,6 @@ layout("/layouts/platform.html"){
this.formData = {} this.formData = {}
this.formData = { this.formData = {
...data, ...data,
paymentMonth:[data.paymentStartMonth, data.paymentEndMonth],
paymentTime:[data.startTime, data.endTime], paymentTime:[data.startTime, data.endTime],
} }
this.isSubmit = true this.isSubmit = true
@@ -369,8 +365,6 @@ layout("/layouts/platform.html"){
}); });
this.formData.startTime=this.formData.paymentTime[0] this.formData.startTime=this.formData.paymentTime[0]
this.formData.endTime=this.formData.paymentTime[1] this.formData.endTime=this.formData.paymentTime[1]
this.formData.paymentStartMonth=this.formData.paymentMonth[0]
this.formData.paymentEndMonth=this.formData.paymentMonth[1]
const formData = clone(this.formData) const formData = clone(this.formData)
const resp = await $.post(loc() + '/doSave', formData) const resp = await $.post(loc() + '/doSave', formData)
loading.close() loading.close()
@@ -393,8 +387,15 @@ layout("/layouts/platform.html"){
this.notifyWarning(resp.msg) this.notifyWarning(resp.msg)
} }
}, },
async getPaymentConfigList(id) {
const resp = await $.post('/platform/member/payment/config/getPaymentConfigList')
if (resp.code === 0) {
this.configList = resp.data
}
},
}, },
async created() { async created() {
this.getPaymentConfigList()
this.pageData() this.pageData()
} }
}) })
@@ -0,0 +1,352 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
:clearable="false"
clearable
@change="doSearch"
placeholder="选择年度"
type="year" style="width: 100%"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">缴费项目:</div>
<div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
style="width: 100%"
v-model="pageForm.projectName">
</el-input>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索
</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="个人缴费列表">
</table-tool>
<el-table :data="tableData" :size="tableSize"
@sort-change="pageOrder"
class="vi-table"
ref="table" row-key="id" style="width: 100%"
v-loading="tableLoading">
<el-table-column :index="indexMethod" align="center" header-align="center"
label="序号" type="index"
width="80px"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop==='isPayment'">
<span style="color: #00aa3a" v-if="row.isPayment">已缴</span>
<span style="color: red" v-else>未缴</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="是否确认金额">
<template scope="{row}">
<span style="color: #00aa3a" v-if="row.paymentMoney!=null">已确定</span>
<span style="color: red" v-else>未确定</span>
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center"
label="操作"
width="100px">
<template scope="scope">
<el-dropdown @command="dropdownCommand">
<el-button :loading="submitLoading" 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="{type:'view',data:scope.row}">
查看
</el-dropdown-item>
<el-dropdown-item v-if="!scope.row.isPayment" :command="{type:'edit',data:scope.row}">
设为已缴
</el-dropdown-item>
<el-dropdown-item v-if="scope.row.paymentMoney==null" :command="{type:'pay',data:scope.row}">
确定缴费金额
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #pay>
<el-form :model="formData" :rules="formRules" label-width="100px" ref="form">
<vi-title title="缴费信息"></vi-title>
<el-form-item label="缴费项目" prop="projectName">
<span>{{formData.projectName}}</span>
</el-form-item>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="人员类型" size="medium">
<span>{{formData.personType}}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="会员类型" size="medium">
<span>{{formData.payPersonnel}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="需缴费用" size="medium">
<div v-for="item in payStandard" style="display:flex;justify-content: space-between;margin-left: 30px">
<template v-if="item.payModeValueList.length>0" >
(
<template v-for="(o,i) in item.payModeValueList">
<el-input @change="getMoney(item)" placeholder="" style="width: 200px;" v-model="o.value">
<template slot="prepend">{{o.name}}</template>
</el-input>
<span v-if="(i+1)!=item.payModeValueList.length">+</span>
</template>
) * 0.5% *{{formData.paymentMonth}}个月
</template>
<template v-else>
<span>{{item.payModeValue}}</span>*{{formData.paymentMonth}}个月
</template>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="缴费金额" prop="paymentMoney" size="medium">
<el-input disabled="true" placeholder="" style="width: 200px;" v-model="formData.paymentMoney">
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div>
<el-button @click="doSave" v-loading="submitLoading" style="float: right"
type="primary">
提交
</el-button>
</div>
</template>
<template #view>
<el-form :model="formData" label-width="100px" ref="form">
<vi-title title="缴费信息"></vi-title>
<el-form-item label="缴费项目" prop="projectName">
<span>{{formData.projectName}}</span>
</el-form-item>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="人员类型" size="medium">
<span>{{formData.personType}}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="会员类型" size="medium">
<span>{{formData.payPersonnel}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="缴纳标准" size="medium">
<div v-for="item in payStandard" style="display:flex;justify-content: space-between;margin-left: 30px">
<span v-if="item.payModeValueList.length>0" >
(
<span v-for="(o,i) in item.payModeValueList">
<span>{{o.name}}</span>
<span v-if="(i+1)!=item.payModeValueList.length">+</span>
</span>
) * 0.5% *{{formData.paymentMonth}}个月
</span>
<template v-else>
<span>{{item.payModeValue}}</span>*{{formData.paymentMonth}}个月
</template>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="缴费金额" size="medium">
<span>{{formData.paymentMoney}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="缴费月份" size="medium">
<span>{{formData.paymentStartMonth}} - {{formData.paymentEndMonth}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="缴费开始时间" size="medium">
<span>{{formData.startTime}} - {{formData.endTime}}</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
pageForm: {
year: moment().format('YYYY'),
},
tableColumns: [
{prop: 'year', label: '年度'},
{prop: 'projectName', label: '缴费项目名称'},
{prop: 'paymentStartMonth', label: '缴费开始月份'},
{prop: 'paymentEndMonth', label: '缴费截止月份'},
{prop: 'paymentMonth', label: '需要缴费月数'},
{prop: 'startTime', label: '缴费开始时间'},
{prop: 'endTime', label: '缴费截止时间'},
{prop: 'paymentMoney', label: '缴费金额'},
{prop: "isPayment", label: "是否缴费", sortable: true},
],
payStandard:{},
formRules: {
paymentMoney: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
},
methods: {
dropdownCommand(command) {
const {type, data} = command
if (type === 'edit') {
this.doPay(data)
}
if (type === 'pay'){
this.openPay(data)
}
if (type === 'view'){
this.openView(data)
}
},
openPay(data){
const payStandards=JSON.parse(data.payStandards)
this.payStandard=payStandards.filter(item => item.personType===data.personType&&item.payPersonnel===data.payPersonnel)
if (this.payStandard.length>0&&this.payStandard[0].payModeValueList===null){
this.formData.paymentMoney=+this.payStandard[0].payModeValue*+this.formData.paymentMonth
}
this.formData=data
this.$refs.guava.pay()
},
async doPay(data) {
const confirm = await this.$confirm("您确定要更改缴费信息吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
const formData={
ids:JSON.stringify([data.id]),
paymentMoney:data.paymentMoney,
isPay:data.isPay,
remark:"缴费"
}
const resp = await $.post("/platform/member/payment/summary/modify", formData)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.pageData()
} else {
this.notifyWarning(resp.msg)
}
}
},
openView(data) {
const payStandards=JSON.parse(data.payStandards)
this.payStandard=payStandards.filter(item => item.personType===data.personType&&item.payPersonnel===data.payPersonnel)
if (this.payStandard.length>0&&this.payStandard[0].payModeValueList===null){
this.formData.paymentMoney=+this.payStandard[0].payModeValue*+this.formData.paymentMonth
}
this.formData=data
this.$refs.guava.view()
},
async doSave() {
const formValid = await this.$refs["form"].validate()
if (formValid) {
this.submitLoading = true
const loading = this.$loading({
lock: true,
text: '数据保存中请稍后',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
const formData = clone(this.formData)
const resp = await $.post(loc() + '/doSave', formData)
loading.close()
this.submitLoading = false
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.$refs.guava.index()
this.pageData()
} else {
this.notifyWarning(resp.msg)
}
}
},
getMoney(item){
this.formData.paymentMoney=0
let money=0
item.payModeValueList.forEach(o=>{
money=+o.value+money
})
this.formData.paymentMoney=money*0.005*+this.formData.paymentMonth
}
},
async created() {
this.pageData()
}
})
</script>
<!--#
}
#-->