基金会员
This commit is contained in:
+1
-1
@@ -78,7 +78,7 @@ public class FundMemberBranchUnionApprovalController {
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "in", List.of("fgh", "ltx"));
|
||||
cnd.and("t.taskName", "=", "fgh");
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
}
|
||||
|
||||
+4
-3
@@ -35,10 +35,11 @@ public class FundMemberHisController {
|
||||
@At
|
||||
@SaCheckPermission("fundMember.his")
|
||||
public Result pageData(PageForm pageForm, Integer year, String unionId) {
|
||||
// 同一会员可能存在多次入会记录,加入时间只取最新一条,避免子查询返回多行。
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
his.*,
|
||||
(SELECT changeTime FROM fund_member_change_record WHERE loginName = his.loginName AND isJoin = 1 ORDER BY changeTime DESC) joinTime
|
||||
(SELECT changeTime FROM fund_member_change_record WHERE loginName = his.loginName AND isJoin = 1 ORDER BY changeTime DESC LIMIT 1) joinTime
|
||||
FROM
|
||||
fund_member_his his
|
||||
$condition
|
||||
@@ -46,8 +47,8 @@ public class FundMemberHisController {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("username", pageForm.getSearchKeyword());
|
||||
seg.orLike("loginname", pageForm.getSearchKeyword());
|
||||
seg.orLike("userName", pageForm.getSearchKeyword());
|
||||
seg.orLike("loginName", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("year", "=", year);
|
||||
|
||||
+199
@@ -0,0 +1,199 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.member.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.member.mode.FundMemberPayImportTemp;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.member.models.FundMemberPay;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.member.service.FundMemberPayService;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.member.vo.FundMemberPayPageForm;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.config.model.MutualMemberConfig;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.config.service.MedicalMutualAidConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.AdaptBy;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.upload.TempFile;
|
||||
import org.nutz.mvc.upload.UploadAdaptor;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 基金会员缴费管理。
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/fundMember/payRecord")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "基金会员缴费管理")
|
||||
public class FundMemberPayController {
|
||||
|
||||
@Inject
|
||||
private FundMemberPayService fundMemberPayService;
|
||||
@Inject
|
||||
private MedicalMutualAidConfigService medicalMutualAidConfigService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/fund/member/payRecord/index.html")
|
||||
@SaCheckPermission("fundMember.payRecord")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("缴费记录分页查询")
|
||||
@SaCheckPermission("fundMember.payRecord")
|
||||
public Result pageData(FundMemberPayPageForm pageForm) {
|
||||
Sql sql = fundMemberPayService.buildPageSql(pageForm);
|
||||
Pagination pagination = fundMemberPayService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生成指定年度缴费名单时实际采用的月缴费金额,供前端确认提示展示。
|
||||
*
|
||||
* @param year 缴费年度
|
||||
* @return 实际匹配到的会员缴费配置年度和每月缴费金额
|
||||
*/
|
||||
@At
|
||||
@ApiOperation("查询年度缴费配置")
|
||||
@SaCheckPermission("fundMember.payRecord")
|
||||
public Result memberConfig(Integer year) {
|
||||
MutualMemberConfig memberConfig = medicalMutualAidConfigService.getMemberConfigForPay(year);
|
||||
if (memberConfig == null || memberConfig.getMonthAmount() == null
|
||||
|| memberConfig.getMonthAmount().signum() <= 0) {
|
||||
return Result.error("未维护有效的会员缴费配置,请先在医疗互助配置中设置每月缴费金额");
|
||||
}
|
||||
return Result.success(NutMap.NEW()
|
||||
.addv("year", memberConfig.getYear())
|
||||
.addv("monthAmount", memberConfig.getMonthAmount()));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("生成年度缴费名单")
|
||||
@SLog(tag = "基金会员缴费管理", msg = "生成年度缴费名单")
|
||||
@SaCheckPermission("fundMember.payRecord")
|
||||
public Result createPayList(Integer year) {
|
||||
int count = fundMemberPayService.createPayList(year);
|
||||
return Result.success("成功生成" + count + "条缴费记录");
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("设置缴费状态")
|
||||
@SLog(tag = "基金会员缴费管理", msg = "设置缴费状态")
|
||||
@SaCheckPermission("fundMember.payRecord")
|
||||
public Result updatePayed(String id, Boolean isPayed) {
|
||||
if (ObjectUtil.isEmpty(id) || isPayed == null) {
|
||||
return Result.error("参数错误");
|
||||
}
|
||||
fundMemberPayService.updatePayed(id, isPayed);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("清空当年缴费名单")
|
||||
@SLog(tag = "基金会员缴费管理", msg = "清空年度缴费名单")
|
||||
@SaCheckPermission("fundMember.payRecord")
|
||||
public Result clearPayList(Integer year) {
|
||||
fundMemberPayService.clearCurrentYearPayList(year);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@ApiOperation("下载缴费导入模板")
|
||||
@SaCheckPermission("fundMember.payRecord")
|
||||
public void downloadImportTemp(HttpServletResponse response) {
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("年度", "year", 12));
|
||||
exportEntities.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, new ArrayList<>());
|
||||
CommonDownloadUtil.download("基金会员缴费导入模板.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@ApiOperation("导出缴费记录")
|
||||
@SaCheckPermission("fundMember.payRecord")
|
||||
public void exportExcel(FundMemberPayPageForm pageForm, HttpServletResponse response) {
|
||||
Sql sql = fundMemberPayService.buildPageSql(pageForm);
|
||||
List<NutMap> records = fundMemberPayService.listMap(sql);
|
||||
records.forEach(record -> record.put("payState", record.getBoolean("isPayed") ? "已缴费" : "未缴费"));
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("年度", "year", 12));
|
||||
exportEntities.add(new ExcelExportEntity("工号", "loginName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("性别", "sex", 10));
|
||||
exportEntities.add(new ExcelExportEntity("会员类别", "aidFundMemberType", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所属单位", "unitName", 30));
|
||||
exportEntities.add(new ExcelExportEntity("所属工会", "unionName", 30));
|
||||
exportEntities.add(new ExcelExportEntity("缴费金额", "money", 15));
|
||||
exportEntities.add(new ExcelExportEntity("缴费状态", "payState", 15));
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, records);
|
||||
CommonDownloadUtil.download(pageForm.getYear() + "年基金会员缴费记录.xlsx", workbook, response);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("导入缴费记录")
|
||||
@SLog(tag = "基金会员缴费管理", msg = "导入缴费记录")
|
||||
@SaCheckPermission("fundMember.payRecord")
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Result doImport(TempFile file, Integer year) {
|
||||
if (file == null || year == null) {
|
||||
return Result.error("文件和缴费年度不能为空");
|
||||
}
|
||||
List<FundMemberPayImportTemp> importRows = ExcelImportUtil.importExcel(
|
||||
file.getFile(), FundMemberPayImportTemp.class, new ImportParams());
|
||||
if (importRows.isEmpty()) {
|
||||
return Result.error("导入文件没有缴费记录");
|
||||
}
|
||||
for (int i = 0; i < importRows.size(); i++) {
|
||||
FundMemberPayImportTemp importRow = importRows.get(i);
|
||||
int rowNumber = i + 2;
|
||||
// 页面选择的年度与模板年度必须一致,防止将缴费状态写入错误年度。
|
||||
if (importRow.getYear() == null) {
|
||||
return Result.error("第" + rowNumber + "行年度不能为空");
|
||||
}
|
||||
if (!year.equals(importRow.getYear())) {
|
||||
return Result.error("第" + rowNumber + "行年度与当前选择的缴费年度不一致");
|
||||
}
|
||||
if (cn.hutool.core.util.StrUtil.isBlank(importRow.getLoginName())) {
|
||||
return Result.error("第" + rowNumber + "行工号不能为空");
|
||||
}
|
||||
}
|
||||
List<String> loginNames = importRows.stream()
|
||||
.map(FundMemberPayImportTemp::getLoginName)
|
||||
.collect(Collectors.toList());
|
||||
List<String> errorLoginNames = fundMemberPayService.markPaidByLoginNames(year, loginNames);
|
||||
// 无论是否存在异常都返回导入统计,前端据 errorCount 决定提示类型。
|
||||
NutMap result = NutMap.NEW();
|
||||
result.setv("totalCount", importRows.size());
|
||||
result.setv("successCount", importRows.size() - errorLoginNames.size());
|
||||
result.setv("errorCount", errorLoginNames.size());
|
||||
result.setv("errorList", errorLoginNames.stream()
|
||||
.map(loginName -> NutMap.NEW().addv("工号", loginName).addv("错误原因", "未找到该年度缴费记录"))
|
||||
.collect(Collectors.toList()));
|
||||
return Result.success(result);
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -113,9 +113,8 @@ public class FundMemberQueryController {
|
||||
@SaCheckPermission("fundMember.query")
|
||||
@Ok("void")
|
||||
@ApiOperation("导出登记汇总Excel")
|
||||
public void exportExcel(Integer year, String unionId, HttpServletResponse response) {
|
||||
public void exportExcel(String unionId, HttpServletResponse response) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("YEAR(submitTime)", "=", year);
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and("unionId", "=", SecurityUtil.getUnionId());
|
||||
} else {
|
||||
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.member.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.member.service.FundMemberService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 基金会员离退休审核。
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/fundMember/retiredApproval")
|
||||
@Ok("json:full")
|
||||
@Api("基金会员-离退休审核")
|
||||
public class FundMemberRetiredApprovalController {
|
||||
|
||||
@Inject
|
||||
private FundMemberService fundMemberService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/zhgh/dayofficework/fund/member/retiredApproval/index.html")
|
||||
@SaCheckPermission("fundMember.retiredApproval")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/platform/zhghh5/dayofficework/fund/member/retiredApproval/index.html")
|
||||
@SaCheckPermission("h5.fundMember.retiredApproval")
|
||||
public void h5() {
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"fundMember.retiredApproval", "h5.fundMember.retiredApproval"}, mode = SaMode.OR)
|
||||
public Result pageData(PageForm pageForm, boolean approval) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
ins.variable instanceVariable,
|
||||
ins.processDefineId instanceProcessDefineId,
|
||||
t.id taskId,
|
||||
t.taskName AS taskKey,
|
||||
t.displayName taskName,
|
||||
t.taskType,
|
||||
t.performType taskPerformType,
|
||||
t.taskState,
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
IFNULL(GROUP_CONCAT(DISTINCT nt.displayName),'结束') curTaskName,
|
||||
IF(rt.id IS NOT NULL, 1, 0) AS canRevoke
|
||||
FROM
|
||||
wf_process_task t
|
||||
LEFT JOIN wf_process_instance ins ON ins.id = t.processInstanceId
|
||||
LEFT JOIN fund_member_apply info ON info.id = ins.businessNo
|
||||
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
|
||||
LEFT JOIN wf_process_task nt ON nt.processInstanceId = ins.id AND nt.taskState = 10
|
||||
LEFT JOIN wf_process_task rt ON rt.processInstanceId = ins.id AND rt.taskParentId = t.id AND rt.taskState = 10
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("t.taskName", "=", "ltx");
|
||||
if (!AuthUtil.hasRole(RoleConstant.SYSADMIN.name())) {
|
||||
cnd.and("ta.actorId", "in", List.of(SecurityUtil.getUserId()));
|
||||
}
|
||||
if (approval) {
|
||||
cnd.and("t.taskState", "in", List.of(ProcessTaskStateEnum.FINISHED.getCode(), ProcessTaskStateEnum.INTERRUPT.getCode()));
|
||||
} else {
|
||||
cnd.and("t.taskState", "=", ProcessTaskStateEnum.DOING.getCode());
|
||||
}
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup searchGroup = new SqlExpressionGroup();
|
||||
searchGroup.orLike("info.loginName", pageForm.getSearchKeyword());
|
||||
searchGroup.orLike("info.userName", pageForm.getSearchKeyword());
|
||||
cnd.and(searchGroup);
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
cnd.desc("t.createdAt");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = fundMemberService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
}
|
||||
+9
-1
@@ -77,6 +77,7 @@ public class FundMemberWriteController {
|
||||
@SLog(tag = "基金会员-填写申请", msg = "提交申请")
|
||||
public Result submit(@Param("data") FundMemberApply fundMember) {
|
||||
fundMemberService.validateCurrentUserNotFundMember();
|
||||
fundMemberService.validateApplyForm(fundMember);
|
||||
if (StrUtil.isBlank(fundMember.getId())) {
|
||||
fundMemberService.validateApply();
|
||||
}
|
||||
@@ -88,6 +89,8 @@ public class FundMemberWriteController {
|
||||
args.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.APPLY.getCode());
|
||||
args.set(FlowConst.FORM_DATA, fundMember);
|
||||
args.set(FlowConst.TASK_FORM_DATA_PREFIX + "userState", fundMember.getUserState());
|
||||
// 会员类别作为流程条件变量,供 JJHY 的离退休、分工会审核分支使用。
|
||||
args.set(FlowConst.TASK_FORM_DATA_PREFIX + "aidFundMemberType", fundMember.getAidFundMemberType());
|
||||
ProcessInstance instance = flowEngine.startProcessInstanceByKey("JJHY", fundMember.getId(), SecurityUtil.getUserId(), args);
|
||||
|
||||
// 自动完成第一个申请任务
|
||||
@@ -105,6 +108,7 @@ public class FundMemberWriteController {
|
||||
@SLog(tag = "基金会员-填写申请", msg = "重新提交申请")
|
||||
public Result submitAgain(@Param("data") FundMemberApply fundMember, @Param("taskId") Long taskId) {
|
||||
fundMemberService.validateCurrentUserNotFundMember();
|
||||
fundMemberService.validateApplyForm(fundMember);
|
||||
if (StrUtil.isBlank(fundMember.getId())) {
|
||||
fundMemberService.validateApply();
|
||||
}
|
||||
@@ -113,12 +117,16 @@ public class FundMemberWriteController {
|
||||
Dict dict = Dict.create();
|
||||
dict.set(FlowConst.PROCESS_TASK_ID_KEY, taskId);
|
||||
dict.set(FlowConst.SUBMIT_TYPE, ProcessSubmitTypeEnum.RE_APPLY.getCode());
|
||||
// 退回后重新提交时同步表单与条件变量,避免分支仍使用首次提交的会员类别。
|
||||
dict.set(FlowConst.FORM_DATA, fundMember);
|
||||
dict.set(FlowConst.TASK_FORM_DATA_PREFIX + "userState", fundMember.getUserState());
|
||||
dict.set(FlowConst.TASK_FORM_DATA_PREFIX + "aidFundMemberType", fundMember.getAidFundMemberType());
|
||||
flowCommonService.executeTask(dict);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"fundMember.write", "fundMember.mine", "fundMember.branchUnionApproval", "fundMember.schoolUnionApproval", "h5.fundMember.write", "h5.fundMember.mine", "h5.fundMember.branchUnionApproval", "h5.fundMember.schoolUnionApproval"}, mode = SaMode.OR)
|
||||
@SaCheckPermission(value = {"fundMember.write", "fundMember.mine", "fundMember.branchUnionApproval", "fundMember.retiredApproval", "fundMember.schoolUnionApproval", "h5.fundMember.write", "h5.fundMember.mine", "h5.fundMember.branchUnionApproval", "h5.fundMember.retiredApproval", "h5.fundMember.schoolUnionApproval"}, mode = SaMode.OR)
|
||||
@ApiOperation("获取申请信息")
|
||||
public Result info(@Param("id") String id) {
|
||||
FundMemberApply box = dao.fetch(FundMemberApply.class, id);
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.member.mode;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 基金会员缴费导入模板。
|
||||
*/
|
||||
@Data
|
||||
public class FundMemberPayImportTemp {
|
||||
|
||||
@Excel(name = "年度")
|
||||
private Integer year;
|
||||
|
||||
@Excel(name = "工号")
|
||||
private String loginName;
|
||||
|
||||
@Excel(name = "姓名")
|
||||
private String userName;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.member.models;
|
||||
|
||||
import com.budwk.app.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.ColDefine;
|
||||
import org.nutz.dao.entity.annotation.ColType;
|
||||
import org.nutz.dao.entity.annotation.Column;
|
||||
import org.nutz.dao.entity.annotation.Comment;
|
||||
import org.nutz.dao.entity.annotation.Default;
|
||||
import org.nutz.dao.entity.annotation.Index;
|
||||
import org.nutz.dao.entity.annotation.Name;
|
||||
import org.nutz.dao.entity.annotation.Table;
|
||||
import org.nutz.dao.entity.annotation.TableIndexes;
|
||||
import org.nutz.dao.entity.annotation.TableMeta;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 基金会员年度缴费记录。
|
||||
*/
|
||||
@Data
|
||||
@Table("fund_member_pay")
|
||||
@TableMeta("{'mysql-charset':'utf8mb4'}")
|
||||
@TableIndexes({
|
||||
@Index(name = "UK_FUND_MEMBER_PAY_USER_YEAR", fields = {"userId", "year"}, unique = true),
|
||||
@Index(name = "IDX_FUND_MEMBER_PAY_YEAR", fields = {"year"}, unique = false)
|
||||
})
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Comment("基金会员年度缴费记录")
|
||||
public class FundMemberPay extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("用户ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("年度")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer year;
|
||||
|
||||
@Column
|
||||
@Comment("缴费金额")
|
||||
@ColDefine(customType = "decimal(10,2)")
|
||||
private BigDecimal money;
|
||||
|
||||
@Column
|
||||
@Comment("是否已缴费")
|
||||
@Default("0")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isPayed;
|
||||
|
||||
@Column
|
||||
@Comment("基金会员类别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String aidFundMemberType;
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.member.service;
|
||||
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.member.models.FundMemberPay;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.member.vo.FundMemberPayPageForm;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 基金会员缴费管理服务。
|
||||
*/
|
||||
public interface FundMemberPayService extends BaseService<FundMemberPay> {
|
||||
|
||||
/**
|
||||
* 生成指定年度的基金会员缴费名单。
|
||||
*
|
||||
* @param year 缴费年度
|
||||
* @return 新增的缴费记录数量
|
||||
*/
|
||||
int createPayList(Integer year);
|
||||
|
||||
/**
|
||||
* 构建缴费记录分页及导出共用查询。
|
||||
*
|
||||
* @param pageForm 查询条件
|
||||
* @return 缴费记录查询 SQL
|
||||
*/
|
||||
Sql buildPageSql(FundMemberPayPageForm pageForm);
|
||||
|
||||
/**
|
||||
* 修改单条缴费记录的缴费状态。
|
||||
*
|
||||
* @param id 缴费记录 ID
|
||||
* @param isPayed 是否已缴费
|
||||
*/
|
||||
void updatePayed(String id, Boolean isPayed);
|
||||
|
||||
/**
|
||||
* 清空本年度全部基金会员缴费记录。
|
||||
*
|
||||
* @param year 缴费年度,必须为当前年度
|
||||
*/
|
||||
void clearCurrentYearPayList(Integer year);
|
||||
|
||||
/**
|
||||
* 根据导入工号批量标记缴费状态。
|
||||
*
|
||||
* @param year 缴费年度
|
||||
* @param loginNames 导入工号集合
|
||||
* @return 未找到对应年度缴费记录的工号集合
|
||||
*/
|
||||
List<String> markPaidByLoginNames(Integer year, List<String> loginNames);
|
||||
}
|
||||
+7
@@ -22,6 +22,13 @@ public interface FundMemberService extends BaseService<FundMemberApply> {
|
||||
*/
|
||||
void validateCurrentUserNotFundMember();
|
||||
|
||||
/**
|
||||
* 校验基金会员申请业务字段。
|
||||
*
|
||||
* @param fundMember 基金会员申请信息
|
||||
*/
|
||||
void validateApplyForm(FundMemberApply fundMember);
|
||||
|
||||
/**
|
||||
* 修改大病基金会员类别。
|
||||
*
|
||||
|
||||
+285
@@ -0,0 +1,285 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.member.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.member.models.FundMemberChangeRecord;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.member.models.FundMemberPay;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.member.service.FundMemberPayService;
|
||||
import com.budwk.app.zhgh.dayofficework.fund.member.vo.FundMemberPayPageForm;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.apply.model.MutualApply;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.config.model.MutualMemberConfig;
|
||||
import com.budwk.app.zhgh.staffbenefit.medicalMutualAid.config.service.MedicalMutualAidConfigService;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 基金会员缴费管理服务实现。
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class FundMemberPayServiceImpl extends BaseServiceImpl<FundMemberPay> implements FundMemberPayService {
|
||||
|
||||
@Inject
|
||||
private MedicalMutualAidConfigService medicalMutualAidConfigService;
|
||||
|
||||
public FundMemberPayServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int createPayList(Integer year) {
|
||||
if (year == null) {
|
||||
throw new RuntimeException("缴费年度不能为空");
|
||||
}
|
||||
if (count(Cnd.where(FundMemberPay::getYear, "=", year)) > 0) {
|
||||
throw new RuntimeException(year + "年缴费名单已生成,请勿重复生成");
|
||||
}
|
||||
MutualMemberConfig memberConfig = medicalMutualAidConfigService.getMemberConfigForPay(year);
|
||||
if (memberConfig == null || memberConfig.getMonthAmount() == null
|
||||
|| memberConfig.getMonthAmount().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
throw new RuntimeException("未维护有效的会员缴费配置,请先在医疗互助配置中设置每月缴费金额");
|
||||
}
|
||||
if (memberConfig.getHalfPriceYear() == null || memberConfig.getHalfPriceYear() <= 0) {
|
||||
throw new RuntimeException("会员缴费配置的缴费减半年限必须大于 0");
|
||||
}
|
||||
|
||||
List<Sys_user> members = dao().query(Sys_user.class,
|
||||
Cnd.where(Sys_user::getAidFundMember, "=", true));
|
||||
if (members.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
List<String> loginNames = members.stream().map(Sys_user::getLoginname).collect(Collectors.toList());
|
||||
List<FundMemberChangeRecord> joinRecords = dao().query(FundMemberChangeRecord.class,
|
||||
Cnd.where(FundMemberChangeRecord::getLoginName, "in", loginNames)
|
||||
.and(FundMemberChangeRecord::getIsJoin, "=", true)
|
||||
.asc(FundMemberChangeRecord::getChangeTime));
|
||||
Map<String, Date> joinTimeMap = new HashMap<>();
|
||||
for (FundMemberChangeRecord joinRecord : joinRecords) {
|
||||
// 同一会员可能存在多次加入记录,按时间升序覆盖后保留最近一次实际入会时间。
|
||||
joinTimeMap.put(joinRecord.getLoginName(), joinRecord.getChangeTime());
|
||||
}
|
||||
List<MutualApply> approvedApplies = dao().query(MutualApply.class,
|
||||
Cnd.where(MutualApply::getLoginName, "in", loginNames)
|
||||
.and(MutualApply::getStatus, "=", 1)
|
||||
.desc(MutualApply::getSubmitTime));
|
||||
Map<String, Date> latestApplyTimeMap = new HashMap<>();
|
||||
for (MutualApply approvedApply : approvedApplies) {
|
||||
Date submitTime = approvedApply.getSubmitTime();
|
||||
if (submitTime == null || toLocalDate(submitTime).getYear() > year) {
|
||||
continue;
|
||||
}
|
||||
latestApplyTimeMap.merge(approvedApply.getLoginName(), submitTime,
|
||||
(oldTime, newTime) -> newTime.after(oldTime) ? newTime : oldTime);
|
||||
}
|
||||
|
||||
List<FundMemberPay> payList = members.stream().map(member -> {
|
||||
BigDecimal money = calculatePayMoney(year, joinTimeMap.get(member.getLoginname()),
|
||||
latestApplyTimeMap.get(member.getLoginname()), memberConfig);
|
||||
if (money.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return null;
|
||||
}
|
||||
FundMemberPay pay = new FundMemberPay();
|
||||
pay.setUserId(member.getId());
|
||||
pay.setYear(year);
|
||||
pay.setMoney(money);
|
||||
pay.setIsPayed(false);
|
||||
pay.setAidFundMemberType(member.getAidFundMemberType());
|
||||
return pay;
|
||||
}).filter(java.util.Objects::nonNull).collect(Collectors.toList());
|
||||
if (payList.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
dao().fastInsert(payList);
|
||||
return payList.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* 按缴费年度、实际入会年月和会员缴费配置计算缴费金额。
|
||||
* 缺少历史入会记录的存量会员按全年收费;入会当年按入会当月(含)至年末的月份数收费。
|
||||
* 入会后已满配置年限,且中间存在已审核医疗互助申请时,从最近申请年份重新计算减半年限。
|
||||
*
|
||||
* @param payYear 缴费年度
|
||||
* @param joinTime 最近一次实际入会时间
|
||||
* @param latestApplyTime 最近一次已审核医疗互助申请提交时间
|
||||
* @param memberConfig 会员缴费配置
|
||||
* @return 应缴金额;缴费年度早于入会年度时返回 0
|
||||
*/
|
||||
private BigDecimal calculatePayMoney(Integer payYear, Date joinTime, Date latestApplyTime,
|
||||
MutualMemberConfig memberConfig) {
|
||||
BigDecimal money = calculateBasePayMoney(payYear, joinTime, memberConfig.getMonthAmount());
|
||||
if (money.compareTo(BigDecimal.ZERO) > 0
|
||||
&& shouldApplyHalfPrice(payYear, joinTime, latestApplyTime, memberConfig.getHalfPriceYear())) {
|
||||
return money.divide(BigDecimal.valueOf(2));
|
||||
}
|
||||
return money;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按入会时间计算未优惠前的年度应缴金额。
|
||||
*/
|
||||
private BigDecimal calculateBasePayMoney(Integer payYear, Date joinTime, BigDecimal monthlyPayAmount) {
|
||||
if (joinTime == null) {
|
||||
return monthlyPayAmount.multiply(BigDecimal.valueOf(12));
|
||||
}
|
||||
LocalDate joinDate = toLocalDate(joinTime);
|
||||
if (payYear < joinDate.getYear()) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
if (payYear > joinDate.getYear()) {
|
||||
return monthlyPayAmount.multiply(BigDecimal.valueOf(12));
|
||||
}
|
||||
int payMonths = 13 - joinDate.getMonthValue();
|
||||
return monthlyPayAmount.multiply(BigDecimal.valueOf(payMonths));
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否达到减半年限:从入会年份起算,最近一次已审核医疗互助申请会重置起算年份。
|
||||
*/
|
||||
private boolean shouldApplyHalfPrice(Integer payYear, Date joinTime, Date latestApplyTime, Integer halfPriceYear) {
|
||||
if (joinTime == null || halfPriceYear == null || halfPriceYear <= 0) {
|
||||
return false;
|
||||
}
|
||||
int startYear = toLocalDate(joinTime).getYear();
|
||||
if (latestApplyTime != null) {
|
||||
startYear = Math.max(startYear, toLocalDate(latestApplyTime).getYear());
|
||||
}
|
||||
return payYear - startYear >= halfPriceYear;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将历史日期统一转换为本地日期,避免年度判断受时区影响。
|
||||
*/
|
||||
private LocalDate toLocalDate(Date date) {
|
||||
return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sql buildPageSql(FundMemberPayPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
pay.id,
|
||||
pay.year,
|
||||
pay.money,
|
||||
pay.isPayed,
|
||||
pay.aidFundMemberType,
|
||||
u.id AS userId,
|
||||
u.loginname AS loginName,
|
||||
u.username AS userName,
|
||||
u.sex,
|
||||
u.unitName,
|
||||
u.unionName,
|
||||
joinRecord.joinTime
|
||||
FROM
|
||||
fund_member_pay pay
|
||||
LEFT JOIN vw_user u ON u.id = pay.userId
|
||||
LEFT JOIN (
|
||||
SELECT loginName, MAX(changeTime) AS joinTime
|
||||
FROM fund_member_change_record
|
||||
WHERE isJoin = 1
|
||||
GROUP BY loginName
|
||||
) joinRecord ON joinRecord.loginName = u.loginname
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("pay.year", "=", pageForm.getYear());
|
||||
cnd.andEX("pay.isPayed", "=", pageForm.getIsPayed());
|
||||
cnd.andEX("pay.aidFundMemberType", "=", pageForm.getAidFundMemberType());
|
||||
cnd.andEX("u.unionId", "=", pageForm.getUnionId());
|
||||
cnd.andEX("u.unitId", "=", pageForm.getUnitId());
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup searchGroup = new SqlExpressionGroup();
|
||||
searchGroup.orLike("u.loginname", pageForm.getSearchKeyword());
|
||||
searchGroup.orLike("u.username", pageForm.getSearchKeyword());
|
||||
cnd.and(searchGroup);
|
||||
}
|
||||
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
cnd.and("u.unionId", "=", SecurityUtil.getUnionId());
|
||||
}
|
||||
cnd.desc("u.unitCode");
|
||||
cnd.asc("u.loginname");
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePayed(String id, Boolean isPayed) {
|
||||
FundMemberPay pay = fetch(id);
|
||||
if (pay == null) {
|
||||
throw new RuntimeException("缴费记录不存在");
|
||||
}
|
||||
update(Chain.make("isPayed", isPayed), Cnd.where(FundMemberPay::getId, "=", id));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCurrentYearPayList(Integer year) {
|
||||
if (year == null) {
|
||||
throw new RuntimeException("缴费年度不能为空");
|
||||
}
|
||||
if (year != DateUtil.thisYear()) {
|
||||
throw new RuntimeException("仅允许清空本年度缴费名单");
|
||||
}
|
||||
clear(Cnd.where(FundMemberPay::getYear, "=", year));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> markPaidByLoginNames(Integer year, List<String> loginNames) {
|
||||
if (year == null) {
|
||||
throw new RuntimeException("缴费年度不能为空");
|
||||
}
|
||||
if (loginNames == null || loginNames.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Set<String> distinctLoginNames = loginNames.stream()
|
||||
.filter(StrUtil::isNotBlank)
|
||||
.map(String::trim)
|
||||
.collect(Collectors.toSet());
|
||||
if (distinctLoginNames.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<Sys_user> users = dao().query(Sys_user.class,
|
||||
Cnd.where(Sys_user::getLoginname, "in", new ArrayList<>(distinctLoginNames)));
|
||||
Map<String, Sys_user> userMap = users.stream()
|
||||
.collect(Collectors.toMap(Sys_user::getLoginname, Function.identity()));
|
||||
List<String> userIds = users.stream().map(Sys_user::getId).collect(Collectors.toList());
|
||||
List<FundMemberPay> payList = userIds.isEmpty() ? Collections.emptyList() : query(
|
||||
Cnd.where(FundMemberPay::getYear, "=", year)
|
||||
.and(FundMemberPay::getUserId, "in", userIds));
|
||||
Set<String> paidUserIds = payList.stream().map(FundMemberPay::getUserId).collect(Collectors.toSet());
|
||||
if (!paidUserIds.isEmpty()) {
|
||||
update(Chain.make("isPayed", true),
|
||||
Cnd.where(FundMemberPay::getYear, "=", year)
|
||||
.and(FundMemberPay::getUserId, "in", new ArrayList<>(paidUserIds)));
|
||||
}
|
||||
|
||||
return distinctLoginNames.stream()
|
||||
.filter(loginName -> !userMap.containsKey(loginName)
|
||||
|| !paidUserIds.contains(userMap.get(loginName).getId()))
|
||||
.sorted()
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
+10
@@ -54,6 +54,16 @@ public class FundMemberServiceImpl extends BaseServiceImpl<FundMemberApply> impl
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateApplyForm(FundMemberApply fundMember) {
|
||||
if (fundMember == null || StrUtil.isBlank(fundMember.getAidFundMemberType())) {
|
||||
throw new RuntimeException("会员类别不能为空");
|
||||
}
|
||||
if ("退休".equals(fundMember.getAidFundMemberType()) && fundMember.getRetireTime() == null) {
|
||||
throw new RuntimeException("会员类别为退休时,退休时间不能为空");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAidFundMemberType(String loginName, String aidFundMemberType) {
|
||||
if (StrUtil.isBlank(loginName)) {
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.budwk.app.zhgh.dayofficework.fund.member.vo;
|
||||
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 基金会员缴费记录查询参数。
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class FundMemberPayPageForm extends PageForm {
|
||||
|
||||
private Integer year;
|
||||
|
||||
private String unionId;
|
||||
|
||||
private String unitId;
|
||||
|
||||
private String aidFundMemberType;
|
||||
|
||||
private Boolean isPayed;
|
||||
}
|
||||
+5
@@ -23,6 +23,11 @@ public class MutualMemberConfig {
|
||||
@Comment("主键")
|
||||
private Long id;
|
||||
|
||||
/** 配置所属年度,用于生成对应年度的基金会员缴费名单。 */
|
||||
@Column("year")
|
||||
@Comment("年度")
|
||||
private Integer year;
|
||||
|
||||
/** 每月缴纳互助金额。 */
|
||||
@Column("month_amount")
|
||||
@Comment("每月缴纳互助金额(元)")
|
||||
|
||||
+13
-3
@@ -93,11 +93,21 @@ public interface MedicalMutualAidConfigService extends BaseService<MutualConfig>
|
||||
void deleteBonus(Long bonusId);
|
||||
|
||||
/**
|
||||
* 查询会员缴费配置,未配置时返回页面默认值。
|
||||
* 查询指定年度的会员缴费配置。
|
||||
*
|
||||
* @return 会员缴费配置
|
||||
* @param year 配置年度
|
||||
* @return 对应年度的会员缴费配置;未配置时返回 null
|
||||
*/
|
||||
MutualMemberConfig getMemberConfig();
|
||||
MutualMemberConfig getMemberConfig(Integer year);
|
||||
|
||||
/**
|
||||
* 查询生成缴费名单应使用的会员缴费配置。
|
||||
* 优先使用缴费年度配置,未配置时使用最新年度配置。
|
||||
*
|
||||
* @param payYear 缴费年度
|
||||
* @return 可用于生成名单的会员缴费配置;未配置时返回 null
|
||||
*/
|
||||
MutualMemberConfig getMemberConfigForPay(Integer payYear);
|
||||
|
||||
/**
|
||||
* 保存会员缴费配置。
|
||||
|
||||
+27
-13
@@ -49,7 +49,7 @@ public class MedicalMutualAidConfigServiceImpl extends BaseServiceImpl<MutualCon
|
||||
.addv("config", config)
|
||||
.addv("ratios", configId == null ? List.of() : listRatios(configId))
|
||||
.addv("bonuses", configId == null ? List.of() : listBonuses(configId))
|
||||
.addv("memberConfig", getMemberConfig());
|
||||
.addv("memberConfig", getMemberConfig(configYear));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,30 +170,44 @@ public class MedicalMutualAidConfigServiceImpl extends BaseServiceImpl<MutualCon
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询会员缴费配置;未配置时返回默认表单,方便页面直接展示。
|
||||
* 按年度读取会员缴费配置,供年度配置页面编辑时精准回显。
|
||||
*/
|
||||
@Override
|
||||
public MutualMemberConfig getMemberConfig() {
|
||||
MutualMemberConfig memberConfig = dao().fetch(MutualMemberConfig.class, Cnd.NEW());
|
||||
if (memberConfig != null) {
|
||||
return memberConfig;
|
||||
public MutualMemberConfig getMemberConfig(Integer year) {
|
||||
if (year == null) {
|
||||
return null;
|
||||
}
|
||||
MutualMemberConfig defaultConfig = new MutualMemberConfig();
|
||||
defaultConfig.setMonthAmount(new BigDecimal("0.00"));
|
||||
defaultConfig.setHalfPriceYear(1);
|
||||
return defaultConfig;
|
||||
return dao().fetch(MutualMemberConfig.class, Cnd.where("year", "=", year));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存会员缴费配置时复用已有唯一记录,避免产生多条全局缴费配置。
|
||||
* 生成缴费名单时优先匹配缴费年度,未维护该年度配置才兜底使用最新年度配置。
|
||||
*/
|
||||
@Override
|
||||
public MutualMemberConfig getMemberConfigForPay(Integer payYear) {
|
||||
MutualMemberConfig yearConfig = getMemberConfig(payYear);
|
||||
if (yearConfig != null) {
|
||||
return yearConfig;
|
||||
}
|
||||
return dao().query(MutualMemberConfig.class, Cnd.NEW().desc("year").desc("id")).stream()
|
||||
.filter(config -> config.getYear() != null)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按年度保存会员缴费配置,同一年只保留一条记录。
|
||||
*/
|
||||
@Override
|
||||
public MutualMemberConfig saveMemberConfig(MutualMemberConfig memberConfig) {
|
||||
if (memberConfig == null) {
|
||||
throw new BaseException("会员缴费配置不能为空");
|
||||
}
|
||||
MutualMemberConfig oldConfig = dao().fetch(MutualMemberConfig.class, Cnd.NEW());
|
||||
if (oldConfig != null && memberConfig.getId() == null) {
|
||||
if (memberConfig.getYear() == null) {
|
||||
throw new BaseException("会员缴费配置年度不能为空");
|
||||
}
|
||||
MutualMemberConfig oldConfig = getMemberConfig(memberConfig.getYear());
|
||||
if (oldConfig != null && (memberConfig.getId() == null || !oldConfig.getId().equals(memberConfig.getId()))) {
|
||||
memberConfig.setId(oldConfig.getId());
|
||||
}
|
||||
return dao().insertOrUpdate(memberConfig);
|
||||
|
||||
@@ -111,6 +111,12 @@ module.exports = {
|
||||
errorList: 0
|
||||
}
|
||||
},
|
||||
clearImportFile() {
|
||||
this.$set(this.importData, "fileList", [])
|
||||
if (this.$refs.upload) {
|
||||
this.$refs.upload.clearFiles()
|
||||
}
|
||||
},
|
||||
doImport() {
|
||||
if (this.importData.fileList.length === 0) {
|
||||
this.$message.error({
|
||||
@@ -122,6 +128,10 @@ module.exports = {
|
||||
const data = new FormData()
|
||||
data.append("isFlag", this.importData.isFlag)
|
||||
data.append("businessId", this.business_id)
|
||||
// 部分业务导入需要页面上下文参数(如缴费年度),有值时一并提交。
|
||||
if (this.importData.year) {
|
||||
data.append("year", this.importData.year)
|
||||
}
|
||||
this.importData.fileList.forEach((val) => {
|
||||
data.append("file", val.raw, val.raw.name)
|
||||
})
|
||||
@@ -132,20 +142,28 @@ module.exports = {
|
||||
background: "rgba(0, 0, 0, 0.7)"
|
||||
})
|
||||
this.$axios.post(this.post_url, data).then((res) => {
|
||||
loading.close()
|
||||
if (res.code === 0) {
|
||||
if (res.data) {
|
||||
this.$message.warning("导入失败")
|
||||
this.errorInfoData = res.data
|
||||
this.$emit("flush")
|
||||
} else {
|
||||
this.$message.success("导入成功")
|
||||
this.$emit("flush")
|
||||
this.resetImportData()
|
||||
}
|
||||
} else {
|
||||
this.$message.warning("导入失败")
|
||||
if (res.code !== 0) {
|
||||
this.$message.error(res.msg || "导入失败")
|
||||
return
|
||||
}
|
||||
// 导入接口统一返回统计数据,先回显统计再按错误数量提示结果。
|
||||
if (res.data) {
|
||||
this.errorInfoData = res.data
|
||||
}
|
||||
if (res.data && Number(res.data.errorCount) > 0) {
|
||||
this.$message.warning("导入完成,存在异常记录")
|
||||
this.$emit("flush")
|
||||
return
|
||||
}
|
||||
this.$message.success("导入成功")
|
||||
this.$emit("flush")
|
||||
// 成功后仅清除文件,保留本次导入统计供用户核对。
|
||||
this.clearImportFile()
|
||||
}).catch(() => {
|
||||
this.$message.error("导入失败,请稍后重试")
|
||||
}).finally(() => {
|
||||
// 请求成功、校验失败或网络异常时都必须关闭导入遮罩。
|
||||
loading.close()
|
||||
})
|
||||
},
|
||||
exportErrors() {
|
||||
|
||||
+206
@@ -0,0 +1,206 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="缴费年度">
|
||||
<el-date-picker v-model="pageForm.year" type="year" value-format="yyyy" :clearable="false"
|
||||
placeholder="请选择年度" style="width: 100%" @change="doSearch"></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="姓名/工号">
|
||||
<el-input v-model="pageForm.searchKeyword" clearable placeholder="请输入姓名或工号"
|
||||
@keyup.enter.native="doSearch"></el-input>
|
||||
</search-item>
|
||||
<search-item label="会员类别">
|
||||
<dict-select v-model="pageForm.aidFundMemberType" code="USER_AID_FUND_MEMBER_TYPE"
|
||||
placeholder="请选择会员类别" style="width: 100%"></dict-select>
|
||||
</search-item>
|
||||
<search-item label="所属分工会">
|
||||
<el-select v-model="pageForm.unionId" clearable filterable placeholder="请选择分工会"
|
||||
style="width: 100%" @change="unionChange">
|
||||
<el-option v-for="item in unionList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select v-model="pageForm.unitId" clearable filterable placeholder="请选择单位" style="width: 100%">
|
||||
<el-option v-for="item in unitList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="基金会员缴费">
|
||||
<el-radio-group v-model="pageForm.isPayed" size="small" @change="doSearch">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已缴费</el-radio-button>
|
||||
<el-radio-button :label="false">未缴费</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-button size="small" type="primary" icon="el-icon-plus" @click="createPayList">生成年度名单</el-button>
|
||||
<el-button size="small" type="primary" icon="el-icon-upload2" @click="openImport">导入缴费记录</el-button>
|
||||
<el-button size="small" type="primary" icon="el-icon-download" @click="exportPayRecord">导出名单</el-button>
|
||||
<el-button size="small" type="danger" icon="el-icon-delete" :disabled="tableData.length === 0"
|
||||
@click="clearPayRecord">清空{{pageForm.year}}年缴费名单</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" row-key="id" style="width: 100%"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column type="index" label="序号" width="60px" :index="indexMethod" align="center"></el-table-column>
|
||||
<el-table-column prop="year" label="缴费年度" width="100px" align="center"></el-table-column>
|
||||
<el-table-column prop="loginName" label="工号" min-width="110px" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="userName" label="姓名" min-width="100px" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="sex" label="性别" width="80px" align="center"></el-table-column>
|
||||
<el-table-column prop="aidFundMemberType" label="会员类别" min-width="120px" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="unitName" label="所属单位" min-width="150px" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="unionName" label="所属分工会" min-width="150px" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="joinTime" label="加入时间" width="120px" align="center"></el-table-column>
|
||||
<el-table-column prop="money" label="缴费金额(元)" width="130px" align="right"></el-table-column>
|
||||
<el-table-column prop="isPayed" label="缴费状态" width="100px" align="center">
|
||||
<template slot-scope="{row}">
|
||||
<el-tag v-if="row.isPayed" type="success">已缴费</el-tag>
|
||||
<el-tag v-else type="info">未缴费</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="130px" align="center">
|
||||
<template slot-scope="{row}">
|
||||
<el-button v-if="!row.isPayed" size="mini" type="primary" @click="updatePayed(row, true)">设为已缴</el-button>
|
||||
<el-button v-else size="mini" type="danger" @click="updatePayed(row, false)">设为未缴</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #edit>
|
||||
<file-import ref="viewImport" temp_url="/platform/fundMember/payRecord/downloadImportTemp"
|
||||
post_url="/platform/fundMember/payRecord/doImport" @flush="pageData"></file-import>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"file-import": httpVueLoader("/components/plugins/sysImport/index.vue")
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
year: this.$moment().format("YYYY"),
|
||||
searchKeyword: "",
|
||||
unionId: "",
|
||||
unitId: "",
|
||||
aidFundMemberType: "",
|
||||
isPayed: null
|
||||
},
|
||||
unionList: [],
|
||||
unitList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
createPayList() {
|
||||
if (!this.pageForm.year) {
|
||||
this.notifyWarning("请选择缴费年度")
|
||||
return
|
||||
}
|
||||
this.$axios.post(loc() + "/memberConfig", {year: this.pageForm.year}).then((configRes) => {
|
||||
if (configRes.code !== 0) {
|
||||
this.$message.error(configRes.msg)
|
||||
return
|
||||
}
|
||||
this.$confirm("将按会员入会月份生成" + this.pageForm.year + "年缴费名单:入会当年从当月起按每月 " + configRes.data.monthAmount + " 元计算,是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.tableLoading = true
|
||||
this.$axios.post(loc() + "/createPayList", {year: this.pageForm.year}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
openImport() {
|
||||
if (!this.pageForm.year) {
|
||||
this.notifyWarning("请选择缴费年度")
|
||||
return
|
||||
}
|
||||
this.$refs.guava.edit(() => {
|
||||
setTimeout(() => {
|
||||
this.$refs.viewImport.resetImportData()
|
||||
this.$set(this.$refs.viewImport.importData, "year", this.pageForm.year)
|
||||
}, 500)
|
||||
})
|
||||
},
|
||||
exportPayRecord() {
|
||||
if (!this.pageForm.year) {
|
||||
this.notifyWarning("请选择缴费年度")
|
||||
return
|
||||
}
|
||||
this.$downLoad(loc() + "/exportExcel", this.pageForm)
|
||||
},
|
||||
clearPayRecord() {
|
||||
const currentYear = new Date().getFullYear().toString()
|
||||
if (this.pageForm.year !== currentYear) {
|
||||
this.notifyWarning("仅允许清空本年度缴费名单")
|
||||
return
|
||||
}
|
||||
this.$confirm("清空后将删除" + this.pageForm.year + "年全部缴费记录,且无法恢复,是否继续?", "危险操作", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.tableLoading = true
|
||||
this.$axios.post(loc() + "/clearPayList", {year: this.pageForm.year}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
updatePayed(row, isPayed) {
|
||||
const stateName = isPayed ? "已缴费" : "未缴费"
|
||||
this.$confirm("确认将【" + row.userName + "】设置为" + stateName + "吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.tableLoading = true
|
||||
this.$axios.post(loc() + "/updatePayed", {id: row.id, isPayed: isPayed}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
}
|
||||
}).finally(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
async unionChange(unionId) {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
this.$set(this, "unitList", await this.$businessTool.listUnit(unionId))
|
||||
this.doSearch()
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.$set(this, "unionList", await this.$businessTool.listUnion())
|
||||
this.$set(this, "unitList", await this.$businessTool.listUnit())
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -83,6 +83,9 @@ layout("/layouts/platform.html"){
|
||||
code="USER_AID_FUND_MEMBER_TYPE" style="width: 100%"
|
||||
@change="onAidFundMemberTypeChange(row)"></dict-select>
|
||||
</template>
|
||||
<template v-else-if="column.prop === 'joinTime'" scope="{row}">
|
||||
{{ formatDate(row.joinTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="200px">
|
||||
<template slot-scope="{row}">
|
||||
@@ -133,6 +136,10 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 查询列表中的加入时间仅展示年月日,避免显示接口返回的时分秒。
|
||||
formatDate(value) {
|
||||
return value ? this.$moment(value).format('YYYY-MM-DD') : '-'
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.$refs.fundMemberInfoRef.onOpen(row)
|
||||
@@ -193,12 +200,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
// 导出登记汇总表
|
||||
exportExcel() {
|
||||
if (!this.pageForm.year) {
|
||||
this.$message.error('请选择年度再导出')
|
||||
return
|
||||
}
|
||||
this.$downLoad('/platform/fundMember/query/exportExcel', {
|
||||
year: this.pageForm.year,
|
||||
unionId: this.pageForm.unionId
|
||||
})
|
||||
},
|
||||
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker v-model="pageForm.year" type="year" value-format="yyyy" placeholder="请选择年度"
|
||||
style="width: 100%"></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="姓名/工号">
|
||||
<el-input v-model="pageForm.searchKeyword" placeholder="请输入姓名或工号" clearable></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-radio-group v-model="pageForm.approval" size="small" @change="doSearch">
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
|
||||
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
|
||||
<el-table-column prop="loginName" label="工号"></el-table-column>
|
||||
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||
<el-table-column prop="aidFundMemberType" label="会员类别"></el-table-column>
|
||||
<el-table-column prop="submitTime" label="申请时间"></el-table-column>
|
||||
<el-table-column prop="curTaskName" label="当前节点"></el-table-column>
|
||||
<el-table-column prop="instanceState" label="流程状态">
|
||||
<template slot-scope="{row}">
|
||||
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message" size="small"></enum-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="300px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="row.taskState === 10" @click="openAudit(row)" size="mini" type="primary">审核</el-button>
|
||||
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
<template #edit>
|
||||
<fund-member-info ref="fundMemberInfoRef">
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">{{formData.taskName}}</div>
|
||||
<el-form :model="formData" ref="formRef" label-width="0" label-suffix=":" class="flow-task-form">
|
||||
<el-form-item label="审批意见" prop="tf_opinion" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
|
||||
<el-button @click="handleTaskAction(6)" size="small" type="info">退回到发起人</el-button>
|
||||
<el-button @click="handleTaskAction(2)" size="small" type="danger">拒绝申请</el-button>
|
||||
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意申请</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</fund-member-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include('../info.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
components: {"fund-member-info": fundMemberInfo},
|
||||
data() {
|
||||
return {pageForm: {approval: false}, formData: {}, showApprovalForm: false}
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = false
|
||||
this.$refs.fundMemberInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
openAudit(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = true
|
||||
this.formData = {processTaskId: row.taskId, taskName: row.curTaskName}
|
||||
this.$refs.fundMemberInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate(valid => {
|
||||
if (!valid) return
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定", cancelButtonText: "取消", type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify(Object.assign({}, this.formData, {submitType: val}))
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
onRevoke(row) {
|
||||
this.$confirm("您确定要撤回吗?", "提示", {
|
||||
confirmButtonText: "确定", cancelButtonText: "取消", type: "info"
|
||||
}).then(() => {
|
||||
this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -125,7 +125,7 @@ layout("/layouts/platform.html"){
|
||||
</el-row>
|
||||
-->
|
||||
|
||||
<el-form-item label="家庭主要成员" prop="families" required>
|
||||
<el-form-item label="家庭主要成员" prop="families">
|
||||
<el-table :data="formData.families" border size="small">
|
||||
<el-table-column label="序号" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
@@ -223,8 +223,21 @@ layout("/layouts/platform.html"){
|
||||
healthStatus: [{required: true, message: '请输入健康状况', trigger: 'blur'}],
|
||||
education: [{required: true, message: '请选择学历', trigger: 'change'}],
|
||||
joinWorkTime: [{required: true, message: '请选择入职时间', trigger: 'blur'}],
|
||||
retireTime: [{required: false, message: '请选择退休时间', trigger: 'blur'}],
|
||||
retireTime: [{validator: function (rule, value, callback) {
|
||||
if (this.formData.aidFundMemberType === '退休' && !value) {
|
||||
callback(new Error('会员类别为退休时,请选择退休时间'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
}.bind(this), trigger: ['change', 'blur']}],
|
||||
aidFundMemberType: [{required: true, message: '请选择会员类别', trigger: 'change'}],
|
||||
families: [{required: true, validator: function (rule, value, callback) {
|
||||
if (!Array.isArray(value) || value.length === 0) {
|
||||
callback(new Error('请至少添加一名家庭主要成员'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
}, trigger: 'change'}],
|
||||
mobile: [{required: true, message: '请输入手机号码', trigger: 'blur'},
|
||||
{
|
||||
pattern: /^1[3456789]\d{9}$/,
|
||||
|
||||
+19
-6
@@ -353,12 +353,15 @@ layout("/layouts/platform.html"){
|
||||
<div class="dialog-section">
|
||||
<div class="dialog-section-title">会员缴费配置</div>
|
||||
<el-form :model="memberForm" :rules="memberRules" ref="memberFormRef" label-width="190px" style="max-width: 760px">
|
||||
<el-form-item label="年度" prop="year">
|
||||
<el-date-picker :value="memberForm.year" type="year" value-format="yyyy" format="yyyy" placeholder="请选择年度" style="width: 320px" @input="$set(memberForm,'year',$event)"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="每月缴纳互助金额(元)" prop="monthAmount">
|
||||
<el-input-number v-model="memberForm.monthAmount" :min="0" :precision="2" :step="1" controls-position="right" style="width: 320px"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="缴费减半年限" prop="halfPriceYear">
|
||||
<el-input-number v-model="memberForm.halfPriceYear" :min="1" :step="1" controls-position="right" style="width: 320px"></el-input-number>
|
||||
<span style="margin-left: 10px; color: #909399">连续缴费满该年限后,次年缴费减半</span>
|
||||
<span style="margin-left: 10px; color: #909399">自加入或最近一次医疗互助申请年份起满该年限后,次年缴费减半</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -407,6 +410,7 @@ layout("/layouts/platform.html"){
|
||||
status: [{ required: true, message: "请选择状态", trigger: "change" }]
|
||||
},
|
||||
memberRules: {
|
||||
year: [{ required: true, message: "请选择年度", trigger: "change" }],
|
||||
monthAmount: [{ required: true, message: "请输入每月缴纳互助金额", trigger: "change" }],
|
||||
halfPriceYear: [{ required: true, message: "请输入缴费减半年限", trigger: "change" }]
|
||||
}
|
||||
@@ -459,7 +463,9 @@ layout("/layouts/platform.html"){
|
||||
if (resp.code === 0) {
|
||||
this.configForm = resp.data.config || this.defaultConfig(year)
|
||||
this.configForm.year = this.toYearString(this.configForm.year)
|
||||
this.memberForm = resp.data.memberConfig || this.defaultMemberConfig()
|
||||
const memberForm = resp.data.memberConfig || this.defaultMemberConfig(year)
|
||||
this.$set(memberForm, "year", this.toYearString(memberForm.year || year))
|
||||
this.$set(this, "memberForm", memberForm)
|
||||
this.ratioList = resp.data.ratios || []
|
||||
this.bonusList = resp.data.bonuses || []
|
||||
}
|
||||
@@ -476,7 +482,7 @@ layout("/layouts/platform.html"){
|
||||
const year = new Date().getFullYear()
|
||||
this.dialogLoading = false
|
||||
this.configForm = this.defaultConfig(year)
|
||||
this.memberForm = this.defaultMemberConfig()
|
||||
this.$set(this, "memberForm", this.defaultMemberConfig(year))
|
||||
this.ratioList = []
|
||||
this.bonusList = []
|
||||
this.$nextTick(() => {
|
||||
@@ -527,7 +533,7 @@ layout("/layouts/platform.html"){
|
||||
return Promise.reject(resp)
|
||||
}
|
||||
const savedConfig = resp.data
|
||||
const tasks = [this.$axios.post(loc() + "/saveMemberConfig", this.memberForm)]
|
||||
const tasks = [this.$axios.post(loc() + "/saveMemberConfig", this.buildMemberConfigPayload())]
|
||||
this.deletedRatioIds.forEach((id) => {
|
||||
tasks.push(this.$axios.post(loc() + "/deleteRatio", { id: id }))
|
||||
})
|
||||
@@ -642,13 +648,20 @@ layout("/layouts/platform.html"){
|
||||
payload.year = this.toYearNumber(payload.year)
|
||||
return payload
|
||||
},
|
||||
// 会员缴费配置为全局单条配置,未配置时给出可编辑默认值。
|
||||
defaultMemberConfig() {
|
||||
// 会员缴费配置按年度维护,新增配置时默认使用当前年度。
|
||||
defaultMemberConfig(year) {
|
||||
return {
|
||||
year: this.toYearString(year),
|
||||
monthAmount: 0,
|
||||
halfPriceYear: 1
|
||||
}
|
||||
},
|
||||
// 后端年度字段为整型,保存会员缴费配置前统一转换。
|
||||
buildMemberConfigPayload() {
|
||||
const payload = this.copy(this.memberForm)
|
||||
payload.year = this.toYearNumber(payload.year)
|
||||
return payload
|
||||
},
|
||||
// 清理前端临时字段,避免弹窗编辑辅助字段传到后端实体。
|
||||
cleanPayload(row) {
|
||||
const payload = this.copy(row)
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<van-nav-bar title="分工会审核" left-text="返回" left-arrow fixed placeholder @click-left="historyBack"></van-nav-bar>
|
||||
<van-sticky offset-top="46px">
|
||||
<van-search v-model="pageForm.searchKeyword" placeholder="请输入姓名或工号" @search="doSearch"></van-search>
|
||||
<van-tabs v-model="pageForm.approvalText" @change="changeApproval">
|
||||
<van-tab title="已审核" name="1"></van-tab><van-tab title="未审核" name="0"></van-tab>
|
||||
</van-tabs>
|
||||
</van-sticky>
|
||||
<table-list ref="tableListRef" api="/platform/fundMember/branchUnionApproval/pageData" :page_form.sync="pageForm" @ready="doSearch">
|
||||
<template v-slot="{row}"><table-column label="工号">{{row.loginName}}</table-column><table-column label="姓名">{{row.userName}}</table-column><table-column label="会员类别">{{row.aidFundMemberType}}</table-column><table-column label="当前节点">{{row.curTaskName}}</table-column></template>
|
||||
<template #actions="{row}"><div class="action-btn" @click="view(row)"><i class="fa fa-eye"></i><span>查看</span></div><div class="action-btn" v-if="row.taskState===10" @click="audit(row)"><i class="fa fa-check"></i><span>审核</span></div><div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)"><i class="fa fa-undo"></i><span>撤回</span></div></template>
|
||||
</table-list>
|
||||
<h5-fund-member-info ref="infoRef"><div v-if="formData.processTaskId" class="p10"><van-form ref="formRef"><van-field :value="formData.tf_opinion" label="审批意见" type="textarea" required placeholder="请输入审批意见" :rules="[{required:true,message:'请填写审批意见'}]" @input="$set(formData,'tf_opinion',$event)"></van-field></van-form><div class="audit-actions"><van-button block type="info" @click="handleTaskAction(6)">退回</van-button><van-button block type="danger" @click="handleTaskAction(2)">拒绝</van-button><van-button block type="primary" @click="handleTaskAction(1)">同意</van-button></div></div></h5-fund-member-info>
|
||||
</div>
|
||||
<style>.audit-actions{display:flex;column-gap:10px;padding-top:10px}.audit-actions .van-button{flex:1}</style>
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include('../mine/info.js'){}#-->
|
||||
new Vue({el:'#app',store,components:{'h5-fund-member-info':H5_FUND_MEMBER_INFO},data(){return {pageForm:{pageNumber:1,pageSize:10,totalCount:0,searchKeyword:'',approval:false,approvalText:'0'},formData:{}}},methods:{changeApproval(value){this.doSearch(value==='1')},doSearch(approval){if(approval!==undefined){this.$set(this.pageForm,'approval',approval)}this.$set(this.pageForm,'pageNumber',1);this.$set(this.pageForm,'totalCount',0);this.$nextTick(()=>this.$refs.tableListRef.doSearch())},view(row){this.$set(this,'formData',{});this.$refs.infoRef.onOpen(row)},audit(row){this.$set(this,'formData',{processTaskId:row.taskId,taskName:row.curTaskName,tf_opinion:''});this.$refs.infoRef.onOpen(row)},onRevoke(row){this.$dialog.confirm({title:'提示',message:'您确定要撤回吗?'}).then(()=>this.$axios.post('/flow/common/revokeTask',{taskId:row.taskId}).then(res=>{if(res.code===0){this.$toast.success(res.msg||'撤回成功');this.doSearch()}}))},// 与 PC 端保持一致:6 为退回、2 为拒绝、1 为同意。
|
||||
handleTaskAction(submitType){this.$refs.formRef.validate().then(()=>this.$dialog.confirm({title:'提示',message:'您确定要提交吗?'}).then(()=>this.$axios.post('/flow/common/executeTask',{data:JSON.stringify(Object.assign({},this.formData,{submitType:submitType}))}).then(res=>{if(res.code===0){this.$toast.success(res.msg||'提交成功');this.$refs.infoRef.onClose();this.doSearch()}}))).catch(()=>{})}}})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,8 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak><van-nav-bar title="我的基金会员申请" left-text="返回" left-arrow fixed placeholder @click-left="historyBack"></van-nav-bar><van-sticky offset-top="46px"><van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false"><year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item></van-dropdown-menu></van-sticky><table-list ref="tableListRef" api="/platform/fundMember/mine/pageData" :page_form.sync="pageForm" @ready="doSearch"><template v-slot="{row}"><table-column label="工号">{{row.loginName}}</table-column><table-column label="姓名">{{row.userName}}</table-column><table-column label="会员类别">{{row.aidFundMemberType}}</table-column><table-column label="申请时间">{{row.submitTime}}</table-column><table-column label="当前节点">{{row.taskName}}</table-column></template><template #actions="{row}"><div class="action-btn" @click="onView(row)"><i class="fa fa-eye"></i><span>查看</span></div><div class="action-btn" v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onEdit(row)"><i class="fa fa-edit"></i><span>编辑</span></div><div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)"><i class="fa fa-undo"></i><span>撤回</span></div></template></table-list><h5-fund-member-info ref="infoRef"></h5-fund-member-info></div>
|
||||
<script nonce="${cspNonce!}"><!--#include('info.js'){}#-->new Vue({el:'#app',store,components:{'h5-fund-member-info':H5_FUND_MEMBER_INFO},data(){return {pageForm:{pageNumber:1,pageSize:10,totalCount:0,year:new Date().getFullYear()}}},methods:{doSearch(year){if(year!==undefined){this.$set(this.pageForm,'year',year)}this.$set(this.pageForm,'pageNumber',1);this.$set(this.pageForm,'totalCount',0);this.$nextTick(()=>this.$refs.tableListRef.doSearch())},onView(row){this.$refs.infoRef.onOpen(row)},onEdit(row){this.$pjaxReplace('/platform/fundMember/write/h5?bizId='+row.id+'&taskId='+(row.startTaskId||''))},onRevoke(row){this.$dialog.confirm({title:'提示',message:'您确定要撤回吗?'}).then(()=>this.$axios.post('/flow/common/revokeTask',{taskId:row.startTaskId}).then(res=>{if(res.code===0){this.$toast.success('撤回成功');this.doSearch()}}))}}})</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,42 @@
|
||||
const H5_FUND_MEMBER_INFO = {
|
||||
template: [
|
||||
'<van-action-sheet v-model="visible" title="基金会员申请详情"><div class="detail-container">',
|
||||
'<van-cell-group title="申请信息">',
|
||||
'<van-cell title="姓名" :value="viewData.userName || \'-\'"></van-cell>',
|
||||
'<van-cell title="工号" :value="viewData.loginName || \'-\'"></van-cell>',
|
||||
'<van-cell title="出生年月" :value="formatDate(viewData.birthday)"></van-cell>',
|
||||
'<van-cell title="性别" :value="viewData.sex || \'-\'"></van-cell>',
|
||||
'<van-cell title="籍贯" :value="viewData.nativePlace || \'-\'"></van-cell>',
|
||||
'<van-cell title="家庭住址" :value="viewData.address || \'-\'"></van-cell>',
|
||||
'<van-cell title="健康状况" :value="viewData.healthStatus || \'-\'"></van-cell>',
|
||||
'<van-cell title="学历" :value="viewData.education || \'-\'"></van-cell>',
|
||||
'<van-cell title="联系电话" :value="viewData.mobile || \'-\'"></van-cell>',
|
||||
'<van-cell title="入职时间" :value="formatDate(viewData.joinWorkTime)"></van-cell>',
|
||||
'<van-cell title="身份证号码" :value="viewData.idCard || \'-\'"></van-cell>',
|
||||
'<van-cell title="会员类别" :value="viewData.aidFundMemberType || \'-\'"></van-cell>',
|
||||
'<van-cell title="退休时间" :value="viewData.retireTime || \'-\'"></van-cell>',
|
||||
'<van-cell title="家庭主要成员" class="column-cell"><table><tr><th>序号</th><th>姓名</th><th>年龄</th><th>与本人关系</th></tr><tr v-for="(item,index) in viewData.families || []" :key="index"><td style="text-align:center">{{item.sequence || index + 1}}</td><td style="text-align:center">{{item.name}}</td><td style="text-align:center">{{item.age}}</td><td style="text-align:center">{{item.relation}}</td></tr></table></van-cell>',
|
||||
'<van-cell title="备注" :value="viewData.remark || \'-\'"></van-cell>',
|
||||
'</van-cell-group>',
|
||||
'<div v-for="task in doneTasks" :key="task.id">',
|
||||
'<div class="process-title">{{ task.displayName }}</div>',
|
||||
'<van-cell-group v-if="task.ext && task.ext.isFirstTaskNode">',
|
||||
'<van-cell title="申请用户" :value="(task.ext.initiatorName || \'-\') + (task.ext.initiatorAccount ? \'(\' + task.ext.initiatorAccount + \')\' : \'\')"></van-cell>',
|
||||
'<van-cell title="申请时间" :value="task.finishTime || \'-\'"></van-cell>',
|
||||
'<van-cell title="办理结果"><dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE" :value="task.ext.submitType"></dict-tag></van-cell>',
|
||||
'</van-cell-group>',
|
||||
'<van-cell-group v-else>',
|
||||
'<van-cell title="办理用户" :value="((task.taskFormData && task.taskFormData.userName) || \'-\') + ((task.taskFormData && task.taskFormData.loginName) ? \'(\' + task.taskFormData.loginName + \')\' : \'\')"></van-cell>',
|
||||
'<van-cell title="办理时间" :value="task.finishTime || \'-\'"></van-cell>',
|
||||
'<van-cell title="办理结果"><dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE" :value="task.ext && task.ext.submitType"></dict-tag></van-cell>',
|
||||
'<van-cell title="办理意见" class="column-cell"><template #label>{{ (task.taskFormData && (task.taskFormData.opinion || task.taskFormData.tf_opinion)) || \'-\' }}</template></van-cell>',
|
||||
'</van-cell-group>',
|
||||
'</div>',
|
||||
'</div><slot></slot></van-action-sheet>'
|
||||
].join(''),
|
||||
dicts: ["PROCESS_TASK_SUBMIT_TYPE"],
|
||||
data(){return {visible:false,row:{},viewData:{},doneTasks:[]}},
|
||||
methods:{// 查看页面统一显示年月日,空值沿用“-”占位。
|
||||
formatDate(value){return value?this.$moment(value).format('YYYY-MM-DD'):'-'},onOpen(row){this.$set(this,'row',row);this.$set(this,'visible',true);this.getInfo();this.getDoneTasks()},onClose(){this.$set(this,'visible',false)},getInfo(){this.$axios.post('/platform/fundMember/write/info',{id:this.row.id}).then(res=>{if(res.code===0){this.$set(this,'viewData',res.data||{})}})},getDoneTasks(){this.$axios.post('/flow/common/doneTasks',{bizId:this.row.id}).then(res=>{if(res.code===0){this.$set(this,'doneTasks',res.data||[])}})}},
|
||||
style: '.column-cell{flex-direction:column}.column-cell table{width:100%;border-collapse:collapse;table-layout:fixed;margin-top:8px}.column-cell table th,.column-cell table td{border:1px solid #ddd;padding:6px;text-align:center;vertical-align:middle}'
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<van-nav-bar title="离退休审核" left-text="返回" left-arrow fixed placeholder @click-left="historyBack"></van-nav-bar>
|
||||
<van-sticky offset-top="46px">
|
||||
<van-search v-model="pageForm.searchKeyword" placeholder="请输入姓名或工号" @search="doSearch"></van-search>
|
||||
<van-tabs v-model="pageForm.approvalText" @change="changeApproval">
|
||||
<van-tab title="已审核" name="1"></van-tab><van-tab title="未审核" name="0"></van-tab>
|
||||
</van-tabs>
|
||||
</van-sticky>
|
||||
<table-list ref="tableListRef" api="/platform/fundMember/retiredApproval/pageData" :page_form.sync="pageForm" @ready="doSearch">
|
||||
<template v-slot="{row}"><table-column label="工号">{{row.loginName}}</table-column><table-column label="姓名">{{row.userName}}</table-column><table-column label="会员类别">{{row.aidFundMemberType}}</table-column><table-column label="当前节点">{{row.curTaskName}}</table-column></template>
|
||||
<template #actions="{row}"><div class="action-btn" @click="view(row)"><i class="fa fa-eye"></i><span>查看</span></div><div class="action-btn" v-if="row.taskState===10" @click="audit(row)"><i class="fa fa-check"></i><span>审核</span></div><div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)"><i class="fa fa-undo"></i><span>撤回</span></div></template>
|
||||
</table-list>
|
||||
<h5-fund-member-info ref="infoRef"><div v-if="formData.processTaskId" class="p10"><van-form ref="formRef"><van-field :value="formData.tf_opinion" label="审批意见" type="textarea" required placeholder="请输入审批意见" :rules="[{required:true,message:'请填写审批意见'}]" @input="$set(formData,'tf_opinion',$event)"></van-field></van-form><div class="audit-actions"><van-button block type="info" @click="handleTaskAction(6)">退回</van-button><van-button block type="danger" @click="handleTaskAction(2)">拒绝</van-button><van-button block type="primary" @click="handleTaskAction(1)">同意</van-button></div></div></h5-fund-member-info>
|
||||
</div>
|
||||
<style>.audit-actions{display:flex;column-gap:10px;padding-top:10px}.audit-actions .van-button{flex:1}</style>
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include('../mine/info.js'){}#-->
|
||||
new Vue({el:'#app',store,components:{'h5-fund-member-info':H5_FUND_MEMBER_INFO},data(){return {pageForm:{pageNumber:1,pageSize:10,totalCount:0,searchKeyword:'',approval:false,approvalText:'0'},formData:{}}},methods:{changeApproval(value){this.doSearch(value==='1')},doSearch(approval){if(approval!==undefined){this.$set(this.pageForm,'approval',approval)}this.$set(this.pageForm,'pageNumber',1);this.$set(this.pageForm,'totalCount',0);this.$nextTick(()=>this.$refs.tableListRef.doSearch())},view(row){this.$set(this,'formData',{});this.$refs.infoRef.onOpen(row)},audit(row){this.$set(this,'formData',{processTaskId:row.taskId,taskName:row.curTaskName,tf_opinion:''});this.$refs.infoRef.onOpen(row)},onRevoke(row){this.$dialog.confirm({title:'提示',message:'您确定要撤回吗?'}).then(()=>this.$axios.post('/flow/common/revokeTask',{taskId:row.taskId}).then(res=>{if(res.code===0){this.$toast.success(res.msg||'撤回成功');this.doSearch()}}))},handleTaskAction(submitType){this.$refs.formRef.validate().then(()=>this.$dialog.confirm({title:'提示',message:'您确定要提交吗?'}).then(()=>this.$axios.post('/flow/common/executeTask',{data:JSON.stringify(Object.assign({},this.formData,{submitType:submitType}))}).then(res=>{if(res.code===0){this.$toast.success(res.msg||'提交成功');this.$refs.infoRef.onClose();this.doSearch()}}))).catch(()=>{})}}})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<van-nav-bar title="校工会审核" left-text="返回" left-arrow fixed placeholder @click-left="historyBack"></van-nav-bar>
|
||||
<van-sticky offset-top="46px">
|
||||
<van-search v-model="pageForm.searchKeyword" placeholder="请输入姓名或工号" @search="doSearch"></van-search>
|
||||
<van-tabs v-model="pageForm.approvalText" @change="changeApproval">
|
||||
<van-tab title="已审核" name="1"></van-tab><van-tab title="未审核" name="0"></van-tab>
|
||||
</van-tabs>
|
||||
</van-sticky>
|
||||
<table-list ref="tableListRef" api="/platform/fundMember/schoolUnionApproval/pageData" :page_form.sync="pageForm" @ready="doSearch">
|
||||
<template v-slot="{row}"><table-column label="工号">{{row.loginName}}</table-column><table-column label="姓名">{{row.userName}}</table-column><table-column label="所属分工会">{{row.unionName}}</table-column><table-column label="会员类别">{{row.aidFundMemberType}}</table-column><table-column label="当前节点">{{row.curTaskName}}</table-column></template>
|
||||
<template #actions="{row}"><div class="action-btn" @click="view(row)"><i class="fa fa-eye"></i><span>查看</span></div><div class="action-btn" v-if="row.taskState===10" @click="audit(row)"><i class="fa fa-check"></i><span>审核</span></div><div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)"><i class="fa fa-undo"></i><span>撤回</span></div></template>
|
||||
</table-list>
|
||||
<h5-fund-member-info ref="infoRef"><div v-if="formData.processTaskId" class="p10"><van-form ref="formRef"><van-field :value="formData.tf_opinion" label="审批意见" type="textarea" required placeholder="请输入审批意见" :rules="[{required:true,message:'请填写审批意见'}]" @input="$set(formData,'tf_opinion',$event)"></van-field></van-form><div class="audit-actions"><van-button block type="info" @click="handleTaskAction(6)">退回</van-button><van-button block type="danger" @click="handleTaskAction(2)">拒绝</van-button><van-button block type="primary" @click="handleTaskAction(1)">同意</van-button></div></div></h5-fund-member-info>
|
||||
</div>
|
||||
<style>.audit-actions{display:flex;column-gap:10px;padding-top:10px}.audit-actions .van-button{flex:1}</style>
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include('../mine/info.js'){}#-->
|
||||
new Vue({el:'#app',store,components:{'h5-fund-member-info':H5_FUND_MEMBER_INFO},data(){return {pageForm:{pageNumber:1,pageSize:10,totalCount:0,searchKeyword:'',year:new Date().getFullYear(),approval:false,approvalText:'0'},formData:{}}},methods:{changeApproval(value){this.doSearch(value==='1')},doSearch(approval){if(approval!==undefined){this.$set(this.pageForm,'approval',approval)}this.$set(this.pageForm,'pageNumber',1);this.$set(this.pageForm,'totalCount',0);this.$nextTick(()=>this.$refs.tableListRef.doSearch())},view(row){this.$set(this,'formData',{});this.$refs.infoRef.onOpen(row)},audit(row){this.$set(this,'formData',{processTaskId:row.taskId,taskName:row.curTaskName,tf_opinion:''});this.$refs.infoRef.onOpen(row)},onRevoke(row){this.$dialog.confirm({title:'提示',message:'您确定要撤回吗?'}).then(()=>this.$axios.post('/flow/common/revokeTask',{taskId:row.taskId}).then(res=>{if(res.code===0){this.$toast.success(res.msg||'撤回成功');this.doSearch()}}))},// 与 PC 端保持一致:6 为退回、2 为拒绝、1 为同意。
|
||||
handleTaskAction(submitType){this.$refs.formRef.validate().then(()=>this.$dialog.confirm({title:'提示',message:'您确定要提交吗?'}).then(()=>this.$axios.post('/flow/common/executeTask',{data:JSON.stringify(Object.assign({},this.formData,{submitType:submitType}))}).then(res=>{if(res.code===0){this.$toast.success(res.msg||'提交成功');this.$refs.infoRef.onClose();this.doSearch()}}))).catch(()=>{})}}})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,50 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar title="基金会员入会申请" left-text="返回" left-arrow fixed placeholder @click-left="historyBack"></van-nav-bar>
|
||||
<van-notice-bar v-if="isFundMember" wrapable color="#d46b08" background="#fff7e6">您已是基金会员,无需重复申请。</van-notice-bar>
|
||||
<van-form ref="formRef" :show-error-message="false">
|
||||
<van-cell-group title="基本信息">
|
||||
<van-field v-model="formData.userName" label="姓名" readonly></van-field>
|
||||
<van-field v-model="formData.loginName" label="工号" readonly></van-field>
|
||||
<van-field v-model="formData.birthday" label="出生年月" readonly is-link required @click="showBirthday = true" :rules="[{required:true,message:'请选择出生年月'}]"></van-field>
|
||||
<van-field v-model="formData.sex" label="性别" readonly is-link required @click="showSex = true" :rules="[{required:true,message:'请选择性别'}]"></van-field>
|
||||
<van-field v-model="formData.nativePlace" label="籍贯" required placeholder="请输入籍贯" :rules="[{required:true,message:'请输入籍贯'}]"></van-field>
|
||||
<van-field v-model="formData.address" label="家庭住址" required placeholder="请输入家庭住址" :rules="[{required:true,message:'请输入家庭住址'}]"></van-field>
|
||||
<van-field v-model="formData.healthStatus" label="健康状况" required placeholder="请输入健康状况" :rules="[{required:true,message:'请输入健康状况'}]"></van-field>
|
||||
<van-field v-model="formData.education" label="学历" readonly is-link required placeholder="请选择学历" @click="showEducation = true" :rules="[{required:true,message:'请选择学历'}]"></van-field>
|
||||
<van-field v-model="formData.mobile" label="联系电话" required type="tel" maxlength="11" placeholder="请输入联系电话" :rules="[{required:true,message:'请输入手机号码'},{pattern:/^1[3456789]\d{9}$/,message:'请输入正确的手机号码'}]"></van-field>
|
||||
<van-field v-model="formData.joinWorkTime" label="入职时间" readonly is-link required @click="showJoinWorkTime = true" :rules="[{required:true,message:'请选择入职时间'}]"></van-field>
|
||||
<van-field v-model="formData.idCard" label="身份证号码" required maxlength="18" placeholder="请输入身份证号码" :rules="[{required:true,message:'请输入身份证号码'},{pattern:/^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[Xx\d]$/,message:'请输入正确的身份证号码'}]"></van-field>
|
||||
<van-field v-model="formData.aidFundMemberType" label="会员类别" readonly is-link required placeholder="请选择会员类别" @click="showMemberType = true" :rules="[{required:true,message:'请选择会员类别'}]"></van-field>
|
||||
<van-field v-model="formData.retireTime" label="退休时间" readonly is-link :required="formData.aidFundMemberType === '退休'" @click="showRetireTime = true"></van-field>
|
||||
<!-- <van-field v-model="formData.homePhone" label="住宅号码"></van-field> -->
|
||||
</van-cell-group>
|
||||
<van-cell-group title="家庭主要成员">
|
||||
<div v-for="(family, index) in formData.families" :key="index" class="family-item">
|
||||
<div class="family-title">成员{{index + 1}} <van-button size="mini" type="danger" plain @click="removeFamily(index)">删除</van-button></div>
|
||||
<van-field v-model="family.name" label="姓名" required placeholder="请输入姓名"></van-field>
|
||||
<van-field v-model.number="family.age" label="年龄" required type="digit" placeholder="请输入年龄"></van-field>
|
||||
<van-field v-model="family.relation" label="与本人关系" required placeholder="请输入与本人关系"></van-field>
|
||||
</div>
|
||||
<div class="p10"><van-button block plain type="primary" icon="plus" @click="addFamily">添加家庭成员</van-button></div>
|
||||
</van-cell-group>
|
||||
<van-cell-group title="备注"><van-field v-model="formData.remark" type="textarea" rows="3" maxlength="500" show-word-limit placeholder="请输入备注"></van-field></van-cell-group>
|
||||
<div class="p10"><van-button v-if="!isFundMember" block type="primary" @click="submit">提交申请</van-button></div>
|
||||
</van-form>
|
||||
<van-popup v-model="showBirthday" position="bottom"><van-datetime-picker type="date" :min-date="dateMin" :max-date="dateMax" @confirm="setDate('birthday', $event)" @cancel="showBirthday=false"></van-datetime-picker></van-popup>
|
||||
<van-popup v-model="showJoinWorkTime" position="bottom"><van-datetime-picker type="date" :min-date="dateMin" :max-date="dateMax" @confirm="setDate('joinWorkTime', $event)" @cancel="showJoinWorkTime=false"></van-datetime-picker></van-popup>
|
||||
<van-popup v-model="showRetireTime" position="bottom"><van-datetime-picker type="date" :min-date="dateMin" :max-date="dateMax" @confirm="setDate('retireTime', $event)" @cancel="showRetireTime=false"></van-datetime-picker></van-popup>
|
||||
<van-popup v-model="showSex" position="bottom"><van-picker show-toolbar :columns="['男','女']" @confirm="setPicker('sex', $event, 'showSex')" @cancel="showSex=false"></van-picker></van-popup>
|
||||
<van-popup v-model="showEducation" position="bottom"><van-picker show-toolbar :columns="educationOptions" value-key="name" @confirm="setPicker('education', $event.name, 'showEducation')" @cancel="showEducation=false"></van-picker></van-popup>
|
||||
<van-popup v-model="showMemberType" position="bottom"><van-picker show-toolbar :columns="memberTypeOptions" value-key="name" @confirm="setPicker('aidFundMemberType', $event.name, 'showMemberType')" @cancel="showMemberType=false"></van-picker></van-popup>
|
||||
</div>
|
||||
<script nonce="${cspNonce!}">
|
||||
new Vue({el:'#app',store,data(){return {bizId:GetQueryString('bizId'),taskId:GetQueryString('taskId'),isFundMember:false,dateMin:new Date(1950,0,1),dateMax:new Date(),formData:{families:[]},educationOptions:[],memberTypeOptions:[],showBirthday:false,showJoinWorkTime:false,showRetireTime:false,showSex:false,showEducation:false,showMemberType:false}},methods:{// 统一处理接口返回的日期,避免表单回显到时分秒。
|
||||
formatDate(value){return value?this.$moment(value).format('YYYY-MM-DD'):value},setDate(field,date){this.$set(this.formData,field,this.$moment(date).format('YYYY-MM-DD'));this.$set(this,'show' + field.charAt(0).toUpperCase() + field.slice(1),false)},setPicker(field,value,popup){this.$set(this.formData,field,value);this.$set(this,popup,false)},addFamily(){this.formData.families.push({sequence:this.formData.families.length+1,name:'',age:null,relation:''})},removeFamily(index){this.formData.families.splice(index,1);this.formData.families.forEach((item,i)=>this.$set(item,'sequence',i+1))},validateFamilies(){return this.formData.families.length>0&&this.formData.families.every(item=>item.name&&item.age!==null&&item.age!==''&&item.relation)},submit(){this.$refs.formRef.validate().then(()=>{if(this.formData.aidFundMemberType==='退休'&&!this.formData.retireTime){this.$toast.fail('会员类别为退休时,请选择退休时间');return}if(!this.validateFamilies()){this.$toast.fail('请完整填写至少一名家庭主要成员');return}this.$dialog.confirm({title:'提示',message:'您确定要提交申请吗?'}).then(()=>this.$axios.post(this.taskId?'/platform/fundMember/write/submitAgain':'/platform/fundMember/write/submit',{data:JSON.stringify(this.formData),taskId:this.taskId}).then(res=>{if(res.code===0){this.$toast.success('提交成功');this.$pjaxReplace('/platform/fundMember/mine/h5')}}))})},init(){if(this.bizId){this.$axios.post('/platform/fundMember/write/info',{id:this.bizId}).then(res=>{if(res.code===0){this.$set(this,'formData',res.data);this.$set(this.formData,'birthday',this.formatDate(this.formData.birthday));if(!Array.isArray(this.formData.families)){this.$set(this.formData,'families',[])}}})}else{const user=this.$store.state.user;this.$set(this,'formData',{userName:user.username,loginName:user.loginname,sex:user.sex,birthday:this.formatDate(user.birthday),mobile:user.mobile,idCard:user.idCard,unionId:user.union&&user.union.id,unionName:user.union&&user.union.name,userState:user.userState,education:user.education||'',nativePlace:'',healthStatus:'',remark:'',families:[]})}this.$businessTool.getDictOptions('USER_EDUCATION').then(data=>this.$set(this,'educationOptions',data));this.$businessTool.getDictOptions('USER_AID_FUND_MEMBER_TYPE').then(data=>this.$set(this,'memberTypeOptions',data));this.$axios.post('/platform/fundMember/write/memberStatus').then(res=>{if(res.code===0){this.$set(this,'isFundMember',Boolean(res.data))}})}},created(){this.init()}})
|
||||
</script>
|
||||
<style>.p10{padding:10px}.family-item{padding:10px;border-bottom:1px solid #eee}.family-title{display:flex;justify-content:space-between;align-items:center;font-weight:600}</style>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user