This commit is contained in:
2026-07-01 10:37:46 +08:00
parent fad75b8f4f
commit 9b37a9800d
25 changed files with 2214 additions and 1766 deletions
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.staffmanage.member.controller.apply;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
@@ -64,7 +65,7 @@ public class MemberApplyBranchUnionApprovalController {
@At
@ApiOperation("会员入会申请分工会审核列表")
@SaCheckPermission("member.apply.branchUnionApproval")
@SaCheckPermission(value = {"member.apply.branchUnionApproval", "h5.member.apply.branchUnionApproval"}, mode = SaMode.OR)
public Result pageData(MemberApplyPageForm pageForm) {
Sql sql = Sqls.create("""
SELECT
@@ -78,6 +79,7 @@ public class MemberApplyBranchUnionApprovalController {
info.personType,
info.applyDateTime,
info.sign,
info.nativePlace,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
@@ -125,7 +127,7 @@ public class MemberApplyBranchUnionApprovalController {
} else {
cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
}
cnd.groupBy("t.id");
cnd.groupBy("info.id");
sql.setCondition(cnd);
Pagination<NutMap> pagination = memberApplyRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.staffmanage.member.controller.apply;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
@@ -14,6 +15,7 @@ import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
import com.budwk.app.flow.service.FlowCommonService;
import com.budwk.app.sys.models.Sys_union_group;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
@@ -70,7 +72,8 @@ public class MemberApplyController {
@At
@ApiOperation("保存申请")
@SaCheckPermission("member.apply.submit")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
@SLog(tag = "会员入会申请", msg = "保存申请,申请人: ${args[0].username}")
public Result save(@Param("data") MemberApplyRecord memberApplyRecord) {
if (StrUtil.isBlank(memberApplyRecord.getId())) {
@@ -84,7 +87,7 @@ public class MemberApplyController {
@At
@ApiOperation("提交申请")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("member.apply.submit")
@SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
@SLog(tag = "会员入会申请", msg = "提交申请,申请人: ${args[0].username}")
public Result submit(@Param("data") MemberApplyRecord memberApplyRecord){
if (StrUtil.isBlank(memberApplyRecord.getId())) {
@@ -123,7 +126,7 @@ public class MemberApplyController {
@At
@ApiOperation("重新提交申请")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("member.apply.submit")
@SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
@SLog(tag = "会员入会申请", msg = "重新提交申请,申请人: ${args[0].username}")
public Result submitAgain(@Param("data") MemberApplyRecord memberApplyRecord, @Param("taskId") Long taskId) {
if (StrUtil.isBlank(memberApplyRecord.getId())) {
@@ -159,14 +162,58 @@ public class MemberApplyController {
*/
@At
@ApiOperation("根据id查询申请记录")
@SaCheckPermission("member.apply.submit")
@SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
public Result findApplyById(String id) {
return Result.success(dao.fetch(MemberApplyRecord.class,id));
}
/**
* 根据用户id判断是否允许发起入会申请。
*
* @param id 用户id;前端选择代申请人员时传入该人员id,个人申请时传当前登录用户id
* @return Dict,包含 canApply 是否允许申请、msg 不允许时的提示信息,以及用户基础信息
*/
@At
@ApiOperation("根据 userid 查询是否能申请入会")
@SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
public Result findOne(String id) {
Sys_user user = dao.fetch(Sys_user.class, Cnd.where("id", "=", id));
if (user == null) {
return Result.error("用户不存在");
}
Dict result = Dict.create();
result.set("id", user.getId());
result.set("username", user.getUsername());
result.set("loginname", user.getLoginname());
boolean isAlreadyMember = Boolean.TRUE.equals(user.getMember());
if (isAlreadyMember) {
result.set("canApply", false);
result.set("msg", "您已是工会会员,无需重复申请");
return Result.success(result);
}
long doingProcessCount = dao.count(ProcessInstance.class,
Cnd.where("businessNo", "in",
Sqls.create("SELECT id FROM member_apply_record WHERE userId = @userId")
.setParam("userId", id)
).and("state", "=", 10)
);
if (doingProcessCount > 0) {
result.set("canApply", false);
result.set("msg", "您有一份入会申请流程正在审批中,请勿重复提交");
return Result.success(result);
}
result.set("canApply", true);
return Result.success(result);
}
@At
@SaCheckPermission("member.apply.submit")
@SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
public Result getApplyUserByUnionOperate(@Valid String keyWord){
Sql sql = Sqls.create("""
SELECT
@@ -195,7 +242,7 @@ public class MemberApplyController {
*/
@At
@ApiOperation("获取当前登录用户信息")
@SaCheckPermission("member.apply.submit")
@SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
public Result getSelfUserInfo() {
return Result.success(dao.fetch(View_user.class, Cnd.where("id", "=", SecurityUtil.getUserId())));
}
@@ -27,6 +27,7 @@ import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
/**
@@ -62,7 +63,7 @@ public class MemberApplyMineController {
@At
@ApiOperation("会员入会申请,我的申请列表")
@SaCheckPermission("member.apply.mine")
@SaCheckPermission(value = {"member.apply.mine", "h5.member.apply.mine"}, mode = SaMode.OR)
public Result pageData(MemberApplyPageForm pageForm) {
Sql sql = Sqls.create("""
SELECT
@@ -76,6 +77,8 @@ public class MemberApplyMineController {
info.personType,
info.applyDateTime,
info.sign,
info.nativePlace,
info.jobCategory,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
@@ -90,6 +93,7 @@ public class MemberApplyMineController {
t.finishTime,
t.taskParentId,
t.variable taskVariable,
GROUP_CONCAT(DISTINCT ta.actorName, '(', ta.actorAccount, ')' ) AS auditUser,
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask' AND taskState in (10,20)) AS startTaskId
FROM
@@ -113,7 +117,7 @@ public class MemberApplyMineController {
} else {
cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
}
cnd.groupBy("t.id");
cnd.groupBy("info.id");
sql.setCondition(cnd);
Pagination<NutMap> pagination = memberCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success().addData(pagination);
@@ -123,7 +127,7 @@ public class MemberApplyMineController {
@At
@ApiOperation("删除入会申请")
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission("member.apply.mine")
@SaCheckPermission(value = {"member.apply.mine", "h5.member.apply.mine"}, mode = SaMode.OR)
@SLog(tag = "会员入会申请", msg = "删除入会申请id: ${args[0]}")
public Result onDelete(@Valid String id) {
dao.clear(MemberApplyRecord.class, Cnd.where("id", "=", id));
@@ -140,9 +144,22 @@ public class MemberApplyMineController {
*/
@At
@ApiOperation("获取申请信息")
@SaCheckPermission(value = {"member.apply.mine", "member.apply.branchUnionApproval", "member.apply.branchUnionApproval", "member.apply.statistics"}, mode = SaMode.OR)
@SaCheckPermission(value = {"member.apply.mine", "h5.member.apply.mine", "member.apply.query", "member.apply.branchUnionApproval", "h5.member.apply.branchUnionApproval", "member.apply.schoolUnionApproval", "h5.member.apply.schoolunionapproval", "member.apply.unionGroupApproval", "h5.member.apply.uniongroupapproval"}, mode = SaMode.OR)
public Result findMemberApplyRecord(@Valid String id) {
MemberApplyRecord record = dao.fetch(MemberApplyRecord.class, id);
return Result.success().addData(record);
}
/**
* 导出入会申请表。
*
* @param id 入会申请记录id
* @param response docx 文件下载响应
*/
@At
@Ok("void")
@SaCheckPermission(value = {"member.apply.mine", "h5.member.apply.mine", "member.apply.query", "member.apply.branchUnionApproval", "h5.member.apply.branchUnionApproval", "member.apply.schoolUnionApproval", "h5.member.apply.schoolunionapproval", "member.apply.unionGroupApproval", "h5.member.apply.uniongroupapproval"}, mode = SaMode.OR)
public void exportApplyDocx(String id, HttpServletResponse response) {
memberCommonService.exportApplyDocx(id, response);
}
}
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.staffmanage.member.controller.apply;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
@@ -78,7 +79,7 @@ public class MemberApplySchoolUnionApprovalController {
@At
@ApiOperation("会员入会校工会审核列表")
@SaCheckPermission("member.apply.schoolUnionApproval")
@SaCheckPermission(value = {"member.apply.schoolUnionApproval", "h5.member.apply.schoolunionapproval"}, mode = SaMode.OR)
public Result pageData(MemberApplyPageForm pageForm) {
Sql sql = Sqls.create("""
SELECT
@@ -93,6 +94,7 @@ public class MemberApplySchoolUnionApprovalController {
info.origin,
info.applyDateTime,
info.sign,
info.nativePlace,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
@@ -138,7 +140,7 @@ public class MemberApplySchoolUnionApprovalController {
} else {
cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
}
cnd.groupBy("t.id");
cnd.groupBy("info.id");
sql.setCondition(cnd);
Pagination<NutMap> pagination = memberApplyRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination);
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.staffmanage.member.controller.apply;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
@@ -53,7 +54,7 @@ public class MemberApplyUnionGroupApprovalController {
@At
@ApiOperation("会员入会申请工会小组审核列表")
@SaCheckPermission("member.apply.unionGroupApproval")
@SaCheckPermission(value = {"member.apply.unionGroupApproval", "h5.member.apply.uniongroupapproval"}, mode = SaMode.OR)
public Result pageData(MemberApplyPageForm pageForm) {
Sql sql = Sqls.create("""
SELECT
@@ -1,205 +0,0 @@
package com.budwk.app.zhgh.staffmanage.member.controller.statistics;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
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.StrUtil;
import com.budwk.app.base.constant.RoleConstant;
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.base.utils.PageUtil;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberApplyRecordStatisticsPageForm;
import com.budwk.app.zhgh.staffmanage.member.service.MemberApplyRecordService;
import com.budwk.app.zhgh.staffmanage.member.vo.MemberApplyRecordStatisticsVO;
import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 会员申请记录查询统计。
*/
@At("/platform/member/apply/statistics")
@Ok("json:full")
@IocBean
public class MemberApplyRecordStatisticsController {
private static final Map<String, String> ORDER_COLUMN_MAP;
static {
Map<String, String> orderColumnMap = new HashMap<>();
orderColumnMap.put("loginName", "info.loginName");
orderColumnMap.put("userName", "info.userName");
orderColumnMap.put("unitName", "info.unitName");
orderColumnMap.put("unionName", "info.unionName");
orderColumnMap.put("userState", "info.userState");
orderColumnMap.put("preparedBy", "info.preparedBy");
orderColumnMap.put("personType", "info.personType");
orderColumnMap.put("origin", "info.origin");
orderColumnMap.put("applyDateTime", "info.applyDateTime");
orderColumnMap.put("instanceState", "ins.state");
ORDER_COLUMN_MAP = Collections.unmodifiableMap(orderColumnMap);
}
@Inject
private MemberApplyRecordService memberApplyRecordService;
@At("")
@Ok("beetl:/platform/zhgh/staffmanage/member/statistics/applyRecord/index.html")
@SaCheckPermission("member.apply.statistics")
public void index() {
}
/**
* 分页查询会员申请记录统计。
*
* @param pageForm 查询参数:searchKeyword 传姓名/工号关键字,unionId/unitId 传工会和单位ID数组,
* userStates/personTypes/preparedBys 传人员字典值数组,instanceStates 传流程状态 code 数组,
* startApplyDate/endApplyDate 传申请日期范围;分页和排序使用 PageForm 公共字段
* @return Result 包装的 Pagination<MemberApplyRecordStatisticsVO>list 为申请记录,totalCount 为总条数
*/
@At
@SaCheckPermission("member.apply.statistics")
public Result pageData(MemberApplyRecordStatisticsPageForm pageForm) {
Sql sql = getApplyRecordSql(pageForm);
Pagination<MemberApplyRecordStatisticsVO> pagination = memberApplyRecordService.listPageVO(
pageForm, sql, MemberApplyRecordStatisticsVO.class
);
return Result.success(pagination);
}
/**
* 导出会员申请记录统计。
*
* @param pageForm 查询和导出参数:columns 为前端选择的导出列,prop 对应 MemberApplyRecordStatisticsVO 属性,
* label 为 Excel 表头;其他筛选参数与 pageData 保持一致
* @param response 文件下载响应,返回 xlsx 格式 Excel 文件
*/
@At
@Ok("void")
@SaCheckPermission("member.apply.statistics")
public void doExport(MemberApplyRecordStatisticsPageForm pageForm, HttpServletResponse response) {
Sql sql = getApplyRecordSql(pageForm);
List<MemberApplyRecordStatisticsVO> list = memberApplyRecordService.listVO(sql, MemberApplyRecordStatisticsVO.class);
try {
List<ExcelExportEntity> exportEntities = buildExportColumns(pageForm);
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, list);
CommonDownloadUtil.download("会员申请记录统计.xlsx", workbook, response);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 构建申请记录统计 SQL,当前节点先在子查询中合并,避免一个申请存在多个待办时重复展示。
*/
private Sql getApplyRecordSql(MemberApplyRecordStatisticsPageForm pageForm) {
Sql sql = Sqls.create("SELECT " +
"info.id, " +
"info.userName, " +
"info.loginName, " +
"info.unitName, " +
"info.unionName, " +
"info.userState, " +
"info.preparedBy, " +
"info.personType, " +
"info.origin, " +
"info.applyDateTime, " +
"CASE WHEN info.sign IS NOT NULL AND info.sign != '' THEN '已签字' ELSE '未签字' END signState, " +
"ins.id AS instanceId, " +
"ins.businessNo, " +
"ins.state AS instanceState, " +
"CASE ins.state " +
"WHEN 10 THEN '进行中' " +
"WHEN 20 THEN '已完成' " +
"WHEN 30 THEN '已撤回' " +
"WHEN 40 THEN '强行终止' " +
"WHEN 45 THEN '已拒绝' " +
"WHEN 50 THEN '挂起' " +
"WHEN 99 THEN '已废弃' " +
"ELSE '未知' END AS instanceStateName, " +
"ins.processDefineId AS instanceProcessDefineId, " +
"IFNULL(nt.curTaskName, '结束') AS curTaskName " +
"FROM member_apply_record info " +
"LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id " +
"LEFT JOIN (SELECT processInstanceId, GROUP_CONCAT(DISTINCT displayName) AS curTaskName " +
"FROM wf_process_task WHERE taskState = 10 GROUP BY processInstanceId) nt ON nt.processInstanceId = ins.id " +
"$condition");
Cnd cnd = Cnd.NEW();
MemberApplyRecordStatisticsPageForm.buildSearch(cnd, pageForm);
buildDataScope(cnd);
buildOrder(cnd, pageForm);
sql.setCondition(cnd);
return sql;
}
/**
* 按当前登录人的角色补充数据范围,避免普通用户通过统计入口看到无权限的申请记录。
*/
private void buildDataScope(Cnd cnd) {
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_MEMBER_ADMIN.name())) {
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
cnd.and("info.unionId", "=", SecurityUtil.getUnionId());
} else {
cnd.and("info.userId", "=", SecurityUtil.getUserId());
}
}
}
/**
* 仅允许前端按白名单字段排序,避免页面排序字段被拼接成非预期 SQL。
*/
private void buildOrder(Cnd cnd, MemberApplyRecordStatisticsPageForm pageForm) {
if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())
&& ORDER_COLUMN_MAP.containsKey(pageForm.getPageOrderName())) {
cnd.orderBy(ORDER_COLUMN_MAP.get(pageForm.getPageOrderName()), PageUtil.getOrder(pageForm.getPageOrderBy()));
} else {
cnd.desc("info.applyDateTime");
}
}
/**
* 生成导出列;前端未传列设置时,使用申请记录统计的默认核心字段。
*/
private List<ExcelExportEntity> buildExportColumns(MemberApplyRecordStatisticsPageForm pageForm) {
List<ExcelExportEntity> exportEntities = new ArrayList<>();
if (Lang.isNotEmpty(pageForm.getColumns())) {
pageForm.getColumns().forEach(column -> {
exportEntities.add(new ExcelExportEntity(column.get("label"), column.get("prop"), 20));
});
return exportEntities;
}
exportEntities.add(new ExcelExportEntity("工号", "loginName", 20));
exportEntities.add(new ExcelExportEntity("姓名", "userName", 20));
exportEntities.add(new ExcelExportEntity("所属工会", "unionName", 20));
exportEntities.add(new ExcelExportEntity("所属单位", "unitName", 20));
exportEntities.add(new ExcelExportEntity("在职状态", "userState", 20));
exportEntities.add(new ExcelExportEntity("教职工类别", "personType", 20));
exportEntities.add(new ExcelExportEntity("编制类别", "preparedBy", 20));
exportEntities.add(new ExcelExportEntity("来源", "origin", 20));
exportEntities.add(new ExcelExportEntity("申请时间", "applyDateTime", 25));
exportEntities.add(new ExcelExportEntity("签字状态", "signState", 20));
exportEntities.add(new ExcelExportEntity("当前节点", "curTaskName", 20));
exportEntities.add(new ExcelExportEntity("流程状态", "instanceStateName", 20));
return exportEntities;
}
}
@@ -182,6 +182,16 @@ public class MemberApplyRecord extends BaseModel {
@ColDefine(type = ColType.VARCHAR, customType = "text")
private String personalData;
@Column
@Comment("特长及获奖情况")
@ColDefine(type = ColType.VARCHAR, customType = "text")
private String specialty;
@Column
@Comment("婚姻状况")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String marriage;
@Column
@Comment("备注")
@ColDefine(type = ColType.VARCHAR, width = 255)
@@ -223,8 +233,33 @@ public class MemberApplyRecord extends BaseModel {
@ColDefine(type = ColType.VARCHAR, width = 100)
private String sign;
@Column
@Comment("照片")
@ColDefine(type = ColType.VARCHAR, width = 500)
private String photo;
@Column
@Comment("来源,高校编码")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String origin;
@Column
@Comment("家庭住址")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String homeAddress;
@Column
@Comment("来校时间")
@ColDefine(type = ColType.VARCHAR, width = 10)
private String arrivalAtSchoolDate;
@Column
@Comment("籍贯")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String nativePlace;
@Column
@Comment("岗位名称")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String jobCategory;
}
@@ -1,74 +0,0 @@
package com.budwk.app.zhgh.staffmanage.member.param.pageform;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.param.PageForm;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.Cnd;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import java.util.List;
import java.util.Map;
/**
* 会员申请记录统计查询参数。
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class MemberApplyRecordStatisticsPageForm extends PageForm {
@ApiModelProperty("所属工会ID,多个值由前端数组提交")
private List<String> unionId;
@ApiModelProperty("所属单位ID,多个值由前端数组提交")
private List<String> unitId;
@ApiModelProperty("在职状态字典值,多个值由前端数组提交")
private List<String> userStates;
@ApiModelProperty("教职工类别字典值,多个值由前端数组提交")
private List<String> personTypes;
@ApiModelProperty("编制类别字典值,多个值由前端数组提交")
private List<String> preparedBys;
@ApiModelProperty("流程实例状态,使用 ProcessInstanceStateEnum 的 code")
private List<Integer> instanceStates;
@ApiModelProperty("申请开始时间,格式 yyyy-MM-dd")
private String startApplyDate;
@ApiModelProperty("申请结束时间,格式 yyyy-MM-dd")
private String endApplyDate;
@ApiModelProperty("导出列,字段 prop 对应 VO 属性,label 为 Excel 表头")
private List<Map<String, String>> columns;
/**
* 组装申请记录统计的公共查询条件。
*
* @param cnd SQL 条件对象,由调用方继续追加权限、排序等条件
* @param pageForm 查询参数,包含姓名/工号关键字、工会、单位、人员类别、申请时间和流程状态
*/
public static void buildSearch(Cnd cnd, MemberApplyRecordStatisticsPageForm pageForm) {
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("info.loginName", "like", "%" + pageForm.getSearchKeyword() + "%");
seg.or("info.username", "like", "%" + pageForm.getSearchKeyword() + "%");
cnd.and(seg);
}
cnd.andEX("info.unionId", "in", pageForm.getUnionId());
cnd.andEX("info.unitId", "in", pageForm.getUnitId());
cnd.andEX("info.userState", "in", pageForm.getUserStates());
cnd.andEX("info.personType", "in", pageForm.getPersonTypes());
cnd.andEX("info.preparedBy", "in", pageForm.getPreparedBys());
cnd.andEX("ins.state", "in", pageForm.getInstanceStates());
if (StrUtil.isNotBlank(pageForm.getStartApplyDate())) {
cnd.and("info.applyDateTime", ">=", pageForm.getStartApplyDate() + " 00:00:00");
}
if (StrUtil.isNotBlank(pageForm.getEndApplyDate())) {
cnd.and("info.applyDateTime", "<=", pageForm.getEndApplyDate() + " 23:59:59");
}
}
}
@@ -10,6 +10,7 @@ import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberManagePageForm
import org.nutz.dao.sql.Sql;
import org.nutz.lang.util.NutMap;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
@@ -115,4 +116,12 @@ public interface MemberCommonService extends BaseService<Sys_user> {
* @param type 类型: apply or change
*/
void validateApplyOrChangeIsDoing(String userId, String type);
/**
* 导出会员入会申请表。
*
* @param id 入会申请记录id
* @param response docx 文件下载响应
*/
void exportApplyDocx(String id, HttpServletResponse response);
}
@@ -3,6 +3,7 @@ package com.budwk.app.zhgh.staffmanage.member.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HtmlUtil;
@@ -10,9 +11,12 @@ import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.exception.BaseException;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.flow.entity.ProcessInstance;
import com.budwk.app.flow.entity.ProcessTask;
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
import com.budwk.app.flow.vo.ProcessTaskVO;
import com.budwk.app.sys.models.*;
import com.budwk.app.sys.services.SysDictService;
import com.budwk.app.sys.services.SysRoleService;
@@ -29,7 +33,19 @@ import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberManagePageForm
import com.budwk.app.zhgh.staffmanage.member.service.MemberCommonService;
import com.budwk.app.zhgh.staffmanage.specialstaff.model.SpecialStaff;
import com.budwk.app.zhgh.welfare.model.WelfareList;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.util.Units;
import org.apache.poi.xwpf.usermodel.LineSpacingRule;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun;
import org.apache.poi.xwpf.usermodel.XWPFTable;
import org.apache.poi.xwpf.usermodel.XWPFTableCell;
import org.apache.poi.xwpf.usermodel.XWPFTableRow;
import org.ddr.poi.html.HtmlRenderPolicy;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
@@ -45,7 +61,12 @@ import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.random.R;
import org.nutz.lang.util.NutMap;
import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTInline;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDrawing;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
@@ -61,12 +82,23 @@ import java.util.stream.Collectors;
@Slf4j
public class MemberManageServiceImpl extends BaseServiceImpl<Sys_user> implements MemberCommonService {
private static final int MEMBER_APPLY_PHOTO_WIDTH_PIXEL = 100;
private static final int MEMBER_APPLY_PHOTO_HEIGHT_PIXEL = 140;
private static final int MEMBER_APPLY_PHOTO_WIDTH_EMU = Units.pixelToEMU(MEMBER_APPLY_PHOTO_WIDTH_PIXEL);
private static final int MEMBER_APPLY_PHOTO_HEIGHT_EMU = Units.pixelToEMU(MEMBER_APPLY_PHOTO_HEIGHT_PIXEL);
private static final int MEMBER_APPLY_PHOTO_SIZE_TOLERANCE_EMU = Units.pixelToEMU(2);
private static final double MEMBER_APPLY_PHOTO_PARAGRAPH_LINE_POINT = MEMBER_APPLY_PHOTO_HEIGHT_PIXEL * 0.75D;
@Inject
private SysDictService sysDictService;
@Inject
private SysRoleService sysRoleService;
@Inject
private SysUserService sysUserService;
@Inject
private FlowEngine flowEngine;
@Inject
private SysOfficeTemplateUtil sysOfficeTemplateUtil;
public MemberManageServiceImpl(Dao dao) {
super(dao);
@@ -566,4 +598,208 @@ public class MemberManageServiceImpl extends BaseServiceImpl<Sys_user> implement
}
return value.toString();
}
@Override
public void exportApplyDocx(String id, HttpServletResponse response) {
MemberApplyRecord member = dao().fetch(MemberApplyRecord.class, Cnd.where("id", "=", id));
if (member == null) {
throw new RuntimeException("会员申请记录不存在");
}
Sql sql = Sqls.create("""
SELECT
info.*,
ins.id AS instanceId
FROM
`member_apply_record` info
LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id
WHERE
info.id = @id
""").setParam("id", id);
sql.setCallback(Sqls.callback.map());
dao().execute(sql);
NutMap info = (NutMap) sql.getResult();
HashMap<String, Object> docData = new HashMap<>();
docData.put("unitName", member.getUnitName());
docData.put("time", DateUtil.format(new Date(), "yyyy年MM月dd日"));
docData.put("username", member.getUsername());
docData.put("sex", member.getSex());
docData.put("birthday", StrUtil.isNotBlank(member.getBirthday()) ? DateUtil.parse(member.getBirthday()).toString("yyyy-MM-dd") : "");
docData.put("political", member.getPolitical());
docData.put("nation", member.getNation());
docData.put("education", member.getEducation());
docData.put("nativePlace", member.getNativePlace());
docData.put("marriage", member.getMarriage());
docData.put("specialty", buildMemberApplyDocHtml(member.getSpecialty()));
docData.put("jobCategory", member.getJobCategory());
docData.put("idCard", member.getIdCard());
docData.put("mobile", member.getMobile());
docData.put("arrivalAtSchoolDate", StrUtil.isNotBlank(member.getArrivalAtSchoolDate()) ? DateUtil.parse(member.getArrivalAtSchoolDate()).toString("yyyy-MM-dd") : "");
docData.put("homeAddress", member.getHomeAddress());
docData.put("personalData", buildMemberApplyDocHtml(member.getPersonalData()));
docData.put("photo", sysOfficeTemplateUtil.createPictureRenderData(MEMBER_APPLY_PHOTO_WIDTH_PIXEL, MEMBER_APPLY_PHOTO_HEIGHT_PIXEL, member.getPhoto()));
docData.put("sign", sysOfficeTemplateUtil.createPictureRenderData(member.getSign()));
docData.put("applyDateTime", member.getApplyDateTime() != null ? DateUtil.format(member.getApplyDateTime(), "yyyy年MM月dd日") : "");
// 将家庭成员数组合并为模板中的多行文本。
if (member.getFamilies() != null && !member.getFamilies().isEmpty()) {
StringBuilder familyStr = new StringBuilder();
for (int i = 0; i < member.getFamilies().size(); i++) {
NutMap fam = NutMap.WRAP(member.getFamilies().get(i));
familyStr.append((i + 1)).append(". ")
.append("关系:").append(StrUtil.nullToDefault(fam.getString("relation"), "")).append(", ")
.append("姓名:").append(StrUtil.nullToDefault(fam.getString("name"), "")).append(", ")
.append("单位:").append(StrUtil.nullToDefault(fam.getString("unit"), "")).append(", ")
.append("备注:").append(StrUtil.nullToDefault(fam.getString("remark"), "")).append("\n");
}
docData.put("familiesStr", familyStr.toString());
} else {
docData.put("familiesStr", "");
}
List<ProcessTaskVO> doneTaskVos = new ArrayList<>();
Long instanceId = info.getLong("instanceId");
if (instanceId != null) {
List<ProcessTask> doneTaskList = flowEngine.processTaskService().getDoneTaskList(instanceId, null);
for (ProcessTask doneTask : doneTaskList) {
ProcessTaskVO taskVO = flowEngine.processTaskService().findById(doneTask.getId());
doneTaskVos.add(taskVO);
}
}
// 提取分工会和校工会最后一次审核意见,填充到申请表模板对应区块。
doneTaskVos.stream().filter(task -> "分工会审核".equals(task.getDisplayName()))
.max(Comparator.comparing(ProcessTaskVO::getCreatedAt))
.ifPresent(v -> putMemberApplyApproval(docData, "fgh", v));
doneTaskVos.stream().filter(task -> "校工会审核".equals(task.getDisplayName()))
.max(Comparator.comparing(ProcessTaskVO::getCreatedAt))
.ifPresent(v -> putMemberApplyApproval(docData, "xgh", v));
String fileName = "会员入会申请表_" + member.getUsername() + "_" + DateUtil.format(new Date(), "yyyyMMdd") + ".docx";
response.setContentType("application/vnd.openxmlformats-officedocument.wordprocessingml.document");
response.setHeader("content-disposition", "attachment;filename=" + URLEncoder.encode(fileName, StandardCharsets.UTF_8));
HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
htmlRenderPolicy.getConfig().setShowDefaultTableBorderInTableCell(true);
Configure config = Configure.builder()
.bind("personalData", htmlRenderPolicy)
.bind("specialty", htmlRenderPolicy)
.build();
try {
XWPFTemplate template = XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("member_apply_form"), config)
.render(docData);
resizeMemberApplyPhotoRow(template.getXWPFDocument());
template.write(response.getOutputStream());
} catch (Exception e) {
log.error("导出会员入会申请表失败,ID: {}, 错误信息: {}", id, e.getMessage());
throw new RuntimeException("导出文件失败", e);
}
}
/**
* 将流程办理意见转换为模板可渲染的审核信息。
*/
private void putMemberApplyApproval(HashMap<String, Object> docData, String key, ProcessTaskVO taskVO) {
Dict taskFormData = taskVO.getTaskFormData();
HashMap<String, Object> approval = new HashMap<>();
approval.put("date", taskVO.getFinishTime() != null ? DateUtil.format(taskVO.getFinishTime(), "yyyy年MM月dd日") : "");
approval.put("user", taskFormData != null ? taskFormData.getStr("tf_userName") : "");
if (taskFormData != null && StrUtil.isNotBlank(taskFormData.getStr("tf_sign"))) {
approval.put("sign", sysOfficeTemplateUtil.createPictureRenderData(taskFormData.getStr("tf_sign")));
}
approval.put("opinion", taskFormData != null ? taskFormData.getStr("tf_opinion") : "");
docData.put(key, approval);
}
/**
* 入会申请导出时统一转为 HTML 片段,历史富文本保留样式,普通文本保留换行。
*/
private String buildMemberApplyDocHtml(String text) {
if (StrUtil.isBlank(text)) {
return "";
}
String docText = sysOfficeTemplateUtil.convertRichTextToDocText(text);
if (containsHtmlTag(docText)) {
return docText;
}
String escapeText = HtmlUtil.escape(docText)
.replace("\r\n", "\n")
.replace("\r", "\n")
.replace("\n", "<br/>");
return "<p>" + escapeText + "</p>";
}
/**
* 判断内容是否包含 HTML 标签,避免把历史富文本当普通文本转义。
*/
private boolean containsHtmlTag(String text) {
return StrUtil.isNotBlank(text) && text.matches("(?s).*<\\s*[a-zA-Z][^>]*>.*");
}
/**
* 保证导出的会员照片行足够高,避免 Word 裁剪默认内联图片。
*/
private void resizeMemberApplyPhotoRow(XWPFDocument document) {
if (document == null) {
return;
}
for (XWPFTable table : document.getTables()) {
for (XWPFTableRow row : table.getRows()) {
adjustMemberApplyPhotoParagraph(row);
}
}
}
/**
* 只匹配会员照片尺寸,避免影响签字图片。
*/
private boolean adjustMemberApplyPhotoParagraph(XWPFTableRow row) {
if (row == null) {
return false;
}
boolean found = false;
for (XWPFTableCell cell : row.getTableCells()) {
for (XWPFParagraph paragraph : cell.getParagraphs()) {
for (XWPFRun run : paragraph.getRuns()) {
if (runContainsMemberApplyPhoto(run)) {
adjustMemberApplyPhotoParagraphStyle(paragraph);
found = true;
}
}
}
}
return found;
}
/**
* 调整照片所在段落,确保图片在合并单元格中完整可见。
*/
private void adjustMemberApplyPhotoParagraphStyle(XWPFParagraph paragraph) {
paragraph.setAlignment(ParagraphAlignment.CENTER);
paragraph.setSpacingBefore(0);
paragraph.setSpacingAfter(0);
paragraph.setSpacingBeforeLines(0);
paragraph.setSpacingAfterLines(0);
paragraph.setSpacingBetween(MEMBER_APPLY_PHOTO_PARAGRAPH_LINE_POINT, LineSpacingRule.AT_LEAST);
}
private boolean runContainsMemberApplyPhoto(XWPFRun run) {
if (run == null || run.getCTR() == null) {
return false;
}
for (CTDrawing drawing : run.getCTR().getDrawingArray()) {
for (CTInline inline : drawing.getInlineArray()) {
if (inline.getExtent() != null && isMemberApplyPhotoSize(inline.getExtent().getCx(), inline.getExtent().getCy())) {
return true;
}
}
}
return false;
}
private boolean isMemberApplyPhotoSize(long widthEmu, long heightEmu) {
return Math.abs(widthEmu - MEMBER_APPLY_PHOTO_WIDTH_EMU) <= MEMBER_APPLY_PHOTO_SIZE_TOLERANCE_EMU
&& Math.abs(heightEmu - MEMBER_APPLY_PHOTO_HEIGHT_EMU) <= MEMBER_APPLY_PHOTO_SIZE_TOLERANCE_EMU;
}
}
@@ -1,46 +0,0 @@
package com.budwk.app.zhgh.staffmanage.member.vo;
import lombok.Data;
import java.util.Date;
/**
* 会员申请记录统计返回数据。
*/
@Data
public class MemberApplyRecordStatisticsVO {
private String id;
private String userName;
private String loginName;
private String unitName;
private String unionName;
private String userState;
private String preparedBy;
private String personType;
private String origin;
private Date applyDateTime;
private String signState;
private String instanceId;
private String businessNo;
private Integer instanceState;
private String instanceStateName;
private String instanceProcessDefineId;
private String curTaskName;
}
@@ -13,7 +13,8 @@ layout("/layouts/platform.html"){
<el-radio-button label="false">未审核</el-radio-button>
</el-radio-group>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id" style="width: 100%">
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id"
style="width: 100%">
<el-table-column
:index="indexMethod"
align="center"
@@ -73,6 +74,10 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item prop="tf_sign"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_sign"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
@@ -102,11 +107,12 @@ layout("/layouts/platform.html"){
{ prop: "loginName", label: "工号", sortable: true },
{ prop: "userName", label: "姓名", sortable: true },
{ prop: "userState", label: "在职状态", sortable: true },
{ prop: "personType", label: "教职工类别", sortable: true },
{ prop: "preparedBy", label: "编制类别", sortable: true },
// { prop: "personType", label: "教职工类别", sortable: true },
{ prop: "nativePlace", label: "籍贯", sortable: true },
// { prop: "preparedBy", label: "编制类别", sortable: true },
{ prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true },
{ prop: "sign", label: "签字" },
// { prop: "sign", label: "签字" },
{ prop: "curTaskName", label: "当前节点" },
{ prop: "instanceState", label: "流程状态" }
],
@@ -115,12 +121,12 @@ layout("/layouts/platform.html"){
showApprovalForm: false,
formData: {
tf_opinion: ""
},
}
}
},
components: {
'info': INFO,
'common-query': COMMON_QUERY,
"info": INFO,
"common-query": COMMON_QUERY
},
methods: {
openView(row) {
@@ -140,6 +146,8 @@ layout("/layouts/platform.html"){
})
},
handleTaskAction(val) {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -161,6 +169,8 @@ layout("/layouts/platform.html"){
loading.close()
})
})
}
})
},
openRevoke(row) {
this.$confirm("您确定要撤回吗?", "提示", {
@@ -184,7 +194,7 @@ layout("/layouts/platform.html"){
this.pageForm = { ...this.pageForm, ...pageForm }
}
this.doSearch()
},
}
},
created() {
this.pageData()
@@ -62,7 +62,7 @@ const COMMON_QUERY = {
pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys)
this.$emit('search', pageForm)
},
async initData(){
initData(){
if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])) {
this.$businessTool.listUnion(this.pageForm.unionId).then((data) => {
this.unions = data
@@ -79,15 +79,17 @@ const COMMON_QUERY = {
})
}
},
async flushUnits(){
flushUnits(){
this.$set(this.pageForm, "unitId", null)
this.units = []
if (this.pageForm.unionId) {
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
this.$businessTool.listUnit(this.pageForm.unionId).then((data) => {
this.units = data
})
}
}
},
async created() {
created() {
this.initData()
}
}
@@ -16,21 +16,27 @@ const INFO = {
<el-descriptions-item label="学历">{{ viewData.education }}</el-descriptions-item>
<el-descriptions-item label="学位">{{ viewData.academicDegree }}</el-descriptions-item>
<el-descriptions-item label="党政职务">{{ viewData.position }}</el-descriptions-item>
<el-descriptions-item label="籍贯">{{ viewData.nativePlace }}</el-descriptions-item>
<el-descriptions-item label="工作单位">{{ viewData.unitName }}</el-descriptions-item>
<el-descriptions-item label="所属工会">{{ viewData.unionName }}</el-descriptions-item>
<el-descriptions-item label="所属校区">{{ viewData.campus }}</el-descriptions-item>
<el-descriptions-item label="岗位名称">{{ viewData.jobCategory }}</el-descriptions-item>
<!-- <el-descriptions-item label="所属校区">{{ viewData.campus }}</el-descriptions-item>-->
<el-descriptions-item label="身份证号码">{{ viewData.idCard }}</el-descriptions-item>
<el-descriptions-item label="联系电话">{{ viewData.mobile }}</el-descriptions-item>
<el-descriptions-item label="电子邮箱">{{ viewData.email }}</el-descriptions-item>
<!-- <el-descriptions-item label="电子邮箱">{{ viewData.email }}</el-descriptions-item>-->
<!-- <el-descriptions-item label="在职状态">{{ viewData.userState }}</el-descriptions-item>-->
<!-- <el-descriptions-item label="教职工类别">{{ viewData.personType }}</el-descriptions-item>-->
<!-- <el-descriptions-item label="编制类别">{{ viewData.preparedBy }}</el-descriptions-item>-->
<el-descriptions-item label="婚姻状况">{{ viewData.marriage }}</el-descriptions-item>
<el-descriptions-item label="入职时间">{{ viewData.arrivalAtSchoolDate }}</el-descriptions-item>
<el-descriptions-item label="家庭住址" :span="3">{{ viewData.homeAddress }}</el-descriptions-item>
<el-descriptions-item label="在职状态">{{ viewData.userState }}</el-descriptions-item>
<el-descriptions-item label="教职工类别">{{ viewData.personType }}</el-descriptions-item>
<el-descriptions-item label="编制类别">{{ viewData.preparedBy }}</el-descriptions-item>
<template v-if="viewData.loginname == $store.state.user.loginname">
</template>
<el-descriptions-item label="家庭主要成员" :span="3">
<el-table v-if="viewData.families&&viewData.families.length"
:data="viewData.families" size="mini" border
@@ -47,11 +53,20 @@ const INFO = {
</el-table>
<el-empty v-else :image-size="50" description="暂无家庭成员信息"></el-empty>
</el-descriptions-item>
<el-descriptions-item label="个人简况" :span="3">
<div v-if="viewData.personalData" class="text-left" v-html="viewData.personalData"></div>
<el-descriptions-item label="个人学习及工作经历" :span="3">
<div v-if="viewData.personalData" class="text-left w-e-text member-apply-rich-text" style="white-space: pre-wrap; word-break: break-all;" v-html="viewData.personalData"></div>
<el-tag type="warning" v-else>暂无</el-tag>
</el-descriptions-item>
</template>
<el-descriptions-item label="特长及获奖情况" :span="3">
<div v-if="viewData.specialty" class="text-left w-e-text member-apply-rich-text" style="white-space: pre-wrap; word-break: break-all;" v-html="viewData.specialty"></div>
<el-tag type="warning" v-else>暂无</el-tag>
</el-descriptions-item>
<el-descriptions-item label="照片" :span="3" v-if="viewData.photo">
<el-image :src="viewData.photo"
style="width: 120px;height: 150px"
fit="cover"></el-image>
</el-descriptions-item>
<el-descriptions-item label="签字信息" :span="3" v-if="viewData.sign">
<el-image :src="viewData.sign"
@@ -91,7 +106,11 @@ const INFO = {
</template>
<el-descriptions-item label="办理意见" :span="3" v-if="!task.ext.isFirstTaskNode">{{
task.taskFormData.opinion }}
task.taskFormData.tf_opinion }}
</el-descriptions-item>
<el-descriptions-item label="签字信息" :span="3" v-if="!task.ext.isFirstTaskNode">
<el-image :src="task.taskFormData.tf_sign"
class="signature-image"></el-image>
</el-descriptions-item>
</el-descriptions>
</div>
@@ -111,8 +111,9 @@ const MEMBER_APPLY_AUDIT_INFO = {
}
},
methods: {
async onOpen(id){
const resp = await $.post('/platform/member/apply/mine/findMemberApplyRecord', {id})
onOpen(id){
$.post("/platform/member/apply/mine/findMemberApplyRecord", {id})
.then((resp) => {
if (resp.code === 0) {
this.viewData = resp.data
this.$emit('union-name', this.viewData.userUnionName)
@@ -122,6 +123,9 @@ const MEMBER_APPLY_AUDIT_INFO = {
this.viewData.families = []
}
}
})
.always(() => {
})
}
}
}
@@ -42,12 +42,23 @@ layout("/layouts/platform.html"){
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
<template scope="{row}" v-else-if="column.prop=='taskName'">
{{row.taskName}}
<template v-if="row.auditUser">
-{{row.auditUser}}
</template>
</template>
</el-table-column>
<el-table-column label="操作" width="220" fixed="right">
<template slot-scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">
查看
</el-button>
<el-button v-if="row.instanceState === 20"
@click="exportApplyDocx(row.id)" size="mini" type="primary">
导出申请表
</el-button>
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId"
@click="onEdit(row)" size="mini" type="primary">
编辑
@@ -85,11 +96,11 @@ layout("/layouts/platform.html"){
{ prop: "loginName", label: "工号", sortable: true },
{ prop: "userName", label: "姓名", sortable: true },
{ prop: "userState", label: "在职状态", sortable: true },
{ prop: "personType", label: "教职工类别", sortable: true },
{ prop: "preparedBy", label: "编制类别", sortable: true },
// { prop: "personType", label: "教职工类别", sortable: true },
{ prop: "nativePlace", label: "籍贯", sortable: true },
{ prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true },
{ prop: "sign", label: "签字" },
// { prop: "sign", label: "签字" },
{ prop: "taskName", label: "当前节点"},
{ prop: "instanceState", label: "流程状态"}
],
@@ -102,6 +113,9 @@ layout("/layouts/platform.html"){
'common-query': COMMON_QUERY,
},
methods: {
exportApplyDocx(id) {
this.$downLoad("/platform/member/apply/mine/exportApplyDocx", { id })
},
onApply() {
commonUtil.pjaxPush('/platform/member/apply/submit')
},
@@ -14,7 +14,8 @@ layout("/layouts/platform.html"){
<el-radio-button label="false">未审核</el-radio-button>
</el-radio-group>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id" style="width: 100%">
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id"
style="width: 100%">
<el-table-column
:index="indexMethod"
align="center"
@@ -51,7 +52,7 @@ layout("/layouts/platform.html"){
<el-button v-if="row.taskState === 10" @click="openApproval(row)" size="mini" type="primary">
审核
</el-button>
<el-button v-if="row.canRevoke" @click="openRevoke(row)" size="mini" type="danger">
<el-button v-if="row.canRevoke" @click="openRevoke(row.taskId)" size="mini" type="danger">
撤回
</el-button>
</template>
@@ -91,6 +92,10 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item prop="tf_sign" label="签字"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<pc-signature v-model="formData.tf_sign"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
@@ -120,11 +125,12 @@ layout("/layouts/platform.html"){
{ prop: "loginName", label: "工号", sortable: true },
{ prop: "userName", label: "姓名", sortable: true },
{ prop: "userState", label: "在职状态", sortable: true },
{ prop: "personType", label: "教职工类别", sortable: true },
{ prop: "preparedBy", label: "编制类别", sortable: true },
{ prop: "nativePlace", label: "籍贯", sortable: true },
// { prop: "personType", label: "教职工类别", sortable: true },
// { prop: "preparedBy", label: "编制类别", sortable: true },
{ prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true },
{ prop: "sign", label: "签字" },
// { prop: "sign", label: "签字" },
{ prop: "curTaskName", label: "当前节点" },
{ prop: "instanceState", label: "流程状态" }
],
@@ -134,12 +140,12 @@ layout("/layouts/platform.html"){
formData: {
tf_opinion: ""
},
unions: [],
unions: []
}
},
components: {
'info': INFO,
'common-query': COMMON_QUERY,
"info": INFO,
"common-query": COMMON_QUERY
},
methods: {
openView(row) {
@@ -163,6 +169,8 @@ layout("/layouts/platform.html"){
})
},
handleTaskAction(val) {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -184,6 +192,8 @@ layout("/layouts/platform.html"){
loading.close()
})
})
}
})
},
openRevoke(taskId) {
this.$confirm("您确定要撤回吗?", "提示", {
@@ -212,7 +222,7 @@ layout("/layouts/platform.html"){
assignmentUnionName(val) {
const union = this.unions.find(item => item.id === val)
this.$set(this.formData, "tf_allocation_unionName", union.name)
},
}
},
created() {
this.pageData()
@@ -174,12 +174,7 @@
v-model="formData.isVoluntary">
<div>
<span style="flex: 1; word-wrap: break-word; word-break: break-all; white-space: normal;">
我自愿申请加入学校工会,并委托学校按规定代为扣缴工会会员会费
</span>
</div>
<div>
<span style="flex: 1; word-wrap: break-word; word-break: break-all; white-space: normal;">
我将严格遵守工会章程,认真执行工会决议,积极参与工会活动,主动融入“学校健康幸福家”建设,为营造温暖、和谐、奋进的校园氛围贡献力量,以实际行动助力学校各项事业发展。
我自愿加入中华全国总工会,遵守工会章程,执行工会决议,积极参加工会活动,为把我国建设成为富强、民主、文明的社会主义国家而努力奋斗
</span>
</div>
</el-checkbox>
@@ -367,26 +362,83 @@
handleCancel() {
},
async validateApply() {
validateApply() {
if (this.formData.id) {
return
}
// const resp = await $.post('/platform/member/apply/submit/validateApply')
// if (resp.code === 0 && resp.data > 0) {
// this.$confirm("您有其他入会流程正在进行中,请勿重复申请,如需查看详情,可前往我的申请界面,是否前往?", "提示", { type: "warning" })
// .then(() => {
// this.member = true
// this.$store.dispatch("pjaxRoute", "/platform/member/apply/mine")
// })
// .catch(() => {
// this.member = true
// })
// }
},
async init() {
init() {
let user
const resp = await $.post('/platform/member/apply/submit/getSelfUserInfo')
if (resp.code === 0) {
$.post("/platform/member/apply/submit/getSelfUserInfo", {})
.then((resp) => {
if (resp.code === 0 && resp.data) {
user = resp.data
} else {
user = this.$store.state.user
}
this.member = user.member
if (this.id) {
this.$axios.post("/platform/member/apply/submit/findApplyById", { id: this.id }).then((res) => {
if (res.code === 0) {
this.formData = res.data
}
})
return
}
const {
id,
username,
loginname,
sex,
nation,
birthday,
political,
education,
academicDegree,
position,
unitId,
unitName,
unit,
unionId,
unionName,
union,
campus,
userState,
personType,
idCard,
mobile,
email,
families,
personalData
} = user
this.$set(this.formData, "userId", id)
this.$set(this.formData, "username", username)
this.$set(this.formData, "loginname", loginname)
this.$set(this.formData, "birthday", birthday)
this.$set(this.formData, "sex", sex)
this.$set(this.formData, "idCard", idCard)
this.$set(this.formData, "nation", nation)
this.$set(this.formData, "political", political)
this.$set(this.formData, "position", position)
this.$set(this.formData, "education", education)
this.$set(this.formData, "academicDegree", academicDegree)
this.$set(this.formData, "campus", campus)
this.$set(this.formData, "userState", userState)
this.$set(this.formData, "personType", personType)
this.$set(this.formData, "unitName", unit ? unit.name : unitName)
this.$set(this.formData, "unitId", unit ? unit.id : unitId)
this.$set(this.formData, "unionName", union ? union.name : unionName)
this.$set(this.formData, "unionId", union ? union.id : unionId)
this.$set(this.formData, "mobile", mobile)
this.$set(this.formData, "email", email)
this.$set(this.formData, "families", families ? families : [])
this.$set(this.formData, "personalData", personalData)
})
.always(() => {
})
/*if (resp.code === 0) {
if (!resp.data) {
user = this.$store.state.user
} else {
@@ -455,12 +507,15 @@
this.$set(this.formData, "families", families ? families : [])
this.$set(this.formData, "personalData", personalData)
}
*/
},
},
async created() {
created() {
this.init()
this.units = await this.$businessTool.listUnit()
await this.validateApply()
this.$businessTool.listUnit().then((data) => {
this.units = data
})
this.validateApply()
}
})
</script>
@@ -4,7 +4,8 @@ layout("/layouts/platform.html"){
<div id="app" v-cloak>
<el-card shadow="never">
<snaker-start slot="header" label="入会申请" define_key="HYRH"></snaker-start>
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix="" class="flow-task-form">
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=""
class="flow-task-form">
<el-descriptions :column="3" border>
<el-descriptions-item label="工号">
<el-form-item prop="loginname">
@@ -19,8 +20,8 @@ layout("/layouts/platform.html"){
<el-descriptions-item label="性别">
<el-form-item prop="sex">
<el-radio-group v-model="formData.sex" size="small">
<el-radio border label="男"></el-radio>
<el-radio border label="女"></el-radio>
<el-radio border label="男"></el-radio>
<el-radio border label="女"></el-radio>
</el-radio-group>
</el-form-item>
</el-descriptions-item>
@@ -59,9 +60,9 @@ layout("/layouts/platform.html"){
code="USER_ACADEMIC_DEGREE"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="党政职务">
<el-form-item prop="position">
<el-input v-model="formData.position" placeholder="请输入党政职务"
<el-descriptions-item label="籍贯">
<el-form-item prop="nativePlace">
<el-input v-model="formData.nativePlace" placeholder="请输入籍贯"
maxlength="50"></el-input>
</el-form-item>
</el-descriptions-item>
@@ -81,49 +82,69 @@ layout("/layouts/platform.html"){
<el-input v-model="formData.unionName" disabled placeholder="请输入所属工会"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="所属校区">
<!-- <el-descriptions-item label="所属校区">
<el-form-item prop="campus">
<dict-select style="width: 100%" placeholder="请选择所属校区" v-model="formData.campus"
code="USER_CAMPUS"></dict-select>
</el-form-item>
</el-descriptions-item>-->
<el-descriptions-item label="岗位名称">
<el-form-item prop="jobCategory">
<el-input v-model="formData.jobCategory" placeholder="请输入岗位名称"
maxlength="50"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="在职状态">
<!-- <el-descriptions-item label="在职状态">
<el-form-item prop="userState">
<dict-select v-model="formData.userState" code="USER_STATE"
disabled style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="教职工类别">
</el-descriptions-item>-->
<!--<el-descriptions-item label="教职工类别">
<el-form-item prop="personType">
<dict-select v-model="formData.personType" code="USER_PERSON_TYPE"
disabled style="width: 100%"></dict-select>
style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="编制类别">
</el-descriptions-item>-->
<!--<el-descriptions-item label="编制类别">
<el-form-item prop="preparedBy">
<dict-select v-model="formData.preparedBy" code="USER_PREPARED_BY_TYPE"
disabled style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>-->
<el-descriptions-item label="婚姻状况">
<el-form-item prop="marriage" label="婚姻状况">
<dict-select v-model="formData.marriage" code="USER_MARRIAGE"
style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="身份证号码">
<el-form-item prop="idCard">
<el-input v-model="formData.idCard" disabled placeholder="请输入身份证号码" maxlength="18"></el-input>
<el-input v-model="formData.idCard" disabled placeholder="请输入身份证号码"
maxlength="18"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="联系电话">
<el-form-item prop="mobile">
<el-input v-model="formData.mobile" disabled placeholder="请输入联系电话" maxlength="32"></el-input>
<el-input v-model="formData.mobile" disabled placeholder="请输入联系电话"
maxlength="32"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="电子邮箱">
<el-form-item prop="email">
<el-input v-model="formData.email" placeholder="请输入电子邮箱" maxlength="50"></el-input>
<el-descriptions-item label="入职时间">
<el-form-item prop="arrivalAtSchoolDate">
<el-input v-model="formData.arrivalAtSchoolDate" placeholder="请输入入职时间"
disabled maxlength="50"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="家庭住址" :span="3">
<el-form-item prop="homeAddress" label="家庭住址">
<el-input v-model="formData.homeAddress" placeholder="请输入家庭住址" maxlength="90"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="家庭主要成员" :span="3">
<el-form-item prop="families">
@@ -170,9 +191,36 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="个人简况" :span="3">
<el-form-item prop="personalData">
<text-editor v-model="formData.personalData"></text-editor>
<el-descriptions-item label="个人学习及工作经历" :span="3">
<el-form-item prop="personalData" label="个人学习及工作经历">
<el-input type="textarea" :rows="4" v-model="formData.personalData"
placeholder="请输入个人学习及工作经历"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="特长及获奖情况" :span="3">
<el-form-item prop="specialty" label="特长及获奖情况">
<el-input type="textarea" :rows="4" v-model="formData.specialty"
maxlength="100" show-word-limit
placeholder="请输入特长及获奖情况"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="照片" :span="3">
<el-form-item prop="photo" label="照片">
<file-upload
:value.sync="formData.photo"
:upload_number="1"
upload_mode="image"
upload_result_category="interval"
upload_result_type="url"
></file-upload>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="签字" :span="3">
<el-form-item prop="sign">
<pc-signature v-model="formData.sign"></pc-signature>
</el-form-item>
</el-descriptions-item>
@@ -182,30 +230,25 @@ layout("/layouts/platform.html"){
size="medium"
style="width: 95%; color: #F56C6C; display: flex; align-items: center;"
v-model="formData.isVoluntary">
<div>
<span style="flex: 1; word-wrap: break-word; word-break: break-all; white-space: normal;">
我自愿申请加入学校工会,并委托学校按规定代为扣缴工会会员会费。
</span>
</div>
<div>
<span style="flex: 1; word-wrap: break-word; word-break: break-all; white-space: normal;">
我将严格遵守工会章程,认真执行工会决议,积极参与工会活动,主动融入“学校健康幸福家”建设,为营造温暖、和谐、奋进的校园氛围贡献力量,以实际行动助力学校各项事业发展。
<span
style="flex: 1; word-wrap: break-word; word-break: break-all; white-space: normal;">
我自愿加入中华全国总工会,遵守工会章程,执行工会决议,积极参加工会活动,为把我国建设成为富强、民主、文明的社会主义国家而努力奋斗。
</span>
</div>
</el-checkbox>
</el-form-item>
</el-descriptions-item>
<!-- <el-descriptions-item label="签字" :span="3">-->
<!-- <el-form-item prop="sign">-->
<!-- <pc-signature v-model="formData.sign"></pc-signature>-->
<!-- </el-form-item>-->
<!-- </el-descriptions-item>-->
</el-descriptions>
</el-form>
<el-row type="flex" justify="end" class="mt20">
<el-button type="primary" plain @click="onSave">保存</el-button>
<el-button type="primary" @click="onSubmit" v-if="!taskId">提交</el-button>
<el-button type="primary" plain @click="onSave" v-if="!taskId"
:disabled="!canApply"
:title="applyDisableMsg">保存</el-button>
<el-button type="primary" @click="onSubmit" v-if="!taskId" v-if="!taskId"
:disabled="!canApply"
:title="applyDisableMsg">提交</el-button>
<el-button type="primary" @click="onFinishTask" v-else>提交</el-button>
</el-row>
</el-card>
@@ -224,11 +267,42 @@ layout("/layouts/platform.html"){
formData: {
families: []
},
canApply: true,
applyDisableMsg: '',
formRules: {
username: [{ required: false, message: "必填", trigger: ["change", "blur"] }],
sex: [{ required: false, message: "必填", trigger: ["change", "blur"] }],
isVoluntary: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
sign: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
photo: [{ required: true, message: "请上传照片", trigger: ["change", "blur"] }],
homeAddress: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
families: [{
validator: (rule, value, callback) => {
// 提交时家庭主要成员至少填写一条,并校验核心成员信息。
if (!value || value.length === 0) {
callback(new Error("请添加家庭主要成员"))
return
}
const hasIncomplete = value.some(item => {
item = item || {}
return !String(item.relation || "").trim()
|| !String(item.name || "").trim()
|| !String(item.unit || "").trim()
})
if (hasIncomplete) {
callback(new Error("请完善家庭主要成员的关系、姓名、工作单位"))
return
}
callback()
},
trigger: ["change", "blur"]
}],
personalData: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
specialty: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
marriage: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
arrivalAtSchoolDate: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
nativePlace: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
jobCategory: [{ required: true, message: "必填", trigger: ["change", "blur"] }]
/*email: [
{
validator: (rule, value, callback) => {
@@ -289,10 +363,27 @@ layout("/layouts/platform.html"){
trigger: ["change", "blur"]
}
]*/
},
}
}
},
methods: {
checkApplyPermission() {
if (this.id || this.taskId) {
this.canApply = true;
this.applyDisableMsg = '';
return;
}
this.$axios.post("/platform/member/apply/submit/findOne", { id: this.formData.userId }).then(res => {
if (res.code === 0 && res.data) {
this.canApply = res.data.canApply;
this.applyDisableMsg = res.data.msg || '';
if (!this.canApply) {
this.$message.warning(this.applyDisableMsg);
}
}
});
},
onSave() {
this.$confirm("您确定保存吗?", "提示", {
confirmButtonText: "确定",
@@ -300,10 +391,10 @@ layout("/layouts/platform.html"){
type: "warning"
}).then(() => {
const loading = createLoading()
this.$axios.post('/platform/member/apply/submit/save', {data: JSON.stringify(this.formData)}).then(res => {
this.$axios.post("/platform/member/apply/submit/save", { data: JSON.stringify(this.formData) }).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
commonUtil.pjaxPush('/platform/member/apply/mine')
commonUtil.pjaxPush("/platform/member/apply/mine")
}
}).finally(() => {
loading.close()
@@ -319,12 +410,12 @@ layout("/layouts/platform.html"){
type: "warning"
}).then(() => {
const loading = createLoading()
this.$axios.post('/platform/member/apply/submit/submit', {
this.$axios.post("/platform/member/apply/submit/submit", {
data: JSON.stringify(this.formData)
}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
commonUtil.pjaxPush('/platform/member/apply/mine')
commonUtil.pjaxPush("/platform/member/apply/mine")
}
}).finally(() => {
loading.close()
@@ -334,45 +425,46 @@ layout("/layouts/platform.html"){
})
},
onFinishTask() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const loading = createLoading()
this.$axios.post('/platform/member/apply/submit/submitAgain', {
this.$axios.post("/platform/member/apply/submit/submitAgain", {
data: JSON.stringify(this.formData),
taskId: this.taskId,
taskId: this.taskId
}).then(res => {
if (res.code === 0) {
this.$message.success(res.msg)
commonUtil.pjaxPush('/platform/member/apply/mine')
commonUtil.pjaxPush("/platform/member/apply/mine")
}
}).finally(() => {
loading.close()
})
})
}
})
},
async init() {
init() {
let user
const resp = await $.post('/platform/member/apply/submit/getSelfUserInfo')
if (resp.code === 0) {
if (!resp.data) {
user = this.$store.state.user
} else {
$.post("/platform/member/apply/submit/getSelfUserInfo", {})
.then((resp) => {
if (resp.code === 0 && resp.data) {
user = resp.data
}
} else {
user = this.$store.state.user
}
if (this.id) {
const res = await this.$axios.post("/platform/member/apply/submit/findApplyById", { id: this.id })
debugger
this.$axios.post("/platform/member/apply/submit/findApplyById", { id: this.id }).then((res) => {
if (res.code === 0) {
this.formData = res.data
}
} else {
})
return
}
const {
id,
username,
@@ -383,6 +475,7 @@ layout("/layouts/platform.html"){
political,
education,
academicDegree,
arrivalAtSchoolDate,
position,
unitId,
unitName,
@@ -425,9 +518,13 @@ layout("/layouts/platform.html"){
this.$set(this.formData, "email", email)
this.$set(this.formData, "families", families ? families : [])
this.$set(this.formData, "personalData", personalData)
this.$set(this.formData, "arrivalAtSchoolDate", arrivalAtSchoolDate ? this.$moment(arrivalAtSchoolDate).format('YYYY-MM-DD') : "")
this.checkApplyPermission()
})
.always(() => {
})
}
},
},
created() {
this.init()
this.$businessTool.listUnit().then((data) => {
@@ -51,14 +51,6 @@ layout("/layouts/platform.html"){
multiple
placeholder="请选择教职工类别"></dict-select>
</search-item>
<search-item label="编制类别">
<dict-select
v-model="pageForm.preparedBys"
code="USER_PREPARED_BY_TYPE"
collapse-tags
multiple
placeholder="请选择编制类别"></dict-select>
</search-item>
<search-item label="流程状态">
<el-select
v-model="pageForm.instanceStates"
@@ -179,7 +171,6 @@ layout("/layouts/platform.html"){
unitId: [],
userStates: [],
personTypes: [],
preparedBys: [],
instanceStates: [],
applyDateRange: []
},
@@ -202,8 +193,6 @@ layout("/layouts/platform.html"){
{ prop: "unitName", label: "所属单位", width: 180, sortable: true },
{ prop: "userState", label: "在职状态", width: 120, sortable: true },
{ prop: "personType", label: "教职工类别", width: 140, sortable: true },
{ prop: "preparedBy", label: "编制类别", width: 120, sortable: true },
{ prop: "origin", label: "来源", width: 100, sortable: true },
{ prop: "applyDateTime", label: "申请时间", width: 160, sortable: true },
{ prop: "signState", label: "签字状态", width: 110 },
{ prop: "curTaskName", label: "当前节点", width: 160 },
@@ -231,7 +220,6 @@ layout("/layouts/platform.html"){
pageForm.unitId = JSON.stringify(this.pageForm.unitId)
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys)
pageForm.instanceStates = JSON.stringify(this.pageForm.instanceStates)
if (this.pageForm.applyDateRange && this.pageForm.applyDateRange.length > 0) {
pageForm.startApplyDate = this.pageForm.applyDateRange[0]
@@ -59,6 +59,11 @@ layout("/layouts/platform_h5.html"){
maxlength="100"
show-word-limit
></van-field>
<van-field class="more-text" name="tf_sign" label="" required>
<template #input>
<h5-signature v-model="formData.tf_sign" slot="input"></h5-signature>
</template>
</van-field>
</van-form>
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
<van-button type="danger" block @click="handleTaskAction(6)">退回</van-button>
@@ -127,8 +132,8 @@ layout("/layouts/platform_h5.html"){
}
},
async handleTaskAction(val) {
await this.$refs.formRef.validate();
handleTaskAction(val) {
this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({
title: "提示",
message: "您确定要提交吗?"
@@ -153,6 +158,7 @@ layout("/layouts/platform_h5.html"){
}).finally(() => {
loading.close()
})
})
})
},
@@ -182,7 +188,7 @@ layout("/layouts/platform_h5.html"){
initUnion() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? null : this.$store.state.user.union.id
this.$businessTool.listUnion(unionId).then((data) => {
return this.$businessTool.listUnion(unionId).then((data) => {
this.unionList = data
this.unionList.forEach((v) => {
v.text = v.name
@@ -199,7 +205,7 @@ layout("/layouts/platform_h5.html"){
flushUnits() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id
this.$businessTool.listUnit(unionId).then((data) => {
return this.$businessTool.listUnit(unionId).then((data) => {
this.unitList = data
this.unitList.forEach((v) => {
v.text = v.name
@@ -212,9 +218,10 @@ layout("/layouts/platform_h5.html"){
})
}
},
async created() {
await this.initUnion()
await this.flushUnits()
created() {
this.initUnion().then(() => {
this.flushUnits()
})
}
})
</script>
@@ -32,7 +32,7 @@ layout("/layouts/platform_h5.html"){
<table-column label="所属工会">{{row.unionName}}</table-column>
<table-column label="工作单位">{{row.unitName}}</table-column>
<table-column label="填报时间">{{row.applyDateTime}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
<table-column label="当前节点">{{row.taskName}}<span v-if="row.auditUser">-{{row.auditUser}}</span></table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
@@ -149,10 +149,11 @@ layout("/layouts/platform_h5.html"){
this.flushUnits()
this.doSearch()
},
async initUnion() {
initUnion() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? null : this.$store.state.user.union.id
this.unionList = await this.$businessTool.listUnion(unionId)
return this.$businessTool.listUnion(unionId).then((data) => {
this.unionList = data
this.unionList.forEach((v) => {
v.text = v.name
v.value = v.id
@@ -163,11 +164,13 @@ layout("/layouts/platform_h5.html"){
if (this.unionList && this.unionList.length > 0) {
this.$set(this.pageForm, "unionId", this.unionList[0].value)
}
})
},
async flushUnits() {
flushUnits() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id
this.unitList = await this.$businessTool.listUnit(unionId)
return this.$businessTool.listUnit(unionId).then((data) => {
this.unitList = data
this.unitList.forEach((v) => {
v.text = v.name
v.value = v.id
@@ -176,11 +179,13 @@ layout("/layouts/platform_h5.html"){
if (this.unitList && this.unitList.length > 0) {
this.$set(this.pageForm, "unitId", this.unitList[0].value)
}
})
}
},
async created() {
await this.initUnion()
await this.flushUnits()
created() {
this.initUnion().then(() => {
this.flushUnits()
})
}
})
</script>
@@ -59,6 +59,11 @@ layout("/layouts/platform_h5.html"){
maxlength="100"
show-word-limit
></van-field>
<van-field class="more-text" name="tf_sign" label="" required>
<template #input>
<h5-signature v-model="formData.tf_sign" slot="input"></h5-signature>
</template>
</van-field>
</van-form>
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
<van-button type="danger" block @click="handleTaskAction(6)">退回</van-button>
@@ -127,8 +132,8 @@ layout("/layouts/platform_h5.html"){
}
},
async handleTaskAction(val) {
await this.$refs.formRef.validate();
handleTaskAction(val) {
this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({
title: "提示",
message: "您确定要提交吗?"
@@ -153,6 +158,7 @@ layout("/layouts/platform_h5.html"){
}).finally(() => {
loading.close()
})
})
})
},
@@ -168,7 +174,7 @@ layout("/layouts/platform_h5.html"){
overlay: true,
duration: 0
})
this.$axios.post('/flow/common/revokeTask', {taskId: row.startTaskId}).then(res => {
this.$axios.post('/flow/common/revokeTask', {taskId: row.taskId}).then(res => {
if (res.code === 0) {
this.$toast.success('撤回成功');
this.doSearch();
@@ -182,7 +188,7 @@ layout("/layouts/platform_h5.html"){
initUnion() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? null : this.$store.state.user.union.id
this.$businessTool.listUnion(unionId).then((data) => {
return this.$businessTool.listUnion(unionId).then((data) => {
this.unionList = data
this.unionList.forEach((v) => {
v.text = v.name
@@ -199,7 +205,7 @@ layout("/layouts/platform_h5.html"){
flushUnits() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id
this.$businessTool.listUnit(unionId).then((data) => {
return this.$businessTool.listUnit(unionId).then((data) => {
this.unitList = data
this.unitList.forEach((v) => {
v.text = v.name
@@ -212,9 +218,10 @@ layout("/layouts/platform_h5.html"){
})
}
},
async created() {
await this.initUnion()
await this.flushUnits()
created() {
this.initUnion().then(() => {
this.flushUnits()
})
}
})
</script>
@@ -42,6 +42,7 @@ layout("/layouts/platform_h5.html"){
v-model="formData.birthday"
label="出生年月"
is-link
readonly
@click="showDatePicker = true"
:rules="[{ required: true, message: '请填写出生年月' }]"
></van-field>
@@ -59,6 +60,7 @@ layout("/layouts/platform_h5.html"){
name="nation"
label="政治面貌"
readonly
is-link
placeholder="请选择政治面貌"
@click="showPoliticalPicker = true"
clickable
@@ -75,6 +77,7 @@ layout("/layouts/platform_h5.html"){
name="education"
label="学历"
readonly
is-link
placeholder="请选择学历"
@click="showEducationPicker = true"
clickable
@@ -91,6 +94,7 @@ layout("/layouts/platform_h5.html"){
name="academicDegree"
label="学位"
readonly
is-link
placeholder="请选择学位"
@click="showAcademicDegreePicker = true"
clickable
@@ -102,6 +106,16 @@ layout("/layouts/platform_h5.html"){
@confirm="(v)=>{formData.academicDegree = v;showAcademicDegreePicker = false}"
></van-picker>
</van-popup>
<van-field
v-model="formData.nativePlace"
name="nativePlace"
label="籍贯"
placeholder="请输入籍贯"
clearable
maxlength="30"
:rules="[{ required: true }]"
required
></van-field>
<van-field
v-model="formData.position"
name="position"
@@ -115,6 +129,17 @@ layout("/layouts/platform_h5.html"){
<van-field v-model="formData.unionName" label="所属工会" readonly></van-field>
<van-field
v-model="formData.jobCategory"
name="jobCategory"
label="岗位名称"
placeholder="请输入岗位名称"
clearable
maxlength="30"
:rules="[{ required: true }]"
required
></van-field>
<!--<van-field
v-model="formData.campusName"
name="campusName"
label="所属校区"
@@ -125,32 +150,52 @@ layout("/layouts/platform_h5.html"){
></van-field>
<van-popup position="bottom" round v-model:show="showCampusPicker">
<van-picker :columns="campusColumns" @cancel="showCampusPicker = false" @confirm="onCampusColumns" show-toolbar></van-picker>
</van-popup>
</van-popup>-->
<van-field
<!--<van-field
v-model="formData.userState"
name="userState"
label="在职状态"
readonly
placeholder="请填写在职状态"
clickable
></van-field>
></van-field>-->
<!-- <van-field-->
<!-- v-model="formData.personType"-->
<!-- name="personType"-->
<!-- label="教职工类别"-->
<!-- readonly-->
<!-- placeholder="请填写人员类型"-->
<!-- clickable-->
<!-- ></van-field>-->
<!-- <van-field-->
<!-- v-model="formData.preparedBy"-->
<!-- name="preparedBy"-->
<!-- label="编制类别"-->
<!-- readonly-->
<!-- placeholder="请填写编制类别"-->
<!-- clickable-->
<!-- ></van-field>-->
<van-field
v-model="formData.personType"
name="personType"
label="教职工类别"
v-model="formData.marriage"
name="marriage"
label="婚姻状况"
readonly
placeholder="请填写人员类型"
clickable
></van-field>
<van-field
v-model="formData.preparedBy"
name="preparedBy"
label="编制类别"
readonly
placeholder="请填写编制类别"
is-link
placeholder="请选择婚姻状况"
@click="showMarriagePicker = true"
clickable
required
:rules="[{ required: true }]"
></van-field>
<van-popup position="bottom" round v-model:show="showMarriagePicker">
<van-picker show-toolbar
:columns="marriageColumns"
@cancel="showMarriagePicker = false"
@confirm="(v)=>{formData.marriage = v;showMarriagePicker = false}"
></van-picker>
</van-popup>
<van-field
v-model="formData.idCard"
disabled
@@ -171,13 +216,32 @@ layout("/layouts/platform_h5.html"){
maxlength="11"
></van-field>
<van-field
v-model="formData.arrivalAtSchoolDate"
disabled
name="arrivalAtSchoolDate"
label="入职时间"
placeholder="暂无"
></van-field>
<van-field
v-model="formData.homeAddress"
name="homeAddress"
:rules="[{ required: true }]"
label="家庭住址"
required
rows="2"
autosize
type="textarea"
maxlength="80"
placeholder="请输入家庭住址"
></van-field>
<!--<van-field
v-model="formData.email"
name="email"
label="电子邮箱"
placeholder="请输入电子邮箱"
clearable
maxlength="25"
></van-field>
></van-field>-->
</van-cell-group>
<van-cell-group title="家庭信息" class="form-section up_down">
@@ -188,7 +252,8 @@ layout("/layouts/platform_h5.html"){
<span>家庭主要成员及联系方式</span>
</div>
</div>
<van-button v-if="formData.families && formData.families.length>0 && formData.families.length<5" style="width: 40px"
<van-button v-if="formData.families && formData.families.length>0 && formData.families.length<5"
style="width: 40px"
icon="plus" type="primary" round size="mini"
@click="formData.families.push({})"
native-type="button"></van-button>
@@ -208,8 +273,7 @@ layout("/layouts/platform_h5.html"){
:rules="[{ required:true, message: '请填写姓名' }]"></van-field>
<van-field label="工作单位" v-model="o.unit" placeholder="请填写工作单位"
:rules="[{ required:true, message: '请填写工作单位' }]"></van-field>
<van-field label="备注" v-model="o.remark" placeholder="请填写备注"
:rules="[{ required:true, message: '请填写备注' }]"></van-field>
<van-field label="备注" v-model="o.remark" placeholder="请填写备注"></van-field>
</div>
</template>
<template v-else>
@@ -223,43 +287,91 @@ layout("/layouts/platform_h5.html"){
</div>
</van-cell-group>
<van-cell-group title="个人简况" class="form-section">
<text-editor v-model="formData.personalData"></text-editor>
<van-cell-group title="个人学习及工作经历" class="form-section">
<van-field
v-model="formData.personalData"
name="personalData"
rows="4"
label=""
type="textarea"
placeholder="请输入个人学习及工作经历"
required
:rules="[{ required: true, message: '请填写个人学习及工作经历' }]"
></van-field>
</van-cell-group>
<van-cell-group title="特长及获奖情况" class="form-section">
<van-field
v-model="formData.specialty"
name="specialty"
rows="4"
label=""
type="textarea"
maxlength="100"
show-word-limit
placeholder="请输入特长及获奖情况"
required
:rules="[{ required: true, message: '请填写特长及获奖情况' }]"
></van-field>
</van-cell-group>
<van-cell-group title="照片" class="form-section">
<van-field class="direction-column-field" name="photo" label=""
required :rules="[{ required: true, message: '请上传照片' }]">
<template #input>
<h5-file-upload
slot="input"
:value.sync="formData.photo"
:upload_number="1"
upload_mode="image"
upload_result_category="interval"
upload_result_type="url"
complete_result
></h5-file-upload>
</template>
</van-field>
</van-cell-group>
<van-cell-group title="签字" class="form-section">
<van-field class="more-text" name="sign" label="" required>
<template #input>
<h5-signature v-model="formData.sign" slot="input"></h5-signature>
</template>
</van-field>
</van-cell-group>
<van-cell-group title="入会意愿" class="form-section">
<van-checkbox style="font-size: 17px;padding: 12px" icon-size="24px"
v-model="formData.isVoluntary" shape="square">
<div style="text-indent: 2.1rem">
<span :style="'color:' + (formData.isVoluntary ? '#1989fa' : '#F56C6C') ">
我自愿申请加入学校工会,并委托学校按规定代为扣缴工会会员会费
</span>
</div>
<div style="text-indent: 2.1rem">
<span :style="'color:' + (formData.isVoluntary ? '#1989fa' : '#F56C6C') ">
我将严格遵守工会章程,认真执行工会决议,积极参与工会活动,主动融入“学校健康幸福家”建设,为营造温暖、和谐、奋进的校园氛围贡献力量,以实际行动助力学校各项事业发展。
我自愿加入中华全国总工会,遵守工会章程,执行工会决议,积极参加工会活动,为把我国建设成为富强、民主、文明的社会主义国家而努力奋斗
</span>
</div>
</van-checkbox>
</van-cell-group>
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
<van-button block type="primary" @click.submit="onSave">保存</van-button>
<van-button v-if="!taskId" block type="primary" @click.submit="onSubmit">提交</van-button>
<van-button block type="primary" @click.submit="onSave" :disabled="!canApply">保存</van-button>
<van-button v-if="!taskId" block type="primary" @click.submit="onSubmit" :disabled="!canApply">提交</van-button>
<van-button v-else block type="primary" @click.submit="onFinishTask" >提交</van-button>
</div>
</van-form>
</div>
<script nonce="${cspNonce!}">
new Vue({
el: '#app',
el: "#app",
store,
dicts:['USER_NATION', 'USER_POLITICAL', 'USER_EDUCATION','USER_ACADEMIC_DEGREE', 'USER_CAMPUS'],
dicts: ["USER_NATION", "USER_POLITICAL", "USER_EDUCATION", "USER_ACADEMIC_DEGREE", "USER_CAMPUS", "USER_MARRIAGE"],
data() {
return {
id: GetQueryString("bizId"),
taskId: GetQueryString("taskId"),
canApply: true,
applyDisableMsg: '',
formData: {
families: [],
families: []
},
// 民族
showNationPicker: false,
@@ -274,11 +386,29 @@ layout("/layouts/platform_h5.html"){
campusColumns: [],
// 生日
showDatePicker: false,
showMarriagePicker: false
}
},
methods: {
historyBack,
checkApplyPermission() {
if (this.id || this.taskId) {
this.canApply = true;
this.applyDisableMsg = '';
return;
}
this.$axios.post("/platform/member/apply/submit/findOne", { id: this.formData.userId }).then(res => {
if (res.code === 0 && res.data) {
this.canApply = res.data.canApply;
this.applyDisableMsg = res.data.msg || '';
if (!this.canApply) {
this.$message.warning(this.applyDisableMsg);
}
}
});
},
onSave() {
this.$dialog.confirm({
title: "提示",
@@ -292,12 +422,12 @@ layout("/layouts/platform_h5.html"){
overlay: true,
duration: 0
})
this.$axios.post('/platform/member/apply/submit/save', {data: JSON.stringify(this.formData)}).then(res => {
this.$axios.post("/platform/member/apply/submit/save", { data: JSON.stringify(this.formData) }).then(res => {
if (res.code === 0) {
this.$toast.success(res.msg)
this.$pjaxReplace('/platform/member/apply/mine/h5')
this.$pjaxReplace("/platform/member/apply/mine/h5")
} else {
this.$toast.fail('操作失败')
this.$toast.fail("操作失败")
console.log(res.msg)
}
}).finally(() => {
@@ -308,6 +438,21 @@ layout("/layouts/platform_h5.html"){
onSubmit() {
this.$refs.formRef.validate().then(() => {
if (!this.validateFamilies()) {
return
}
if (!this.formData.personalData) {
this.$toast.fail("请填写个人学习及工作经历")
return
}
if (!this.formData.specialty) {
this.$toast.fail("请填写特长及获奖情况")
return
}
if (!this.formData.sign){
this.$toast.fail("请填写签字")
return
}
this.$dialog.confirm({
title: "提示",
message: "您确定要提交吗?"
@@ -318,14 +463,14 @@ layout("/layouts/platform_h5.html"){
overlay: true,
duration: 0
})
this.$axios.post('/platform/member/apply/submit/submit', {
this.$axios.post("/platform/member/apply/submit/submit", {
data: JSON.stringify(this.formData)
}).then(res => {
if (res.code === 0) {
this.$toast.success(res.msg)
this.$pjaxReplace('/platform/member/apply/mine/h5')
this.$pjaxReplace("/platform/member/apply/mine/h5")
} else {
this.$toast.fail('操作失败')
this.$toast.fail("操作失败")
console.log(res.msg)
}
}).finally(() => {
@@ -337,6 +482,21 @@ layout("/layouts/platform_h5.html"){
onFinishTask() {
this.$refs.formRef.validate().then(() => {
if (!this.validateFamilies()) {
return
}
if (!this.formData.personalData) {
this.$toast.fail("请填写个人学习及工作经历")
return
}
if (!this.formData.specialty) {
this.$toast.fail("请填写特长及获奖情况")
return
}
if (!this.formData.sign){
this.$toast.fail("请填写签字")
return
}
this.$dialog.confirm({
title: "提示",
message: "您确定要提交吗?"
@@ -347,15 +507,15 @@ layout("/layouts/platform_h5.html"){
overlay: true,
duration: 0
})
this.$axios.post('/platform/member/apply/submit/submitAgain', {
this.$axios.post("/platform/member/apply/submit/submitAgain", {
data: JSON.stringify(this.formData),
taskId: this.taskId,
taskId: this.taskId
}).then(res => {
if (res.code === 0) {
this.$toast.success(res.msg)
this.$pjaxReplace('/platform/member/apply/mine/h5')
this.$pjaxReplace("/platform/member/apply/mine/h5")
} else {
this.$toast.fail('操作失败')
this.$toast.fail("操作失败")
console.log(res.msg)
}
}).finally(() => {
@@ -365,14 +525,35 @@ layout("/layouts/platform_h5.html"){
})
},
onDateConfirm(value) {
this.formData.birthday = value;
this.showDatePicker = false;
validateFamilies() {
// 提交时家庭主要成员至少填写一条,并校验核心成员信息。
const families = this.formData.families || []
if (families.length === 0) {
this.$toast.fail("请添加家庭主要成员")
return false
}
const hasIncomplete = families.some(item => {
item = item || {}
return !String(item.relation || "").trim()
|| !String(item.name || "").trim()
|| !String(item.unit || "").trim()
})
if (hasIncomplete) {
this.$toast.fail("请完善家庭主要成员的关系、姓名、工作单位")
return false
}
return true
},
async init() {
onDateConfirm(value) {
this.formData.birthday = value
this.showDatePicker = false
},
init() {
let user
const resp = await $.post('/platform/member/apply/submit/getSelfUserInfo')
$.post("/platform/member/apply/submit/getSelfUserInfo", {})
.then((resp) => {
if (resp.code === 0) {
if (!resp.data) {
user = this.$store.state.user
@@ -384,12 +565,15 @@ layout("/layouts/platform_h5.html"){
}
if (this.id) {
const res = await this.$axios.post("/platform/member/apply/submit/findApplyById", { id: this.id })
debugger
this.$axios.post("/platform/member/apply/submit/findApplyById", { id: this.id })
.then((res) => {
if (res.code === 0) {
this.formData = res.data
this.$set(this, "formData", Object.assign({ families: [] }, res.data))
}
} else {
})
return
}
const {
id,
username,
@@ -409,28 +593,35 @@ layout("/layouts/platform_h5.html"){
union,
campus,
userState,
nativePlace,
jobCategory,
personType,
preparedBy,
idCard,
mobile,
email,
families,
arrivalAtSchoolDate,
personalData
} = user
this.$set(this.formData, "userId", id)
this.$set(this.formData, "username", username)
this.$set(this.formData, "loginname", loginname)
this.$set(this.formData, "birthday", birthday)
this.$set(this.formData, "birthday", birthday ? this.$moment(birthday).format("YYYY-MM-DD") : "")
this.$set(this.formData, "sex", sex)
this.$set(this.formData, "idCard", idCard)
this.$set(this.formData, "nation", nation)
this.$set(this.formData, "political", political)
this.$set(this.formData, "position", position)
this.$set(this.formData, "nativePlace", nativePlace)
this.$set(this.formData, "jobCategory", jobCategory)
this.$set(this.formData, "education", education)
this.$set(this.formData, "academicDegree", academicDegree)
this.$set(this.formData, "campus", campus)
this.$set(this.formData, "userState", userState)
this.$set(this.formData, "personType", personType)
this.$set(this.formData, "preparedBy", preparedBy)
this.$set(this.formData, "unitName", unit ? unit.name : unitName)
this.$set(this.formData, "unitId", unit ? unit.id : unitId)
this.$set(this.formData, "unionName", union ? union.name : unionName)
@@ -440,6 +631,9 @@ layout("/layouts/platform_h5.html"){
this.$set(this.formData, "email", email)
this.$set(this.formData, "families", families ? families : [])
this.$set(this.formData, "personalData", personalData)
this.$set(this.formData, "arrivalAtSchoolDate", arrivalAtSchoolDate ? this.$moment(arrivalAtSchoolDate).format("YYYY-MM-DD") : "")
this.checkApplyPermission()
// 处理校区信息
if (campus) {
@@ -455,35 +649,36 @@ layout("/layouts/platform_h5.html"){
this.$set(this.formData, "campus", "")
this.$set(this.formData, "campusName", "")
}
}
})
},
toChinesNum(num) {
let changeNum = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
let unit = ["", "十", "百", "千", "万"];
num = parseInt(num);
let changeNum = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"]
let unit = ["", "十", "百", "千", "万"]
num = parseInt(num)
let getWan = (temp) => {
let strArr = temp.toString().split("").reverse();
let newNum = "";
let strArr = temp.toString().split("").reverse()
let newNum = ""
for (let i = 0; i < strArr.length; i++) {
newNum = (i == 0 && strArr[i] == 0 ? "" : (i > 0 && strArr[i] == 0 && strArr[i - 1] == 0 ? "" : changeNum[strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i]))) + newNum;
newNum = (i == 0 && strArr[i] == 0 ? "" : (i > 0 && strArr[i] == 0 && strArr[i - 1] == 0 ? "" : changeNum[strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i]))) + newNum
}
return newNum;
return newNum
}
let overWan = Math.floor(num / 10000);
let noWan = num % 10000;
let overWan = Math.floor(num / 10000)
let noWan = num % 10000
if (noWan.toString().length < 4) {
noWan = "0" + noWan;
noWan = "0" + noWan
}
return overWan ? getWan(overWan) + "万" + getWan(noWan) : getWan(num);
return overWan ? getWan(overWan) + "万" + getWan(noWan) : getWan(num)
},
onCampusColumns(o) {
this.$set(this.formData, "campusName", o.text); // 显示名称
this.$set(this.formData, "campus", o.value); // 字典值
this.showCampusPicker = false;
this.$set(this.formData, "campusName", o.text) // 显示名称
this.$set(this.formData, "campus", o.value) // 字典值
this.showCampusPicker = false
},
async initDictOptions() {
initDictOptions() {
// 初始化校区字典数据
const campusData = await this.$businessTool.getDictOptions('USER_CAMPUS')
return this.$businessTool.getDictOptions("USER_CAMPUS")
.then((campusData) => {
this.campusColumns = campusData.map(item => {
return { value: item.code, text: item.name }
})
@@ -494,6 +689,10 @@ layout("/layouts/platform_h5.html"){
this.$set(this.formData, "campusName", campusItem.text)
}
}
})
.finally(() => {
this.init()
}
}
},
computed: {
@@ -522,11 +721,16 @@ layout("/layouts/platform_h5.html"){
}
return []
},
marriageColumns() {
if (this.dict && this.dict.type && this.dict.type.USER_MARRIAGE) {
return this.dict.type.USER_MARRIAGE.map(v => v.name)
}
return []
}
},
created() {
this.initDictOptions();
this.init()
},
this.initDictOptions()
}
})
</script>
<!--#
@@ -127,8 +127,8 @@ layout("/layouts/platform_h5.html"){
}
},
async handleTaskAction(val) {
await this.$refs.formRef.validate();
handleTaskAction(val) {
this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({
title: "提示",
message: "您确定要提交吗?"
@@ -153,6 +153,7 @@ layout("/layouts/platform_h5.html"){
}).finally(() => {
loading.close()
})
})
})
},
@@ -183,7 +184,7 @@ layout("/layouts/platform_h5.html"){
initUnion() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? null : this.$store.state.user.union.id
this.$businessTool.listUnion(unionId).then((data) => {
return this.$businessTool.listUnion(unionId).then((data) => {
this.unionList = data
this.unionList.forEach((v) => {
v.text = v.name
@@ -200,7 +201,7 @@ layout("/layouts/platform_h5.html"){
flushUnits() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id
this.$businessTool.listUnit(unionId).then((data) => {
return this.$businessTool.listUnit(unionId).then((data) => {
this.unitList = data
this.unitList.forEach((v) => {
v.text = v.name
@@ -213,9 +214,10 @@ layout("/layouts/platform_h5.html"){
})
}
},
async created() {
await this.initUnion()
await this.flushUnits()
created() {
this.initUnion().then(() => {
this.flushUnits()
})
}
})
</script>