体育活动
This commit is contained in:
+3
-3
@@ -90,6 +90,7 @@ public class ActivityBasicScopeController {
|
|||||||
FROM
|
FROM
|
||||||
`vw_user` u
|
`vw_user` u
|
||||||
LEFT JOIN sys_user_role sur on sur.userid = u.id
|
LEFT JOIN sys_user_role sur on sur.userid = u.id
|
||||||
|
LEFT JOIN club_user clubuser ON clubuser.userid=u.id
|
||||||
$condition
|
$condition
|
||||||
""");
|
""");
|
||||||
try {
|
try {
|
||||||
@@ -201,8 +202,8 @@ public class ActivityBasicScopeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
public Object getRoleListByMenuId(String menuId) {
|
public Object getRoleListByMenuId() {
|
||||||
return Result.success(dao.query(Sys_role.class, Cnd.where("system_name", "=", menuId).desc("code")));
|
return Result.success(dao.query(Sys_role.class, Cnd.NEW().desc("code")));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,7 +351,6 @@ public class ActivityBasicScopeController {
|
|||||||
cnd.andEX("u.personType", IN_OR_NIN_OP, activityUserScopePageParam.getPersonTypes());
|
cnd.andEX("u.personType", IN_OR_NIN_OP, activityUserScopePageParam.getPersonTypes());
|
||||||
cnd.andEX("u.userState", IN_OR_NIN_OP, activityUserScopePageParam.getUserStates());
|
cnd.andEX("u.userState", IN_OR_NIN_OP, activityUserScopePageParam.getUserStates());
|
||||||
cnd.andEX("u.sex", IN_OR_NIN_OP, activityUserScopePageParam.getSexTypes());
|
cnd.andEX("u.sex", IN_OR_NIN_OP, activityUserScopePageParam.getSexTypes());
|
||||||
cnd.andEX("sur.jdhid", EQ_OR_NEQ_OP, activityUserScopePageParam.getTeacherMeetingId());
|
|
||||||
cnd.andEX("sur.roleid", IN_OR_NIN_OP, activityUserScopePageParam.getRoleIds());
|
cnd.andEX("sur.roleid", IN_OR_NIN_OP, activityUserScopePageParam.getRoleIds());
|
||||||
cnd.andEX("clubuser.clubid", EQ_OR_NEQ_OP, activityUserScopePageParam.getClubId());
|
cnd.andEX("clubuser.clubid", EQ_OR_NEQ_OP, activityUserScopePageParam.getClubId());
|
||||||
|
|
||||||
|
|||||||
+14
-1
@@ -115,11 +115,14 @@ public class ActivityCultureApplyUserController {
|
|||||||
@At
|
@At
|
||||||
@SaCheckLogin
|
@SaCheckLogin
|
||||||
@ApiOperation(value = "队友搜索")
|
@ApiOperation(value = "队友搜索")
|
||||||
public Result queryTeammate(@Valid String keyword) {
|
public Result queryTeammate(@Valid String keyword,Integer signUpMethod) {
|
||||||
Sql sql = Sqls.create("select id userId,username userName,loginname loginName,sex,mobile,unitName from vw_user $condition limit 0,10");
|
Sql sql = Sqls.create("select id userId,username userName,loginname loginName,sex,mobile,unitName from vw_user $condition limit 0,10");
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
cnd.or(Cnd.likeEX("username", keyword));
|
cnd.or(Cnd.likeEX("username", keyword));
|
||||||
cnd.or(Cnd.likeEX("loginname", keyword));
|
cnd.or(Cnd.likeEX("loginname", keyword));
|
||||||
|
if (signUpMethod == 3){
|
||||||
|
cnd.and("unionid", "=", SecurityUtil.getUnionId());
|
||||||
|
}
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
List<NutMap> list = activityCultureApplyUserService.listMap(sql);
|
List<NutMap> list = activityCultureApplyUserService.listMap(sql);
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
@@ -142,6 +145,16 @@ public class ActivityCultureApplyUserController {
|
|||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@SaCheckLogin
|
||||||
|
@ApiOperation(value = "查询分工会报名人员")
|
||||||
|
public Result listTeamUserUnion(@Valid String activityId) {
|
||||||
|
List<ActivityTissuePerson> list = dao.query(ActivityTissuePerson.class, Cnd.where(ActivityTissuePerson::getTissueId, "=", activityId)
|
||||||
|
.and(ActivityTissuePerson::getApplyUserId, "=", SecurityUtil.getUserId())
|
||||||
|
);
|
||||||
|
return Result.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@SaCheckLogin
|
@SaCheckLogin
|
||||||
@ApiOperation(value = "是否报名")
|
@ApiOperation(value = "是否报名")
|
||||||
|
|||||||
+35
-24
@@ -129,8 +129,9 @@ public class ActivityCultureApplyUserServiceImpl extends BaseServiceImpl<Activit
|
|||||||
//总人数限制
|
//总人数限制
|
||||||
if (tissue.getUserNumberLimit() == 1) {
|
if (tissue.getUserNumberLimit() == 1) {
|
||||||
Integer totalUserNumberLimit = tissue.getTotalUserNumberLimit();
|
Integer totalUserNumberLimit = tissue.getTotalUserNumberLimit();
|
||||||
int hasRegisterCount = count(Cnd.where(ActivityTissuePerson::getTissueId, "=", activityId));
|
int hasRegisterCount = count(Cnd.where(ActivityTissuePerson::getTissueId, "=", activityId)
|
||||||
if (!(totalUserNumberLimit - hasRegisterCount > 0)) {
|
.and(ActivityTissuePerson::getUserId, "not in", personIds));
|
||||||
|
if (personIds.size() + hasRegisterCount > totalUserNumberLimit) {
|
||||||
throw new BaseException("报名名额已满!");
|
throw new BaseException("报名名额已满!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -139,19 +140,18 @@ public class ActivityCultureApplyUserServiceImpl extends BaseServiceImpl<Activit
|
|||||||
if (tissue.getUserNumberLimit() == 2) {
|
if (tissue.getUserNumberLimit() == 2) {
|
||||||
int limitNumByUnion = getLimitNumByUnion(tissue.getUnionUserNumberLimit(), SecurityUtil.getUnionId());
|
int limitNumByUnion = getLimitNumByUnion(tissue.getUnionUserNumberLimit(), SecurityUtil.getUnionId());
|
||||||
//获取当前该分工会已报多少人
|
//获取当前该分工会已报多少人
|
||||||
Sql sql = Sqls.create("""
|
/*Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
count(1)
|
count(1)
|
||||||
FROM
|
FROM
|
||||||
activity_tissue_person atp
|
activity_tissue_person atp
|
||||||
LEFT JOIN `vw_user` u ON u.id = atp.userId
|
|
||||||
WHERE
|
WHERE
|
||||||
atp.tissueId = @activityId
|
atp.tissueId = @activityId
|
||||||
AND u.unionid = @unionId
|
AND atp.unionId = @unionId
|
||||||
""");
|
""");
|
||||||
sql.setParam("activityId", activityId).setParam("unionId", SecurityUtil.getUnionId());
|
sql.setParam("activityId", activityId).setParam("unionId", SecurityUtil.getUnionId());
|
||||||
int hasRegisterCount = count(sql);
|
int hasRegisterCount = count(sql);*/
|
||||||
if (!(limitNumByUnion - hasRegisterCount > 0)) {
|
if (personIds.size() > limitNumByUnion) {
|
||||||
throw new BaseException("该分工会报名名额已满!");
|
throw new BaseException("该分工会报名名额已满!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -202,6 +202,8 @@ public class ActivityCultureApplyUserServiceImpl extends BaseServiceImpl<Activit
|
|||||||
mobile,
|
mobile,
|
||||||
unitName,
|
unitName,
|
||||||
unionName,
|
unionName,
|
||||||
|
unionId,
|
||||||
|
unitId,
|
||||||
'$activityId' AS tissueId,
|
'$activityId' AS tissueId,
|
||||||
'$applyUserId' AS applyUserId,
|
'$applyUserId' AS applyUserId,
|
||||||
'$applyUserUserName' AS applyUserUserName,
|
'$applyUserUserName' AS applyUserUserName,
|
||||||
@@ -221,23 +223,32 @@ public class ActivityCultureApplyUserServiceImpl extends BaseServiceImpl<Activit
|
|||||||
//分工会报名独有判断
|
//分工会报名独有判断
|
||||||
//判断总人数限制
|
//判断总人数限制
|
||||||
//判断分工会人数限制
|
//判断分工会人数限制
|
||||||
View_user user = dao().fetch(View_user.class, Cnd.where("id", "=", SecurityUtil.getUserId()));
|
Sql sql = Sqls.create("""
|
||||||
ActivityTissuePerson activityTissuePerson = new ActivityTissuePerson();
|
SELECT
|
||||||
activityTissuePerson.setTissueId(activityId);
|
id AS userId,
|
||||||
activityTissuePerson.setUserId(user.getId());
|
username AS userName,
|
||||||
activityTissuePerson.setUserName(user.getUsername());
|
loginname AS loginName,
|
||||||
activityTissuePerson.setLoginName(user.getLoginname());
|
sex,
|
||||||
activityTissuePerson.setSex(user.getSex());
|
mobile,
|
||||||
activityTissuePerson.setMobile(user.getMobile());
|
unitName,
|
||||||
activityTissuePerson.setUnitId(user.getUnitId());
|
unionName,
|
||||||
activityTissuePerson.setUnitName(user.getUnitName());
|
unionId,
|
||||||
activityTissuePerson.setUnionId(user.getUnionId());
|
unitId,
|
||||||
activityTissuePerson.setUnionName(user.getUnionName());
|
'$activityId' AS tissueId,
|
||||||
activityTissuePerson.setApplyDateTime(DateUtil.now());
|
'$applyUserId' AS applyUserId,
|
||||||
activityTissuePerson.setApplyUserId(user.getId());
|
'$applyUserUserName' AS applyUserUserName,
|
||||||
activityTissuePerson.setApplyUserUserName(user.getUsername());
|
'$applyDateTime' AS applyDateTime
|
||||||
activityTissuePerson.setDynamicFormData(dynamicFormParam);
|
FROM
|
||||||
insert(activityTissuePerson);
|
`vw_user`
|
||||||
|
$condition
|
||||||
|
""");
|
||||||
|
sql.setVar("activityId", activityId);
|
||||||
|
sql.setVar("applyUserId", SecurityUtil.getUserId());
|
||||||
|
sql.setVar("applyDateTime", DateUtil.now());
|
||||||
|
sql.setVar("applyUserUserName", SecurityUtil.getUserUsername());
|
||||||
|
sql.setCondition(Cnd.where("id", "in", personIds));
|
||||||
|
List<ActivityTissuePerson> fullPersonList = listEntity(sql);
|
||||||
|
insert(fullPersonList);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+22
@@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
import com.budwk.app.base.annotation.SLog;
|
import com.budwk.app.base.annotation.SLog;
|
||||||
import com.budwk.app.base.param.PageForm;
|
import com.budwk.app.base.param.PageForm;
|
||||||
import com.budwk.app.base.result.Result;
|
import com.budwk.app.base.result.Result;
|
||||||
|
import com.budwk.app.sys.models.Sys_user;
|
||||||
import com.budwk.app.zhgh.activity.sports.models.ActivitySchoolApply;
|
import com.budwk.app.zhgh.activity.sports.models.ActivitySchoolApply;
|
||||||
import com.budwk.app.zhgh.activity.sports.param.ActivitySportsApplyUserPageParam;
|
import com.budwk.app.zhgh.activity.sports.param.ActivitySportsApplyUserPageParam;
|
||||||
import com.budwk.app.zhgh.activity.sports.service.ActivitySportsApplyUserService;
|
import com.budwk.app.zhgh.activity.sports.service.ActivitySportsApplyUserService;
|
||||||
@@ -13,6 +14,7 @@ import org.nutz.dao.Cnd;
|
|||||||
import org.nutz.dao.Dao;
|
import org.nutz.dao.Dao;
|
||||||
import org.nutz.dao.Sqls;
|
import org.nutz.dao.Sqls;
|
||||||
import org.nutz.dao.sql.Sql;
|
import org.nutz.dao.sql.Sql;
|
||||||
|
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||||
import org.nutz.ioc.aop.Aop;
|
import org.nutz.ioc.aop.Aop;
|
||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
@@ -222,4 +224,24 @@ public class ActivitySportsApplyUserController {
|
|||||||
return Result.success(applyList);
|
return Result.success(applyList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@At
|
||||||
|
@SaCheckPermission("activity.apply")
|
||||||
|
public Result getSysUser(String queryString,String[] loginnames){
|
||||||
|
Cnd cnd = Cnd.NEW();
|
||||||
|
cnd.andEX("loginname", "not in", loginnames);
|
||||||
|
if (StrUtil.isNotBlank(queryString)) {
|
||||||
|
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||||
|
group.andLike("username", queryString).orLike("loginname", queryString);
|
||||||
|
cnd.and(group);
|
||||||
|
}
|
||||||
|
|
||||||
|
Sql sql = Sqls.create("select id,loginname,username,sex,mobile,unitId,birthday,idcard from `vw_user` $condition LIMIT 30");
|
||||||
|
sql.setCondition(cnd);
|
||||||
|
sql.setCallback(Sqls.callback.entities());
|
||||||
|
sql.setEntity(activitySportsApplyUserService.getEntity());
|
||||||
|
List<Sys_user> list = dao.execute(sql).getList(Sys_user.class);
|
||||||
|
return Result.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+158
@@ -1,17 +1,35 @@
|
|||||||
package com.budwk.app.zhgh.activity.sports.h5Controller;
|
package com.budwk.app.zhgh.activity.sports.h5Controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.budwk.app.base.result.Result;
|
import com.budwk.app.base.result.Result;
|
||||||
|
import com.budwk.app.sys.views.View_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.basic.models.ActivityEvent;
|
||||||
|
import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
|
||||||
import com.budwk.app.zhgh.activity.sports.models.ActivitySchool;
|
import com.budwk.app.zhgh.activity.sports.models.ActivitySchool;
|
||||||
|
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.models.ActivitySchoolTeam;
|
||||||
import com.budwk.app.zhgh.activity.sports.param.ActivitySportsApplyUserPageParam;
|
import com.budwk.app.zhgh.activity.sports.param.ActivitySportsApplyUserPageParam;
|
||||||
import com.budwk.app.zhgh.activity.sports.service.ActivitySportsApplyUserService;
|
import com.budwk.app.zhgh.activity.sports.service.ActivitySportsApplyUserService;
|
||||||
|
import org.nutz.dao.Cnd;
|
||||||
|
import org.nutz.dao.Dao;
|
||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
|
import org.nutz.lang.Lang;
|
||||||
import org.nutz.mvc.annotation.At;
|
import org.nutz.mvc.annotation.At;
|
||||||
import org.nutz.mvc.annotation.Ok;
|
import org.nutz.mvc.annotation.Ok;
|
||||||
import org.nutz.mvc.annotation.Param;
|
import org.nutz.mvc.annotation.Param;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName H5ActivitySportsApplyUserController
|
* @ClassName H5ActivitySportsApplyUserController
|
||||||
@@ -26,6 +44,9 @@ public class H5ActivitySportsApplyUserController {
|
|||||||
@Inject
|
@Inject
|
||||||
private ActivitySportsApplyUserService activitySportsApplyUserService;
|
private ActivitySportsApplyUserService activitySportsApplyUserService;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private Dao dao;
|
||||||
|
|
||||||
@At("/applyUser")
|
@At("/applyUser")
|
||||||
@Ok("beetl:platform/zhghh5/activity/sports/applyUser.html")
|
@Ok("beetl:platform/zhghh5/activity/sports/applyUser.html")
|
||||||
@SaCheckPermission("h5.activity.sports.applyUser")
|
@SaCheckPermission("h5.activity.sports.applyUser")
|
||||||
@@ -60,5 +81,142 @@ public class H5ActivitySportsApplyUserController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@SaCheckPermission("h5.activity.sports.applyUser")
|
||||||
|
public Result signUpUser(@Valid String activityId, @Valid String eventId, @Valid String schoolEventId, @Valid String teamId) {
|
||||||
|
View_user user = dao.fetch(View_user.class, Cnd.where(View_user::getId, "=", SecurityUtil.getUserId()));
|
||||||
|
ActivitySchoolEvent schoolEvent = dao.fetch(ActivitySchoolEvent.class, schoolEventId);
|
||||||
|
ActivityEvent activityEvent = dao.fetch(ActivityEvent.class, eventId);
|
||||||
|
ActivitySchool activitySchool = dao.fetch(ActivitySchool.class, activityId);
|
||||||
|
ActivitySchoolTeam schoolTeam = dao.fetch(ActivitySchoolTeam.class, teamId);
|
||||||
|
|
||||||
|
ActivityBasicUnit basicUnit = dao.fetch(ActivityBasicUnit.class, Cnd.where("id", "=", SecurityUtil.getUnitId()));
|
||||||
|
ActivityBasicUnion basicUnion = dao.fetch(ActivityBasicUnion.class, Cnd.where("id", "=", basicUnit.getUnionId()));
|
||||||
|
if (Lang.isEmpty(basicUnion)) {
|
||||||
|
return Result.error("请先设置活动工会");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//判断是否在活动组别内
|
||||||
|
int count = dao.count(ActivityUserScope.class,
|
||||||
|
Cnd.where(ActivityUserScope::getGroupId, "=", activitySchool.getActivityGroupId())
|
||||||
|
.and(ActivityUserScope::getUserId, "=", SecurityUtil.getUserId()));
|
||||||
|
if (count == 0) {
|
||||||
|
return Result.error("您没有权限参与该活动");
|
||||||
|
}
|
||||||
|
//如果不等于空代表是个人项目
|
||||||
|
if (ObjectUtil.isNotEmpty(activityEvent.getIsMenWomen())) {
|
||||||
|
if (activityEvent.getIsMenWomen() == 1 && !user.getSex().equals("男")) {
|
||||||
|
return Result.error("当前项目只能男性能报名!");
|
||||||
|
}
|
||||||
|
if (activityEvent.getIsMenWomen() == 2 && !user.getSex().equals("女")) {
|
||||||
|
return Result.error("当前项目只能女性能报名!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<ActivitySchoolApply> schoolApplyList = dao.query(ActivitySchoolApply.class,
|
||||||
|
Cnd.where(ActivitySchoolApply::getActivityId, "=", activityId)
|
||||||
|
.and(ActivitySchoolApply::getEventId, "=", eventId)
|
||||||
|
.and(ActivitySchoolApply::getActivityUnionId, "=", basicUnit.getId())
|
||||||
|
.and(ActivitySchoolApply::getApplyUser, "!=", SecurityUtil.getUserId()));
|
||||||
|
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(schoolEvent.getRestrictGirlNum()) && user.getSex().equals("女")) {
|
||||||
|
if (schoolEvent.getRestrictGirlNum() == 0) {
|
||||||
|
return Result.error("当前项目女性没有报名名额!");
|
||||||
|
}
|
||||||
|
//找出当前工会女性报名的数量
|
||||||
|
int size = schoolApplyList.stream().filter(girl -> girl.getSex().equals("女")).toList().size();
|
||||||
|
//数量加上自己如果大于配置的
|
||||||
|
if (size + 1 > schoolEvent.getRestrictGirlNum()) {
|
||||||
|
return Result.error("当前项目女性只能报名" + schoolEvent.getRestrictGirlNum() + "人!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(schoolEvent.getRestrictBoyNum()) && user.getSex().equals("男")) {
|
||||||
|
if (schoolEvent.getRestrictBoyNum() == 0) {
|
||||||
|
return Result.error("当前项目男性没有报名名额!");
|
||||||
|
}
|
||||||
|
//找出当前工会男性报名的数量
|
||||||
|
int size = schoolApplyList.stream().filter(girl -> girl.getSex().equals("男")).toList().size();
|
||||||
|
//数量加上自己如果大于配置的
|
||||||
|
if (size + 1 > schoolEvent.getRestrictBoyNum()) {
|
||||||
|
return Result.error("当前项目男性只能报名" + schoolEvent.getRestrictGirlNum() + "人!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(schoolEvent.getStartAgeDate()) && ObjectUtil.isNotEmpty(schoolEvent.getEndAgeDate())) {
|
||||||
|
//如果年龄做了判断
|
||||||
|
try {
|
||||||
|
if (ObjectUtil.isEmpty(user.getBirthday())) {
|
||||||
|
return Result.error("请先完善您的出生日期");
|
||||||
|
}
|
||||||
|
// 需要先将字符串转换为日期进行比较
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Date startAgeDate = sdf.parse(schoolEvent.getStartAgeDate());
|
||||||
|
Date endAgeDate = sdf.parse(schoolEvent.getEndAgeDate());
|
||||||
|
if (user.getBirthday().getTime() < startAgeDate.getTime() || user.getBirthday().getTime() > endAgeDate.getTime()) {
|
||||||
|
return Result.error("您年龄不在报名时间段内");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
return Result.error("年龄格式解析错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ActivitySchoolApply schoolApply = new ActivitySchoolApply();
|
||||||
|
schoolApply.setActivityId(activityId);
|
||||||
|
schoolApply.setEventId(eventId);
|
||||||
|
schoolApply.setUnionname(user.getUnionName());
|
||||||
|
schoolApply.setAwardsMode(activityEvent.getProjectType());
|
||||||
|
schoolApply.setUnitId(user.getUnitId());
|
||||||
|
schoolApply.setUnionId(user.getUnionId());
|
||||||
|
schoolApply.setActivityUnionId(basicUnion.getId());
|
||||||
|
schoolApply.setActivityUnionName(basicUnion.getName());
|
||||||
|
schoolApply.setUserId(SecurityUtil.getUserId());
|
||||||
|
schoolApply.setApplyUser(SecurityUtil.getUserId());
|
||||||
|
schoolApply.setBirthday(ObjectUtil.isNotEmpty(user.getBirthday()) ? String.valueOf(user.getBirthday()) : null);
|
||||||
|
schoolApply.setApplyDate(DateUtil.now());
|
||||||
|
schoolApply.setIdentity(List.of("1"));
|
||||||
|
if (activitySchool.getApplyWay().size() == 2 && activitySchool.getApplyWay().contains(1)) {
|
||||||
|
schoolApply.setStatus(0);
|
||||||
|
} else if (activitySchool.getApplyWay().size() == 1 && activitySchool.getApplyWay().contains(1)) {
|
||||||
|
schoolApply.setStatus(2);
|
||||||
|
}
|
||||||
|
schoolApply.setUnitname(user.getUnitName());
|
||||||
|
schoolApply.setTeamId(schoolTeam.getId());
|
||||||
|
schoolApply.setTeam(schoolTeam.getName());
|
||||||
|
schoolApply.setLoginname(user.getLoginname());
|
||||||
|
schoolApply.setUsername(user.getUsername());
|
||||||
|
schoolApply.setMobile(user.getMobile());
|
||||||
|
schoolApply.setSex(user.getSex());
|
||||||
|
dao.insert(schoolApply);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@At
|
||||||
|
@SaCheckPermission("h5.activity.sports.applyUser")
|
||||||
|
public Result cancelApply(@Valid String activityId, @Valid String eventId, @Valid String schoolEventId) {
|
||||||
|
int count = dao.count(ActivitySchoolApply.class,
|
||||||
|
Cnd.where(ActivitySchoolApply::getUserId, "=", SecurityUtil.getUserId())
|
||||||
|
.and(ActivitySchoolApply::getActivityId, "=", activityId)
|
||||||
|
.and(ActivitySchoolApply::getEventId, "=", eventId).and(ActivitySchoolApply::getStatus, "=", 2));
|
||||||
|
if (count > 0) {
|
||||||
|
return Result.error("您已报名成功无法取消,请联系管理员取消!");
|
||||||
|
}
|
||||||
|
|
||||||
|
dao.clear(ActivitySchoolApply.class, Cnd.where(ActivitySchoolApply::getUserId, "=", SecurityUtil.getUserId())
|
||||||
|
.and(ActivitySchoolApply::getActivityId, "=", activityId).and(ActivitySchoolApply::getEventId, "=", eventId));
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@At
|
||||||
|
@SaCheckPermission("h5.activity.sports.applyUser")
|
||||||
|
public Result listTeamList(@Valid String activityId, @Valid String eventId) {
|
||||||
|
return Result.success(dao.query(ActivitySchoolTeam.class, Cnd.where(ActivitySchoolTeam::getActivityId, "=", activityId)
|
||||||
|
.and(ActivitySchoolTeam::getEventId, "=", eventId).asc(ActivitySchoolTeam::getLocation)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,7 +205,11 @@ public class ActivitySchool extends BaseModel implements Serializable , SysHomeC
|
|||||||
sysHomeActivity.setName(this.getName());
|
sysHomeActivity.setName(this.getName());
|
||||||
sysHomeActivity.setCover(this.getImage());
|
sysHomeActivity.setCover(this.getImage());
|
||||||
sysHomeActivity.setUrl("/platform/activity/apply");
|
sysHomeActivity.setUrl("/platform/activity/apply");
|
||||||
|
if (this.applyWay.contains(2)) {
|
||||||
|
sysHomeActivity.setH5Url("/platform/h5/activity/apply/applyUser?activityId=" + this.getId());
|
||||||
|
} else {
|
||||||
sysHomeActivity.setH5Url(null);
|
sysHomeActivity.setH5Url(null);
|
||||||
|
}
|
||||||
sysHomeActivity.setStartDate(DateUtil.parseDate(this.getApplyStartTime()));
|
sysHomeActivity.setStartDate(DateUtil.parseDate(this.getApplyStartTime()));
|
||||||
sysHomeActivity.setEndDate(DateUtil.parseDate(this.getApplyEndTime()));
|
sysHomeActivity.setEndDate(DateUtil.parseDate(this.getApplyEndTime()));
|
||||||
sysHomeActivity.setAllowUserGroupId(this.getActivityGroupId());
|
sysHomeActivity.setAllowUserGroupId(this.getActivityGroupId());
|
||||||
|
|||||||
+11
-2
@@ -1,6 +1,7 @@
|
|||||||
package com.budwk.app.zhgh.activity.sports.service.impl;
|
package com.budwk.app.zhgh.activity.sports.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.budwk.app.base.constant.RoleConstant;
|
import com.budwk.app.base.constant.RoleConstant;
|
||||||
import com.budwk.app.base.page.Pagination;
|
import com.budwk.app.base.page.Pagination;
|
||||||
@@ -53,6 +54,9 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
|
|||||||
public String getUnionId() {
|
public String getUnionId() {
|
||||||
ActivityBasicUnit basicUnit = dao().fetch(ActivityBasicUnit.class, Cnd.where("id", "=", SecurityUtil.getUnitId()));
|
ActivityBasicUnit basicUnit = dao().fetch(ActivityBasicUnit.class, Cnd.where("id", "=", SecurityUtil.getUnitId()));
|
||||||
ActivityBasicUnion basicUnion = dao().fetch(ActivityBasicUnion.class, Cnd.where("id", "=", basicUnit.getUnionId()));
|
ActivityBasicUnion basicUnion = dao().fetch(ActivityBasicUnion.class, Cnd.where("id", "=", basicUnit.getUnionId()));
|
||||||
|
if (Lang.isEmpty(basicUnion)) {
|
||||||
|
throw new RuntimeException("请先设置活动工会");
|
||||||
|
}
|
||||||
|
|
||||||
return StrUtil.isBlank(SecurityUtil.getUnitId()) ? "" : basicUnion.getId();
|
return StrUtil.isBlank(SecurityUtil.getUnitId()) ? "" : basicUnion.getId();
|
||||||
}
|
}
|
||||||
@@ -77,8 +81,10 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
|
|||||||
eve.projectType eveProjectType,
|
eve.projectType eveProjectType,
|
||||||
eve.isMenWomen,
|
eve.isMenWomen,
|
||||||
apply.`status`,
|
apply.`status`,
|
||||||
|
apply2.`status` status2,
|
||||||
IF (sum(apply.`status`=2) IS NULL, 0, sum(apply.`status`=2)) AS successUserApply,
|
IF (sum(apply.`status`=2) IS NULL, 0, sum(apply.`status`=2)) AS successUserApply,
|
||||||
count(apply.id) userApply,
|
count(apply.id) userApply,
|
||||||
|
count(apply2.id) userApply2,
|
||||||
apply.applyUser,
|
apply.applyUser,
|
||||||
(SELECT ast.`name` FROM activity_school_apply app LEFT JOIN activity_school_team ast ON ast.id = app.teamId WHERE app.eventId = ase.eventId AND app.activityId = ase.activityId AND app.userId = @userId) activityTeamName,
|
(SELECT ast.`name` FROM activity_school_apply app LEFT JOIN activity_school_team ast ON ast.id = app.teamId WHERE app.eventId = ase.eventId AND app.activityId = ase.activityId AND app.userId = @userId) activityTeamName,
|
||||||
(select GROUP_CONCAT(username) FROM activity_school_apply WHERE status=2 and eventId = ase.eventId
|
(select GROUP_CONCAT(username) FROM activity_school_apply WHERE status=2 and eventId = ase.eventId
|
||||||
@@ -92,6 +98,7 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
|
|||||||
LEFT JOIN activity_event eve ON ase.eventId=eve.id
|
LEFT JOIN activity_event eve ON ase.eventId=eve.id
|
||||||
LEFT JOIN activity_basic_settings abs ON abs.id=eve.competitionCategory
|
LEFT JOIN activity_basic_settings abs ON abs.id=eve.competitionCategory
|
||||||
LEFT JOIN activity_school_apply apply ON apply.activityId=ase.activityId AND apply.eventId=ase.eventId AND (applyUser=@userId or userId=@userId)
|
LEFT JOIN activity_school_apply apply ON apply.activityId=ase.activityId AND apply.eventId=ase.eventId AND (applyUser=@userId or userId=@userId)
|
||||||
|
LEFT JOIN activity_school_apply apply2 ON apply2.activityId=ase.activityId AND apply2.eventId=ase.eventId AND apply2.userId=@userId
|
||||||
$condition
|
$condition
|
||||||
""").setParam("unionId", pageParam.getUnionId()).setParam("userId", SecurityUtil.getUserId());
|
""").setParam("unionId", pageParam.getUnionId()).setParam("userId", SecurityUtil.getUserId());
|
||||||
|
|
||||||
@@ -179,7 +186,7 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
|
|||||||
// cnd.and(new Static("JSON_CONTAINS(school.applyWay,JSON_ARRAY( 1))>0"));
|
// cnd.and(new Static("JSON_CONTAINS(school.applyWay,JSON_ARRAY( 1))>0"));
|
||||||
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(SecurityUtil.getUserId())));
|
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(SecurityUtil.getUserId())));
|
||||||
}
|
}
|
||||||
cnd.and("YEAR(school.applyStartTime)", "=", year);
|
cnd.andEX("YEAR(school.applyStartTime)", "=", year);
|
||||||
cnd.desc("school.applyStartTime");
|
cnd.desc("school.applyStartTime");
|
||||||
|
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
@@ -339,7 +346,8 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
|
|||||||
List<ActivitySchoolApply> awardsModeG = list.stream().filter(v -> v.getAwardsMode().equals("1")).collect(Collectors.toList());
|
List<ActivitySchoolApply> awardsModeG = list.stream().filter(v -> v.getAwardsMode().equals("1")).collect(Collectors.toList());
|
||||||
|
|
||||||
list.forEach(v -> {
|
list.forEach(v -> {
|
||||||
if (Strings.isNotBlank(v.getBirthday())) {
|
if (ObjectUtil.isNotEmpty(v.getBirthday())) {
|
||||||
|
String birthday = v.getBirthday();
|
||||||
v.setAge(cn.hutool.core.date.DateUtil.ageOfNow(v.getBirthday()));
|
v.setAge(cn.hutool.core.date.DateUtil.ageOfNow(v.getBirthday()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -372,6 +380,7 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
|
|||||||
apply.setApplyUser(SecurityUtil.getUserId());
|
apply.setApplyUser(SecurityUtil.getUserId());
|
||||||
apply.setStatus(pass ? 2 : 0);
|
apply.setStatus(pass ? 2 : 0);
|
||||||
apply.setApplyDate(DateUtil.now());
|
apply.setApplyDate(DateUtil.now());
|
||||||
|
apply.setUnitId(basicUnit.getId());
|
||||||
apply.setActivityUnionId(basicUnion.getId());
|
apply.setActivityUnionId(basicUnion.getId());
|
||||||
apply.setActivityUnionName(basicUnion.getName());
|
apply.setActivityUnionName(basicUnion.getName());
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -49,10 +49,11 @@ public class RestActController {
|
|||||||
@ApiOperation("活动列表")
|
@ApiOperation("活动列表")
|
||||||
public Result pageData(@Valid PageForm pageForm, Integer year) {
|
public Result pageData(@Valid PageForm pageForm, Integer year) {
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
cnd.andEX("year", "=", year);
|
cnd.andEX("YEAR(startTime)", "=", year);
|
||||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||||
cnd.where().andLike(RestAct::getName, pageForm.getSearchKeyword());
|
cnd.where().andLike(RestAct::getName, pageForm.getSearchKeyword());
|
||||||
}
|
}
|
||||||
|
cnd.desc("signUpStartTime");
|
||||||
Pagination pagination = restActService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
Pagination pagination = restActService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||||
return Result.success(pagination);
|
return Result.success(pagination);
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-1
@@ -1,6 +1,7 @@
|
|||||||
package com.budwk.app.zhgh.dayofficework.rest.controller;
|
package com.budwk.app.zhgh.dayofficework.rest.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.budwk.app.base.annotation.SLog;
|
import com.budwk.app.base.annotation.SLog;
|
||||||
import com.budwk.app.base.page.Pagination;
|
import com.budwk.app.base.page.Pagination;
|
||||||
import com.budwk.app.base.param.PageForm;
|
import com.budwk.app.base.param.PageForm;
|
||||||
@@ -50,13 +51,21 @@ public class RestBranchSignUpController {
|
|||||||
@At
|
@At
|
||||||
@SaCheckPermission("rest.branchUnionSignUp")
|
@SaCheckPermission("rest.branchUnionSignUp")
|
||||||
@ApiOperation("分页查询")
|
@ApiOperation("分页查询")
|
||||||
public Result pageData(@Valid PageForm pageForm) {
|
public Result pageData(@Valid PageForm pageForm, Integer year) {
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
r.*
|
r.*
|
||||||
FROM
|
FROM
|
||||||
rest r
|
rest r
|
||||||
|
$condition
|
||||||
""");
|
""");
|
||||||
|
Cnd cnd = Cnd.NEW();
|
||||||
|
cnd.andEX("YEAR(r.startTime)", "=", year);
|
||||||
|
cnd.desc("r.signUpStartTime");
|
||||||
|
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||||
|
cnd.where().andLike("r.name", pageForm.getSearchKeyword());
|
||||||
|
}
|
||||||
|
sql.setCondition(cnd);
|
||||||
Pagination pagination = restActService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
Pagination pagination = restActService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||||
return Result.success(pagination);
|
return Result.success(pagination);
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-1
@@ -10,6 +10,7 @@ import com.budwk.app.bpm.service.BpmService;
|
|||||||
import com.budwk.app.sys.models.Sys_user_role;
|
import com.budwk.app.sys.models.Sys_user_role;
|
||||||
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
import com.budwk.app.web.controllers.open.commons.service.CommonService;
|
||||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolence;
|
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolence;
|
||||||
|
import com.budwk.app.zhgh.dayofficework.warmthCondolence.models.WarmthCondolenceNotice;
|
||||||
import com.budwk.app.zhgh.dayofficework.warmthCondolence.service.WarmthCondolenceService;
|
import com.budwk.app.zhgh.dayofficework.warmthCondolence.service.WarmthCondolenceService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -18,6 +19,7 @@ import org.nutz.dao.Cnd;
|
|||||||
import org.nutz.ioc.aop.Aop;
|
import org.nutz.ioc.aop.Aop;
|
||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
|
import org.nutz.lang.Lang;
|
||||||
import org.nutz.mvc.annotation.At;
|
import org.nutz.mvc.annotation.At;
|
||||||
import org.nutz.mvc.annotation.Ok;
|
import org.nutz.mvc.annotation.Ok;
|
||||||
import org.nutz.mvc.annotation.Param;
|
import org.nutz.mvc.annotation.Param;
|
||||||
@@ -41,7 +43,8 @@ public class WarmthCondolenceApplyController {
|
|||||||
@At("")
|
@At("")
|
||||||
@Ok("beetl:/platform/zhgh/dayofficework/warmthCondolence/apply/index.html")
|
@Ok("beetl:/platform/zhgh/dayofficework/warmthCondolence/apply/index.html")
|
||||||
@SaCheckPermission("warmthCondolence.apply")
|
@SaCheckPermission("warmthCondolence.apply")
|
||||||
public void index(){}
|
public void index() {
|
||||||
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@SaCheckPermission("warmthCondolence.apply")
|
@SaCheckPermission("warmthCondolence.apply")
|
||||||
@@ -49,6 +52,16 @@ public class WarmthCondolenceApplyController {
|
|||||||
@Aop(TransAop.READ_COMMITTED)
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
@SLog(type = "warmthCondolenceApply", tag = "保存慰问申请", msg = "保存慰问申请")
|
@SLog(type = "warmthCondolenceApply", tag = "保存慰问申请", msg = "保存慰问申请")
|
||||||
public Result save(@Param("warmthCondolence") WarmthCondolence warmthCondolence) {
|
public Result save(@Param("warmthCondolence") WarmthCondolence warmthCondolence) {
|
||||||
|
WarmthCondolenceNotice notice = warmthCondolenceService.dao().fetch(WarmthCondolenceNotice.class, warmthCondolence.getNoticeId());
|
||||||
|
if (Lang.isEmpty(notice)) {
|
||||||
|
return Result.error("未找到申请事项");
|
||||||
|
}
|
||||||
|
if(notice.getStartTime().getTime() > System.currentTimeMillis()){
|
||||||
|
return Result.error("申请事项未开始");
|
||||||
|
}
|
||||||
|
if(notice.getEndTime().getTime() < System.currentTimeMillis()){
|
||||||
|
return Result.error("申请事项已结束");
|
||||||
|
}
|
||||||
warmthCondolence.setNo(warmthCondolenceService.createNo(warmthCondolence));
|
warmthCondolence.setNo(warmthCondolenceService.createNo(warmthCondolence));
|
||||||
warmthCondolenceService.insertOrUpdate(warmthCondolence);
|
warmthCondolenceService.insertOrUpdate(warmthCondolence);
|
||||||
bpmService.startSaveProcessInstance(BpmProcessConstant.WARMTH_CONDOLENCE.name(), warmthCondolence.getUserName() + "的申请", warmthCondolence.getId(), null);
|
bpmService.startSaveProcessInstance(BpmProcessConstant.WARMTH_CONDOLENCE.name(), warmthCondolence.getUserName() + "的申请", warmthCondolence.getId(), null);
|
||||||
@@ -61,6 +74,16 @@ public class WarmthCondolenceApplyController {
|
|||||||
@Aop(TransAop.READ_COMMITTED)
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
@SLog(tag = "送温暖慰问申请", msg = "送温暖慰问申请")
|
@SLog(tag = "送温暖慰问申请", msg = "送温暖慰问申请")
|
||||||
public Result submit(@Param("warmthCondolence") @Valid WarmthCondolence warmthCondolence) {
|
public Result submit(@Param("warmthCondolence") @Valid WarmthCondolence warmthCondolence) {
|
||||||
|
WarmthCondolenceNotice notice = warmthCondolenceService.dao().fetch(WarmthCondolenceNotice.class, warmthCondolence.getNoticeId());
|
||||||
|
if (Lang.isEmpty(notice)) {
|
||||||
|
return Result.error("未找到申请事项");
|
||||||
|
}
|
||||||
|
if(notice.getStartTime().getTime() > System.currentTimeMillis()){
|
||||||
|
return Result.error("申请事项未开始");
|
||||||
|
}
|
||||||
|
if(notice.getEndTime().getTime() < System.currentTimeMillis()){
|
||||||
|
return Result.error("申请事项已结束");
|
||||||
|
}
|
||||||
warmthCondolence.setNo(warmthCondolenceService.createNo(warmthCondolence));
|
warmthCondolence.setNo(warmthCondolenceService.createNo(warmthCondolence));
|
||||||
warmthCondolenceService.insertOrUpdate(warmthCondolence);
|
warmthCondolenceService.insertOrUpdate(warmthCondolence);
|
||||||
//查询分工会审批人工号
|
//查询分工会审批人工号
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ public class WarmthCondolenceCommonController {
|
|||||||
@SaCheckPermission("warmthCondolence")
|
@SaCheckPermission("warmthCondolence")
|
||||||
public Result listNotice(){
|
public Result listNotice(){
|
||||||
List<WarmthCondolenceNotice> list = warmthCondolenceNoticeService.query(Cnd.where(WarmthCondolenceNotice::getEnable, "=", 1)
|
List<WarmthCondolenceNotice> list = warmthCondolenceNoticeService.query(Cnd.where(WarmthCondolenceNotice::getEnable, "=", 1)
|
||||||
.asc(WarmthCondolenceNotice::getStartTime));
|
.desc(WarmthCondolenceNotice::getStartTime));
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
multiple
|
multiple
|
||||||
>
|
>
|
||||||
<el-option v-for="o in userList" :label="o.username + '(' + o.loginname + ')'" :value="o.id" :key="o.id"></el-option>
|
<el-option v-for="o in userList" :label="o.username + '(' + o.loginname + ')'" :value="o.id"
|
||||||
|
:key="o.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
@@ -170,67 +171,11 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<template v-if="is_A06 === true || is_sysadmin === true">
|
<template v-if="is_A06 === true || is_sysadmin === true">
|
||||||
<!--<el-row class="query-row">
|
<el-row class="query-row">
|
||||||
<el-col class="query-title">活动部门:</el-col>
|
|
||||||
<el-col class="query-content">
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :lg="12" :md="12" :sm="24" :xl="12" :xs="24">
|
|
||||||
<el-select @change="flushUnits();doSearch()" @clear="flushUnits();doSearch()"
|
|
||||||
:clearable="is_A06===true||is_sysadmin===true"
|
|
||||||
filterable="true"
|
|
||||||
placeholder="所属工会" style="width: 100%"
|
|
||||||
v-model="pageForm.activityUnionId">
|
|
||||||
<el-option :label="item.unionname" :value="item.id"
|
|
||||||
v-for="item in activityUnions"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-col>
|
|
||||||
<el-col :lg="12" :md="12" :sm="24" :xl="12" :xs="24">
|
|
||||||
<el-select @change="doSearch" @clear="doSearch" clearable="true"
|
|
||||||
filterable="true"
|
|
||||||
placeholder="所属单位"
|
|
||||||
style="width: 100%"
|
|
||||||
v-model="pageForm.activityUnitId">
|
|
||||||
<el-option :label="item.name" :value="item.id"
|
|
||||||
v-for="item in activityUnits"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-col>
|
|
||||||
</el-row>-->
|
|
||||||
|
|
||||||
<!-- <el-row class="query-row">
|
|
||||||
<el-col class="query-title">系统角色:</el-col>
|
<el-col class="query-title">系统角色:</el-col>
|
||||||
<el-col class="query-content">
|
<el-col class="query-content">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="6">
|
<el-col :span="24">
|
||||||
<el-select @change="getRoleListByMenuId"
|
|
||||||
v-model="pageForm.module"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
style="width: 100%" placeholder="请选择角色所属的系统">
|
|
||||||
<el-option
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
v-for="item in menuOptions">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="6"
|
|
||||||
v-if="relatedSessionMenus.includes(pageForm.module)">
|
|
||||||
<el-select filterable
|
|
||||||
placeholder="届次"
|
|
||||||
style="width: 100%"
|
|
||||||
:disabled="!relatedSessionMenus.includes(pageForm.module)"
|
|
||||||
v-model="pageForm.teacherMeetingId">
|
|
||||||
<el-option :key="item.id" :label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
v-for="item in meetingOptions">
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-select
|
<el-select
|
||||||
@change="doSearch" clearable filterable
|
@change="doSearch" clearable filterable
|
||||||
placeholder="请选择角色"
|
placeholder="请选择角色"
|
||||||
@@ -245,10 +190,10 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>-->
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- <el-row class="query-row"
|
<el-row class="query-row"
|
||||||
v-if="is_A06===true||is_sysadmin===true||is_H02===true">
|
v-if="is_A06===true||is_sysadmin===true||is_H02===true">
|
||||||
<el-col class="query-title">协会:</el-col>
|
<el-col class="query-title">协会:</el-col>
|
||||||
<el-col class="query-content">
|
<el-col class="query-content">
|
||||||
@@ -258,13 +203,13 @@
|
|||||||
style="width: 100%">
|
style="width: 100%">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in clubOptions"
|
v-for="item in clubOptions"
|
||||||
:key="item.stid"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.clubName"
|
||||||
:value="item.stid">
|
:value="item.id">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>-->
|
</el-row>
|
||||||
|
|
||||||
<el-row class="query-row">
|
<el-row class="query-row">
|
||||||
<el-col class="query-title">活动组别:</el-col>
|
<el-col class="query-title">活动组别:</el-col>
|
||||||
@@ -308,7 +253,8 @@
|
|||||||
</el-row>-->
|
</el-row>-->
|
||||||
|
|
||||||
<el-row class="query-row" style="justify-content: end">
|
<el-row class="query-row" style="justify-content: end">
|
||||||
<el-checkbox v-model="pageForm.reverseSelection" label="是否反选" border @change="doSearch" class="reverseCheckBox"></el-checkbox>
|
<el-checkbox v-model="pageForm.reverseSelection" label="是否反选" border @change="doSearch"
|
||||||
|
class="reverseCheckBox"></el-checkbox>
|
||||||
<el-button type="danger" icon="el-icon-circle-close" @click="doReset">重置</el-button>
|
<el-button type="danger" icon="el-icon-circle-close" @click="doReset">重置</el-button>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -348,7 +294,8 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
<el-dialog :visible.sync="setDialogVisible" title="设置活动人员" width="45%" :append-to-body="true" :close-on-click-modal="false">
|
<el-dialog :visible.sync="setDialogVisible" title="设置活动人员" width="45%" :append-to-body="true"
|
||||||
|
:close-on-click-modal="false">
|
||||||
<el-form :model="formData" :rules="rules" label-width="100px" ref="setForm">
|
<el-form :model="formData" :rules="rules" label-width="100px" ref="setForm">
|
||||||
<el-form-item label="添加方式" prop="setGroupType">
|
<el-form-item label="添加方式" prop="setGroupType">
|
||||||
<el-radio-group size="small" v-model="formData.setGroupType">
|
<el-radio-group size="small" v-model="formData.setGroupType">
|
||||||
@@ -449,7 +396,6 @@ module.exports = {
|
|||||||
units: [],
|
units: [],
|
||||||
activityUnits: [],
|
activityUnits: [],
|
||||||
menuOptions: [],
|
menuOptions: [],
|
||||||
meetingOptions: [],
|
|
||||||
roleList: [],
|
roleList: [],
|
||||||
tableHeight: "0px",
|
tableHeight: "0px",
|
||||||
tableColumns: [
|
tableColumns: [
|
||||||
@@ -470,7 +416,6 @@ module.exports = {
|
|||||||
setGroupId: [{required: true, message: "请选择分组", trigger: ["blur", "change"]}],
|
setGroupId: [{required: true, message: "请选择分组", trigger: ["blur", "change"]}],
|
||||||
setGroupName: [{required: true, message: "请输入分组名称", trigger: ["blur", "change"]}]
|
setGroupName: [{required: true, message: "请输入分组名称", trigger: ["blur", "change"]}]
|
||||||
},
|
},
|
||||||
relatedSessionMenus: ["aca4d14498c145ceb5b24ed70776aae2", "733d7266652740a3aeac9da97ab5eeca", "fe2d0768e26d4a80beeb159306bb8d01"],
|
|
||||||
roleData: {}
|
roleData: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -498,24 +443,8 @@ module.exports = {
|
|||||||
"user-cnd": httpVueLoader("/components/plugins/UserCnd.vue")
|
"user-cnd": httpVueLoader("/components/plugins/UserCnd.vue")
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
doExportUser() {
|
|
||||||
const {
|
|
||||||
userId,
|
|
||||||
memberTypes,
|
|
||||||
sexTypes,
|
|
||||||
personTypes,
|
|
||||||
userStates,
|
|
||||||
unionId,
|
|
||||||
unitId,
|
|
||||||
teacherMeetingId,
|
|
||||||
roleIds,
|
|
||||||
clubId,
|
|
||||||
activityGroupId,
|
|
||||||
age,
|
|
||||||
reverseSelection,
|
|
||||||
activityUserCnd
|
|
||||||
} = this.pageForm
|
|
||||||
|
|
||||||
|
doExportUser() {
|
||||||
let props = {}
|
let props = {}
|
||||||
this.tableColumns.forEach((v) => {
|
this.tableColumns.forEach((v) => {
|
||||||
props[v.prop] = v.label
|
props[v.prop] = v.label
|
||||||
@@ -661,17 +590,7 @@ module.exports = {
|
|||||||
this.menuOptions = data
|
this.menuOptions = data
|
||||||
},
|
},
|
||||||
async getRoleListByMenuId() {
|
async getRoleListByMenuId() {
|
||||||
if (["aca4d14498c145ceb5b24ed70776aae2", "733d7266652740a3aeac9da97ab5eeca"].includes(this.pageForm.module)) {
|
const {data} = await $.post("/platform/activity/basic/scope/getRoleListByMenuId")
|
||||||
//教代会
|
|
||||||
let meets = await proposal.getOpenMeeting()
|
|
||||||
this.meetingOptions = meets.map((v) => ({ ...v, name: v.jdhallname }))
|
|
||||||
} else if (["fe2d0768e26d4a80beeb159306bb8d01"].includes(this.pageForm.module)) {
|
|
||||||
//工代会
|
|
||||||
let meets = await getGdh(true)
|
|
||||||
this.meetingOptions = meets.map((v) => ({ ...v, name: v.gdhAllName }))
|
|
||||||
}
|
|
||||||
this.pageForm.teacherMeetingId = ""
|
|
||||||
const { data } = await $.post("/platform/activity/basic/scope/getRoleListByMenuId", { menuId: this.pageForm.module })
|
|
||||||
this.roleList = data
|
this.roleList = data
|
||||||
},
|
},
|
||||||
async getRolesAndUnion() {
|
async getRolesAndUnion() {
|
||||||
@@ -681,25 +600,19 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
await this.getRolesAndUnion()
|
await this.getRolesAndUnion()
|
||||||
// this.clubOptions = await getClubsByRole()
|
this.clubOptions = await this.$businessTool.listClub()
|
||||||
|
|
||||||
if ((this.is_sysadmin || this.is_A06 || this.is_H02) === false && this.is_H04 === true) {
|
if ((this.is_sysadmin || this.is_A06 || this.is_H02) === false && this.is_H04 === true) {
|
||||||
this.unions = this.$businessTool.listUnion(this.unionid)
|
this.unions = this.$businessTool.listUnion(this.unionid)
|
||||||
this.$set(this.pageForm, "unionId", this.unions[0].id)
|
this.$set(this.pageForm, "unionId", this.unions[0].id)
|
||||||
} else {
|
} else {
|
||||||
this.unions = await this.$businessTool.listUnion()
|
this.unions = await this.$businessTool.listUnion()
|
||||||
// this.activityUnions = await getActivityUnions()
|
|
||||||
}
|
}
|
||||||
/*if (this.is_H04 === false && this.is_H02 === true) {
|
|
||||||
if (this.clubOptions.length > 0) {
|
|
||||||
this.$set(this.pageForm, "clubId", this.clubOptions[0].stid)
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
await this.flushUnits()
|
await this.flushUnits()
|
||||||
await this.getActivityGroup()
|
await this.getActivityGroup()
|
||||||
this.personTypeOptions = await this.$businessTool.getDictOptions("PERSON_TYPE")
|
this.personTypeOptions = await this.$businessTool.getDictOptions("PERSON_TYPE")
|
||||||
this.userStateOptions = await this.$businessTool.getDictOptions("USER_STATE")
|
this.userStateOptions = await this.$businessTool.getDictOptions("USER_STATE")
|
||||||
// await this.getMenuOptions()
|
await this.getRoleListByMenuId()
|
||||||
await this.pageData()
|
await this.pageData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ const ACTIVITY_CULTURE_APPLY_USER = {
|
|||||||
<el-card class="mt10" shadow="never">
|
<el-card class="mt10" shadow="never">
|
||||||
<table-tool label="活动列表">
|
<table-tool label="活动列表">
|
||||||
<el-radio-group v-model="pageForm.isEnrolled" @change="doSearch" size="mini" class="ml10">
|
<el-radio-group v-model="pageForm.isEnrolled" @change="doSearch" size="mini" class="ml10">
|
||||||
<el-radio-button :label="false">未报名</el-radio-button>
|
|
||||||
<el-radio-button :label="true">已报名</el-radio-button>
|
<el-radio-button :label="true">已报名</el-radio-button>
|
||||||
|
<el-radio-button :label="false">未报名</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</table-tool>
|
</table-tool>
|
||||||
|
|
||||||
|
|||||||
@@ -210,8 +210,9 @@ const ACTIVITY_CULTURE_AUDIT_ACTIVITY = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
openAudit(row) {
|
openAudit(row) {
|
||||||
this.$refs.guava.edit()
|
this.$refs.guava.edit(()=>{
|
||||||
this.$refs.editInfo.findOne(row.id)
|
this.$refs.editInfo.findOne(row.id)
|
||||||
|
})
|
||||||
this.formData = {
|
this.formData = {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
username: this.$store.state.user.username,
|
username: this.$store.state.user.username,
|
||||||
@@ -220,8 +221,9 @@ const ACTIVITY_CULTURE_AUDIT_ACTIVITY = {
|
|||||||
},
|
},
|
||||||
openView(row) {
|
openView(row) {
|
||||||
const { id } = row
|
const { id } = row
|
||||||
this.$refs.guava.view()
|
this.$refs.guava.view(()=>{
|
||||||
this.$refs.infoActivity.findOne(id)
|
this.$refs.infoActivity.findOne(id)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
pageData() {
|
pageData() {
|
||||||
this.tableLoading = true
|
this.tableLoading = true
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ const ACTIVITY_CULTURE_INFO_ACTIVITY = {
|
|||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="报名方式">
|
<el-descriptions-item label="报名方式">
|
||||||
<span v-if="viewData.signUpMethod===1">个人报名</span>
|
<span v-if="viewData.signUpMethod===1">个人报名</span>
|
||||||
<span v-else-if="viewData.signUpMethod===2">分工会报名</span>
|
<span v-else-if="viewData.signUpMethod===2">组队报名</span>
|
||||||
<span v-else-if="viewData.signUpMethod===3">组队报名</span>
|
<span v-else-if="viewData.signUpMethod===3">分工会报名</span>
|
||||||
<span v-else-if="!viewData.signUpMethod">无需报名</span>
|
<span v-else-if="!viewData.signUpMethod">无需报名</span>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="是否用于报名">
|
<el-descriptions-item label="是否用于报名">
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ const singleSignUp = {
|
|||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="报名方式">
|
<el-descriptions-item label="报名方式">
|
||||||
<span v-if="viewData.signUpMethod===1">个人报名</span>
|
<span v-if="viewData.signUpMethod===1">个人报名</span>
|
||||||
<span v-else-if="viewData.signUpMethod===2">分工会报名</span>
|
<span v-else-if="viewData.signUpMethod===2">组队报名</span>
|
||||||
<span v-else-if="viewData.signUpMethod===3">组队报名</span>
|
<span v-else-if="viewData.signUpMethod===3">分工会报名</span>
|
||||||
<span v-else-if="!viewData.signUpMethod">无需报名</span>
|
<span v-else-if="!viewData.signUpMethod">无需报名</span>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="是否用于报名">
|
<el-descriptions-item label="是否用于报名">
|
||||||
@@ -153,7 +153,47 @@ const singleSignUp = {
|
|||||||
</div>
|
</div>
|
||||||
<!-- 分工会报名-->
|
<!-- 分工会报名-->
|
||||||
<div v-else-if="viewData.signUpMethod===3">
|
<div v-else-if="viewData.signUpMethod===3">
|
||||||
|
<div class="process-title">选择报名人员
|
||||||
|
<span v-if="viewData.userNumberLimit===2">
|
||||||
|
,报名人数 <span style="color: red">
|
||||||
|
{{viewData.unionTeamNum}}</span>人
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<el-select
|
||||||
|
v-if="inApplyTime"
|
||||||
|
v-model="searchTeammateUserId"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
remote
|
||||||
|
reserve-keyword
|
||||||
|
placeholder="请输入关键词"
|
||||||
|
:remote-method="queryTeammate">
|
||||||
|
<el-option
|
||||||
|
v-for="item in teammateOptions"
|
||||||
|
:key="item.userId"
|
||||||
|
:label="item.userName + '(' + item.loginName + ')'"
|
||||||
|
:value="item.userId">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-button v-if="inApplyTime" class="ml5" type="primary" icon="el-icon-plus"
|
||||||
|
@click="addTeamUser">添加
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-table :data="teamUsers" class="mt10">
|
||||||
|
<el-table-column label="序号" type="index" width="60px"></el-table-column>
|
||||||
|
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||||
|
<el-table-column prop="loginName" label="工号"></el-table-column>
|
||||||
|
<el-table-column prop="sex" label="性别"></el-table-column>
|
||||||
|
<el-table-column prop="unitName" label="单位"></el-table-column>
|
||||||
|
<el-table-column prop="mobile" label="手机号"></el-table-column>
|
||||||
|
<el-table-column label="操作" width="100px"
|
||||||
|
v-if="inApplyTime">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="danger" size="mini" @click="removeTeamUser(scope.$index)">删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 表单填写-->
|
<!-- 表单填写-->
|
||||||
@@ -242,6 +282,17 @@ const singleSignUp = {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//查询报名人员
|
||||||
|
listTeamUserUnion() {
|
||||||
|
this.$axios.post("/platform/activity/culture/applyUser/listTeamUserUnion", {activityId: this.id}).then((res) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.isSignUp = res.data.length > 0
|
||||||
|
this.teamUsers = res.data
|
||||||
|
this.defaultAddSelf()
|
||||||
|
this.customFormInit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
//表单回显
|
//表单回显
|
||||||
customFormInit() {
|
customFormInit() {
|
||||||
@@ -300,14 +351,14 @@ const singleSignUp = {
|
|||||||
|
|
||||||
//分工会
|
//分工会
|
||||||
if (this.viewData.signUpMethod === 3) {
|
if (this.viewData.signUpMethod === 3) {
|
||||||
// if (this.teamUsers.length === 0) {
|
if (this.teamUsers.length === 0) {
|
||||||
// this.$message.warning("请添加报名人员后再提交!")
|
this.$message.warning("请添加报名人员后再提交!")
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
// if (this.teamUsers.length > this.viewData.teamNum) {
|
if (this.viewData.teamNum && this.teamUsers.length > this.viewData.teamNum) {
|
||||||
// this.$message.warning("您选择的人数大于" + this.viewData.teamNum + "人,请重新选择!")
|
this.$message.warning("您选择的人数大于" + this.viewData.teamNum + "人,请重新选择!")
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let formData = {
|
let formData = {
|
||||||
@@ -368,7 +419,7 @@ const singleSignUp = {
|
|||||||
this.$message.warning("请添加报名人员后再提交!")
|
this.$message.warning("请添加报名人员后再提交!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (this.teamUsers.length > this.viewData.teamNum) {
|
if (this.viewData.teamNum && this.teamUsers.length > this.viewData.teamNum) {
|
||||||
this.$message.warning("您选择的人数大于" + this.viewData.teamNum + "人,请重新选择!")
|
this.$message.warning("您选择的人数大于" + this.viewData.teamNum + "人,请重新选择!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -420,7 +471,10 @@ const singleSignUp = {
|
|||||||
//查询队友信息
|
//查询队友信息
|
||||||
queryTeammate(val) {
|
queryTeammate(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
this.$axios.post("/platform/activity/culture/applyUser/queryTeammate", {keyword: val}).then((res) => {
|
this.$axios.post("/platform/activity/culture/applyUser/queryTeammate", {
|
||||||
|
keyword: val,
|
||||||
|
signUpMethod: this.viewData.signUpMethod
|
||||||
|
}).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
res.data.map(v => v.applyUserId = this.$store.state.user.id)
|
res.data.map(v => v.applyUserId = this.$store.state.user.id)
|
||||||
this.teammateOptions = res.data
|
this.teammateOptions = res.data
|
||||||
@@ -439,7 +493,7 @@ const singleSignUp = {
|
|||||||
this.$message.error("请勿重复添加")
|
this.$message.error("请勿重复添加")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (this.teamUsers.length >= this.viewData.teamNum) {
|
if (this.viewData.teamNum && this.teamUsers.length >= this.viewData.teamNum) {
|
||||||
this.$message.error("已满员")
|
this.$message.error("已满员")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -457,11 +511,22 @@ const singleSignUp = {
|
|||||||
this.$axios.post("/platform/activity/culture/infoManage/activityInfo", {id: this.id}).then((res) => {
|
this.$axios.post("/platform/activity/culture/infoManage/activityInfo", {id: this.id}).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.viewData = res.data
|
this.viewData = res.data
|
||||||
|
//总人数限制
|
||||||
|
if (this.viewData.userNumberLimit === 1) {
|
||||||
|
} else if (this.viewData.userNumberLimit === 2) {
|
||||||
|
//分工会人数限制
|
||||||
|
const union = this.viewData.unionUserNumberLimit.find(v => v.id === this.$store.state.user.union.id)
|
||||||
|
this.viewData.unionTeamNum = union.limitNum
|
||||||
|
}
|
||||||
|
if (this.viewData.signUpMethod === 3) {
|
||||||
|
this.listTeamUserUnion()
|
||||||
|
} else {
|
||||||
|
this.listTeamUser()
|
||||||
|
}
|
||||||
if (this.viewData.formConfig) {
|
if (this.viewData.formConfig) {
|
||||||
this.formCreateRule = formCreate.parseJson(this.viewData.formConfig.rule)
|
this.formCreateRule = formCreate.parseJson(this.viewData.formConfig.rule)
|
||||||
this.formCreateOption = formCreate.parseJson(this.viewData.formConfig.options)
|
this.formCreateOption = formCreate.parseJson(this.viewData.formConfig.options)
|
||||||
}
|
}
|
||||||
this.listTeamUser()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,6 +90,17 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
|||||||
{{activityTableData.athleteMaxNum-applyUserTableData.filter(v=>v.identity.includes('1')).length}}人;
|
{{activityTableData.athleteMaxNum-applyUserTableData.filter(v=>v.identity.includes('1')).length}}人;
|
||||||
替补还可以报{{activityTableData.substituteNum-applyUserTableData.filter(v=>v.identity.includes('5')).length}}人(非必需)】
|
替补还可以报{{activityTableData.substituteNum-applyUserTableData.filter(v=>v.identity.includes('5')).length}}人(非必需)】
|
||||||
</el-divider>
|
</el-divider>
|
||||||
|
<div style="padding-left: 10px">
|
||||||
|
<el-tooltip class="item"
|
||||||
|
content="系统中查询不到的人可以点击添加"
|
||||||
|
effect="dark"
|
||||||
|
placement="top">
|
||||||
|
<el-button
|
||||||
|
:disabled="(activityTableData.restrictMaxNum-applyUserTableData.length)<=0"
|
||||||
|
@click="openAddUser" circle icon="el-icon-plus"
|
||||||
|
type="danger"></el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-button @click="setUserRole('4')"
|
<el-button @click="setUserRole('4')"
|
||||||
icon="el-icon-check"
|
icon="el-icon-check"
|
||||||
@@ -229,6 +240,89 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
|||||||
</el-card>
|
</el-card>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
:append-to-body="true"
|
||||||
|
:visible.sync="addUserDialogVisible"
|
||||||
|
title="添加人员"
|
||||||
|
width="40%"
|
||||||
|
>
|
||||||
|
<el-form :model="formData" label-width="100px" ref="lsryform">
|
||||||
|
<el-form-item label="所在队伍" prop="teamId"
|
||||||
|
:rules="{required: true, message: '请选择所在队伍', trigger: 'blur'}">
|
||||||
|
<el-select clearable disabled placeholder="请选择所在队伍" style="width: 100%"
|
||||||
|
v-model="formData.teamId">
|
||||||
|
<el-option
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
v-for="item in teamList">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="姓名" prop="userId" :rules="{required: true, message: '请输入工号或者姓名查询', trigger: 'blur'}">
|
||||||
|
<el-select
|
||||||
|
:remote-method="querySearchAsync"
|
||||||
|
@change="addUserChange"
|
||||||
|
filterable
|
||||||
|
placeholder="请输入工号或者下姓名查询"
|
||||||
|
remote
|
||||||
|
reserve-keyword
|
||||||
|
style="width: 100%"
|
||||||
|
v-model="formData.userId">
|
||||||
|
<el-option
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.username+'-'+item.loginname"
|
||||||
|
:value="item.id"
|
||||||
|
v-for="item in lsUserList">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工号" prop="loginname" :rules="{required: true, message: '请填写工号', trigger: 'blur'}">
|
||||||
|
<el-input disabled maxlength="50" placeholder="请填写工号"
|
||||||
|
type="text" v-model="formData.loginname"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="性别" prop="sex" :rules="{required: true, message: '性别', trigger: 'blur'}">
|
||||||
|
<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 label="出生年月" prop="birthday" :rules="{required: true, message: '选择出生年月', trigger: 'blur'}">
|
||||||
|
<el-date-picker
|
||||||
|
style="width: 100%"
|
||||||
|
v-model="formData.birthday"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="选择出生年月">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电话" prop="mobile">
|
||||||
|
<el-input maxlength="50" placeholder="请填写电话" type="text"
|
||||||
|
v-model="formData.mobile"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="身份证号" prop="idcard">
|
||||||
|
<el-input maxlength="30" placeholder="请填写身份证号" type="text"
|
||||||
|
v-model="formData.idcard"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所在单位" prop="unitId" :rules="{required: true, message: '请选择所在单位', trigger: 'blur'}">
|
||||||
|
<el-select clearable filterable placeholder="请选择所在单位" style="width: 100%"
|
||||||
|
v-model="formData.unitId">
|
||||||
|
<el-option
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
v-for="item in unitOptions">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<span class="dialog-footer" slot="footer">
|
||||||
|
<el-button @click="addUserDialogVisible = false">取 消</el-button>
|
||||||
|
<el-button @click="doAddUser" type="primary">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
store,
|
store,
|
||||||
@@ -253,10 +347,104 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
|||||||
applyUserTabLoading: false,
|
applyUserTabLoading: false,
|
||||||
selection: [],
|
selection: [],
|
||||||
//全部可报名的人员
|
//全部可报名的人员
|
||||||
userList: []
|
userList: [],
|
||||||
|
|
||||||
|
addUserDialogVisible: false,
|
||||||
|
lsUserList:[],
|
||||||
|
unitOptions:[]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
doAddUser(){
|
||||||
|
this.$refs["lsryform"].validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const birthDate = moment(this.formData.birthday);
|
||||||
|
const age = this.$moment().diff(birthDate, 'years');
|
||||||
|
const data = {
|
||||||
|
isAddUser: true,
|
||||||
|
age: age,
|
||||||
|
unitname: this.unitOptions.find(x => x.id === this.formData.unitId).name,
|
||||||
|
...this.formData
|
||||||
|
}
|
||||||
|
//如果添加的人不在数据库
|
||||||
|
const user = this.lsUserList.find(l => l.id === this.formData.userId)
|
||||||
|
if (!user) {
|
||||||
|
const newUser = this.leftApplyUserList.find(a => a.id === this.formData.userId)
|
||||||
|
if (newUser) {
|
||||||
|
this.notifyWarning('该用户已存在左侧选择框内,请从左侧选择框内选择!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.applyUserList.push(data)
|
||||||
|
this.flushApplyUser(this.applyUserList)
|
||||||
|
this.sortApplyUserTableData()
|
||||||
|
|
||||||
|
this.$notify.success({title: '成功', message: '已添加'});
|
||||||
|
this.addUserDialogVisible = false
|
||||||
|
} else {
|
||||||
|
this.$notify.error({title: '错误', message: '存在未填写的的必填项'});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async addUserChange(val) {
|
||||||
|
const user = this.lsUserList.find(l => l.id === val)
|
||||||
|
/* let loginname = "GHLS" + moment().format('YYYY') + "001"
|
||||||
|
//如果数据库找不到此人
|
||||||
|
if (!user) {
|
||||||
|
const lsryUser = await this.getGhLsRy()
|
||||||
|
//如果有临时人员
|
||||||
|
if (lsryUser) {
|
||||||
|
let str = lsryUser.loginname;
|
||||||
|
let prefix = "GHLS";
|
||||||
|
// 找到"GHLS"在字符串中首次出现的位置
|
||||||
|
let index = str.indexOf(prefix);
|
||||||
|
// 如果"GHLS"确实存在于字符串中,并且不是在字符串开头
|
||||||
|
if (index !== -1 && index + prefix.length < str.length) {
|
||||||
|
loginname = prefix + (Number(str.slice(index + prefix.length)) + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
this.$set(this.formData, 'eventId', this.eventData.eventId)
|
||||||
|
this.$set(this.formData, 'activityId', this.activityTableData.activityId)
|
||||||
|
this.$set(this.formData, 'team', this.applyFromData.teamName)
|
||||||
|
this.$set(this.formData, 'teamId', this.applyFromData.teamId)
|
||||||
|
this.$set(this.formData, 'userId', user ? user.id : null)
|
||||||
|
this.$set(this.formData, 'loginname', user ? user.loginname : null)
|
||||||
|
this.$set(this.formData, 'username', user ? user.username : null)
|
||||||
|
this.$set(this.formData, 'unitId', user ? user.unitId : null)
|
||||||
|
this.$set(this.formData, 'sex', user ? user.sex : null)
|
||||||
|
this.$set(this.formData, 'idcard', user ? user.idCard : null)
|
||||||
|
this.$set(this.formData, 'mobile', user ? user.mobile : null)
|
||||||
|
this.$set(this.formData, 'birthday', user ? user.birthday : null)
|
||||||
|
this.$set(this.formData, 'awardsMode', this.activityTableData.eveProjectType)
|
||||||
|
this.$set(this.formData, 'status', 2)
|
||||||
|
},
|
||||||
|
async querySearchAsync(queryString) {
|
||||||
|
const leftApplyUserList = this.leftApplyUserList.map(m => m.loginname)
|
||||||
|
const rightApplyUserList = this.rightApplyUserList.map(m => m.loginname)
|
||||||
|
const loginnames = leftApplyUserList.concat(rightApplyUserList)
|
||||||
|
const {code, data} = await $.get("/platform/activity/apply/getSysUser", {
|
||||||
|
loginnames: JSON.stringify(loginnames),
|
||||||
|
queryString: queryString
|
||||||
|
})
|
||||||
|
if (code === 0) {
|
||||||
|
this.lsUserList = data
|
||||||
|
} else {
|
||||||
|
this.lsUserList = []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
openAddUser() {
|
||||||
|
this.formData = {
|
||||||
|
teamName: this.applyFromData.teamName,
|
||||||
|
teamId: this.applyFromData.teamId,
|
||||||
|
identity: ['1']
|
||||||
|
}
|
||||||
|
this.addUserDialogVisible = true
|
||||||
|
if (this.$refs['lsryform']) {
|
||||||
|
this.$refs['lsryform'].resetFields()
|
||||||
|
}
|
||||||
|
},
|
||||||
async openUniteApply(data) {
|
async openUniteApply(data) {
|
||||||
this.activityTableData = data
|
this.activityTableData = data
|
||||||
//固定模式
|
//固定模式
|
||||||
@@ -332,7 +520,16 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
|||||||
let message = null
|
let message = null
|
||||||
|
|
||||||
if (flag) {
|
if (flag) {
|
||||||
const { athletesMaxNum, restrictGirlNum, restrictBoyNum, leanderNum, coachNum, deputyDirectorNum, substituteNum, projectType } =
|
const {
|
||||||
|
athletesMaxNum,
|
||||||
|
restrictGirlNum,
|
||||||
|
restrictBoyNum,
|
||||||
|
leanderNum,
|
||||||
|
coachNum,
|
||||||
|
deputyDirectorNum,
|
||||||
|
substituteNum,
|
||||||
|
projectType
|
||||||
|
} =
|
||||||
this.eventData
|
this.eventData
|
||||||
|
|
||||||
const applyUserList = clone(this.applyUserList)
|
const applyUserList = clone(this.applyUserList)
|
||||||
@@ -388,7 +585,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
|||||||
message = teamName + "女运动员至少设置" + restrictGirlNum + "人"
|
message = teamName + "女运动员至少设置" + restrictGirlNum + "人"
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
const manYdyNum = teamApplyData[i].filter((v) => v.sex === "女" && v.identity.includes("1")).length
|
const manYdyNum = teamApplyData[i].filter((v) => v.sex === "男" && v.identity.includes("1")).length
|
||||||
if (restrictBoyNum > 0 && manYdyNum < restrictBoyNum) {
|
if (restrictBoyNum > 0 && manYdyNum < restrictBoyNum) {
|
||||||
msgFlag = false
|
msgFlag = false
|
||||||
message = teamName + "男运动员至少设置" + restrictBoyNum + "人"
|
message = teamName + "男运动员至少设置" + restrictBoyNum + "人"
|
||||||
@@ -666,6 +863,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
|||||||
getTransProp(user) {
|
getTransProp(user) {
|
||||||
return {
|
return {
|
||||||
id: user.id,
|
id: user.id,
|
||||||
|
loginname: user.loginname,
|
||||||
name: user.username + "(" + (user.sex ? user.sex : "") + "-" + user.loginname + ")"
|
name: user.username + "(" + (user.sex ? user.sex : "") + "-" + user.loginname + ")"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -681,5 +879,8 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
|||||||
this.userList = []
|
this.userList = []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created() {}
|
async created() {
|
||||||
|
this.unitOptions = await this.$businessTool.listUnit()
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ layout("/layouts/platform.html"){
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #public>
|
<template #public>
|
||||||
<activity-sports-delete-user @flip="flip"
|
<activity-sports-delete-user @flush="doSearch"
|
||||||
ref="activityDeleteUser"></activity-sports-delete-user>
|
ref="activityDeleteUser"></activity-sports-delete-user>
|
||||||
</template>
|
</template>
|
||||||
</guava>
|
</guava>
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item prop="files" label="封面图" v-if="formData.applyWay.includes(1)">
|
<el-form-item prop="files" label="封面图" >
|
||||||
<file-upload
|
<file-upload
|
||||||
:value.sync="formData.image"
|
:value.sync="formData.image"
|
||||||
:upload_number="1"
|
:upload_number="1"
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ layout("/layouts/platform.html"){
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$message.success(res.msg)
|
this.$message.success(res.msg)
|
||||||
|
this.$store.dispatch("pjaxRoute", "/platform/warmthCondolence/mine")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -129,13 +129,13 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
doDelete(id) {
|
doDelete(row) {
|
||||||
this.$confirm("您确定要删除吗?", "提示", {
|
this.$confirm("您确定要删除吗?", "提示", {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning"
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$axios.post("/platform/warmthCondolenceNotice/delete", { id: id }).then((res) => {
|
this.$axios.post("/platform/warmthCondolenceNotice/delete", { id: row.id }).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$message.success(res.msg)
|
this.$message.success(res.msg)
|
||||||
this.doSearch()
|
this.doSearch()
|
||||||
|
|||||||
@@ -191,8 +191,8 @@ layout("/layouts/platform_h5.html"){
|
|||||||
<van-icon name="location-o"></van-icon>
|
<van-icon name="location-o"></van-icon>
|
||||||
报名方式:
|
报名方式:
|
||||||
<span v-if="viewData.signUpMethod===1" style="color: var(--color-primary)">个人报名</span>
|
<span v-if="viewData.signUpMethod===1" style="color: var(--color-primary)">个人报名</span>
|
||||||
<span v-if="viewData.signUpMethod===2" style="color: var(--color-primary)">分工会报名</span>
|
<span v-if="viewData.signUpMethod===2" style="color: var(--color-primary)">组队报名</span>
|
||||||
<span v-if="viewData.signUpMethod===3" style="color: var(--color-primary)">组队报名</span>
|
<span v-if="viewData.signUpMethod===3" style="color: var(--color-primary)">分工会报名</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="info-item" v-if="viewData.signUpMethod==3">
|
<div class="info-item" v-if="viewData.signUpMethod==3">
|
||||||
<van-icon name="location-o"></van-icon>
|
<van-icon name="location-o"></van-icon>
|
||||||
@@ -277,6 +277,51 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 分工会报名-->
|
||||||
|
<div v-else-if="viewData.signUpMethod===3" class="block">
|
||||||
|
<div class="notice-title left-tag-title">选择报名人员
|
||||||
|
<span v-if="viewData.userNumberLimit===2">
|
||||||
|
,报名人数 <span style="color: red">
|
||||||
|
{{viewData.unionTeamNum}}</span>人
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<el-select
|
||||||
|
v-if="inApplyTime"
|
||||||
|
v-model="searchTeammateUserId"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
remote
|
||||||
|
reserve-keyword
|
||||||
|
placeholder="请输入关键词"
|
||||||
|
:remote-method="queryTeammate">
|
||||||
|
<el-option
|
||||||
|
v-for="item in teammateOptions"
|
||||||
|
:key="item.userId"
|
||||||
|
:label="item.userName + '(' + item.loginName + ')'"
|
||||||
|
:value="item.userId">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-button v-if="inApplyTime" class="ml5" type="primary" icon="el-icon-plus"
|
||||||
|
@click="addTeamUser">添加
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-table :data="teamUsers" class="mt10">
|
||||||
|
<el-table-column label="序号" type="index" width="60px"></el-table-column>
|
||||||
|
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||||
|
<el-table-column prop="loginName" label="工号"></el-table-column>
|
||||||
|
<!-- <el-table-column prop="sex" label="性别"></el-table-column>-->
|
||||||
|
<!-- <el-table-column prop="unitName" label="单位"></el-table-column>-->
|
||||||
|
<!-- <el-table-column prop="mobile" label="手机号"></el-table-column>-->
|
||||||
|
<el-table-column label="操作" width="100px"
|
||||||
|
v-if="inApplyTime">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="danger" size="mini" @click="removeTeamUser(scope.$index)">删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-create-h5" v-if="isCustomForm">
|
<div class="form-create-h5" v-if="isCustomForm">
|
||||||
<div class="notice-title left-tag-title">填写报名信息</div>
|
<div class="notice-title left-tag-title">填写报名信息</div>
|
||||||
<form-create :value.sync="dynamicFormData" v-model="fapi" :rule="formCreateRule"
|
<form-create :value.sync="dynamicFormData" v-model="fapi" :rule="formCreateRule"
|
||||||
@@ -362,11 +407,22 @@ layout("/layouts/platform_h5.html"){
|
|||||||
this.$axios.post("/platform/activity/culture/infoManage/activityInfo", {id: this.id}).then((res) => {
|
this.$axios.post("/platform/activity/culture/infoManage/activityInfo", {id: this.id}).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.viewData = res.data
|
this.viewData = res.data
|
||||||
|
//总人数限制
|
||||||
|
if (this.viewData.userNumberLimit === 1) {
|
||||||
|
} else if (this.viewData.userNumberLimit === 2) {
|
||||||
|
//分工会人数限制
|
||||||
|
const union = this.viewData.unionUserNumberLimit.find(v => v.id === this.$store.state.user.union.id)
|
||||||
|
this.viewData.unionTeamNum = union.limitNum
|
||||||
|
}
|
||||||
|
if (this.viewData.signUpMethod === 3) {
|
||||||
|
this.listTeamUserUnion()
|
||||||
|
} else {
|
||||||
|
this.listTeamUser()
|
||||||
|
}
|
||||||
if (this.viewData.formConfig) {
|
if (this.viewData.formConfig) {
|
||||||
this.formCreateRule = formCreate.parseJson(this.viewData.formConfig.rule)
|
this.formCreateRule = formCreate.parseJson(this.viewData.formConfig.rule)
|
||||||
this.formCreateOption = formCreate.parseJson(this.viewData.formConfig.options)
|
this.formCreateOption = formCreate.parseJson(this.viewData.formConfig.options)
|
||||||
}
|
}
|
||||||
this.listTeamUser()
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -382,6 +438,17 @@ layout("/layouts/platform_h5.html"){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//查询报名人员
|
||||||
|
listTeamUserUnion() {
|
||||||
|
this.$axios.post("/platform/activity/culture/applyUser/listTeamUserUnion", {activityId: this.id}).then((res) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.isSignUp = res.data.length > 0
|
||||||
|
this.teamUsers = res.data
|
||||||
|
this.defaultAddSelf()
|
||||||
|
this.customFormInit()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
//表单回显
|
//表单回显
|
||||||
customFormInit() {
|
customFormInit() {
|
||||||
if (this.teamUsers && this.teamUsers.length > 0) {
|
if (this.teamUsers && this.teamUsers.length > 0) {
|
||||||
@@ -467,7 +534,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (this.teamUsers.length > this.viewData.teamNum) {
|
if (this.viewData.teamNum && this.teamUsers.length > this.viewData.teamNum) {
|
||||||
this.$dialog
|
this.$dialog
|
||||||
.alert({
|
.alert({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
@@ -499,8 +566,12 @@ layout("/layouts/platform_h5.html"){
|
|||||||
this.$axios.post("/platform/activity/culture/applyUser/signUp", formData).then((res) => {
|
this.$axios.post("/platform/activity/culture/applyUser/signUp", formData).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$toast.success(res.msg)
|
this.$toast.success(res.msg)
|
||||||
|
if (this.viewData.signUpMethod === 3) {
|
||||||
|
this.listTeamUserUnion()
|
||||||
|
} else {
|
||||||
this.listTeamUser()
|
this.listTeamUser()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -568,7 +639,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (this.teamUsers.length > this.viewData.teamNum) {
|
if (this.viewData.teamNum && this.teamUsers.length > this.viewData.teamNum) {
|
||||||
this.$dialog
|
this.$dialog
|
||||||
.alert({
|
.alert({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
@@ -601,8 +672,12 @@ layout("/layouts/platform_h5.html"){
|
|||||||
this.$axios.post("/platform/activity/culture/applyUser/signUp", formData).then((res) => {
|
this.$axios.post("/platform/activity/culture/applyUser/signUp", formData).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$toast.success(res.msg)
|
this.$toast.success(res.msg)
|
||||||
|
if (this.viewData.signUpMethod === 3) {
|
||||||
|
this.listTeamUserUnion()
|
||||||
|
} else {
|
||||||
this.listTeamUser()
|
this.listTeamUser()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -618,7 +693,11 @@ layout("/layouts/platform_h5.html"){
|
|||||||
this.$axios.post("/platform/activity/culture/applyUser/cancelSignUp", {activityId: this.id}).then((res) => {
|
this.$axios.post("/platform/activity/culture/applyUser/cancelSignUp", {activityId: this.id}).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$toast.success(res.msg)
|
this.$toast.success(res.msg)
|
||||||
|
if (this.viewData.signUpMethod === 3) {
|
||||||
|
this.listTeamUserUnion()
|
||||||
|
} else {
|
||||||
this.listTeamUser()
|
this.listTeamUser()
|
||||||
|
}
|
||||||
this.fapi.resetFields()
|
this.fapi.resetFields()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -628,7 +707,10 @@ layout("/layouts/platform_h5.html"){
|
|||||||
//查询队友信息
|
//查询队友信息
|
||||||
queryTeammate(val) {
|
queryTeammate(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
this.$axios.post("/platform/activity/culture/applyUser/queryTeammate", {keyword: val}).then((res) => {
|
this.$axios.post("/platform/activity/culture/applyUser/queryTeammate", {
|
||||||
|
keyword: val,
|
||||||
|
signUpMethod: this.viewData.signUpMethod
|
||||||
|
}).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
res.data.map(v => {
|
res.data.map(v => {
|
||||||
v.applyUserId = this.$store.state.user.id
|
v.applyUserId = this.$store.state.user.id
|
||||||
@@ -663,7 +745,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (this.teamUsers.length >= this.viewData.teamNum) {
|
if (this.viewData.teamNum && this.teamUsers.length >= this.viewData.teamNum) {
|
||||||
this.$dialog
|
this.$dialog
|
||||||
.alert({
|
.alert({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="app" v-cloak>
|
<div id="app" v-cloak>
|
||||||
<van-nav-bar title="活动列表" @click-left="()=>this.$pjaxReplace('/platform/home')" left-arrow left-text="返回" placeholder fixed></van-nav-bar>
|
<van-nav-bar title="活动列表" @click-left="()=>this.$pjaxReplace('/platform/home')" left-arrow left-text="返回"
|
||||||
|
placeholder fixed></van-nav-bar>
|
||||||
<van-sticky offset-top="46px">
|
<van-sticky offset-top="46px">
|
||||||
<van-dropdown-menu>
|
<van-dropdown-menu>
|
||||||
<year-van-dropdown-item :num="5" @change="pageData" v-model="pageForm.year"></year-van-dropdown-item>
|
<year-van-dropdown-item :num="5" @change="pageData" v-model="pageForm.year"></year-van-dropdown-item>
|
||||||
@@ -81,10 +82,11 @@ layout("/layouts/platform_h5.html"){
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
<!--#include("eventNotification.js"){}#-->
|
<!--#include("eventNotification.js"){}#-->
|
||||||
new Vue({
|
const vue = new Vue({
|
||||||
el: "#app",
|
el: "#app",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
activityId: GetQueryString("activityId"),
|
||||||
tableData: [],
|
tableData: [],
|
||||||
finished: false,
|
finished: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -119,18 +121,20 @@ layout("/layouts/platform_h5.html"){
|
|||||||
this.viewData = row
|
this.viewData = row
|
||||||
this.$refs.eventNotification.viewShow = true
|
this.$refs.eventNotification.viewShow = true
|
||||||
},
|
},
|
||||||
pageData() {
|
async pageData() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.$axios.post("/platform/h5/activity/apply/activityData", this.pageForm).then((res) => {
|
const res = await this.$axios.post("/platform/h5/activity/apply/activityData", this.pageForm)
|
||||||
this.tableData = res.data
|
this.tableData = res.data
|
||||||
|
|
||||||
this.finished = true
|
this.finished = true
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
async created() {
|
||||||
this.pageData()
|
await this.pageData()
|
||||||
|
if (this.activityId) {
|
||||||
|
const activity = this.tableData.find(v => v.id === this.activityId)
|
||||||
|
this.openView(activity)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</van-sticky>
|
</van-sticky>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<van-list :finished="finished" @load="pageData" finished-text="没有更多了" v-if="tableData.length>0" v-model="loading">
|
<van-list :finished="finished" @load="pageData" finished-text="没有更多了" v-if="tableData.length>0"
|
||||||
|
v-model="loading">
|
||||||
<div class="table-list">
|
<div class="table-list">
|
||||||
<div :key="row.id" class="table-card" v-for="row in tableData">
|
<div :key="row.id" class="table-card" v-for="row in tableData">
|
||||||
<van-image :src="row.image" fit="cover" height="200" v-if="row.image" width="100%"></van-image>
|
<van-image :src="row.image" fit="cover" height="200" v-if="row.image" width="100%"></van-image>
|
||||||
@@ -25,11 +26,16 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #right-icon>
|
<template #right-icon>
|
||||||
<div style="display: flex; justify-content: flex-end" v-if="row.status">
|
<div style="display: flex; justify-content: flex-end" v-if="row.status&&row.applyWay.length===1&&row.applyWay.includes(1)">
|
||||||
<van-tag type="primary" v-if="row.status===1">待审核</van-tag>
|
<van-tag type="primary" v-if="row.status===1">待审核</van-tag>
|
||||||
<van-tag type="success" v-if="row.status===2">已成功报名</van-tag>
|
<van-tag type="success" v-if="row.status===2">已成功报名</van-tag>
|
||||||
<van-tag type="danger" v-if="row.status===3">审核不通过</van-tag>
|
<van-tag type="danger" v-if="row.status===3">审核不通过</van-tag>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="display: flex; justify-content: flex-end" v-else>
|
||||||
|
<van-tag type="primary" v-if="row.status2===0">待审核</van-tag>
|
||||||
|
<van-tag type="success" v-if="row.status2===2">已成功报名</van-tag>
|
||||||
|
<van-tag type="danger" v-if="row.status2===3">审核不通过</van-tag>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell title="可报队数" v-if="row.eveProjectType==='2'">
|
<van-cell title="可报队数" v-if="row.eveProjectType==='2'">
|
||||||
@@ -54,31 +60,54 @@ layout("/layouts/platform_h5.html"){
|
|||||||
<span v-else>0人</span>
|
<span v-else>0人</span>
|
||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell title="已报名人员" v-if="JSON.parse(row.applyWay).length===1">
|
<van-cell title="已报名人员"
|
||||||
|
v-if="row.userApplyNames&&row.applyWay.length===1&&row.applyWay.includes(1)">
|
||||||
<template #right-icon>
|
<template #right-icon>
|
||||||
<span @click="openApplyUser(row)" v-if="row.userApplyNames">{{ row.userApplyNames}}</span>
|
<span @click="openApplyUser(row)" v-if="row.userApplyNames">{{ row.userApplyNames}}</span>
|
||||||
<span v-else>暂无</span>
|
<span v-else>暂无</span>
|
||||||
</template>
|
</template>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<!--<van-cell class="table-card-footer">
|
<van-cell class="table-card-footer">
|
||||||
<template>
|
<div v-if="row.applyWay.length===1&&row.applyWay.includes(1)">
|
||||||
<van-button :loading="subLoading" @click="openView(row)" round
|
<van-button :loading="subLoading" @click="signUpUser(row)" round
|
||||||
size="small"
|
size="small"
|
||||||
type="primary">
|
type="primary" v-if="activityData.applyWay.includes(1)&&row.userApply===0">
|
||||||
报 名
|
报 名
|
||||||
</van-button>
|
</van-button>
|
||||||
</template>
|
<van-button :loading="subLoading" @click="cancelApply(row)" round
|
||||||
</van-cell>-->
|
size="small"
|
||||||
|
color="#dd6363"
|
||||||
|
type="primary" v-if="activityData.applyWay.includes(1)&&row.userApply>0">
|
||||||
|
取消报名
|
||||||
|
</van-button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<van-button :loading="subLoading" @click="signUpUser(row)" round
|
||||||
|
size="small"
|
||||||
|
type="primary" v-if="activityData.applyWay.includes(1)&&row.userApply2===0">
|
||||||
|
报 名
|
||||||
|
</van-button>
|
||||||
|
<van-button :loading="subLoading" @click="cancelApply(row)" round
|
||||||
|
size="small"
|
||||||
|
color="#dd6363"
|
||||||
|
type="primary" v-if="activityData.applyWay.includes(1)&&row.userApply2>0">
|
||||||
|
取消报名
|
||||||
|
</van-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</van-cell>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</van-list>
|
</van-list>
|
||||||
<van-empty image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据" v-else></van-empty>
|
<van-empty image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据"
|
||||||
|
v-else></van-empty>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
new Vue({
|
const vue = new Vue({
|
||||||
el: "#app",
|
el: "#app",
|
||||||
|
store,
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableData: [],
|
tableData: [],
|
||||||
@@ -90,13 +119,72 @@ layout("/layouts/platform_h5.html"){
|
|||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
totalCount: 0
|
totalCount: 0
|
||||||
},
|
},
|
||||||
subLoading: false
|
subLoading: false,
|
||||||
|
activityData: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {},
|
components: {},
|
||||||
methods: {
|
methods: {
|
||||||
openApplyUser() {},
|
openApplyUser() {
|
||||||
openView(row) {},
|
},
|
||||||
|
cancelApply(row) {
|
||||||
|
this.$dialog.confirm({
|
||||||
|
title: "提示",
|
||||||
|
message: "确认要取消报名吗?"
|
||||||
|
}).then(() => {
|
||||||
|
if (row.applyUser !== this.$store.state.user.id) {
|
||||||
|
this.$dialog.alert({
|
||||||
|
title: '温馨提示',
|
||||||
|
message: "报名人不是您,请联系报名人取消!",
|
||||||
|
}).then(() => {
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$axios.post("/platform/h5/activity/apply/cancelApply", {
|
||||||
|
activityId: row.activityId,
|
||||||
|
eventId: row.eventId,
|
||||||
|
schoolEventId: row.id
|
||||||
|
}).then(resp => {
|
||||||
|
if (resp.code === 0) {
|
||||||
|
this.doSearch()
|
||||||
|
this.$dialog.alert({
|
||||||
|
title: '温馨提示',
|
||||||
|
message: resp.msg,
|
||||||
|
}).then(() => {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
signUpUser(row) {
|
||||||
|
this.$dialog.confirm({
|
||||||
|
title: "提示",
|
||||||
|
message: "确认要报名吗?"
|
||||||
|
}).then(async () => {
|
||||||
|
const teamList = await this.listTeamList(row)
|
||||||
|
if (teamList.length > 0 ) {
|
||||||
|
row.teamId = teamList[0].id
|
||||||
|
}
|
||||||
|
this.$axios.post("/platform/h5/activity/apply/signUpUser", {
|
||||||
|
activityId: row.activityId,
|
||||||
|
teamId: row.teamId,
|
||||||
|
eventId: row.eventId,
|
||||||
|
schoolEventId: row.id
|
||||||
|
}).then(resp => {
|
||||||
|
if (resp.code === 0) {
|
||||||
|
this.doSearch()
|
||||||
|
this.$dialog.alert({
|
||||||
|
title: '温馨提示',
|
||||||
|
message: resp.msg,
|
||||||
|
}).then(() => {
|
||||||
|
// on close
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
openView(row) {
|
||||||
|
},
|
||||||
pageData() {
|
pageData() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.$axios.post("/platform/h5/activity/apply/pageData", {data: JSON.stringify(this.pageForm)}).then((res) => {
|
this.$axios.post("/platform/h5/activity/apply/pageData", {data: JSON.stringify(this.pageForm)}).then((res) => {
|
||||||
@@ -110,9 +198,25 @@ layout("/layouts/platform_h5.html"){
|
|||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
async listTeamList(row) {
|
||||||
|
const resp = await this.$axios.post("/platform/h5/activity/apply/listTeamList", {
|
||||||
|
activityId: row.activityId,
|
||||||
|
eventId: row.eventId,
|
||||||
|
})
|
||||||
|
if (resp.code === 0) {
|
||||||
|
return resp.data
|
||||||
|
}
|
||||||
|
},
|
||||||
|
doSearch() {
|
||||||
|
this.tableKey = new Date().getTime()
|
||||||
|
this.pageForm.pageNumber = 1
|
||||||
|
this.pageForm.totalCount = 0
|
||||||
|
this.tableData = []
|
||||||
|
this.pageData()
|
||||||
|
},
|
||||||
findOneActivity() {
|
findOneActivity() {
|
||||||
this.$axios.post("/platform/h5/activity/apply/findOneActivity", {activityId: this.pageForm.activityId}).then((res) => {
|
this.$axios.post("/platform/h5/activity/apply/findOneActivity", {activityId: this.pageForm.activityId}).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 0) {
|
||||||
this.activityData = res.data
|
this.activityData = res.data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user