This commit is contained in:
2025-04-09 11:21:17 +08:00
44 changed files with 1119 additions and 1098 deletions
@@ -30,7 +30,7 @@ import javax.servlet.http.HttpSession;
public class LoginUtil { public class LoginUtil {
public enum LoginOrigin { public enum LoginOrigin {
APP, WEB, WEB_H5, CAS, QI_YE_WEI_XIN, WEI_XIN, SMS_CODE; APP, WEB, WEB_H5, CAS, QI_YE_WEI_XIN, WEI_XIN, WEI_XIN_SUCCESS, SMS_CODE;
} }
@Inject @Inject
@@ -126,7 +126,7 @@ public class PwdUtil {
// System.out.println(dbPwd); // System.out.println(dbPwd);
// System.out.println(s); // System.out.println(s);
String pwd = "123456"; String pwd = "002154";
String dbPwd = PwdUtil.doSm4CbcEncrypt(pwd); String dbPwd = PwdUtil.doSm4CbcEncrypt(pwd);
System.out.println(dbPwd); System.out.println(dbPwd);
} }
@@ -11,6 +11,7 @@ import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.base.Globals; import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.shiro.exception.CaptchaEmptyException; import io.v.nutz.web.commons.shiro.exception.CaptchaEmptyException;
import io.v.nutz.web.commons.shiro.exception.CaptchaIncorrectException; import io.v.nutz.web.commons.shiro.exception.CaptchaIncorrectException;
import io.v.nutz.web.commons.shiro.filter.PlatformAuthenticationFilter;
import io.v.nutz.web.commons.slog.SLogService; import io.v.nutz.web.commons.slog.SLogService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.lang3.math.NumberUtils;
@@ -27,10 +28,7 @@ import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json; import org.nutz.json.Json;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap; import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.*;
import org.nutz.mvc.annotation.Attr;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
@@ -140,7 +138,7 @@ public class SysWechatController {
String loginName = Optional.ofNullable(sysUser).map(Sys_user::getLoginname).orElse(null); String loginName = Optional.ofNullable(sysUser).map(Sys_user::getLoginname).orElse(null);
try { try {
loginUtil.doLogin(loginName, request, session, LoginUtil.LoginOrigin.WEI_XIN); loginUtil.doLogin(loginName, request, session, LoginUtil.LoginOrigin.WEI_XIN_SUCCESS);
if (StrUtil.isNotBlank(redirect)) { if (StrUtil.isNotBlank(redirect)) {
return ">>:" + redirect; return ">>:" + redirect;
} }
@@ -151,9 +149,6 @@ public class SysWechatController {
} catch (UnknownAccountException e) { } catch (UnknownAccountException e) {
request.setAttribute("errMsg", "系统中没有此用户"); request.setAttribute("errMsg", "系统中没有此用户");
return ">>:" + Globals.AppDomain + "/error/UnknownAccountError.html"; return ">>:" + Globals.AppDomain + "/error/UnknownAccountError.html";
} catch (AuthenticationException e) {
request.setAttribute("errMsg", "系统中没有此用户");
return ">>:" + Globals.AppDomain + "/error/UnknownAccountError.html";
} catch (Exception e) { } catch (Exception e) {
request.setAttribute("errMsg", "用户名或密码错误"); request.setAttribute("errMsg", "用户名或密码错误");
return ">>:" + Globals.AppDomain + "/error/500.html"; return ">>:" + Globals.AppDomain + "/error/500.html";
@@ -162,7 +157,8 @@ public class SysWechatController {
@At @At
@Ok("re") @Ok("json")
@Filters(@By(type = PlatformAuthenticationFilter.class))
public Result doLogin(@Attr("platformLoginToken") AuthenticationToken token, HttpServletRequest request, HttpSession session, @Param("state") String state) { public Result doLogin(@Attr("platformLoginToken") AuthenticationToken token, HttpServletRequest request, HttpSession session, @Param("state") String state) {
System.out.println(state); System.out.println(state);
@@ -32,7 +32,7 @@ public class EasyCredentialsMatch extends HashedCredentialsMatcher {
LoginUtil.LoginOrigin loginOrigin = platformCaptchaToken.getLoginOrigin(); LoginUtil.LoginOrigin loginOrigin = platformCaptchaToken.getLoginOrigin();
//cas和企业微信实现免密登录 //cas和企业微信实现免密登录
if (loginOrigin.equals(LoginUtil.LoginOrigin.CAS) || loginOrigin.equals(LoginUtil.LoginOrigin.QI_YE_WEI_XIN)){ if (loginOrigin.equals(LoginUtil.LoginOrigin.CAS) || loginOrigin.equals(LoginUtil.LoginOrigin.QI_YE_WEI_XIN) || loginOrigin.equals(LoginUtil.LoginOrigin.WEI_XIN_SUCCESS)){
return true; return true;
} }
@@ -94,7 +94,7 @@ public class PlatformAuthorizingRealm extends AuthorizingRealm {
throw Lang.makeThrow(AuthenticationException.class, "验证码失效,请重新获取"); throw Lang.makeThrow(AuthenticationException.class, "验证码失效,请重新获取");
} }
user = sysUserService.fetch(Cnd.NEW().and("mobile", "=", mobile)); user = sysUserService.fetch(Cnd.NEW().and("mobile", "=", mobile));
}else if (!loginOrigin.equals(LoginUtil.LoginOrigin.CAS) && !loginOrigin.equals(LoginUtil.LoginOrigin.QI_YE_WEI_XIN) && !loginOrigin.equals(LoginUtil.LoginOrigin.WEI_XIN)) { }else if (!loginOrigin.equals(LoginUtil.LoginOrigin.CAS) && !loginOrigin.equals(LoginUtil.LoginOrigin.QI_YE_WEI_XIN) && !loginOrigin.equals(LoginUtil.LoginOrigin.WEI_XIN_SUCCESS)) {
validateService.checkCode(key, captcha); validateService.checkCode(key, captcha);
if (Strings.isBlank(loginname)) { if (Strings.isBlank(loginname)) {
throw Lang.makeThrow(AuthenticationException.class, "登录账号不可为空"); throw Lang.makeThrow(AuthenticationException.class, "登录账号不可为空");
@@ -120,7 +120,7 @@ public class PlatformAuthorizingRealm extends AuthorizingRealm {
} }
if (!loginOrigin.equals(LoginUtil.LoginOrigin.CAS) && !loginOrigin.equals(LoginUtil.LoginOrigin.QI_YE_WEI_XIN) if (!loginOrigin.equals(LoginUtil.LoginOrigin.CAS) && !loginOrigin.equals(LoginUtil.LoginOrigin.QI_YE_WEI_XIN)
&& !loginOrigin.equals(LoginUtil.LoginOrigin.WEI_XIN)) { && !loginOrigin.equals(LoginUtil.LoginOrigin.WEI_XIN_SUCCESS)) {
int errCount = NumberUtils.toInt(Strings.sNull(session.getAttribute("platformErrCount"))); int errCount = NumberUtils.toInt(Strings.sNull(session.getAttribute("platformErrCount")));
if (errCount >= 4) { if (errCount >= 4) {
//输错5次禁用账户10分钟 //输错5次禁用账户10分钟
@@ -235,7 +235,7 @@ public class ActivityBasicScopeController {
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,H06,H10")) { if (!ShiroUtil.hasAnyRoles("sysadmin,H06,H10,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasAnyRoles(new String[]{"H04", "club01"})) { if (ShiroUtil.hasAnyRoles(new String[]{"H04", "club01"})) {
cnd.and("creator", "=", ShiroUtil.getPrincipalProperty("id")); cnd.and("creator", "=", ShiroUtil.getPrincipalProperty("id"));
} }
@@ -284,7 +284,7 @@ public class ActivityBasicScopeController {
addv("is_H04", ShiroUtil.hasRole("H04")); addv("is_H04", ShiroUtil.hasRole("H04"));
addv("is_H02", ShiroUtil.hasRole("club01")); addv("is_H02", ShiroUtil.hasRole("club01"));
addv("is_H03", ShiroUtil.hasRole("SchoolUnionMemberAdmin")); addv("is_H03", ShiroUtil.hasRole("SchoolUnionMemberAdmin"));
addv("is_sysadmin", ShiroUtil.hasRole("sysadmin")); addv("is_sysadmin", ShiroUtil.hasRole("sysadmin,SCHOOL_UNION_SPORTS_ADMIN"));
addv("unionid", Vi.getUnionId()); addv("unionid", Vi.getUnionId());
}}; }};
} }
@@ -97,7 +97,7 @@ public class ActivityBasicUserController {
cnd.andEX("u.unitid", "=", unitId); cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("u.personType", "=", personType); cnd.andEX("u.personType", "=", personType);
cnd.andEX("u.userState", "=", userState); cnd.andEX("u.userState", "=", userState);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.andEX("aus.creator", "=", ShiroUtil.getPrincipalProperty("id")); cnd.andEX("aus.creator", "=", ShiroUtil.getPrincipalProperty("id"));
} }
@@ -202,7 +202,7 @@ public class ActivityUnionController {
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) { if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
cnd.and(searchName, "like", "%" + searchKeyword + "%"); cnd.and(searchName, "like", "%" + searchKeyword + "%");
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.and("gh.id", "=", basicUnit.getUnionid()); cnd.and("gh.id", "=", basicUnit.getUnionid());
} }
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderBy)) { if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderBy)) {
@@ -233,7 +233,7 @@ public class ActivityUnionController {
try { try {
union.setSource("activity"); union.setSource("activity");
sysUnionService.insert(union); sysUnionService.insert(union);
if (!ShiroUtil.hasAnyRoles("sysadmin.H04")) { if (!ShiroUtil.hasAnyRoles("sysadmin.H04,SCHOOL_UNION_SPORTS_ADMIN")) {
sysUnitService.dao().update(ActivityBasicUnit.class, Chain.make("unionid", union.getId()), Cnd.where("id", "=", Vi.getUnit().getId())); sysUnitService.dao().update(ActivityBasicUnit.class, Chain.make("unionid", union.getId()), Cnd.where("id", "=", Vi.getUnit().getId()));
} }
return Result.success(); return Result.success();
@@ -1,10 +1,10 @@
package io.v.nutz.zhgh.activity.controller.school; package io.v.nutz.zhgh.activity.controller.school;
import cn.afterturn.easypoi.entity.ImageEntity;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import com.deepoove.poi.XWPFTemplate; import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure; import com.deepoove.poi.config.Configure;
import com.deepoove.poi.data.PictureRenderData; import com.deepoove.poi.data.PictureRenderData;
import com.deepoove.poi.data.PictureType;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy; import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus; import io.v.nutz.base.dao.CndPlus;
@@ -18,16 +18,14 @@ import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.sys.models.Sys_unit; import io.v.nutz.sys.models.Sys_unit;
import io.v.nutz.sys.models.Sys_user; import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.services.SysUserService; import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.utils.ShiroUtil; import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.activity.models.*; import io.v.nutz.zhgh.activity.models.*;
import io.v.nutz.zhgh.activity.services.ActivitySchoolApplyService; import io.v.nutz.zhgh.activity.services.ActivitySchoolApplyService;
import io.v.nutz.zhgh.activity.services.ActivitySchoolService; import io.v.nutz.zhgh.activity.services.ActivitySchoolService;
import io.v.nutz.zhgh.activity.services.ActivitySchoolTeamService; import io.v.nutz.zhgh.activity.services.ActivitySchoolTeamService;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.ddr.poi.html.HtmlRenderPolicy;
import org.nutz.aop.interceptor.async.Async;
import org.nutz.boot.starter.ftp.FtpService; import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
@@ -46,15 +44,14 @@ import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param; import org.nutz.mvc.annotation.Param;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.IntStream;
/** /**
* @author: Aaron * @author: Aaron
@@ -62,6 +59,7 @@ import java.util.stream.Collectors;
* @description: 活动报名 * @description: 活动报名
**/ **/
@Slf4j
@IocBean @IocBean
@Ok("json:full") @Ok("json:full")
@At("/platform/activity/apply") @At("/platform/activity/apply")
@@ -70,23 +68,16 @@ public class ActivityApplyController {
@Inject @Inject
private ActivitySchoolService activitySchoolService; private ActivitySchoolService activitySchoolService;
@Inject @Inject
protected SysUserService sysUserService; protected SysUserService sysUserService;
@Inject @Inject
private ActivitySchoolApplyService activitySchoolApplyService; private ActivitySchoolApplyService activitySchoolApplyService;
@Inject @Inject
private ActivitySchoolTeamService activitySchoolTeamService; private ActivitySchoolTeamService activitySchoolTeamService;
@Inject @Inject
private SimpleService simpleService; private SimpleService simpleService;
@Inject("ActivitySchoolEvent") @Inject("ActivitySchoolEvent")
private ViService<ActivitySchoolEvent> activitySchoolEventViService; private ViService<ActivitySchoolEvent> activitySchoolEventViService;
@Inject @Inject
private OfficeTemplateUtil officeTemplateUtil; private OfficeTemplateUtil officeTemplateUtil;
@Inject @Inject
@@ -196,7 +187,7 @@ public class ActivityApplyController {
// cnd.and(new Static("now() > school.applyEndTime")); // cnd.and(new Static("now() > school.applyEndTime"));
// } // }
if (!ShiroUtil.hasAnyRoles("H04,sysadmin")) { if (!ShiroUtil.hasAnyRoles("H04,sysadmin,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.and(new Static("JSON_CONTAINS(school.applyWay,JSON_ARRAY( 1))>0")); cnd.and(new Static("JSON_CONTAINS(school.applyWay,JSON_ARRAY( 1))>0"));
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(ShiroUtil.getUserId()))); cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(ShiroUtil.getUserId())));
} }
@@ -673,7 +664,7 @@ public class ActivityApplyController {
""").setParam("unionId", getUnionId()).setParam("userId", ShiroUtil.getUserId()); """).setParam("unionId", getUnionId()).setParam("userId", ShiroUtil.getUserId());
if (!ShiroUtil.hasAnyRoles("H04,sysadmin")) { if (!ShiroUtil.hasAnyRoles("H04,sysadmin,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.where().andLike("school.applyWay ", "1"); cnd.where().andLike("school.applyWay ", "1");
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(ShiroUtil.getUserId()))); cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=school.activityGroupId AND userId='%s') >0".formatted(ShiroUtil.getUserId())));
} }
@@ -833,15 +824,16 @@ public class ActivityApplyController {
@At @At
@ViReturn @ViReturn
@RequiresPermissions("activity.apply") @RequiresPermissions("activity.apply")
public Object dshApplyUserList( public Object dshApplyUserList(@Param(value = "activityId", required = false) String activityId,
@Param(value = "activityId", required = false) String activityId, @Param(value = "eventId", required = false) String eventId,
@Param(value = "eventId", required = false) String eventId) { @Param(value = "activityIsAudit", required = false) String activityIsAudit) {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT SELECT
asa.id, asa.id,
asa.username, asa.username,
asa.loginname, asa.loginname,
asa.sex, asa.sex,
asa.mobile,
asa.identity, asa.identity,
asa.`status`, asa.`status`,
asa.applyUserSign, asa.applyUserSign,
@@ -849,9 +841,23 @@ public class ActivityApplyController {
FROM FROM
`activity_school_apply` asa `activity_school_apply` asa
LEFT JOIN sys_user us ON asa.applyUser = us.id LEFT JOIN sys_user us ON asa.applyUser = us.id
WHERE asa.activityId=@activityId and asa.eventId=@eventId and asa.activityUnionId=@activityUnionId $condition
ORDER BY asa.applyUser """);
""").setParam("activityId", activityId).setParam("eventId", eventId).setParam("activityUnionId", getUnionId()); // WHERE
// asa.activityId=@activityId and asa.eventId=@eventId and asa.activityUnionId=@activityUnionId
// ORDER BY asa.applyUser
// .setParam("activityId", activityId).setParam("eventId", eventId).setParam("activityUnionId", getUnionId());
Cnd cnd = Cnd.NEW();
cnd.and("asa.activityId", "=", activityId);
cnd.and("asa.eventId", "=", eventId);
cnd.and("asa.activityUnionId", "=", getUnionId());
if ("false".equals(activityIsAudit)) {
cnd.and("asa.status", "=", 1);
} else {
cnd.and("asa.status", "!=", 1);
}
cnd.asc("asa.applyUser");
sql.setCondition(cnd);
return activitySchoolApplyService.listMap(sql); return activitySchoolApplyService.listMap(sql);
} }
@@ -888,6 +894,12 @@ public class ActivityApplyController {
return null; return null;
} }
/**
* 下载签名告知书
* @param activityId
* @param response
*/
@At @At
@Ok(("void")) @Ok(("void"))
@RequiresPermissions("activity.apply") @RequiresPermissions("activity.apply")
@@ -896,26 +908,44 @@ public class ActivityApplyController {
ActivitySchool school = simpleService.dao().fetch(ActivitySchool.class, activityId); ActivitySchool school = simpleService.dao().fetch(ActivitySchool.class, activityId);
List<ActivitySchoolApply> schoolApplyList = simpleService.dao().query(ActivitySchoolApply.class, List<ActivitySchoolApply> schoolApplyList = simpleService.dao().query(ActivitySchoolApply.class,
Cnd.where("activityId", "=", activityId) Cnd.where("activityId", "=", activityId)
.and("status", "=", 2) .and("status", "=", 2).and("unionId", "=", Vi.getUnionId())
.and("applyUserSign", "is not", null)); .and("applyUserSign", "is not", null));
List<NutMap> signList = new ArrayList<>();
for (int i = 0; i < schoolApplyList.size(); i++) {
ActivitySchoolApply apply = schoolApplyList.get(i);
ByteArrayOutputStream signOs = new ByteArrayOutputStream();
ftpService.download(apply.getApplyUserSign(), signOs);
ByteArrayInputStream bais = new ByteArrayInputStream(signOs.toByteArray());
BufferedImage bufferImg = ImageIO.read(bais);
/*byte[] bytes = Base64.getDecoder().decode(bufferImg.toByteArray()); List<NutMap> signList = schoolApplyList.stream().map(v -> {
signList.add(NutMap.NEW().addv("sign", new PictureRenderData(70, 30, ".png", bytes)));*/ try {
} PictureRenderData image = getImage(v.getApplyUserSign());
return NutMap.NEW().setv("image", image);
} catch (IOException e) {
log.error("下载签名失败", e);
return null;
}
}).filter(Objects::nonNull).collect(Collectors.toList());
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
Configure config = Configure.newBuilder().bind("signList", policy).build();
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
// 平均分组签字
int totalSize = signList.size();
// 计算每个子列表的大小
int chunkSize = (int) Math.ceil(totalSize / 4.0);
List<List<NutMap>> collect = IntStream.range(0, 4)
.mapToObj(i -> {
int start = i * chunkSize;
int end = Math.min((i + 1) * chunkSize, totalSize);
return start < totalSize ? new ArrayList<>(signList.subList(start, end)) : List.of(NutMap.NEW());
}).collect(Collectors.toList());
for (int i = 0; i < collect.size(); i++) {
map.put("signList" + i, collect.get(i));
}
HackLoopTableRenderPolicy policy = new HackLoopTableRenderPolicy();
Configure config = Configure.newBuilder().bind("signList0", policy).bind("signList1", policy)
.bind("signList2", policy).bind("signList3", policy).build();
// HtmlRenderPolicy policy = new HtmlRenderPolicy();
// Configure config = Configure.newBuilder().bind("signList", policy).build();
map.put("activityName", school.getName()); map.put("activityName", school.getName());
map.put("signList", signList); map.put("dateTime", cn.hutool.core.date.DateUtil.format(new Date(), "yyyy年MM月dd日"));
response.addHeader("Content-Type", "application/octet-stream"); response.addHeader("Content-Type", "application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String((school.getName() + "自愿参赛责任及风险告知书").getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\".docx"); response.addHeader("Content-Disposition", "attachment; filename=\"" + new String((school.getName() + "自愿参赛责任及风险告知书").getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\".docx");
ServletOutputStream outputStream = response.getOutputStream(); ServletOutputStream outputStream = response.getOutputStream();
@@ -923,8 +953,19 @@ public class ActivityApplyController {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
private PictureRenderData getImage(String base64) throws IOException {
if (base64.startsWith("data:")) {
String s = base64.split(",")[1];
byte[] bytes = Base64.getDecoder().decode(s);
return new PictureRenderData(70, 30, ".png", bytes);
} else {
ByteArrayOutputStream os = new ByteArrayOutputStream();
ftpService.download(base64, os);
os.close();
return new PictureRenderData(70, 30, PictureType.PNG, os.toByteArray());
}
}
} }
@@ -232,7 +232,7 @@ public class ActivityCommonController {
app.sex app.sex
""").setParam("id", id); """).setParam("id", id);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06") && ShiroUtil.hasRole("H04")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN") && ShiroUtil.hasRole("H04")) {
sql1.setVar("union", " AND app.unionId = '" + unionid + "' "); sql1.setVar("union", " AND app.unionId = '" + unionid + "' ");
} }
@@ -245,7 +245,7 @@ public class ActivityCommonController {
Cnd unionCnd = Cnd.NEW(); Cnd unionCnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,A06") && ShiroUtil.hasRole("H04")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN") && ShiroUtil.hasRole("H04")) {
unionCnd.and("id", "=", unionid); unionCnd.and("id", "=", unionid);
} }
@@ -117,7 +117,7 @@ public class ActivityInfoManageController {
} else if ("four".equals(query)) { } else if ("four".equals(query)) {
cnd.and(new Static("now() > school.endTime")); cnd.and(new Static("now() > school.endTime"));
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
cnd.and("school.belongUnionId", "=", Vi.getUnionId()); cnd.and("school.belongUnionId", "=", Vi.getUnionId());
} }
@@ -88,7 +88,7 @@ public class ActivityReadingController {
cnd.and("close", "!=", true); cnd.and("close", "!=", true);
cnd.and("YEAR(startTime)", "=", year); cnd.and("YEAR(startTime)", "=", year);
cnd.and("activityLevel", "=", activityLevel); cnd.and("activityLevel", "=", activityLevel);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (activityLevel.equals("40002")) { if (activityLevel.equals("40002")) {
cnd.and("belongUnionId", "=", getUnionId()); cnd.and("belongUnionId", "=", getUnionId());
} }
@@ -135,7 +135,7 @@ public class ActivityReadingController {
cnd.and("app.activityId", "=", id); cnd.and("app.activityId", "=", id);
// cnd.and("YEAR(app.applyDate)", "=", year); // cnd.and("YEAR(app.applyDate)", "=", year);
sql.setCondition(cnd); sql.setCondition(cnd);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasRole("H04") && activityLevel.equals("40002")) { if (ShiroUtil.hasRole("H04") && activityLevel.equals("40002")) {
cnd.and("app.activityUnionId", "=", basicUnit.getUnionid()); cnd.and("app.activityUnionId", "=", basicUnit.getUnionid());
cnd.and("school.belongUnionId", "=", basicUnit.getUnionid()); cnd.and("school.belongUnionId", "=", basicUnit.getUnionid());
@@ -150,7 +150,7 @@ public class ActivityReadingController {
List<NutMap> apply = new ArrayList(); List<NutMap> apply = new ArrayList();
Cnd unionCnd = Cnd.NEW(); Cnd unionCnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
unionCnd.and("id", "=", basicUnit.getUnionid()); unionCnd.and("id", "=", basicUnit.getUnionid());
} }
@@ -353,7 +353,7 @@ public class ActivityReadingController {
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,H10")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,H10,SCHOOL_UNION_SPORTS_ADMIN")) {
if (!user.getUnionid().equals(getUnionId())) { if (!user.getUnionid().equals(getUnionId())) {
setObj(v.getLoginName() + "此用户不是本工会人员"); setObj(v.getLoginName() + "此用户不是本工会人员");
throw new RuntimeException(v.getLoginName() + "此用户不是本工会人员"); throw new RuntimeException(v.getLoginName() + "此用户不是本工会人员");
@@ -214,7 +214,7 @@ public class ActivityRemindController {
@ViReturn @ViReturn
public Object getActivitys() { public Object getActivitys() {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
cnd.and("belongUnionId", "=", Vi.getUnionId()); cnd.and("belongUnionId", "=", Vi.getUnionId());
} }
@@ -79,7 +79,7 @@ public class SiteRecordController {
cnd.and("asr.isRetire","=",isRetire); cnd.and("asr.isRetire","=",isRetire);
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.and("asr.reserve_person_unionid", "=", Vi.getUnionId()); cnd.and("asr.reserve_person_unionid", "=", Vi.getUnionId());
} }
if (Strings.isNotBlank(time)) { if (Strings.isNotBlank(time)) {
@@ -100,7 +100,7 @@ public class SiteReserveController {
if (StrUtil.isNotBlank(isRetire)) { if (StrUtil.isNotBlank(isRetire)) {
cnd.and("asr.isRetire","=",isRetire); cnd.and("asr.isRetire","=",isRetire);
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.and("reserve_person_id", "=", ShiroUtil.getPrincipalProperty("id")); cnd.and("reserve_person_id", "=", ShiroUtil.getPrincipalProperty("id"));
} }
if (Strings.isNotBlank(time)) { if (Strings.isNotBlank(time)) {
@@ -84,7 +84,7 @@ public class SiteUnionProcessController {
CndPlus cnd = CndPlus.create(); CndPlus cnd = CndPlus.create();
cnd.and("asr.reserve_state", "true".equals(isAudit) ? ">" : "false".equals(isAudit) ? "=" : ">=", 6098); cnd.and("asr.reserve_state", "true".equals(isAudit) ? ">" : "false".equals(isAudit) ? "=" : ">=", 6098);
cnd.and("asr.isRetire","=",0); cnd.and("asr.isRetire","=",0);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.and("reserve_person_unionid", "=", Vi.getUnionId()); cnd.and("reserve_person_unionid", "=", Vi.getUnionId());
} }
if (Strings.isNotBlank(time)) { if (Strings.isNotBlank(time)) {
@@ -101,7 +101,7 @@ public class ActivityUnionApplyUserController {
cnd.where().andLike("tissue.name", name); cnd.where().andLike("tissue.name", name);
} }
if (!ShiroUtil.hasAnyRoles("A06,sysadmin")) { if (!ShiroUtil.hasAnyRoles("A06,sysadmin,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=tissue.groupId AND userId='%s') >0".formatted(ShiroUtil.getUserId()))); cnd.and(new Static("(SELECT COUNT(1) FROM activity_user_scope WHERE groupId=tissue.groupId AND userId='%s') >0".formatted(ShiroUtil.getUserId())));
} }
@@ -124,7 +124,7 @@ public class ActivityUnionManageController {
Sql sql = Sqls.create(""" Sql sql = Sqls.create("""
SELECT id userId,username userName,loginname loginName,sex,mobile,unitname unitName,unionname unionName FROM `user` $condition SELECT id userId,username userName,loginname loginName,sex,mobile,unitname unitName,unionname unionName FROM `user` $condition
"""); """);
if (!ShiroUtil.hasRole("sysadmin")) { if (!ShiroUtil.hasAnyRoles("sysadmin,SCHOOL_UNION_SPORTS_ADMIN")) {
if (activity_type == 40002) { if (activity_type == 40002) {
cnd.and("unionId", "=", Vi.getUnionId()); cnd.and("unionId", "=", Vi.getUnionId());
} else if (activity_type == 40003) { } else if (activity_type == 40003) {
@@ -158,7 +158,7 @@ public class ActivityUnionManageController {
tissue.setUserId(ShiroUtil.getUserId()); tissue.setUserId(ShiroUtil.getUserId());
} }
tissue.setApplyTime(DateUtil.getDate()); tissue.setApplyTime(DateUtil.getDate());
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
tissue.setState(1); tissue.setState(1);
} else { } else {
tissue.setState(3); tissue.setState(3);
@@ -86,7 +86,7 @@ public class ActivityUnionUserStatisticsController {
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("atp.tissueId", "=", activityId); cnd.and("atp.tissueId", "=", activityId);
cnd.andEX("u.unionId", "=", unionId); cnd.andEX("u.unionId", "=", unionId);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (!tissue.getUserId().equals(ShiroUtil.getUserId())) { if (!tissue.getUserId().equals(ShiroUtil.getUserId())) {
if (type == 40002) { if (type == 40002) {
cnd.and("unionId", "=", Vi.getUnionId()); cnd.and("unionId", "=", Vi.getUnionId());
@@ -110,13 +110,13 @@ public class ActivityUnionYearSummaryController {
str += " left join `user` u on su.userId = u.id"; str += " left join `user` u on su.userId = u.id";
if ("2".equals(summaryFrom)) { if ("2".equals(summaryFrom)) {
str += " left join sys_union un on su.tissueId = un.id"; str += " left join sys_union un on su.tissueId = un.id";
if (!ShiroUtil.hasAnyRoles(new String[]{"sysadmin", "A06"})) { if (!ShiroUtil.hasAnyRoles(new String[]{"sysadmin", "A06", "SCHOOL_UNION_SPORTS_ADMIN"})) {
cnd.and("su.tissueId", "=", Vi.getUnionId()); cnd.and("su.tissueId", "=", Vi.getUnionId());
} }
} }
if ("3".equals(summaryFrom)) { if ("3".equals(summaryFrom)) {
str += " left join sys_club club on su.tissueId = club.id"; str += " left join sys_club club on su.tissueId = club.id";
if (!ShiroUtil.hasAnyRoles(new String[]{"sysadmin", "A06"})) { if (!ShiroUtil.hasAnyRoles(new String[]{"sysadmin", "A06", "SCHOOL_UNION_SPORTS_ADMIN"})) {
cnd.and("su.tissueId", "=", vi.getClubId()); cnd.and("su.tissueId", "=", vi.getClubId());
} }
} }
@@ -2,6 +2,7 @@ package io.v.nutz.zhgh.activity.models;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
import java.util.List; import java.util.List;
@Data @Data
@@ -17,6 +18,14 @@ public class ActivityMobileSignUpParam {
private List<String> userIds; private List<String> userIds;
private List<teamUserInfo> teamUserInfos;
private String applyUserSign; private String applyUserSign;
@Data
public static class teamUserInfo implements Serializable {
private String userId;
private String mobile;
}
} }
@@ -53,7 +53,7 @@ public class ActivityPlanServiceImpl extends ViServiceImpl<ActivityPlan> impleme
cnd.where().andLike("ap.name", name); cnd.where().andLike("ap.name", name);
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,H10,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,H10,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasRole("H04")) { if (ShiroUtil.hasRole("H04")) {
cnd.and("tissueId", "in", vi.getMangeUnionStr()); cnd.and("tissueId", "in", vi.getMangeUnionStr());
} else if (ShiroUtil.hasRole("club01")) { } else if (ShiroUtil.hasRole("club01")) {
@@ -76,7 +76,7 @@ public class ActivityTissueServiceImpl extends ViServiceImpl<ActivityTissue> imp
cnd.where().andLike("tissue.name", name); cnd.where().andLike("tissue.name", name);
} }
if (!ShiroUtil.hasAnyRoles("sysadmin,H10,A06")) { if (!ShiroUtil.hasAnyRoles("sysadmin,H10,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
cnd.and("tissue.userId", "=", ShiroUtil.getUserId()); cnd.and("tissue.userId", "=", ShiroUtil.getUserId());
/* if (ShiroUtil.hasRole("H04")) { /* if (ShiroUtil.hasRole("H04")) {
cnd.and("tissue.unionId", "in", vi.getMangeUnionStr()); cnd.and("tissue.unionId", "in", vi.getMangeUnionStr());
@@ -66,6 +66,7 @@ public class mobileActivityListController {
@Param(value = "eventId", required = false) String eventId, @Param(value = "eventId", required = false) String eventId,
@Param(value = "applyUserSign", required = false) String applyUserSign, @Param(value = "applyUserSign", required = false) String applyUserSign,
@Param(value = "teamId", required = false) String teamId, @Param(value = "teamId", required = false) String teamId,
@Param(value = "mobile", required = false) String mobile,
@Param(value = "teamName", required = false) String teamName) { @Param(value = "teamName", required = false) String teamName) {
User user = baseService.dao().fetch(User.class, Cnd.where("id", "=", ShiroUtil.getUserId())); User user = baseService.dao().fetch(User.class, Cnd.where("id", "=", ShiroUtil.getUserId()));
@@ -84,7 +85,7 @@ public class mobileActivityListController {
schoolApply.setTeam(teamName); schoolApply.setTeam(teamName);
schoolApply.setApplyUser(user.getId()); schoolApply.setApplyUser(user.getId());
schoolApply.setUserId(user.getId()); schoolApply.setUserId(user.getId());
schoolApply.setMobile(user.getMobile()); schoolApply.setMobile(mobile);
schoolApply.setSex(user.getSex()); schoolApply.setSex(user.getSex());
schoolApply.setUnitId(user.getUnitid()); schoolApply.setUnitId(user.getUnitid());
schoolApply.setUnionId(user.getUnionid()); schoolApply.setUnionId(user.getUnionid());
@@ -268,7 +269,7 @@ public class mobileActivityListController {
@ViReturn @ViReturn
@RequiresAuthentication @RequiresAuthentication
public Object doTeamSignUp(ActivityMobileSignUpParam param) { public Object doTeamSignUp(ActivityMobileSignUpParam param) {
mobileActivityApplyService.doTeamSignUp(param.getActivityId(), param.getUserIds(), param.getEventId(), param.getTeamId(), param.getTeamName(),param.getApplyUserSign()); mobileActivityApplyService.doTeamSignUp(param.getActivityId(), param.getUserIds(), param.getEventId(), param.getTeamId(), param.getTeamName(),param.getApplyUserSign(), param.getTeamUserInfos());
return null; return null;
} }
@@ -1,11 +1,24 @@
package io.v.nutz.zhgh.mobile.activity.Sports.service; package io.v.nutz.zhgh.mobile.activity.Sports.service;
import io.v.nutz.base.service.BaseService; import io.v.nutz.base.service.BaseService;
import io.v.nutz.zhgh.activity.models.ActivityMobileSignUpParam;
import io.v.nutz.zhgh.activity.models.ActivitySchoolApply; import io.v.nutz.zhgh.activity.models.ActivitySchoolApply;
import java.util.List; import java.util.List;
public interface MobileActivityApplyService extends BaseService<ActivitySchoolApply> { public interface MobileActivityApplyService extends BaseService<ActivitySchoolApply> {
void doDeleteApply(String activityId, String eventId); void doDeleteApply(String activityId, String eventId);
void doTeamSignUp(String activityId, List<String> userIds, String eventId, String teamId, String teamName,String applyUserSign);
/**
* 组队报名
* @param activityId
* @param userIds
* @param eventId
* @param teamId
* @param teamName
* @param applyUserSign
* @param teamUserInfos
*/
void doTeamSignUp(String activityId, List<String> userIds, String eventId, String teamId, String teamName,
String applyUserSign, List<ActivityMobileSignUpParam.teamUserInfo> teamUserInfos);
} }
@@ -7,19 +7,14 @@ import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.activity.models.*; import io.v.nutz.zhgh.activity.models.*;
import io.v.nutz.zhgh.mobile.activity.Sports.service.MobileActivityApplyService; import io.v.nutz.zhgh.mobile.activity.Sports.service.MobileActivityApplyService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.web.filter.mgt.DefaultFilter;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang; import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static org.apache.shiro.web.filter.mgt.DefaultFilter.user;
/** /**
* @ClassName ActivitySchoolApplyServiceImpl * @ClassName ActivitySchoolApplyServiceImpl
* @Description TODO * @Description TODO
@@ -39,16 +34,24 @@ public class MobileActivityApplyServiceImpl extends BaseServiceImpl<ActivityScho
} }
@Override @Override
public void doTeamSignUp(String activityId, List<String> userIds, String eventId, String teamId, String teamName, String applyUserSign) { public void doTeamSignUp(String activityId, List<String> userIds, String eventId, String teamId,
String teamName, String applyUserSign, List<ActivityMobileSignUpParam.teamUserInfo> teamUserInfos) {
List<ActivitySchoolApply> schoolApplyArrayList = new ArrayList<>(); List<ActivitySchoolApply> schoolApplyArrayList = new ArrayList<>();
userIds.forEach(i -> {
ActivitySchoolApply schoolApply = getApply(activityId, eventId, i, teamId, teamName, applyUserSign); // userIds.forEach(i -> {
// ActivitySchoolApply schoolApply = getApply(activityId, eventId, i, teamId, teamName, applyUserSign);
// schoolApplyArrayList.add(schoolApply);
// });
teamUserInfos.forEach( v -> {
ActivitySchoolApply schoolApply = getApply(activityId, eventId, v.getUserId(), teamId, teamName, applyUserSign, v.getMobile());
schoolApplyArrayList.add(schoolApply); schoolApplyArrayList.add(schoolApply);
}); });
insert(schoolApplyArrayList); insert(schoolApplyArrayList);
} }
public ActivitySchoolApply getApply(String activityId, String eventId, String userId, String teamId, String teamName, String applyUserSign) { public ActivitySchoolApply getApply(String activityId, String eventId, String userId, String teamId, String teamName, String applyUserSign, String mobile) {
ActivitySchool activitySchool = dao().fetch(ActivitySchool.class, activityId); ActivitySchool activitySchool = dao().fetch(ActivitySchool.class, activityId);
User user = dao().fetch(User.class, Cnd.where("id", "=", userId)); User user = dao().fetch(User.class, Cnd.where("id", "=", userId));
ActivityBasicUnit basicUnit = dao().fetch(ActivityBasicUnit.class, Cnd.where("id", "=", user.getUnitid())); ActivityBasicUnit basicUnit = dao().fetch(ActivityBasicUnit.class, Cnd.where("id", "=", user.getUnitid()));
@@ -70,7 +73,7 @@ public class MobileActivityApplyServiceImpl extends BaseServiceImpl<ActivityScho
schoolApply.setTeam(teamName); schoolApply.setTeam(teamName);
schoolApply.setApplyUser(ShiroUtil.getUserId()); schoolApply.setApplyUser(ShiroUtil.getUserId());
schoolApply.setUserId(userId); schoolApply.setUserId(userId);
schoolApply.setMobile(user.getMobile()); schoolApply.setMobile(mobile);
schoolApply.setSex(user.getSex()); schoolApply.setSex(user.getSex());
schoolApply.setUnitId(user.getUnitid()); schoolApply.setUnitId(user.getUnitid());
schoolApply.setUnionId(user.getUnionid()); schoolApply.setUnionId(user.getUnionid());
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.mobile; package io.v.nutz.zhgh.mobile;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result; import cn.wizzer.framework.base.Result;
import io.v.nutz.base.utils.LoginUtil; import io.v.nutz.base.utils.LoginUtil;
import io.v.nutz.base.utils.PwdUtil; import io.v.nutz.base.utils.PwdUtil;
@@ -21,8 +22,6 @@ import org.apache.shiro.subject.Subject;
import org.nutz.dao.Chain; import org.nutz.dao.Chain;
import org.nutz.dao.Cnd; import org.nutz.dao.Cnd;
import org.nutz.dao.Dao; import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings; import org.nutz.lang.Strings;
@@ -127,22 +126,24 @@ public class mobileLoginController {
@Param("isFirstLogin") boolean isFirstLogin, @Param("newPwd") String newPwd) { @Param("isFirstLogin") boolean isFirstLogin, @Param("newPwd") String newPwd) {
Sys_user user = dao.fetch(Sys_user.class, Cnd.where("id", "=", ShiroUtil.getUserId())); Sys_user user = dao.fetch(Sys_user.class, Cnd.where("id", "=", ShiroUtil.getUserId()));
if (isFirstLogin) { if (!isFirstLogin) {
sourcePwd = user.getLoginname(); String userSourcePwd = PwdUtil.doSm4CbcDecrypt(user.getPassword());
if (!userSourcePwd.equals(sourcePwd)) {
return Result.error("原密码错误");
}
if (userSourcePwd.equals(newPwd)) {
return Result.error("新密码不能与原密码相同");
}
} }
String userSourcePwd = PwdUtil.doSm4CbcDecrypt(user.getPassword()); if (user.getLoginname().equals(newPwd)) {
return Result.error("请勿以工号作为密码");
if (!userSourcePwd.equals(sourcePwd)) {
return Result.error("原密码错误");
}
if (userSourcePwd.equals(newPwd)) {
return Result.error("新密码不能与原密码相同");
} }
String pwd = PwdUtil.doSm4CbcEncrypt(newPwd); String pwd = PwdUtil.doSm4CbcEncrypt(newPwd);
dao.update(Sys_user.class, Chain.make("password", pwd), Cnd.where("id", "=", ShiroUtil.getUserId())); dao.update(Sys_user.class, Chain.make("password", pwd).add("weAppLoginCount", user.getWeAppLoginCount() + 1), Cnd.where("id", "=", ShiroUtil.getUserId()));
sysUserService.deleteCacheAndUpdate(ShiroUtil.getUserId()); sysUserService.deleteCacheAndUpdate(ShiroUtil.getUserId());
return Result.success("修改成功"); return Result.success("修改成功");
@@ -156,10 +157,11 @@ public class mobileLoginController {
@At @At
@RequiresAuthentication @RequiresAuthentication
public Object checkIsFirstLogin(){ public Object checkIsFirstLogin(){
Sql sql = Sqls.create("select weAppLoginCount from sys_user where id = @userId").setParam("userId", ShiroUtil.getUserId()); Sys_user user = dao.fetch(Sys_user.class, Cnd.where("id", "=", ShiroUtil.getUserId()));
sql.setCallback(Sqls.callback.integer()); if ((user.getWeAppLoginCount() == null || user.getWeAppLoginCount() == 1) && StrUtil.isNotBlank(user.getOpenId())) {
dao.execute(sql); return Result.error();
int count = sql.getInt(); } else {
return count == 0 ? Result.error() : Result.success(); return Result.success();
}
} }
} }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

@@ -27,21 +27,15 @@ layout("/mobile/platform.html"){
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-nav-bar :title="title" <van-nav-bar :title="title" @click-left="pjaxReplace('/mobile/activity/Sports/list/activityList')" fixed left-arrow placeholder></van-nav-bar>
@click-left="pjaxReplace('/mobile/activity/Sports/list/activityList')" fixed
left-arrow
placeholder></van-nav-bar>
<div class="search-fixed"> <div class="search-fixed">
<van-dropdown-menu active-color="#1989fa"> <van-dropdown-menu active-color="#1989fa">
<!-- <van-dropdown-item v-model="pageForm.isMenWomen" @change="yearChange" <!-- <van-dropdown-item v-model="pageForm.isMenWomen" @change="yearChange"
:options="sexList"></van-dropdown-item>--> :options="sexList"></van-dropdown-item>-->
<van-dropdown-item v-model="pageForm.groupName" @change="yearChange" <van-dropdown-item v-model="pageForm.groupName" @change="yearChange" :options="groupList"></van-dropdown-item>
:options="groupList"></van-dropdown-item> <van-dropdown-item :options="eventList" @change="yearChange" v-model="pageForm.eventId"></van-dropdown-item>
<van-dropdown-item :options="eventList" @change="yearChange" <van-dropdown-item :options="auditList" @change="yearChange" v-model="pageForm.isAudit"></van-dropdown-item>
v-model="pageForm.eventId"></van-dropdown-item>
<van-dropdown-item :options="auditList" @change="yearChange"
v-model="pageForm.isAudit"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
@@ -51,20 +45,16 @@ layout("/mobile/platform.html"){
mode="closeable" mode="closeable"
text="自己报名的项目如要修改请点击取消报名后再重新报名,若其他人帮助报名则联系报名人取消!" text="自己报名的项目如要修改请点击取消报名后再重新报名,若其他人帮助报名则联系报名人取消!"
></van-notice-bar> ></van-notice-bar>
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" <van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" v-model="loading" @load="pageData">
v-model="loading" @load="pageData">
<div v-for="o in tableData" class="van-doc-card"> <div v-for="o in tableData" class="van-doc-card">
<van-row> <van-row>
<van-col span="24" class="username"> <van-col span="24" class="username">
{{ o.allName }} {{ o.allName }}
<div v-if="o.status" <div v-if="o.status" style="display: flex; justify-content: flex-end">
style="display: flex;justify-content: flex-end">
<span v-if="o.status===1">待审核</span> <span v-if="o.status===1">待审核</span>
<span v-if="o.status===2">已成功报名</span> <span v-if="o.status===2">已成功报名</span>
<span v-if="o.status===3">审核不通过</span> <span v-if="o.status===3">审核不通过</span>
</div> </div>
</van-col> </van-col>
</van-row> </van-row>
@@ -106,9 +96,7 @@ layout("/mobile/platform.html"){
<van-row class="info" v-if="o.projectType==2"> <van-row class="info" v-if="o.projectType==2">
<van-col span="24"> <van-col span="24">
<van-cell title="可报队数:"> <van-cell title="可报队数:">{{ o.restrictTotalTeam }}队</van-cell>
{{ o.restrictTotalTeam }}队
</van-cell>
</van-col> </van-col>
</van-row> </van-row>
@@ -116,16 +104,11 @@ layout("/mobile/platform.html"){
<van-col span="24"> <van-col span="24">
<span>每队可报人数:</span> <span>每队可报人数:</span>
<span v-if="o.athletesMaxNum">{{ o.athletesMaxNum }}人</span> <span v-if="o.athletesMaxNum">{{ o.athletesMaxNum }}人</span>
<span v-else-if="o.applyType===1">{{ <span v-else-if="o.applyType===1">{{ o.athletesMaxNum * o.restrictTotalTeam }}人</span>
o.athletesMaxNum * o.restrictTotalTeam <span v-else-if="o.applyType===2&&o.eveProjectType==='1'">{{ o.athletesMaxNum }}人</span>
}}人</span> <span v-else-if="o.applyType===2&&o.eveProjectType==='2'">
<span v-else-if="o.applyType===2&&o.eveProjectType==='1'">{{ {{ (o.restrictGirlNum ? o.restrictGirlNum : 0) + (o.restrictBoyNum ? o.restrictBoyNum : 0) }}人
o.athletesMaxNum </span>
}}人</span>
<span
v-else-if="o.applyType===2&&o.eveProjectType==='2'">{{
(o.restrictGirlNum ? o.restrictGirlNum : 0) + (o.restrictBoyNum ? o.restrictBoyNum : 0)
}}人</span>
<span v-else>暂无</span> <span v-else>暂无</span>
</van-col> </van-col>
</van-row> </van-row>
@@ -142,18 +125,13 @@ layout("/mobile/platform.html"){
v-else-if="o.totalApplyNum>0&&o.applyType===3">{{ o.totalApplyNum }}人</span> v-else-if="o.totalApplyNum>0&&o.applyType===3">{{ o.totalApplyNum }}人</span>
<span v-else>0人</span>--> <span v-else>0人</span>-->
<span>{{o.totalApplyNum}}</span> <span>{{o.totalApplyNum}}</span>
</van-col> </van-col>
</van-row> </van-row>
<van-row class="info" <van-row class="info" v-if="JSON.parse(o.applyWay).length===2&&JSON.parse(o.applyWay).includes(1)">
v-if="JSON.parse(o.applyWay).length===2&&JSON.parse(o.applyWay).includes(1)">
<van-col span="24"> <van-col span="24">
<span>已报名人员:</span> <span>已报名人员:</span>
<span v-if="o.userApplyNames" style="color: #0e78c5" <span v-if="o.userApplyNames" style="color: #0e78c5" @click="openApplyUser(o)">{{ o.userApplyNames }}</span>
@click="openApplyUser(o)">{{
o.userApplyNames
}}</span>
<span v-else>未报名</span> <span v-else>未报名</span>
</van-col> </van-col>
</van-row> </van-row>
@@ -161,19 +139,23 @@ layout("/mobile/platform.html"){
<van-row class="info"> <van-row class="info">
<van-col span="24"> <van-col span="24">
<div class="register-icon"> <div class="register-icon">
<img v-if="o.userApply==0&&o.applyWay.includes(1)" <img v-if="o.userApply==0&&o.applyWay.includes(1)" @click="openActivity(o)" src="/assets/mobile/svg/activity/wbm.svg" />
@click="openActivity(o)" <img
src="/assets/mobile/svg/activity/wbm.svg" /> v-if="o.userApply>0&&o.applyWay.includes(1)&&o.applyUser===userId"
<img v-if="o.userApply>0&&o.applyWay.includes(1)&&o.applyUser===userId" @click="openActivity(o)"
@click="openActivity(o)" src="/assets/mobile/svg/activity/qxbm.svg"
src="/assets/mobile/svg/activity/qxbm.svg" /> />
<van-button style="border-radius: 10px" block size="small" <van-button
type="info" style="border-radius: 10px"
@click="openSign(o)" block
v-if="o.userApply>0 size="small"
type="info"
@click="openSign(o)"
v-if="o.userApply>0
&&o.applyWay.includes(1) &&o.applyWay.includes(1)
&&o.applyUser!==userId &&o.applyUser!==userId
&&o.isSign&&!o.applyUserSign"> &&o.isSign&&!o.applyUserSign"
>
签 字 签 字
</van-button> </van-button>
</div> </div>
@@ -183,184 +165,148 @@ layout("/mobile/platform.html"){
</van-list> </van-list>
</div> </div>
<van-action-sheet v-model="teamSignUpShow" :close-on-click-overlay="false" <van-action-sheet
:style="{ height: '100%',width:'100%' ,'overflow-y':'visible'}" v-model="teamSignUpShow"
:title="isView?'查看报名信息':'组队报名'"> :close-on-click-overlay="false"
<div class="van-card-header"> :style="{ height: '100%',width:'100%' ,'overflow-y':'visible'}"
本人信息 :title="isView?'查看报名信息':'组队报名'"
</div> >
<div class="van-card-header">本人信息</div>
<div class="van-card-body"> <div class="van-card-body">
<van-field label="姓名" readonly <van-field label="姓名" readonly v-model="userName"></van-field>
v-model="userName"></van-field> <van-field label="工号" readonly v-model="loginName"></van-field>
<van-field label="工号" readonly
v-model="loginName"></van-field>
<van-field label="性别" readonly v-model="sex"></van-field> <van-field label="性别" readonly v-model="sex"></van-field>
<van-field label="所在单位" readonly <van-field label="联系方式" v-model="formData.mobile" placeholder="请输入联系方式" type="tel" maxlength="11"></van-field>
v-model="unitName"></van-field> <van-field label="所在单位" readonly v-model="unitName"></van-field>
<van-field label="所属工会" readonly <van-field label="所属工会" readonly v-model="unionName"></van-field>
v-model="unionName"></van-field>
<van-field label="签字" readonly v-if="activityData.isSign&&isView"> <van-field label="签字" readonly v-if="activityData.isSign&&isView">
<template #input> <template #input>
<van-image <van-image
:src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + formData.applyUserSign" :src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + formData.applyUserSign"
width="100" height="50" v-if="formData.applyUserSign"></van-image> width="100"
height="50"
v-if="formData.applyUserSign"
></van-image>
<span v-else>暂无</span> <span v-else>暂无</span>
</template> </template>
</van-field> </van-field>
</div> </div>
<template <template v-for="(item,index) in registerList.filter(v=>v.loginName !== loginName)">
v-for="(item,index) in registerList.filter(v=>v.loginName !== loginName)">
<div class="van-card-header"> <div class="van-card-header">
队友信息{{ index + 1 }} 队友信息{{ index + 1 }}
<span style="color:red;" @click="removeRegUser(item)" v-if="!isView">删除</span> <span style="color: red" @click="removeRegUser(item)" v-if="!isView">删除</span>
</div> </div>
<div class="van-card-body"> <div class="van-card-body">
<van-field label="姓名" readonly v-model="item.userName"></van-field> <van-field label="姓名" readonly v-model="item.userName"></van-field>
<van-field label="工号" readonly v-model="item.loginName"></van-field> <van-field label="工号" readonly v-model="item.loginName"></van-field>
<van-field label="性别" readonly v-model="item.sex"></van-field> <van-field label="性别" readonly v-model="item.sex"></van-field>
<van-field label="联系方式" v-model="item.mobile" placeholder="请输入联系方式" type="tel" maxlength="11"></van-field>
<van-field label="所在单位" readonly v-model="item.unitName"></van-field> <van-field label="所在单位" readonly v-model="item.unitName"></van-field>
<van-field label="所属工会" readonly v-model="item.unionName"></van-field> <van-field label="所属工会" readonly v-model="item.unionName"></van-field>
<van-field label="签字" readonly v-if="activityData.isSign&&isView"> <van-field label="签字" readonly v-if="activityData.isSign&&isView">
<template #input> <template #input>
<van-image <van-image
:src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + formData.applyUserSign" :src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + formData.applyUserSign"
width="100" height="50"></van-image> width="100"
height="50"
></van-image>
<span v-else>暂无</span> <span v-else>暂无</span>
</template> </template>
</van-field> </van-field>
</div> </div>
</template> </template>
<div <div v-if="registerList.filter(v=>v.loginName !== loginName).length === 0">
v-if="registerList.filter(v=>v.loginName !== loginName).length === 0"> <div style="padding: 10px 10px; text-align: center; color: #9b9999">暂无队友信息,请点击添加队友按钮</div>
<div style="padding: 10px 10px;text-align: center;color: #9b9999;">
暂无队友信息,请点击添加队友按钮
</div>
</div> </div>
<div style="margin: 20px 20px 10px 20px" v-if="!isView"> <div style="margin: 20px 20px 10px 20px" v-if="!isView">
<div class="van-card-header"> <div class="van-card-header">签字</div>
签字
</div>
<div class="van-card-body"> <div class="van-card-body">
<mobile-sign ref="signature" :my_sign.sync="formData.applyUserSign" <mobile-sign ref="signature" :my_sign.sync="formData.applyUserSign" :is_value_base64="false"></mobile-sign>
:is_value_base64="false"></mobile-sign>
</div> </div>
</div> </div>
<div style="display: flex;justify-content: center" v-if="!isView"> <div style="display: flex; justify-content: center" v-if="!isView">
<van-radio-group v-model="formData.isCy" direction="horizontal" <van-radio-group v-model="formData.isCy" direction="horizontal" v-if="activityData.isSign">
v-if="activityData.isSign">
<van-radio name="1"></van-radio> <van-radio name="1"></van-radio>
<span style="color: red" <span style="color: red" @click="fxgzsActionPopup=true">我已阅读参赛责任及风险告知书</span>
@click="fxgzsActionPopup=true">自愿参赛责任及风险告知书</span>
</van-radio-group> </van-radio-group>
</div> </div>
<div style="margin: 20px 20px 10px 20px" v-if="!isView"> <div style="margin: 20px 20px 45px 20px" v-if="!isView">
<van-row gutter="20"> <van-row gutter="20">
<van-col span="12"> <van-col span="12">
<van-button @click="openUserActionSheet" style="border-radius: 10px" block <van-button @click="openUserActionSheet" style="border-radius: 10px" block type="info">添加队友</van-button>
type="info">
添加队友
</van-button>
</van-col> </van-col>
<van-col span="12"> <van-col span="12">
<van-button @click="doTeamSignUp()" style="border-radius: 10px" block <van-button @click="doTeamSignUp()" style="border-radius: 10px" block type="info">提 交</van-button>
type="info">
提 交
</van-button>
</van-col> </van-col>
</van-row> </van-row>
</div> </div>
</van-action-sheet> </van-action-sheet>
<van-action-sheet v-model="userActionSheet" title="选择人员" class="userActionPopup"> <van-action-sheet v-model="userActionSheet" title="选择人员" class="userActionPopup">
<van-search v-model="searchKey" @search="onSearchUser" show-action <van-search v-model="searchKey" @search="onSearchUser" show-action placeholder="请输入姓名或者工号搜索">
placeholder="请输入姓名或者工号搜索">
<template #action> <template #action>
<div @click="onSearchUser">搜索</div> <div @click="onSearchUser">搜索</div>
</template> </template>
</van-search> </van-search>
<div class="van-action-sheet__content mt5 user-select-sheet" <div class="van-action-sheet__content mt5 user-select-sheet" v-if="searchUserList && searchUserList.length>0">
v-if="searchUserList && searchUserList.length>0">
<template v-if="searchLoading"> <template v-if="searchLoading">
<van-loading size="24px" vertical>搜索中...</van-loading> <van-loading size="24px" vertical>搜索中...</van-loading>
</template> </template>
<template v-if="!searchLoading"> <template v-if="!searchLoading">
<template v-for="item in searchUserList" <template v-for="item in searchUserList" v-if="!registerList.map(v=>v.id).includes(item.id)">
v-if="!registerList.map(v=>v.id).includes(item.id)"> <button @click="searchUserAdd(item)" class="van-action-sheet__item">
<button @click="searchUserAdd(item)" <span class="van-action-sheet__name" style="display: flex; flex-direction: column">
class="van-action-sheet__item"> <div style="display: flex; justify-content: center">{{ item.userName }}-{{ item.loginName }}-{{item.sex}}</div>
<span class="van-action-sheet__name" <div>{{ item.unitName }}</div>
style="display: flex;flex-direction: column"> </span>
<div style="display: flex;justify-content: center;">
{{ item.userName }}-{{ item.loginName }}-{{item.sex}}
</div>
<div>
{{ item.unitName }}
</div>
</span>
</button> </button>
</template> </template>
</template> </template>
</div> </div>
<van-empty v-else image="search" description="请输入姓名或者工号搜索"></van-empty> <van-empty v-else image="search" description="请输入姓名或者工号搜索"></van-empty>
</van-action-sheet> </van-action-sheet>
<van-action-sheet v-model="fxgzsActionPopup" title="自愿参赛责任及风险告知书"> <van-action-sheet v-model="fxgzsActionPopup" title="自愿参赛责任及风险告知书">
<div v-html="activityData.precautions"></div> <div v-html="activityData.precautions" style="padding: 10px 15px"></div>
</van-action-sheet> </van-action-sheet>
<van-action-sheet v-model="signActionPopup" title="签字"> <van-action-sheet v-model="signActionPopup" title="签字">
<div class="van-card-header"> <div class="van-card-header">签字</div>
签字
</div>
<div class="van-card-body"> <div class="van-card-body">
<mobile-sign ref="signature" :my_sign.sync="formData.applyUserSign" <mobile-sign ref="signature" :my_sign.sync="formData.applyUserSign" :is_value_base64="false"></mobile-sign>
:is_value_base64="false"></mobile-sign>
</div> </div>
<div style="display: flex;justify-content: center;padding-bottom: 10px"> <div style="display: flex; justify-content: center; padding-bottom: 10px">
<van-radio-group v-model="formData.isCy" direction="horizontal"> <van-radio-group v-model="formData.isCy" direction="horizontal">
<van-radio name="1"></van-radio> <van-radio name="1"></van-radio>
<span style="color: red" <span style="color: red" @click="fxgzsActionPopup=true">自愿参赛责任及风险告知书</span>
@click="fxgzsActionPopup=true">自愿参赛责任及风险告知书</span>
</van-radio-group> </van-radio-group>
</div> </div>
<van-row gutter="20"> <van-row gutter="20">
<van-col span="24"> <van-col span="24">
<van-button @click="doSign()" style="border-radius: 10px" block <van-button @click="doSign()" style="border-radius: 10px" block type="info">提 交</van-button>
type="info">
提 交
</van-button>
</van-col> </van-col>
</van-row> </van-row>
</van-action-sheet> </van-action-sheet>
<van-action-sheet
<van-action-sheet v-model="activityDialog" :close-on-click-overlay="false" v-model="activityDialog"
:style="{ height: '100%',width:'100%' ,'overflow-y':'visible'}" :close-on-click-overlay="false"
title="项目报名"> :style="{ height: '100%',width:'100%' ,'overflow-y':'visible'}"
<div class="van-card-header"> title="项目报名"
本人信息 >
</div> <div class="van-card-header">本人信息</div>
<div class="van-card-body"> <div class="van-card-body">
<van-field label="姓名" readonly <van-field label="姓名" readonly v-model="userName"></van-field>
v-model="userName"></van-field> <van-field label="工号" readonly v-model="loginName"></van-field>
<van-field label="工号" readonly
v-model="loginName"></van-field>
<van-field label="性别" readonly v-model="sex"></van-field> <van-field label="性别" readonly v-model="sex"></van-field>
<van-field label="所在单位" readonly <van-field label="联系方式" v-model="formData.mobile" placeholder="请输入联系方式" type="tel" maxlength="11"></van-field>
v-model="unitName"></van-field> <van-field label="所在单位" readonly v-model="unitName"></van-field>
<van-field label="所属工会" readonly <van-field label="所属工会" readonly v-model="unionName"></van-field>
v-model="unionName"></van-field>
<van-radio-group v-model="formData.teamId" v-if="projectType==2"> <van-radio-group v-model="formData.teamId" v-if="projectType==2">
<van-cell-group> <van-cell-group>
<template v-for="i in teams"> <template v-for="i in teams">
@@ -372,28 +318,20 @@ layout("/mobile/platform.html"){
</template> </template>
</van-cell-group> </van-cell-group>
</van-radio-group> </van-radio-group>
</div>
<div class="van-card-header">
签字
</div> </div>
<div class="van-card-header">签字</div>
<div class="van-card-body"> <div class="van-card-body">
<mobile-sign ref="signature" :my_sign.sync="formData.applyUserSign" <mobile-sign ref="signature" :my_sign.sync="formData.applyUserSign" :is_value_base64="false"></mobile-sign>
:is_value_base64="false"></mobile-sign>
</div> </div>
<div style="display: flex;justify-content: center;padding-bottom: 10px"> <div style="display: flex; justify-content: center; padding-bottom: 10px">
<van-radio-group v-model="formData.isCy" direction="horizontal"> <van-radio-group v-model="formData.isCy" direction="horizontal">
<van-radio name="1"></van-radio> <van-radio name="1"></van-radio>
<span style="color: red" <span style="color: red" @click="fxgzsActionPopup=true">我已阅读参赛责任及风险告知书</span>
@click="fxgzsActionPopup=true">自愿参赛责任及风险告知书</span>
</van-radio-group> </van-radio-group>
</div> </div>
<van-row gutter="20"> <van-row gutter="20">
<van-col span="24"> <van-col span="24">
<van-button @click="doActivityConfirm()" style="border-radius: 10px" block <van-button @click="doActivityConfirm()" style="border-radius: 10px" block type="info">提 交</van-button>
type="info">
提 交
</van-button>
</van-col> </van-col>
</van-row> </van-row>
</van-action-sheet> </van-action-sheet>
@@ -410,9 +348,7 @@ layout("/mobile/platform.html"){
</van-dialog>--> </van-dialog>-->
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg"
description="暂无数据"></van-empty>
</div> </div>
<script> <script>
@@ -431,7 +367,8 @@ layout("/mobile/platform.html"){
teamId: null, teamId: null,
teamName: null, teamName: null,
activityId: "", activityId: "",
eventId: "" eventId: "",
mobile: null
}, },
title: "活动报名", title: "活动报名",
projectType: "", projectType: "",
@@ -482,42 +419,43 @@ layout("/mobile/platform.html"){
methods: { methods: {
doSign() { doSign() {
if (this.activityData.isSign && !this.formData.applyUserSign) { if (this.activityData.isSign && !this.formData.applyUserSign) {
this.$dialog.alert({ this.$dialog
title: "温馨提示", .alert({
message: "请签字后再提交!" title: "温馨提示",
}).then(() => { message: "请签字后再提交!"
})
}) .then(() => {})
return return
} }
if (this.activityData.isSign && !this.formData.isCy) { if (this.activityData.isSign && !this.formData.isCy) {
this.$dialog.alert({ this.$dialog
title: "温馨提示", .alert({
message: "请先阅读自愿参赛责任及风险告知书!" title: "温馨提示",
}).then(() => { message: "请先阅读自愿参赛责任及风险告知书!"
})
}) .then(() => {})
return return
} }
this.$dialog.confirm({ this.$dialog
title: "提示", .confirm({
message: "您确认要提交吗?" title: "提示",
}).then(() => { message: "您确认要提交吗?"
$.post("/mobile/activity/Sports/list/doSign", { })
applyUserSign: this.formData.applyUserSign, .then(() => {
activityId: this.activityData.activityId, $.post("/mobile/activity/Sports/list/doSign", {
eventId: this.activityData.eventId applyUserSign: this.formData.applyUserSign,
}).then(resp => { activityId: this.activityData.activityId,
if (resp.code === 0) { eventId: this.activityData.eventId
this.$toast.success("提交成功!") }).then((resp) => {
window.location.reload() if (resp.code === 0) {
} else { this.$toast.success("提交成功!")
this.$toast.fail(resp.msg) window.location.reload()
} } else {
this.$toast.fail(resp.msg)
}
})
}) })
})
}, },
openSign(row) { openSign(row) {
this.activityData = row this.activityData = row
@@ -530,9 +468,9 @@ layout("/mobile/platform.html"){
const resp = await this.selectRegisterList() const resp = await this.selectRegisterList()
if (resp) { if (resp) {
const selfInfo = resp.find(v => v.id === "${@shiro.getPrincipalProperty('id')}" && v.eventId === item.eventId) const selfInfo = resp.find((v) => v.id === "${@shiro.getPrincipalProperty('id')}" && v.eventId === item.eventId)
if (selfInfo) { if (selfInfo) {
this.registerList = resp.filter(v => v.eventId === item.eventId && v.applyUser === selfInfo.applyUser) this.registerList = resp.filter((v) => v.eventId === item.eventId && v.applyUser === selfInfo.applyUser)
this.formData.applyUserSign = selfInfo.applyUserSign this.formData.applyUserSign = selfInfo.applyUserSign
} }
this.teamSignUpShow = true this.teamSignUpShow = true
@@ -543,66 +481,83 @@ layout("/mobile/platform.html"){
activityId: this.formData.activityId activityId: this.formData.activityId
}) })
return resp.data return resp.data
}, },
async doTeamSignUp() { async doTeamSignUp() {
if (this.activityData.isSign && !this.formData.applyUserSign) { if (!this.formData.mobile || !this.formData.mobile.match(/^1[3-9]\d{9}$/)) {
this.$dialog.alert({ this.$dialog.alert({
title: "温馨提示", title: "温馨提示",
message: "请签字后再提交!" message: "请正确填写本人的联系方式!"
}).then(() => {
}) })
return return
} }
const _this = this
this.registerList.forEach((item) => {
if (item.id === "${@shiro.getPrincipalProperty('id')}") {
item.mobile = _this.formData.mobile
}
})
console.log(this.registerList)
const hasEmptyPhone = this.registerList.some((item) => !item.mobile || !item.mobile.match(/^1[3-9]\d{9}$/))
if (hasEmptyPhone) {
this.$dialog.alert({
title: "温馨提示",
message: "请正确填写参赛队友的联系方式!"
})
return
}
if (this.activityData.isSign && !this.formData.applyUserSign) {
this.$dialog
.alert({
title: "温馨提示",
message: "请签字后再提交!"
})
.then(() => {})
return
}
if (this.activityData.isSign && !this.formData.isCy) { if (this.activityData.isSign && !this.formData.isCy) {
this.$dialog.alert({ this.$dialog
title: "温馨提示", .alert({
message: "请先阅读自愿参赛责任及风险告知书!" title: "温馨提示",
}).then(() => { message: "请先阅读自愿参赛责任及风险告知书!"
})
}) .then(() => {})
return return
} }
const { const { athletesMaxNum, startAgeDate, endAgeDate, isMenWomen, restrictBoyNum, restrictGirlNum } = this.events.find(
athletesMaxNum, (v) => v.eventId === this.formData.eventId
startAgeDate, )
endAgeDate,
isMenWomen,
restrictBoyNum,
restrictGirlNum
} = this.events.find(v => v.eventId === this.formData.eventId)
if (restrictBoyNum > 0) { if (restrictBoyNum > 0) {
if (this.registerList.filter(v => v.sex === "男").length !== restrictBoyNum) { if (this.registerList.filter((v) => v.sex === "男").length !== restrictBoyNum) {
this.$dialog.alert({ this.$dialog
title: "温馨提示", .alert({
message: "男运动员需要报名" + restrictBoyNum + "人才能提交!" title: "温馨提示",
}).then(() => { message: "男运动员需要报名" + restrictBoyNum + "人才能提交!"
})
}) .then(() => {})
return return
} }
} }
if (restrictGirlNum > 0) { if (restrictGirlNum > 0) {
if (this.registerList.filter(v => v.sex === "女").length !== restrictGirlNum) { if (this.registerList.filter((v) => v.sex === "女").length !== restrictGirlNum) {
this.$dialog.alert({ this.$dialog
title: "温馨提示", .alert({
message: "女运动员需要报名" + restrictGirlNum + "人才能提交!" title: "温馨提示",
}).then(() => { message: "女运动员需要报名" + restrictGirlNum + "人才能提交!"
})
}) .then(() => {})
return return
} }
} }
this.addRegisterList = await this.selectRegisterList() this.addRegisterList = await this.selectRegisterList()
let arr = [] let arr = []
if (this.addRegisterList && this.addRegisterList.length > 0) { if (this.addRegisterList && this.addRegisterList.length > 0) {
this.registerList.forEach(r => { this.registerList.forEach((r) => {
const num = this.addRegisterList.filter(a => Number(a.id) === r.id).length const num = this.addRegisterList.filter((a) => Number(a.id) === r.id).length
if (num === this.formData.restrictRegNumber) { if (num === this.formData.restrictRegNumber) {
arr.push(r.userName) arr.push(r.userName)
} }
@@ -610,28 +565,33 @@ layout("/mobile/platform.html"){
} }
if (arr && arr.length > 0) { if (arr && arr.length > 0) {
this.$dialog.alert({ this.$dialog
title: "温馨提示", .alert({
message: "【" + arr.toString() + "】已达到限报数量,您无法添加其组队!" title: "温馨提示",
}).then(() => { message: "【" + arr.toString() + "】已达到限报数量,您无法添加其组队!"
})
}) .then(() => {})
return return
} }
this.$modal.confirm("您确定要提交吗?").then(async () => { this.$modal.confirm("请确保手机号填写正确,您确定要提交吗?").then(async () => {
if (this.formData.teamId) { if (this.formData.teamId) {
this.$set(this.formData, "teamName", this.teams.find(v => v.id === this.formData.teamId).name) this.$set(this.formData, "teamName", this.teams.find((v) => v.id === this.formData.teamId).name)
} }
const userIds = this.registerList.map(v => v.id) const userIds = this.registerList.map((v) => v.id)
const teamUserInfos = this.registerList.map((v) => {
return { userId: v.id, mobile: v.mobile }
})
await $.post("/mobile/activity/Sports/list/doTeamSignUp", { await $.post("/mobile/activity/Sports/list/doTeamSignUp", {
activityId: this.formData.activityId, activityId: this.formData.activityId,
eventId: this.formData.eventId, eventId: this.formData.eventId,
teamId: this.formData.teamId, teamId: this.formData.teamId,
teamName: this.formData.teamName, teamName: this.formData.teamName,
userIds: JSON.stringify(userIds), userIds: JSON.stringify(userIds),
applyUserSign: this.formData.applyUserSign applyUserSign: this.formData.applyUserSign,
teamUserInfos: JSON.stringify(teamUserInfos)
}) })
await this.onRefresh() await this.onRefresh()
this.teamSignUpShow = false this.teamSignUpShow = false
@@ -639,27 +599,26 @@ layout("/mobile/platform.html"){
}) })
}, },
searchUserAdd(item) { searchUserAdd(item) {
const { const { restrictBoyNum, restrictGirlNum } = this.events.find((v) => v.eventId === this.formData.eventId)
restrictBoyNum, const nanRegisterList = this.registerList.filter((v) => v.sex === "男").map((r) => r.sex)
restrictGirlNum const nvRegisterList = this.registerList.filter((v) => v.sex === "女").map((r) => r.sex)
} = this.events.find(v => v.eventId === this.formData.eventId)
const nanRegisterList = this.registerList.filter(v => v.sex === "男").map(r => r.sex)
const nvRegisterList = this.registerList.filter(v => v.sex === "女").map(r => r.sex)
if (restrictBoyNum > 0 && nanRegisterList.length === restrictBoyNum && item.sex === "男") { if (restrictBoyNum > 0 && nanRegisterList.length === restrictBoyNum && item.sex === "男") {
this.$dialog.alert({ this.$dialog
title: "温馨提示", .alert({
message: "男教师报名人数已满" title: "温馨提示",
}).then(() => { message: "男教师报名人数已满"
}) })
.then(() => {})
return return
} }
if (restrictGirlNum > 0 && nvRegisterList.length === restrictGirlNum && item.sex === "女") { if (restrictGirlNum > 0 && nvRegisterList.length === restrictGirlNum && item.sex === "女") {
this.$dialog.alert({ this.$dialog
title: "温馨提示", .alert({
message: "女教师报名人数已满" title: "温馨提示",
}).then(() => { message: "女教师报名人数已满"
}) })
.then(() => {})
return return
} }
@@ -692,14 +651,16 @@ layout("/mobile/platform.html"){
this.$toast.fail("因为是组队报名,自己不能删除") this.$toast.fail("因为是组队报名,自己不能删除")
return return
} }
this.$dialog.confirm({ this.$dialog
title: "提示", .confirm({
message: "您确认要删除吗?" title: "提示",
}).then(() => { message: "您确认要删除吗?"
const index = this.registerList.findIndex(v => v.id === item.id) })
this.registerList.splice(index, 1) .then(() => {
}).catch(() => { const index = this.registerList.findIndex((v) => v.id === item.id)
}) this.registerList.splice(index, 1)
})
.catch(() => {})
}, },
openUserActionSheet() { openUserActionSheet() {
this.searchKey = "" this.searchKey = ""
@@ -708,27 +669,34 @@ layout("/mobile/platform.html"){
this.userActionSheet = true this.userActionSheet = true
}, },
onBeforeClose(action, done) { onBeforeClose(action, done) {
return done(false) return done(false)
}, },
async doActivityConfirm() { async doActivityConfirm() {
if (this.activityData.isSign && !this.formData.applyUserSign) { if (!this.formData.mobile || !this.formData.mobile.match(/^1[3-9]\d{9}$/)) {
this.$dialog.alert({ this.$dialog.alert({
title: "温馨提示", title: "温馨提示",
message: "请签字后再提交!" message: "请正确填写参赛人员联系方式!"
}).then(() => {
}) })
return return
} }
if (this.activityData.isSign && !this.formData.isCy) {
this.$dialog.alert({
title: "温馨提示",
message: "请先阅读自愿参赛责任及风险告知书!"
}).then(() => {
}) if (this.activityData.isSign && !this.formData.applyUserSign) {
this.$dialog
.alert({
title: "温馨提示",
message: "请签字后再提交!"
})
.then(() => {})
return
}
if (this.activityData.isSign && !this.formData.isCy) {
this.$dialog
.alert({
title: "温馨提示",
message: "请先阅读自愿参赛责任及风险告知书!"
})
.then(() => {})
return return
} }
if (this.formData.teamId == null && this.projectType == 2) { if (this.formData.teamId == null && this.projectType == 2) {
@@ -749,10 +717,12 @@ layout("/mobile/platform.html"){
return return
} }
if (this.formData.teamId != null) this.$set(this.formData, "teamName", this.teams.find((v) => v.id == this.formData.teamId).name) if (this.formData.teamId != null) this.$set(this.formData, "teamName", this.teams.find((v) => v.id == this.formData.teamId).name)
await $.post("/mobile/activity/Sports/list/doActivity", this.formData)
await this.onRefresh() this.$modal.confirm("请确保手机号填写正确,您确定要提交吗?").then(async () => {
this.activityDialog = false await $.post("/mobile/activity/Sports/list/doActivity", this.formData)
await this.onRefresh()
this.activityDialog = false
})
} }
}, },
async openActivity(o) { async openActivity(o) {
@@ -810,7 +780,7 @@ layout("/mobile/platform.html"){
userId: "${@shiro.getPrincipalProperty('id')}", userId: "${@shiro.getPrincipalProperty('id')}",
activityId: activityId, activityId: activityId,
eventId: eventId eventId: eventId
}).then(resp => { }).then((resp) => {
if (resp.code === 0) { if (resp.code === 0) {
this.onRefresh() this.onRefresh()
this.teamSignUpShow = false this.teamSignUpShow = false
@@ -823,14 +793,7 @@ layout("/mobile/platform.html"){
return return
} }
const { const { athletesMaxNum, startAgeDate, endAgeDate, isMenWomen, restrictBoyNum, restrictGirlNum } = this.events.find(
athletesMaxNum,
startAgeDate,
endAgeDate,
isMenWomen,
restrictBoyNum,
restrictGirlNum
} = this.events.find(
(v) => v.id === eventId (v) => v.id === eventId
) )
if (isMenWomen) { if (isMenWomen) {
@@ -911,8 +874,6 @@ layout("/mobile/platform.html"){
this.teamSignUpShow = true this.teamSignUpShow = true
return return
} }
} else { } else {
if (isMenWomen != null && isMenWomen == 1 && "${@shiro.getPrincipalProperty('sex')}" != "男") { if (isMenWomen != null && isMenWomen == 1 && "${@shiro.getPrincipalProperty('sex')}" != "男") {
this.$toast("此项目只能男性老师才能报名!") this.$toast("此项目只能男性老师才能报名!")
@@ -1048,7 +1009,7 @@ layout("/mobile/platform.html"){
} }
.van-card-body { .van-card-body {
padding: 0px 10px 0px 10px padding: 0px 10px 0px 10px;
} }
.user-select-sheet { .user-select-sheet {
@@ -18,73 +18,64 @@ layout("/mobile/platform.html"){
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading> <m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar title="活动列表" left-arrow placeholder fixed <van-nav-bar title="活动列表" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
@click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
<div class="search-fixed"> <div class="search-fixed">
<van-dropdown-menu active-color="#1989fa"> <van-dropdown-menu active-color="#1989fa">
<van-dropdown-item v-model="pageForm.year" :options="yearList" <van-dropdown-item v-model="pageForm.year" :options="yearList" @change="getActivityData"></van-dropdown-item>
@change="getActivityData"></van-dropdown-item> <van-dropdown-item v-model="pageForm.isActivity" :options="activityList" @change="getActivityData"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.isActivity" :options="activityList"
@change="getActivityData"></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
</div> </div>
<div style="margin: 60px auto 0 auto"> <div style="margin: 60px auto 0 auto">
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"> <van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''">
<div v-for="o in tableData" class="list-card" <div v-for="o in tableData" class="list-card" @click="openInfo(o)">
@click="openInfo(o)">
<van-cell-group inset> <van-cell-group inset>
<van-cell :border="false" title="活动名称"> <van-cell :border="false" title="活动名称">
<span class="van-ellipsis" style="font-size: 16px" <span class="van-ellipsis" style="font-size: 16px;white-space: normal !important;" :style="{color:themeColor}">{{o.NAME}}</span>
:style="{color:themeColor}">{{o.NAME}}</span>
</van-cell> </van-cell>
<van-cell :border="false" title="活动地址">{{o.address}}</van-cell> <van-cell :border="false" title="活动地址">{{o.address}}</van-cell>
<van-cell :border="false" title="报名开始时间"> <van-cell :border="false" title="报名时间">
{{moment(o.applyStartTime).format('YYYY/MM/DD HH:mm')}} {{moment(o.applyStartTime).format('YYYY/MM/DD HH:mm')}}至{{moment(o.applyEndTime).format('YYYY/MM/DD HH:mm')}}
</van-cell>
<van-cell :border="false" title="报名结束时间">
{{moment(o.applyEndTime).format('YYYY/MM/DD HH:mm')}}
</van-cell> </van-cell>
<!-- <van-cell :border="false" title="报名结束时间">{{moment(o.applyEndTime).format('YYYY/MM/DD HH:mm')}}</van-cell>-->
<!-- <van-cell :border="false" title="活动时间"> <!-- <van-cell :border="false" title="活动时间">
<span style="font-size: 12px"> <span style="font-size: 12px">
{{moment(o.startTime).format('YYYY/MM/DD HH:mm')}} 至 {{moment(o.endTime).format('YYYY/MM/DD HH:mm')}} {{moment(o.startTime).format('YYYY/MM/DD HH:mm')}} 至 {{moment(o.endTime).format('YYYY/MM/DD HH:mm')}}
</span> </span>
</van-cell>--> </van-cell>-->
<van-cell :border="false" title="活动状态"> <van-cell :border="false" title="活动状态">
<van-tag type="warning" <div style="display: flex; justify-content: space-between">
v-if="moment(o.applyStartTime).valueOf() > moment().valueOf()">未开始 <div>
</van-tag> <van-tag type="warning" v-if="moment(o.applyStartTime).valueOf() > moment().valueOf()">未开始</van-tag>
<van-tag <van-tag
type="primary" type="primary"
v-else-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()" v-else-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()"
> >
报名中 报名中
</van-tag> </van-tag>
<van-tag <van-tag
type="success" type="success"
v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()" v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()"
> >
进行中 进行中
</van-tag> </van-tag>
<van-tag type="danger" <van-tag type="danger" v-else-if="moment().valueOf() > moment(o.endTime).valueOf()">活动结束</van-tag>
v-else-if="moment().valueOf() > moment(o.endTime).valueOf()">活动结束 </div>
</van-tag> <van-button type="info" style="width: 90px" plain size="small" round @click="openInfo">查看详情</van-button>
</div>
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
</div> </div>
</van-list> </van-list>
</div> </div>
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" <van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
description="暂无数据"></van-empty>
<van-action-sheet v-model="show" title="活动通知"> <van-action-sheet v-model="show" title="活动通知">
<div v-html="activityInfo.eventNotification" style="padding-bottom: 30px"></div> <div v-html="activityInfo.eventNotification" style="padding: 1px 15px 30px 15px;margin-bottom: 70px"></div>
<van-button type="primary" block @click="openApply" <van-button type="primary" block @click="openApply" style="position: fixed; bottom: 40px">进入报名</van-button>
style="position: fixed; bottom: 0; ">进入报名
</van-button>
</van-action-sheet> </van-action-sheet>
</div> </div>
@@ -133,7 +124,6 @@ layout("/mobile/platform.html"){
openInfo(data) { openInfo(data) {
this.activityInfo = data this.activityInfo = data
this.show = true this.show = true
} }
}, },
async created() { async created() {
+23 -8
View File
@@ -295,6 +295,7 @@ layout("/mobile/platform.html"){
<van-swipe :autoplay="3000" class="swiper"> <van-swipe :autoplay="3000" class="swiper">
<van-swipe-item v-for="(image, index) in images" :key="index"> <van-swipe-item v-for="(image, index) in images" :key="index">
<img :src="image" width="100%" /> <img :src="image" width="100%" />
<!-- <img v-lazy="image" width="100%" />-->
</van-swipe-item> </van-swipe-item>
</van-swipe> </van-swipe>
@@ -441,7 +442,7 @@ layout("/mobile/platform.html"){
<mobile-sign-points></mobile-sign-points> <mobile-sign-points></mobile-sign-points>
</van-popup> </van-popup>
<van-popup v-model="updatePwdShow" class="pwd_popup"> <van-popup v-model="updatePwdShow" class="pwd_popup" :close-on-click-overlay="false" :closeable="!formData.isFirstLogin">
<div class="card modify-password"> <div class="card modify-password">
<div class="card-content"> <div class="card-content">
<h2>{{ formData.isFirstLogin ? '首次登录,请修改密码' : '修改密码' }}</h2> <h2>{{ formData.isFirstLogin ? '首次登录,请修改密码' : '修改密码' }}</h2>
@@ -452,12 +453,12 @@ layout("/mobile/platform.html"){
<span class="toggle-password" data-target="current-password">🔒</span> <span class="toggle-password" data-target="current-password">🔒</span>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="new-password">新密码</label> <label for="new-password">请输入新密码</label>
<input type="password" id="new-password" name="new-password" maxlength="20" v-model="formData.newPwd" @blur="checkPwd" /> <input type="password" id="new-password" name="new-password" maxlength="20" v-model="formData.newPwd" @blur="checkPwd" />
<span class="toggle-password" data-target="new-password">🔒</span> <span class="toggle-password" data-target="new-password">🔒</span>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="confirm-password">确认新密码</label> <label for="confirm-password">请再次输入新密码</label>
<input <input
type="password" type="password"
id="confirm-password" id="confirm-password"
@@ -487,7 +488,7 @@ layout("/mobile/platform.html"){
data() { data() {
return { return {
swipeShow: false, swipeShow: false,
images: ["/assets/mobile/img/home/home1.png", "/assets/mobile/img/home/home2.png", "/assets/mobile/img/home/home3.png"], images: ["/assets/mobile/img/home/home5.png?v=1.0.1", "/assets/mobile/img/home/home2.png?v=1.0.1", "/assets/mobile/img/home/home3.png?v=1.0.1", "/assets/mobile/img/home/home1.png?v=1.0.1"],
qianShow: false, qianShow: false,
msgActive: "unread", msgActive: "unread",
moduleMenus: [], moduleMenus: [],
@@ -531,9 +532,23 @@ layout("/mobile/platform.html"){
if (!this.formData.isFirstLogin && !this.formData.sourcePwd) { if (!this.formData.isFirstLogin && !this.formData.sourcePwd) {
this.$toast("请输入原密码") this.$toast("请输入原密码")
} }
if (!this.formData.newPwd) {
this.$toast("请输入新密码")
return
}
if (!this.formData.confirmPwd) {
this.$toast("请再次输入新密码")
return
}
const resp = await $.post("/mobile/login/updatePwd", this.formData) const resp = await $.post("/mobile/login/updatePwd", this.formData)
if (resp.code === 0) { if (resp.code === 0) {
this.$toast("修改成功") this.$toast("修改成功")
this.formData = {
sourcePwd: "",
newPwd: "",
confirmPwd: ""
}
await this.getWeAppLoginCount()
this.updatePwdShow = false this.updatePwdShow = false
} else { } else {
this.$toast(resp.msg) this.$toast(resp.msg)
@@ -555,8 +570,8 @@ layout("/mobile/platform.html"){
checkConfirmPwd() { checkConfirmPwd() {
// 检验输入是否大于6位数 // 检验输入是否大于6位数
if (!this.formData.confirmPwd) { if (!this.formData.confirmPwd) {
this.errorInfo = "请输入确认新密码" this.errorInfo = "请再次输入新密码"
this.$toast("请输入确认新密码") this.$toast("请再次输入新密码")
return return
} }
if (this.formData.confirmPwd.length < 6) { if (this.formData.confirmPwd.length < 6) {
@@ -565,8 +580,8 @@ layout("/mobile/platform.html"){
return return
} }
if (this.formData.newPwd !== this.formData.confirmPwd) { if (this.formData.newPwd !== this.formData.confirmPwd) {
this.errorInfo = "新密码与确认新密码不一致" this.errorInfo = "新密码与再次输入新密码不一致"
this.$toast("新密码与确认新密码不一致") this.$toast("新密码与再次输入新密码不一致")
return return
} }
this.errorInfo = "" this.errorInfo = ""
File diff suppressed because one or more lines are too long
@@ -4,7 +4,6 @@ layout("/layouts/platform.html"){
<style> <style>
.query-row { .query-row {
} }
.query-title { .query-title {
@@ -14,16 +13,12 @@ layout("/layouts/platform.html"){
} }
.query-content { .query-content {
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<guava> <guava>
<user-data-scope <user-data-scope ref="userDataScope" :group_id.sync="formData.activityGroupId"></user-data-scope>
ref="userDataScope"
:group_id.sync="formData.activityGroupId"
></user-data-scope>
</guava> </guava>
<!--<guava> <!--<guava>
<el-card shadow="never"> <el-card shadow="never">
@@ -179,19 +174,19 @@ layout("/layouts/platform.html"){
<script> <script>
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [initTableMixins], mixins: [initTableMixins],
components: { components: {
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'), "dict-select": httpVueLoader("/components/plugins/DictSelect.vue?v=1.0.0"),
'user-data-scope': httpVueLoader('/components/plugins/UserDataScope.vue'), "user-data-scope": httpVueLoader("/components/plugins/UserDataScope.vue")
}, },
computed: { computed: {
currentGroupName() { currentGroupName() {
if (this.pageForm.groupId) { if (this.pageForm.groupId) {
const group = this.activityGroupList.find(v => v.groupId === this.pageForm.groupId) const group = this.activityGroupList.find((v) => v.groupId === this.pageForm.groupId)
return group.groupName + '人员' return group.groupName + "人员"
} }
return '全部人员' return "全部人员"
} }
}, },
data() { data() {
@@ -208,33 +203,33 @@ layout("/layouts/platform.html"){
personTypes: [], personTypes: [],
userStates: [], userStates: [],
memberStatus: [], memberStatus: [],
year: moment().format('YYYY') year: moment().format("YYYY")
}, },
tableColumns: [ tableColumns: [
{prop: 'loginName', label: '工号'}, { prop: "loginName", label: "工号" },
{prop: 'userName', label: '姓名'}, { prop: "userName", label: "姓名" },
{prop: 'sex', label: '性别'}, { prop: "sex", label: "性别" },
{prop: 'birthday', label: '出生年月'}, { prop: "birthday", label: "出生年月" },
{prop: 'mobile', label: '联系电话'}, { prop: "mobile", label: "联系电话" },
{prop: 'personType', label: '人员类型', sortable: true}, { prop: "personType", label: "人员类型", sortable: true },
{prop: 'userState', label: '在职状态', sortable: true}, { prop: "userState", label: "在职状态", sortable: true },
{prop: 'unitName', label: '所属单位', sortable: true}, { prop: "unitName", label: "所属单位", sortable: true },
{prop: 'unionName', label: '所属工会', sortable: true}, { prop: "unionName", label: "所属工会", sortable: true },
{prop: 'activityUnionName', label: '活动工会', sortable: true}, { prop: "activityUnionName", label: "活动工会", sortable: true },
{prop: 'groupName', label: '所属分组', sortable: true}, { prop: "groupName", label: "所属分组", sortable: true }
], ]
} }
}, },
methods: { methods: {
async doDelete(id, groupId) { async doDelete(id, groupId) {
const confirm = await this.$confirm('您确定要删除吗?', '提示', { const confirm = await this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning"
}) })
if (confirm === 'confirm') { if (confirm === "confirm") {
this.pageForm.id = id this.pageForm.id = id
const resp = await $.post(loc() + '/doDelete', this.pageForm) const resp = await $.post(loc() + "/doDelete", this.pageForm)
if (resp.code === 0) { if (resp.code === 0) {
this.notifySuccess(resp.msg) this.notifySuccess(resp.msg)
this.doSearch() this.doSearch()
@@ -243,7 +238,10 @@ layout("/layouts/platform.html"){
}, },
async flushUnits() { async flushUnits() {
this.$set(this.pageForm, "unitId", "") this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') { if (
"${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')||@shiro.hasRole('SCHOOL_UNION_SPORTS_ADMIN')}" ===
"true"
) {
this.units = await getUnits(this.pageForm.unionId) this.units = await getUnits(this.pageForm.unionId)
this.ActivityUnits = await getActivityUnits(this.pageForm.activityUnionId) this.ActivityUnits = await getActivityUnits(this.pageForm.activityUnionId)
} else { } else {
@@ -252,7 +250,7 @@ layout("/layouts/platform.html"){
this.doSearch() this.doSearch()
}, },
async getActivityGroup() { async getActivityGroup() {
const resp = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup') const resp = await $.get("/platform/activity/basic/scope/getActivityUserScopeGroup")
this.activityGroupList = resp.data this.activityGroupList = resp.data
if (resp.data && resp.data.length > 0) { if (resp.data && resp.data.length > 0) {
this.$set(this.pageForm, "groupId", resp.data[0].groupId) this.$set(this.pageForm, "groupId", resp.data[0].groupId)
@@ -265,7 +263,6 @@ layout("/layouts/platform.html"){
this.unions = await getUnions(null) this.unions = await getUnions(null)
this.ActivityUnions = await getActivityUnions() this.ActivityUnions = await getActivityUnions()
this.flushUnits() this.flushUnits()
} }
}) })
</script> </script>
@@ -142,6 +142,26 @@ layout("/layouts/platform.html"){
padding-top: 0; padding-top: 0;
} }
.el-table .yellow-row {
background: rgba(255, 255, 0, 0.10);
}
.el-table .blue-row {
background: rgba(0, 0, 255, 0.10);
}
.el-table .green-row {
background: rgba(0, 128, 0, 0.10);
}
.el-table .red-row {
background: rgba(255, 0, 0, 0.10);
}
.el-table .purple-row {
background: rgba(128, 0, 128, 0.19);
}
</style> </style>
<div class="platform" id="app" v-cloak> <div class="platform" id="app" v-cloak>
@@ -235,12 +255,19 @@ layout("/layouts/platform.html"){
.format('YYYY/MM/DD HH:mm')}} 至 .format('YYYY/MM/DD HH:mm')}} 至
{{moment(item.applyEndTime).format('YYYY/MM/DD HH:mm')}} {{moment(item.applyEndTime).format('YYYY/MM/DD HH:mm')}}
</div> </div>
<div class="text item" v-if="item.isSign"> <div class="text item" v-if="item.isSign" style="display: flex;justify-content: space-around;">
<div style="display: flex;justify-content: flex-end"> <div>
<el-button @click.stop="doExport"
size="mini"
type="primary">
下载风险告知书(签名)
</el-button>
</div>
<div>
<el-button @click.stop="openPromiseBook(item)" <el-button @click.stop="openPromiseBook(item)"
size="mini" size="mini"
type="primary"> type="primary">
上传风险告知书 上传风险告知书(盖章)
</el-button> </el-button>
</div> </div>
<!-- <span style="color: gray">活动时间:</span> <!-- <span style="color: gray">活动时间:</span>
@@ -343,14 +370,15 @@ layout("/layouts/platform.html"){
</template> </template>
<template scope="{row}" v-else-if="column.prop=='applyNum'"> <template scope="{row}" v-else-if="column.prop=='applyNum'">
<span v-if="row.successUserApply>0&&row.applyType !== 3"> {{ row.totalApplyNum }}
{{row.successUserApply}}人</span> <!-- <span v-if="row.successUserApply>0&&row.applyType !== 3">-->
<span <!-- {{row.successUserApply}}人</span>-->
v-else-if="JSON.parse(row.applyWay).length===2&&row.applyWay.includes(1)"> <!-- <span-->
{{row.totalApplyNum}}人</span> <!-- v-else-if="JSON.parse(row.applyWay).length===2&&row.applyWay.includes(1)">-->
<span v-else-if="row.totalApplyNum>0&&row.applyType === 3"> <!-- {{row.totalApplyNum}}人</span>-->
{{ row.totalApplyNum }}人</span> <!-- <span v-else-if="row.totalApplyNum>0&&row.applyType === 3">-->
<span v-else>0人</span> <!-- {{ row.totalApplyNum }}人</span>-->
<!-- <span v-else>0人</span>-->
</template> </template>
@@ -741,6 +769,10 @@ layout("/layouts/platform.html"){
<template #public> <template #public>
<vi-title2 title="批量审核"> <vi-title2 title="批量审核">
<template #func> <template #func>
<el-radio-group v-model="activityIsAudit" @change="openAuditApplyUser(null)" size="small" style="margin-right: 10px">
<el-radio-button label="true">已审核</el-radio-button>
<el-radio-button label="false">未审核</el-radio-button>
</el-radio-group>
<el-button <el-button
icon="el-icon-check" icon="el-icon-check"
type="primary" type="primary"
@@ -762,7 +794,7 @@ layout("/layouts/platform.html"){
type="primary" type="primary"
size="small" size="small"
@click="doExport" @click="doExport"
>下载风险告知书 >下载风险告知书(签名)
</el-button> </el-button>
</template> </template>
</vi-title2> </vi-title2>
@@ -774,6 +806,7 @@ layout("/layouts/platform.html"){
row-key="id" row-key="id"
:size="tableSize" :size="tableSize"
class="vi-table" class="vi-table"
:row-class-name="tableRowClassName"
@selection-change="dshHandleSelectionChange" @selection-change="dshHandleSelectionChange"
> >
<el-table-column <el-table-column
@@ -807,6 +840,14 @@ layout("/layouts/platform.html"){
label="性别" label="性别"
> >
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" prop="mobile" label="联系方式"></el-table-column>
<el-table-column
align="center"
header-align="center"
prop="applyUserName"
label="报名人"
>
</el-table-column>
<el-table-column align="center" header-align="center" prop="identity" label="身份"> <el-table-column align="center" header-align="center" prop="identity" label="身份">
<template scope="{row}"> <template scope="{row}">
<el-tag v-if="row.identity.includes('1')" effect="dark">运动员</el-tag> <el-tag v-if="row.identity.includes('1')" effect="dark">运动员</el-tag>
@@ -825,13 +866,6 @@ layout("/layouts/platform.html"){
<el-tag v-if="row.identity.includes('7')">工作人员</el-tag> <el-tag v-if="row.identity.includes('7')">工作人员</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
align="center"
header-align="center"
prop="applyUserName"
label="报名人"
>
</el-table-column>
<el-table-column <el-table-column
align="center" align="center"
header-align="center" header-align="center"
@@ -854,8 +888,8 @@ layout("/layouts/platform.html"){
<el-image <el-image
:src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + row.applyUserSign" :src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + row.applyUserSign"
fit="cover" fit="cover"
style="width: 100%; height: 100%;" v-if="row.applyUserSign"></el-image> style="height: 60px" v-if="row.applyUserSign"></el-image>
<span v-else>暂未签字</span> <el-tag type="warning" v-else>暂未签字</el-tag>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -1158,6 +1192,8 @@ layout("/layouts/platform.html"){
</div> </div>
<script> <script>
// 颜色数组
const colors = ["yellow-row", "blue-row", "green-row", "red-row", "purple-row"];
//分组 //分组
const groupBy = (list, fn) => { const groupBy = (list, fn) => {
const groups = {} const groups = {}
@@ -1281,7 +1317,10 @@ layout("/layouts/platform.html"){
promiseBookFileList: [], promiseBookFileList: [],
isPromiseBookFileView: true, isPromiseBookFileView: true,
promiseBookDialogVisible: false promiseBookDialogVisible: false,
// 活动审核相关
activityIsAudit: false
} }
}, },
filters: { filters: {
@@ -1297,6 +1336,10 @@ layout("/layouts/platform.html"){
"delete_info": httpVueLoader("/components/activity/school/DeleteInfo.vue") "delete_info": httpVueLoader("/components/activity/school/DeleteInfo.vue")
}, },
methods: { methods: {
tableRowClassName({ row }) {
debugger
return row.color;
},
doExport(){ doExport(){
window.open("/platform/activity/apply/doExport?activityId=" + this.activityData2.id) window.open("/platform/activity/apply/doExport?activityId=" + this.activityData2.id)
}, },
@@ -1363,12 +1406,30 @@ layout("/layouts/platform.html"){
this.dshSelectionIds = val.map(v => v.id) this.dshSelectionIds = val.map(v => v.id)
}, },
async openAuditApplyUser(data) { async openAuditApplyUser(data) {
this.eventData = data if (data) {
this.eventData = data
}
const resp = await $.get("/platform/activity/apply/dshApplyUserList", { const resp = await $.get("/platform/activity/apply/dshApplyUserList", {
activityId: data.activityId, activityId: this.eventData.activityId,
eventId: data.eventId eventId: this.eventData.eventId,
activityIsAudit: this.activityIsAudit
}) })
if (resp.code === 0) { if (resp.code === 0) {
let colorIndex = 0; // 当前颜色索引
// 为每个item设置type和color
resp.data.forEach((item, index) => {
// 如果是第一个元素,或者当前applyUserName与前一个不同
if (index === 0 || item.applyUserName !== resp.data[index - 1].applyUserName) {
// 分配颜色
item.color = colors[colorIndex % colors.length];
colorIndex++;
} else {
// 如果当前applyUserName与前一个相同,使用相同的颜色
item.color = resp.data[index - 1].color;
}
});
this.dshApplyUserList = resp.data this.dshApplyUserList = resp.data
this.$refs.guava.public() this.$refs.guava.public()
} }
@@ -2438,6 +2499,9 @@ layout("/layouts/platform.html"){
const resp = await $.post(loc() + "/activityData", this.pageForm) const resp = await $.post(loc() + "/activityData", this.pageForm)
if (resp.code === 0) { if (resp.code === 0) {
this.activityList = resp.data this.activityList = resp.data
if (this.activityList) {
await this.openApply(this.activityList[0])
}
} else { } else {
this.notifyWarning(resp.msg) this.notifyWarning(resp.msg)
} }
@@ -55,8 +55,7 @@ layout("/layouts/platform.html"){
style="width: 100%" style="width: 100%"
@change="changeLevel" @change="changeLevel"
> >
<el-option v-for="item in activityTypeList" :key="item.code" <el-option v-for="item in activityTypeList" :key="item.code" :label="item.name" :value="item.code"></el-option>
:label="item.name" :value="item.code"></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
@@ -69,18 +68,13 @@ layout("/layouts/platform.html"){
placeholder="请选择活动" placeholder="请选择活动"
@change="getData()" @change="getData()"
> >
<el-option v-for="item in activities" :label="item.name" <el-option v-for="item in activities" :label="item.name" :value="item.id"></el-option>
:value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
<div class="search-item"> <div class="search-item">
<div class="search-item-label" v-if="pageForm.activityLevel!=='40003'"> <div class="search-item-label" v-if="pageForm.activityLevel!=='40003'">基层工会</div>
基层工会 <div class="search-item-label" v-if="pageForm.activityLevel==='40003'">协会名称</div>
</div>
<div class="search-item-label" v-if="pageForm.activityLevel==='40003'">
协会名称
</div>
<div class="search-item-option"> <div class="search-item-option">
<el-select <el-select
style="width: 100%; font-weight: bold" style="width: 100%; font-weight: bold"
@@ -91,8 +85,7 @@ layout("/layouts/platform.html"){
@change="changeVVV" @change="changeVVV"
@clear="changeVVV" @clear="changeVVV"
> >
<el-option v-for="item in unions" :key="item.id" <el-option v-for="item in unions" :key="item.id" :label="item.unionname" :value="item.id"></el-option>
:label="item.unionname" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
@@ -102,10 +95,8 @@ layout("/layouts/platform.html"){
<div class="search-item-label">报名状态</div> <div class="search-item-label">报名状态</div>
<div class="search-item-option"> <div class="search-item-option">
<el-radio-group v-model="pageForm.applyed"> <el-radio-group v-model="pageForm.applyed">
<el-radio style="background-color: white" label="1" border>未报名 <el-radio style="background-color: white" label="1" border>未报名</el-radio>
</el-radio> <el-radio style="background-color: white" label="2" border>已报名</el-radio>
<el-radio style="background-color: white" label="2" border>已报名
</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
</div> </div>
@@ -129,48 +120,41 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt10 d" style="padding: 20px"> <el-card shadow="never" class="mt10 d" style="padding: 20px">
<el-row :gutter="20" class="el-row-title" style="margin-left: 0; margin-right: 0"> <el-row :gutter="20" class="el-row-title" style="margin-left: 0; margin-right: 0">
<el-col :span="2">序号</el-col> <el-col :span="2">序号</el-col>
<el-col :span="4">年度</el-col> <el-col :span="2">年度</el-col>
<el-col :span="6"> <el-col :span="6">
<span v-if="pageForm.activityLevel!=='40003'">基层工会名称</span> <span v-if="pageForm.activityLevel!=='40003'">基层工会名称</span>
<span v-if="pageForm.activityLevel==='40003'">协会名称</span> <span v-if="pageForm.activityLevel==='40003'">协会名称</span>
</el-col> </el-col>
<el-col :span="6">活动名称</el-col> <el-col :span="6">活动名称</el-col>
<el-col :span="4">人数</el-col> <el-col :span="4">人数</el-col>
<el-col :span="2"> <el-col :span="4">
<!-- <el-button style="position: absolute;right: 0px" plain size="small" icon="el-icon-printer" <!-- <el-button style="position: absolute;right: 0px" plain size="small" icon="el-icon-printer"
type="primary" @click="doExport">导 出 type="primary" @click="doExport">导 出
</el-button>--> </el-button>-->
</el-col> </el-col>
</el-row> </el-row>
<el-table :data="[]" size="mini" v-if="noneData||tabLoading" <el-table :data="[]" size="mini" v-if="noneData||tabLoading" v-loading="tabLoading"></el-table>
v-loading="tabLoading"></el-table>
<el-card v-else class="box-card mb10" v-for="app,tabIdx in apply" shadow="hover" <el-card v-else class="box-card mb10" v-for="app,tabIdx in apply" shadow="hover" v-loading="tabLoading">
v-loading="tabLoading">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="2">{{tabIdx + 1}}</el-col> <el-col :span="2">{{tabIdx + 1}}</el-col>
<el-col :span="2">{{pageForm.year}}</el-col> <el-col :span="2">{{pageForm.year}}</el-col>
<el-col :span="6"> <el-col :span="6">{{isDisPlayCode?'('+app.unioncode+')':null}}{{app.unionname}}</el-col>
{{isDisPlayCode?'('+app.unioncode+')':null}}{{app.unionname}}
</el-col>
<el-col :span="6">{{pageForm.activityName || '暂无'}}</el-col> <el-col :span="6">{{pageForm.activityName || '暂无'}}</el-col>
<el-col :span="4">{{app.num |money}} 人({{(app.promiseBookFiles&&app.promiseBookFiles.length>0)?'已上传承诺书':'未上传'}})</el-col>
<el-col :span="4"> <el-col :span="4">
<el-button @click="openPromiseBook(app)" {{app.num |money}} 人({{(app.promiseBookFiles&&app.promiseBookFiles.length>0)?'已上传风险告知书':'未上传'}})
style="float: right; padding: 3px 5px" </el-col>
type="text">查看承诺书 <el-col :span="4">
</el-button> <el-button @click="openPromiseBook(app)" style="float: right; padding: 3px 5px" type="text">查看风险告知书</el-button>
<el-button style="float: right; padding: 3px 5px" <el-button style="float: right; padding: 3px 5px" @click="$set(app,'show',!app.show)" type="text">
@click="$set(app,'show',!app.show)" type="text">
{{app.show?'折叠':'展开'}} {{app.show?'折叠':'展开'}}
</el-button> </el-button>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<transition name="el-fade-in-linear"> <transition name="el-fade-in-linear">
<div v-show="app.show" class="text item transition-box" <div v-show="app.show" class="text item transition-box" style="padding: 20px 20px">
style="padding: 20px 20px">
<el-timeline v-if="pageForm.applyType===1||pageForm.applyType===3"> <el-timeline v-if="pageForm.applyType===1||pageForm.applyType===3">
<!-- <el-timeline-item timestamp="领队信息" placement="top" v-if="app.leader.username!=null"> <!-- <el-timeline-item timestamp="领队信息" placement="top" v-if="app.leader.username!=null">
<el-card shadow="never"> <el-card shadow="never">
@@ -244,8 +228,7 @@ layout("/layouts/platform.html"){
</el-timeline-item>--> </el-timeline-item>-->
<el-timeline-item timestamp="运动员信息" placement="top"> <el-timeline-item timestamp="运动员信息" placement="top">
<el-table border stripe :data="app.apply2" size="mini" <el-table border stripe :data="app.apply2" size="mini" :key="tableKey">
:key="tableKey">
<el-table-column <el-table-column
type="index" type="index"
label="序号" label="序号"
@@ -268,8 +251,7 @@ layout("/layouts/platform.html"){
<span v-if="row.team">{{ row.team }}</span> <span v-if="row.team">{{ row.team }}</span>
<span v-if="!row.team">暂无</span> <span v-if="!row.team">暂无</span>
</template> </template>
<template scope="{row:{projectType}}" <template scope="{row:{projectType}}" v-else-if="column.prop=='projectType'">
v-else-if="column.prop=='projectType'">
{{projectType==1?'单项':'团体'}} {{projectType==1?'单项':'团体'}}
</template> </template>
@@ -279,23 +261,12 @@ layout("/layouts/platform.html"){
<span v-else class="text-danger">否</span> <span v-else class="text-danger">否</span>
</template>--> </template>-->
<template scope="{row}" <template scope="{row}" v-else-if="column.prop=='identity'">
v-else-if="column.prop=='identity'"> <el-tag v-if="row.identity.includes(1)" effect="light">运动员</el-tag>
<el-tag v-if="row.identity.includes(1)" <el-tag v-if="row.identity.includes(2)" type="success" effect="light">教练</el-tag>
effect="light">运动员 <el-tag v-if="row.identity.includes(3)" type="warning" effect="light">领队</el-tag>
</el-tag> <el-tag v-if="row.identity.includes(4)" type="warning" effect="light">处级领导</el-tag>
<el-tag v-if="row.identity.includes(2)" <el-tag v-if="row.identity.includes(5)" type="warning" effect="light">替补</el-tag>
type="success" effect="light">教练
</el-tag>
<el-tag v-if="row.identity.includes(3)"
type="warning" effect="light">领队
</el-tag>
<el-tag v-if="row.identity.includes(4)"
type="warning" effect="light">处级领导
</el-tag>
<el-tag v-if="row.identity.includes(5)"
type="warning" effect="light">替补
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -303,141 +274,93 @@ layout("/layouts/platform.html"){
</el-timeline> </el-timeline>
<el-timeline v-else-if="pageForm.applyType===2"> <el-timeline v-else-if="pageForm.applyType===2">
<el-timeline-item timestamp="领队信息" placement="top" <el-timeline-item timestamp="领队信息" placement="top" v-if="app.leader.username!=null">
v-if="app.leader.username!=null">
<el-card shadow="never"> <el-card shadow="never">
<el-form label-suffix=":" label-position="right" <el-form label-suffix=":" label-position="right" label-width="80px" style="margin-top: 30px">
label-width="80px" style="margin-top: 30px">
<el-row gutter="20"> <el-row gutter="20">
<el-col :span="4"> <el-col :span="4">
<el-form-item label="姓名">{{ <el-form-item label="姓名">{{ app.leader.username | str }}</el-form-item>
app.leader.username | str }}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="性别">{{ app.leader.sex | <el-form-item label="性别">{{ app.leader.sex | str }}</el-form-item>
str }}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="工号">{{ <el-form-item label="工号">{{ app.leader.loginname | str }}</el-form-item>
app.leader.loginname | str }}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="电话">{{ app.leader.mobile <el-form-item label="电话">{{ app.leader.mobile | str }}</el-form-item>
| str }}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="单位">{{ <el-form-item label="单位">{{ app.leader.unitname | str }}</el-form-item>
app.leader.unitname | str }}
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</el-card> </el-card>
</el-timeline-item> </el-timeline-item>
<el-timeline-item timestamp="教练信息" placement="top" <el-timeline-item timestamp="教练信息" placement="top" v-if="app.coach.username!=null">
v-if="app.coach.username!=null">
<el-card shadow="never"> <el-card shadow="never">
<el-form label-suffix=":" label-position="right" <el-form label-suffix=":" label-position="right" label-width="80px" style="margin-top: 30px">
label-width="80px" style="margin-top: 30px">
<el-row gutter="20"> <el-row gutter="20">
<el-col :span="4"> <el-col :span="4">
<el-form-item label="姓名">{{ app.coach.username <el-form-item label="姓名">{{ app.coach.username | str }}</el-form-item>
| str }}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="性别">{{ app.coach.sex | <el-form-item label="性别">{{ app.coach.sex | str }}</el-form-item>
str }}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="工号">{{ <el-form-item label="工号">{{ app.coach.loginname | str }}</el-form-item>
app.coach.loginname | str }}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="电话">{{ app.coach.mobile | <el-form-item label="电话">{{ app.coach.mobile | str }}</el-form-item>
str }}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="单位">{{ app.coach.unitname <el-form-item label="单位">{{ app.coach.unitname | str }}</el-form-item>
| str }}
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</el-card> </el-card>
</el-timeline-item> </el-timeline-item>
<el-timeline-item timestamp="团长信息" placement="top" <el-timeline-item timestamp="团长信息" placement="top" v-if="app.head.username!=null">
v-if="app.head.username!=null">
<el-card shadow="never"> <el-card shadow="never">
<el-form label-suffix=":" label-position="right" <el-form label-suffix=":" label-position="right" label-width="80px" style="margin-top: 30px">
label-width="80px" style="margin-top: 30px">
<el-row gutter="20"> <el-row gutter="20">
<el-col :span="4"> <el-col :span="4">
<el-form-item label="姓名">{{ app.head.username <el-form-item label="姓名">{{ app.head.username | str }}</el-form-item>
| str }}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="性别">{{ app.head.sex | str <el-form-item label="性别">{{ app.head.sex | str }}</el-form-item>
}}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="工号">{{ app.head.loginname <el-form-item label="工号">{{ app.head.loginname | str }}</el-form-item>
| str }}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="电话">{{ app.head.mobile | <el-form-item label="电话">{{ app.head.mobile | str }}</el-form-item>
str }}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="单位">{{ app.head.unitname <el-form-item label="单位">{{ app.head.unitname | str }}</el-form-item>
| str }}
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
</el-card> </el-card>
</el-timeline-item> </el-timeline-item>
<el-timeline-item timestamp="工作人员信息" placement="top" <el-timeline-item timestamp="工作人员信息" placement="top" v-if="app.staff.username!=null">
v-if="app.staff.username!=null">
<el-card shadow="never"> <el-card shadow="never">
<el-form label-suffix=":" label-position="right" <el-form label-suffix=":" label-position="right" label-width="80px" style="margin-top: 30px">
label-width="80px" style="margin-top: 30px">
<el-row gutter="20"> <el-row gutter="20">
<el-col :span="4"> <el-col :span="4">
<el-form-item label="姓名">{{ app.staff.username <el-form-item label="姓名">{{ app.staff.username | str }}</el-form-item>
| str }}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="性别">{{ app.staff.sex | <el-form-item label="性别">{{ app.staff.sex | str }}</el-form-item>
str }}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="工号">{{ <el-form-item label="工号">{{ app.staff.loginname | str }}</el-form-item>
app.staff.loginname | str }}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="电话">{{ app.staff.mobile | <el-form-item label="电话">{{ app.staff.mobile | str }}</el-form-item>
str }}
</el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="单位">{{ app.staff.unitname <el-form-item label="单位">{{ app.staff.unitname | str }}</el-form-item>
| str }}
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@@ -491,8 +414,7 @@ layout("/layouts/platform.html"){
</el-col> </el-col>
</el-row> </el-row>
<el-table border stripe :data="app.apply2" size="mini" <el-table border stripe :data="app.apply2" size="mini" :key="tableKey">
:key="tableKey">
<el-table-column <el-table-column
type="index" type="index"
label="序号" label="序号"
@@ -523,28 +445,16 @@ layout("/layouts/platform.html"){
<span v-else class="text-danger">否</span> <span v-else class="text-danger">否</span>
</template>--> </template>-->
<template scope="{row:{projectType}}" <template scope="{row:{projectType}}" v-else-if="column.prop=='projectType'">
v-else-if="column.prop=='projectType'">
{{projectType==1?'单项':'团体'}} {{projectType==1?'单项':'团体'}}
</template> </template>
<template scope="{row}" <template scope="{row}" v-else-if="column.prop=='identity'">
v-else-if="column.prop=='identity'"> <el-tag v-if="row.identity.includes(1)" effect="light">运动员</el-tag>
<el-tag v-if="row.identity.includes(1)" <el-tag v-if="row.identity.includes(2)" type="success" effect="light">教练</el-tag>
effect="light">运动员 <el-tag v-if="row.identity.includes(3)" type="warning" effect="light">领队</el-tag>
</el-tag> <el-tag v-if="row.identity.includes(4)" type="warning" effect="light">处级领导</el-tag>
<el-tag v-if="row.identity.includes(2)" <el-tag v-if="row.identity.includes(5)" type="warning" effect="light">替补</el-tag>
type="success" effect="light">教练
</el-tag>
<el-tag v-if="row.identity.includes(3)"
type="warning" effect="light">领队
</el-tag>
<el-tag v-if="row.identity.includes(4)"
type="warning" effect="light">处级领导
</el-tag>
<el-tag v-if="row.identity.includes(5)"
type="warning" effect="light">替补
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -587,9 +497,7 @@ layout("/layouts/platform.html"){
name="file" name="file"
ref="upload" ref="upload"
> >
<el-button icon="el-icon-upload" size="medium" style="width: 200px" type=""> <el-button icon="el-icon-upload" size="medium" style="width: 200px" type="">选择文件</el-button>
选择文件
</el-button>
</el-upload> </el-upload>
</el-card> </el-card>
</el-timeline-item> </el-timeline-item>
@@ -601,18 +509,9 @@ layout("/layouts/platform.html"){
</span> </span>
</el-dialog> </el-dialog>
<el-dialog <el-dialog :append-to-body="false" :close-on-click-modal="false" :visible.sync="promiseBookDialogVisible" title="参赛风险告知书" width="30%">
:append-to-body="false" <file-upload :files="promiseBookFileList" view v-if="promiseBookFileList&&promiseBookFileList.length>0"></file-upload>
:close-on-click-modal="false" <span v-if="promiseBookFileList&&promiseBookFileList.length===0">暂无风险告知书</span>
:visible.sync="promiseBookDialogVisible"
title="参赛承诺书"
width="30%"
>
<file-upload :files="promiseBookFileList" view v-if="promiseBookFileList&&promiseBookFileList.length>0">
</file-upload>
<span v-if="promiseBookFileList&&promiseBookFileList.length===0">
暂无承诺书
</span>
<span class="dialog-footer" slot="footer"> <span class="dialog-footer" slot="footer">
<el-button @click="promiseBookDialogVisible = false" type="primary">关 闭</el-button> <el-button @click="promiseBookDialogVisible = false" type="primary">关 闭</el-button>
</span> </span>
@@ -669,7 +568,7 @@ layout("/layouts/platform.html"){
fileVisible: false, fileVisible: false,
promiseBookFileList: [], promiseBookFileList: [],
promiseBookDialogVisible: false, promiseBookDialogVisible: false
} }
}, },
components: { components: {
@@ -2,7 +2,7 @@
layout("/layouts/platform.html"){ layout("/layouts/platform.html"){
#--> #-->
<link rel="stylesheet" href="${base!}/assets/platform/plugins/jqFullCalendar/css/fullcalendar.css"> <link rel="stylesheet" href="${base!}/assets/platform/plugins/jqFullCalendar/css/fullcalendar.css" />
<script src="${base!}/assets/platform/plugins/jqFullCalendar/js/fullcalendar.min.js"></script> <script src="${base!}/assets/platform/plugins/jqFullCalendar/js/fullcalendar.min.js"></script>
<script src="${base!}/assets/platform/plugins/jqFullCalendar/js/moment.min.js"></script> <script src="${base!}/assets/platform/plugins/jqFullCalendar/js/moment.min.js"></script>
@@ -25,9 +25,7 @@ layout("/layouts/platform.html"){
} }
.other { .other {
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
@@ -39,24 +37,26 @@ layout("/layouts/platform.html"){
<div class="search-item-label">月份:</div> <div class="search-item-label">月份:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-date-picker <el-date-picker
style="width: 100%" style="width: 100%"
@change="doSearch" @change="doSearch"
v-model="pageForm.time" v-model="pageForm.time"
placeholder="请选择月份" placeholder="请选择月份"
type="month" type="month"
value-format="yyyy-MM"> value-format="yyyy-MM"
</el-date-picker> ></el-date-picker>
</div> </div>
</div> </div>
<div class="search-item"> <div class="search-item">
<div class="search-item-label">姓名工号:</div> <div class="search-item-label">姓名工号:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword" <el-input
style="width: 100%" placeholder="请输入内容"
@keyup.enter.native="doSearch"> clearable
<el-select v-model="pageForm.searchName" slot="prepend" v-model="pageForm.searchKeyword"
placeholder="查询类型" style="width: 100%"
style="width: 80px;"> @keyup.enter.native="doSearch"
>
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型" style="width: 80px">
<el-option label="姓名" value="u.username"></el-option> <el-option label="姓名" value="u.username"></el-option>
<el-option label="工号" value="u.loginname"></el-option> <el-option label="工号" value="u.loginname"></el-option>
</el-select> </el-select>
@@ -67,11 +67,14 @@ layout("/layouts/platform.html"){
<div class="search-item"> <div class="search-item">
<div class="search-item-label">场地名称:</div> <div class="search-item-label">场地名称:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable clearable <el-input
placeholder="请输入场地名称" @keyup.enter.native="doSearch"
style="width: 100%" clearable
v-model="pageForm.siteName"> clearable
</el-input> placeholder="请输入场地名称"
style="width: 100%"
v-model="pageForm.siteName"
></el-input>
</div> </div>
</div> </div>
@@ -94,8 +97,7 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt20"> <el-card shadow="never" class="mt20">
<vi-title2 title="预约列表"> <vi-title2 title="预约列表">
<template #func> <template #func>
<el-button size="small" type="primary" class="el-icon-date" @click="openCalendar">预约日历 <el-button size="small" type="primary" class="el-icon-date" @click="openCalendar">预约日历</el-button>
</el-button>
<el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isRetire"> <el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isRetire">
<el-radio-button label="">全部</el-radio-button> <el-radio-button label="">全部</el-radio-button>
<el-radio-button label="1">离退休</el-radio-button> <el-radio-button label="1">离退休</el-radio-button>
@@ -103,31 +105,32 @@ layout("/layouts/platform.html"){
</el-radio-group> </el-radio-group>
</template> </template>
</vi-title2> </vi-title2>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" <el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" align="center" header-align="center">
align="center"
header-align="center">
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
width="80px"></el-table-column>
<el-table-column <el-table-column
:label="column.label" :index="indexMethod"
:prop="column.prop" align="center"
:sortable="column.sortable" header-align="center"
align="center" label="序号"
header-align="center" type="index"
show-overflow-tooltip width="80px"
v-for="column in tableColumns" ></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
> >
<template scope="{row}" v-if="column.prop==='state_name'"> <template scope="{row}" v-if="column.prop==='state_name'">
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>--> <!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
<span v-if="[0].includes(row.stateaudittype)" <span v-if="[0].includes(row.stateaudittype)" style="color: #e6a23c">{{row.state_name}}</span>
style="color: #e6a23c">{{row.state_name}}</span>
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span> <span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span> <span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" <el-table-column align="center" header-align="center" label="操作" fixed="right" width="200px">
width="200px">
<template scope="{row}"> <template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button> <el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
</template> </template>
@@ -148,9 +151,7 @@ layout("/layouts/platform.html"){
<el-dialog title="预约详情" :visible.sync="siteInfoDialog" width="60%"> <el-dialog title="预约详情" :visible.sync="siteInfoDialog" width="60%">
<reserve-info ref="reserveDialogInfo"></reserve-info> <reserve-info ref="reserveDialogInfo"></reserve-info>
</el-dialog> </el-dialog>
</guava> </guava>
</div> </div>
<script> <script>
@@ -158,12 +159,12 @@ layout("/layouts/platform.html"){
const activityUtil = new typeUtil() const activityUtil = new typeUtil()
let calendar = null let calendar = null
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [initTableMixins], mixins: [initTableMixins],
data() { data() {
return { return {
userid: "${@shiro.getPrincipalProperty('id')}", userid: "${@shiro.getPrincipalProperty('id')}",
role: "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}", role: "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')||@shiro.hasRole('SCHOOL_UNION_SPORTS_ADMIN')}",
activityTypeList: [], activityTypeList: [],
siteList: [], siteList: [],
pageForm: { pageForm: {
@@ -171,19 +172,19 @@ layout("/layouts/platform.html"){
searchKeyword: "", searchKeyword: "",
isAudit: false, isAudit: false,
time: "", time: "",
isRetire: '0' isRetire: "0"
}, },
tableColumns: [ tableColumns: [
{label: '场地名称', prop: 'site_name', sortable: true}, { label: "场地名称", prop: "site_name", sortable: true },
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true}, { label: "预约人姓名", prop: "reserve_person_username", sortable: true },
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true}, { label: "预约人部门", prop: "reserve_person_unitname", sortable: true },
// {label: '开始时间', prop: 'reserve_start_time', sortable: true}, // {label: '开始时间', prop: 'reserve_start_time', sortable: true},
// {label: '结束时间', prop: 'reserve_end_time', sortable: true}, // {label: '结束时间', prop: 'reserve_end_time', sortable: true},
{label: '预约时间范围', prop: 'reservationtimestr'}, { label: "预约时间范围", prop: "reservationtimestr" },
{label: '联系电话', prop: 'reserve_person_phone'}, { label: "联系电话", prop: "reserve_person_phone" },
// {label: '活动名称', prop: 'reserve_activity'}, // {label: '活动名称', prop: 'reserve_activity'},
{label: '预约事由', prop: 'reserve_cause'}, { label: "预约事由", prop: "reserve_cause" },
{label: '预约状态', prop: 'state_name'}, { label: "预约状态", prop: "state_name" }
], ],
sites: [], sites: [],
events: [], events: [],
@@ -192,7 +193,7 @@ layout("/layouts/platform.html"){
} }
}, },
components: { components: {
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue?v=' + new Date().getTime()), "reserve-info": httpVueLoader("/components/activity/site/ReserveInfo.vue?v=" + new Date().getTime())
}, },
methods: { methods: {
openView(row) { openView(row) {
@@ -200,13 +201,13 @@ layout("/layouts/platform.html"){
this.$refs.reserve.openView(row.id) this.$refs.reserve.openView(row.id)
}, },
async doDelete(id) { async doDelete(id) {
const confirm = await this.$confirm("您确定要删除此预约吗?", '提示', { const confirm = await this.$confirm("您确定要删除此预约吗?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning"
}) })
if (confirm !== 'confirm') return if (confirm !== "confirm") return
const resp = await $.post('/platform/activity/site/reserve/doDelete', {id, op: 1}) const resp = await $.post("/platform/activity/site/reserve/doDelete", { id, op: 1 })
if (resp.code === 0) { if (resp.code === 0) {
this.notifySuccess(resp.msg) this.notifySuccess(resp.msg)
this.doSearch() this.doSearch()
@@ -215,7 +216,7 @@ layout("/layouts/platform.html"){
} }
}, },
async getSites() { async getSites() {
const {data} = await $.get(loc() + '/getSites') const { data } = await $.get(loc() + "/getSites")
this.sites = data this.sites = data
}, },
@@ -224,60 +225,63 @@ layout("/layouts/platform.html"){
if (calendar) { if (calendar) {
return return
} }
calendar = $('#site-calendar').fullCalendar({ calendar = $("#site-calendar").fullCalendar({
header: { //设置日历头部信息,false,则不显示头部信息。包括left,center,right左中右三个位置 header: {
left: 'prev,next, today', //上一个、下一个、今天 //设置日历头部信息,false,则不显示头部信息。包括left,center,right左中右三个位置
center: 'title', //标题 left: "prev,next, today", //上一个、下一个、今天
right: 'month,agendaWeek,agendaDay' //月、周、日、日程列表 center: "title", //标题
right: "month,agendaWeek,agendaDay" //月、周、日、日程列表
}, },
locale: 'zh-cn', //?没用? locale: "zh-cn", //?没用?
timeFormat: 'HH:mm', //日程事件的时间格式 timeFormat: "HH:mm", //日程事件的时间格式
buttonText: { //各按钮的显示文本信息 buttonText: {
today: '今天', //各按钮的显示文本信息
month: '月', today: "今天",
agendaWeek: '周', month: "月",
agendaDay: '日', agendaWeek: "周",
listMonth: '日程', agendaDay: "日",
listMonth: "日程"
}, },
monthNames: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], //月份全称 monthNames: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], //月份全称
monthNamesShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], //月份简写 monthNamesShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], //月份简写
dayNames: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], //周全称 dayNames: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], //周全称
dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], //周简写 dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], //周简写
noEventsMessage: "当月无数据", //listview视图下,无数据提示 noEventsMessage: "当月无数据", //listview视图下,无数据提示
allDayText: "全天", //自定义全天视图的名称 allDayText: "全天", //自定义全天视图的名称
allDaySlot: false, //是否在周日历上方显示全天 allDaySlot: false, //是否在周日历上方显示全天
allDayDefault: false, //是否为全天日程事件,显示这一天中所做的事情 allDayDefault: false, //是否为全天日程事件,显示这一天中所做的事情
slotDuration: "00:30:00", //一格时间槽代表多长时间,默认00:30:00(30分钟) slotDuration: "00:30:00", //一格时间槽代表多长时间,默认00:30:00(30分钟)
slotLabelFormat: "H(:mm)a", //日期视图左边那一列显示的每一格日期时间格式 slotLabelFormat: "H(:mm)a", //日期视图左边那一列显示的每一格日期时间格式
slotLabelInterval: "01:00:00", //日期视图左边那一列多长间隔显示一条日期文字(默认跟着slotDuration走的,可自定义) slotLabelInterval: "01:00:00", //日期视图左边那一列多长间隔显示一条日期文字(默认跟着slotDuration走的,可自定义)
snapDuration: "01:00:00", //其实就是动态创建一个日程时,默认创建多长的时间块 snapDuration: "01:00:00", //其实就是动态创建一个日程时,默认创建多长的时间块
firstDay: 1, //一周中显示的第一天是哪天,周日是0,周一是1,类推 firstDay: 1, //一周中显示的第一天是哪天,周日是0,周一是1,类推
hiddenDays: [], //隐藏一周中的某一天或某几天,数组形式,如隐藏周二和周五:[2,5],默认不隐藏,除非weekends设置为false。 hiddenDays: [], //隐藏一周中的某一天或某几天,数组形式,如隐藏周二和周五:[2,5],默认不隐藏,除非weekends设置为false。
weekends: true, //是否显示周六和周日,设为false则不显示周六和周日。默认值为true weekends: true, //是否显示周六和周日,设为false则不显示周六和周日。默认值为true
weekMode: 'fixed', //月视图里显示周的模式,因每月周数不同月视图高度不定。fixed:固定显示6周高,日历高度保持不变liquid:不固定周数,高度随周数变化variable:不固定周数,但高度固定 weekMode: "fixed", //月视图里显示周的模式,因每月周数不同月视图高度不定。fixed:固定显示6周高,日历高度保持不变liquid:不固定周数,高度随周数变化variable:不固定周数,但高度固定
weekNumbers: false, //是否在日历中显示周次(一年中的第几周),如果设置为true,则会在月视图的左侧、周视图和日视图的左上角显示周数。 weekNumbers: false, //是否在日历中显示周次(一年中的第几周),如果设置为true,则会在月视图的左侧、周视图和日视图的左上角显示周数。
weekNumberCalculation: 'iso', //周次的显示格式。 weekNumberCalculation: "iso", //周次的显示格式。
height: that.calendarHeight, //设置日历的高度,包括header日历头部,默认未设置,高度根据aspectRatio值自适应。 height: that.calendarHeight, //设置日历的高度,包括header日历头部,默认未设置,高度根据aspectRatio值自适应。
// contentHeight: 600, //设置日历主体内容的高度,不包括header部分,默认未设置,高度根据aspectRatio值自适应。 // contentHeight: 600, //设置日历主体内容的高度,不包括header部分,默认未设置,高度根据aspectRatio值自适应。
handleWindowResize: true, //是否随浏览器窗口大小变化而自动变化。 handleWindowResize: true, //是否随浏览器窗口大小变化而自动变化。
defaultView: 'agendaWeek', //初始化时默认视图,默认是月month,agendaWeek是周,agendaDay是当天 defaultView: "agendaWeek", //初始化时默认视图,默认是月month,agendaWeek是周,agendaDay是当天
slotEventOverlap: false, //事件是否可以重叠覆盖 slotEventOverlap: false, //事件是否可以重叠覆盖
defaultDate: moment().format('YYYY-MM-DD'), //默认显示那一天的日期视图getDates(true)2020-05-10 defaultDate: moment().format("YYYY-MM-DD"), //默认显示那一天的日期视图getDates(true)2020-05-10
nowIndicator: false, //周/日视图中显示今天当前时间点(以红线标记),默认false不显示 nowIndicator: false, //周/日视图中显示今天当前时间点(以红线标记),默认false不显示
eventLimit: 2, //数据条数太多时,限制显示条数(多余的以“+2more”格式显示),默认false不限制,支持输入数字设定固定的显示条数 eventLimit: 2, //数据条数太多时,限制显示条数(多余的以“+2more”格式显示),默认false不限制,支持输入数字设定固定的显示条数
eventLimitText: "更多", //当一块区域内容太多以"+2 more"格式显示时,这个more的名称自定义(应该与eventLimit: true一并用) eventLimitText: "更多", //当一块区域内容太多以"+2 more"格式显示时,这个more的名称自定义(应该与eventLimit: true一并用)
dayPopoverFormat: "YYYY年M月d日预约信息", //点开"+2 more"弹出的小窗口标题,与eventLimitClick可以结合用 dayPopoverFormat: "YYYY年M月d日预约信息", //点开"+2 more"弹出的小窗口标题,与eventLimitClick可以结合用
render: (view) => { //method,绑定日历到id上。$('#id').fullCalendar('render'); render: (view) => {
//method,绑定日历到id上。$('#id').fullCalendar('render');
}, },
viewRender: (view) => { viewRender: (view) => {
that.getCalendarData() that.getCalendarData()
}, },
eventRender: (info, element) => { eventRender: (info, element) => {
console.log(info) console.log(info)
element.find('.fc-title').append("<br/>申请人:" + info.reserve_person_username) element.find(".fc-title").append("<br/>申请人:" + info.reserve_person_username)
element.find('.fc-title').append("<br/>联系电话:" + info.reserve_person_phone) element.find(".fc-title").append("<br/>联系电话:" + info.reserve_person_phone)
element.find('.fc-title').append("<br/>预约事由:" + info.reserve_cause) element.find(".fc-title").append("<br/>预约事由:" + info.reserve_cause)
element.find('.fc-title').append("<br/>审核状态:" + info.state_name) element.find(".fc-title").append("<br/>审核状态:" + info.state_name)
// $(info.el).html(info.event.title); // $(info.el).html(info.event.title);
}, },
//日历数据源 //日历数据源
@@ -289,7 +293,7 @@ layout("/layouts/platform.html"){
setTimeout(async () => { setTimeout(async () => {
// that.siteInfoDialog = true // that.siteInfoDialog = true
await httpVueLoader('/components/activity/site/ReserveInfo.vue?v=' + new Date().getTime())() await httpVueLoader("/components/activity/site/ReserveInfo.vue?v=" + new Date().getTime())()
// that.$refs.reserveDialogInfo.openView(event.id) // that.$refs.reserveDialogInfo.openView(event.id)
}, 1000) }, 1000)
@@ -319,44 +323,44 @@ layout("/layouts/platform.html"){
// that.$set(that.formData, 'appointmentAskTypeValue', this.askTypeArray[0].code) // that.$set(that.formData, 'appointmentAskTypeValue', this.askTypeArray[0].code)
// } // }
}, },
selectable: false, //是否允许通过单击或拖动选择日历中的对象,包括天和时间 selectable: false, //是否允许通过单击或拖动选择日历中的对象,包括天和时间
selectMirror: true, //镜像 selectMirror: true, //镜像
lazyFetching: false, //是否启用懒加载技术--即只取当前条件下的视图数据,其它数据在切换时触发,默认true只取当前视图的,false是取全视图的 lazyFetching: false, //是否启用懒加载技术--即只取当前条件下的视图数据,其它数据在切换时触发,默认true只取当前视图的,false是取全视图的
defaultTimedEventDuration: "01:00:00", //在Event Object中如果没有end参数时使用,如start=7:00pm,则该日程对象时间范围就是7:00~9:00 defaultTimedEventDuration: "01:00:00", //在Event Object中如果没有end参数时使用,如start=7:00pm,则该日程对象时间范围就是7:00~9:00
defaultAllDayEventDuration: {days: 1}, //默认1天是多长,(有的是采用工作时间模式,所以支持自定义) defaultAllDayEventDuration: { days: 1 } //默认1天是多长,(有的是采用工作时间模式,所以支持自定义)
}); })
}, },
async getCalendarData() { async getCalendarData() {
if (!calendar) { if (!calendar) {
return return
} }
const view = calendar.fullCalendar('getView') const view = calendar.fullCalendar("getView")
//这里取时间戳 //这里取时间戳
const startTimeTs = view.start.format('YYYY-MM-DD HH:mm:ss') const startTimeTs = view.start.format("YYYY-MM-DD HH:mm:ss")
const endTimeTs = view.end.format('YYYY-MM-DD HH:mm:ss') const endTimeTs = view.end.format("YYYY-MM-DD HH:mm:ss")
const {data} = await $.get(loc() + '/getCalendarData', { const { data } = await $.get(loc() + "/getCalendarData", {
siteId: this.pageForm.siteId, siteId: this.pageForm.siteId,
startTimeTs, startTimeTs,
endTimeTs endTimeTs
}) })
if (data && data.length > 0) { if (data && data.length > 0) {
data.map(x => { data.map((x) => {
console.log(x) console.log(x)
if (x.site_id === '83dfd7d780f448aea307d2ce967b51fe') { if (x.site_id === "83dfd7d780f448aea307d2ce967b51fe") {
x.className = 'yantaoshi' x.className = "yantaoshi"
} else if (x.site_id === 'd6ebd7e454a24e3495b0d18438fb6a59') { } else if (x.site_id === "d6ebd7e454a24e3495b0d18438fb6a59") {
x.className = 'duogongnengting' x.className = "duogongnengting"
} else if (x.site_id === 'a6486481018b479ab137bac53936f15e') { } else if (x.site_id === "a6486481018b479ab137bac53936f15e") {
x.className = 'dangyuanzhijia' x.className = "dangyuanzhijia"
} else { } else {
x.className = 'other' x.className = "other"
} }
}) })
let events = data let events = data
calendar.fullCalendar('removeEvents', () => true) calendar.fullCalendar("removeEvents", () => true)
calendar.fullCalendar('addEventSource', events, true); calendar.fullCalendar("addEventSource", events, true)
} else { } else {
calendar.fullCalendar('removeEvents', () => true) calendar.fullCalendar("removeEvents", () => true)
} }
}, },
openCalendar() { openCalendar() {
@@ -367,9 +371,9 @@ layout("/layouts/platform.html"){
}, 500) }, 500)
}, },
async findAllOpenSite() { async findAllOpenSite() {
const {data} = await $.get("/platform/activity/site/apply/getAllSite") const { data } = await $.get("/platform/activity/site/apply/getAllSite")
return data return data
}, }
}, },
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {
@@ -381,7 +385,7 @@ layout("/layouts/platform.html"){
this.siteList = await this.findAllOpenSite() this.siteList = await this.findAllOpenSite()
this.pageData() this.pageData()
this.getSites() this.getSites()
}, }
}) })
</script> </script>
<!--# <!--#
@@ -10,24 +10,26 @@ layout("/layouts/platform.html"){
<div class="search-item-label">月份:</div> <div class="search-item-label">月份:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-date-picker <el-date-picker
style="width: 100%" style="width: 100%"
@change="doSearch" @change="doSearch"
v-model="pageForm.time" v-model="pageForm.time"
placeholder="请选择月份" placeholder="请选择月份"
type="month" type="month"
value-format="yyyy-MM"> value-format="yyyy-MM"
</el-date-picker> ></el-date-picker>
</div> </div>
</div> </div>
<div class="search-item"> <div class="search-item">
<div class="search-item-label">姓名工号:</div> <div class="search-item-label">姓名工号:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword" <el-input
style="width: 100%" placeholder="请输入内容"
@keyup.enter.native="doSearch"> clearable
<el-select v-model="pageForm.searchName" slot="prepend" v-model="pageForm.searchKeyword"
placeholder="查询类型" style="width: 100%"
style="width: 80px;"> @keyup.enter.native="doSearch"
>
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型" style="width: 80px">
<el-option label="姓名" value="u.username"></el-option> <el-option label="姓名" value="u.username"></el-option>
<el-option label="工号" value="u.loginname"></el-option> <el-option label="工号" value="u.loginname"></el-option>
</el-select> </el-select>
@@ -38,36 +40,39 @@ layout("/layouts/platform.html"){
<div class="search-item"> <div class="search-item">
<div class="search-item-label">场地名称:</div> <div class="search-item-label">场地名称:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable clearable <el-input
placeholder="请输入场地名称" @keyup.enter.native="doSearch"
style="width: 100%" clearable
v-model="pageForm.siteName"> clearable
</el-input> placeholder="请输入场地名称"
style="width: 100%"
v-model="pageForm.siteName"
></el-input>
</div> </div>
</div> </div>
<!-- <div class="search-item">--> <!-- <div class="search-item">-->
<!-- <div class="search-item-label">场地类型:</div>--> <!-- <div class="search-item-label">场地类型:</div>-->
<!-- <div class="search-item-option">--> <!-- <div class="search-item-option">-->
<!-- <el-select v-model="pageForm.siteType" placeholder="场地类型"--> <!-- <el-select v-model="pageForm.siteType" placeholder="场地类型"-->
<!-- clearable filterable style="width: 100%">--> <!-- clearable filterable style="width: 100%">-->
<!-- <el-option v-for="item in activityTypeList" :label="item.text"--> <!-- <el-option v-for="item in activityTypeList" :label="item.text"-->
<!-- :value="item.value"></el-option>--> <!-- :value="item.value"></el-option>-->
<!-- </el-select>--> <!-- </el-select>-->
<!-- </div>--> <!-- </div>-->
<!-- </div>--> <!-- </div>-->
<div class="search-query"> <div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button> <el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div> </div>
</div> </div>
</el-card> </el-card>
<el-card shadow="never" class="mt10"> <el-card shadow="never" class="mt10">
<table-tool :app="this" label="预约列表"> <table-tool :app="this" label="预约列表">
<template #func> <template #func>
<el-button @click="location.href='/platform/activity/site/apply'" <el-button @click="location.href='/platform/activity/site/apply'" class="mr10" size="small" type="primary">
class="mr10" size="small" type="primary">我要预约</el-button> 我要预约
</el-button>
<el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isRetire"> <el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isRetire">
<el-radio-button label="">全部</el-radio-button> <el-radio-button label="">全部</el-radio-button>
<el-radio-button label="1">离退休</el-radio-button> <el-radio-button label="1">离退休</el-radio-button>
@@ -75,31 +80,32 @@ layout("/layouts/platform.html"){
</el-radio-group> </el-radio-group>
</template> </template>
</table-tool> </table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" <el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" align="center" header-align="center">
align="center"
header-align="center">
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
width="80px"></el-table-column>
<el-table-column <el-table-column
:label="column.label" :index="indexMethod"
:prop="column.prop" align="center"
:sortable="column.sortable" header-align="center"
align="center" label="序号"
header-align="center" type="index"
show-overflow-tooltip width="80px"
v-for="column in tableColumns" ></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
> >
<template scope="{row}" v-if="column.prop==='state_name'"> <template scope="{row}" v-if="column.prop==='state_name'">
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>--> <!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
<span v-if="[0].includes(row.stateaudittype)" <span v-if="[0].includes(row.stateaudittype)" style="color: #e6a23c">{{row.state_name}}</span>
style="color: #e6a23c">{{row.state_name}}</span>
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span> <span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span> <span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" <el-table-column align="center" header-align="center" label="操作" fixed="right" width="200px">
width="200px">
<template scope="scope"> <template scope="scope">
<!--<el-button @click="() => {dropdownCommand({type:'view',data:scope.row})}" size="mini">查看</el-button> <!--<el-button @click="() => {dropdownCommand({type:'view',data:scope.row})}" size="mini">查看</el-button>
<el-button type="danger" @click="() => {dropdownCommand({type:'delete',data:scope.row})}" size="mini">删除</el-button>--> <el-button type="danger" @click="() => {dropdownCommand({type:'delete',data:scope.row})}" size="mini">删除</el-button>-->
@@ -109,19 +115,15 @@ layout("/layouts/platform.html"){
<span class="ti-angle-down"></span> <span class="ti-angle-down"></span>
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'view',data:scope.row}"> <el-dropdown-item :command="{type:'view',data:scope.row}">查看</el-dropdown-item>
查看
</el-dropdown-item>
<!--# if(@shiro.hasRole('sysadmin')){ #--> <!--# if(@shiro.hasRole('sysadmin')){ #-->
<el-dropdown-item <el-dropdown-item :command="{type:'delete',data:scope.row}">删除</el-dropdown-item>
:command="{type:'delete',data:scope.row}">
删除
</el-dropdown-item>
<!--# } #--> <!--# } #-->
<el-dropdown-item <el-dropdown-item
v-if="scope.row.reserve_person_id === '${@shiro.getPrincipalProperty('id')}' v-if="scope.row.reserve_person_id === '${@shiro.getPrincipalProperty('id')}'
&& (scope.row.reserve_person_union_process == null || scope.row.reserve_person_union_process == '')" && (scope.row.reserve_person_union_process == null || scope.row.reserve_person_union_process == '')"
:command="{type:'cancel',data:scope.row}"> :command="{type:'cancel',data:scope.row}"
>
撤销预约 撤销预约
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
@@ -143,14 +145,14 @@ layout("/layouts/platform.html"){
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #--> <!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
const activityUtil = new typeUtil() const activityUtil = new typeUtil()
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [initTableMixins], mixins: [initTableMixins],
data() { data() {
return { return {
activityTypeList: [], activityTypeList: [],
siteList: [], siteList: [],
tableData: [], tableData: [],
userid: '', userid: "",
pageForm: { pageForm: {
searchName: "u.username", searchName: "u.username",
searchKeyword: "", searchKeyword: "",
@@ -159,106 +161,118 @@ layout("/layouts/platform.html"){
totalCount: 0, totalCount: 0,
pageOrderName: "", pageOrderName: "",
pageOrderBy: "", pageOrderBy: "",
time: '', time: "",
isRetire: '0' isRetire: "0"
}, },
tableColumns: [ tableColumns: [
{label: '场地名称', prop: 'site_name', sortable: true}, { label: "场地名称", prop: "site_name", sortable: true },
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true}, { label: "预约人姓名", prop: "reserve_person_username", sortable: true },
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true}, { label: "预约人部门", prop: "reserve_person_unitname", sortable: true },
// {label: '开始时间', prop: 'reserve_start_time', sortable: true}, // {label: '开始时间', prop: 'reserve_start_time', sortable: true},
// {label: '结束时间', prop: 'reserve_end_time', sortable: true}, // {label: '结束时间', prop: 'reserve_end_time', sortable: true},
{label: '预约时间范围', prop: 'reservationtimestr'}, { label: "预约时间范围", prop: "reservationtimestr" },
{label: '联系电话', prop: 'reserve_person_phone'}, { label: "联系电话", prop: "reserve_person_phone" },
// {label: '活动名称', prop: 'reserve_activity'}, // {label: '活动名称', prop: 'reserve_activity'},
{label: '预约事由', prop: 'reserve_cause'}, { label: "预约事由", prop: "reserve_cause" },
{label: '预约状态', prop: 'state_name'}, { label: "预约状态", prop: "state_name" }
], ]
} }
}, },
components: { components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'), guava: httpVueLoader("/components/plugins/Guava.vue"),
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue?v=' + new Date().getTime()), "reserve-info": httpVueLoader("/components/activity/site/ReserveInfo.vue?v=" + new Date().getTime())
}, },
methods: { methods: {
dropdownCommand(command) { dropdownCommand(command) {
const {type, data} = command const { type, data } = command
if (type === 'view') { if (type === "view") {
this.userid = data.reserve_person_id; this.userid = data.reserve_person_id
this.openView(data) this.openView(data)
} else if (type === 'delete') { } else if (type === "delete") {
this.doClean(data.id) this.doClean(data.id)
} else if (type === 'cancel') { } else if (type === "cancel") {
this.doRevoke(data.id) this.doRevoke(data.id)
} }
}, },
backOption(row) { backOption(row) {
this.$prompt('请填写反馈意见', '提示', { this.$prompt("请填写反馈意见", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
inputValidator: (value) => { inputValidator: (value) => {
if (value === null) { if (value === null) {
return '反馈意见不能为空' return "反馈意见不能为空"
} }
} }
}).then(async ({value}) => { })
const res = await $.post('/mobile/activity/site/info/backOption', { .then(async ({ value }) => {
id: row.id, const res = await $.post("/mobile/activity/site/info/backOption", {
option: value id: row.id,
option: value
})
if (res.code === 0) {
await this.doSearch()
this.$notify.success({ title: "提示", message: "操作成功!" })
} else {
this.$notify.warning({ title: "警告", message: "操作失败!" })
}
}) })
if (res.code === 0) { .catch(() => {})
await this.doSearch()
this.$notify.success({title: '提示', message: '操作成功!'});
} else {
this.$notify.warning({title: '警告', message: '操作失败!'});
}
}).catch(() => {
});
}, },
async doClean(id) { async doClean(id) {
this.$confirm("您确定要删除此预约吗?", '提示', { this.$confirm("您确定要删除此预约吗?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning', type: "warning",
callback: (a, b) => { callback: (a, b) => {
if ("confirm" === a) { if ("confirm" === a) {
$.post("/platform/activity/site/apply/doClean", {id}, (data) => { $.post(
if (data.code === 0) { "/platform/activity/site/apply/doClean",
this.$message.success(data.msg) { id },
this.pageData(); (data) => {
} else { if (data.code === 0) {
this.$message.warning(data.msg) this.$message.success(data.msg)
} this.pageData()
}, "json"); } else {
this.$message.warning(data.msg)
}
},
"json"
)
} }
} }
}); })
}, },
async doRevoke(id) { async doRevoke(id) {
this.$confirm("您确定要撤销此预约吗?", '提示', { this.$confirm("您确定要撤销此预约吗?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning', type: "warning",
callback: (a, b) => { callback: (a, b) => {
if ("confirm" === a) { if ("confirm" === a) {
$.post("/platform/activity/site/apply/revoke", {id}, (data) => { $.post(
if (data.code === 0) { "/platform/activity/site/apply/revoke",
this.$message.success(data.msg) { id },
this.pageData(); (data) => {
} else { if (data.code === 0) {
this.$message.warning(data.msg) this.$message.success(data.msg)
} this.pageData()
}, "json"); } else {
this.$message.warning(data.msg)
}
},
"json"
)
} }
} }
}); })
}, },
openView(row) { openView(row) {
this.$refs.guava.view() this.$refs.guava.view()
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}" const role =
"${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')||@shiro.hasRole('SCHOOL_UNION_SPORTS_ADMIN')}"
this.$refs.reserve.role = role this.$refs.reserve.role = role
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === this.userid const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === this.userid
this.$refs.reserve.backOptionShow = (role || backOptionShow) this.$refs.reserve.backOptionShow = role || backOptionShow
this.$refs.reserve.openView(row.id) this.$refs.reserve.openView(row.id)
}, },
async doSearch() { async doSearch() {
@@ -267,14 +281,14 @@ layout("/layouts/platform.html"){
this.siteList = await this.findAllOpenSite() this.siteList = await this.findAllOpenSite()
}, },
async findAllOpenSite() { async findAllOpenSite() {
const {data} = await $.get("/platform/activity/site/apply/getAllSite") const { data } = await $.get("/platform/activity/site/apply/getAllSite")
return data return data
}, }
}, },
async created() { async created() {
this.activityTypeList = await activityUtil.getAllType() this.activityTypeList = await activityUtil.getAllType()
this.siteList = await this.findAllOpenSite() this.siteList = await this.findAllOpenSite()
this.pageData(); this.pageData()
} }
}) })
</script> </script>
@@ -10,24 +10,26 @@ layout("/layouts/platform.html"){
<div class="search-item-label">月份:</div> <div class="search-item-label">月份:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-date-picker <el-date-picker
style="width: 100%" style="width: 100%"
@change="doSearch" @change="doSearch"
v-model="pageForm.time" v-model="pageForm.time"
placeholder="请选择月份" placeholder="请选择月份"
type="month" type="month"
value-format="yyyy-MM"> value-format="yyyy-MM"
</el-date-picker> ></el-date-picker>
</div> </div>
</div> </div>
<div class="search-item"> <div class="search-item">
<div class="search-item-label">姓名工号:</div> <div class="search-item-label">姓名工号:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword" <el-input
style="width: 100%" placeholder="请输入内容"
@keyup.enter.native="doSearch"> clearable
<el-select v-model="pageForm.searchName" slot="prepend" v-model="pageForm.searchKeyword"
placeholder="查询类型" style="width: 100%"
style="width: 80px;"> @keyup.enter.native="doSearch"
>
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型" style="width: 80px">
<el-option label="姓名" value="u.username"></el-option> <el-option label="姓名" value="u.username"></el-option>
<el-option label="工号" value="u.loginname"></el-option> <el-option label="工号" value="u.loginname"></el-option>
</el-select> </el-select>
@@ -38,11 +40,14 @@ layout("/layouts/platform.html"){
<div class="search-item"> <div class="search-item">
<div class="search-item-label">场地名称:</div> <div class="search-item-label">场地名称:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable clearable <el-input
placeholder="请输入场地名称" @keyup.enter.native="doSearch"
style="width: 100%" clearable
v-model="pageForm.siteName"> clearable
</el-input> placeholder="请输入场地名称"
style="width: 100%"
v-model="pageForm.siteName"
></el-input>
</div> </div>
</div> </div>
@@ -71,36 +76,35 @@ layout("/layouts/platform.html"){
</el-radio-group> </el-radio-group>
</template> </template>
</table-tool> </table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" <el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" align="center" header-align="center">
align="center"
header-align="center">
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
width="80px"></el-table-column>
<el-table-column <el-table-column
:label="column.label" :index="indexMethod"
:prop="column.prop" align="center"
:sortable="column.sortable" header-align="center"
align="center" label="序号"
header-align="center" type="index"
show-overflow-tooltip width="80px"
v-for="column in tableColumns" ></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
> >
<template scope="{row}" v-if="column.prop==='state_name'"> <template scope="{row}" v-if="column.prop==='state_name'">
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>--> <!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
<span v-if="[0].includes(row.stateaudittype)" <span v-if="[0].includes(row.stateaudittype)" style="color: #e6a23c">{{row.state_name}}</span>
style="color: #e6a23c">{{row.state_name}}</span>
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span> <span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span> <span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" <el-table-column align="center" header-align="center" label="操作" fixed="right" width="200px">
width="200px">
<template scope="{row}"> <template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button> <el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.reserve_state == 6090" @click="doProcess(row)" size="mini" <el-button v-if="row.reserve_state == 6090" @click="doProcess(row)" size="mini" type="primary">审核</el-button>
type="primary">审核
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -112,23 +116,17 @@ layout("/layouts/platform.html"){
<reserve-info ref="auditInfo"> <reserve-info ref="auditInfo">
<template #handle> <template #handle>
<el-tab-pane label="离退休工作处审核" name="retire"> <el-tab-pane label="离退休工作处审核" name="retire">
<el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm" <el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm" :rules="formRules">
:rules="formRules"> <el-form-item label="审核人">${@shiro.getPrincipalProperty('username')}</el-form-item>
<el-form-item label="审核人"> <el-form-item label="审核时间">{{moment().format('YYYY-MM-DD')}}</el-form-item>
${@shiro.getPrincipalProperty('username')}
</el-form-item>
<el-form-item label="审核时间">
{{moment().format('YYYY-MM-DD')}}
</el-form-item>
<el-form-item label="审核意见" prop="auditOpinion"> <el-form-item label="审核意见" prop="auditOpinion">
<el-input maxlength="300" rows="5" type="textarea" <el-input maxlength="300" rows="5" type="textarea" v-model="formData.auditOpinion"></el-input>
v-model="formData.auditOpinion"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="签字" prop="auditSign"> <el-form-item label="签字" prop="auditSign">
<sign :qz.sync="formData.auditSign" prefix="activitySite"></sign> <sign :qz.sync="formData.auditSign" prefix="activitySite"></sign>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row style="margin: 40px 0;text-align: right"> <el-row style="margin: 40px 0; text-align: right">
<el-button type="danger" @click="doReview(false)">拒绝</el-button> <el-button type="danger" @click="doReview(false)">拒绝</el-button>
<el-button type="primary" @click="doReview(true)">通过</el-button> <el-button type="primary" @click="doReview(true)">通过</el-button>
</el-row> </el-row>
@@ -146,7 +144,7 @@ layout("/layouts/platform.html"){
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #--> <!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
const activityUtil = new typeUtil() const activityUtil = new typeUtil()
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [initTableMixins], mixins: [initTableMixins],
data() { data() {
return { return {
@@ -157,53 +155,54 @@ layout("/layouts/platform.html"){
searchName: "u.username", searchName: "u.username",
searchKeyword: "", searchKeyword: "",
isAudit: false, isAudit: false,
time: "", time: ""
}, },
tableColumns: [ tableColumns: [
{label: '场地名称', prop: 'site_name', sortable: true}, { label: "场地名称", prop: "site_name", sortable: true },
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true}, { label: "预约人姓名", prop: "reserve_person_username", sortable: true },
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true}, { label: "预约人部门", prop: "reserve_person_unitname", sortable: true },
// {label: '开始时间', prop: 'reserve_start_time', sortable: true}, // {label: '开始时间', prop: 'reserve_start_time', sortable: true},
// {label: '结束时间', prop: 'reserve_end_time', sortable: true}, // {label: '结束时间', prop: 'reserve_end_time', sortable: true},
{label: '预约时间范围', prop: 'reservationtimestr'}, { label: "预约时间范围", prop: "reservationtimestr" },
{label: '联系电话', prop: 'reserve_person_phone'}, { label: "联系电话", prop: "reserve_person_phone" },
// {label: '活动名称', prop: 'reserve_activity'}, // {label: '活动名称', prop: 'reserve_activity'},
{label: '预约事由', prop: 'reserve_cause'}, { label: "预约事由", prop: "reserve_cause" },
{label: '预约状态', prop: 'state_name'}, { label: "预约状态", prop: "state_name" }
], ],
formRules: { formRules: {
auditOpinion: [{required: true, message: '请签字', trigger: ['change', 'blur']}], auditOpinion: [{ required: true, message: "请签字", trigger: ["change", "blur"] }],
auditSign: [{required: true, message: '请签字', trigger: ['change', 'blur']}], auditSign: [{ required: true, message: "请签字", trigger: ["change", "blur"] }]
}, }
} }
}, },
components: { components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'), guava: httpVueLoader("/components/plugins/Guava.vue"),
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue?v=' + new Date().getTime()), "reserve-info": httpVueLoader("/components/activity/site/ReserveInfo.vue?v=" + new Date().getTime()),
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.0'), sign: httpVueLoader("/components/sign/sign.vue?v=2.0.0")
}, },
methods: { methods: {
openView(row) { openView(row) {
this.$refs.guava.view() this.$refs.guava.view()
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}" const role =
"${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')||@shiro.hasRole('SCHOOL_UNION_SPORTS_ADMIN')}"
this.$refs.reserve.role = role this.$refs.reserve.role = role
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id
this.$refs.reserve.backOptionShow = (role || backOptionShow) this.$refs.reserve.backOptionShow = role || backOptionShow
this.$refs.reserve.openView(row.id) this.$refs.reserve.openView(row.id)
}, },
doProcess(row) { doProcess(row) {
this.$refs.guava.edit() this.$refs.guava.edit()
this.$refs.auditInfo.openView(row.id, 'retire') this.$refs.auditInfo.openView(row.id, "retire")
this.formData = { this.formData = {
id: row.id, id: row.id,
auditOpinion: null, auditOpinion: null
} }
}, },
async doReview(row) { async doReview(row) {
const valid = await this.$refs['auditForm'].validate() const valid = await this.$refs["auditForm"].validate()
if (!valid) return if (!valid) return
this.formData.auditPass = row this.formData.auditPass = row
const resp = await $.post('/platform/activity/site/retireProcess/doProcess', { const resp = await $.post("/platform/activity/site/retireProcess/doProcess", {
id: this.formData.id, id: this.formData.id,
audit: JSON.stringify(this.formData) audit: JSON.stringify(this.formData)
}) })
@@ -214,14 +213,14 @@ layout("/layouts/platform.html"){
} }
}, },
async findAllOpenSite() { async findAllOpenSite() {
const {data} = await $.get("/platform/activity/site/apply/getAllSite") const { data } = await $.get("/platform/activity/site/apply/getAllSite")
return data return data
}, }
}, },
async created() { async created() {
this.activityTypeList = await activityUtil.getAllType() this.activityTypeList = await activityUtil.getAllType()
this.siteList = await this.findAllOpenSite() this.siteList = await this.findAllOpenSite()
this.pageData(); this.pageData()
} }
}) })
</script> </script>
@@ -10,24 +10,26 @@ layout("/layouts/platform.html"){
<div class="search-item-label">月份:</div> <div class="search-item-label">月份:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-date-picker <el-date-picker
style="width: 100%" style="width: 100%"
@change="doSearch" @change="doSearch"
v-model="pageForm.time" v-model="pageForm.time"
placeholder="请选择月份" placeholder="请选择月份"
type="month" type="month"
value-format="yyyy-MM"> value-format="yyyy-MM"
</el-date-picker> ></el-date-picker>
</div> </div>
</div> </div>
<div class="search-item"> <div class="search-item">
<div class="search-item-label">姓名工号:</div> <div class="search-item-label">姓名工号:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword" <el-input
style="width: 100%" placeholder="请输入内容"
@keyup.enter.native="doSearch"> clearable
<el-select v-model="pageForm.searchName" slot="prepend" v-model="pageForm.searchKeyword"
placeholder="查询类型" style="width: 100%"
style="width: 80px;"> @keyup.enter.native="doSearch"
>
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型" style="width: 80px">
<el-option label="姓名" value="u.username"></el-option> <el-option label="姓名" value="u.username"></el-option>
<el-option label="工号" value="u.loginname"></el-option> <el-option label="工号" value="u.loginname"></el-option>
</el-select> </el-select>
@@ -38,11 +40,14 @@ layout("/layouts/platform.html"){
<div class="search-item"> <div class="search-item">
<div class="search-item-label">场地名称:</div> <div class="search-item-label">场地名称:</div>
<div class="search-item-option"> <div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable clearable <el-input
placeholder="请输入场地名称" @keyup.enter.native="doSearch"
style="width: 100%" clearable
v-model="pageForm.siteName"> clearable
</el-input> placeholder="请输入场地名称"
style="width: 100%"
v-model="pageForm.siteName"
></el-input>
</div> </div>
</div> </div>
@@ -76,31 +81,32 @@ layout("/layouts/platform.html"){
</el-radio-group> </el-radio-group>
</template> </template>
</table-tool> </table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" <el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" align="center" header-align="center">
align="center"
header-align="center">
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
width="80px"></el-table-column>
<el-table-column <el-table-column
:label="column.label" :index="indexMethod"
:prop="column.prop" align="center"
:sortable="column.sortable" header-align="center"
align="center" label="序号"
header-align="center" type="index"
show-overflow-tooltip width="80px"
v-for="column in tableColumns" ></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
> >
<template scope="{row}" v-if="column.prop==='state_name'"> <template scope="{row}" v-if="column.prop==='state_name'">
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>--> <!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
<span v-if="[0].includes(row.stateaudittype)" <span v-if="[0].includes(row.stateaudittype)" style="color: #e6a23c">{{row.state_name}}</span>
style="color: #e6a23c">{{row.state_name}}</span>
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span> <span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span> <span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right" <el-table-column align="center" header-align="center" label="操作" fixed="right" width="200px">
width="200px">
<template scope="{row}"> <template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button> <el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.reserve_state == 6118" @click="doProcess(row)" size="mini" type="primary">审核</el-button> <el-button v-if="row.reserve_state == 6118" @click="doProcess(row)" size="mini" type="primary">审核</el-button>
@@ -116,21 +122,16 @@ layout("/layouts/platform.html"){
<template #handle> <template #handle>
<el-tab-pane label="校工会审核" name="xghsh"> <el-tab-pane label="校工会审核" name="xghsh">
<el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm" :rules="formRules"> <el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm" :rules="formRules">
<el-form-item label="审核人"> <el-form-item label="审核人">${@shiro.getPrincipalProperty('username')}</el-form-item>
${@shiro.getPrincipalProperty('username')} <el-form-item label="审核时间">{{moment().format('YYYY-MM-DD')}}</el-form-item>
</el-form-item>
<el-form-item label="审核时间">
{{moment().format('YYYY-MM-DD')}}
</el-form-item>
<el-form-item label="审核意见" prop="auditOpinion"> <el-form-item label="审核意见" prop="auditOpinion">
<el-input maxlength="300" rows="5" type="textarea" <el-input maxlength="300" rows="5" type="textarea" v-model="formData.auditOpinion"></el-input>
v-model="formData.auditOpinion"></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item label="签字" prop="auditSign">--> <!-- <el-form-item label="签字" prop="auditSign">-->
<!-- <sign :qz.sync="formData.auditSign" prefix="activitySite"></sign>--> <!-- <sign :qz.sync="formData.auditSign" prefix="activitySite"></sign>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
</el-form> </el-form>
<el-row style="margin: 40px 0;text-align: right"> <el-row style="margin: 40px 0; text-align: right">
<el-button type="danger" @click="doReview(false)">拒绝</el-button> <el-button type="danger" @click="doReview(false)">拒绝</el-button>
<el-button type="primary" @click="doReview(true)">通过</el-button> <el-button type="primary" @click="doReview(true)">通过</el-button>
</el-row> </el-row>
@@ -143,74 +144,74 @@ layout("/layouts/platform.html"){
<reserve-info ref="reserve"></reserve-info> <reserve-info ref="reserve"></reserve-info>
</template> </template>
</guava> </guava>
</div> </div>
<script> <script>
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #--> <!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
const activityUtil = new typeUtil() const activityUtil = new typeUtil()
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [initTableMixins], mixins: [initTableMixins],
data() { data() {
return { return {
id:null, id: null,
activityTypeList:[], activityTypeList: [],
siteList:[], siteList: [],
pageForm: { pageForm: {
searchName: "u.username", searchName: "u.username",
searchKeyword: "", searchKeyword: "",
isAudit: false, isAudit: false,
time: "", time: "",
isRetire: '0' isRetire: "0"
}, },
tableColumns: [ tableColumns: [
{label: '场地名称', prop: 'site_name', sortable: true}, { label: "场地名称", prop: "site_name", sortable: true },
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true}, { label: "预约人姓名", prop: "reserve_person_username", sortable: true },
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true}, { label: "预约人部门", prop: "reserve_person_unitname", sortable: true },
// {label: '开始时间', prop: 'reserve_start_time', sortable: true}, // {label: '开始时间', prop: 'reserve_start_time', sortable: true},
// {label: '结束时间', prop: 'reserve_end_time', sortable: true}, // {label: '结束时间', prop: 'reserve_end_time', sortable: true},
{label: '预约时间范围', prop: 'reservationtimestr'}, { label: "预约时间范围", prop: "reservationtimestr" },
{label: '联系电话', prop: 'reserve_person_phone'}, { label: "联系电话", prop: "reserve_person_phone" },
// {label: '活动项目', prop: 'reserve_activity'}, // {label: '活动项目', prop: 'reserve_activity'},
{label: '预约事由', prop: 'reserve_cause'}, { label: "预约事由", prop: "reserve_cause" },
{label: '预约状态', prop: 'state_name'}, { label: "预约状态", prop: "state_name" }
], ],
formRules:{ formRules: {
auditOpinion: [{required: true, message: '请签字', trigger: ['change', 'blur']}], auditOpinion: [{ required: true, message: "请签字", trigger: ["change", "blur"] }],
auditSign: [{required: true, message: '请签字', trigger: ['change', 'blur']}], auditSign: [{ required: true, message: "请签字", trigger: ["change", "blur"] }]
}, }
} }
}, },
components: { components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'), guava: httpVueLoader("/components/plugins/Guava.vue"),
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue?v=' + new Date().getTime()), "reserve-info": httpVueLoader("/components/activity/site/ReserveInfo.vue?v=" + new Date().getTime()),
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.0'), sign: httpVueLoader("/components/sign/sign.vue?v=2.0.0")
}, },
methods: { methods: {
openView(row) { openView(row) {
this.$refs.guava.view() this.$refs.guava.view()
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}" const role =
"${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')||@shiro.hasRole('SCHOOL_UNION_SPORTS_ADMIN')}"
this.$refs.reserve.role = role this.$refs.reserve.role = role
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id
this.$refs.reserve.backOptionShow = (role || backOptionShow) this.$refs.reserve.backOptionShow = role || backOptionShow
this.$refs.reserve.openView(row.id) this.$refs.reserve.openView(row.id)
}, },
doProcess(row){ doProcess(row) {
this.$refs.guava.edit() this.$refs.guava.edit()
this.$refs.auditInfo.openView(row.id, 'xghsh') this.$refs.auditInfo.openView(row.id, "xghsh")
this.formData={ this.formData = {
id: row.id, id: row.id,
schoolOption: null, schoolOption: null
} }
}, },
async doReview(row){ async doReview(row) {
const valid = await this.$refs['auditForm'].validate() const valid = await this.$refs["auditForm"].validate()
if (!valid) return if (!valid) return
this.formData.auditPass = row this.formData.auditPass = row
const resp = await $.post('/platform/activity/site/review/doProcess', { const resp = await $.post("/platform/activity/site/review/doProcess", {
id:this.formData.id, id: this.formData.id,
audit:JSON.stringify(this.formData) audit: JSON.stringify(this.formData)
}) })
if (resp.code === 0) { if (resp.code === 0) {
this.$refs.guava.index() this.$refs.guava.index()
@@ -219,24 +220,29 @@ layout("/layouts/platform.html"){
} }
}, },
doInstructions() { doInstructions() {
$.post(location.href + "/doReview", this.formData, (res) => { $.post(
if (res.code == 0) { location.href + "/doReview",
this.$message.success(res.msg) this.formData,
this.pageData(); (res) => {
this.$refs.guava.index() if (res.code == 0) {
} this.$message.success(res.msg)
}, "json"); this.pageData()
this.$refs.guava.index()
}
},
"json"
)
}, },
async findAllOpenSite() { async findAllOpenSite() {
const {data} = await $.get("/platform/activity/site/apply/getAllSite") const { data } = await $.get("/platform/activity/site/apply/getAllSite")
return data return data
}, }
}, },
async created() { async created() {
this.activityTypeList = await activityUtil.getAllType() this.activityTypeList = await activityUtil.getAllType()
this.siteList = await this.findAllOpenSite() this.siteList = await this.findAllOpenSite()
this.pageData(); this.pageData()
}, }
}) })
</script> </script>
<!--# <!--#
@@ -183,7 +183,8 @@ layout("/layouts/platform.html"){
methods: { methods: {
openView(row) { openView(row) {
this.$refs.guava.view() this.$refs.guava.view()
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}" const role =
"${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')||@shiro.hasRole('SCHOOL_UNION_SPORTS_ADMIN')}"
this.$refs.reserve.role = role this.$refs.reserve.role = role
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id
this.$refs.reserve.backOptionShow = role || backOptionShow this.$refs.reserve.backOptionShow = role || backOptionShow
@@ -51,6 +51,10 @@ const activity = {
}) })
}, },
enterActivity(item) { enterActivity(item) {
if (item.type === "Activity" && "${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}||${@shiro.hasRole('gh01')||@shiro.hasRole('gh08')}" === 'false') {
this.$message.warning("该活动只支持基层工会主席报名,个人报名请前往移动端")
return
}
if (item.url) { if (item.url) {
sublime.jumpPagePjax(item.url) sublime.jumpPagePjax(item.url)
} else if (item.url) { } else if (item.url) {