Merge remote-tracking branch 'origin/main'

This commit is contained in:
@jyuhsin
2026-01-04 14:29:37 +08:00
35 changed files with 569 additions and 205 deletions
@@ -1,5 +1,6 @@
package com.budwk.app.sys.controller;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
@@ -77,9 +78,7 @@ public class SysLoginController {
@At("/noPermission")
@Ok("beetl:/platform/sys/noPermission.html")
@Filters
public void noPermission() {
}
public void noPermission() {}
@At("/doLogin")
@Ok("json")
@@ -142,43 +141,22 @@ public class SysLoginController {
@At
@Ok("json")
@ApiOperation("小程序账号密码登录")
public Result weAppLogin(@Param("username") String username, @Param("password") String password, HttpServletRequest req) {
if (StrUtil.isBlank(username)) {
return Result.error("用户名不能为空");
}
if (StrUtil.isBlank(password)) {
return Result.error("密码不能为空");
}
String lockKey = RedisConstant.USER_LOGIN_LOCK_PREFIX + username;
int errCount = Convert.toInt(StrUtil.blankToDefault(redisService.get(lockKey), "0"));
log.info("用户名:" + username + "登录失败次数:" + errCount);
if (errCount > 5) {
redisService.setex(lockKey, 5 * 60, String.valueOf(errCount + 1));
return Result.error("登录失败次数过多,请5分钟后再试");
}
try {
Sys_user user = sysUserService.loginByIdCardLastNum(username, password);
if (user == null) {
throw new BaseException("用户登录失败");
}
sysUserService.loginPlus(user, LoginType.WE_APP, req);
// redisService.del(lockKey);
return Result.success("login.success").addData(StpUtil.getTokenInfo());
} catch (Exception e) {
log.error(e.getMessage(), e);
redisService.set(lockKey, Convert.toStr(errCount + 1));
return Result.error(e.getMessage());
}
@Ok("re")
@SaCheckLogin
@ApiOperation("小程序桥接界面")
public String weAppLogin() {
return "beetl:/platform/zhghh5/sys/weappcheck/index.html";
}
@At
@Ok("json")
@ApiOperation("登录信息")
@SaCheckLogin
public Result getWeAppToken(){
return Result.success("login.success").addData(StpUtil.getTokenInfo());
}
@At(value = "/platform/wxwork/oauth2/callback", top = true)
@Ok("re")
@@ -305,7 +305,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
String decodePwd = Base64Decoder.decodeStr(passowrd);
String hashedPassword = PwdUtil.getPassword(decodePwd, user.getSalt());
if (!Strings.sNull(hashedPassword).equalsIgnoreCase(user.getPassword())) {
// throw new BaseException("用户名或者密码不正确");
throw new BaseException("用户名或者密码不正确");
}
user = this.fetchLinks(user, "unit");
if (Lang.isNotEmpty(user.getUnit()) && StrUtil.isNotBlank(user.getUnit().getUnionId())) {
@@ -320,7 +320,9 @@ public class ActivityBasicScopeController {
if (activityUserScopePageParam.getActivityGroupId() != null) {
Sql sqlx = Sqls.createf("SELECT userId FROM activity_user_scope where groupId = '%s'", activityUserScopePageParam.getActivityGroupId());
cnd.and("u.id", activityUserScopePageParam.getReverseSelection() ? "IN" : "NOT IN", sqlx);
List<NutMap> userList = baseService.listMap(sqlx);
List<String> userIds = userList.stream().map(v -> v.getString("userId")).toList();
cnd.and("u.id", activityUserScopePageParam.getReverseSelection() ? "IN" : "NOT IN", userIds);
}
cnd.andEX("u.id", IN_OR_NIN_OP, activityUserScopePageParam.getUserId());
@@ -49,7 +49,7 @@ public class QsvSurveyServiceImpl extends BaseServiceImpl<QsvUserAnswerRecord> i
try {
// 查询用户答题记录
List<QsvUserAnswerRecord> answerRecords = dao().query(QsvUserAnswerRecord.class, Cnd.where(QsvUserAnswerRecord::getActivityId, "=", activityId));
List<QsvUserAnswerRecord> answerRecords = dao().query(QsvUserAnswerRecord.class, Cnd.where(QsvUserAnswerRecord::getActivityId, "=", activityId).and("isFinish","=",1));
// 将答题记录的扩展JSON转换为JSONObject列表
List<JSONObject> answerExtList = answerRecords.stream().map(QsvUserAnswerRecord::getExtJson).toList();
@@ -88,11 +88,23 @@ public class ActivitySchoolEvent extends BaseModel implements Serializable {
@ColDefine(type = ColType.INT, width = 8)
private Integer leanderNum;
@Column
@Comment("领队是否必须是运动员")
@ColDefine(type = ColType.BOOLEAN)
@Default("0")
private Boolean leanderIsAthlete;
@Column
@Comment("组合方式2:教练人数")
@ColDefine(type = ColType.INT, width = 8)
private Integer coachNum;
@Column
@Comment("教练是否必须是运动员")
@ColDefine(type = ColType.BOOLEAN)
@Default("0")
private Boolean coachIsAthlete;
@Column
@Comment("组合方式2:女队人数")
@ColDefine(type = ColType.INT, width = 8)
@@ -104,7 +104,7 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(),
RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_WENTI_WY.name())) {
// cnd.where().andLike("school.applyWay ", "1");
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(SecurityUtil.getUserId())));
@@ -166,7 +166,7 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
//查询报名中
if (isActivity == 2) {
cnd.and(new Static("now() >applyStartTime and now() < applyEndTime"));
cnd.and(new Static("(now() >applyStartTime and now() < applyEndTime) or now() <applyStartTime"));
}//查询已结束的
else if (isActivity == 3) {
cnd.and(new Static("now() > school.applyEndTime"));
@@ -182,7 +182,7 @@ public class ActivitySportsApplyUserServiceImpl extends BaseServiceImpl<Activity
}
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(),
RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
RoleConstant.BRANCH_UNION_CHAIRMAN.name(), RoleConstant.BRANCH_UNION_WENTI_WY.name())) {
// cnd.and(new Static("JSON_CONTAINS(school.applyWay,JSON_ARRAY( 1))>0"));
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(SecurityUtil.getUserId())));
}
@@ -233,7 +233,7 @@ public class MTrainSignUpActivityController {
.and("state", "!=", 2));
int hasRegisterNum = signUpUsers.size() + 1;//+1是算自己
if(hasRegisterNum > course.getCoursePeopleNumber()) {
return Result.error(3, "您当前的报名为候补报名状态");
return Result.error(99, "您当前的报名为候补报名状态");
}
}
return Result.success();
@@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.export.ExcelExportService;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
@@ -139,6 +140,7 @@ public class TrainSignUpActivityStatisticsController {
u.unitName,
u.unionName,
u.sex,
u.personType,
if(ts.mobile is null, u.mobile, ts.mobile) as mobile,
u.birthday,
tsc.courseName,
@@ -150,7 +152,7 @@ public class TrainSignUpActivityStatisticsController {
left join train_sign_up_course tsc on tsc.id = ts.courseId
WHERE
ts.activityId = @activityId
ORDER BY FIELD( ts.state, 1, 3, 2, 4 ),u.unionid desc, u.unitid desc
ORDER BY FIELD( ts.state, 1, 3, 2, 4 ),u.unionid desc, u.unitid desc,ts.signUpTime asc
""").setParam("activityId", activityId);
List<NutMap> userList = trainSignUpActivityManageService.listMap(sql);
userList.forEach(item -> {
@@ -163,6 +165,8 @@ public class TrainSignUpActivityStatisticsController {
} else if (item.getInt("state") == 4) {
item.setv("stateName", "无效报名(缺席)");
}
item.setv("birthday", DateUtil.format(item.getTime("birthday"),"yyyy-MM-dd"));
item.setv("signUpTime", DateUtil.format(item.getTime("signUpTime"),"yyyy-MM-dd HH:mm:ss"));
});
List<ExcelExportEntity> excelCommonExportEntity = new ArrayList<>();
@@ -172,8 +176,9 @@ public class TrainSignUpActivityStatisticsController {
excelCommonExportEntity.add(new ExcelExportEntity("分工会", "unionName", 20));
excelCommonExportEntity.add(new ExcelExportEntity("性别", "sex", 20));
excelCommonExportEntity.add(new ExcelExportEntity("手机号", "mobile", 20));
excelCommonExportEntity.add(new ExcelExportEntity("生日", "birthday", 20));
excelCommonExportEntity.add(new ExcelExportEntity("教职工类别", "personType", 20));
excelCommonExportEntity.add(new ExcelExportEntity("报名状态", "stateName", 20));
excelCommonExportEntity.add(new ExcelExportEntity("报名时间", "signUpTime", 30));
List<TrainSignUpCourse> courseList = dao.query(TrainSignUpCourse.class, Cnd.where("activityId", "=", activityId));
Map<String, TrainSignUpCourse> courseMap = courseList.stream().collect(Collectors.toMap(o -> o.getId(), o -> o));
@@ -105,7 +105,7 @@ public class SysClub extends BaseModel {
private List<JSONObject> establishReport;
@Column
@Comment("章程草案")
@Comment("章程")
@ColDefine(type = ColType.MYSQL_JSON)
private List<JSONObject> rulesFile;
@@ -1,8 +1,16 @@
package com.budwk.app.zhgh.staffmanage.member.controller.statistics;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.date.DateUtil;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.zhgh.staffmanage.member.service.MemberStatisticsService;
import com.budwk.app.zhgh.user.singleTeacher.param.SingleTeacherPageForm;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.usermodel.Workbook;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
@@ -80,4 +88,44 @@ public class MemberSummaryController {
e.printStackTrace();
}
}
@At
@Ok("void")
@SaCheckPermission("member.statistics.summary")
@ApiOperation("导出Excel")
public void exportExcel(@Param("queryId") String queryId, @Param("queryType") String queryType,
@Param("currentYear") Integer currentYear, HttpServletResponse response) {
if (currentYear == null) {
currentYear = DateUtil.thisYear();
}
List<NutMap> list = new ArrayList<>();
if ("fgh".equals(queryType)) {
list = memberStatisticsService.getUnionStatisticsData(queryId, currentYear);
} else {
list = memberStatisticsService.getUnitStatisticsData(queryId, currentYear);
}
NutMap totalMap = NutMap.NEW();
totalMap.put("单位名称", "合计");
totalMap.put("总人数", list.stream().mapToInt(v -> v.getInt("totalNumber", 0)).sum());
list.add(totalMap);
List<ExcelExportEntity> entities = new ArrayList<>();
if ("fgh".equals(queryType)) {
entities.add(new ExcelExportEntity("分工会", "unionName", 20));
} else {
entities.add(new ExcelExportEntity("单位", "unitName", 20));
entities.add(new ExcelExportEntity("分工会", "unionName", 20));
}
entities.add(new ExcelExportEntity("总人数", "totalNumber", 15));
try {
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, list);
CommonDownloadUtil.download("会员人数统计.xlsx", workbook, response);
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -362,6 +362,7 @@ public class MemberStatisticsServiceImpl extends BaseServiceImpl<Sys_user> imple
un.id,
un.unitcode AS unitCode,
un.`name` AS unitName,
uni.`name`AS unionName,
SUM(CASE WHEN TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) <= 40 $personCnd $yearCnd THEN 1 ELSE 0 END) AS smallForty,
SUM(CASE WHEN TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) >= 41 AND TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) <= 50 $personCnd $yearCnd THEN 1 ELSE 0 END) AS smallFifty,
SUM(CASE WHEN TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) >= 51 AND TIMESTAMPDIFF(YEAR, u.birthday, CURDATE()) <= 55 $personCnd $yearCnd THEN 1 ELSE 0 END) AS smallFiftyFive,
@@ -371,6 +372,7 @@ public class MemberStatisticsServiceImpl extends BaseServiceImpl<Sys_user> imple
SUM(CASE WHEN sex = '女' $personCnd $yearCnd THEN 1 ELSE 0 END) AS femaleMember
FROM
sys_unit un
LEFT JOIN sys_union uni ON uni.id = un.unionId
JOIN $table u ON u.unitId = un.id AND u.member = 1
$condition
""");
@@ -107,11 +107,19 @@ public class WelfareListController {
return Result.success();
}
@At
@SaCheckPermission("welfare.list.mange")
@ApiOperation("导出收货地址")
@Ok("void")
public void exportAddress(WelfareListPageForm pageForm, HttpServletResponse response) {
welfareListService.exportAddress(pageForm, response);
}
@At
@SaCheckPermission("welfare.list.mange")
@ApiOperation("导出")
@Ok("void")
public void exportXlsx(@Param("pageForm") WelfareListPageForm pageForm, HttpServletResponse response) {
public void exportXlsx(WelfareListPageForm pageForm, HttpServletResponse response) {
welfareListService.exportXlsx(pageForm, response);
}
@@ -83,6 +83,7 @@ public class WelfareMineController {
cnd.and("wp.isDisabled", "=", 0);
cnd.andEX("YEAR(wp.choiceTimeStart)", "=", year);
cnd.andEX("wl.userId", "=", SecurityUtil.getUserId());
cnd.andEX("wp.isUnseal", "=", true);
cnd.desc("wp.choiceTimeStart");
cnd.groupBy("wl.id");
sql.setCondition(cnd);
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.welfare.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.page.Pagination;
@@ -80,6 +81,7 @@ public class WelfareProjectMangeController {
if (StrUtil.isNotBlank(project.getId())) {
projectService.updateProject(project);
} else {
project.setIsUnseal(false);
projectService.saveProject(project);
}
return Result.success();
@@ -146,4 +148,14 @@ public class WelfareProjectMangeController {
return Result.success();
}
@At
@SaCheckPermission("welfare.project.mange")
public Result welfareStatusChange(@Valid String id, @Valid Boolean isUnseal) {
projectService.update(Chain.make("isUnseal", isUnseal), Cnd.where("id", "=", id));
projectService.dao().update(WelfareProject.class,
Chain.make("isUnseal", isUnseal),
Cnd.where("id", "=", id));
return Result.success();
}
}
@@ -70,6 +70,7 @@ public class WelfareUserSelectController {
cnd.andEX("YEAR(wp.choiceTimeStart)", "in", year);
cnd.and("wp.isDisabled", "=", 0);
cnd.groupBy("wp.id");
cnd.andEX("wp.isUnseal", "=", true);
cnd.desc("YEAR(wp.choiceTimeStart)");
sql.setCondition(cnd);
Pagination pagination = welfareProjectService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
@@ -74,6 +74,11 @@ public class WelfareProject extends BaseModel implements SysHomeConvert {
@ColDefine(type = ColType.DATETIME)
private Date choiceTimeEnd;
@Column
@Comment("是否开启")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isUnseal;
@Column
@Comment("逾期补发结束时间")
@ColDefine(type = ColType.DATETIME)
@@ -7,6 +7,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.Map;
import java.util.List;
@EqualsAndHashCode(callSuper = true)
@Data
@@ -55,4 +57,7 @@ public class WelfareListPageForm extends PageForm {
@ApiModelProperty("在职状态")
private String[] userStates;
@ApiModelProperty("导出的数据")
private List<Map<String, String>> columns;
}
@@ -46,6 +46,13 @@ public interface WelfareListService extends BaseService<WelfareList> {
*/
void addWelfareUser(WelfareFilterUserPageForm pageForm);
/**
* 导出收货地址
* @param pageForm
* @param response
*/
void exportAddress(WelfareListPageForm pageForm, HttpServletResponse response);
/**
* 导出
* @param pageForm
@@ -553,6 +553,82 @@ public class WelfareListServiceImpl extends BaseServiceImpl<WelfareList> impleme
dao().insert(welfareList);
}
@Override
public void exportAddress(WelfareListPageForm pageForm, HttpServletResponse response) {
Sql sql = Sqls.create("""
SELECT
t1.*,
t2.loginname,
t2.username,
t2.sex,
DATE_FORMAT(t2.birthday, '%Y-%m-%d') AS birthday,
CONCAT('收货人:',t3.userName,' 电话:',t3.tel,' 详细地址:',t3.province, t3.city, t3.county, t3.addressDetail) AS address
FROM
`welfare_list` t1
LEFT JOIN sys_user t2 ON t2.id = t1.userId
LEFT JOIN (
SELECT
userId,
userName,
tel,
province,
city,
county,
addressDetail,
ROW_NUMBER() OVER (PARTITION BY userId ORDER BY isDefault DESC, id) as rn
FROM welfare_member_address
) t3 ON t3.userId = t1.userId AND t3.rn = 1
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("t1.projectId", "=", pageForm.getProjectId());
if (StrUtil.isNotBlank(pageForm.getUserName())) {
cnd.where().andLike("t2.username", pageForm.getUserName());
}
if (StrUtil.isNotBlank(pageForm.getLoginName())) {
cnd.where().andLike("t2.loginname", pageForm.getLoginName());
}
cnd.andEX("t2.sex", "=", pageForm.getSex());
cnd.andEX("t2.birthday", "=", pageForm.getBirthday());
if (pageForm.getBirthMonths() != null && pageForm.getBirthMonths().length > 0) {
cnd.andEX("MONTH(t2.birthday)", "in", pageForm.getBirthMonths());
}
cnd.andEX("t1.welfareUnitId", "in", pageForm.getUnitIds());
cnd.andEX("t1.welfareUnionId", "=", pageForm.getUnionId());
cnd.andEX("t1.personType", "in", pageForm.getPersonTypes());
cnd.andEX("t1.preparedBy", "in", pageForm.getPreparedBys());
cnd.andEX("t1.userState", "in", pageForm.getUserStates());
if (StrUtil.isAllBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.asc("t1.welfareUnionName");
cnd.asc("t1.welfareUnitName");
} else {
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
}
sql.setCondition(cnd);
List<NutMap> list = listMap(sql);
try {
Workbook workbook = null;
List<ExcelExportEntity> exportEntities = new ArrayList<>();
exportEntities.add(new ExcelExportEntity("工号", "loginname", 20));
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
exportEntities.add(new ExcelExportEntity("收货地址", "address", 70));
exportEntities.add(new ExcelExportEntity("所属工会", "welfareUnionName", 20));
exportEntities.add(new ExcelExportEntity("所属单位", "welfareUnitName", 30));
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, list);
CommonDownloadUtil.download("收货地址汇总.xlsx", workbook, response);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void exportXlsx(WelfareListPageForm pageForm, HttpServletResponse response) {
Sql sql = Sqls.create("""
@@ -596,26 +672,46 @@ public class WelfareListServiceImpl extends BaseServiceImpl<WelfareList> impleme
sql.setCondition(cnd);
List<NutMap> list = listMap(sql);
List<ExcelExportEntity> entities = new ArrayList<>();
entities.add(new ExcelExportEntity("工号", "loginname", 20));
entities.add(new ExcelExportEntity("姓名", "username", 20));
entities.add(new ExcelExportEntity("性别", "sex", 20));
entities.add(new ExcelExportEntity("出生日期", "birthday", 20));
entities.add(new ExcelExportEntity("人员类型", "personType", 20));
entities.add(new ExcelExportEntity("聘用方式", "preparedBy", 20));
entities.add(new ExcelExportEntity("在职状态", "userState", 20));
entities.add(new ExcelExportEntity("所属工会", "welfareUnionName", 20));
entities.add(new ExcelExportEntity("所属单位", "welfareUnitName", 20));
entities.add(new ExcelExportEntity("备注", "remark", 20));
try {
Workbook workbook = null;
if (Lang.isNotEmpty(pageForm.getColumns())) {
List<ExcelExportEntity> exportEntities = new ArrayList<>();
pageForm.getColumns().forEach(column -> {
exportEntities.add(new ExcelExportEntity(column.get("label"), column.get("prop"), 20));
});
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, list);
} else {
workbook = setHistoryExcelData(list);
}
// 设置导出参数
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
// 导出Excel并下载
try (Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, list)) {
CommonDownloadUtil.download("福利名单.xlsx", workbook, response);
} catch (Exception e) {
log.error("导出Excel失败", e);
e.printStackTrace();
}
}
public Workbook setHistoryExcelData(List<NutMap> list) {
List<ExcelExportEntity> exportEntities = new ArrayList<>();
exportEntities.add(new ExcelExportEntity("工号", "loginname", 20));
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
exportEntities.add(new ExcelExportEntity("性别", "sex", 20));
exportEntities.add(new ExcelExportEntity("联系电话", "mobile", 20));
exportEntities.add(new ExcelExportEntity("身份证号", "idCard", 30));
exportEntities.add(new ExcelExportEntity("在职状态", "userState", 20));
exportEntities.add(new ExcelExportEntity("聘用方式", "preparedBy", 20));
exportEntities.add(new ExcelExportEntity("人员类型", "personType", 20));
exportEntities.add(new ExcelExportEntity("所属工会", "unionName", 20));
exportEntities.add(new ExcelExportEntity("所属单位", "unitName", 30));
// exportEntities.add(new ExcelExportEntity("来校年月", "comeSchoolDate", 30));
// exportEntities.add(new ExcelExportEntity("所在科室", "threeUnitName", 20));
// exportEntities.add(new ExcelExportEntity("工会小组", "unionGroupName", 30));
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
return ExcelExportUtil.exportExcel(exportParams, exportEntities, list);
}
}
@@ -77,9 +77,11 @@ var ACTIVITY_SPORTS_APPLY_USER = {
<!--如果是正常报名-->
<template v-if="!activityTableData.isLeader">
<div style="display: flex;margin: 20px 0;align-items: center;">
<el-divider content-position="left">每支队伍最多
<!-- 每支队伍最多
{{activityTableData.restrictMaxNum}}
其中领队{{activityTableData.leanderNum}}
其中-->
<el-divider content-position="left">
报名人员限制领队{{activityTableData.leanderNum}}
教练{{activityTableData.coachNum}}
运动员必须设置{{activityTableData.athleteMaxNum}}
替补{{activityTableData.substituteNum}}
@@ -507,6 +509,8 @@ var ACTIVITY_SPORTS_APPLY_USER = {
restrictGirlNum,
restrictBoyNum,
leanderNum,
leanderIsAthlete,
coachIsAthlete,
coachNum,
deputyDirectorNum,
substituteNum,
@@ -542,6 +546,14 @@ var ACTIVITY_SPORTS_APPLY_USER = {
message = teamName + "领队应设置" + leanderNum + "人"
break
}
if (leanderNum > 0 && leanderIsAthlete) {
const num = teamApplyData[i].filter((v) => v.identity.includes("3") && !v.identity.includes("1")).length
if (num>0){
msgFlag = false
message = teamName + "领队必须是运动员!"
break
}
}
//教练
const jlNum = teamApplyData[i].filter((v) => v.identity.includes("2")).length
if (coachNum > 0 && (jlNum > coachNum || jlNum === 0)) {
@@ -549,6 +561,15 @@ var ACTIVITY_SPORTS_APPLY_USER = {
message = teamName + "教练应设置" + coachNum + "人"
break
}
debugger
if (coachNum > 0 && coachIsAthlete) {
const num = teamApplyData[i].filter((v) => v.identity.includes("2") && !v.identity.includes("1")).length
if (num>0){
msgFlag = false
message = teamName + "教练必须是运动员!"
break
}
}
//运动员
const ydyNum = teamApplyData[i].filter((v) => v.identity.includes("1")).length
if (athletesMaxNum > 0 && (ydyNum > athletesMaxNum || ydyNum < athletesMaxNum)) {
@@ -38,7 +38,7 @@ layout("/layouts/platform.html"){
<search-item label="">
<el-radio-group @change="activityInfoData" v-model="pageForm.isActivity">
<el-radio-button :label="1">全部</el-radio-button>
<el-radio-button :label="2">报名中</el-radio-button>
<el-radio-button :label="2">即将开始&报名中</el-radio-button>
<el-radio-button :label="3">已结束</el-radio-button>
</el-radio-group>
</search-item>
@@ -305,7 +305,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
<el-row :gutter="40">
<el-col :span="12">
<el-form-item prop="leanderNum" label="领队人数(可兼运动员)">
<el-checkbox v-model="eventForm.leanderIsAthlete" v-if="eventForm.leanderNum>0">领队是否必须是运动员</el-checkbox>
<el-input-number style="width: 100%" v-model="eventForm.leanderNum"
placeholder="请填写领队人数" controls-position="right" :precision="0"
:max="100000" :min="0"></el-input-number>
@@ -314,6 +314,7 @@ let ACTIVITY_SPORTS_ADD_ACTIVITY = {
<el-col :span="12">
<el-form-item prop="coachNum" label="教练人数(可兼运动员)">
<el-checkbox v-model="eventForm.coachIsAthlete" v-if="eventForm.coachNum>0">教练是否必须是运动员</el-checkbox>
<el-input-number style="width: 100%" v-model="eventForm.coachNum"
placeholder="请填写教练人数" controls-position="right" :precision="0"
:max="100000" :min="0"></el-input-number>
@@ -97,7 +97,7 @@ layout("/layouts/platform.html"){
</template>
<template #edit_func>
<el-button @click="doSave" type="primary">保 存</el-button>
<!-- <el-button @click="doSave" type="primary">保 存</el-button>-->
<el-button @click="doOperate" type="primary">提 交</el-button>
</template>
<template #edit>
@@ -501,7 +501,7 @@ layout("/layouts/platform.html"){
})
if (res.code !== 0) {
this.$message.warning(res.msg)
if (res.code !== 3) {
if (res.code !== 99) {
return
}
}
@@ -97,8 +97,8 @@ layout("/layouts/platform.html"){
registerUserTableColumns: [
{ label: "姓名", prop: "username" },
{ label: "一卡通号", prop: "loginname" },
{ label: "单位", prop: "unitName" },
{ label: "分工会", prop: "unionName" },
{ label: "单位", prop: "unitname" },
{ label: "分工会", prop: "unionname" },
{ label: "联系方式", prop: "mobile" },
{ label: "报名时间", prop: "signUpTime" },
{ label: "报名状态", prop: "state" }
@@ -31,7 +31,7 @@ const REGISTER_INFO_COMPONENT = {
<div class="text-left" v-html="viewData.introduce"></div>
</el-descriptions-item>
<el-descriptions-item :span="4">
<template slot="label">活动形式</template>
<template slot="label">协会宗旨</template>
<div class="text-left" v-html="viewData.purpose"></div>
</el-descriptions-item>
<el-descriptions-item :span="2">
@@ -39,7 +39,7 @@ const REGISTER_INFO_COMPONENT = {
<file-preview :files="viewData.establishReport" complete_result></file-preview>
</el-descriptions-item>
<el-descriptions-item :span="2">
<template slot="label">章程草案</template>
<template slot="label">章程</template>
<file-preview :files="viewData.rulesFile" complete_result></file-preview>
</el-descriptions-item>
<el-descriptions-item :span="2">
@@ -78,11 +78,11 @@ const CLUB_FORM_TEMPLATE = {
</el-col>
</el-row>
<el-form-item label="协会介绍及宗旨" prop="introduce">
<el-form-item label="协会介绍" prop="introduce">
<text-editor v-model="formData.introduce"></text-editor>
</el-form-item>
<el-form-item label="活动形式" prop="purpose">
<el-form-item label="协会宗旨" prop="purpose">
<text-editor v-model="formData.purpose"></text-editor>
</el-form-item>
@@ -100,7 +100,7 @@ const CLUB_FORM_TEMPLATE = {
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="章程草案" prop="rulesFile">
<el-form-item label="章程" prop="rulesFile">
<file-upload
:value.sync="formData.rulesFile"
:upload_number="5"
@@ -162,9 +162,10 @@ const CLUB_FORM_TEMPLATE = {
clubCode: [{ required: false, message: "请填写协会编码", trigger: ["blur", "change"] }],
clubType: [{ required: true, message: "请选择协会类型", trigger: ["blur", "change"] }],
concatPerson: [{ required: true, message: "请选择协会联系人", trigger: ["blur", "change"] }],
foundTime: [{ required: true, message: "请选择成立时间", trigger: ["blur", "change"] }]
foundTime: [{ required: true, message: "请选择成立时间", trigger: ["blur", "change"] }],
due: [{ required: true, message: "请输入会费标准", trigger: ["blur", "change"] }],
// establishReport: [{ required: true, message: "请上传申请成立报告", trigger: ["blur", "change"] }]
//rulesFile: [{ required: true, message: "请上传章程草案", trigger: ["blur", "change"] }],
rulesFile: [{ required: true, message: "请上传章程", trigger: ["blur", "change"] }],
//manageFile: [{ required: true, message: "请上传经费来源及管理办法", trigger: ["blur", "change"] }],
//yearPlanFile: [{ required: true, message: "请上传年度活动计划", trigger: ["blur", "change"] }]
}
@@ -42,7 +42,9 @@ layout("/layouts/platform.html"){
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="会员统计"></table-tool>
<table-tool label="会员统计">
<el-button size="mini" type="primary" icon="el-icon-download" @click="exportExcel">导出</el-button>
</table-tool>
<el-table :data="tableData" show-summary>
<el-table-column
align="center"
@@ -90,6 +92,13 @@ layout("/layouts/platform.html"){
}
},
methods: {
exportExcel() {
this.$downLoad("/platform/member/statistics/summary/exportExcel", {
queryId: this.pageForm.queryId,
queryType: this.pageForm.queryType,
currentYear: this.pageForm.currentYear
})
},
doExport() {},
initData() {
if (this.$auth.hasRoleOr(["SYSADMIN", "SCHOOL_UNION_ADMIN"])) {
@@ -106,8 +106,8 @@ layout("/layouts/platform.html"){
</guava>
</div>
<script>
<!--#include("../../member/common/audit/memberAuditChangeInfo.js"){}#-->
<!--#include("../../member/common/change/memberChangeInfo.js"){}#-->
<!--#include("../../member/change/common/memberAllChangeInfo.js"){}#-->
<!--#include("../../member/change/common/memberChange.js"){}#-->
<!--#include("../../member/common/info/memberInfo.js"){}#-->
new Vue({
el: "#app",
@@ -175,8 +175,8 @@ layout("/layouts/platform.html"){
}
},
components: {
'member-audit-change-info': MEMBER_AUDIT_CHANGE_INFO,
'member-change-info': MEMBER_CHANGE_INFO,
'member-audit-change-info': MEMBER_ALL_CHANGE_INFO,
'member-change-info': MEMBER_CHANGE,
'member-info': MEMBER_INFO
},
methods: {
@@ -51,6 +51,14 @@ layout("/layouts/platform.html"){
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='isUnseal'">
<el-switch
@change="(val)=>{welfareStatusChange(row.id,row.isUnseal)}"
active-color="#13ce66"
inactive-color="#ff4949"
v-model="row.isUnseal">
</el-switch>
</template>
<!-- <template scope="{row}" v-if="column.prop=='gift'">-->
<!-- <span v-if="row.flexible">福利套餐</span>-->
<!-- <span v-else>{{row.gift}}</span>-->
@@ -261,7 +269,8 @@ layout("/layouts/platform.html"){
{ prop: "year", label: "年度" },
{ prop: "name", label: "项目名称" },
{ prop: "choiceTimeStart", label: "开始选择时间" },
{ prop: "choiceTimeEnd", label: "结束选择时间" }
{ prop: "choiceTimeEnd", label: "结束选择时间" },
{prop: "isUnseal", label: "是否开启"},
// { prop: "gift", label: "福利礼品" },
// { prop: "provideTimeStart", label: "发放时间" }
@@ -296,6 +305,19 @@ layout("/layouts/platform.html"){
this.sendMsg(data)
}
},
async welfareStatusChange(id, isUnseal) {
const resp = await this.$axios.post("/platform/welfare/project/mange/welfareStatusChange", {
id: id,
isUnseal: isUnseal
})
if (resp.code === 0) {
this.doSearch()
this.$message.success(resp.msg)
} else {
this.$message.error(resp.msg)
}
},
async save() {
const formValid = await this.$refs["form"].validate()
if (formValid) {
@@ -130,6 +130,9 @@ layout("/layouts/platform.html"){
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="福利名单">
<el-button :disabled="!pageForm.projectId" @click="exportAddress" icon="el-icon-download" size="small" type="primary">
导出收货地址
</el-button>
<el-button :disabled="!pageForm.projectId" @click="openExport" icon="el-icon-download" size="small" type="primary">
导出名单
</el-button>
@@ -145,6 +148,38 @@ layout("/layouts/platform.html"){
>
添加人员
</el-button>
<el-popover
placement="bottom"
trigger="click"
width="200">
<div style="padding:4px 0;border-bottom:1px solid #eee;">
<el-button size="mini" @click="checkAll">全选</el-button>
<el-button size="mini" @click="invertCheck">反选</el-button>
</div>
<div style="max-height:40vh;overflow-y:auto;padding:6px 0;">
<el-checkbox-group v-model="checkedFields">
<el-checkbox
v-for="f in tableColumns"
:key="f.prop"
:label="f.prop"
style="display:block;margin:6px 0;">
{{ f.label }}
</el-checkbox>
</el-checkbox-group>
</div>
<el-button
slot="reference"
type="text"
icon="el-icon-s-operation"
size="small"
style="margin-left:12px;">
列设置
</el-button>
</el-popover>
</table-tool>
<el-table
@@ -159,15 +194,16 @@ layout("/layouts/platform.html"){
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
<el-table-column
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
v-if="checkedFields.includes(column.prop)"
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='isChoose'">
<span class="text-primary" v-if="row.isChoose">已选择</span>
@@ -241,8 +277,14 @@ layout("/layouts/platform.html"){
return null
}
return null
},
showColumns() {
return this.tableColumns.filter(c => this.checkedFields.includes(c.prop));
}
},
mounted() {
this.checkedFields = this.tableColumns.filter(c => c.checked !== 0).map(c => c.prop);
},
components: {
add_welfare_list_by_select: ADD_WELFARE_LIST_BY_SELECT,
"file-import": httpVueLoader("/components/plugins/sysImport/index.vue?v=" + new Date().getTime()),
@@ -251,6 +293,7 @@ layout("/layouts/platform.html"){
},
data() {
return {
checkedFields: [],
pageForm: {
searchName: "username",
year: new Date().getFullYear().toString()
@@ -282,13 +325,26 @@ layout("/layouts/platform.html"){
}
},
methods: {
// 导出收货地址
exportAddress() {
this.$downLoad("/platform/welfare/list/mange/exportAddress", this.pageForm)
},
// 导出名单
openExport() {
this.$downLoad("/platform/welfare/list/mange/exportXlsx", {
pageForm: JSON.stringify(this.pageForm)
const pageForm = clone(this.pageForm)
const data = this.tableColumns.filter(item => this.checkedFields.includes(item.prop)).map(item => {
return {prop: item.prop, label: item.label}
})
pageForm.columns = JSON.stringify(data)
this.$downLoad("/platform/welfare/list/mange/exportXlsx", pageForm)
},
checkAll() {
this.checkedFields = this.tableColumns.map(c => c.prop);
},
invertCheck() {
const all = this.tableColumns.map(c => c.prop);
this.checkedFields = all.filter(p => !this.checkedFields.includes(p));
},
successImport() {
this.doSearch()
this.importDialog = false
@@ -105,7 +105,7 @@ layout("/layouts/platform_h5.html"){
],
stateList: [
{value: 1, text: "全部"},
{value: 2, text: "报名中"},
{value: 2, text: "即将开始&报名中"},
{value: 3, text: "报名已结束"}
],
subLoading: false,
@@ -49,7 +49,7 @@ layout("/layouts/platform_h5.html"){
<div id="app" v-cloak>
<van-nav-bar title="活动详情" @click-left="historyBack" left-arrow left-text="返回" placeholder fixed></van-nav-bar>
<van-image height="186" src="/assets/mobile/img/trainSignUp/3quhtakfd4heeqsk6irqhft60p.png"></van-image>
<van-image height="186" :src="activity.cover"></van-image>
<div class="title">{{activity.activityName}}</div>
<van-tabs v-model:active="tabActive" shrink>
@@ -147,16 +147,19 @@ layout("/layouts/platform_h5.html"){
}
</style>
<div id="app" v-cloak>
<van-nav-bar :title="trainType + '列表'" @click-left="historyBack" left-arrow left-text="返回" placeholder fixed></van-nav-bar>
<van-nav-bar :title="trainType + '列表'" @click-left="historyBack" left-arrow left-text="返回" placeholder
fixed></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="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-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>
@@ -187,49 +190,52 @@ layout("/layouts/platform_h5.html"){
</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">
<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 @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)"
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)"
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"
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="
@click="trainClick(o)"
v-if="activityStatus === '1'"
style="
text-align: center;
line-height: 40px;
width: 40px;
@@ -249,65 +255,69 @@ layout("/layouts/platform_h5.html"){
</div>
</template>
</div>
<van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据"></van-empty>
<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>
<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) + '' +
: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"
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 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)
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"
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)
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"
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)
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)"
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)
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"
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px"
>
已签到
</van-button>
@@ -317,7 +327,8 @@ layout("/layouts/platform_h5.html"){
</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>
<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">
@@ -330,12 +341,12 @@ layout("/layouts/platform_h5.html"){
<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"
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>
@@ -378,8 +389,8 @@ layout("/layouts/platform_h5.html"){
course: [],
qdArray: [],
activityOptions: [
{ text: "全部", value: "0" },
{ text: "我报名的", value: "1" }
{text: "全部", value: "0"},
{text: "我报名的", value: "1"}
],
courseOptions: [],
courseType: "0",
@@ -474,7 +485,7 @@ layout("/layouts/platform_h5.html"){
},
async signIn(o) {
if (o.signType === 1) {
vant.Dialog.alert({ message: "功能马上推出,敬请期待!" })
vant.Dialog.alert({message: "功能马上推出,敬请期待!"})
return
}
if (o.signType === 2) {
@@ -554,42 +565,46 @@ layout("/layouts/platform_h5.html"){
await this.pageData()
}
})
.catch(() => {})
.catch(() => {
})
},
async signUp(o) {
this.choose = o
const res = await this.$axios.post("/platform/mobile/trainSignUpActivity/validateSignUp", {
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
}).then(async res => {
if (res.code !== 0) {
await vant.Dialog.alert({
title: "提示",
message: res.msg
})
if (res.code !== 99) {
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)
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 = ""
const column = this.allColumnsData.find((x) => x.id === o.courseType)
this.dynamicColumnsData = column ? column.trainMobileSignColumnList : []
this.dynamicColumnsData.forEach((item) => {
item.columnValue = ""
})
this.joinPopup = true
})
this.joinPopup = true
},
async joinSubmit() {
let valid = false
@@ -647,7 +662,8 @@ layout("/layouts/platform_h5.html"){
}
toast.clear()
})
.catch(() => {})
.catch(() => {
})
},
trainClick(o) {
this.timeList = o.courseTimeList
@@ -656,8 +672,8 @@ layout("/layouts/platform_h5.html"){
this.activityStatus === "0"
? o.courseTimeList
: this.qdInfoList.filter((item) => {
return item.courseId === o.id
})
return item.courseId === o.id
})
if (o.signType === 3) {
this.initMap(o)
}
@@ -768,12 +784,12 @@ layout("/layouts/platform_h5.html"){
async getCourseText() {
const courseArray = await this.getAllType()
this.courseOptions = []
this.courseOptions.push({ text: "全部类型", value: "0" })
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.lxname, value: item.id })
this.courseOptions.push({text: item.lxname, value: item.id})
}
this.courseText = this.courseText.substr(0, this.courseText.length - 1)
},
@@ -812,17 +828,17 @@ layout("/layouts/platform_h5.html"){
this.isMySign = Number(GetQueryString("isMySign"))
const time = GetQueryString("endTime")
if (this.isMySign === 1) {
this.activityOptions = [{ text: "我报名的", value: "1" }]
this.activityOptions = [{text: "我报名的", value: "1"}]
this.activityStatus = "1"
} else {
this.activityOptions = [
{ text: "全部", value: "0" },
{ text: "我报名的", value: "1" }
{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 })
vant.Toast.setDefaultOptions({duration: 2000})
this.pageData()
await this.getCourseText()
await this.getActivity()
@@ -0,0 +1,56 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app">
{{ 登录成功,正在跳转小程序界面 }}
</div>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script>
new Vue({
el: '#app',
store,
data() {
return {}
},
methods: {
async handleLogin() {
try {
const res = await this.$axios.post('/platform/login/getWeAppToken');
if (res.code === 0) {
console.log("token获取成功,下一步关闭当前web-view")
if (window.wx?.miniProgram) {
console.log("小程序界面,正在关闭web-view")
// 发送登录成功 + 关闭指令
window.wx.miniProgram.postMessage({
data: {
type: 'login_success',
loginname: this.$store.state.user.loginname,
...res.data
}
});
setTimeout(() => {
wx.miniProgram.navigateTo({ url: '/pages/activity/index' });
}, 3000);
} else {
// 非小程序环境,跳转首页等
window.location.href = 'platform/home'
}
} else {
console.error('获取 token 失败');
}
} catch (err) {
console.error('请求异常', err);
}
}
},
created() {
this.handleLogin()
}
})
</script>
<!--#
}
#-->