commit
This commit is contained in:
+269
-35
@@ -1,14 +1,19 @@
|
|||||||
package com.budwk.app.zhgh.activity.family.controller.manage;
|
package com.budwk.app.zhgh.activity.family.controller.manage;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.dev33.satoken.annotation.SaMode;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
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;
|
||||||
import com.budwk.app.base.result.Result;
|
import com.budwk.app.base.result.Result;
|
||||||
import com.budwk.app.sys.models.Sys_dict;
|
import com.budwk.app.sys.models.Sys_dict;
|
||||||
|
import com.budwk.app.sys.models.Sys_user;
|
||||||
import com.budwk.app.sys.services.SysDictService;
|
import com.budwk.app.sys.services.SysDictService;
|
||||||
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
import com.budwk.app.web.commons.auth.utils.AuthUtil;
|
||||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||||
|
import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
|
||||||
import com.budwk.app.zhgh.activity.family.models.*;
|
import com.budwk.app.zhgh.activity.family.models.*;
|
||||||
import com.budwk.app.zhgh.activity.family.service.FamilyActivityService;
|
import com.budwk.app.zhgh.activity.family.service.FamilyActivityService;
|
||||||
import com.budwk.app.zhgh.activity.family.service.FamilyActivityStatisticsService;
|
import com.budwk.app.zhgh.activity.family.service.FamilyActivityStatisticsService;
|
||||||
@@ -16,6 +21,7 @@ import io.swagger.annotations.Api;
|
|||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nutz.dao.Cnd;
|
import org.nutz.dao.Cnd;
|
||||||
|
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.Static;
|
import org.nutz.dao.util.cri.Static;
|
||||||
@@ -28,39 +34,56 @@ 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 java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@IocBean
|
@IocBean
|
||||||
@Ok("json:full")
|
@Ok("json:full")
|
||||||
@Api(tags = "活动报名")
|
@Api(tags = "活动报名")
|
||||||
@At("/platform/family/manage/apply")
|
@At("/platform/family/apply")
|
||||||
public class FamilyActivityApplyController {
|
public class FamilyActivityApplyController {
|
||||||
|
|
||||||
|
private final ReentrantLock lock = new ReentrantLock(true);
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private FamilyActivityService familyActivityService;
|
private FamilyActivityService familyActivityService;
|
||||||
@Inject
|
@Inject
|
||||||
private SysDictService dictService;
|
private SysDictService dictService;
|
||||||
@Inject
|
@Inject
|
||||||
private FamilyActivityStatisticsService statisticsService;
|
private FamilyActivityStatisticsService statisticsService;
|
||||||
|
@Inject
|
||||||
|
private Dao dao;
|
||||||
|
|
||||||
@At("")
|
@At("/")
|
||||||
@SaCheckPermission("family.manage.apply")
|
@SaCheckPermission("family.apply")
|
||||||
@Ok("beetl:/platform/zhgh/activity/family/apply/index.html")
|
@Ok("beetl:/platform/zhgh/activity/family/apply/index.html")
|
||||||
public void index() {
|
public void index() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@At("/h5")
|
||||||
|
@SaCheckPermission("h5.family.apply")
|
||||||
|
@Ok("beetl:/platform/zhghh5/activity/family/apply/index.html")
|
||||||
|
public void h5Index() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@At("/list/h5")
|
||||||
|
@SaCheckPermission("h5.family.apply")
|
||||||
|
@Ok("beetl:/platform/zhghh5/activity/family/list/index.html")
|
||||||
|
public void listIndex() {
|
||||||
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("活动查询")
|
@ApiOperation("活动查询")
|
||||||
@SaCheckPermission("family.manage.apply")
|
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
|
||||||
public Result activityData(PageForm pageForm,
|
public Result activityPageData(PageForm pageForm,
|
||||||
@Param(value = "year") Integer year,
|
@Param(value = "year") Integer year,
|
||||||
@Param(value = "activityType") Integer activityType) {
|
@Param(value = "activityType") Integer activityType,
|
||||||
|
@Param(value = "id") String id,
|
||||||
|
@Param(value = "dataType") String dataType) {
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
|
cnd.andEX("id", "=", id);
|
||||||
cnd.andEX("`year`", "=", year);
|
cnd.andEX("`year`", "=", year);
|
||||||
//查询报名中
|
//查询报名中
|
||||||
if (activityType == 2) {
|
if (activityType == 2) {
|
||||||
@@ -68,12 +91,18 @@ public class FamilyActivityApplyController {
|
|||||||
}//查询已结束的
|
}//查询已结束的
|
||||||
else if (activityType == 3) {
|
else if (activityType == 3) {
|
||||||
cnd.and(new Static("now() > activityEndTime"));
|
cnd.and(new Static("now() > activityEndTime"));
|
||||||
|
} else if (activityType == 4) {
|
||||||
|
cnd.and(new Static("now() < activitySignUpStartTime"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AuthUtil.hasRole("H04") && !AuthUtil.hasRoleOr("sysadmin, A06")) {
|
if (AuthUtil.hasRole("H04") && !AuthUtil.hasRoleOr("sysadmin, A06")) {
|
||||||
cnd.and("activityMode", "=", 2).and("createdBy", "=", SecurityUtil.getUserId());
|
cnd.and("activityMode", "=", 2).and("createdBy", "=", SecurityUtil.getUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if("mine".equals(dataType)) {
|
||||||
|
cnd.and(new Static("id in (select activityId from family_user where userId = '%s')".formatted(SecurityUtil.getUserId())));
|
||||||
|
}
|
||||||
|
|
||||||
Pagination pagination = familyActivityService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
Pagination pagination = familyActivityService.listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||||
List<FamilyActivity> familyActivities = pagination.getList();
|
List<FamilyActivity> familyActivities = pagination.getList();
|
||||||
Map<String, String> familyTypeMap = dictService.getSubListByCode("FAMILY_SIGNUP_TYPE").stream().collect(Collectors.toMap(Sys_dict::getCode, Sys_dict::getName));
|
Map<String, String> familyTypeMap = dictService.getSubListByCode("FAMILY_SIGNUP_TYPE").stream().collect(Collectors.toMap(Sys_dict::getCode, Sys_dict::getName));
|
||||||
@@ -83,33 +112,16 @@ public class FamilyActivityApplyController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("分活动查询")
|
@ApiOperation("分活动查询")
|
||||||
@SaCheckPermission("family.manage.apply")
|
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
|
||||||
public Result pageData(PageForm pageForm,
|
public Result pageData(PageForm pageForm,
|
||||||
@Param(value = "courseTypeId") String courseTypeId,
|
@Param(value = "courseTypeId") String courseTypeId,
|
||||||
@Param(value = "activityId") String activityId,
|
@Param(value = "activityId") String activityId,
|
||||||
@Param(value = "assortTypes") String[] assortTypes) {
|
@Param(value = "assortTypes") String[] assortTypes,
|
||||||
|
@Param(value = "dataType") String dataType) {
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
tsuc.id,
|
tsuc.*,
|
||||||
tsuc.activityId,
|
type.typeName
|
||||||
tsuc.courseName,
|
|
||||||
tsuc.coursePeopleNumber,
|
|
||||||
tsuc.courseLocation,
|
|
||||||
tsuc.courseType,
|
|
||||||
tsuc.courseLocationCoordinates,
|
|
||||||
tsuc.courseReservedNumber,
|
|
||||||
tsuc.courseInstructor,
|
|
||||||
tsuc.campus,
|
|
||||||
tsuc.unionLimit,
|
|
||||||
tsuc.isMobileSign,
|
|
||||||
tsuc.signType,
|
|
||||||
tsuc.isReceiveGift,
|
|
||||||
tsuc.giftType,
|
|
||||||
tsuc.reserveMode,
|
|
||||||
tsuc.waitingNum,
|
|
||||||
tsuc.assort,
|
|
||||||
type.typeName,
|
|
||||||
tsuc.courseIsLimitApply
|
|
||||||
FROM
|
FROM
|
||||||
`family_course` tsuc
|
`family_course` tsuc
|
||||||
LEFT JOIN family_type type ON type.id = tsuc.courseType
|
LEFT JOIN family_type type ON type.id = tsuc.courseType
|
||||||
@@ -122,6 +134,10 @@ public class FamilyActivityApplyController {
|
|||||||
cnd.and("tsuc.assort", "in", assortTypes);
|
cnd.and("tsuc.assort", "in", assortTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if("mine".equals(dataType)) {
|
||||||
|
cnd.and(new Static("tsuc.id in (select courseId from family_user where userId = '%s')".formatted(SecurityUtil.getUserId())));
|
||||||
|
}
|
||||||
|
|
||||||
List<FamilyCourse> courseArray = familyActivityService.dao().query(FamilyCourse.class, Cnd.where("activityId", "=", activityId));
|
List<FamilyCourse> courseArray = familyActivityService.dao().query(FamilyCourse.class, Cnd.where("activityId", "=", activityId));
|
||||||
courseArray = familyActivityService.filterCourseByHostUnion(courseArray);
|
courseArray = familyActivityService.filterCourseByHostUnion(courseArray);
|
||||||
cnd.and("tsuc.id", "in", courseArray.stream().map(FamilyCourse::getId).toList());
|
cnd.and("tsuc.id", "in", courseArray.stream().map(FamilyCourse::getId).toList());
|
||||||
@@ -134,6 +150,9 @@ public class FamilyActivityApplyController {
|
|||||||
List<NutMap> courseList = pagination.getList();
|
List<NutMap> courseList = pagination.getList();
|
||||||
|
|
||||||
courseList.forEach(c -> {
|
courseList.forEach(c -> {
|
||||||
|
List<FamilyActivityCourse> courseTimes = dao.query(FamilyActivityCourse.class, Cnd.where("courseId", "=", c.getString("id")).asc("courseDate"));
|
||||||
|
c.put("courseTimes", courseTimes);
|
||||||
|
|
||||||
c.put("hasRegisterNum", statisticsService.queryCourseCount(c.getString("id"), c.getString("courseType")));
|
c.put("hasRegisterNum", statisticsService.queryCourseCount(c.getString("id"), c.getString("courseType")));
|
||||||
c.put("hasWaitingNum", statisticsService.queryCourseWaitCount(c.getString("id"), c.getString("courseType")));
|
c.put("hasWaitingNum", statisticsService.queryCourseWaitCount(c.getString("id"), c.getString("courseType")));
|
||||||
//当前用户是否报过
|
//当前用户是否报过
|
||||||
@@ -154,7 +173,7 @@ public class FamilyActivityApplyController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("获取分活动时间")
|
@ApiOperation("获取分活动时间")
|
||||||
@SaCheckPermission("family.manage.apply")
|
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
|
||||||
public Result getCourseTime(String id) {
|
public Result getCourseTime(String id) {
|
||||||
List<FamilyActivityCourse> list = familyActivityService.dao().query(FamilyActivityCourse.class, Cnd.where("courseId", "=", id));
|
List<FamilyActivityCourse> list = familyActivityService.dao().query(FamilyActivityCourse.class, Cnd.where("courseId", "=", id));
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
@@ -162,7 +181,7 @@ public class FamilyActivityApplyController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("查询分类标识集合")
|
@ApiOperation("查询分类标识集合")
|
||||||
@SaCheckPermission("family.manage.apply")
|
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
|
||||||
public Result queryCourseAssort(String activityId) {
|
public Result queryCourseAssort(String activityId) {
|
||||||
List<FamilyCourse> courseList = familyActivityService.dao().query(
|
List<FamilyCourse> courseList = familyActivityService.dao().query(
|
||||||
FamilyCourse.class,
|
FamilyCourse.class,
|
||||||
@@ -175,4 +194,219 @@ public class FamilyActivityApplyController {
|
|||||||
return Result.success(assortList);
|
return Result.success(assortList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ApiOperation("验证是否能报名")
|
||||||
|
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
|
||||||
|
public Result validateSignUp(String courseId,
|
||||||
|
@Param(value = "currentFamilyNumber") Integer currentFamilyNumber) {
|
||||||
|
try {
|
||||||
|
lock.lock();
|
||||||
|
if(StrUtil.isBlank(courseId)) {
|
||||||
|
return Result.error(99, "报名信息为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
currentFamilyNumber = currentFamilyNumber != null ? currentFamilyNumber : 0;
|
||||||
|
FamilyCourse course = dao.fetch(FamilyCourse.class, courseId);
|
||||||
|
FamilyActivity activity = dao.fetch(FamilyActivity.class, course.getActivityId());
|
||||||
|
|
||||||
|
//判断时间
|
||||||
|
if(DateUtil.compare(new Date(), activity.getActivitySignUpStartTime(), "yyyy-MM-dd HH:mm:ss") < 0) {
|
||||||
|
return Result.error(99,"报名未开始");
|
||||||
|
}
|
||||||
|
if(DateUtil.compare(new Date(), activity.getActivitySignUpEndTime(), "yyyy-MM-dd HH:mm:ss") > 0) {
|
||||||
|
return Result.error(99,"报名已结束");
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断活动组别
|
||||||
|
int count = dao.count(ActivityUserScope.class, Cnd.where("groupId", "=", activity.getActivityGroupId()).and("userId", "=", SecurityUtil.getUserId()));
|
||||||
|
if(count == 0) {
|
||||||
|
return Result.error(99,"抱歉,您没有此次活动的权限");
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断是否报名
|
||||||
|
boolean courseByUser = familyActivityService.isSignCourseByUser(courseId, SecurityUtil.getUserId());
|
||||||
|
if(courseByUser) {
|
||||||
|
return Result.error(99,"抱歉,您已经报名");
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断活动人数
|
||||||
|
boolean signFull = familyActivityService.isSignFull(course, currentFamilyNumber);
|
||||||
|
if(signFull) {
|
||||||
|
return Result.error(99,"啊哦,目前报名人数已达上限。您可保持关注,如有老师取消之前的报名从而释放出名额,您可再来试试。谢谢!");
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断活动限制
|
||||||
|
boolean signCourse = familyActivityService.isSignCourse(course, activity);
|
||||||
|
if(!signCourse) {
|
||||||
|
if(activity.getRestrictLimit() != 3) {
|
||||||
|
return Result.error(99,"您选择的类型已达上限,不能再报该类型的了");
|
||||||
|
} else {
|
||||||
|
return Result.error(99,activity.getActivityName() + "限制报" + activity.getLimitNum() + "个活动,已达上限");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断分工会人数限制
|
||||||
|
boolean signFullByUnionId = familyActivityService.isSignFullByUnionId(course, currentFamilyNumber);
|
||||||
|
if(signFullByUnionId) {
|
||||||
|
return Result.error(99,"您所在的分工会名额不足");
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return Result.error(99,"报名失败");
|
||||||
|
} finally {
|
||||||
|
lock.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ApiOperation("查询子活动时间段")
|
||||||
|
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
|
||||||
|
public Object getCourseTimeSelectList(String courseId) {
|
||||||
|
// 查课程的时间段
|
||||||
|
List<FamilyActivityCourse> courseList = dao.query(FamilyActivityCourse.class, Cnd.where("courseId", "=", courseId).asc("courseStartTime"));
|
||||||
|
|
||||||
|
// 查课程的报名人数
|
||||||
|
List<FamilyUserCourse> applyUserList = dao.query(FamilyUserCourse.class, Cnd.where("courseId", "=", courseId));
|
||||||
|
|
||||||
|
List<FamilyUser> userList = dao.query(FamilyUser.class, Cnd.where("courseId", "=", courseId).and("state", "=", 1));
|
||||||
|
List<String> idList = userList.stream().map(FamilyUser::getUserId).toList();
|
||||||
|
|
||||||
|
applyUserList = applyUserList.stream().filter(o -> idList.contains(o.getUserId())).toList();
|
||||||
|
|
||||||
|
// 按照课程下面时间段去分组
|
||||||
|
Map<String, List<FamilyUserCourse>> collectMap = applyUserList.stream().collect(Collectors.groupingBy(FamilyUserCourse::getActivityCourseId));
|
||||||
|
List<NutMap> list = courseList.stream().map(v -> {
|
||||||
|
String id = v.getId();
|
||||||
|
NutMap nutMap = NutMap.NEW();
|
||||||
|
List<FamilyUserCourse> familyUserCourses = collectMap.get(id);
|
||||||
|
int remainingNum = v.getCourseLimitNum() != null ? v.getCourseLimitNum() : 0;
|
||||||
|
if (Lang.isNotEmpty(familyUserCourses)) {
|
||||||
|
remainingNum = v.getCourseLimitNum() - familyUserCourses.size();
|
||||||
|
}
|
||||||
|
nutMap.put("remainingNum", remainingNum);
|
||||||
|
nutMap.put("text", DateUtil.format(v.getCourseStartTime(), "HH:mm") + "至" + DateUtil.format(v.getCourseEndTime(), "HH:mm") + "段(剩" + remainingNum + ")");
|
||||||
|
nutMap.put("value", id);
|
||||||
|
nutMap.put("disabled", remainingNum == 0);
|
||||||
|
return nutMap;
|
||||||
|
}).filter(v -> v.getInt("remainingNum") != 0).toList();
|
||||||
|
return Result.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ApiOperation("验证子活动是否能报名")
|
||||||
|
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
|
||||||
|
public Object validateSourceSignUp(String activityCourseId, String courseId) {
|
||||||
|
try {
|
||||||
|
lock.lock();
|
||||||
|
|
||||||
|
List<FamilyUser> userList = dao.query(FamilyUser.class, Cnd.where("courseId", "=", courseId).and("state", "=", 1));
|
||||||
|
List<String> isList = userList.stream().map(FamilyUser::getUserId).toList();
|
||||||
|
|
||||||
|
// 该时间段下已报名的人数
|
||||||
|
int count = dao.count(FamilyUserCourse.class, Cnd.where("activityCourseId", "=", activityCourseId)
|
||||||
|
.and("courseId", "=", courseId).and("userId", "in", isList));
|
||||||
|
// 获取改时间段下的活动课程限制报名人数
|
||||||
|
FamilyActivityCourse course = dao.fetch(FamilyActivityCourse.class, activityCourseId);
|
||||||
|
Integer courseLimitNum = course.getCourseLimitNum();
|
||||||
|
// 报名加上自己,如果大于了限制人数,那就无法报名
|
||||||
|
if (count + 1 > courseLimitNum) {
|
||||||
|
return Result.error(99,"该时间段名额已报满,请选择其他时段报名");
|
||||||
|
} else {
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return Result.error(99,"报名失败");
|
||||||
|
} finally {
|
||||||
|
lock.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ApiOperation("活动报名")
|
||||||
|
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
|
||||||
|
@SLog(tag = "亲子活动-活动报名", msg = "活动报名")
|
||||||
|
public Result doSignUp(FamilyUser familyUser) {
|
||||||
|
try {
|
||||||
|
lock.lock();
|
||||||
|
boolean courseByUser = familyActivityService.isSignCourseByUser(familyUser.getCourseId(), SecurityUtil.getUserId());
|
||||||
|
if(courseByUser) {
|
||||||
|
return Result.error(99,"您已报过该活动");
|
||||||
|
}
|
||||||
|
FamilyActivity activity = familyActivityService.fetch(familyUser.getActivityId());
|
||||||
|
boolean validFamilyCount = familyActivityService.validFamilyCount(familyUser);
|
||||||
|
if(validFamilyCount) {
|
||||||
|
return Result.error(99,activity.getKeyWord() + "人数最多为" + activity.getFamilyMaxCount());
|
||||||
|
}
|
||||||
|
//判断人数
|
||||||
|
int number = 0;
|
||||||
|
FamilyCourse course = familyActivityService.dao().fetch(FamilyCourse.class, familyUser.getCourseId());
|
||||||
|
FamilyType type = familyActivityService.dao().fetch(FamilyType.class, course.getCourseType());
|
||||||
|
if(type != null) {
|
||||||
|
if(type.getIsBringFamily() && type.getIsAddFamily()) {
|
||||||
|
List<List<NutMap>> mobileColumnsValue = familyUser.getMobileColumnsValue();
|
||||||
|
number = Lang.isNotEmpty(mobileColumnsValue) ? mobileColumnsValue.size() : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
boolean signFull = familyActivityService.isSignFull(course, number);
|
||||||
|
if(signFull) {
|
||||||
|
return Result.error(99,"当前报名人数已满");
|
||||||
|
}
|
||||||
|
boolean signFullByUnionId = familyActivityService.isSignFullByUnionId(course, number);
|
||||||
|
if(signFullByUnionId) {
|
||||||
|
return Result.error(99,"该活动您所在的分工会名额不足");
|
||||||
|
}
|
||||||
|
familyActivityService.doSignUp(familyUser);
|
||||||
|
return Result.success("祝贺您!您已报名成功!请留意各分场活动的准确时间、地点,提前10-15分钟到达活动现场做好准备。如您因故不能参加活动,还请及时登录系统取消报名,以便将机会留给其他有需要的教职工。谢谢!");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return Result.error("报名失败");
|
||||||
|
} finally {
|
||||||
|
lock.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ApiOperation("取消报名")
|
||||||
|
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
|
||||||
|
@SLog(tag = "亲子活动-活动报名", msg = "取消报名")
|
||||||
|
public Result cancelSignUp(@Param("activityId") String activityId, @Param("courseId") String courseId) {
|
||||||
|
String userId = SecurityUtil.getUserId();
|
||||||
|
//取消分两种情况
|
||||||
|
//第一种没有设置分工会人数限制,那么将候补的人按时间倒叙往上补
|
||||||
|
//第二种如果设置了分工会人数限制,那么只将本分工会的候补人员按照时间倒叙往上补,如果本分工会没有候补人员,则名额空出来,由校工会手动调整
|
||||||
|
FamilyCourse course = dao.fetch(FamilyCourse.class, courseId);
|
||||||
|
FamilyType type = dao.fetch(FamilyType.class, course.getCourseType());
|
||||||
|
//如果是正常报名取消了,将候补报名的按时间倒叙第一个改为正常报名
|
||||||
|
Cnd cnd = Cnd.where("activityId", "=", activityId).and("courseId", "=", courseId)
|
||||||
|
.and("state", "=", 2);
|
||||||
|
//如果设置了分工会报名人数限制,则只查本分工会
|
||||||
|
if (Lang.isNotEmpty(course.getUnionLimit())) {
|
||||||
|
cnd.and(new Static(" userId in (select id from user where unionid = '%s')".formatted(SecurityUtil.getUnionId())));
|
||||||
|
}
|
||||||
|
cnd.asc("signUpTime");
|
||||||
|
if (!type.getIsBringFamily() && course.getReserveMode() == 2) {
|
||||||
|
List<FamilyUser> signUpUsers = dao.query(FamilyUser.class, cnd);
|
||||||
|
int thisSignUpUserCount = dao.count(FamilyUser.class,
|
||||||
|
Cnd.where("activityId", "=", activityId)
|
||||||
|
.and("courseId", "=", courseId).and("userId", "=", userId)
|
||||||
|
.and("state", "in", List.of(1, 3)));
|
||||||
|
if (!signUpUsers.isEmpty() && thisSignUpUserCount > 0) {
|
||||||
|
FamilyUser familyUser = signUpUsers.get(0);
|
||||||
|
familyUser.setState(1);
|
||||||
|
dao.update(familyUser);
|
||||||
|
Sys_user user = dao.fetch(Sys_user.class, familyUser.getUserId());
|
||||||
|
//msgApi.sendTextMsg("【" + activity.getActivityName() + "】已候补成功,请按时参加活动!", user.getLoginname());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//删除报名记录
|
||||||
|
dao.clear("family_user_course", Cnd.where("activityId", "=", activityId)
|
||||||
|
.and("courseId", "=", courseId).and("userId", "=", userId));
|
||||||
|
|
||||||
|
dao.clear("family_user", Cnd.where("activityId", "=", activityId)
|
||||||
|
.and("courseId", "=", courseId).and("userId", "=", userId));
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -99,7 +99,7 @@ public class FamilyActivityController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("查询单个活动")
|
@ApiOperation("查询单个活动")
|
||||||
@SaCheckPermission("family.manage")
|
@SaCheckPermission("family")
|
||||||
public Result findOne(@Param("id") @NotNull String id) {
|
public Result findOne(@Param("id") @NotNull String id) {
|
||||||
NutMap dataMap = familyActivityManageService.findOne(id, null, "");
|
NutMap dataMap = familyActivityManageService.findOne(id, null, "");
|
||||||
String activityStartTime = dataMap.getString("activityStartTime");
|
String activityStartTime = dataMap.getString("activityStartTime");
|
||||||
|
|||||||
+8
-8
@@ -36,7 +36,7 @@ import java.util.List;
|
|||||||
@IocBean
|
@IocBean
|
||||||
@Ok("json:full")
|
@Ok("json:full")
|
||||||
@Api(tags = "亲子活动人员调整")
|
@Api(tags = "亲子活动人员调整")
|
||||||
@At("/platform/family/manage/userAdjust")
|
@At("/platform/family/userAdjust")
|
||||||
public class FamilyAdjustController {
|
public class FamilyAdjustController {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@@ -49,7 +49,7 @@ public class FamilyAdjustController {
|
|||||||
private FamilyActivityStatisticsService familyActivityStatisticsService;
|
private FamilyActivityStatisticsService familyActivityStatisticsService;
|
||||||
|
|
||||||
@At("")
|
@At("")
|
||||||
@SaCheckPermission("family.manage.activity.adjust")
|
@SaCheckPermission("family.adjust")
|
||||||
@Ok("beetl:/platform/zhgh/activity/family/userAdjust/index.html")
|
@Ok("beetl:/platform/zhgh/activity/family/userAdjust/index.html")
|
||||||
public void index() {
|
public void index() {
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@ public class FamilyAdjustController {
|
|||||||
*/
|
*/
|
||||||
@At
|
@At
|
||||||
@ApiOperation("活动列表")
|
@ApiOperation("活动列表")
|
||||||
@SaCheckPermission("family.manage.activity.adjust")
|
@SaCheckPermission("family.adjust")
|
||||||
public Result activityList(@Param(value = "year") Integer year) {
|
public Result activityList(@Param(value = "year") Integer year) {
|
||||||
List<FamilyActivity> activityList = dao.query(FamilyActivity.class, Cnd.NEW().andEX("year", "=", year).andEX("isDisabled", "=", false).desc("activityStartTime"));
|
List<FamilyActivity> activityList = dao.query(FamilyActivity.class, Cnd.NEW().andEX("year", "=", year).andEX("isDisabled", "=", false).desc("activityStartTime"));
|
||||||
return Result.success(activityList);
|
return Result.success(activityList);
|
||||||
@@ -69,7 +69,7 @@ public class FamilyAdjustController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("分页查询")
|
@ApiOperation("分页查询")
|
||||||
@SaCheckPermission("family.manage.activity.adjust")
|
@SaCheckPermission("family.adjust")
|
||||||
public Result pageData(PageForm pageForm,
|
public Result pageData(PageForm pageForm,
|
||||||
@Param(value = "activityId") String activityId) {
|
@Param(value = "activityId") String activityId) {
|
||||||
Pagination pagination = familyActivityStatisticsService.pageData(pageForm, activityId);
|
Pagination pagination = familyActivityStatisticsService.pageData(pageForm, activityId);
|
||||||
@@ -78,7 +78,7 @@ public class FamilyAdjustController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("子活动查询")
|
@ApiOperation("子活动查询")
|
||||||
@SaCheckPermission("family.manage.activity.adjust")
|
@SaCheckPermission("family.adjust")
|
||||||
public Result getCourse(String activityId) {
|
public Result getCourse(String activityId) {
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
@@ -108,7 +108,7 @@ public class FamilyAdjustController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("报名用户列表")
|
@ApiOperation("报名用户列表")
|
||||||
@SaCheckPermission("family.manage.activity.adjust")
|
@SaCheckPermission("family.adjust")
|
||||||
public Result registerUserList(@Param("courseId") String courseId,
|
public Result registerUserList(@Param("courseId") String courseId,
|
||||||
@Param(value = "unionId") String unionId,
|
@Param(value = "unionId") String unionId,
|
||||||
@Param(value = "unitId") String unitId,
|
@Param(value = "unitId") String unitId,
|
||||||
@@ -120,7 +120,7 @@ public class FamilyAdjustController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("人员调整")
|
@ApiOperation("人员调整")
|
||||||
@SaCheckPermission("family.manage.activity.adjust")
|
@SaCheckPermission("family.adjust")
|
||||||
@SLog(tag = "亲子活动-人员调整", msg = "人员调整")
|
@SLog(tag = "亲子活动-人员调整", msg = "人员调整")
|
||||||
public Result adjust(String activityId, String oldCourseId, String newCourseId, String userId) {
|
public Result adjust(String activityId, String oldCourseId, String newCourseId, String userId) {
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ public class FamilyAdjustController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("删除报名人员")
|
@ApiOperation("删除报名人员")
|
||||||
@SaCheckPermission("family.manage.activity.adjust")
|
@SaCheckPermission("family.adjust")
|
||||||
@SLog(tag = "亲子活动-人员调整", msg = "删除报名人员")
|
@SLog(tag = "亲子活动-人员调整", msg = "删除报名人员")
|
||||||
public Result deleteSignUser(String activityId, String courseId, String userId) {
|
public Result deleteSignUser(String activityId, String courseId, String userId) {
|
||||||
|
|
||||||
|
|||||||
+165
@@ -0,0 +1,165 @@
|
|||||||
|
package com.budwk.app.zhgh.activity.family.controller.manage;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.dev33.satoken.annotation.SaMode;
|
||||||
|
import cn.hutool.core.date.DateUnit;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.budwk.app.base.annotation.SLog;
|
||||||
|
import com.budwk.app.base.result.Result;
|
||||||
|
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||||
|
import com.budwk.app.zhgh.activity.family.models.FamilyUserCourse;
|
||||||
|
import com.budwk.app.zhgh.activity.family.service.FamilyActivityService;
|
||||||
|
import com.budwk.app.zhgh.activity.trainSignUp.models.TrainSignUpUserCourse;
|
||||||
|
import com.budwk.app.zhgh.activity.trainSignUp.service.TrainSignUpActivityService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||||
|
import org.nutz.dao.Cnd;
|
||||||
|
import org.nutz.dao.Dao;
|
||||||
|
import org.nutz.dao.Sqls;
|
||||||
|
import org.nutz.dao.sql.Sql;
|
||||||
|
import org.nutz.ioc.aop.Aop;
|
||||||
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
|
import org.nutz.lang.util.NutMap;
|
||||||
|
import org.nutz.mvc.annotation.At;
|
||||||
|
import org.nutz.mvc.annotation.Ok;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName FamilyMineController
|
||||||
|
* @Author JyuHsin
|
||||||
|
* @Date 2025/9/13 16:56
|
||||||
|
* @Version 1.0
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@IocBean
|
||||||
|
@Ok("json:full")
|
||||||
|
@Api(tags = "活动报名")
|
||||||
|
@At("/platform/family/mine")
|
||||||
|
public class FamilyMineController {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private Dao dao;
|
||||||
|
@Inject
|
||||||
|
private FamilyActivityService activityService;
|
||||||
|
|
||||||
|
@At("/")
|
||||||
|
@SaCheckPermission("family.mine")
|
||||||
|
@Ok("beetl:/platform/zhgh/activity/family/mine/index.html")
|
||||||
|
public void index() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@At("/h5")
|
||||||
|
@SaCheckPermission("h5.family.mine")
|
||||||
|
@Ok("beetl:/platform/zhghh5/activity/family/mine/index.html")
|
||||||
|
public void h5Index() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ApiOperation("主动扫码签到")
|
||||||
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
|
@SaCheckPermission(value = {"family.mine", "h5.family.mine"}, mode = SaMode.OR)
|
||||||
|
@SLog(tag = "品牌活动-活动签到", msg = "主动扫码签到")
|
||||||
|
public Result drivingScan(String courseId) {
|
||||||
|
|
||||||
|
// 主动扫码签到是用户自己打开扫一扫,扫二维码签到
|
||||||
|
int count = dao.count(FamilyUserCourse.class, Cnd.where("courseId", "=", courseId).and("userId", "=", SecurityUtil.getUserId()));
|
||||||
|
if (count == 0) {
|
||||||
|
return Result.error(99, "未查询到您的报名记录");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取现在的日期,并往后推1个小时
|
||||||
|
String oneHourLater = DateUtil.offsetHour(new Date(), 1).toString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
FamilyUserCourse userCourse = dao.fetch(
|
||||||
|
FamilyUserCourse.class,
|
||||||
|
Cnd.where("courseId", "=", courseId)
|
||||||
|
.and("userId", "=", SecurityUtil.getUserId())
|
||||||
|
.and("courseStartTime", "<=", oneHourLater)
|
||||||
|
.and("courseEndTime", ">=", oneHourLater)
|
||||||
|
);
|
||||||
|
if (userCourse == null) {
|
||||||
|
return Result.error(99, "未到签到时间");
|
||||||
|
}
|
||||||
|
|
||||||
|
userCourse.setAttend(true);
|
||||||
|
userCourse.setAttendTime(DateUtil.date());
|
||||||
|
dao.update(userCourse);
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ApiOperation("被动扫码签到")
|
||||||
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
|
@SaCheckPermission(value = {"family.mine", "h5.family.mine"}, mode = SaMode.OR)
|
||||||
|
@SLog(tag = "品牌活动-活动签到", msg = "被动扫码签到")
|
||||||
|
public Result passiveScan(String id) {
|
||||||
|
|
||||||
|
// id表示课程的某个时间段,userId表示是谁出示的二维码
|
||||||
|
FamilyUserCourse userCourse = dao.fetch(FamilyUserCourse.class, id);
|
||||||
|
if (userCourse == null) {
|
||||||
|
return Result.error("未查询到报名记录");
|
||||||
|
}
|
||||||
|
int isAfter = DateUtil.compare(new Date(), userCourse.getCourseStartTime());
|
||||||
|
if (isAfter > 0) {
|
||||||
|
return Result.error("抱歉,已经开始,无法签到");
|
||||||
|
}
|
||||||
|
long diffMillis = Math.abs(DateUtil.between(new Date(), userCourse.getCourseStartTime(), DateUnit.MS));
|
||||||
|
long oneHourInMs = 3600 * 1000;
|
||||||
|
if (diffMillis > oneHourInMs) {
|
||||||
|
return Result.error("签到时间为开始前1个小时");
|
||||||
|
}
|
||||||
|
|
||||||
|
userCourse.setAttend(true);
|
||||||
|
userCourse.setAttendTime(DateUtil.date());
|
||||||
|
dao.update(userCourse);
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ApiOperation("分活动查询")
|
||||||
|
@SaCheckPermission(value = {"family.mine", "h5.family.mine"}, mode = SaMode.OR)
|
||||||
|
public Result queryCourseSign(String courseId) {
|
||||||
|
Sql sql = Sqls.create("""
|
||||||
|
SELECT
|
||||||
|
uc.*,
|
||||||
|
date(uc.courseStartTime) as courseDate
|
||||||
|
FROM
|
||||||
|
`family_user_course` uc
|
||||||
|
WHERE
|
||||||
|
courseId = @courseId and userId = @userId
|
||||||
|
""");
|
||||||
|
sql.setParam("userId", SecurityUtil.getUserId());
|
||||||
|
sql.setParam("courseId", courseId);
|
||||||
|
List<NutMap> listMap = activityService.listMap(sql);
|
||||||
|
return Result.success(listMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ApiOperation("获取我报名的课程")
|
||||||
|
@SaCheckPermission(value = {"family.apply", "h5.family.apply"}, mode = SaMode.OR)
|
||||||
|
public Result queryMineCourse(String activityId) {
|
||||||
|
|
||||||
|
Sql sql = Sqls.create("""
|
||||||
|
SELECT
|
||||||
|
c.*,
|
||||||
|
u.mobileColumnsValue
|
||||||
|
FROM
|
||||||
|
family_user u
|
||||||
|
LEFT JOIN family_course c ON c.id = u.courseId
|
||||||
|
$condition
|
||||||
|
""");
|
||||||
|
Cnd cnd = Cnd.NEW();
|
||||||
|
cnd.and("u.activityId", "=", activityId);
|
||||||
|
cnd.and("u.userId", "=", SecurityUtil.getUserId());
|
||||||
|
sql.setCondition(cnd);
|
||||||
|
List<NutMap> listMap = activityService.listMap(sql);
|
||||||
|
return Result.success(listMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
+8
-8
@@ -42,7 +42,7 @@ import java.util.List;
|
|||||||
@IocBean
|
@IocBean
|
||||||
@Ok("json:full")
|
@Ok("json:full")
|
||||||
@Api(tags = "活动类型管理")
|
@Api(tags = "活动类型管理")
|
||||||
@At("/platform/family/manage/type")
|
@At("/platform/family/type")
|
||||||
public class FamilyTypeController {
|
public class FamilyTypeController {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@@ -51,14 +51,14 @@ public class FamilyTypeController {
|
|||||||
private BaseService baseService;
|
private BaseService baseService;
|
||||||
|
|
||||||
@At("")
|
@At("")
|
||||||
@SaCheckPermission("family.manage.type")
|
@SaCheckPermission("family.type")
|
||||||
@Ok("beetl:/platform/zhgh/activity/family/type/index.html")
|
@Ok("beetl:/platform/zhgh/activity/family/type/index.html")
|
||||||
public void index() {
|
public void index() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("分页查询")
|
@ApiOperation("分页查询")
|
||||||
@SaCheckPermission("family.manage.type")
|
@SaCheckPermission("family.type")
|
||||||
public Result pageData(PageForm pageForm,
|
public Result pageData(PageForm pageForm,
|
||||||
@Param(value = "typeName") String typeName) {
|
@Param(value = "typeName") String typeName) {
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
@@ -89,7 +89,7 @@ public class FamilyTypeController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("活动类型新增")
|
@ApiOperation("活动类型新增")
|
||||||
@SaCheckPermission("family.manage.type")
|
@SaCheckPermission("family.type")
|
||||||
@SLog(tag = "亲子活动-活动类型管理", msg = "活动类型新增")
|
@SLog(tag = "亲子活动-活动类型管理", msg = "活动类型新增")
|
||||||
public Result doAdd(@Param("data") String data) throws Exception {
|
public Result doAdd(@Param("data") String data) throws Exception {
|
||||||
FamilyType type = Json.fromJson(FamilyType.class, data);
|
FamilyType type = Json.fromJson(FamilyType.class, data);
|
||||||
@@ -105,7 +105,7 @@ public class FamilyTypeController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("活动类型修改")
|
@ApiOperation("活动类型修改")
|
||||||
@SaCheckPermission("family.manage.type")
|
@SaCheckPermission("family.type")
|
||||||
@SLog(tag = "亲子活动-活动类型管理", msg = "活动类型修改")
|
@SLog(tag = "亲子活动-活动类型管理", msg = "活动类型修改")
|
||||||
public Result doEdit(FamilyType type) {
|
public Result doEdit(FamilyType type) {
|
||||||
int count = dao.count(FamilyType.class, Cnd.where("code", "=", type.getCode()).and("id", "!=", type.getId()));
|
int count = dao.count(FamilyType.class, Cnd.where("code", "=", type.getCode()).and("id", "!=", type.getId()));
|
||||||
@@ -120,7 +120,7 @@ public class FamilyTypeController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("活动类型删除")
|
@ApiOperation("活动类型删除")
|
||||||
@SaCheckPermission("family.manage.type")
|
@SaCheckPermission("family.type")
|
||||||
@SLog(tag = "亲子活动-活动类型管理", msg = "活动类型删除")
|
@SLog(tag = "亲子活动-活动类型管理", msg = "活动类型删除")
|
||||||
public Object doDelete(@Param(value = "id") String id) {
|
public Object doDelete(@Param(value = "id") String id) {
|
||||||
dao.clear(FamilyType.class, Cnd.where("id", "=", id));
|
dao.clear(FamilyType.class, Cnd.where("id", "=", id));
|
||||||
@@ -131,7 +131,7 @@ public class FamilyTypeController {
|
|||||||
@At
|
@At
|
||||||
@Aop(TransAop.READ_COMMITTED)
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
@ApiOperation("排序号变更")
|
@ApiOperation("排序号变更")
|
||||||
@SaCheckPermission("family.manage.type")
|
@SaCheckPermission("family.type")
|
||||||
public Object xhChange(String id, Integer xh, boolean toDown) {
|
public Object xhChange(String id, Integer xh, boolean toDown) {
|
||||||
if (toDown) {
|
if (toDown) {
|
||||||
FamilyType next = dao.fetch(FamilyType.class, Cnd.where("xh", "=", xh + 1));
|
FamilyType next = dao.fetch(FamilyType.class, Cnd.where("xh", "=", xh + 1));
|
||||||
@@ -158,7 +158,7 @@ public class FamilyTypeController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("自定义表单字段类型")
|
@ApiOperation("自定义表单字段类型")
|
||||||
@SaCheckPermission("family.manage.type")
|
@SaCheckPermission("family.type")
|
||||||
public Result getColumnType() {
|
public Result getColumnType() {
|
||||||
List<String> names = EnumUtil.getNames(ColType.class);
|
List<String> names = EnumUtil.getNames(ColType.class);
|
||||||
names.add("JSON");
|
names.add("JSON");
|
||||||
|
|||||||
+7
-7
@@ -56,14 +56,14 @@ public class FamilyUserManageController {
|
|||||||
private FamilyBlackListService familyBlackListService;
|
private FamilyBlackListService familyBlackListService;
|
||||||
|
|
||||||
@At("")
|
@At("")
|
||||||
@SaCheckPermission("family.user.activity")
|
@SaCheckPermission("family.userManage")
|
||||||
@Ok("beetl:/platform/zhgh/activity/family/userManage/index.html")
|
@Ok("beetl:/platform/zhgh/activity/family/userManage/index.html")
|
||||||
public void index() {
|
public void index() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("分页查询")
|
@ApiOperation("分页查询")
|
||||||
@SaCheckPermission("family.user.activity")
|
@SaCheckPermission("family.userManage")
|
||||||
public Result pageData(PageForm pageForm,
|
public Result pageData(PageForm pageForm,
|
||||||
@Param(value = "activityId") String activityId,
|
@Param(value = "activityId") String activityId,
|
||||||
@Param(value = "courseId") String courseId,
|
@Param(value = "courseId") String courseId,
|
||||||
@@ -87,7 +87,7 @@ public class FamilyUserManageController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("报名人员处理")
|
@ApiOperation("报名人员处理")
|
||||||
@SaCheckPermission("family.user.activity")
|
@SaCheckPermission("family.userManage")
|
||||||
@SLog(tag = "亲子活动-人员调整", msg = "报名人员处理")
|
@SLog(tag = "亲子活动-人员调整", msg = "报名人员处理")
|
||||||
public Result doHandleUser(@Param("userId") String userId) {
|
public Result doHandleUser(@Param("userId") String userId) {
|
||||||
familyBlackListService.doHandleUser(userId);
|
familyBlackListService.doHandleUser(userId);
|
||||||
@@ -96,7 +96,7 @@ public class FamilyUserManageController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("根据活动Id获取子活动")
|
@ApiOperation("根据活动Id获取子活动")
|
||||||
@SaCheckPermission("family.user.activity")
|
@SaCheckPermission("family.userManage")
|
||||||
public Result getCourseByActivityId(@Param("activityId") String activityId) {
|
public Result getCourseByActivityId(@Param("activityId") String activityId) {
|
||||||
List<FamilyCourse> list = dao.query(FamilyCourse.class, Cnd.where("activityId", "=", activityId));
|
List<FamilyCourse> list = dao.query(FamilyCourse.class, Cnd.where("activityId", "=", activityId));
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
@@ -104,7 +104,7 @@ public class FamilyUserManageController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("获取子活动具体时间")
|
@ApiOperation("获取子活动具体时间")
|
||||||
@SaCheckPermission("family.user.activity")
|
@SaCheckPermission("family.userManage")
|
||||||
public Result attendClassRecord(String userId) {
|
public Result attendClassRecord(String userId) {
|
||||||
familyBlackListService.attendClassRecord(userId);
|
familyBlackListService.attendClassRecord(userId);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
@@ -112,7 +112,7 @@ public class FamilyUserManageController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("获取候补人员")
|
@ApiOperation("获取候补人员")
|
||||||
@SaCheckPermission("family.user.activity")
|
@SaCheckPermission("family.userManage")
|
||||||
public Result getReserveUser(String courseId) {
|
public Result getReserveUser(String courseId) {
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
@@ -133,7 +133,7 @@ public class FamilyUserManageController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("补充人员")
|
@ApiOperation("补充人员")
|
||||||
@SaCheckPermission("family.user.activity")
|
@SaCheckPermission("family.userManage")
|
||||||
@SLog(tag = "亲子活动-人员管理", msg = "补充人员")
|
@SLog(tag = "亲子活动-人员管理", msg = "补充人员")
|
||||||
public Result reserveSingUp(String[] ids, String courseId) {
|
public Result reserveSingUp(String[] ids, String courseId) {
|
||||||
//先查询这个课程有多少个未签到的人员
|
//先查询这个课程有多少个未签到的人员
|
||||||
|
|||||||
-369
@@ -1,369 +0,0 @@
|
|||||||
package com.budwk.app.zhgh.activity.family.controller.mobile;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.budwk.app.base.annotation.SLog;
|
|
||||||
import com.budwk.app.base.page.Pagination;
|
|
||||||
import com.budwk.app.base.param.PageForm;
|
|
||||||
import com.budwk.app.base.result.Result;
|
|
||||||
import com.budwk.app.sys.models.Sys_user;
|
|
||||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
|
||||||
import com.budwk.app.zhgh.activity.basic.models.ActivityUserScope;
|
|
||||||
import com.budwk.app.zhgh.activity.family.models.*;
|
|
||||||
import com.budwk.app.zhgh.activity.family.service.FamilyActivityService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.nutz.dao.Chain;
|
|
||||||
import org.nutz.dao.Cnd;
|
|
||||||
import org.nutz.dao.Dao;
|
|
||||||
import org.nutz.dao.util.cri.Static;
|
|
||||||
import org.nutz.integration.jedis.RedisService;
|
|
||||||
import org.nutz.ioc.loader.annotation.Inject;
|
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
|
||||||
import org.nutz.lang.Lang;
|
|
||||||
import org.nutz.lang.util.NutMap;
|
|
||||||
import org.nutz.mvc.annotation.At;
|
|
||||||
import org.nutz.mvc.annotation.Ok;
|
|
||||||
import org.nutz.mvc.annotation.Param;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zxy
|
|
||||||
* @Description TODO
|
|
||||||
* @createTime 2022年02月25日 13:44:00
|
|
||||||
*/
|
|
||||||
@IocBean
|
|
||||||
@Ok("json:full")
|
|
||||||
@Api(tags = "亲子活动移动端")
|
|
||||||
@At("/platform/mobile/familyActivity")
|
|
||||||
public class MFamilyActivityController {
|
|
||||||
|
|
||||||
private static final String REDIS_KEY_PREFIX = "m_family_activity";
|
|
||||||
private final ReentrantLock lock = new ReentrantLock(true);
|
|
||||||
@Inject
|
|
||||||
private Dao dao;
|
|
||||||
@Inject
|
|
||||||
private FamilyActivityService familyActivityService;
|
|
||||||
@Inject
|
|
||||||
private RedisService redisService;
|
|
||||||
|
|
||||||
@At("/familyList")
|
|
||||||
@Ok("beetl:/platform/zhghh5/activity/family/familyList/index.html")
|
|
||||||
@SaCheckPermission("h5.family.sign")
|
|
||||||
public void familyList() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@At("/familyInfo")
|
|
||||||
@Ok("beetl:/platform/zhghh5/activity/family/familyInfo/index.html")
|
|
||||||
@SaCheckPermission("h5.family.sign")
|
|
||||||
public void familyInfo() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@At("/activityInfo")
|
|
||||||
@Ok("beetl:/platform/zhghh5/activity/family/activityInfo/index.html")
|
|
||||||
@SaCheckPermission("h5.family.sign")
|
|
||||||
public void activityInfo() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@At
|
|
||||||
@ApiOperation("分页查询")
|
|
||||||
@SaCheckPermission("h5.family.sign")
|
|
||||||
public Result pageData(PageForm pageForm,
|
|
||||||
@Param(value = "activityStatus") int activityStatus,
|
|
||||||
@Param(value = "year") Integer year,
|
|
||||||
@Param(value = "activityType") Integer activityType) {
|
|
||||||
Pagination pagination = familyActivityService.mPageData(pageForm, year, activityStatus, activityType);
|
|
||||||
return Result.success(pagination);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param id 活动id
|
|
||||||
* @param tabIndex 0全部 1我的
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@At
|
|
||||||
@ApiOperation("查询单个活动")
|
|
||||||
@SaCheckPermission("h5.family.sign")
|
|
||||||
public Result findOne(@Param("id") String id,
|
|
||||||
@Param(value = "tabIndex") Integer tabIndex,
|
|
||||||
@Param(value = "fromMode") String fromMode) {
|
|
||||||
Cnd cnd = Cnd.NEW();
|
|
||||||
if (tabIndex > 0) {
|
|
||||||
List<FamilyUser> mySignCourseList = dao.query(FamilyUser.class, Cnd.where("userId", "=", SecurityUtil.getUserId()).and("activityId", "=", id));
|
|
||||||
List<String> mySignCourseIdList = mySignCourseList.stream().map(FamilyUser::getCourseId).collect(Collectors.toList());
|
|
||||||
cnd.and("id", "in", mySignCourseIdList);
|
|
||||||
}
|
|
||||||
NutMap nutMap = familyActivityService.findOne(id, cnd, fromMode);
|
|
||||||
List<FamilyCourse> courseList = nutMap.getAsList("courseList", FamilyCourse.class);
|
|
||||||
courseList.forEach(v -> {
|
|
||||||
if (v.getCourseIsLimitApply() != null && v.getCourseIsLimitApply() && v.getIsSign()) {
|
|
||||||
FamilyActivityCourse course = dao.fetch(FamilyActivityCourse.class, Cnd.where("courseId", "=", v.getId()));
|
|
||||||
v.setCourseTimeName(DateUtil.format(course.getCourseStartTime(), "HH:mm") + "至" + DateUtil.format(course.getCourseEndTime(), "HH:mm") + "段");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return Result.success(nutMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
@At
|
|
||||||
@ApiOperation("查询子活动时间段")
|
|
||||||
@SaCheckPermission("h5.family.sign")
|
|
||||||
public Object getCourseTimeSelectList(String courseId) {
|
|
||||||
// 查课程的时间段
|
|
||||||
List<FamilyActivityCourse> courseList = dao.query(FamilyActivityCourse.class, Cnd.where("courseId", "=", courseId));
|
|
||||||
|
|
||||||
// 查课程的报名人数
|
|
||||||
List<FamilyUserCourse> applyUserList = dao.query(FamilyUserCourse.class, Cnd.where("courseId", "=", courseId));
|
|
||||||
// 按照课程下面时间段去分组
|
|
||||||
Map<String, List<FamilyUserCourse>> collectMap = applyUserList.stream().collect(Collectors.groupingBy(FamilyUserCourse::getActivityCourseId));
|
|
||||||
List<NutMap> list = courseList.stream().map(v -> {
|
|
||||||
String id = v.getId();
|
|
||||||
NutMap nutMap = NutMap.NEW();
|
|
||||||
List<FamilyUserCourse> familyUserCourses = collectMap.get(id);
|
|
||||||
int remainingNum = v.getCourseLimitNum() != null ? v.getCourseLimitNum() : 0;
|
|
||||||
if (Lang.isNotEmpty(familyUserCourses)) {
|
|
||||||
remainingNum = v.getCourseLimitNum() - familyUserCourses.size();
|
|
||||||
}
|
|
||||||
nutMap.put("remainingNum", remainingNum);
|
|
||||||
nutMap.put("text", DateUtil.format(v.getCourseStartTime(), "HH:mm") + "至" + DateUtil.format(v.getCourseEndTime(), "HH:mm") + "段(剩" + remainingNum + ")");
|
|
||||||
nutMap.put("value", id);
|
|
||||||
return nutMap;
|
|
||||||
}).filter(v -> v.getInt("remainingNum") != 0).toList();
|
|
||||||
return Result.success(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@At
|
|
||||||
@ApiOperation("活动报名")
|
|
||||||
@SaCheckPermission("h5.family.sign")
|
|
||||||
@SLog(tag = "亲子活动-活动报名", msg = "活动报名")
|
|
||||||
public Result doSignUp(FamilyUser familyUser) {
|
|
||||||
try {
|
|
||||||
lock.lock();
|
|
||||||
boolean courseByUser = familyActivityService.isSignCourseByUser(familyUser.getCourseId(), SecurityUtil.getUserId());
|
|
||||||
if(courseByUser) {
|
|
||||||
return Result.error("您已报过该活动");
|
|
||||||
}
|
|
||||||
//判断人数
|
|
||||||
int number = 0;
|
|
||||||
FamilyCourse course = familyActivityService.dao().fetch(FamilyCourse.class, familyUser.getCourseId());
|
|
||||||
FamilyType type = familyActivityService.dao().fetch(FamilyType.class, course.getCourseType());
|
|
||||||
if(type != null) {
|
|
||||||
if(type.getIsBringFamily() && type.getIsAddFamily()) {
|
|
||||||
List<List<NutMap>> mobileColumnsValue = familyUser.getMobileColumnsValue();
|
|
||||||
number = Lang.isNotEmpty(mobileColumnsValue) ? mobileColumnsValue.size() : 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
boolean signFull = familyActivityService.isSignFull(course, number);
|
|
||||||
if(signFull) {
|
|
||||||
return Result.error("当前报名人数已满");
|
|
||||||
}
|
|
||||||
boolean signFullByUnionId = familyActivityService.isSignFullByUnionId(course, number);
|
|
||||||
if(signFullByUnionId) {
|
|
||||||
return Result.error("该活动您所在的分工会名额不足");
|
|
||||||
}
|
|
||||||
familyActivityService.doSignUp(familyUser);
|
|
||||||
return Result.success();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return Result.success("报名失败");
|
|
||||||
} finally {
|
|
||||||
lock.unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@At
|
|
||||||
@ApiOperation("取消报名")
|
|
||||||
@SaCheckPermission("h5.family.sign")
|
|
||||||
@SLog(tag = "亲子活动-活动报名", msg = "取消报名")
|
|
||||||
public Result cancelSignUp(@Param("activityId") String activityId, @Param("courseId") String courseId) {
|
|
||||||
String userId = SecurityUtil.getUserId();
|
|
||||||
//取消分两种情况
|
|
||||||
//第一种没有设置分工会人数限制,那么将候补的人按时间倒叙往上补
|
|
||||||
//第二种如果设置了分工会人数限制,那么只将本分工会的候补人员按照时间倒叙往上补,如果本分工会没有候补人员,则名额空出来,由校工会手动调整
|
|
||||||
FamilyActivity activity = dao.fetch(FamilyActivity.class, activityId);
|
|
||||||
FamilyCourse course = dao.fetch(FamilyCourse.class, courseId);
|
|
||||||
FamilyType type = dao.fetch(FamilyType.class, course.getCourseType());
|
|
||||||
//如果是正常报名取消了,将候补报名的按时间倒叙第一个改为正常报名
|
|
||||||
Cnd cnd = Cnd.where("activityId", "=", activityId).and("courseId", "=", courseId)
|
|
||||||
.and("state", "=", 2);
|
|
||||||
//如果设置了分工会报名人数限制,则只查本分工会
|
|
||||||
if (Lang.isNotEmpty(course.getUnionLimit())) {
|
|
||||||
cnd.and(new Static(" userId in (select id from user where unionid = '%s')".formatted(SecurityUtil.getUnionId())));
|
|
||||||
}
|
|
||||||
cnd.asc("signUpTime");
|
|
||||||
if (!type.getIsBringFamily() && course.getReserveMode() == 2) {
|
|
||||||
List<FamilyUser> signUpUsers = dao.query(FamilyUser.class, cnd);
|
|
||||||
int thisSignUpUserCount = dao.count(FamilyUser.class,
|
|
||||||
Cnd.where("activityId", "=", activityId)
|
|
||||||
.and("courseId", "=", courseId).and("userId", "=", userId)
|
|
||||||
.and("state", "in", List.of(1, 3)));
|
|
||||||
if (!signUpUsers.isEmpty() && thisSignUpUserCount > 0) {
|
|
||||||
FamilyUser familyUser = signUpUsers.get(0);
|
|
||||||
familyUser.setState(1);
|
|
||||||
dao.update(familyUser);
|
|
||||||
Sys_user user = dao.fetch(Sys_user.class, familyUser.getUserId());
|
|
||||||
//msgApi.sendTextMsg("【" + activity.getActivityName() + "】已候补成功,请按时参加活动!", user.getLoginname());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//删除报名记录
|
|
||||||
dao.clear("family_user_course", Cnd.where("activityId", "=", activityId)
|
|
||||||
.and("courseId", "=", courseId).and("userId", "=", userId));
|
|
||||||
|
|
||||||
dao.clear("family_user", Cnd.where("activityId", "=", activityId)
|
|
||||||
.and("courseId", "=", courseId).and("userId", "=", userId));
|
|
||||||
return Result.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
@At
|
|
||||||
@ApiOperation("签到")
|
|
||||||
@SaCheckPermission("h5.family.sign")
|
|
||||||
@SLog(tag = "亲子活动-活动报名", msg = "活动签到")
|
|
||||||
public Result doQd(@Param("id") String id, @Param("courseId") String courseId, @Param("point") Double[] points) {
|
|
||||||
FamilyCourse course = dao.fetch(FamilyCourse.class, courseId);
|
|
||||||
List<Double> coursePoints = course.getCourseLocationCoordinates();
|
|
||||||
// if (Lang.isNotEmpty(coursePoints)) {
|
|
||||||
// //需要签到
|
|
||||||
// if (ArrayUtil.isEmpty(points) || ArrayUtil.hasNull(points)) {
|
|
||||||
// return Result.error().addMsg("请获取当前的坐标信息");
|
|
||||||
// }
|
|
||||||
// Double[] coursePointArray = coursePoints.toArray(new Double[]{});
|
|
||||||
// float distance = AMapUtils.calculateLineDistance(new LatLng(points[0], points[1]), new LatLng(coursePointArray[0], coursePointArray[1]));
|
|
||||||
//
|
|
||||||
// if (distance > 500) {
|
|
||||||
// return Result.error().addMsg("请到签到点位附近签到");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
familyActivityService.doQd(id);
|
|
||||||
return Result.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 签到信息
|
|
||||||
*
|
|
||||||
* @param activityId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@At
|
|
||||||
@ApiOperation("获取签到信息")
|
|
||||||
@SaCheckPermission("h5.family.sign")
|
|
||||||
public Result getQdInfoList(@Param("activityId") String activityId) {
|
|
||||||
List<NutMap> list = familyActivityService.qdInfoByUserId(SecurityUtil.getUserId(), activityId);
|
|
||||||
return Result.success(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@At
|
|
||||||
@ApiOperation("验证是否能报名")
|
|
||||||
@SaCheckPermission("h5.family.sign")
|
|
||||||
public Result validateSignUp(String courseId,
|
|
||||||
@Param(value = "currentFamilyNumber") Integer currentFamilyNumber) {
|
|
||||||
try {
|
|
||||||
lock.lock();
|
|
||||||
if(StrUtil.isBlank(courseId)) {
|
|
||||||
return Result.error("报名信息为空");
|
|
||||||
}
|
|
||||||
|
|
||||||
currentFamilyNumber = currentFamilyNumber != null ? currentFamilyNumber : 0;
|
|
||||||
FamilyCourse course = dao.fetch(FamilyCourse.class, courseId);
|
|
||||||
FamilyActivity activity = dao.fetch(FamilyActivity.class, course.getActivityId());
|
|
||||||
|
|
||||||
//判断时间
|
|
||||||
if(DateUtil.compare(new Date(), activity.getActivitySignUpStartTime(), "yyyy-MM-dd HH:mm:ss") < 0) {
|
|
||||||
return Result.error("报名未开始");
|
|
||||||
}
|
|
||||||
if(DateUtil.compare(new Date(), activity.getActivitySignUpEndTime(), "yyyy-MM-dd HH:mm:ss") > 0) {
|
|
||||||
return Result.error("报名已结束");
|
|
||||||
}
|
|
||||||
|
|
||||||
//判断活动组别
|
|
||||||
int count = dao.count(ActivityUserScope.class, Cnd.where("groupId", "=", activity.getActivityGroupId()).and("userId", "=", SecurityUtil.getUserId()));
|
|
||||||
if(count == 0) {
|
|
||||||
return Result.error("抱歉,您没有此次活动的权限");
|
|
||||||
}
|
|
||||||
|
|
||||||
//判断是否报名
|
|
||||||
boolean courseByUser = familyActivityService.isSignCourseByUser(courseId, SecurityUtil.getUserId());
|
|
||||||
if(courseByUser) {
|
|
||||||
return Result.error("抱歉,您已经报名");
|
|
||||||
}
|
|
||||||
|
|
||||||
//判断活动人数
|
|
||||||
boolean signFull = familyActivityService.isSignFull(course, currentFamilyNumber);
|
|
||||||
if(signFull) {
|
|
||||||
return Result.error("名额剩余数量不足");
|
|
||||||
}
|
|
||||||
|
|
||||||
//判断活动限制
|
|
||||||
boolean signCourse = familyActivityService.isSignCourse(course, activity);
|
|
||||||
if(!signCourse) {
|
|
||||||
if(activity.getRestrictLimit() != 3) {
|
|
||||||
return Result.error("您选择的类型已达上限,不能再报该类型的了");
|
|
||||||
} else {
|
|
||||||
return Result.error(activity.getActivityName() + "限制报" + activity.getLimitNum() + "个活动,已达上限");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//判断分工会人数限制
|
|
||||||
boolean signFullByUnionId = familyActivityService.isSignFullByUnionId(course, currentFamilyNumber);
|
|
||||||
if(signFullByUnionId) {
|
|
||||||
return Result.error("您所在的分工会名额不足");
|
|
||||||
}
|
|
||||||
|
|
||||||
return Result.success();
|
|
||||||
}catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return Result.error("报名失败");
|
|
||||||
} finally {
|
|
||||||
lock.unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@At
|
|
||||||
@ApiOperation("验证子活动是否能报名")
|
|
||||||
@SaCheckPermission("h5.family.sign")
|
|
||||||
public Object validateSourceSignUp(String activityCourseId, String courseId) {
|
|
||||||
try {
|
|
||||||
lock.lock();
|
|
||||||
// 该时间段下已报名的人数
|
|
||||||
int count = dao.count(FamilyUserCourse.class, Cnd.where("activityCourseId", "=", activityCourseId)
|
|
||||||
.and("courseId", "=", courseId));
|
|
||||||
// 获取改时间段下的活动课程限制报名人数
|
|
||||||
FamilyActivityCourse course = dao.fetch(FamilyActivityCourse.class, activityCourseId);
|
|
||||||
Integer courseLimitNum = course.getCourseLimitNum();
|
|
||||||
// 报名加上自己,如果大于了限制人数,那就无法报名
|
|
||||||
if (count + 1 > courseLimitNum) {
|
|
||||||
return Result.error("该时间段名额已报满,请选择其他时段报名");
|
|
||||||
} else {
|
|
||||||
return Result.success();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return Result.error("报名失败");
|
|
||||||
} finally {
|
|
||||||
lock.unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@At
|
|
||||||
@ApiOperation("二维码签到")
|
|
||||||
@SaCheckPermission("h5.family.sign")
|
|
||||||
@SLog(tag = "亲子活动-活动报名", msg = "二维码签到")
|
|
||||||
public Result codeSign(String id, String codeCourseId, String clickCourseId) {
|
|
||||||
if(StrUtil.isBlank(codeCourseId) || StrUtil.isBlank(clickCourseId)) {
|
|
||||||
return Result.error("签到失败,没有获取到扫描信息");
|
|
||||||
}
|
|
||||||
if(!codeCourseId.equals(clickCourseId)) {
|
|
||||||
return Result.error("签到失败,二维码与您当前签到信息不符");
|
|
||||||
}
|
|
||||||
dao.update(FamilyUserCourse.class, Chain.make("isAttend", true)
|
|
||||||
.add("attendTime", new Date()), Cnd.where("id", "=", id));
|
|
||||||
return Result.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
-201
@@ -1,201 +0,0 @@
|
|||||||
package com.budwk.app.zhgh.activity.family.controller.mobile;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
|
||||||
import org.nutz.mvc.annotation.At;
|
|
||||||
import org.nutz.mvc.annotation.Ok;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 品牌活动扫码
|
|
||||||
*/
|
|
||||||
@IocBean
|
|
||||||
@At("/platform/mobile/familyActivityScannerQrCode")
|
|
||||||
@Ok("json:full")
|
|
||||||
@Slf4j
|
|
||||||
public class MFamilyActivityScannerQrCodeController {
|
|
||||||
|
|
||||||
/*@Inject
|
|
||||||
private WxTokenUtil;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private familyActivityService familyActivityService;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private Dao dao;
|
|
||||||
|
|
||||||
@At("")
|
|
||||||
@Ok("beetl:/mobile/scannerQrCode.html")
|
|
||||||
public void scannerQrCode() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
*//**
|
|
||||||
* 微信js验证
|
|
||||||
*
|
|
||||||
* @param url
|
|
||||||
* @return
|
|
||||||
*//*
|
|
||||||
@At("/auth/sign")
|
|
||||||
@ViReturn
|
|
||||||
@RequiresAuthentication
|
|
||||||
public Object wxAuthSign(String url) {
|
|
||||||
String jsapi_ticket = wxTokenUtil.jsTicket();
|
|
||||||
return sign(jsapi_ticket, url);
|
|
||||||
}
|
|
||||||
|
|
||||||
*//**
|
|
||||||
* 二维码信息
|
|
||||||
*
|
|
||||||
* @param userId 用户id
|
|
||||||
* @param signId 签到记录id
|
|
||||||
* @param activityId 活动id
|
|
||||||
* @return
|
|
||||||
*//*
|
|
||||||
@At("/qrCodeInfo")
|
|
||||||
@RequiresAuthentication
|
|
||||||
public Object qrCodeInfo(@Param("userId") String userId, @Param("signId") String signId, @Param("activityId") String activityId) {
|
|
||||||
if (StrUtil.isBlank(userId) || StrUtil.isBlank(signId) || StrUtil.isBlank(activityId)) {
|
|
||||||
return Result.error("参数错误");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
// Sql activitySql = Sqls.create("select activityName,cover from family_activity where id = @activityId");
|
|
||||||
// activitySql.setParam("activityId",activityId);
|
|
||||||
// NutMap activityMap = (NutMap) Daos.query(dao, activitySql.toString(), Sqls.callback.map());
|
|
||||||
|
|
||||||
Sql signSql = Sqls.create("select isAttend,attendTime,isReceive,receiveTime from family_user_course where id = @signId");
|
|
||||||
signSql.setParam("signId", signId);
|
|
||||||
NutMap attendInfo = (NutMap) Daos.query(dao, signSql.toString(), Sqls.callback.map());
|
|
||||||
Sql userSql = Sqls.create("select id,username,loginname,unitname,unionname,sex from `user` where id = @userId");
|
|
||||||
userSql.setParam("userId", userId);
|
|
||||||
NutMap userMap = (NutMap) Daos.query(dao, userSql.toString(), Sqls.callback.map());
|
|
||||||
return Result.success(Map.of("signInfo", attendInfo, "userInfo", userMap));
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
return Result.error("获取信息失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@At("/signInfo")
|
|
||||||
@RequiresAuthentication
|
|
||||||
public Object signInfo(@Param("signId") String signId) {
|
|
||||||
if (StrUtil.isBlank(signId)) {
|
|
||||||
return Result.error("参数错误");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
Sql signSql = Sqls.create("select isAttend,attendTime from family_user_course where id = @signId");
|
|
||||||
signSql.setParam("signId", signId);
|
|
||||||
NutMap signInfo = familyActivityService.fetch(signSql);
|
|
||||||
return Result.success(signInfo);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
return Result.error("获取信息失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*//**
|
|
||||||
* 发放礼品
|
|
||||||
*
|
|
||||||
* @param signId
|
|
||||||
* @return
|
|
||||||
*//*
|
|
||||||
@At("/grantGiftByQrCode")
|
|
||||||
@RequiresAuthentication
|
|
||||||
public Object grantGiftByQrCode(@Param("signId") String signId) {
|
|
||||||
if (StrUtil.isBlank(signId)) {
|
|
||||||
return Result.error("参数错误");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
Chain chain = Chain.make("isReceive", 1);
|
|
||||||
chain.add("receiveTime", new Date());
|
|
||||||
chain.add("giftScannerCodeUserId", ShiroUtil.getPrincipalProperty("id"));
|
|
||||||
dao.update(familyUserCourse.class, chain, Cnd.where("id", "=", signId));
|
|
||||||
Sql signSql = Sqls.create("select isAttend,attendTime,isReceive,receiveTime from family_user_course where id = @signId");
|
|
||||||
signSql.setParam("signId", signId);
|
|
||||||
NutMap signInfo = familyActivityService.fetch(signSql);
|
|
||||||
return Result.success(signInfo);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
return Result.error("获取信息失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
*//**
|
|
||||||
* 二维码扫描确认签到
|
|
||||||
*
|
|
||||||
* @param signId
|
|
||||||
* @return
|
|
||||||
*//*
|
|
||||||
@At("/confirmSignByQrCode")
|
|
||||||
@RequiresAuthentication
|
|
||||||
public Object confirmSignByQrCode(@Param("signId") String signId) {
|
|
||||||
if (StrUtil.isBlank(signId)) {
|
|
||||||
return Result.error("参数错误");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
Chain chain = Chain.make("isAttend", 1);
|
|
||||||
chain.add("attendTime", new Date());
|
|
||||||
chain.add("signScannerCodeUserId", ShiroUtil.getPrincipalProperty("id"));
|
|
||||||
dao.update(familyUserCourse.class, chain, Cnd.where("id", "=", signId));
|
|
||||||
|
|
||||||
Sql signSql = Sqls.create("select isAttend,attendTime,isReceive,receiveTime from family_user_course where id = @signId");
|
|
||||||
signSql.setParam("signId", signId);
|
|
||||||
NutMap signInfo = familyActivityService.fetch(signSql);
|
|
||||||
return Result.success(signInfo);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
return Result.error("获取信息失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static Map<String, String> sign(String jsapi_ticket, String url) {
|
|
||||||
Map<String, String> ret = new HashMap<String, String>();
|
|
||||||
String nonce_str = create_nonce_str();
|
|
||||||
String timestamp = create_timestamp();
|
|
||||||
String string1;
|
|
||||||
String signature = "";
|
|
||||||
|
|
||||||
//注意这里参数名必须全部小写,且必须有序
|
|
||||||
string1 = "jsapi_ticket=" + jsapi_ticket +
|
|
||||||
"&noncestr=" + nonce_str +
|
|
||||||
"×tamp=" + timestamp +
|
|
||||||
"&url=" + url;
|
|
||||||
System.out.println(string1);
|
|
||||||
|
|
||||||
try {
|
|
||||||
MessageDigest crypt = MessageDigest.getInstance("SHA-1");
|
|
||||||
crypt.reset();
|
|
||||||
crypt.update(string1.getBytes("UTF-8"));
|
|
||||||
signature = byteToHex(crypt.digest());
|
|
||||||
} catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
ret.put("url", url);
|
|
||||||
ret.put("jsapi_ticket", jsapi_ticket);
|
|
||||||
ret.put("nonceStr", nonce_str);
|
|
||||||
ret.put("timestamp", timestamp);
|
|
||||||
ret.put("signature", signature);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String byteToHex(final byte[] hash) {
|
|
||||||
Formatter formatter = new Formatter();
|
|
||||||
for (byte b : hash) {
|
|
||||||
formatter.format("%02x", b);
|
|
||||||
}
|
|
||||||
String result = formatter.toString();
|
|
||||||
formatter.close();
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String create_nonce_str() {
|
|
||||||
return UUID.randomUUID().toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String create_timestamp() {
|
|
||||||
return Long.toString(System.currentTimeMillis() / 1000);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
}
|
|
||||||
+9
-9
@@ -62,7 +62,7 @@ import java.util.stream.Collectors;
|
|||||||
@IocBean
|
@IocBean
|
||||||
@Ok("json:full")
|
@Ok("json:full")
|
||||||
@Api(tags = "亲子活动统计")
|
@Api(tags = "亲子活动统计")
|
||||||
@At("/platform/family/statistics/activity")
|
@At("/platform/family/statistics")
|
||||||
public class FamilyActivityStatisticsController {
|
public class FamilyActivityStatisticsController {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@@ -73,14 +73,14 @@ public class FamilyActivityStatisticsController {
|
|||||||
private Dao dao;
|
private Dao dao;
|
||||||
|
|
||||||
@At("")
|
@At("")
|
||||||
@SaCheckPermission("family.statistics.activity")
|
@SaCheckPermission("family.statistics")
|
||||||
@Ok("beetl:/platform/zhgh/activity/family/statistics/index.html")
|
@Ok("beetl:/platform/zhgh/activity/family/statistics/index.html")
|
||||||
public void index() {
|
public void index() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("分页查询")
|
@ApiOperation("分页查询")
|
||||||
@SaCheckPermission("family.statistics.activity")
|
@SaCheckPermission("family.statistics")
|
||||||
public Result pageData(PageForm pageForm,
|
public Result pageData(PageForm pageForm,
|
||||||
@Param(value = "activityId") String activityId) {
|
@Param(value = "activityId") String activityId) {
|
||||||
Pagination pagination = familyActivityStatisticsService.pageData(pageForm, activityId);
|
Pagination pagination = familyActivityStatisticsService.pageData(pageForm, activityId);
|
||||||
@@ -95,7 +95,7 @@ public class FamilyActivityStatisticsController {
|
|||||||
*/
|
*/
|
||||||
@At
|
@At
|
||||||
@ApiOperation("活动列表")
|
@ApiOperation("活动列表")
|
||||||
@SaCheckPermission("family.statistics.activity")
|
@SaCheckPermission("family.statistics")
|
||||||
public Result activityList(@Param(value = "year") Integer year) {
|
public Result activityList(@Param(value = "year") Integer year) {
|
||||||
List<FamilyActivity> list = dao.query(FamilyActivity.class, Cnd.NEW().andEX("year", "=", year).desc("activityStartTime"));
|
List<FamilyActivity> list = dao.query(FamilyActivity.class, Cnd.NEW().andEX("year", "=", year).desc("activityStartTime"));
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
@@ -109,14 +109,14 @@ public class FamilyActivityStatisticsController {
|
|||||||
*/
|
*/
|
||||||
@At
|
@At
|
||||||
@ApiOperation("报名人员列表")
|
@ApiOperation("报名人员列表")
|
||||||
@SaCheckPermission("family.statistics.activity")
|
@SaCheckPermission("family.statistics")
|
||||||
public Result registerUserList(@Param(value = "courseId") String courseId) {
|
public Result registerUserList(@Param(value = "courseId") String courseId) {
|
||||||
return Result.success(familyActivityStatisticsService.registerUserList(courseId));
|
return Result.success(familyActivityStatisticsService.registerUserList(courseId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("报名动态列")
|
@ApiOperation("报名动态列")
|
||||||
@SaCheckPermission("family.statistics.activity")
|
@SaCheckPermission("family.statistics")
|
||||||
public Object getTaleColumnInfo(@Param(value = "courseId") String courseId) {
|
public Object getTaleColumnInfo(@Param(value = "courseId") String courseId) {
|
||||||
return Result.success(familyActivityStatisticsService.getTaleColumnInfo(courseId));
|
return Result.success(familyActivityStatisticsService.getTaleColumnInfo(courseId));
|
||||||
}
|
}
|
||||||
@@ -129,14 +129,14 @@ public class FamilyActivityStatisticsController {
|
|||||||
*/
|
*/
|
||||||
@At
|
@At
|
||||||
@ApiOperation("获取签到信息")
|
@ApiOperation("获取签到信息")
|
||||||
@SaCheckPermission("family.statistics.activity")
|
@SaCheckPermission("family.statistics")
|
||||||
public Result getSignInfo(@Param("courseId") String courseId) {
|
public Result getSignInfo(@Param("courseId") String courseId) {
|
||||||
return Result.success(familyActivityStatisticsService.getSignInfo(courseId));
|
return Result.success(familyActivityStatisticsService.getSignInfo(courseId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("开放报名")
|
@ApiOperation("开放报名")
|
||||||
@SaCheckPermission("family.statistics.activity")
|
@SaCheckPermission("family.statistics")
|
||||||
public Result signChange(@Param("courseId") String courseId, @Param("openOtherUnion") Boolean openOtherUnion) {
|
public Result signChange(@Param("courseId") String courseId, @Param("openOtherUnion") Boolean openOtherUnion) {
|
||||||
dao.update(FamilyCourse.class, Chain.make("openOtherUnion", openOtherUnion)
|
dao.update(FamilyCourse.class, Chain.make("openOtherUnion", openOtherUnion)
|
||||||
, Cnd.where("id", "=", courseId));
|
, Cnd.where("id", "=", courseId));
|
||||||
@@ -146,7 +146,7 @@ public class FamilyActivityStatisticsController {
|
|||||||
@At
|
@At
|
||||||
@Ok("void")
|
@Ok("void")
|
||||||
@ApiOperation("导出签到名单")
|
@ApiOperation("导出签到名单")
|
||||||
@SaCheckPermission("family.statistics.activity")
|
@SaCheckPermission("family.statistics")
|
||||||
public void exportSignUser(@Param(value = "activityId") String activityId,
|
public void exportSignUser(@Param(value = "activityId") String activityId,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -24,113 +24,129 @@ import java.util.List;
|
|||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class FamilyActivity extends BaseModel implements Serializable, SysHomeConvert {
|
public class FamilyActivity extends BaseModel implements Serializable, SysHomeConvert {
|
||||||
|
|
||||||
@Name
|
@Name
|
||||||
@PrevInsert(uu32 = true)
|
@PrevInsert(uu32 = true)
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||||
@Comment("活动名称")
|
@Comment("活动名称")
|
||||||
private String activityName;
|
private String activityName;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.INT)
|
@ColDefine(type = ColType.INT)
|
||||||
@Comment("年度")
|
@Comment("年度")
|
||||||
private Integer year;
|
private Integer year;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.DATETIME)
|
@ColDefine(type = ColType.DATETIME)
|
||||||
@Comment("活动报名开始时间")
|
@Comment("活动报名开始时间")
|
||||||
private Date activitySignUpStartTime;
|
private Date activitySignUpStartTime;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.DATETIME)
|
@ColDefine(type = ColType.DATETIME)
|
||||||
@Comment("活动报名开始时间")
|
@Comment("活动报名开始时间")
|
||||||
private Date activitySignUpEndTime;
|
private Date activitySignUpEndTime;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.DATETIME)
|
@ColDefine(type = ColType.DATETIME)
|
||||||
@Comment("活动开始时间")
|
@Comment("活动开始时间")
|
||||||
private Date activityStartTime;
|
private Date activityStartTime;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.DATETIME)
|
@ColDefine(type = ColType.DATETIME)
|
||||||
@Comment("活动结束时间")
|
@Comment("活动结束时间")
|
||||||
private Date activityEndTime;
|
private Date activityEndTime;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.BOOLEAN)
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
@Comment("是否禁用")
|
@Comment("是否禁用")
|
||||||
@Default("0")
|
@Default("0")
|
||||||
private boolean isDisabled;
|
private boolean isDisabled;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@ColDefine(customType = "longtext")
|
@ColDefine(customType = "longtext")
|
||||||
@Comment("活动介绍")
|
@Comment("活动介绍")
|
||||||
private String introduce;
|
private String introduce;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.INT, width = 10)
|
@ColDefine(type = ColType.INT, width = 10)
|
||||||
@Comment("活动限制标识")
|
@Comment("活动限制标识")
|
||||||
private Integer restrictLimit;
|
private Integer restrictLimit;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.INT, width = 10)
|
@ColDefine(type = ColType.INT, width = 10)
|
||||||
@Comment("活动限制报名个数")
|
@Comment("活动限制报名个数")
|
||||||
private Integer limitNum;
|
private Integer limitNum;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||||
@Comment("活动封面")
|
@Comment("活动封面")
|
||||||
private String cover;
|
private String cover;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||||
@Comment("微信群二维码")
|
@Comment("微信群二维码")
|
||||||
private String wechat;
|
private String wechat;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.BOOLEAN)
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
@Comment("上课前是否通知")
|
@Comment("上课前是否通知")
|
||||||
@Default("0")
|
@Default("0")
|
||||||
private boolean notice;
|
private boolean notice;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@Comment("活动范围Id")
|
@Comment("活动范围Id")
|
||||||
@ColDefine(type = ColType.INT, width = 32)
|
@ColDefine(type = ColType.INT, width = 32)
|
||||||
private Integer activityGroupId;
|
private Integer activityGroupId;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@Comment("活动范围名称")
|
@Comment("活动范围名称")
|
||||||
@ColDefine(type = ColType.VARCHAR, width = 40)
|
@ColDefine(type = ColType.VARCHAR, width = 40)
|
||||||
private String activityGroupName;
|
private String activityGroupName;
|
||||||
|
|
||||||
@Many(field = "activityId")
|
@Many(field = "activityId")
|
||||||
private List<FamilyCourse> courseList;
|
private List<FamilyCourse> courseList;
|
||||||
|
|
||||||
@Many(field = "activityId")
|
@Many(field = "activityId")
|
||||||
private List<FamilyTypeLimit> typeLimits;
|
private List<FamilyTypeLimit> typeLimits;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@Comment("活动类型")
|
@Comment("活动类型")
|
||||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||||
private String trainType;
|
private String trainType;
|
||||||
|
|
||||||
@Override
|
@Column
|
||||||
public Sys_home_activity covertToSysHomeActivity() {
|
@Comment("关键词")
|
||||||
Sys_home_activity sysHomeActivity = new Sys_home_activity();
|
@Default("家属")
|
||||||
sysHomeActivity.setId(this.getId());
|
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||||
sysHomeActivity.setName(this.getActivityName());
|
private String keyWord;
|
||||||
sysHomeActivity.setCover(this.getCover());
|
|
||||||
sysHomeActivity.setUrl("/platform/family/manage/apply");
|
@Column
|
||||||
sysHomeActivity.setH5Url("/platform/mobile/familyActivity/familyList");
|
@Comment("家属最多数")
|
||||||
if (Lang.isNotEmpty(this.getActivitySignUpStartTime())) {
|
@ColDefine(type = ColType.INT)
|
||||||
sysHomeActivity.setStartDate(this.getActivitySignUpStartTime());
|
private Integer familyMaxCount;
|
||||||
sysHomeActivity.setEndDate(this.getActivitySignUpEndTime());
|
|
||||||
}
|
@Column
|
||||||
sysHomeActivity.setAllowUserGroupId(this.getActivityGroupId());
|
@Comment("判断家属数量的唯一标识")
|
||||||
sysHomeActivity.setEnable(!this.isDisabled());
|
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||||
sysHomeActivity.setClassPath(this.getClass().getPackageName() + this.getClass().getName());
|
private String onlyKey;
|
||||||
return sysHomeActivity;
|
|
||||||
}
|
@Override
|
||||||
|
public Sys_home_activity covertToSysHomeActivity() {
|
||||||
|
Sys_home_activity sysHomeActivity = new Sys_home_activity();
|
||||||
|
sysHomeActivity.setId(this.getId());
|
||||||
|
sysHomeActivity.setName(this.getActivityName());
|
||||||
|
sysHomeActivity.setCover(this.getCover());
|
||||||
|
sysHomeActivity.setUrl("/platform/family/apply");
|
||||||
|
sysHomeActivity.setH5Url("/platform/family/apply/h5?id=" + this.getId());
|
||||||
|
if (Lang.isNotEmpty(this.getActivitySignUpStartTime())) {
|
||||||
|
sysHomeActivity.setStartDate(this.getActivitySignUpStartTime());
|
||||||
|
sysHomeActivity.setEndDate(this.getActivitySignUpEndTime());
|
||||||
|
}
|
||||||
|
sysHomeActivity.setAllowUserGroupId(this.getActivityGroupId());
|
||||||
|
sysHomeActivity.setEnable(!this.isDisabled());
|
||||||
|
sysHomeActivity.setClassPath(this.getClass().getPackageName() + this.getClass().getName());
|
||||||
|
return sysHomeActivity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,6 +78,11 @@ public class FamilyCourse extends BaseModel implements Serializable {
|
|||||||
@Comment("序号")
|
@Comment("序号")
|
||||||
private int orderNum;
|
private int orderNum;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@ColDefine(customType = "longtext")
|
||||||
|
@Comment("详细信息")
|
||||||
|
private String introduce;
|
||||||
|
|
||||||
@Many(field = "courseId")
|
@Many(field = "courseId")
|
||||||
private List<FamilyActivityCourse> courseTimeList;
|
private List<FamilyActivityCourse> courseTimeList;
|
||||||
|
|
||||||
@@ -89,6 +94,7 @@ public class FamilyCourse extends BaseModel implements Serializable {
|
|||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.BOOLEAN)
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
@Comment("移动端是否签到")
|
@Comment("移动端是否签到")
|
||||||
|
@Default("0")
|
||||||
private boolean isMobileSign;
|
private boolean isMobileSign;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@@ -99,6 +105,7 @@ public class FamilyCourse extends BaseModel implements Serializable {
|
|||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.BOOLEAN)
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
@Comment("移动端是否签收礼品")
|
@Comment("移动端是否签收礼品")
|
||||||
|
@Default("0")
|
||||||
private boolean isReceiveGift;
|
private boolean isReceiveGift;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@@ -137,6 +144,33 @@ public class FamilyCourse extends BaseModel implements Serializable {
|
|||||||
@Comment("候补名额数")
|
@Comment("候补名额数")
|
||||||
private Integer waitingNum;
|
private Integer waitingNum;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
|
@Comment("是否限制年龄")
|
||||||
|
@Default("0")
|
||||||
|
private boolean familyAgeLimit;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@ColDefine(type = ColType.INT)
|
||||||
|
@Comment("最小年龄")
|
||||||
|
private Integer minAge;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@ColDefine(type = ColType.INT)
|
||||||
|
@Comment("最大年龄")
|
||||||
|
private Integer maxAge;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@ColDefine(type = ColType.BOOLEAN)
|
||||||
|
@Comment("是否限制性别")
|
||||||
|
@Default("0")
|
||||||
|
private boolean familySexLimit;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@ColDefine(type = ColType.VARCHAR)
|
||||||
|
@Comment("限制性别")
|
||||||
|
private String familySex;
|
||||||
|
|
||||||
private Integer hasWaitingNum;
|
private Integer hasWaitingNum;
|
||||||
private String courseTimeName;
|
private String courseTimeName;
|
||||||
private Integer hasRegisterNum;
|
private Integer hasRegisterNum;
|
||||||
|
|||||||
@@ -84,4 +84,9 @@ public class FamilyMobileSignColumn implements Serializable {
|
|||||||
@ColDefine(type = ColType.INT, width = 1)
|
@ColDefine(type = ColType.INT, width = 1)
|
||||||
private Integer columnIndex;
|
private Integer columnIndex;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("验证规则")
|
||||||
|
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||||
|
private String validRule;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+84
-82
@@ -16,101 +16,103 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface FamilyActivityService extends BaseService<FamilyActivity> {
|
public interface FamilyActivityService extends BaseService<FamilyActivity> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加活动
|
* 添加活动
|
||||||
* @param activity 活动信息
|
* @param activity 活动信息
|
||||||
* @param course 培训班信息
|
* @param course 培训班信息
|
||||||
*/
|
*/
|
||||||
void add(FamilyActivity activity, FamilyCourse course);
|
void add(FamilyActivity activity, FamilyCourse course);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑活动
|
* 编辑活动
|
||||||
* @param activity 活动信息
|
* @param activity 活动信息
|
||||||
*/
|
*/
|
||||||
void edit(FamilyActivity activity);
|
void edit(FamilyActivity activity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新活动状态
|
* 更新活动状态
|
||||||
* @param activity 活动信息
|
* @param activity 活动信息
|
||||||
*/
|
*/
|
||||||
void updateActivityStatus(FamilyActivity activity);
|
void updateActivityStatus(FamilyActivity activity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询单条活动信息
|
* 查询单条活动信息
|
||||||
* @param id 活动ID
|
* @param id 活动ID
|
||||||
* @return 返回的数据与前端符合
|
* @return 返回的数据与前端符合
|
||||||
*/
|
*/
|
||||||
NutMap findOne(String id, Cnd cnd, String fromMode);
|
NutMap findOne(String id, Cnd cnd, String fromMode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pc分页查询
|
* pc分页查询
|
||||||
* @param pageForm
|
* @param pageForm
|
||||||
* @param cnd
|
* @param cnd
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Pagination pageData(PageForm pageForm, Cnd cnd);
|
Pagination pageData(PageForm pageForm, Cnd cnd);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机端分页查询
|
* 手机端分页查询
|
||||||
* @param pageForm 分页
|
* @param pageForm 分页
|
||||||
* @param year 年度
|
* @param year 年度
|
||||||
* @param activityStatus 报名状态 0全部 1进行中 2结束
|
* @param activityStatus 报名状态 0全部 1进行中 2结束
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Pagination mPageData(PageForm pageForm, Integer year, int activityStatus, Integer activityType);
|
Pagination mPageData(PageForm pageForm, Integer year, int activityStatus, Integer activityType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机端报名
|
* 手机端报名
|
||||||
* @param familyUser 活动ID
|
* @param familyUser 活动ID
|
||||||
*/
|
*/
|
||||||
void doSignUp(FamilyUser familyUser) throws Exception;
|
void doSignUp(FamilyUser familyUser) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异步插入每个报名成功人员的课程数据
|
* 异步插入每个报名成功人员的课程数据
|
||||||
* @param activityId
|
* @param activityId
|
||||||
* @param courseId
|
* @param courseId
|
||||||
* @param userId
|
* @param userId
|
||||||
*/
|
*/
|
||||||
void asyncInsertUserCourse(String activityId, String courseId, String userId);
|
void asyncInsertUserCourse(String activityId, String courseId, String userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 该培训班每个分工会名额是否报满
|
* 该培训班每个分工会名额是否报满
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean isSignFullByUnionId(FamilyCourse course, Integer currentFamilyNumber);
|
boolean isSignFullByUnionId(FamilyCourse course, Integer currentFamilyNumber);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 该培训班是否报满
|
* 该培训班是否报满
|
||||||
*/
|
*/
|
||||||
boolean isSignFull(FamilyCourse course, Integer currentFamilyNumber);
|
boolean isSignFull(FamilyCourse course, Integer currentFamilyNumber);
|
||||||
|
|
||||||
/**
|
boolean validFamilyCount(FamilyUser user);
|
||||||
* 还能报该类型的培训班吗 比如书画班最多报一项 健身班两项
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
boolean isSignCourse(FamilyCourse course, FamilyActivity activity);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前用户是否已报过该培训班
|
* 还能报该类型的培训班吗 比如书画班最多报一项 健身班两项
|
||||||
* @param courseId
|
* @return
|
||||||
* @param userId
|
*/
|
||||||
* @return
|
boolean isSignCourse(FamilyCourse course, FamilyActivity activity);
|
||||||
*/
|
|
||||||
boolean isSignCourseByUser(String courseId, String userId);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机端签到
|
* 当前用户是否已报过该培训班
|
||||||
* @param id 每个培训班每节课每个用户的记录ID
|
* @param courseId
|
||||||
*/
|
* @param userId
|
||||||
void doQd(String id);
|
* @return
|
||||||
|
*/
|
||||||
|
boolean isSignCourseByUser(String courseId, String userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 某个用户的签到信息
|
* 手机端签到
|
||||||
* @param userId 用户id
|
* @param id 每个培训班每节课每个用户的记录ID
|
||||||
* @param activityId 活动id
|
*/
|
||||||
*/
|
void doQd(String id);
|
||||||
List<NutMap> qdInfoByUserId(String userId, String activityId);
|
|
||||||
|
|
||||||
List<FamilyCourse> filterCourseByHostUnion(List<FamilyCourse> courseList);
|
/**
|
||||||
|
* 某个用户的签到信息
|
||||||
|
* @param userId 用户id
|
||||||
|
* @param activityId 活动id
|
||||||
|
*/
|
||||||
|
List<NutMap> qdInfoByUserId(String userId, String activityId);
|
||||||
|
|
||||||
|
List<FamilyCourse> filterCourseByHostUnion(List<FamilyCourse> courseList);
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-5
@@ -1,11 +1,9 @@
|
|||||||
package com.budwk.app.zhgh.activity.family.service.impl;
|
package com.budwk.app.zhgh.activity.family.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONArray;
|
|
||||||
import cn.hutool.json.JSONObject;
|
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
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;
|
||||||
|
import com.budwk.app.base.result.Result;
|
||||||
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
import com.budwk.app.base.service.impl.BaseServiceImpl;
|
||||||
import com.budwk.app.sys.models.Sys_home_activity;
|
import com.budwk.app.sys.models.Sys_home_activity;
|
||||||
import com.budwk.app.sys.views.View_user;
|
import com.budwk.app.sys.views.View_user;
|
||||||
@@ -27,12 +25,10 @@ import org.nutz.dao.util.cri.Static;
|
|||||||
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.json.Json;
|
|
||||||
import org.nutz.lang.Lang;
|
import org.nutz.lang.Lang;
|
||||||
import org.nutz.lang.util.NutMap;
|
import org.nutz.lang.util.NutMap;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -373,6 +369,26 @@ public class FamilyActivityServiceImpl extends BaseServiceImpl<FamilyActivity> i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean validFamilyCount(FamilyUser user) {
|
||||||
|
String activityId = user.getActivityId();
|
||||||
|
// 查询报名记录
|
||||||
|
List<FamilyUser> list = dao().query(FamilyUser.class, Cnd.where(FamilyUser::getActivityId, "=", activityId).and(FamilyUser::getUserId, "=", SecurityUtil.getUserId()));
|
||||||
|
if(Lang.isEmpty(list)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
FamilyActivity activity = dao().fetch(FamilyActivity.class, activityId);
|
||||||
|
|
||||||
|
List<List<NutMap>> allMobileColumnsValue = new ArrayList<>(list.stream()
|
||||||
|
.map(FamilyUser::getMobileColumnsValue)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.flatMap(List::stream)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
allMobileColumnsValue.addAll(user.getMobileColumnsValue());
|
||||||
|
return allMobileColumnsValue.size() > activity.getFamilyMaxCount();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSignCourse(FamilyCourse course, FamilyActivity activity) {
|
public boolean isSignCourse(FamilyCourse course, FamilyActivity activity) {
|
||||||
//培训班类型
|
//培训班类型
|
||||||
|
|||||||
+1
-1
@@ -98,7 +98,7 @@ public class TrainSignUpManageController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ApiOperation("查询单个活动")
|
@ApiOperation("查询单个活动")
|
||||||
@SaCheckPermission("trainSingUp.manage")
|
@SaCheckPermission("trainSingUp")
|
||||||
public Result findOne(@Param("id") @NotNull String id) {
|
public Result findOne(@Param("id") @NotNull String id) {
|
||||||
NutMap dataMap = trainSignUpActivityManageService.findOne(id, null, "");
|
NutMap dataMap = trainSignUpActivityManageService.findOne(id, null, "");
|
||||||
String activityStartTime = dataMap.getString("activityStartTime");
|
String activityStartTime = dataMap.getString("activityStartTime");
|
||||||
|
|||||||
+22
@@ -140,4 +140,26 @@ public class TrainsignUpMineController {
|
|||||||
List<NutMap> listMap = activityService.listMap(sql);
|
List<NutMap> listMap = activityService.listMap(sql);
|
||||||
return Result.success(listMap);
|
return Result.success(listMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ApiOperation("获取我报名的课程")
|
||||||
|
@SaCheckPermission(value = {"trainSingUp.mine", "h5.trainSingUp.mine"}, mode = SaMode.OR)
|
||||||
|
public Result queryMineCourse(String activityId) {
|
||||||
|
|
||||||
|
Sql sql = Sqls.create("""
|
||||||
|
SELECT
|
||||||
|
c.*,
|
||||||
|
u.mobileColumnsValue
|
||||||
|
FROM
|
||||||
|
train_sign_up_user u
|
||||||
|
LEFT JOIN train_sign_up_course c ON c.id = u.courseId
|
||||||
|
$condition
|
||||||
|
""");
|
||||||
|
Cnd cnd = Cnd.NEW();
|
||||||
|
cnd.and("u.activityId", "=", activityId);
|
||||||
|
cnd.and("u.userId", "=", SecurityUtil.getUserId());
|
||||||
|
sql.setCondition(cnd);
|
||||||
|
List<NutMap> listMap = activityService.listMap(sql);
|
||||||
|
return Result.success(listMap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ module.exports = {
|
|||||||
const doc = parser.parseFromString(this.content, 'text/html');
|
const doc = parser.parseFromString(this.content, 'text/html');
|
||||||
const link = doc.querySelector('a');
|
const link = doc.querySelector('a');
|
||||||
const href = link.getAttribute('href');
|
const href = link.getAttribute('href');
|
||||||
|
if(!href) {
|
||||||
|
this.pdf = false
|
||||||
|
return
|
||||||
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.pdfObj = new Pdfh5('#pdf-container', {
|
this.pdfObj = new Pdfh5('#pdf-container', {
|
||||||
pdfurl: href,
|
pdfurl: href,
|
||||||
|
|||||||
+65
-73
@@ -1,5 +1,5 @@
|
|||||||
<!--#include('signForm.js'){}#-->
|
<!--#include('signForm.js'){}#-->
|
||||||
const info = {
|
const courseList = {
|
||||||
template: /*language=HTML*/ `
|
template: /*language=HTML*/ `
|
||||||
<div>
|
<div>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
@@ -15,12 +15,12 @@ const info = {
|
|||||||
<el-col class="query-title hidden-xs-only">类  型:</el-col>
|
<el-col class="query-title hidden-xs-only">类  型:</el-col>
|
||||||
<el-col class="query-content">
|
<el-col class="query-content">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="pageForm.courseTypeId"
|
v-model="pageForm.courseTypeId"
|
||||||
placeholder="请选择类型"
|
placeholder="请选择类型"
|
||||||
filterable
|
filterable
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
@change="doSearch"
|
@change="doSearch"
|
||||||
>
|
>
|
||||||
<el-option v-for="item in courseTypeList" :key="item.id" :label="item.typeName" :value="item.id"></el-option>
|
<el-option v-for="item in courseTypeList" :key="item.id" :label="item.typeName" :value="item.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -30,12 +30,12 @@ const info = {
|
|||||||
<el-col class="query-title hidden-xs-only">分类标识:</el-col>
|
<el-col class="query-title hidden-xs-only">分类标识:</el-col>
|
||||||
<el-col class="query-content">
|
<el-col class="query-content">
|
||||||
<el-tag
|
<el-tag
|
||||||
:effect="pageForm.assortTypes.includes(item) ? 'dark' : 'plain'"
|
:effect="pageForm.assortTypes.includes(item) ? 'dark' : 'plain'"
|
||||||
:key="item"
|
:key="item"
|
||||||
:type="item"
|
:type="item"
|
||||||
@click="tagClick('assortTypes', item)"
|
@click="tagClick('assortTypes', item)"
|
||||||
style="margin-right: 10px; cursor: pointer"
|
style="margin-right: 10px; cursor: pointer"
|
||||||
v-for="item in assortList"
|
v-for="item in assortList"
|
||||||
>
|
>
|
||||||
{{ item }}
|
{{ item }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
@@ -44,15 +44,15 @@ const info = {
|
|||||||
<el-table :data="tableData" class="mt10">
|
<el-table :data="tableData" class="mt10">
|
||||||
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
|
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:label="column.label"
|
:label="column.label"
|
||||||
:prop="column.prop"
|
:prop="column.prop"
|
||||||
:key="column.prop"
|
:key="column.prop"
|
||||||
:width="column.width"
|
:width="column.width"
|
||||||
:sortable="column.sortable"
|
:sortable="column.sortable"
|
||||||
align="center"
|
align="center"
|
||||||
header-align="center"
|
header-align="center"
|
||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
v-for="column in tableColumns"
|
v-for="column in tableColumns"
|
||||||
>
|
>
|
||||||
<template v-slot="{row}" v-if="column.prop=='courseLocationCoordinates'">
|
<template v-slot="{row}" v-if="column.prop=='courseLocationCoordinates'">
|
||||||
<el-button style="padding: 0" @click="openViewMap(row.courseLocationCoordinates)" type="text">
|
<el-button style="padding: 0" @click="openViewMap(row.courseLocationCoordinates)" type="text">
|
||||||
@@ -67,6 +67,12 @@ const info = {
|
|||||||
<template v-slot="{row}" v-else-if="column.prop=='applyNum'">
|
<template v-slot="{row}" v-else-if="column.prop=='applyNum'">
|
||||||
<span v-html="calcSignUpCount(row)"></span>
|
<span v-html="calcSignUpCount(row)"></span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template v-slot="{row}" v-else-if="column.prop=='introduce'">
|
||||||
|
<span v-if="!row.introduce?.trim()">暂无</span>
|
||||||
|
<el-button v-else style="padding: 0" @click="onPreview(row.introduce)" type="text">点击查看</el-button>
|
||||||
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="100">
|
<el-table-column label="操作" width="100">
|
||||||
<template v-slot="{row}">
|
<template v-slot="{row}">
|
||||||
@@ -102,7 +108,14 @@ const info = {
|
|||||||
<el-button @click="viewMapDialog = false">取 消</el-button>
|
<el-button @click="viewMapDialog = false">取 消</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog :visible.sync="infoVisible" title="详细信息" append-to-body>
|
||||||
|
<div v-html="introduce"></div>
|
||||||
|
<el-row class="mt20" justify="end" type="flex">
|
||||||
|
<el-button @click="infoVisible = false">取 消</el-button>
|
||||||
|
</el-row>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<sign-form ref="signFormRef" @refresh="doSearch"></sign-form>
|
<sign-form ref="signFormRef" @refresh="doSearch"></sign-form>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
@@ -123,18 +136,41 @@ const info = {
|
|||||||
tableColumns: [
|
tableColumns: [
|
||||||
{ prop: "courseName", label: "名称" },
|
{ prop: "courseName", label: "名称" },
|
||||||
{ prop: "typeName", label: "类型", width: 130},
|
{ prop: "typeName", label: "类型", width: 130},
|
||||||
|
{ prop: "campus", label: "校区", width: 160 },
|
||||||
{ prop: "courseLocationCoordinates", label: "地点", width: 200 },
|
{ prop: "courseLocationCoordinates", label: "地点", width: 200 },
|
||||||
{ prop: "courseInstructor", label: "联系人", width: 100 },
|
{ prop: "courseInstructor", label: "联系人", width: 100 },
|
||||||
{ prop: "courseTime", label: "时间", width: 200 },
|
{ prop: "courseTime", label: "时间", width: 160 },
|
||||||
|
{ prop: "introduce", label: "详细信息", width: 100 },
|
||||||
{ prop: "applyNum", label: "已报名人数", width: 200 }
|
{ prop: "applyNum", label: "已报名人数", width: 200 }
|
||||||
],
|
],
|
||||||
activity: {},
|
activity: {},
|
||||||
courseTypeList: [],
|
courseTypeList: [],
|
||||||
|
|
||||||
activityType: '',
|
activityType: '',
|
||||||
|
pdf: false,
|
||||||
|
infoVisible: false,
|
||||||
|
introduce: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async onPreview(introduce) {
|
||||||
|
try {
|
||||||
|
const parser = new DOMParser();
|
||||||
|
const doc = parser.parseFromString(introduce, 'text/html');
|
||||||
|
const link = doc.querySelector('a');
|
||||||
|
const href = link.getAttribute('href');
|
||||||
|
|
||||||
|
const id = href.substring(href.indexOf("=") + 1)
|
||||||
|
const res = await this.$axios.post("/platform/sys/file/previewFileData", { ids: JSON.stringify([id]) })
|
||||||
|
|
||||||
|
this.pdf = true
|
||||||
|
window.open("/assets/platform/plugins/pdfJs/web/viewer.html?file=" + encodeURIComponent(res.data[0].downloadPath), res.data[0].name)
|
||||||
|
} catch (e) {
|
||||||
|
this.introduce = introduce
|
||||||
|
this.pdf = false
|
||||||
|
this.infoVisible = true
|
||||||
|
}
|
||||||
|
},
|
||||||
tagClick(key, val) {
|
tagClick(key, val) {
|
||||||
let idx = this.pageForm[key].indexOf(val)
|
let idx = this.pageForm[key].indexOf(val)
|
||||||
if (idx !== -1) {
|
if (idx !== -1) {
|
||||||
@@ -153,7 +189,7 @@ const info = {
|
|||||||
},
|
},
|
||||||
onSign(row) {
|
onSign(row) {
|
||||||
const courseType = this.courseTypeList.find((v) => v.id === row.courseType)
|
const courseType = this.courseTypeList.find((v) => v.id === row.courseType)
|
||||||
this.$axios.post("/platform/mobile/familyActivity/validateSignUp", {courseId: row.id})
|
this.$axios.post("/platform/family/apply/validateSignUp", {courseId: row.id})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
this.$alert(res.msg, "提示", {
|
this.$alert(res.msg, "提示", {
|
||||||
@@ -168,7 +204,7 @@ const info = {
|
|||||||
type: "warning"
|
type: "warning"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.$refs.signFormRef.onOpen(row, courseType)
|
this.$refs.signFormRef.onOpen(row, courseType, this.activity)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -178,7 +214,7 @@ const info = {
|
|||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "info"
|
type: "info"
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
const resp = await this.$axios.post("/platform/mobile/familyActivity/cancelSignUp", {
|
const resp = await this.$axios.post("/platform/family/apply/cancelSignUp", {
|
||||||
activityId: row.activityId,
|
activityId: row.activityId,
|
||||||
courseId: row.id
|
courseId: row.id
|
||||||
})
|
})
|
||||||
@@ -191,7 +227,7 @@ const info = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
async getCourseTypeList() {
|
async getCourseTypeList() {
|
||||||
const resp = await this.$axios.post("/platform/family/manage/type/getAllType")
|
const resp = await this.$axios.post("/platform/family/type/getAllType")
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
this.courseTypeList = resp.data
|
this.courseTypeList = resp.data
|
||||||
}
|
}
|
||||||
@@ -256,50 +292,6 @@ const info = {
|
|||||||
|
|
||||||
},
|
},
|
||||||
style: /*language=CSS*/ `
|
style: /*language=CSS*/ `
|
||||||
.glow-box {
|
|
||||||
min-height: calc(100vh - 56px - 40px - 50px - 80px);
|
|
||||||
max-height: calc(100vh - 56px - 40px - 50px - 80px);
|
|
||||||
overflow-y: auto;
|
|
||||||
background: #F0F2F5;
|
|
||||||
}
|
|
||||||
img {
|
|
||||||
width: 100%;
|
|
||||||
height: 180px;
|
|
||||||
}
|
|
||||||
.title {
|
|
||||||
background: white;
|
|
||||||
height: 20px;
|
|
||||||
}
|
|
||||||
.query-row {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 6px 0;
|
|
||||||
}
|
|
||||||
.query-row:not(:last-child) {
|
|
||||||
border-bottom: 1px dashed rgb(230, 230, 230);
|
|
||||||
}
|
|
||||||
.query-row > .query-title {
|
|
||||||
width: 100px;
|
|
||||||
max-width: 100px;
|
|
||||||
min-width: 100px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.query-row > .query-content {
|
|
||||||
min-width: 200px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.query-row > .query-content > .el-tag {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
@media screen and (max-width: 992px) {
|
|
||||||
.query-row:nth-child(4) .query-content .el-col:not(:last-child) {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.query-title {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
@@ -3,33 +3,81 @@ layout("/layouts/platform.html"){
|
|||||||
#-->
|
#-->
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.info-dialog .el-dialog__body {
|
||||||
|
max-height: 600px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
.glow-box {
|
||||||
|
min-height: calc(100vh - 56px - 40px - 50px - 80px);
|
||||||
|
max-height: calc(100vh - 56px - 40px - 50px - 80px);
|
||||||
|
overflow-y: auto;
|
||||||
|
background: #F0F2F5;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: 180px;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
background: white;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
.query-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 6px 0;
|
||||||
|
}
|
||||||
|
.query-row:not(:last-child) {
|
||||||
|
border-bottom: 1px dashed rgb(230, 230, 230);
|
||||||
|
}
|
||||||
|
.query-row > .query-title {
|
||||||
|
width: 100px;
|
||||||
|
max-width: 100px;
|
||||||
|
min-width: 100px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.query-row > .query-content {
|
||||||
|
min-width: 200px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.query-row > .query-content > .el-tag {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
@media screen and (max-width: 992px) {
|
||||||
|
.query-row:nth-child(4) .query-content .el-col:not(:last-child) {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-title {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="app" v-cloak>
|
<div id="app" v-cloak>
|
||||||
<guava ref="guava">
|
<guava ref="guava">
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<el-card shadow="never">
|
<search @search="doSearch">
|
||||||
<search @search="doSearch">
|
<search-item label="年度:">
|
||||||
<search-item label="年度:">
|
<el-date-picker
|
||||||
<el-date-picker
|
placeholder="选择年度"
|
||||||
placeholder="选择年度"
|
type="year"
|
||||||
type="year"
|
style="width: 100%"
|
||||||
style="width: 100%"
|
v-model="pageForm.year"
|
||||||
v-model="pageForm.year"
|
value-format="yyyy"
|
||||||
value-format="yyyy"
|
@change="doSearch"
|
||||||
@change="doSearch"
|
></el-date-picker>
|
||||||
></el-date-picker>
|
</search-item>
|
||||||
</search-item>
|
<search-item label="活动状态:">
|
||||||
<search-item label="活动状态:">
|
<el-select v-model="pageForm.activityType" @change="doSearch" style="width: 100%"
|
||||||
<el-radio-group v-model="pageForm.activityType" @change="doSearch">
|
placeholder="请选择活动状态" filterable>
|
||||||
<el-radio-button :label="1">全部</el-radio-button>
|
<el-option :value="1" label="全部"></el-option>
|
||||||
<el-radio-button :label="2">报名中</el-radio-button>
|
<el-option :value="4" label="即将开始"></el-option>
|
||||||
<el-radio-button :label="3">已结束</el-radio-button>
|
<el-option :value="2" label="报名中"></el-option>
|
||||||
</el-radio-group>
|
<el-option :value="3" label="已结束"></el-option>
|
||||||
</search-item>
|
</el-select>
|
||||||
</search>
|
</search-item>
|
||||||
</el-card>
|
</search>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="mt10" shadow="never">
|
<el-card class="mt10" shadow="never">
|
||||||
@@ -58,8 +106,9 @@ layout("/layouts/platform.html"){
|
|||||||
<span>{{$moment(row.activityEndTime).format('MM/DD HH:mm')}}</span>
|
<span>{{$moment(row.activityEndTime).format('MM/DD HH:mm')}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="100">
|
<el-table-column label="操作" width="300">
|
||||||
<template v-slot="{row}">
|
<template v-slot="{row}">
|
||||||
|
<el-button @click="onView(row)" size="mini" type="primary">查看介绍</el-button>
|
||||||
<el-button @click="onOpen(row)" size="mini" type="primary">去报名</el-button>
|
<el-button @click="onOpen(row)" size="mini" type="primary">去报名</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -68,24 +117,50 @@ layout("/layouts/platform.html"){
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<template #view>
|
<template #view>
|
||||||
<info ref="infoRef"></info>
|
<course-list ref="courseListRef"></course-list>
|
||||||
</template>
|
</template>
|
||||||
</guava>
|
</guava>
|
||||||
|
|
||||||
|
<el-dialog title="详细信息" :visible.sync="infoVisible" width="60%" class="info-dialog">
|
||||||
|
|
||||||
|
<activity-info ref="infoRef"></activity-info>
|
||||||
|
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-statistic
|
||||||
|
v-if="time < 0"
|
||||||
|
format="DD 天 HH 时 mm 分钟 ss 秒"
|
||||||
|
:value="new Date(infoRow.activitySignUpStartTime)"
|
||||||
|
time-indices
|
||||||
|
title="距离开始:"
|
||||||
|
@finish="time = 0"
|
||||||
|
>
|
||||||
|
</el-statistic>
|
||||||
|
<template v-else>
|
||||||
|
<el-button @click="infoVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="onOpen(infoRow)" :disabled="time < 0">
|
||||||
|
去报名
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
<!--#include('info.js'){}#-->
|
<!--#include('courseList.js'){}#-->
|
||||||
|
<!--#include('../manage/info.js'){}#-->
|
||||||
new Vue({
|
new Vue({
|
||||||
el: "#app",
|
el: "#app",
|
||||||
mixins: [initTableMixins],
|
mixins: [initTableMixins],
|
||||||
components: {
|
components: {
|
||||||
"info": info,
|
"course-list": courseList,
|
||||||
|
"activity-info": info,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pageForm: {
|
pageForm: {
|
||||||
year: this.$moment().format("YYYY"),
|
year: this.$moment().format("YYYY"),
|
||||||
activityType: "2"
|
activityType: 4
|
||||||
},
|
},
|
||||||
tableColumns: [
|
tableColumns: [
|
||||||
{ label: "活动名称", prop: "activityName", width: 600},
|
{ label: "活动名称", prop: "activityName", width: 600},
|
||||||
@@ -93,16 +168,32 @@ layout("/layouts/platform.html"){
|
|||||||
{ label: "报名时间", prop: "activitySignUpStartTime"},
|
{ label: "报名时间", prop: "activitySignUpStartTime"},
|
||||||
{ label: "活动时间", prop: "activityStartTime"},
|
{ label: "活动时间", prop: "activityStartTime"},
|
||||||
],
|
],
|
||||||
|
time: 0,
|
||||||
|
infoRow: {},
|
||||||
|
infoVisible: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onView(row) {
|
||||||
|
this.infoRow = row
|
||||||
|
this.time = this.$moment().diff(this.$moment(row.activitySignUpStartTime), 'milliseconds')
|
||||||
|
this.infoVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.infoRef.initData(row.id)
|
||||||
|
})
|
||||||
|
},
|
||||||
onOpen(row) {
|
onOpen(row) {
|
||||||
|
if(this.$moment().isBefore(this.$moment(row.activitySignUpStartTime))) {
|
||||||
|
this.onView(row)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.infoVisible = false
|
||||||
this.$refs.guava.view(() => {
|
this.$refs.guava.view(() => {
|
||||||
this.$refs.infoRef.onOpen(row)
|
this.$refs.courseListRef.onOpen(row)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
pageData() {
|
pageData() {
|
||||||
this.$axios.post("/platform/family/manage/apply/activityData", this.pageForm).then((res) => {
|
this.$axios.post("/platform/family/apply/activityPageData", this.pageForm).then((res) => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.tableData = res.data.list
|
this.tableData = res.data.list
|
||||||
this.pageForm.totalCount = res.data.totalCount
|
this.pageForm.totalCount = res.data.totalCount
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const signForm = {
|
|||||||
style="display: flex; justify-content: space-between; align-items: center">
|
style="display: flex; justify-content: space-between; align-items: center">
|
||||||
<div>家属信息</div>
|
<div>家属信息</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" size="mini" @click="delFamily">
|
<el-button type="danger" size="mini" @click="delFamily">
|
||||||
删除家属
|
删除家属
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" size="mini" @click="addFamily">
|
<el-button type="primary" size="mini" @click="addFamily">
|
||||||
@@ -76,28 +76,28 @@ const signForm = {
|
|||||||
:name="index + ''"
|
:name="index + ''"
|
||||||
:label="'家属' + (index + 1)"
|
:label="'家属' + (index + 1)"
|
||||||
:key="index">
|
:key="index">
|
||||||
<el-row>
|
<el-row class="mt20">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-for="(column, index) in item"
|
v-for="(column, index) in item"
|
||||||
:label="column.columnName"
|
:label="column.columnName"
|
||||||
:key="column.columnCode"
|
:key="column.columnCode"
|
||||||
:rules="{ required: column.isRequired,
|
:rules="{ required: column.isRequired,
|
||||||
message: (['SELECT', 'FILE'].includes(column.columnFormType) ? '请选择' : '请填写') + column.columnName,
|
message: (['SELECT', 'FILE'].includes(column.columnFormType) ? '请选择' : '请填写') + column.columnName,
|
||||||
trigger: 'blur'}"
|
trigger: 'blur'}"
|
||||||
>
|
>
|
||||||
<!--文本框-->
|
<!--文本框-->
|
||||||
<template
|
<template
|
||||||
v-if="!['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
|
v-if="!['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="column.columnValue"
|
v-model="column.columnValue"
|
||||||
:placeholder="'请填写' + column.columnName"
|
:placeholder="'请填写' + column.columnName"
|
||||||
:type="['INT'].includes(column.columnType) ? 'number' : ''"
|
:type="['INT'].includes(column.columnType) ? 'number' : ''"
|
||||||
></el-input>
|
></el-input>
|
||||||
</template>
|
</template>
|
||||||
<!--选择框-->
|
<!--选择框-->
|
||||||
<template
|
<template
|
||||||
v-else-if="['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
|
v-else-if="['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
|
||||||
<el-select v-model="column.columnValue"
|
<el-select v-model="column.columnValue"
|
||||||
:placeholder="'请选择' + column.columnName"
|
:placeholder="'请选择' + column.columnName"
|
||||||
style="width: 100%">
|
style="width: 100%">
|
||||||
@@ -108,11 +108,11 @@ const signForm = {
|
|||||||
<!--时间框-->
|
<!--时间框-->
|
||||||
<template v-else-if="['DATE', 'DATETIME'].includes(column.columnType)">
|
<template v-else-if="['DATE', 'DATETIME'].includes(column.columnType)">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
v-model="column.columnValue"
|
v-model="column.columnValue"
|
||||||
:type="column.columnType === 'DATE' ? 'date' : 'datetime'"
|
:type="column.columnType === 'DATE' ? 'date' : 'datetime'"
|
||||||
:placeholder="'请选择' + column.columnName"
|
:placeholder="'请选择' + column.columnName"
|
||||||
:value-format="column.columnType === 'DATE' ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss'"
|
:value-format="column.columnType === 'DATE' ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss'"
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</template>
|
</template>
|
||||||
<!--文件-->
|
<!--文件-->
|
||||||
@@ -154,12 +154,14 @@ const signForm = {
|
|||||||
courseTypeRow: {},
|
courseTypeRow: {},
|
||||||
courseTimeSelectList: [],
|
courseTimeSelectList: [],
|
||||||
active: '',
|
active: '',
|
||||||
|
|
||||||
|
activity: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addFamily() {
|
addFamily() {
|
||||||
if(this.formData.mobileColumnsValue.length >= this.courseTypeRow.familyMaxCount) {
|
if(this.formData.mobileColumnsValue.length >= this.activity.familyMaxCount) {
|
||||||
this.$message.warning('家属最多人数为' + this.courseTypeRow.familyMaxCount)
|
this.$message.warning('家属最多人数为' + this.activity.familyMaxCount)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const list = clone(this.courseTypeRow.familyMobileSignColumnList)
|
const list = clone(this.courseTypeRow.familyMobileSignColumnList)
|
||||||
@@ -170,53 +172,47 @@ const signForm = {
|
|||||||
const ac = (Number(this.active) - 1)
|
const ac = (Number(this.active) - 1)
|
||||||
this.active = '' + (ac >= 0 ? ac : 0)
|
this.active = '' + (ac >= 0 ? ac : 0)
|
||||||
},
|
},
|
||||||
validFamilyForm() {
|
|
||||||
for (let i = 0; i < this.formData.mobileColumnsValue.length; i++) {
|
|
||||||
const family = this.formData.mobileColumnsValue[i]
|
|
||||||
for (const familyColumn of family) {
|
|
||||||
if(familyColumn.isRequired && !familyColumn.columnValue) {
|
|
||||||
this.$message.error('家属' + (i + 1) + '的' + familyColumn.columnName + '不能为空')
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
async validSignUp() {
|
async validSignUp() {
|
||||||
//获取家属是多少人
|
//获取家属是多少人
|
||||||
const res = await this.$axios.post("/platform/mobile/familyActivity/validateSignUp", {
|
const res = await this.$axios.post("/platform/family/apply/validateSignUp", {
|
||||||
courseId: this.formData.courseId,
|
courseId: this.formData.courseId,
|
||||||
currentFamilyNumber: this.formData.mobileColumnsValue.length || 0
|
currentFamilyNumber: this.formData.mobileColumnsValue.length || 0
|
||||||
})
|
})
|
||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
this.$message.warning(res.msg)
|
this.$alert(res.msg, "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
type: "warning"
|
||||||
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
async validateSourceSignUp() {
|
async validateSourceSignUp() {
|
||||||
if (this.courseRow.courseIsLimitApply) {
|
if (this.courseRow.courseIsLimitApply) {
|
||||||
const resp = await $.post('/platform/mobile/familyActivity/validateSourceSignUp', {
|
const resp = await $.post('/platform/family/apply/validateSourceSignUp', {
|
||||||
activityCourseId: this.formData.activityCourseId,
|
activityCourseId: this.formData.activityCourseId,
|
||||||
courseId: this.courseRow.id
|
courseId: this.courseRow.id
|
||||||
})
|
})
|
||||||
if (resp.code !== 0) {
|
if (resp.code !== 0) {
|
||||||
this.$message.warning(resp.msg)
|
this.$alert(resp.msg, "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
type: "warning"
|
||||||
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
async getCourseTimeSelectList(o) {
|
async getCourseTimeSelectList(o) {
|
||||||
const resp = await $.post('/platform/mobile/familyActivity/getCourseTimeSelectList', {courseId: o.id})
|
const resp = await $.post('/platform/family/apply/getCourseTimeSelectList', {courseId: o.id})
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
this.courseTimeSelectList = resp.data
|
this.courseTimeSelectList = resp.data
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning('获取时段信息失败,请联系管理员')
|
this.$message.warning('获取时段信息失败,请联系管理员')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async onOpen(row, courseType) {
|
async onOpen(row, courseType, activity) {
|
||||||
this.initData(row, courseType)
|
this.initData(row, courseType, activity)
|
||||||
if (row.courseIsLimitApply) {
|
if (row.courseIsLimitApply) {
|
||||||
await this.getCourseTimeSelectList(row)
|
await this.getCourseTimeSelectList(row)
|
||||||
}
|
}
|
||||||
@@ -229,6 +225,135 @@ const signForm = {
|
|||||||
this.courseTypeRow = courseType
|
this.courseTypeRow = courseType
|
||||||
this.signDialog = true
|
this.signDialog = true
|
||||||
},
|
},
|
||||||
|
validateIdCard(idCard) {
|
||||||
|
if (!idCard) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 18位身份证号码校验
|
||||||
|
if (idCard.length === 18) {
|
||||||
|
const idCardRegex = /^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}(\d|[Xx])$/
|
||||||
|
if (!idCardRegex.test(idCard)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验码计算
|
||||||
|
const weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
|
||||||
|
const checksums = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"]
|
||||||
|
let sum = 0
|
||||||
|
for (let i = 0; i < 17; i++) {
|
||||||
|
sum += idCard[i] * weights[i]
|
||||||
|
}
|
||||||
|
const checksum = checksums[sum % 11]
|
||||||
|
return checksum === idCard[17].toUpperCase()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 15位身份证号码校验
|
||||||
|
else if (idCard.length === 15) {
|
||||||
|
const idCardRegex = /^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/
|
||||||
|
return idCardRegex.test(idCard)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 外国人或其他情况
|
||||||
|
else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validFamilyForm() {
|
||||||
|
// 校验规则映射
|
||||||
|
const validators = {
|
||||||
|
idCard: (value) => this.validateIdCard(value),
|
||||||
|
mobile: (value) => /^1[3-9]\d{9}$/.test(value),
|
||||||
|
email: (value) => /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(value)
|
||||||
|
};
|
||||||
|
// 显示提示弹窗(直接传完整的 message)
|
||||||
|
const showAlert = (message) => {
|
||||||
|
this.$alert(message, "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
type: "warning"
|
||||||
|
})
|
||||||
|
};
|
||||||
|
const { mobileColumnsValue } = this.formData;
|
||||||
|
for (let i = 0; i < mobileColumnsValue.length; i++) {
|
||||||
|
const family = mobileColumnsValue[i];
|
||||||
|
for (const col of family) {
|
||||||
|
const value = col.columnValue?.trim(); // 安全处理空值和空格
|
||||||
|
// 必填校验
|
||||||
|
if (col.isRequired && !value) {
|
||||||
|
const message = this.activity.keyWord + (i + 1) + '的' + col.columnName + '不能为空';
|
||||||
|
showAlert(message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 格式校验
|
||||||
|
if (col.validRule && value) {
|
||||||
|
const validator = validators[col.validRule];
|
||||||
|
if (validator && !validator(value)) {
|
||||||
|
const message = this.activity.keyWord + (i + 1) + '的' + col.columnName + '格式不正确';
|
||||||
|
showAlert(message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(col.validRule === 'idCard' && this.courseRow.familyAgeLimit) {
|
||||||
|
const parseCard = this.parseIdCard(value)
|
||||||
|
if(this.courseRow.minAge && parseCard.age < this.courseRow.minAge) {
|
||||||
|
const message = '限制报名最小年龄为' + this.courseRow.minAge;
|
||||||
|
showAlert(message);
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
if(this.courseRow.maxAge && parseCard.age > this.courseRow.maxAge) {
|
||||||
|
const message = '限制报名最大年龄为' + this.courseRow.maxAge;
|
||||||
|
showAlert(message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(col.validRule === 'idCard' && this.courseRow.familySexLimit) {
|
||||||
|
const parseCard = this.parseIdCard(value)
|
||||||
|
if(this.courseRow.familySex && parseCard.sex !== this.courseRow.familySex) {
|
||||||
|
const message = '限制报名性别为' + this.courseRow.familySex;
|
||||||
|
showAlert(message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
parseIdCard(idCard) {
|
||||||
|
if (!idCard || (idCard.length !== 18 && idCard.length !== 15)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
let birthStr = '';
|
||||||
|
let sexCode = '';
|
||||||
|
|
||||||
|
if (idCard.length === 15) {
|
||||||
|
birthStr = '19' + idCard.substring(6, 12);
|
||||||
|
sexCode = idCard.substring(14, 15); // 15位:第15位是性别
|
||||||
|
} else {
|
||||||
|
birthStr = idCard.substring(6, 14);
|
||||||
|
sexCode = idCard.substring(16, 17); // 18位:第17位是性别
|
||||||
|
}
|
||||||
|
|
||||||
|
const birthYear = parseInt(birthStr.substring(0, 4), 10);
|
||||||
|
const birthMonth = parseInt(birthStr.substring(4, 6), 10) - 1;
|
||||||
|
const birthDay = parseInt(birthStr.substring(6, 8), 10);
|
||||||
|
|
||||||
|
const birthDate = new Date(birthYear, birthMonth, birthDay);
|
||||||
|
const today = new Date();
|
||||||
|
|
||||||
|
let age = today.getFullYear() - birthDate.getFullYear();
|
||||||
|
const monthDiff = today.getMonth() - birthDate.getMonth();
|
||||||
|
const dayDiff = today.getDate() - birthDate.getDate();
|
||||||
|
|
||||||
|
if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
|
||||||
|
age--;
|
||||||
|
}
|
||||||
|
|
||||||
|
const sex = parseInt(sexCode, 10) % 2 === 1 ? '男' : '女';
|
||||||
|
|
||||||
|
return { age, sex, };
|
||||||
|
},
|
||||||
async onSubmit() {
|
async onSubmit() {
|
||||||
//验证家属表单
|
//验证家属表单
|
||||||
if (!this.validFamilyForm()) return
|
if (!this.validFamilyForm()) return
|
||||||
@@ -241,8 +366,9 @@ const signForm = {
|
|||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning"
|
type: "warning"
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
|
const formData = clone(this.formData)
|
||||||
let array = []
|
let array = []
|
||||||
this.formData.mobileColumnsValue.forEach(item => {
|
formData.mobileColumnsValue.forEach(item => {
|
||||||
const o = item.map((v) => {
|
const o = item.map((v) => {
|
||||||
return {
|
return {
|
||||||
columnName: v.columnName,
|
columnName: v.columnName,
|
||||||
@@ -253,11 +379,14 @@ const signForm = {
|
|||||||
})
|
})
|
||||||
array.push(o)
|
array.push(o)
|
||||||
})
|
})
|
||||||
this.formData.mobileColumnsValue = JSON.stringify(clone(array))
|
formData.mobileColumnsValue = JSON.stringify(clone(array))
|
||||||
const resp = await this.$axios.post("/platform/mobile/familyActivity/doSignUp", this.formData)
|
const resp = await this.$axios.post("/platform/family/apply/doSignUp", formData)
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
|
this.$alert(resp.msg, "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
type: "warning"
|
||||||
|
})
|
||||||
this.signDialog = false
|
this.signDialog = false
|
||||||
this.$message.success(resp.msg)
|
|
||||||
this.$emit('refresh')
|
this.$emit('refresh')
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(resp.msg)
|
this.$message.warning(resp.msg)
|
||||||
@@ -266,7 +395,8 @@ const signForm = {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
initData(row, courseType) {
|
initData(row, courseType, activity) {
|
||||||
|
this.activity = activity
|
||||||
this.formData = {
|
this.formData = {
|
||||||
activityId: row.activityId,
|
activityId: row.activityId,
|
||||||
courseId: row.id,
|
courseId: row.id,
|
||||||
@@ -284,7 +414,7 @@ const signForm = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
style: /*language=CSS*/ `
|
style: /*language=CSS*/ `
|
||||||
.el-tabs__header {
|
::v-deep .el-tabs__header {
|
||||||
margin: 0 0 15px !important;
|
margin: 0 0 15px !important;
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
@@ -41,28 +41,28 @@ const basicForm = {
|
|||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item :rules="{required:true,message: '请选择活动时间', trigger: 'blur'}" label="活动时间" prop="activityTime">
|
<el-form-item :rules="{required:true,message: '请选择活动时间', trigger: 'blur'}" label="活动时间" prop="activityTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
:picker-options="pickerOptions"
|
:picker-options="pickerOptions"
|
||||||
end-placeholder="请选择活动结束日期"
|
end-placeholder="请选择活动结束日期"
|
||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="请选择活动开始日期"
|
start-placeholder="请选择活动开始日期"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
type="datetimerange"
|
type="datetimerange"
|
||||||
v-model="formData.activityTime"
|
v-model="formData.activityTime"
|
||||||
value-format="yyyy-MM-dd HH:mm"
|
value-format="yyyy-MM-dd HH:mm"
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item :rules="{required:true,message: '请选择报名时间', trigger: 'blur'}" label="报名时间" prop="activitySignTime">
|
<el-form-item :rules="{required:true,message: '请选择报名时间', trigger: 'blur'}" label="报名时间" prop="activitySignTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
:disabled="false"
|
:disabled="false"
|
||||||
end-placeholder="请选择报名结束日期"
|
end-placeholder="请选择报名结束日期"
|
||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="请选择报名开始日期"
|
start-placeholder="请选择报名开始日期"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
type="datetimerange"
|
type="datetimerange"
|
||||||
v-model="formData.activitySignTime"
|
v-model="formData.activitySignTime"
|
||||||
value-format="yyyy-MM-dd HH:mm"
|
value-format="yyyy-MM-dd HH:mm"
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -73,18 +73,18 @@ const basicForm = {
|
|||||||
<div style="display: flex; justify-content: space-between">
|
<div style="display: flex; justify-content: space-between">
|
||||||
<div style="width: 99%">
|
<div style="width: 99%">
|
||||||
<el-select
|
<el-select
|
||||||
@change="changeActivity"
|
@change="changeActivity"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
placeholder="请选择可报名人员范围"
|
placeholder="请选择可报名人员范围"
|
||||||
style="width: 99%"
|
style="width: 99%"
|
||||||
v-model="formData.activityGroupId"
|
v-model="formData.activityGroupId"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
:key="item.groupId"
|
:key="item.groupId"
|
||||||
:label="item.groupName"
|
:label="item.groupName"
|
||||||
:value="item.groupId"
|
:value="item.groupId"
|
||||||
v-for="item in activityGroupList"
|
v-for="item in activityGroupList"
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
@@ -102,29 +102,41 @@ const basicForm = {
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row :gutter="20" type="flex">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item :rules="{required:true,message: '请输入关键词', trigger: 'blur'}" label="关键词" prop="keyWord">
|
||||||
|
<el-input maxlength="50" v-model="formData.keyWord" placeholder="请输入关键词"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item :rules="{required:true,message: '请输入家属最多数', trigger: 'blur'}" label="家属最多数" prop="familyMaxCount">
|
||||||
|
<el-input maxlength="50" v-model="formData.familyMaxCount" placeholder="请输入家属最多数" type="number"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
<el-form-item :rules="{required:true,message: '请输入活动介绍', trigger: 'blur'}" label="活动介绍" prop="introduce">
|
<el-form-item :rules="{required:true,message: '请输入活动介绍', trigger: 'blur'}" label="活动介绍" prop="introduce">
|
||||||
<text-editor v-model="formData.introduce"></text-editor>
|
<text-editor v-model="formData.introduce"></text-editor>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="封面图片" prop="cover" :rules="{required:true,message: '请上传活动移动端封面图片', trigger: 'blur'}">
|
<el-form-item label="封面图片" prop="cover" :rules="{required:true,message: '请上传活动移动端封面图片', trigger: 'blur'}">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<file-upload
|
<file-upload
|
||||||
:upload_number="1"
|
:upload_number="1"
|
||||||
:value.sync="formData.cover"
|
:value.sync="formData.cover"
|
||||||
accept=".jpg,.jpeg,.png"
|
accept=".jpg,.jpeg,.png"
|
||||||
complete_result
|
complete_result
|
||||||
upload_mode="image"
|
upload_mode="image"
|
||||||
upload_result_category="interval"
|
upload_result_category="interval"
|
||||||
></file-upload>
|
></file-upload>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="微信群二维码" prop="wechat">
|
<el-form-item label="微信群二维码" prop="wechat">
|
||||||
<file-upload
|
<file-upload
|
||||||
:upload_number="1"
|
:upload_number="1"
|
||||||
:value.sync="formData.wechat"
|
:value.sync="formData.wechat"
|
||||||
accept=".jpg,.jpeg,.png"
|
accept=".jpg,.jpeg,.png"
|
||||||
complete_result
|
complete_result
|
||||||
upload_mode="image"
|
upload_mode="image"
|
||||||
upload_result_category="interval"
|
upload_result_category="interval"
|
||||||
></file-upload>
|
></file-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -141,17 +153,17 @@ const basicForm = {
|
|||||||
<el-table-column label="序号" prop="orderNum" width="100px">
|
<el-table-column label="序号" prop="orderNum" width="100px">
|
||||||
<template v-slot="{row}">
|
<template v-slot="{row}">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="row.orderNum"
|
v-model="row.orderNum"
|
||||||
@change="courseOrderNumChange"
|
@change="courseOrderNumChange"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="formData.courseList.length"
|
:max="formData.courseList.length"
|
||||||
:step="1"
|
:step="1"
|
||||||
step-strictly
|
step-strictly
|
||||||
:precision="0"
|
:precision="0"
|
||||||
controls-position="right"
|
controls-position="right"
|
||||||
style="width: 76px"
|
style="width: 76px"
|
||||||
size="small"
|
size="small"
|
||||||
label="序号"
|
label="序号"
|
||||||
></el-input-number>
|
></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -173,32 +185,32 @@ const basicForm = {
|
|||||||
<el-table-column :label="activityType + '人数'" prop="coursePeopleNumber" width="110px">
|
<el-table-column :label="activityType + '人数'" prop="coursePeopleNumber" width="110px">
|
||||||
<template v-slot="{row}">
|
<template v-slot="{row}">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
:controls="false"
|
:controls="false"
|
||||||
:max="9999"
|
:max="9999"
|
||||||
size="small"
|
size="small"
|
||||||
:min="0"
|
:min="0"
|
||||||
:precision="0"
|
:precision="0"
|
||||||
step-strictly
|
step-strictly
|
||||||
style="max-width: 80px"
|
style="max-width: 80px"
|
||||||
@change="(c, o) => validNumber(row, null)"
|
@change="(c, o) => validNumber(row, null)"
|
||||||
v-model="row.coursePeopleNumber"
|
v-model="row.coursePeopleNumber"
|
||||||
placeholder="请输入人数"
|
placeholder="请输入人数"
|
||||||
></el-input-number>
|
></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="预留名额" prop="courseReservedNumber" width="110px">
|
<el-table-column label="预留名额" prop="courseReservedNumber" width="110px">
|
||||||
<template v-slot="{row}">
|
<template v-slot="{row}">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
:controls="false"
|
:controls="false"
|
||||||
:max="1000"
|
:max="1000"
|
||||||
:min="0"
|
:min="0"
|
||||||
size="small"
|
size="small"
|
||||||
:precision="0"
|
:precision="0"
|
||||||
step-strictly
|
step-strictly
|
||||||
style="max-width: 80px"
|
style="max-width: 80px"
|
||||||
@change="(c, o) => validNumber(row, o)"
|
@change="(c, o) => validNumber(row, o)"
|
||||||
v-model="row.courseReservedNumber"
|
v-model="row.courseReservedNumber"
|
||||||
placeholder="请输入预留名额"
|
placeholder="请输入预留名额"
|
||||||
></el-input-number>
|
></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -265,6 +277,13 @@ const basicForm = {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<div class="left-span-label" style="margin-top: 20px">判断家属数量唯一标识</div>
|
||||||
|
<el-form-item label="唯一标识" prop="onlyKey">
|
||||||
|
<el-select @focus="keyFocus" v-model="formData.onlyKey" placeholder="请选择唯一标识">
|
||||||
|
<el-option v-for="item in typeArray" :key="item.columnCode" :label="item.columnName" :value="item.columnCode"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div style="float: right; margin: 20px 0">
|
<div style="float: right; margin: 20px 0">
|
||||||
@@ -292,12 +311,12 @@ const basicForm = {
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<drawer-user-scope
|
<drawer-user-scope
|
||||||
@group_change="getActivityGroup"
|
@group_change="getActivityGroup"
|
||||||
ref="drawerUserScope"
|
ref="drawerUserScope"
|
||||||
:group_id.sync="formData.activityGroupId">
|
:group_id.sync="formData.activityGroupId">
|
||||||
</drawer-user-scope>
|
</drawer-user-scope>
|
||||||
|
|
||||||
<course-time ref="courseTimeRef"></course-time>
|
<course-time ref="courseTimeRef"></course-time>
|
||||||
<custom-form ref="customFormRef"></custom-form>
|
<custom-form ref="customFormRef"></custom-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -310,7 +329,17 @@ const basicForm = {
|
|||||||
formData: {
|
formData: {
|
||||||
notice: false,
|
notice: false,
|
||||||
courseList: [
|
courseList: [
|
||||||
{ orderNum: 1, courseName: "", courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false },
|
{
|
||||||
|
orderNum: 1,
|
||||||
|
courseName: "",
|
||||||
|
courseTimeList: [],
|
||||||
|
isMobileSign: false,
|
||||||
|
isReceiveGift: false,
|
||||||
|
reserveMode: 1,
|
||||||
|
courseIsLimitApply: false,
|
||||||
|
familyAgeLimit: false,
|
||||||
|
familySexLimit: false,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
conditionStructure: {
|
conditionStructure: {
|
||||||
method: "AND",
|
method: "AND",
|
||||||
@@ -318,7 +347,8 @@ const basicForm = {
|
|||||||
},
|
},
|
||||||
restrictLimit: 1,
|
restrictLimit: 1,
|
||||||
limitNum: 1,
|
limitNum: 1,
|
||||||
typeLimits: []
|
typeLimits: [],
|
||||||
|
keyWord: '家属'
|
||||||
},
|
},
|
||||||
historicalActList: [],
|
historicalActList: [],
|
||||||
trainTypeList: [],
|
trainTypeList: [],
|
||||||
@@ -331,6 +361,8 @@ const basicForm = {
|
|||||||
},
|
},
|
||||||
campusList: [],
|
campusList: [],
|
||||||
courseTypeList: [],
|
courseTypeList: [],
|
||||||
|
|
||||||
|
typeArray: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -339,6 +371,28 @@ const basicForm = {
|
|||||||
"custom-form": customForm,
|
"custom-form": customForm,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
keyFocus() {
|
||||||
|
const types = this.formData.courseList.filter(o => o.courseType !== undefined).map(o => o.courseType)
|
||||||
|
if(types.length === 0) {
|
||||||
|
this.$message.warning('请先设置' + this.activityType + '类型')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const typeList = this.courseTypeList.filter(o => types.includes(o.id))
|
||||||
|
let array = []
|
||||||
|
typeList.forEach(item => {
|
||||||
|
array = array.concat(item.familyMobileSignColumnList)
|
||||||
|
})
|
||||||
|
// 根据 columnCode 去重
|
||||||
|
const uniqueMap = new Map()
|
||||||
|
array.forEach(item => {
|
||||||
|
if (item.columnCode) {
|
||||||
|
uniqueMap.set(item.columnCode, item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// 可选:保留没有 columnCode 的项
|
||||||
|
const withoutCode = array.filter(item => !item.columnCode)
|
||||||
|
this.typeArray = [...uniqueMap.values(), ...withoutCode]
|
||||||
|
},
|
||||||
async validNumber(row, old) {
|
async validNumber(row, old) {
|
||||||
if (GetQueryString("id") === "") {
|
if (GetQueryString("id") === "") {
|
||||||
if (row.courseReservedNumber > row.coursePeopleNumber && row.reserveMode === 1) {
|
if (row.courseReservedNumber > row.coursePeopleNumber && row.reserveMode === 1) {
|
||||||
@@ -371,7 +425,7 @@ const basicForm = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getRegisterUserCount(courseId) {
|
async getRegisterUserCount(courseId) {
|
||||||
const resp = await this.$axios.post("/platform/family/manage/activity/getRegisterUserCount", { courseId })
|
const resp = await this.$axios.post("/platform/family/manage/getRegisterUserCount", { courseId })
|
||||||
return resp.code === 0 ? resp.data : 0
|
return resp.code === 0 ? resp.data : 0
|
||||||
},
|
},
|
||||||
courseTypeChange(val, row) {
|
courseTypeChange(val, row) {
|
||||||
@@ -444,7 +498,7 @@ const basicForm = {
|
|||||||
this.formData.courseList.push({ courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false })
|
this.formData.courseList.push({ courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false })
|
||||||
},
|
},
|
||||||
async historicalActChange(val) {
|
async historicalActChange(val) {
|
||||||
const resp = await this.$axios.post("/platform/family/manage/activity/findOne", {id: val})
|
const resp = await this.$axios.post("/platform/family/manage/findOne", {id: val})
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
this.formData = resp.data
|
this.formData = resp.data
|
||||||
this.typeChange(this.formData.trainType)
|
this.typeChange(this.formData.trainType)
|
||||||
@@ -468,7 +522,7 @@ const basicForm = {
|
|||||||
return data
|
return data
|
||||||
},
|
},
|
||||||
async getHistoricalActList() {
|
async getHistoricalActList() {
|
||||||
const resp = await this.$axios.post("/platform/family/manage/activity/getHistoricalActList", {})
|
const resp = await this.$axios.post("/platform/family/manage/getHistoricalActList", {})
|
||||||
return resp.data
|
return resp.data
|
||||||
},
|
},
|
||||||
async onSave() {
|
async onSave() {
|
||||||
@@ -508,6 +562,18 @@ const basicForm = {
|
|||||||
this.$message.warning("第" + (i + 1) + "行签到方式填写有误,请核查")
|
this.$message.warning("第" + (i + 1) + "行签到方式填写有误,请核查")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if(v.familyAgeLimit === true && !v.minAge) {
|
||||||
|
this.$message.warning("第" + (i + 1) + "行最小年龄不能为空,请核查")
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if(v.familyAgeLimit === true && !v.maxAge) {
|
||||||
|
this.$message.warning("第" + (i + 1) + "行最大年龄不能为空,请核查")
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if(v.familySexLimit === true && !v.familySex) {
|
||||||
|
this.$message.warning("第" + (i + 1) + "行性别不能为空,请核查")
|
||||||
|
return true
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
if (courseValid) return
|
if (courseValid) return
|
||||||
@@ -543,7 +609,7 @@ const basicForm = {
|
|||||||
type: "warning"
|
type: "warning"
|
||||||
})
|
})
|
||||||
if (confirm !== "confirm") return
|
if (confirm !== "confirm") return
|
||||||
const resp = await this.$axios.post("/platform/family/manage/activity/doHandle", cloneData)
|
const resp = await this.$axios.post("/platform/family/manage/doHandle", cloneData)
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
this.$message.success(resp.msg)
|
this.$message.success(resp.msg)
|
||||||
this.step = 1
|
this.step = 1
|
||||||
@@ -554,15 +620,16 @@ const basicForm = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getAllType() {
|
async getAllType() {
|
||||||
const resp = await this.$axios.post("/platform/family/manage/type/getAllType", {})
|
const resp = await this.$axios.post("/platform/family/type/getAllType", {})
|
||||||
return resp.data
|
return resp.data
|
||||||
},
|
},
|
||||||
async init(row) {
|
async init(row) {
|
||||||
if (row && row.id) {
|
if (row && row.id) {
|
||||||
const resp = await this.$axios.post("/platform/family/manage/activity/findOne", {id: row.id})
|
const resp = await this.$axios.post("/platform/family/manage/findOne", {id: row.id})
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
this.formData = resp.data
|
this.formData = resp.data
|
||||||
this.typeChange(this.formData.trainType)
|
this.typeChange(this.formData.trainType)
|
||||||
|
if(this.formData.onlyKey) this.keyFocus()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -588,6 +655,6 @@ const basicForm = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
style: /*language=CSS*/ `
|
style: /*language=CSS*/ `
|
||||||
|
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,69 @@ const customForm = {
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
<el-row :gutter="50" type="flex">
|
||||||
|
<el-col :span="4">
|
||||||
|
<span>是否限制年龄</span>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="20">
|
||||||
|
<el-radio-group v-model="formData.courseList[moreInfoIndex].familyAgeLimit" size="small">
|
||||||
|
<el-radio border :label="true">限制</el-radio>
|
||||||
|
<el-radio border :label="false">不限制</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="50" type="flex" v-if="formData.courseList[moreInfoIndex].familyAgeLimit === true">
|
||||||
|
<el-col :span="4">
|
||||||
|
<span>最小年龄</span>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="20">
|
||||||
|
<el-input-number :controls="false" style="width: 100%"
|
||||||
|
:max="100"
|
||||||
|
:min="0"
|
||||||
|
:precision="0"
|
||||||
|
step-strictly
|
||||||
|
placeholder="请输入最小年龄"
|
||||||
|
v-model="formData.courseList[moreInfoIndex].minAge"></el-input-number>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="50" type="flex" v-if="formData.courseList[moreInfoIndex].familyAgeLimit === true">
|
||||||
|
<el-col :span="4">
|
||||||
|
<span>最大年龄</span>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="20">
|
||||||
|
<el-input-number :controls="false" style="width: 100%"
|
||||||
|
:max="100"
|
||||||
|
:min="0"
|
||||||
|
:precision="0"
|
||||||
|
step-strictly
|
||||||
|
placeholder="请输入最大年龄"
|
||||||
|
v-model="formData.courseList[moreInfoIndex].maxAge"></el-input-number>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="50" type="flex">
|
||||||
|
<el-col :span="4">
|
||||||
|
<span>是否限制性别</span>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="20">
|
||||||
|
<el-radio-group v-model="formData.courseList[moreInfoIndex].familySexLimit" size="small">
|
||||||
|
<el-radio border :label="true">限制</el-radio>
|
||||||
|
<el-radio border :label="false">不限制</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="50" type="flex" v-if="formData.courseList[moreInfoIndex].familySexLimit === true">
|
||||||
|
<el-col :span="4">
|
||||||
|
<span>限制性别</span>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="20">
|
||||||
|
<el-select v-model="formData.courseList[moreInfoIndex].familySex" placeholder="请选择性别"
|
||||||
|
style="width: 100%" clearable>
|
||||||
|
<el-option label="男" value="男"></el-option>
|
||||||
|
<el-option label="女" value="女"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="50" type="flex">
|
<el-row :gutter="50" type="flex">
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<span>是否签到</span>
|
<span>是否签到</span>
|
||||||
@@ -132,7 +195,7 @@ const customForm = {
|
|||||||
<span>候补数量</span>
|
<span>候补数量</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="20">
|
<el-col :span="20">
|
||||||
<el-input-number :controls="false" size="small" style="width: 100%"
|
<el-input-number :controls="false" style="width: 100%"
|
||||||
:max="100"
|
:max="100"
|
||||||
:min="0"
|
:min="0"
|
||||||
:precision="0"
|
:precision="0"
|
||||||
@@ -140,6 +203,16 @@ const customForm = {
|
|||||||
v-model="formData.courseList[moreInfoIndex].waitingNum"></el-input-number>
|
v-model="formData.courseList[moreInfoIndex].waitingNum"></el-input-number>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
<el-row :gutter="50" type="flex">
|
||||||
|
<el-col :span="4">
|
||||||
|
<span>详细信息</span>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="20">
|
||||||
|
<text-editor v-model="formData.courseList[moreInfoIndex].introduce"></text-editor>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<div style="text-align: right">
|
<div style="text-align: right">
|
||||||
<el-button @click="moreInfoDrawer = false">取 消</el-button>
|
<el-button @click="moreInfoDrawer = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="moreInfoDrawer = false">保 存</el-button>
|
<el-button type="primary" @click="moreInfoDrawer = false">保 存</el-button>
|
||||||
@@ -195,17 +268,6 @@ const customForm = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
style: /*language=CSS*/ `
|
style: /*language=CSS*/ `
|
||||||
.my-drawer .el-col-4 {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
.my-drawer .el-row {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.el-drawer__body {
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
.el-row--flex {
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,18 @@ layout("/layouts/platform.html"){
|
|||||||
#-->
|
#-->
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.my-drawer .el-col-4 {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
.my-drawer .el-row {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.el-drawer__body {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
.el-row--flex {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="app" v-cloak>
|
<div id="app" v-cloak>
|
||||||
@@ -164,8 +175,7 @@ layout("/layouts/platform.html"){
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
openActivityCode(id) {
|
openActivityCode(id) {
|
||||||
this.activityUrl = location.origin + "/platform/mobile/familyActivity/activityInfo?activityId="
|
this.activityUrl = location.origin + "/platform/family/apply/h5?id=" + id
|
||||||
+ id + '&isMySign=0'
|
|
||||||
this.codeDialogVisible = true
|
this.codeDialogVisible = true
|
||||||
},
|
},
|
||||||
makeCode(row) {
|
makeCode(row) {
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ const info = {
|
|||||||
<el-descriptions-item label="活动结束时间">{{viewData.activityEndTime}}</el-descriptions-item>
|
<el-descriptions-item label="活动结束时间">{{viewData.activityEndTime}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="报名开始时间">{{viewData.activitySignUpStartTime}}</el-descriptions-item>
|
<el-descriptions-item label="报名开始时间">{{viewData.activitySignUpStartTime}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="报名结束时间">{{viewData.activitySignUpEndTime}}</el-descriptions-item>
|
<el-descriptions-item label="报名结束时间">{{viewData.activitySignUpEndTime}}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="详细信息" :span="2">
|
||||||
|
<div v-html="viewData.introduce"></div>
|
||||||
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane :label="activityType + '信息'">
|
<el-tab-pane :label="activityType + '信息'">
|
||||||
@@ -66,7 +69,7 @@ const info = {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initData(id) {
|
initData(id) {
|
||||||
this.$axios.post(loc() + "/findOne", { id: id })
|
this.$axios.post("/platform/family/manage/findOne", { id: id })
|
||||||
.then((resp) => {
|
.then((resp) => {
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
this.viewData = resp.data
|
this.viewData = resp.data
|
||||||
@@ -104,7 +107,7 @@ const info = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
style: /*language=CSS*/ `
|
style: /*language=CSS*/ `
|
||||||
.el-button--text {
|
::v-deep .el-button--text {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
@@ -66,8 +66,10 @@ const makeQrcode = {
|
|||||||
this.courseDialog = true
|
this.courseDialog = true
|
||||||
},
|
},
|
||||||
makeCourseCode(row) {
|
makeCourseCode(row) {
|
||||||
const o = {courseId: row.id}
|
const url = '/platform/family/mine/drivingScan'
|
||||||
const content = jrQrcode.getQrBase64(JSON.stringify(o))
|
const data = url + '?courseId=' + row.id
|
||||||
|
console.log(data)
|
||||||
|
const content = jrQrcode.getQrBase64(data)
|
||||||
let image = new Image()
|
let image = new Image()
|
||||||
image.src = content
|
image.src = content
|
||||||
let viewer = new Viewer(image, {
|
let viewer = new Viewer(image, {
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ const unionForm = {
|
|||||||
!this.formData.courseList[this.unionLimitIndex].unionLimit ||
|
!this.formData.courseList[this.unionLimitIndex].unionLimit ||
|
||||||
this.formData.courseList[this.unionLimitIndex].unionLimit.length === 0
|
this.formData.courseList[this.unionLimitIndex].unionLimit.length === 0
|
||||||
) {
|
) {
|
||||||
const resp = await this.$axios.get("/platform/family/manage/activity/getUnionLimit", {
|
const resp = await this.$axios.get("/platform/family/manage/getUnionLimit", {
|
||||||
activityScopeId: this.formData.activityGroupId
|
activityScopeId: this.formData.activityGroupId
|
||||||
})
|
})
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
|
|||||||
@@ -73,6 +73,16 @@ const basicForm = {
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="验证规则" prop="validRule">
|
||||||
|
<template v-slot="{row}">
|
||||||
|
<el-select v-model="row.validRule" style="width: 100%" filterable placeholder="请选择验证规则" clearable>
|
||||||
|
<el-option label="身份证" value="idCard"></el-option>
|
||||||
|
<el-option label="手机号" value="mobile"></el-option>
|
||||||
|
<el-option label="邮箱" value="email"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="控件类型" prop="columnFormType">
|
<el-table-column label="控件类型" prop="columnFormType">
|
||||||
<template v-slot="{row, $index}">
|
<template v-slot="{row, $index}">
|
||||||
<el-select
|
<el-select
|
||||||
|
|||||||
@@ -213,10 +213,10 @@ const userInfo = {
|
|||||||
this.unitList = await this.$businessTool.listUnit(this.registerForm.unionId)
|
this.unitList = await this.$businessTool.listUnit(this.registerForm.unionId)
|
||||||
},
|
},
|
||||||
style: /*language=CSS*/ `
|
style: /*language=CSS*/ `
|
||||||
.adjustDialog .el-radio__label {
|
::v-deep .adjustDialog .el-radio__label {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.adjustDialog .el-dialog__body {
|
::v-deep .adjustDialog .el-dialog__body {
|
||||||
max-height: 600px;
|
max-height: 600px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ layout("/layouts/platform.html"){
|
|||||||
await this.doSearch()
|
await this.doSearch()
|
||||||
},
|
},
|
||||||
async getActivityList() {
|
async getActivityList() {
|
||||||
const resp = await this.$axios.post("/platform/family/statistics/activity/activityList", { year: this.pageForm.year })
|
const resp = await this.$axios.post("/platform/family/statistics/activityList", { year: this.pageForm.year })
|
||||||
this.activityList = resp.data
|
this.activityList = resp.data
|
||||||
if (this.activityList && this.activityList.length > 0) {
|
if (this.activityList && this.activityList.length > 0) {
|
||||||
this.pageForm.activityId = this.activityList[0].id
|
this.pageForm.activityId = this.activityList[0].id
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ const courseList = {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot="{row}" v-else-if="column.prop=='introduce'">
|
<template v-slot="{row}" v-else-if="column.prop=='introduce'">
|
||||||
<span v-if="!row.introduce">暂无</span>
|
<span v-if="!row.introduce?.trim()">暂无</span>
|
||||||
<el-button v-else style="padding: 0" @click="onPreview(row.introduce)" type="text">点击查看</el-button>
|
<el-button v-else style="padding: 0" @click="onPreview(row.introduce)" type="text">点击查看</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -107,6 +107,13 @@ const courseList = {
|
|||||||
<el-button @click="viewMapDialog = false">取 消</el-button>
|
<el-button @click="viewMapDialog = false">取 消</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog :visible.sync="infoVisible" title="详细信息" append-to-body>
|
||||||
|
<div v-html="introduce"></div>
|
||||||
|
<el-row class="mt20" justify="end" type="flex">
|
||||||
|
<el-button @click="infoVisible = false">取 消</el-button>
|
||||||
|
</el-row>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<apply-form ref="formRef" @refresh="doSearch"></apply-form>
|
<apply-form ref="formRef" @refresh="doSearch"></apply-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -128,29 +135,40 @@ const courseList = {
|
|||||||
tableColumns: [
|
tableColumns: [
|
||||||
{ prop: "courseName", label: "名称" },
|
{ prop: "courseName", label: "名称" },
|
||||||
{ prop: "typeName", label: "类型", width: 130},
|
{ prop: "typeName", label: "类型", width: 130},
|
||||||
|
{ prop: "campus", label: "校区", width: 160 },
|
||||||
{ prop: "courseLocationCoordinates", label: "地点", width: 200 },
|
{ prop: "courseLocationCoordinates", label: "地点", width: 200 },
|
||||||
{ prop: "courseInstructor", label: "联系人", width: 100 },
|
{ prop: "courseInstructor", label: "联系人", width: 100 },
|
||||||
{ prop: "introduce", label: "详细介绍", width: 100 },
|
{ prop: "courseTime", label: "时间", width: 160 },
|
||||||
{ prop: "courseTime", label: "时间", width: 200 },
|
{ prop: "introduce", label: "详细信息", width: 100 },
|
||||||
{ prop: "applyNum", label: "已报名人数", width: 200 }
|
{ prop: "applyNum", label: "已报名人数", width: 200 }
|
||||||
],
|
],
|
||||||
activity: {},
|
activity: {},
|
||||||
courseTypeList: [],
|
courseTypeList: [],
|
||||||
|
|
||||||
trainType: '',
|
trainType: '',
|
||||||
|
pdf: false,
|
||||||
|
infoVisible: false,
|
||||||
|
introduce: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async onPreview(introduce) {
|
async onPreview(introduce) {
|
||||||
const parser = new DOMParser();
|
try {
|
||||||
const doc = parser.parseFromString(introduce, 'text/html');
|
const parser = new DOMParser();
|
||||||
const link = doc.querySelector('a');
|
const doc = parser.parseFromString(introduce, 'text/html');
|
||||||
const href = link.getAttribute('href');
|
const link = doc.querySelector('a');
|
||||||
|
const href = link.getAttribute('href');
|
||||||
|
|
||||||
const id = href.substring(href.indexOf("=") + 1)
|
const id = href.substring(href.indexOf("=") + 1)
|
||||||
const res = await this.$axios.post("/platform/sys/file/previewFileData", { ids: JSON.stringify([id]) })
|
const res = await this.$axios.post("/platform/sys/file/previewFileData", { ids: JSON.stringify([id]) })
|
||||||
|
|
||||||
window.open("/assets/platform/plugins/pdfJs/web/viewer.html?file=" + encodeURIComponent(res.data[0].downloadPath), res.data[0].name)
|
this.pdf = true
|
||||||
|
window.open("/assets/platform/plugins/pdfJs/web/viewer.html?file=" + encodeURIComponent(res.data[0].downloadPath), res.data[0].name)
|
||||||
|
} catch (e) {
|
||||||
|
this.introduce = introduce
|
||||||
|
this.pdf = false
|
||||||
|
this.infoVisible = true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
tagClick(key, val) {
|
tagClick(key, val) {
|
||||||
let idx = this.pageForm[key].indexOf(val)
|
let idx = this.pageForm[key].indexOf(val)
|
||||||
|
|||||||
@@ -76,22 +76,22 @@ layout("/layouts/platform.html"){
|
|||||||
|
|
||||||
<activity-info ref="infoRef"></activity-info>
|
<activity-info ref="infoRef"></activity-info>
|
||||||
|
|
||||||
<el-statistic
|
|
||||||
v-if="time < 0"
|
|
||||||
format="DD 天 HH 时 mm 分钟 ss 秒"
|
|
||||||
:value="new Date(infoRow.activitySignUpStartTime)"
|
|
||||||
time-indices
|
|
||||||
title="距离开始:"
|
|
||||||
@finish="time = 0"
|
|
||||||
style="margin-top: 30px"
|
|
||||||
>
|
|
||||||
</el-statistic>
|
|
||||||
|
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="infoVisible = false">取消</el-button>
|
<el-statistic
|
||||||
<el-button type="primary" @click="onOpen(infoRow)" :disabled="time < 0">
|
v-if="time < 0"
|
||||||
去报名
|
format="DD 天 HH 时 mm 分钟 ss 秒"
|
||||||
</el-button>
|
:value="new Date(infoRow.activitySignUpStartTime)"
|
||||||
|
time-indices
|
||||||
|
title="距离开始:"
|
||||||
|
@finish="time = 0"
|
||||||
|
>
|
||||||
|
</el-statistic>
|
||||||
|
<template v-else>
|
||||||
|
<el-button @click="infoVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="onOpen(infoRow)" :disabled="time < 0">
|
||||||
|
去报名
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ layout("/layouts/platform.html"){
|
|||||||
return {
|
return {
|
||||||
pageForm: {
|
pageForm: {
|
||||||
year: this.$moment().format("YYYY"),
|
year: this.$moment().format("YYYY"),
|
||||||
activityType: 2
|
activityType: 4
|
||||||
},
|
},
|
||||||
tableColumns: [
|
tableColumns: [
|
||||||
{ label: "活动名称", prop: "activityName", width: 600},
|
{ label: "活动名称", prop: "activityName", width: 600},
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ const customForm = {
|
|||||||
<span>候补数量</span>
|
<span>候补数量</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="20">
|
<el-col :span="20">
|
||||||
<el-input-number :controls="false" size="small" style="width: 100%"
|
<el-input-number :controls="false" style="width: 100%"
|
||||||
:max="100"
|
:max="100"
|
||||||
:min="0"
|
:min="0"
|
||||||
:precision="0"
|
:precision="0"
|
||||||
|
|||||||
@@ -3,18 +3,7 @@ layout("/layouts/platform.html"){
|
|||||||
#-->
|
#-->
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.my-drawer .el-col-4 {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
.my-drawer .el-row {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.el-drawer__body {
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
.el-row--flex {
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="app" v-cloak>
|
<div id="app" v-cloak>
|
||||||
|
|||||||
@@ -0,0 +1,149 @@
|
|||||||
|
<!--#
|
||||||
|
layout("/layouts/platform_h5.html"){
|
||||||
|
#-->
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.info-title {
|
||||||
|
font-weight: bold;
|
||||||
|
background-color: white;
|
||||||
|
padding: 13px;
|
||||||
|
box-shadow: 0 8px 12px #ebedf0;
|
||||||
|
text-align: center !important;
|
||||||
|
}
|
||||||
|
.info-container {
|
||||||
|
margin-bottom: 60px;
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.info-img {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.van-count-down {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div id="app">
|
||||||
|
<van-nav-bar title="亲子活动" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
|
||||||
|
|
||||||
|
<van-sticky offset-top="46px">
|
||||||
|
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
|
||||||
|
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
|
||||||
|
<van-dropdown-item v-model="pageForm.activityType" :options="typeOptions" :multiple="false"
|
||||||
|
@change="doSearch"></van-dropdown-item>
|
||||||
|
</van-dropdown-menu>
|
||||||
|
</van-sticky>
|
||||||
|
|
||||||
|
<table-list api="/platform/family/apply/activityPageData"
|
||||||
|
:page_form.sync="pageForm"
|
||||||
|
ref="tableListRef"
|
||||||
|
title="activityName"
|
||||||
|
img="cover"
|
||||||
|
@ready="onReady"
|
||||||
|
>
|
||||||
|
<template v-slot="{index,row}">
|
||||||
|
<table-column label="面向对象">{{row.activityGroupName}}</table-column>
|
||||||
|
<table-column label="报名时间">
|
||||||
|
{{$moment(row.activitySignUpStartTime).format('MM/DD HH:mm') + '~' + $moment(row.activitySignUpEndTime).format('MM/DD HH:mm')}}
|
||||||
|
</table-column>
|
||||||
|
<table-column label="活动时间">
|
||||||
|
{{$moment(row.activityStartTime).format('MM/DD HH:mm') + '~' + $moment(row.activityEndTime).format('MM/DD HH:mm')}}
|
||||||
|
</table-column>
|
||||||
|
</template>
|
||||||
|
<template #actions="{index,row}">
|
||||||
|
<div class="action-btn" @click="onView(row)">
|
||||||
|
<i class="fa fa-eye"></i>
|
||||||
|
<span>查看介绍</span>
|
||||||
|
</div>
|
||||||
|
<div class="action-btn" @click="onApply(row)">
|
||||||
|
<i class="fa fa-edit"></i>
|
||||||
|
<span>去报名</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</table-list>
|
||||||
|
|
||||||
|
<van-action-sheet :close-on-click-overlay="false" title="详细信息" v-model="infoVisible">
|
||||||
|
|
||||||
|
<div class="info-container">
|
||||||
|
<div>
|
||||||
|
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
|
||||||
|
<div class="info-title">{{infoRow.activityName}}</div>
|
||||||
|
<pdf-preview :content="infoRow.introduce"></pdf-preview>
|
||||||
|
</div>
|
||||||
|
<div class="button">
|
||||||
|
<van-button @click="onApply(infoRow)" type="primary" block>
|
||||||
|
<span v-if="time >= 0">
|
||||||
|
去报名
|
||||||
|
</span>
|
||||||
|
<template v-else>
|
||||||
|
距离开始
|
||||||
|
<van-count-down :time="Math.abs(time)" class="count-down" format="DD 天 HH 时 mm 分 ss 秒" @finish="time = 0"></van-count-down>
|
||||||
|
</template>
|
||||||
|
</van-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</van-action-sheet>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const vue = new Vue({
|
||||||
|
el: "#app",
|
||||||
|
store,
|
||||||
|
components: {
|
||||||
|
"pdf-preview": httpVueLoader("/components/plugins/sysFilePreview/PdfIndex.vue?v=" + new Date().getTime())
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
time: 0,
|
||||||
|
pageForm: {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalCount: 0,
|
||||||
|
searchKeyword: '',
|
||||||
|
year: new Date().getFullYear(),
|
||||||
|
activityType: 4,
|
||||||
|
},
|
||||||
|
typeOptions: [
|
||||||
|
{text: '全部', value: 1},
|
||||||
|
{text: '即将开始', value: 4},
|
||||||
|
{text: '报名中', value: 2},
|
||||||
|
{text: '已结束', value: 3},
|
||||||
|
],
|
||||||
|
infoVisible: false,
|
||||||
|
infoRow: {},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onView(row) {
|
||||||
|
this.infoRow = row
|
||||||
|
this.time = this.$moment().diff(this.$moment(row.activitySignUpStartTime), 'milliseconds')
|
||||||
|
this.infoVisible = true
|
||||||
|
},
|
||||||
|
onApply(row) {
|
||||||
|
if(this.$moment().isBefore(this.$moment(row.activitySignUpStartTime))) {
|
||||||
|
this.onView(row)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$pjaxReplace('/platform/family/apply/list/h5?id=' + row.id)
|
||||||
|
},
|
||||||
|
onReady() {
|
||||||
|
this.doSearch()
|
||||||
|
},
|
||||||
|
doSearch() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.pageForm.pageNumber = 1
|
||||||
|
this.pageForm.totalCount = 0
|
||||||
|
this.$refs.tableListRef.doSearch()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!--#
|
||||||
|
}
|
||||||
|
#-->
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
const times = {
|
||||||
|
template:
|
||||||
|
/*language=HTML*/
|
||||||
|
`
|
||||||
|
<div>
|
||||||
|
<van-action-sheet v-model="visible" title="时间段" cancel-text="取消">
|
||||||
|
<button v-for="(item,index) in row?.courseTimes" type="button" class="van-action-sheet__item">
|
||||||
|
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||||
|
<div>
|
||||||
|
<div class="van-action-sheet__name">
|
||||||
|
<label>{{ weekdayCNMap[$moment(item.courseDate).day()] }}</label>
|
||||||
|
<label>{{ $moment(item.courseDate).format('YYYY-MM-DD') }}</label>
|
||||||
|
</div>
|
||||||
|
<div class="van-action-sheet__subname">
|
||||||
|
{{$moment(item.courseStartTime).format('MM-DD HH:mm') + ' 至 ' + $moment(item.courseEndTime).format('MM-DD HH:mm')}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="row.isSign === true && row.isMobileSign === true" class="sign_button">
|
||||||
|
<van-button v-if="item.isAttend !== true" @click.stop="onSign(item)" size="mini" type="info">签到</van-button>
|
||||||
|
<van-button v-if="item.isAttend === true" size="mini" type="info" disabled>已签到</van-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
</van-action-sheet>
|
||||||
|
|
||||||
|
<van-popup round :safe-area-inset-bottom="true"
|
||||||
|
:close-on-click-overlay="false"
|
||||||
|
v-model="signVisible"
|
||||||
|
:style="{ width: '80%', height: '66%' }"
|
||||||
|
get-container="#app"
|
||||||
|
@close="onSignClose"
|
||||||
|
closeable
|
||||||
|
>
|
||||||
|
<scan-code ref="scanCodeRef"></scan-code>
|
||||||
|
</van-popup>
|
||||||
|
</div>
|
||||||
|
`,
|
||||||
|
store,
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible:false,
|
||||||
|
row: null,
|
||||||
|
weekdayCNMap: {0: '周日', 1: '周一', 2: '周二', 3: '周三', 4: '周四', 5: '周五', 6: '周六'},
|
||||||
|
|
||||||
|
selectCourseTime: {},
|
||||||
|
signVisible: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
"scan-code": httpVueLoader("/components/plugins/sysScanCode/index.vue?v=" + new Date().getTime())
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSignClose() {
|
||||||
|
this.$refs.scanCodeRef.closeScan()
|
||||||
|
},
|
||||||
|
onOpen(row) {
|
||||||
|
this.row = row
|
||||||
|
this.visible = true
|
||||||
|
},
|
||||||
|
onSign(courseTime) {
|
||||||
|
this.selectCourseTime = courseTime
|
||||||
|
if(this.row.signType === 1) {
|
||||||
|
this.signVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.scanCodeRef.init()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if(this.row.signType === 2) {
|
||||||
|
this.makeCode()
|
||||||
|
}
|
||||||
|
if(this.row.signType === 3) {
|
||||||
|
this.$toast('此签到模式正在升级中')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
makeCode() {
|
||||||
|
const url = '/platform/family/mine/passiveScan'
|
||||||
|
const data = url + '?id=' + this.selectCourseTime.id
|
||||||
|
console.log(data)
|
||||||
|
const content = jrQrcode.getQrBase64(data)
|
||||||
|
vant.ImagePreview([content])
|
||||||
|
},
|
||||||
|
onClose(){
|
||||||
|
this.visible = false
|
||||||
|
},
|
||||||
|
},
|
||||||
|
style: /*language=CSS*/ `
|
||||||
|
|
||||||
|
`
|
||||||
|
}
|
||||||
@@ -0,0 +1,343 @@
|
|||||||
|
const applyForm = {
|
||||||
|
template:
|
||||||
|
/*language=HTML*/
|
||||||
|
`
|
||||||
|
<div>
|
||||||
|
<van-action-sheet :close-on-click-overlay="false" title="报名信息" v-model="visible">
|
||||||
|
<van-form ref="formRef" class="form-container">
|
||||||
|
<van-cell-group title="活动信息" class="form-section">
|
||||||
|
<van-field label="活动名称" readonly v-model="row.courseName"></van-field>
|
||||||
|
<van-field label="校区" readonly v-model="row.campus"></van-field>
|
||||||
|
<van-field label="活动地点" readonly v-model="row.courseLocation"></van-field>
|
||||||
|
</van-cell-group>
|
||||||
|
<van-cell-group title="基础信息" class="form-section">
|
||||||
|
<van-field label="姓名" readonly v-model="formData.username"></van-field>
|
||||||
|
<van-field label="工号" readonly v-model="formData.loginname"></van-field>
|
||||||
|
<van-field label="所在单位" readonly v-model="formData.unitName"></van-field>
|
||||||
|
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
|
||||||
|
<van-field label="性别" readonly v-model="formData.sex"></van-field>
|
||||||
|
<template v-if="row.courseIsLimitApply">
|
||||||
|
<van-field label="报名时段"
|
||||||
|
required
|
||||||
|
:rules="[{ required: true, message: '请选择报名时段' }]"
|
||||||
|
readonly
|
||||||
|
@click="showCoursePicker = true"
|
||||||
|
placeholder="请选择报名时段"
|
||||||
|
name="courseTimeName"
|
||||||
|
v-model="formData.courseTimeName">
|
||||||
|
</van-field>
|
||||||
|
<van-popup v-model="showCoursePicker" position="bottom">
|
||||||
|
<van-picker
|
||||||
|
show-toolbar
|
||||||
|
:columns="courseTimeSelectList"
|
||||||
|
@confirm="onCourseConfirm"
|
||||||
|
@cancel="showCoursePicker=false"
|
||||||
|
></van-picker>
|
||||||
|
</van-popup>
|
||||||
|
</template>
|
||||||
|
</van-cell-group>
|
||||||
|
|
||||||
|
<van-cell-group class="form-section">
|
||||||
|
<template #title>
|
||||||
|
<div style="display: flex; align-items: center; justify-content: space-between">
|
||||||
|
<div>{{activity.keyWord}}信息</div>
|
||||||
|
<div>
|
||||||
|
<van-tag @click="delFamily" size="large" type="primary" color="#ff3b30">删除{{activity.keyWord}}</van-tag>
|
||||||
|
<van-tag @click="addFamily" size="large" type="primary" color="#1867b0">添加{{activity.keyWord}}</van-tag>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div v-if="formData.mobileColumnsValue && formData.mobileColumnsValue.length > 0" class="mt10">
|
||||||
|
<van-tabs v-model="familyActive" type="card" color="#0e78c5" animated>
|
||||||
|
<van-tab v-for="item, index in formData.mobileColumnsValue"
|
||||||
|
:name="index + ''"
|
||||||
|
:title="activity.keyWord + (index + 1)"
|
||||||
|
:key="index">
|
||||||
|
<train-dynamic-form v-model="formData.mobileColumnsValue[index]"></train-dynamic-form>
|
||||||
|
</van-tab>
|
||||||
|
</van-tabs>
|
||||||
|
</div>
|
||||||
|
<div v-if="formData.mobileColumnsValue?.length === 0" class="companionList_empty_text">
|
||||||
|
<span>
|
||||||
|
暂无数据,请添加{{activity.keyWord}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</van-cell-group>
|
||||||
|
|
||||||
|
<div class="button">
|
||||||
|
<van-button @click="onSubmit" round type="info">提交</van-button>
|
||||||
|
</div>
|
||||||
|
</van-form>
|
||||||
|
</van-action-sheet>
|
||||||
|
</div>
|
||||||
|
`,
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
familyActive: '',
|
||||||
|
row: {},
|
||||||
|
activity: {},
|
||||||
|
visible: false,
|
||||||
|
formData: {},
|
||||||
|
showCoursePicker: false,
|
||||||
|
courseTimeSelectList: [],
|
||||||
|
courseType: {},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
"train-dynamic-form": httpVueLoader("/components/module/trainSignUp/TrainDynamicForm.vue")
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
addFamily() {
|
||||||
|
if(this.formData.mobileColumnsValue.length >= this.activity.familyMaxCount) {
|
||||||
|
this.$toast(this.activity.keyWord + '最多人数为' + this.activity.familyMaxCount)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const list = clone(this.courseType.familyMobileSignColumnList)
|
||||||
|
this.formData.mobileColumnsValue.push(list)
|
||||||
|
},
|
||||||
|
delFamily() {
|
||||||
|
this.formData.mobileColumnsValue.splice(this.familyActive, 1)
|
||||||
|
const ac = (Number(this.familyActive) - 1)
|
||||||
|
this.familyActive = '' + (ac >= 0 ? ac : 0)
|
||||||
|
},
|
||||||
|
async onOpen(row, courseType, activity) {
|
||||||
|
this.row = row
|
||||||
|
this.courseType = courseType
|
||||||
|
this.activity = activity
|
||||||
|
|
||||||
|
this.init(row, courseType)
|
||||||
|
if(row.courseIsLimitApply) {
|
||||||
|
await this.getCourseTimeSelectList(row)
|
||||||
|
}
|
||||||
|
this.visible = true
|
||||||
|
},
|
||||||
|
init(row, courseType) {
|
||||||
|
this.$set(this.formData, 'username', this.$store.state.user.username)
|
||||||
|
this.$set(this.formData, 'loginname', this.$store.state.user.loginname)
|
||||||
|
this.$set(this.formData, 'unionName', this.$store.state.user.union.name)
|
||||||
|
this.$set(this.formData, 'unitName', this.$store.state.user.unit.name)
|
||||||
|
this.$set(this.formData, 'sex', this.$store.state.user.sex)
|
||||||
|
this.$set(this.formData, 'activityId', row.activityId)
|
||||||
|
this.$set(this.formData, 'courseId', row.id)
|
||||||
|
this.$set(this.formData, 'mobileColumnsValue', [])
|
||||||
|
},
|
||||||
|
onCourseConfirm(val){
|
||||||
|
this.formData.activityCourseId = val.value
|
||||||
|
this.$set(this.formData, "activityCourseId", val.value)
|
||||||
|
this.$set(this.formData, "courseTimeName", val.text.substring(0, 12))
|
||||||
|
this.showCoursePicker = false
|
||||||
|
},
|
||||||
|
async getCourseTimeSelectList(o) {
|
||||||
|
const resp = await this.$axios.post('/platform/family/apply/getCourseTimeSelectList',{courseId: o.id})
|
||||||
|
if (resp.code === 0) {
|
||||||
|
this.courseTimeSelectList = resp.data
|
||||||
|
} else {
|
||||||
|
this.$toast.fail("获取时段信息失败,请联系管理员")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validateIdCard(idCard) {
|
||||||
|
if (!idCard) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 18位身份证号码校验
|
||||||
|
if (idCard.length === 18) {
|
||||||
|
const idCardRegex = /^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}(\d|[Xx])$/
|
||||||
|
if (!idCardRegex.test(idCard)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验码计算
|
||||||
|
const weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
|
||||||
|
const checksums = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"]
|
||||||
|
let sum = 0
|
||||||
|
for (let i = 0; i < 17; i++) {
|
||||||
|
sum += idCard[i] * weights[i]
|
||||||
|
}
|
||||||
|
const checksum = checksums[sum % 11]
|
||||||
|
return checksum === idCard[17].toUpperCase()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 15位身份证号码校验
|
||||||
|
else if (idCard.length === 15) {
|
||||||
|
const idCardRegex = /^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/
|
||||||
|
return idCardRegex.test(idCard)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 外国人或其他情况
|
||||||
|
else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
validFamilyForm() {
|
||||||
|
// 校验规则映射
|
||||||
|
const validators = {
|
||||||
|
idCard: (value) => this.validateIdCard(value),
|
||||||
|
mobile: (value) => /^1[3-9]\d{9}$/.test(value),
|
||||||
|
email: (value) => /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(value)
|
||||||
|
};
|
||||||
|
// 显示提示弹窗(直接传完整的 message)
|
||||||
|
const showAlert = (message) => {
|
||||||
|
vant.Dialog.alert({
|
||||||
|
title: '提示',
|
||||||
|
message: message, // 直接使用传入的完整消息
|
||||||
|
confirmButtonColor: '#1867b0'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const { mobileColumnsValue } = this.formData;
|
||||||
|
for (let i = 0; i < mobileColumnsValue.length; i++) {
|
||||||
|
const family = mobileColumnsValue[i];
|
||||||
|
for (const col of family) {
|
||||||
|
const value = col.columnValue?.trim(); // 安全处理空值和空格
|
||||||
|
// 必填校验
|
||||||
|
if (col.isRequired && !value) {
|
||||||
|
const message = this.activity.keyWord + (i + 1) + '的' + col.columnName + '不能为空';
|
||||||
|
showAlert(message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 格式校验
|
||||||
|
if (col.validRule && value) {
|
||||||
|
const validator = validators[col.validRule];
|
||||||
|
if (validator && !validator(value)) {
|
||||||
|
const message = this.activity.keyWord + (i + 1) + '的' + col.columnName + '格式不正确';
|
||||||
|
showAlert(message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(col.validRule === 'idCard' && this.row.familyAgeLimit) {
|
||||||
|
const parseCard = this.parseIdCard(value)
|
||||||
|
if(this.row.minAge && parseCard.age < this.row.minAge) {
|
||||||
|
const message = '限制报名最小年龄为' + this.row.minAge;
|
||||||
|
showAlert(message);
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
if(this.row.maxAge && parseCard.age > this.row.maxAge) {
|
||||||
|
const message = '限制报名最大年龄为' + this.row.maxAge;
|
||||||
|
showAlert(message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(col.validRule === 'idCard' && this.row.familySexLimit) {
|
||||||
|
const parseCard = this.parseIdCard(value)
|
||||||
|
if(this.row.familySex && parseCard.sex !== this.row.familySex) {
|
||||||
|
const message = '限制报名性别为' + this.row.familySex;
|
||||||
|
showAlert(message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
parseIdCard(idCard) {
|
||||||
|
if (!idCard || (idCard.length !== 18 && idCard.length !== 15)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
let birthStr = '';
|
||||||
|
let sexCode = '';
|
||||||
|
|
||||||
|
if (idCard.length === 15) {
|
||||||
|
birthStr = '19' + idCard.substring(6, 12);
|
||||||
|
sexCode = idCard.substring(14, 15); // 15位:第15位是性别
|
||||||
|
} else {
|
||||||
|
birthStr = idCard.substring(6, 14);
|
||||||
|
sexCode = idCard.substring(16, 17); // 18位:第17位是性别
|
||||||
|
}
|
||||||
|
|
||||||
|
const birthYear = parseInt(birthStr.substring(0, 4), 10);
|
||||||
|
const birthMonth = parseInt(birthStr.substring(4, 6), 10) - 1;
|
||||||
|
const birthDay = parseInt(birthStr.substring(6, 8), 10);
|
||||||
|
|
||||||
|
const birthDate = new Date(birthYear, birthMonth, birthDay);
|
||||||
|
const today = new Date();
|
||||||
|
|
||||||
|
let age = today.getFullYear() - birthDate.getFullYear();
|
||||||
|
const monthDiff = today.getMonth() - birthDate.getMonth();
|
||||||
|
const dayDiff = today.getDate() - birthDate.getDate();
|
||||||
|
|
||||||
|
if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
|
||||||
|
age--;
|
||||||
|
}
|
||||||
|
|
||||||
|
const sex = parseInt(sexCode, 10) % 2 === 1 ? '男' : '女';
|
||||||
|
|
||||||
|
return { age, sex, };
|
||||||
|
},
|
||||||
|
async validateSignUp() {
|
||||||
|
// 获取家属人数
|
||||||
|
const res = await this.$axios.post("/platform/family/apply/validateSignUp", {
|
||||||
|
courseId: this.formData.courseId,
|
||||||
|
currentFamilyNumber: this.formData.mobileColumnsValue.length || 0
|
||||||
|
})
|
||||||
|
if(res.code !== 0) {
|
||||||
|
this.$dialog.alert({title: '温馨提示', message: res.msg})
|
||||||
|
}
|
||||||
|
return res.code === 0
|
||||||
|
},
|
||||||
|
async validateCourseTime() {
|
||||||
|
const res = await this.$axios.post('/platform/family/apply/validateSourceSignUp', {
|
||||||
|
activityCourseId: this.formData.activityCourseId,
|
||||||
|
courseId: this.row.id
|
||||||
|
})
|
||||||
|
if(res.code !== 0) {
|
||||||
|
this.$dialog.alert({title: '温馨提示', message: res.msg})
|
||||||
|
}
|
||||||
|
return res.code === 0
|
||||||
|
},
|
||||||
|
async onSubmit() {
|
||||||
|
if (!this.validFamilyForm()) return
|
||||||
|
if (!await this.validateSignUp()) return
|
||||||
|
|
||||||
|
this.$refs.formRef.validate().then(() => {
|
||||||
|
this.$dialog.confirm({
|
||||||
|
title: "提示",
|
||||||
|
message: "您确定要提交吗?"
|
||||||
|
}).then(async () => {
|
||||||
|
if (this.row.courseIsLimitApply) {
|
||||||
|
if(!await this.validateCourseTime()) return
|
||||||
|
}
|
||||||
|
|
||||||
|
const formData = clone(this.formData)
|
||||||
|
let array = []
|
||||||
|
formData.mobileColumnsValue.forEach(item => {
|
||||||
|
const o = item.map((v) => {
|
||||||
|
return {
|
||||||
|
columnName: v.columnName,
|
||||||
|
columnValue: v.columnValue,
|
||||||
|
columnCode: v.columnCode,
|
||||||
|
columnFormType: v.columnFormType
|
||||||
|
}
|
||||||
|
})
|
||||||
|
array.push(o)
|
||||||
|
})
|
||||||
|
formData.mobileColumnsValue = JSON.stringify(clone(array))
|
||||||
|
this.$axios.post("/platform/family/apply/doSignUp", formData).then(res => {
|
||||||
|
this.$dialog.alert({title: '温馨提示', message: res.msg})
|
||||||
|
.then(() => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.visible = false
|
||||||
|
this.$emit('refresh')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
style: /*language=CSS*/ `
|
||||||
|
::v-deep .companionList_empty_text {
|
||||||
|
text-align: center;
|
||||||
|
padding: 10px 0;
|
||||||
|
font-size: 14px;
|
||||||
|
color: grey;
|
||||||
|
}
|
||||||
|
::v-deep .button {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
}
|
||||||
@@ -0,0 +1,230 @@
|
|||||||
|
<!--#
|
||||||
|
layout("/layouts/platform_h5.html"){
|
||||||
|
#-->
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.primary-color {
|
||||||
|
color: var(--color-primary);
|
||||||
|
}
|
||||||
|
.sign_button .van-button{
|
||||||
|
width: 66px;
|
||||||
|
height: 30px;
|
||||||
|
font-size: 14px;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div id="app">
|
||||||
|
<van-nav-bar title="活动报名" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
|
||||||
|
|
||||||
|
<van-sticky offset-top="46px">
|
||||||
|
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
|
||||||
|
<van-dropdown-item v-model="pageForm.courseTypeId" :options="typeOptions" :multiple="false"
|
||||||
|
@change="doSearch"></van-dropdown-item>
|
||||||
|
</van-dropdown-menu>
|
||||||
|
</van-sticky>
|
||||||
|
|
||||||
|
<table-list api="/platform/family/apply/pageData"
|
||||||
|
:page_form.sync="pageForm"
|
||||||
|
ref="tableListRef"
|
||||||
|
@ready="onReady"
|
||||||
|
>
|
||||||
|
<template #header="{index,row}">
|
||||||
|
<div class="item-header">
|
||||||
|
<div class="item-title">{{ row.courseName }}</div>
|
||||||
|
<div v-html="calcSignUpCount(row)"></div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-slot="{index,row}">
|
||||||
|
<table-column label="类型">{{row.typeName}}</table-column>
|
||||||
|
<table-column label="校区">{{row.campus}}</table-column>
|
||||||
|
<table-column label="地点">{{row.courseLocation}}</table-column>
|
||||||
|
<table-column label="联系人">{{row.courseInstructor}}</table-column>
|
||||||
|
<table-column label="时间">
|
||||||
|
<span v-if="row.courseTimes && row.courseTimes.length === 1" class="primary-color" @click="onTime(row)">
|
||||||
|
{{ weekdayCNMap[$moment(row.courseTimes[0].courseDate).day()]
|
||||||
|
+ ' '
|
||||||
|
+ $moment(row.courseTimes[0].courseStartTime).format('MM月DD日 HH:mm')
|
||||||
|
+ '~'
|
||||||
|
+ $moment(row.courseTimes[0].courseEndTime).format('HH:mm') }}
|
||||||
|
</span>
|
||||||
|
<span v-else @click="onTime(row)" class="primary-color">点我查看</span>
|
||||||
|
</table-column>
|
||||||
|
<table-column v-if="row.introduce?.trim()" label="详细信息">
|
||||||
|
<span @click="introduceRow = row; introduceVisible = true" class="primary-color">点我查看</span>
|
||||||
|
</table-column>
|
||||||
|
</template>
|
||||||
|
<template #actions="{index,row}">
|
||||||
|
<div v-if="activity.wechat && row.isSign" class="action-btn" @click="this.vant.ImagePreview([activity.wechat])">
|
||||||
|
<i class="fa fa-wechat"></i>
|
||||||
|
<span>微信群二维码</span>
|
||||||
|
</div>
|
||||||
|
<template v-if="$moment().isBefore($moment(activity.activitySignUpEndTime))">
|
||||||
|
<div v-if="row.isSign === false" class="action-btn" @click="onApply(row)">
|
||||||
|
<i class="fa fa-sign-in"></i>
|
||||||
|
<span>我要报名</span>
|
||||||
|
</div>
|
||||||
|
<div v-if="row.isSign === true" class="action-btn delete" @click="onCancel(row)">
|
||||||
|
<i class="fa fa-trash"></i>
|
||||||
|
<span>取消报名</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<div v-if="row.isSign === true && row.isMobileSign === true && $moment().isAfter($moment(activity.activitySignUpEndTime))"
|
||||||
|
class="action-btn"
|
||||||
|
@click="onTime(row)"
|
||||||
|
>
|
||||||
|
<i class="fa fa-sign-in"></i>
|
||||||
|
<span>签到</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</table-list>
|
||||||
|
|
||||||
|
<van-action-sheet :close-on-click-overlay="false" title="详细信息" v-model="introduceVisible" cancel-text="取消">
|
||||||
|
<pdf-preview :content="introduceRow.introduce"></pdf-preview>
|
||||||
|
</van-action-sheet>
|
||||||
|
|
||||||
|
<times ref="timesRef"></times>
|
||||||
|
<apply-form ref="formRef" @refresh="refresh"></apply-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="${base!}/assets/platform/plugins/jr-qrcode/jr-qrcode.js"></script>
|
||||||
|
<script>
|
||||||
|
<!--#include('../common/times.js'){}#-->
|
||||||
|
<!--#include('applyForm.js'){}#-->
|
||||||
|
const vue = new Vue({
|
||||||
|
el: "#app",
|
||||||
|
store,
|
||||||
|
components: {
|
||||||
|
'times': times,
|
||||||
|
'apply-form': applyForm,
|
||||||
|
"pdf-preview": httpVueLoader("/components/plugins/sysFilePreview/PdfIndex.vue?v=" + new Date().getTime())
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pageForm: {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalCount: 0,
|
||||||
|
searchKeyword: '',
|
||||||
|
year: new Date().getFullYear(),
|
||||||
|
courseTypeId: null,
|
||||||
|
activityId: GetQueryString('id'),
|
||||||
|
dataType: GetQueryString('dataType'),
|
||||||
|
},
|
||||||
|
typeOptions: [],
|
||||||
|
assortOptions: [],
|
||||||
|
sourceTypeOptions: [],
|
||||||
|
introduceVisible: false,
|
||||||
|
|
||||||
|
introduceRow: {},
|
||||||
|
activity: {},
|
||||||
|
weekdayCNMap: {0: '周日', 1: '周一', 2: '周二', 3: '周三', 4: '周四', 5: '周五', 6: '周六'},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
refresh() {
|
||||||
|
this.doSearch()
|
||||||
|
},
|
||||||
|
async onTime(row) {
|
||||||
|
// 如果设置签到,并且也报名的话
|
||||||
|
if(row.isMobileSign === true && row.isSign === true) {
|
||||||
|
const res = await this.$axios.post('/platform/family/mine/queryCourseSign', {
|
||||||
|
courseId: row.id
|
||||||
|
})
|
||||||
|
row.courseTimes = res.data
|
||||||
|
}
|
||||||
|
this.$refs.timesRef.onOpen(row)
|
||||||
|
},
|
||||||
|
onApply(row) {
|
||||||
|
const courseType = this.sourceTypeOptions.find((v) => v.id === row.courseType)
|
||||||
|
this.$axios.post('/platform/family/apply/validateSignUp', {
|
||||||
|
courseId: row.id
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
if (res.code !== 0) {
|
||||||
|
vant.Dialog.alert({
|
||||||
|
title: '提示',
|
||||||
|
message: res.msg,
|
||||||
|
confirmButtonColor: '#1867b0'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
let lave = row.coursePeopleNumber - (row.hasRegisterNum + row.courseReservedNumber)
|
||||||
|
if(row.reserveMode === 2 && lave <= 0) {
|
||||||
|
vant.Dialog.alert({
|
||||||
|
title: '提示',
|
||||||
|
message: '您当前的报名为候补报名状态',
|
||||||
|
confirmButtonColor: '#1867b0'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.$refs.formRef.onOpen(row, courseType, this.activity)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onCancel(row) {
|
||||||
|
vant.Dialog.confirm({
|
||||||
|
title: '温馨提示',
|
||||||
|
message: "您确定要<span style='color: red'>取消【" + row.courseName + "】</span>吗?",
|
||||||
|
confirmButtonColor: '#1867b0',
|
||||||
|
}).then(async () => {
|
||||||
|
const resp = await this.$axios.post('/platform/family/apply/cancelSignUp', {
|
||||||
|
activityId: row.activityId,
|
||||||
|
courseId: row.id
|
||||||
|
})
|
||||||
|
this.$toast(resp.msg)
|
||||||
|
if (resp.code === 0) {
|
||||||
|
this.doSearch()
|
||||||
|
}
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
calcSignUpCount(row) {
|
||||||
|
if(!row.coursePeopleNumber || row.coursePeopleNumber === 0) {
|
||||||
|
return "名额数不限制"
|
||||||
|
}
|
||||||
|
let lave = row.coursePeopleNumber - (row.hasRegisterNum + row.courseReservedNumber)
|
||||||
|
if(row.reserveMode === 2) {
|
||||||
|
let lave2 = row.waitingNum - row.hasWaitingNum
|
||||||
|
return "<span style='color: red'>余" + lave +"</span>/" + row.coursePeopleNumber + "人"
|
||||||
|
+ ",<span style='color: red'>候补余" + lave2 + "</span>/" + row.waitingNum + "人"
|
||||||
|
} else {
|
||||||
|
return "<span style='color: red'>余" + lave +"</span>/" + row.coursePeopleNumber + "人"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async onReady() {
|
||||||
|
const typeList = await this.getCourseTypeList()
|
||||||
|
this.sourceTypeOptions = clone(typeList)
|
||||||
|
this.typeOptions = [
|
||||||
|
{
|
||||||
|
text: "全部类型",
|
||||||
|
value: null
|
||||||
|
}
|
||||||
|
].concat(typeList.map((v) => ({ text: v.typeName, value: v.id })))
|
||||||
|
if (this.typeOptions.length > 0) {
|
||||||
|
this.pageForm.type = this.typeOptions[0].value
|
||||||
|
this.doSearch()
|
||||||
|
}
|
||||||
|
this.fetchActivity()
|
||||||
|
},
|
||||||
|
fetchActivity() {
|
||||||
|
this.$axios.post('/platform/family/manage/findOne', {id: this.pageForm.activityId})
|
||||||
|
.then((res) => {
|
||||||
|
this.activity = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async getCourseTypeList() {
|
||||||
|
const resp = await this.$axios.post("/platform/family/type/getAllType")
|
||||||
|
return resp.data
|
||||||
|
},
|
||||||
|
doSearch() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.pageForm.pageNumber = 1
|
||||||
|
this.pageForm.totalCount = 0
|
||||||
|
this.$refs.tableListRef.doSearch()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!--#
|
||||||
|
}
|
||||||
|
#-->
|
||||||
@@ -0,0 +1,347 @@
|
|||||||
|
<!--#
|
||||||
|
layout("/layouts/platform_h5.html"){
|
||||||
|
#-->
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.info-title {
|
||||||
|
font-weight: bold;
|
||||||
|
background-color: white;
|
||||||
|
padding: 13px;
|
||||||
|
box-shadow: 0 8px 12px #ebedf0;
|
||||||
|
text-align: center !important;
|
||||||
|
}
|
||||||
|
.info-container {
|
||||||
|
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.info-img {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.van-count-down {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.table-list-container {
|
||||||
|
padding: 0;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .table-list-item {
|
||||||
|
background-color: #fff;
|
||||||
|
border-bottom: 1px solid #eaecef;
|
||||||
|
padding: 16px;
|
||||||
|
position: relative;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .table-list-item:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .table-list-item .item-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .table-list-item .item-title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #1f2f3d;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
flex: 1;
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .table-list-item .img-container {
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .table-list-item .img-container img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.table-list-container .table-list-item .item-meta {
|
||||||
|
display: flex;
|
||||||
|
color: #606266;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
padding: 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .table-list-item .meta-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .table-list-item .meta-item i {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #909399;
|
||||||
|
width: 16px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .table-list-item .item-content {
|
||||||
|
color: #606266;
|
||||||
|
font-size: 14px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .table-list-item .item-footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 12px;
|
||||||
|
padding-top: 8px;
|
||||||
|
border-top: 1px dashed #eaecef;
|
||||||
|
color: #909399;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .table-list-item .item-actions {
|
||||||
|
display: flex;
|
||||||
|
column-gap: 20px;
|
||||||
|
justify-content: end;
|
||||||
|
margin-top: 15px;
|
||||||
|
padding-top: 12px;
|
||||||
|
border-top: 1px solid #eaecef;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .table-list-item .action-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: end;
|
||||||
|
font-size: 14px;
|
||||||
|
color: var(--color-primary);
|
||||||
|
padding: 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .table-list-item .action-btn i {
|
||||||
|
margin-right: 6px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .table-list-item .action-btn.delete {
|
||||||
|
color: #ff0000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .table-list-item .action-btn.review {
|
||||||
|
color: #67c23a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .empty-state {
|
||||||
|
text-align: center;
|
||||||
|
padding: 60px 20px;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .empty-state i {
|
||||||
|
font-size: 60px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
color: #dcdee0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-list-container .empty-state p {
|
||||||
|
margin-top: 10px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.table-column {
|
||||||
|
display: flex;
|
||||||
|
padding: 6px 0;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
color: #333;
|
||||||
|
font-size: 14px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
max-width: 120px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
color: #555;
|
||||||
|
font-size: 14px;
|
||||||
|
flex-grow: 1; /* 动态占据剩余部分 */
|
||||||
|
white-space: nowrap; /* 防止换行 */
|
||||||
|
overflow: hidden; /* 隐藏溢出的部分 */
|
||||||
|
text-overflow: ellipsis; /* 省略号 */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div id="app">
|
||||||
|
<van-nav-bar title="亲子活动-我的报名" left-text="返回" left-arrow @click-left="historyBack" fixed placeholder></van-nav-bar>
|
||||||
|
|
||||||
|
<van-sticky offset-top="46px">
|
||||||
|
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
|
||||||
|
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
|
||||||
|
<van-dropdown-item v-model="pageForm.activityType" :options="typeOptions" :multiple="false"
|
||||||
|
@change="doSearch"></van-dropdown-item>
|
||||||
|
</van-dropdown-menu>
|
||||||
|
</van-sticky>
|
||||||
|
|
||||||
|
<table-list api="/platform/family/apply/activityPageData"
|
||||||
|
:page_form.sync="pageForm"
|
||||||
|
ref="tableListRef"
|
||||||
|
title="activityName"
|
||||||
|
img="cover"
|
||||||
|
@ready="onReady"
|
||||||
|
>
|
||||||
|
<template v-slot="{index,row}">
|
||||||
|
<table-column label="面向对象">{{row.activityGroupName}}</table-column>
|
||||||
|
<table-column label="报名时间">
|
||||||
|
{{$moment(row.activitySignUpStartTime).format('MM/DD HH:mm') + '~' + $moment(row.activitySignUpEndTime).format('MM/DD HH:mm')}}
|
||||||
|
</table-column>
|
||||||
|
<table-column label="活动时间">
|
||||||
|
{{$moment(row.activityStartTime).format('MM/DD HH:mm') + '~' + $moment(row.activityEndTime).format('MM/DD HH:mm')}}
|
||||||
|
</table-column>
|
||||||
|
</template>
|
||||||
|
<template #actions="{index,row}">
|
||||||
|
<div class="action-btn" @click="onView(row)">
|
||||||
|
<i class="fa fa-eye"></i>
|
||||||
|
<span>活动介绍</span>
|
||||||
|
</div>
|
||||||
|
<div class="action-btn" @click="onInfo(row)">
|
||||||
|
<i class="fa fa-eye"></i>
|
||||||
|
<span>{{row.keyWord}}信息</span>
|
||||||
|
</div>
|
||||||
|
<div class="action-btn" @click="onApply(row)">
|
||||||
|
<i class="fa fa-edit"></i>
|
||||||
|
<span>操作</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</table-list>
|
||||||
|
|
||||||
|
<van-action-sheet :close-on-click-overlay="false" title="活动详细信息" v-model="infoVisible" cancel-text="取消">
|
||||||
|
|
||||||
|
<div class="info-container">
|
||||||
|
<div>
|
||||||
|
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
|
||||||
|
<div class="info-title">{{infoRow.activityName}}</div>
|
||||||
|
<pdf-preview :content="infoRow.introduce"></pdf-preview>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</van-action-sheet>
|
||||||
|
|
||||||
|
<van-action-sheet :close-on-click-overlay="false" title="报名信息" v-model="courseVisible" cancel-text="取消">
|
||||||
|
<div class="table-list-container">
|
||||||
|
<div v-for="(row, index) in mineCourses" :key="index" class="table-list-item">
|
||||||
|
<div class="item-header">
|
||||||
|
<div class="item-title" style="white-space: normal">{{ row.courseName }}</div>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex;column-gap: 10px">
|
||||||
|
<div class="table-column">
|
||||||
|
<div class="label">校区:</div>
|
||||||
|
<div class="value">{{ row.campus }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex;column-gap: 10px">
|
||||||
|
<div class="table-column">
|
||||||
|
<div class="label">地点:</div>
|
||||||
|
<div class="value">{{ row.courseLocation }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex;column-gap: 10px">
|
||||||
|
<div class="table-column">
|
||||||
|
<div class="label">联系人:</div>
|
||||||
|
<div class="value">{{ row.courseInstructor }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex;column-gap: 10px">
|
||||||
|
<div class="table-column">
|
||||||
|
<div class="label">家属人数:</div>
|
||||||
|
<div class="value">
|
||||||
|
{{ row.mobileColumnsValue ? JSON.parse(row.mobileColumnsValue).length : '暂无' }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="item-actions"></div>
|
||||||
|
</div>
|
||||||
|
</van-action-sheet>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const vue = new Vue({
|
||||||
|
el: "#app",
|
||||||
|
store,
|
||||||
|
components: {
|
||||||
|
"pdf-preview": httpVueLoader("/components/plugins/sysFilePreview/PdfIndex.vue?v=" + new Date().getTime())
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pageForm: {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalCount: 0,
|
||||||
|
searchKeyword: '',
|
||||||
|
year: new Date().getFullYear(),
|
||||||
|
activityType: 1,
|
||||||
|
dataType: 'mine'
|
||||||
|
},
|
||||||
|
typeOptions: [
|
||||||
|
{text: '全部', value: 1},
|
||||||
|
{text: '报名中', value: 2},
|
||||||
|
{text: '已结束', value: 3},
|
||||||
|
],
|
||||||
|
infoVisible: false,
|
||||||
|
infoRow: {},
|
||||||
|
|
||||||
|
mineCourses: [],
|
||||||
|
courseVisible: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onView(row) {
|
||||||
|
this.infoRow = row
|
||||||
|
this.infoVisible = true
|
||||||
|
},
|
||||||
|
onApply(row) {
|
||||||
|
this.$pjaxReplace('/platform/family/apply/list/h5?id=' + row.id + '&dataType=mine')
|
||||||
|
},
|
||||||
|
onInfo(row) {
|
||||||
|
this.$axios.post('/platform/family/mine/queryMineCourse', {activityId: row.id})
|
||||||
|
.then((res) => {
|
||||||
|
this.mineCourses = res.data
|
||||||
|
this.courseVisible = true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onReady() {
|
||||||
|
this.doSearch()
|
||||||
|
},
|
||||||
|
doSearch() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.pageForm.pageNumber = 1
|
||||||
|
this.pageForm.totalCount = 0
|
||||||
|
this.$refs.tableListRef.doSearch()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!--#
|
||||||
|
}
|
||||||
|
#-->
|
||||||
-142
@@ -1,142 +0,0 @@
|
|||||||
<!--#
|
|
||||||
layout("/layouts/platform_h5.html"){
|
|
||||||
#-->
|
|
||||||
<style>
|
|
||||||
.van-image {
|
|
||||||
display: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-weight: bold;
|
|
||||||
background-color: white;
|
|
||||||
padding: 13px;
|
|
||||||
box-shadow: 0 8px 12px #ebedf0;
|
|
||||||
text-align: center !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-tabs {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-tab {
|
|
||||||
-webkit-flex: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-tab--active {
|
|
||||||
color: #1867b0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-tabs__nav--line {
|
|
||||||
padding-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-tabs__content {
|
|
||||||
padding: 13px 13px 50px 13px;
|
|
||||||
background-color: white;
|
|
||||||
line-height: 28px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content_title {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pre_text {
|
|
||||||
white-space: break-spaces;
|
|
||||||
padding-left: 7px;
|
|
||||||
/*margin-top: 30px;*/
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<div id="app" v-cloak>
|
|
||||||
<van-nav-bar
|
|
||||||
title="活动详情"
|
|
||||||
left-text="返回"
|
|
||||||
left-arrow
|
|
||||||
@click-left="$pjaxReplace('/platform/mobile/trainSignUpActivity/trainList')"
|
|
||||||
></van-nav-bar>
|
|
||||||
|
|
||||||
<van-image height="186" src="/assets/mobile/img/trainSignUp/3quhtakfd4heeqsk6irqhft60p.png"></van-image>
|
|
||||||
<div class="title">{{activity.activityName}}</div>
|
|
||||||
|
|
||||||
<van-tabs v-model:active="tabActive" shrink>
|
|
||||||
<van-tab title="详细信息" name="a">
|
|
||||||
<div class="pre_text" v-html="activity.introduce"></div>
|
|
||||||
</van-tab>
|
|
||||||
</van-tabs>
|
|
||||||
|
|
||||||
<van-button @click="toSign" type="primary" block style="position: fixed; bottom: 0; z-index: 2">去报名</van-button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
new Vue({
|
|
||||||
el: "#app",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
trainType: "培训班",
|
|
||||||
trainTypeList: [],
|
|
||||||
tabActive: "a",
|
|
||||||
activityId: "",
|
|
||||||
activity: {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async findOne() {
|
|
||||||
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/findOne", {
|
|
||||||
id: this.activityId,
|
|
||||||
tabIndex: 0
|
|
||||||
})
|
|
||||||
if (resp.code === 0) {
|
|
||||||
this.activity = resp.data
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async toSign() {
|
|
||||||
const nowTime = this.$moment().unix()
|
|
||||||
if (nowTime < this.$moment(this.activity.activitySignUpStartTime).unix()) {
|
|
||||||
vant.Dialog.alert({
|
|
||||||
title: "提示",
|
|
||||||
message: "活动报名还未开始"
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (nowTime > this.$moment(this.activity.activitySignUpEndTime).unix()) {
|
|
||||||
vant.Dialog.alert({
|
|
||||||
title: "提示",
|
|
||||||
message: "活动报名已结束"
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (this.activity.activityGroupId != null) {
|
|
||||||
const isExist = await this.getScopeUser(this.activity.activityGroupId)
|
|
||||||
if (!isExist) {
|
|
||||||
vant.Dialog.alert({
|
|
||||||
title: "参加人员范围",
|
|
||||||
message: this.activity.activityGroupName
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.$pjaxReplace(
|
|
||||||
"/platform/mobile/trainSignUpActivity/trainInfo?activityId=" +
|
|
||||||
this.activity.id +
|
|
||||||
"&endTime=" +
|
|
||||||
this.activity.activitySignUpEndTime +
|
|
||||||
"&isMySign=" +
|
|
||||||
GetQueryString("isMySign")
|
|
||||||
)
|
|
||||||
},
|
|
||||||
async getScopeUser(activityGroupId) {
|
|
||||||
const resp = await this.$axios.post("/platform/activity/basic/scope/getScopeUser", { activityGroupId: activityGroupId })
|
|
||||||
return resp.data
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async created() {
|
|
||||||
this.$businessTool.getDictOptions("TRAIN_SIGNUP_TYPE").then((data) => {
|
|
||||||
this.trainTypeList = data
|
|
||||||
})
|
|
||||||
this.activityId = GetQueryString("activityId")
|
|
||||||
this.findOne()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
<!--#
|
|
||||||
}
|
|
||||||
#-->
|
|
||||||
@@ -11,9 +11,12 @@ layout("/layouts/platform_h5.html"){
|
|||||||
text-align: center !important;
|
text-align: center !important;
|
||||||
}
|
}
|
||||||
.info-container {
|
.info-container {
|
||||||
height: calc(100vh - 46px - 44px);
|
margin-bottom: 60px;
|
||||||
min-height: calc(100vh - 46px - 44px);
|
}
|
||||||
overflow-y: auto;
|
.button {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.info-img {
|
.info-img {
|
||||||
display: block;
|
display: block;
|
||||||
@@ -62,25 +65,27 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</template>
|
</template>
|
||||||
</table-list>
|
</table-list>
|
||||||
|
|
||||||
<van-popup v-model="infoVisible" position="right" :style="{ width: '100%', height: '100%' }">
|
<van-action-sheet :close-on-click-overlay="false" title="详细信息" v-model="infoVisible">
|
||||||
<van-nav-bar title="详细信息" left-text="返回" left-arrow @click-left="infoVisible = false" fixed placeholder></van-nav-bar>
|
|
||||||
|
|
||||||
<div class="info-container">
|
<div class="info-container">
|
||||||
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
|
<div>
|
||||||
<div class="info-title">{{infoRow.activityName}}</div>
|
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
|
||||||
<pdf-preview style="height: calc(100vh - 46px - 44px - 186px - 57px)" :content="infoRow.introduce"></pdf-preview>
|
<div class="info-title">{{infoRow.activityName}}</div>
|
||||||
|
<pdf-preview :content="infoRow.introduce"></pdf-preview>
|
||||||
|
</div>
|
||||||
|
<div class="button">
|
||||||
|
<van-button @click="onApply(infoRow)" type="primary" block>
|
||||||
|
<span v-if="time >= 0">
|
||||||
|
去报名
|
||||||
|
</span>
|
||||||
|
<template v-else>
|
||||||
|
距离开始
|
||||||
|
<van-count-down :time="Math.abs(time)" class="count-down" format="DD 天 HH 时 mm 分 ss 秒" @finish="time = 0"></van-count-down>
|
||||||
|
</template>
|
||||||
|
</van-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</van-action-sheet>
|
||||||
<van-button @click="onApply(infoRow)" type="primary" block>
|
|
||||||
<span v-if="time >= 0">
|
|
||||||
去报名
|
|
||||||
</span>
|
|
||||||
<template v-else>
|
|
||||||
距离开始
|
|
||||||
<van-count-down :time="Math.abs(time)" class="count-down" format="DD 天 HH 时 mm 分 ss 秒" @finish="time = 0"></van-count-down>
|
|
||||||
</template>
|
|
||||||
</van-button>
|
|
||||||
</van-popup>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -100,7 +105,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
totalCount: 0,
|
totalCount: 0,
|
||||||
searchKeyword: '',
|
searchKeyword: '',
|
||||||
year: new Date().getFullYear(),
|
year: new Date().getFullYear(),
|
||||||
activityType: 2,
|
activityType: 4,
|
||||||
},
|
},
|
||||||
typeOptions: [
|
typeOptions: [
|
||||||
{text: '全部', value: 1},
|
{text: '全部', value: 1},
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ const applyForm = {
|
|||||||
/*language=HTML*/
|
/*language=HTML*/
|
||||||
`
|
`
|
||||||
<div>
|
<div>
|
||||||
<van-popup v-model="visible" position="right" :style="{ width: '100%', height: '100%', 'background-color': '#F7F8FA' }">
|
<van-action-sheet :close-on-click-overlay="false" title="报名信息" v-model="visible">
|
||||||
<van-nav-bar title="报名信息" left-text="返回" left-arrow @click-left="visible = false" fixed placeholder></van-nav-bar>
|
|
||||||
<van-form ref="formRef" class="form-container">
|
<van-form ref="formRef" class="form-container">
|
||||||
<van-cell-group title="活动信息" class="form-section">
|
<van-cell-group title="活动信息" class="form-section">
|
||||||
<van-field label="活动名称" readonly v-model="row.courseName"></van-field>
|
<van-field label="活动名称" readonly v-model="row.courseName"></van-field>
|
||||||
@@ -18,12 +17,12 @@ const applyForm = {
|
|||||||
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
|
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
|
||||||
<van-field label="性别" readonly v-model="formData.sex"></van-field>
|
<van-field label="性别" readonly v-model="formData.sex"></van-field>
|
||||||
<template v-if="row.courseIsLimitApply">
|
<template v-if="row.courseIsLimitApply">
|
||||||
<van-field label="报名时段"
|
<van-field label="报名时段"
|
||||||
required
|
required
|
||||||
:rules="[{ required: true, message: '请选择报名时段' }]"
|
:rules="[{ required: true, message: '请选择报名时段' }]"
|
||||||
readonly
|
readonly
|
||||||
@click="showCoursePicker = true"
|
@click="showCoursePicker = true"
|
||||||
placeholder="请选择报名时段"
|
placeholder="请选择报名时段"
|
||||||
name="courseTimeName"
|
name="courseTimeName"
|
||||||
v-model="formData.courseTimeName">
|
v-model="formData.courseTimeName">
|
||||||
</van-field>
|
</van-field>
|
||||||
@@ -39,11 +38,11 @@ const applyForm = {
|
|||||||
<train-dynamic-form v-model="dynamicColumnsData" ref="dynamicForm"></train-dynamic-form>
|
<train-dynamic-form v-model="dynamicColumnsData" ref="dynamicForm"></train-dynamic-form>
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
|
|
||||||
<div class="form-actions">
|
<div class="button">
|
||||||
<van-button @click="onSubmit" round type="info">提交</van-button>
|
<van-button @click="onSubmit" round type="info">提交</van-button>
|
||||||
</div>
|
</div>
|
||||||
</van-form>
|
</van-form>
|
||||||
</van-popup>
|
</van-action-sheet>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
data() {
|
data() {
|
||||||
@@ -61,15 +60,15 @@ const applyForm = {
|
|||||||
"train-dynamic-form": httpVueLoader("/components/module/trainSignUp/TrainDynamicForm.vue")
|
"train-dynamic-form": httpVueLoader("/components/module/trainSignUp/TrainDynamicForm.vue")
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async onOpen(row, course) {
|
async onOpen(row, courseType) {
|
||||||
this.row = row
|
this.row = row
|
||||||
this.init(row, course)
|
this.init(row, courseType)
|
||||||
if(row.courseIsLimitApply) {
|
if(row.courseIsLimitApply) {
|
||||||
await this.getCourseTimeSelectList(row)
|
await this.getCourseTimeSelectList(row)
|
||||||
}
|
}
|
||||||
this.visible = true
|
this.visible = true
|
||||||
},
|
},
|
||||||
init(row, course) {
|
init(row, courseType) {
|
||||||
this.$set(this.formData, 'username', this.$store.state.user.username)
|
this.$set(this.formData, 'username', this.$store.state.user.username)
|
||||||
this.$set(this.formData, 'loginname', this.$store.state.user.loginname)
|
this.$set(this.formData, 'loginname', this.$store.state.user.loginname)
|
||||||
this.$set(this.formData, 'unionName', this.$store.state.user.union.name)
|
this.$set(this.formData, 'unionName', this.$store.state.user.union.name)
|
||||||
@@ -78,7 +77,7 @@ const applyForm = {
|
|||||||
this.$set(this.formData, 'activityId', row.activityId)
|
this.$set(this.formData, 'activityId', row.activityId)
|
||||||
this.$set(this.formData, 'courseId', row.id)
|
this.$set(this.formData, 'courseId', row.id)
|
||||||
|
|
||||||
this.dynamicColumnsData = course ? course.trainMobileSignColumnList : []
|
this.dynamicColumnsData = courseType ? courseType.trainMobileSignColumnList : []
|
||||||
this.dynamicColumnsData.forEach((item) => {
|
this.dynamicColumnsData.forEach((item) => {
|
||||||
item.columnValue = this.$store.state.user[item.columnCode] || ""
|
item.columnValue = this.$store.state.user[item.columnCode] || ""
|
||||||
})
|
})
|
||||||
@@ -151,6 +150,10 @@ const applyForm = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
style: /*language=CSS*/ `
|
style: /*language=CSS*/ `
|
||||||
|
.button {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,11 +37,16 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</template>
|
</template>
|
||||||
<template v-slot="{index,row}">
|
<template v-slot="{index,row}">
|
||||||
<table-column label="类型">{{row.typeName}}</table-column>
|
<table-column label="类型">{{row.typeName}}</table-column>
|
||||||
|
<table-column label="校区">{{row.campus}}</table-column>
|
||||||
<table-column label="地点">{{row.courseLocation}}</table-column>
|
<table-column label="地点">{{row.courseLocation}}</table-column>
|
||||||
<table-column label="联系人">{{row.courseInstructor}}</table-column>
|
<table-column label="联系人">{{row.courseInstructor}}</table-column>
|
||||||
<table-column label="时间">
|
<table-column label="时间">
|
||||||
<span v-if="row.courseTimes && row.courseTimes.length === 1">
|
<span v-if="row.courseTimes && row.courseTimes.length === 1" class="primary-color" @click="onTime(row)">
|
||||||
{{ $moment(row.courseTimes[0].courseStartTime).format('HH:mm') + '~' + $moment(row.courseTimes[0].courseEndTime).format('HH:mm') }}
|
{{ weekdayCNMap[$moment(row.courseTimes[0].courseDate).day()]
|
||||||
|
+ ' '
|
||||||
|
+ $moment(row.courseTimes[0].courseStartTime).format('MM月DD日 HH:mm')
|
||||||
|
+ '~'
|
||||||
|
+ $moment(row.courseTimes[0].courseEndTime).format('HH:mm') }}
|
||||||
</span>
|
</span>
|
||||||
<span v-else @click="onTime(row)" class="primary-color">点我查看</span>
|
<span v-else @click="onTime(row)" class="primary-color">点我查看</span>
|
||||||
</table-column>
|
</table-column>
|
||||||
@@ -74,10 +79,9 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</template>
|
</template>
|
||||||
</table-list>
|
</table-list>
|
||||||
|
|
||||||
<van-popup v-model="introduceVisible" position="right" :style="{ width: '100%', height: '100%', 'background-color': '#F7F8FA' }">
|
<van-action-sheet :close-on-click-overlay="false" title="详细信息" v-model="introduceVisible" cancel-text="取消">
|
||||||
<van-nav-bar title="详细信息" left-text="返回" left-arrow @click-left="introduceVisible = false" fixed placeholder></van-nav-bar>
|
<pdf-preview :content="introduceRow.introduce"></pdf-preview>
|
||||||
<pdf-preview style="height: calc(100vh - 46px)" :content="introduceRow.introduce"></pdf-preview>
|
</van-action-sheet>
|
||||||
</van-popup>
|
|
||||||
|
|
||||||
<times ref="timesRef"></times>
|
<times ref="timesRef"></times>
|
||||||
<apply-form ref="formRef" @refresh="refresh"></apply-form>
|
<apply-form ref="formRef" @refresh="refresh"></apply-form>
|
||||||
@@ -114,6 +118,8 @@ layout("/layouts/platform_h5.html"){
|
|||||||
|
|
||||||
introduceRow: {},
|
introduceRow: {},
|
||||||
activity: {},
|
activity: {},
|
||||||
|
|
||||||
|
weekdayCNMap: {0: '周日', 1: '周一', 2: '周二', 3: '周三', 4: '周四', 5: '周五', 6: '周六'},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -131,7 +137,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
this.$refs.timesRef.onOpen(row)
|
this.$refs.timesRef.onOpen(row)
|
||||||
},
|
},
|
||||||
onApply(row) {
|
onApply(row) {
|
||||||
const course = this.sourceTypeOptions.find((v) => v.id === row.courseType)
|
const courseType = this.sourceTypeOptions.find((v) => v.id === row.courseType)
|
||||||
this.$axios.post('/platform/trainSingUp/apply/validateSignUp', {
|
this.$axios.post('/platform/trainSingUp/apply/validateSignUp', {
|
||||||
courseId: row.id
|
courseId: row.id
|
||||||
})
|
})
|
||||||
@@ -151,7 +157,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
confirmButtonColor: '#1867b0'
|
confirmButtonColor: '#1867b0'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.$refs.formRef.onOpen(row, course)
|
this.$refs.formRef.onOpen(row, courseType)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -172,6 +178,9 @@ layout("/layouts/platform_h5.html"){
|
|||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
calcSignUpCount(row) {
|
calcSignUpCount(row) {
|
||||||
|
if(!row.coursePeopleNumber || row.coursePeopleNumber === 0) {
|
||||||
|
return "名额数不限制"
|
||||||
|
}
|
||||||
let lave = row.coursePeopleNumber - (row.hasRegisterNum + row.courseReservedNumber)
|
let lave = row.coursePeopleNumber - (row.hasRegisterNum + row.courseReservedNumber)
|
||||||
if(row.reserveMode === 2) {
|
if(row.reserveMode === 2) {
|
||||||
let lave2 = row.waitingNum - row.hasWaitingNum
|
let lave2 = row.waitingNum - row.hasWaitingNum
|
||||||
|
|||||||
@@ -11,9 +11,12 @@ layout("/layouts/platform_h5.html"){
|
|||||||
text-align: center !important;
|
text-align: center !important;
|
||||||
}
|
}
|
||||||
.info-container {
|
.info-container {
|
||||||
height: calc(100vh - 46px - 44px);
|
|
||||||
min-height: calc(100vh - 46px - 44px);
|
}
|
||||||
overflow-y: auto;
|
.button {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.info-img {
|
.info-img {
|
||||||
display: block;
|
display: block;
|
||||||
@@ -62,17 +65,16 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</template>
|
</template>
|
||||||
</table-list>
|
</table-list>
|
||||||
|
|
||||||
<van-popup v-model="infoVisible" position="right" :style="{ width: '100%', height: '100%' }">
|
<van-action-sheet :close-on-click-overlay="false" title="活动详细信息" v-model="infoVisible" cancel-text="取消">
|
||||||
<van-nav-bar title="详细信息" left-text="返回" left-arrow @click-left="infoVisible = false" fixed placeholder></van-nav-bar>
|
|
||||||
|
|
||||||
<div class="info-container">
|
<div class="info-container">
|
||||||
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
|
<div>
|
||||||
<div class="info-title">{{infoRow.activityName}}</div>
|
<van-image class="info-img" height="186" width="100%" :src="infoRow.cover"></van-image>
|
||||||
<pdf-preview style="height: calc(100vh - 46px - 44px - 186px - 57px)" :content="infoRow.introduce"></pdf-preview>
|
<div class="info-title">{{infoRow.activityName}}</div>
|
||||||
|
<pdf-preview :content="infoRow.introduce"></pdf-preview>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</van-action-sheet>
|
||||||
<van-button @click="onApply(infoRow)" type="primary" block>下一步</van-button>
|
|
||||||
</van-popup>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,817 +0,0 @@
|
|||||||
<!--#
|
|
||||||
layout("/layouts/platform_h5.html"){
|
|
||||||
#-->
|
|
||||||
<style>
|
|
||||||
.van-card {
|
|
||||||
background: #ffffff;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-card__thumb {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-card__content > div {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-doc-card {
|
|
||||||
margin: 14px;
|
|
||||||
padding: 16px;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 10px;
|
|
||||||
box-shadow: 0 8px 12px #ebedf0;
|
|
||||||
line-height: 25px;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-doc-card-my {
|
|
||||||
margin: 14px;
|
|
||||||
padding: 16px;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 10px;
|
|
||||||
box-shadow: 0 8px 12px #ebedf0;
|
|
||||||
line-height: 25px;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.train-title {
|
|
||||||
color: grey;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
padding: 16px 16px 10px;
|
|
||||||
min-height: 100px;
|
|
||||||
max-height: 360px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text {
|
|
||||||
color: #cccdd1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time {
|
|
||||||
font-family: -webkit-pictograph, serif;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup {
|
|
||||||
width: 90%;
|
|
||||||
max-height: 70%;
|
|
||||||
overflow-y: auto;
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 2px 10px 12px 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-card__thumb {
|
|
||||||
width: 35px;
|
|
||||||
height: 38px;
|
|
||||||
margin-right: 20px;
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-card__content {
|
|
||||||
min-height: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-card__title {
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 13px;
|
|
||||||
margin-top: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-dropdown-menu__item {
|
|
||||||
flex: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-empty {
|
|
||||||
background-color: transparent;
|
|
||||||
position: relative;
|
|
||||||
transform: translate(0%, 50%);
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.joinPopup {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: #f6f7f9;
|
|
||||||
}
|
|
||||||
|
|
||||||
.join_content {
|
|
||||||
padding: 20px;
|
|
||||||
/*height: calc(100% - 40px - 46px - 60px);*/
|
|
||||||
height: calc(100vh - 46px - 50px);
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.join_submit {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-card-header {
|
|
||||||
padding: 14px 20px;
|
|
||||||
border-bottom: 1px solid #ebeef5;
|
|
||||||
box-sizing: border-box;
|
|
||||||
color: #0e78c5;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-card-body {
|
|
||||||
padding: 0px 10px 0px 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-doc-card-two {
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 10px;
|
|
||||||
box-shadow: 0 8px 12px #ebedf0;
|
|
||||||
line-height: 25px;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer .van-button {
|
|
||||||
border-radius: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.amap-logo {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.amap-copyright {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-tabs__nav--complete {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<div id="app" v-cloak>
|
|
||||||
<van-nav-bar
|
|
||||||
:title="trainType + '列表'"
|
|
||||||
left-text="返回"
|
|
||||||
left-arrow
|
|
||||||
@click-left="$pjaxReplace('/platform/mobile/trainSignUpActivity/trainList?isMySign=' + isMySign)"
|
|
||||||
></van-nav-bar>
|
|
||||||
|
|
||||||
<van-sticky>
|
|
||||||
<van-dropdown-menu>
|
|
||||||
<van-dropdown-item @change="tabChange" v-model="activityStatus" :options="activityOptions"></van-dropdown-item>
|
|
||||||
<van-dropdown-item @change="courseChange" v-model="courseType" :options="courseOptions"></van-dropdown-item>
|
|
||||||
</van-dropdown-menu>
|
|
||||||
</van-sticky>
|
|
||||||
|
|
||||||
<van-tabs v-if="activityStatus != '1' && assortList.length > 0" v-model="assort" type="card" style="margin-top: 10px" @click="tabClick">
|
|
||||||
<van-tab v-for="item in assortList" :key="item" :name="item" :title="item"></van-tab>
|
|
||||||
</van-tabs>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div id="parentDiv" v-if="tableData.courseList && tableData.courseList.length>0">
|
|
||||||
<template v-for="o in tableData.courseList">
|
|
||||||
<div style="position: relative" :class="activityStatus !== '1' ? 'van-doc-card' : 'van-doc-card-my'">
|
|
||||||
<div>
|
|
||||||
<van-tag :plain="false" type="primary" size="medium">{{getCourseTypeName(o)}}</van-tag>
|
|
||||||
<span style="font-weight: bold; font-size: 14px">
|
|
||||||
{{o.courseName}}
|
|
||||||
<span v-if="activityStatus !== '1'">
|
|
||||||
<span v-html="calcSignUpCount(o)"></span>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span class="train-title">校  区:</span>
|
|
||||||
<span>{{o.campus}}</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span class="train-title">活动地点:</span>
|
|
||||||
<span>{{o.courseLocation}}</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span class="train-title">联 系 人:</span>
|
|
||||||
<span>{{o.courseInstructor}}</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span class="train-title">活动时间:</span>
|
|
||||||
<span v-if="o.courseTimeList && o.courseTimeList.length > 1" @click="trainClick(o)" style="color: #1867b0">点我查看</span>
|
|
||||||
<span @click="trainClick(o)" v-if="o.courseTimeList && o.courseTimeList.length === 1" style="color: #1867b0">
|
|
||||||
{{o.courseTimeList[0].courseStartTime.substring(11, 19) + ' ~ ' + o.courseTimeList[0].courseEndTime.substring(11, 19)}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span @click.stop="showPic(tableData.wechat)" v-if="o.isSign === true && tableData.wechat" style="color: #dd6363">
|
|
||||||
点我查看微信群二维码
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<van-button
|
|
||||||
type="primary"
|
|
||||||
round
|
|
||||||
size="mini"
|
|
||||||
v-if="activityStatus !== '1' && o.isSign === false"
|
|
||||||
style="position: absolute; left: 74%; bottom: 10%; width: 74px; height: 28px"
|
|
||||||
@click.stop="signUp(o)"
|
|
||||||
>
|
|
||||||
我要报名
|
|
||||||
</van-button>
|
|
||||||
|
|
||||||
<van-button
|
|
||||||
type="primary"
|
|
||||||
color="#dd6363"
|
|
||||||
round
|
|
||||||
size="mini"
|
|
||||||
v-if="o.isSign === true && $moment().valueOf() < $moment(activity.activitySignUpEndTime).valueOf()"
|
|
||||||
style="position: absolute; left: 74%; bottom: 10%; width: 74px; height: 28px"
|
|
||||||
@click.stop="cancel(o)"
|
|
||||||
>
|
|
||||||
取消报名
|
|
||||||
</van-button>
|
|
||||||
|
|
||||||
<image
|
|
||||||
v-if="activityStatus !== '1' && o.isSign === true && $moment().valueOf() >= $moment(activity.activitySignUpEndTime).valueOf()"
|
|
||||||
style="position: absolute; left: 77%; top: 58%"
|
|
||||||
src="/assets/mobile/svg/trainSignUp/sign_up.svg"
|
|
||||||
></image>
|
|
||||||
|
|
||||||
<div
|
|
||||||
@click="trainClick(o)"
|
|
||||||
v-if="activityStatus === '1'"
|
|
||||||
style="
|
|
||||||
text-align: center;
|
|
||||||
line-height: 40px;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 14px;
|
|
||||||
position: absolute;
|
|
||||||
right: -10px;
|
|
||||||
top: 8%;
|
|
||||||
background-color: #00c698;
|
|
||||||
border-radius: 7px;
|
|
||||||
color: white;
|
|
||||||
"
|
|
||||||
>
|
|
||||||
签到
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
<van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据"></van-empty>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<van-popup v-model:show="popupShow" class="popup">
|
|
||||||
<div id="map" v-if="course.isMobileSign === true && course.signType === 3" style="width: 100%; height: 250px"></div>
|
|
||||||
|
|
||||||
<van-card
|
|
||||||
:title="item.courseStartTime.substring(0, 10) + '(' +
|
|
||||||
getWeek(item.courseStartTime.substring(0, 10)) + ')'"
|
|
||||||
v-for="(item,index) in qdArray"
|
|
||||||
:key="index"
|
|
||||||
thumb="/assets/mobile/svg/trainSignUp/qd1.svg"
|
|
||||||
>
|
|
||||||
<template #desc>
|
|
||||||
<div style="margin-top: 7px">{{item.courseStartTime.substring(11, 19) + ' ~ ' + item.courseEndTime.substring(11, 19)}}</div>
|
|
||||||
<div v-if="item.courseLocationCoordinates && item.isMobileSign === true && activityStatus === '1'">
|
|
||||||
<van-button
|
|
||||||
type="primary"
|
|
||||||
color="#1867b0"
|
|
||||||
round
|
|
||||||
size="mini"
|
|
||||||
@click.stop="showQRCode(item, 2)"
|
|
||||||
v-if="(item.isAttend === true && course.giftType === 1 && item.state === 1)
|
|
||||||
|| ($moment().unix() > $moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === true && course.giftType === 1)"
|
|
||||||
style="position: absolute; right: 65px; top: 25%; width: 60px; height: 25px"
|
|
||||||
>
|
|
||||||
礼品码
|
|
||||||
</van-button>
|
|
||||||
<van-button
|
|
||||||
type="primary"
|
|
||||||
color="#e1e1e1"
|
|
||||||
round
|
|
||||||
size="mini"
|
|
||||||
v-if="(item.isAttend === false && findTime(item) === false && item.state === 1)
|
|
||||||
|| ($moment().unix() > $moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === false)"
|
|
||||||
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px"
|
|
||||||
>
|
|
||||||
未签到
|
|
||||||
</van-button>
|
|
||||||
<van-button
|
|
||||||
type="primary"
|
|
||||||
color="#1867b0"
|
|
||||||
round
|
|
||||||
size="mini"
|
|
||||||
v-if="(item.isAttend === false && findTime(item) === true && item.state === 1)
|
|
||||||
|| ($moment().unix() > $moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === false)"
|
|
||||||
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px"
|
|
||||||
@click.stop="signIn(item)"
|
|
||||||
>
|
|
||||||
签 到
|
|
||||||
</van-button>
|
|
||||||
<van-button
|
|
||||||
type="primary"
|
|
||||||
color="#61ce98"
|
|
||||||
round
|
|
||||||
size="mini"
|
|
||||||
v-if="(item.isAttend === true && item.state === 1)
|
|
||||||
|| ($moment().unix() > $moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === true)"
|
|
||||||
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px"
|
|
||||||
>
|
|
||||||
已签到
|
|
||||||
</van-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</van-card>
|
|
||||||
</van-popup>
|
|
||||||
|
|
||||||
<van-popup class="joinPopup" position="right" v-model:show="joinPopup">
|
|
||||||
<van-nav-bar @click-left="joinPopup = false" left-text="返回" fixed left-arrow placeholder title="活动报名"></van-nav-bar>
|
|
||||||
<div class="join_content">
|
|
||||||
<van-form @submit="joinSubmit" :show-error-message="false">
|
|
||||||
<div class="van-doc-card-two" style="margin: 0 0 16px 0">
|
|
||||||
<div></div>
|
|
||||||
<div class="van-card-header">基础信息</div>
|
|
||||||
<div class="van-card-body">
|
|
||||||
<van-field name="userName" label="姓名" readonly v-model="formData.userName"></van-field>
|
|
||||||
<van-field name="loginName" label="工号" readonly v-model="formData.loginName"></van-field>
|
|
||||||
<van-field name="unitName" label="所在单位" readonly v-model="formData.unitName"></van-field>
|
|
||||||
<van-field name="unionName" label="所属工会" readonly v-model="formData.unionName"></van-field>
|
|
||||||
<van-field name="sex" label="性别" readonly v-model="formData.sex"></van-field>
|
|
||||||
<van-field
|
|
||||||
label="联系方式"
|
|
||||||
required
|
|
||||||
name="mobile"
|
|
||||||
:rules="[{ required: true, message: '请填写联系方式' }]"
|
|
||||||
placeholder="请填写联系方式"
|
|
||||||
v-model="formData.mobile"
|
|
||||||
></van-field>
|
|
||||||
<train-dynamic-form v-model="dynamicColumnsData" ref="trainDynamicForm"></train-dynamic-form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="footer">
|
|
||||||
<van-button class="join_submit" type="primary">提交报名</van-button>
|
|
||||||
</div>
|
|
||||||
</van-form>
|
|
||||||
</div>
|
|
||||||
</van-popup>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="${base!}/assets/platform/plugins/jr-qrcode/jr-qrcode.js"></script>
|
|
||||||
<script>
|
|
||||||
let locations = null
|
|
||||||
let map = null
|
|
||||||
let geolocation = null
|
|
||||||
new Vue({
|
|
||||||
el: "#app",
|
|
||||||
store,
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
loading: false,
|
|
||||||
tableData: [],
|
|
||||||
formData: {},
|
|
||||||
assort: "",
|
|
||||||
assortList: [],
|
|
||||||
allColumnsData: [],
|
|
||||||
dynamicColumnsData: [],
|
|
||||||
trainType: "培训班",
|
|
||||||
trainTypeList: [],
|
|
||||||
actionShow: false,
|
|
||||||
timeList: [],
|
|
||||||
activityId: "",
|
|
||||||
activityStatus: "0",
|
|
||||||
joinPopup: false,
|
|
||||||
popupShow: false,
|
|
||||||
courseText: "",
|
|
||||||
qdInfoList: [],
|
|
||||||
course: [],
|
|
||||||
qdArray: [],
|
|
||||||
activityOptions: [
|
|
||||||
{ text: "全部", value: "0" },
|
|
||||||
{ text: "我报名的", value: "1" }
|
|
||||||
],
|
|
||||||
courseOptions: [],
|
|
||||||
courseType: "0",
|
|
||||||
tempArray: [],
|
|
||||||
activitySignUpStartTime: null,
|
|
||||||
choose: {},
|
|
||||||
activity: "",
|
|
||||||
isMySign: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
"train-dynamic-form": httpVueLoader("/components/module/trainSignUp/TrainDynamicForm.vue")
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
tabClick(name, title) {
|
|
||||||
if (this.courseType === "0" && this.activityStatus !== "1") {
|
|
||||||
this.tableData.courseList = this.tempArray.courseList.filter((o) => o.assort === title)
|
|
||||||
} else {
|
|
||||||
this.tableData.courseList = this.tempArray.courseList.filter((o) => o.assort === title && o.courseType === this.courseType)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
calcSignUpCount(o) {
|
|
||||||
let lave = (o.coursePeopleNumber + o.hasWaitingNum) - (o.hasRegisterNum + o.courseReservedNumber)
|
|
||||||
if(o.reserveMode === 2) {
|
|
||||||
let lave2 = o.waitingNum - o.hasWaitingNum
|
|
||||||
let str = "(<span style='color: red'>余" + lave +"</span>/" + o.coursePeopleNumber + "人"
|
|
||||||
+ ",<span style='color: red'>候补余" + lave2 + "</span>/" + o.waitingNum + "人)"
|
|
||||||
return str
|
|
||||||
} else {
|
|
||||||
return "(<span style='color: red'>余" + lave +"</span>/" + o.coursePeopleNumber + "人)"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getCourseTypeName(o) {
|
|
||||||
const b = this.courseOptions.find((item) => item.value === o.courseType)
|
|
||||||
return b ? b.text : ""
|
|
||||||
},
|
|
||||||
//二维码
|
|
||||||
showQRCode(item, type) {
|
|
||||||
const o = {
|
|
||||||
userId: item.userId,
|
|
||||||
signId: item.id,
|
|
||||||
activityId: item.activityId,
|
|
||||||
activityCourseId: item.activityCourseId,
|
|
||||||
isMobileSign: item.isMobileSign,
|
|
||||||
signType: item.signType,
|
|
||||||
isReceiveGift: item.isReceiveGift,
|
|
||||||
giftType: item.giftType,
|
|
||||||
type: type
|
|
||||||
}
|
|
||||||
// 生成二维码的 base64 编码
|
|
||||||
const content = jrQrcode.getQrBase64(JSON.stringify(o))
|
|
||||||
vant.ImagePreview([content])
|
|
||||||
},
|
|
||||||
showPic(url) {
|
|
||||||
vant.ImagePreview([url])
|
|
||||||
},
|
|
||||||
findTime(o) {
|
|
||||||
const today = this.$moment().format("YYYY-MM-DD")
|
|
||||||
return o.courseStartTime.substr(0, 10) === today
|
|
||||||
},
|
|
||||||
findQd() {
|
|
||||||
const today = this.$moment().format("YYYY-MM-DD")
|
|
||||||
const day = this.qdInfoList.find((item) => {
|
|
||||||
return item.courseStartTime.substr(0, 10) === today
|
|
||||||
})
|
|
||||||
if (day === undefined) {
|
|
||||||
return 3
|
|
||||||
} else {
|
|
||||||
return day.isAttend ? 2 : 1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async signIn(o) {
|
|
||||||
if (o.signType === 1) {
|
|
||||||
vant.Dialog.alert({ message: "功能马上推出,敬请期待!" })
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (o.signType === 2) {
|
|
||||||
this.showQRCode(o, 1)
|
|
||||||
}
|
|
||||||
if (o.signType === 3) {
|
|
||||||
const start = new Date(o.courseStartTime).getTime() - 1000 * 60 * 30
|
|
||||||
const end = new Date(o.courseEndTime).getTime()
|
|
||||||
|
|
||||||
const now = new Date().getTime()
|
|
||||||
if (now < start || now > end) {
|
|
||||||
vant.Toast("请在规定时间签到")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const that = this
|
|
||||||
geolocation.getCurrentPosition(async function (status, result) {
|
|
||||||
if (status === "complete") {
|
|
||||||
locations = [result.position.getLng(), result.position.getLat()]
|
|
||||||
//用户当前位置
|
|
||||||
const userPoint = new AMap.LngLat(result.position.getLng(), result.position.getLat())
|
|
||||||
//课程位置
|
|
||||||
const coursePoint = new AMap.LngLat(that.course.courseLocationCoordinates[0], that.course.courseLocationCoordinates[1])
|
|
||||||
const distance = Math.round(userPoint.distance(coursePoint))
|
|
||||||
if (distance > 250) {
|
|
||||||
vant.Toast("请在250米内签到")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const array = [result.position.getLng(), result.position.getLat()]
|
|
||||||
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/doQd", {
|
|
||||||
id: o.id,
|
|
||||||
courseId: that.course.id,
|
|
||||||
point: JSON.stringify(array)
|
|
||||||
})
|
|
||||||
if (resp.code === 0) {
|
|
||||||
await that.pageData()
|
|
||||||
}
|
|
||||||
vant.Toast(resp.msg)
|
|
||||||
that.popupShow = false
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//获取当前坐标点
|
|
||||||
getPoint() {
|
|
||||||
/*return new Promise((resolve, reject) => {
|
|
||||||
window.navigator.geolocation.getCurrentPosition(position => {
|
|
||||||
pointArray = [position.coords.longitude, position.coords.latitude]
|
|
||||||
resolve(pointArray)
|
|
||||||
}, error => {
|
|
||||||
vant.Toast(error.message)
|
|
||||||
pointArray = []
|
|
||||||
reject([])
|
|
||||||
})
|
|
||||||
})*/
|
|
||||||
geolocation.getCurrentPosition(function (status, result) {
|
|
||||||
if (status === "complete") {
|
|
||||||
//alert(result.position)
|
|
||||||
locations = result.position
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
cancel(o) {
|
|
||||||
vant.Dialog.confirm({
|
|
||||||
title: "温馨提示",
|
|
||||||
message: "您确定要<span style='color: red'>取消【" + o.courseName + "】</span>吗?",
|
|
||||||
confirmButtonColor: "#1867b0"
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/cancelSignUp", {
|
|
||||||
activityId: o.activityId,
|
|
||||||
courseId: o.id
|
|
||||||
})
|
|
||||||
vant.Toast(resp.msg)
|
|
||||||
if (resp.code === 0) {
|
|
||||||
await this.pageData()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {})
|
|
||||||
},
|
|
||||||
async signUp(o) {
|
|
||||||
this.choose = o
|
|
||||||
|
|
||||||
const res = await this.$axios.post("/platform/mobile/trainSignUpActivity/validateSignUp", {
|
|
||||||
courseId: o.id
|
|
||||||
})
|
|
||||||
if (res.code !== 0) {
|
|
||||||
vant.Dialog.alert({
|
|
||||||
title: "提示",
|
|
||||||
message: res.msg
|
|
||||||
})
|
|
||||||
if (res.code !== 3) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.formData = {
|
|
||||||
userName: this.$store.state.user.username,
|
|
||||||
loginName: this.$store.state.user.loginname,
|
|
||||||
mobile: this.$store.state.user.mobile,
|
|
||||||
sex: this.$store.state.user.sex,
|
|
||||||
birthday: this.$store.state.user.birthday,
|
|
||||||
unionName: this.$store.state.user.union.name,
|
|
||||||
unitName: this.$store.state.user.unit.name
|
|
||||||
}
|
|
||||||
this.$set(this.formData, "activityId", o.activityId)
|
|
||||||
this.$set(this.formData, "courseId", o.id)
|
|
||||||
|
|
||||||
const column = this.allColumnsData.find((x) => x.id === o.courseType)
|
|
||||||
this.dynamicColumnsData = column ? column.trainMobileSignColumnList : []
|
|
||||||
this.dynamicColumnsData.forEach((item) => {
|
|
||||||
item.columnValue = ""
|
|
||||||
})
|
|
||||||
this.joinPopup = true
|
|
||||||
},
|
|
||||||
async joinSubmit() {
|
|
||||||
let valid = false
|
|
||||||
try {
|
|
||||||
await this.$refs.trainDynamicForm.$refs.form.validate()
|
|
||||||
valid = true
|
|
||||||
} catch (e) {
|
|
||||||
valid = false
|
|
||||||
}
|
|
||||||
if (!valid) return
|
|
||||||
//获取家属是多少人
|
|
||||||
let per = 0
|
|
||||||
this.dynamicColumnsData.forEach((item) => {
|
|
||||||
if (item.columnCode === "xdqsrs") {
|
|
||||||
per += Number(item.columnValue)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const res = await this.$axios.post("/platform/mobile/trainSignUpActivity/validateSignUp", {
|
|
||||||
courseId: this.choose.id,
|
|
||||||
currentFamilyNumber: per
|
|
||||||
})
|
|
||||||
if (res.code !== 0) {
|
|
||||||
vant.Dialog.alert({
|
|
||||||
title: "提示",
|
|
||||||
message: res.msg
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
vant.Dialog.confirm({
|
|
||||||
title: "温馨提示",
|
|
||||||
message: "您确定要选择【" + this.choose.courseName + "】吗?"
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
const toast = vant.Toast.loading({
|
|
||||||
duration: 0,
|
|
||||||
forbidClick: true,
|
|
||||||
overlay: true,
|
|
||||||
message: "努力提交中"
|
|
||||||
})
|
|
||||||
const mobileColumnsValue = this.dynamicColumnsData.map((v) => {
|
|
||||||
return {
|
|
||||||
columnName: v.columnName,
|
|
||||||
columnValue: v.columnValue,
|
|
||||||
columnCode: v.columnCode,
|
|
||||||
columnFormType: v.columnFormType
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.formData.mobileColumnsValue = JSON.stringify(mobileColumnsValue)
|
|
||||||
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/doSignUp", this.formData)
|
|
||||||
vant.Toast(resp.msg)
|
|
||||||
if (resp.code === 0) {
|
|
||||||
await this.pageData()
|
|
||||||
this.joinPopup = false
|
|
||||||
}
|
|
||||||
toast.clear()
|
|
||||||
})
|
|
||||||
.catch(() => {})
|
|
||||||
},
|
|
||||||
trainClick(o) {
|
|
||||||
this.timeList = o.courseTimeList
|
|
||||||
this.course = o
|
|
||||||
this.qdArray =
|
|
||||||
this.activityStatus === "0"
|
|
||||||
? o.courseTimeList
|
|
||||||
: this.qdInfoList.filter((item) => {
|
|
||||||
return item.courseId === o.id
|
|
||||||
})
|
|
||||||
if (o.signType === 3) {
|
|
||||||
this.initMap(o)
|
|
||||||
}
|
|
||||||
this.popupShow = true
|
|
||||||
},
|
|
||||||
initMap(o) {
|
|
||||||
if (o.courseLocationCoordinates && o.courseLocationCoordinates.length < 2) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$nextTick(async () => {
|
|
||||||
// 地图初始化应该在地图容器div已经添加到DOM树之后
|
|
||||||
map = new AMap.Map("map", {
|
|
||||||
zoom: 12,
|
|
||||||
center: o.courseLocationCoordinates,
|
|
||||||
resizeEnable: true,
|
|
||||||
scrollWheel: true
|
|
||||||
})
|
|
||||||
AMap.plugin("AMap.Geolocation", function () {
|
|
||||||
geolocation = new AMap.Geolocation({
|
|
||||||
// 是否使用高精度定位,默认:true
|
|
||||||
enableHighAccuracy: true,
|
|
||||||
// 设置定位超时时间,默认:无穷大
|
|
||||||
timeout: 10000,
|
|
||||||
// 定位按钮的停靠位置的偏移量,默认:Pixel(10, 20)
|
|
||||||
buttonOffset: new AMap.Pixel(10, 20),
|
|
||||||
// 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
|
|
||||||
//zoomToAccuracy: true,
|
|
||||||
// 定位按钮的排放位置, RB表示右下
|
|
||||||
buttonPosition: "RB",
|
|
||||||
showCircle: false
|
|
||||||
//showButton: false,
|
|
||||||
})
|
|
||||||
map.addControl(geolocation)
|
|
||||||
})
|
|
||||||
|
|
||||||
// 创建一个 Marker 实例:
|
|
||||||
var marker = new AMap.Marker({
|
|
||||||
position: new AMap.LngLat(o.courseLocationCoordinates[0], o.courseLocationCoordinates[1]), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
|
|
||||||
title: "签到点"
|
|
||||||
})
|
|
||||||
|
|
||||||
//获取当前坐标点
|
|
||||||
await this.getPoint()
|
|
||||||
|
|
||||||
var circle = new AMap.Circle({
|
|
||||||
center: new AMap.LngLat(o.courseLocationCoordinates[0], o.courseLocationCoordinates[1]), // 圆心位置
|
|
||||||
radius: 250, // 圆半径
|
|
||||||
borderWeight: 1,
|
|
||||||
strokeOpacity: 1,
|
|
||||||
fillOpacity: 0.4
|
|
||||||
})
|
|
||||||
|
|
||||||
map.add(circle)
|
|
||||||
// 缩放地图到合适的视野级别
|
|
||||||
map.setFitView([circle])
|
|
||||||
|
|
||||||
// 多个点实例组成的数组
|
|
||||||
var markerList = [marker]
|
|
||||||
map.add(markerList)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async pageData() {
|
|
||||||
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/findOne", {
|
|
||||||
id: this.activityId,
|
|
||||||
tabIndex: this.activityStatus
|
|
||||||
})
|
|
||||||
if (resp.code === 0) {
|
|
||||||
this.tableData = resp.data
|
|
||||||
this.assortList = Array.from(new Set(this.tableData.courseList.map((o) => o.assort).filter((o) => o !== "" && o !== undefined)))
|
|
||||||
this.tempArray = JSON.parse(JSON.stringify(this.tableData))
|
|
||||||
if (this.assortList.length > 0 && this.activityStatus !== "1") {
|
|
||||||
this.tableData.courseList = this.tableData.courseList.filter((o) => o.assort === this.assortList[0])
|
|
||||||
}
|
|
||||||
const type = this.trainTypeList.find((o) => o.code === this.tableData.trainType)
|
|
||||||
this.trainType = type ? type.name : "培训班"
|
|
||||||
} else {
|
|
||||||
this.tableData = []
|
|
||||||
this.loading = false
|
|
||||||
}
|
|
||||||
await this.getQdInfoList()
|
|
||||||
this.courseChange(this.courseType, 1)
|
|
||||||
this.loading = false
|
|
||||||
},
|
|
||||||
async getQdInfoList() {
|
|
||||||
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/getQdInfoList", {
|
|
||||||
activityId: this.activityId
|
|
||||||
})
|
|
||||||
if (resp.code === 0) {
|
|
||||||
this.qdInfoList = resp.data
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getWeek(dateString) {
|
|
||||||
var dateArray = dateString.split("-")
|
|
||||||
const date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2])
|
|
||||||
return "周" + "日一二三四五六".charAt(date.getDay())
|
|
||||||
},
|
|
||||||
tabChange(val) {
|
|
||||||
this.tabName = val
|
|
||||||
this.tableData = []
|
|
||||||
this.pageData()
|
|
||||||
},
|
|
||||||
async getAllType() {
|
|
||||||
const resp = await this.$axios.post("/platform/trainSingUp/type/getAllType", {})
|
|
||||||
this.allColumnsData = resp.data
|
|
||||||
return resp.data
|
|
||||||
},
|
|
||||||
async getCourseText() {
|
|
||||||
const courseArray = await this.getAllType()
|
|
||||||
this.courseOptions = []
|
|
||||||
this.courseOptions.push({ text: "全部类型", value: "0" })
|
|
||||||
for (const item of courseArray) {
|
|
||||||
if (item.personMaxRegisterNum > 0) {
|
|
||||||
this.courseText += item.value + "报名最多选" + item.personMaxRegisterNum + "项,"
|
|
||||||
}
|
|
||||||
this.courseOptions.push({ text: item.typeName, value: item.id })
|
|
||||||
}
|
|
||||||
this.courseText = this.courseText.substr(0, this.courseText.length - 1)
|
|
||||||
},
|
|
||||||
courseChange(value, item) {
|
|
||||||
if (item === undefined) {
|
|
||||||
this.tableData.courseList = []
|
|
||||||
}
|
|
||||||
if (this.assortList.length > 0 && this.activityStatus !== "1") {
|
|
||||||
if (value === "0") {
|
|
||||||
this.tableData.courseList = this.tempArray.courseList.filter((o) => o.assort === this.assort)
|
|
||||||
} else {
|
|
||||||
this.tableData.courseList = this.tempArray.courseList.filter(
|
|
||||||
(item) => item.courseType === value && item.assort === this.assort
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.tableData.courseList =
|
|
||||||
value === "0" ? this.tempArray.courseList : this.tempArray.courseList.filter((item) => item.courseType === value)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async getActivity() {
|
|
||||||
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/findOne", {
|
|
||||||
id: this.activityId,
|
|
||||||
tabIndex: 0
|
|
||||||
})
|
|
||||||
if (resp.code === 0) {
|
|
||||||
this.activity = resp.data
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async created() {
|
|
||||||
this.$businessTool.getDictOptions("TRAIN_SIGNUP_TYPE").then((data) => {
|
|
||||||
this.trainTypeList = data
|
|
||||||
})
|
|
||||||
this.activityId = GetQueryString("activityId")
|
|
||||||
this.isMySign = Number(GetQueryString("isMySign"))
|
|
||||||
const time = GetQueryString("endTime")
|
|
||||||
if (this.isMySign === 1) {
|
|
||||||
this.activityOptions = [{ text: "我报名的", value: "1" }]
|
|
||||||
this.activityStatus = "1"
|
|
||||||
} else {
|
|
||||||
this.activityOptions = [
|
|
||||||
{ text: "全部", value: "0" },
|
|
||||||
{ text: "我报名的", value: "1" }
|
|
||||||
]
|
|
||||||
this.activityStatus = new Date().getTime() > new Date(time).getTime() ? "1" : "0"
|
|
||||||
}
|
|
||||||
this.activitySignUpStartTime = GetQueryString("activitySignUpStartTime")
|
|
||||||
vant.Toast.setDefaultOptions({ duration: 2000 })
|
|
||||||
this.pageData()
|
|
||||||
await this.getCourseText()
|
|
||||||
await this.getActivity()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
<!--#
|
|
||||||
}
|
|
||||||
#-->
|
|
||||||
@@ -1,258 +0,0 @@
|
|||||||
<!--#
|
|
||||||
layout("/layouts/platform_h5.html"){
|
|
||||||
#-->
|
|
||||||
<style>
|
|
||||||
.van-card {
|
|
||||||
background: #ffffff;
|
|
||||||
margin: 10px auto 0;
|
|
||||||
width: 96%;
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 14px 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-card__thumb {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-card__content > div {
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.train-title {
|
|
||||||
flex: 0.6;
|
|
||||||
margin-top: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-doc-card {
|
|
||||||
margin: 14px;
|
|
||||||
padding: 12px;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 10px;
|
|
||||||
box-shadow: 0 8px 12px #ebedf0;
|
|
||||||
line-height: 20px;
|
|
||||||
font-size: 12px;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-divider {
|
|
||||||
margin: 6px 0 5px 0px;
|
|
||||||
border-color: #1867b0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-image__img {
|
|
||||||
max-height: 200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.van-image__error,
|
|
||||||
.van-image__loading {
|
|
||||||
height: 200px;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag {
|
|
||||||
position: absolute;
|
|
||||||
display: inline-block;
|
|
||||||
background-color: #1867b0;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 10px;
|
|
||||||
top: 1px;
|
|
||||||
border-radius: 6px;
|
|
||||||
right: -8px;
|
|
||||||
padding: 1px 7px;
|
|
||||||
transform: rotate(17deg);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<div id="app" v-cloak>
|
|
||||||
<van-nav-bar title="活动列表" @click-left="historyBack" left-arrow left-text="返回" placeholder fixed></van-nav-bar>
|
|
||||||
<van-sticky offset-top="46px">
|
|
||||||
<van-dropdown-menu>
|
|
||||||
<van-dropdown-item v-model="pageForm.year" :options="yearList" @change="formChange"></van-dropdown-item>
|
|
||||||
<van-dropdown-item v-model="pageForm.activityStatus" :options="activityStatusList" @change="formChange"></van-dropdown-item>
|
|
||||||
</van-dropdown-menu>
|
|
||||||
</van-sticky>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<van-list :finished="finished" finished-text="没有更多了" v-if="tableData && tableData.length>0" v-model="loading" @load="pageData">
|
|
||||||
<div v-for="o in tableData" class="van-doc-card">
|
|
||||||
<div>
|
|
||||||
<div class="tag" style="background-color: #bc62c5" v-if="o.isDisabled">活动未开启</div>
|
|
||||||
<div class="tag" v-else-if="!o.isDisabled && $moment(o.activitySignUpStartTime).valueOf() > $moment().valueOf()">未开始报名</div>
|
|
||||||
<div
|
|
||||||
class="tag"
|
|
||||||
v-else-if="!o.isDisabled && $moment(o.activitySignUpEndTime).valueOf() > $moment().valueOf() && $moment().valueOf() > $moment(o.activitySignUpStartTime).valueOf()"
|
|
||||||
>
|
|
||||||
报名中
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="tag"
|
|
||||||
style="background-color: #f14646"
|
|
||||||
v-else-if="!o.isDisabled && $moment(o.activityEndTime).valueOf() < $moment().valueOf() && $moment().valueOf() < $moment(o.activityStartTime).valueOf()"
|
|
||||||
>
|
|
||||||
报名结束
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="tag"
|
|
||||||
v-else-if="!o.isDisabled && $moment(o.activityStartTime).valueOf() < $moment().valueOf() && $moment().valueOf() < $moment(o.activityEndTime).valueOf()"
|
|
||||||
>
|
|
||||||
活动进行中
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="tag"
|
|
||||||
style="background-color: #f14646"
|
|
||||||
v-else-if="!o.isDisabled && $moment().valueOf() > $moment(o.activityEndTime).valueOf()"
|
|
||||||
>
|
|
||||||
活动结束
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div @click="activityClick(o)">
|
|
||||||
<div>
|
|
||||||
<van-image :src="o.cover" style="display: contents" v-if="o.cover"></van-image>
|
|
||||||
<van-image src="" style="display: contents" v-else></van-image>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div class="van-ellipsis" style="margin-top: 6px; font-size: 15px; font-weight: bold; flex: 1">{{o.activityName}}</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div class="train-title">
|
|
||||||
<span style="color: grey">年   度:</span>
|
|
||||||
<span>{{o.year}}</span>
|
|
||||||
</div>
|
|
||||||
<div class="train-title">
|
|
||||||
<span style="color: grey">活动对象:</span>
|
|
||||||
<span>{{o.activityGroupName}}</span>
|
|
||||||
</div>
|
|
||||||
<van-divider></van-divider>
|
|
||||||
</div>
|
|
||||||
<div class="train-title">
|
|
||||||
<span style="color: grey">报名时间:</span>
|
|
||||||
<span>{{$moment(o.activitySignUpStartTime).format('YYYY-MM-DD HH:mm')}}</span>
|
|
||||||
<span>~</span>
|
|
||||||
<span>{{$moment(o.activitySignUpEndTime).format('YYYY-MM-DD HH:mm') }}</span>
|
|
||||||
</div>
|
|
||||||
<div style="margin-top: 6px">
|
|
||||||
<span style="color: grey">活动时间:</span>
|
|
||||||
<span>{{$moment(o.activityStartTime).format('YYYY-MM-DD HH:mm')}}</span>
|
|
||||||
<span>~</span>
|
|
||||||
<span>{{$moment(o.activityEndTime).format('YYYY-MM-DD HH:mm') }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</van-list>
|
|
||||||
<van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据"></van-empty>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<van-tabbar v-model="pageForm.activityType" @change="doSearch">
|
|
||||||
<van-tabbar-item icon="wap-home-o">活动列表</van-tabbar-item>
|
|
||||||
<van-tabbar-item icon="user-o">我报名的</van-tabbar-item>
|
|
||||||
</van-tabbar>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
new Vue({
|
|
||||||
el: "#app",
|
|
||||||
store,
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
finished: false,
|
|
||||||
loading: false,
|
|
||||||
tableData: [],
|
|
||||||
tarBarActive: 0,
|
|
||||||
pageForm: {
|
|
||||||
year: "",
|
|
||||||
activityStatus: null,
|
|
||||||
pageNumber: 1,
|
|
||||||
pageSize: 5,
|
|
||||||
totalCount: 0,
|
|
||||||
searchKeyword: "",
|
|
||||||
activityType: 0
|
|
||||||
},
|
|
||||||
activityLevelList: [],
|
|
||||||
activityStatusList: [
|
|
||||||
{ text: "全部", value: 1 },
|
|
||||||
{ text: "未开始", value: 6 },
|
|
||||||
{ text: "报名中", value: 2 },
|
|
||||||
{ text: "进行中", value: 3 },
|
|
||||||
{ text: "已结束", value: 4 }
|
|
||||||
],
|
|
||||||
yearList: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
createYearList() {
|
|
||||||
for (let i = new Date().getFullYear() - 50; i <= new Date().getFullYear(); i++) {
|
|
||||||
this.yearList.unshift({ value: i, text: i + "年" })
|
|
||||||
}
|
|
||||||
},
|
|
||||||
doSearch() {
|
|
||||||
this.pageForm.pageNumber = 1
|
|
||||||
this.pageForm.totalCount = 0
|
|
||||||
this.tableData = []
|
|
||||||
this.pageData()
|
|
||||||
},
|
|
||||||
formChange() {
|
|
||||||
this.pageForm.pageNumber = 1
|
|
||||||
this.tableData = []
|
|
||||||
this.pageData()
|
|
||||||
},
|
|
||||||
async activityClick(o) {
|
|
||||||
if (o.isDisabled) {
|
|
||||||
this.$toast("活动未开启")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (this.$moment(o.applyStartTime).valueOf() > this.$moment().valueOf()) {
|
|
||||||
this.$toast("活动未开始报名")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$pjaxReplace(
|
|
||||||
"/platform/mobile/trainSignUpActivity/activityInfo?activityId=" +
|
|
||||||
o.id +
|
|
||||||
"&endTime=" +
|
|
||||||
o.activitySignUpEndTime +
|
|
||||||
"&isMySign=" +
|
|
||||||
this.pageForm.activityType
|
|
||||||
)
|
|
||||||
},
|
|
||||||
async pageData() {
|
|
||||||
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/pageData", this.pageForm)
|
|
||||||
if (resp.code === 0) {
|
|
||||||
if (resp.data.list.length === 0) {
|
|
||||||
this.tableData = []
|
|
||||||
this.loading = false
|
|
||||||
this.finished = true
|
|
||||||
} else {
|
|
||||||
this.tableData = this.tableData.concat(resp.data.list)
|
|
||||||
}
|
|
||||||
if (this.tableData.length === resp.data.totalCount) {
|
|
||||||
this.finished = true
|
|
||||||
} else {
|
|
||||||
this.pageForm.pageNumber++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.loading = false
|
|
||||||
},
|
|
||||||
tabChange(val) {
|
|
||||||
this.tabName = val
|
|
||||||
this.tableData = []
|
|
||||||
this.pageForm.pageNumber = 1
|
|
||||||
this.pageData()
|
|
||||||
},
|
|
||||||
async init() {
|
|
||||||
this.$set(this.pageForm, "activityStatus", 1)
|
|
||||||
this.$set(this.pageForm, "year", new Date().getFullYear())
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async created() {
|
|
||||||
this.createYearList()
|
|
||||||
await this.init()
|
|
||||||
this.pageData()
|
|
||||||
this.pageForm.activityType = Number(GetQueryString("isMySign"))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
<!--#
|
|
||||||
}
|
|
||||||
#-->
|
|
||||||
Reference in New Issue
Block a user