This commit is contained in:
Paidax
2024-07-26 10:26:18 +08:00
parent a82c0f6f1a
commit fc673e5e4e
7 changed files with 532 additions and 419 deletions
@@ -1,6 +1,7 @@
package io.v.nutz.zhgh.member.controller.check; package io.v.nutz.zhgh.member.controller.check;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.SimpleService; import io.v.nutz.base.service.SimpleService;
import io.v.nutz.base.utils.Roles; import io.v.nutz.base.utils.Roles;
@@ -14,6 +15,7 @@ import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
@@ -23,7 +25,7 @@ import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* @FileName io.v.nutz.zhgh.member.controller.check.MemberCheckUnionController * @FileName io.v.nutz.member.controller.check.MemberCheckUnionController
* @Description: 校工会核对 * @Description: 校工会核对
* @Author zxc * @Author zxc
* @Date 2022/10/21:10:31 * @Date 2022/10/21:10:31
@@ -60,7 +62,7 @@ public class MemberCheckSchoolController {
gh.unionname, gh.unionname,
mcut.isFinish, mcut.isFinish,
IF(mcut.isFinish is true,'是','否') as isFinishText, IF(mcut.isFinish is true,'是','否') as isFinishText,
( SELECT COUNT( 1 ) FROM `user` WHERE welfareMember = 1 AND unionid=gh.id) memberNum, ( SELECT COUNT( 1 ) FROM `user` WHERE member = 1 AND unionid=gh.id) memberNum,
(SELECT COUNT( 1 ) FROM member_check_union_task WHERE unionid = gh.id and taskId=mcut.taskId ) unionGroupNum, (SELECT COUNT( 1 ) FROM member_check_union_task WHERE unionid = gh.id and taskId=mcut.taskId ) unionGroupNum,
(SELECT COUNT( 1 ) FROM member_check_union_task WHERE isFinish = false AND unionid = gh.id and taskId=mcut.taskId ) fouUnionGroupNum, (SELECT COUNT( 1 ) FROM member_check_union_task WHERE isFinish = false AND unionid = gh.id and taskId=mcut.taskId ) fouUnionGroupNum,
(SELECT COUNT( 1 ) FROM member_check_union_task WHERE isFinish = true AND unionid = gh.id and taskId=mcut.taskId ) shiUnionGroupNum (SELECT COUNT( 1 ) FROM member_check_union_task WHERE isFinish = true AND unionid = gh.id and taskId=mcut.taskId ) shiUnionGroupNum
@@ -115,7 +117,10 @@ public class MemberCheckSchoolController {
mcr.type changeType, mcr.type changeType,
mcr.applyTime changeTime, mcr.applyTime changeTime,
state.stateId, state.stateId,
state.stateName state.stateName,
his.id hisId,
his.changeType,
his.changeTypes
FROM FROM
member_change_record mcr member_change_record mcr
LEFT JOIN `user` u ON u.id = mcr.userId LEFT JOIN `user` u ON u.id = mcr.userId
@@ -131,7 +136,9 @@ public class MemberCheckSchoolController {
sql.setParam("taskId", taskId); sql.setParam("taskId", taskId);
sql.setParam("unionId", unionId); sql.setParam("unionId", unionId);
sql.setParam("stateId", MemberChangeApplyState.SCHOOL_UNION); sql.setParam("stateId", MemberChangeApplyState.SCHOOL_UNION);
return simpleService.listMap(sql); List<NutMap> list = simpleService.listMap(sql);
return list;
} }
@At @At
@@ -3,6 +3,7 @@ package io.v.nutz.zhgh.member.controller.check;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.SimpleService; import io.v.nutz.base.service.SimpleService;
import io.v.nutz.sys.models.Sys_union;
import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode; import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode;
import io.v.nutz.zhgh.member.model.MemberChangeRecord; import io.v.nutz.zhgh.member.model.MemberChangeRecord;
import io.v.nutz.zhgh.member.model.MemberCheckSelfTask; import io.v.nutz.zhgh.member.model.MemberCheckSelfTask;
@@ -28,7 +29,7 @@ import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* @FileName io.v.nutz.zhgh.member.controller.check.MemberCheckTaskController * @FileName io.v.nutz.member.controller.check.MemberCheckTaskController
* @Description: TODO * @Description: TODO
* @Author zxc * @Author zxc
* @Date 2022/10/21:10:33 * @Date 2022/10/21:10:33
@@ -71,17 +72,16 @@ public class MemberCheckTaskController {
public Object doAdd(MemberCheckTask task) { public Object doAdd(MemberCheckTask task) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(task.getStartTime()); calendar.setTime(task.getStartTime());
List<SysUnionGroup> unionGroups = dao.query(SysUnionGroup.class, Cnd.NEW()); List<Sys_union> sysUnions = dao.query(Sys_union.class, null);
Trans.exec(() -> { Trans.exec(() -> {
task.setYear(calendar.get(Calendar.YEAR)); task.setYear(calendar.get(Calendar.YEAR));
task.setTaskMode(MemberChangeRecordMode.MEMBER.getCode()); task.setTaskMode(MemberChangeRecordMode.MEMBER.getCode());
dao.insert(task); dao.insert(task);
if (task.getCreateTaskMode() == 1) { if (task.getCreateTaskMode() == 1) {
List<MemberCheckUnionTask> unionTasks = unionGroups.stream().map(v -> { List<MemberCheckUnionTask> unionTasks = sysUnions.stream().map(v -> {
MemberCheckUnionTask unionTask = new MemberCheckUnionTask(); MemberCheckUnionTask unionTask = new MemberCheckUnionTask();
unionTask.setTaskId(task.getId()); unionTask.setTaskId(task.getId());
unionTask.setGroupUnionId(v.getId()); unionTask.setUnionId(v.getId());
unionTask.setUnionId(v.getUnionId());
unionTask.setIsFinish(false); unionTask.setIsFinish(false);
return unionTask; return unionTask;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
@@ -151,6 +151,7 @@ public class MemberCheckTaskController {
cnd.andEX("year", "=", year); cnd.andEX("year", "=", year);
cnd.and("createTaskMode", "=", 1); cnd.and("createTaskMode", "=", 1);
cnd.and("taskMode", "=", MemberChangeRecordMode.MEMBER.getCode()); cnd.and("taskMode", "=", MemberChangeRecordMode.MEMBER.getCode());
cnd.desc("year");
return dao.query(MemberCheckTask.class, cnd); return dao.query(MemberCheckTask.class, cnd);
} }
@@ -1,10 +1,13 @@
package io.v.nutz.zhgh.member.controller.check; package io.v.nutz.zhgh.member.controller.check;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.SimpleService; import io.v.nutz.base.service.SimpleService;
import io.v.nutz.base.utils.Vi; import io.v.nutz.base.utils.Vi;
import io.v.nutz.sys.models.Sys_config;
import io.v.nutz.zhgh.data.constant.UserChangeType;
import io.v.nutz.zhgh.member.constant.MemberChangeApplyState; import io.v.nutz.zhgh.member.constant.MemberChangeApplyState;
import io.v.nutz.zhgh.member.constant.MemberChangeOrigin; import io.v.nutz.zhgh.member.constant.MemberChangeOrigin;
import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode; import io.v.nutz.zhgh.member.constant.MemberChangeRecordMode;
@@ -30,9 +33,11 @@ import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.Optional;
/** /**
* @FileName io.v.nutz.zhgh.member.controller.check.MemberCheckUnionController * @FileName io.v.nutz.member.controller.check.MemberCheckUnionController
* @Description: 院级工会核对 * @Description: 院级工会核对
* @Author zxc * @Author zxc
* @Date 2022/10/21:10:31 * @Date 2022/10/21:10:31
@@ -65,11 +70,31 @@ public class MemberCheckUnionController {
@Param(value = "changed", required = false) Integer changed, @Param(value = "changed", required = false) Integer changed,
@Param(value = "isMember", required = false) Integer isMember, @Param(value = "isMember", required = false) Integer isMember,
@Param(value = "unionGroupId", required = false) String unionGroupId, @Param(value = "unionGroupId", required = false) String unionGroupId,
@Param(value = "threeUnitId", required = false) String threeUnitId) { @Param(value = "threeUnitId", required = false) String threeUnitId,
@Param(value = "userStates", required = false) String[] userStates,
@Param(value = "personTypes", required = false) String[] personTypes,
@Param(value = "changeTypes", required = false) Integer[] changeTypes,
@Param(value = "changeOrigin", required = false) Integer[] changeOrigins
) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
select select
u.*, u.id,
u.loginname,
u.username,
u.sex,
u.birthday,
u.personType,
u.userState,
u.unionname,
u.unitname,
u.threeUnitName,
u.unionGroupName,
u.mobile,
u.idcard,
u.member,
his.id hisId,
his.changeType, his.changeType,
his.changeTypes,
his.changeTime, his.changeTime,
state.stateId, state.stateId,
state.stateName, state.stateName,
@@ -83,7 +108,7 @@ public class MemberCheckUnionController {
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,H03,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
cnd.and("u.unionId", "=", Vi.getUnionId()); cnd.and("u.unionId", "=", Vi.getUnionId());
} else if (ShiroUtil.hasRole("ghxzzz")) { } else if (ShiroUtil.hasRole("ghxzzz")) {
@@ -99,18 +124,56 @@ public class MemberCheckUnionController {
cnd.andEX("u.unitid", "=", unitId); cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("u.unionGroupId", "=", unionGroupId); cnd.andEX("u.unionGroupId", "=", unionGroupId);
cnd.andEX("u.threeUnitId", "=", threeUnitId); cnd.andEX("u.threeUnitId", "=", threeUnitId);
// cnd.and("mcr.recordMode", "=", MemberChangeRecordMode.MEMBER.getCode());
cnd.and(Cnd.likeEX("u." + pageForm.getSearchName(), pageForm.getSearchKeyword())); cnd.and(Cnd.likeEX("u." + pageForm.getSearchName(), pageForm.getSearchKeyword()));
cnd.andEX("u.member", "=", isMember); cnd.andEX("u.member", "=", isMember);
if (changed != null) { if (changed != null) {
if (changed == 1) { if (changed == 1) {
cnd.and(new Static("his.changeType is not null")); cnd.and(new Static("his.changeTypes is not null"));
} else { } else {
cnd.and(new Static("his.changeType is null")); cnd.and(new Static("his.changeTypes is null"));
} }
} }
cnd.desc("his.changeTime");
if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), "ascending".equals(pageForm.getPageOrderBy()) ? "asc" : "desc");
} else {
cnd.desc("changeTime");
}
if (org.nutz.lang.Lang.isNotEmpty(changeTypes)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
for (Integer type : changeTypes) {
seg.or(new Static("JSON_CONTAINS(his.changeTypes, CAST(%d AS JSON), '$')".formatted(type)));
}
cnd.and(seg);
}
if (org.nutz.lang.Lang.isNotEmpty(userStates)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
for (String state : userStates) {
seg.orEquals("u.userState", state);
}
cnd.and(seg);
}
if (org.nutz.lang.Lang.isNotEmpty(personTypes)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
for (String personType : personTypes) {
seg.orEquals("u.personType", personType);
}
cnd.and(seg);
}
if (org.nutz.lang.Lang.isNotEmpty(changeOrigins)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
for (Integer c : changeOrigins) {
seg.orEquals("u.changeOrigin", c);
}
cnd.and(seg);
}
sql.setCondition(cnd); sql.setCondition(cnd);
sql.setParam("success", MemberChangeApplyState.SUCCESS); sql.setParam("success", MemberChangeApplyState.SUCCESS);
sql.setVar("failStates", Joiner.on(",").join(List.of(MemberChangeApplyState.UNION_FAIL, MemberChangeApplyState.SCHOOL_UNION_FAIL))); sql.setVar("failStates", Joiner.on(",").join(List.of(MemberChangeApplyState.UNION_FAIL, MemberChangeApplyState.SCHOOL_UNION_FAIL)));
@@ -121,10 +184,17 @@ public class MemberCheckUnionController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions("member.check.union") @RequiresPermissions("member.check.union")
public Object getButtonNum(@Param(value = "unionId", required = false) String unionId, public Object getButtonNum(
@Param(value = "isMember", required = false) Integer isMember,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId, @Param(value = "unitId", required = false) String unitId,
@Param(value = "unionGroupId", required = false) String unionGroupId, @Param(value = "unionGroupId", required = false) String unionGroupId,
@Param(value = "threeUnitId", required = false) String threeUnitId) { @Param(value = "threeUnitId", required = false) String threeUnitId,
@Param(value = "userStates", required = false) String[] userStates,
@Param(value = "personTypes", required = false) String[] personTypes,
@Param(value = "changeTypes", required = false) Integer[] changeTypes,
@Param(value = "changeOrigin", required = false) Integer[] changeOrigins
) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
select select
(sum( CASE WHEN his.changeType IS NOT NULL THEN 1 ELSE 0 END )) as 'changeNum', (sum( CASE WHEN his.changeType IS NOT NULL THEN 1 ELSE 0 END )) as 'changeNum',
@@ -140,7 +210,7 @@ public class MemberCheckUnionController {
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,H03,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
cnd.and("u.unionId", "=", Vi.getUnionId()); cnd.and("u.unionId", "=", Vi.getUnionId());
} else if (ShiroUtil.hasRole("ghxzzz")) { } else if (ShiroUtil.hasRole("ghxzzz")) {
@@ -156,6 +226,40 @@ public class MemberCheckUnionController {
cnd.andEX("u.threeUnitId", "=", threeUnitId); cnd.andEX("u.threeUnitId", "=", threeUnitId);
cnd.andEX("u.unionid", "=", unionId); cnd.andEX("u.unionid", "=", unionId);
cnd.andEX("u.unitid", "=", unitId); cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("u.member", "=", isMember);
if (org.nutz.lang.Lang.isNotEmpty(changeTypes)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
for (Integer type : changeTypes) {
seg.or(new Static("JSON_CONTAINS(his.changeTypes, CAST(%d AS JSON), '$')".formatted(type)));
}
cnd.and(seg);
}
if (org.nutz.lang.Lang.isNotEmpty(userStates)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
for (String state : userStates) {
seg.orEquals("u.userState", state);
}
cnd.and(seg);
}
if (org.nutz.lang.Lang.isNotEmpty(personTypes)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
for (String personType : personTypes) {
seg.orEquals("u.personType", personType);
}
cnd.and(seg);
}
if (org.nutz.lang.Lang.isNotEmpty(changeOrigins)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
for (Integer c : changeOrigins) {
seg.orEquals("u.changeOrigin", c);
}
cnd.and(seg);
}
sql.setCondition(cnd); sql.setCondition(cnd);
sql.setParam("success", MemberChangeApplyState.SUCCESS); sql.setParam("success", MemberChangeApplyState.SUCCESS);
sql.setVar("failStates", Joiner.on(",").join(List.of(MemberChangeApplyState.UNION_FAIL, MemberChangeApplyState.SCHOOL_UNION_FAIL))); sql.setVar("failStates", Joiner.on(",").join(List.of(MemberChangeApplyState.UNION_FAIL, MemberChangeApplyState.SCHOOL_UNION_FAIL)));
@@ -166,15 +270,12 @@ public class MemberCheckUnionController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions("member.check.union") @RequiresPermissions("member.check.union")
public Object submitCheck(String taskId, @Param(value = "unionGroupId", required = false) String unionGroupId) { public Object submitCheck(String taskId, @Param(value = "unionid", required = false) String unionid) {
if (Lang.isEmpty(io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds())) {
return Result.error("请联系管理员,该用户角色错误");
}
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,H03")) { if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
cnd.andEX("groupUnionId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); cnd.andEX("unionid", "=", Vi.getUnionId());
} }
cnd.andEX("groupUnionId", "=", unionGroupId); cnd.andEX("unionid", "=", unionid);
cnd.and("taskId", "=", taskId); cnd.and("taskId", "=", taskId);
dao.update(MemberCheckUnionTask.class, Chain.make("isFinish", true), cnd); dao.update(MemberCheckUnionTask.class, Chain.make("isFinish", true), cnd);
return null; return null;
@@ -183,17 +284,55 @@ public class MemberCheckUnionController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions("member.check.union") @RequiresPermissions("member.check.union")
public Object doSubmitChangeUser(MemberChangeRecord record) { public Object doSubmitChangeUser(MemberChangeRecord memberChangeRecord) {
record.setRecordMode(MemberChangeRecordMode.MEMBER.getCode()); if (Objects.equals(memberChangeRecord.getType(), UserChangeType.NEW.getCode())) {
record.setApplyOrigin(MemberChangeOrigin.UNION_GROUP.getCode()); return Result.error("您已经入职,可以选择恢复功能入会!");
record = MemberChangeAuditHandle.CREATE.next(record, null); }
if (Objects.equals(memberChangeRecord.getType(), UserChangeType.UNIT_CHANGE.getCode())) {
boolean unionGroupEnable = Optional.ofNullable(dao.fetch(Sys_config.class, Cnd.where("configKey", "=", "isThreeUnit"))).map(v -> v.getConfigValue()).orElse("false").equals("true");
if (unionGroupEnable && memberChangeRecord.getCurrentThreeUnitId().equals(memberChangeRecord.getOriginThreeUnitId())) {
return Result.error("请选择不同的单位!");
} else if (!unionGroupEnable && memberChangeRecord.getCurrentUnitId().equals(memberChangeRecord.getOriginUnitId())) {
return Result.error("请选择不同的单位!");
}
}
if (!Objects.equals(memberChangeRecord.getType(), UserChangeType.UNIT_CHANGE.getCode())) {
memberChangeRecord.setCurrentUnitId(null);
memberChangeRecord.setCurrentUnionId(null);
}
Sql userSql = Sqls.fetchString("select userState from sys_user where id = @userId");
userSql.setParam("userId", memberChangeRecord.getUserId());
dao.execute(userSql);
String userState = StrUtil.blankToDefault(userSql.getString(), "");
if (memberChangeRecord.getType() == UserChangeType.ON_DUTY.getCode()) {
if (userState.equals(UserChangeType.ON_DUTY.getDescription())) {
return Result.error("该用户当前的状态已经是" + UserChangeType.ON_DUTY.getDescription() + ",您无需变更!");
}
}
if (memberChangeRecord.getType() == UserChangeType.RESIGN.getCode()) {
if (userState.equals(UserChangeType.RESIGN.getDescription())) {
return Result.error("该用户当前的状态已经是" + UserChangeType.RESIGN.getDescription() + ",您无需变更!");
}
}
if (memberChangeRecord.getType() == UserChangeType.RETIREMENT.getCode()) {
if (userState.equals(UserChangeType.RETIREMENT.getDescription())) {
return Result.error("该用户当前的状态已经是" + UserChangeType.RETIREMENT.getDescription() + ",您无需变更!");
}
}
memberChangeRecord.setRecordMode(MemberChangeRecordMode.MEMBER.getCode());
memberChangeRecord.setApplyOrigin(MemberChangeOrigin.UNION.getCode());
memberChangeRecord = MemberChangeAuditHandle.CREATE.next(memberChangeRecord, null);
Audit audit = new Audit(); Audit audit = new Audit();
audit.setAuditPass(true); audit.setAuditPass(true);
audit.setAuditOpinion(record.getRemark()); audit.setAuditOpinion(memberChangeRecord.getRemark());
MemberChangeAuditHandle.UNION.next(record, audit);
MemberChangeAuditHandle.UNION.next(memberChangeRecord, audit);
return null; return null;
} }
@@ -202,10 +341,10 @@ public class MemberCheckUnionController {
@RequiresPermissions("member.check.union") @RequiresPermissions("member.check.union")
public Object getUnionTaskStatus(String taskId, @Param(value = "unionId", required = false) String unionId, @Param(value = "unionGroupId", required = false) String unionGroupId) { public Object getUnionTaskStatus(String taskId, @Param(value = "unionId", required = false) String unionId, @Param(value = "unionGroupId", required = false) String unionGroupId) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,H03")) { if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
cnd.and("groupUnionId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); cnd.and("unionId", "=", Vi.getUnionId());
} }
cnd.andEX("groupUnionId", "=", unionGroupId); cnd.andEX("unionId", "=", unionId);
cnd.and("taskId", "=", taskId); cnd.and("taskId", "=", taskId);
MemberCheckUnionTask unionTask = dao.fetch(MemberCheckUnionTask.class, cnd); MemberCheckUnionTask unionTask = dao.fetch(MemberCheckUnionTask.class, cnd);
return unionTask != null && unionTask.getIsFinish(); return unionTask != null && unionTask.getIsFinish();
@@ -214,12 +353,12 @@ public class MemberCheckUnionController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions("member.check.union") @RequiresPermissions("member.check.union")
public Object checkAgain(String taskId, @Param(value = "unionGroupId", required = false) String unionGroupId) { public Object checkAgain(String taskId, @Param(value = "unionId", required = false) String unionId) {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,H03")) { if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,SchoolUnionMemberAdmin,SchoolUnionWelfareAdmin")) {
cnd.and("groupUnionId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds()); cnd.and("unionId", "in", Vi.getUnionId());
} }
cnd.andEX("groupUnionId", "=", unionGroupId); cnd.andEX("unionId", "=", unionId);
cnd.and("taskId", "=", taskId); cnd.and("taskId", "=", taskId);
dao.update(MemberCheckUnionTask.class, Chain.make("isFinish", false), cnd); dao.update(MemberCheckUnionTask.class, Chain.make("isFinish", false), cnd);
return null; return null;
@@ -59,7 +59,7 @@ layout("/layouts/platform.html"){
<div class="search-item" <div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"> v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionMemberAdmin')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div> <div class="search-item-label">所属工会:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" <el-select placeholder="所属工会" v-model="pageForm.unionId"
@@ -188,7 +188,7 @@ layout("/layouts/platform.html"){
}, },
async flushUnits() { async flushUnits() {
this.$set(this.pageForm, "unitId", "") this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') { if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionMemberAdmin')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId) this.units = await getUnits(this.pageForm.unionId)
} else { } else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}") this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
@@ -5,18 +5,6 @@ layout("/layouts/platform.html"){
<guava ref="guava"> <guava ref="guava">
<el-card shadow="never"> <el-card shadow="never">
<div class="search"> <div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
style="width: 100%"
v-model="pageForm.year"
type="year"
value-format="yyyy"
placeholder="选择年度">
</el-date-picker>
</div>
</div>
<div class="search-item"> <div class="search-item">
<div class="search-item-label">任务:</div> <div class="search-item-label">任务:</div>
<div class="search-item-option"> <div class="search-item-option">
@@ -29,7 +17,7 @@ layout("/layouts/platform.html"){
</div> </div>
<div class="search-item" <div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"> v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionMemberAdmin')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div> <div class="search-item-label">所属工会:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" <el-select placeholder="所属工会" v-model="pageForm.unionId"
@@ -43,21 +31,9 @@ layout("/layouts/platform.html"){
</div> </div>
</div> </div>
<!-- <div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>-->
<div class="search-query"> <div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
</div> </div>
</div> </div>
</el-card> </el-card>
@@ -74,67 +50,6 @@ layout("/layouts/platform.html"){
@expand-change="tableColumnExpandChange" @expand-change="tableColumnExpandChange"
v-loading="tableLoading" :size="tableSize" class="vi-table"> v-loading="tableLoading" :size="tableSize" class="vi-table">
<el-table-column type="expand">
<template slot-scope="{row}">
<el-table :data="row.checkUsers" style="width: 100%">
<el-table-column label="姓名" prop="userName"
header-align="center"></el-table-column>
<el-table-column label="工号" prop="loginName"
header-align="center"></el-table-column>
<el-table-column label="所属单位" prop="unitname"
header-align="center">
<template scope="{row}">
{{row.unitname}}<span v-if="row.newUnitName">→{{row.newUnitName}}</span>
</template>
</el-table-column>
<el-table-column label="所在科室" prop="threeUnitName"
header-align="center">
<template scope="{row}">
{{row.threeUnitName}}<span
v-if="row.newThreeUnitName">→{{row.newThreeUnitName}}</span>
</template>
</el-table-column>
<el-table-column label="异动信息" header-align="center">
<el-table-column label="更新时间" prop="changeTime" min-width="145px"
header-align="center"
sortable
align="center" show-overflow-tooltip>
</el-table-column>
<el-table-column label="异动类型" prop="changeType"
header-align="center"
align="center" show-overflow-tooltip sortable>
<template scope="{row}">
<span style="color: #0e78c5">{{changeType[row.changeType]}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="会员" header-align="center" align="center"
prop="member"
show-overflow-tooltip sortable>
<template scope="{row}">
<span v-if="row.member==1" class="text-success ">
<i class="fa fa-circle ml5"></i> 是
</span>
<span v-else class="text-danger">
<i class="fa fa-circle ml5"></i> 否
</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100px" header-align="center">
<template scope="{row:expandRow}">
<el-button size="mini" type="primary"
@click="openAudit(expandRow,true,row)">
审核
</el-button>
</template>
</el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" type="index" <el-table-column align="center" header-align="center" type="index"
:index="indexMethod" label="序号" :index="indexMethod" label="序号"
width="80px"></el-table-column> width="80px"></el-table-column>
@@ -162,14 +77,14 @@ layout("/layouts/platform.html"){
</el-table-column> </el-table-column>
<!--<el-table-column header-align="center" label="操作" width="200px"> <el-table-column header-align="center" label="操作" width="200px">
<template scope="{row}"> <template scope="{row}">
<el-button size="mini" type="primary" @click="openCheck(row)" <el-button size="mini" type="primary" @click="openCheck(row)"
:disabled="!(row.apply||row.reApply)"> :disabled="!row.isFinish">
核对 核对
</el-button> </el-button>
</template> </template>
</el-table-column>--> </el-table-column>
</el-table> </el-table>
</el-card> </el-card>
@@ -184,7 +99,7 @@ layout("/layouts/platform.html"){
<mem-change-records :userid="info.userId"></mem-change-records> <mem-change-records :userid="info.userId"></mem-change-records>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="院级工会审核" name="union"> <el-tab-pane label="分工会审核" name="union">
<el-form :model="formData" ref="form" :rules="formRules" <el-form :model="formData" ref="form" :rules="formRules"
label-width="120px" label-suffix=":"> label-width="120px" label-suffix=":">
@@ -327,21 +242,6 @@ layout("/layouts/platform.html"){
disabled></el-input> disabled></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="新科室">
<el-select v-model="info.currentThreeUnitId"
style="width: 100%" filterable
clearable
placeholder="请选择单位">
<el-option
v-for="item in threeUnits"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row> </el-row>
</template> </template>
@@ -406,11 +306,10 @@ layout("/layouts/platform.html"){
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</template> </template>
</guava> </guava>
<el-drawer <el-drawer
title="小组核对情况" title="分工会核对情况"
:visible.sync="groupUnionDrawer" :visible.sync="groupUnionDrawer"
direction="rtl" :size="'50%'"> direction="rtl" :size="'50%'">
<el-table :data="unionGroupData"> <el-table :data="unionGroupData">
@@ -427,23 +326,117 @@ layout("/layouts/platform.html"){
<el-table-column prop="isFinish" label="是否核对"> <el-table-column prop="isFinish" label="是否核对">
<template scope="{row}"> <template scope="{row}">
<el-tag type="danger" v-if="!row.isFinish">未核对</el-tag> <el-tag type="danger" v-if="!row.isFinish">未核对</el-tag>
<el-tag v-else type="success">已核对</el-tag> <el-tag v-else type="success">已核对</el-tag>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-drawer> </el-drawer>
<user-change-history ref="userChangeHistory">
<el-form class="demo-table-expand" :model="formData" ref="form"
:rules="formRules"
label-width="120px" label-suffix=":">
<div class="el-descriptions__header mt10">
<div class="el-descriptions__title">校工会审核</div>
<div class="el-descriptions__extra"></div>
</div>
<el-row gutter="20">
<el-col :span="12">
<el-form-item prop="username" label="审核人员">
<el-input v-model="formData.username"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="auditTime" label="审核时间">
<el-input v-model="formData.auditTime" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="opinion" label="审核意见">
<el-input type="textarea" v-model="formData.auditOpinion" rows="4"
maxlength="500"
placeholder="请填写您的审核意见"></el-input>
</el-form-item>
<el-row type="flex" justify="end">
<el-button @click="doAudit(false)" :loading="submitLoading">拒
绝
</el-button>
<el-button type="primary" @click="doAudit(true)"
:loading="submitLoading">通
过
</el-button>
</el-row>
</el-form>
</user-change-history>
<el-dialog title="异动人员确认" width="60%" :visible.sync="confirmDialog">
<el-table :data="changeUsers">
<el-table-column label="序号" type="index"
header-align="center"></el-table-column>
<el-table-column label="姓名" prop="userName"
header-align="center"></el-table-column>
<el-table-column label="工号" prop="loginName"
header-align="center"></el-table-column>
<el-table-column label="所属单位" prop="unitname"
header-align="center">
<template scope="{row}">
{{row.unitname}}
</template>
</el-table-column>
<el-table-column label="异动信息" header-align="center">
<el-table-column label="更新时间" prop="changeTime" min-width="145px"
header-align="center"
sortable
align="center" show-overflow-tooltip>
</el-table-column>
<el-table-column label="异动类型" prop="changeTypes" header-align="center"
align="center" show-overflow-tooltip sortable>
<template scope="{row}">
<span style="color: #0e78c5;cursor: pointer"
@click="openUserChangeInfo(row)">
{{getChangeTypes(row.changeTypes)}}
</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="会员" header-align="center" align="center"
prop="member"
show-overflow-tooltip sortable>
<template scope="{row}">
<span v-if="row.member==1" class="text-success ">
<i class="fa fa-circle ml5"></i> 是
</span>
<span v-else class="text-danger">
<i class="fa fa-circle ml5"></i> 否
</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100px" header-align="center">
<template scope="{row}">
<el-button size="mini" type="primary"
@click="openAudit(row)">
审核
</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div> </div>
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: '#app',
mixins: [initTableMixins], mixins: [initTableMixins],
components: { components: {
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.3'), 'member': httpVueLoader('/components/member/MemberInfo.vue?v=' + new Date().getTime()),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'), 'mem-change-records': httpVueLoader('/components/member/MemChangeRecords.vue?v=' + new Date().getTime()),
'mem-change-records': httpVueLoader('/components/member/MemChangeRecords.vue?v=1.0.2'), 'user-change-history': httpVueLoader('/components/userChangeHistory/userChangeHistory.vue?v=' + new Date().getTime()),
}, },
data() { data() {
return { return {
@@ -452,12 +445,10 @@ layout("/layouts/platform.html"){
unions: [], unions: [],
units: [], units: [],
tableColumns: [ tableColumns: [
{prop: 'unioncode', label: '编号', sortable: true},
{prop: 'unionname', label: '分工会名称', sortable: true}, {prop: 'unionname', label: '分工会名称', sortable: true},
{prop: 'memberNum', label: '会员人数', sortable: true}, {prop: 'memberNum', label: '会员人数', sortable: true},
{prop: 'unionGroup', label: '小组核对情况', sortable: true}, {prop: 'isFinish', label: '分工会是否核对完成', sortable: true},
// {prop: 'isFinish', label: '是否核对完成', sortable: true}, {prop: 'notCheckNum', label: '异动人数', sortable: true},
{prop: 'notCheckNum', label: '待核对人数', sortable: true},
], ],
pageForm: { pageForm: {
year: new Date().getFullYear() + '' year: new Date().getFullYear() + ''
@@ -471,9 +462,78 @@ layout("/layouts/platform.html"){
formData: {}, formData: {},
unitOptions: [], unitOptions: [],
currentTableRow: {},
changeUsers: [],
confirmDialog: false,
currentUnionId: null
} }
}, },
methods: { methods: {
async openUserChangeInfo({hisId}) {
this.$refs.userChangeHistory.openUserChangeInfo(hisId)
},
async openCheck(row) {
const taskId = this.pageForm.taskId
const unionId = row.id
this.currentUnionId = row.id
const resp = await $.post(loc() + '/getNotCheckUsers', {taskId, unionId})
if (resp.code === 0) {
this.confirmDialog = true
this.changeUsers = resp.data
}
},
openAudit({hisId, id}) {
this.$refs.userChangeHistory.openUserChangeInfo(hisId)
this.$refs.userChangeHistory.slot = true
if (this.$refs['form']) {
this.$refs['form'].resetFields()
}
this.formData = {
recordId: id,
username: "${@shiro.getPrincipalProperty('username')}",
auditTime: moment().format('YYYY-MM-DD'),
}
},
async doAudit(pass) {
this.formData.auditPass = pass
this.submitLoading = true
const resp = await $.post("/platform/member/change/audit/doAudit", this.formData)
this.submitLoading = false
if (resp.code === 0) {
this.$message.success(resp.msg)
this.$refs.userChangeHistory.changeInfoDialog = false
this.openCheck({id: this.currentUnionId})
this.pageData()
} else {
this.$message.warning(resp.msg)
}
},
getChangeTypes(changeTypes) {
if (changeTypes) {
const c = JSON.parse(changeTypes)
return c.map(v => {
return this.changeType[v]
}).join(',')
}
return null
},
async afterEdit(memData) {
if (!this.userId) {
await $.post(" /platform/member/info/make/joinMemberFamily", memData)
}
this.userId = ''
this.pageData()
this.$refs.guava.index()
},
async openGroupUnionDrawer(row) { async openGroupUnionDrawer(row) {
const {data} = await $.post(loc() + "/unionGroupData", { const {data} = await $.post(loc() + "/unionGroupData", {
unionId: row.id, unionId: row.id,
@@ -511,10 +571,7 @@ layout("/layouts/platform.html"){
return sums; return sums;
}, },
openCheck(row) {
this.userId = row.id
this.$refs.guava.edit()
},
async getMemberCheckTaskOptions() { async getMemberCheckTaskOptions() {
const resp = await $.get('/platform/member/check/task/getAllTask') const resp = await $.get('/platform/member/check/task/getAllTask')
this.memberCheckTaskOptions = resp.data this.memberCheckTaskOptions = resp.data
@@ -524,7 +581,7 @@ layout("/layouts/platform.html"){
}, },
async flushUnits() { async flushUnits() {
this.$set(this.pageForm, "unitId", "") this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') { if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionMemberAdmin')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId) this.units = await getUnits(this.pageForm.unionId)
} else { } else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}") this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
@@ -549,6 +606,7 @@ layout("/layouts/platform.html"){
} }
}, },
async tableColumnExpandChange(row, expandedRows) { async tableColumnExpandChange(row, expandedRows) {
this.currentTableRow = row
if (expandedRows.length) { if (expandedRows.length) {
const {taskId} = this.pageForm const {taskId} = this.pageForm
const {id: unionId} = row const {id: unionId} = row
@@ -558,56 +616,7 @@ layout("/layouts/platform.html"){
} }
} }
}, },
async openAudit(expandRow, audit, row) {
/* if (!row.isFinish) {
this.notifyWarning('待院工会完成核对后才可审核')
return
}*/
const resp = await $.get("/platform/member/common/findChangeApplyInfo", {id: expandRow.id})
if (resp.code === 0) {
const data = resp.data
data.audit = audit
data.currentUnionName = data.currentUnion ? data.currentUnion.unionname : null
this.info = data
if (audit) {
this.active = 'school'
} else {
this.active = 'info'
}
await this.unitChange(data.currentUnitId)
this.$refs.guava.edit()
if (this.$refs['form']) {
this.$refs['form'].resetFields()
}
this.formData = {
recordId: expandRow.id,
username: "${@shiro.getPrincipalProperty('username')}",
auditTime: moment().format('YYYY-MM-DD'),
}
} else {
this.info = {}
this.notifyWarning(resp.msg)
}
},
async doAudit(pass) {
this.formData.currentUnitId = this.info.currentUnitId
this.formData.currentUnionId = this.info.currentUnionId
this.formData.currentThreeUnitId = this.info.currentThreeUnitId
this.formData.auditPass = pass
this.submitLoading = true
const resp = await $.post("/platform/member/change/audit/doAudit", this.formData)
this.submitLoading = false
if (resp.code === 0) {
//更新用户信息
this.info.userId = null
this.pageData()
this.$refs.guava.index()
} else {
this.notifyWarning(resp.msg)
}
},
async unitChange(v) { async unitChange(v) {
const unit = this.unitOptions.find(x => x.id === v) const unit = this.unitOptions.find(x => x.id === v)
if (unit) { if (unit) {
@@ -75,7 +75,7 @@ layout("/layouts/platform.html"){
<el-date-picker <el-date-picker
v-model="formData.startTime" v-model="formData.startTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择开始时间"> placeholder="选择开始时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@@ -83,13 +83,13 @@ layout("/layouts/platform.html"){
<el-date-picker <el-date-picker
v-model="formData.endTime" v-model="formData.endTime"
type="datetime" type="datetime"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择结束时间"> placeholder="选择结束时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item prop="createTaskMode" label="核对模式"> <el-form-item prop="createTaskMode" label="核对模式">
<el-radio-group v-model="formData.createTaskMode"> <el-radio-group v-model="formData.createTaskMode">
<el-radio-button :label="1">工会小组核对</el-radio-button> <el-radio-button :label="1">分工会核对</el-radio-button>
<el-radio-button :label="2">个人核对</el-radio-button> <el-radio-button :label="2">个人核对</el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
@@ -5,18 +5,18 @@ layout("/layouts/platform.html"){
<guava ref="guava"> <guava ref="guava">
<el-card shadow="never"> <el-card shadow="never">
<div class="search"> <div class="search">
<div class="search-item"> <!-- <div class="search-item">-->
<div class="search-item-label">年度:</div> <!-- <div class="search-item-label">年度:</div>-->
<div class="search-item-option"> <!-- <div class="search-item-option">-->
<el-date-picker <!-- <el-date-picker-->
style="width: 100%" <!-- style="width: 100%"-->
v-model="pageForm.year" <!-- v-model="pageForm.year"-->
type="year" <!-- type="year"-->
value-format="yyyy" <!-- value-format="yyyy"-->
placeholder="选择年度"> <!-- placeholder="选择年度">-->
</el-date-picker> <!-- </el-date-picker>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
<div class="search-item"> <div class="search-item">
<div class="search-item-label">任务:</div> <div class="search-item-label">任务:</div>
<div class="search-item-option"> <div class="search-item-option">
@@ -45,7 +45,7 @@ layout("/layouts/platform.html"){
</div> </div>
<div class="search-item" <div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"> v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionMemberAdmin')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div> <div class="search-item-label">所属工会:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" <el-select placeholder="所属工会" v-model="pageForm.unionId"
@@ -60,7 +60,7 @@ layout("/layouts/platform.html"){
</div> </div>
<div class="search-item" <div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"> v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionMemberAdmin')||@shiro.hasRole('H03')}">
<div class="search-item-label">组成单位:</div> <div class="search-item-label">组成单位:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-select placeholder="组成单位" v-model="pageForm.unitId" style="width: 100%;" <el-select placeholder="组成单位" v-model="pageForm.unitId" style="width: 100%;"
@@ -73,41 +73,55 @@ layout("/layouts/platform.html"){
</div> </div>
</div> </div>
<template v-if="isThreeUnit">
<div class="search-item"> <div class="search-item">
<div class="search-item-label">工会小组:</div> <div class="search-item-label">性&emsp;&emsp;别:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-select v-model="pageForm.unionGroupId" style="width: 100%" <el-select v-model="pageForm.sex" style="width: 100%" clearable
filterable
clearable
@change="getThreeUnits"
placeholder="请选择"> placeholder="请选择">
<el-option <el-option v-for="sex in sexOptions" :label="sex"
v-for="item in unionGroups" :value="sex"></el-option>
:key="item.id"
:label="item.groupName"
:value="item.id">
</el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<div class="search-item"> <div class="search-item">
<div class="search-item-label">组成科室:</div> <div class="search-item-label">在职状态:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-select v-model="pageForm.threeUnitId" style="width: 100%" filterable <dict-select v-model="pageForm.userStates"
style="width: 100%"
multiple
clearable clearable
placeholder="请选择"> placeholder="在职状态"
<el-option code="userState"></dict-select>
v-for="item in threeUnits" </div>
:key="item.id" </div>
:label="item.name"
:value="item.id"> <div class="search-item">
</el-option> <div class="search-item-label">人员类型:</div>
</el-select> <div class="search-item-option">
<dict-select v-model="pageForm.personTypes"
style="width: 100%"
multiple
clearable
placeholder="人员类型"
code="UserType"></dict-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">变更类型:</div>
<div class="search-item-option">
<enum-select v-model="pageForm.changeTypes"
enum="UserChangeType"
label="description"
multiple
value="code"
style="width: 100%"
clearable
placeholder="变更类型"
></enum-select>
</div> </div>
</div> </div>
</template>
<div class="search-query"> <div class="search-query">
<el-button type="primary" icon="el-icon-search" <el-button type="primary" icon="el-icon-search"
@@ -121,11 +135,11 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt10"> <el-card shadow="never" class="mt10">
<table-tool label="人员列表" :app="this"> <table-tool label="人员列表" :app="this">
<template #func> <template #func>
<!-- <span class="text-danger">人员信息是否异动:</span>--> <!-- <span class="text-danger">人员信息是否异动:</span>-->
<el-select v-model="pageForm.isMember" @change="doSearch()" <el-select v-model="pageForm.isMember" @change="doSearch();getNumData()"
:clearable="false" size="small" :clearable="false" size="small"
style="width: 200px;margin-right: 5px"> style="width: 200px;margin-right: 5px">
<el-option label="全部会员" value=""></el-option> <el-option label="全部" value=""></el-option>
<el-option label="是会员" value="1"></el-option> <el-option label="是会员" value="1"></el-option>
<el-option label="不是会员" value="0"></el-option> <el-option label="不是会员" value="0"></el-option>
</el-select> </el-select>
@@ -144,21 +158,21 @@ layout("/layouts/platform.html"){
<el-radio-button label="1">是({{numData.memberNum}})</el-radio-button> <el-radio-button label="1">是({{numData.memberNum}})</el-radio-button>
<el-radio-button label="0">否({{numData.notMemberNum}})</el-radio-button> <el-radio-button label="0">否({{numData.notMemberNum}})</el-radio-button>
</el-radio-group> </el-radio-group>
--> -->
<!-- <span v-if="!allowOperationTask" class="text-danger mr10"> <!-- <span v-if="!allowOperationTask" class="text-danger mr10">
该任务不在核对时间内,无法操作 该任务不在核对时间内,无法操作
</span>--> </span>-->
<el-dropdown style="margin: 0 10px" @command="pushDropdownCommand"> <!-- <el-dropdown style="margin: 0 10px" @command="pushDropdownCommand">-->
<el-button type="primary" size="small" icon="el-icon-plus"> <!-- <el-button type="primary" size="small" icon="el-icon-plus">-->
添加 <!-- 添加-->
</el-button> <!-- </el-button>-->
<el-dropdown-menu slot="dropdown"> <!-- <el-dropdown-menu slot="dropdown">-->
<el-dropdown-item :command="{type:'select'}">选择加入 <!-- <el-dropdown-item :command="{type:'select'}">选择加入-->
</el-dropdown-item> <!-- </el-dropdown-item>-->
<el-dropdown-item :command="{type:'add'}">新增用户 <!-- <el-dropdown-item :command="{type:'add'}">新增用户-->
</el-dropdown-item> <!-- </el-dropdown-item>-->
</el-dropdown-menu> <!-- </el-dropdown-menu>-->
</el-dropdown> <!-- </el-dropdown>-->
<el-button icon="el-icon-success" size="small" type="primary" <el-button icon="el-icon-success" size="small" type="primary"
@click="submitCheck" @click="submitCheck"
@@ -176,11 +190,11 @@ layout("/layouts/platform.html"){
size="small" @click="doExportByUnion">导出 size="small" @click="doExportByUnion">导出
</el-button> </el-button>
<el-button :disabled="!checkUsers.length" type="primary" size="small" <!-- <el-button :disabled="!checkUsers.length" type="primary" size="small"-->
icon="el-icon-edit" <!-- icon="el-icon-edit"-->
@click="openUnitMove" class="ml5"> <!-- @click="openUnitMove" class="ml5">-->
单位调整 <!-- 单位调整-->
</el-button> <!-- </el-button>-->
</template> </template>
</table-tool> </table-tool>
@@ -189,7 +203,7 @@ layout("/layouts/platform.html"){
v-loading="tableLoading" :size="tableSize" class="vi-table" ref="table" v-loading="tableLoading" :size="tableSize" class="vi-table" ref="table"
@selection-change="tableHandleSelectionChange"> @selection-change="tableHandleSelectionChange">
<el-table-column type="selection" :reserve-selection="true"></el-table-column> <!-- <el-table-column type="selection" :reserve-selection="true"></el-table-column>-->
<el-table-column align="center" header-align="center" type="index" <el-table-column align="center" header-align="center" type="index"
:index="indexMethod" label="序号" :index="indexMethod" label="序号"
@@ -211,10 +225,12 @@ layout("/layouts/platform.html"){
header-align="center" sortable header-align="center" sortable
align="center" show-overflow-tooltip> align="center" show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column label="异动类型" prop="changeType" header-align="center" <el-table-column label="异动类型" prop="changeTypes" header-align="center"
align="center" show-overflow-tooltip sortable> align="center" show-overflow-tooltip sortable>
<template scope="{row}"> <template scope="{row}">
<span style="color: #0e78c5">{{changeType[row.changeType]}}</span> <span style="color: #0e78c5;cursor: pointer" @click="openUserChangeInfo(row)">
{{getChangeTypes(row.changeTypes)}}
</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@@ -254,114 +270,18 @@ layout("/layouts/platform.html"){
</el-card> </el-card>
<template #edit> <template #edit>
<mem-change-apply ref="apply" :userid="userId" @submit="doSubmitChangeUser" <mem-change-apply ref="apply" :userid="userId"
:welfare_member="true" @submit="doSubmitChangeUser"
change_mode="check"></mem-change-apply> change_mode="check"></mem-change-apply>
</template> </template>
<template #public> <template #public>
<member ref="member" :id="userId" @save="afterEdit"></member> <member ref="member" :id="userId" @save="afterEdit"></member>
</template> </template>
<user-change-history ref="userChangeHistory"></user-change-history>
</guava> </guava>
<el-drawer
title="单位调整"
:visible.sync="unitMoveVisibile"
:before-close="handleClose" size="70%">
<el-row class="text-primary p20">
选择新单位
</el-row>
<el-row type="flex" :gutter="20" class="pl20 pr20">
<el-col :span="12">
<el-select placeholder="请选择新工会" v-model="unitMoveFormData.unionId"
style="width: 100%;"
clearable="true"
@change="moveUnionsChange"
filterable="true">
<el-option v-for="item in unitMoveUnions" :label="item.unionname"
:value="item.id"></el-option>
</el-select>
</el-col>
<el-col :span="12">
<el-select v-model="unitMoveFormData.unitId" style="width: 100%" filterable
clearable
@change="moveUnitChange"
placeholder="请选择新单位">
<el-option
v-for="item in unitMoveUnits"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="12">
<el-select v-model="unitMoveFormData.threeUnitId" clearable filterable
placeholder="请选择新科室"
style="width: 100%" @change="threeUnitChange">
<el-option
v-for="item in threeUnits"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="12">
<el-input :value="unitMoveFormData.unionGroupName" disabled
placeholder="新工会小组"></el-input>
</el-col>
</el-row>
<el-row class="mt10">
<el-table :data="checkUsers" style="width: 100%;padding: 20px" class="vi-table"
border
height="70vh">
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="loginname"
width="120"
label="工号"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="username"
width="120"
label="姓名"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="threeUnitName"
label="当前科室"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="unitname"
label="当前单位"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="unionname"
label="当前工会"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
label="新科室">
<template slot-scope="{row}">
<span>{{unitMoveFormData.threeUnitName}}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
label="新单位">
<template slot-scope="{row}">
<span>{{unitMoveFormData.unitName}}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
label="新分工会">
<template slot-scope="{row}">
<span>{{unitMoveFormData.unionName}}</span>
</template>
</el-table-column>
</el-table>
</el-row>
<span style="position: absolute;bottom: 20px;right: 20px">
<el-button @click="unitMoveVisibile = false">取 消</el-button>
<el-button type="primary" @click="doUnitMove">确定</el-button>
</span>
</el-drawer>
<el-drawer <el-drawer
title="添加会员" title="添加会员"
@@ -380,6 +300,7 @@ layout("/layouts/platform.html"){
</span> </span>
</el-drawer> </el-drawer>
<user-change-history ref="userChangeHistory"></user-change-history>
</div> </div>
<script> <script>
@@ -387,8 +308,9 @@ layout("/layouts/platform.html"){
el: '#app', el: '#app',
mixins: [initTableMixins], mixins: [initTableMixins],
components: { components: {
'mem-change-apply': httpVueLoader('/components/member/MemChangeApply.vue?v=1.0.2'), 'mem-change-apply': httpVueLoader('/components/member/MemChangeApply.vue?v=' + new Date().getTime()),
'member-user-select': httpVueLoader('/components/plugins/MemberUserTableSelect.vue?v=1.0.0'), 'member-user-select': httpVueLoader('/components/plugins/MemberUserTableSelect.vue?v=' + new Date().getTime()),
'user-change-history': httpVueLoader('/components/userChangeHistory/userChangeHistory.vue?v=' + new Date().getTime()),
}, },
computed: { computed: {
allowOperationTask() { allowOperationTask() {
@@ -420,10 +342,10 @@ layout("/layouts/platform.html"){
{prop: 'userState', label: '在职状态', sortable: true}, {prop: 'userState', label: '在职状态', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true}, {prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true}, {prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'threeUnitName', label: '所在科室', sortable: true, checked: 0}, // {prop: 'threeUnitName', label: '所在科室', sortable: true},
{prop: 'unionGroupName', label: '工会小组', sortable: true, checked: 0}, // {prop: 'unionGroupName', label: '工会小组', sortable: true},
], ],
isThreeUnit:null,
pageForm: { pageForm: {
year: new Date().getFullYear() + '', year: new Date().getFullYear() + '',
searchName: 'username', searchName: 'username',
@@ -432,7 +354,14 @@ layout("/layouts/platform.html"){
unionId: '', unionId: '',
unitId: '', unitId: '',
unionGroupId: '', unionGroupId: '',
changeTypes: [],
personTypes: [],
changeOrigins: []
}, },
sexOptions: ['男', '女'],
memberCheckTaskOptions: [], memberCheckTaskOptions: [],
changeType: {}, changeType: {},
userId: null, userId: null,
@@ -460,6 +389,18 @@ layout("/layouts/platform.html"){
} }
}, },
methods: { methods: {
async openUserChangeInfo({hisId, changeTypes}) {
this.$refs.userChangeHistory.openUserChangeInfo(hisId, changeTypes)
},
getChangeTypes(changeTypes) {
if (changeTypes) {
const c = JSON.parse(changeTypes)
return c.map(v => {
return this.changeType[v]
}).join(',')
}
return null
},
doExportByUnion() { doExportByUnion() {
let props = {} let props = {}
this.tableColumns.forEach(v => { this.tableColumns.forEach(v => {
@@ -623,17 +564,17 @@ layout("/layouts/platform.html"){
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async doSubmitChangeUser(formData) { async doSubmitChangeUser(formData) {
console.log(formData)
formData.taskId = this.pageForm.taskId formData.taskId = this.pageForm.taskId
const resp = await $.post(loc() + '/doSubmitChangeUser', formData) const resp = await $.post(loc() + '/doSubmitChangeUser', formData)
this.$refs.apply.closeLoading() this.$refs.apply.closeLoading()
if (resp.code === 0) { if (resp.code === 0) {
this.$message.success(resp.msg)
this.userId = null this.userId = null
this.$refs.guava.index() this.$refs.guava.index()
this.pageData() this.pageData()
this.getNumData() this.getNumData()
} else { } else {
this.notifyWarning(resp.msg) this.$message.warning(resp.msg)
} }
}, },
@@ -641,8 +582,8 @@ layout("/layouts/platform.html"){
* 提交核对 * 提交核对
*/ */
async submitCheck() { async submitCheck() {
if (!this.pageForm.unionGroupId) { if (!this.pageForm.unionId) {
this.notifyWarning("请选择需要核对的工会小组!") this.notifyWarning("请选择需要核对的分工会!")
return return
} }
const confirm = await this.$confirm('此操作会提交至校工会确认,请确认核对完成了吗?', '提示', { const confirm = await this.$confirm('此操作会提交至校工会确认,请确认核对完成了吗?', '提示', {
@@ -671,7 +612,7 @@ layout("/layouts/platform.html"){
}, },
async flushUnits() { async flushUnits() {
this.$set(this.pageForm, "unitId", "") this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') { if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('SchoolUnionMemberAdmin')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId) this.units = await getUnits(this.pageForm.unionId)
} else { } else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}") this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
@@ -696,8 +637,8 @@ layout("/layouts/platform.html"){
} }
}, },
async checkAgain() { async checkAgain() {
if (!this.pageForm.unionGroupId) { if (!this.pageForm.unionId) {
this.notifyWarning("请选择需要重新核对的工会小组!") this.notifyWarning("请选择需要重新核对的工会!")
return return
} }
const confirm = await this.$confirm('您确定要重新核对吗?', '提示', { const confirm = await this.$confirm('您确定要重新核对吗?', '提示', {
@@ -714,28 +655,44 @@ layout("/layouts/platform.html"){
} }
}, },
async getNumData() { async getNumData() {
const resp = await $.post(loc() + '/getButtonNum', this.pageForm) const pageForm = clone(this.pageForm)
pageForm.userStates = JSON.stringify(pageForm.userStates)
pageForm.personTypes = JSON.stringify(pageForm.personTypes)
pageForm.changeTypes = JSON.stringify(pageForm.changeTypes)
pageForm.changeOrigins = JSON.stringify(pageForm.changeOrigins)
const resp = await $.post(loc() + '/getButtonNum', pageForm)
if (resp.code === 0) { if (resp.code === 0) {
this.numData = resp.data this.numData = resp.data
} else { } else {
this.notifyWarning(resp.msg) this.notifyWarning(resp.msg)
} }
},
pageData() {
sublime.showLoadingbar();
this.tableLoading = true
const pageForm = clone(this.pageForm)
pageForm.userStates = JSON.stringify(pageForm.userStates)
pageForm.personTypes = JSON.stringify(pageForm.personTypes)
pageForm.changeTypes = JSON.stringify(pageForm.changeTypes)
pageForm.changeOrigins = JSON.stringify(pageForm.changeOrigins)
$.post(loc() + '/pageData', pageForm, (data) => {
sublime.closeLoadingbar();
this.tableLoading = false
if (data.code === 0) {
this.tableData = data.data.list;
this.pageForm.totalCount = data.data.totalCount;
} else {
this.$message.error(data.msg);
} }
}, "json");
},
}, },
async created() { async created() {
this.isThreeUnit = await getConfigKey('isThreeUnit') === 'true'
if (this.isThreeUnit) {
this.tableColumns.forEach(v => {
if (["threeUnitName", "unionGroupName"].includes(v.prop)) {
v.checked = 1
}
})
}
await this.getMemberCheckTaskOptions() await this.getMemberCheckTaskOptions()
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('H03')||@shiro.hasRole('A06')}" === 'false') { if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('H03')||@shiro.hasRole('SchoolUnionMemberAdmin')}" === 'false') {
this.unions = await getUnions(null, true) this.unions = await getUnions(null, true)
this.is_ghxzzz = true this.is_ghxzzz = true
this.$set(this.pageForm, "unionId", this.unions[0].id) this.$set(this.pageForm, "unionId", this.unions[0].id)