This commit is contained in:
Paidax
2025-03-27 15:38:56 +08:00
parent 7410b3a181
commit 50aa04192a
47 changed files with 4438 additions and 686 deletions
@@ -0,0 +1,92 @@
/*
* Copyright [2022] [https://www.xiaonuo.vip]
*
* Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
*
* 1.请不要删除和修改根目录下的LICENSE文件。
* 2.请不要删除和修改Snowy源码头部的版权声明。
* 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
* 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
* 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
* 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
*/
package io.v.nutz.base.utils;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.URLUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
/**
* 文件下载工具类,使用本类前,对参数校验的异常使用CommonResponseUtil.renderError()方法进行渲染
*
* @author xuyuxiang
* @date 2020/8/5 21:45
*/
@Slf4j
public class CommonDownloadUtil {
/**
* 下载文件
*
* @param file 要下载的文件
* @param response 响应
* @author xuyuxiang
* @date 2020/8/5 21:46
*/
public static void download(File file, HttpServletResponse response) {
download(file.getName(), FileUtil.readBytes(file), response);
}
/**
* 下载文件
*
* @param fileName
* @param workbook
* @param response
*/
public static void download(String fileName, Workbook workbook, HttpServletResponse response) {
ByteArrayOutputStream byteOs = new ByteArrayOutputStream();
try {
workbook.write(byteOs);
} catch (IOException e) {
e.printStackTrace();
log.error(">>> 文件下载异常:", e);
} finally {
try {
workbook.close();
} catch (IOException e) {
e.printStackTrace();
}
IoUtil.close(byteOs);
}
download(fileName, byteOs.toByteArray(), response);
}
/**
* 下载文件
*
* @author xuyuxiang
* @date 2022/7/31 10:57
*/
public static void download(String fileName, byte[] fileBytes, HttpServletResponse response) {
try {
response.setHeader("Content-Disposition", "attachment;filename=" + URLUtil.encode(fileName));
response.addHeader("Content-Length", "" + fileBytes.length);
response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
response.setContentType("application/octet-stream;charset=UTF-8");
IoUtil.write(response.getOutputStream(), true, fileBytes);
} catch (IOException e) {
log.error(">>> 文件下载异常:", e);
}
}
}
@@ -5,6 +5,8 @@ import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.View;
import java.util.Date;
/**
* 视图中的user
*
@@ -127,13 +129,22 @@ public class User {
@Column
private String campusName;
@Column
private String activityUnionId;
@Column
private String activityUnitId;
@Column
private String weAppOpenid;
@Column
private String threeUnitId;
@Column
private String schoolTime;
@Column
private Date retireDate;
}
@@ -235,11 +235,11 @@ public class ActivityBasicScopeController {
$condition
""");
Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,H06,H10")) {
if (ShiroUtil.hasAnyRoles(new String[]{"H04", "club01"})) {
cnd.and("creator", "=", ShiroUtil.getPrincipalProperty("id"));
}
}
// if (!ShiroUtil.hasAnyRoles("sysadmin,H06,H10")) {
// if (ShiroUtil.hasAnyRoles(new String[]{"H04", "club01"})) {
// cnd.and("creator", "=", ShiroUtil.getPrincipalProperty("id"));
// }
// }
cnd.and("groupId", "IS NOT", null);
cnd.and("groupName", "IS NOT", null);
cnd.groupBy("groupId");
@@ -1,6 +1,7 @@
package io.v.nutz.zhgh.activity.controller.union;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.sys.models.Sys_home_activity;
import io.v.nutz.zhgh.activity.models.ActivityTissue;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
@@ -102,6 +103,12 @@ public class ActivityAuditController {
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
baseService.insert(audit);
baseService.dao().update(ActivityTissue.class, Chain.make("state", flag ? 3 : 2).add("auditId", audit.getId()), Cnd.where("id", "=", id));
// 审核通过,修改活动为启动状态,并且还要将这个活动设置成首界面可见
if (flag) {
baseService.dao().update(ActivityTissue.class, Chain.make("isDisabled", true), Cnd.where("id", "=", id));
baseService.dao().update(Sys_home_activity.class, Chain.make("enable", true), Cnd.where("id", "=", id));
}
return null;
}
@@ -88,8 +88,9 @@ public class ActivityUnionApplyUserController {
LEFT JOIN activity_basic_settings abs ON abs.`code`=tissue.projectTypeCode
$condition
""");
cnd.andEx("YEAR(tissue.startTime)", "=", year);
if (StrUtil.isNotBlank(year)) {
cnd.andEx("YEAR(tissue.startTime)", "=", year);
}
cnd.andEx("tissue.isDisabled", "=", true);
cnd.andEx("tissue.type", "=", type);
cnd.andEx("tissue.state", "=", 3);
@@ -116,6 +117,10 @@ public class ActivityUnionApplyUserController {
List<NutMap> list = pagination.getList();
list.forEach(v -> {
String activityId = v.getString("id");
// 当前活动已报名人数
int totalApplyNum = baseService.dao().count(ActivityTissuePerson.class, Cnd.where("tissueId", "=", activityId));
v.put("totalApplyNum", totalApplyNum);
int signUpMethod = v.getInt("signUpMethod");
if (signUpMethod == 1||signUpMethod == 3) {
int count = baseService.dao().count(ActivityTissuePerson.class,
@@ -179,8 +184,7 @@ public class ActivityUnionApplyUserController {
activity_tissue_person atp
LEFT JOIN `user` u ON atp.userId = u.id
WHERE
atp.tissueId = @tissueId
AND u.unionid = @unionId
atp.tissueId = @tissueId AND u.unionid = @unionId
""");
sql.setParam("tissueId", tissueId);
sql.setParam("unionId", Vi.getUnionId());
@@ -231,6 +231,11 @@ public class ActivityUnionManageController {
} else {
mobileHomeService.delete(tissue.getId());
}
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
tissue.setState(1);
} else {
tissue.setState(3);
}
activityTissueService.doEdit(tissue);
return null;
}
@@ -70,6 +70,20 @@ public class ActivityUnionUserStatisticsController {
if (Lang.isEmpty(tissue)){
return null;
}
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (type == 40002) {
if (!Vi.getUnionId().equals(tissue.getUnionId())) {
return null;
}
} else if (type == 40003) {
if (!vi.getClubId().equals(tissue.getClubId())) {
return null;
}
}
}
Sql sql = Sqls.create("""
SELECT
u.id,
@@ -89,16 +103,16 @@ public class ActivityUnionUserStatisticsController {
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("atp.tissueId", "=", activityId);
cnd.andEX("u.unionId", "=", unionId);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (!tissue.getUserId().equals(ShiroUtil.getUserId())) {
if (type == 40002) {
cnd.and("unionId", "=", Vi.getUnionId());
} else if (type == 40003) {
cnd.and("u.id", "in", " SELECT userid FROM sys_club_user WHERE clubid = '%s' ".formatted(vi.getClubId()));
}
}
}
// cnd.andEX("u.unionId", "=", unionId);
// if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
// if (!tissue.getUserId().equals(ShiroUtil.getUserId())) {
// if (type == 40002) {
// cnd.and("unionId", "=", Vi.getUnionId());
// } else if (type == 40003) {
// cnd.and("u.id", "in", " SELECT userid FROM sys_club_user WHERE clubid = '%s' ".formatted(vi.getClubId()));
// }
// }
// }
if (Strings.isNotBlank(page.getSearchName()) && Strings.isNotBlank(page.getSearchKeyword())) {
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
}
@@ -239,6 +239,17 @@ public class ActivityTissue extends BaseModel implements Serializable, SysHomeCo
@Comment("是否推送移动端首页")
@ColDefine(type = ColType.INT)
private Integer isPushHome;
@Column
@Comment("签到开始时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String signStartTime;
@Column
@Comment("签到结束时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String signEndTime;
@Override
public Sys_home_activity covertToSysHomeActivity() {
Sys_home_activity sysHomeActivity = new Sys_home_activity();
@@ -252,7 +263,7 @@ public class ActivityTissue extends BaseModel implements Serializable, SysHomeCo
} else if (this.getType() == 40003) {
sysHomeActivity.setUrl("/platform/activity/applyUser/club");
}
sysHomeActivity.setH5Url("/mobile/activity/unionActivity");
sysHomeActivity.setH5Url("/mobile/activity/unionActivity/goReg?id=" + this.getId() + "&signUpMethod=" + this.getSignUpMethod());
if (StrUtil.isNotBlank(this.getApplyStartTime())) {
sysHomeActivity.setStartDate(DateUtil.parseDate(this.getApplyStartTime()));
sysHomeActivity.setEndDate(DateUtil.parseDate(this.getApplyEndTime()));
@@ -67,8 +67,9 @@ public class ActivityTissueServiceImpl extends ViServiceImpl<ActivityTissue> imp
LEFT JOIN activity_basic_settings abs ON abs.`code`=tissue.projectTypeCode
$condition
""");
cnd.andEx("YEAR(tissue.applyTime)", "=", year);
if (StrUtil.isNotBlank(year)) {
cnd.and("YEAR(tissue.applyTime)", "=", year);
}
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.or("tissue.projectTypeCode", "!=", "50004");
seg.or("tissue.projectTypeCode", "is", null);
@@ -81,8 +82,15 @@ public class ActivityTissueServiceImpl extends ViServiceImpl<ActivityTissue> imp
cnd.where().andLike("tissue.name", name);
}
if (!ShiroUtil.hasAnyRoles("sysadmin,H10,A06")) {
cnd.and("tissue.userId", "=", ShiroUtil.getUserId());
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
// cnd.and("tissue.userId", "=", ShiroUtil.getUserId());
if (ShiroUtil.hasAnyRoles("H04")) {
cnd.and("tissue.unionId", "=", Vi.getUnionId());
} else if (ShiroUtil.hasAnyRoles("club01")) {
cnd.and("tissue.clubId", "=", vi.getClubId());
} else {
cnd.and("tissue.userId", "=", ShiroUtil.getUserId());
}
/* if (ShiroUtil.hasRole("H04")) {
cnd.and("tissue.unionId", "in", vi.getMangeUnionStr());
} else if (ShiroUtil.hasRole("club01")) {
@@ -39,23 +39,6 @@ public interface SourceData {
// Assert.isTrue(jsonResult.getBoolean("success"), jsonResult.getString("data"));
}
/**
* 不进系统人员类型
*/
List<String> NOT_ENTERING_PERSON_TYPE = List.of("退休人员", "兼职教师", "非全日用工(项目临聘)", "服务外包和其他人员",
"教学编制2", "教学教师(附属医院)", "教学编制", "离休人员", "临时人员", "非全日制工", "博士后(在职)");
/**
* 不进系统在职状态
* 01 退休
* 05 调出
* 06 辞职
* 07 离职
* @see io.v.nutz.zhgh.data.constant.HMCFieldCode#USER_STATE_CODE
*/
List<String> NOT_ENTERING_USER_STATE = List.of("01", "05", "06", "07");
List<String> NOT_ENTERING_USER_LOGIN_NAME = List.of("2020000410", "2008000010");
/**
* 接口中的数据跟SourceUser的对应关系
* <p>
@@ -83,6 +66,7 @@ public interface SourceData {
put("ZYJSZWDJ", new String[]{"professionalTechnicalLevel"}); // 专业技术等级
put("JZGLBM", new String[]{"userCategory"}); // 教职工类别
put("GWLBM", new String[]{"jobCategory"}); // 岗位类别
put("LXRQ", new String[]{"schoolTime"}); // 岗位类别
}};
/**
@@ -119,11 +103,6 @@ public interface SourceData {
// checkSuccess(map);
List<NutMap> data = map.getAsList("data", NutMap.class);
for (NutMap row : data) {
if (NOT_ENTERING_PERSON_TYPE.contains(row.getString("RYFLMC"))
|| NOT_ENTERING_USER_LOGIN_NAME.contains(row.getString("GH"))
|| NOT_ENTERING_USER_STATE.contains(row.getString("DQZTM"))) {
continue;
}
Map entity = new HashMap(500);
row.forEach((k, v) -> {
@@ -4,23 +4,18 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HtmlUtil;
import io.v.nutz.base.utils.ManyAddOrRenewUtil;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.sys.models.Sys_dict;
import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.sys.services.SysDictService;
import io.v.nutz.sys.services.SysUserRoleService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
import io.v.nutz.zhgh.data.constant.SourceData;
import io.v.nutz.zhgh.data.constant.UserChangeType;
import io.v.nutz.zhgh.data.model.UserHistory;
import io.v.nutz.zhgh.data.model.UserSource;
import io.v.nutz.zhgh.data.service.HistoryUserService;
import io.v.nutz.zhgh.data.service.SourceUserService;
import io.v.nutz.zhgh.data.vo.SourceUserCommonVo;
import io.v.nutz.zhgh.staffmanage.member.UserMode;
import io.v.nutz.base.service.AsyncService;
import io.v.nutz.base.service.impl.ViServiceImpl;
@@ -51,14 +46,12 @@ import org.nutz.lang.random.R;
import org.nutz.lang.util.NutMap;
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
import org.springframework.beans.BeanUtils;
import org.springframework.util.StringUtils;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@@ -72,6 +65,18 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
super(dao);
}
/**
* 不进系统人员类型
*/
private final List<String> NOT_ENTERING_PERSON_TYPE = List.of("退休人员", "兼职教师", "非全日用工(项目临聘)", "服务外包和其他人员",
"教学编制2", "教学教师(附属医院)", "教学编制", "离休人员", "临时人员", "非全日制工", "博士后(在职)");
/**
* 不进系统在职状态
* @see io.v.nutz.zhgh.data.constant.HMCFieldCode#USER_STATE_CODE
*/
private final List<String> NOT_ENTERING_USER_STATE = List.of("退休", "调出", "辞职", "离职");
private final List<String> NOT_ENTERING_USER_LOGIN_NAME = List.of("2020000410", "2008000010");
@Inject
private AsyncService asyncService;
@@ -179,6 +184,10 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
source.setWelfareMember(null);
Sys_user user = userMap.get(source.getLoginname().toLowerCase());
boolean isNotEnterUser = NOT_ENTERING_PERSON_TYPE.contains(source.getPersonType())
|| NOT_ENTERING_USER_LOGIN_NAME.contains(source.getLoginname())
|| NOT_ENTERING_USER_STATE.contains(source.getUserState());
if (isAuto) {
checkMemberOrWelfareMember(changeConfig, source, user, addMemberUserIds, deleteMemberUserIds,
addWelfareMemberUserIds, deleteWelfareMemberUserIds);
@@ -220,18 +229,24 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
if (Lang.isEmpty(history)) {
continue;
}
histories.add(history);
if (history.getChangeTypes().contains(MemberChangeType.NEW.getType())) {
if (user != null) {
histories.add(history);
}
if (!isNotEnterUser && history.getChangeTypes().contains(MemberChangeType.NEW.getType())) {
needInitUserList.add(u);
histories.add(history);
}
} else {
SourceChangeMiddleTable table = createSourceChangeMiddleTable(source, user, dictMap, allowChangeFieldNames);
if (Lang.isEmpty(table)) {
continue;
}
middleTables.add(table);
if (table.getChangeTypes().contains(MemberChangeType.NEW.getType())) {
if (user != null) {
middleTables.add(table);
}
if (!isNotEnterUser && table.getChangeTypes().contains(MemberChangeType.NEW.getType())) {
needInitUserList.add(u);
middleTables.add(table);
}
}
}
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.zhgh.activity.models.ActivityTissue;
import io.v.nutz.zhgh.jf.handle.reimbursement.ReimbursementToHandler;
import io.v.nutz.zhgh.jf.model.ActivityBx;
import io.v.nutz.zhgh.jf.service.ActivityBxService;
@@ -11,10 +12,14 @@ import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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.dao.util.cri.SqlExpressionGroup;
import org.nutz.ioc.aop.Aop;
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;
@@ -37,6 +42,8 @@ import java.util.List;
@At("/platform/jf/reimbursement/apply")
public class ActivityReimbursementApplyController {
@Inject
private Dao dao;
@Inject
private ActivityBxService activityBxService;
@@ -118,6 +125,17 @@ public class ActivityReimbursementApplyController {
@ViReturn
@RequiresPermissions("sys.jf.reimbursement.apply")
public Object getActivityReimbursementByUser() {
// 查询可以报销的活动
Cnd queryTissueCnd = Cnd.NEW();
// 这里要判断是不是管理员,不是就只能看自己创建的或者联系人是自己的
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
SqlExpressionGroup queryTissueGroup = new SqlExpressionGroup();
queryTissueGroup.or("userId", "=", ShiroUtil.getUserId());
queryTissueGroup.or("opBy", "=", ShiroUtil.getUserId());
queryTissueCnd.and(queryTissueGroup);
}
// 还要去排除报销表里边已经报销过了的,审核拒绝的报销不能过滤,要查出来重新报销走报销流程,直接查活动的id
Cnd cnd = Cnd.NEW();
cnd.and("state_id", "=", 1060);
cnd.andEX("`year`", "=", DateUtil.thisYear());
@@ -125,14 +143,27 @@ public class ActivityReimbursementApplyController {
seg.or("reimbursement_state_id", "in", List.of(1005, 1015, 1025, 1045));
seg.or("reimbursement_union_audit_id", "is", null);
cnd.and(seg);
Sql sql = Sqls.create("select activity_id from activity_bx $condition");
sql.setCondition(cnd);
sql.setCallback(Sqls.callback.strList());
dao.execute(sql);
List<String> activityIds = sql.getList(String.class);
// 查出来的这玩意activityIds,要从活动里边过滤掉
if (Lang.isNotEmpty(activityIds)) {
queryTissueCnd.and("id", "not in", activityIds);
}
// 上述条件过滤完之后,可以查询可报销的活动了,可以看看断点打印
List<ActivityTissue> list = dao.query(ActivityTissue.class, queryTissueCnd);
return list;
// cnd.and("reimbursement_unit_secretary_audit_id", "is", null);
// cnd.and("reimbursement_finance_audit_id", "is", null);
// cnd.and("reimbursement_school_director_id", "is", null);
// cnd.and("reimbursement_school_chairman_id", "is", null);
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("user_id", "=", ShiroUtil.getUserId());
}
return activityBxService.query(cnd);
// if (!ShiroUtil.hasAnyRoles("sysadmin")) {
// cnd.and("user_id", "=", ShiroUtil.getUserId());
// }
// return ;
}
@@ -60,7 +60,7 @@ public class UnionActivityRegisterController {
@Ok("re")
@RequiresAuthentication
public String goReg(String signUpMethod) {
if (signUpMethod.equals("1")) {
if ("1".equals(signUpMethod)) {
return "beetl:/mobile/activity/unionActivity/singleReg.html";
}
return "beetl:/mobile/activity/unionActivity/unionReg.html";
@@ -88,6 +88,9 @@ public class UnionActivityRegisterController {
act.needSign,
act.projectTypeCode,
act.teamNum,
act.groupId,
act.signStartTime,
act.signEndTime,
abs.`name` AS projectTypeName,
creater.username AS createUserName,
creater.mobile as createUserMobile
@@ -300,10 +303,7 @@ public class UnionActivityRegisterController {
@ViReturn
@RequiresAuthentication
public Object searchNoRegisterUser(String searchKey, String activityId) {
ActivityTissue tissue = simpleService.dao().fetch(ActivityTissue.class, Cnd.where("id", "=", activityId));
Sql sql = Sqls.create("""
SELECT
id,
@@ -315,11 +315,10 @@ public class UnionActivityRegisterController {
`user`
$condition
""");
String unionId = Vi.getUnionId();
Cnd cnd = Cnd.NEW();
if (tissue.getSignUpMethod() != 3) {
cnd.andEX("unionId", "=", unionId);
}
// if (tissue.getSignUpMethod() != 3) {
cnd.andEX("unionId", "=", Vi.getUnionId());
// }
cnd.and(Cnd.exps(Cnd.likeEX("username", searchKey.trim())).or(Cnd.likeEX("loginname", searchKey.trim())));
if (tissue.getGroupId() != null) {
cnd.and(new Static("""
@@ -352,10 +351,15 @@ public class UnionActivityRegisterController {
}
if (Lang.isNotEmpty(activityTissue.getUserNumberLimit())) {
if (activityTissue.getUserNumberLimit() == 1) {
int hasRegisterCount = simpleService.dao().count(ActivityTissuePerson.class, Cnd.where("tissueId", "=", activityId));
if (hasRegisterCount + personIds.length > activityTissue.getTotalUserNumberLimit()) {
// 判断当前人有没有组队报过名,如果报过名本次提交就算修改,可以放行这个判断
int count = simpleService.dao().count(ActivityTissuePerson.class, Cnd.where("tissueId", "=", activityId).and("applyUserId", "=", ShiroUtil.getUserId()));
if (count <= 0) {
int hasRegisterCount = simpleService.dao().count(ActivityTissuePerson.class, Cnd.where("tissueId", "=", activityId));
if (hasRegisterCount + personIds.length > activityTissue.getTotalUserNumberLimit()) {
// return Result.error().addMsg("当前最多只能报名%s人!".formatted(Math.max(activityTissue.getTotalUserNumberLimit() - hasRegisterCount, 0)));
return Result.error().addMsg("该活动限制人数为%s人".formatted(activityTissue.getTotalUserNumberLimit()));
return Result.error().addMsg("该活动限制人数为%s人".formatted(activityTissue.getTotalUserNumberLimit()));
}
}
}
if (activityTissue.getUserNumberLimit() == 2) {
@@ -55,7 +55,7 @@ public class QsvQuizRankController {
@At
@Ok("void")
@RequiresPermissions("qsv.quiz.rank")
public void exportXlsx(@Valid QsvQuizRankPageForm pageForm, HttpServletResponse response) {
public void exportXlsx(QsvQuizRankPageForm pageForm, HttpServletResponse response) {
qsvQuizRankService.exportXlsx(pageForm, response);
}
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject;
import cn.wizzer.framework.base.Result;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
import io.v.nutz.zhgh.qsv.dto.QsvCheckAnswerResult;
import io.v.nutz.zhgh.qsv.models.QsvActivity;
import io.v.nutz.zhgh.qsv.models.QsvSubject;
@@ -60,6 +61,12 @@ public class H5QsvQuizController {
@RequiresAuthentication
public Result subjects(@Valid String activityId) {
QsvActivity activity = dao.fetch(QsvActivity.class, activityId);
int count = dao.count(ActivityUserScope.class, Cnd.where("groupId", "=", activity.getGroupId()).and("userId", "=", ShiroUtil.getUserId()));
if (count != 1) {
return Result.error("您无需参加此次知识竞赛,感谢您的关注!");
}
String mode = activity.getMode();
//能否重复答题
Boolean repeatable = activity.getRepeatable();
@@ -78,7 +85,7 @@ public class H5QsvQuizController {
List<QsvUserAnswerRecord> answerRecords = dao.query(QsvUserAnswerRecord.class, Cnd.where("activityId", "=", activityId)
.and("userId", "=", ShiroUtil.getUserId()));
if (activity.getEndTime().after(new Date())) {
if (activity.getEndTime().before(new Date())) {
//已结束 查询最新一次的答题记录
Optional<QsvUserAnswerRecord> lastRecordOptional = answerRecords.stream().max(Comparator.comparing(QsvUserAnswerRecord::getAnswerTime));
if (lastRecordOptional.isPresent()) {
@@ -102,13 +109,13 @@ public class H5QsvQuizController {
}
} else {
if (mode.equals("REGULAR")) {
if ("REGULAR".equals(mode)) {
if (ObjectUtil.isEmpty(answerRecords)) {
//首次进来生成答题记录
if (displayMode.equals("ALL")) {
resultSubjects = dao.query(QsvSubject.class, Cnd.where("activityId", "=", activityId));
if ("ALL".equals(displayMode)) {
resultSubjects = dao.query(QsvSubject.class, Cnd.where("activityId", "=", activityId).asc("sortNum"));
answerRecordId = qsvUserAnswerRecordService.insertRecord(activityId, resultSubjects.stream().map(QsvSubject::getId).collect(Collectors.toList())).getId();
} else if (displayMode.equals("RANDOM")) {
} else if ("RANDOM".equals(displayMode)) {
//单次随机抽取题目数量
Integer randomCount = activity.getRandomCount();
@@ -130,17 +137,26 @@ public class H5QsvQuizController {
resultSubjects = dao.query(QsvSubject.class, cnd);
}
} else {
if (displayMode.equals("ALL")) {
if ("ALL".equals(displayMode)) {
//判断能否重复答题 如果可重复要根据次数判断是否再次生成记录 不能重复直接返回最新的一次记录
if (repeatable) {
//已回答次数
if (answerRecords.size() < maxAttempts) {
//生成答题记录
List<QsvSubject> subjects = dao.query(QsvSubject.class, Cnd.where("activityId", "=", activityId));
answerRecordId = qsvUserAnswerRecordService.insertRecord(activityId, subjects.stream().map(QsvSubject::getId).collect(Collectors.toList())).getId();
QsvUserAnswerRecord answerRecord = dao.fetch(QsvUserAnswerRecord.class, answerRecordId);
QsvUserAnswerRecord fetch = dao.fetch(QsvUserAnswerRecord.class, Cnd.where("activityId", "=", activityId)
.and("userId", "=", ShiroUtil.getUserId()).and("isFinish", "=", false)
.desc("randomNumber"));
List<String> subjectIds = new ArrayList<>();
if (fetch == null) {
List<QsvSubject> subjects = dao.query(QsvSubject.class, Cnd.where("activityId", "=", activityId).asc("sortNum"));
answerRecordId = qsvUserAnswerRecordService.insertRecord(activityId, subjects.stream().map(QsvSubject::getId).collect(Collectors.toList())).getId();
QsvUserAnswerRecord answerRecord = dao.fetch(QsvUserAnswerRecord.class, answerRecordId);
subjectIds = answerRecord.getSubjectIds();
List<String> subjectIds = answerRecord.getSubjectIds();
} else {
subjectIds = fetch.getSubjectIds();
answerRecordId = fetch.getId();
}
Cnd cnd = Cnd.where("id", "in", subjectIds);
String dynamic = subjectIds.stream().map(id -> "'" + id + "'").collect(Collectors.joining(","));
cnd.and(new Static("1=1 ORDER BY FIELD (id," + dynamic + ")"));
@@ -172,7 +188,7 @@ public class H5QsvQuizController {
throw new RuntimeException("业务异常");
}
}
} else if (displayMode.equals("RANDOM")) {
} else if ("RANDOM".equals(displayMode)) {
//判断是否有未答完的记录
Optional<QsvUserAnswerRecord> notFinishRecordOptional = answerRecords.stream().filter(r -> !r.getIsFinish()).findFirst();
if (notFinishRecordOptional.isPresent()) {
@@ -200,7 +216,7 @@ public class H5QsvQuizController {
//进行下一次抽取
List<String> subjectIds = answerRecords.stream().map(QsvUserAnswerRecord::getSubjectIds).flatMap(Collection::stream).toList();
List<QsvSubject> subjects = dao.query(QsvSubject.class, Cnd.where("activityId", "=", activityId)
.and("id", "not in", subjectIds));
.and("id", "not in", subjectIds).asc("sortNum"));
if (subjects.size() < randomCount) {
throw new RuntimeException("题目数不够,无法生成题目");
@@ -230,7 +246,7 @@ public class H5QsvQuizController {
}
}
}
} else if (mode.equals("SCHEDULED")) {
} else if ("SCHEDULED".equals(mode)) {
//定时定题
//查询今天的题目
@@ -246,7 +262,7 @@ public class H5QsvQuizController {
if (todayAllFinish && todayRecords.size() < maxAttempts) {
//生成今天的记录
List<QsvSubject> subjects = dao.query(QsvSubject.class, Cnd.where("activityId", "=", activityId)
.and("displayDate", "=", DateUtil.today()));
.and("displayDate", "=", DateUtil.today()).asc("sortNum"));
QsvUserAnswerRecord answerRecord = qsvUserAnswerRecordService.insertRecord(activityId, subjects.stream().map(QsvSubject::getId).collect(Collectors.toList()));
answerRecordId = answerRecord.getId();
@@ -273,7 +289,7 @@ public class H5QsvQuizController {
} else {
//生成今天的记录
List<QsvSubject> subjects = dao.query(QsvSubject.class, Cnd.where("activityId", "=", activityId)
.and("displayDate", "=", DateUtil.today()));
.and("displayDate", "=", DateUtil.today()).asc("sortNum"));
QsvUserAnswerRecord answerRecord = qsvUserAnswerRecordService.insertRecord(activityId, subjects.stream().map(QsvSubject::getId).collect(Collectors.toList()));
answerRecordId = answerRecord.getId();
@@ -7,6 +7,7 @@ import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.page.Pagination;
import io.v.nutz.base.service.impl.BaseServiceImpl;
import io.v.nutz.base.utils.CommonDownloadUtil;
import io.v.nutz.zhgh.qsv.models.QsvActivity;
import io.v.nutz.zhgh.qsv.models.QsvUserAnswerRecord;
import io.v.nutz.zhgh.qsv.param.QsvQuizRankPageForm;
@@ -83,7 +84,7 @@ public class QsvQuizRankServiceImpl extends BaseServiceImpl<QsvUserAnswerRecord>
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, list);
// CommonDownloadUtil.download(activity.getTitle() + "得分名单" + ".xlsx", workbook, response);
CommonDownloadUtil.download(activity.getTitle() + "得分名单" + ".xlsx", workbook, response);
}
private Sql buildQuerySql(String activityId, String mode, String scoreStatisticsMode, QsvQuizRankPageForm pageForm) {
@@ -8,6 +8,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import io.v.nutz.base.service.impl.BaseServiceImpl;
import io.v.nutz.base.utils.CommonDownloadUtil;
import io.v.nutz.zhgh.qsv.models.QsvActivity;
import io.v.nutz.zhgh.qsv.models.QsvOption;
import io.v.nutz.zhgh.qsv.models.QsvSubject;
@@ -45,7 +46,8 @@ public class QsvSurveyServiceImpl extends BaseServiceImpl<QsvUserAnswerRecord> i
try {
// 查询用户答题记录
List<QsvUserAnswerRecord> answerRecords = dao().query(QsvUserAnswerRecord.class, Cnd.where("activityId", "=", activityId));
List<QsvUserAnswerRecord> answerRecords = dao().query(QsvUserAnswerRecord.class, Cnd.where("activityId", "=", activityId)
.and("isFinish", "=", true));
// 将答题记录的扩展JSON转换为JSONObject列表
List<JSONObject> answerExtList = answerRecords.stream().map(QsvUserAnswerRecord::getExtJson).toList();
@@ -122,7 +124,8 @@ public class QsvSurveyServiceImpl extends BaseServiceImpl<QsvUserAnswerRecord> i
}
// 查询用户答题记录
List<QsvUserAnswerRecord> answerRecords = dao().query(QsvUserAnswerRecord.class, Cnd.where("activityId", "=", activityId));
List<QsvUserAnswerRecord> answerRecords = dao().query(QsvUserAnswerRecord.class, Cnd.where("activityId", "=", activityId)
.and("isFinish", "=", true));
// 将答题记录的扩展JSON转换为JSONObject列表
List<JSONObject> answerExtList = answerRecords.stream().map(QsvUserAnswerRecord::getExtJson).toList();
@@ -148,7 +151,7 @@ public class QsvSurveyServiceImpl extends BaseServiceImpl<QsvUserAnswerRecord> i
exportParams.setType(ExcelType.XSSF);
// 导出Excel并下载
try (Workbook workbook = ExcelExportUtil.exportExcel(exportParams, excelExportEntities, list)) {
// CommonDownloadUtil.download(activity.getTitle() + "答题记录" + ".xlsx", workbook, response);
CommonDownloadUtil.download(activity.getTitle() + "答题记录" + ".xlsx", workbook, response);
}
} catch (Exception e) {
log.error("导出Excel失败", e);
@@ -165,9 +168,10 @@ public class QsvSurveyServiceImpl extends BaseServiceImpl<QsvUserAnswerRecord> i
try {
// 查询用户答题记录
List<QsvUserAnswerRecord> answerRecords = dao().query(QsvUserAnswerRecord.class, Cnd.where("activityId", "=", activityId));
List<QsvUserAnswerRecord> answerRecords = dao().query(QsvUserAnswerRecord.class, Cnd.where("activityId", "=", activityId)
.and("isFinish", "=", true));
// 将答题记录的扩展JSON转换为JSONObject列表
List<JSONObject> answerExtList = answerRecords.stream().map(QsvUserAnswerRecord::getExtJson).toList();
// List<JSONObject> answerExtList = answerRecords.stream().map(QsvUserAnswerRecord::getExtJson).toList();
// 查询活动题目列表
List<QsvSubject> subjects = dao().query(QsvSubject.class, Cnd.where("activityId", "=", activityId));
@@ -36,7 +36,7 @@ public class QsvUserAnswerRecordServiceImpl extends BaseServiceImpl<QsvUserAnswe
Boolean shuffleSubject = activity.getShuffleSubject();
//打乱题目顺序
if (category.equals("QUIZ") && shuffleSubject) {
if ("QUIZ".equals(category) && shuffleSubject) {
Collections.shuffle(subjectIds);
}
@@ -64,13 +64,13 @@ public class QsvUserAnswerRecordServiceImpl extends BaseServiceImpl<QsvUserAnswe
record.setUnionName(user.getUnionname());
//问卷模式
if (category.equals("QUIZ")) {
if (mode.equals("REGULAR")) {
if ("QUIZ".equals(category)) {
if ("REGULAR".equals(mode)) {
//常规模式 抽取随机题目
int count = dao().count(QsvUserAnswerRecord.class, Cnd.where("activityId", "=", activityId)
.and("userId", "=", ShiroUtil.getUserId()));
record.setRandomNumber(count + 1);
} else if (mode.equals("SCHEDULED")) {
} else if ("SCHEDULED".equals(mode)) {
//定时定题模式
int count = dao().count(QsvUserAnswerRecord.class, Cnd.where("activityId", "=", activityId)
.and("userId", "=", ShiroUtil.getUserId())
@@ -88,8 +88,8 @@ public class SourceChangeManageController {
Cnd cnd = Cnd.NEW();
if(StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("username",pageForm.getSearchKeyword());
seg.orLike("loginname",pageForm.getSearchKeyword());
seg.orLike("u.username",pageForm.getSearchKeyword());
seg.orLike("u.loginname",pageForm.getSearchKeyword());
cnd.and(seg);
}
if (StrUtil.isAllNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
@@ -233,7 +233,9 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
history.setChangeTypes(changeTypes);
dao().insert(history);
dao().update(SourceChangeMiddleTable.class, Chain.make("isOperate", 2), Cnd.where("id", "=", middleTable.getId()));
dao().update(SourceChangeMiddleTable.class, Chain.make("isOperate", 2)
.add("retireDate", middleTable.getRetireDate()),
Cnd.where("id", "=", middleTable.getId()));
sysUserService.deleteCacheAndUpdate(userId);
sysUserService.clearCache();
@@ -1,4 +1,45 @@
const commonUtil = {
//axios配置
axiosService() {
// 创建 axios 实例
const axiosService = axios.create({
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
"x-requested-with": "XMLHttpRequest"
}
})
//axios拦截器
axiosService.interceptors.response.use(
(response) => {
const userAgent = navigator.userAgent || navigator.vendor || window.opera
const isMobile = /iPad|iPhone|iPod|Android/.test(userAgent)
//判断是否为blob 不处理直接返回文件流
if (response.config.responseType === "blob") {
return response
}
if (response.data && response.data.code !== 0) {
if (isMobile) {
vant.Toast(response.data.msg)
} else {
ELEMENT.Message.error(response.data.msg)
}
return Promise.reject(response.data)
}
return response.data
},
(error) => {
const userAgent = navigator.userAgent || navigator.vendor || window.opera
const isMobile = /iPad|iPhone|iPod|Android/.test(userAgent)
if (isMobile) {
vant.Toast(error.message)
} else {
ELEMENT.Message.error(error.message)
}
return Promise.reject(error)
}
)
return axiosService
},
//权限认证
authService() {
function authPermission(permission) {
@@ -65,4 +106,55 @@ const commonUtil = {
}
}
},
//下载文件
downLoadService: function (url, data) {
const loading = ELEMENT.Loading.service({
lock: true,
text: "导出中,请耐心等待",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)"
})
Vue.prototype.$axios
.post(url, data, { responseType: "blob" })
.then((response) => {
if (response.data.type === "application/json") {
try {
const reader = new FileReader()
reader.onload = function () {
// reader.result 包含了 Blob 的内容,转换为字符串
const content = reader.result
// 将字符串解析为 JSON 对象
const jsonObject = JSON.parse(content)
this.$message.error(jsonObject.msg)
}
reader.readAsText(response.data)
} catch (err) {
this.$message.error("下载文件出错")
}
return
}
//获取服务器返回的文件描述信息
const contentDisposition = response.headers["content-disposition"]
const filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/
const matches = filenameRegex.exec(contentDisposition)
let filename = ""
if (matches != null && matches[1]) {
filename = matches[1].replace(/['"]/g, "")
filename = decodeURIComponent(filename)
}
//执行下载文件
const url = window.URL.createObjectURL(new Blob([response.data]))
const link = document.createElement("a")
link.href = url
link.setAttribute("download", filename) // 例如 'document.pdf'
document.body.appendChild(link)
link.click()
link.parentNode.removeChild(link)
loading.close()
})
.finally(() => {
loading.close()
})
},
}
@@ -5,7 +5,8 @@ const self_mixin = {
hasRegUserNum: 0,
unionId: null,
unionLimitNum: 0,
isRegisterFull: false
isRegisterFull: false,
user: JSON.parse(window.sessionStorage.getItem('user'))
}
},
methods: {
@@ -15,9 +16,9 @@ const self_mixin = {
resp.data.location = JSON.parse(resp.data.location)
resp.data.unionUserNumberLimit = JSON.parse(resp.data.unionUserNumberLimit)
this.o = resp.data
this.unionId = "${@shiro.getPrincipalProperty('unit').getUnionid()}"
this.unionId = this.user.union.id
if (!this.unionId) {
this.$toast.fail('您的所属工会信息缺失,请联系管理员')
this.$message.warning('您的所属工会信息缺失,请联系管理员')
return
}
if (this.o.userNumberLimit === 2) {
@@ -127,4 +128,4 @@ const self_mixin = {
return s.toFixed(2)
}
}
}
}
File diff suppressed because it is too large Load Diff
@@ -1,373 +1,312 @@
<template>
<el-tabs tab-position="top" v-model="activeName" v-loading="loading">
<el-tab-pane label="活动基础信息" name="1">
<el-form label-suffix=":" style="padding: 20px 0" label-width="120px">
<el-form-item class="item-center">{{ viewData.name }}</el-form-item>
<el-tabs tab-position="top" v-model="activeName" v-loading="loading">
<el-tab-pane label="活动基础信息" name="1">
<border-table>
<table>
<tr>
<th>联系人</th>
<td>{{ viewData.username }}( {{ viewData.loginname }})</td>
<th>联系方式</th>
<td>{{ viewData.mobile }}</td>
<th>活动编号</th>
<td>{{ viewData.activityCode }}</td>
</tr>
<tr>
<th>活动名称</th>
<td>{{ viewData.name }}</td>
<th>活动类型</th>
<td>{{ viewData.type === 1 ? "分工会活动" : viewData.type === 2 ? "协会协会活动" : "校工会活动" }}</td>
<th>活动项目类型</th>
<td>{{ viewData.projectTypeName }}( {{ viewData.projectTypeCode }})</td>
</tr>
<tr>
<th>活动地点</th>
<td>{{ viewData.address }}</td>
<th>报名时间</th>
<td>{{ viewData.applyStartTime }} - {{ viewData.applyEndTime }}</td>
<th>活动时间</th>
<td>{{ viewData.startTime }} - {{ viewData.endTime }}</td>
</tr>
<tr>
<th>创建组织</th>
<td>
<span v-if="viewData.type===40001">{{ "校工会" }}</span>
<span v-if="viewData.type===40002">{{ viewData.unionname ? viewData.unionname : "暂无" }}</span>
<span v-if="viewData.type===40003">{{ viewData.clubName ? viewData.clubName : "暂无" }}</span>
</td>
<th>报名方式</th>
<td>
<span v-if="viewData.signUpMethod===1">个人报名</span>
<span v-else-if="viewData.signUpMethod===2">分工会报名</span>
<span v-else-if="viewData.signUpMethod===3">组队报名</span>
<span v-else-if="!viewData.signUpMethod">无需报名</span>
</td>
<th>报名人数限制</th>
<td>
<span v-if="viewData.userNumberLimit===1">总人数限制({{viewData.totalUserNumberLimit }})</span>
<span v-else-if="viewData.userNumberLimit===2">分工会人数限制</span>
<span v-else-if="!viewData.userNumberLimit">不限制</span>
</td>
</tr>
<tr v-if="viewData.userNumberLimit===2">
<th>报名方式</th>
<td colspan="5">
<el-table border stripe :data="viewData.unionUserNumberLimit" size="small"
height="500">
<el-table-column type="index" label="序号" header-align="center" align="center"
width="100">
</el-table-column>
<el-table-column label="分工会名称" prop="unionname"></el-table-column>
<el-table-column label="分工会人数" prop="teacherCount"></el-table-column>
<el-table-column label="限制人数" prop="limitNum"></el-table-column>
</el-table>
</td>
</tr>
<tr v-if="viewData.needSign && viewData.needSign!=null">
<th>是否需要签到</th>
<td>{{ viewData.needSign ? "需要" : "不需要" }}</td>
<th>签到半径</th>
<td colspan="3">{{ viewData.rangeMeter + "米" }}</td>
</tr>
<tr v-if="viewData.needSign">
<th>活动签到点位</th>
<td colspan="5">
<el-card shadow="never">
<div style="width: 100%;height: 500px" id="signMap"></div>
</el-card>
</td>
</tr>
<tr>
<th>活动介绍</th>
<td colspan="5">
<div v-html="viewData.activityContent"></div>
</td>
</tr>
<tr>
<th>附件</th>
<td colspan="5">
<file-upload v-if="viewData.otherFiles&&viewData.otherFiles.length"
:files="viewData.otherFiles" :view="true">
</file-upload>
<span v-else>暂无</span>
</td>
</tr>
<tr>
<th>封面图</th>
<td colspan="5">
<img v-if="viewData.cover"
:src="FILE_DOMAIN + '/fileStreamPreview?id=' + viewData.cover"
class="avatar" style="height: 200px;width: auto">
<span v-else>暂无</span>
</td>
</tr>
<el-row gutter="60">
</table>
</border-table>
<el-col :span="12">
<el-form-item label="联系人">
<span v-if="viewData.username">
{{ viewData.username }}
({{ viewData.loginname }})</span>
</el-form-item>
</el-col>
</el-tab-pane>
<el-tab-pane label="活动费用" name="3" v-if="!viewData.isEnrollSystem">
<el-form label-suffix=":" label-position="left" style="padding: 20px 0" label-width="80px">
<el-col :span="12">
<el-form-item label="联系方式">
{{ viewData.mobile }}
</el-form-item>
</el-col>
<el-table border stripe :data="viewData.goods">
<el-col :span="12">
<el-form-item label="活动编号">
{{ viewData.activityCode }}
</el-form-item>
</el-col>
<el-table-column
type="index" label="序号" header-align="center" align="center" width="100">
</el-table-column>
<el-col :span="12">
<el-form-item label="活动项目类型">
{{ viewData.projectTypeName }}({{ viewData.projectTypeCode }})
</el-form-item>
</el-col>
<el-table-column
label="物品名称" header-align="center" align="center" prop="name">
</el-table-column>
<el-col :span="12">
<el-form-item label="活动类型">
{{ viewData.type === 1 ? '分工会活动' : viewData.type === 2 ? '协会协会活动' : '校工会活动' }}
</el-form-item>
</el-col>
<el-table-column
label="物品价格" header-align="center" align="center" prop="actualPrice">
</el-table-column>
</el-table>
<el-col :span="12">
<el-form-item label="活动计划时间">
{{ viewData.startPlannedDate + ' - ' + viewData.endPlannedDate }}
</el-form-item>
</el-col>
<el-form-item label="发&emsp;&emsp;票">
<file-upload v-if="viewData.billFiles&&viewData.billFiles.length"
:files="viewData.billFiles" :view="true">
</file-upload>
<span v-else>暂无</span>
</el-form-item>
<el-col :span="12">
<el-form-item label="活动时间">{{ viewData.startTime }} - {{
viewData.endTime
}}
</el-form-item>
</el-col>
<el-col :span="12" v-if="viewData.applyStartTime">
<el-form-item label="报名时间">{{ viewData.applyStartTime }} - {{
viewData.applyEndTime
}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动人数">{{ viewData.peopleNum || '暂无' }}</el-form-item>
</el-col>
<el-form-item label="照&emsp;&emsp;片">
<file-upload v-if="viewData.photoFiles&&viewData.photoFiles.length"
:files="viewData.photoFiles" :view="true">
</file-upload>
<span v-else>暂无</span>
</el-form-item>
</el-form>
<el-col :span="24">
<el-form-item label="活动内容">
<span style="white-space: pre-line">
{{ viewData.activityContent }}
</span>
</el-form-item>
</el-col>
<el-col :span="24" v-if="!viewData.isEnrollSystem">
<el-form-item label="活动考核内容">
<span style="white-space: pre-line">
{{ viewData.activityExamineContent }}
</span>
</el-form-item>
</el-col>
</el-tab-pane>
<el-tab-pane label="活动总结" name="4" v-if="!viewData.isEnrollSystem">
<el-form ref="form" label-width="120px">
<el-form-item prop="activitySummary" label="活动总结">
{{ viewData.activitySummary }}
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="审核信息" name="5" v-if="viewData.auditId">
<el-form ref="form" label-width="120px">
<el-col :span="24">
<el-form-item label="活动地点">{{ viewData.address }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="报名方式">
<span v-if="viewData.signUpMethod===1">个人报名</span>
<span v-else-if="viewData.signUpMethod===2">分工会报名</span>
<span v-else-if="viewData.signUpMethod===3">组队报名</span>
<span v-else-if="!viewData.signUpMethod">无需报名</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动提醒">
{{ viewData.xlFlag ? '提醒' : '不提醒' }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否用于报名">
<span v-if="viewData.isEnrollSystem">活动报名</span>
<span v-else>活动管理</span>
</el-form-item>
</el-col>
<el-col :span="12" v-if="viewData.signUpMethod!=null">
<el-form-item label="报名人数限制">
<span v-if="viewData.userNumberLimit===1">总人数限制({{
viewData.totalUserNumberLimit
}})</span>
<span v-else-if="viewData.userNumberLimit===2">分工会人数限制</span>
<span v-else-if="!viewData.userNumberLimit">不限制</span>
</el-form-item>
</el-col>
<el-col :span="24" v-if="viewData.userNumberLimit===2">
<el-form-item label="分工会限制名额">
<el-table border stripe :data="viewData.unionUserNumberLimit" size="small"
height="500">
<el-table-column type="index" label="序号" header-align="center" align="center"
width="100">
</el-table-column>
<el-table-column label="分工会名称" prop="unionname"></el-table-column>
<el-table-column label="分工会人数" prop="teacherCount"></el-table-column>
<el-table-column label="限制人数" prop="limitNum"></el-table-column>
</el-table>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item v-if="viewData.type===1" label="所属工会">
{{ !viewData.unionname ? '暂无' : viewData.unionname }}
</el-form-item>
<el-form-item v-if="viewData.type===2" label="所属协会">
{{ !viewData.clubName ? '暂无' : viewData.clubName }}
</el-form-item>
<el-form-item v-if="viewData.type===3" label="所属组织">
校工会
</el-form-item>
</el-col>
<el-col :span="12" v-if="[1,2].includes(viewData.signUpMethod)">
<el-form-item label="是否需要签到">
{{ viewData.needSign ? '需要' : '不需要' }}
</el-form-item>
</el-col>
<el-col :span="12" v-if="viewData.signUpMethod!=null">
<el-form-item label="签到半径(m)" v-if="viewData.needSign">
{{ viewData.rangeMeter + '' }}
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="封面图" prop="cover">
<img v-if="viewData.cover"
:src="FILE_DOMAIN + '/fileStreamPreview?id=' + viewData.cover"
class="avatar" style="height: 200px;width: auto">
</el-form-item>
</el-col>
<el-col :span="24" v-if="viewData.needSign">
<el-form-item prop="" label="活动签到点位">
<el-card shadow="never">
<div style="width: 100%;height: 500px" id="signMap"></div>
</el-card>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
<el-tab-pane label="活动费用" name="3" v-if="!viewData.isEnrollSystem">
<el-form label-suffix=":" label-position="left" style="padding: 20px 0" label-width="80px">
<el-table border stripe :data="viewData.goods">
<el-table-column
type="index" label="序号" header-align="center" align="center" width="100">
</el-table-column>
<el-table-column
label="物品名称" header-align="center" align="center" prop="name">
</el-table-column>
<el-table-column
label="物品价格" header-align="center" align="center" prop="actualPrice">
</el-table-column>
</el-table>
<el-form-item label="发&emsp;&emsp;票">
<file-upload v-if="viewData.billFiles&&viewData.billFiles.length"
:files="viewData.billFiles" :view="true">
</file-upload>
<span v-else>暂无</span>
</el-form-item>
<el-form-item label="照&emsp;&emsp;片">
<file-upload v-if="viewData.photoFiles&&viewData.photoFiles.length"
:files="viewData.photoFiles" :view="true">
</file-upload>
<span v-else>暂无</span>
</el-form-item>
<el-form-item label="其&emsp;&emsp;他">
<file-upload v-if="viewData.otherFiles&&viewData.otherFiles.length"
:files="viewData.otherFiles" :view="true">
</file-upload>
<span v-else>暂无</span>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="活动总结" name="4" v-if="!viewData.isEnrollSystem">
<el-form ref="form" label-width="120px">
<el-form-item prop="activitySummary" label="活动总结">
{{ viewData.activitySummary }}
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="审核信息" name="5" v-if="viewData.auditId">
<el-form ref="form" label-width="120px">
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="审核人员:">
{{ viewData.audit.username }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间:">
{{ viewData.audit.auditTime }}
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="审核意见:">
{{ viewData.audit.auditOpinion }}
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
<el-tab-pane v-if="handle" :label="label" name="999">
<slot name="handle"></slot>
</el-tab-pane>
</el-tabs>
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="审核人员:">
{{ viewData.audit.username }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间:">
{{ viewData.audit.auditTime }}
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="审核意见:">
{{ viewData.audit.auditOpinion }}
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
<el-tab-pane v-if="handle" :label="label" name="999">
<slot name="handle"></slot>
</el-tab-pane>
</el-tabs>
</template>
<script>
module.exports = {
props: {
handle: {
type: Boolean,
default: false,
},
label: {
type: String,
default: '审核'
},
},
data() {
return {
userData: [],
viewData: {},
loading: true,
search: '',
tableKey: '',
activeName: '1',
userColumns: [],
}
},
components: {
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
},
methods: {
hasPane(name) {
if (!this.handle) {
return true
}
return this.panes.includes(name)
},
async doExport() {
window.open("/platform/activity/info/mange/doExportUser?id=" + this.viewData.id)
},
async userChange() {
if (this.search) {
const {data} = await $.get("/platform/activity/info/mange/searchTissueUser", {
id: this.viewData.id,
search: this.search
})
this.userData = data
}
},
async getInfo(id) {
this.userColumns = [{prop: 'userName', label: '姓名'},
{prop: 'loginName', label: '工号'},
{prop: 'sex', label: '性别'},
{prop: 'mobile', label: '联系方式'},
{prop: 'unitName', label: '所属单位'},
{prop: 'unionName', label: '所属工会'}]
this.loading = true
const {data} = await $.get("/platform/activity/info/mange/findOne", {id})
this.loading = false
if (data) {
if (data.needSign) {
this.userColumns.push({prop: 'isSign', label: '是否签到'})
this.userColumns.push({prop: 'signTime', label: '签到时间'})
props: {
handle: {
type: Boolean,
default: false
},
label: {
type: String,
default: "审核"
}
data.billFiles = JSON.parse(data.billFiles)
data.photoFiles = JSON.parse(data.photoFiles)
data.otherFiles = JSON.parse(data.otherFiles)
this.userData = clone(data.tissuePersonList)
data.unionUserNumberLimit = JSON.parse(data.unionUserNumberLimit)
data.location = JSON.parse(data.location)
this.viewData = data
this.tableKey = new Date().getTime()
this.initMap()
this.activeName = this.handle ? "999" : "1"
} else {
this.viewData = {}
this.$notify.error({title: '错误', message: '获取信息失败'});
}
},
initMap() {
let marker = null
this.$nextTick(() => {
let map = new AMap.Map("signMap", {
resizeEnable: true,
center: [118.640081, 32.082496],
zoom: 16
});
data() {
return {
userData: [],
viewData: {},
loading: true,
search: "",
tableKey: "",
activeName: "1",
userColumns: []
}
},
components: {
"file-upload": httpVueLoader("/components/plugins/FileUpload.vue")
},
methods: {
hasPane(name) {
if (!this.handle) {
return true
}
return this.panes.includes(name)
},
async doExport() {
window.open("/platform/activity/info/mange/doExportUser?id=" + this.viewData.id)
},
async userChange() {
if (this.search) {
const { data } = await $.get("/platform/activity/info/mange/searchTissueUser", {
id: this.viewData.id,
search: this.search
})
this.userData = data
}
},
async getInfo(id) {
this.userColumns = [{ prop: "userName", label: "姓名" },
{ prop: "loginName", label: "工号" },
{ prop: "sex", label: "性别" },
{ prop: "mobile", label: "联系方式" },
{ prop: "unitName", label: "所属单位" },
{ prop: "unionName", label: "所属工会" }]
this.loading = true
const { data } = await $.get("/platform/activity/info/mange/findOne", { id })
this.loading = false
if (data) {
if (data.needSign) {
this.userColumns.push({ prop: "isSign", label: "是否签到" })
this.userColumns.push({ prop: "signTime", label: "签到时间" })
}
data.billFiles = JSON.parse(data.billFiles)
data.photoFiles = JSON.parse(data.photoFiles)
data.otherFiles = JSON.parse(data.otherFiles)
this.userData = clone(data.tissuePersonList)
data.unionUserNumberLimit = JSON.parse(data.unionUserNumberLimit)
data.location = JSON.parse(data.location)
this.viewData = data
this.tableKey = new Date().getTime()
this.initMap()
this.activeName = this.handle ? "999" : "1"
} else {
this.viewData = {}
this.$notify.error({ title: "错误", message: "获取信息失败" })
}
},
initMap() {
let marker = null
this.$nextTick(() => {
let map = new AMap.Map("signMap", {
resizeEnable: true,
center: [118.640081, 32.082496],
zoom: 16
})
if (this.viewData.location && Array.isArray(this.viewData.location)) {
const lng = parseFloat(this.viewData.location[0])
const lat = parseFloat(this.viewData.location[1])
marker = new AMap.Marker({
position: [lng, lat],
offset: new AMap.Pixel(-13, -30)
});
marker.setMap(map);
map.setZoomAndCenter(18, [lng, lat])
if (this.viewData.location && Array.isArray(this.viewData.location)) {
const lng = parseFloat(this.viewData.location[0])
const lat = parseFloat(this.viewData.location[1])
marker = new AMap.Marker({
position: [lng, lat],
offset: new AMap.Pixel(-13, -30)
})
marker.setMap(map)
map.setZoomAndCenter(18, [lng, lat])
}
map.on("click", (e) => {
console.log(e)
if (marker) {
marker.setMap(null)
marker = null
}
marker = new AMap.Marker({
position: [e.lnglat.getLng(), e.lnglat.getLat()],
offset: new AMap.Pixel(-13, -30)
})
marker.setMap(map)
this.formData.location = []
this.formData.location.push(e.lnglat.getLng())
this.formData.location.push(e.lnglat.getLat())
})
})
}
map.on('click', (e) => {
console.log(e)
if (marker) {
marker.setMap(null)
marker = null
}
marker = new AMap.Marker({
position: [e.lnglat.getLng(), e.lnglat.getLat()],
offset: new AMap.Pixel(-13, -30)
})
marker.setMap(map)
this.formData.location = []
this.formData.location.push(e.lnglat.getLng())
this.formData.location.push(e.lnglat.getLat())
});
})
}
},
}
</script>
<style>
.item-center {
text-align: center;
font-weight: 700;
margin-right: 110px;
text-align: center;
font-weight: 700;
margin-right: 110px;
}
.item-center .el-form-item__content {
font-size: 18px;
font-size: 18px;
}
</style>
@@ -36,6 +36,9 @@
<script type="text/javascript" src="${base!}/assets/platform/plugins/wp-upload-vue/font/iconfont.js"></script>
<script type="text/javascript" src="${base!}/assets/platform/plugins/wp-upload-vue/js/wpupload.js"></script>
<!--axios-->
<script src="${base!}/assets/platform/plugins/axios/axios.js"></script>
<!-- import JavaScript -->
<script src="${base!}/assets/platform/plugins/element-ui/lib/index.js"></script>
<script src="${base!}/assets/platform/plugins/element-ui/lib/i18n/${lang,escape}.js"></script>
@@ -146,6 +149,8 @@
window.viewImage = viewImage;
Vue.prototype.$viewImage = viewImage
Vue.prototype.$auth = commonUtil.authService()
Vue.prototype.$axios = commonUtil.axiosService()
Vue.prototype.$downLoad = commonUtil.downLoadService
</script>
</head>
<body>
@@ -61,11 +61,7 @@
</van-cell>
<van-cell title="活动内容" v-if="o.projectTypeCode!=='50004'">
<template #label>
<span style="white-space: pre-line">
{{o.activityContent}}
</span>
</template>
<span @click.stop="showActivityInfo(o.activityContent)" style="color: #0a84ff">点我查看详情</span>
</van-cell>
<van-cell title="签到点位" v-if="o.needSign">
<template #label>
@@ -1,11 +1,12 @@
const self_mixin = {
const self_mixin_h5 = {
data() {
return {
//已报名人数
hasRegUserNum: 0,
unionId: null,
unionLimitNum: 0,
isRegisterFull: false
isRegisterFull: false,
user: JSON.parse(window.sessionStorage.getItem('user'))
}
},
methods: {
@@ -15,7 +16,7 @@ const self_mixin = {
resp.data.location = JSON.parse(resp.data.location)
resp.data.unionUserNumberLimit = JSON.parse(resp.data.unionUserNumberLimit)
this.o = resp.data
this.unionId = "${@shiro.getPrincipalProperty('unit').getUnionid()}"
this.unionId = this.user.union.id
if (!this.unionId) {
this.$toast.fail('您的所属工会信息缺失,请联系管理员')
return
@@ -52,8 +53,9 @@ const self_mixin = {
zoomEnable: true,
dragEnable: false,
resizeEnable: true,
center: [114.402582, 30.521378],
zoom: 16
center: [119.743667, 30.216618],
zoom: 16,
scrollWheel: true,
});
if (this.o.location && Array.isArray(this.o.location)) {
@@ -61,7 +63,7 @@ const self_mixin = {
const lat = parseFloat(this.o.location[1])
marker = new AMap.Marker({
position: [lng, lat],
offset: new AMap.Pixel(-13, -30)
//offset: new AMap.Pixel(-13, -30)
})
map.add(marker)
// marker.setMap(map);
@@ -127,4 +129,4 @@ const self_mixin = {
return s.toFixed(2)
}
}
}
}
@@ -168,7 +168,7 @@ layout("/mobile/platform.html"){
if (o.projectTypeCode === '50004') {
pjaxReplace('/mobile/activity/myActivity/goMyProject?id=' + o.id)
} else {
pjaxReplace('/mobile/activity/unionActivity/goReg?id=' + o.id + '&signUpMethod=' + o.signUpMethod)
pjaxReplace('/mobile/activity/myActivity/goSign?id=' + o.id)
}
}
},
@@ -9,22 +9,43 @@ layout("/mobile/platform.html"){
height: 200px;
width: 100%;
}
.remark-content{
width: 100%;
max-width: 100%;
height: calc(100vh - 46px - 44px);
overflow-y: auto;
}
.remark-content *{
max-width: 100%!important;
}
.joinPopup {
width: 100%;
height: 100%;
background-color: #f6f7f9;
}
</style>
<div id="app" v-cloak>
<van-nav-bar title="签到" left-arrow placeholder fixed @click-left="history.back()"></van-nav-bar>
<van-nav-bar title="签到" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/activity/unionActivity')"></van-nav-bar>
<!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#-->
<div style="margin: 20px 20px 10px 20px" v-if="o.needSign">
<van-button
:disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf() || isSign"
:disabled="isSign"
@click="doSign()" style="border-radius: 10px" block type="info"
:color="themeColor">
{{isSign?'签到成功':'立即签到'}}
</van-button>
</div>
<van-popup class="joinPopup" position="right" v-model:show="showActivityInfoPopup">
<van-nav-bar @click-left="showActivityInfoPopup = false" fixed left-arrow placeholder title="活动内容"></van-nav-bar>
<div class="remark-content" v-html="activityContent" @click="remarkClick"></div>
</van-popup>
</div>
@@ -36,15 +57,29 @@ layout("/mobile/platform.html"){
let geolocation = null
const vue = new Vue({
el: '#app',
mixins: [mobileMixins, self_mixin],
mixins: [mobileMixins, self_mixin_h5],
data() {
return {
activityId: '',
o: {},
isSign: null
isSign: null,
activityContent: '',
showActivityInfoPopup: false
}
},
methods: {
remarkClick(event){
//如果点击的是图片
if(event.target.tagName === 'IMG'){
vant.ImagePreview([event.target.src])
}
},
showActivityInfo(activityContent){
this.activityContent = ''
this.activityContent = activityContent
this.showActivityInfoPopup = true
},
async getSignStatus() {
const resp = await $.post('/mobile/activity/unionActivity/isSign', {activityId: this.activityId})
if (resp.code === 0) {
@@ -52,6 +87,12 @@ layout("/mobile/platform.html"){
}
},
async doSign() {
const loading1 = this.$toast.loading({
message: '正在获取您的位置...',
forbidClick: true,
overlay: true,
duration: 0
})
geolocation.getCurrentPosition(async (status, result) => {
if (status !== 'complete') {
this.$toast.fail('定位失败!')
@@ -67,10 +108,21 @@ layout("/mobile/platform.html"){
const distance = this.getMapDistance(params)
console.log(distance)
console.log(this.o.rangeMeter)
loading1.close()
if (!moment().isBetween(moment(this.o.signStartTime), moment(this.o.signEndTime))) {
vant.Dialog.alert({
title: '温馨提示',
message: '未到签到时间<br/>签到开始时间:' + this.o.signStartTime + '<br/>签到结束时间:' + this.o.signEndTime,
})
return
}
if (distance > this.o.rangeMeter) {
this.$toast('距离活动打卡点还有' + distance + '米')
return
}
const confirm = await this.$dialog.confirm({
title: '提示',
message: '您确认要签到吗?',
@@ -83,23 +135,24 @@ layout("/mobile/platform.html"){
})
if (confirm === 'confirm') {
const resp = await $.post('/mobile/activity/unionActivity/singleSignUp', {activityId: this.activityId})
loading.close()
if (resp.code === 0) {
await this.getSignStatus()
loading.close()
this.$toast.success(resp.msg)
} else {
this.$toast.fail(resp.msg)
}
}
})
}
},
created() {
async created() {
const id = GetQueryString("id")
if (id) {
this.activityId = id
this.getActivityInfo()
this.getSignStatus()
await this.getActivityInfo()
await this.getSignStatus()
}
}
})
@@ -107,4 +160,4 @@ layout("/mobile/platform.html"){
<!--#
}
#-->
#-->
@@ -9,6 +9,23 @@ layout("/mobile/platform.html"){
/*height: 200px;*/
width: 100%;
}
.remark-content{
width: 100%;
max-width: 100%;
height: calc(100vh - 46px - 44px);
overflow-y: auto;
}
.remark-content *{
max-width: 100%!important;
}
.joinPopup {
width: 100%;
height: 100%;
background-color: #f6f7f9;
}
</style>
<div id="app" v-cloak>
@@ -41,7 +58,7 @@ layout("/mobile/platform.html"){
</van-button>
</div>
<div style="margin: 20px 20px 10px 20px"
<!--<div style="margin: 20px 20px 10px 20px"
v-if="isRegister && moment().valueOf() < moment(o.endTime).valueOf() && moment().valueOf() > moment(o.startTime).valueOf()">
<van-button
:color="themeColor"
@@ -50,25 +67,45 @@ layout("/mobile/platform.html"){
type="info">
{{isSign?'签到成功':'立即签到'}}
</van-button>
</div>
</div>-->
<van-popup class="joinPopup" position="right" v-model:show="showActivityInfoPopup">
<van-nav-bar @click-left="showActivityInfoPopup = false" fixed left-arrow placeholder title="活动内容"></van-nav-bar>
<div class="remark-content" v-html="activityContent" @click="remarkClick"></div>
</van-popup>
</div>
<script>
<!--#include("/mobile/activity/unionActivity/common/initMap.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [mobileMixins, self_mixin],
mixins: [mobileMixins, self_mixin_h5],
data() {
return {
activityId: '',
o: {},
tagCloseable: true,
isRegister: false,
isSign: false
isSign: false,
activityContent: '',
showActivityInfoPopup: false
}
},
methods: {
remarkClick(event){
//如果点击的是图片
if(event.target.tagName === 'IMG'){
vant.ImagePreview([event.target.src])
}
},
showActivityInfo(activityContent){
console.log(activityContent)
this.activityContent = ''
this.activityContent = activityContent
this.showActivityInfoPopup = true
},
async isRegisterForMe() {
const resp = await $.get('/mobile/activity/unionActivity/isRegisterForMe', {activityId: this.activityId})
if (resp.code === 0) {
@@ -93,15 +130,21 @@ layout("/mobile/platform.html"){
})
await this.getHasRegUserNum()
const resp = await $.post('/mobile/activity/unionActivity/doSingleRegister', {activityId: this.activityId})
loading.close()
if (resp.code === 0) {
setTimeout(() => {
this.$toast.success(resp.msg)
loading.close()
pjaxReplace('/mobile/activity/unionActivity')
}, 500)
vant.Dialog.alert({
title: '温馨提示',
message: '您已报名成功,请按时参加活动哦',
}).then(() => {
window.location.reload()
}).catch(() => {
window.location.reload()
})
} else {
this.$toast.fail(resp.msg)
vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
})
}
}
},
@@ -110,23 +153,31 @@ layout("/mobile/platform.html"){
title: '提示',
message: '您确认要取消报名吗?',
})
const loading = this.$toast.loading({
message: '取消中...',
forbidClick: true,
overlay: true,
duration: 0
})
if (confirm === 'confirm') {
const loading = this.$toast.loading({
message: '取消中...',
forbidClick: true,
overlay: true,
duration: 0
})
const resp = await $.post('/mobile/activity/unionActivity/doSingleCancelRegister', {activityId: this.activityId})
loading.close()
if (resp.code === 0) {
setTimeout(() => {
this.$toast.success(resp.msg)
loading.close()
pjaxReplace('/mobile/activity/unionActivity')
}, 1000)
vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
}).then(() => {
window.location.reload()
}).catch(() => {})
// setTimeout(() => {
// this.$toast.success(resp.msg)
// pjaxReplace('/mobile/activity/unionActivity')
// }, 1000)
} else {
this.$toast.fail(resp.msg)
vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
})
}
}
},
@@ -39,10 +39,27 @@ layout("/mobile/platform.html"){
.van-search__action {
background-color: #edf0ff
}
.remark-content{
width: 100%;
max-width: 100%;
height: calc(100vh - 46px - 44px);
overflow-y: auto;
}
.remark-content *{
max-width: 100%!important;
}
.joinPopup {
width: 100%;
height: 100%;
background-color: #f6f7f9;
}
</style>
<div id="app" v-cloak>
<van-nav-bar :title="title" @click-left="history.back()" fixed left-arrow
<van-nav-bar :title="title" @click-left="pjaxReplace('/mobile/activity/unionActivity')" fixed left-arrow
placeholder></van-nav-bar>
<!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#-->
@@ -51,47 +68,40 @@ layout("/mobile/platform.html"){
<van-cell class="regCell" title="报名人员">
<template #label>
<div>
<span v-if="o.userNumberLimit===1">
本活动限制总报名人数:({{o.totalUserNumberLimit}})人
</span>
<span v-if="o.userNumberLimit===1">本活动限制总报名人数:({{o.totalUserNumberLimit}})人</span>
<span v-else-if="o.userNumberLimit===2">
当前工会报名限额 <span style="color: orange">{{o.limitUnion.limitNum}})人</span>
当前基层工会报名限额
<span style="color: orange">{{o.limitUnion.limitNum}})人</span>
</span>
</div>
<div class="mt5" v-loading="tagCloseable">
<div v-if="registerList && registerList.length>0">
<template v-for="item in registerList">
<van-tag :closeable="tagCloseable" :color="themeColor"
@close="removeRegUser(item)"
size="medium"
type="primary">
<van-tag :closeable="tagCloseable" :color="themeColor" @close="removeRegUser(item)" size="medium" type="primary">
{{item.userName}}
</van-tag>
</template>
</div>
<div v-else>
<div style="text-align: center;margin-top: 20px;">
无报名人员
</div>
<div style="text-align: center; margin-top: 20px">无报名人员</div>
</div>
</div>
<div class="mt5" style="text-align: right"
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()">
<van-button :color="themeColor" @click="openUserActionSheet" size="mini"
type="info" v-if="tagCloseable">选择报名人员
</van-button>
<div
class="mt5"
style="text-align: right"
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"
>
<van-button :color="themeColor" @click="openUserActionSheet" size="mini" type="info" v-if="tagCloseable">选择报名人员</van-button>
</div>
</template>
</van-cell>
</van-cell-group>
<van-action-sheet class="userActionPopup" title="选择报名人员" v-model="userActionSheet">
<van-search @search="onSearchUser" placeholder="请输入姓名搜索" show-action
v-model="searchKey">
<van-search @search="onSearchUser" placeholder="请输入姓名搜索" show-action v-model="searchKey">
<template #action>
<div @click="onSearchUser(searchKey)">搜索</div>
</template>
</van-search>
<!-- <div class="van-hairline&#45;&#45;bottom">-->
@@ -101,50 +111,36 @@ layout("/mobile/platform.html"){
<van-loading size="24px" vertical>搜索中...</van-loading>
</template>
<div class="van-action-sheet__content mt5"
v-else-if="searchUserList && searchUserList.length>0">
<div class="van-action-sheet__content mt5" v-else-if="searchUserList && searchUserList.length>0">
<template>
<template v-for="item in searchUserList"
v-if="!registerList.map(v=>v.id).includes(item.id)">
<button @click="searchUserAdd(item)"
class="van-action-sheet__item van-hairline--bottom">
<template v-for="item in searchUserList" v-if="!registerList.map(v=>v.id).includes(item.id)">
<button @click="searchUserAdd(item)" class="van-action-sheet__item van-hairline--bottom">
<span class="van-action-sheet__name">{{item.userName}}{{item.loginName}}</span>
</button>
</template>
<!--<van-empty description="没有更多了" style="position:absolute;height: 70%"
<!--<van-empty description="没有更多了"
v-else></van-empty>-->
</template>
</div>
<van-empty description="暂无数据" style="position:absolute;height: 70%"
v-else-if="searchUserList.length===0"></van-empty>
<van-empty description="暂无数据" v-else-if="searchUserList.length===0"></van-empty>
</van-action-sheet>
<div style="margin: 20px 20px 10px 20px"
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()">
<van-button :color="themeColor" @click="doSave()" block style="border-radius: 10px"
type="info"
v-if="tagCloseable">
提 交
</van-button>
<div
style="margin: 20px 20px 10px 20px"
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"
>
<van-button :color="themeColor" @click="doSave()" block style="border-radius: 10px" type="info" v-if="tagCloseable">提 交</van-button>
<template v-else="!tagCloseable">
<van-button :color="themeColor" @click="tagCloseable = true"
block style="border-radius: 10px"
type="info">
修 改
</van-button>
<van-button
@click="doCancel"
block color="red" style="border-radius: 10px;margin-top: 10px"
type="info">
取消报名
</van-button>
<van-button :color="themeColor" @click="tagCloseable = true" block style="border-radius: 10px" type="info">修 改</van-button>
<van-button @click="doCancel" block color="red" style="border-radius: 10px; margin-top: 10px" type="info">取消报名</van-button>
</template>
</div>
<van-popup class="joinPopup" position="right" v-model:show="showActivityInfoPopup">
<van-nav-bar @click-left="showActivityInfoPopup = false" fixed left-arrow placeholder title="活动内容"></van-nav-bar>
<div class="remark-content" v-html="activityContent" @click="remarkClick"></div>
</van-popup>
<!-- <div style="margin: 20px 20px 10px 20px" v-if="tagCloseable">-->
<!-- <van-button-->
<!-- :disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf()"-->
@@ -160,45 +156,58 @@ layout("/mobile/platform.html"){
<!--#include("/mobile/activity/unionActivity/common/initMap.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [mobileMixins, self_mixin],
el: "#app",
mixins: [mobileMixins, self_mixin_h5],
data() {
return {
title: "",
userId: "${@shiro.getPrincipalProperty('id')}",
userName: "${@shiro.getPrincipalProperty('username')}",
activityId: '',
activityId: "",
o: {},
registerList: [],
addRegisterList: [],
userActionSheet: false,
searchKey: '',
searchKey: "",
searchUserList: [],
tagCloseable: true,
searchLoading: false
searchLoading: false,
activityContent: '',
showActivityInfoPopup: false
}
},
methods: {
remarkClick(event){
//如果点击的是图片
if(event.target.tagName === 'IMG'){
vant.ImagePreview([event.target.src])
}
},
showActivityInfo(activityContent){
console.log(activityContent)
this.activityContent = ''
this.activityContent = activityContent
this.showActivityInfoPopup = true
},
async doCancel() {
const confirm = await this.$dialog.confirm({
title: '提示',
message: '您确认要取消报名吗?',
title: "提示",
message: "您确认要取消报名吗?"
})
const loading = this.$toast.loading({
message: '取消中...',
forbidClick: true,
overlay: true,
duration: 0
})
if (confirm === 'confirm') {
const resp = await $.post('/mobile/activity/unionActivity/doSingleCancelRegister', {activityId: this.activityId})
if (confirm === "confirm") {
const loading = this.$toast.loading({
message: "取消中...",
forbidClick: true,
overlay: true,
duration: 0
})
const resp = await $.post("/mobile/activity/unionActivity/doSingleCancelRegister", { activityId: this.activityId })
loading.close()
if (resp.code === 0) {
setTimeout(() => {
loading.close()
this.$toast.success(resp.msg)
setTimeout(() => {
window.history.back()
}, 400)
window.location.reload()
}, 1000)
} else {
this.$toast.fail(resp.msg)
@@ -206,10 +215,10 @@ layout("/mobile/platform.html"){
}
},
async getRegisterUser() {
const resp = await $.get('/mobile/activity/myActivity/selectRegisterList', {activityId: this.activityId})
const resp = await $.get("/mobile/activity/myActivity/selectRegisterList", { activityId: this.activityId })
if (resp.code === 0) {
if (this.o.signUpMethod === 3) {
this.registerList = resp.data.filter(v => v.applyUserId === this.userId)
this.registerList = resp.data.filter((v) => v.applyUserId === this.userId)
} else {
this.registerList = resp.data
}
@@ -220,9 +229,10 @@ layout("/mobile/platform.html"){
}
},
openUserActionSheet() {
this.searchKey = ''
this.searchKey = ""
this.searchUserList = []
this.userActionSheet = true
this.onSearchUser("1")
},
async onSearchUser(val) {
if (!val) {
@@ -230,21 +240,20 @@ layout("/mobile/platform.html"){
return
}
this.searchLoading = true
const resp = await $.get('/mobile/activity/unionActivity/searchNoRegisterUser', {
const resp = await $.get("/mobile/activity/unionActivity/searchNoRegisterUser", {
activityId: this.activityId,
searchKey: val
})
if (resp.code === 0) {
this.searchLoading = false
this.searchUserList = resp.data.list
} else {
this.$toast.fail(resp.msg)
}
},
searchUserAdd(item) {
const {id, userName} = item
this.registerList.push({id, userName})
const { id, userName } = item
this.registerList.push({ id, userName })
this.$toast.success("添加成功")
},
async removeRegUser(item) {
@@ -253,46 +262,42 @@ layout("/mobile/platform.html"){
return
}
const confirm = await this.$dialog.confirm({
title: '提示',
message: '您确认要移除吗?',
title: "提示",
message: "您确认要移除吗?"
})
if (confirm === 'confirm') {
const index = this.registerList.findIndex(v => v.id === item.id)
if (confirm === "confirm") {
const index = this.registerList.findIndex((v) => v.id === item.id)
this.registerList.splice(index, 1)
}
},
//保存
async doSave() {
if (this.registerList.length === 0) {
this.$toast('请添加报名人员后再提交!')
this.$toast("请添加报名人员后再提交!")
return
}
if (this.o.signUpMethod === 3) {
if (this.registerList.length !== this.o.teamNum) {
vant.Dialog.alert({
title: '温馨提示',
message: '此活动是双人报名模式您需要报名' + this.o.teamNum + '人!',
}).then(() => {
});
title: "温馨提示",
message: "此活动是双人报名模式您需要报名" + this.o.teamNum + "人!"
}).then(() => {})
return
}
if (!this.registerList.map(v => v.id).includes(this.userId)) {
if (!this.registerList.map((v) => v.id).includes(this.userId)) {
vant.Dialog.alert({
title: '温馨提示',
message: '此活动是组队模式请您找' + this.o.teamNum + '朋友一起报名!',
}).then(() => {
});
title: "温馨提示",
message: "此活动是组队模式请您找" + this.o.teamNum + "朋友一起报名!"
}).then(() => {})
return
}
// await this.getRegisterUser()
const resp = await $.get('/mobile/activity/myActivity/selectRegisterList', {activityId: this.activityId})
const resp = await $.get("/mobile/activity/myActivity/selectRegisterList", { activityId: this.activityId })
this.addRegisterList = resp.data
let arr = []
if (this.addRegisterList && this.addRegisterList.length > 0) {
this.addRegisterList.forEach(v => {
this.registerList.forEach(r => {
this.addRegisterList.forEach((v) => {
this.registerList.forEach((r) => {
if (v.id === r.id && v.applyUserId !== this.userId) {
arr.push(r.userName)
}
@@ -302,11 +307,9 @@ layout("/mobile/platform.html"){
if (arr && arr.length > 0) {
vant.Dialog.alert({
title: '温馨提示',
message: '【' + arr.toString() + '】已成功报名您无需再报名!',
}).then(() => {
});
title: "温馨提示",
message: "【" + arr.toString() + "】已成功报名您无需再报名!"
}).then(() => {})
return
}
@@ -319,41 +322,40 @@ layout("/mobile/platform.html"){
});
return
}*/
}
let message = ''
let message = ""
if (this.o.needSign) {
message = '此活动开启了签到,需要您活动当天前往签到点位核实活动报名人员后进行签到!'
message = "此活动开启了签到,需要您活动当天前往签到点位核实活动报名人员后进行签到!"
}
const confirm = await this.$dialog.confirm({
title: '提示',
message: message + '您确认要报名吗?',
title: "提示",
message: message + "您确认要报名吗?"
})
if (confirm === 'confirm') {
if (confirm === "confirm") {
const loading = this.$toast.loading({
message: '报名中...',
message: "报名中...",
forbidClick: true,
overlay: true,
duration: 0
})
const params = {
activityId: this.activityId,
personIds: JSON.stringify(this.registerList.map(v => v.id))
personIds: JSON.stringify(this.registerList.map((v) => v.id))
}
const resp = await $.post('/mobile/activity/unionActivity/doSaveUnionRegister', params)
const resp = await $.post("/mobile/activity/unionActivity/doSaveUnionRegister", params)
loading.close()
if (resp.code === 0) {
await this.getRegisterUser()
await this.getHasRegUserNum()
setTimeout(() => {
loading.close()
this.$toast.success(resp.msg)
}, 1000)
vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
})
} else {
setTimeout(() => {
loading.close()
this.$toast.fail(resp.msg)
}, 500)
vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
})
}
}
}
@@ -365,14 +367,12 @@ layout("/mobile/platform.html"){
await this.getActivityInfo()
await this.getRegisterUser()
if (this.o.signUpMethod === 3 && this.registerList.length === 0) {
this.registerList.push({id: this.userId, userName: this.userName})
this.registerList.push({ id: this.userId, userName: this.userName })
}
this.title = (this.o.signUpMethod === 2 ? '分工会报名' : '组队报名')
this.title = this.o.signUpMethod === 2 ? "基层工会报名" : "组队报名"
if (moment(this.o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() > moment(this.o.applyEndTime).valueOf()) {
this.$toast.fail("不在活动范围内")
}
}
}
})
@@ -15,6 +15,12 @@
<link rel="stylesheet" href="${base!}/assets/mobile/css/main.css">
<link rel="stylesheet" href="${base!}/assets/platform/plugins/vant/vant.css">
<script>
window._AMapSecurityConfig = {
securityJsCode: "4fa1e1aeabba7eb9518129cf57ab17c1",
};
</script>
<script src="${base!}/assets/platform/plugins/vue/vue.min.js"></script>
<script src="${base!}/assets/platform/plugins/vant/vant.js"></script>
@@ -48,7 +54,7 @@
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script src="${base!}/assets/platform/js/scannerQrCodeJs.js"></script>
<script type="text/javascript"
src="https://webapi.amap.com/maps?v=2.0&key=6ab3452804ba35050880b5e047436853&plugin=AMap.PolyEditor,AMap.Geolocation"></script>
src="https://webapi.amap.com/maps?v=2.0&key=57f0d098ba1b881ecc436c4cfd23bbbf&plugin=AMap.PolyEditor,AMap.Geolocation"></script>
<!--字典混入-->
<script src="${base!}/components/plugins/sysDict/DictData.js"></script>
@@ -11,8 +11,8 @@ layout("/mobile/platform.html"){
text-align: center;
padding: 20px;
background: #ffffff;
/*margin: 10px 0;*/
margin-bottom: 10px;
margin: 0 0 10px 0 !important;
/*margin-bottom: 10px;*/
color: var(--color-primary);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
@@ -80,7 +80,7 @@ layout("/mobile/platform.html"){
<h2 class="title">{{ activity.title }}</h2>
</van-sticky>
<div v-if="!answerRecord.isFinish">
<div style="margin-top: 50px" v-if="!answerRecord.isFinish">
<div v-for="(subject, index) in subjects" :key="index" class="subject">
<p>{{index+1}}、{{ subject.title }}</p>
<div class="tag">
@@ -161,8 +161,15 @@ layout("/mobile/platform.html"){
this.activity = res.data.activity
this.subjects = res.data.subjects
this.answerRecordId = res.data.answerRecordId
this.checkGroupPermission()
// this.checkGroupPermission()
this.getAnswerRecord()
} else {
vant.Dialog.alert({
title: '温馨提示',
message: res.msg,
}).then(() => {
pjaxReplace("/mobile/index")
})
}
})
},
@@ -307,8 +314,7 @@ layout("/mobile/platform.html"){
//自动提交
autoSubmit(loading = null) {
$
.post("/platform/h5/qsv/quiz/submitAnswer", {
$.post("/platform/h5/qsv/quiz/submitAnswer", {
answer: JSON.stringify({
activityId: this.id,
answerRecordId: this.answerRecordId,
@@ -324,35 +330,35 @@ layout("/mobile/platform.html"){
.then((res) => {
if (res.code === 0) {
this.$toast.success(res.msg)
this.$pjaxReplace("/platform/h5/qsv/quiz/result?answerRecordId=" + this.answerRecordId)
pjaxReplace("/platform/h5/qsv/quiz/result?answerRecordId=" + this.answerRecordId)
// this.getAnswerRecord()
}
})
.finally(() => {
.always(() => {
if (loading) {
loading.clear()
}
})
},
async checkGroupPermission() {
const groupId = this.activity.groupId
if (groupId) {
const { code, data } = await $.post("/open/common/checkGroupPermission", { groupId })
if (code === 0) {
if (!data) {
this.$dialog
.alert({
title: "提示",
message: "您没有权限参与"
})
.then(() => {
location.back()
})
}
}
}
}
// async checkGroupPermission() {
// const groupId = this.activity.groupId
// if (groupId) {
// const { code, data } = await $.post("/open/common/checkGroupPermission", { groupId })
// if (code === 0) {
// if (!data) {
// this.$dialog
// .alert({
// title: "提示",
// message: "您没有权限参与"
// })
// .then(() => {
// location.back()
// })
// }
// }
// }
// }
},
created() {
if (this.timerInterval) {
@@ -10,6 +10,7 @@ layout("/mobile/platform.html"){
.container .title {
text-align: center;
padding: 20px;
margin: 0 !important;
background: #ffffff;
color: var(--color-primary);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
@@ -168,7 +169,7 @@ layout("/mobile/platform.html"){
</div>
</van-sticky>
<div>
<div style="margin-top: 50px">
<div v-for="(subject, index) in subjects" :key="index" class="subject">
<p>{{index+1}}、{{ subject.title }}</p>
<div class="tag">
@@ -208,11 +209,12 @@ layout("/mobile/platform.html"){
</div>
<div class="button-control">
<van-button v-if="canAgainQuestion" type="primary" @click="againQuestion" block>重新答题</van-button>
<van-button type="primary" @click="openHistory" block>查看全部答题记录</van-button>
</div>
</div>
<van-action-sheet v-model="historyShow" title="历史记录">
<van-action-sheet v-model="historyShow" title="历史记录" >
<div class="history-list">
<div v-for="item in historyList" class="history-item">
<div class="history-header">
@@ -239,7 +241,9 @@ layout("/mobile/platform.html"){
activity: {},
list: [],
historyShow: false,
historyList: []
historyList: [],
canAgainQuestion: false
}
},
computed: {
@@ -268,12 +272,26 @@ layout("/mobile/platform.html"){
}
},
methods: {
/**
* 重新答题
*/
againQuestion() {
vant.Dialog.confirm({
title: '温馨提示',
message: '确定要重新答题吗?',
}).then(() => {
pjaxReplace('/platform/h5/qsv/quiz?id=' + this.activity.id)
}).catch(() => {
// on cancel
});
},
getAnswerResult() {
$.post("/platform/h5/qsv/quiz/answerResult", { answerRecordId: this.answerRecordId }).then((res) => {
if (res.code === 0) {
this.subjects = res.data.subjects
this.activity = res.data.activity
this.getAnswerRecord()
this.getHistoryQuestion()
}
})
},
@@ -305,16 +323,19 @@ layout("/mobile/platform.html"){
}
})
},
historyBack() {
pjaxReplace('/platform/h5/qsv')
},
openHistory() {
this.historyShow = true
},
getHistoryQuestion() {
$.post("/platform/h5/qsv/quiz/historyScore", { activityId: this.activity.id }).then((res) => {
if (res.code === 0) {
this.historyList = res.data
if (this.activity.maxAttempts > res.data.length) {
this.canAgainQuestion = true
}
}
})
}
@@ -169,14 +169,14 @@
</el-form-item>
</el-col>
<el-col :lg="12" :xl="12" :xs="24">
<!--<el-col :lg="12" :xl="12" :xs="24">
<el-form-item label="活动人数" prop="peopleNum">
<el-input-number :disabled="[1,2].includes(formData.signUpMethod)"
maxlength="10" style="width: 100%"
placeholder="请填写活动人数"
v-model="formData.peopleNum"></el-input-number>
</el-form-item>
</el-col>
</el-col>-->
<el-col :lg="12" :xl="12" :xs="24">
<el-form-item label="参加人员范围" prop="groupId">
@@ -202,6 +202,9 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="40">
<!-- <el-col :lg="12" :xl="12" :xs="12">
<el-form-item label="是否推送移动端" prop="isPushHome">
@@ -401,6 +404,19 @@
</el-form-item>
</el-col>
<el-col :span="12" v-if="formData.needSign">
<el-form-item label="签到时间" prop="signTime">
<el-date-picker
end-placeholder="结束日期"
range-separator="-"
start-placeholder="开始日期"
style="width: 100%"
type="datetimerange"
v-model="formData.signTime"
value-format="yyyy-MM-dd HH:mm">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24" v-show="formData.needSign">
<el-form-item label="活动签到点位">
@@ -882,7 +898,12 @@
const formData = JSON.parse(JSON.stringify(this.formData))
formData.type = this.pageForm.type
formData.apply_type = 1
const {time, applyTime2, plannedDate} = formData
const {time, applyTime2, plannedDate, signTime} = formData
if (signTime && signTime.length) {
formData.signStartTime = signTime[0]
formData.signEndTime = signTime[1]
formData.signTime = undefined
}
if (applyTime2 && applyTime2.length) {
formData.applyStartTime = applyTime2[0]
formData.applyEndTime = applyTime2[1]
@@ -945,7 +966,12 @@
const formData = JSON.parse(JSON.stringify(this.formData))
formData.type = this.pageForm.type
formData.apply_type = 1
const {time, applyTime2, plannedDate} = formData
const {time, applyTime2, plannedDate, signTime} = formData
if (signTime && signTime.length) {
formData.signStartTime = signTime[0]
formData.signEndTime = signTime[1]
formData.signTime = undefined
}
if (applyTime2 && applyTime2.length) {
formData.applyStartTime = applyTime2[0]
formData.applyEndTime = applyTime2[1]
@@ -986,9 +1012,6 @@
}
});
},
async init() {
this.delNotesList = []
@@ -1028,6 +1051,7 @@
if (data.otherFiles && data.otherFiles.length > 0) data.otherFiles = JSON.parse(data.otherFiles)
if (data.applyStartTime) data.applyTime2 = [data.applyStartTime, data.applyEndTime]
if (data.startTime) data.time = [data.startTime, data.endTime]
if (data.signStartTime) data.signTime = [data.signStartTime, data.signEndTime]
if (data.startPlannedDate) data.plannedDate = [data.startPlannedDate, data.endPlannedDate]
this.userData = clone(data.tissuePersonList)
data.unionUserNumberLimit = JSON.parse(data.unionUserNumberLimit)
@@ -1040,6 +1064,11 @@
if (this.formData.needSign) {
await this.initMap()
}
if (this.formData.userNumberLimit === 2) {
this.calSummaryCount()
}
} else {
this.notifyWarning(msg)
}
@@ -1049,7 +1078,7 @@
// if (map == null) {
map = new AMap.Map("signMap", {
resizeEnable: true,
center: [118.640081, 32.082496],
center: [119.743667, 30.216618],
zoom: 16
})
// }
@@ -148,7 +148,10 @@
通知
</el-dropdown-item>
<el-dropdown-item :command="{type:'openCode',row}">
二维码
报名二维码
</el-dropdown-item>
<el-dropdown-item :command="{type:'openSignCode',row}">
签到二维码
</el-dropdown-item>
<!-- <el-dropdown-item :command="{type:'export',row}">
导出人员名单
@@ -260,6 +263,8 @@
this.sendMsg(row)
} else if (type === 'openCode') {
this.openCode(row)
} else if (type === 'openSignCode') {
this.openSignCode(row)
} else if (type === 'export') {
location.href = "/platform/activity/info/mange/export?id=" + row.id
}
@@ -267,6 +272,9 @@
openCode(row) {
this.$refs.openQRCode.openCode("/mobile/activity/unionActivity/goReg?id=" + row.id + "&signUpMethod=" + row.signUpMethod)
},
openSignCode(row) {
this.$refs.openQRCode.openCode("/mobile/activity/myActivity/goSign?id=" + row.id)
},
sendMsg(row) {
if (row.signUpMethod === 1 || row.signUpMethod === 3) {
this.mobileUrl = "/mobile/activity/unionActivity/goReg?id=" + row.id + "&signUpMethod=" + row.signUpMethod
@@ -53,6 +53,7 @@
<el-table-column
:label="column.label"
:prop="column.prop"
:width="column.width"
:sortable="column.sortable"
align="center"
header-align="center"
@@ -61,22 +62,33 @@
<template scope="{row}" v-if="column.prop=='time'">
<span>{{moment(row.startTime).format('YYYY-MM-DD')}} - {{moment(row.endTime).format('YYYY-MM-DD')}}</span>
</template>
<template scope="{row}" v-else-if="column.prop=='projectTypeName'">{{row.projectTypeName}}({{row.projectTypeCode}})</template>
<template scope="{row}" v-else-if="column.prop=='tussueName'">
<span v-if="row.type==40002">{{row.unionname?row.unionname:'暂无'}}</span>
<span v-if="row.type==40003">{{row.clubName?row.clubName:'暂无'}}</span>
<span v-if="row.type==40001">校工会</span>
</template>
<template scope="{row}" v-else-if="column.prop=='totalApplyNum'">
<span v-if="row.userNumberLimit===1">(<span style="color: red">余{{ Number(row.totalUserNumberLimit) - Number(row.totalApplyNum) }}</span>/{{row.totalUserNumberLimit}}人)</span>
<span v-else-if="row.userNumberLimit===2">{{ row.totalApplyNum }}人</span>
<span v-else>(<span style="color: #fd835a">无名额限制</span>/已报 <span style="color: red">{{row.totalApplyNum}}</span>人)</span>
</template>
<template scope="{row}" v-else-if="column.prop=='signUpMethod'">
<span v-if="row.signUpMethod===1">个人报名</span>
<span v-else-if="row.signUpMethod===2">分工会报名</span>
<span v-else-if="row.signUpMethod===3"
style="color: #fd835a">组队报名<span style="color: black">(每组限报 <span style="color: red">{{row.teamNum}}</span> 人)</span></span>
<span v-else-if="!row.signUpMethod">无需报名</span>
</template>
<template scope="{row}" v-else-if="column.prop=='countUser'">
<el-tag type="success" v-if="row.countUser>0">已报名({{row.countUser}}</el-tag>
<el-tag type="danger" v-else>未报名</el-tag>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" prop="userOnline" width="200px">
<el-table-column align="center" header-align="center" label="操作" prop="userOnline" width="250px">
<template scope="{row}">
<el-button :loading="row.loading" @click="openView(row)" size="mini" type="primary">查看</el-button>
<template
@@ -86,7 +98,7 @@
报名
</el-button>
<el-button :loading="row.loading" @click="openAudit(row)" size="mini" type="primary" v-if="row.signUpMethod === 3">
报名
{{ row.countUser > 0 ? '修改' : '报名' }}
</el-button>
<el-button
:loading="row.loading"
@@ -102,7 +114,7 @@
@click="doDelete(row)"
size="mini"
type="danger"
v-if="row.countUser>0&&row.signUpMethod === 1"
v-if="row.countUser>0"
>
取消报名
</el-button>
@@ -177,8 +189,9 @@
{ prop: "projectTypeName", label: "活动项目类型" },
{ prop: "tussueName", label: "举办单位" },
{ prop: "time", label: "活动日期" },
{ prop: "applyTime", label: "创建时间", sortable: true },
{ prop: "countUser", label: "报名人数", sortable: true }
{ prop: "totalApplyNum", label: "已报名人数", width: 160 },
{ prop: "signUpMethod", label: "报名方式", sortable: true, width: 200 },
{ prop: "countUser", label: "我的报名", sortable: true }
],
leftData: [],
rightData: [],
@@ -283,6 +296,8 @@
const { data: rightData } = await $.get("/platform/activity/applyUser/getReportedUser", {
tissueId: row.id
})
debugger
this.leftData = data.map((user) => {
return this.getTransProp(user, row.signUpMethod)
})
@@ -76,8 +76,7 @@
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="人员列表">
<template #func>
<el-button @click="doExport" icon="el-icon-s-promotion" type="primary">导出
</el-button>
<el-button @click="doExport" icon="el-icon-s-promotion" type="primary" size="small">导出</el-button>
</template>
</table-tool>
@@ -48,7 +48,7 @@ layout("/layouts/platform.html"){
<el-option
v-for="item in activityOptions"
:key="item.id"
:label="item.activity_name"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
@@ -417,7 +417,7 @@ layout("/layouts/platform.html"){
</guava>
<el-dialog
<!--<el-dialog
title="活动报销须知"
:visible.sync="dialogVisible"
width="40%">
@@ -438,7 +438,7 @@ layout("/layouts/platform.html"){
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogVisible = false;">同意</el-button>
</span>
</el-dialog>
</el-dialog>-->
</div>
@@ -467,7 +467,7 @@ layout("/layouts/platform.html"){
projectType: [],
activityType: [],
formData: {
goods: []
budgets: [{}]
},
formSign: {},
pageForm: {
@@ -562,6 +562,8 @@ layout("/layouts/platform.html"){
this.formData.budgets.forEach(v => {
this.remoteMethod(v.loginName)
})
} else {
this.formData.budgets = [{}]
}
}
},
@@ -25,11 +25,20 @@ const MEMBER_ALL_CHANGE_INFO = {
<el-descriptions-item label="在职状态">{{ viewData.userState }}</el-descriptions-item>
<el-descriptions-item label="人员类型">{{ viewData.personType }}</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
<template v-if="viewData.retireDate">
<el-descriptions-item label="退休日期">
<el-tooltip class="item" effect="dark" :content="viewData.retireDate.substring(0, 10) + '系统将自动取消会员身份及福利会员身份'" placement="top">
<span>{{ viewData.retireDate.substring(0, 10) }}</span>
</el-tooltip>
</el-descriptions-item>
</template>
<template v-else>
<el-descriptions-item></el-descriptions-item>
</template>
<el-descriptions-item label="会员状态">{{ viewData.member ? '会员' : '非会员' }}</el-descriptions-item>
<el-descriptions-item label="福利会员状态">{{ viewData.welfareMember ? '福利会员' : '非福利会员' }}</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
<el-descriptions-item label="进校时间">{{ viewData.schoolTime }}</el-descriptions-item>
<el-descriptions-item label="家庭主要成员" :span="3">
<el-table v-if="viewData.families&&viewData.families.length"
@@ -36,7 +36,7 @@ const MEMBER_CHANGE_AUDIT_INFO = {
<el-descriptions-item label="会员状态">{{ viewData.member ? '会员' : '非会员' }}</el-descriptions-item>
<el-descriptions-item label="福利会员状态">{{ viewData.welfareMember ? '福利会员' : '非福利会员' }}</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
<el-descriptions-item label="进校时间">{{ viewData.schoolTime }}</el-descriptions-item>
<el-descriptions-item label="家庭主要成员" :span="3">
<el-table v-if="viewData.families&&viewData.families.length"
@@ -27,7 +27,11 @@ const MEMBER_INFO = {
<el-descriptions-item label="在职状态">{{ viewData.userState }}</el-descriptions-item>
<el-descriptions-item label="人员类型">{{ viewData.personType }}</el-descriptions-item>
<template v-if="viewData.retireDate">
<el-descriptions-item label="退休日期">{{ viewData.retireDate }}</el-descriptions-item>
<el-descriptions-item label="退休日期">
<el-tooltip class="item" effect="dark" :content="viewData.retireDate.substring(0, 10) + '系统将自动取消会员身份及福利会员身份'" placement="top">
<span>{{ viewData.retireDate.substring(0, 10) }}</span>
</el-tooltip>
</el-descriptions-item>
</template>
<template v-else>
<el-descriptions-item></el-descriptions-item>
@@ -35,7 +39,7 @@ const MEMBER_INFO = {
<el-descriptions-item label="会员状态">{{ viewData.member ? '会员' : '非会员' }}</el-descriptions-item>
<el-descriptions-item label="福利会员状态">{{ viewData.welfareMember ? '福利会员' : '非福利会员' }}</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
<el-descriptions-item label="进校时间">{{ viewData.schoolTime }}</el-descriptions-item>
<el-descriptions-item label="家庭主要成员" :span="3">
<el-table v-if="viewData.families&&viewData.families.length"
@@ -127,7 +127,7 @@ layout("/layouts/platform.html"){
})
},
exportXlsx() {
// this.$downLoad("/platform/qsv/quizRank/exportXlsx", this.pageForm)
this.$downLoad("/platform/qsv/quizRank/exportXlsx", this.pageForm)
}
},
async created() {
@@ -56,7 +56,7 @@ const answer = {
},
exportUserAnswerXlsx() {
// this.$downLoad("/platform/qsv/survey/exportUserAnswerXlsx", { activityId: this.activityId })
this.$downLoad("/platform/qsv/survey/exportUserAnswerXlsx", { activityId: this.activityId })
}
}
}
@@ -22,11 +22,11 @@ layout("/layouts/platform.html"){
</el-card>
<el-card shadow="never" class="mt10">
<table-tool :app="this" label="数据列表">
<!-- <el-button @click="exportXlsx" icon="el-icon-download" size="small" type="primary" class="mr5">导出xlsx</el-button>-->
<!-- <el-button @click="exportXlsx" icon="el-icon-download" size="small" type="primary" class="mr5">导出xlsx</el-button>-->
</table-tool>
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder">
<el-table-column label="序号" width="50" type="index" :index="indexMethod"></el-table-column>
<el-table-column label="标题" prop="title" width="120" sortable></el-table-column>
<el-table-column label="标题" prop="title" width="320" sortable></el-table-column>
<el-table-column label="类型" prop="category" sortable>
<template scope="{row}">
<dict-tag :options="dict.type.ACTIVITY_QSV_CATEGORY" :value="row.category"></dict-tag>
@@ -60,7 +60,7 @@ layout("/layouts/platform.html"){
},
methods: {
exportXlsx() {
$.post("/platform/qsv/survey/exportXlsx", this.pageForm)
this.$downLoad("/platform/qsv/survey/exportXlsx", this.pageForm)
}
},
created() {
@@ -86,6 +86,7 @@ layout("/layouts/platform.html"){
<el-table-column label="操作" width="180px">
<template slot-scope="{row}">
<el-button @click="openChangeInfo(row, true)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.isOperate" @click="doRevoke(row)" size="mini" type="warning">撤销</el-button>
<el-button v-if="!row.isOperate" @click="openChangeInfo(row, false)" size="mini" type="primary">变更</el-button>
</template>
</el-table-column>
@@ -142,11 +143,27 @@ layout("/layouts/platform.html"){
'user-change-info': USER_CHANGE_INFO
},
methods: {
/**
* 撤销
*/
doRevoke(row) {
console.log(row)
},
/**
* 批量操作变更
*/
doBatchChange(){
if (this.checkUsers.length === 0) {
this.$message.warning('请选择需要批量确认的用户数据')
return
}
const isHasRetire = this.checkUsers.some(v=> ['退休'].includes(v.userState))
if (isHasRetire) {
this.$message.warning('勾选用户中有退休教工,请手动变更退休职工并设置退休时间,勿批量确认')
return
}
this.$confirm('确认要批量变更勾选用户吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@@ -154,8 +171,8 @@ layout("/layouts/platform.html"){
}).then(async () => {
const url = "/platform/sourcechange/manage/doBatchChange"
let isSendMsg = false
const isHasNewTeacher = this.checkUsers.some(v=> v.changeInfosStr === '新入职')
const isHasNewTeacher = this.checkUsers.some(v=> v.changeInfosStr === '新入职')
const ids = this.checkUsers.map(item => item.id)
if (isHasNewTeacher) {
this.$confirm('勾选用户中有新入职教工,是否对新入职教职工发送入会邀请?', '提示', {
@@ -26,11 +26,20 @@ const USER_CHANGE_INFO = {
<el-descriptions-item label="在职状态">{{ viewData.userState }}</el-descriptions-item>
<el-descriptions-item label="人员类型">{{ viewData.personType }}</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
<template v-if="viewData.retireDate">
<el-descriptions-item label="退休日期">
<el-tooltip class="item" effect="dark" :content="viewData.retireDate.substring(0, 10) + '系统将自动取消会员身份及福利会员身份'" placement="top">
<span>{{ viewData.retireDate.substring(0, 10) }}</span>
</el-tooltip>
</el-descriptions-item>
</template>
<template v-else>
<el-descriptions-item></el-descriptions-item>
</template>
<el-descriptions-item label="会员状态">{{ viewData.member ? '会员' : '非会员' }}</el-descriptions-item>
<el-descriptions-item label="福利会员状态">{{ viewData.welfareMember ? '福利会员' : '非福利会员' }}</el-descriptions-item>
<el-descriptions-item></el-descriptions-item>
<el-descriptions-item label="进校时间">{{ viewData.schoolTime }}</el-descriptions-item>
<el-descriptions-item label="家庭主要成员" :span="3">
<el-table v-if="viewData.families&&viewData.families.length"
@@ -195,7 +204,7 @@ const USER_CHANGE_INFO = {
<el-date-picker v-model="formData.retireDate"
type="date"
:disabled="isView"
placeholder="请选择出生日期"
placeholder="请选择退休日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
style="width: 100%"></el-date-picker>
@@ -419,6 +428,10 @@ const USER_CHANGE_INFO = {
doSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
if (['退休'].includes(this.formData.userState) && !this.formData.retireDate) {
this.$message.warning('请在数据更新后信息中设置该教工的退休日期')
return
}
this.$confirm("提交后会改变人员基础数据,您确定要提交吗?", "提示", { type: "warning" })
.then(() => {
this.$emit('do-submit', this.formData)