Compare commits

15 Commits
Author SHA1 Message Date
c-zhouhf1 584e710136 commit 2026-09-10 16:09:33 +08:00
c-zhouhf1 9f7c0f214e commit 2026-09-09 10:26:53 +08:00
c-zhouhf1 7322252d41 commit 2026-09-07 15:18:17 +08:00
c-zhouhf1 bc56b0c777 commit 2026-07-02 10:52:23 +08:00
c-zhouhf1 ada0306d4e commit 2026-07-01 13:55:00 +08:00
c-zhouhf1 da87374d15 commit 2026-07-01 10:38:21 +08:00
c-zhouhf1 21f5105058 Merge branch 'main' of https://dd3skj.picp.vip/JyuHsin/zhgh_jshvc 2026-07-01 10:37:59 +08:00
c-zhouhf1 7e46c8bccb commit 2026-07-01 10:37:51 +08:00
c-zhouhf1 9b37a9800d commit 2026-07-01 10:37:46 +08:00
c-zhangr1 e349f57511 1 2026-06-30 15:35:13 +08:00
= 725b08caef Merge branch 'main' of https://dd3skj.picp.vip/JyuHsin/zhgh_jshvc 2026-06-30 13:44:18 +08:00
= b91a62d949 commit 2026-06-30 13:42:08 +08:00
c-zhouhf1 fad75b8f4f Merge branch 'main' of https://dd3skj.picp.vip/JyuHsin/zhgh_jshvc
# Conflicts:
#	src/main/resources/application-dev.yaml
2026-06-30 08:44:59 +08:00
c-zhouhf1 7260e1f2d3 commit 2026-06-30 08:43:12 +08:00
c-zhouhf1 dc3e67775b commit 2026-06-30 08:43:01 +08:00
50 changed files with 7135 additions and 2531 deletions
@@ -161,7 +161,7 @@ public class FlowDesignController {
return Result.success(); return Result.success();
} }
@At @At("/xiugaiDesign")
@ApiOperation("修改流程设计") @ApiOperation("修改流程设计")
@SaCheckPermission("flow.design") @SaCheckPermission("flow.design")
public Result updateContent(@Param("design") ProcessDesign processDesign) { public Result updateContent(@Param("design") ProcessDesign processDesign) {
@@ -228,7 +228,7 @@ public class FlowDesignController {
public Result assigneePage(Integer pageNumber, Integer pageSize, String searchKeyword, @Param("userIds") String[] userIds) { public Result assigneePage(Integer pageNumber, Integer pageSize, String searchKeyword, @Param("userIds") String[] userIds) {
Sql sql = Sqls.create("select id,loginname,username,unitName from vw_user $condition"); Sql sql = Sqls.create("select id,loginname,username,unitName from vw_user $condition");
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if(StrUtil.isNotBlank(searchKeyword)) { if (StrUtil.isNotBlank(searchKeyword)) {
SqlExpressionGroup group = new SqlExpressionGroup(); SqlExpressionGroup group = new SqlExpressionGroup();
group.orLike("username", searchKeyword); group.orLike("username", searchKeyword);
group.orLike("loginname", searchKeyword); group.orLike("loginname", searchKeyword);
@@ -92,6 +92,7 @@ public class SysDataUnitPullServiceImpl extends BaseServiceImpl<Sys_unit> implem
} }
log.info("本次拉取单位数据,新增{}条,更新{}条", insertList.size(), updateList.size()); log.info("本次拉取单位数据,新增{}条,更新{}条", insertList.size(), updateList.size());
dao().insert(insertList); dao().insert(insertList);
dao().update(updateList); // 单位同步只更新数据中心负责维护的字段,避免将未参与映射的工会、小组等本地关联字段覆盖为空。
dao().update(updateList, "name|unitcode|unitType|unitTypeCode|parentId|unitLevel");
} }
} }
@@ -0,0 +1,312 @@
package com.budwk.app.zhgh.activity.sports.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.base.utils.DateUtil;
import com.budwk.app.base.utils.PwdUtil;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.activity.basic.models.ActivityBasicUnion;
import com.budwk.app.zhgh.activity.basic.models.ActivityBasicUnit;
import com.budwk.app.zhgh.activity.sports.models.ActivityResults;
import com.budwk.app.zhgh.activity.sports.models.ActivitySchoolApply;
import com.budwk.app.zhgh.activity.sports.service.ActivitySportsApplyUserService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.random.R;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.trans.Trans;
import java.util.Arrays;
/**
* @author zhf
* @date 2021/5/19 14:58
* @description 运动会成绩录入
*/
@IocBean
@Ok("json:full")
@At("/platform/activity/results/input")
public class ActivitySportsResultsController {
@Inject
private BaseService baseService;
@Inject
private ActivitySportsApplyUserService activitySchoolApplyViService;
@At("")
@Ok("beetl:platform/zhgh/activity/sports/ActivityResults/index.html")
@SaCheckPermission("activity.results.input")
public void index() {
}
@At
@SaCheckPermission("activity.results.input")
public Result pageData(String groupName,
PageForm page,
String activityId,
String eventId,
String[] isMenWomen) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
ase.id,
ase.activityId,
ase.eventId,
ae.projectType awardsMode,
ae.allName,
ae.isMenWomen,
school.`name` ,
( SELECT COUNT( 1 ) FROM activity_results ar WHERE ar.eventId = ase.eventId and ar.activityId=ase.activityId) rs
FROM
activity_school_event ase
LEFT JOIN activity_event ae ON ase.eventId = ae.id
LEFT JOIN activity_school school ON school.id = ase.activityId
LEFT JOIN activity_basic_settings abs ON abs.id=ae.competitionCategory
$condition
""");
cnd.and("ase.activityId", "=", activityId);
cnd.andEX("abs.`name`", "=", groupName);
cnd.andEX("ae.`id`", "=", eventId);
SqlExpressionGroup sqlExpressionGroup = new SqlExpressionGroup();
if (isMenWomen != null) {
if (Arrays.stream(isMenWomen).anyMatch(a -> a.equals("2"))) {
sqlExpressionGroup.and("ae.isMenWomen", "=", 1);
}
if (Arrays.stream(isMenWomen).anyMatch(a -> a.equals("3"))) {
sqlExpressionGroup.or("ae.isMenWomen", "=", 2);
}
if (Arrays.stream(isMenWomen).anyMatch(a -> a.equals("4"))) {
sqlExpressionGroup.and("ae.projectType", "=", 1);
}
if (Arrays.stream(isMenWomen).anyMatch(a -> a.equals("5"))) {
sqlExpressionGroup.or("ae.projectType", "=", 2);
}
}
if (sqlExpressionGroup.getExps().size() > 0) {
cnd.and(sqlExpressionGroup);
}
cnd.desc("allName");
sql.setCondition(cnd);
return Result.success(baseService.listPageMap(page.getPageNumber(), page.getPageSize(), sql));
}
@At
@SaCheckPermission("activity.results.input")
@Aop(TransAop.READ_COMMITTED)
public Result doAdd(@Param(value = "activityResults") ActivityResults[] activityResults, String activityId, String eventId) {
baseService.dao().clear(ActivityResults.class, Cnd.where("activityId", "=", activityId).and("eventId", "=", eventId));
baseService.insert(activityResults);
return Result.success();
}
@At
@SaCheckPermission("activity.results.input")
@Aop(TransAop.READ_COMMITTED)
public Result doAddUser(ActivitySchoolApply activitySchoolApply) {
Sys_user sysUser = baseService.dao().fetch(Sys_user.class, Cnd.where("loginname", "=", activitySchoolApply.getLoginname()));
if (sysUser != null && sysUser.getLoginname().equals(activitySchoolApply.getLoginname()) && !sysUser.getUsername().equals(activitySchoolApply.getUsername())) {
return Result.error("工号已存在,请检查姓名和工号是否一致!");
}
if (sysUser == null) {
Trans.exec(() -> {
String pwd = "@dd3s#3618!";
String salt = R.UU32();
Sys_user user = new Sys_user();
user.setId(R.UU32());
user.setSalt(R.UU32());
user.setPassword(PwdUtil.getPassword(pwd, salt));
user.setUsername(activitySchoolApply.getUsername());
user.setLoginname(activitySchoolApply.getLoginname());
user.setSex(activitySchoolApply.getSex());
user.setUnitId(activitySchoolApply.getUnitId());
user.setMobile(activitySchoolApply.getMobile());
baseService.insert(user);
ActivityBasicUnit activityBasicUnit = activitySchoolApplyViService.dao().fetch(ActivityBasicUnit.class, Cnd.where("id", "=", user.getUnitId()));
ActivityBasicUnion basicUnion = activitySchoolApplyViService.dao().fetch(ActivityBasicUnion.class, Cnd.where("id", "=", activityBasicUnit.getUnionId()));
activitySchoolApply.setUserId(user.getId());
activitySchoolApply.setApplyUser(SecurityUtil.getUserId());
activitySchoolApply.setApplyDate(DateUtil.getDate());
activitySchoolApply.setSex(user.getSex());
activitySchoolApply.setUnitId(user.getUnitId());
activitySchoolApply.setActivityUnionId(basicUnion.getId());
activitySchoolApply.setActivityUnionName(basicUnion.getName());
activitySchoolApplyViService.insert(activitySchoolApply);
});
return Result.success();
}
sysUser.setSex(activitySchoolApply.getSex());
baseService.update(sysUser);
ActivityBasicUnit activityBasicUnit = activitySchoolApplyViService.dao().fetch(ActivityBasicUnit.class, Cnd.where("id", "=", sysUser.getUnitId()));
ActivityBasicUnion basicUnion = activitySchoolApplyViService.dao().fetch(ActivityBasicUnion.class, Cnd.where("id", "=", activityBasicUnit.getUnionId()));
activitySchoolApply.setUserId(sysUser.getId());
activitySchoolApply.setApplyUser(SecurityUtil.getUserId());
activitySchoolApply.setApplyDate(DateUtil.getDate());
activitySchoolApply.setUnitId(sysUser.getUnitId());
activitySchoolApply.setActivityUnionId(basicUnion.getId());
activitySchoolApply.setActivityUnionName(basicUnion.getName());
activitySchoolApplyViService.insert(activitySchoolApply);
return Result.success();
}
/**
* 查询个人参赛人员
*
* @param activityId
* @param eventId
* @param isMenWomen
* @return
*/
@At
@SaCheckPermission("activity.results.input")
public Result getUserList(String activityId,
String eventId,
Integer isMenWomen) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
u.id,u.username,u.loginname,u.unionId,
u.unionname,u.sex
FROM
activity_school_apply asa
LEFT JOIN `vw_user` u ON u.id = asa.userId $condition
""");
cnd.and("asa.activityId", "=", activityId);
cnd.and("asa.eventId", "=", eventId);
cnd.and("asa.awardsMode", "=", 1);
if (isMenWomen != null && isMenWomen == 1) cnd.and("u.sex", "=", "男性");
if (isMenWomen != null && isMenWomen == 2) cnd.and("u.sex", "=", "女性");
sql.setCondition(cnd);
return Result.success(activitySchoolApplyViService.listMap(sql));
}
@At
@SaCheckPermission("activity.results.input")
public Result getUnionDetails(String activityId, String eventId, String unionId) {
int count = activitySchoolApplyViService.count(Cnd.where("activityId", "=", activityId).and("eventId", "=", eventId).and("unionId", "=", unionId));
return Result.success(count);
}
/**
* 查询团体参赛分工会
*
* @param activityId
* @param eventId
* @return
*/
@At
@SaCheckLogin
public Result getUnionList(String activityId,
String eventId) {
Sql sql = Sqls.create("""
SELECT
un.id,
un.name unionname
FROM
activity_school_apply asa
LEFT JOIN sys_union un ON un.id = asa.unionId
WHERE
asa.activityId = @activityId
AND asa.eventId = @eventId
GROUP BY
un.name
""").setParam("activityId", activityId).setParam("eventId", eventId);
return Result.success(activitySchoolApplyViService.list(sql));
}
/**
* 根据活动项目性别查询有没有获奖人员
*
* @return
*/
@At
@SaCheckPermission("activity.results.input")
public Result getUserData(String activityId,
String eventId,
Integer isMenWomen) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
ar.id,
ar.userId,
ar.activityId,
ar.eventId,
u.username,
u.unionId unionId,
u.unionname,
u.sex,
ar.integral,
ar.numberOfPeople,
ar.ranking,
ar.isTeamPersonal
FROM
`activity_results` ar
LEFT JOIN `vw_user` u ON ar.userId = u.id $condition
""");
cnd.and("ar.activityId", "=", activityId);
cnd.and("ar.eventId", "=", eventId);
if (isMenWomen != null && isMenWomen == 1) cnd.and("u.sex", "=", "男性");
if (isMenWomen != null && isMenWomen == 2) cnd.and("u.sex", "=", "女性");
cnd.asc("ar.ranking");
sql.setCondition(cnd);
return Result.success(baseService.listMap(sql));
}
@At
@SaCheckPermission("activity.results.input")
public Result getUnionData(String activityId,
String eventId) {
Sql sql = Sqls.create("""
SELECT
ar.id,
ar.activityId,
ar.eventId,
ar.ranking,
ar.unionId,
ar.numberOfPeople,
ar.integral,
ar.isTeamPersonal
FROM
activity_results ar
WHERE
ar.isTeamPersonal = 2
AND ar.activityId = @activityId
AND ar.eventId = @eventId
ORDER BY ar.ranking asc
""").setParam("activityId", activityId).setParam("eventId", eventId);
return Result.success(baseService.listMap(sql));
}
}
@@ -0,0 +1,491 @@
package com.budwk.app.zhgh.activity.sports.controller;
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.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.sys.models.Sys_union;
import com.budwk.app.sys.services.SysUnionService;
import com.budwk.app.zhgh.activity.sports.models.ActivitySchool;
import com.budwk.app.zhgh.activity.sports.models.ActivitySchoolEvent;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
* @author zhf
* @date 2021/5/24 14:12
* @description 运动会成绩统计
*/
@IocBean
@Ok("json:full")
@At("/platform/activity/score/statistics")
public class ActivitySportsScoreStatisticsController {
@Inject
private SysUnionService sysUnionService;
@Inject
private BaseService baseService;
// @Inject
// private OfficeTemplateUtil officeTemplateUtil;
@At("")
@Ok("beetl:platform/zhgh/activity/sports/scoreStatistics/index.html")
@SaCheckPermission("activity.score.statistics")
public void index() {
}
@At
@SaCheckPermission("activity.score.statistics")
@ApiOperation("男子项目分工会积分/女子项目分工会积分")
public Result isMaleFemale(String activityId, String sex, Integer awardsMode) {
NutMap map = new NutMap();
List<NutMap> result = new ArrayList<>();
//查询所有的工会
List<Sys_union> query = sysUnionService.query();
Cnd cndX = Cnd.NEW();
//查询所有的项目
Sql sqlX = Sqls.create("""
SELECT
ev.id,
ev.eventId,
ba.`name` baname,
eve.projectType awardsMode,
eve.allName label,
eve.isMenWomen
FROM
activity_school_event ev
LEFT JOIN activity_event eve ON ev.eventId = eve.id
LEFT JOIN activity_basic_settings ba ON eve.competitionCategory = ba.id $condition
""");
cndX.and("ev.activityId", "=", activityId);
if (awardsMode < 3) {
cndX.and("eve.projectType", "=", awardsMode);
cndX.and("eve.isInterest", "=", false);
cndX.and("eve.isMenWomen", "=", sex.equals("") ? 1 : 2);
}
if (awardsMode == 3) {
cndX.and("eve.isInterest", "=", true);
}
if (awardsMode == 4) {
cndX.and(Cnd.exps("eve.isMenWomen", "=", sex.equals("") ? 1 : 2).or("eve.isMenWomen", "is", null));
}
cndX.and(new Static("1=1 order by case ba.`name` when '甲组' then 1 when '乙组' then 2 when '丙组' then 3 when '丁组' then 4 when '团体' then 5 end"));
sqlX.setCondition(cndX);
List<Record> eventList = baseService.list(sqlX);
//查询每个工会下每个项目的成绩
for (Sys_union sys_union : query) {
NutMap nutMap = new NutMap();
//记录总积分
double totalScore = 0;
nutMap.setv("unionname", sys_union.getName());
for (Record event : eventList) {
Sql sqlC = Sqls.create("""
SELECT
IF ( sum( integral ) IS NULL, 0, sum( integral )) AS integral,
ev.allName,ev.projectType,abs.`name` AS zb,ev.isInterest
FROM
activity_results ar
LEFT JOIN activity_event ev ON ar.eventId = ev.id
LEFT JOIN activity_basic_settings abs ON abs.id=ev.competitionCategory $condition
""");
Cnd cndC = Cnd.NEW();
if ((awardsMode == 1 && event.getString("awardsMode").equals("1")) || (awardsMode == 2 && event.getString("awardsMode").equals("2"))) {
cndC.and("ev.isInterest", "=", false);
cndC.and("ev.isMenWomen", "=", sex.equals("") ? 1 : 2);
} else if (awardsMode == 3) {
cndC.and("ev.isInterest", "=", true);
} else if (awardsMode == 4) {
cndC.and(Cnd.exps("ev.isMenWomen", "=", sex.equals("") ? 1 : 2).or("ev.isMenWomen", "is", null));
}
cndC.and("ar.eventId", "=", event.getString("eventid"));
cndC.and("ar.unionid", "=", sys_union.getId());
cndC.and("ar.activityId", "=", activityId);
sqlC.setCondition(cndC);
Double score = 0.0;
List<NutMap> list = baseService.listMap(sqlC);
boolean isInterest = list.get(0).getBoolean("isInterest");
if (list.size() > 0) {
score = list.get(0).getDouble("integral");
}
if (list.get(0).getString("allName") != null) {
if (!isInterest) {
nutMap.setv(list.get(0).getString("allName"), score);
} else {
nutMap.setv(list.get(0).getString("allName"), score / 2);
}
}
totalScore += isInterest ? (score / 2) : score;
if (list.get(0).getString("zb") != null) {
nutMap.setv("projectType", list.get(0).getString("projectType"));
nutMap.setv("zb", list.get(0).getString("zb"));
}
}
nutMap.setv("totalScore", totalScore);
result.add(nutMap);
}
map.put("score", result);
map.put("eventList", eventList);
return Result.success(map);
}
@At
@SaCheckPermission("activity.score.statistics")
@ApiOperation("单子单项前八/女子单项前八/团体项目前八")
public Result isTopEight(String activityId, String sex, Integer awardsMode) {
NutMap map = new NutMap();
Cnd cndX = Cnd.NEW();
//查询所有的项目
Sql sqlX = Sqls.create("""
SELECT
ev.id,
ev.eventId,
ba.`name` baname,
eve.projectType awardsMode,
eve.allName label
FROM
activity_school_event ev
LEFT JOIN activity_event eve ON ev.eventId = eve.id
LEFT JOIN activity_basic_settings ba ON eve.competitionCategory = ba.id $condition
""");
cndX.and("ev.activityId", "=", activityId);
if (awardsMode == 1) {
cndX.and("eve.isMenWomen", "!=", sex.equals("") ? 2 : 1);
cndX.and("eve.projectType", "=", 1);
} else {
cndX.and("eve.projectType", "=", 2);
}
cndX.and(new Static("1=1 order by case ba.`name` when '甲组' then 1 when '乙组' then 2 when '丙组' then 3 when '丁组' then 4 when '团体' then 5 end"));
sqlX.setCondition(cndX);
List<Record> eventList = baseService.list(sqlX);
Sql sqlC = Sqls.create("");
Cnd cnd = Cnd.NEW();
if (awardsMode == 1) {
sqlC = Sqls.create("""
SELECT
CONCAT( apply.username, '(', apply.activityUnionName, ')' ) username,
ar.integral,
ar.ranking,
eve.allName
FROM
activity_results ar
LEFT JOIN activity_event eve ON ar.eventId = eve.id
LEFT JOIN activity_school_apply apply ON apply.userId = ar.userId
AND ar.activityId = apply.activityId $condition
""");
cnd.and("ar.isTeamPersonal", "=", awardsMode);
cnd.and("apply.sex", "=", sex);
cnd.and("ar.activityId", "=", activityId);
cnd.and("ar.ranking", "<=", 8);
cnd.groupBy("ar.id");
} else {
sqlC = Sqls.create("""
SELECT
CONCAT(sun.name) username,
eve.allName,ar.ranking
FROM
activity_results ar
LEFT JOIN activity_event eve ON ar.eventId = eve.id
LEFT JOIN sys_union sun ON sun.id = ar.unionId $condition
""");
cnd.and("ar.isTeamPersonal", "=", awardsMode);
cnd.and("ar.activityId", "=", activityId);
cnd.and("ar.ranking", "<=", 8);
}
sqlC.setCondition(cnd);
List<Record> list = baseService.list(sqlC);
map.put("userList", list);
map.put("eventList", eventList);
return Result.success(map);
}
@At
@SaCheckLogin
public Result getActivitys(Integer year) {
List<ActivitySchool> schoolList = baseService.dao().query(ActivitySchool.class, Cnd.where("YEAR(applyEndTime)", "=", year));
return Result.success(schoolList);
}
@At
@SaCheckPermission("activity.score.statistics")
@ApiOperation("男子总分前八/女子总分前八")
public Result isScoreTopEight(String activityId, String sex) {
NutMap map = new NutMap();
List<NutMap> result = new ArrayList<>();
Cnd cndX = Cnd.NEW();
//查询所有的项目
Sql sqlX = Sqls.create("""
SELECT
ev.id,
ev.eventId,
ba.`name` baname,
eve.projectType awardsMode,
eve.allName label
FROM
activity_school_event ev
LEFT JOIN activity_event eve ON ev.eventId = eve.id
LEFT JOIN activity_basic_settings ba ON eve.competitionCategory = ba.id $condition
""");
cndX.and("ev.activityId", "=", activityId);
cndX.and(Cnd.exps("eve.isMenWomen", "=", sex.equals("") ? 1 : 2).or("eve.isMenWomen", "is", null));
cndX.and(new Static("1=1 order by case ba.`name` when '甲组' then 1 when '乙组' then 2 when '丙组' then 3 when '丁组' then 4 when '团体' then 5 end"));
sqlX.setCondition(cndX);
List<Record> eventList = baseService.list(sqlX);
//查询所有的工会
List<Sys_union> query = sysUnionService.query();
for (Sys_union sys_union : query) {
NutMap nutMap = new NutMap();
//记录总积分
double totalScore = 0;
nutMap.setv("unionname", sys_union.getName());
for (Record event : eventList) {
Sql sqlC = Sqls.create("""
SELECT
IF ( sum( integral ) IS NULL, 0, sum( integral )) AS integral,
ev.allName,ev.isInterest
FROM
activity_results ar
LEFT JOIN activity_event ev ON ar.eventId = ev.id $condition
""");
Cnd cndC = Cnd.NEW();
cndC.and(Cnd.exps("ev.isMenWomen", "=", sex.equals("") ? 1 : 2).or("ev.isMenWomen", "is", null));
cndC.and("ar.unionid", "=", sys_union.getId());
cndC.and("ar.eventId", "=", event.getString("eventid"));
cndC.and("ar.activityId", "=", activityId);
sqlC.setCondition(cndC);
Double score = 0.0;
List<NutMap> list = baseService.listMap(sqlC);
boolean isInterest = list.get(0).getBoolean("isInterest");
if (list.size() > 0) {
score = list.get(0).getDouble("integral");
}
totalScore += isInterest ? (score / 2) : score;
}
nutMap.setv("totalScore", totalScore);
result.add(nutMap);
}
map.put("score", result);
return Result.success(map);
}
@At
@SaCheckPermission("activity.score.statistics")
@ApiOperation("年度团体总分")
public Result getAnnualResults(Integer year) {
ArrayList<Map> resultMap = new ArrayList<>();
Dao dao = sysUnionService.dao();
List<Sys_union> unionList = sysUnionService.query();
List<ActivitySchool> activitySchoolList = dao.query(ActivitySchool.class, Cnd.where("YEAR(applyStartTime)", "=", year));
List<String> labelList = activitySchoolList.stream().map(v -> v.getName()).collect(Collectors.toList());
labelList.add(0, "分工会");
unionList.forEach(u -> {
NutMap unionMap = Lang.obj2nutmap(u);
AtomicReference<Double> scoreSum = new AtomicReference<>((double) 0);
activitySchoolList.forEach(x -> {
Sql sql = Sqls.create("""
SELECT sum(integral) as sumScore FROM `activity_results` ar
where ar.activityId = @activityId and ar.unionId = @unionId
""");
sql.setParam("activityId", x.getId());
sql.setParam("unionId", u.getId());
sql.setCallback(Sqls.callback.map());
dao.execute(sql);
NutMap scoreMap = (NutMap) sql.getResult();
double score = scoreMap.getDouble("sumScore");
scoreSum.updateAndGet(v -> v + score);
unionMap.put(x.getName(), score);
});
unionMap.put("总分", scoreSum.get());
unionMap.put("分工会", unionMap.getString("name"));
resultMap.add(unionMap);
});
labelList.add("总分");
return Result.success(Map.of("label", labelList, "score", resultMap));
}
@At
@ApiOperation("年度男子团体总分/年度女子团体总分")
@SaCheckPermission("activity.score.statistics")
public Result getYear8(Integer isMenWomen, Integer year) {
ArrayList<Map> resultMap = new ArrayList<>();
// int isMenWomen = sex.equals("男") ? 1 : 2;
Dao dao = sysUnionService.dao();
List<Sys_union> unionList = sysUnionService.query();
List<ActivitySchool> activityList = dao.query(ActivitySchool.class, Cnd.where("YEAR(applyStartTime)", "=", year));
List<String> activityIdList = activityList.stream().map(ActivitySchool::getId).collect(Collectors.toList());
List<String> activityNameList = activityList.stream().map(ActivitySchool::getName).collect(Collectors.toList());
List<String> eventIdList = dao.query(ActivitySchoolEvent.class, Cnd.where("activityId", "in", activityIdList)).stream().map(v -> v.getEventId()).collect(Collectors.toList());
activityNameList.add(0, "分工会");
Sql sql = Sqls.create("""
SELECT
ae.isMenWomen,
ae.isInterest,
ar.integral,
ar.unionId,
ar.activityId
FROM
activity_event ae
LEFT JOIN activity_results ar ON ar.eventId = ae.id
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("ae.id", "in", eventIdList);
cnd.and("ar.activityId", "in", activityIdList);
sql.setCondition(cnd);
sql.setCallback(Sqls.callback.maps());
dao.execute(sql);
List<NutMap> list = sql.getList(NutMap.class);
unionList.forEach(u -> {
NutMap unionMap = Lang.obj2nutmap(u);
AtomicReference<Double> scoreSum = new AtomicReference<>((double) 0);
activityList.forEach(a -> {
double sexScore = list.stream().filter(x -> x.getString("unionId").equals(u.getId()) && x.getInt("isMenWomen") == isMenWomen && x.getString("activityId").equals(a.getId())).mapToDouble(h -> h.getDouble("integral")).sum();
double qwScore = list.stream().filter(x -> x.getString("unionId").equals(u.getId()) && x.getInt("isInterest") == 1 && x.getString("activityId").equals(a.getId())).mapToDouble(h -> h.getDouble("integral")).sum();
scoreSum.updateAndGet(v -> v + sexScore + qwScore * 0.5);
unionMap.put(a.getName(), sexScore + (qwScore * 0.5));
});
unionMap.put("总分", scoreSum.get());
unionMap.put("分工会", unionMap.getString("name"));
resultMap.add(unionMap);
});
activityNameList.add("总分");
return Result.success(Map.of("label", activityNameList, "score", resultMap));
}
public static Double getDouble(NutMap o) {
return o.getDouble("score");
}
@At
@Ok("void")
@SaCheckPermission("activity.score.statistics")
public void doExcelCj(String activityId, String unionId, HttpServletResponse response) throws IOException {
Sql sql = Sqls.create("""
SELECT
un.unioncode,
un.name unionname,
us.loginname,
us.username,
us.sex,
eve.projectCode,
abs.`name` competitionCategoryName,
eve.allName,
ar.integral,
CEILING(
IF
( us.loginname IS NOT NULL, ar.integral, ar.integral / 2 )) jf,
ar.ranking
FROM
activity_results ar
LEFT JOIN activity_event eve ON ar.eventId = eve.id
LEFT JOIN activity_basic_settings abs ON abs.id = eve.competitionCategory
LEFT JOIN activity_school_apply apply ON apply.userId = ar.userId
AND ar.activityId = apply.activityId
LEFT JOIN sys_union un ON un.id = ar.unionId
LEFT JOIN sys_user us ON us.id = ar.userId
$condition
ORDER BY
un.unioncode ASC,
us.sex DESC,
FIELD( abs.`name`, '甲组', '乙组', '丙组', '丁组', '团体' ) ASC
""");
Cnd cnd = Cnd.NEW();
cnd.and("ar.activityId", "=", activityId);
cnd.andEX("ar.unionId", "=", unionId);
cnd.groupBy("ar.id");
sql.setCondition(cnd);
List<NutMap> list = baseService.listMap(sql);
List<ExcelExportEntity> entityList = new ArrayList<>();
entityList.add(new ExcelExportEntity("分工会代码", "unioncode", 40));
entityList.add(new ExcelExportEntity("分工会名称", "unionname", 20));
entityList.add(new ExcelExportEntity("工号", "loginname", 20));
entityList.add(new ExcelExportEntity("姓名", "username", 20));
entityList.add(new ExcelExportEntity("性别", "sex", 20));
entityList.add(new ExcelExportEntity("项目代码", "projectCode", 20));
entityList.add(new ExcelExportEntity("组别", "competitionCategoryName", 20));
entityList.add(new ExcelExportEntity("项目名称", "allName", 40));
entityList.add(new ExcelExportEntity("成绩", "integral", 20));
entityList.add(new ExcelExportEntity("名次", "ranking", 20));
entityList.add(new ExcelExportEntity("积分", "jf", 20));
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, list);
CommonDownloadUtil.download("成绩名单.xlsx", workbook, response);
}
}
@@ -0,0 +1,494 @@
package com.budwk.app.zhgh.activity.sports.controller;
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.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.sys.models.Sys_union;
import com.budwk.app.sys.services.SysUnionService;
import com.budwk.app.zhgh.activity.sports.models.ActivitySchool;
import com.budwk.app.zhgh.activity.sports.models.ActivitySchoolEvent;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@IocBean
@Ok("json:full")
@At("/platform/activity/statistics/export")
public class ActivitySportsStatisticsTypeExportController {
@Inject
private SysUnionService sysUnionService;
@Inject
private BaseService baseService;
@Ok("void")
@At
@ApiOperation("年度男子团体总分/年度女子团体总分")
@SaCheckPermission("activity.score.statistics")
public void getYear8(Integer isMenWomen, Integer year, HttpServletResponse response) {
ArrayList<Map> resultMap = new ArrayList<>();
List<Sys_union> unionList = sysUnionService.query();
List<ActivitySchool> activityList = baseService.dao().query(ActivitySchool.class, Cnd.where("YEAR(applyStartTime)", "=", year));
List<String> activityIdList = activityList.stream().map(ActivitySchool::getId).collect(Collectors.toList());
List<String> activityNameList = activityList.stream().map(ActivitySchool::getName).collect(Collectors.toList());
List<String> eventIdList = baseService.dao().query(ActivitySchoolEvent.class, Cnd.where("activityId", "in", activityIdList)).stream().map(v -> v.getEventId()).collect(Collectors.toList());
activityNameList.add(0, "分工会");
Sql sql = Sqls.create("""
SELECT
ae.isMenWomen,
ae.isInterest,
ar.integral,
ar.unionId,
ar.activityId
FROM
activity_event ae
LEFT JOIN activity_results ar ON ar.eventId = ae.id
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("ae.id", "in", eventIdList);
cnd.and("ar.activityId", "in", activityIdList);
sql.setCondition(cnd);
List<NutMap> list = baseService.listMap(sql);
unionList.forEach(u -> {
NutMap unionMap = Lang.obj2nutmap(u);
AtomicReference<Double> scoreSum = new AtomicReference<>((double) 0);
activityList.forEach(a -> {
double sexScore = list.stream().filter(x -> x.getString("unionId").equals(u.getId()) && x.getInt("isMenWomen") == isMenWomen && x.getString("activityId").equals(a.getId())).mapToDouble(h -> h.getDouble("integral")).sum();
double qwScore = list.stream().filter(x -> x.getString("unionId").equals(u.getId()) && x.getInt("isInterest") == 1 && x.getString("activityId").equals(a.getId())).mapToDouble(h -> h.getDouble("integral")).sum();
scoreSum.updateAndGet(v -> v + (sexScore + (qwScore * 0.5)));
unionMap.put(a.getName(), sexScore + (qwScore * 0.5));
});
unionMap.put("总分", scoreSum.get());
unionMap.put("分工会", unionMap.getString("name"));
resultMap.add(unionMap);
});
activityNameList.add("总分");
resultMap.sort(Comparator.comparing((Map m) -> (new BigDecimal(m.get("总分").toString()))).reversed());
for (int i = 0; i < resultMap.size(); i++) {
resultMap.get(i).put("名次", i + 1);
}
List<ExcelExportEntity> entityList = new ArrayList<>();
entityList.add(new ExcelExportEntity("名次", "名次", 20));
activityNameList.forEach(v -> {
entityList.add(new ExcelExportEntity(v, v, 40));
});
try {
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, resultMap);
CommonDownloadUtil.download("年度" + (isMenWomen == 1 ? "男子" : "女子") + "团体总分.xlsx", workbook, response);
} catch (Exception e) {
e.printStackTrace();
}
}
@Ok("void")
@At
@ApiOperation("年度团体总分")
@SaCheckPermission("activity.score.statistics")
public void getAnnualResults(Integer year, HttpServletResponse response) {
ArrayList<Map> resultMap = new ArrayList<>();
Dao dao = sysUnionService.dao();
List<Sys_union> unionList = sysUnionService.query();
List<ActivitySchool> activitySchoolList = dao.query(ActivitySchool.class, Cnd.where("YEAR(applyStartTime)", "=", year));
List<String> labelList = activitySchoolList.stream().map(v -> v.getName()).collect(Collectors.toList());
labelList.add(0, "分工会");
unionList.forEach(u -> {
NutMap unionMap = Lang.obj2nutmap(u);
AtomicReference<Double> scoreSum = new AtomicReference<>((double) 0);
activitySchoolList.forEach(x -> {
Sql sql = Sqls.create("""
SELECT sum(integral) as sumScore FROM `activity_results` ar
where ar.activityId = @activityId and ar.unionId = @unionId
""");
sql.setParam("activityId", x.getId());
sql.setParam("unionId", u.getId());
sql.setCallback(Sqls.callback.map());
dao.execute(sql);
NutMap scoreMap = (NutMap) sql.getResult();
double score = scoreMap.getDouble("sumScore");
scoreSum.updateAndGet(v -> v + score);
unionMap.put(x.getName(), score);
});
unionMap.put("总分", scoreSum.get());
unionMap.put("分工会", unionMap.getString("name"));
resultMap.add(unionMap);
});
labelList.add("总分");
resultMap.sort(Comparator.comparing((Map m) -> (new BigDecimal(m.get("总分").toString()))).reversed());
for (int i = 0; i < resultMap.size(); i++) {
resultMap.get(i).put("名次", i + 1);
}
List<ExcelExportEntity> entityList = new ArrayList<>();
entityList.add(new ExcelExportEntity("名次", "名次", 20));
labelList.forEach(v -> {
entityList.add(new ExcelExportEntity(v, v, 40));
});
try {
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, resultMap);
CommonDownloadUtil.download("年度团体总分.xlsx", workbook, response);
} catch (Exception e) {
e.printStackTrace();
}
}
@At
@Ok("void")
@SaCheckPermission("activity.score.statistics")
@ApiOperation("男子项目分工会积分/女子项目分工会积分")
public void isMaleFemale(String activityId, String sex, Integer awardsMode, HttpServletResponse response) {
NutMap map = new NutMap();
List<NutMap> result = new ArrayList<>();
//查询所有的工会
List<Sys_union> query = sysUnionService.query();
Cnd cndX = Cnd.NEW();
//查询所有的项目
Sql sqlX = Sqls.create("""
SELECT
ev.id,
ev.eventId,
ba.`name` baname,
eve.projectType awardsMode,
eve.allName label,
eve.isMenWomen
FROM
activity_school_event ev
LEFT JOIN activity_event eve ON ev.eventId = eve.id
LEFT JOIN activity_basic_settings ba ON eve.competitionCategory = ba.id $condition
""");
cndX.and("ev.activityId", "=", activityId);
if (awardsMode < 3) {
cndX.and("eve.projectType", "=", awardsMode);
cndX.and("eve.isInterest", "=", false);
cndX.and("eve.isMenWomen", "=", sex.equals("") ? 1 : 2);
}
if (awardsMode == 3) {
cndX.and("eve.isInterest", "=", true);
}
if (awardsMode == 4) {
cndX.and(Cnd.exps("eve.isMenWomen", "=", sex.equals("") ? 1 : 2).or("eve.isMenWomen", "is", null));
}
cndX.and(new Static("1=1 order by case ba.`name` when '甲组' then 1 when '乙组' then 2 when '丙组' then 3 when '丁组' then 4 when '团体' then 5 end"));
sqlX.setCondition(cndX);
List<Record> eventList = baseService.list(sqlX);
//查询每个工会下每个项目的成绩
for (Sys_union sys_union : query) {
NutMap nutMap = new NutMap();
//记录总积分
double totalScore = 0;
nutMap.setv("unionname", sys_union.getName());
for (Record event : eventList) {
Sql sqlC = Sqls.create("""
SELECT
IF ( sum( integral ) IS NULL, 0, sum( integral )) AS integral,
ev.allName,ev.projectType,abs.`name` AS zb,ev.isInterest
FROM
activity_results ar
LEFT JOIN activity_event ev ON ar.eventId = ev.id
LEFT JOIN activity_basic_settings abs ON abs.id=ev.competitionCategory $condition
""");
Cnd cndC = Cnd.NEW();
if ((awardsMode == 1 && event.getString("awardsMode").equals("1")) || (awardsMode == 2 && event.getString("awardsMode").equals("2"))) {
cndC.and("ev.isInterest", "=", false);
cndC.and("ev.isMenWomen", "=", sex.equals("") ? 1 : 2);
} else if (awardsMode == 3) {
cndC.and("ev.isInterest", "=", true);
} else if (awardsMode == 4) {
cndC.and(Cnd.exps("ev.isMenWomen", "=", sex.equals("") ? 1 : 2).or("ev.isMenWomen", "is", null));
}
cndC.and("ar.eventId", "=", event.getString("eventid"));
cndC.and("ar.unionid", "=", sys_union.getId());
cndC.and("ar.activityId", "=", activityId);
sqlC.setCondition(cndC);
Double score = 0.0;
List<NutMap> list = baseService.listMap(sqlC);
boolean isInterest = list.get(0).getBoolean("isInterest");
if (list.size() > 0) {
score = list.get(0).getDouble("integral");
}
if (list.get(0).getString("allName") != null) {
if (!isInterest) {
nutMap.setv(list.get(0).getString("allName"), score);
} else {
nutMap.setv(list.get(0).getString("allName"), score / 2);
}
}
totalScore += isInterest ? (score / 2) : score;
if (list.get(0).getString("zb") != null) {
nutMap.setv("projectType", list.get(0).getString("projectType"));
nutMap.setv("zb", list.get(0).getString("zb"));
}
}
nutMap.setv("totalScore", totalScore);
result.add(nutMap);
}
result.sort(Comparator.comparing((Map m) -> (new BigDecimal(m.get("totalScore").toString()))).reversed());
for (int i = 0; i < result.size(); i++) {
result.get(i).put("名次", i + 1);
}
List<ExcelExportEntity> entityList = new ArrayList<>();
entityList.add(new ExcelExportEntity("名次", "名次", 20));
entityList.add(new ExcelExportEntity("分工会", "unionname", 40));
eventList.forEach(v -> {
entityList.add(new ExcelExportEntity(v.getString("label"), v.getString("label"), 40));
});
entityList.add(new ExcelExportEntity("总分", "totalScore", 40));
try {
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, result);
CommonDownloadUtil.download("分工会" + sex + "项目积分.xlsx", workbook, response);
} catch (Exception e) {
e.printStackTrace();
}
}
@At
@Ok("void")
@SaCheckPermission("activity.score.statistics")
@ApiOperation("单子单项前八/女子单项前八/团体项目前八")
public void isTopEight(String activityId, String sex, Integer awardsMode, HttpServletResponse response) {
Cnd cndX = Cnd.NEW();
//查询所有的项目
Sql sqlX = Sqls.create("""
SELECT
ev.id,
ev.eventId,
ba.`name` baname,
eve.projectType awardsMode,
eve.allName label
FROM
activity_school_event ev
LEFT JOIN activity_event eve ON ev.eventId = eve.id
LEFT JOIN activity_basic_settings ba ON eve.competitionCategory = ba.id $condition
""");
cndX.and("ev.activityId", "=", activityId);
if (awardsMode == 1) {
cndX.and("eve.isMenWomen", "!=", sex.equals("") ? 2 : 1);
cndX.and("eve.projectType", "=", 1);
} else {
cndX.and("eve.projectType", "=", 2);
}
cndX.and(new Static("1=1 order by case ba.`name` when '甲组' then 1 when '乙组' then 2 when '丙组' then 3 when '丁组' then 4 when '团体' then 5 end"));
sqlX.setCondition(cndX);
List<Record> eventList = baseService.list(sqlX);
List<NutMap> nutMaps = new ArrayList<>();
for (int i = 0; i < 8; i++) {
NutMap nutMap = new NutMap();
Sql sqlC;
Cnd cnd = Cnd.NEW();
if (awardsMode == 1) {
sqlC = Sqls.create("""
SELECT
CONCAT( apply.username, '(', apply.activityUnionName, ')' ) username,
ar.integral,
ar.ranking,
eve.allName
FROM
activity_results ar
LEFT JOIN activity_event eve ON ar.eventId = eve.id
LEFT JOIN activity_school_apply apply ON apply.userId = ar.userId
AND ar.activityId = apply.activityId $condition
""");
cnd.and("ar.isTeamPersonal", "=", awardsMode);
cnd.and("apply.sex", "=", sex);
cnd.and("ar.activityId", "=", activityId);
cnd.and("ar.ranking", "=", i + 1);
cnd.groupBy("ar.id");
} else {
sqlC = Sqls.create("""
SELECT
CONCAT(sun.name) username,
eve.allName,ar.ranking
FROM
activity_results ar
LEFT JOIN activity_event eve ON ar.eventId = eve.id
LEFT JOIN sys_union sun ON sun.id = ar.unionId $condition
""");
cnd.and("ar.isTeamPersonal", "=", awardsMode);
cnd.and("ar.activityId", "=", activityId);
cnd.and("ar.ranking", "=", i + 1);
}
sqlC.setCondition(cnd);
List<Record> list = baseService.list(sqlC);
list.forEach(l -> {
nutMap.setv(l.getString("allName"), l.getString("username"));
});
nutMaps.add(nutMap);
}
for (int i = 0; i < nutMaps.size(); i++) {
nutMaps.get(i).put("名次", i + 1);
}
List<ExcelExportEntity> entityList = new ArrayList<>();
entityList.add(new ExcelExportEntity("名次", "名次", 20));
eventList.forEach(v -> {
entityList.add(new ExcelExportEntity(v.getString("label"), v.getString("label"), 40));
});
String sex2 = awardsMode == 2 ? "团体" : sex.equals("") ? "男子" : "女子";
try {
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, nutMaps);
CommonDownloadUtil.download(sex2 + "项目前八.xlsx", workbook, response);
} catch (Exception e) {
e.printStackTrace();
}
}
@At
@Ok("void")
@SaCheckPermission("activity.score.statistics")
@ApiOperation("男子总分前八/女子总分前八")
public void isScoreTopEight(String activityId, String sex, HttpServletResponse response) {
List<NutMap> result = new ArrayList<>();
Cnd cndX = Cnd.NEW();
//查询所有的项目
Sql sqlX = Sqls.create("""
SELECT
ev.id,
ev.eventId,
ba.`name` baname,
eve.projectType awardsMode,
eve.allName label
FROM
activity_school_event ev
LEFT JOIN activity_event eve ON ev.eventId = eve.id
LEFT JOIN activity_basic_settings ba ON eve.competitionCategory = ba.id $condition
""");
cndX.and("ev.activityId", "=", activityId);
cndX.and(Cnd.exps("eve.isMenWomen", "=", sex.equals("") ? 1 : 2).or("eve.isMenWomen", "is", null));
cndX.and(new Static("1=1 order by case ba.`name` when '甲组' then 1 when '乙组' then 2 when '丙组' then 3 when '丁组' then 4 when '团体' then 5 end"));
sqlX.setCondition(cndX);
List<Record> eventList = baseService.list(sqlX);
//查询所有的工会
List<Sys_union> query = sysUnionService.query();
for (Sys_union sys_union : query) {
NutMap nutMap = new NutMap();
//记录总积分
double totalScore = 0;
nutMap.setv("unionname", sys_union.getName());
for (Record event : eventList) {
Sql sqlC = Sqls.create("""
SELECT
IF ( sum( integral ) IS NULL, 0, sum( integral )) AS integral,
ev.allName,ev.isInterest
FROM
activity_results ar
LEFT JOIN activity_event ev ON ar.eventId = ev.id $condition
""");
Cnd cndC = Cnd.NEW();
cndC.and(Cnd.exps("ev.isMenWomen", "=", sex.equals("") ? 1 : 2).or("ev.isMenWomen", "is", null));
cndC.and("ar.unionid", "=", sys_union.getId());
cndC.and("ar.eventId", "=", event.getString("eventid"));
cndC.and("ar.activityId", "=", activityId);
sqlC.setCondition(cndC);
Double score = 0.0;
List<NutMap> list = baseService.listMap(sqlC);
boolean isInterest = list.get(0).getBoolean("isInterest");
if (list.size() > 0) {
score = list.get(0).getDouble("integral");
}
totalScore += isInterest ? (score / 2) : score;
}
nutMap.setv("totalScore", totalScore);
result.add(nutMap);
}
List<ExcelExportEntity> entityList = new ArrayList<>();
entityList.add(new ExcelExportEntity("名次", "名次", 20));
entityList.add(new ExcelExportEntity("分工会", "unionname", 40));
entityList.add(new ExcelExportEntity("总分", "totalScore", 40));
result.sort(Comparator.comparing((Map m) -> (new BigDecimal(m.get("totalScore").toString()))).reversed());
for (int i = 0; i < result.size(); i++) {
result.get(i).put("名次", i + 1);
}
try {
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entityList, result);
CommonDownloadUtil.download("分工会" + sex + "子总分.xlsx", workbook, response);
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -96,6 +96,12 @@ public class CareDataLeaderCon {
return Result.success(careDataLeaderService.dataMetricData(year)); return Result.success(careDataLeaderService.dataMetricData(year));
} }
@At
@SaCheckPermission("careData.union")
public Result memberOverviewData() {
return Result.success(careDataLeaderService.memberOverviewData());
}
@At @At
@SaCheckPermission("careData.union") @SaCheckPermission("careData.union")
public Result assetDataData() { public Result assetDataData() {
@@ -45,6 +45,13 @@ public interface CareDataLeaderService {
*/ */
NutMap dataMetricData(Integer year); NutMap dataMetricData(Integer year);
/**
* 查询会员总数和男女会员数。
*
* @return 会员概览数据,包含 total、male、female、unknown。
*/
NutMap memberOverviewData();
/** /**
* 查询资产使用状态分布。 * 查询资产使用状态分布。
* *
@@ -91,13 +91,38 @@ public class CareDataLeaderServiceImpl implements CareDataLeaderService {
int targetYear = year == null ? LocalDate.now().getYear() : year; int targetYear = year == null ? LocalDate.now().getYear() : year;
return NutMap.NEW() return NutMap.NEW()
.addv("year", targetYear) .addv("year", targetYear)
.addv("budgetTotal", schoolBudgetTotal(targetYear)) .addv("budgetTotal", budgetTotal(targetYear))
.addv("tourCount", tourCount(targetYear)) .addv("tourCount", tourCount(targetYear))
.addv("honorCount", honorCount(targetYear)) .addv("honorCount", honorCount(targetYear))
.addv("difficultCount", difficultCount(targetYear)) .addv("difficultCount", difficultCount(targetYear))
.addv("reimburseTotal", reimburseTotal(targetYear)); .addv("reimburseTotal", reimburseTotal(targetYear));
} }
@Override
public NutMap memberOverviewData() {
Sql sql = Sqls.create("""
SELECT
COUNT(1) AS total,
IFNULL(SUM(CASE WHEN sex = '男' THEN 1 ELSE 0 END), 0) AS male,
IFNULL(SUM(CASE WHEN sex = '女' THEN 1 ELSE 0 END), 0) AS female
FROM vw_user
WHERE member = 1
$unionFilter
""");
setUnionFilter(sql, "unionId", null);
NutMap memberOverview = firstMap(sql);
long total = memberOverview.getLong("total", 0L);
long male = memberOverview.getLong("male", 0L);
long female = memberOverview.getLong("female", 0L);
// 部分会员性别为空或不是“男/女”,总数需要保留这部分人员。
long unknown = Math.max(0L, total - male - female);
return NutMap.NEW()
.addv("total", total)
.addv("male", male)
.addv("female", female)
.addv("unknown", unknown);
}
@Override @Override
public NutMap assetDataData() { public NutMap assetDataData() {
List<NutMap> states = assetUsageStateRows(); List<NutMap> states = assetUsageStateRows();
@@ -220,14 +245,41 @@ public class CareDataLeaderServiceImpl implements CareDataLeaderService {
return listMap(sql); return listMap(sql);
} }
private BigDecimal schoolBudgetTotal(int year) { private BigDecimal budgetTotal(int year) {
Sql sql = Sqls.create(""" Sql sql;
if (canViewAllUnionData()) {
sql = Sqls.create("""
SELECT IFNULL(SUM(totalQuota), 0) AS total SELECT IFNULL(SUM(totalQuota), 0) AS total
FROM (
SELECT totalQuota
FROM outlay_manage_school FROM outlay_manage_school
WHERE delFlag = 0 WHERE delFlag = 0
AND `year` = @year AND `year` = @year
UNION ALL
SELECT totalQuota
FROM outlay_manage_union
WHERE delFlag = 0
AND `year` = @year
UNION ALL
SELECT totalQuota
FROM outlay_manage_club
WHERE delFlag = 0
AND `year` = @year
) budget
"""); """);
sql.setParam("year", year); sql.setParam("year", year);
} else {
// 普通分工会用户只能看到本分工会预算,校级和社团预算不挂具体分工会。
sql = Sqls.create("""
SELECT IFNULL(SUM(totalQuota), 0) AS total
FROM outlay_manage_union
WHERE delFlag = 0
AND `year` = @year
AND unionId = @unionId
""");
sql.setParam("year", year);
sql.setParam("unionId", SecurityUtil.getUnionId());
}
return decimalValue(firstMap(sql), "total"); return decimalValue(firstMap(sql), "total");
} }
@@ -145,11 +145,13 @@ public class CondolenceApplyController {
} }
if(!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) { if(!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
if(AuthUtil.hasRoleOr( if(AuthUtil.hasRoleOr(
RoleConstant.BRANCH_UNION_ADMIN.name(), RoleConstant.BRANCH_UNION_ZUZHI_WY.name(),
RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_CHAIRMAN.name(),
RoleConstant.BRANCH_UNION_WY.name(), RoleConstant.BRANCH_UNION_WY.name(),
RoleConstant.BRANCH_UNION_XUANCHUAN_WY.name(), RoleConstant.BRANCH_UNION_XUANCHUAN_WY.name(),
RoleConstant.BRANCH_UNION_WENTI_WY.name(), RoleConstant.BRANCH_UNION_WENTI_WY.name(),
RoleConstant.BRANCH_UNION_WENTI_SPORTS.name(),
RoleConstant.BRANCH_UNION_NVGONG_WY.name(),
RoleConstant.BRANCH_UNION_XJSHAN_PROMOTION.name() RoleConstant.BRANCH_UNION_XJSHAN_PROMOTION.name()
)) { )) {
cnd.and(View_user::getUnionId, "=", SecurityUtil.getUnionId()); cnd.and(View_user::getUnionId, "=", SecurityUtil.getUnionId());
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.staffmanage.member.controller.apply; package com.budwk.app.zhgh.staffmanage.member.controller.apply;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.page.Pagination; import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
@@ -64,7 +65,7 @@ public class MemberApplyBranchUnionApprovalController {
@At @At
@ApiOperation("会员入会申请分工会审核列表") @ApiOperation("会员入会申请分工会审核列表")
@SaCheckPermission("member.apply.branchUnionApproval") @SaCheckPermission(value = {"member.apply.branchUnionApproval", "h5.member.apply.branchUnionApproval"}, mode = SaMode.OR)
public Result pageData(MemberApplyPageForm pageForm) { public Result pageData(MemberApplyPageForm pageForm) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
@@ -78,6 +79,7 @@ public class MemberApplyBranchUnionApprovalController {
info.personType, info.personType,
info.applyDateTime, info.applyDateTime,
info.sign, info.sign,
info.nativePlace,
ins.id AS instanceId, ins.id AS instanceId,
ins.businessNo, ins.businessNo,
ins.state instanceState, ins.state instanceState,
@@ -125,7 +127,7 @@ public class MemberApplyBranchUnionApprovalController {
} else { } else {
cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
} }
cnd.groupBy("t.id"); cnd.groupBy("info.id");
sql.setCondition(cnd); sql.setCondition(cnd);
Pagination<NutMap> pagination = memberApplyRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); Pagination<NutMap> pagination = memberApplyRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination); return Result.success(pagination);
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.staffmanage.member.controller.apply; package com.budwk.app.zhgh.staffmanage.member.controller.apply;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.lang.Dict; import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog; 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.enums.ProcessSubmitTypeEnum;
import com.budwk.app.flow.service.FlowCommonService; import com.budwk.app.flow.service.FlowCommonService;
import com.budwk.app.sys.models.Sys_union_group; 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.web.commons.auth.utils.AuthUtil;
import com.budwk.app.sys.views.View_user; import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.SecurityUtil; import com.budwk.app.web.commons.auth.utils.SecurityUtil;
@@ -70,7 +72,8 @@ public class MemberApplyController {
@At @At
@ApiOperation("保存申请") @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}") @SLog(tag = "会员入会申请", msg = "保存申请,申请人: ${args[0].username}")
public Result save(@Param("data") MemberApplyRecord memberApplyRecord) { public Result save(@Param("data") MemberApplyRecord memberApplyRecord) {
if (StrUtil.isBlank(memberApplyRecord.getId())) { if (StrUtil.isBlank(memberApplyRecord.getId())) {
@@ -84,7 +87,7 @@ public class MemberApplyController {
@At @At
@ApiOperation("提交申请") @ApiOperation("提交申请")
@Aop(TransAop.READ_COMMITTED) @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}") @SLog(tag = "会员入会申请", msg = "提交申请,申请人: ${args[0].username}")
public Result submit(@Param("data") MemberApplyRecord memberApplyRecord){ public Result submit(@Param("data") MemberApplyRecord memberApplyRecord){
if (StrUtil.isBlank(memberApplyRecord.getId())) { if (StrUtil.isBlank(memberApplyRecord.getId())) {
@@ -123,7 +126,7 @@ public class MemberApplyController {
@At @At
@ApiOperation("重新提交申请") @ApiOperation("重新提交申请")
@Aop(TransAop.READ_COMMITTED) @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}") @SLog(tag = "会员入会申请", msg = "重新提交申请,申请人: ${args[0].username}")
public Result submitAgain(@Param("data") MemberApplyRecord memberApplyRecord, @Param("taskId") Long taskId) { public Result submitAgain(@Param("data") MemberApplyRecord memberApplyRecord, @Param("taskId") Long taskId) {
if (StrUtil.isBlank(memberApplyRecord.getId())) { if (StrUtil.isBlank(memberApplyRecord.getId())) {
@@ -159,14 +162,58 @@ public class MemberApplyController {
*/ */
@At @At
@ApiOperation("根据id查询申请记录") @ApiOperation("根据id查询申请记录")
@SaCheckPermission("member.apply.submit") @SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
public Result findApplyById(String id) { public Result findApplyById(String id) {
return Result.success(dao.fetch(MemberApplyRecord.class,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 @At
@SaCheckPermission("member.apply.submit") @SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
public Result getApplyUserByUnionOperate(@Valid String keyWord){ public Result getApplyUserByUnionOperate(@Valid String keyWord){
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
@@ -195,7 +242,7 @@ public class MemberApplyController {
*/ */
@At @At
@ApiOperation("获取当前登录用户信息") @ApiOperation("获取当前登录用户信息")
@SaCheckPermission("member.apply.submit") @SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
public Result getSelfUserInfo() { public Result getSelfUserInfo() {
return Result.success(dao.fetch(View_user.class, Cnd.where("id", "=", SecurityUtil.getUserId()))); 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.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
/** /**
@@ -62,7 +63,7 @@ public class MemberApplyMineController {
@At @At
@ApiOperation("会员入会申请,我的申请列表") @ApiOperation("会员入会申请,我的申请列表")
@SaCheckPermission("member.apply.mine") @SaCheckPermission(value = {"member.apply.mine", "h5.member.apply.mine"}, mode = SaMode.OR)
public Result pageData(MemberApplyPageForm pageForm) { public Result pageData(MemberApplyPageForm pageForm) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
@@ -76,6 +77,8 @@ public class MemberApplyMineController {
info.personType, info.personType,
info.applyDateTime, info.applyDateTime,
info.sign, info.sign,
info.nativePlace,
info.jobCategory,
ins.id AS instanceId, ins.id AS instanceId,
ins.businessNo, ins.businessNo,
ins.state instanceState, ins.state instanceState,
@@ -90,6 +93,7 @@ public class MemberApplyMineController {
t.finishTime, t.finishTime,
t.taskParentId, t.taskParentId,
t.variable taskVariable, 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, 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 (select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask' AND taskState in (10,20)) AS startTaskId
FROM FROM
@@ -113,7 +117,7 @@ public class MemberApplyMineController {
} else { } else {
cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
} }
cnd.groupBy("t.id"); cnd.groupBy("info.id");
sql.setCondition(cnd); sql.setCondition(cnd);
Pagination<NutMap> pagination = memberCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); Pagination<NutMap> pagination = memberCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success().addData(pagination); return Result.success().addData(pagination);
@@ -123,7 +127,7 @@ public class MemberApplyMineController {
@At @At
@ApiOperation("删除入会申请") @ApiOperation("删除入会申请")
@Aop(TransAop.READ_COMMITTED) @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]}") @SLog(tag = "会员入会申请", msg = "删除入会申请id: ${args[0]}")
public Result onDelete(@Valid String id) { public Result onDelete(@Valid String id) {
dao.clear(MemberApplyRecord.class, Cnd.where("id", "=", id)); dao.clear(MemberApplyRecord.class, Cnd.where("id", "=", id));
@@ -140,9 +144,22 @@ public class MemberApplyMineController {
*/ */
@At @At
@ApiOperation("获取申请信息") @ApiOperation("获取申请信息")
@SaCheckPermission(value = {"member.apply.mine", "member.apply.branchUnionApproval", "member.apply.branchUnionApproval"}, 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) { public Result findMemberApplyRecord(@Valid String id) {
MemberApplyRecord record = dao.fetch(MemberApplyRecord.class, id); MemberApplyRecord record = dao.fetch(MemberApplyRecord.class, id);
return Result.success().addData(record); 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);
}
} }
@@ -0,0 +1,115 @@
package com.budwk.app.zhgh.staffmanage.member.controller.apply;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.PageUtil;
import com.budwk.app.flow.enums.ProcessInstanceStateEnum;
import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberApplyPageForm;
import com.budwk.app.zhgh.staffmanage.member.service.MemberCommonService;
import io.swagger.annotations.ApiOperation;
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.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.servlet.http.HttpServletResponse;
/**
* 会员入会申请查询统计。
*/
@IocBean
@Ok("json:full")
@At("/platform/member/apply/query")
public class MemberApplyQueryController {
@Inject
private MemberCommonService memberCommonService;
@At("")
@Ok("beetl:/platform/zhgh/staffmanage/member/apply/query/index.html")
@SaCheckPermission("member.apply.query")
public void index() {
}
/**
* 查询已办结的会员入会申请记录。
*
* @param pageForm 查询参数:姓名/工号、工会、单位、在职状态、教职工类别、编制类别以及分页排序信息
* @return Result 包装的分页数据,list 字段为入会申请记录,totalCount 为总数
*/
@At
@ApiOperation("会员入会申请查询统计列表")
@SaCheckPermission("member.apply.query")
public Result pageData(MemberApplyPageForm pageForm) {
Sql sql = Sqls.create("""
SELECT
info.id,
info.userName,
info.loginName,
info.unitName,
info.unionName,
info.userState,
info.preparedBy,
info.personType,
info.applyDateTime,
info.sign,
info.nativePlace,
info.jobCategory,
ins.id AS instanceId,
ins.businessNo,
ins.state instanceState,
ins.variable instanceVariable,
ins.processDefineId instanceProcessDefineId,
t.id taskId,
t.taskName AS taskKey,
t.displayName taskName,
t.taskType,
t.performType taskPerformType,
t.taskState,
t.finishTime,
t.taskParentId,
t.variable taskVariable,
GROUP_CONCAT(DISTINCT ta.actorName, '(', ta.actorAccount, ')' ) AS auditUser,
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask' AND taskState in (10,20)) AS startTaskId
FROM
member_apply_record info
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
LEFT JOIN wf_process_task t ON t.processInstanceId = ins.id AND t.taskState = 10
LEFT JOIN wf_process_task_actor ta ON ta.processTaskId = t.id
$condition
""");
Cnd cnd = Cnd.NEW();
MemberApplyPageForm.buildSearch(cnd, pageForm);
// 查询统计只展示流程已完成的入会申请,避免未完结流程进入统计口径。
cnd.and("ins.state", "=", ProcessInstanceStateEnum.FINISHED.getCode());
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.desc("info.applyDateTime");
} else {
cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
}
cnd.groupBy("info.id");
sql.setCondition(cnd);
Pagination<NutMap> pagination = memberCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success().addData(pagination);
}
/**
* 导出入会申请表。
*
* @param id 入会申请记录id
* @param response docx 文件下载响应
*/
@At
@Ok("void")
@ApiOperation("导出入会申请表")
@SaCheckPermission("member.apply.query")
public void exportApplyDocx(String id, HttpServletResponse response) {
memberCommonService.exportApplyDocx(id, response);
}
}
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.staffmanage.member.controller.apply; package com.budwk.app.zhgh.staffmanage.member.controller.apply;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog; import com.budwk.app.base.annotation.SLog;
@@ -78,7 +79,7 @@ public class MemberApplySchoolUnionApprovalController {
@At @At
@ApiOperation("会员入会校工会审核列表") @ApiOperation("会员入会校工会审核列表")
@SaCheckPermission("member.apply.schoolUnionApproval") @SaCheckPermission(value = {"member.apply.schoolUnionApproval", "h5.member.apply.schoolunionapproval"}, mode = SaMode.OR)
public Result pageData(MemberApplyPageForm pageForm) { public Result pageData(MemberApplyPageForm pageForm) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
@@ -93,6 +94,7 @@ public class MemberApplySchoolUnionApprovalController {
info.origin, info.origin,
info.applyDateTime, info.applyDateTime,
info.sign, info.sign,
info.nativePlace,
ins.id AS instanceId, ins.id AS instanceId,
ins.businessNo, ins.businessNo,
ins.state instanceState, ins.state instanceState,
@@ -138,7 +140,7 @@ public class MemberApplySchoolUnionApprovalController {
} else { } else {
cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy())); cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
} }
cnd.groupBy("t.id"); cnd.groupBy("info.id");
sql.setCondition(cnd); sql.setCondition(cnd);
Pagination<NutMap> pagination = memberApplyRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); Pagination<NutMap> pagination = memberApplyRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
return Result.success(pagination); return Result.success(pagination);
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.staffmanage.member.controller.apply; package com.budwk.app.zhgh.staffmanage.member.controller.apply;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.page.Pagination; import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result; import com.budwk.app.base.result.Result;
@@ -53,7 +54,7 @@ public class MemberApplyUnionGroupApprovalController {
@At @At
@ApiOperation("会员入会申请工会小组审核列表") @ApiOperation("会员入会申请工会小组审核列表")
@SaCheckPermission("member.apply.unionGroupApproval") @SaCheckPermission(value = {"member.apply.unionGroupApproval", "h5.member.apply.uniongroupapproval"}, mode = SaMode.OR)
public Result pageData(MemberApplyPageForm pageForm) { public Result pageData(MemberApplyPageForm pageForm) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
@@ -182,6 +182,16 @@ public class MemberApplyRecord extends BaseModel {
@ColDefine(type = ColType.VARCHAR, customType = "text") @ColDefine(type = ColType.VARCHAR, customType = "text")
private String personalData; 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 @Column
@Comment("备注") @Comment("备注")
@ColDefine(type = ColType.VARCHAR, width = 255) @ColDefine(type = ColType.VARCHAR, width = 255)
@@ -223,8 +233,33 @@ public class MemberApplyRecord extends BaseModel {
@ColDefine(type = ColType.VARCHAR, width = 100) @ColDefine(type = ColType.VARCHAR, width = 100)
private String sign; private String sign;
@Column
@Comment("照片")
@ColDefine(type = ColType.VARCHAR, width = 500)
private String photo;
@Column @Column
@Comment("来源,高校编码") @Comment("来源,高校编码")
@ColDefine(type = ColType.VARCHAR, width = 50) @ColDefine(type = ColType.VARCHAR, width = 50)
private String origin; 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;
} }
@@ -10,6 +10,7 @@ import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberManagePageForm
import org.nutz.dao.sql.Sql; import org.nutz.dao.sql.Sql;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -115,4 +116,12 @@ public interface MemberCommonService extends BaseService<Sys_user> {
* @param type 类型: apply or change * @param type 类型: apply or change
*/ */
void validateApplyOrChangeIsDoing(String userId, String type); 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.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HtmlUtil; 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.exception.BaseException;
import com.budwk.app.base.page.Pagination; import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.service.impl.BaseServiceImpl; 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.engine.FlowEngine;
import com.budwk.app.flow.entity.ProcessInstance; 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.enums.ProcessTaskStateEnum;
import com.budwk.app.flow.vo.ProcessTaskVO;
import com.budwk.app.sys.models.*; import com.budwk.app.sys.models.*;
import com.budwk.app.sys.services.SysDictService; import com.budwk.app.sys.services.SysDictService;
import com.budwk.app.sys.services.SysRoleService; 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.member.service.MemberCommonService;
import com.budwk.app.zhgh.staffmanage.specialstaff.model.SpecialStaff; import com.budwk.app.zhgh.staffmanage.specialstaff.model.SpecialStaff;
import com.budwk.app.zhgh.welfare.model.WelfareList; 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 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.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; 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.Lang;
import org.nutz.lang.random.R; import org.nutz.lang.random.R;
import org.nutz.lang.util.NutMap; 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.*;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -61,12 +82,23 @@ import java.util.stream.Collectors;
@Slf4j @Slf4j
public class MemberManageServiceImpl extends BaseServiceImpl<Sys_user> implements MemberCommonService { 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 @Inject
private SysDictService sysDictService; private SysDictService sysDictService;
@Inject @Inject
private SysRoleService sysRoleService; private SysRoleService sysRoleService;
@Inject @Inject
private SysUserService sysUserService; private SysUserService sysUserService;
@Inject
private FlowEngine flowEngine;
@Inject
private SysOfficeTemplateUtil sysOfficeTemplateUtil;
public MemberManageServiceImpl(Dao dao) { public MemberManageServiceImpl(Dao dao) {
super(dao); super(dao);
@@ -566,4 +598,208 @@ public class MemberManageServiceImpl extends BaseServiceImpl<Sys_user> implement
} }
return value.toString(); 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 -1
View File
@@ -81,7 +81,7 @@ redis:
#nodes=192.168.6.31:6377,192.168.6.31:6378,192.168.6.28:6377,192.168.6.28:6378,192.168.6.34:6377,192.168.6.34:6378 #nodes=192.168.6.31:6377,192.168.6.31:6378,192.168.6.28:6377,192.168.6.28:6378,192.168.6.34:6377,192.168.6.34:6378
jdbc: jdbc:
url: jdbc:mysql://192.168.21.212:3306/zhgh_jshvc?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true url: jdbc:mysql://127.0.0.1:3306/zhgh_jshvc?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
username: root username: root
password: 123456 password: 123456
validationQuery: select 1 validationQuery: select 1
Binary file not shown.

Before

Width:  |  Height:  |  Size: 994 KiB

After

Width:  |  Height:  |  Size: 816 KiB

@@ -0,0 +1,144 @@
<template>
<el-table :data="tableData" style="width: 100%;height: 100%" stripe border
ref="MaleFemaleTab"
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading" size="mini" fixed>
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px" fixed></el-table-column>
<el-table-column label="分工会" prop="unionname" header-align="center"
align="center" fixed show-overflow-tooltip width="250px"></el-table-column>
<el-table-column label="甲组" header-align="center" v-if="tableColumns.length>0">
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
show-overflow-tooltip>
</el-table-column>
</el-table-column>
<el-table-column label="乙组" header-align="center" v-if="tableColumns2.length>0">
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns2"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
show-overflow-tooltip>
</el-table-column>
</el-table-column>
<el-table-column label="丙组" header-align="center" v-if="tableColumns3.length>0">
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns3"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
show-overflow-tooltip>
</el-table-column>
</el-table-column>
<el-table-column label="丁组" header-align="center" v-if="tableColumns4.length>0">
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns4"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
show-overflow-tooltip>
</el-table-column>
</el-table-column>
<el-table-column label="团体" header-align="center" v-if="tableColumns5.length>0">
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns5"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
show-overflow-tooltip>
</el-table-column>
</el-table-column>
<el-table-column label="总分" prop="totalScore" header-align="center"
align="center" show-overflow-tooltip fixed="right"></el-table-column>
<el-table-column align="center" header-align="center" type="index" show-overflow-tooltip label="名次"
width="80px" fixed="right"></el-table-column>
</el-table>
</template>
<script>
module.exports = {
props: {
Form: {
type: Object,
default: {},
}
},
mixins: [initTableMixins],
data() {
return {
tableData: [],
maxHeight: 0,
tableColumns2: [],
tableColumns3: [],
tableColumns4: [],
tableColumns5: []
}
},
mounted() {
/* const tabHeight = document.getElementById("app").clientHeight - (this.$refs.MaleFemaleTab.$el.offsetTop + 60)
this.$nextTick(()=>{
this.maxHeight = tabHeight
})*/
},
methods: {
isMaleFemale() {
this.tableLoading = true
this.tableColumns = []
this.tableColumns2 = []
this.tableColumns3 = []
this.tableColumns4 = []
this.tableColumns5 = []
this.tableData = []
this.$axios.post("/platform/activity/score/statistics/isMaleFemale", this.Form).then((resp) => {
const data = resp.data
data.eventList.forEach(v => {
if (v.baname == "甲组" || v.baname == "乙组" || v.baname == "丙组" || v.baname == "丁组") {
this.tableColumns.push({label: v.isMenWomen ? v.label.substr(4) : v.label.substr(2), prop: v.label})
} else {
this.tableColumns5.push({label: v.label, prop: v.label})
}
})
this.tableData = data.score.sort(this.compare("totalScore"))
if (this.Form.unionname) {
this.tableData = this.tableData.filter(v => v.unionname == this.Form.unionname)
}
}).finally(() => {
this.tableLoading = false
})
},
compare(prop) {
return (obj1, obj2) => {
const val1 = obj1[prop];
const val2 = obj2[prop];
if (val1 > val2) {
return -1;
} else if (val1 < val2) {
return 1;
} else {
return 0;
}
}
}
},
}
</script>
@@ -0,0 +1,75 @@
<template>
<el-table :data="tableData" style="width: 100%;height: 100%" stripe border
ref="MaleFemaleTab"
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading" size="mini" fixed>
<!--:max-height="maxHeight"-->
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px" fixed></el-table-column>
<el-table-column label="分工会" prop="unionname" header-align="center"
align="center" fixed show-overflow-tooltip></el-table-column>
<el-table-column label="总分" prop="totalScore" header-align="center"
align="center" show-overflow-tooltip></el-table-column>
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="名次"
width="80px"></el-table-column>
</el-table>
</template>
<script>
module.exports = {
props: {
Form: {
type: Object,
default: {},
}
},
mixins: [initTableMixins],
data() {
return {
tableData: [],
maxHeight: 0
}
},
mounted() {
/*const tabHeight = document.getElementById("app").clientHeight - (this.$refs.MaleFemaleTab.$el.offsetTop + 60)
this.$nextTick(() => {
this.maxHeight = tabHeight
})*/
},
methods: {
isScoreTopEight() {
this.tableLoading = true
this.tableColumns = []
this.tableData = []
this.$axios.post(loc() + "/isScoreTopEight", this.Form).then((resp) => {
const data = resp.data
const table = data.score.sort(this.compare("totalScore"))
this.tableData = table.slice(0, 8)
}).finally(() => {
this.tableLoading = false
})
},
compare(prop) {
return (obj1, obj2) => {
const val1 = obj1[prop];
const val2 = obj2[prop];
if (val1 > val2) {
return -1;
} else if (val1 < val2) {
return 1;
} else {
return 0;
}
}
}
},
}
</script>
@@ -0,0 +1,91 @@
<template>
<div v-loading="tableLoading">
<!-- <el-table :data="tableData" style="width: 100%" stripe border
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading" size="mini">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="名次"
width="100px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
show-overflow-tooltip>
</el-table-column>
</el-table>-->
<table class="table table-bordered" style="table-layout: fixed;">
<thead>
<tr>
<th style="text-align: center!important;">项目</th>
<th style="text-align: center!important;" v-for="i in 8">{{ i }}</th>
</tr>
</thead>
<tbody>
<tr v-for="i in tableData">
<td align="center" width="20%">{{ i.label }}</td>
<td v-for="x in 8" align="center" width="10%">
{{ getTableTdContent(i.sss, x) }}
</td>
</tr>
</tbody>
</table>
</div>
</template>
<script>
module.exports = {
props: {
Form: {
type: Object,
default: {},
}
},
mixins: [initTableMixins],
data() {
return {
tableData: []
}
},
methods: {
getTableTdContent(d, i) {
return d.filter(v => {
if (v.ranking == i) {
return v.username
}
}).map(v => {
return v.username
}).toString()
},
isTopEight() {
this.tableLoading = true
this.tableColumns = []
this.tableData = []
this.$axios.post(loc() + "/isTopEight", this.Form).then((resp) => {
const data = resp.data
data.eventList.map(v => {
v.sss = []
data.userList.map(x => {
if (v.label === x.allname) {
console.log(x)
v.sss.push(x)
}
})
})
this.tableData = data.eventList
}).finally(() => {
this.tableLoading = false
})
},
},
}
</script>
@@ -104,29 +104,16 @@ module.exports = {
if (val) { if (val) {
if (Array.isArray(val)) { if (Array.isArray(val)) {
this.fileList = val.map((v) => { this.fileList = val.map((v) => {
return { return this.normalizeFile(v)
...v,
status: null,
isImage: ["jpg", "jpeg", "png", "gif", "bmp", "webp"].includes(v.name.split(".").pop().toLowerCase())
}
}) })
} else if(typeof val === "string") { } else if(typeof val === "string") {
this.fileList = [ this.fileList = [
{ this.normalizeFile(val)
url: val,
status: null,
isImage: true
}
] ]
} else { } else {
val = JSON.parse(val) val = JSON.parse(val)
this.fileList = val.map((v) => { this.fileList = val.map((v) => {
return { return this.normalizeFile(v)
...v,
url: v.url ? v.url : v.response?.data,
isImage: ["jpg", "jpeg", "png", "gif", "bmp", "webp"].includes(v.name.split(".").pop().toLowerCase()),
status: null
}
}) })
} }
} else { } else {
@@ -142,14 +129,50 @@ module.exports = {
} }
}, },
methods: { methods: {
// 统一历史数据和上传返回数据的文件名、地址字段,避免 Vant 回显时把下载路径当文件名显示。
normalizeFile(file) {
const data = typeof file === "string" ? {url: file} : Object.assign({}, file)
const responseData = data.response && data.response.data ? data.response.data : ""
const url = data.url || responseData || data.downloadPath || data.path || ""
const name = data.name || data.fileName || data.originalName || data.originalFilename || this.getFileNameFromUrl(url) || "附件"
data.url = url
data.name = name
data.file = {name: name}
data.status = null
data.isImage = this.isImageFile(name)
delete data.content
return data
},
// 同步父组件前移除原始 File 对象,避免表单 JSON 保存时带入不可序列化内容。
getCleanFileList() {
return this.fileList.map((file) => {
const data = Object.assign({}, file)
delete data.file
delete data.content
return data
})
},
getFileNameFromUrl(url) {
if (!url || typeof url !== "string") {
return ""
}
const cleanUrl = url.split("?")[0].split("#")[0]
const splitUrl = cleanUrl.split("/")
const fileName = splitUrl[splitUrl.length - 1]
return fileName && fileName.indexOf(".") > -1 ? decodeURIComponent(fileName) : ""
},
isImageFile(name) {
if (!name || typeof name !== "string" || name.indexOf(".") === -1) {
return false
}
const suffix = name.split(".").pop().toLowerCase()
return ["jpg", "jpeg", "png", "gif", "bmp", "webp"].includes(suffix)
},
beforeDelete(file) { beforeDelete(file) {
this.fileList = this.fileList.filter((f) => f.url !== file.url) this.fileList = this.fileList.filter((f) => f.url !== file.url)
this.$emit("update:value", this.fileList) this.$emit("update:value", this.getCleanFileList())
}, },
beforeRead(file) { beforeRead(file) {
debugger
console.log(file)
console.log(this.upload_size)
if (file.size > this.upload_size) { if (file.size > this.upload_size) {
this.$toast("文件过大,请上传小于" + (this.upload_size / 1024 / 1024).toFixed(2) + "M的文件!") this.$toast("文件过大,请上传小于" + (this.upload_size / 1024 / 1024).toFixed(2) + "M的文件!")
return false return false
@@ -178,7 +201,7 @@ module.exports = {
if (valid) { if (valid) {
return true return true
} }
this.$toast(`文件只能是 ${this.accept} 格式!`) this.$toast("文件只能是 " + this.accept + " 格式!")
return false return false
}, },
afterRead(files) { afterRead(files) {
@@ -200,8 +223,8 @@ module.exports = {
f.url = resp.data f.url = resp.data
f.response = resp f.response = resp
f.percentage = 100 f.percentage = 100
f.isImage = true f.isImage = this.isImageFile(f.name)
delete f.file f.file = {name: f.name}
delete f.content delete f.content
} else { } else {
f.status = "fail" f.status = "fail"
@@ -213,7 +236,7 @@ module.exports = {
if (this.upload_result_category === "interval") { if (this.upload_result_category === "interval") {
} else if (this.upload_result_category === "array") { } else if (this.upload_result_category === "array") {
if (this.complete_result) { if (this.complete_result) {
this.$emit("update:value", this.fileList) this.$emit("update:value", this.getCleanFileList())
} else { } else {
const resultArrayValue = [] const resultArrayValue = []
this.fileList.forEach((data) => { this.fileList.forEach((data) => {
@@ -1,16 +1,16 @@
<!doctype html> <!doctype html>
<html lang="${lang,escape}"> <html lang="${lang,escape}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1" /> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1"/>
<meta name="description" content="${AppName!}" /> <meta name="description" content="${AppName!}"/>
<title>${AppName!}</title> <title>${AppName!}</title>
<meta charset="UTF-8" /> <meta charset="UTF-8"/>
<!-- import CSS --> <!-- import CSS -->
<link rel="stylesheet" href="${base!}/assets/platform/css/root.css" /> <link rel="stylesheet" href="${base!}/assets/platform/css/root.css"/>
<link rel="stylesheet" href="${base!}/assets/platform/fonts/themify-icons.css" /> <link rel="stylesheet" href="${base!}/assets/platform/fonts/themify-icons.css"/>
<link rel="stylesheet" href="${base!}/assets/platform/fonts/font-awesome.min.css" /> <link rel="stylesheet" href="${base!}/assets/platform/fonts/font-awesome.min.css"/>
<!-- import Vue before Element --> <!-- import Vue before Element -->
<script src="${base!}/assets/platform/plugins/vue/vue.js"></script> <script src="${base!}/assets/platform/plugins/vue/vue.js"></script>
@@ -21,21 +21,21 @@
<!-- import ElementUI --> <!-- import ElementUI -->
<script src="${base!}/assets/platform/plugins/element-ui/lib/index.js"></script> <script src="${base!}/assets/platform/plugins/element-ui/lib/index.js"></script>
<script src="${base!}/assets/platform/plugins/element-ui/lib/i18n/${lang,escape}.js"></script> <script src="${base!}/assets/platform/plugins/element-ui/lib/i18n/${lang,escape}.js"></script>
<link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/index.css" /> <link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/index.css"/>
<link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/index_custom.css" /> <link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/index_custom.css"/>
<link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/override.css" /> <link rel="stylesheet" href="${base!}/assets/platform/plugins/element-ui/lib/theme-chalk/override.css"/>
<link rel="stylesheet" href="${base!}/assets/platform/plugins/fullcalendar/fullcalendar.css"> <link rel="stylesheet" href="${base!}/assets/platform/plugins/fullcalendar/fullcalendar.css">
<!-- import common css --> <!-- import common css -->
<link rel="stylesheet" href="${base!}/assets/platform/css/common.css" /> <link rel="stylesheet" href="${base!}/assets/platform/css/common.css"/>
<!-- import Jquery --> <!-- import Jquery -->
<script src="${base!}/assets/platform/plugins/jquery/jquery.js"></script> <script src="${base!}/assets/platform/plugins/jquery/jquery.js"></script>
<!-- pjax是异步加载html片段的工具,模拟前端路由机制 --> <!-- pjax是异步加载html片段的工具,模拟前端路由机制 -->
<script src="${base!}/assets/platform/plugins/pjax/jquery.pjax.js"></script> <script src="${base!}/assets/platform/plugins/pjax/jquery.pjax.js"></script>
<!-- nprogress 配合pjax使用 --> <!-- nprogress 配合pjax使用 -->
<link rel="stylesheet" href="${base!}/assets/platform/plugins/nprogress/nprogress.css" /> <link rel="stylesheet" href="${base!}/assets/platform/plugins/nprogress/nprogress.css"/>
<script src="${base!}/assets/platform/plugins/nprogress/nprogress.js"></script> <script src="${base!}/assets/platform/plugins/nprogress/nprogress.js"></script>
<!-- 农历插件 --> <!-- 农历插件 -->
@@ -45,14 +45,14 @@
<!--axios--> <!--axios-->
<script src="${base!}/assets/platform/plugins/axios/axios.js"></script> <script src="${base!}/assets/platform/plugins/axios/axios.js"></script>
<!--图片预览--> <!--图片预览-->
<link rel="stylesheet" href="${base!}/assets/platform/plugins/viewerjs/viewer.css" /> <link rel="stylesheet" href="${base!}/assets/platform/plugins/viewerjs/viewer.css"/>
<script src="${base!}/assets/platform/plugins/viewerjs/viewer.js"></script> <script src="${base!}/assets/platform/plugins/viewerjs/viewer.js"></script>
<!--签字canvas--> <!--签字canvas-->
<script src="${base!}/assets/platform/plugins/smooth-signature/index.umd.min.js"></script> <script src="${base!}/assets/platform/plugins/smooth-signature/index.umd.min.js"></script>
<!--二维码--> <!--二维码-->
<script src="${base!}/assets/platform/plugins/vue-qrcode/index.js"></script> <script src="${base!}/assets/platform/plugins/vue-qrcode/index.js"></script>
<!--富文本编辑器--> <!--富文本编辑器-->
<link rel="stylesheet" href="${base!}/assets/platform/plugins/wangEditor4/wangEditor.css" /> <link rel="stylesheet" href="${base!}/assets/platform/plugins/wangEditor4/wangEditor.css"/>
<script src="${base!}/assets/platform/plugins/wangEditor4/wangEditor.js"></script> <script src="${base!}/assets/platform/plugins/wangEditor4/wangEditor.js"></script>
<!--g2plot--> <!--g2plot-->
<script src="${base!}/assets/platform/plugins/g2plot/g2plot.min.js"></script> <script src="${base!}/assets/platform/plugins/g2plot/g2plot.min.js"></script>
@@ -65,8 +65,8 @@
<!--vue-count-to--> <!--vue-count-to-->
<script src="${base!}/assets/platform/plugins/vue-count-to/vue-count-to.min.js"></script> <script src="${base!}/assets/platform/plugins/vue-count-to/vue-count-to.min.js"></script>
<!--vxe--> <!--vxe-->
<link rel="stylesheet" href="${base!}/assets/platform/plugins/vxe/vxe-pc-ui.css" /> <link rel="stylesheet" href="${base!}/assets/platform/plugins/vxe/vxe-pc-ui.css"/>
<link rel="stylesheet" href="${base!}/assets/platform/plugins/vxe/vxe-table.css" /> <link rel="stylesheet" href="${base!}/assets/platform/plugins/vxe/vxe-table.css"/>
<script src="https://vxeui.com/umd/xe-utils@3.5.30/dist/xe-utils.umd.min.js"></script> <script src="https://vxeui.com/umd/xe-utils@3.5.30/dist/xe-utils.umd.min.js"></script>
<script src="https://vxeui.com/umd/vxe-pc-ui@3.1.25/lib/index.umd.min.js"></script> <script src="https://vxeui.com/umd/vxe-pc-ui@3.1.25/lib/index.umd.min.js"></script>
@@ -103,7 +103,7 @@
<script nonce="${cspNonce!}"> <script nonce="${cspNonce!}">
// 在加载 lodash 后、使用前插入 // 在加载 lodash 后、使用前插入
const originalDefaultsDeep = window._.defaultsDeep; const originalDefaultsDeep = window._.defaultsDeep;
window._.defaultsDeep = function(...args) { window._.defaultsDeep = function (...args) {
// 先对所有参数做原型污染清洗 // 先对所有参数做原型污染清洗
const cleanArgs = args.map(arg => sanitizeForPrototypePollution(arg)); const cleanArgs = args.map(arg => sanitizeForPrototypePollution(arg));
return originalDefaultsDeep.apply(window._, cleanArgs); return originalDefaultsDeep.apply(window._, cleanArgs);
@@ -133,7 +133,7 @@
ELEMENT.Table.props.border.default = true ELEMENT.Table.props.border.default = true
ELEMENT.TableColumn.props.headerAlign.default = 'center' ELEMENT.TableColumn.props.headerAlign.default = 'center'
ELEMENT.TableColumn.props.align.default = 'center' ELEMENT.TableColumn.props.align.default = 'center'
ELEMENT.TableColumn.props.showOverflowTooltip = { type: Boolean, default: true } ELEMENT.TableColumn.props.showOverflowTooltip = {type: Boolean, default: true}
Vue.use(ELEMENT, { Vue.use(ELEMENT, {
zIndex: 20000 zIndex: 20000
}) })
@@ -494,13 +494,16 @@
padding: 0 14px; padding: 0 14px;
border-radius: 18px; border-radius: 18px;
color: #ffffff; color: #ffffff;
cursor: pointer;
font-size: 12px; font-size: 12px;
font-weight: 700; font-weight: 700;
font-family: inherit;
line-height: 1; line-height: 1;
text-decoration: none; text-decoration: none;
white-space: nowrap; white-space: nowrap;
background: linear-gradient(90deg, #f5a300 0%, #ff8e00 42%, #ff4b16 100%); background: linear-gradient(90deg, #f5a300 0%, #ff8e00 42%, #ff4b16 100%);
border: 1px solid rgba(255, 247, 184, 0.9); border: 1px solid rgba(255, 247, 184, 0.9);
outline: none;
box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.48), 0 2px 6px rgba(141, 53, 0, 0.25); box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.48), 0 2px 6px rgba(141, 53, 0, 0.25);
transition: transform 0.2s ease, box-shadow 0.2s ease; transition: transform 0.2s ease, box-shadow 0.2s ease;
} }
@@ -618,6 +621,7 @@
background-color: rgba(255, 255, 255, 0.15); background-color: rgba(255, 255, 255, 0.15);
color: #ffffff; color: #ffffff;
} }
.v4-user-sign { .v4-user-sign {
color: #ffffff; color: #ffffff;
cursor: pointer; cursor: pointer;
@@ -629,6 +633,7 @@
gap: 6px; gap: 6px;
white-space: nowrap; white-space: nowrap;
} }
.v4-user-sign:hover { .v4-user-sign:hover {
background-color: rgba(255, 255, 255, 0.15); background-color: rgba(255, 255, 255, 0.15);
color: #ffffff; color: #ffffff;
@@ -705,12 +710,12 @@
} }
</style> </style>
</head> </head>
<body> <body>
<header class="v4-header"> <header class="v4-header">
<div class="v4-left-section"> <div class="v4-left-section">
<div class="v4-logo-container"> <div class="v4-logo-container">
<img src="${AppLogo!}" alt="Logo" class="v4-logo" /> <img src="${AppLogo!}" alt="Logo" class="v4-logo"/>
</div> </div>
<nav class="v4-nav"> <nav class="v4-nav">
@@ -738,7 +743,7 @@
</div> </div>
<div class="v4-user-section"> <div class="v4-user-section">
<a class="v4-retire-system-link" href="http://192.168.73.133:8081/platform/login"> <a id="v4-retire-system-btn" class="v4-retire-system-link" href="javascript:void(0)" target="_blank">
离退休系统 离退休系统
</a> </a>
<div class="v4-user-info"> <div class="v4-user-info">
@@ -753,16 +758,16 @@
退出 退出
</a> </a>
</div> </div>
</header> </header>
<div style="height: 64px"></div> <div style="height: 64px"></div>
<main class="v4-content"> <main class="v4-content">
<!-- 页面内容区域 --> <!-- 页面内容区域 -->
<div class="ele-body" id="container">${layoutContent}</div> <div class="ele-body" id="container">${layoutContent}</div>
</main> </main>
<!-- 页脚 --> <!-- 页脚 -->
<footer class="v4-footer" id="v4-footer" style="display: none;"> <footer class="v4-footer" id="v4-footer" style="display: none;">
<div class="v4-footer-bottom"> <div class="v4-footer-bottom">
<div class="v4-footer-copyright"> <div class="v4-footer-copyright">
<p>&copy; 2025 武汉地大三思科技有限公司. 保留所有权利.</p> <p>&copy; 2025 武汉地大三思科技有限公司. 保留所有权利.</p>
@@ -773,10 +778,10 @@
<a href="http://www.3sgo.cn/" target="_blank">武汉地大三思科技有限公司</a> <a href="http://www.3sgo.cn/" target="_blank">武汉地大三思科技有限公司</a>
</div> </div>
</div> </div>
</footer> </footer>
<script nonce="${cspNonce!}"> <script nonce="${cspNonce!}">
// 处理导航项的active状态 // 处理导航项的active状态
$(document).ready(function () { $(document).ready(function () {
// 控制页脚显示的函数 // 控制页脚显示的函数
@@ -806,6 +811,27 @@
setActiveNavItem() setActiveNavItem()
toggleFooter() toggleFooter()
/*
* 离退休系统跳转地址从 sys_config 读取。
* 请求参数: key 固定传 RETIRE_SYSTEM_URL, 对应 sys_config.configKey。
* 返回值: Result JSON, data 为 sys_config.configValue, 应配置完整跳转地址。
*/
$("#v4-retire-system-btn").on("click", () => {
$.post("/open/common/getConfigKey", {key: "RETIRE_SYSTEM_URL"})
.then((res) => {
var retireSystemUrl = res && res.code === 0 ? res.data : ""
if (retireSystemUrl) {
window.open(retireSystemUrl, "_blank")
} else {
ELEMENT.Message.error("未配置离退休系统地址")
}
}, () => {
ELEMENT.Message.error("获取离退休系统地址失败")
})
.always(() => {
})
})
// 为导航项添加点击事件 // 为导航项添加点击事件
$(".v4-nav-item").on("click", function () { $(".v4-nav-item").on("click", function () {
$(".v4-nav-item").removeClass("active") $(".v4-nav-item").removeClass("active")
@@ -826,6 +852,6 @@
toggleFooter() toggleFooter()
}) })
}) })
</script> </script>
</body> </body>
</html> </html>
@@ -140,7 +140,7 @@
...this.designerData, ...this.designerData,
content: val.json content: val.json
} }
$.post("/flow/design/updateContent", { design: JSON.stringify(design) }).then((res) => { $.post("/flow/design/xiugaiDesign", { design: JSON.stringify(design) }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
window.parent.postMessage("success") window.parent.postMessage("success")
} else { } else {
@@ -0,0 +1,957 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" class="platform" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">&emsp;&emsp;</div>
<div class="search-item-option">
<el-date-picker
@change="yearChange"
v-model="pageForm.year"
type="year"
value-format="yyyy" style="width: 100%"
placeholder="选择年">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">活动名称</div>
<div class="search-item-option">
<el-select v-model="pageForm.activityId" placeholder="请选择活动名称" filterable clearable
style="width: 100%" @change="doSearchS">
<el-option
v-for="item in activityList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">活动项目</div>
<div class="search-item-option">
<el-select v-model="pageForm.eventId" placeholder="请选择活动项目" filterable clearable
style="width: 100%" @change="doSearch">
<el-option
v-for="item in events"
:key="item.eventId"
:label="item.allName"
:value="item.eventId">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">男子女子</div>
<div class="search-item-option">
<el-select v-model="pageForm.isMenWomen" placeholder="请选择男子女子" clearable
style="width: 100%" @change="doSearch">
<el-option
v-for="item in menWomenList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">项目类型</div>
<div class="search-item-option">
<el-select v-model="pageForm.projectType" placeholder="请选择项目类型" clearable
style="width: 100%" @change="doSearch">
<el-option
v-for="item in projectTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">比赛组别</div>
<div class="search-item-option">
<el-select v-model="pageForm.competitionCategory" placeholder="请选择比赛组别" filterable clearable
style="width: 100%" @change="doSearch">
<el-option
v-for="item in groupList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="项目列表">
<!--<el-radio-group v-model="pageForm.isMenWomen" @change="doSearch"
style="margin-left: 10px">
<el-radio-button :label="1">全部</el-radio-button>
<el-radio-button :label="2">男子</el-radio-button>
<el-radio-button :label="3">女子</el-radio-button>
<el-radio-button :label="4">团体</el-radio-button>
</el-radio-group>-->
<!-- <el-checkbox-group @change="doSearch" v-model="pageForm.isMenWomen">
<el-checkbox-button :key="2" :label="2">男子</el-checkbox-button>
<el-checkbox-button :key="3" :label="3">女子</el-checkbox-button>
</el-checkbox-group>-->
<!-- <el-checkbox-group @change="doSearch" v-model="pageForm.isMenWomen">
<el-checkbox-button :key="4" :label="4">单项</el-checkbox-button>
<el-checkbox-button :key="5" :label="5">团体</el-checkbox-button>
</el-checkbox-group>
<el-select v-model="pageForm.groupName" placeholder="请选择组别"
filterable clearable
style="width: 100%;margin-bottom: 5px;margin-left: 10px" @change="doSearch">
<el-option
v-for="item in groupList"
:key="item.id"
:label="item.name"
:value="item.name">
</el-option>
</el-select>-->
</table-tool>
<el-table :data="tableData" style="width: 100%;margin-bottom: 20px" row-key="id"
@sort-change="pageOrder" v-loading="tableLoading" :size="tableSize" class="vi-table">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column prop="allName" align="center" header-align="center"
label="项目名称"></el-table-column>
<el-table-column prop="rs" align="center" header-align="center"
label="获奖数量"></el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作" width="150px">
<template scope="{row}">
<el-dropdown @command="dropdownCommand">
<el-button size="mini" :loading="row.loading">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'input',row}">
录入成绩
</el-dropdown-item>
<el-dropdown-item :command="{type:'view',row}">
&emsp;&emsp;
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit_func>
<el-button type="primary" @click="openAdd">临时获奖人员添加</el-button>
<el-button type="primary" @click="doAdd">确 定</el-button>
</template>
<template #edit>
<template>
<table-tool label="录入成绩"></table-tool>
<el-form :model="formData" ref="addForm" label-width="120px"
label-suffix="">
<el-row :gutter="40">
<el-col :span="12">
<el-form-item prop="name" label="活动名称">
<el-input maxlength="200" disabled v-model="name"
type="text"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="allName" label="活动项目">
<el-input maxlength="200" disabled v-model="allName"
type="text"></el-input>
</el-form-item>
</el-col>
</el-row>
<div style="display: flex;margin: 20px 0">
<el-divider content-position="left">获奖名次列表</el-divider>
<div style="padding-left: 10px;padding-top: 10px;">
<el-tooltip class="item" effect="dark" content="点击添加活动人员" placement="top">
<el-button style="float: right;margin-bottom: 10px" type="primary" icon="el-icon-plus"
size="mini"
@click="openAddUser">
添加
</el-button>
</el-tooltip>
</div>
</div>
<el-table style="margin-bottom: 20px" border stripe :data="userData" size="small"
v-loading="userTabLoading">
<el-table-column
type="index" label="序号" header-align="center" align="center" width="100">
</el-table-column>
<el-table-column align="center" header-align="center"
:label="awardsMode==1?'姓名':'分工会'"
prop="id">
<template scope="{$index,row}">
<el-select v-model="row.userId" @change="(val)=>{userDetailsChange(val,row)}"
placeholder="请输入姓名" filterable clearable
style="width: 100%" size="small" v-if="awardsMode==1">
<el-option
v-for="item in userList"
:disabled="item.disabled"
:key="item.id"
:label="item.username+''+item.loginname+''+item.sex"
:value="item.id">
</el-option>
</el-select>
<el-select v-model="row.unionId" @change="(val)=>{unionDetailsChange(val,row)}"
placeholder="请输入分工会" filterable clearable
style="width: 100%" size="small" v-if="awardsMode==2">
<el-option
v-for="item in unionList"
:disabled="item.disabled"
:key="item.id"
:label="item.unionname"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="名次" prop="ranking">
<template scope="{$index,row}">
<el-select v-model="row.ranking" @change="rankingChange(row)"
placeholder="请输入名次" filterable clearable
style="width: 100%" size="small">
<el-option
v-for="item in rankingList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="积分" prop="integral">
<template scope="{row}">
<el-input-number v-model="row.integral"
type="text"></el-input-number>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="人数" prop="numberOfPeople"
v-if="awardsMode==2">
<template scope="{row}">
<el-input-number v-model="row.numberOfPeople"
type="text"></el-input-number>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="分工会" prop="unionname"
v-if="awardsMode==1">
<template scope="{row}">
<el-input v-model="row.unionname" disabled placeholder="分工会"
type="text"></el-input>
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作"
width="150px">
<template scope="{$index,row}">
<el-button type="danger" icon="el-icon-delete" circle
@click="delUser($index,row)"></el-button>
</template>
</el-table-column>
</el-table>
</el-form>
</template>
</template>
<template #view>
<el-form :model="formData" ref="addForm" label-width="120px" label-suffix="">
<el-row :gutter="40">
<el-col :span="12">
<el-form-item prop="name" label="活动名称">
<el-input maxlength="200" disabled v-model="name"
type="text"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="allName" label="活动项目">
<el-input maxlength="200" disabled v-model="allName"
type="text"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div style="display: flex;margin: 20px 0">
<el-divider content-position="left">获奖名次列表</el-divider>
</div>
<el-table style="margin-bottom: 20px" border stripe :data="viewData" size="small"
v-loading="userTabLoading">
<el-table-column
type="index" label="序号" header-align="center" align="center" width="100">
</el-table-column>
<el-table-column align="center" header-align="center"
:label="awardsMode==1?'姓名':'分工会'"
prop="id">
<template scope="{$index,row}">
<el-select v-model="row.userId" @change="(val)=>{userDetailsChange(val,row)}"
placeholder="请输入姓名" filterable clearable disabled
style="width: 100%" size="small" v-if="awardsMode==1">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.username+''+item.loginname+''+item.sex"
:value="item.id">
</el-option>
</el-select>
<el-select v-model="row.unionId" @change="(val)=>{unionDetailsChange(val,row)}"
placeholder="请输入分工会" filterable clearable disabled
style="width: 100%" size="small" v-if="awardsMode==2">
<el-option
v-for="item in unionList"
:key="item.id"
:label="item.unionname"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="名次" prop="ranking">
<template scope="{$index,row}">
<el-select v-model="row.ranking" @change="rankingChange(row)"
placeholder="请输入名次" filterable clearable disabled
style="width: 100%" size="small">
<el-option
v-for="item in rankingList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="积分" prop="integral">
<template scope="{row}">
<el-input v-model="row.integral" disabled type="text"></el-input>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="人数" prop="numberOfPeople"
v-if="awardsMode==2">
<template scope="{row}">
<el-input v-model="row.numberOfPeople" disabled type="text"></el-input>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="分工会" prop="unionname"
v-if="awardsMode==1">
<template scope="{row}">
<el-input v-model="row.unionname" disabled placeholder="分工会"
type="text"></el-input>
</template>
</el-table-column>
</el-table>
</template>
</guava>
<el-dialog
title="添加人员"
:visible.sync="dialogVisible"
width="40%"
:close-on-click-modal="false"
>
<el-form :model="formData" ref="form" :rules="formRules" label-width="100px">
<!-- <el-form-item prop="loginname" label="工&emsp;&emsp;号">
<el-input maxlength="50" placeholder="请填写工号" v-model="formData.loginname"
type="text" @blur="userBlur"></el-input>
</el-form-item>
<el-form-item prop="username" label="姓&emsp;&emsp;名">
<el-input maxlength="50" placeholder="请填写姓名" v-model="formData.username"
type="text"></el-input>
</el-form-item>-->
<el-form-item prop="mobile" label="姓名或工号">
<el-select
style="width: 100%"
v-model="formData.userid"
filterable
clearable
remote
reserve-keyword
allow-create
default-first-option
placeholder="请输入姓名或工号查找"
:remote-method="userRemoteMethod"
@change="userChange2">
<el-option
v-for="item in userOptions"
:key="item.id"
:label="item.username+''+item.loginname+''"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="loginname" label="工&emsp;&emsp;号">
<el-input maxlength="50" placeholder="请填写工号" v-model="formData.loginname"
type="text"></el-input>
</el-form-item>
<el-form-item prop="mobile" label="电&emsp;&emsp;话">
<el-input maxlength="50" placeholder="请填写电话" v-model="formData.mobile"
type="text"></el-input>
</el-form-item>
<el-form-item prop="sex" label="性&emsp;&emsp;别">
<el-radio-group v-model="formData.sex">
<el-radio :label="'男'" border></el-radio>
<el-radio :label="'女'" border></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="unitId" label="所在单位">
<el-select v-model="formData.unitId" placeholder="请选择所在单位" clearable @change="unitChange"
filterable
style="width: 100%">
<el-option
v-for="item in unitOptions"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="unionname" label="所属工会">
<el-input disabled placeholder="所属工会" v-model="formData.unionname"
type="text"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doAddUser">确 定</el-button>
</span>
</el-dialog>
</div>
<script nonce="${cspNonce!}">
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
userOptions: [],
groupList: [],
menWomenList: [
{id: 1, name: "男子"},
{id: 2, name: "女子"}
],
projectTypeList: [
{id: "1", name: "单项"},
{id: "2", name: "团体"}
],
dialogVisible: false,
viewData: [],
userTabLoading: false,
awardsMode: "",
isMenWomen: "",
allName: "",
name: "",
eventId: "",
activityId: "",
userData: [],
userList: [],
userList2: [],
unionList: [],
unionList2: [],
activityList: [],
events: [],
unitOptions: [],
rankingList: [
{name: "第一名", id: 1},
{name: "第二名", id: 2},
{name: "第三名", id: 3},
{name: "第四名", id: 4},
{name: "第五名", id: 5},
{name: "第六名", id: 6},
{name: "第七名", id: 7},
{name: "第八名", id: 8}],
sexList: [{sex: "男", id: 1}, {sex: "女", id: 2}],
pageForm: {
isMenWomen: "",
projectType: "",
competitionCategory: "",
year: new Date().getFullYear() + "",
},
formRules: {
unitId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
username: [{required: true, message: '必填', trigger: ['blur', 'change']}],
loginname: [{required: true, message: '必填', trigger: ['blur', 'change']}],
}
}
},
components: {},
methods: {
dropdownCommand(command) {
const {type, row} = command
if (type === 'view') {
this.openView(row)
} else if (type === 'input') {
this.openInput(row)
}
},
userRemoteMethod(query) {
if (query) {
this.$axios.post("/open/common/userOptions", {query: query}).then((resp) => {
this.userOptions = resp.data
})
}
},
userChange2(userid) {
const aa = this.userOptions.find(v => v.id === userid)
if (aa) {
const unit = this.unitOptions.find(v => v.id === aa.unitId)
this.$set(this.formData, "username", aa.username)
this.$set(this.formData, "loginname", aa.loginname)
this.$set(this.formData, "mobile", aa.mobile)
this.$set(this.formData, "unitId", aa.unitId)
this.$set(this.formData, "unionId", unit.unionId)
this.$set(this.formData, "unionname", unit.unionName)
this.$set(this.formData, "sex", aa.sex)
} else {
this.$set(this.formData, "username", userid)
}
},
unitChange() {
const unit = this.unitOptions.find(v => v.id === this.formData.unitId)
this.$set(this.formData, "unionId", unit.unionId)
this.$set(this.formData, "unionname", unit.unionName)
this.$set(this.formData, "unitname", unit.name)
},
openAdd() {
this.$businessTool.listUnit().then((data) => {
this.unitOptions = data
this.$set(this.formData, "activityId", this.activityId)
this.$set(this.formData, "eventId", this.eventId)
this.$set(this.formData, "awardsMode", this.awardsMode)
this.$set(this.formData, "identity", ['1'])
this.$set(this.formData, "status", 2)
this.$set(this.formData, "sex", "男")
this.dialogVisible = true
if (this.$refs['form']) {
this.$refs['form'].resetFields()
}
})
},
doAddUser() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.userList.some(v => v.id === this.formData.userid)) {
this.notifyWarning("您添加的运动员已经是远动员!")
return
}
this.$axios.post(loc() + "/doAdd", {
activityResults: JSON.stringify(this.userData),
activityId: this.activityId,
eventId: this.eventId
}).then(() => {
const pageForm = clone(this.formData)
pageForm.identity = JSON.stringify(this.formData.identity)
return this.$axios.post(loc() + "/doAddUser", pageForm)
}).then((resp) => {
if (resp.code === 0) {
if (this.awardsMode == 2) {
this.getUnionList({
activityId: this.activityId,
eventId: this.eventId
}).then((unionList) => {
this.unionList = unionList
return this.getUnionData({activityId: this.activityId, eventId: this.eventId})
}).then((userData) => {
this.userData = userData
return this.unionDetailsChange()
}).then(() => {
this.dialogVisible = false
})
} else {
this.userChange().then(() => {
this.userDetailsChange()
this.dialogVisible = false
})
}
} else {
this.notifyWarning(resp.msg)
}
})
}
})
},
yearChange() {
this.activityList = []
this.events = []
this.$set(this.pageForm, "activityId", "")
this.$set(this.pageForm, "eventId", "")
this.$axios.post("/platform/activity/score/statistics/getActivitys", {year: this.pageForm.year}).then((res) => {
const data = res.data
this.activityList = data
if (data.length > 0) {
this.pageForm.activityId = this.activityList[0].id
}
this.doSearchS()
})
},
changeActivit() {
return this.$axios.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId}).then((resp) => {
this.events = resp.data
})
},
doAdd() {
this.userData.activityId = this.activityId
this.userData.eventId = this.eventId
this.$axios.post(loc() + "/doAdd", {
activityResults: JSON.stringify(this.userData),
activityId: this.activityId,
eventId: this.eventId
}).then((resp) => {
if (resp.code === 0) {
this.pageData()
this.$refs.guava.index()
} else {
this.notifyWarning(resp.msg)
}
})
},
rankingChange() {
for (let ranking = 1; ranking <= 8; ranking++) {
let size = 0
let indexArray = [];
this.userData.forEach((v, index) => {
if (ranking == v.ranking) {
size++
indexArray.push(index)
}
})
if (size == 1) {
/*
if (this.awardsMode == 2) {
this.userData[indexArray[0]].integral = (this.calScore(ranking) / 2).toFixed(2);
console.log(this.calScore(ranking),2)
} else {
this.userData[indexArray[0]].integral = this.calScore(ranking).toFixed(2);
console.log(this.calScore(ranking),1)
}*/
this.userData[indexArray[0]].integral = this.calScore(ranking).toFixed(2);
} else {
var scoreArray = 0;
for (var i = 0; i < size; i++) {
scoreArray += this.calScore(ranking * 1 + i * 1);
}
/* if (this.awardsMode == 2) {
scoreArray = scoreArray / size / 2;
console.log(scoreArray, 2)
} else {
scoreArray = scoreArray / size;
console.log(scoreArray, 1)
}*/
scoreArray = scoreArray / size;
indexArray.forEach(v => {
this.userData[v].integral = scoreArray.toFixed(2);
})
}
}
},
calScore(ranking) {
let score;
if (ranking < 5) {// 1 2 3 4
if (ranking < 3) {//1 2
if (ranking == 1) {
score = this.awardsMode == 1 ? 9 : 9 * 2;
} else if (ranking == 2) {
score = this.awardsMode == 1 ? 7 : 7 * 2;
}
} else {//3 4
if (ranking == 3) {
score = this.awardsMode == 1 ? 6 : 6 * 2;
} else if (ranking == 4) {
score = this.awardsMode == 1 ? 5 : 5 * 2;
}
}
} else {//5 6 7 8
if (ranking < 7) {//5 6
if (ranking == 5) {
score = this.awardsMode == 1 ? 4 : 4 * 2;
} else if (ranking == 6) {
score = this.awardsMode == 1 ? 3 : 3 * 2;
}
} else {//7 8 9
if (ranking == 7) {
score = this.awardsMode == 1 ? 2 : 2 * 2;
} else if (ranking == 8) {
score = this.awardsMode == 1 ? 1 : 1 * 2;
} else if (ranking == 9) {
score = this.awardsMode == 1 ? 1 : 1 * 2;
}
}
}
return score;
},
userDetailsChange(val, row) {
const useridArr = this.userData.map(v => v.userId)
this.userList.forEach(v => {
v.disabled = useridArr.includes(v.id)
if (row && row.userId === v.id) {
const o = {
unionId: v.unionId,
activityId: this.activityId,
eventId: this.eventId,
isTeamPersonal: 1,
unionname: v.unionname
}
Object.assign(row, o)
}
})
},
unionDetailsChange(val, row) {
if (row) {
const {unionId} = row
return this.$axios.post(loc() + "/getUnionDetails", {
activityId: this.activityId,
eventId: this.eventId,
unionId: unionId
}).then((data) => {
this.setUnionDetails(row, data)
})
}
this.setUnionDetails(row, '')
return Promise.resolve()
},
setUnionDetails(row, data) {
this.$nextTick(() => {
const unionIdArr = this.userData.map(v => v.unionId)
this.unionList.forEach(v => {
v.disabled = unionIdArr.includes(v.id)
if (row && row.unionId === v.id) {
const o = {
numberOfPeople: data.data,
activityId: this.activityId,
eventId: this.eventId,
isTeamPersonal: 2
}
Object.assign(row, o)
}
})
})
},
delUser(index, row) {
this.userData.splice(index, 1)
this.userDetailsChange()
this.unionDetailsChange()
},
getUserList() {
return this.$axios.post(loc() + "/getUserList", {
activityId: this.activityId,
eventId: this.eventId,
isMenWomen: this.isMenWomen
}).then((resp) => {
return resp.data
})
},
getUnionList(row) {
const {activityId, eventId} = row
return this.$axios.post(loc() + "/getUnionList", {
activityId: activityId,
eventId: eventId
}).then((resp) => {
return resp.data
})
},
openAddUser() {
this.userData.push({})
},
userChange() {
return this.getUserList().then((userList) => {
this.userList = userList
this.userList2 = this.userList
this.userData = []
return this.$axios.post(loc() + "/getUserData", {
activityId: this.activityId,
eventId: this.eventId,
isMenWomen: this.isMenWomen
})
}).then((resp) => {
const data = resp.data
if (data.length > 0) {
this.userData = data
this.viewData = data
}
this.$forceUpdate();
})
},
getUnionData(row) {
const {activityId, eventId} = row
return this.$axios.post(loc() + "/getUnionData", {
activityId: activityId,
eventId: eventId
}).then((resp) => {
return resp.data
})
},
openView(row) {
this.isMenWomen = ""
this.userData = []
this.viewData = []
this.userList = []
this.awardsMode = row.awardsMode
this.name = row.name
this.allName = row.allName
this.activityId = row.activityId
this.eventId = row.eventId
if (row.awardsMode == 2) {
this.getUnionList(row).then((unionList) => {
this.unionList = unionList
return this.getUnionData(row)
}).then((viewData) => {
this.viewData = viewData
return this.unionDetailsChange()
}).then(() => {
this.$refs.guava.view()
})
} else {
this.userChange().then(() => {
this.userDetailsChange()
this.$refs.guava.view()
})
}
},
openInput(row) {
this.isMenWomen = ""
this.userData = []
this.userList = []
this.awardsMode = row.awardsMode
this.name = row.name
this.allName = row.allName
this.activityId = row.activityId
this.eventId = row.eventId
this.isMenWomen = row.isMenWomen
if (row.awardsMode == 2) {
this.getUnionList(row).then((unionList) => {
this.unionList = unionList
return this.getUnionData(row)
}).then((userData) => {
this.userData = userData
return this.unionDetailsChange()
}).then(() => {
this.$refs.guava.edit()
})
} else {
this.userChange().then(() => {
this.userDetailsChange()
this.$refs.guava.edit()
})
}
},
getActivitys() {
return this.$axios.post("/platform/activity/score/statistics/getActivitys", {year: this.pageForm.year}).then((res) => {
return res.data
})
},
focusGroup() {
this.$axios.post("/platform/activity/basic/event/focusGroup").then((resp) => {
if (resp.code === 0) {
this.groupList = resp.data
} else {
this.notifyWarning(resp.msg)
}
})
},
doSearchS() {
this.$set(this.pageForm, "eventId", "")
this.changeActivit().then(() => {
this.doSearch()
})
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageData()
},
pageData() {
this.tableLoading = true
const pageForm = clone(this.pageForm)
this.$axios.post("/platform/activity/results/input/pageData", pageForm).then(resp => {
if (resp.code == 0) {
this.tableData = resp.data.list;
this.pageForm.totalCount = resp.data.totalCount;
} else {
this.$message({
message: resp.msg,
type: 'error'
});
}
}).finally(() => {
this.tableLoading = false
})
},
},
created() {
this.focusGroup()
this.yearChange()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,487 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
#app {
/*max-height: calc(100vh - 50px);
overflow: hidden;*/
}
.query-row {
height: 70px;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
}
.query-row:not(:last-child) {
border-bottom: 1px dashed rgb(230, 230, 230);
}
.query-row-title {
width: 120px;
}
/* .el-select, .el-input {
width: 80%;
}*/
.el-date-editor.el-input, .el-date-editor.el-input__inner {
width: 175px !important;
}
/* Bootstrap 会覆盖 a:focus,导致左侧菜单当前项出现白色焦点框,这里仅还原侧边栏菜单链接的焦点态。 */
#sidebar-menu .el-menu .el-menu-item a:focus {
outline: none;
box-shadow: none;
text-decoration: none;
background: transparent;
}
</style>
<div id="app" v-cloak>
<guava ref="guava"
style="width: 100%;min-height: 100%;background-color: #f0f2f5;padding: 20px;box-sizing: border-box;">
<template>
<el-card shadow="never">
<search @search="doSearch" :is-search-button="false">
<search-item label="年度">
<el-date-picker
:clearable="false"
@change="getActivitys"
placeholder="选择年"
type="year"
v-model="pageForm.year" value-format="yyyy">
</el-date-picker>
</search-item>
<search-item label="活动名称" v-if="!pageForm.status">
<el-select :clearable="false" @change="activityChange" filterable
placeholder="请选择活动名称" style="width: 100%" v-model="pageForm.activityId">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in activityList">
</el-option>
</el-select>
</search-item>
<search-item label="所属工会" v-if="isUnion">
<el-select @change="unionChange(pageForm.unionId)" clearable filterable placeholder="请选择工会"
style="width: 100%" v-model="pageForm.unionname">
<el-option
:key="item.id"
:label="item.name"
:value="item.name"
v-for="item in unionList">
</el-option>
</el-select>
</search-item>
<search-item>
<el-button @click="doExcelCj" icon="el-icon-printer" type="primary">导出成绩excel
</el-button>
</search-item>
</search>
</el-card>
<div style="max-height: 250px">
<el-card shadow="never" style="margin-top: 10px">
<el-row type="flex" align="middle" class="query-row">
<el-col class="query-row-title">按年度统计:</el-col>
<el-col class="query-row-content" v-if="isSearchOptions">
<el-tag
:effect="pageForm.status===item.code?'dark':'plain'"
:key="item.code"
:type="item.name"
@click="statusType(item.code)"
style="margin-right: 10px;cursor: pointer"
v-for="item in statusOptions">
{{ item.name }}
</el-tag>
</el-col>
</el-row>
<el-row type="flex" align="middle" class="query-row">
<el-col class="query-row-title">运动会成绩统计:</el-col>
<el-col class="query-row-content" v-if="isSearchOptions">
<el-tag
:effect="pageForm.status2===item.id?'dark':'plain'"
:key="item.id"
:type="item.name"
@click="status2Type(item.id)"
style="margin-right: 10px;cursor: pointer"
v-for="item in searchOptions">
{{ item.name }}
</el-tag>
</el-col>
<el-col class="query-row-content" v-else>
<el-button style="margin-left: 10px"
size="medium" @click="gradesClick(9)">成绩统计
</el-button>
</el-col>
<div class="pull-right offscreen-right" style="margin-left: auto">
<el-button @click="doExportByActivityStatisticsType" icon="el-icon-printer" type="primary">
导出
</el-button>
</div>
</el-row>
</el-card>
</div>
<el-card shadow="never" class="mt10"
v-show="[1,2,3,4,5,9,10].includes(isSearchOptions)&&isSearchOptions">
<table-tool v-if="isSearchOptions==1" label="男子单项成绩"></table-tool>
<table-tool v-if="isSearchOptions==2" label="女子单项成绩"></table-tool>
<table-tool v-if="isSearchOptions==3" label="男子团体成绩"></table-tool>
<table-tool v-if="isSearchOptions==4" label="女子团体成绩"></table-tool>
<table-tool v-if="isSearchOptions==5" label="男女混合类成绩"></table-tool>
<table-tool v-if="isSearchOptions==9&&isSearch" label="男子项目分工会积分"></table-tool>
<table-tool v-if="isSearchOptions==9&&!isSearch" label="分工会项目成绩"></table-tool>
<table-tool v-if="isSearchOptions==10" label="女子项目分工会积分"></table-tool>
<is-male-female :form="pageForm" ref="female"></is-male-female>
</el-card>
<el-card shadow="never" class="mt10" v-show="[6,7,8].includes(isSearchOptions)&&isSearchOptions">
<table-tool v-if="isSearchOptions==6" label="男子项目前八"></table-tool>
<table-tool v-if="isSearchOptions==7" label="女子项目前八"></table-tool>
<table-tool v-if="isSearchOptions==8" label="综合类前八"></table-tool>
<el-row>
<top-eight :form="pageForm" ref="doeight"></top-eight>
</el-row>
</el-card>
<el-card shadow="never" class="mt10" v-show="[11,12].includes(isSearchOptions)&&isSearchOptions">
<table-tool v-if="isSearchOptions==11" label="男子总分前八"></table-tool>
<table-tool v-if="isSearchOptions==12" label="女子总分前八"></table-tool>
<score-top-eight :form="pageForm" ref="doTopEight"></score-top-eight>
</el-card>
<el-card shadow="never" class="mt10" v-show="[99].includes(isSearchOptions)">
<table-tool v-if="isSearchOptions==99" label="全年成绩"></table-tool>
<el-table :data="annualResultsTableData" style="width: 100%;height: 100%" stripe border
show-summary
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading" size="mini" fixed ref="annualResults"
>
<el-table-column align="center" header-align="center" type="index"
label="名次"
width="80px" fixed></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in annualTableColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
show-overflow-tooltip>
</el-table-column>
</el-table>
</el-card>
</template>
</guava>
</div>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<script nonce="${cspNonce!}">
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
isMenWomen: "",
isUnion: false,
isYear8: false,
annualTableColumns: [],
annualResultsTableData: [],
annualMaxHeight: 0,
colspan: [],
eventList: [],
score: [],
titleCol: 0,
activityList: [],
events: [],
unionList: [],
units: [],
isSearch: true,
searchOptions: [],
Options: [
/* {id: 1, name: "男子单项"},
{id: 2, name: "女子单项"},
{id: 3, name: "男子团体"},
{id: 4, name: "女子团体"},
{id: 5, name: "男女混合类"},*/
{id: 9, name: "男子项目分工会积分"},
{id: 10, name: "女子项目分工会积分"},
{id: 6, name: "男子单项前八"},
{id: 7, name: "女子单项前八"},
{id: 8, name: "团体项目前八"},
{id: 11, name: "男子总分前八"},
{id: 12, name: "女子总分前八"},
],
isSearchOptions: 9,
pageForm: {
status2: 9,
status: '',
unionname: '',
activityId: "",
personTypes: [],
year: new Date().getFullYear() + "",
},
activityStatisticsType: 0,//统计类型说明:1 年度男子团体总分2.年度女子团体总分3.年度团体总分4.分工会男子项目积分5.分工会女子项目积分,依次后推
statusOptions: [
{code: "1", name: "年度男子团体总分"},
{code: "2", name: "年度女子团体总分"},
{code: "3", name: "年度团体总分"}
]
}
},
components: {
'is-male-female': httpVueLoader('/components/module/activity/score/isMaleFemale.vue?v=' + new Date().getTime()),
'top-eight': httpVueLoader('/components/module/activity/score/topEight.vue?v=' + new Date().getTime()),
'score-top-eight': httpVueLoader('/components/module/activity/score/scoreTopEight.vue?v=' + new Date().getTime()),
},
methods: {
status2Type(id) {
if (this.pageForm.status2 === id) {
this.$set(this.pageForm, "status2", 9)
this.$set(this.pageForm, "sex", "男")
this.$set(this.pageForm, "activityId", this.activityList[0].id)
} else {
this.$set(this.pageForm, "status2", id)
}
this.searchClick(id)
},
statusType(state) {
let promise = Promise.resolve()
if (state === "1") {
promise = this.getYear8(1)
} else if (state === "2") {
promise = this.getYear8(2)
} else if (state === "3") {
promise = this.annualResults()
}
promise.then(() => {
if (this.pageForm.status === state) {
this.$set(this.pageForm, "status", null)
this.$set(this.pageForm, "activityId", this.activityList[0].id)
this.activityChange()
this.$set(this.pageForm, "status2", 9)
} else {
this.$set(this.pageForm, "status", state)
this.$set(this.pageForm, "status2", '')
}
})
},
doExportByActivityStatisticsType() {
const {activityId, year} = this.pageForm
const url = "/platform/activity/statistics/export"
if (this.activityStatisticsType === 1 || this.activityStatisticsType === 2) {
this.$downLoad(url + "/getYear8", {year: year, isMenWomen: this.isMenWomen})
} else if (this.activityStatisticsType === 3) {
this.$downLoad(url + "/getAnnualResults", {year})
} else if (this.activityStatisticsType === 4 || this.activityStatisticsType === 5) {
let sex = this.activityStatisticsType === 4 ? "男" : "女"
this.$downLoad(url + "/isMaleFemale", {activityId: activityId, sex: sex, awardsMode: 4})
} else if (this.activityStatisticsType === 6 || this.activityStatisticsType === 7 || this.activityStatisticsType === 8) {
let sex = this.activityStatisticsType === 6 ? "男" : "女"
let awardsMode = this.activityStatisticsType === 8 ? 2 : 1
this.$downLoad(url + "/isTopEight", {activityId: activityId, sex: sex, awardsMode: awardsMode})
} else if (this.activityStatisticsType === 9 || this.activityStatisticsType === 10) {
let sex = this.activityStatisticsType === 9 ? "男" : "女"
this.$downLoad(url + "/isScoreTopEight", {activityId: activityId, sex: sex})
}
},
doExcelCj() {
const {activityId, unionname} = this.pageForm
let unionId = ''
if (unionname) {
const unionlist = clone(this.unionList)
unionId = unionlist.find(v => v.name === unionname).id
}
this.$downLoad(loc() + "/doExcelCj", {activityId: activityId, unionId: unionId})
},
activityChange() {
this.$set(this.pageForm, "yearDoSearch", null)
const aa = this.activityList.find(v => v.id == this.pageForm.activityId)
if (!aa) {
return
}
if (aa.applyType == 1) {
this.isSearch = false
this.searchOptions = [{id: 9, name: "分工会项目成绩"}]
} else {
this.searchOptions = this.Options
}
this.searchClick(9)
},
unionChange() {
this.searchClick(9)
},
searchClick(id) {
this.$set(this.pageForm, "status", null)
if (!this.pageForm.activityId) {
this.$set(this.pageForm, "activityId", this.activityList[0].id)
}
if (id === 9) {
this.activityStatisticsType = 4
} else if (id === 10) {
this.activityStatisticsType = 5
} else if (id === 6) {
this.activityStatisticsType = 6
} else if (id === 7) {
this.activityStatisticsType = 7
} else if (id === 8) {
this.activityStatisticsType = 8
} else if (id === 11) {
this.activityStatisticsType = 9
} else if (id === 12) {
this.activityStatisticsType = 10
}
this.isSearchOptions = id
if (id <= 5 || id == 9 || id == 10) {
if (id == 1 || id == 2) {
this.isUnion = false
this.isYear8 = false
this.pageForm.sex = id == 1 ? "男" : "女"
this.pageForm.awardsMode = 1
} else if (id == 3 || id == 4) {
this.isUnion = false
this.isUnionisYear8 = false
this.pageForm.sex = id == 3 ? "男" : "女"
this.pageForm.awardsMode = 2
} else if (id == 9 || id == 10) {
this.isUnion = true
this.pageForm.sex = id == 9 ? "男" : "女"
this.pageForm.awardsMode = 4
} else {
this.pageForm.awardsMode = 3
}
this.$refs.female.isMaleFemale()
} else if (id == 6 || id == 7 || id == 8) {
if (id == 6 || id == 7) {
this.isUnion = false
this.isYear8 = false
this.pageForm.sex = id == 6 ? "男" : "女"
this.pageForm.awardsMode = 1
} else if (id == 8) {
this.pageForm.awardsMode = 2
}
this.$refs.doeight.isTopEight()
} else if (id == 11 || id == 12) {
this.pageForm.sex = id == 11 ? "男" : "女"
this.$refs.doTopEight.isScoreTopEight()
}
},
getYear8(isMenWomen) {
this.activityStatisticsType = isMenWomen
this.isMenWomen = isMenWomen
this.isUnion = false
this.isYear8 = true
this.$set(this.pageForm, "activityId", null)
this.$set(this.pageForm, "unionname", null)
this.annualTableColumns = []
this.annualResultsTableData = []
this.tableLoading = true
this.isSearchOptions = 99
return this.$axios.post(loc() + "/getYear8", {
year: this.pageForm.year,
isMenWomen: isMenWomen
}).then((resp) => {
const data = resp.data
this.annualResultsTableData = data.score
this.annualResultsTableData = this.annualResultsTableData.sort((a, b) => b['总分'] - a['总分'])
data.label.forEach(v => {
this.annualTableColumns.push({label: v, prop: v})
})
}).finally(() => {
this.tableLoading = false
})
},
annualResults() {
this.activityStatisticsType = 3
this.isUnion = false
this.isYear8 = false
this.$set(this.pageForm, "activityId", null)
this.$set(this.pageForm, "unionname", null)
this.annualTableColumns = []
this.annualResultsTableData = []
this.tableLoading = true;
this.isSearchOptions = 99
return this.$axios.post(loc() + "/getAnnualResults", {
year: this.pageForm.year
}).then((resp) => {
const data = resp.data
this.annualResultsTableData = data.score
this.annualResultsTableData = this.annualResultsTableData.sort((a, b) => b['总分'] - a['总分'])
data.label.forEach(v => {
this.annualTableColumns.push({label: v, prop: v})
})
}).finally(() => {
this.tableLoading = false
})
},
getActivitys() {
return this.$axios.post(loc() + "/getActivitys", {year: this.pageForm.year}).then((resp) => {
const data = resp.data
this.pageForm = {
activityId: "",
status2: 9,
year: this.pageForm.year
}
this.activityList = data
})
},
changeActivit() {
return this.$axios.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId}).then((resp) => {
this.events = resp
})
},
},
created() {
this.searchOptions = this.Options
this.$businessTool.listUnion().then((unionList) => {
this.unionList = unionList
return this.getActivitys()
}).then(() => {
if (this.activityList.length) {
this.pageForm.activityId = this.activityList[0].id
}
setTimeout(() => {
this.searchClick(9)
}, 200)
})
},
})
</script>
<!--#
}
#-->
@@ -1346,7 +1346,7 @@ layout("/layouts/platform_leader_dashboard.html"){
class="staff-home-map-wrap" class="staff-home-map-wrap"
:class="{ 'staff-home-map-wrap-capture': coordinateMode }" :class="{ 'staff-home-map-wrap-capture': coordinateMode }"
@click="captureCoordinate"> @click="captureCoordinate">
<img class="staff-home-map" src="${base!}/assets/platform/images/careData/leader/staff-home-campus-map.png?v=20260527" alt=""> <img class="staff-home-map" src="${base!}/assets/platform/images/careData/leader/staff-home-campus-map.png?v=20260630_3" alt="">
<span <span
class="staff-home-marker" class="staff-home-marker"
v-for="item in littleHouses" v-for="item in littleHouses"
@@ -1603,18 +1603,11 @@ layout("/layouts/platform_leader_dashboard.html"){
} }
}, },
loadMemberOverviewData() { loadMemberOverviewData() {
Promise.all([ this.$axios.post("/platform/careData/leader/memberOverviewData").then(resp => {
this.$axios.post("/platform/member/info/board/memberNumber"), if (resp && resp.code === 0 && resp.data) {
this.$axios.post("/platform/member/info/board/memberSexPercentage") this.$set(this.memberOverview, "total", Number(resp.data.total || 0))
]).then(([numberResp, sexResp]) => { this.$set(this.memberOverview, "male", Number(resp.data.male || 0))
if (numberResp && numberResp.code === 0 && numberResp.data) { this.$set(this.memberOverview, "female", Number(resp.data.female || 0))
this.$set(this.memberOverview, "total", Number(numberResp.data.memberNum || 0))
}
if (sexResp && sexResp.code === 0 && Array.isArray(sexResp.data)) {
const maleRow = sexResp.data.find(item => this.isMaleMemberType(item && item.type)) || sexResp.data[0] || {}
const femaleRow = sexResp.data.find(item => this.isFemaleMemberType(item && item.type)) || sexResp.data[1] || {}
this.$set(this.memberOverview, "male", Number(maleRow.value || 0))
this.$set(this.memberOverview, "female", Number(femaleRow.value || 0))
} }
}).catch(() => {}) }).catch(() => {})
}, },
@@ -123,7 +123,7 @@ layout("/layouts/platform_leader_dashboard.html"){
<section class="staff-home-panel"> <section class="staff-home-panel">
<div class="staff-home-title">&#32844;&#24037;&#23567;&#23478;</div> <div class="staff-home-title">&#32844;&#24037;&#23567;&#23478;</div>
<div class="staff-home-map-wrap"> <div class="staff-home-map-wrap">
<img class="staff-home-map" src="${base!}/assets/platform/images/careData/leader/staff-home-campus-map.png?v=20260527" alt=""> <img class="staff-home-map" src="${base!}/assets/platform/images/careData/leader/staff-home-campus-map.png?v=20260630_3" alt="">
</div> </div>
</section> </section>
</main> </main>
@@ -226,12 +226,17 @@ layout("/layouts/platform.html"){
files: [{required: true, message: "必填", trigger: ["change", "blur"]}], files: [{required: true, message: "必填", trigger: ["change", "blur"]}],
signature: [{required: true, message: "必填", trigger: ["change", "blur"]}] signature: [{required: true, message: "必填", trigger: ["change", "blur"]}]
}, },
chooseType: {},
payUserOptions: [], payUserOptions: [],
helpUserOptions: [], helpUserOptions: [],
typeOptions: [] typeOptions: []
} }
}, },
computed: {
// 类型列表和申请详情独立加载,任一数据变化后重新匹配;未匹配时返回空对象,保证附件区域安全渲染。
chooseType() {
return this.typeOptions.find(o => o.id === this.formData.type) || {}
}
},
methods: { methods: {
createRemoteMethod(options) { createRemoteMethod(options) {
return (keyword) => { return (keyword) => {
@@ -267,10 +272,11 @@ layout("/layouts/platform.html"){
} }
}, },
typeChange(id) { typeChange(id) {
this.chooseType = this.typeOptions.find(o => o.id === id) // id 为用户选择的慰问类型 ID;仅匹配成功时更新金额和方式,详情回显时保留原申请值。
if (this.chooseType) { const type = this.typeOptions.find(o => o.id === id)
this.$set(this.formData, "money", this.chooseType.money) if (type) {
this.$set(this.formData, "way", this.chooseType.way) this.$set(this.formData, "money", type.money)
this.$set(this.formData, "way", type.way)
} }
}, },
onSave() { onSave() {
@@ -335,7 +341,6 @@ layout("/layouts/platform.html"){
this.formData = res.data this.formData = res.data
this.selectQueryUser(this.formData.helpLoginName, this.helpUserOptions) this.selectQueryUser(this.formData.helpLoginName, this.helpUserOptions)
this.selectQueryUser(this.formData.payLoginName, this.payUserOptions) this.selectQueryUser(this.formData.payLoginName, this.payUserOptions)
this.chooseType = this.typeOptions.find(o => o.id === this.formData.type)
} }
}) })
} else { } else {
@@ -352,9 +357,10 @@ layout("/layouts/platform.html"){
} }
}, },
queryCondolenceType() { queryCondolenceType() {
// 接口无需参数,返回 Resultcode 为 0 时 data 为启用类型数组,异常响应按空列表处理。
this.$axios.post("/platform/condolence/type/queryCondolenceType") this.$axios.post("/platform/condolence/type/queryCondolenceType")
.then((resp) => { .then((resp) => {
this.typeOptions = resp.data this.$set(this, "typeOptions", resp && resp.code === 0 && Array.isArray(resp.data) ? resp.data : [])
}) })
} }
}, },
@@ -13,7 +13,8 @@ layout("/layouts/platform.html"){
<el-radio-button label="false">未审核</el-radio-button> <el-radio-button label="false">未审核</el-radio-button>
</el-radio-group> </el-radio-group>
</table-tool> </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 <el-table-column
:index="indexMethod" :index="indexMethod"
align="center" align="center"
@@ -73,6 +74,10 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]"> :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea> <user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item> </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-form>
<el-row type="flex" justify="end"> <el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button> <el-button @click="$refs.guava.index()" size="small">取消</el-button>
@@ -102,11 +107,12 @@ layout("/layouts/platform.html"){
{ prop: "loginName", label: "工号", sortable: true }, { prop: "loginName", label: "工号", sortable: true },
{ prop: "userName", label: "姓名", sortable: true }, { prop: "userName", label: "姓名", sortable: true },
{ prop: "userState", label: "在职状态", sortable: true }, { prop: "userState", label: "在职状态", sortable: true },
{ prop: "personType", label: "教职工类别", sortable: true }, // { prop: "personType", label: "教职工类别", sortable: true },
{ prop: "preparedBy", label: "编制类别", sortable: true }, { prop: "nativePlace", label: "籍贯", sortable: true },
// { prop: "preparedBy", label: "编制类别", sortable: true },
{ prop: "unionName", label: "所属工会", sortable: true }, { prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true }, { prop: "unitName", label: "所属单位", sortable: true },
{ prop: "sign", label: "签字" }, // { prop: "sign", label: "签字" },
{ prop: "curTaskName", label: "当前节点" }, { prop: "curTaskName", label: "当前节点" },
{ prop: "instanceState", label: "流程状态" } { prop: "instanceState", label: "流程状态" }
], ],
@@ -115,22 +121,22 @@ layout("/layouts/platform.html"){
showApprovalForm: false, showApprovalForm: false,
formData: { formData: {
tf_opinion: "" tf_opinion: ""
}, }
} }
}, },
components: { components: {
'info': INFO, "info": INFO,
'common-query': COMMON_QUERY, "common-query": COMMON_QUERY
}, },
methods: { methods: {
openView(row) { openView(row) {
this.$refs.guava.edit(()=>{ this.$refs.guava.edit(() => {
this.showApprovalForm = false this.showApprovalForm = false
this.$refs.infoRef.onOpen(row) this.$refs.infoRef.onOpen(row)
}) })
}, },
openApproval(row) { openApproval(row) {
this.$refs.guava.edit(()=>{ this.$refs.guava.edit(() => {
this.showApprovalForm = true this.showApprovalForm = true
this.formData = { this.formData = {
processTaskId: row.taskId, processTaskId: row.taskId,
@@ -140,6 +146,8 @@ layout("/layouts/platform.html"){
}) })
}, },
handleTaskAction(val) { handleTaskAction(val) {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", { this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
@@ -161,6 +169,8 @@ layout("/layouts/platform.html"){
loading.close() loading.close()
}) })
}) })
}
})
}, },
openRevoke(row) { openRevoke(row) {
this.$confirm("您确定要撤回吗?", "提示", { this.$confirm("您确定要撤回吗?", "提示", {
@@ -169,22 +179,22 @@ layout("/layouts/platform.html"){
type: "info" type: "info"
}).then(() => { }).then(() => {
const loading = createLoading() const loading = createLoading()
this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then((res) => { this.$axios.post("/flow/common/revokeTask", { taskId: row.taskId }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success(res.msg) this.$message.success(res.msg)
this.doSearch() this.doSearch()
} }
}).finally(()=>{ }).finally(() => {
loading.close() loading.close()
}) })
}) })
}, },
search(pageForm){ search(pageForm) {
if (pageForm) { if (pageForm) {
this.pageForm = {...this.pageForm, ...pageForm} this.pageForm = { ...this.pageForm, ...pageForm }
} }
this.doSearch() this.doSearch()
}, }
}, },
created() { created() {
this.pageData() this.pageData()
@@ -62,7 +62,7 @@ const COMMON_QUERY = {
pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys) pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys)
this.$emit('search', pageForm) this.$emit('search', pageForm)
}, },
async initData(){ initData(){
if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])) { if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])) {
this.$businessTool.listUnion(this.pageForm.unionId).then((data) => { this.$businessTool.listUnion(this.pageForm.unionId).then((data) => {
this.unions = data this.unions = data
@@ -79,15 +79,17 @@ const COMMON_QUERY = {
}) })
} }
}, },
async flushUnits(){ flushUnits(){
this.$set(this.pageForm, "unitId", null) this.$set(this.pageForm, "unitId", null)
this.units = [] this.units = []
if (this.pageForm.unionId) { 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() this.initData()
} }
} }
@@ -16,21 +16,27 @@ const INFO = {
<el-descriptions-item label="学历">{{ viewData.education }}</el-descriptions-item> <el-descriptions-item label="学历">{{ viewData.education }}</el-descriptions-item>
<el-descriptions-item label="学位">{{ viewData.academicDegree }}</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.unitName }}</el-descriptions-item>
<el-descriptions-item label="所属工会">{{ viewData.unionName }}</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.idCard }}</el-descriptions-item>
<el-descriptions-item label="联系电话">{{ viewData.mobile }}</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 v-if="viewData.loginname == $store.state.user.loginname">
</template>
<el-descriptions-item label="家庭主要成员" :span="3"> <el-descriptions-item label="家庭主要成员" :span="3">
<el-table v-if="viewData.families&&viewData.families.length" <el-table v-if="viewData.families&&viewData.families.length"
:data="viewData.families" size="mini" border :data="viewData.families" size="mini" border
@@ -47,11 +53,20 @@ const INFO = {
</el-table> </el-table>
<el-empty v-else :image-size="50" description="暂无家庭成员信息"></el-empty> <el-empty v-else :image-size="50" description="暂无家庭成员信息"></el-empty>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="个人简况" :span="3"> <el-descriptions-item label="个人学习及工作经历" :span="3">
<div v-if="viewData.personalData" class="text-left" v-html="viewData.personalData"></div> <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-tag type="warning" v-else>暂无</el-tag>
</el-descriptions-item> </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-descriptions-item label="签字信息" :span="3" v-if="viewData.sign">
<el-image :src="viewData.sign" <el-image :src="viewData.sign"
@@ -91,7 +106,11 @@ const INFO = {
</template> </template>
<el-descriptions-item label="办理意见" :span="3" v-if="!task.ext.isFirstTaskNode">{{ <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-item>
</el-descriptions> </el-descriptions>
</div> </div>
@@ -111,8 +111,9 @@ const MEMBER_APPLY_AUDIT_INFO = {
} }
}, },
methods: { methods: {
async onOpen(id){ onOpen(id){
const resp = await $.post('/platform/member/apply/mine/findMemberApplyRecord', {id}) $.post("/platform/member/apply/mine/findMemberApplyRecord", {id})
.then((resp) => {
if (resp.code === 0) { if (resp.code === 0) {
this.viewData = resp.data this.viewData = resp.data
this.$emit('union-name', this.viewData.userUnionName) this.$emit('union-name', this.viewData.userUnionName)
@@ -122,6 +123,9 @@ const MEMBER_APPLY_AUDIT_INFO = {
this.viewData.families = [] this.viewData.families = []
} }
} }
})
.always(() => {
})
} }
} }
} }
@@ -42,12 +42,23 @@ layout("/layouts/platform.html"){
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message" <enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag> size="small"></enum-tag>
</template> </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>
<el-table-column label="操作" width="220" fixed="right"> <el-table-column label="操作" width="220" fixed="right">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary"> <el-button @click="openView(row)" size="mini" type="primary">
查看 查看
</el-button> </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" <el-button v-if="row.taskKey === 'startTask' || !row.instanceId"
@click="onEdit(row)" size="mini" type="primary"> @click="onEdit(row)" size="mini" type="primary">
编辑 编辑
@@ -85,11 +96,11 @@ layout("/layouts/platform.html"){
{ prop: "loginName", label: "工号", sortable: true }, { prop: "loginName", label: "工号", sortable: true },
{ prop: "userName", label: "姓名", sortable: true }, { prop: "userName", label: "姓名", sortable: true },
{ prop: "userState", label: "在职状态", sortable: true }, { prop: "userState", label: "在职状态", sortable: true },
{ prop: "personType", label: "教职工类别", sortable: true }, // { prop: "personType", label: "教职工类别", sortable: true },
{ prop: "preparedBy", label: "编制类别", sortable: true }, { prop: "nativePlace", label: "籍贯", sortable: true },
{ prop: "unionName", label: "所属工会", sortable: true }, { prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true }, { prop: "unitName", label: "所属单位", sortable: true },
{ prop: "sign", label: "签字" }, // { prop: "sign", label: "签字" },
{ prop: "taskName", label: "当前节点"}, { prop: "taskName", label: "当前节点"},
{ prop: "instanceState", label: "流程状态"} { prop: "instanceState", label: "流程状态"}
], ],
@@ -102,6 +113,9 @@ layout("/layouts/platform.html"){
'common-query': COMMON_QUERY, 'common-query': COMMON_QUERY,
}, },
methods: { methods: {
exportApplyDocx(id) {
this.$downLoad("/platform/member/apply/mine/exportApplyDocx", { id })
},
onApply() { onApply() {
commonUtil.pjaxPush('/platform/member/apply/submit') commonUtil.pjaxPush('/platform/member/apply/submit')
}, },
@@ -0,0 +1,114 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<common-query ref="commonQueryRef" @search="search"></common-query>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="申请列表"></table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id" style="width: 100%">
<el-table-column
:index="indexMethod"
align="center"
header-align="center"
label="序号"
type="index"
width="80px"
></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
header-align="center"
min-width="100px"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='loginName'">
<el-link @click="openView(row)" type="primary">{{row.loginName}}</el-link>
</template>
<template scope="{row}" v-else-if="column.prop=='instanceState'">
<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 @click="exportApplyDocx(row.id)" size="mini" type="primary">
导出申请表
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #view>
<info ref="info"></info>
</template>
</guava>
</div>
<script nonce="${cspNonce!}">
<!--#include("../common/info.js"){}#-->
<!--#include("../common/commonQuery.js"){}#-->
new Vue({
el: "#app",
store,
mixins: [initTableMixins],
data() {
return {
tableColumns: [
{ prop: "loginName", label: "工号", sortable: true },
{ prop: "userName", label: "姓名", sortable: true },
{ prop: "userState", label: "在职状态", sortable: true },
{ prop: "nativePlace", label: "籍贯", sortable: true },
{ prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true },
{ prop: "instanceState", label: "流程状态" }
]
}
},
components: {
"info": INFO,
"common-query": COMMON_QUERY
},
methods: {
exportApplyDocx(id) {
this.$downLoad("/platform/member/apply/query/exportApplyDocx", { id: id })
},
openView(row) {
this.$refs.guava.view(() => {
this.$refs.info.onOpen(row)
})
},
search(pageForm) {
if (pageForm) {
this.pageForm = Object.assign({}, this.pageForm, pageForm)
}
this.doSearch()
}
},
created() {
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -14,7 +14,8 @@ layout("/layouts/platform.html"){
<el-radio-button label="false">未审核</el-radio-button> <el-radio-button label="false">未审核</el-radio-button>
</el-radio-group> </el-radio-group>
</table-tool> </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 <el-table-column
:index="indexMethod" :index="indexMethod"
align="center" 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 v-if="row.taskState === 10" @click="openApproval(row)" size="mini" type="primary">
审核 审核
</el-button> </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> </el-button>
</template> </template>
@@ -91,6 +92,10 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]"> :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea> <user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item> </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-form>
<el-row type="flex" justify="end"> <el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button> <el-button @click="$refs.guava.index()" size="small">取消</el-button>
@@ -120,11 +125,12 @@ layout("/layouts/platform.html"){
{ prop: "loginName", label: "工号", sortable: true }, { prop: "loginName", label: "工号", sortable: true },
{ prop: "userName", label: "姓名", sortable: true }, { prop: "userName", label: "姓名", sortable: true },
{ prop: "userState", label: "在职状态", sortable: true }, { prop: "userState", label: "在职状态", sortable: true },
{ prop: "personType", label: "教职工类别", sortable: true }, { prop: "nativePlace", label: "籍贯", sortable: true },
{ prop: "preparedBy", label: "编制类别", sortable: true }, // { prop: "personType", label: "教职工类别", sortable: true },
// { prop: "preparedBy", label: "编制类别", sortable: true },
{ prop: "unionName", label: "所属工会", sortable: true }, { prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true }, { prop: "unitName", label: "所属单位", sortable: true },
{ prop: "sign", label: "签字" }, // { prop: "sign", label: "签字" },
{ prop: "curTaskName", label: "当前节点" }, { prop: "curTaskName", label: "当前节点" },
{ prop: "instanceState", label: "流程状态" } { prop: "instanceState", label: "流程状态" }
], ],
@@ -134,22 +140,22 @@ layout("/layouts/platform.html"){
formData: { formData: {
tf_opinion: "" tf_opinion: ""
}, },
unions: [], unions: []
} }
}, },
components: { components: {
'info': INFO, "info": INFO,
'common-query': COMMON_QUERY, "common-query": COMMON_QUERY
}, },
methods: { methods: {
openView(row) { openView(row) {
this.$refs.guava.edit(()=>{ this.$refs.guava.edit(() => {
this.showApprovalForm = false this.showApprovalForm = false
this.$refs.infoRef.onOpen(row) this.$refs.infoRef.onOpen(row)
}) })
}, },
openApproval(row) { openApproval(row) {
this.$refs.guava.edit(()=>{ this.$refs.guava.edit(() => {
this.showApprovalForm = true this.showApprovalForm = true
this.formData = { this.formData = {
origin: row.origin, origin: row.origin,
@@ -163,6 +169,8 @@ layout("/layouts/platform.html"){
}) })
}, },
handleTaskAction(val) { handleTaskAction(val) {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", { this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
@@ -184,6 +192,8 @@ layout("/layouts/platform.html"){
loading.close() loading.close()
}) })
}) })
}
})
}, },
openRevoke(taskId) { openRevoke(taskId) {
this.$confirm("您确定要撤回吗?", "提示", { this.$confirm("您确定要撤回吗?", "提示", {
@@ -202,9 +212,9 @@ layout("/layouts/platform.html"){
}) })
}) })
}, },
search(pageForm){ search(pageForm) {
if (pageForm) { if (pageForm) {
this.pageForm = {...this.pageForm, ...pageForm} this.pageForm = { ...this.pageForm, ...pageForm }
} }
this.doSearch() this.doSearch()
}, },
@@ -212,7 +222,7 @@ layout("/layouts/platform.html"){
assignmentUnionName(val) { assignmentUnionName(val) {
const union = this.unions.find(item => item.id === val) const union = this.unions.find(item => item.id === val)
this.$set(this.formData, "tf_allocation_unionName", union.name) this.$set(this.formData, "tf_allocation_unionName", union.name)
}, }
}, },
created() { created() {
this.pageData() this.pageData()
@@ -174,12 +174,7 @@
v-model="formData.isVoluntary"> v-model="formData.isVoluntary">
<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>
<div>
<span style="flex: 1; word-wrap: break-word; word-break: break-all; white-space: normal;">
我将严格遵守工会章程,认真执行工会决议,积极参与工会活动,主动融入“学校健康幸福家”建设,为营造温暖、和谐、奋进的校园氛围贡献力量,以实际行动助力学校各项事业发展。
</span> </span>
</div> </div>
</el-checkbox> </el-checkbox>
@@ -367,26 +362,83 @@
handleCancel() { handleCancel() {
}, },
async validateApply() { validateApply() {
if (this.formData.id) { if (this.formData.id) {
return 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 let user
const resp = await $.post('/platform/member/apply/submit/getSelfUserInfo') $.post("/platform/member/apply/submit/getSelfUserInfo", {})
if (resp.code === 0) { .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) { if (!resp.data) {
user = this.$store.state.user user = this.$store.state.user
} else { } else {
@@ -455,12 +507,15 @@
this.$set(this.formData, "families", families ? families : []) this.$set(this.formData, "families", families ? families : [])
this.$set(this.formData, "personalData", personalData) this.$set(this.formData, "personalData", personalData)
} }
*/
}, },
}, },
async created() { created() {
this.init() this.init()
this.units = await this.$businessTool.listUnit() this.$businessTool.listUnit().then((data) => {
await this.validateApply() this.units = data
})
this.validateApply()
} }
}) })
</script> </script>
@@ -4,7 +4,8 @@ layout("/layouts/platform.html"){
<div id="app" v-cloak> <div id="app" v-cloak>
<el-card shadow="never"> <el-card shadow="never">
<snaker-start slot="header" label="入会申请" define_key="HYRH"></snaker-start> <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 :column="3" border>
<el-descriptions-item label="工号"> <el-descriptions-item label="工号">
<el-form-item prop="loginname"> <el-form-item prop="loginname">
@@ -19,8 +20,8 @@ layout("/layouts/platform.html"){
<el-descriptions-item label="性别"> <el-descriptions-item label="性别">
<el-form-item prop="sex"> <el-form-item prop="sex">
<el-radio-group v-model="formData.sex" size="small"> <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-radio-group>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
@@ -59,9 +60,9 @@ layout("/layouts/platform.html"){
code="USER_ACADEMIC_DEGREE"></dict-select> code="USER_ACADEMIC_DEGREE"></dict-select>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="党政职务"> <el-descriptions-item label="籍贯">
<el-form-item prop="position"> <el-form-item prop="nativePlace">
<el-input v-model="formData.position" placeholder="请输入党政职务" <el-input v-model="formData.nativePlace" placeholder="请输入籍贯"
maxlength="50"></el-input> maxlength="50"></el-input>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
@@ -81,49 +82,69 @@ layout("/layouts/platform.html"){
<el-input v-model="formData.unionName" disabled placeholder="请输入所属工会"></el-input> <el-input v-model="formData.unionName" disabled placeholder="请输入所属工会"></el-input>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="所属校区"> <!-- <el-descriptions-item label="所属校区">
<el-form-item prop="campus"> <el-form-item prop="campus">
<dict-select style="width: 100%" placeholder="请选择所属校区" v-model="formData.campus" <dict-select style="width: 100%" placeholder="请选择所属校区" v-model="formData.campus"
code="USER_CAMPUS"></dict-select> code="USER_CAMPUS"></dict-select>
</el-form-item> </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>
<!-- <el-descriptions-item label="在职状态">
<el-descriptions-item label="在职状态">
<el-form-item prop="userState"> <el-form-item prop="userState">
<dict-select v-model="formData.userState" code="USER_STATE" <dict-select v-model="formData.userState" code="USER_STATE"
disabled style="width: 100%"></dict-select> disabled style="width: 100%"></dict-select>
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>-->
<el-descriptions-item label="教职工类别"> <!--<el-descriptions-item label="教职工类别">
<el-form-item prop="personType"> <el-form-item prop="personType">
<dict-select v-model="formData.personType" code="USER_PERSON_TYPE" <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-form-item>
</el-descriptions-item> </el-descriptions-item>-->
<el-descriptions-item label="编制类别"> <!--<el-descriptions-item label="编制类别">
<el-form-item prop="preparedBy"> <el-form-item prop="preparedBy">
<dict-select v-model="formData.preparedBy" code="USER_PREPARED_BY_TYPE" <dict-select v-model="formData.preparedBy" code="USER_PREPARED_BY_TYPE"
disabled style="width: 100%"></dict-select> disabled style="width: 100%"></dict-select>
</el-form-item> </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>
<el-descriptions-item label="身份证号码"> <el-descriptions-item label="身份证号码">
<el-form-item prop="idCard"> <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-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="联系电话"> <el-descriptions-item label="联系电话">
<el-form-item prop="mobile"> <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-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="电子邮箱"> <el-descriptions-item label="入职时间">
<el-form-item prop="email"> <el-form-item prop="arrivalAtSchoolDate">
<el-input v-model="formData.email" placeholder="请输入电子邮箱" maxlength="50"></el-input> <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-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="家庭主要成员" :span="3"> <el-descriptions-item label="家庭主要成员" :span="3">
<el-form-item prop="families"> <el-form-item prop="families">
@@ -170,9 +191,36 @@ layout("/layouts/platform.html"){
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="个人简况" :span="3"> <el-descriptions-item label="个人学习及工作经历" :span="3">
<el-form-item prop="personalData"> <el-form-item prop="personalData" label="个人学习及工作经历">
<text-editor v-model="formData.personalData"></text-editor> <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-form-item>
</el-descriptions-item> </el-descriptions-item>
@@ -182,30 +230,25 @@ layout("/layouts/platform.html"){
size="medium" size="medium"
style="width: 95%; color: #F56C6C; display: flex; align-items: center;" style="width: 95%; color: #F56C6C; display: flex; align-items: center;"
v-model="formData.isVoluntary"> v-model="formData.isVoluntary">
<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>
<div>
<span style="flex: 1; word-wrap: break-word; word-break: break-all; white-space: normal;">
我将严格遵守工会章程,认真执行工会决议,积极参与工会活动,主动融入“学校健康幸福家”建设,为营造温暖、和谐、奋进的校园氛围贡献力量,以实际行动助力学校各项事业发展。
</span> </span>
</div> </div>
</el-checkbox> </el-checkbox>
</el-form-item> </el-form-item>
</el-descriptions-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-descriptions>
</el-form> </el-form>
<el-row type="flex" justify="end" class="mt20"> <el-row type="flex" justify="end" class="mt20">
<el-button type="primary" plain @click="onSave">保存</el-button> <el-button type="primary" plain @click="onSave" v-if="!taskId"
<el-button type="primary" @click="onSubmit" v-if="!taskId">提交</el-button> :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-button type="primary" @click="onFinishTask" v-else>提交</el-button>
</el-row> </el-row>
</el-card> </el-card>
@@ -224,11 +267,42 @@ layout("/layouts/platform.html"){
formData: { formData: {
families: [] families: []
}, },
canApply: true,
applyDisableMsg: '',
formRules: { formRules: {
username: [{required: false, message: "必填", trigger: ["change", "blur"]}], username: [{ required: false, message: "必填", trigger: ["change", "blur"] }],
sex: [{required: false, message: "必填", trigger: ["change", "blur"]}], sex: [{ required: false, message: "必填", trigger: ["change", "blur"] }],
isVoluntary: [{required: true, message: "必填", trigger: ["change", "blur"]}], isVoluntary: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
sign: [{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: [ /*email: [
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
@@ -289,10 +363,27 @@ layout("/layouts/platform.html"){
trigger: ["change", "blur"] trigger: ["change", "blur"]
} }
]*/ ]*/
}, }
} }
}, },
methods: { 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() { onSave() {
this.$confirm("您确定保存吗?", "提示", { this.$confirm("您确定保存吗?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
@@ -300,10 +391,10 @@ layout("/layouts/platform.html"){
type: "warning" type: "warning"
}).then(() => { }).then(() => {
const loading = createLoading() 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) { if (res.code === 0) {
this.$message.success(res.msg) this.$message.success(res.msg)
commonUtil.pjaxPush('/platform/member/apply/mine') commonUtil.pjaxPush("/platform/member/apply/mine")
} }
}).finally(() => { }).finally(() => {
loading.close() loading.close()
@@ -319,12 +410,12 @@ layout("/layouts/platform.html"){
type: "warning" type: "warning"
}).then(() => { }).then(() => {
const loading = createLoading() const loading = createLoading()
this.$axios.post('/platform/member/apply/submit/submit', { this.$axios.post("/platform/member/apply/submit/submit", {
data: JSON.stringify(this.formData) data: JSON.stringify(this.formData)
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success(res.msg) this.$message.success(res.msg)
commonUtil.pjaxPush('/platform/member/apply/mine') commonUtil.pjaxPush("/platform/member/apply/mine")
} }
}).finally(() => { }).finally(() => {
loading.close() loading.close()
@@ -334,45 +425,46 @@ layout("/layouts/platform.html"){
}) })
}, },
onFinishTask() { onFinishTask() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", { this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(() => { }).then(() => {
const loading = createLoading() const loading = createLoading()
this.$axios.post('/platform/member/apply/submit/submitAgain', { this.$axios.post("/platform/member/apply/submit/submitAgain", {
data: JSON.stringify(this.formData), data: JSON.stringify(this.formData),
taskId: this.taskId, taskId: this.taskId
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success(res.msg) this.$message.success(res.msg)
commonUtil.pjaxPush('/platform/member/apply/mine') commonUtil.pjaxPush("/platform/member/apply/mine")
} }
}).finally(() => { }).finally(() => {
loading.close() loading.close()
}) })
}) })
}
})
}, },
async init() { init() {
let user let user
const resp = await $.post('/platform/member/apply/submit/getSelfUserInfo') $.post("/platform/member/apply/submit/getSelfUserInfo", {})
if (resp.code === 0) { .then((resp) => {
if (!resp.data) { if (resp.code === 0 && resp.data) {
user = this.$store.state.user
} else {
user = resp.data user = resp.data
}
} else { } else {
user = this.$store.state.user user = this.$store.state.user
} }
if (this.id) { if (this.id) {
const res = await this.$axios.post("/platform/member/apply/submit/findApplyById", { id: this.id }) this.$axios.post("/platform/member/apply/submit/findApplyById", { id: this.id }).then((res) => {
debugger
if (res.code === 0) { if (res.code === 0) {
this.formData = res.data this.formData = res.data
} }
} else { })
return
}
const { const {
id, id,
username, username,
@@ -383,6 +475,7 @@ layout("/layouts/platform.html"){
political, political,
education, education,
academicDegree, academicDegree,
arrivalAtSchoolDate,
position, position,
unitId, unitId,
unitName, unitName,
@@ -425,9 +518,13 @@ layout("/layouts/platform.html"){
this.$set(this.formData, "email", email) this.$set(this.formData, "email", email)
this.$set(this.formData, "families", families ? families : []) this.$set(this.formData, "families", families ? families : [])
this.$set(this.formData, "personalData", personalData) this.$set(this.formData, "personalData", personalData)
this.$set(this.formData, "arrivalAtSchoolDate", arrivalAtSchoolDate ? this.$moment(arrivalAtSchoolDate).format('YYYY-MM-DD') : "")
this.checkApplyPermission()
})
.always(() => {
})
} }
}, },
},
created() { created() {
this.init() this.init()
this.$businessTool.listUnit().then((data) => { this.$businessTool.listUnit().then((data) => {
@@ -0,0 +1,306 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<search @search="doSearch">
<search-item label="姓名/工号">
<el-input v-model="pageForm.searchKeyword" clearable placeholder="请输入姓名或工号"></el-input>
</search-item>
<search-item label="所属工会">
<el-select
v-model="pageForm.unionId"
:disabled="$auth.hasRole('BRANCH_UNION_CHAIRMAN')"
@change="flushUnits"
@clear="flushUnits"
clearable
collapse-tags
filterable
multiple
placeholder="请选择所属工会"
style="width: 100%">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unions"></el-option>
</el-select>
</search-item>
<search-item label="所属单位">
<el-select
v-model="pageForm.unitId"
clearable
collapse-tags
filterable
multiple
placeholder="请选择所属单位"
style="width: 100%">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in units"></el-option>
</el-select>
</search-item>
<search-item label="在职状态">
<dict-select
v-model="pageForm.userStates"
code="USER_STATE"
collapse-tags
multiple
placeholder="请选择在职状态"></dict-select>
</search-item>
<search-item label="教职工类别">
<dict-select
v-model="pageForm.personTypes"
code="USER_PERSON_TYPE"
collapse-tags
multiple
placeholder="请选择教职工类别"></dict-select>
</search-item>
<search-item label="流程状态">
<el-select
v-model="pageForm.instanceStates"
clearable
collapse-tags
filterable
multiple
placeholder="请选择流程状态"
style="width: 100%">
<el-option :key="item.value" :label="item.label" :value="item.value" v-for="item in instanceStateOptions"></el-option>
</el-select>
</search-item>
<search-item label="申请时间">
<el-date-picker
v-model="pageForm.applyDateRange"
clearable
end-placeholder="结束日期"
range-separator="至"
start-placeholder="开始日期"
style="width: 100%"
type="daterange"
value-format="yyyy-MM-dd"></el-date-picker>
</search-item>
</search>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="会员申请记录统计">
<el-button icon="el-icon-printer" type="primary" size="small" @click="doExport">导出</el-button>
<el-popover placement="bottom" trigger="click" width="220">
<div style="padding:4px 0;border-bottom:1px solid #eee;">
<el-button size="mini" @click="checkAll">全选</el-button>
<el-button size="mini" @click="invertCheck">反选</el-button>
</div>
<div style="max-height:40vh;overflow-y:auto;padding:6px 0;">
<el-checkbox-group v-model="checkedFields">
<el-checkbox
:key="column.prop"
:label="column.prop"
style="display:block;margin:6px 0;"
v-for="column in tableColumns">
{{ column.label }}
</el-checkbox>
</el-checkbox-group>
</div>
<el-button slot="reference" type="text" icon="el-icon-s-operation" size="small" style="margin-left:12px;">
列设置
</el-button>
</el-popover>
</table-tool>
<el-table
:data="tableData"
:header-cell-style="{background:'#FAFAFA'}"
@sort-change="pageOrder"
border
row-key="id"
stripe
style="width: 100%"
v-loading="tableLoading">
<el-table-column
:index="indexMethod"
align="center"
fixed="left"
header-align="center"
label="序号"
type="index"
width="80px"></el-table-column>
<el-table-column
:fixed="column.fixed"
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
min-width="120px"
show-overflow-tooltip
v-for="column in showColumns">
<template scope="{row}" v-if="column.prop === 'loginName'">
<el-link @click="openView(row)" type="primary">{{ row.loginName }}</el-link>
</template>
<template scope="{row}" v-else-if="column.prop === 'applyDateTime'">
{{ row.applyDateTime ? $moment(row.applyDateTime).format("YYYY-MM-DD HH:mm") : "" }}
</template>
<template scope="{row}" v-else-if="column.prop === 'signState'">
<el-tag :type="row.signState === '已签字' ? 'success' : 'warning'" size="small">{{ row.signState }}</el-tag>
</template>
<template scope="{row}" v-else-if="column.prop === 'instanceState'">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message" size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column align="center" fixed="right" header-align="center" label="操作" width="100px">
<template scope="{row}">
<el-button size="mini" type="primary" @click="openView(row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #view>
<info ref="infoRef"></info>
</template>
</guava>
</div>
<script nonce="${cspNonce!}">
<!--#include("../../apply/common/info.js"){}#-->
new Vue({
el: "#app",
store,
mixins: [initTableMixins],
data() {
return {
pageForm: {
searchKeyword: "",
unionId: [],
unitId: [],
userStates: [],
personTypes: [],
instanceStates: [],
applyDateRange: []
},
unions: [],
units: [],
checkedFields: [],
instanceStateOptions: [
{ label: "进行中", value: 10 },
{ label: "已完成", value: 20 },
{ label: "已撤回", value: 30 },
{ label: "强行终止", value: 40 },
{ label: "已拒绝", value: 45 },
{ label: "挂起", value: 50 },
{ label: "已废弃", value: 99 }
],
tableColumns: [
{ prop: "loginName", label: "工号", width: 120, fixed: "left", sortable: true },
{ prop: "userName", label: "姓名", width: 120, fixed: "left", sortable: true },
{ prop: "unionName", label: "所属工会", width: 160, sortable: true },
{ prop: "unitName", label: "所属单位", width: 180, sortable: true },
{ prop: "userState", label: "在职状态", width: 120, sortable: true },
{ prop: "personType", label: "教职工类别", width: 140, sortable: true },
{ prop: "applyDateTime", label: "申请时间", width: 160, sortable: true },
{ prop: "signState", label: "签字状态", width: 110 },
{ prop: "curTaskName", label: "当前节点", width: 160 },
{ prop: "instanceState", label: "流程状态", width: 120, sortable: true, exportProp: "instanceStateName" }
]
}
},
components: {
"info": INFO
},
computed: {
showColumns() {
return this.tableColumns.filter(column => this.checkedFields.includes(column.prop))
}
},
methods: {
openView(row) {
this.$refs.guava.view(() => {
this.$refs.infoRef.onOpen(row)
})
},
buildRequestForm() {
const pageForm = clone(this.pageForm)
pageForm.unionId = JSON.stringify(this.pageForm.unionId)
pageForm.unitId = JSON.stringify(this.pageForm.unitId)
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
pageForm.instanceStates = JSON.stringify(this.pageForm.instanceStates)
if (this.pageForm.applyDateRange && this.pageForm.applyDateRange.length > 0) {
pageForm.startApplyDate = this.pageForm.applyDateRange[0]
pageForm.endApplyDate = this.pageForm.applyDateRange[1]
} else {
pageForm.startApplyDate = ""
pageForm.endApplyDate = ""
}
return pageForm
},
pageData() {
const pageForm = this.buildRequestForm()
this.tableLoading = true
this.$axios.post("/platform/member/apply/statistics/pageData", pageForm).then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
} else {
this.$message.error(res.msg)
}
}).finally(() => {
this.tableLoading = false
})
},
doExport() {
const pageForm = this.buildRequestForm()
const columns = this.tableColumns.filter(column => this.checkedFields.includes(column.prop)).map(column => {
return {
prop: column.exportProp ? column.exportProp : column.prop,
label: column.label
}
})
pageForm.columns = JSON.stringify(columns)
this.$downLoad("/platform/member/apply/statistics/doExport", pageForm)
},
checkAll() {
this.checkedFields = this.tableColumns.map(column => column.prop)
},
invertCheck() {
const allFields = this.tableColumns.map(column => column.prop)
this.checkedFields = allFields.filter(prop => !this.checkedFields.includes(prop))
},
flushUnits() {
this.$set(this.pageForm, "unitId", [])
this.units = []
if (this.pageForm.unionId && this.pageForm.unionId.length === 1) {
this.$businessTool.listUnit(this.pageForm.unionId[0]).then((data) => {
this.units = data
})
} else {
this.$businessTool.listUnit().then((data) => {
this.units = data
})
}
},
initQueryOptions() {
if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_MEMBER_ADMIN", "SCHOOL_UNION_ADMIN"])) {
this.$businessTool.listUnion().then((data) => {
this.unions = data
})
this.$businessTool.listUnit().then((data) => {
this.units = data
})
} else if (this.$auth.hasRole("BRANCH_UNION_CHAIRMAN")) {
this.$set(this.pageForm, "unionId", [this.$store.state.user.union.id])
this.$businessTool.listUnion(this.$store.state.user.union.id).then((data) => {
this.unions = data
})
this.$businessTool.listUnit(this.$store.state.user.union.id).then((data) => {
this.units = data
})
}
}
},
created() {
this.checkedFields = this.tableColumns.map(column => column.prop)
this.initQueryOptions()
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -736,6 +736,17 @@ layout("/layouts/platform_h5.html"){
const identity = this.reimbursementIdentityOption.find((item) => item.code === this.formData.reimbursementIdentity) const identity = this.reimbursementIdentityOption.find((item) => item.code === this.formData.reimbursementIdentity)
if (identity) { if (identity) {
this.$set(this.formData, 'reimbursementIdentityName', identity.name) this.$set(this.formData, 'reimbursementIdentityName', identity.name)
} else {
const identityNameMap = {
school: '校工会',
union: '分工会',
club: '协会'
}
this.$set(this.formData, 'reimbursementIdentityName', identityNameMap[this.formData.reimbursementIdentity] || '')
}
const club = this.clubOption.find((item) => item.id === this.formData.clubId)
if (club) {
this.$set(this.formData, 'clubName', club.clubName)
} }
}, },
fillCurrentUser() { fillCurrentUser() {
@@ -34,10 +34,10 @@ layout("/layouts/platform_h5.html"){
readonly readonly
:rules="[{ required: true }]" :rules="[{ required: true }]"
placeholder="请点击选择慰问对象" placeholder="请点击选择慰问对象"
@click="helpUserSelectShow = true" @click="openUserSelect('help')"
is-link is-link
></van-field> ></van-field>
<van-action-sheet v-model="helpUserSelectShow" title="慰问对象" class="height100"> <van-action-sheet v-model="helpUserSelectShow" @close="resetUserSearch" title="慰问对象" class="height100">
<van-search <van-search
v-model="searchKeyword" v-model="searchKeyword"
:show-action="false" :show-action="false"
@@ -65,12 +65,13 @@ layout("/layouts/platform_h5.html"){
name="payUserName" name="payUserName"
label="收款人" label="收款人"
required required
readonly
:rules="[{ required: true }]" :rules="[{ required: true }]"
placeholder="请点击选择收款人" placeholder="请点击选择收款人"
@click="payUserSelectShow = true" @click="openUserSelect('pay')"
is-link is-link
></van-field> ></van-field>
<van-action-sheet v-model="payUserSelectShow" title="收款人" class="height100"> <van-action-sheet v-model="payUserSelectShow" @close="resetUserSearch" title="收款人" class="height100">
<van-search <van-search
v-model="searchKeyword" v-model="searchKeyword"
:show-action="false" :show-action="false"
@@ -101,12 +102,12 @@ layout("/layouts/platform_h5.html"){
readonly readonly
:rules="[{ required: true }]" :rules="[{ required: true }]"
placeholder="请点击选择慰问类型" placeholder="请点击选择慰问类型"
@click="showTypePicker = true" @click="this.$set(this, 'showTypePicker', true)"
clickable clickable
is-link is-link
></van-field> ></van-field>
<van-popup position="bottom" round v-model:show="showTypePicker"> <van-popup position="bottom" round v-model:show="showTypePicker">
<van-picker :columns="typeColumns" @cancel="showTypePicker = false" @confirm="onTypeConfirm" show-toolbar></van-picker> <van-picker :columns="typeColumns" @cancel="this.$set(this, 'showTypePicker', false)" @confirm="onTypeConfirm" show-toolbar></van-picker>
</van-popup> </van-popup>
<van-field <van-field
@@ -140,15 +141,15 @@ layout("/layouts/platform_h5.html"){
clickable clickable
is-link is-link
readonly readonly
@click="showTimePicker = true" @click="openTimePicker"
></van-field> ></van-field>
<van-popup position="bottom" round v-model:show="showTimePicker"> <van-popup position="bottom" round v-model:show="showTimePicker">
<van-datetime-picker <van-datetime-picker
v-model="formData.occurTime" v-model="timePickerValue"
type="date" type="date"
title="请选择慰问时间" title="请选择慰问时间"
@confirm="(val) => {formData.occurTime = $moment(val).format('YYYY-MM-DD'); showTimePicker = false}" @confirm="onTimeConfirm"
@cancel="showTimePicker = false" @cancel="this.$set(this, 'showTimePicker', false)"
></van-datetime-picker> ></van-datetime-picker>
</van-popup> </van-popup>
@@ -163,15 +164,15 @@ layout("/layouts/platform_h5.html"){
clickable clickable
is-link is-link
readonly readonly
@click="showChildPicker = true" @click="this.$set(this, 'showChildPicker', true)"
></van-field> ></van-field>
<van-popup position="bottom" round v-model:show="showChildPicker"> <van-popup position="bottom" round v-model:show="showChildPicker">
<van-picker <van-picker
title="请选择孩次" title="请选择孩次"
show-toolbar show-toolbar
:columns="['一孩', '二孩', '三孩']" :columns="['一孩', '二孩', '三孩']"
@confirm="(val) => {formData.child = val; showChildPicker = false}" @confirm="(val) => {this.$set(formData, 'child', val); this.$set(this, 'showChildPicker', false)}"
@cancel="showChildPicker = false" @cancel="this.$set(this, 'showChildPicker', false)"
></van-picker> ></van-picker>
</van-popup> </van-popup>
@@ -223,15 +224,15 @@ layout("/layouts/platform_h5.html"){
clickable clickable
is-link is-link
readonly readonly
@click="showFamilyPicker = true" @click="this.$set(this, 'showFamilyPicker', true)"
></van-field> ></van-field>
<van-popup position="bottom" round v-model:show="showFamilyPicker"> <van-popup position="bottom" round v-model:show="showFamilyPicker">
<van-picker <van-picker
title="请选择直系亲属" title="请选择直系亲属"
show-toolbar show-toolbar
:columns="['配偶', '父亲', '母亲', '子女']" :columns="['配偶', '父亲', '母亲', '子女']"
@confirm="(val) => {formData.deadImmediateFamily = val; showFamilyPicker = false}" @confirm="(val) => {this.$set(formData, 'deadImmediateFamily', val); this.$set(this, 'showFamilyPicker', false)}"
@cancel="showFamilyPicker = false" @cancel="this.$set(this, 'showFamilyPicker', false)"
></van-picker> ></van-picker>
</van-popup> </van-popup>
@@ -255,7 +256,7 @@ layout("/layouts/platform_h5.html"){
{{ '(附件说明:' + chooseType.uploadFileDesc + '' }} {{ '(附件说明:' + chooseType.uploadFileDesc + '' }}
</span> </span>
</template> </template>
<van-field class="direction-column-field" name="avatar" label=""> <van-field class="direction-column-field" name="files" label="" :rules="[{ validator: validateFiles, message: '请上传附件' }]">
<template #input> <template #input>
<h5-file-upload <h5-file-upload
slot="input" slot="input"
@@ -269,7 +270,7 @@ layout("/layouts/platform_h5.html"){
</van-cell-group> </van-cell-group>
<van-cell-group title="签字" class="form-section"> <van-cell-group title="签字" class="form-section">
<van-field class="direction-column-field" name="signature" label=""> <van-field class="direction-column-field" name="signature" label="" :rules="[{ validator: validateSignature, message: '请完成签字' }]">
<template #input> <template #input>
<h5-signature v-model="formData.signature" slot="input"></h5-signature> <h5-signature v-model="formData.signature" slot="input"></h5-signature>
</template> </template>
@@ -278,9 +279,9 @@ layout("/layouts/platform_h5.html"){
<!-- 提交按钮 --> <!-- 提交按钮 -->
<div class="form-actions"> <div class="form-actions">
<van-button native-type="button" @click="onSave" round type="info" plain>保存申请</van-button> <van-button native-type="button" @click="onSave" :loading="formLoading" :disabled="formLoading" round type="info" plain>保存申请</van-button>
<van-button @click="onSubmit" round type="info" v-if="!taskId">提交申请</van-button> <van-button native-type="button" @click="onSubmit" :loading="formLoading" :disabled="formLoading" round type="info" v-if="!taskId">提交申请</van-button>
<van-button @click="onFinishTask" round type="info" v-else>提交申请</van-button> <van-button native-type="button" @click="onFinishTask" :loading="formLoading" :disabled="formLoading" round type="info" v-else>提交申请</van-button>
</div> </div>
</van-form> </van-form>
</div> </div>
@@ -296,7 +297,8 @@ layout("/layouts/platform_h5.html"){
taskId: GetQueryString("taskId"), taskId: GetQueryString("taskId"),
formData: {}, formData: {},
chooseType: {}, formLoading: false,
userSearchSequence: 0,
userOptions: [], userOptions: [],
typeOptions: [], typeOptions: [],
@@ -307,20 +309,64 @@ layout("/layouts/platform_h5.html"){
searchKeyword: '', searchKeyword: '',
showTimePicker: false, showTimePicker: false,
timePickerValue: new Date(),
showChildPicker: false, showChildPicker: false,
showFamilyPicker: false, showFamilyPicker: false,
} }
}, },
methods: { computed: {
async userRemoteMethod(event, type) { // 详情和类型列表任意顺序返回都重新匹配;未匹配时保证附件区域可安全读取属性。
if (event) { chooseType() {
this.userOptions = await this.selectQueryUser(event) return this.typeOptions.find(o => o.id === this.formData.type) || {}
type === 'help' ? this.helpUserSelectShow = true : this.payUserSelectShow = true
} }
}, },
async selectQueryUser(keyword) { methods: {
const res = await this.$axios.post("/platform/condolence/apply/listUser", { keyword: keyword }) // 打开人员选择时清除上次搜索,并使之前尚未返回的请求失效。
return res.data openUserSelect(type) {
this.resetUserSearch()
this.$set(this, type === 'help' ? 'helpUserSelectShow' : 'payUserSelectShow', true)
},
resetUserSearch() {
this.userSearchSequence++
this.searchKeyword = ''
this.userOptions = []
},
// keyword 为姓名或工号,type 为 help/pay;只接收最新请求且对应弹框仍打开的结果。
userRemoteMethod(keyword, type) {
const sequence = ++this.userSearchSequence
this.userOptions = []
if (!keyword || !keyword.trim()) return
return this.selectQueryUser(keyword).then((users) => {
const visible = type === 'help' ? this.helpUserSelectShow : this.payUserSelectShow
if (sequence === this.userSearchSequence && visible) this.userOptions = users
}).catch(() => {
// 查询失败保留空结果,后续输入仍可重新查询。
})
},
// keyword 传姓名或工号;返回 Promise<Array>,数组项包含人员 ID、姓名、工号及单位工会信息。
selectQueryUser(keyword) {
return this.$axios.post("/platform/condolence/apply/listUser", { keyword: keyword })
.then((res) => res && res.code === 0 && Array.isArray(res.data) ? res.data : [])
},
// 选择器使用独立 Date 值,取消操作不会改变表单中的日期字符串。
openTimePicker() {
const date = this.$moment(this.formData.occurTime, 'YYYY-MM-DD', true)
this.timePickerValue = date.isValid() ? date.toDate() : new Date()
this.showTimePicker = true
},
onTimeConfirm(value) {
this.$set(this.formData, 'occurTime', this.$moment(value).format('YYYY-MM-DD'))
this.showTimePicker = false
},
// 自定义插槽没有普通输入值,校验直接读取业务附件数组;失败或上传中的文件不算有效附件。
validateFiles() {
return this.chooseType.isUploadFile !== true || (Array.isArray(this.formData.files)
&& this.formData.files.some(file => file && file.status !== 'fail' && file.status !== 'loading'
&& (file.url || file.downloadPath || file.path)))
},
// 签字组件上传成功后将地址写入表单,空地址不能通过提交校验。
validateSignature() {
return typeof this.formData.signature === 'string' && this.formData.signature.trim().length > 0
}, },
helpUserChange(user) { helpUserChange(user) {
const { id, userName, loginName, unitId, unitName, unionId, unionName } = user const { id, userName, loginName, unitId, unitName, unionId, unionName } = user
@@ -345,53 +391,78 @@ layout("/layouts/platform_h5.html"){
this.userOptions = [] this.userOptions = []
}, },
typeChange(id) { typeChange(id) {
this.chooseType = this.typeOptions.find(o => o.id === id) // 仅用户主动选择时联动金额和方式,详情回显保留历史申请值。
if (this.chooseType) { const type = this.typeOptions.find(o => o.id === id)
this.$set(this.formData, "money", this.chooseType.money) if (type) {
this.$set(this.formData, "way", this.chooseType.way) this.$set(this.formData, "money", type.money)
this.$set(this.formData, "way", type.way)
} }
}, },
onTypeConfirm(o) { onTypeConfirm(o) {
// 空列表或失效选项不能写入申请,提示用户重新选择。
if (!o || !this.typeOptions.some(type => type.id === o.value)) {
this.$toast('暂无可选慰问类型,请重新加载后选择')
return
}
this.$set(this.formData, "typeName", o.text) this.$set(this.formData, "typeName", o.text)
this.$set(this.formData, "type", o.value) this.$set(this.formData, "type", o.value)
this.typeChange(o.value) this.typeChange(o.value)
this.showTypePicker = false this.showTypePicker = false
}, },
onSave() { onSave() {
this.$dialog.confirm({ // 从确认框开始锁定操作,取消或请求结束后统一解除,避免重复保存。
if (this.formLoading) return
this.formLoading = true
return this.$dialog.confirm({
title: "提示", title: "提示",
message: "您确定保存吗?" message: "您确定保存吗?"
}).then(() => { }).then(() => {
this.$axios.post("/platform/condolence/apply/save", { data: JSON.stringify(this.formData) }).then(res => { return this.$axios.post("/platform/condolence/apply/save", { data: JSON.stringify(this.formData) }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$toast(res.msg) this.$toast(res.msg)
this.$pjaxReplace("/platform/condolence/mine/h5") this.$pjaxReplace("/platform/condolence/mine/h5")
} }
}) })
}).catch((error) => {
if (error !== 'cancel' && error !== 'close') this.$toast('保存失败,请重试')
}).finally(() => {
this.formLoading = false
}) })
}, },
async onSubmit() { onSubmit() {
this.$refs.formRef.validate().then(() => { if (this.formLoading) return
this.$dialog.confirm({ return this.$refs.formRef.validate().then(() => {
// 公共校验失败会停止 Promise 链,因此校验通过后才加锁,并再次拦截并发点击。
if (this.formLoading) return
this.formLoading = true
return this.$dialog.confirm({
title: "提示", title: "提示",
message: "您确定要提交申请吗?" message: "您确定要提交申请吗?"
}).then(() => { }).then(() => {
this.$axios.post("/platform/condolence/apply/submit", { data: JSON.stringify(this.formData) }).then(res => { return this.$axios.post("/platform/condolence/apply/submit", { data: JSON.stringify(this.formData) }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$toast(res.msg) this.$toast(res.msg)
this.$pjaxReplace("/platform/condolence/mine/h5") this.$pjaxReplace("/platform/condolence/mine/h5")
} }
}) })
}).catch((error) => {
if (error !== 'cancel' && error !== 'close') this.$toast('提交失败,请重试')
}).finally(() => {
this.formLoading = false
}) })
}) })
}, },
async onFinishTask() { onFinishTask() {
this.$refs.formRef.validate().then(() => { if (this.formLoading) return
this.$dialog.confirm({ return this.$refs.formRef.validate().then(() => {
// 重新提交与首次提交共用操作锁,校验未通过时保持按钮可用。
if (this.formLoading) return
this.formLoading = true
return this.$dialog.confirm({
title: "提示", title: "提示",
message: "您确定要提交申请吗?" message: "您确定要提交申请吗?"
}).then(() => { }).then(() => {
this.$axios.post("/platform/condolence/apply/submitAgain", { return this.$axios.post("/platform/condolence/apply/submitAgain", {
data: JSON.stringify(this.formData), data: JSON.stringify(this.formData),
taskId: GetQueryString("taskId") taskId: GetQueryString("taskId")
}).then(res => { }).then(res => {
@@ -400,6 +471,10 @@ layout("/layouts/platform_h5.html"){
this.$pjaxReplace("/platform/condolence/mine/h5") this.$pjaxReplace("/platform/condolence/mine/h5")
} }
}) })
}).catch((error) => {
if (error !== 'cancel' && error !== 'close') this.$toast('重新提交失败,请重试')
}).finally(() => {
this.formLoading = false
}) })
}) })
}, },
@@ -408,9 +483,6 @@ layout("/layouts/platform_h5.html"){
this.$axios.post("/platform/condolence/mine/info", { id: this.bizId }).then((res) => { this.$axios.post("/platform/condolence/mine/info", { id: this.bizId }).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.formData = res.data this.formData = res.data
this.selectQueryUser(this.formData.helpLoginName, this.helpUserOptions)
this.selectQueryUser(this.formData.payLoginName, this.payUserOptions)
this.chooseType = this.typeOptions.find(o => o.id === this.formData.type)
} }
}) })
} else { } else {
@@ -429,10 +501,9 @@ layout("/layouts/platform_h5.html"){
queryCondolenceType() { queryCondolenceType() {
this.$axios.post('/platform/condolence/type/queryCondolenceType') this.$axios.post('/platform/condolence/type/queryCondolenceType')
.then((res) => { .then((res) => {
this.typeOptions = JSON.parse(JSON.stringify(res.data)) // Result.code 为 0 时 data 为类型数组;异常响应使用空列表,重复加载不累积选项。
res.data.forEach((v) => { this.typeOptions = res && res.code === 0 && Array.isArray(res.data) ? res.data : []
this.typeColumns.push({ value: v.id, text: v.name + "(" + v.code + ")" }) this.typeColumns = this.typeOptions.map(v => ({ value: v.id, text: v.name + "(" + v.code + ")" }))
})
}) })
}, },
}, },
@@ -59,6 +59,11 @@ layout("/layouts/platform_h5.html"){
maxlength="100" maxlength="100"
show-word-limit show-word-limit
></van-field> ></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> </van-form>
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px"> <div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
<van-button type="danger" block @click="handleTaskAction(6)">退回</van-button> <van-button type="danger" block @click="handleTaskAction(6)">退回</van-button>
@@ -127,8 +132,8 @@ layout("/layouts/platform_h5.html"){
} }
}, },
async handleTaskAction(val) { handleTaskAction(val) {
await this.$refs.formRef.validate(); this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({ this.$dialog.confirm({
title: "提示", title: "提示",
message: "您确定要提交吗?" message: "您确定要提交吗?"
@@ -153,6 +158,7 @@ layout("/layouts/platform_h5.html"){
}).finally(() => { }).finally(() => {
loading.close() loading.close()
}) })
})
}) })
}, },
@@ -182,7 +188,7 @@ layout("/layouts/platform_h5.html"){
initUnion() { initUnion() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"]) const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? null : this.$store.state.user.union.id 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 = data
this.unionList.forEach((v) => { this.unionList.forEach((v) => {
v.text = v.name v.text = v.name
@@ -199,7 +205,7 @@ layout("/layouts/platform_h5.html"){
flushUnits() { flushUnits() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"]) const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id 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 = data
this.unitList.forEach((v) => { this.unitList.forEach((v) => {
v.text = v.name v.text = v.name
@@ -212,9 +218,10 @@ layout("/layouts/platform_h5.html"){
}) })
} }
}, },
async created() { created() {
await this.initUnion() this.initUnion().then(() => {
await this.flushUnits() this.flushUnits()
})
} }
}) })
</script> </script>
@@ -13,21 +13,31 @@ const INFO = {
<van-cell title="学历">{{ viewData.education }}</van-cell> <van-cell title="学历">{{ viewData.education }}</van-cell>
<van-cell title="学位">{{ viewData.academicDegree }}</van-cell> <van-cell title="学位">{{ viewData.academicDegree }}</van-cell>
<van-cell title="籍贯">{{ viewData.nativePlace }}</van-cell>
<van-cell title="党政职务">{{ viewData.position }}</van-cell> <van-cell title="党政职务">{{ viewData.position }}</van-cell>
<van-cell title="工作单位">{{ viewData.unitName }}</van-cell> <van-cell title="工作单位">{{ viewData.unitName }}</van-cell>
<van-cell title="所属工会">{{ viewData.unionName }}</van-cell> <van-cell title="所属工会">{{ viewData.unionName }}</van-cell>
<van-cell title="所属校区">{{ viewData.campus }}</van-cell> <van-cell title="岗位名称">{{ viewData.jobCategory }}</van-cell>
<van-cell title="身份证号码">{{ viewData.idCard }}</van-cell> <van-cell title="身份证号码">{{ viewData.idCard }}</van-cell>
<van-cell title="联系电话">{{ viewData.mobile }}</van-cell> <van-cell title="联系电话">{{ viewData.mobile }}</van-cell>
<van-cell title="电子邮箱">{{ viewData.email }}</van-cell> <van-cell title="入职时间">{{ viewData.arrivalAtSchoolDate }}</van-cell>
<van-cell title="在职状态">{{ viewData.userState }}</van-cell> <van-cell title="在职状态">{{ viewData.userState }}</van-cell>
<van-cell title="教职工类别">{{ viewData.personType }}</van-cell> <van-cell title="编制类别">{{ viewData.preparedBy || '暂无' }}</van-cell>
<van-cell title="人员性质">{{ viewData.preparedBy || '暂无' }}</van-cell> <van-cell title="婚姻状况">{{ viewData.marriage || '暂无' }}</van-cell>
<van-cell title="家庭住址">
<template #label>
<div style="white-space: pre-line">
{{viewData.homeAddress}}
</div>
</template>
</van-cell>
<template v-if="viewData.loginname === $store.state.user.loginnmae"> <template v-if="viewData.loginname === $store.state.user.loginnmae">
</template>
<van-cell title="家庭成员" class="column-cell"> <van-cell title="家庭成员" class="column-cell">
<table class="family-table"> <table class="family-table">
<thead> <thead>
@@ -51,13 +61,32 @@ const INFO = {
</table> </table>
</van-cell> </van-cell>
<van-cell title="个人历"> <van-cell title="个人学习及工作经历">
<template #label> <template #label>
<div v-if="viewData.vita" class="text-left" v-html="viewData.vita"></div> <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>
<span style="font-size: 14px" v-else>无数据</span> <span style="font-size: 14px" v-else>无数据</span>
</template> </template>
</van-cell> </van-cell>
<van-cell title="特长及获奖情况">
<template #label>
<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>
<span style="font-size: 14px" v-else>无数据</span>
</template> </template>
</van-cell>
<van-cell title="照片" v-if="viewData.photo">
<van-image :src="viewData.photo"
style="width: 120px;height: 150px"
fit="cover"></van-image>
</van-cell>
<van-cell title="签字" >
<van-image :src="viewData.sign"
v-if="viewData.sign"
class="signature-image"></van-image>
</van-cell>
</van-cell-group> </van-cell-group>
<template v-for="task in doneTasks"> <template v-for="task in doneTasks">
@@ -76,12 +105,17 @@ const INFO = {
</van-cell> </van-cell>
<van-cell title="办理时间">{{ task.finishTime }}</van-cell> <van-cell title="办理时间">{{ task.finishTime }}</van-cell>
<van-cell title="办理结果"> <van-cell title="办理结果">
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT" <dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
:value="task.ext.caseFilingResult"></dict-tag> :value="task.ext.submitType"></dict-tag>
</van-cell> </van-cell>
<van-cell title="办理意见" v-if="!task.ext.isFirstTaskNode" class="direction-column-cell"> <van-cell title="办理意见" v-if="!task.ext.isFirstTaskNode" class="direction-column-cell">
<div v-html="task.taskFormData.tf_opinion"></div> <div v-html="task.taskFormData.tf_opinion"></div>
</van-cell> </van-cell>
<van-cell title="签字" >
<van-image :src="task.taskFormData.tf_sign"
v-if="task.taskFormData.tf_sign"
class="signature-image"></van-image>
</van-cell>
</van-cell-group> </van-cell-group>
</template> </template>
</div> </div>
@@ -32,7 +32,7 @@ layout("/layouts/platform_h5.html"){
<table-column label="所属工会">{{row.unionName}}</table-column> <table-column label="所属工会">{{row.unionName}}</table-column>
<table-column label="工作单位">{{row.unitName}}</table-column> <table-column label="工作单位">{{row.unitName}}</table-column>
<table-column label="填报时间">{{row.applyDateTime}}</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>
<template #actions="{index,row}"> <template #actions="{index,row}">
<div class="action-btn" @click="onView(row)"> <div class="action-btn" @click="onView(row)">
@@ -149,10 +149,11 @@ layout("/layouts/platform_h5.html"){
this.flushUnits() this.flushUnits()
this.doSearch() this.doSearch()
}, },
async initUnion() { initUnion() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"]) const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? null : this.$store.state.user.union.id 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) => { this.unionList.forEach((v) => {
v.text = v.name v.text = v.name
v.value = v.id v.value = v.id
@@ -163,11 +164,13 @@ layout("/layouts/platform_h5.html"){
if (this.unionList && this.unionList.length > 0) { if (this.unionList && this.unionList.length > 0) {
this.$set(this.pageForm, "unionId", this.unionList[0].value) this.$set(this.pageForm, "unionId", this.unionList[0].value)
} }
})
}, },
async flushUnits() { flushUnits() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"]) const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id 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) => { this.unitList.forEach((v) => {
v.text = v.name v.text = v.name
v.value = v.id v.value = v.id
@@ -176,11 +179,13 @@ layout("/layouts/platform_h5.html"){
if (this.unitList && this.unitList.length > 0) { if (this.unitList && this.unitList.length > 0) {
this.$set(this.pageForm, "unitId", this.unitList[0].value) this.$set(this.pageForm, "unitId", this.unitList[0].value)
} }
})
} }
}, },
async created() { created() {
await this.initUnion() this.initUnion().then(() => {
await this.flushUnits() this.flushUnits()
})
} }
}) })
</script> </script>
@@ -59,6 +59,11 @@ layout("/layouts/platform_h5.html"){
maxlength="100" maxlength="100"
show-word-limit show-word-limit
></van-field> ></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> </van-form>
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px"> <div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
<van-button type="danger" block @click="handleTaskAction(6)">退回</van-button> <van-button type="danger" block @click="handleTaskAction(6)">退回</van-button>
@@ -127,8 +132,8 @@ layout("/layouts/platform_h5.html"){
} }
}, },
async handleTaskAction(val) { handleTaskAction(val) {
await this.$refs.formRef.validate(); this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({ this.$dialog.confirm({
title: "提示", title: "提示",
message: "您确定要提交吗?" message: "您确定要提交吗?"
@@ -153,6 +158,7 @@ layout("/layouts/platform_h5.html"){
}).finally(() => { }).finally(() => {
loading.close() loading.close()
}) })
})
}) })
}, },
@@ -168,7 +174,7 @@ layout("/layouts/platform_h5.html"){
overlay: true, overlay: true,
duration: 0 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) { if (res.code === 0) {
this.$toast.success('撤回成功'); this.$toast.success('撤回成功');
this.doSearch(); this.doSearch();
@@ -182,7 +188,7 @@ layout("/layouts/platform_h5.html"){
initUnion() { initUnion() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"]) const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? null : this.$store.state.user.union.id 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 = data
this.unionList.forEach((v) => { this.unionList.forEach((v) => {
v.text = v.name v.text = v.name
@@ -199,7 +205,7 @@ layout("/layouts/platform_h5.html"){
flushUnits() { flushUnits() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"]) const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id 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 = data
this.unitList.forEach((v) => { this.unitList.forEach((v) => {
v.text = v.name v.text = v.name
@@ -212,9 +218,10 @@ layout("/layouts/platform_h5.html"){
}) })
} }
}, },
async created() { created() {
await this.initUnion() this.initUnion().then(() => {
await this.flushUnits() this.flushUnits()
})
} }
}) })
</script> </script>
@@ -42,6 +42,7 @@ layout("/layouts/platform_h5.html"){
v-model="formData.birthday" v-model="formData.birthday"
label="出生年月" label="出生年月"
is-link is-link
readonly
@click="showDatePicker = true" @click="showDatePicker = true"
:rules="[{ required: true, message: '请填写出生年月' }]" :rules="[{ required: true, message: '请填写出生年月' }]"
></van-field> ></van-field>
@@ -59,6 +60,7 @@ layout("/layouts/platform_h5.html"){
name="nation" name="nation"
label="政治面貌" label="政治面貌"
readonly readonly
is-link
placeholder="请选择政治面貌" placeholder="请选择政治面貌"
@click="showPoliticalPicker = true" @click="showPoliticalPicker = true"
clickable clickable
@@ -75,6 +77,7 @@ layout("/layouts/platform_h5.html"){
name="education" name="education"
label="学历" label="学历"
readonly readonly
is-link
placeholder="请选择学历" placeholder="请选择学历"
@click="showEducationPicker = true" @click="showEducationPicker = true"
clickable clickable
@@ -91,6 +94,7 @@ layout("/layouts/platform_h5.html"){
name="academicDegree" name="academicDegree"
label="学位" label="学位"
readonly readonly
is-link
placeholder="请选择学位" placeholder="请选择学位"
@click="showAcademicDegreePicker = true" @click="showAcademicDegreePicker = true"
clickable clickable
@@ -102,6 +106,16 @@ layout("/layouts/platform_h5.html"){
@confirm="(v)=>{formData.academicDegree = v;showAcademicDegreePicker = false}" @confirm="(v)=>{formData.academicDegree = v;showAcademicDegreePicker = false}"
></van-picker> ></van-picker>
</van-popup> </van-popup>
<van-field
v-model="formData.nativePlace"
name="nativePlace"
label="籍贯"
placeholder="请输入籍贯"
clearable
maxlength="30"
:rules="[{ required: true }]"
required
></van-field>
<van-field <van-field
v-model="formData.position" v-model="formData.position"
name="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.unionName" label="所属工会" readonly></van-field>
<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" v-model="formData.campusName"
name="campusName" name="campusName"
label="所属校区" label="所属校区"
@@ -125,32 +150,52 @@ layout("/layouts/platform_h5.html"){
></van-field> ></van-field>
<van-popup position="bottom" round v-model:show="showCampusPicker"> <van-popup position="bottom" round v-model:show="showCampusPicker">
<van-picker :columns="campusColumns" @cancel="showCampusPicker = false" @confirm="onCampusColumns" show-toolbar></van-picker> <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" v-model="formData.userState"
name="userState" name="userState"
label="在职状态" label="在职状态"
readonly readonly
placeholder="请填写在职状态" placeholder="请填写在职状态"
clickable 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 <van-field
v-model="formData.personType" v-model="formData.marriage"
name="personType" name="marriage"
label="教职工类别" label="婚姻状况"
readonly readonly
placeholder="请填写人员类型" is-link
clickable placeholder="请选择婚姻状况"
></van-field> @click="showMarriagePicker = true"
<van-field
v-model="formData.preparedBy"
name="preparedBy"
label="编制类别"
readonly
placeholder="请填写编制类别"
clickable clickable
required
:rules="[{ required: true }]"
></van-field> ></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 <van-field
v-model="formData.idCard" v-model="formData.idCard"
disabled disabled
@@ -171,13 +216,32 @@ layout("/layouts/platform_h5.html"){
maxlength="11" maxlength="11"
></van-field> ></van-field>
<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" v-model="formData.email"
name="email" name="email"
label="电子邮箱" label="电子邮箱"
placeholder="请输入电子邮箱" placeholder="请输入电子邮箱"
clearable clearable
maxlength="25" maxlength="25"
></van-field> ></van-field>-->
</van-cell-group> </van-cell-group>
<van-cell-group title="家庭信息" class="form-section up_down"> <van-cell-group title="家庭信息" class="form-section up_down">
@@ -188,7 +252,8 @@ layout("/layouts/platform_h5.html"){
<span>家庭主要成员及联系方式</span> <span>家庭主要成员及联系方式</span>
</div> </div>
</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" icon="plus" type="primary" round size="mini"
@click="formData.families.push({})" @click="formData.families.push({})"
native-type="button"></van-button> native-type="button"></van-button>
@@ -208,8 +273,7 @@ layout("/layouts/platform_h5.html"){
:rules="[{ required:true, message: '请填写姓名' }]"></van-field> :rules="[{ required:true, message: '请填写姓名' }]"></van-field>
<van-field label="工作单位" v-model="o.unit" placeholder="请填写工作单位" <van-field label="工作单位" v-model="o.unit" placeholder="请填写工作单位"
:rules="[{ required:true, message: '请填写工作单位' }]"></van-field> :rules="[{ required:true, message: '请填写工作单位' }]"></van-field>
<van-field label="备注" v-model="o.remark" placeholder="请填写备注" <van-field label="备注" v-model="o.remark" placeholder="请填写备注"></van-field>
:rules="[{ required:true, message: '请填写备注' }]"></van-field>
</div> </div>
</template> </template>
<template v-else> <template v-else>
@@ -223,43 +287,91 @@ layout("/layouts/platform_h5.html"){
</div> </div>
</van-cell-group> </van-cell-group>
<van-cell-group title="个人简况" class="form-section"> <van-cell-group title="个人学习及工作经历" class="form-section">
<text-editor v-model="formData.personalData"></text-editor> <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>
<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-cell-group title="入会意愿" class="form-section">
<van-checkbox style="font-size: 17px;padding: 12px" icon-size="24px" <van-checkbox style="font-size: 17px;padding: 12px" icon-size="24px"
v-model="formData.isVoluntary" shape="square"> v-model="formData.isVoluntary" shape="square">
<div style="text-indent: 2.1rem"> <div style="text-indent: 2.1rem">
<span :style="'color:' + (formData.isVoluntary ? '#1989fa' : '#F56C6C') "> <span :style="'color:' + (formData.isVoluntary ? '#1989fa' : '#F56C6C') ">
我自愿申请加入学校工会,并委托学校按规定代为扣缴工会会员会费 我自愿加入中华全国总工会,遵守工会章程,执行工会决议,积极参加工会活动,为把我国建设成为富强、民主、文明的社会主义国家而努力奋斗
</span>
</div>
<div style="text-indent: 2.1rem">
<span :style="'color:' + (formData.isVoluntary ? '#1989fa' : '#F56C6C') ">
我将严格遵守工会章程,认真执行工会决议,积极参与工会活动,主动融入“学校健康幸福家”建设,为营造温暖、和谐、奋进的校园氛围贡献力量,以实际行动助力学校各项事业发展。
</span> </span>
</div> </div>
</van-checkbox> </van-checkbox>
</van-cell-group> </van-cell-group>
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px"> <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 block type="primary" @click.submit="onSave" :disabled="!canApply">保存</van-button>
<van-button v-if="!taskId" block type="primary" @click.submit="onSubmit">提交</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> <van-button v-else block type="primary" @click.submit="onFinishTask" >提交</van-button>
</div> </div>
</van-form> </van-form>
</div> </div>
<script nonce="${cspNonce!}"> <script nonce="${cspNonce!}">
new Vue({ new Vue({
el: '#app', el: "#app",
store, 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() { data() {
return { return {
id: GetQueryString("bizId"), id: GetQueryString("bizId"),
taskId: GetQueryString("taskId"), taskId: GetQueryString("taskId"),
canApply: true,
applyDisableMsg: '',
formData: { formData: {
families: [], families: []
}, },
// 民族 // 民族
showNationPicker: false, showNationPicker: false,
@@ -274,11 +386,29 @@ layout("/layouts/platform_h5.html"){
campusColumns: [], campusColumns: [],
// 生日 // 生日
showDatePicker: false, showDatePicker: false,
showMarriagePicker: false
} }
}, },
methods: { methods: {
historyBack, 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() { onSave() {
this.$dialog.confirm({ this.$dialog.confirm({
title: "提示", title: "提示",
@@ -292,12 +422,12 @@ layout("/layouts/platform_h5.html"){
overlay: true, overlay: true,
duration: 0 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) { if (res.code === 0) {
this.$toast.success(res.msg) this.$toast.success(res.msg)
this.$pjaxReplace('/platform/member/apply/mine/h5') this.$pjaxReplace("/platform/member/apply/mine/h5")
} else { } else {
this.$toast.fail('操作失败') this.$toast.fail("操作失败")
console.log(res.msg) console.log(res.msg)
} }
}).finally(() => { }).finally(() => {
@@ -308,6 +438,21 @@ layout("/layouts/platform_h5.html"){
onSubmit() { onSubmit() {
this.$refs.formRef.validate().then(() => { 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({ this.$dialog.confirm({
title: "提示", title: "提示",
message: "您确定要提交吗?" message: "您确定要提交吗?"
@@ -318,14 +463,14 @@ layout("/layouts/platform_h5.html"){
overlay: true, overlay: true,
duration: 0 duration: 0
}) })
this.$axios.post('/platform/member/apply/submit/submit', { this.$axios.post("/platform/member/apply/submit/submit", {
data: JSON.stringify(this.formData) data: JSON.stringify(this.formData)
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$toast.success(res.msg) this.$toast.success(res.msg)
this.$pjaxReplace('/platform/member/apply/mine/h5') this.$pjaxReplace("/platform/member/apply/mine/h5")
} else { } else {
this.$toast.fail('操作失败') this.$toast.fail("操作失败")
console.log(res.msg) console.log(res.msg)
} }
}).finally(() => { }).finally(() => {
@@ -337,6 +482,21 @@ layout("/layouts/platform_h5.html"){
onFinishTask() { onFinishTask() {
this.$refs.formRef.validate().then(() => { 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({ this.$dialog.confirm({
title: "提示", title: "提示",
message: "您确定要提交吗?" message: "您确定要提交吗?"
@@ -347,15 +507,15 @@ layout("/layouts/platform_h5.html"){
overlay: true, overlay: true,
duration: 0 duration: 0
}) })
this.$axios.post('/platform/member/apply/submit/submitAgain', { this.$axios.post("/platform/member/apply/submit/submitAgain", {
data: JSON.stringify(this.formData), data: JSON.stringify(this.formData),
taskId: this.taskId, taskId: this.taskId
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$toast.success(res.msg) this.$toast.success(res.msg)
this.$pjaxReplace('/platform/member/apply/mine/h5') this.$pjaxReplace("/platform/member/apply/mine/h5")
} else { } else {
this.$toast.fail('操作失败') this.$toast.fail("操作失败")
console.log(res.msg) console.log(res.msg)
} }
}).finally(() => { }).finally(() => {
@@ -365,14 +525,35 @@ layout("/layouts/platform_h5.html"){
}) })
}, },
onDateConfirm(value) { validateFamilies() {
this.formData.birthday = value; // 提交时家庭主要成员至少填写一条,并校验核心成员信息。
this.showDatePicker = false; 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 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.code === 0) {
if (!resp.data) { if (!resp.data) {
user = this.$store.state.user user = this.$store.state.user
@@ -384,12 +565,15 @@ layout("/layouts/platform_h5.html"){
} }
if (this.id) { if (this.id) {
const res = await this.$axios.post("/platform/member/apply/submit/findApplyById", { id: this.id }) this.$axios.post("/platform/member/apply/submit/findApplyById", { id: this.id })
debugger .then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.formData = res.data this.$set(this, "formData", Object.assign({ families: [] }, res.data))
} }
} else { })
return
}
const { const {
id, id,
username, username,
@@ -409,28 +593,35 @@ layout("/layouts/platform_h5.html"){
union, union,
campus, campus,
userState, userState,
nativePlace,
jobCategory,
personType, personType,
preparedBy,
idCard, idCard,
mobile, mobile,
email, email,
families, families,
arrivalAtSchoolDate,
personalData personalData
} = user } = user
this.$set(this.formData, "userId", id) this.$set(this.formData, "userId", id)
this.$set(this.formData, "username", username) this.$set(this.formData, "username", username)
this.$set(this.formData, "loginname", loginname) 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, "sex", sex)
this.$set(this.formData, "idCard", idCard) this.$set(this.formData, "idCard", idCard)
this.$set(this.formData, "nation", nation) this.$set(this.formData, "nation", nation)
this.$set(this.formData, "political", political) this.$set(this.formData, "political", political)
this.$set(this.formData, "position", position) 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, "education", education)
this.$set(this.formData, "academicDegree", academicDegree) this.$set(this.formData, "academicDegree", academicDegree)
this.$set(this.formData, "campus", campus) this.$set(this.formData, "campus", campus)
this.$set(this.formData, "userState", userState) this.$set(this.formData, "userState", userState)
this.$set(this.formData, "personType", personType) 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, "unitName", unit ? unit.name : unitName)
this.$set(this.formData, "unitId", unit ? unit.id : unitId) this.$set(this.formData, "unitId", unit ? unit.id : unitId)
this.$set(this.formData, "unionName", union ? union.name : unionName) 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, "email", email)
this.$set(this.formData, "families", families ? families : []) this.$set(this.formData, "families", families ? families : [])
this.$set(this.formData, "personalData", personalData) this.$set(this.formData, "personalData", personalData)
this.$set(this.formData, "arrivalAtSchoolDate", arrivalAtSchoolDate ? this.$moment(arrivalAtSchoolDate).format("YYYY-MM-DD") : "")
this.checkApplyPermission()
// 处理校区信息 // 处理校区信息
if (campus) { if (campus) {
@@ -455,37 +649,38 @@ layout("/layouts/platform_h5.html"){
this.$set(this.formData, "campus", "") this.$set(this.formData, "campus", "")
this.$set(this.formData, "campusName", "") this.$set(this.formData, "campusName", "")
} }
} })
}, },
toChinesNum(num){ toChinesNum(num) {
let changeNum = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九']; let changeNum = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"]
let unit = ["", "十", "百", "千", "万"]; let unit = ["", "十", "百", "千", "万"]
num = parseInt(num); num = parseInt(num)
let getWan = (temp) => { let getWan = (temp) => {
let strArr = temp.toString().split("").reverse(); let strArr = temp.toString().split("").reverse()
let newNum = ""; let newNum = ""
for (let i = 0; i < strArr.length; i++) { 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 overWan = Math.floor(num / 10000)
let noWan = num % 10000; let noWan = num % 10000
if (noWan.toString().length < 4) { 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) { onCampusColumns(o) {
this.$set(this.formData, "campusName", o.text); // 显示名称 this.$set(this.formData, "campusName", o.text) // 显示名称
this.$set(this.formData, "campus", o.value); // 字典值 this.$set(this.formData, "campus", o.value) // 字典值
this.showCampusPicker = false; 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 => { this.campusColumns = campusData.map(item => {
return {value: item.code, text: item.name} return { value: item.code, text: item.name }
}) })
// 初始化完成后,如果已经有用户数据,更新校区显示名称 // 初始化完成后,如果已经有用户数据,更新校区显示名称
if (this.formData.campus && this.campusColumns.length > 0) { if (this.formData.campus && this.campusColumns.length > 0) {
@@ -494,39 +689,48 @@ layout("/layouts/platform_h5.html"){
this.$set(this.formData, "campusName", campusItem.text) this.$set(this.formData, "campusName", campusItem.text)
} }
} }
})
.finally(() => {
this.init()
}
} }
}, },
computed: { computed: {
nationColumns(){ nationColumns() {
if(this.dict && this.dict.type && this.dict.type.USER_NATION){ if (this.dict && this.dict.type && this.dict.type.USER_NATION) {
return this.dict.type.USER_NATION.map(v=>v.name) return this.dict.type.USER_NATION.map(v => v.name)
} }
return [] return []
}, },
politicalColumns(){ politicalColumns() {
if(this.dict && this.dict.type && this.dict.type.USER_POLITICAL){ if (this.dict && this.dict.type && this.dict.type.USER_POLITICAL) {
return this.dict.type.USER_POLITICAL.map(v=>v.name) return this.dict.type.USER_POLITICAL.map(v => v.name)
} }
return [] return []
}, },
educationColumns(){ educationColumns() {
if(this.dict && this.dict.type && this.dict.type.USER_EDUCATION){ if (this.dict && this.dict.type && this.dict.type.USER_EDUCATION) {
return this.dict.type.USER_EDUCATION.map(v=>v.name) return this.dict.type.USER_EDUCATION.map(v => v.name)
} }
return [] return []
}, },
academicDegreeColumns(){ academicDegreeColumns() {
if(this.dict && this.dict.type && this.dict.type.USER_ACADEMIC_DEGREE){ if (this.dict && this.dict.type && this.dict.type.USER_ACADEMIC_DEGREE) {
return this.dict.type.USER_ACADEMIC_DEGREE.map(v=>v.name) return this.dict.type.USER_ACADEMIC_DEGREE.map(v => v.name)
} }
return [] 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() { created() {
this.initDictOptions(); this.initDictOptions()
this.init() }
},
}) })
</script> </script>
<!--# <!--#
@@ -127,8 +127,8 @@ layout("/layouts/platform_h5.html"){
} }
}, },
async handleTaskAction(val) { handleTaskAction(val) {
await this.$refs.formRef.validate(); this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({ this.$dialog.confirm({
title: "提示", title: "提示",
message: "您确定要提交吗?" message: "您确定要提交吗?"
@@ -153,6 +153,7 @@ layout("/layouts/platform_h5.html"){
}).finally(() => { }).finally(() => {
loading.close() loading.close()
}) })
})
}) })
}, },
@@ -183,7 +184,7 @@ layout("/layouts/platform_h5.html"){
initUnion() { initUnion() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"]) const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? null : this.$store.state.user.union.id 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 = data
this.unionList.forEach((v) => { this.unionList.forEach((v) => {
v.text = v.name v.text = v.name
@@ -200,7 +201,7 @@ layout("/layouts/platform_h5.html"){
flushUnits() { flushUnits() {
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"]) const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id 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 = data
this.unitList.forEach((v) => { this.unitList.forEach((v) => {
v.text = v.name v.text = v.name
@@ -213,9 +214,10 @@ layout("/layouts/platform_h5.html"){
}) })
} }
}, },
async created() { created() {
await this.initUnion() this.initUnion().then(() => {
await this.flushUnits() this.flushUnits()
})
} }
}) })
</script> </script>
@@ -176,11 +176,12 @@ const todo = {
// 处理任务 // 处理任务
onView(task) { onView(task) {
const {taskId, taskKey, instanceId, businessNo, formKey, h5FormKey} = task; const {taskId, taskKey, instanceId, businessNo, formKey, h5FormKey} = task;
if (!h5FormKey) { const h5Url = h5FormKey || task.h5formkey
if (!h5Url) {
this.$toast("请到电脑端智慧工会系统审核"); this.$toast("请到电脑端智慧工会系统审核");
return; return;
} }
this.$pjaxReplace(h5FormKey + "?taskId=" + taskId + "bizId=" + businessNo + "taskKey=" + taskKey+ "&tab=" + this.activeTab) this.$pjaxReplace(h5Url + "?taskId=" + taskId + "&bizId=" + businessNo + "&taskKey=" + taskKey + "&tab=" + this.activeTab)
}, },
// 获取空状态文本 // 获取空状态文本