commit
This commit is contained in:
+28
-2
@@ -27,6 +27,7 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ActivitySportsInfoManageController
|
||||
@@ -151,12 +152,37 @@ public class ActivitySportsInfoManageController {
|
||||
@SLog(tag = "体育活动", msg = "修改活动")
|
||||
@SaCheckPermission("activity.sports.info")
|
||||
public Result doEdit(@Param(value = "data") ActivitySchool activitySchool,
|
||||
@Param(value = "events") ActivitySchoolEvent[] events) {
|
||||
activitySportsService.doEdit(activitySchool, events);
|
||||
@Param(value = "events") ActivitySchoolEvent[] events,
|
||||
@Param(value = "forceReduceTeam") boolean forceReduceTeam) {
|
||||
// 编辑活动减少队伍时,先把即将删除且已有报名人员的队伍返回给前端二次确认;确认后由 service 继续保存。
|
||||
List<NutMap> teamApplyList = activitySportsService.checkTeamReduceApply(activitySchool.getId(), events);
|
||||
if (!forceReduceTeam && teamApplyList.size() > 0) {
|
||||
return Result.NEW().addCode(2).addMsg(buildTeamReduceMsg(teamApplyList)).addData(teamApplyList);
|
||||
}
|
||||
activitySportsService.doEdit(activitySchool, events, forceReduceTeam);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
private String buildTeamReduceMsg(List<NutMap> teamApplyList) {
|
||||
// 返回给前端确认框的报名占用说明:包含项目名称、队伍名称、报名人数,便于用户判断是否强制删除。
|
||||
StringBuilder msg = new StringBuilder();
|
||||
for (NutMap teamApply : teamApplyList) {
|
||||
if (msg.length() > 0) {
|
||||
msg.append(";");
|
||||
}
|
||||
msg.append("项目【")
|
||||
.append(teamApply.getString("eventName"))
|
||||
.append("】的【")
|
||||
.append(teamApply.getString("teamName"))
|
||||
.append("】已有")
|
||||
.append(teamApply.getInt("applyNum"))
|
||||
.append("名报名人员");
|
||||
}
|
||||
msg.append(",确认删除这些队伍并保存吗?");
|
||||
return msg.toString();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@SLog(tag = "体育活动", msg = "添加活动")
|
||||
|
||||
+13
-77
@@ -5,28 +5,21 @@ 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.models.ActivitySchoolEvent;
|
||||
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.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
|
||||
@@ -53,11 +46,12 @@ public class ActivitySportsResultsController {
|
||||
|
||||
@At
|
||||
@SaCheckPermission("activity.results.input")
|
||||
public Result pageData(String groupName,
|
||||
PageForm page,
|
||||
public Result pageData(PageForm page,
|
||||
String activityId,
|
||||
String eventId,
|
||||
String[] isMenWomen) {
|
||||
Integer isMenWomen,
|
||||
String projectType,
|
||||
String competitionCategory) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -77,24 +71,10 @@ public class ActivitySportsResultsController {
|
||||
$condition
|
||||
""");
|
||||
cnd.and("ase.activityId", "=", activityId);
|
||||
cnd.andEX("abs.`name`", "=", groupName);
|
||||
cnd.andEX("ae.`id`", "=", eventId);
|
||||
SqlExpressionGroup sqlExpressionGroup = new SqlExpressionGroup();
|
||||
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.andEX("ae.isMenWomen", "=", isMenWomen);
|
||||
cnd.andEX("ae.projectType", "=", projectType);
|
||||
cnd.andEX("ae.competitionCategory", "=", competitionCategory);
|
||||
cnd.desc("allName");
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(baseService.listPageMap(page.getPageNumber(), page.getPageSize(), sql));
|
||||
@@ -114,53 +94,7 @@ public class ActivitySportsResultsController {
|
||||
@At
|
||||
@SaCheckPermission("activity.results.input")
|
||||
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.setApplyDate(DateUtil.getDate());
|
||||
activitySchoolApply.setSex(user.getSex());
|
||||
activitySchoolApply.setUnitId(user.getUnitId());
|
||||
activitySchoolApply.setActivityUnionId(basicUnion.getId());
|
||||
activitySchoolApply.setActivityUnionName(basicUnion.getName());
|
||||
activitySchoolApplyViService.insert(activitySchoolApply);
|
||||
});
|
||||
return null;
|
||||
}
|
||||
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);
|
||||
|
||||
activitySchoolApplyViService.doAddTemporaryApplyUser(activitySchoolApply);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@@ -201,8 +135,10 @@ public class ActivitySportsResultsController {
|
||||
@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);
|
||||
// 团体成绩录入的人数按活动项目配置的“每队(项)运动员人数”展示,不再按该分工会实际报名人数统计。
|
||||
ActivitySchoolEvent schoolEvent = activitySchoolApplyViService.dao().fetch(ActivitySchoolEvent.class,
|
||||
Cnd.where("activityId", "=", activityId).and("eventId", "=", eventId));
|
||||
return Result.success(schoolEvent == null || schoolEvent.getAthletesMaxNum() == null ? 0 : schoolEvent.getAthletesMaxNum());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -188,6 +188,11 @@ public class ActivitySchool extends BaseModel implements Serializable , SysHomeC
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String belongClubId;
|
||||
|
||||
@Column
|
||||
@Comment("报多队工会")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<String> moreTeamUnionIds;
|
||||
|
||||
@Column
|
||||
@Comment("创建时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
|
||||
+2
@@ -23,6 +23,8 @@ public interface ActivitySportsApplyUserService extends BaseService<ActivityScho
|
||||
|
||||
Object getUniteApplyInfo(ActivitySportsApplyUserPageParam applyUserPageParam, Integer isMenWomen);
|
||||
|
||||
void doAddTemporaryApplyUser(ActivitySchoolApply activitySchoolApply);
|
||||
|
||||
void doApplyUser(ActivitySchoolApply[] userList, String eventId, String activityId, Boolean pass, String unionId);
|
||||
|
||||
Pagination applyPageData(PageForm page, String activityId, String eventId, String unionId);
|
||||
|
||||
@@ -4,8 +4,10 @@ package com.budwk.app.zhgh.activity.sports.service;
|
||||
import com.budwk.app.base.service.BaseService;
|
||||
import com.budwk.app.zhgh.activity.sports.models.ActivitySchool;
|
||||
import com.budwk.app.zhgh.activity.sports.models.ActivitySchoolEvent;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Aaron
|
||||
@@ -14,7 +16,9 @@ public interface ActivitySportsService extends BaseService<ActivitySchool> {
|
||||
|
||||
String doAdd(ActivitySchool activitySchool, ActivitySchoolEvent[] events);
|
||||
|
||||
void doEdit(ActivitySchool activitySchool, ActivitySchoolEvent[] events);
|
||||
void doEdit(ActivitySchool activitySchool, ActivitySchoolEvent[] events, boolean forceReduceTeam);
|
||||
|
||||
List<NutMap> checkTeamReduceApply(String activityId, ActivitySchoolEvent[] events);
|
||||
|
||||
void doDelete(String id);
|
||||
|
||||
|
||||
+102
-3
@@ -6,6 +6,7 @@ import com.budwk.app.base.constant.RoleConstant;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||
import com.budwk.app.base.utils.PwdUtil;
|
||||
import com.budwk.app.sys.models.Sys_user;
|
||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
@@ -30,6 +31,7 @@ import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -365,9 +367,10 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
|
||||
result.put("awardsModeT", awardsModeT);
|
||||
result.put("awardsModeG", awardsModeG);
|
||||
|
||||
result.put("team", dao().query(ActivitySchoolTeam.class,
|
||||
Cnd.where("eventId", "=", applyUserPageParam.getEventId())
|
||||
.and("activityId", "=", applyUserPageParam.getActivityId()).asc("location")));
|
||||
boolean allowMoreTeam = allowMoreTeam(activity);
|
||||
result.put("allowMoreTeam", allowMoreTeam);
|
||||
// 团体项目队伍范围按活动“报多队工会”控制:命中的工会返回全部队伍,否则只返回第一队。
|
||||
result.put("team", getApplyTeamList(applyUserPageParam.getActivityId(), applyUserPageParam.getEventId(), allowMoreTeam));
|
||||
|
||||
result.put("activity", activity);
|
||||
List<NutMap> events = getEvents(applyUserPageParam.getActivityId());
|
||||
@@ -377,12 +380,80 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void doAddTemporaryApplyUser(ActivitySchoolApply activitySchoolApply) {
|
||||
// 成绩录入临时补报名:单项只补人员和工会,团体还需要补默认第1队,保证后续团体成绩下拉能出现该工会。
|
||||
Sys_user sysUser = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", activitySchoolApply.getLoginname()));
|
||||
if (sysUser != null && sysUser.getLoginname().equals(activitySchoolApply.getLoginname()) && !sysUser.getUsername().equals(activitySchoolApply.getUsername())) {
|
||||
throw Lang.makeThrow("工号已存在,请检查姓名和工号是否一致!");
|
||||
}
|
||||
if (sysUser == null) {
|
||||
sysUser = createTemporaryUser(activitySchoolApply);
|
||||
} else {
|
||||
sysUser.setSex(activitySchoolApply.getSex());
|
||||
update(sysUser);
|
||||
}
|
||||
fillTemporaryApplyUser(activitySchoolApply, sysUser);
|
||||
insert(activitySchoolApply);
|
||||
}
|
||||
|
||||
private Sys_user createTemporaryUser(ActivitySchoolApply activitySchoolApply) {
|
||||
// 临时人员不存在系统账号时,按原逻辑创建基础账号,保证报名记录能关联 userId。
|
||||
String pwd = "@dd3s#3618!";
|
||||
String salt = R.UU32();
|
||||
Sys_user user = new Sys_user();
|
||||
user.setId(R.UU32());
|
||||
user.setSalt(salt);
|
||||
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());
|
||||
dao().insert(user);
|
||||
return user;
|
||||
}
|
||||
|
||||
private void fillTemporaryApplyUser(ActivitySchoolApply activitySchoolApply, Sys_user sysUser) {
|
||||
ActivityBasicUnit activityBasicUnit = dao().fetch(ActivityBasicUnit.class, Cnd.where("id", "=", sysUser.getUnitId()));
|
||||
if (activityBasicUnit == null) {
|
||||
throw Lang.makeThrow("未找到临时人员所属单位!");
|
||||
}
|
||||
ActivityBasicUnion basicUnion = dao().fetch(ActivityBasicUnion.class, Cnd.where("id", "=", activityBasicUnit.getUnionId()));
|
||||
if (basicUnion == null) {
|
||||
throw Lang.makeThrow("未找到临时人员所属工会!");
|
||||
}
|
||||
activitySchoolApply.setUserId(sysUser.getId());
|
||||
activitySchoolApply.setApplyUser(SecurityUtil.getUserId());
|
||||
activitySchoolApply.setApplyDate(DateUtil.now());
|
||||
activitySchoolApply.setSex(sysUser.getSex());
|
||||
activitySchoolApply.setUnitId(sysUser.getUnitId());
|
||||
activitySchoolApply.setUnionId(basicUnion.getId());
|
||||
activitySchoolApply.setActivityUnionId(basicUnion.getId());
|
||||
activitySchoolApply.setActivityUnionName(basicUnion.getName());
|
||||
activitySchoolApply.setStatus(activitySchoolApply.getStatus() == null ? 2 : activitySchoolApply.getStatus());
|
||||
if ("2".equals(activitySchoolApply.getAwardsMode())) {
|
||||
ActivitySchoolTeam team = getFirstTeam(activitySchoolApply.getActivityId(), activitySchoolApply.getEventId());
|
||||
if (team == null) {
|
||||
throw Lang.makeThrow("当前团体项目未创建队伍,无法添加临时人员!");
|
||||
}
|
||||
activitySchoolApply.setTeamId(team.getId());
|
||||
activitySchoolApply.setTeam(team.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void doApplyUser(ActivitySchoolApply[] userList, String eventId, String activityId, Boolean pass, String unionId) {
|
||||
|
||||
ActivityBasicUnit basicUnit = dao().fetch(ActivityBasicUnit.class, Cnd.where("id", "=", SecurityUtil.getUnitId()));
|
||||
ActivityBasicUnion basicUnion = dao().fetch(ActivityBasicUnion.class, Cnd.where("id", "=", StrUtil.isNotBlank(unionId) ? unionId : basicUnit.getUnionId()));
|
||||
ActivitySchool activity = dao().fetch(ActivitySchool.class, activityId);
|
||||
ActivitySchoolTeam firstTeam = null;
|
||||
if (!allowMoreTeam(activity)) {
|
||||
firstTeam = getFirstTeam(activityId, eventId);
|
||||
}
|
||||
|
||||
|
||||
for (ActivitySchoolApply apply : userList) {
|
||||
@@ -391,6 +462,11 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
|
||||
apply.setApplyDate(DateUtil.now());
|
||||
apply.setActivityUnionId(basicUnion.getId());
|
||||
apply.setActivityUnionName(basicUnion.getName());
|
||||
// 未配置为可报多队的工会,保存时统一落到第一队,避免绕过前端提交其他队伍。
|
||||
if (firstTeam != null) {
|
||||
apply.setTeamId(firstTeam.getId());
|
||||
apply.setTeam(firstTeam.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -411,6 +487,29 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
|
||||
|
||||
}
|
||||
|
||||
private boolean allowMoreTeam(ActivitySchool activity) {
|
||||
// 当前登录人工会在活动“报多队工会”列表中时,才允许选择第一队以外的队伍。
|
||||
return activity != null
|
||||
&& activity.getMoreTeamUnionIds() != null
|
||||
&& activity.getMoreTeamUnionIds().contains(getUnionId());
|
||||
}
|
||||
|
||||
private List<ActivitySchoolTeam> getApplyTeamList(String activityId, String eventId, boolean allowMoreTeam) {
|
||||
List<ActivitySchoolTeam> teams = dao().query(ActivitySchoolTeam.class,
|
||||
Cnd.where("eventId", "=", eventId)
|
||||
.and("activityId", "=", activityId)
|
||||
.asc("location"));
|
||||
if (allowMoreTeam || teams.size() <= 1) {
|
||||
return teams;
|
||||
}
|
||||
return teams.subList(0, 1);
|
||||
}
|
||||
|
||||
private ActivitySchoolTeam getFirstTeam(String activityId, String eventId) {
|
||||
List<ActivitySchoolTeam> teams = getApplyTeamList(activityId, eventId, false);
|
||||
return teams.size() > 0 ? teams.get(0) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination applyPageData(PageForm page, String activityId, String eventId, String unionId) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
+87
-1
@@ -9,6 +9,7 @@ import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.base.utils.DateUtil;
|
||||
import com.budwk.app.sys.models.Sys_home_activity;
|
||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||
import com.budwk.app.zhgh.activity.basic.models.ActivityEvent;
|
||||
import com.budwk.app.zhgh.activity.basic.models.ActivityBasicUnit;
|
||||
import com.budwk.app.zhgh.activity.culture.models.ActivityTissue;
|
||||
import com.budwk.app.zhgh.activity.sports.models.ActivitySchool;
|
||||
@@ -28,6 +29,7 @@ import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
@@ -96,7 +98,11 @@ public class ActivitySportsServiceImpl extends BaseServiceImpl<ActivitySchool> i
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void doEdit(ActivitySchool activitySchool, ActivitySchoolEvent[] events) {
|
||||
public void doEdit(ActivitySchool activitySchool, ActivitySchoolEvent[] events, boolean forceReduceTeam) {
|
||||
// 防止绕过 controller 直接调用编辑逻辑时误删已有报名人员使用的队伍,未确认时直接中断本次保存。
|
||||
if (!forceReduceTeam && checkTeamReduceApply(activitySchool.getId(), events).size() > 0) {
|
||||
throw Lang.makeThrow("减少队伍时存在已报名人员,请确认后再保存");
|
||||
}
|
||||
ActivitySchool school = dao().fetch(ActivitySchool.class, activitySchool.getId());
|
||||
if (school.getActivityLevel() == 40002) {
|
||||
school.setBelongUnionId(SecurityUtil.getUnionId());
|
||||
@@ -126,6 +132,7 @@ public class ActivitySportsServiceImpl extends BaseServiceImpl<ActivitySchool> i
|
||||
}
|
||||
for (ActivitySchoolEvent event : events) {
|
||||
update(event);
|
||||
syncTeam(activitySchool.getId(), event);
|
||||
}
|
||||
dao().delete(ActivityTissue.class, activitySchool.getId());
|
||||
ActivityTissue activityTissue = new ActivityTissue();
|
||||
@@ -157,6 +164,85 @@ public class ActivitySportsServiceImpl extends BaseServiceImpl<ActivitySchool> i
|
||||
dao().insertOrUpdate(sysHomeActivity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> checkTeamReduceApply(String activityId, ActivitySchoolEvent[] events) {
|
||||
// 检查“最多创建几队”减少后将被删除的队伍,返回仍有报名人员占用的队伍清单给前端确认。
|
||||
List<NutMap> result = new ArrayList<>();
|
||||
if (Strings.isBlank(activityId) || events == null || events.length == 0) {
|
||||
return result;
|
||||
}
|
||||
for (ActivitySchoolEvent event : events) {
|
||||
if (event == null || Strings.isBlank(event.getEventId()) || "allItems".equals(event.getEventId()) || event.getRestrictTotalTeam() == null) {
|
||||
continue;
|
||||
}
|
||||
List<ActivitySchoolTeam> reduceTeams = getReduceTeams(activityId, event);
|
||||
if (reduceTeams.size() == 0) {
|
||||
continue;
|
||||
}
|
||||
ActivityEvent activityEvent = dao().fetch(ActivityEvent.class, event.getEventId());
|
||||
for (ActivitySchoolTeam team : reduceTeams) {
|
||||
int applyNum = dao().count(ActivitySchoolApply.class, Cnd.where("activityId", "=", activityId)
|
||||
.and("eventId", "=", event.getEventId())
|
||||
.and("teamId", "=", team.getId()));
|
||||
if (applyNum > 0) {
|
||||
result.add(NutMap.NEW()
|
||||
.setv("eventId", event.getEventId())
|
||||
.setv("eventName", activityEvent == null ? "" : activityEvent.getAllName())
|
||||
.setv("teamId", team.getId())
|
||||
.setv("teamName", team.getName())
|
||||
.setv("applyNum", applyNum));
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<ActivitySchoolTeam> getReduceTeams(String activityId, ActivitySchoolEvent event) {
|
||||
// 按队伍位置保留前 N 队,超过目标队伍数的部分就是本次减少队伍时需要删除的队伍。
|
||||
List<ActivitySchoolTeam> teams = dao().query(ActivitySchoolTeam.class, Cnd.where("activityId", "=", activityId)
|
||||
.and("eventId", "=", event.getEventId())
|
||||
.asc("location"));
|
||||
int targetTotalTeam = event.getRestrictTotalTeam() == null ? 0 : Math.max(event.getRestrictTotalTeam(), 0);
|
||||
List<ActivitySchoolTeam> reduceTeams = new ArrayList<>();
|
||||
for (int i = targetTotalTeam; i < teams.size(); i++) {
|
||||
reduceTeams.add(teams.get(i));
|
||||
}
|
||||
return reduceTeams;
|
||||
}
|
||||
|
||||
private void syncTeam(String schoolId, ActivitySchoolEvent event) {
|
||||
// 保存项目时同步 activity_school_team:增加队伍只补插缺少的队伍,减少队伍只删除超过目标数量的后续队伍。
|
||||
if (event == null || Strings.isBlank(event.getEventId()) || "allItems".equals(event.getEventId()) || event.getRestrictTotalTeam() == null) {
|
||||
return;
|
||||
}
|
||||
List<ActivitySchoolTeam> teams = dao().query(ActivitySchoolTeam.class, Cnd.where("activityId", "=", schoolId)
|
||||
.and("eventId", "=", event.getEventId())
|
||||
.asc("location"));
|
||||
int currentTotalTeam = teams.size();
|
||||
int targetTotalTeam = Math.max(event.getRestrictTotalTeam(), 0);
|
||||
for (int i = 0; i < teams.size(); i++) {
|
||||
ActivitySchoolTeam team = teams.get(i);
|
||||
team.setMinNum(event.getRestrictMinNum());
|
||||
team.setMaxNum(event.getRestrictMaxNum());
|
||||
dao().updateIgnoreNull(team);
|
||||
}
|
||||
if (targetTotalTeam > currentTotalTeam) {
|
||||
for (int i = currentTotalTeam + 1; i <= targetTotalTeam; i++) {
|
||||
ActivitySchoolTeam team = new ActivitySchoolTeam();
|
||||
team.setActivityId(schoolId);
|
||||
team.setEventId(event.getEventId());
|
||||
team.setName(String.format("第%d队", i));
|
||||
team.setMinNum(event.getRestrictMinNum());
|
||||
team.setMaxNum(event.getRestrictMaxNum());
|
||||
dao().insert(team);
|
||||
}
|
||||
} else if (targetTotalTeam < currentTotalTeam) {
|
||||
for (int i = targetTotalTeam; i < teams.size(); i++) {
|
||||
dao().delete(ActivitySchoolTeam.class, teams.get(i).getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
private void addTeam(String schoolId, ActivitySchoolEvent[] events) {
|
||||
if (events.length > 0) {
|
||||
|
||||
+103
-39
@@ -38,7 +38,7 @@ layout("/layouts/platform.html"){
|
||||
<div class="search-item-label">活动项目</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.eventId" placeholder="请选择活动项目" filterable clearable
|
||||
style="width: 100%" @change="doSearchS">
|
||||
style="width: 100%" @change="doSearch">
|
||||
<el-option
|
||||
v-for="item in events"
|
||||
:key="item.eventId"
|
||||
@@ -49,6 +49,51 @@ layout("/layouts/platform.html"){
|
||||
</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>
|
||||
@@ -125,7 +170,7 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
|
||||
<template #edit_func>
|
||||
<el-button type="primary" @click="openAdd" v-if="awardsMode==1">临时获奖人员添加</el-button>
|
||||
<el-button type="primary" @click="openAdd">临时获奖人员添加</el-button>
|
||||
<el-button type="primary" @click="doAdd">确 定</el-button>
|
||||
</template>
|
||||
|
||||
@@ -431,11 +476,14 @@ layout("/layouts/platform.html"){
|
||||
return {
|
||||
|
||||
userOptions: [],
|
||||
groupList: [
|
||||
{value: 1, name: "甲组"},
|
||||
{value: 2, name: "乙组"},
|
||||
{value: 3, name: "丙组"},
|
||||
{value: 4, name: "丁组"}
|
||||
groupList: [],
|
||||
menWomenList: [
|
||||
{id: 1, name: "男子"},
|
||||
{id: 2, name: "女子"}
|
||||
],
|
||||
projectTypeList: [
|
||||
{id: "1", name: "单项"},
|
||||
{id: "2", name: "团体"}
|
||||
],
|
||||
dialogVisible: false,
|
||||
viewData: [],
|
||||
@@ -465,7 +513,9 @@ layout("/layouts/platform.html"){
|
||||
{name: "第八名", id: 8}],
|
||||
sexList: [{sex: "男", id: 1}, {sex: "女", id: 2}],
|
||||
pageForm: {
|
||||
isMenWomen: [],
|
||||
isMenWomen: "",
|
||||
projectType: "",
|
||||
competitionCategory: "",
|
||||
year: new Date().getFullYear() + "",
|
||||
},
|
||||
formRules: {
|
||||
@@ -511,7 +561,7 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
async unitChange() {
|
||||
const unit = this.unitOptions.find(v => v.id === this.formData.unitId)
|
||||
this.$set(this.formData, "unionId", unit.id)
|
||||
this.$set(this.formData, "unionId", unit.unionId)
|
||||
this.$set(this.formData, "unionname", unit.unionName)
|
||||
this.$set(this.formData, "unitname", unit.name)
|
||||
},
|
||||
@@ -545,8 +595,14 @@ layout("/layouts/platform.html"){
|
||||
pageForm.identity = JSON.stringify(this.formData.identity)
|
||||
const resp = await this.$axios.post(loc() + "/doAddUser", pageForm)
|
||||
if (resp.code === 0) {
|
||||
await this.userChange()
|
||||
this.userDetailsChange()
|
||||
if (this.awardsMode == 2) {
|
||||
this.unionList = await this.getUnionList({activityId: this.activityId, eventId: this.eventId})
|
||||
this.userData = await this.getUnionData({activityId: this.activityId, eventId: this.eventId})
|
||||
await this.unionDetailsChange()
|
||||
} else {
|
||||
await this.userChange()
|
||||
this.userDetailsChange()
|
||||
}
|
||||
this.dialogVisible = false
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
@@ -554,21 +610,24 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
})
|
||||
},
|
||||
async yearChange() {
|
||||
yearChange() {
|
||||
this.activityList = []
|
||||
this.events = []
|
||||
this.$set(this.pageForm, "activityId", "")
|
||||
this.$set(this.pageForm, "eventId", "")
|
||||
const {data} = await this.$axios.post("/platform/activity/score/statistics/getActivitys", {year: this.pageForm.year})
|
||||
this.activityList = data
|
||||
if (data.length > 0) {
|
||||
this.pageForm.activityId = this.activityList[0].id
|
||||
}
|
||||
await this.doSearchS()
|
||||
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()
|
||||
})
|
||||
},
|
||||
async changeActivit() {
|
||||
const resp = await this.$axios.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
|
||||
this.events = resp.data
|
||||
changeActivit() {
|
||||
return this.$axios.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId}).then((resp) => {
|
||||
this.events = resp.data
|
||||
})
|
||||
},
|
||||
async doAdd() {
|
||||
|
||||
@@ -802,25 +861,34 @@ layout("/layouts/platform.html"){
|
||||
|
||||
|
||||
},
|
||||
async getActivitys() {
|
||||
const {data} = await this.$axios.post("/platform/activity/score/statistics/getActivitys", {year: this.pageForm.year})
|
||||
return data;
|
||||
|
||||
getActivitys() {
|
||||
return this.$axios.post("/platform/activity/score/statistics/getActivitys", {year: this.pageForm.year}).then((res) => {
|
||||
return res.data
|
||||
})
|
||||
},
|
||||
async doSearchS() {
|
||||
this.doSearch()
|
||||
await this.changeActivit()
|
||||
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.tabLoading = true
|
||||
this.tableLoading = true
|
||||
const pageForm = clone(this.pageForm)
|
||||
pageForm.isMenWomen = JSON.stringify(pageForm.isMenWomen)
|
||||
this.$axios.post("/platform/activity/results/input/pageData", pageForm).then(resp => {
|
||||
this.tabLoading = false
|
||||
if (resp.code == 0) {
|
||||
this.tableData = resp.data.list;
|
||||
this.pageForm.totalCount = resp.data.totalCount;
|
||||
@@ -830,20 +898,16 @@ layout("/layouts/platform.html"){
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}).finally(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
|
||||
},
|
||||
},
|
||||
|
||||
async created() {
|
||||
created() {
|
||||
this.focusGroup()
|
||||
this.yearChange()
|
||||
// this.pageData()
|
||||
this.activityList = await this.getActivitys()
|
||||
if (this.activityList.length) {
|
||||
this.pageForm.activityId = this.activityList[0].id
|
||||
}
|
||||
await this.changeActivit()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -29,6 +29,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
<div class="transfer">
|
||||
<el-select :clearable="false"
|
||||
@change="flushApplyUser(applyUserList)"
|
||||
:disabled="!allowMoreTeam"
|
||||
placeholder="队伍"
|
||||
size="small"
|
||||
v-if="activityTableData.eveProjectType=='2'"
|
||||
@@ -128,7 +129,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
</el-button>
|
||||
|
||||
<el-dropdown @command="changeTeam"
|
||||
v-if="activityTableData.eveProjectType==2&&teamList.length>1">
|
||||
v-if="allowMoreTeam&&activityTableData.eveProjectType==2&&teamList.length>1">
|
||||
<el-button size="small" type="primary">
|
||||
修改小队<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</el-button>
|
||||
@@ -354,6 +355,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
eventList: [],
|
||||
eventData: {},
|
||||
teamList: [],
|
||||
allowMoreTeam: false,
|
||||
|
||||
applyFromData: {},
|
||||
leftApplyUserList: [],
|
||||
@@ -486,9 +488,10 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
isMenWomenTwo: data.isMenWomen
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
const {users, awardsModeT, awardsModeG, team, activity, getEvent} = resp.data
|
||||
const {users, awardsModeT, awardsModeG, team, activity, getEvent, allowMoreTeam} = resp.data
|
||||
this.activityData = activity
|
||||
this.eventData = getEvent
|
||||
this.allowMoreTeam = allowMoreTeam === true
|
||||
this.teamList = team
|
||||
if (this.teamList && this.teamList.length > 0) {
|
||||
this.applyFromData.teamName = this.teamList[0].name
|
||||
@@ -878,6 +881,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
||||
},
|
||||
uniteApplyReset() {
|
||||
this.teamList = []
|
||||
this.allowMoreTeam = false
|
||||
this.eventData = {}
|
||||
this.activityData = {}
|
||||
this.applyFromData = {}
|
||||
|
||||
@@ -191,6 +191,19 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item prop="moreTeamUnionIds" label="报多队工会">
|
||||
<el-select v-model="formData.moreTeamUnionIds" placeholder="请选择报多队工会" filterable clearable multiple
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in unionOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
@@ -433,7 +446,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8" v-if="formData.applyType===1||(formData.applyType===2&&projectType==='2')">
|
||||
<el-form-item label="最多创建几队(如需修改,请先删掉项目,在重新添加项目后,再修改队数)" prop="restrictTotalTeam"
|
||||
<el-form-item label="最多创建几队" prop="restrictTotalTeam"
|
||||
class="restrictTotalTeam">
|
||||
<el-input-number style="width: 100%" v-model="eventForm.restrictTotalTeam"
|
||||
placeholder="请填写最多创建几队" controls-position="right" :precision="0"
|
||||
@@ -585,7 +598,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: { applyWay: [] },
|
||||
formData: { applyWay: [], moreTeamUnionIds: [] },
|
||||
unionUserNumOneKeyRatio: null,
|
||||
summaryCount: 0,
|
||||
unionUserNumCalc: [{ startNum: 1, endNum: 1, resultNum: 1 }],
|
||||
@@ -601,6 +614,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
|
||||
checkedEvents: [],
|
||||
unitOptions: [],
|
||||
clubOptions: [],
|
||||
unionOptions: [],
|
||||
planList: [],
|
||||
events: [],
|
||||
projectType: "",
|
||||
@@ -953,6 +967,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
|
||||
applyWay: [2],
|
||||
eventsIds: [],
|
||||
unitJointly: [],
|
||||
moreTeamUnionIds: [],
|
||||
applyType: 2,
|
||||
activityCode: data,
|
||||
activityLevel: 40001
|
||||
@@ -985,6 +1000,11 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
|
||||
v.unitSponsor = JSON.parse(v.unitSponsor)
|
||||
v.undertakeUnit = JSON.parse(v.undertakeUnit)
|
||||
v.unitJointly = JSON.parse(v.unitJointly)
|
||||
if (v.moreTeamUnionIds && !Array.isArray(v.moreTeamUnionIds)) {
|
||||
this.$set(v, "moreTeamUnionIds", JSON.parse(v.moreTeamUnionIds))
|
||||
} else if (!v.moreTeamUnionIds) {
|
||||
this.$set(v, "moreTeamUnionIds", [])
|
||||
}
|
||||
v.activityGroupId = parseInt(v.activityGroupId)
|
||||
v.activityLevel = parseInt(v.activityLevel)
|
||||
this.formData = clone(v)
|
||||
@@ -1013,7 +1033,15 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
|
||||
}
|
||||
}
|
||||
},
|
||||
async doOperate() {
|
||||
confirmReduceTeam(resp, submit) {
|
||||
this.$confirm(resp.msg, "提示", { type: "warning" })
|
||||
.then(() => {
|
||||
submit()
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
doOperate(forceReduceTeam) {
|
||||
const method = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
const formData = clone(this.formData)
|
||||
const events = clone(this.checkedEventInfo)
|
||||
@@ -1030,16 +1058,23 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0,0,0,.45)"
|
||||
})
|
||||
const resp = await this.$axios.post(base + "/platform/activity/sports/info/mange" + method, {
|
||||
return this.$axios.post(base + "/platform/activity/sports/info/mange" + method, {
|
||||
data: JSON.stringify(formData),
|
||||
events: JSON.stringify(events)
|
||||
events: JSON.stringify(events),
|
||||
forceReduceTeam: forceReduceTeam === true
|
||||
}).then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.$emit("flip")
|
||||
} else if (resp.code === 2) {
|
||||
this.confirmReduceTeam(resp, () => {
|
||||
this.doOperate(true)
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({ title: "错误", message: resp.msg })
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$emit("flip")
|
||||
} else {
|
||||
this.$notify.error({ title: "错误", message: resp.msg })
|
||||
}
|
||||
loading.close()
|
||||
},
|
||||
async operate() {
|
||||
const deleteEventIds = this.eventsIds.filter((v) => !this.formData.eventsIds.includes(v))
|
||||
@@ -1060,7 +1095,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
|
||||
await this.doOperate()
|
||||
}
|
||||
},
|
||||
async doSave() {
|
||||
doSave(forceReduceTeam) {
|
||||
let url = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
|
||||
this.checkedEventInfo.forEach((v) => {
|
||||
@@ -1115,19 +1150,27 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
|
||||
background: "rgba(0,0,0,.45)"
|
||||
})
|
||||
|
||||
const resp = await this.$axios.post("/platform/activity/sports/info/mange" + url, {
|
||||
return this.$axios.post("/platform/activity/sports/info/mange" + url, {
|
||||
data: JSON.stringify(formData),
|
||||
events: JSON.stringify(events)
|
||||
events: JSON.stringify(events),
|
||||
forceReduceTeam: forceReduceTeam === true
|
||||
}).then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.$emit("flush")
|
||||
if (!this.formData.id) formData.id = resp.data
|
||||
return this.openEdit(formData, false).then(() => {
|
||||
this.$message.success(resp.msg)
|
||||
})
|
||||
} else if (resp.code === 2) {
|
||||
this.confirmReduceTeam(resp, () => {
|
||||
this.doSave(true)
|
||||
})
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
}).finally(() => {
|
||||
loading.close()
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$emit("flush")
|
||||
if (!this.formData.id) formData.id = resp.data
|
||||
await this.openEdit(formData, false)
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
loading.close()
|
||||
},
|
||||
examineTrans(formData) {
|
||||
const { unitJointly, unitSponsor, time, applyTime, applyWay, image } = formData
|
||||
@@ -1197,12 +1240,14 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
|
||||
]*/
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.clubOptions = await this.getClubsByRole()
|
||||
this.clubOptions.map((v) => {
|
||||
v.name = v.clubName
|
||||
created() {
|
||||
Promise.all([this.getClubsByRole(), this.$businessTool.listUnit(), this.$businessTool.listUnion()]).then(([clubs, units, unions]) => {
|
||||
this.clubOptions = clubs
|
||||
this.clubOptions.map((v) => {
|
||||
v.name = v.clubName
|
||||
})
|
||||
this.unionOptions = unions
|
||||
this.unitOptions = this.clubOptions.concat(units)
|
||||
})
|
||||
const units = await this.$businessTool.listUnit()
|
||||
this.unitOptions = this.clubOptions.concat(units)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,6 +150,15 @@ var ACTIVITY_SPORTS_INFO = {
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="年龄限制范围 ">
|
||||
<span v-if="app.startAgeDate&&app.endAgeDate">
|
||||
{{ app.startAgeDate }} - {{ app.endAgeDate }}
|
||||
</span>
|
||||
<span v-else>暂无</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8" v-if="app.projectType==2">
|
||||
<el-form-item label="领队人数 ">
|
||||
{{ app.leanderNum | money }} 人
|
||||
|
||||
Reference in New Issue
Block a user