Compare commits
15
Commits
41ba30bf70
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
584e710136 | ||
|
|
9f7c0f214e | ||
|
|
7322252d41 | ||
|
|
bc56b0c777 | ||
|
|
ada0306d4e | ||
|
|
da87374d15 | ||
|
|
21f5105058 | ||
|
|
7e46c8bccb | ||
|
|
9b37a9800d | ||
|
|
e349f57511 | ||
|
|
725b08caef | ||
|
|
b91a62d949 | ||
|
|
fad75b8f4f | ||
|
|
7260e1f2d3 | ||
|
|
dc3e67775b |
@@ -41,212 +41,212 @@ import java.util.*;
|
||||
@Slf4j
|
||||
public class FlowDesignController {
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
@Inject
|
||||
private ProcessDesignService processDesignService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
@Inject
|
||||
private ProcessDesignService processDesignService;
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
// 获取所有任务参与者处理类
|
||||
public static final List<JSONObject> ASSIGMENT_HANDLER_LIST;
|
||||
// 获取所有候选用户处理类
|
||||
public static final List<JSONObject> CANDIDATE_HANDLER_LIST;
|
||||
// 获取所有任务参与者处理类
|
||||
public static final List<JSONObject> ASSIGMENT_HANDLER_LIST;
|
||||
// 获取所有候选用户处理类
|
||||
public static final List<JSONObject> CANDIDATE_HANDLER_LIST;
|
||||
|
||||
static {
|
||||
Set<Class<?>> classes = ClassScanner.scanPackageBySuper("com.budwk.app", AssignmentHandler.class);
|
||||
ArrayList<JSONObject> list = new ArrayList<>(classes.size());
|
||||
for (Class<?> aClass : classes) {
|
||||
try {
|
||||
AssignmentHandler handler = (AssignmentHandler) ReflectUtil.newInstance(aClass);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("value", handler.getClass().getName());
|
||||
jsonObject.set("order", handler.getOrder());
|
||||
jsonObject.set("name", handler.getMessage());
|
||||
list.add(jsonObject);
|
||||
} catch (Exception e) {
|
||||
log.error("初始化AssignmentHandler失败: {}", aClass.getName());
|
||||
}
|
||||
}
|
||||
// 排序 按order
|
||||
list.sort(Comparator.comparingInt(o -> o.getInt("order")));
|
||||
ASSIGMENT_HANDLER_LIST = Collections.unmodifiableList(list);
|
||||
}
|
||||
static {
|
||||
Set<Class<?>> classes = ClassScanner.scanPackageBySuper("com.budwk.app", AssignmentHandler.class);
|
||||
ArrayList<JSONObject> list = new ArrayList<>(classes.size());
|
||||
for (Class<?> aClass : classes) {
|
||||
try {
|
||||
AssignmentHandler handler = (AssignmentHandler) ReflectUtil.newInstance(aClass);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("value", handler.getClass().getName());
|
||||
jsonObject.set("order", handler.getOrder());
|
||||
jsonObject.set("name", handler.getMessage());
|
||||
list.add(jsonObject);
|
||||
} catch (Exception e) {
|
||||
log.error("初始化AssignmentHandler失败: {}", aClass.getName());
|
||||
}
|
||||
}
|
||||
// 排序 按order
|
||||
list.sort(Comparator.comparingInt(o -> o.getInt("order")));
|
||||
ASSIGMENT_HANDLER_LIST = Collections.unmodifiableList(list);
|
||||
}
|
||||
|
||||
static {
|
||||
Set<Class<?>> classes = ClassScanner.scanPackageBySuper("com.budwk.app", CandidateHandler.class);
|
||||
ArrayList<JSONObject> list = new ArrayList<>(classes.size());
|
||||
for (Class<?> aClass : classes) {
|
||||
try {
|
||||
CandidateHandler handler = (CandidateHandler) ReflectUtil.newInstance(aClass);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("value", handler.getClass().getName());
|
||||
jsonObject.set("order", handler.getOrder());
|
||||
jsonObject.set("name", handler.getMessage());
|
||||
list.add(jsonObject);
|
||||
} catch (Exception e) {
|
||||
log.error("初始化CandidateHandler失败: {}", aClass.getName());
|
||||
}
|
||||
}
|
||||
// 排序 按order
|
||||
list.sort(Comparator.comparingInt(o -> o.getInt("order")));
|
||||
CANDIDATE_HANDLER_LIST = Collections.unmodifiableList(list);
|
||||
}
|
||||
static {
|
||||
Set<Class<?>> classes = ClassScanner.scanPackageBySuper("com.budwk.app", CandidateHandler.class);
|
||||
ArrayList<JSONObject> list = new ArrayList<>(classes.size());
|
||||
for (Class<?> aClass : classes) {
|
||||
try {
|
||||
CandidateHandler handler = (CandidateHandler) ReflectUtil.newInstance(aClass);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("value", handler.getClass().getName());
|
||||
jsonObject.set("order", handler.getOrder());
|
||||
jsonObject.set("name", handler.getMessage());
|
||||
list.add(jsonObject);
|
||||
} catch (Exception e) {
|
||||
log.error("初始化CandidateHandler失败: {}", aClass.getName());
|
||||
}
|
||||
}
|
||||
// 排序 按order
|
||||
list.sort(Comparator.comparingInt(o -> o.getInt("order")));
|
||||
CANDIDATE_HANDLER_LIST = Collections.unmodifiableList(list);
|
||||
}
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/flow/design/index.html")
|
||||
@SaCheckPermission("flow.design")
|
||||
public void index() {
|
||||
}
|
||||
@At("")
|
||||
@Ok("beetl:/platform/flow/design/index.html")
|
||||
@SaCheckPermission("flow.design")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("beetl:/platform/flow/design/designer.html")
|
||||
@SaCheckLogin
|
||||
public void designer(HttpServletRequest request) {
|
||||
request.setAttribute("id", request.getParameter("id"));
|
||||
}
|
||||
@At
|
||||
@Ok("beetl:/platform/flow/design/designer.html")
|
||||
@SaCheckLogin
|
||||
public void designer(HttpServletRequest request) {
|
||||
request.setAttribute("id", request.getParameter("id"));
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("获取流程设计分页列表")
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result pageData(PageForm pageForm, String displayName, String name, String category, Boolean deployed) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
@At
|
||||
@ApiOperation("获取流程设计分页列表")
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result pageData(PageForm pageForm, String displayName, String name, String category, Boolean deployed) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
cnd.and(Cnd.likeEX(ProcessDesign::getDisplayName, displayName));
|
||||
cnd.and(Cnd.likeEX(ProcessDesign::getName, name));
|
||||
cnd.andEX(ProcessDesign::getCategory, "=", category);
|
||||
cnd.andEX(ProcessDesign::getIsDeployed, "=", deployed);
|
||||
cnd.and(Cnd.likeEX(ProcessDesign::getDisplayName, displayName));
|
||||
cnd.and(Cnd.likeEX(ProcessDesign::getName, name));
|
||||
cnd.andEX(ProcessDesign::getCategory, "=", category);
|
||||
cnd.andEX(ProcessDesign::getIsDeployed, "=", deployed);
|
||||
|
||||
Pagination pagination = processDesignService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
Pagination pagination = processDesignService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("保存流程设计")
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result insert(@Param("design") ProcessDesign processDesign) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("name", processDesign.getName());
|
||||
jsonObject.set("displayName", processDesign.getDisplayName());
|
||||
jsonObject.set("category", processDesign.getCategory());
|
||||
jsonObject.set("instanceUrl", processDesign.getInstanceUrl());
|
||||
jsonObject.set("h5InstanceUrl", processDesign.getH5InstanceUrl());
|
||||
jsonObject.set("instanceViewUrl", processDesign.getInstanceViewUrl());
|
||||
jsonObject.set("h5InstanceViewUrl", processDesign.getH5InstanceViewUrl());
|
||||
jsonObject.set("icon", processDesign.getIcon());
|
||||
jsonObject.set("picIcon", processDesign.getPicIcon());
|
||||
jsonObject.set("description", processDesign.getDescription());
|
||||
processDesign.setContent(jsonObject);
|
||||
dao.insert(processDesign);
|
||||
return Result.success();
|
||||
}
|
||||
@At
|
||||
@ApiOperation("保存流程设计")
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result insert(@Param("design") ProcessDesign processDesign) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("name", processDesign.getName());
|
||||
jsonObject.set("displayName", processDesign.getDisplayName());
|
||||
jsonObject.set("category", processDesign.getCategory());
|
||||
jsonObject.set("instanceUrl", processDesign.getInstanceUrl());
|
||||
jsonObject.set("h5InstanceUrl", processDesign.getH5InstanceUrl());
|
||||
jsonObject.set("instanceViewUrl", processDesign.getInstanceViewUrl());
|
||||
jsonObject.set("h5InstanceViewUrl", processDesign.getH5InstanceViewUrl());
|
||||
jsonObject.set("icon", processDesign.getIcon());
|
||||
jsonObject.set("picIcon", processDesign.getPicIcon());
|
||||
jsonObject.set("description", processDesign.getDescription());
|
||||
processDesign.setContent(jsonObject);
|
||||
dao.insert(processDesign);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("修改流程设计")
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result update(@Param("design") ProcessDesign processDesign) {
|
||||
JSONObject jsonObject = processDesign.getContent();
|
||||
jsonObject.set("name", processDesign.getName());
|
||||
jsonObject.set("displayName", processDesign.getDisplayName());
|
||||
jsonObject.set("category", processDesign.getCategory());
|
||||
jsonObject.set("instanceUrl", processDesign.getInstanceUrl());
|
||||
jsonObject.set("h5InstanceUrl", processDesign.getH5InstanceUrl());
|
||||
jsonObject.set("instanceViewUrl", processDesign.getInstanceViewUrl());
|
||||
jsonObject.set("h5InstanceViewUrl", processDesign.getH5InstanceViewUrl());
|
||||
jsonObject.set("icon", processDesign.getIcon());
|
||||
jsonObject.set("picIcon", processDesign.getPicIcon());
|
||||
jsonObject.set("description", processDesign.getDescription());
|
||||
processDesign.setContent(jsonObject);
|
||||
processDesignService.update(processDesign);
|
||||
return Result.success();
|
||||
}
|
||||
@At
|
||||
@ApiOperation("修改流程设计")
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result update(@Param("design") ProcessDesign processDesign) {
|
||||
JSONObject jsonObject = processDesign.getContent();
|
||||
jsonObject.set("name", processDesign.getName());
|
||||
jsonObject.set("displayName", processDesign.getDisplayName());
|
||||
jsonObject.set("category", processDesign.getCategory());
|
||||
jsonObject.set("instanceUrl", processDesign.getInstanceUrl());
|
||||
jsonObject.set("h5InstanceUrl", processDesign.getH5InstanceUrl());
|
||||
jsonObject.set("instanceViewUrl", processDesign.getInstanceViewUrl());
|
||||
jsonObject.set("h5InstanceViewUrl", processDesign.getH5InstanceViewUrl());
|
||||
jsonObject.set("icon", processDesign.getIcon());
|
||||
jsonObject.set("picIcon", processDesign.getPicIcon());
|
||||
jsonObject.set("description", processDesign.getDescription());
|
||||
processDesign.setContent(jsonObject);
|
||||
processDesignService.update(processDesign);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("修改流程设计")
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result updateContent(@Param("design") ProcessDesign processDesign) {
|
||||
JSONObject jsonObject = processDesign.getContent();
|
||||
jsonObject.set("name", processDesign.getName());
|
||||
jsonObject.set("displayName", processDesign.getDisplayName());
|
||||
jsonObject.set("category", processDesign.getCategory());
|
||||
jsonObject.set("instanceUrl", processDesign.getInstanceUrl());
|
||||
jsonObject.set("h5InstanceUrl", processDesign.getH5InstanceUrl());
|
||||
jsonObject.set("instanceViewUrl", processDesign.getInstanceViewUrl());
|
||||
jsonObject.set("h5InstanceViewUrl", processDesign.getH5InstanceViewUrl());
|
||||
jsonObject.set("icon", processDesign.getIcon());
|
||||
jsonObject.set("picIcon", processDesign.getPicIcon());
|
||||
jsonObject.set("description", processDesign.getDescription());
|
||||
processDesign.setContent(jsonObject);
|
||||
processDesignService.update(processDesign);
|
||||
return Result.success();
|
||||
}
|
||||
@At("/xiugaiDesign")
|
||||
@ApiOperation("修改流程设计")
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result updateContent(@Param("design") ProcessDesign processDesign) {
|
||||
JSONObject jsonObject = processDesign.getContent();
|
||||
jsonObject.set("name", processDesign.getName());
|
||||
jsonObject.set("displayName", processDesign.getDisplayName());
|
||||
jsonObject.set("category", processDesign.getCategory());
|
||||
jsonObject.set("instanceUrl", processDesign.getInstanceUrl());
|
||||
jsonObject.set("h5InstanceUrl", processDesign.getH5InstanceUrl());
|
||||
jsonObject.set("instanceViewUrl", processDesign.getInstanceViewUrl());
|
||||
jsonObject.set("h5InstanceViewUrl", processDesign.getH5InstanceViewUrl());
|
||||
jsonObject.set("icon", processDesign.getIcon());
|
||||
jsonObject.set("picIcon", processDesign.getPicIcon());
|
||||
jsonObject.set("description", processDesign.getDescription());
|
||||
processDesign.setContent(jsonObject);
|
||||
processDesignService.update(processDesign);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("删除流程设计")
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result delete(@Param("id") Long id) {
|
||||
dao.delete(ProcessDesign.class, id);
|
||||
return Result.success();
|
||||
}
|
||||
@At
|
||||
@ApiOperation("删除流程设计")
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result delete(@Param("id") Long id) {
|
||||
dao.delete(ProcessDesign.class, id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("流程设计详情")
|
||||
public Result detail(@Param("id") Long id) {
|
||||
ProcessDesign design = dao.fetch(ProcessDesign.class, id);
|
||||
return Result.success(design);
|
||||
}
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("流程设计详情")
|
||||
public Result detail(@Param("id") Long id) {
|
||||
ProcessDesign design = dao.fetch(ProcessDesign.class, id);
|
||||
return Result.success(design);
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("发布流程设计")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result deploy(@Param("id") Long id) {
|
||||
processDesignService.deploy(id);
|
||||
return Result.success();
|
||||
}
|
||||
@At
|
||||
@ApiOperation("发布流程设计")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("flow.design")
|
||||
public Result deploy(@Param("id") Long id) {
|
||||
processDesignService.deploy(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者处理类")
|
||||
public Result assigmentHandlerClass() {
|
||||
return Result.success(ASSIGMENT_HANDLER_LIST);
|
||||
}
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者处理类")
|
||||
public Result assigmentHandlerClass() {
|
||||
return Result.success(ASSIGMENT_HANDLER_LIST);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者处理类")
|
||||
public Result candidateHandlerClass() {
|
||||
return Result.success(CANDIDATE_HANDLER_LIST);
|
||||
}
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者处理类")
|
||||
public Result candidateHandlerClass() {
|
||||
return Result.success(CANDIDATE_HANDLER_LIST);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者分页数据")
|
||||
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");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if(StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("username", searchKeyword);
|
||||
group.orLike("loginname", searchKeyword);
|
||||
cnd.and(group);
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者分页数据")
|
||||
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");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
group.orLike("username", searchKeyword);
|
||||
group.orLike("loginname", searchKeyword);
|
||||
cnd.and(group);
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
// cnd.andEX("id", "in", userIds);
|
||||
Pagination pagination = sysUserService.listPageMap(pageNumber, pageSize, sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
Pagination pagination = sysUserService.listPageMap(pageNumber, pageSize, sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者分页数据回显")
|
||||
public Result assigneeEcho(@Param("userIds") String[] userIds) {
|
||||
Sql sql = Sqls.create("select id,loginname,username,unitName from vw_user where id in (@userIds)");
|
||||
sql.setParam("userIds", userIds);
|
||||
List<NutMap> list = sysUserService.listMap(sql);
|
||||
return Result.success(list);
|
||||
}
|
||||
@At
|
||||
@SaCheckLogin
|
||||
@ApiOperation("获取流程设计任务参与者分页数据回显")
|
||||
public Result assigneeEcho(@Param("userIds") String[] userIds) {
|
||||
Sql sql = Sqls.create("select id,loginname,username,unitName from vw_user where id in (@userIds)");
|
||||
sql.setParam("userIds", userIds);
|
||||
List<NutMap> list = sysUserService.listMap(sql);
|
||||
return Result.success(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,6 +92,7 @@ public class SysDataUnitPullServiceImpl extends BaseServiceImpl<Sys_unit> implem
|
||||
}
|
||||
log.info("本次拉取单位数据,新增{}条,更新{}条", insertList.size(), updateList.size());
|
||||
dao().insert(insertList);
|
||||
dao().update(updateList);
|
||||
// 单位同步只更新数据中心负责维护的字段,避免将未参与映射的工会、小组等本地关联字段覆盖为空。
|
||||
dao().update(updateList, "name|unitcode|unitType|unitTypeCode|parentId|unitLevel");
|
||||
}
|
||||
}
|
||||
|
||||
+312
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+491
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+494
@@ -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));
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("careData.union")
|
||||
public Result memberOverviewData() {
|
||||
return Result.success(careDataLeaderService.memberOverviewData());
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission("careData.union")
|
||||
public Result assetDataData() {
|
||||
|
||||
+7
@@ -45,6 +45,13 @@ public interface CareDataLeaderService {
|
||||
*/
|
||||
NutMap dataMetricData(Integer year);
|
||||
|
||||
/**
|
||||
* 查询会员总数和男女会员数。
|
||||
*
|
||||
* @return 会员概览数据,包含 total、male、female、unknown。
|
||||
*/
|
||||
NutMap memberOverviewData();
|
||||
|
||||
/**
|
||||
* 查询资产使用状态分布。
|
||||
*
|
||||
|
||||
+61
-9
@@ -91,13 +91,38 @@ public class CareDataLeaderServiceImpl implements CareDataLeaderService {
|
||||
int targetYear = year == null ? LocalDate.now().getYear() : year;
|
||||
return NutMap.NEW()
|
||||
.addv("year", targetYear)
|
||||
.addv("budgetTotal", schoolBudgetTotal(targetYear))
|
||||
.addv("budgetTotal", budgetTotal(targetYear))
|
||||
.addv("tourCount", tourCount(targetYear))
|
||||
.addv("honorCount", honorCount(targetYear))
|
||||
.addv("difficultCount", difficultCount(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
|
||||
public NutMap assetDataData() {
|
||||
List<NutMap> states = assetUsageStateRows();
|
||||
@@ -220,14 +245,41 @@ public class CareDataLeaderServiceImpl implements CareDataLeaderService {
|
||||
return listMap(sql);
|
||||
}
|
||||
|
||||
private BigDecimal schoolBudgetTotal(int year) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT IFNULL(SUM(totalQuota), 0) AS total
|
||||
FROM outlay_manage_school
|
||||
WHERE delFlag = 0
|
||||
AND `year` = @year
|
||||
""");
|
||||
sql.setParam("year", year);
|
||||
private BigDecimal budgetTotal(int year) {
|
||||
Sql sql;
|
||||
if (canViewAllUnionData()) {
|
||||
sql = Sqls.create("""
|
||||
SELECT IFNULL(SUM(totalQuota), 0) AS total
|
||||
FROM (
|
||||
SELECT totalQuota
|
||||
FROM outlay_manage_school
|
||||
WHERE delFlag = 0
|
||||
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);
|
||||
} 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");
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -145,11 +145,13 @@ public class CondolenceApplyController {
|
||||
}
|
||||
if(!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
|
||||
if(AuthUtil.hasRoleOr(
|
||||
RoleConstant.BRANCH_UNION_ADMIN.name(),
|
||||
RoleConstant.BRANCH_UNION_ZUZHI_WY.name(),
|
||||
RoleConstant.BRANCH_UNION_CHAIRMAN.name(),
|
||||
RoleConstant.BRANCH_UNION_WY.name(),
|
||||
RoleConstant.BRANCH_UNION_XUANCHUAN_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()
|
||||
)) {
|
||||
cnd.and(View_user::getUnionId, "=", SecurityUtil.getUnionId());
|
||||
|
||||
+4
-2
@@ -1,6 +1,7 @@
|
||||
package com.budwk.app.zhgh.staffmanage.member.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
@@ -64,7 +65,7 @@ public class MemberApplyBranchUnionApprovalController {
|
||||
|
||||
@At
|
||||
@ApiOperation("会员入会申请分工会审核列表")
|
||||
@SaCheckPermission("member.apply.branchUnionApproval")
|
||||
@SaCheckPermission(value = {"member.apply.branchUnionApproval", "h5.member.apply.branchUnionApproval"}, mode = SaMode.OR)
|
||||
public Result pageData(MemberApplyPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -78,6 +79,7 @@ public class MemberApplyBranchUnionApprovalController {
|
||||
info.personType,
|
||||
info.applyDateTime,
|
||||
info.sign,
|
||||
info.nativePlace,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
@@ -125,7 +127,7 @@ public class MemberApplyBranchUnionApprovalController {
|
||||
} else {
|
||||
cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = memberApplyRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
|
||||
+53
-6
@@ -1,6 +1,7 @@
|
||||
package com.budwk.app.zhgh.staffmanage.member.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
@@ -14,6 +15,7 @@ import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessSubmitTypeEnum;
|
||||
import com.budwk.app.flow.service.FlowCommonService;
|
||||
import com.budwk.app.sys.models.Sys_union_group;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.sys.views.View_user;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
@@ -70,7 +72,8 @@ public class MemberApplyController {
|
||||
|
||||
@At
|
||||
@ApiOperation("保存申请")
|
||||
@SaCheckPermission("member.apply.submit")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
|
||||
@SLog(tag = "会员入会申请", msg = "保存申请,申请人: ${args[0].username}")
|
||||
public Result save(@Param("data") MemberApplyRecord memberApplyRecord) {
|
||||
if (StrUtil.isBlank(memberApplyRecord.getId())) {
|
||||
@@ -84,7 +87,7 @@ public class MemberApplyController {
|
||||
@At
|
||||
@ApiOperation("提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("member.apply.submit")
|
||||
@SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
|
||||
@SLog(tag = "会员入会申请", msg = "提交申请,申请人: ${args[0].username}")
|
||||
public Result submit(@Param("data") MemberApplyRecord memberApplyRecord){
|
||||
if (StrUtil.isBlank(memberApplyRecord.getId())) {
|
||||
@@ -123,7 +126,7 @@ public class MemberApplyController {
|
||||
@At
|
||||
@ApiOperation("重新提交申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("member.apply.submit")
|
||||
@SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
|
||||
@SLog(tag = "会员入会申请", msg = "重新提交申请,申请人: ${args[0].username}")
|
||||
public Result submitAgain(@Param("data") MemberApplyRecord memberApplyRecord, @Param("taskId") Long taskId) {
|
||||
if (StrUtil.isBlank(memberApplyRecord.getId())) {
|
||||
@@ -159,14 +162,58 @@ public class MemberApplyController {
|
||||
*/
|
||||
@At
|
||||
@ApiOperation("根据id查询申请记录")
|
||||
@SaCheckPermission("member.apply.submit")
|
||||
@SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
|
||||
public Result findApplyById(String id) {
|
||||
return Result.success(dao.fetch(MemberApplyRecord.class,id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户id判断是否允许发起入会申请。
|
||||
*
|
||||
* @param id 用户id;前端选择代申请人员时传入该人员id,个人申请时传当前登录用户id
|
||||
* @return Dict,包含 canApply 是否允许申请、msg 不允许时的提示信息,以及用户基础信息
|
||||
*/
|
||||
@At
|
||||
@ApiOperation("根据 userid 查询是否能申请入会")
|
||||
@SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
|
||||
public Result findOne(String id) {
|
||||
Sys_user user = dao.fetch(Sys_user.class, Cnd.where("id", "=", id));
|
||||
if (user == null) {
|
||||
return Result.error("用户不存在");
|
||||
}
|
||||
|
||||
Dict result = Dict.create();
|
||||
result.set("id", user.getId());
|
||||
result.set("username", user.getUsername());
|
||||
result.set("loginname", user.getLoginname());
|
||||
|
||||
boolean isAlreadyMember = Boolean.TRUE.equals(user.getMember());
|
||||
if (isAlreadyMember) {
|
||||
result.set("canApply", false);
|
||||
result.set("msg", "您已是工会会员,无需重复申请");
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
long doingProcessCount = dao.count(ProcessInstance.class,
|
||||
Cnd.where("businessNo", "in",
|
||||
Sqls.create("SELECT id FROM member_apply_record WHERE userId = @userId")
|
||||
.setParam("userId", id)
|
||||
).and("state", "=", 10)
|
||||
);
|
||||
|
||||
if (doingProcessCount > 0) {
|
||||
result.set("canApply", false);
|
||||
result.set("msg", "您有一份入会申请流程正在审批中,请勿重复提交");
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
result.set("canApply", true);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SaCheckPermission("member.apply.submit")
|
||||
@SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
|
||||
public Result getApplyUserByUnionOperate(@Valid String keyWord){
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -195,7 +242,7 @@ public class MemberApplyController {
|
||||
*/
|
||||
@At
|
||||
@ApiOperation("获取当前登录用户信息")
|
||||
@SaCheckPermission("member.apply.submit")
|
||||
@SaCheckPermission(value = {"member.apply.submit", "h5.member.apply.submit"}, mode = SaMode.OR)
|
||||
public Result getSelfUserInfo() {
|
||||
return Result.success(dao.fetch(View_user.class, Cnd.where("id", "=", SecurityUtil.getUserId())));
|
||||
}
|
||||
|
||||
+21
-4
@@ -27,6 +27,7 @@ import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
@@ -62,7 +63,7 @@ public class MemberApplyMineController {
|
||||
|
||||
@At
|
||||
@ApiOperation("会员入会申请,我的申请列表")
|
||||
@SaCheckPermission("member.apply.mine")
|
||||
@SaCheckPermission(value = {"member.apply.mine", "h5.member.apply.mine"}, mode = SaMode.OR)
|
||||
public Result pageData(MemberApplyPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -76,6 +77,8 @@ public class MemberApplyMineController {
|
||||
info.personType,
|
||||
info.applyDateTime,
|
||||
info.sign,
|
||||
info.nativePlace,
|
||||
info.jobCategory,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
@@ -90,6 +93,7 @@ public class MemberApplyMineController {
|
||||
t.finishTime,
|
||||
t.taskParentId,
|
||||
t.variable taskVariable,
|
||||
GROUP_CONCAT(DISTINCT ta.actorName, '(', ta.actorAccount, ')' ) AS auditUser,
|
||||
IF((SELECT taskName FROM wf_process_task tt WHERE tt.id = t.taskParentId) = 'startTask', 1, 0) canRevoke,
|
||||
(select MAX(id) from wf_process_task where processInstanceId = ins.id and taskName = 'startTask' AND taskState in (10,20)) AS startTaskId
|
||||
FROM
|
||||
@@ -113,7 +117,7 @@ public class MemberApplyMineController {
|
||||
} else {
|
||||
cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = memberCommonService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success().addData(pagination);
|
||||
@@ -123,7 +127,7 @@ public class MemberApplyMineController {
|
||||
@At
|
||||
@ApiOperation("删除入会申请")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SaCheckPermission("member.apply.mine")
|
||||
@SaCheckPermission(value = {"member.apply.mine", "h5.member.apply.mine"}, mode = SaMode.OR)
|
||||
@SLog(tag = "会员入会申请", msg = "删除入会申请id: ${args[0]}")
|
||||
public Result onDelete(@Valid String id) {
|
||||
dao.clear(MemberApplyRecord.class, Cnd.where("id", "=", id));
|
||||
@@ -140,9 +144,22 @@ public class MemberApplyMineController {
|
||||
*/
|
||||
@At
|
||||
@ApiOperation("获取申请信息")
|
||||
@SaCheckPermission(value = {"member.apply.mine", "member.apply.branchUnionApproval", "member.apply.branchUnionApproval"}, mode = SaMode.OR)
|
||||
@SaCheckPermission(value = {"member.apply.mine", "h5.member.apply.mine", "member.apply.query", "member.apply.branchUnionApproval", "h5.member.apply.branchUnionApproval", "member.apply.schoolUnionApproval", "h5.member.apply.schoolunionapproval", "member.apply.unionGroupApproval", "h5.member.apply.uniongroupapproval"}, mode = SaMode.OR)
|
||||
public Result findMemberApplyRecord(@Valid String id) {
|
||||
MemberApplyRecord record = dao.fetch(MemberApplyRecord.class, id);
|
||||
return Result.success().addData(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出入会申请表。
|
||||
*
|
||||
* @param id 入会申请记录id
|
||||
* @param response docx 文件下载响应
|
||||
*/
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission(value = {"member.apply.mine", "h5.member.apply.mine", "member.apply.query", "member.apply.branchUnionApproval", "h5.member.apply.branchUnionApproval", "member.apply.schoolUnionApproval", "h5.member.apply.schoolunionapproval", "member.apply.unionGroupApproval", "h5.member.apply.uniongroupapproval"}, mode = SaMode.OR)
|
||||
public void exportApplyDocx(String id, HttpServletResponse response) {
|
||||
memberCommonService.exportApplyDocx(id, response);
|
||||
}
|
||||
}
|
||||
|
||||
+115
@@ -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);
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -1,6 +1,7 @@
|
||||
package com.budwk.app.zhgh.staffmanage.member.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.annotation.SLog;
|
||||
@@ -78,7 +79,7 @@ public class MemberApplySchoolUnionApprovalController {
|
||||
|
||||
@At
|
||||
@ApiOperation("会员入会校工会审核列表")
|
||||
@SaCheckPermission("member.apply.schoolUnionApproval")
|
||||
@SaCheckPermission(value = {"member.apply.schoolUnionApproval", "h5.member.apply.schoolunionapproval"}, mode = SaMode.OR)
|
||||
public Result pageData(MemberApplyPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -93,6 +94,7 @@ public class MemberApplySchoolUnionApprovalController {
|
||||
info.origin,
|
||||
info.applyDateTime,
|
||||
info.sign,
|
||||
info.nativePlace,
|
||||
ins.id AS instanceId,
|
||||
ins.businessNo,
|
||||
ins.state instanceState,
|
||||
@@ -138,7 +140,7 @@ public class MemberApplySchoolUnionApprovalController {
|
||||
} else {
|
||||
cnd.orderBy("info." + pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
cnd.groupBy("t.id");
|
||||
cnd.groupBy("info.id");
|
||||
sql.setCondition(cnd);
|
||||
Pagination<NutMap> pagination = memberApplyRecordService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package com.budwk.app.zhgh.staffmanage.member.controller.apply;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
@@ -53,7 +54,7 @@ public class MemberApplyUnionGroupApprovalController {
|
||||
|
||||
@At
|
||||
@ApiOperation("会员入会申请工会小组审核列表")
|
||||
@SaCheckPermission("member.apply.unionGroupApproval")
|
||||
@SaCheckPermission(value = {"member.apply.unionGroupApproval", "h5.member.apply.uniongroupapproval"}, mode = SaMode.OR)
|
||||
public Result pageData(MemberApplyPageForm pageForm) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
|
||||
@@ -182,6 +182,16 @@ public class MemberApplyRecord extends BaseModel {
|
||||
@ColDefine(type = ColType.VARCHAR, customType = "text")
|
||||
private String personalData;
|
||||
|
||||
@Column
|
||||
@Comment("特长及获奖情况")
|
||||
@ColDefine(type = ColType.VARCHAR, customType = "text")
|
||||
private String specialty;
|
||||
|
||||
@Column
|
||||
@Comment("婚姻状况")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
private String marriage;
|
||||
|
||||
@Column
|
||||
@Comment("备注")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
@@ -223,8 +233,33 @@ public class MemberApplyRecord extends BaseModel {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String sign;
|
||||
|
||||
@Column
|
||||
@Comment("照片")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String photo;
|
||||
|
||||
@Column
|
||||
@Comment("来源,高校编码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String origin;
|
||||
|
||||
@Column
|
||||
@Comment("家庭住址")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String homeAddress;
|
||||
|
||||
@Column
|
||||
@Comment("来校时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String arrivalAtSchoolDate;
|
||||
|
||||
@Column
|
||||
@Comment("籍贯")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String nativePlace;
|
||||
|
||||
@Column
|
||||
@Comment("岗位名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String jobCategory;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberManagePageForm
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -115,4 +116,12 @@ public interface MemberCommonService extends BaseService<Sys_user> {
|
||||
* @param type 类型: apply or change
|
||||
*/
|
||||
void validateApplyOrChangeIsDoing(String userId, String type);
|
||||
|
||||
/**
|
||||
* 导出会员入会申请表。
|
||||
*
|
||||
* @param id 入会申请记录id
|
||||
* @param response docx 文件下载响应
|
||||
*/
|
||||
void exportApplyDocx(String id, HttpServletResponse response);
|
||||
}
|
||||
|
||||
+236
@@ -3,6 +3,7 @@ package com.budwk.app.zhgh.staffmanage.member.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
@@ -10,9 +11,12 @@ import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.exception.BaseException;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
|
||||
import com.budwk.app.flow.engine.FlowEngine;
|
||||
import com.budwk.app.flow.entity.ProcessInstance;
|
||||
import com.budwk.app.flow.entity.ProcessTask;
|
||||
import com.budwk.app.flow.enums.ProcessTaskStateEnum;
|
||||
import com.budwk.app.flow.vo.ProcessTaskVO;
|
||||
import com.budwk.app.sys.models.*;
|
||||
import com.budwk.app.sys.services.SysDictService;
|
||||
import com.budwk.app.sys.services.SysRoleService;
|
||||
@@ -29,7 +33,19 @@ import com.budwk.app.zhgh.staffmanage.member.param.pageform.MemberManagePageForm
|
||||
import com.budwk.app.zhgh.staffmanage.member.service.MemberCommonService;
|
||||
import com.budwk.app.zhgh.staffmanage.specialstaff.model.SpecialStaff;
|
||||
import com.budwk.app.zhgh.welfare.model.WelfareList;
|
||||
import com.deepoove.poi.XWPFTemplate;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.util.Units;
|
||||
import org.apache.poi.xwpf.usermodel.LineSpacingRule;
|
||||
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFRun;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFTable;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFTableCell;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFTableRow;
|
||||
import org.ddr.poi.html.HtmlRenderPolicy;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
@@ -45,7 +61,12 @@ import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTInline;
|
||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDrawing;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -61,12 +82,23 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
public class MemberManageServiceImpl extends BaseServiceImpl<Sys_user> implements MemberCommonService {
|
||||
|
||||
private static final int MEMBER_APPLY_PHOTO_WIDTH_PIXEL = 100;
|
||||
private static final int MEMBER_APPLY_PHOTO_HEIGHT_PIXEL = 140;
|
||||
private static final int MEMBER_APPLY_PHOTO_WIDTH_EMU = Units.pixelToEMU(MEMBER_APPLY_PHOTO_WIDTH_PIXEL);
|
||||
private static final int MEMBER_APPLY_PHOTO_HEIGHT_EMU = Units.pixelToEMU(MEMBER_APPLY_PHOTO_HEIGHT_PIXEL);
|
||||
private static final int MEMBER_APPLY_PHOTO_SIZE_TOLERANCE_EMU = Units.pixelToEMU(2);
|
||||
private static final double MEMBER_APPLY_PHOTO_PARAGRAPH_LINE_POINT = MEMBER_APPLY_PHOTO_HEIGHT_PIXEL * 0.75D;
|
||||
|
||||
@Inject
|
||||
private SysDictService sysDictService;
|
||||
@Inject
|
||||
private SysRoleService sysRoleService;
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
@Inject
|
||||
private FlowEngine flowEngine;
|
||||
@Inject
|
||||
private SysOfficeTemplateUtil sysOfficeTemplateUtil;
|
||||
|
||||
public MemberManageServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
@@ -566,4 +598,208 @@ public class MemberManageServiceImpl extends BaseServiceImpl<Sys_user> implement
|
||||
}
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportApplyDocx(String id, HttpServletResponse response) {
|
||||
MemberApplyRecord member = dao().fetch(MemberApplyRecord.class, Cnd.where("id", "=", id));
|
||||
if (member == null) {
|
||||
throw new RuntimeException("会员申请记录不存在");
|
||||
}
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.id AS instanceId
|
||||
FROM
|
||||
`member_apply_record` info
|
||||
LEFT JOIN wf_process_instance ins ON ins.businessNo = info.id
|
||||
WHERE
|
||||
info.id = @id
|
||||
""").setParam("id", id);
|
||||
sql.setCallback(Sqls.callback.map());
|
||||
dao().execute(sql);
|
||||
NutMap info = (NutMap) sql.getResult();
|
||||
|
||||
HashMap<String, Object> docData = new HashMap<>();
|
||||
docData.put("unitName", member.getUnitName());
|
||||
docData.put("time", DateUtil.format(new Date(), "yyyy年MM月dd日"));
|
||||
docData.put("username", member.getUsername());
|
||||
docData.put("sex", member.getSex());
|
||||
docData.put("birthday", StrUtil.isNotBlank(member.getBirthday()) ? DateUtil.parse(member.getBirthday()).toString("yyyy-MM-dd") : "");
|
||||
docData.put("political", member.getPolitical());
|
||||
docData.put("nation", member.getNation());
|
||||
docData.put("education", member.getEducation());
|
||||
docData.put("nativePlace", member.getNativePlace());
|
||||
docData.put("marriage", member.getMarriage());
|
||||
docData.put("specialty", buildMemberApplyDocHtml(member.getSpecialty()));
|
||||
docData.put("jobCategory", member.getJobCategory());
|
||||
docData.put("idCard", member.getIdCard());
|
||||
docData.put("mobile", member.getMobile());
|
||||
docData.put("arrivalAtSchoolDate", StrUtil.isNotBlank(member.getArrivalAtSchoolDate()) ? DateUtil.parse(member.getArrivalAtSchoolDate()).toString("yyyy-MM-dd") : "");
|
||||
docData.put("homeAddress", member.getHomeAddress());
|
||||
docData.put("personalData", buildMemberApplyDocHtml(member.getPersonalData()));
|
||||
docData.put("photo", sysOfficeTemplateUtil.createPictureRenderData(MEMBER_APPLY_PHOTO_WIDTH_PIXEL, MEMBER_APPLY_PHOTO_HEIGHT_PIXEL, member.getPhoto()));
|
||||
docData.put("sign", sysOfficeTemplateUtil.createPictureRenderData(member.getSign()));
|
||||
docData.put("applyDateTime", member.getApplyDateTime() != null ? DateUtil.format(member.getApplyDateTime(), "yyyy年MM月dd日") : "");
|
||||
|
||||
// 将家庭成员数组合并为模板中的多行文本。
|
||||
if (member.getFamilies() != null && !member.getFamilies().isEmpty()) {
|
||||
StringBuilder familyStr = new StringBuilder();
|
||||
for (int i = 0; i < member.getFamilies().size(); i++) {
|
||||
NutMap fam = NutMap.WRAP(member.getFamilies().get(i));
|
||||
familyStr.append((i + 1)).append(". ")
|
||||
.append("关系:").append(StrUtil.nullToDefault(fam.getString("relation"), "无")).append(", ")
|
||||
.append("姓名:").append(StrUtil.nullToDefault(fam.getString("name"), "无")).append(", ")
|
||||
.append("单位:").append(StrUtil.nullToDefault(fam.getString("unit"), "无")).append(", ")
|
||||
.append("备注:").append(StrUtil.nullToDefault(fam.getString("remark"), "无")).append("\n");
|
||||
}
|
||||
docData.put("familiesStr", familyStr.toString());
|
||||
} else {
|
||||
docData.put("familiesStr", "无");
|
||||
}
|
||||
|
||||
List<ProcessTaskVO> doneTaskVos = new ArrayList<>();
|
||||
Long instanceId = info.getLong("instanceId");
|
||||
if (instanceId != null) {
|
||||
List<ProcessTask> doneTaskList = flowEngine.processTaskService().getDoneTaskList(instanceId, null);
|
||||
for (ProcessTask doneTask : doneTaskList) {
|
||||
ProcessTaskVO taskVO = flowEngine.processTaskService().findById(doneTask.getId());
|
||||
doneTaskVos.add(taskVO);
|
||||
}
|
||||
}
|
||||
|
||||
// 提取分工会和校工会最后一次审核意见,填充到申请表模板对应区块。
|
||||
doneTaskVos.stream().filter(task -> "分工会审核".equals(task.getDisplayName()))
|
||||
.max(Comparator.comparing(ProcessTaskVO::getCreatedAt))
|
||||
.ifPresent(v -> putMemberApplyApproval(docData, "fgh", v));
|
||||
doneTaskVos.stream().filter(task -> "校工会审核".equals(task.getDisplayName()))
|
||||
.max(Comparator.comparing(ProcessTaskVO::getCreatedAt))
|
||||
.ifPresent(v -> putMemberApplyApproval(docData, "xgh", v));
|
||||
|
||||
String fileName = "会员入会申请表_" + member.getUsername() + "_" + DateUtil.format(new Date(), "yyyyMMdd") + ".docx";
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.wordprocessingml.document");
|
||||
response.setHeader("content-disposition", "attachment;filename=" + URLEncoder.encode(fileName, StandardCharsets.UTF_8));
|
||||
|
||||
HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
|
||||
htmlRenderPolicy.getConfig().setShowDefaultTableBorderInTableCell(true);
|
||||
Configure config = Configure.builder()
|
||||
.bind("personalData", htmlRenderPolicy)
|
||||
.bind("specialty", htmlRenderPolicy)
|
||||
.build();
|
||||
try {
|
||||
XWPFTemplate template = XWPFTemplate.compile(sysOfficeTemplateUtil.getTemplate("member_apply_form"), config)
|
||||
.render(docData);
|
||||
resizeMemberApplyPhotoRow(template.getXWPFDocument());
|
||||
template.write(response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
log.error("导出会员入会申请表失败,ID: {}, 错误信息: {}", id, e.getMessage());
|
||||
throw new RuntimeException("导出文件失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将流程办理意见转换为模板可渲染的审核信息。
|
||||
*/
|
||||
private void putMemberApplyApproval(HashMap<String, Object> docData, String key, ProcessTaskVO taskVO) {
|
||||
Dict taskFormData = taskVO.getTaskFormData();
|
||||
HashMap<String, Object> approval = new HashMap<>();
|
||||
approval.put("date", taskVO.getFinishTime() != null ? DateUtil.format(taskVO.getFinishTime(), "yyyy年MM月dd日") : "");
|
||||
approval.put("user", taskFormData != null ? taskFormData.getStr("tf_userName") : "");
|
||||
if (taskFormData != null && StrUtil.isNotBlank(taskFormData.getStr("tf_sign"))) {
|
||||
approval.put("sign", sysOfficeTemplateUtil.createPictureRenderData(taskFormData.getStr("tf_sign")));
|
||||
}
|
||||
approval.put("opinion", taskFormData != null ? taskFormData.getStr("tf_opinion") : "");
|
||||
docData.put(key, approval);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入会申请导出时统一转为 HTML 片段,历史富文本保留样式,普通文本保留换行。
|
||||
*/
|
||||
private String buildMemberApplyDocHtml(String text) {
|
||||
if (StrUtil.isBlank(text)) {
|
||||
return "";
|
||||
}
|
||||
String docText = sysOfficeTemplateUtil.convertRichTextToDocText(text);
|
||||
if (containsHtmlTag(docText)) {
|
||||
return docText;
|
||||
}
|
||||
String escapeText = HtmlUtil.escape(docText)
|
||||
.replace("\r\n", "\n")
|
||||
.replace("\r", "\n")
|
||||
.replace("\n", "<br/>");
|
||||
return "<p>" + escapeText + "</p>";
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断内容是否包含 HTML 标签,避免把历史富文本当普通文本转义。
|
||||
*/
|
||||
private boolean containsHtmlTag(String text) {
|
||||
return StrUtil.isNotBlank(text) && text.matches("(?s).*<\\s*[a-zA-Z][^>]*>.*");
|
||||
}
|
||||
|
||||
/**
|
||||
* 保证导出的会员照片行足够高,避免 Word 裁剪默认内联图片。
|
||||
*/
|
||||
private void resizeMemberApplyPhotoRow(XWPFDocument document) {
|
||||
if (document == null) {
|
||||
return;
|
||||
}
|
||||
for (XWPFTable table : document.getTables()) {
|
||||
for (XWPFTableRow row : table.getRows()) {
|
||||
adjustMemberApplyPhotoParagraph(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 只匹配会员照片尺寸,避免影响签字图片。
|
||||
*/
|
||||
private boolean adjustMemberApplyPhotoParagraph(XWPFTableRow row) {
|
||||
if (row == null) {
|
||||
return false;
|
||||
}
|
||||
boolean found = false;
|
||||
for (XWPFTableCell cell : row.getTableCells()) {
|
||||
for (XWPFParagraph paragraph : cell.getParagraphs()) {
|
||||
for (XWPFRun run : paragraph.getRuns()) {
|
||||
if (runContainsMemberApplyPhoto(run)) {
|
||||
adjustMemberApplyPhotoParagraphStyle(paragraph);
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
/**
|
||||
* 调整照片所在段落,确保图片在合并单元格中完整可见。
|
||||
*/
|
||||
private void adjustMemberApplyPhotoParagraphStyle(XWPFParagraph paragraph) {
|
||||
paragraph.setAlignment(ParagraphAlignment.CENTER);
|
||||
paragraph.setSpacingBefore(0);
|
||||
paragraph.setSpacingAfter(0);
|
||||
paragraph.setSpacingBeforeLines(0);
|
||||
paragraph.setSpacingAfterLines(0);
|
||||
paragraph.setSpacingBetween(MEMBER_APPLY_PHOTO_PARAGRAPH_LINE_POINT, LineSpacingRule.AT_LEAST);
|
||||
}
|
||||
|
||||
private boolean runContainsMemberApplyPhoto(XWPFRun run) {
|
||||
if (run == null || run.getCTR() == null) {
|
||||
return false;
|
||||
}
|
||||
for (CTDrawing drawing : run.getCTR().getDrawingArray()) {
|
||||
for (CTInline inline : drawing.getInlineArray()) {
|
||||
if (inline.getExtent() != null && isMemberApplyPhotoSize(inline.getExtent().getCx(), inline.getExtent().getCy())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isMemberApplyPhotoSize(long widthEmu, long heightEmu) {
|
||||
return Math.abs(widthEmu - MEMBER_APPLY_PHOTO_WIDTH_EMU) <= MEMBER_APPLY_PHOTO_SIZE_TOLERANCE_EMU
|
||||
&& Math.abs(heightEmu - MEMBER_APPLY_PHOTO_HEIGHT_EMU) <= MEMBER_APPLY_PHOTO_SIZE_TOLERANCE_EMU;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
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
|
||||
password: 123456
|
||||
validationQuery: select 1
|
||||
|
||||
BIN
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 (Array.isArray(val)) {
|
||||
this.fileList = val.map((v) => {
|
||||
return {
|
||||
...v,
|
||||
status: null,
|
||||
isImage: ["jpg", "jpeg", "png", "gif", "bmp", "webp"].includes(v.name.split(".").pop().toLowerCase())
|
||||
}
|
||||
return this.normalizeFile(v)
|
||||
})
|
||||
} else if(typeof val === "string") {
|
||||
this.fileList = [
|
||||
{
|
||||
url: val,
|
||||
status: null,
|
||||
isImage: true
|
||||
}
|
||||
this.normalizeFile(val)
|
||||
]
|
||||
} else {
|
||||
val = JSON.parse(val)
|
||||
this.fileList = val.map((v) => {
|
||||
return {
|
||||
...v,
|
||||
url: v.url ? v.url : v.response?.data,
|
||||
isImage: ["jpg", "jpeg", "png", "gif", "bmp", "webp"].includes(v.name.split(".").pop().toLowerCase()),
|
||||
status: null
|
||||
}
|
||||
return this.normalizeFile(v)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
@@ -142,14 +129,50 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
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) {
|
||||
this.fileList = this.fileList.filter((f) => f.url !== file.url)
|
||||
this.$emit("update:value", this.fileList)
|
||||
this.$emit("update:value", this.getCleanFileList())
|
||||
},
|
||||
beforeRead(file) {
|
||||
debugger
|
||||
console.log(file)
|
||||
console.log(this.upload_size)
|
||||
if (file.size > this.upload_size) {
|
||||
this.$toast("文件过大,请上传小于" + (this.upload_size / 1024 / 1024).toFixed(2) + "M的文件!")
|
||||
return false
|
||||
@@ -178,7 +201,7 @@ module.exports = {
|
||||
if (valid) {
|
||||
return true
|
||||
}
|
||||
this.$toast(`文件只能是 ${this.accept} 格式!`)
|
||||
this.$toast("文件只能是 " + this.accept + " 格式!")
|
||||
return false
|
||||
},
|
||||
afterRead(files) {
|
||||
@@ -200,8 +223,8 @@ module.exports = {
|
||||
f.url = resp.data
|
||||
f.response = resp
|
||||
f.percentage = 100
|
||||
f.isImage = true
|
||||
delete f.file
|
||||
f.isImage = this.isImageFile(f.name)
|
||||
f.file = {name: f.name}
|
||||
delete f.content
|
||||
} else {
|
||||
f.status = "fail"
|
||||
@@ -213,7 +236,7 @@ module.exports = {
|
||||
if (this.upload_result_category === "interval") {
|
||||
} else if (this.upload_result_category === "array") {
|
||||
if (this.complete_result) {
|
||||
this.$emit("update:value", this.fileList)
|
||||
this.$emit("update:value", this.getCleanFileList())
|
||||
} else {
|
||||
const resultArrayValue = []
|
||||
this.fileList.forEach((data) => {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -140,7 +140,7 @@
|
||||
...this.designerData,
|
||||
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) {
|
||||
window.parent.postMessage("success")
|
||||
} 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">年  度</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}">
|
||||
查  看
|
||||
</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="工  号">
|
||||
<el-input maxlength="50" placeholder="请填写工号" v-model="formData.loginname"
|
||||
type="text" @blur="userBlur"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="username" label="姓  名">
|
||||
<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="工  号">
|
||||
<el-input maxlength="50" placeholder="请填写工号" v-model="formData.loginname"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="mobile" label="电  话">
|
||||
<el-input maxlength="50" placeholder="请填写电话" v-model="formData.mobile"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="sex" label="性  别">
|
||||
<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>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+6
-13
@@ -1346,7 +1346,7 @@ layout("/layouts/platform_leader_dashboard.html"){
|
||||
class="staff-home-map-wrap"
|
||||
:class="{ 'staff-home-map-wrap-capture': coordinateMode }"
|
||||
@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
|
||||
class="staff-home-marker"
|
||||
v-for="item in littleHouses"
|
||||
@@ -1603,18 +1603,11 @@ layout("/layouts/platform_leader_dashboard.html"){
|
||||
}
|
||||
},
|
||||
loadMemberOverviewData() {
|
||||
Promise.all([
|
||||
this.$axios.post("/platform/member/info/board/memberNumber"),
|
||||
this.$axios.post("/platform/member/info/board/memberSexPercentage")
|
||||
]).then(([numberResp, sexResp]) => {
|
||||
if (numberResp && numberResp.code === 0 && numberResp.data) {
|
||||
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))
|
||||
this.$axios.post("/platform/careData/leader/memberOverviewData").then(resp => {
|
||||
if (resp && resp.code === 0 && resp.data) {
|
||||
this.$set(this.memberOverview, "total", Number(resp.data.total || 0))
|
||||
this.$set(this.memberOverview, "male", Number(resp.data.male || 0))
|
||||
this.$set(this.memberOverview, "female", Number(resp.data.female || 0))
|
||||
}
|
||||
}).catch(() => {})
|
||||
},
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ layout("/layouts/platform_leader_dashboard.html"){
|
||||
<section class="staff-home-panel">
|
||||
<div class="staff-home-title">职工小家</div>
|
||||
<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>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
@@ -226,12 +226,17 @@ layout("/layouts/platform.html"){
|
||||
files: [{required: true, message: "必填", trigger: ["change", "blur"]}],
|
||||
signature: [{required: true, message: "必填", trigger: ["change", "blur"]}]
|
||||
},
|
||||
chooseType: {},
|
||||
payUserOptions: [],
|
||||
helpUserOptions: [],
|
||||
typeOptions: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 类型列表和申请详情独立加载,任一数据变化后重新匹配;未匹配时返回空对象,保证附件区域安全渲染。
|
||||
chooseType() {
|
||||
return this.typeOptions.find(o => o.id === this.formData.type) || {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
createRemoteMethod(options) {
|
||||
return (keyword) => {
|
||||
@@ -267,10 +272,11 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
typeChange(id) {
|
||||
this.chooseType = this.typeOptions.find(o => o.id === id)
|
||||
if (this.chooseType) {
|
||||
this.$set(this.formData, "money", this.chooseType.money)
|
||||
this.$set(this.formData, "way", this.chooseType.way)
|
||||
// id 为用户选择的慰问类型 ID;仅匹配成功时更新金额和方式,详情回显时保留原申请值。
|
||||
const type = this.typeOptions.find(o => o.id === id)
|
||||
if (type) {
|
||||
this.$set(this.formData, "money", type.money)
|
||||
this.$set(this.formData, "way", type.way)
|
||||
}
|
||||
},
|
||||
onSave() {
|
||||
@@ -335,7 +341,6 @@ layout("/layouts/platform.html"){
|
||||
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 {
|
||||
@@ -352,9 +357,10 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
queryCondolenceType() {
|
||||
// 接口无需参数,返回 Result;code 为 0 时 data 为启用类型数组,异常响应按空列表处理。
|
||||
this.$axios.post("/platform/condolence/type/queryCondolenceType")
|
||||
.then((resp) => {
|
||||
this.typeOptions = resp.data
|
||||
this.$set(this, "typeOptions", resp && resp.code === 0 && Array.isArray(resp.data) ? resp.data : [])
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
+163
-153
@@ -2,93 +2,98 @@
|
||||
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="申请列表">
|
||||
<el-radio-group @change="doSearch" class="mr5" size="small" v-model="pageForm.audit">
|
||||
<el-radio-button label="true">已审核</el-radio-button>
|
||||
<el-radio-button label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :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=='sign'">
|
||||
<el-image v-if="row.sign" :src="row.sign" style="height: 60px"></el-image>
|
||||
<el-tag type="warning" v-else>暂无</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 label="操作" fixed="right" width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openView(row)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button v-if="row.taskState === 10" @click="openApproval(row)" size="mini" type="primary">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button v-if="row.canRevoke" @click="openRevoke(row)" size="mini" type="danger">
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
<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="申请列表">
|
||||
<el-radio-group @change="doSearch" class="mr5" size="small" v-model="pageForm.audit">
|
||||
<el-radio-button label="true">已审核</el-radio-button>
|
||||
<el-radio-button label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :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=='sign'">
|
||||
<el-image v-if="row.sign" :src="row.sign" style="height: 60px"></el-image>
|
||||
<el-tag type="warning" v-else>暂无</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 label="操作" fixed="right" width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openView(row)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button v-if="row.taskState === 10" @click="openApproval(row)" size="mini" type="primary">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button v-if="row.canRevoke" @click="openRevoke(row)" size="mini" type="danger">
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #edit>
|
||||
<info ref="infoRef">
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">
|
||||
{{formData.taskName}}
|
||||
</div>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=":"
|
||||
class="flow-task-form">
|
||||
<el-form-item label="审批意见" prop="tf_opinion"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
|
||||
<el-button @click="handleTaskAction(6)" size="small" type="info">退回到发起人</el-button>
|
||||
<el-button @click="handleTaskAction(2)" size="small" type="danger">拒绝申请</el-button>
|
||||
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意申请</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</info>
|
||||
</template>
|
||||
<template #edit>
|
||||
<info ref="infoRef">
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">
|
||||
{{formData.taskName}}
|
||||
</div>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=":"
|
||||
class="flow-task-form">
|
||||
<el-form-item label="审批意见" prop="tf_opinion"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
|
||||
</el-form-item>
|
||||
<el-form-item prop="tf_sign"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<pc-signature v-model="formData.tf_sign"></pc-signature>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
|
||||
<el-button @click="handleTaskAction(6)" size="small" type="info">退回到发起人</el-button>
|
||||
<el-button @click="handleTaskAction(2)" size="small" type="danger">拒绝申请</el-button>
|
||||
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意申请</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</guava>
|
||||
</div>
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include("../common/info.js"){}#-->
|
||||
<!--#include("../common/commonQuery.js"){}#-->
|
||||
<!--#include("../common/info.js"){}#-->
|
||||
<!--#include("../common/commonQuery.js"){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
@@ -102,89 +107,94 @@ layout("/layouts/platform.html"){
|
||||
{ prop: "loginName", label: "工号", sortable: true },
|
||||
{ prop: "userName", label: "姓名", sortable: true },
|
||||
{ prop: "userState", label: "在职状态", sortable: true },
|
||||
{ prop: "personType", label: "教职工类别", sortable: true },
|
||||
{ prop: "preparedBy", label: "编制类别", sortable: true },
|
||||
{ prop: "unionName", label: "所属工会", sortable: true },
|
||||
// { prop: "personType", label: "教职工类别", sortable: true },
|
||||
{ prop: "nativePlace", label: "籍贯", sortable: true },
|
||||
// { prop: "preparedBy", label: "编制类别", sortable: true },
|
||||
{ prop: "unionName", label: "所属工会", sortable: true },
|
||||
{ prop: "unitName", label: "所属单位", sortable: true },
|
||||
{ prop: "sign", label: "签字" },
|
||||
{ prop: "curTaskName", label: "当前节点" },
|
||||
{ prop: "instanceState", label: "流程状态" }
|
||||
// { prop: "sign", label: "签字" },
|
||||
{ prop: "curTaskName", label: "当前节点" },
|
||||
{ prop: "instanceState", label: "流程状态" }
|
||||
],
|
||||
|
||||
// 审核相关
|
||||
showApprovalForm: false,
|
||||
formData: {
|
||||
tf_opinion: ""
|
||||
},
|
||||
// 审核相关
|
||||
showApprovalForm: false,
|
||||
formData: {
|
||||
tf_opinion: ""
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': INFO,
|
||||
'common-query': COMMON_QUERY,
|
||||
"info": INFO,
|
||||
"common-query": COMMON_QUERY
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.edit(()=>{
|
||||
this.showApprovalForm = false
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
openView(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = false
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
openApproval(row) {
|
||||
this.$refs.guava.edit(()=>{
|
||||
this.showApprovalForm = true
|
||||
this.formData = {
|
||||
processTaskId: row.taskId,
|
||||
taskName: row.curTaskName
|
||||
}
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = true
|
||||
this.formData = {
|
||||
processTaskId: row.taskId,
|
||||
taskName: row.curTaskName
|
||||
}
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading()
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleTaskAction(val) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading()
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
},
|
||||
openRevoke(row) {
|
||||
this.$confirm("您确定要撤回吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then(() => {
|
||||
const loading = createLoading()
|
||||
this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(()=>{
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
this.$confirm("您确定要撤回吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then(() => {
|
||||
const loading = createLoading()
|
||||
this.$axios.post("/flow/common/revokeTask", { taskId: row.taskId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
},
|
||||
search(pageForm){
|
||||
if (pageForm) {
|
||||
this.pageForm = {...this.pageForm, ...pageForm}
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
search(pageForm) {
|
||||
if (pageForm) {
|
||||
this.pageForm = { ...this.pageForm, ...pageForm }
|
||||
}
|
||||
this.doSearch()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
|
||||
+6
-4
@@ -62,7 +62,7 @@ const COMMON_QUERY = {
|
||||
pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys)
|
||||
this.$emit('search', pageForm)
|
||||
},
|
||||
async initData(){
|
||||
initData(){
|
||||
if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])) {
|
||||
this.$businessTool.listUnion(this.pageForm.unionId).then((data) => {
|
||||
this.unions = data
|
||||
@@ -79,15 +79,17 @@ const COMMON_QUERY = {
|
||||
})
|
||||
}
|
||||
},
|
||||
async flushUnits(){
|
||||
flushUnits(){
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.units = []
|
||||
if (this.pageForm.unionId) {
|
||||
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
|
||||
this.$businessTool.listUnit(this.pageForm.unionId).then((data) => {
|
||||
this.units = data
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
created() {
|
||||
this.initData()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,21 +16,27 @@ const INFO = {
|
||||
|
||||
<el-descriptions-item label="学历">{{ viewData.education }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学位">{{ viewData.academicDegree }}</el-descriptions-item>
|
||||
<el-descriptions-item label="党政职务">{{ viewData.position }}</el-descriptions-item>
|
||||
<el-descriptions-item label="籍贯">{{ viewData.nativePlace }}</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="工作单位">{{ viewData.unitName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属工会">{{ viewData.unionName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属校区">{{ viewData.campus }}</el-descriptions-item>
|
||||
<el-descriptions-item label="岗位名称">{{ viewData.jobCategory }}</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="所属校区">{{ viewData.campus }}</el-descriptions-item>-->
|
||||
|
||||
<el-descriptions-item label="身份证号码">{{ viewData.idCard }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{ viewData.mobile }}</el-descriptions-item>
|
||||
<el-descriptions-item label="电子邮箱">{{ viewData.email }}</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="电子邮箱">{{ viewData.email }}</el-descriptions-item>-->
|
||||
|
||||
<el-descriptions-item label="在职状态">{{ viewData.userState }}</el-descriptions-item>
|
||||
<el-descriptions-item label="教职工类别">{{ viewData.personType }}</el-descriptions-item>
|
||||
<el-descriptions-item label="编制类别">{{ viewData.preparedBy }}</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="在职状态">{{ viewData.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>
|
||||
|
||||
|
||||
<template v-if="viewData.loginname == $store.state.user.loginname">
|
||||
</template>
|
||||
<el-descriptions-item label="家庭主要成员" :span="3">
|
||||
<el-table v-if="viewData.families&&viewData.families.length"
|
||||
:data="viewData.families" size="mini" border
|
||||
@@ -47,11 +53,20 @@ const INFO = {
|
||||
</el-table>
|
||||
<el-empty v-else :image-size="50" description="暂无家庭成员信息"></el-empty>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="个人简况" :span="3">
|
||||
<div v-if="viewData.personalData" class="text-left" v-html="viewData.personalData"></div>
|
||||
<el-descriptions-item label="个人学习及工作经历" :span="3">
|
||||
<div v-if="viewData.personalData" class="text-left w-e-text member-apply-rich-text" style="white-space: pre-wrap; word-break: break-all;" v-html="viewData.personalData"></div>
|
||||
<el-tag type="warning" v-else>暂无</el-tag>
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
<el-descriptions-item label="特长及获奖情况" :span="3">
|
||||
<div v-if="viewData.specialty" class="text-left w-e-text member-apply-rich-text" style="white-space: pre-wrap; word-break: break-all;" v-html="viewData.specialty"></div>
|
||||
<el-tag type="warning" v-else>暂无</el-tag>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="照片" :span="3" v-if="viewData.photo">
|
||||
<el-image :src="viewData.photo"
|
||||
style="width: 120px;height: 150px"
|
||||
fit="cover"></el-image>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="签字信息" :span="3" v-if="viewData.sign">
|
||||
<el-image :src="viewData.sign"
|
||||
@@ -91,8 +106,12 @@ const INFO = {
|
||||
</template>
|
||||
|
||||
<el-descriptions-item label="办理意见" :span="3" v-if="!task.ext.isFirstTaskNode">{{
|
||||
task.taskFormData.opinion }}
|
||||
task.taskFormData.tf_opinion }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="签字信息" :span="3" v-if="!task.ext.isFirstTaskNode">
|
||||
<el-image :src="task.taskFormData.tf_sign"
|
||||
class="signature-image"></el-image>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
+15
-11
@@ -111,17 +111,21 @@ const MEMBER_APPLY_AUDIT_INFO = {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async onOpen(id){
|
||||
const resp = await $.post('/platform/member/apply/mine/findMemberApplyRecord', {id})
|
||||
if (resp.code === 0) {
|
||||
this.viewData = resp.data
|
||||
this.$emit('union-name', this.viewData.userUnionName)
|
||||
if (this.viewData.families) {
|
||||
this.viewData.families = JSON.parse(this.viewData.families)
|
||||
} else {
|
||||
this.viewData.families = []
|
||||
}
|
||||
}
|
||||
onOpen(id){
|
||||
$.post("/platform/member/apply/mine/findMemberApplyRecord", {id})
|
||||
.then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.viewData = resp.data
|
||||
this.$emit('union-name', this.viewData.userUnionName)
|
||||
if (this.viewData.families) {
|
||||
this.viewData.families = JSON.parse(this.viewData.families)
|
||||
} else {
|
||||
this.viewData.families = []
|
||||
}
|
||||
}
|
||||
})
|
||||
.always(() => {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,12 +42,23 @@ layout("/layouts/platform.html"){
|
||||
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
|
||||
size="small"></enum-tag>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='taskName'">
|
||||
{{row.taskName}}
|
||||
<template v-if="row.auditUser">
|
||||
-{{row.auditUser}}
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="220" fixed="right">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button v-if="row.instanceState === 20"
|
||||
@click="exportApplyDocx(row.id)" size="mini" type="primary">
|
||||
导出申请表
|
||||
</el-button>
|
||||
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId"
|
||||
@click="onEdit(row)" size="mini" type="primary">
|
||||
编辑
|
||||
@@ -85,11 +96,11 @@ layout("/layouts/platform.html"){
|
||||
{ prop: "loginName", label: "工号", sortable: true },
|
||||
{ prop: "userName", label: "姓名", sortable: true },
|
||||
{ prop: "userState", label: "在职状态", sortable: true },
|
||||
{ prop: "personType", label: "教职工类别", sortable: true },
|
||||
{ prop: "preparedBy", label: "编制类别", sortable: true },
|
||||
// { prop: "personType", label: "教职工类别", sortable: true },
|
||||
{ prop: "nativePlace", label: "籍贯", sortable: true },
|
||||
{ prop: "unionName", label: "所属工会", sortable: true },
|
||||
{ prop: "unitName", label: "所属单位", sortable: true },
|
||||
{ prop: "sign", label: "签字" },
|
||||
// { prop: "sign", label: "签字" },
|
||||
{ prop: "taskName", label: "当前节点"},
|
||||
{ prop: "instanceState", label: "流程状态"}
|
||||
],
|
||||
@@ -102,6 +113,9 @@ layout("/layouts/platform.html"){
|
||||
'common-query': COMMON_QUERY,
|
||||
},
|
||||
methods: {
|
||||
exportApplyDocx(id) {
|
||||
this.$downLoad("/platform/member/apply/mine/exportApplyDocx", { id })
|
||||
},
|
||||
onApply() {
|
||||
commonUtil.pjaxPush('/platform/member/apply/submit')
|
||||
},
|
||||
|
||||
@@ -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>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+180
-170
@@ -2,111 +2,116 @@
|
||||
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>
|
||||
<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="申请列表">
|
||||
<el-radio-group @change="doSearch" class="mr5" size="small" v-model="pageForm.audit">
|
||||
<el-radio-button label="true">已审核</el-radio-button>
|
||||
<el-radio-button label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :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=='sign'">
|
||||
<el-image v-if="row.sign" :src="row.sign" style="height: 60px"></el-image>
|
||||
<el-tag type="warning" v-else>暂无</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 label="操作" fixed="right" width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openView(row)">查看</el-button>
|
||||
<el-button v-if="row.taskState === 10" @click="openApproval(row)" size="mini" type="primary">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button v-if="row.canRevoke" @click="openRevoke(row)" size="mini" type="danger">
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="申请列表">
|
||||
<el-radio-group @change="doSearch" class="mr5" size="small" v-model="pageForm.audit">
|
||||
<el-radio-button label="true">已审核</el-radio-button>
|
||||
<el-radio-button label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :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=='sign'">
|
||||
<el-image v-if="row.sign" :src="row.sign" style="height: 60px"></el-image>
|
||||
<el-tag type="warning" v-else>暂无</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 label="操作" fixed="right" width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openView(row)">查看</el-button>
|
||||
<el-button v-if="row.taskState === 10" @click="openApproval(row)" size="mini" type="primary">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button v-if="row.canRevoke" @click="openRevoke(row.taskId)" size="mini" type="danger">
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #edit>
|
||||
<info ref="infoRef">
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">
|
||||
{{formData.taskName}}
|
||||
</div>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="130px" label-suffix=":">
|
||||
<el-row :gutter="20" v-if="formData.origin === 'HMC'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="分配工会关系" prop="tf_allocation_unionId"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-select clearable filterable placeholder="请选择工会" style="width: 100%;"
|
||||
@change="assignmentUnionName"
|
||||
v-model="formData.tf_allocation_unionId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<template #edit>
|
||||
<info ref="infoRef">
|
||||
<div v-if="showApprovalForm">
|
||||
<div class="process-title">
|
||||
{{formData.taskName}}
|
||||
</div>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="130px" label-suffix=":">
|
||||
<el-row :gutter="20" v-if="formData.origin === 'HMC'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="分配工会关系" prop="tf_allocation_unionId"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-select clearable filterable placeholder="请选择工会" style="width: 100%;"
|
||||
@change="assignmentUnionName"
|
||||
v-model="formData.tf_allocation_unionId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="当前所在工会" prop="tf_self_unionName">
|
||||
<el-input v-model="formData.tf_self_unionName" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="当前所在工会" prop="tf_self_unionName">
|
||||
<el-input v-model="formData.tf_self_unionName" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="审批意见" prop="tf_opinion"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
|
||||
<el-button @click="handleTaskAction(6)" size="small" type="info">退回到发起人</el-button>
|
||||
<el-button @click="handleTaskAction(2)" size="small" type="danger">拒绝申请</el-button>
|
||||
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意申请</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</info>
|
||||
</template>
|
||||
<el-form-item label="审批意见" prop="tf_opinion"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
|
||||
</el-form-item>
|
||||
<el-form-item prop="tf_sign" label="签字"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<pc-signature v-model="formData.tf_sign"></pc-signature>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
|
||||
<el-button @click="handleTaskAction(6)" size="small" type="info">退回到发起人</el-button>
|
||||
<el-button @click="handleTaskAction(2)" size="small" type="danger">拒绝申请</el-button>
|
||||
<el-button @click="handleTaskAction(1)" size="small" type="primary">同意申请</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</guava>
|
||||
</div>
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include("../common/info.js"){}#-->
|
||||
<!--#include("../common/commonQuery.js"){}#-->
|
||||
<!--#include("../common/info.js"){}#-->
|
||||
<!--#include("../common/commonQuery.js"){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
@@ -120,78 +125,83 @@ layout("/layouts/platform.html"){
|
||||
{ prop: "loginName", label: "工号", sortable: true },
|
||||
{ prop: "userName", label: "姓名", sortable: true },
|
||||
{ prop: "userState", label: "在职状态", sortable: true },
|
||||
{ prop: "personType", label: "教职工类别", sortable: true },
|
||||
{ prop: "preparedBy", label: "编制类别", sortable: true },
|
||||
{ prop: "unionName", label: "所属工会", sortable: true },
|
||||
{ prop: "nativePlace", label: "籍贯", sortable: true },
|
||||
// { prop: "personType", label: "教职工类别", sortable: true },
|
||||
// { prop: "preparedBy", label: "编制类别", sortable: true },
|
||||
{ prop: "unionName", label: "所属工会", sortable: true },
|
||||
{ prop: "unitName", label: "所属单位", sortable: true },
|
||||
{ prop: "sign", label: "签字" },
|
||||
// { prop: "sign", label: "签字" },
|
||||
{ prop: "curTaskName", label: "当前节点" },
|
||||
{ prop: "instanceState", label: "流程状态" }
|
||||
{ prop: "instanceState", label: "流程状态" }
|
||||
],
|
||||
|
||||
// 审核相关
|
||||
showApprovalForm: false,
|
||||
formData: {
|
||||
tf_opinion: ""
|
||||
},
|
||||
unions: [],
|
||||
// 审核相关
|
||||
showApprovalForm: false,
|
||||
formData: {
|
||||
tf_opinion: ""
|
||||
},
|
||||
unions: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': INFO,
|
||||
'common-query': COMMON_QUERY,
|
||||
"info": INFO,
|
||||
"common-query": COMMON_QUERY
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.edit(()=>{
|
||||
this.showApprovalForm = false
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
openApproval(row) {
|
||||
this.$refs.guava.edit(()=>{
|
||||
this.showApprovalForm = true
|
||||
this.formData = {
|
||||
origin: row.origin,
|
||||
processTaskId: row.taskId,
|
||||
taskName: row.curTaskName
|
||||
}
|
||||
if (row.origin === "HMC") {
|
||||
this.$set(this.formData, "tf_self_unionName", this.$store.state.user.union.name)
|
||||
}
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
handleTaskAction(val) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading()
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = false
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
openApproval(row) {
|
||||
this.$refs.guava.edit(() => {
|
||||
this.showApprovalForm = true
|
||||
this.formData = {
|
||||
origin: row.origin,
|
||||
processTaskId: row.taskId,
|
||||
taskName: row.curTaskName
|
||||
}
|
||||
if (row.origin === "HMC") {
|
||||
this.$set(this.formData, "tf_self_unionName", this.$store.state.user.union.name)
|
||||
}
|
||||
this.$refs.infoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading()
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
openRevoke(taskId) {
|
||||
this.$confirm("您确定要撤回吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "info"
|
||||
}).then(() => {
|
||||
const loading = createLoading()
|
||||
const loading = createLoading()
|
||||
this.$axios.post("/flow/common/revokeTask", { taskId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
@@ -202,23 +212,23 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
})
|
||||
},
|
||||
search(pageForm){
|
||||
if (pageForm) {
|
||||
this.pageForm = {...this.pageForm, ...pageForm}
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
// 分配工会名称
|
||||
assignmentUnionName(val) {
|
||||
const union = this.unions.find(item => item.id === val)
|
||||
this.$set(this.formData, "tf_allocation_unionName", union.name)
|
||||
},
|
||||
search(pageForm) {
|
||||
if (pageForm) {
|
||||
this.pageForm = { ...this.pageForm, ...pageForm }
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
// 分配工会名称
|
||||
assignmentUnionName(val) {
|
||||
const union = this.unions.find(item => item.id === val)
|
||||
this.$set(this.formData, "tf_allocation_unionName", union.name)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
this.$businessTool.listUnion().then(data => {
|
||||
this.unions = data
|
||||
})
|
||||
this.pageData()
|
||||
this.$businessTool.listUnion().then(data => {
|
||||
this.unions = data
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -174,12 +174,7 @@
|
||||
v-model="formData.isVoluntary">
|
||||
<div>
|
||||
<span style="flex: 1; word-wrap: break-word; word-break: break-all; white-space: normal;">
|
||||
我自愿申请加入学校工会,并委托学校按规定代为扣缴工会会员会费。
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span style="flex: 1; word-wrap: break-word; word-break: break-all; white-space: normal;">
|
||||
我将严格遵守工会章程,认真执行工会决议,积极参与工会活动,主动融入“学校健康幸福家”建设,为营造温暖、和谐、奋进的校园氛围贡献力量,以实际行动助力学校各项事业发展。
|
||||
我自愿加入中华全国总工会,遵守工会章程,执行工会决议,积极参加工会活动,为把我国建设成为富强、民主、文明的社会主义国家而努力奋斗。
|
||||
</span>
|
||||
</div>
|
||||
</el-checkbox>
|
||||
@@ -367,26 +362,83 @@
|
||||
handleCancel() {
|
||||
|
||||
},
|
||||
async validateApply() {
|
||||
validateApply() {
|
||||
if (this.formData.id) {
|
||||
return
|
||||
}
|
||||
// const resp = await $.post('/platform/member/apply/submit/validateApply')
|
||||
// if (resp.code === 0 && resp.data > 0) {
|
||||
// this.$confirm("您有其他入会流程正在进行中,请勿重复申请,如需查看详情,可前往我的申请界面,是否前往?", "提示", { type: "warning" })
|
||||
// .then(() => {
|
||||
// this.member = true
|
||||
// this.$store.dispatch("pjaxRoute", "/platform/member/apply/mine")
|
||||
// })
|
||||
// .catch(() => {
|
||||
// this.member = true
|
||||
// })
|
||||
// }
|
||||
},
|
||||
async init() {
|
||||
init() {
|
||||
let user
|
||||
const resp = await $.post('/platform/member/apply/submit/getSelfUserInfo')
|
||||
if (resp.code === 0) {
|
||||
$.post("/platform/member/apply/submit/getSelfUserInfo", {})
|
||||
.then((resp) => {
|
||||
if (resp.code === 0 && resp.data) {
|
||||
user = resp.data
|
||||
} else {
|
||||
user = this.$store.state.user
|
||||
}
|
||||
this.member = user.member
|
||||
if (this.id) {
|
||||
this.$axios.post("/platform/member/apply/submit/findApplyById", { id: this.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.formData = res.data
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
const {
|
||||
id,
|
||||
username,
|
||||
loginname,
|
||||
sex,
|
||||
nation,
|
||||
birthday,
|
||||
political,
|
||||
education,
|
||||
academicDegree,
|
||||
position,
|
||||
unitId,
|
||||
unitName,
|
||||
unit,
|
||||
unionId,
|
||||
unionName,
|
||||
union,
|
||||
campus,
|
||||
userState,
|
||||
personType,
|
||||
idCard,
|
||||
mobile,
|
||||
email,
|
||||
families,
|
||||
personalData
|
||||
} = user
|
||||
|
||||
this.$set(this.formData, "userId", id)
|
||||
this.$set(this.formData, "username", username)
|
||||
this.$set(this.formData, "loginname", loginname)
|
||||
this.$set(this.formData, "birthday", birthday)
|
||||
this.$set(this.formData, "sex", sex)
|
||||
this.$set(this.formData, "idCard", idCard)
|
||||
this.$set(this.formData, "nation", nation)
|
||||
this.$set(this.formData, "political", political)
|
||||
this.$set(this.formData, "position", position)
|
||||
this.$set(this.formData, "education", education)
|
||||
this.$set(this.formData, "academicDegree", academicDegree)
|
||||
this.$set(this.formData, "campus", campus)
|
||||
this.$set(this.formData, "userState", userState)
|
||||
this.$set(this.formData, "personType", personType)
|
||||
this.$set(this.formData, "unitName", unit ? unit.name : unitName)
|
||||
this.$set(this.formData, "unitId", unit ? unit.id : unitId)
|
||||
this.$set(this.formData, "unionName", union ? union.name : unionName)
|
||||
this.$set(this.formData, "unionId", union ? union.id : unionId)
|
||||
|
||||
this.$set(this.formData, "mobile", mobile)
|
||||
this.$set(this.formData, "email", email)
|
||||
this.$set(this.formData, "families", families ? families : [])
|
||||
this.$set(this.formData, "personalData", personalData)
|
||||
})
|
||||
.always(() => {
|
||||
})
|
||||
/*if (resp.code === 0) {
|
||||
if (!resp.data) {
|
||||
user = this.$store.state.user
|
||||
} else {
|
||||
@@ -455,12 +507,15 @@
|
||||
this.$set(this.formData, "families", families ? families : [])
|
||||
this.$set(this.formData, "personalData", personalData)
|
||||
}
|
||||
*/
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
created() {
|
||||
this.init()
|
||||
this.units = await this.$businessTool.listUnit()
|
||||
await this.validateApply()
|
||||
this.$businessTool.listUnit().then((data) => {
|
||||
this.units = data
|
||||
})
|
||||
this.validateApply()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
+512
-415
@@ -2,439 +2,536 @@
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<snaker-start slot="header" label="入会申请" define_key="HYRH"></snaker-start>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=":" class="flow-task-form">
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="工号">
|
||||
<el-form-item prop="loginname">
|
||||
<el-input v-model="formData.loginname" readonly size="small"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名">
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="formData.username" readonly size="small"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">
|
||||
<el-form-item prop="sex">
|
||||
<el-radio-group v-model="formData.sex" size="small">
|
||||
<el-radio border label="男">男</el-radio>
|
||||
<el-radio border label="女">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-card shadow="never">
|
||||
<snaker-start slot="header" label="入会申请" define_key="HYRH"></snaker-start>
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=":"
|
||||
class="flow-task-form">
|
||||
<el-descriptions :column="3" border>
|
||||
<el-descriptions-item label="工号">
|
||||
<el-form-item prop="loginname">
|
||||
<el-input v-model="formData.loginname" readonly size="small"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名">
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="formData.username" readonly size="small"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">
|
||||
<el-form-item prop="sex">
|
||||
<el-radio-group v-model="formData.sex" size="small">
|
||||
<el-radio border label="男性">男性</el-radio>
|
||||
<el-radio border label="女性">女性</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="民族">
|
||||
<el-form-item prop="nation">
|
||||
<dict-select style="width: 100%" placeholder="请选择民族" v-model="formData.nation"
|
||||
code="USER_NATION"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="出生日期">
|
||||
<el-form-item prop="birthday">
|
||||
<el-date-picker v-model="formData.birthday" type="date"
|
||||
placeholder="请选择出生日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="政治面貌">
|
||||
<el-form-item prop="political">
|
||||
<dict-select style="width: 100%" placeholder="请选择政治面貌" v-model="formData.political"
|
||||
code="USER_POLITICAL"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="民族">
|
||||
<el-form-item prop="nation">
|
||||
<dict-select style="width: 100%" placeholder="请选择民族" v-model="formData.nation"
|
||||
code="USER_NATION"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="出生日期">
|
||||
<el-form-item prop="birthday">
|
||||
<el-date-picker v-model="formData.birthday" type="date"
|
||||
placeholder="请选择出生日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="政治面貌">
|
||||
<el-form-item prop="political">
|
||||
<dict-select style="width: 100%" placeholder="请选择政治面貌" v-model="formData.political"
|
||||
code="USER_POLITICAL"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
|
||||
<el-descriptions-item label="学历">
|
||||
<el-form-item prop="education">
|
||||
<dict-select style="width: 100%" placeholder="请选择学历" v-model="formData.education"
|
||||
code="USER_EDUCATION"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="学位">
|
||||
<el-form-item prop="academicDegree">
|
||||
<dict-select style="width: 100%" placeholder="请选择学位" v-model="formData.academicDegree"
|
||||
code="USER_ACADEMIC_DEGREE"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="党政职务">
|
||||
<el-form-item prop="position">
|
||||
<el-input v-model="formData.position" placeholder="请输入党政职务"
|
||||
maxlength="50"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="学历">
|
||||
<el-form-item prop="education">
|
||||
<dict-select style="width: 100%" placeholder="请选择学历" v-model="formData.education"
|
||||
code="USER_EDUCATION"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="学位">
|
||||
<el-form-item prop="academicDegree">
|
||||
<dict-select style="width: 100%" placeholder="请选择学位" v-model="formData.academicDegree"
|
||||
code="USER_ACADEMIC_DEGREE"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="籍贯">
|
||||
<el-form-item prop="nativePlace">
|
||||
<el-input v-model="formData.nativePlace" placeholder="请输入籍贯"
|
||||
maxlength="50"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="工作单位">
|
||||
<el-form-item prop="unitId">
|
||||
<el-select clearable filterable placeholder="请选择工作单位" style="width: 100%"
|
||||
disabled @change="getUnionName(formData.unitId)"
|
||||
v-model="formData.unitId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in units"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属工会">
|
||||
<el-form-item prop="unionName">
|
||||
<el-input v-model="formData.unionName" disabled placeholder="请输入所属工会"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属校区">
|
||||
<el-form-item prop="campus">
|
||||
<dict-select style="width: 100%" placeholder="请选择所属校区" v-model="formData.campus"
|
||||
code="USER_CAMPUS"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工作单位">
|
||||
<el-form-item prop="unitId">
|
||||
<el-select clearable filterable placeholder="请选择工作单位" style="width: 100%"
|
||||
disabled @change="getUnionName(formData.unitId)"
|
||||
v-model="formData.unitId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in units"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属工会">
|
||||
<el-form-item prop="unionName">
|
||||
<el-input v-model="formData.unionName" disabled placeholder="请输入所属工会"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="所属校区">
|
||||
<el-form-item prop="campus">
|
||||
<dict-select style="width: 100%" placeholder="请选择所属校区" v-model="formData.campus"
|
||||
code="USER_CAMPUS"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>-->
|
||||
|
||||
|
||||
<el-descriptions-item label="在职状态">
|
||||
<el-form-item prop="userState">
|
||||
<dict-select v-model="formData.userState" code="USER_STATE"
|
||||
disabled style="width: 100%"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="教职工类别">
|
||||
<el-form-item prop="personType">
|
||||
<dict-select v-model="formData.personType" code="USER_PERSON_TYPE"
|
||||
disabled style="width: 100%"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="编制类别">
|
||||
<el-form-item prop="preparedBy">
|
||||
<dict-select v-model="formData.preparedBy" code="USER_PREPARED_BY_TYPE"
|
||||
disabled style="width: 100%"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="岗位名称">
|
||||
<el-form-item prop="jobCategory">
|
||||
<el-input v-model="formData.jobCategory" placeholder="请输入岗位名称"
|
||||
maxlength="50"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="身份证号码">
|
||||
<el-form-item prop="idCard">
|
||||
<el-input v-model="formData.idCard" disabled placeholder="请输入身份证号码" maxlength="18"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">
|
||||
<el-form-item prop="mobile">
|
||||
<el-input v-model="formData.mobile" disabled placeholder="请输入联系电话" maxlength="32"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="电子邮箱">
|
||||
<el-form-item prop="email">
|
||||
<el-input v-model="formData.email" placeholder="请输入电子邮箱" maxlength="50"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="在职状态">
|
||||
<el-form-item prop="userState">
|
||||
<dict-select v-model="formData.userState" code="USER_STATE"
|
||||
disabled style="width: 100%"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>-->
|
||||
<!--<el-descriptions-item label="教职工类别">
|
||||
<el-form-item prop="personType">
|
||||
<dict-select v-model="formData.personType" code="USER_PERSON_TYPE"
|
||||
style="width: 100%"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>-->
|
||||
<!--<el-descriptions-item label="编制类别">
|
||||
<el-form-item prop="preparedBy">
|
||||
<dict-select v-model="formData.preparedBy" code="USER_PREPARED_BY_TYPE"
|
||||
disabled style="width: 100%"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>-->
|
||||
<el-descriptions-item label="婚姻状况">
|
||||
<el-form-item prop="marriage" label="婚姻状况">
|
||||
<dict-select v-model="formData.marriage" code="USER_MARRIAGE"
|
||||
style="width: 100%"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="身份证号码">
|
||||
<el-form-item prop="idCard">
|
||||
<el-input v-model="formData.idCard" disabled placeholder="请输入身份证号码"
|
||||
maxlength="18"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">
|
||||
<el-form-item prop="mobile">
|
||||
<el-input v-model="formData.mobile" disabled placeholder="请输入联系电话"
|
||||
maxlength="32"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="入职时间">
|
||||
<el-form-item prop="arrivalAtSchoolDate">
|
||||
<el-input v-model="formData.arrivalAtSchoolDate" placeholder="请输入入职时间"
|
||||
disabled maxlength="50"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="家庭住址" :span="3">
|
||||
<el-form-item prop="homeAddress" label="家庭住址">
|
||||
<el-input v-model="formData.homeAddress" placeholder="请输入家庭住址" maxlength="90"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="家庭主要成员" :span="3">
|
||||
<el-form-item prop="families">
|
||||
<el-table :data="formData.families" border size="small">
|
||||
<el-table-column label="关系" prop="relation">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.relation" maxlength="50"
|
||||
placeholder="请输入与本人关系"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" prop="name">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.name" maxlength="50" placeholder="请输入姓名"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作单位" prop="unit">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.unit" maxlength="100"
|
||||
placeholder="请输入工作单位"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.remark" maxlength="100" placeholder="请输入备注"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="100px">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<el-button type="primary" size="mini"
|
||||
@click="formData.families.push({})">添加
|
||||
</el-button>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="formData.families.length===0"
|
||||
@click="formData.families.splice(scope.$index,1)"
|
||||
></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="家庭主要成员" :span="3">
|
||||
<el-form-item prop="families">
|
||||
<el-table :data="formData.families" border size="small">
|
||||
<el-table-column label="关系" prop="relation">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.relation" maxlength="50"
|
||||
placeholder="请输入与本人关系"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" prop="name">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.name" maxlength="50" placeholder="请输入姓名"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作单位" prop="unit">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.unit" maxlength="100"
|
||||
placeholder="请输入工作单位"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.remark" maxlength="100" placeholder="请输入备注"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="100px">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<el-button type="primary" size="mini"
|
||||
@click="formData.families.push({})">添加
|
||||
</el-button>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="formData.families.length===0"
|
||||
@click="formData.families.splice(scope.$index,1)"
|
||||
></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="个人简况" :span="3">
|
||||
<el-form-item prop="personalData">
|
||||
<text-editor v-model="formData.personalData"></text-editor>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="个人学习及工作经历" :span="3">
|
||||
<el-form-item prop="personalData" label="个人学习及工作经历">
|
||||
<el-input type="textarea" :rows="4" v-model="formData.personalData"
|
||||
placeholder="请输入个人学习及工作经历"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="入会意愿" :span="3">
|
||||
<el-form-item prop="isVoluntary">
|
||||
<el-checkbox
|
||||
size="medium"
|
||||
style="width: 95%; color: #F56C6C; display: flex; align-items: center;"
|
||||
v-model="formData.isVoluntary">
|
||||
<div>
|
||||
<span style="flex: 1; word-wrap: break-word; word-break: break-all; white-space: normal;">
|
||||
我自愿申请加入学校工会,并委托学校按规定代为扣缴工会会员会费。
|
||||
<el-descriptions-item label="特长及获奖情况" :span="3">
|
||||
<el-form-item prop="specialty" label="特长及获奖情况">
|
||||
<el-input type="textarea" :rows="4" v-model="formData.specialty"
|
||||
maxlength="100" show-word-limit
|
||||
placeholder="请输入特长及获奖情况"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="照片" :span="3">
|
||||
<el-form-item prop="photo" label="照片">
|
||||
<file-upload
|
||||
:value.sync="formData.photo"
|
||||
:upload_number="1"
|
||||
upload_mode="image"
|
||||
upload_result_category="interval"
|
||||
upload_result_type="url"
|
||||
></file-upload>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="签字" :span="3">
|
||||
<el-form-item prop="sign">
|
||||
<pc-signature v-model="formData.sign"></pc-signature>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="入会意愿" :span="3">
|
||||
<el-form-item prop="isVoluntary">
|
||||
<el-checkbox
|
||||
size="medium"
|
||||
style="width: 95%; color: #F56C6C; display: flex; align-items: center;"
|
||||
v-model="formData.isVoluntary">
|
||||
|
||||
<div>
|
||||
<span
|
||||
style="flex: 1; word-wrap: break-word; word-break: break-all; white-space: normal;">
|
||||
我自愿加入中华全国总工会,遵守工会章程,执行工会决议,积极参加工会活动,为把我国建设成为富强、民主、文明的社会主义国家而努力奋斗。
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span style="flex: 1; word-wrap: break-word; word-break: break-all; white-space: normal;">
|
||||
我将严格遵守工会章程,认真执行工会决议,积极参与工会活动,主动融入“学校健康幸福家”建设,为营造温暖、和谐、奋进的校园氛围贡献力量,以实际行动助力学校各项事业发展。
|
||||
</span>
|
||||
</div>
|
||||
</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<!-- <el-descriptions-item label="签字" :span="3">-->
|
||||
<!-- <el-form-item prop="sign">-->
|
||||
<!-- <pc-signature v-model="formData.sign"></pc-signature>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
</el-descriptions>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end" class="mt20">
|
||||
<el-button type="primary" plain @click="onSave">保存</el-button>
|
||||
<el-button type="primary" @click="onSubmit" v-if="!taskId">提交</el-button>
|
||||
<el-button type="primary" @click="onFinishTask" v-else>提交</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-form>
|
||||
<el-row type="flex" justify="end" class="mt20">
|
||||
<el-button type="primary" plain @click="onSave" v-if="!taskId"
|
||||
:disabled="!canApply"
|
||||
:title="applyDisableMsg">保存</el-button>
|
||||
<el-button type="primary" @click="onSubmit" v-if="!taskId" v-if="!taskId"
|
||||
:disabled="!canApply"
|
||||
:title="applyDisableMsg">提交</el-button>
|
||||
<el-button type="primary" @click="onFinishTask" v-else>提交</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
id: GetQueryString("bizId"),
|
||||
taskId: GetQueryString("taskId"),
|
||||
units: [],
|
||||
formData: {
|
||||
families: []
|
||||
},
|
||||
formRules: {
|
||||
username: [{required: false, message: "必填", trigger: ["change", "blur"]}],
|
||||
sex: [{required: false, message: "必填", trigger: ["change", "blur"]}],
|
||||
isVoluntary: [{required: true, message: "必填", trigger: ["change", "blur"]}],
|
||||
sign: [{required: true, message: "必填", trigger: ["change", "blur"]}],
|
||||
/*email: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (!value) {
|
||||
callback();
|
||||
} else if (/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("邮箱格式错误"));
|
||||
}
|
||||
},
|
||||
trigger: ["change", "blur"]
|
||||
}
|
||||
],
|
||||
idCard: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (!value) {
|
||||
// 如果值为空,直接通过校验
|
||||
callback();
|
||||
} else if (/^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}(\d|[Xx])$/.test(value)) {
|
||||
// 18位身份证号码格式正确
|
||||
callback();
|
||||
} else if (/^[1-9]\d{7}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
||||
// 15位身份证号码格式正确
|
||||
callback();
|
||||
} else if (/^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
||||
// 外国人身份证号码格式正确(18位)
|
||||
callback();
|
||||
} else if (/^[1-9]\d{7}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
||||
// 外国人身份证号码格式正确(15位)
|
||||
callback();
|
||||
} else {
|
||||
// 格式错误,返回错误信息
|
||||
callback(new Error("身份证号码格式错误"));
|
||||
}
|
||||
},
|
||||
trigger: ["change", "blur"]
|
||||
}
|
||||
],
|
||||
mobile: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (!value) {
|
||||
// 如果值为空,直接通过校验
|
||||
callback();
|
||||
} else if (/^[1][345789][0-9]{9}$/.test(value)) {
|
||||
// 手机号格式正确
|
||||
callback();
|
||||
} else if (/^\d+-\d+$/.test(value) && value.length <= 16) {
|
||||
// 座机号格式正确
|
||||
callback();
|
||||
} else {
|
||||
// 格式错误,返回错误信息
|
||||
callback(new Error(value.includes('-') ? '座机号码格式错误' : '手机号码格式错误'));
|
||||
}
|
||||
},
|
||||
trigger: ["change", "blur"]
|
||||
}
|
||||
]*/
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSave() {
|
||||
this.$confirm("您确定保存吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading()
|
||||
this.$axios.post('/platform/member/apply/submit/save', {data: JSON.stringify(this.formData)}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
commonUtil.pjaxPush('/platform/member/apply/mine')
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
},
|
||||
onSubmit() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading()
|
||||
this.$axios.post('/platform/member/apply/submit/submit', {
|
||||
data: JSON.stringify(this.formData)
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
commonUtil.pjaxPush('/platform/member/apply/mine')
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onFinishTask() {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading()
|
||||
this.$axios.post('/platform/member/apply/submit/submitAgain', {
|
||||
data: JSON.stringify(this.formData),
|
||||
taskId: this.taskId,
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
commonUtil.pjaxPush('/platform/member/apply/mine')
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
},
|
||||
async init() {
|
||||
let user
|
||||
const resp = await $.post('/platform/member/apply/submit/getSelfUserInfo')
|
||||
if (resp.code === 0) {
|
||||
if (!resp.data) {
|
||||
user = this.$store.state.user
|
||||
} else {
|
||||
user = resp.data
|
||||
}
|
||||
} else {
|
||||
user = this.$store.state.user
|
||||
}
|
||||
new Vue({
|
||||
el: "#app",
|
||||
store,
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
id: GetQueryString("bizId"),
|
||||
taskId: GetQueryString("taskId"),
|
||||
units: [],
|
||||
formData: {
|
||||
families: []
|
||||
},
|
||||
canApply: true,
|
||||
applyDisableMsg: '',
|
||||
formRules: {
|
||||
username: [{ required: false, message: "必填", trigger: ["change", "blur"] }],
|
||||
sex: [{ required: false, message: "必填", trigger: ["change", "blur"] }],
|
||||
isVoluntary: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
|
||||
sign: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
|
||||
photo: [{ required: true, message: "请上传照片", trigger: ["change", "blur"] }],
|
||||
homeAddress: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
|
||||
families: [{
|
||||
validator: (rule, value, callback) => {
|
||||
// 提交时家庭主要成员至少填写一条,并校验核心成员信息。
|
||||
if (!value || value.length === 0) {
|
||||
callback(new Error("请添加家庭主要成员"))
|
||||
return
|
||||
}
|
||||
const hasIncomplete = value.some(item => {
|
||||
item = item || {}
|
||||
return !String(item.relation || "").trim()
|
||||
|| !String(item.name || "").trim()
|
||||
|| !String(item.unit || "").trim()
|
||||
})
|
||||
if (hasIncomplete) {
|
||||
callback(new Error("请完善家庭主要成员的关系、姓名、工作单位"))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
},
|
||||
trigger: ["change", "blur"]
|
||||
}],
|
||||
personalData: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
|
||||
specialty: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
|
||||
marriage: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
|
||||
arrivalAtSchoolDate: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
|
||||
nativePlace: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
|
||||
jobCategory: [{ required: true, message: "必填", trigger: ["change", "blur"] }]
|
||||
/*email: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (!value) {
|
||||
callback();
|
||||
} else if (/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("邮箱格式错误"));
|
||||
}
|
||||
},
|
||||
trigger: ["change", "blur"]
|
||||
}
|
||||
],
|
||||
idCard: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (!value) {
|
||||
// 如果值为空,直接通过校验
|
||||
callback();
|
||||
} else if (/^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}(\d|[Xx])$/.test(value)) {
|
||||
// 18位身份证号码格式正确
|
||||
callback();
|
||||
} else if (/^[1-9]\d{7}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
||||
// 15位身份证号码格式正确
|
||||
callback();
|
||||
} else if (/^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
||||
// 外国人身份证号码格式正确(18位)
|
||||
callback();
|
||||
} else if (/^[1-9]\d{7}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
||||
// 外国人身份证号码格式正确(15位)
|
||||
callback();
|
||||
} else {
|
||||
// 格式错误,返回错误信息
|
||||
callback(new Error("身份证号码格式错误"));
|
||||
}
|
||||
},
|
||||
trigger: ["change", "blur"]
|
||||
}
|
||||
],
|
||||
mobile: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (!value) {
|
||||
// 如果值为空,直接通过校验
|
||||
callback();
|
||||
} else if (/^[1][345789][0-9]{9}$/.test(value)) {
|
||||
// 手机号格式正确
|
||||
callback();
|
||||
} else if (/^\d+-\d+$/.test(value) && value.length <= 16) {
|
||||
// 座机号格式正确
|
||||
callback();
|
||||
} else {
|
||||
// 格式错误,返回错误信息
|
||||
callback(new Error(value.includes('-') ? '座机号码格式错误' : '手机号码格式错误'));
|
||||
}
|
||||
},
|
||||
trigger: ["change", "blur"]
|
||||
}
|
||||
]*/
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkApplyPermission() {
|
||||
if (this.id || this.taskId) {
|
||||
this.canApply = true;
|
||||
this.applyDisableMsg = '';
|
||||
return;
|
||||
}
|
||||
this.$axios.post("/platform/member/apply/submit/findOne", { id: this.formData.userId }).then(res => {
|
||||
if (res.code === 0 && res.data) {
|
||||
this.canApply = res.data.canApply;
|
||||
this.applyDisableMsg = res.data.msg || '';
|
||||
|
||||
if (this.id) {
|
||||
const res = await this.$axios.post("/platform/member/apply/submit/findApplyById", { id: this.id })
|
||||
debugger
|
||||
if (res.code === 0) {
|
||||
this.formData = res.data
|
||||
}
|
||||
} else {
|
||||
const {
|
||||
id,
|
||||
username,
|
||||
loginname,
|
||||
sex,
|
||||
nation,
|
||||
birthday,
|
||||
political,
|
||||
education,
|
||||
academicDegree,
|
||||
position,
|
||||
unitId,
|
||||
unitName,
|
||||
unit,
|
||||
unionId,
|
||||
unionName,
|
||||
union,
|
||||
campus,
|
||||
userState,
|
||||
personType,
|
||||
preparedBy,
|
||||
idCard,
|
||||
mobile,
|
||||
email,
|
||||
families,
|
||||
personalData
|
||||
} = user
|
||||
if (!this.canApply) {
|
||||
this.$message.warning(this.applyDisableMsg);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
onSave() {
|
||||
this.$confirm("您确定保存吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading()
|
||||
this.$axios.post("/platform/member/apply/submit/save", { data: JSON.stringify(this.formData) }).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
commonUtil.pjaxPush("/platform/member/apply/mine")
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
},
|
||||
onSubmit() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading()
|
||||
this.$axios.post("/platform/member/apply/submit/submit", {
|
||||
data: JSON.stringify(this.formData)
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
commonUtil.pjaxPush("/platform/member/apply/mine")
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
onFinishTask() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
const loading = createLoading()
|
||||
this.$axios.post("/platform/member/apply/submit/submitAgain", {
|
||||
data: JSON.stringify(this.formData),
|
||||
taskId: this.taskId
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
commonUtil.pjaxPush("/platform/member/apply/mine")
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
init() {
|
||||
let user
|
||||
$.post("/platform/member/apply/submit/getSelfUserInfo", {})
|
||||
.then((resp) => {
|
||||
if (resp.code === 0 && resp.data) {
|
||||
user = resp.data
|
||||
} else {
|
||||
user = this.$store.state.user
|
||||
}
|
||||
if (this.id) {
|
||||
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,
|
||||
arrivalAtSchoolDate,
|
||||
position,
|
||||
unitId,
|
||||
unitName,
|
||||
unit,
|
||||
unionId,
|
||||
unionName,
|
||||
union,
|
||||
campus,
|
||||
userState,
|
||||
personType,
|
||||
preparedBy,
|
||||
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, "preparedBy", preparedBy)
|
||||
this.$set(this.formData, "unitName", unit ? unit.name : unitName)
|
||||
this.$set(this.formData, "unitId", unit ? unit.id : unitId)
|
||||
this.$set(this.formData, "unionName", union ? union.name : unionName)
|
||||
this.$set(this.formData, "unionId", union ? union.id : unionId)
|
||||
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, "preparedBy", preparedBy)
|
||||
this.$set(this.formData, "unitName", unit ? unit.name : unitName)
|
||||
this.$set(this.formData, "unitId", unit ? unit.id : unitId)
|
||||
this.$set(this.formData, "unionName", union ? union.name : unionName)
|
||||
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)
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
this.$businessTool.listUnit().then((data) => {
|
||||
this.units = data
|
||||
})
|
||||
}
|
||||
})
|
||||
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)
|
||||
this.$set(this.formData, "arrivalAtSchoolDate", arrivalAtSchoolDate ? this.$moment(arrivalAtSchoolDate).format('YYYY-MM-DD') : "")
|
||||
this.checkApplyPermission()
|
||||
})
|
||||
.always(() => {
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
this.$businessTool.listUnit().then((data) => {
|
||||
this.units = data
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
|
||||
+306
@@ -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>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
+11
@@ -736,6 +736,17 @@ layout("/layouts/platform_h5.html"){
|
||||
const identity = this.reimbursementIdentityOption.find((item) => item.code === this.formData.reimbursementIdentity)
|
||||
if (identity) {
|
||||
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() {
|
||||
|
||||
+122
-51
@@ -34,10 +34,10 @@ layout("/layouts/platform_h5.html"){
|
||||
readonly
|
||||
:rules="[{ required: true }]"
|
||||
placeholder="请点击选择慰问对象"
|
||||
@click="helpUserSelectShow = true"
|
||||
@click="openUserSelect('help')"
|
||||
is-link
|
||||
></van-field>
|
||||
<van-action-sheet v-model="helpUserSelectShow" title="慰问对象" class="height100">
|
||||
<van-action-sheet v-model="helpUserSelectShow" @close="resetUserSearch" title="慰问对象" class="height100">
|
||||
<van-search
|
||||
v-model="searchKeyword"
|
||||
:show-action="false"
|
||||
@@ -65,12 +65,13 @@ layout("/layouts/platform_h5.html"){
|
||||
name="payUserName"
|
||||
label="收款人"
|
||||
required
|
||||
readonly
|
||||
:rules="[{ required: true }]"
|
||||
placeholder="请点击选择收款人"
|
||||
@click="payUserSelectShow = true"
|
||||
@click="openUserSelect('pay')"
|
||||
is-link
|
||||
></van-field>
|
||||
<van-action-sheet v-model="payUserSelectShow" title="收款人" class="height100">
|
||||
<van-action-sheet v-model="payUserSelectShow" @close="resetUserSearch" title="收款人" class="height100">
|
||||
<van-search
|
||||
v-model="searchKeyword"
|
||||
:show-action="false"
|
||||
@@ -101,12 +102,12 @@ layout("/layouts/platform_h5.html"){
|
||||
readonly
|
||||
:rules="[{ required: true }]"
|
||||
placeholder="请点击选择慰问类型"
|
||||
@click="showTypePicker = true"
|
||||
@click="this.$set(this, 'showTypePicker', true)"
|
||||
clickable
|
||||
is-link
|
||||
></van-field>
|
||||
<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-field
|
||||
@@ -140,15 +141,15 @@ layout("/layouts/platform_h5.html"){
|
||||
clickable
|
||||
is-link
|
||||
readonly
|
||||
@click="showTimePicker = true"
|
||||
@click="openTimePicker"
|
||||
></van-field>
|
||||
<van-popup position="bottom" round v-model:show="showTimePicker">
|
||||
<van-datetime-picker
|
||||
v-model="formData.occurTime"
|
||||
v-model="timePickerValue"
|
||||
type="date"
|
||||
title="请选择慰问时间"
|
||||
@confirm="(val) => {formData.occurTime = $moment(val).format('YYYY-MM-DD'); showTimePicker = false}"
|
||||
@cancel="showTimePicker = false"
|
||||
@confirm="onTimeConfirm"
|
||||
@cancel="this.$set(this, 'showTimePicker', false)"
|
||||
></van-datetime-picker>
|
||||
</van-popup>
|
||||
|
||||
@@ -163,15 +164,15 @@ layout("/layouts/platform_h5.html"){
|
||||
clickable
|
||||
is-link
|
||||
readonly
|
||||
@click="showChildPicker = true"
|
||||
@click="this.$set(this, 'showChildPicker', true)"
|
||||
></van-field>
|
||||
<van-popup position="bottom" round v-model:show="showChildPicker">
|
||||
<van-picker
|
||||
title="请选择孩次"
|
||||
show-toolbar
|
||||
:columns="['一孩', '二孩', '三孩']"
|
||||
@confirm="(val) => {formData.child = val; showChildPicker = false}"
|
||||
@cancel="showChildPicker = false"
|
||||
@confirm="(val) => {this.$set(formData, 'child', val); this.$set(this, 'showChildPicker', false)}"
|
||||
@cancel="this.$set(this, 'showChildPicker', false)"
|
||||
></van-picker>
|
||||
</van-popup>
|
||||
|
||||
@@ -223,15 +224,15 @@ layout("/layouts/platform_h5.html"){
|
||||
clickable
|
||||
is-link
|
||||
readonly
|
||||
@click="showFamilyPicker = true"
|
||||
@click="this.$set(this, 'showFamilyPicker', true)"
|
||||
></van-field>
|
||||
<van-popup position="bottom" round v-model:show="showFamilyPicker">
|
||||
<van-picker
|
||||
title="请选择直系亲属"
|
||||
show-toolbar
|
||||
:columns="['配偶', '父亲', '母亲', '子女']"
|
||||
@confirm="(val) => {formData.deadImmediateFamily = val; showFamilyPicker = false}"
|
||||
@cancel="showFamilyPicker = false"
|
||||
@confirm="(val) => {this.$set(formData, 'deadImmediateFamily', val); this.$set(this, 'showFamilyPicker', false)}"
|
||||
@cancel="this.$set(this, 'showFamilyPicker', false)"
|
||||
></van-picker>
|
||||
</van-popup>
|
||||
|
||||
@@ -255,7 +256,7 @@ layout("/layouts/platform_h5.html"){
|
||||
{{ '(附件说明:' + chooseType.uploadFileDesc + ')' }}
|
||||
</span>
|
||||
</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>
|
||||
<h5-file-upload
|
||||
slot="input"
|
||||
@@ -269,7 +270,7 @@ layout("/layouts/platform_h5.html"){
|
||||
</van-cell-group>
|
||||
|
||||
<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>
|
||||
<h5-signature v-model="formData.signature" slot="input"></h5-signature>
|
||||
</template>
|
||||
@@ -278,9 +279,9 @@ layout("/layouts/platform_h5.html"){
|
||||
|
||||
<!-- 提交按钮 -->
|
||||
<div class="form-actions">
|
||||
<van-button native-type="button" @click="onSave" round type="info" plain>保存申请</van-button>
|
||||
<van-button @click="onSubmit" 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="onSave" :loading="formLoading" :disabled="formLoading" round type="info" plain>保存申请</van-button>
|
||||
<van-button native-type="button" @click="onSubmit" :loading="formLoading" :disabled="formLoading" round type="info" v-if="!taskId">提交申请</van-button>
|
||||
<van-button native-type="button" @click="onFinishTask" :loading="formLoading" :disabled="formLoading" round type="info" v-else>提交申请</van-button>
|
||||
</div>
|
||||
</van-form>
|
||||
</div>
|
||||
@@ -296,7 +297,8 @@ layout("/layouts/platform_h5.html"){
|
||||
taskId: GetQueryString("taskId"),
|
||||
formData: {},
|
||||
|
||||
chooseType: {},
|
||||
formLoading: false,
|
||||
userSearchSequence: 0,
|
||||
userOptions: [],
|
||||
typeOptions: [],
|
||||
|
||||
@@ -307,20 +309,64 @@ layout("/layouts/platform_h5.html"){
|
||||
searchKeyword: '',
|
||||
|
||||
showTimePicker: false,
|
||||
timePickerValue: new Date(),
|
||||
showChildPicker: false,
|
||||
showFamilyPicker: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 详情和类型列表任意顺序返回都重新匹配;未匹配时保证附件区域可安全读取属性。
|
||||
chooseType() {
|
||||
return this.typeOptions.find(o => o.id === this.formData.type) || {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async userRemoteMethod(event, type) {
|
||||
if (event) {
|
||||
this.userOptions = await this.selectQueryUser(event)
|
||||
type === 'help' ? this.helpUserSelectShow = true : this.payUserSelectShow = true
|
||||
}
|
||||
// 打开人员选择时清除上次搜索,并使之前尚未返回的请求失效。
|
||||
openUserSelect(type) {
|
||||
this.resetUserSearch()
|
||||
this.$set(this, type === 'help' ? 'helpUserSelectShow' : 'payUserSelectShow', true)
|
||||
},
|
||||
async selectQueryUser(keyword) {
|
||||
const res = await this.$axios.post("/platform/condolence/apply/listUser", { keyword: keyword })
|
||||
return res.data
|
||||
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) {
|
||||
const { id, userName, loginName, unitId, unitName, unionId, unionName } = user
|
||||
@@ -345,53 +391,78 @@ layout("/layouts/platform_h5.html"){
|
||||
this.userOptions = []
|
||||
},
|
||||
typeChange(id) {
|
||||
this.chooseType = this.typeOptions.find(o => o.id === id)
|
||||
if (this.chooseType) {
|
||||
this.$set(this.formData, "money", this.chooseType.money)
|
||||
this.$set(this.formData, "way", this.chooseType.way)
|
||||
// 仅用户主动选择时联动金额和方式,详情回显保留历史申请值。
|
||||
const type = this.typeOptions.find(o => o.id === id)
|
||||
if (type) {
|
||||
this.$set(this.formData, "money", type.money)
|
||||
this.$set(this.formData, "way", type.way)
|
||||
}
|
||||
},
|
||||
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, "type", o.value)
|
||||
this.typeChange(o.value)
|
||||
this.showTypePicker = false
|
||||
},
|
||||
onSave() {
|
||||
this.$dialog.confirm({
|
||||
// 从确认框开始锁定操作,取消或请求结束后统一解除,避免重复保存。
|
||||
if (this.formLoading) return
|
||||
this.formLoading = true
|
||||
return this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定保存吗?"
|
||||
}).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) {
|
||||
this.$toast(res.msg)
|
||||
this.$pjaxReplace("/platform/condolence/mine/h5")
|
||||
}
|
||||
})
|
||||
}).catch((error) => {
|
||||
if (error !== 'cancel' && error !== 'close') this.$toast('保存失败,请重试')
|
||||
}).finally(() => {
|
||||
this.formLoading = false
|
||||
})
|
||||
},
|
||||
async onSubmit() {
|
||||
this.$refs.formRef.validate().then(() => {
|
||||
this.$dialog.confirm({
|
||||
onSubmit() {
|
||||
if (this.formLoading) return
|
||||
return this.$refs.formRef.validate().then(() => {
|
||||
// 公共校验失败会停止 Promise 链,因此校验通过后才加锁,并再次拦截并发点击。
|
||||
if (this.formLoading) return
|
||||
this.formLoading = true
|
||||
return this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要提交申请吗?"
|
||||
}).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) {
|
||||
this.$toast(res.msg)
|
||||
this.$pjaxReplace("/platform/condolence/mine/h5")
|
||||
}
|
||||
})
|
||||
}).catch((error) => {
|
||||
if (error !== 'cancel' && error !== 'close') this.$toast('提交失败,请重试')
|
||||
}).finally(() => {
|
||||
this.formLoading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
async onFinishTask() {
|
||||
this.$refs.formRef.validate().then(() => {
|
||||
this.$dialog.confirm({
|
||||
onFinishTask() {
|
||||
if (this.formLoading) return
|
||||
return this.$refs.formRef.validate().then(() => {
|
||||
// 重新提交与首次提交共用操作锁,校验未通过时保持按钮可用。
|
||||
if (this.formLoading) return
|
||||
this.formLoading = true
|
||||
return this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要提交申请吗?"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/condolence/apply/submitAgain", {
|
||||
return this.$axios.post("/platform/condolence/apply/submitAgain", {
|
||||
data: JSON.stringify(this.formData),
|
||||
taskId: GetQueryString("taskId")
|
||||
}).then(res => {
|
||||
@@ -400,6 +471,10 @@ layout("/layouts/platform_h5.html"){
|
||||
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) => {
|
||||
if (res.code === 0) {
|
||||
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 {
|
||||
@@ -429,10 +501,9 @@ layout("/layouts/platform_h5.html"){
|
||||
queryCondolenceType() {
|
||||
this.$axios.post('/platform/condolence/type/queryCondolenceType')
|
||||
.then((res) => {
|
||||
this.typeOptions = JSON.parse(JSON.stringify(res.data))
|
||||
res.data.forEach((v) => {
|
||||
this.typeColumns.push({ value: v.id, text: v.name + "(" + v.code + ")" })
|
||||
})
|
||||
// Result.code 为 0 时 data 为类型数组;异常响应使用空列表,重复加载不累积选项。
|
||||
this.typeOptions = res && res.code === 0 && Array.isArray(res.data) ? res.data : []
|
||||
this.typeColumns = this.typeOptions.map(v => ({ value: v.id, text: v.name + "(" + v.code + ")" }))
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
+39
-32
@@ -59,6 +59,11 @@ layout("/layouts/platform_h5.html"){
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
></van-field>
|
||||
<van-field class="more-text" name="tf_sign" label="" required>
|
||||
<template #input>
|
||||
<h5-signature v-model="formData.tf_sign" slot="input"></h5-signature>
|
||||
</template>
|
||||
</van-field>
|
||||
</van-form>
|
||||
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
|
||||
<van-button type="danger" block @click="handleTaskAction(6)">退回</van-button>
|
||||
@@ -127,33 +132,34 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
},
|
||||
|
||||
async handleTaskAction(val) {
|
||||
await this.$refs.formRef.validate();
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要提交吗?"
|
||||
}).then(() => {
|
||||
const loading = this.$toast.loading({
|
||||
message: "加载中...",
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.infoRef.onClose()
|
||||
this.$toast.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate().then(() => {
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要提交吗?"
|
||||
}).then(() => {
|
||||
const loading = this.$toast.loading({
|
||||
message: "加载中...",
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.infoRef.onClose()
|
||||
this.$toast.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 撤回
|
||||
@@ -182,7 +188,7 @@ layout("/layouts/platform_h5.html"){
|
||||
initUnion() {
|
||||
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
|
||||
const unionId = hasAdmin ? null : this.$store.state.user.union.id
|
||||
this.$businessTool.listUnion(unionId).then((data) => {
|
||||
return this.$businessTool.listUnion(unionId).then((data) => {
|
||||
this.unionList = data
|
||||
this.unionList.forEach((v) => {
|
||||
v.text = v.name
|
||||
@@ -199,7 +205,7 @@ layout("/layouts/platform_h5.html"){
|
||||
flushUnits() {
|
||||
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
|
||||
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id
|
||||
this.$businessTool.listUnit(unionId).then((data) => {
|
||||
return this.$businessTool.listUnit(unionId).then((data) => {
|
||||
this.unitList = data
|
||||
this.unitList.forEach((v) => {
|
||||
v.text = v.name
|
||||
@@ -212,9 +218,10 @@ layout("/layouts/platform_h5.html"){
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.initUnion()
|
||||
await this.flushUnits()
|
||||
created() {
|
||||
this.initUnion().then(() => {
|
||||
this.flushUnits()
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -13,51 +13,80 @@ const INFO = {
|
||||
|
||||
<van-cell title="学历">{{ viewData.education }}</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.unitName }}</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.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.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">
|
||||
<van-cell title="家庭成员" class="column-cell">
|
||||
<table class="family-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="table-header">序号</th>
|
||||
<th class="table-header">与本人关系</th>
|
||||
<th class="table-header">姓名</th>
|
||||
<th class="table-header">单位</th>
|
||||
<th class="table-header">备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="table-row" v-for="(item, index) in viewData.families" :key="index">
|
||||
<td class="table-cell">{{ index + 1 }}</td>
|
||||
<td class="table-cell">{{ item.relation }}</td>
|
||||
<td class="table-cell">{{ item.name }}</td>
|
||||
<td class="table-cell">{{ item.unit }}</td>
|
||||
<td class="table-cell">{{ item.remark }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</van-cell>
|
||||
|
||||
<van-cell title="个人简历">
|
||||
<template #label>
|
||||
<div v-if="viewData.vita" class="text-left" v-html="viewData.vita"></div>
|
||||
<span style="font-size: 14px" v-else>无数据</span>
|
||||
</template>
|
||||
</van-cell>
|
||||
</template>
|
||||
<van-cell title="家庭成员" class="column-cell">
|
||||
<table class="family-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="table-header">序号</th>
|
||||
<th class="table-header">与本人关系</th>
|
||||
<th class="table-header">姓名</th>
|
||||
<th class="table-header">单位</th>
|
||||
<th class="table-header">备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="table-row" v-for="(item, index) in viewData.families" :key="index">
|
||||
<td class="table-cell">{{ index + 1 }}</td>
|
||||
<td class="table-cell">{{ item.relation }}</td>
|
||||
<td class="table-cell">{{ item.name }}</td>
|
||||
<td class="table-cell">{{ item.unit }}</td>
|
||||
<td class="table-cell">{{ item.remark }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</van-cell>
|
||||
|
||||
<van-cell title="个人学习及工作经历">
|
||||
<template #label>
|
||||
<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>
|
||||
</template>
|
||||
</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>
|
||||
</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>
|
||||
|
||||
<template v-for="task in doneTasks">
|
||||
@@ -76,12 +105,17 @@ const INFO = {
|
||||
</van-cell>
|
||||
<van-cell title="办理时间">{{ task.finishTime }}</van-cell>
|
||||
<van-cell title="办理结果">
|
||||
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT"
|
||||
:value="task.ext.caseFilingResult"></dict-tag>
|
||||
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
|
||||
:value="task.ext.submitType"></dict-tag>
|
||||
</van-cell>
|
||||
<van-cell title="办理意见" v-if="!task.ext.isFirstTaskNode" class="direction-column-cell">
|
||||
<div v-html="task.taskFormData.tf_opinion"></div>
|
||||
</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>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -32,7 +32,7 @@ layout("/layouts/platform_h5.html"){
|
||||
<table-column label="所属工会">{{row.unionName}}</table-column>
|
||||
<table-column label="工作单位">{{row.unitName}}</table-column>
|
||||
<table-column label="填报时间">{{row.applyDateTime}}</table-column>
|
||||
<table-column label="当前节点">{{row.curTaskName}}</table-column>
|
||||
<table-column label="当前节点">{{row.taskName}}<span v-if="row.auditUser">-{{row.auditUser}}</span></table-column>
|
||||
</template>
|
||||
<template #actions="{index,row}">
|
||||
<div class="action-btn" @click="onView(row)">
|
||||
@@ -149,38 +149,43 @@ layout("/layouts/platform_h5.html"){
|
||||
this.flushUnits()
|
||||
this.doSearch()
|
||||
},
|
||||
async initUnion() {
|
||||
initUnion() {
|
||||
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
|
||||
const unionId = hasAdmin ? null : this.$store.state.user.union.id
|
||||
this.unionList = await this.$businessTool.listUnion(unionId)
|
||||
this.unionList.forEach((v) => {
|
||||
v.text = v.name
|
||||
v.value = v.id
|
||||
})
|
||||
if (hasAdmin) {
|
||||
this.unionList.unshift({ text: "全部工会", value: null })
|
||||
}
|
||||
if (this.unionList && this.unionList.length > 0) {
|
||||
this.$set(this.pageForm, "unionId", this.unionList[0].value)
|
||||
}
|
||||
return this.$businessTool.listUnion(unionId).then((data) => {
|
||||
this.unionList = data
|
||||
this.unionList.forEach((v) => {
|
||||
v.text = v.name
|
||||
v.value = v.id
|
||||
})
|
||||
if (hasAdmin) {
|
||||
this.unionList.unshift({ text: "全部工会", value: null })
|
||||
}
|
||||
if (this.unionList && this.unionList.length > 0) {
|
||||
this.$set(this.pageForm, "unionId", this.unionList[0].value)
|
||||
}
|
||||
})
|
||||
},
|
||||
async flushUnits() {
|
||||
flushUnits() {
|
||||
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
|
||||
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id
|
||||
this.unitList = await this.$businessTool.listUnit(unionId)
|
||||
this.unitList.forEach((v) => {
|
||||
v.text = v.name
|
||||
v.value = v.id
|
||||
})
|
||||
this.unitList.unshift({ text: "全部单位", value: null })
|
||||
if (this.unitList && this.unitList.length > 0) {
|
||||
this.$set(this.pageForm, "unitId", this.unitList[0].value)
|
||||
}
|
||||
return this.$businessTool.listUnit(unionId).then((data) => {
|
||||
this.unitList = data
|
||||
this.unitList.forEach((v) => {
|
||||
v.text = v.name
|
||||
v.value = v.id
|
||||
})
|
||||
this.unitList.unshift({ text: "全部单位", value: null })
|
||||
if (this.unitList && this.unitList.length > 0) {
|
||||
this.$set(this.pageForm, "unitId", this.unitList[0].value)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.initUnion()
|
||||
await this.flushUnits()
|
||||
created() {
|
||||
this.initUnion().then(() => {
|
||||
this.flushUnits()
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
+46
-39
@@ -59,6 +59,11 @@ layout("/layouts/platform_h5.html"){
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
></van-field>
|
||||
<van-field class="more-text" name="tf_sign" label="" required>
|
||||
<template #input>
|
||||
<h5-signature v-model="formData.tf_sign" slot="input"></h5-signature>
|
||||
</template>
|
||||
</van-field>
|
||||
</van-form>
|
||||
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
|
||||
<van-button type="danger" block @click="handleTaskAction(6)">退回</van-button>
|
||||
@@ -127,33 +132,34 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
},
|
||||
|
||||
async handleTaskAction(val) {
|
||||
await this.$refs.formRef.validate();
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要提交吗?"
|
||||
}).then(() => {
|
||||
const loading = this.$toast.loading({
|
||||
message: "加载中...",
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.infoRef.onClose()
|
||||
this.$toast.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate().then(() => {
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要提交吗?"
|
||||
}).then(() => {
|
||||
const loading = this.$toast.loading({
|
||||
message: "加载中...",
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.infoRef.onClose()
|
||||
this.$toast.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 撤回
|
||||
@@ -168,7 +174,7 @@ layout("/layouts/platform_h5.html"){
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
this.$axios.post('/flow/common/revokeTask', {taskId: row.startTaskId}).then(res => {
|
||||
this.$axios.post('/flow/common/revokeTask', {taskId: row.taskId}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$toast.success('撤回成功');
|
||||
this.doSearch();
|
||||
@@ -179,10 +185,10 @@ layout("/layouts/platform_h5.html"){
|
||||
})
|
||||
},
|
||||
|
||||
initUnion() {
|
||||
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
|
||||
const unionId = hasAdmin ? null : this.$store.state.user.union.id
|
||||
this.$businessTool.listUnion(unionId).then((data) => {
|
||||
initUnion() {
|
||||
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
|
||||
const unionId = hasAdmin ? null : this.$store.state.user.union.id
|
||||
return this.$businessTool.listUnion(unionId).then((data) => {
|
||||
this.unionList = data
|
||||
this.unionList.forEach((v) => {
|
||||
v.text = v.name
|
||||
@@ -196,10 +202,10 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
})
|
||||
},
|
||||
flushUnits() {
|
||||
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
|
||||
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id
|
||||
this.$businessTool.listUnit(unionId).then((data) => {
|
||||
flushUnits() {
|
||||
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
|
||||
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id
|
||||
return this.$businessTool.listUnit(unionId).then((data) => {
|
||||
this.unitList = data
|
||||
this.unitList.forEach((v) => {
|
||||
v.text = v.name
|
||||
@@ -212,9 +218,10 @@ layout("/layouts/platform_h5.html"){
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.initUnion()
|
||||
await this.flushUnits()
|
||||
created() {
|
||||
this.initUnion().then(() => {
|
||||
this.flushUnits()
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
+693
-489
File diff suppressed because it is too large
Load Diff
+40
-38
@@ -127,33 +127,34 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
},
|
||||
|
||||
async handleTaskAction(val) {
|
||||
await this.$refs.formRef.validate();
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要提交吗?"
|
||||
}).then(() => {
|
||||
const loading = this.$toast.loading({
|
||||
message: "加载中...",
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.infoRef.onClose()
|
||||
this.$toast.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
handleTaskAction(val) {
|
||||
this.$refs.formRef.validate().then(() => {
|
||||
this.$dialog.confirm({
|
||||
title: "提示",
|
||||
message: "您确定要提交吗?"
|
||||
}).then(() => {
|
||||
const loading = this.$toast.loading({
|
||||
message: "加载中...",
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
duration: 0
|
||||
})
|
||||
this.$axios.post("/flow/common/executeTask", {
|
||||
data: JSON.stringify({
|
||||
...this.formData,
|
||||
submitType: val
|
||||
})
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$refs.infoRef.onClose()
|
||||
this.$toast.success(res.msg)
|
||||
this.doSearch()
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
// 撤回
|
||||
@@ -180,10 +181,10 @@ layout("/layouts/platform_h5.html"){
|
||||
});
|
||||
},
|
||||
|
||||
initUnion() {
|
||||
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
|
||||
const unionId = hasAdmin ? null : this.$store.state.user.union.id
|
||||
this.$businessTool.listUnion(unionId).then((data) => {
|
||||
initUnion() {
|
||||
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
|
||||
const unionId = hasAdmin ? null : this.$store.state.user.union.id
|
||||
return this.$businessTool.listUnion(unionId).then((data) => {
|
||||
this.unionList = data
|
||||
this.unionList.forEach((v) => {
|
||||
v.text = v.name
|
||||
@@ -197,10 +198,10 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
})
|
||||
},
|
||||
flushUnits() {
|
||||
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
|
||||
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id
|
||||
this.$businessTool.listUnit(unionId).then((data) => {
|
||||
flushUnits() {
|
||||
const hasAdmin = this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])
|
||||
const unionId = hasAdmin ? this.pageForm.unionId : this.$store.state.user.union.id
|
||||
return this.$businessTool.listUnit(unionId).then((data) => {
|
||||
this.unitList = data
|
||||
this.unitList.forEach((v) => {
|
||||
v.text = v.name
|
||||
@@ -213,9 +214,10 @@ layout("/layouts/platform_h5.html"){
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.initUnion()
|
||||
await this.flushUnits()
|
||||
created() {
|
||||
this.initUnion().then(() => {
|
||||
this.flushUnits()
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -176,11 +176,12 @@ const todo = {
|
||||
// 处理任务
|
||||
onView(task) {
|
||||
const {taskId, taskKey, instanceId, businessNo, formKey, h5FormKey} = task;
|
||||
if (!h5FormKey) {
|
||||
const h5Url = h5FormKey || task.h5formkey
|
||||
if (!h5Url) {
|
||||
this.$toast("请到电脑端智慧工会系统审核");
|
||||
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)
|
||||
},
|
||||
|
||||
// 获取空状态文本
|
||||
|
||||
Reference in New Issue
Block a user