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 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
@@ -126,7 +126,7 @@ public class PwdUtil {
// System.out.println(dbPwd);
// System.out.println(s);
String pwd = "123456";
String pwd = "002154";
String dbPwd = PwdUtil.doSm4CbcEncrypt(pwd);
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.shiro.exception.CaptchaEmptyException;
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 lombok.extern.slf4j.Slf4j;
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.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Attr;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@@ -140,7 +138,7 @@ public class SysWechatController {
String loginName = Optional.ofNullable(sysUser).map(Sys_user::getLoginname).orElse(null);
try {
loginUtil.doLogin(loginName, request, session, LoginUtil.LoginOrigin.WEI_XIN);
loginUtil.doLogin(loginName, request, session, LoginUtil.LoginOrigin.WEI_XIN_SUCCESS);
if (StrUtil.isNotBlank(redirect)) {
return ">>:" + redirect;
}
@@ -151,9 +149,6 @@ public class SysWechatController {
} catch (UnknownAccountException e) {
request.setAttribute("errMsg", "系统中没有此用户");
return ">>:" + Globals.AppDomain + "/error/UnknownAccountError.html";
} catch (AuthenticationException e) {
request.setAttribute("errMsg", "系统中没有此用户");
return ">>:" + Globals.AppDomain + "/error/UnknownAccountError.html";
} catch (Exception e) {
request.setAttribute("errMsg", "用户名或密码错误");
return ">>:" + Globals.AppDomain + "/error/500.html";
@@ -162,7 +157,8 @@ public class SysWechatController {
@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) {
System.out.println(state);
@@ -32,7 +32,7 @@ public class EasyCredentialsMatch extends HashedCredentialsMatcher {
LoginUtil.LoginOrigin loginOrigin = platformCaptchaToken.getLoginOrigin();
//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;
}
@@ -94,7 +94,7 @@ public class PlatformAuthorizingRealm extends AuthorizingRealm {
throw Lang.makeThrow(AuthenticationException.class, "验证码失效,请重新获取");
}
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);
if (Strings.isBlank(loginname)) {
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)
&& !loginOrigin.equals(LoginUtil.LoginOrigin.WEI_XIN)) {
&& !loginOrigin.equals(LoginUtil.LoginOrigin.WEI_XIN_SUCCESS)) {
int errCount = NumberUtils.toInt(Strings.sNull(session.getAttribute("platformErrCount")));
if (errCount >= 4) {
//输错5次禁用账户10分钟
@@ -235,7 +235,7 @@ public class ActivityBasicScopeController {
$condition
""");
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"})) {
cnd.and("creator", "=", ShiroUtil.getPrincipalProperty("id"));
}
@@ -284,7 +284,7 @@ public class ActivityBasicScopeController {
addv("is_H04", ShiroUtil.hasRole("H04"));
addv("is_H02", ShiroUtil.hasRole("club01"));
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());
}};
}
@@ -97,7 +97,7 @@ public class ActivityBasicUserController {
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("u.personType", "=", personType);
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"));
}
@@ -202,7 +202,7 @@ public class ActivityUnionController {
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(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());
}
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderBy)) {
@@ -233,7 +233,7 @@ public class ActivityUnionController {
try {
union.setSource("activity");
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()));
}
return Result.success();
@@ -1,10 +1,10 @@
package io.v.nutz.zhgh.activity.controller.school;
import cn.afterturn.easypoi.entity.ImageEntity;
import cn.wizzer.framework.base.Result;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
import com.deepoove.poi.data.PictureRenderData;
import com.deepoove.poi.data.PictureType;
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
import io.v.nutz.base.annontation.ViReturn;
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_user;
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.zhgh.activity.models.*;
import io.v.nutz.zhgh.activity.services.ActivitySchoolApplyService;
import io.v.nutz.zhgh.activity.services.ActivitySchoolService;
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.RequiresPermissions;
import org.ddr.poi.html.HtmlRenderPolicy;
import org.nutz.aop.interceptor.async.Async;
import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Chain;
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.Param;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* @author: Aaron
@@ -62,6 +59,7 @@ import java.util.stream.Collectors;
* @description: 活动报名
**/
@Slf4j
@IocBean
@Ok("json:full")
@At("/platform/activity/apply")
@@ -70,23 +68,16 @@ public class ActivityApplyController {
@Inject
private ActivitySchoolService activitySchoolService;
@Inject
protected SysUserService sysUserService;
@Inject
private ActivitySchoolApplyService activitySchoolApplyService;
@Inject
private ActivitySchoolTeamService activitySchoolTeamService;
@Inject
private SimpleService simpleService;
@Inject("ActivitySchoolEvent")
private ViService<ActivitySchoolEvent> activitySchoolEventViService;
@Inject
private OfficeTemplateUtil officeTemplateUtil;
@Inject
@@ -196,7 +187,7 @@ public class ActivityApplyController {
// 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("(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());
if (!ShiroUtil.hasAnyRoles("H04,sysadmin")) {
if (!ShiroUtil.hasAnyRoles("H04,sysadmin,SCHOOL_UNION_SPORTS_ADMIN")) {
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())));
}
@@ -833,15 +824,16 @@ public class ActivityApplyController {
@At
@ViReturn
@RequiresPermissions("activity.apply")
public Object dshApplyUserList(
@Param(value = "activityId", required = false) String activityId,
@Param(value = "eventId", required = false) String eventId) {
public Object dshApplyUserList(@Param(value = "activityId", required = false) String activityId,
@Param(value = "eventId", required = false) String eventId,
@Param(value = "activityIsAudit", required = false) String activityIsAudit) {
Sql sql = Sqls.create("""
SELECT
asa.id,
asa.username,
asa.loginname,
asa.sex,
asa.mobile,
asa.identity,
asa.`status`,
asa.applyUserSign,
@@ -849,9 +841,23 @@ public class ActivityApplyController {
FROM
`activity_school_apply` asa
LEFT JOIN sys_user us ON asa.applyUser = us.id
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());
$condition
""");
// 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);
}
@@ -888,6 +894,12 @@ public class ActivityApplyController {
return null;
}
/**
* 下载签名告知书
* @param activityId
* @param response
*/
@At
@Ok(("void"))
@RequiresPermissions("activity.apply")
@@ -896,26 +908,44 @@ public class ActivityApplyController {
ActivitySchool school = simpleService.dao().fetch(ActivitySchool.class, activityId);
List<ActivitySchoolApply> schoolApplyList = simpleService.dao().query(ActivitySchoolApply.class,
Cnd.where("activityId", "=", activityId)
.and("status", "=", 2)
.and("status", "=", 2).and("unionId", "=", Vi.getUnionId())
.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());
signList.add(NutMap.NEW().addv("sign", new PictureRenderData(70, 30, ".png", bytes)));*/
}
List<NutMap> signList = schoolApplyList.stream().map(v -> {
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<>();
// 平均分组签字
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("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-Disposition", "attachment; filename=\"" + new String((school.getName() + "自愿参赛责任及风险告知书").getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\".docx");
ServletOutputStream outputStream = response.getOutputStream();
@@ -923,8 +953,19 @@ public class ActivityApplyController {
} catch (Exception e) {
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
""").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 + "' ");
}
@@ -245,7 +245,7 @@ public class ActivityCommonController {
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);
}
@@ -117,7 +117,7 @@ public class ActivityInfoManageController {
} else if ("four".equals(query)) {
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")) {
cnd.and("school.belongUnionId", "=", Vi.getUnionId());
}
@@ -88,7 +88,7 @@ public class ActivityReadingController {
cnd.and("close", "!=", true);
cnd.and("YEAR(startTime)", "=", year);
cnd.and("activityLevel", "=", activityLevel);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (activityLevel.equals("40002")) {
cnd.and("belongUnionId", "=", getUnionId());
}
@@ -135,7 +135,7 @@ public class ActivityReadingController {
cnd.and("app.activityId", "=", id);
// cnd.and("YEAR(app.applyDate)", "=", year);
sql.setCondition(cnd);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasRole("H04") && activityLevel.equals("40002")) {
cnd.and("app.activityUnionId", "=", basicUnit.getUnionid());
cnd.and("school.belongUnionId", "=", basicUnit.getUnionid());
@@ -150,7 +150,7 @@ public class ActivityReadingController {
List<NutMap> apply = new ArrayList();
Cnd unionCnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasRole("H04")) {
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())) {
setObj(v.getLoginName() + "此用户不是本工会人员");
throw new RuntimeException(v.getLoginName() + "此用户不是本工会人员");
@@ -214,7 +214,7 @@ public class ActivityRemindController {
@ViReturn
public Object getActivitys() {
Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasRole("H04")) {
cnd.and("belongUnionId", "=", Vi.getUnionId());
}
@@ -79,7 +79,7 @@ public class SiteRecordController {
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());
}
if (Strings.isNotBlank(time)) {
@@ -100,7 +100,7 @@ public class SiteReserveController {
if (StrUtil.isNotBlank(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"));
}
if (Strings.isNotBlank(time)) {
@@ -84,7 +84,7 @@ public class SiteUnionProcessController {
CndPlus cnd = CndPlus.create();
cnd.and("asr.reserve_state", "true".equals(isAudit) ? ">" : "false".equals(isAudit) ? "=" : ">=", 6098);
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());
}
if (Strings.isNotBlank(time)) {
@@ -101,7 +101,7 @@ public class ActivityUnionApplyUserController {
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())));
}
@@ -124,7 +124,7 @@ public class ActivityUnionManageController {
Sql sql = Sqls.create("""
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) {
cnd.and("unionId", "=", Vi.getUnionId());
} else if (activity_type == 40003) {
@@ -158,7 +158,7 @@ public class ActivityUnionManageController {
tissue.setUserId(ShiroUtil.getUserId());
}
tissue.setApplyTime(DateUtil.getDate());
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
tissue.setState(1);
} else {
tissue.setState(3);
@@ -86,7 +86,7 @@ public class ActivityUnionUserStatisticsController {
Cnd cnd = Cnd.NEW();
cnd.and("atp.tissueId", "=", activityId);
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 (type == 40002) {
cnd.and("unionId", "=", Vi.getUnionId());
@@ -110,13 +110,13 @@ public class ActivityUnionYearSummaryController {
str += " left join `user` u on su.userId = u.id";
if ("2".equals(summaryFrom)) {
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());
}
}
if ("3".equals(summaryFrom)) {
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());
}
}
@@ -2,6 +2,7 @@ package io.v.nutz.zhgh.activity.models;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
@@ -17,6 +18,14 @@ public class ActivityMobileSignUpParam {
private List<String> userIds;
private List<teamUserInfo> teamUserInfos;
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);
}
if (!ShiroUtil.hasAnyRoles("sysadmin,H10,A06")) {
if (!ShiroUtil.hasAnyRoles("sysadmin,H10,A06,SCHOOL_UNION_SPORTS_ADMIN")) {
if (ShiroUtil.hasRole("H04")) {
cnd.and("tissueId", "in", vi.getMangeUnionStr());
} else if (ShiroUtil.hasRole("club01")) {
@@ -76,7 +76,7 @@ public class ActivityTissueServiceImpl extends ViServiceImpl<ActivityTissue> imp
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());
/* if (ShiroUtil.hasRole("H04")) {
cnd.and("tissue.unionId", "in", vi.getMangeUnionStr());
@@ -66,6 +66,7 @@ public class mobileActivityListController {
@Param(value = "eventId", required = false) String eventId,
@Param(value = "applyUserSign", required = false) String applyUserSign,
@Param(value = "teamId", required = false) String teamId,
@Param(value = "mobile", required = false) String mobile,
@Param(value = "teamName", required = false) String teamName) {
User user = baseService.dao().fetch(User.class, Cnd.where("id", "=", ShiroUtil.getUserId()));
@@ -84,7 +85,7 @@ public class mobileActivityListController {
schoolApply.setTeam(teamName);
schoolApply.setApplyUser(user.getId());
schoolApply.setUserId(user.getId());
schoolApply.setMobile(user.getMobile());
schoolApply.setMobile(mobile);
schoolApply.setSex(user.getSex());
schoolApply.setUnitId(user.getUnitid());
schoolApply.setUnionId(user.getUnionid());
@@ -268,7 +269,7 @@ public class mobileActivityListController {
@ViReturn
@RequiresAuthentication
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;
}
@@ -1,11 +1,24 @@
package io.v.nutz.zhgh.mobile.activity.Sports.service;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.zhgh.activity.models.ActivityMobileSignUpParam;
import io.v.nutz.zhgh.activity.models.ActivitySchoolApply;
import java.util.List;
public interface MobileActivityApplyService extends BaseService<ActivitySchoolApply> {
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.mobile.activity.Sports.service.MobileActivityApplyService;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.web.filter.mgt.DefaultFilter;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import java.util.ArrayList;
import java.util.List;
import static org.apache.shiro.web.filter.mgt.DefaultFilter.user;
/**
* @ClassName ActivitySchoolApplyServiceImpl
* @Description TODO
@@ -39,16 +34,24 @@ public class MobileActivityApplyServiceImpl extends BaseServiceImpl<ActivityScho
}
@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<>();
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);
});
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);
User user = dao().fetch(User.class, Cnd.where("id", "=", userId));
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.setApplyUser(ShiroUtil.getUserId());
schoolApply.setUserId(userId);
schoolApply.setMobile(user.getMobile());
schoolApply.setMobile(mobile);
schoolApply.setSex(user.getSex());
schoolApply.setUnitId(user.getUnitid());
schoolApply.setUnionId(user.getUnionid());
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.mobile;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.utils.LoginUtil;
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.Cnd;
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.IocBean;
import org.nutz.lang.Strings;
@@ -127,22 +126,24 @@ public class mobileLoginController {
@Param("isFirstLogin") boolean isFirstLogin, @Param("newPwd") String newPwd) {
Sys_user user = dao.fetch(Sys_user.class, Cnd.where("id", "=", ShiroUtil.getUserId()));
if (isFirstLogin) {
sourcePwd = user.getLoginname();
if (!isFirstLogin) {
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 (!userSourcePwd.equals(sourcePwd)) {
return Result.error("原密码错误");
}
if (userSourcePwd.equals(newPwd)) {
return Result.error("新密码不能与原密码相同");
if (user.getLoginname().equals(newPwd)) {
return Result.error("请勿以工号作为密码");
}
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());
return Result.success("修改成功");
@@ -156,10 +157,11 @@ public class mobileLoginController {
@At
@RequiresAuthentication
public Object checkIsFirstLogin(){
Sql sql = Sqls.create("select weAppLoginCount from sys_user where id = @userId").setParam("userId", ShiroUtil.getUserId());
sql.setCallback(Sqls.callback.integer());
dao.execute(sql);
int count = sql.getInt();
return count == 0 ? Result.error() : Result.success();
Sys_user user = dao.fetch(Sys_user.class, Cnd.where("id", "=", ShiroUtil.getUserId()));
if ((user.getWeAppLoginCount() == null || user.getWeAppLoginCount() == 1) && StrUtil.isNotBlank(user.getOpenId())) {
return Result.error();
} else {
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>
<div id="app" v-cloak>
<van-nav-bar :title="title"
@click-left="pjaxReplace('/mobile/activity/Sports/list/activityList')" fixed
left-arrow
placeholder></van-nav-bar>
<van-nav-bar :title="title" @click-left="pjaxReplace('/mobile/activity/Sports/list/activityList')" fixed left-arrow placeholder></van-nav-bar>
<div class="search-fixed">
<van-dropdown-menu active-color="#1989fa">
<!-- <van-dropdown-item v-model="pageForm.isMenWomen" @change="yearChange"
:options="sexList"></van-dropdown-item>-->
<van-dropdown-item v-model="pageForm.groupName" @change="yearChange"
:options="groupList"></van-dropdown-item>
<van-dropdown-item :options="eventList" @change="yearChange"
v-model="pageForm.eventId"></van-dropdown-item>
<van-dropdown-item :options="auditList" @change="yearChange"
v-model="pageForm.isAudit"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.groupName" @change="yearChange" :options="groupList"></van-dropdown-item>
<van-dropdown-item :options="eventList" @change="yearChange" v-model="pageForm.eventId"></van-dropdown-item>
<van-dropdown-item :options="auditList" @change="yearChange" v-model="pageForm.isAudit"></van-dropdown-item>
</van-dropdown-menu>
</div>
@@ -51,20 +45,16 @@ layout("/mobile/platform.html"){
mode="closeable"
text="自己报名的项目如要修改请点击取消报名后再重新报名,若其他人帮助报名则联系报名人取消!"
></van-notice-bar>
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
v-model="loading" @load="pageData">
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" v-model="loading" @load="pageData">
<div v-for="o in tableData" class="van-doc-card">
<van-row>
<van-col span="24" class="username">
{{ o.allName }}
<div v-if="o.status"
style="display: flex;justify-content: flex-end">
<div v-if="o.status" style="display: flex; justify-content: flex-end">
<span v-if="o.status===1">待审核</span>
<span v-if="o.status===2">已成功报名</span>
<span v-if="o.status===3">审核不通过</span>
</div>
</van-col>
</van-row>
@@ -106,9 +96,7 @@ layout("/mobile/platform.html"){
<van-row class="info" v-if="o.projectType==2">
<van-col span="24">
<van-cell title="可报队数:">
{{ o.restrictTotalTeam }}队
</van-cell>
<van-cell title="可报队数:">{{ o.restrictTotalTeam }}队</van-cell>
</van-col>
</van-row>
@@ -116,16 +104,11 @@ layout("/mobile/platform.html"){
<van-col span="24">
<span>每队可报人数:</span>
<span v-if="o.athletesMaxNum">{{ o.athletesMaxNum }}人</span>
<span v-else-if="o.applyType===1">{{
o.athletesMaxNum * o.restrictTotalTeam
}}人</span>
<span v-else-if="o.applyType===2&&o.eveProjectType==='1'">{{
o.athletesMaxNum
}}人</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-if="o.applyType===1">{{ o.athletesMaxNum * o.restrictTotalTeam }}人</span>
<span v-else-if="o.applyType===2&&o.eveProjectType==='1'">{{ o.athletesMaxNum }}人</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>
</van-col>
</van-row>
@@ -142,18 +125,13 @@ layout("/mobile/platform.html"){
v-else-if="o.totalApplyNum>0&&o.applyType===3">{{ o.totalApplyNum }}人</span>
<span v-else>0人</span>-->
<span>{{o.totalApplyNum}}</span>
</van-col>
</van-row>
<van-row class="info"
v-if="JSON.parse(o.applyWay).length===2&&JSON.parse(o.applyWay).includes(1)">
<van-row class="info" v-if="JSON.parse(o.applyWay).length===2&&JSON.parse(o.applyWay).includes(1)">
<van-col span="24">
<span>已报名人员:</span>
<span v-if="o.userApplyNames" style="color: #0e78c5"
@click="openApplyUser(o)">{{
o.userApplyNames
}}</span>
<span v-if="o.userApplyNames" style="color: #0e78c5" @click="openApplyUser(o)">{{ o.userApplyNames }}</span>
<span v-else>未报名</span>
</van-col>
</van-row>
@@ -161,19 +139,23 @@ layout("/mobile/platform.html"){
<van-row class="info">
<van-col span="24">
<div class="register-icon">
<img v-if="o.userApply==0&&o.applyWay.includes(1)"
@click="openActivity(o)"
src="/assets/mobile/svg/activity/wbm.svg" />
<img v-if="o.userApply>0&&o.applyWay.includes(1)&&o.applyUser===userId"
@click="openActivity(o)"
src="/assets/mobile/svg/activity/qxbm.svg" />
<van-button style="border-radius: 10px" block size="small"
type="info"
@click="openSign(o)"
v-if="o.userApply>0
<img v-if="o.userApply==0&&o.applyWay.includes(1)" @click="openActivity(o)" src="/assets/mobile/svg/activity/wbm.svg" />
<img
v-if="o.userApply>0&&o.applyWay.includes(1)&&o.applyUser===userId"
@click="openActivity(o)"
src="/assets/mobile/svg/activity/qxbm.svg"
/>
<van-button
style="border-radius: 10px"
block
size="small"
type="info"
@click="openSign(o)"
v-if="o.userApply>0
&&o.applyWay.includes(1)
&&o.applyUser!==userId
&&o.isSign&&!o.applyUserSign">
&&o.isSign&&!o.applyUserSign"
>
签 字
</van-button>
</div>
@@ -183,184 +165,148 @@ layout("/mobile/platform.html"){
</van-list>
</div>
<van-action-sheet v-model="teamSignUpShow" :close-on-click-overlay="false"
:style="{ height: '100%',width:'100%' ,'overflow-y':'visible'}"
:title="isView?'查看报名信息':'组队报名'">
<div class="van-card-header">
本人信息
</div>
<van-action-sheet
v-model="teamSignUpShow"
:close-on-click-overlay="false"
:style="{ height: '100%',width:'100%' ,'overflow-y':'visible'}"
:title="isView?'查看报名信息':'组队报名'"
>
<div class="van-card-header">本人信息</div>
<div class="van-card-body">
<van-field label="姓名" readonly
v-model="userName"></van-field>
<van-field label="工号" readonly
v-model="loginName"></van-field>
<van-field label="姓名" readonly v-model="userName"></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="unitName"></van-field>
<van-field label="所属工会" readonly
v-model="unionName"></van-field>
<van-field label="联系方式" v-model="formData.mobile" placeholder="请输入联系方式" type="tel" maxlength="11"></van-field>
<van-field label="所在单位" readonly v-model="unitName"></van-field>
<van-field label="所属工会" readonly v-model="unionName"></van-field>
<van-field label="签字" readonly v-if="activityData.isSign&&isView">
<template #input>
<van-image
: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>
</template>
</van-field>
</div>
<template
v-for="(item,index) in registerList.filter(v=>v.loginName !== loginName)">
<template v-for="(item,index) in registerList.filter(v=>v.loginName !== loginName)">
<div class="van-card-header">
队友信息{{ 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 class="van-card-body">
<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.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.unionName"></van-field>
<van-field label="签字" readonly v-if="activityData.isSign&&isView">
<template #input>
<van-image
: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>
</template>
</van-field>
</div>
</template>
<div
v-if="registerList.filter(v=>v.loginName !== loginName).length === 0">
<div style="padding: 10px 10px;text-align: center;color: #9b9999;">
暂无队友信息,请点击添加队友按钮
</div>
<div v-if="registerList.filter(v=>v.loginName !== loginName).length === 0">
<div style="padding: 10px 10px; text-align: center; color: #9b9999">暂无队友信息,请点击添加队友按钮</div>
</div>
<div style="margin: 20px 20px 10px 20px" v-if="!isView">
<div class="van-card-header">
签字
</div>
<div class="van-card-header">签字</div>
<div class="van-card-body">
<mobile-sign ref="signature" :my_sign.sync="formData.applyUserSign"
:is_value_base64="false"></mobile-sign>
<mobile-sign ref="signature" :my_sign.sync="formData.applyUserSign" :is_value_base64="false"></mobile-sign>
</div>
</div>
<div style="display: flex;justify-content: center" v-if="!isView">
<van-radio-group v-model="formData.isCy" direction="horizontal"
v-if="activityData.isSign">
<div style="display: flex; justify-content: center" v-if="!isView">
<van-radio-group v-model="formData.isCy" direction="horizontal" v-if="activityData.isSign">
<van-radio name="1"></van-radio>
<span style="color: red"
@click="fxgzsActionPopup=true">自愿参赛责任及风险告知书</span>
<span style="color: red" @click="fxgzsActionPopup=true">我已阅读参赛责任及风险告知书</span>
</van-radio-group>
</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-col span="12">
<van-button @click="openUserActionSheet" style="border-radius: 10px" block
type="info">
添加队友
</van-button>
<van-button @click="openUserActionSheet" style="border-radius: 10px" block type="info">添加队友</van-button>
</van-col>
<van-col span="12">
<van-button @click="doTeamSignUp()" style="border-radius: 10px" block
type="info">
提 交
</van-button>
<van-button @click="doTeamSignUp()" style="border-radius: 10px" block type="info">提 交</van-button>
</van-col>
</van-row>
</div>
</van-action-sheet>
<van-action-sheet v-model="userActionSheet" title="选择人员" class="userActionPopup">
<van-search v-model="searchKey" @search="onSearchUser" show-action
placeholder="请输入姓名或者工号搜索">
<van-search v-model="searchKey" @search="onSearchUser" show-action placeholder="请输入姓名或者工号搜索">
<template #action>
<div @click="onSearchUser">搜索</div>
</template>
</van-search>
<div class="van-action-sheet__content mt5 user-select-sheet"
v-if="searchUserList && searchUserList.length>0">
<div class="van-action-sheet__content mt5 user-select-sheet" v-if="searchUserList && searchUserList.length>0">
<template v-if="searchLoading">
<van-loading size="24px" vertical>搜索中...</van-loading>
</template>
<template v-if="!searchLoading">
<template v-for="item in searchUserList"
v-if="!registerList.map(v=>v.id).includes(item.id)">
<button @click="searchUserAdd(item)"
class="van-action-sheet__item">
<span class="van-action-sheet__name"
style="display: flex;flex-direction: column">
<div style="display: flex;justify-content: center;">
{{ item.userName }}-{{ item.loginName }}-{{item.sex}}
</div>
<div>
{{ item.unitName }}
</div>
</span>
<template v-for="item in searchUserList" v-if="!registerList.map(v=>v.id).includes(item.id)">
<button @click="searchUserAdd(item)" class="van-action-sheet__item">
<span class="van-action-sheet__name" style="display: flex; flex-direction: column">
<div style="display: flex; justify-content: center">{{ item.userName }}-{{ item.loginName }}-{{item.sex}}</div>
<div>{{ item.unitName }}</div>
</span>
</button>
</template>
</template>
</div>
<van-empty v-else image="search" description="请输入姓名或者工号搜索"></van-empty>
</van-action-sheet>
<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 v-model="signActionPopup" title="签字">
<div class="van-card-header">
签字
</div>
<div class="van-card-header">签字</div>
<div class="van-card-body">
<mobile-sign ref="signature" :my_sign.sync="formData.applyUserSign"
:is_value_base64="false"></mobile-sign>
<mobile-sign ref="signature" :my_sign.sync="formData.applyUserSign" :is_value_base64="false"></mobile-sign>
</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 name="1"></van-radio>
<span style="color: red"
@click="fxgzsActionPopup=true">自愿参赛责任及风险告知书</span>
<span style="color: red" @click="fxgzsActionPopup=true">自愿参赛责任及风险告知书</span>
</van-radio-group>
</div>
<van-row gutter="20">
<van-col span="24">
<van-button @click="doSign()" style="border-radius: 10px" block
type="info">
提 交
</van-button>
<van-button @click="doSign()" style="border-radius: 10px" block type="info">提 交</van-button>
</van-col>
</van-row>
</van-action-sheet>
<van-action-sheet v-model="activityDialog" :close-on-click-overlay="false"
:style="{ height: '100%',width:'100%' ,'overflow-y':'visible'}"
title="项目报名">
<div class="van-card-header">
本人信息
</div>
<van-action-sheet
v-model="activityDialog"
:close-on-click-overlay="false"
:style="{ height: '100%',width:'100%' ,'overflow-y':'visible'}"
title="项目报名"
>
<div class="van-card-header">本人信息</div>
<div class="van-card-body">
<van-field label="姓名" readonly
v-model="userName"></van-field>
<van-field label="工号" readonly
v-model="loginName"></van-field>
<van-field label="姓名" readonly v-model="userName"></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="unitName"></van-field>
<van-field label="所属工会" readonly
v-model="unionName"></van-field>
<van-field label="联系方式" v-model="formData.mobile" placeholder="请输入联系方式" type="tel" maxlength="11"></van-field>
<van-field label="所在单位" readonly v-model="unitName"></van-field>
<van-field label="所属工会" readonly v-model="unionName"></van-field>
<van-radio-group v-model="formData.teamId" v-if="projectType==2">
<van-cell-group>
<template v-for="i in teams">
@@ -372,28 +318,20 @@ layout("/mobile/platform.html"){
</template>
</van-cell-group>
</van-radio-group>
</div>
<div class="van-card-header">
签字
</div>
<div class="van-card-header">签字</div>
<div class="van-card-body">
<mobile-sign ref="signature" :my_sign.sync="formData.applyUserSign"
:is_value_base64="false"></mobile-sign>
<mobile-sign ref="signature" :my_sign.sync="formData.applyUserSign" :is_value_base64="false"></mobile-sign>
</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 name="1"></van-radio>
<span style="color: red"
@click="fxgzsActionPopup=true">自愿参赛责任及风险告知书</span>
<span style="color: red" @click="fxgzsActionPopup=true">我已阅读参赛责任及风险告知书</span>
</van-radio-group>
</div>
<van-row gutter="20">
<van-col span="24">
<van-button @click="doActivityConfirm()" style="border-radius: 10px" block
type="info">
提 交
</van-button>
<van-button @click="doActivityConfirm()" style="border-radius: 10px" block type="info">提 交</van-button>
</van-col>
</van-row>
</van-action-sheet>
@@ -410,9 +348,7 @@ layout("/mobile/platform.html"){
</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>
<script>
@@ -431,7 +367,8 @@ layout("/mobile/platform.html"){
teamId: null,
teamName: null,
activityId: "",
eventId: ""
eventId: "",
mobile: null
},
title: "活动报名",
projectType: "",
@@ -482,42 +419,43 @@ layout("/mobile/platform.html"){
methods: {
doSign() {
if (this.activityData.isSign && !this.formData.applyUserSign) {
this.$dialog.alert({
title: "温馨提示",
message: "请签字后再提交!"
}).then(() => {
})
this.$dialog
.alert({
title: "温馨提示",
message: "请签字后再提交!"
})
.then(() => {})
return
}
if (this.activityData.isSign && !this.formData.isCy) {
this.$dialog.alert({
title: "温馨提示",
message: "请先阅读自愿参赛责任及风险告知书!"
}).then(() => {
})
this.$dialog
.alert({
title: "温馨提示",
message: "请先阅读自愿参赛责任及风险告知书!"
})
.then(() => {})
return
}
this.$dialog.confirm({
title: "提示",
message: "您确认要提交吗?"
}).then(() => {
$.post("/mobile/activity/Sports/list/doSign", {
applyUserSign: this.formData.applyUserSign,
activityId: this.activityData.activityId,
eventId: this.activityData.eventId
}).then(resp => {
if (resp.code === 0) {
this.$toast.success("提交成功!")
window.location.reload()
} else {
this.$toast.fail(resp.msg)
}
this.$dialog
.confirm({
title: "提示",
message: "您确认要提交吗?"
})
.then(() => {
$.post("/mobile/activity/Sports/list/doSign", {
applyUserSign: this.formData.applyUserSign,
activityId: this.activityData.activityId,
eventId: this.activityData.eventId
}).then((resp) => {
if (resp.code === 0) {
this.$toast.success("提交成功!")
window.location.reload()
} else {
this.$toast.fail(resp.msg)
}
})
})
})
},
openSign(row) {
this.activityData = row
@@ -530,9 +468,9 @@ layout("/mobile/platform.html"){
const resp = await this.selectRegisterList()
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) {
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.teamSignUpShow = true
@@ -543,66 +481,83 @@ layout("/mobile/platform.html"){
activityId: this.formData.activityId
})
return resp.data
},
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({
title: "温馨提示",
message: "请签字后再提交!"
}).then(() => {
message: "请正确填写本人的联系方式!"
})
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) {
this.$dialog.alert({
title: "温馨提示",
message: "请先阅读自愿参赛责任及风险告知书!"
}).then(() => {
})
this.$dialog
.alert({
title: "温馨提示",
message: "请先阅读自愿参赛责任及风险告知书!"
})
.then(() => {})
return
}
const {
athletesMaxNum,
startAgeDate,
endAgeDate,
isMenWomen,
restrictBoyNum,
restrictGirlNum
} = this.events.find(v => v.eventId === this.formData.eventId)
const { athletesMaxNum, startAgeDate, endAgeDate, isMenWomen, restrictBoyNum, restrictGirlNum } = this.events.find(
(v) => v.eventId === this.formData.eventId
)
if (restrictBoyNum > 0) {
if (this.registerList.filter(v => v.sex === "男").length !== restrictBoyNum) {
this.$dialog.alert({
title: "温馨提示",
message: "男运动员需要报名" + restrictBoyNum + "人才能提交!"
}).then(() => {
})
if (this.registerList.filter((v) => v.sex === "男").length !== restrictBoyNum) {
this.$dialog
.alert({
title: "温馨提示",
message: "男运动员需要报名" + restrictBoyNum + "人才能提交!"
})
.then(() => {})
return
}
}
if (restrictGirlNum > 0) {
if (this.registerList.filter(v => v.sex === "女").length !== restrictGirlNum) {
this.$dialog.alert({
title: "温馨提示",
message: "女运动员需要报名" + restrictGirlNum + "人才能提交!"
}).then(() => {
})
if (this.registerList.filter((v) => v.sex === "女").length !== restrictGirlNum) {
this.$dialog
.alert({
title: "温馨提示",
message: "女运动员需要报名" + restrictGirlNum + "人才能提交!"
})
.then(() => {})
return
}
}
this.addRegisterList = await this.selectRegisterList()
let arr = []
if (this.addRegisterList && this.addRegisterList.length > 0) {
this.registerList.forEach(r => {
const num = this.addRegisterList.filter(a => Number(a.id) === r.id).length
this.registerList.forEach((r) => {
const num = this.addRegisterList.filter((a) => Number(a.id) === r.id).length
if (num === this.formData.restrictRegNumber) {
arr.push(r.userName)
}
@@ -610,28 +565,33 @@ layout("/mobile/platform.html"){
}
if (arr && arr.length > 0) {
this.$dialog.alert({
title: "温馨提示",
message: "【" + arr.toString() + "】已达到限报数量,您无法添加其组队!"
}).then(() => {
})
this.$dialog
.alert({
title: "温馨提示",
message: "【" + arr.toString() + "】已达到限报数量,您无法添加其组队!"
})
.then(() => {})
return
}
this.$modal.confirm("您确定要提交吗?").then(async () => {
this.$modal.confirm("请确保手机号填写正确,您确定要提交吗?").then(async () => {
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", {
activityId: this.formData.activityId,
eventId: this.formData.eventId,
teamId: this.formData.teamId,
teamName: this.formData.teamName,
userIds: JSON.stringify(userIds),
applyUserSign: this.formData.applyUserSign
applyUserSign: this.formData.applyUserSign,
teamUserInfos: JSON.stringify(teamUserInfos)
})
await this.onRefresh()
this.teamSignUpShow = false
@@ -639,27 +599,26 @@ layout("/mobile/platform.html"){
})
},
searchUserAdd(item) {
const {
restrictBoyNum,
restrictGirlNum
} = 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)
const { restrictBoyNum, restrictGirlNum } = 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 === "男") {
this.$dialog.alert({
title: "温馨提示",
message: "男教师报名人数已满"
}).then(() => {
})
this.$dialog
.alert({
title: "温馨提示",
message: "男教师报名人数已满"
})
.then(() => {})
return
}
if (restrictGirlNum > 0 && nvRegisterList.length === restrictGirlNum && item.sex === "女") {
this.$dialog.alert({
title: "温馨提示",
message: "女教师报名人数已满"
}).then(() => {
})
this.$dialog
.alert({
title: "温馨提示",
message: "女教师报名人数已满"
})
.then(() => {})
return
}
@@ -692,14 +651,16 @@ layout("/mobile/platform.html"){
this.$toast.fail("因为是组队报名,自己不能删除")
return
}
this.$dialog.confirm({
title: "提示",
message: "您确认要删除吗?"
}).then(() => {
const index = this.registerList.findIndex(v => v.id === item.id)
this.registerList.splice(index, 1)
}).catch(() => {
})
this.$dialog
.confirm({
title: "提示",
message: "您确认要删除吗?"
})
.then(() => {
const index = this.registerList.findIndex((v) => v.id === item.id)
this.registerList.splice(index, 1)
})
.catch(() => {})
},
openUserActionSheet() {
this.searchKey = ""
@@ -708,27 +669,34 @@ layout("/mobile/platform.html"){
this.userActionSheet = true
},
onBeforeClose(action, done) {
return done(false)
},
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({
title: "温馨提示",
message: "请签字后再提交!"
}).then(() => {
message: "请正确填写参赛人员联系方式!"
})
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
}
if (this.formData.teamId == null && this.projectType == 2) {
@@ -749,10 +717,12 @@ layout("/mobile/platform.html"){
return
}
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.activityDialog = false
this.$modal.confirm("请确保手机号填写正确,您确定要提交吗?").then(async () => {
await $.post("/mobile/activity/Sports/list/doActivity", this.formData)
await this.onRefresh()
this.activityDialog = false
})
}
},
async openActivity(o) {
@@ -810,7 +780,7 @@ layout("/mobile/platform.html"){
userId: "${@shiro.getPrincipalProperty('id')}",
activityId: activityId,
eventId: eventId
}).then(resp => {
}).then((resp) => {
if (resp.code === 0) {
this.onRefresh()
this.teamSignUpShow = false
@@ -823,14 +793,7 @@ layout("/mobile/platform.html"){
return
}
const {
athletesMaxNum,
startAgeDate,
endAgeDate,
isMenWomen,
restrictBoyNum,
restrictGirlNum
} = this.events.find(
const { athletesMaxNum, startAgeDate, endAgeDate, isMenWomen, restrictBoyNum, restrictGirlNum } = this.events.find(
(v) => v.id === eventId
)
if (isMenWomen) {
@@ -911,8 +874,6 @@ layout("/mobile/platform.html"){
this.teamSignUpShow = true
return
}
} else {
if (isMenWomen != null && isMenWomen == 1 && "${@shiro.getPrincipalProperty('sex')}" != "男") {
this.$toast("此项目只能男性老师才能报名!")
@@ -1048,7 +1009,7 @@ layout("/mobile/platform.html"){
}
.van-card-body {
padding: 0px 10px 0px 10px
padding: 0px 10px 0px 10px;
}
.user-select-sheet {
@@ -18,73 +18,64 @@ layout("/mobile/platform.html"){
</style>
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar title="活动列表" left-arrow placeholder fixed
@click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
<van-nav-bar title="活动列表" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
<div class="search-fixed">
<van-dropdown-menu active-color="#1989fa">
<van-dropdown-item v-model="pageForm.year" :options="yearList"
@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.year" :options="yearList" @change="getActivityData"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.isActivity" :options="activityList" @change="getActivityData"></van-dropdown-item>
</van-dropdown-menu>
</div>
<div style="margin: 60px auto 0 auto">
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''">
<div v-for="o in tableData" class="list-card"
@click="openInfo(o)">
<div v-for="o in tableData" class="list-card" @click="openInfo(o)">
<van-cell-group inset>
<van-cell :border="false" title="活动名称">
<span class="van-ellipsis" style="font-size: 16px"
:style="{color:themeColor}">{{o.NAME}}</span>
<span class="van-ellipsis" style="font-size: 16px;white-space: normal !important;" :style="{color:themeColor}">{{o.NAME}}</span>
</van-cell>
<van-cell :border="false" title="活动地址">{{o.address}}</van-cell>
<van-cell :border="false" title="报名开始时间">
{{moment(o.applyStartTime).format('YYYY/MM/DD HH:mm')}}
</van-cell>
<van-cell :border="false" title="报名结束时间">
{{moment(o.applyEndTime).format('YYYY/MM/DD HH:mm')}}
<van-cell :border="false" title="报名时间">
{{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 :border="false" title="活动时间">
<span style="font-size: 12px">
{{moment(o.startTime).format('YYYY/MM/DD HH:mm')}} 至 {{moment(o.endTime).format('YYYY/MM/DD HH:mm')}}
</span>
</van-cell>-->
<van-cell :border="false" title="活动状态">
<van-tag type="warning"
v-if="moment(o.applyStartTime).valueOf() > moment().valueOf()">未开始
</van-tag>
<van-tag
type="primary"
v-else-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()"
>
报名中
</van-tag>
<van-tag
type="success"
v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()"
>
进行中
</van-tag>
<van-tag type="danger"
v-else-if="moment().valueOf() > moment(o.endTime).valueOf()">活动结束
</van-tag>
<div style="display: flex; justify-content: space-between">
<div>
<van-tag type="warning" v-if="moment(o.applyStartTime).valueOf() > moment().valueOf()">未开始</van-tag>
<van-tag
type="primary"
v-else-if="moment(o.applyEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.applyStartTime).valueOf()"
>
报名中
</van-tag>
<van-tag
type="success"
v-else-if="moment(o.startTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.endTime).valueOf()"
>
进行中
</van-tag>
<van-tag type="danger" v-else-if="moment().valueOf() > moment(o.endTime).valueOf()">活动结束</van-tag>
</div>
<van-button type="info" style="width: 90px" plain size="small" round @click="openInfo">查看详情</van-button>
</div>
</van-cell>
</van-cell-group>
</div>
</van-list>
</div>
<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>
<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"
style="position: fixed; bottom: 0; ">进入报名
</van-button>
<van-button type="primary" block @click="openApply" style="position: fixed; bottom: 40px">进入报名</van-button>
</van-action-sheet>
</div>
@@ -133,7 +124,6 @@ layout("/mobile/platform.html"){
openInfo(data) {
this.activityInfo = data
this.show = true
}
},
async created() {
+23 -8
View File
@@ -295,6 +295,7 @@ layout("/mobile/platform.html"){
<van-swipe :autoplay="3000" class="swiper">
<van-swipe-item v-for="(image, index) in images" :key="index">
<img :src="image" width="100%" />
<!-- <img v-lazy="image" width="100%" />-->
</van-swipe-item>
</van-swipe>
@@ -441,7 +442,7 @@ layout("/mobile/platform.html"){
<mobile-sign-points></mobile-sign-points>
</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-content">
<h2>{{ formData.isFirstLogin ? '首次登录,请修改密码' : '修改密码' }}</h2>
@@ -452,12 +453,12 @@ layout("/mobile/platform.html"){
<span class="toggle-password" data-target="current-password">🔒</span>
</div>
<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" />
<span class="toggle-password" data-target="new-password">🔒</span>
</div>
<div class="form-group">
<label for="confirm-password">确认新密码</label>
<label for="confirm-password">请再次输入新密码</label>
<input
type="password"
id="confirm-password"
@@ -487,7 +488,7 @@ layout("/mobile/platform.html"){
data() {
return {
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,
msgActive: "unread",
moduleMenus: [],
@@ -531,9 +532,23 @@ layout("/mobile/platform.html"){
if (!this.formData.isFirstLogin && !this.formData.sourcePwd) {
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)
if (resp.code === 0) {
this.$toast("修改成功")
this.formData = {
sourcePwd: "",
newPwd: "",
confirmPwd: ""
}
await this.getWeAppLoginCount()
this.updatePwdShow = false
} else {
this.$toast(resp.msg)
@@ -555,8 +570,8 @@ layout("/mobile/platform.html"){
checkConfirmPwd() {
// 检验输入是否大于6位数
if (!this.formData.confirmPwd) {
this.errorInfo = "请输入确认新密码"
this.$toast("请输入确认新密码")
this.errorInfo = "请再次输入新密码"
this.$toast("请再次输入新密码")
return
}
if (this.formData.confirmPwd.length < 6) {
@@ -565,8 +580,8 @@ layout("/mobile/platform.html"){
return
}
if (this.formData.newPwd !== this.formData.confirmPwd) {
this.errorInfo = "新密码与确认新密码不一致"
this.$toast("新密码与确认新密码不一致")
this.errorInfo = "新密码与再次输入新密码不一致"
this.$toast("新密码与再次输入新密码不一致")
return
}
this.errorInfo = ""
File diff suppressed because one or more lines are too long
@@ -4,7 +4,6 @@ layout("/layouts/platform.html"){
<style>
.query-row {
}
.query-title {
@@ -14,16 +13,12 @@ layout("/layouts/platform.html"){
}
.query-content {
}
</style>
<div id="app" v-cloak>
<guava>
<user-data-scope
ref="userDataScope"
:group_id.sync="formData.activityGroupId"
></user-data-scope>
<user-data-scope ref="userDataScope" :group_id.sync="formData.activityGroupId"></user-data-scope>
</guava>
<!--<guava>
<el-card shadow="never">
@@ -179,19 +174,19 @@ layout("/layouts/platform.html"){
<script>
const vue = new Vue({
el: '#app',
el: "#app",
mixins: [initTableMixins],
components: {
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
'user-data-scope': httpVueLoader('/components/plugins/UserDataScope.vue'),
"dict-select": httpVueLoader("/components/plugins/DictSelect.vue?v=1.0.0"),
"user-data-scope": httpVueLoader("/components/plugins/UserDataScope.vue")
},
computed: {
currentGroupName() {
if (this.pageForm.groupId) {
const group = this.activityGroupList.find(v => v.groupId === this.pageForm.groupId)
return group.groupName + '人员'
const group = this.activityGroupList.find((v) => v.groupId === this.pageForm.groupId)
return group.groupName + "人员"
}
return '全部人员'
return "全部人员"
}
},
data() {
@@ -208,33 +203,33 @@ layout("/layouts/platform.html"){
personTypes: [],
userStates: [],
memberStatus: [],
year: moment().format('YYYY')
year: moment().format("YYYY")
},
tableColumns: [
{prop: 'loginName', label: '工号'},
{prop: 'userName', label: '姓名'},
{prop: 'sex', label: '性别'},
{prop: 'birthday', label: '出生年月'},
{prop: 'mobile', label: '联系电话'},
{prop: 'personType', label: '人员类型', sortable: true},
{prop: 'userState', label: '在职状态', sortable: true},
{prop: 'unitName', label: '所属单位', sortable: true},
{prop: 'unionName', label: '所属工会', sortable: true},
{prop: 'activityUnionName', label: '活动工会', sortable: true},
{prop: 'groupName', label: '所属分组', sortable: true},
],
{ prop: "loginName", label: "工号" },
{ prop: "userName", label: "姓名" },
{ prop: "sex", label: "性别" },
{ prop: "birthday", label: "出生年月" },
{ prop: "mobile", label: "联系电话" },
{ prop: "personType", label: "人员类型", sortable: true },
{ prop: "userState", label: "在职状态", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true },
{ prop: "unionName", label: "所属工会", sortable: true },
{ prop: "activityUnionName", label: "活动工会", sortable: true },
{ prop: "groupName", label: "所属分组", sortable: true }
]
}
},
methods: {
async doDelete(id, groupId) {
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
const confirm = await this.$confirm("您确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === 'confirm') {
if (confirm === "confirm") {
this.pageForm.id = id
const resp = await $.post(loc() + '/doDelete', this.pageForm)
const resp = await $.post(loc() + "/doDelete", this.pageForm)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
@@ -243,7 +238,10 @@ layout("/layouts/platform.html"){
},
async flushUnits() {
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.ActivityUnits = await getActivityUnits(this.pageForm.activityUnionId)
} else {
@@ -252,7 +250,7 @@ layout("/layouts/platform.html"){
this.doSearch()
},
async getActivityGroup() {
const resp = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup')
const resp = await $.get("/platform/activity/basic/scope/getActivityUserScopeGroup")
this.activityGroupList = resp.data
if (resp.data && resp.data.length > 0) {
this.$set(this.pageForm, "groupId", resp.data[0].groupId)
@@ -265,7 +263,6 @@ layout("/layouts/platform.html"){
this.unions = await getUnions(null)
this.ActivityUnions = await getActivityUnions()
this.flushUnits()
}
})
</script>
@@ -142,6 +142,26 @@ layout("/layouts/platform.html"){
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>
<div class="platform" id="app" v-cloak>
@@ -235,12 +255,19 @@ layout("/layouts/platform.html"){
.format('YYYY/MM/DD HH:mm')}} 至
{{moment(item.applyEndTime).format('YYYY/MM/DD HH:mm')}}
</div>
<div class="text item" v-if="item.isSign">
<div style="display: flex;justify-content: flex-end">
<div class="text item" v-if="item.isSign" style="display: flex;justify-content: space-around;">
<div>
<el-button @click.stop="doExport"
size="mini"
type="primary">
下载风险告知书(签名)
</el-button>
</div>
<div>
<el-button @click.stop="openPromiseBook(item)"
size="mini"
type="primary">
上传风险告知书
上传风险告知书(盖章)
</el-button>
</div>
<!-- <span style="color: gray">活动时间:</span>
@@ -343,14 +370,15 @@ layout("/layouts/platform.html"){
</template>
<template scope="{row}" v-else-if="column.prop=='applyNum'">
<span v-if="row.successUserApply>0&&row.applyType !== 3">
{{row.successUserApply}}人</span>
<span
v-else-if="JSON.parse(row.applyWay).length===2&&row.applyWay.includes(1)">
{{row.totalApplyNum}}人</span>
<span v-else-if="row.totalApplyNum>0&&row.applyType === 3">
{{ row.totalApplyNum }}人</span>
<span v-else>0人</span>
{{ row.totalApplyNum }}
<!-- <span v-if="row.successUserApply>0&&row.applyType !== 3">-->
<!-- {{row.successUserApply}}人</span>-->
<!-- <span-->
<!-- v-else-if="JSON.parse(row.applyWay).length===2&&row.applyWay.includes(1)">-->
<!-- {{row.totalApplyNum}}人</span>-->
<!-- <span v-else-if="row.totalApplyNum>0&&row.applyType === 3">-->
<!-- {{ row.totalApplyNum }}人</span>-->
<!-- <span v-else>0人</span>-->
</template>
@@ -741,6 +769,10 @@ layout("/layouts/platform.html"){
<template #public>
<vi-title2 title="批量审核">
<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
icon="el-icon-check"
type="primary"
@@ -762,7 +794,7 @@ layout("/layouts/platform.html"){
type="primary"
size="small"
@click="doExport"
>下载风险告知书
>下载风险告知书(签名)
</el-button>
</template>
</vi-title2>
@@ -774,6 +806,7 @@ layout("/layouts/platform.html"){
row-key="id"
:size="tableSize"
class="vi-table"
:row-class-name="tableRowClassName"
@selection-change="dshHandleSelectionChange"
>
<el-table-column
@@ -807,6 +840,14 @@ layout("/layouts/platform.html"){
label="性别"
>
</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="身份">
<template scope="{row}">
<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>
</template>
</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"
@@ -854,8 +888,8 @@ layout("/layouts/platform.html"){
<el-image
:src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + row.applyUserSign"
fit="cover"
style="width: 100%; height: 100%;" v-if="row.applyUserSign"></el-image>
<span v-else>暂未签字</span>
style="height: 60px" v-if="row.applyUserSign"></el-image>
<el-tag type="warning" v-else>暂未签字</el-tag>
</template>
</el-table-column>
</el-table>
@@ -1158,6 +1192,8 @@ layout("/layouts/platform.html"){
</div>
<script>
// 颜色数组
const colors = ["yellow-row", "blue-row", "green-row", "red-row", "purple-row"];
//分组
const groupBy = (list, fn) => {
const groups = {}
@@ -1281,7 +1317,10 @@ layout("/layouts/platform.html"){
promiseBookFileList: [],
isPromiseBookFileView: true,
promiseBookDialogVisible: false
promiseBookDialogVisible: false,
// 活动审核相关
activityIsAudit: false
}
},
filters: {
@@ -1297,6 +1336,10 @@ layout("/layouts/platform.html"){
"delete_info": httpVueLoader("/components/activity/school/DeleteInfo.vue")
},
methods: {
tableRowClassName({ row }) {
debugger
return row.color;
},
doExport(){
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)
},
async openAuditApplyUser(data) {
this.eventData = data
if (data) {
this.eventData = data
}
const resp = await $.get("/platform/activity/apply/dshApplyUserList", {
activityId: data.activityId,
eventId: data.eventId
activityId: this.eventData.activityId,
eventId: this.eventData.eventId,
activityIsAudit: this.activityIsAudit
})
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.$refs.guava.public()
}
@@ -2438,6 +2499,9 @@ layout("/layouts/platform.html"){
const resp = await $.post(loc() + "/activityData", this.pageForm)
if (resp.code === 0) {
this.activityList = resp.data
if (this.activityList) {
await this.openApply(this.activityList[0])
}
} else {
this.notifyWarning(resp.msg)
}
@@ -55,8 +55,7 @@ layout("/layouts/platform.html"){
style="width: 100%"
@change="changeLevel"
>
<el-option v-for="item in activityTypeList" :key="item.code"
:label="item.name" :value="item.code"></el-option>
<el-option v-for="item in activityTypeList" :key="item.code" :label="item.name" :value="item.code"></el-option>
</el-select>
</div>
</div>
@@ -69,18 +68,13 @@ layout("/layouts/platform.html"){
placeholder="请选择活动"
@change="getData()"
>
<el-option v-for="item in activities" :label="item.name"
:value="item.id"></el-option>
<el-option v-for="item in activities" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
<div class="search-item">
<div class="search-item-label" v-if="pageForm.activityLevel!=='40003'">
基层工会
</div>
<div class="search-item-label" v-if="pageForm.activityLevel==='40003'">
协会名称
</div>
<div class="search-item-label" v-if="pageForm.activityLevel!=='40003'">基层工会</div>
<div class="search-item-label" v-if="pageForm.activityLevel==='40003'">协会名称</div>
<div class="search-item-option">
<el-select
style="width: 100%; font-weight: bold"
@@ -91,8 +85,7 @@ layout("/layouts/platform.html"){
@change="changeVVV"
@clear="changeVVV"
>
<el-option v-for="item in unions" :key="item.id"
:label="item.unionname" :value="item.id"></el-option>
<el-option v-for="item in unions" :key="item.id" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</div>
</div>
@@ -102,10 +95,8 @@ layout("/layouts/platform.html"){
<div class="search-item-label">报名状态</div>
<div class="search-item-option">
<el-radio-group v-model="pageForm.applyed">
<el-radio style="background-color: white" label="1" border>未报名
</el-radio>
<el-radio style="background-color: white" label="2" border>已报名
</el-radio>
<el-radio style="background-color: white" label="1" border>未报名</el-radio>
<el-radio style="background-color: white" label="2" border>已报名</el-radio>
</el-radio-group>
</div>
</div>
@@ -129,48 +120,41 @@ layout("/layouts/platform.html"){
<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-col :span="2">序号</el-col>
<el-col :span="4">年度</el-col>
<el-col :span="2">年度</el-col>
<el-col :span="6">
<span v-if="pageForm.activityLevel!=='40003'">基层工会名称</span>
<span v-if="pageForm.activityLevel==='40003'">协会名称</span>
</el-col>
<el-col :span="6">活动名称</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"
type="primary" @click="doExport">导 出
</el-button>-->
</el-col>
</el-row>
<el-table :data="[]" size="mini" v-if="noneData||tabLoading"
v-loading="tabLoading"></el-table>
<el-table :data="[]" size="mini" v-if="noneData||tabLoading" v-loading="tabLoading"></el-table>
<el-card v-else class="box-card mb10" v-for="app,tabIdx in apply" shadow="hover"
v-loading="tabLoading">
<el-card v-else class="box-card mb10" v-for="app,tabIdx in apply" shadow="hover" v-loading="tabLoading">
<div slot="header" class="clearfix">
<el-row :gutter="20">
<el-col :span="2">{{tabIdx + 1}}</el-col>
<el-col :span="2">{{pageForm.year}}</el-col>
<el-col :span="6">
{{isDisPlayCode?'('+app.unioncode+')':null}}{{app.unionname}}
</el-col>
<el-col :span="6">{{isDisPlayCode?'('+app.unioncode+')':null}}{{app.unionname}}</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-button @click="openPromiseBook(app)"
style="float: right; padding: 3px 5px"
type="text">查看承诺书
</el-button>
<el-button style="float: right; padding: 3px 5px"
@click="$set(app,'show',!app.show)" type="text">
{{app.num |money}} 人({{(app.promiseBookFiles&&app.promiseBookFiles.length>0)?'已上传风险告知书':'未上传'}})
</el-col>
<el-col :span="4">
<el-button @click="openPromiseBook(app)" style="float: right; padding: 3px 5px" type="text">查看风险告知书</el-button>
<el-button style="float: right; padding: 3px 5px" @click="$set(app,'show',!app.show)" type="text">
{{app.show?'折叠':'展开'}}
</el-button>
</el-col>
</el-row>
</div>
<transition name="el-fade-in-linear">
<div v-show="app.show" class="text item transition-box"
style="padding: 20px 20px">
<div v-show="app.show" class="text item transition-box" style="padding: 20px 20px">
<el-timeline v-if="pageForm.applyType===1||pageForm.applyType===3">
<!-- <el-timeline-item timestamp="领队信息" placement="top" v-if="app.leader.username!=null">
<el-card shadow="never">
@@ -244,8 +228,7 @@ layout("/layouts/platform.html"){
</el-timeline-item>-->
<el-timeline-item timestamp="运动员信息" placement="top">
<el-table border stripe :data="app.apply2" size="mini"
:key="tableKey">
<el-table border stripe :data="app.apply2" size="mini" :key="tableKey">
<el-table-column
type="index"
label="序号"
@@ -268,8 +251,7 @@ layout("/layouts/platform.html"){
<span v-if="row.team">{{ row.team }}</span>
<span v-if="!row.team">暂无</span>
</template>
<template scope="{row:{projectType}}"
v-else-if="column.prop=='projectType'">
<template scope="{row:{projectType}}" v-else-if="column.prop=='projectType'">
{{projectType==1?'单项':'团体'}}
</template>
@@ -279,23 +261,12 @@ layout("/layouts/platform.html"){
<span v-else class="text-danger">否</span>
</template>-->
<template scope="{row}"
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(2)"
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 scope="{row}" 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(2)" 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>
</el-table-column>
</el-table>
@@ -303,141 +274,93 @@ layout("/layouts/platform.html"){
</el-timeline>
<el-timeline v-else-if="pageForm.applyType===2">
<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-form label-suffix=":" label-position="right"
label-width="80px" style="margin-top: 30px">
<el-form label-suffix=":" label-position="right" label-width="80px" style="margin-top: 30px">
<el-row gutter="20">
<el-col :span="4">
<el-form-item label="姓名">{{
app.leader.username | str }}
</el-form-item>
<el-form-item label="姓名">{{ app.leader.username | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="性别">{{ app.leader.sex |
str }}
</el-form-item>
<el-form-item label="性别">{{ app.leader.sex | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="工号">{{
app.leader.loginname | str }}
</el-form-item>
<el-form-item label="工号">{{ app.leader.loginname | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="电话">{{ app.leader.mobile
| str }}
</el-form-item>
<el-form-item label="电话">{{ app.leader.mobile | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="单位">{{
app.leader.unitname | str }}
</el-form-item>
<el-form-item label="单位">{{ app.leader.unitname | str }}</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="教练信息" placement="top"
v-if="app.coach.username!=null">
<el-timeline-item timestamp="教练信息" placement="top" v-if="app.coach.username!=null">
<el-card shadow="never">
<el-form label-suffix=":" label-position="right"
label-width="80px" style="margin-top: 30px">
<el-form label-suffix=":" label-position="right" label-width="80px" style="margin-top: 30px">
<el-row gutter="20">
<el-col :span="4">
<el-form-item label="姓名">{{ app.coach.username
| str }}
</el-form-item>
<el-form-item label="姓名">{{ app.coach.username | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="性别">{{ app.coach.sex |
str }}
</el-form-item>
<el-form-item label="性别">{{ app.coach.sex | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="工号">{{
app.coach.loginname | str }}
</el-form-item>
<el-form-item label="工号">{{ app.coach.loginname | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="电话">{{ app.coach.mobile |
str }}
</el-form-item>
<el-form-item label="电话">{{ app.coach.mobile | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="单位">{{ app.coach.unitname
| str }}
</el-form-item>
<el-form-item label="单位">{{ app.coach.unitname | str }}</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="团长信息" placement="top"
v-if="app.head.username!=null">
<el-timeline-item timestamp="团长信息" placement="top" v-if="app.head.username!=null">
<el-card shadow="never">
<el-form label-suffix=":" label-position="right"
label-width="80px" style="margin-top: 30px">
<el-form label-suffix=":" label-position="right" label-width="80px" style="margin-top: 30px">
<el-row gutter="20">
<el-col :span="4">
<el-form-item label="姓名">{{ app.head.username
| str }}
</el-form-item>
<el-form-item label="姓名">{{ app.head.username | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="性别">{{ app.head.sex | str
}}
</el-form-item>
<el-form-item label="性别">{{ app.head.sex | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="工号">{{ app.head.loginname
| str }}
</el-form-item>
<el-form-item label="工号">{{ app.head.loginname | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="电话">{{ app.head.mobile |
str }}
</el-form-item>
<el-form-item label="电话">{{ app.head.mobile | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="单位">{{ app.head.unitname
| str }}
</el-form-item>
<el-form-item label="单位">{{ app.head.unitname | str }}</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="工作人员信息" placement="top"
v-if="app.staff.username!=null">
<el-timeline-item timestamp="工作人员信息" placement="top" v-if="app.staff.username!=null">
<el-card shadow="never">
<el-form label-suffix=":" label-position="right"
label-width="80px" style="margin-top: 30px">
<el-form label-suffix=":" label-position="right" label-width="80px" style="margin-top: 30px">
<el-row gutter="20">
<el-col :span="4">
<el-form-item label="姓名">{{ app.staff.username
| str }}
</el-form-item>
<el-form-item label="姓名">{{ app.staff.username | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="性别">{{ app.staff.sex |
str }}
</el-form-item>
<el-form-item label="性别">{{ app.staff.sex | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="工号">{{
app.staff.loginname | str }}
</el-form-item>
<el-form-item label="工号">{{ app.staff.loginname | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="电话">{{ app.staff.mobile |
str }}
</el-form-item>
<el-form-item label="电话">{{ app.staff.mobile | str }}</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="单位">{{ app.staff.unitname
| str }}
</el-form-item>
<el-form-item label="单位">{{ app.staff.unitname | str }}</el-form-item>
</el-col>
</el-row>
</el-form>
@@ -491,8 +414,7 @@ layout("/layouts/platform.html"){
</el-col>
</el-row>
<el-table border stripe :data="app.apply2" size="mini"
:key="tableKey">
<el-table border stripe :data="app.apply2" size="mini" :key="tableKey">
<el-table-column
type="index"
label="序号"
@@ -523,28 +445,16 @@ layout("/layouts/platform.html"){
<span v-else class="text-danger">否</span>
</template>-->
<template scope="{row:{projectType}}"
v-else-if="column.prop=='projectType'">
<template scope="{row:{projectType}}" v-else-if="column.prop=='projectType'">
{{projectType==1?'单项':'团体'}}
</template>
<template scope="{row}"
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(2)"
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 scope="{row}" 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(2)" 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>
</el-table-column>
</el-table>
@@ -587,9 +497,7 @@ layout("/layouts/platform.html"){
name="file"
ref="upload"
>
<el-button icon="el-icon-upload" size="medium" style="width: 200px" type="">
选择文件
</el-button>
<el-button icon="el-icon-upload" size="medium" style="width: 200px" type="">选择文件</el-button>
</el-upload>
</el-card>
</el-timeline-item>
@@ -601,18 +509,9 @@ layout("/layouts/platform.html"){
</span>
</el-dialog>
<el-dialog
:append-to-body="false"
:close-on-click-modal="false"
: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>
<el-dialog :append-to-body="false" :close-on-click-modal="false" :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">
<el-button @click="promiseBookDialogVisible = false" type="primary">关 闭</el-button>
</span>
@@ -669,7 +568,7 @@ layout("/layouts/platform.html"){
fileVisible: false,
promiseBookFileList: [],
promiseBookDialogVisible: false,
promiseBookDialogVisible: false
}
},
components: {
@@ -2,7 +2,7 @@
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/moment.min.js"></script>
@@ -25,9 +25,7 @@ layout("/layouts/platform.html"){
}
.other {
}
</style>
<div id="app" v-cloak>
@@ -39,24 +37,26 @@ layout("/layouts/platform.html"){
<div class="search-item-label">月份:</div>
<div class="search-item-option">
<el-date-picker
style="width: 100%"
@change="doSearch"
v-model="pageForm.time"
placeholder="请选择月份"
type="month"
value-format="yyyy-MM">
</el-date-picker>
style="width: 100%"
@change="doSearch"
v-model="pageForm.time"
placeholder="请选择月份"
type="month"
value-format="yyyy-MM"
></el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">姓名工号:</div>
<div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
style="width: 100%"
@keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend"
placeholder="查询类型"
style="width: 80px;">
<el-input
placeholder="请输入内容"
clearable
v-model="pageForm.searchKeyword"
style="width: 100%"
@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.loginname"></el-option>
</el-select>
@@ -67,11 +67,14 @@ layout("/layouts/platform.html"){
<div class="search-item">
<div class="search-item-label">场地名称:</div>
<div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable clearable
placeholder="请输入场地名称"
style="width: 100%"
v-model="pageForm.siteName">
</el-input>
<el-input
@keyup.enter.native="doSearch"
clearable
clearable
placeholder="请输入场地名称"
style="width: 100%"
v-model="pageForm.siteName"
></el-input>
</div>
</div>
@@ -94,8 +97,7 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt20">
<vi-title2 title="预约列表">
<template #func>
<el-button size="small" type="primary" class="el-icon-date" @click="openCalendar">预约日历
</el-button>
<el-button size="small" type="primary" class="el-icon-date" @click="openCalendar">预约日历</el-button>
<el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isRetire">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button label="1">离退休</el-radio-button>
@@ -103,31 +105,32 @@ layout("/layouts/platform.html"){
</el-radio-group>
</template>
</vi-title2>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
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 :data="tableData" :size="tableSize" @sort-change="pageOrder" align="center" header-align="center">
<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"
:index="indexMethod"
align="center"
header-align="center"
label="序号"
type="index"
width="80px"
></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'">
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
<span v-if="[0].includes(row.stateaudittype)"
style="color: #e6a23c">{{row.state_name}}</span>
<span v-if="[0].includes(row.stateaudittype)" 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==1" style="color: #f56c6c">{{row.state_name}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right"
width="200px">
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="200px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
</template>
@@ -148,9 +151,7 @@ layout("/layouts/platform.html"){
<el-dialog title="预约详情" :visible.sync="siteInfoDialog" width="60%">
<reserve-info ref="reserveDialogInfo"></reserve-info>
</el-dialog>
</guava>
</div>
<script>
@@ -158,12 +159,12 @@ layout("/layouts/platform.html"){
const activityUtil = new typeUtil()
let calendar = null
const vue = new Vue({
el: '#app',
el: "#app",
mixins: [initTableMixins],
data() {
return {
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: [],
siteList: [],
pageForm: {
@@ -171,19 +172,19 @@ layout("/layouts/platform.html"){
searchKeyword: "",
isAudit: false,
time: "",
isRetire: '0'
isRetire: "0"
},
tableColumns: [
{label: '场地名称', prop: 'site_name', sortable: true},
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true},
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true},
{ label: "场地名称", prop: "site_name", sortable: true },
{ label: "预约人姓名", prop: "reserve_person_username", sortable: true },
{ label: "预约人部门", prop: "reserve_person_unitname", sortable: true },
// {label: '开始时间', prop: 'reserve_start_time', sortable: true},
// {label: '结束时间', prop: 'reserve_end_time', sortable: true},
{label: '预约时间范围', prop: 'reservationtimestr'},
{label: '联系电话', prop: 'reserve_person_phone'},
{ label: "预约时间范围", prop: "reservationtimestr" },
{ label: "联系电话", prop: "reserve_person_phone" },
// {label: '活动名称', prop: 'reserve_activity'},
{label: '预约事由', prop: 'reserve_cause'},
{label: '预约状态', prop: 'state_name'},
{ label: "预约事由", prop: "reserve_cause" },
{ label: "预约状态", prop: "state_name" }
],
sites: [],
events: [],
@@ -192,7 +193,7 @@ layout("/layouts/platform.html"){
}
},
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: {
openView(row) {
@@ -200,13 +201,13 @@ layout("/layouts/platform.html"){
this.$refs.reserve.openView(row.id)
},
async doDelete(id) {
const confirm = await this.$confirm("您确定要删除此预约吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
const confirm = await this.$confirm("您确定要删除此预约吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm !== 'confirm') return
const resp = await $.post('/platform/activity/site/reserve/doDelete', {id, op: 1})
if (confirm !== "confirm") return
const resp = await $.post("/platform/activity/site/reserve/doDelete", { id, op: 1 })
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
@@ -215,7 +216,7 @@ layout("/layouts/platform.html"){
}
},
async getSites() {
const {data} = await $.get(loc() + '/getSites')
const { data } = await $.get(loc() + "/getSites")
this.sites = data
},
@@ -224,60 +225,63 @@ layout("/layouts/platform.html"){
if (calendar) {
return
}
calendar = $('#site-calendar').fullCalendar({
header: { //设置日历头部信息,false,则不显示头部信息。包括left,center,right左中右三个位置
left: 'prev,next, today', //上一个、下一个、今天
center: 'title', //标题
right: 'month,agendaWeek,agendaDay' //月、周、日、日程列表
calendar = $("#site-calendar").fullCalendar({
header: {
//设置日历头部信息,false,则不显示头部信息。包括left,center,right左中右三个位置
left: "prev,next, today", //上一个、下一个、今天
center: "title", //标题
right: "month,agendaWeek,agendaDay" //月、周、日、日程列表
},
locale: 'zh-cn', //?没用?
timeFormat: 'HH:mm', //日程事件的时间格式
buttonText: { //各按钮的显示文本信息
today: '今天',
month: '月',
agendaWeek: '周',
agendaDay: '日',
listMonth: '日程',
locale: "zh-cn", //?没用?
timeFormat: "HH:mm", //日程事件的时间格式
buttonText: {
//各按钮的显示文本信息
today: "今天",
month: "月",
agendaWeek: "周",
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月"], //月份简写
dayNames: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], //周全称
dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], //周简写
noEventsMessage: "当月无数据", //listview视图下,无数据提示
allDayText: "全天", //自定义全天视图的名称
allDaySlot: false, //是否在周日历上方显示全天
allDayDefault: false, //是否为全天日程事件,显示这一天中所做的事情
slotDuration: "00:30:00", //一格时间槽代表多长时间,默认00:30:00(30分钟)
slotLabelFormat: "H(:mm)a", //日期视图左边那一列显示的每一格日期时间格式
slotLabelInterval: "01:00:00", //日期视图左边那一列多长间隔显示一条日期文字(默认跟着slotDuration走的,可自定义)
snapDuration: "01:00:00", //其实就是动态创建一个日程时,默认创建多长的时间块
firstDay: 1, //一周中显示的第一天是哪天,周日是0,周一是1,类推
hiddenDays: [], //隐藏一周中的某一天或某几天,数组形式,如隐藏周二和周五:[2,5],默认不隐藏,除非weekends设置为false。
weekends: true, //是否显示周六和周日,设为false则不显示周六和周日。默认值为true
weekMode: 'fixed', //月视图里显示周的模式,因每月周数不同月视图高度不定。fixed:固定显示6周高,日历高度保持不变liquid:不固定周数,高度随周数变化variable:不固定周数,但高度固定
weekNumbers: false, //是否在日历中显示周次(一年中的第几周),如果设置为true,则会在月视图的左侧、周视图和日视图的左上角显示周数。
weekNumberCalculation: 'iso', //周次的显示格式。
height: that.calendarHeight, //设置日历的高度,包括header日历头部,默认未设置,高度根据aspectRatio值自适应。
dayNames: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], //周全称
dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], //周简写
noEventsMessage: "当月无数据", //listview视图下,无数据提示
allDayText: "全天", //自定义全天视图的名称
allDaySlot: false, //是否在周日历上方显示全天
allDayDefault: false, //是否为全天日程事件,显示这一天中所做的事情
slotDuration: "00:30:00", //一格时间槽代表多长时间,默认00:30:00(30分钟)
slotLabelFormat: "H(:mm)a", //日期视图左边那一列显示的每一格日期时间格式
slotLabelInterval: "01:00:00", //日期视图左边那一列多长间隔显示一条日期文字(默认跟着slotDuration走的,可自定义)
snapDuration: "01:00:00", //其实就是动态创建一个日程时,默认创建多长的时间块
firstDay: 1, //一周中显示的第一天是哪天,周日是0,周一是1,类推
hiddenDays: [], //隐藏一周中的某一天或某几天,数组形式,如隐藏周二和周五:[2,5],默认不隐藏,除非weekends设置为false。
weekends: true, //是否显示周六和周日,设为false则不显示周六和周日。默认值为true
weekMode: "fixed", //月视图里显示周的模式,因每月周数不同月视图高度不定。fixed:固定显示6周高,日历高度保持不变liquid:不固定周数,高度随周数变化variable:不固定周数,但高度固定
weekNumbers: false, //是否在日历中显示周次(一年中的第几周),如果设置为true,则会在月视图的左侧、周视图和日视图的左上角显示周数。
weekNumberCalculation: "iso", //周次的显示格式。
height: that.calendarHeight, //设置日历的高度,包括header日历头部,默认未设置,高度根据aspectRatio值自适应。
// contentHeight: 600, //设置日历主体内容的高度,不包括header部分,默认未设置,高度根据aspectRatio值自适应。
handleWindowResize: true, //是否随浏览器窗口大小变化而自动变化。
defaultView: 'agendaWeek', //初始化时默认视图,默认是月month,agendaWeek是周,agendaDay是当天
slotEventOverlap: false, //事件是否可以重叠覆盖
defaultDate: moment().format('YYYY-MM-DD'), //默认显示那一天的日期视图getDates(true)2020-05-10
nowIndicator: false, //周/日视图中显示今天当前时间点(以红线标记),默认false不显示
eventLimit: 2, //数据条数太多时,限制显示条数(多余的以“+2more”格式显示),默认false不限制,支持输入数字设定固定的显示条数
eventLimitText: "更多", //当一块区域内容太多以"+2 more"格式显示时,这个more的名称自定义(应该与eventLimit: true一并用)
dayPopoverFormat: "YYYY年M月d日预约信息", //点开"+2 more"弹出的小窗口标题,与eventLimitClick可以结合用
render: (view) => { //method,绑定日历到id上。$('#id').fullCalendar('render');
handleWindowResize: true, //是否随浏览器窗口大小变化而自动变化。
defaultView: "agendaWeek", //初始化时默认视图,默认是月month,agendaWeek是周,agendaDay是当天
slotEventOverlap: false, //事件是否可以重叠覆盖
defaultDate: moment().format("YYYY-MM-DD"), //默认显示那一天的日期视图getDates(true)2020-05-10
nowIndicator: false, //周/日视图中显示今天当前时间点(以红线标记),默认false不显示
eventLimit: 2, //数据条数太多时,限制显示条数(多余的以“+2more”格式显示),默认false不限制,支持输入数字设定固定的显示条数
eventLimitText: "更多", //当一块区域内容太多以"+2 more"格式显示时,这个more的名称自定义(应该与eventLimit: true一并用)
dayPopoverFormat: "YYYY年M月d日预约信息", //点开"+2 more"弹出的小窗口标题,与eventLimitClick可以结合用
render: (view) => {
//method,绑定日历到id上。$('#id').fullCalendar('render');
},
viewRender: (view) => {
that.getCalendarData()
},
eventRender: (info, element) => {
console.log(info)
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_cause)
element.find('.fc-title').append("<br/>审核状态:" + info.state_name)
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_cause)
element.find(".fc-title").append("<br/>审核状态:" + info.state_name)
// $(info.el).html(info.event.title);
},
//日历数据源
@@ -289,7 +293,7 @@ layout("/layouts/platform.html"){
setTimeout(async () => {
// 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)
}, 1000)
@@ -319,44 +323,44 @@ layout("/layouts/platform.html"){
// that.$set(that.formData, 'appointmentAskTypeValue', this.askTypeArray[0].code)
// }
},
selectable: false, //是否允许通过单击或拖动选择日历中的对象,包括天和时间
selectMirror: true, //镜像
lazyFetching: false, //是否启用懒加载技术--即只取当前条件下的视图数据,其它数据在切换时触发,默认true只取当前视图的,false是取全视图的
defaultTimedEventDuration: "01:00:00", //在Event Object中如果没有end参数时使用,如start=7:00pm,则该日程对象时间范围就是7:00~9:00
defaultAllDayEventDuration: {days: 1}, //默认1天是多长,(有的是采用工作时间模式,所以支持自定义)
});
selectable: false, //是否允许通过单击或拖动选择日历中的对象,包括天和时间
selectMirror: true, //镜像
lazyFetching: false, //是否启用懒加载技术--即只取当前条件下的视图数据,其它数据在切换时触发,默认true只取当前视图的,false是取全视图的
defaultTimedEventDuration: "01:00:00", //在Event Object中如果没有end参数时使用,如start=7:00pm,则该日程对象时间范围就是7:00~9:00
defaultAllDayEventDuration: { days: 1 } //默认1天是多长,(有的是采用工作时间模式,所以支持自定义)
})
},
async getCalendarData() {
if (!calendar) {
return
}
const view = calendar.fullCalendar('getView')
const view = calendar.fullCalendar("getView")
//这里取时间戳
const startTimeTs = view.start.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 startTimeTs = view.start.format("YYYY-MM-DD HH:mm:ss")
const endTimeTs = view.end.format("YYYY-MM-DD HH:mm:ss")
const { data } = await $.get(loc() + "/getCalendarData", {
siteId: this.pageForm.siteId,
startTimeTs,
endTimeTs
})
if (data && data.length > 0) {
data.map(x => {
data.map((x) => {
console.log(x)
if (x.site_id === '83dfd7d780f448aea307d2ce967b51fe') {
x.className = 'yantaoshi'
} else if (x.site_id === 'd6ebd7e454a24e3495b0d18438fb6a59') {
x.className = 'duogongnengting'
} else if (x.site_id === 'a6486481018b479ab137bac53936f15e') {
x.className = 'dangyuanzhijia'
if (x.site_id === "83dfd7d780f448aea307d2ce967b51fe") {
x.className = "yantaoshi"
} else if (x.site_id === "d6ebd7e454a24e3495b0d18438fb6a59") {
x.className = "duogongnengting"
} else if (x.site_id === "a6486481018b479ab137bac53936f15e") {
x.className = "dangyuanzhijia"
} else {
x.className = 'other'
x.className = "other"
}
})
let events = data
calendar.fullCalendar('removeEvents', () => true)
calendar.fullCalendar('addEventSource', events, true);
calendar.fullCalendar("removeEvents", () => true)
calendar.fullCalendar("addEventSource", events, true)
} else {
calendar.fullCalendar('removeEvents', () => true)
calendar.fullCalendar("removeEvents", () => true)
}
},
openCalendar() {
@@ -367,9 +371,9 @@ layout("/layouts/platform.html"){
}, 500)
},
async findAllOpenSite() {
const {data} = await $.get("/platform/activity/site/apply/getAllSite")
const { data } = await $.get("/platform/activity/site/apply/getAllSite")
return data
},
}
},
mounted() {
setTimeout(() => {
@@ -381,7 +385,7 @@ layout("/layouts/platform.html"){
this.siteList = await this.findAllOpenSite()
this.pageData()
this.getSites()
},
}
})
</script>
<!--#
@@ -10,24 +10,26 @@ layout("/layouts/platform.html"){
<div class="search-item-label">月份:</div>
<div class="search-item-option">
<el-date-picker
style="width: 100%"
@change="doSearch"
v-model="pageForm.time"
placeholder="请选择月份"
type="month"
value-format="yyyy-MM">
</el-date-picker>
style="width: 100%"
@change="doSearch"
v-model="pageForm.time"
placeholder="请选择月份"
type="month"
value-format="yyyy-MM"
></el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">姓名工号:</div>
<div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
style="width: 100%"
@keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend"
placeholder="查询类型"
style="width: 80px;">
<el-input
placeholder="请输入内容"
clearable
v-model="pageForm.searchKeyword"
style="width: 100%"
@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.loginname"></el-option>
</el-select>
@@ -38,36 +40,39 @@ layout("/layouts/platform.html"){
<div class="search-item">
<div class="search-item-label">场地名称:</div>
<div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable clearable
placeholder="请输入场地名称"
style="width: 100%"
v-model="pageForm.siteName">
</el-input>
<el-input
@keyup.enter.native="doSearch"
clearable
clearable
placeholder="请输入场地名称"
style="width: 100%"
v-model="pageForm.siteName"
></el-input>
</div>
</div>
<!-- <div class="search-item">-->
<!-- <div class="search-item-label">场地类型:</div>-->
<!-- <div class="search-item-option">-->
<!-- <el-select v-model="pageForm.siteType" placeholder="场地类型"-->
<!-- clearable filterable style="width: 100%">-->
<!-- <el-option v-for="item in activityTypeList" :label="item.text"-->
<!-- :value="item.value"></el-option>-->
<!-- </el-select>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="search-item">-->
<!-- <div class="search-item-label">场地类型:</div>-->
<!-- <div class="search-item-option">-->
<!-- <el-select v-model="pageForm.siteType" placeholder="场地类型"-->
<!-- clearable filterable style="width: 100%">-->
<!-- <el-option v-for="item in activityTypeList" :label="item.text"-->
<!-- :value="item.value"></el-option>-->
<!-- </el-select>-->
<!-- </div>-->
<!-- </div>-->
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool :app="this" label="预约列表">
<template #func>
<el-button @click="location.href='/platform/activity/site/apply'"
class="mr10" size="small" type="primary">我要预约</el-button>
<el-button @click="location.href='/platform/activity/site/apply'" class="mr10" size="small" type="primary">
我要预约
</el-button>
<el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isRetire">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button label="1">离退休</el-radio-button>
@@ -75,31 +80,32 @@ layout("/layouts/platform.html"){
</el-radio-group>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
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 :data="tableData" :size="tableSize" @sort-change="pageOrder" align="center" header-align="center">
<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"
:index="indexMethod"
align="center"
header-align="center"
label="序号"
type="index"
width="80px"
></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'">
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
<span v-if="[0].includes(row.stateaudittype)"
style="color: #e6a23c">{{row.state_name}}</span>
<span v-if="[0].includes(row.stateaudittype)" 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==1" style="color: #f56c6c">{{row.state_name}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right"
width="200px">
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="200px">
<template scope="scope">
<!--<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>-->
@@ -109,19 +115,15 @@ layout("/layouts/platform.html"){
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'view',data:scope.row}">
查看
</el-dropdown-item>
<el-dropdown-item :command="{type:'view',data:scope.row}">查看</el-dropdown-item>
<!--# if(@shiro.hasRole('sysadmin')){ #-->
<el-dropdown-item
:command="{type:'delete',data:scope.row}">
删除
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:scope.row}">删除</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 == '')"
:command="{type:'cancel',data:scope.row}">
:command="{type:'cancel',data:scope.row}"
>
撤销预约
</el-dropdown-item>
</el-dropdown-menu>
@@ -143,14 +145,14 @@ layout("/layouts/platform.html"){
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
const activityUtil = new typeUtil()
const vue = new Vue({
el: '#app',
el: "#app",
mixins: [initTableMixins],
data() {
return {
activityTypeList: [],
siteList: [],
tableData: [],
userid: '',
userid: "",
pageForm: {
searchName: "u.username",
searchKeyword: "",
@@ -159,106 +161,118 @@ layout("/layouts/platform.html"){
totalCount: 0,
pageOrderName: "",
pageOrderBy: "",
time: '',
isRetire: '0'
time: "",
isRetire: "0"
},
tableColumns: [
{label: '场地名称', prop: 'site_name', sortable: true},
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true},
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true},
{ label: "场地名称", prop: "site_name", sortable: true },
{ label: "预约人姓名", prop: "reserve_person_username", sortable: true },
{ label: "预约人部门", prop: "reserve_person_unitname", sortable: true },
// {label: '开始时间', prop: 'reserve_start_time', sortable: true},
// {label: '结束时间', prop: 'reserve_end_time', sortable: true},
{label: '预约时间范围', prop: 'reservationtimestr'},
{label: '联系电话', prop: 'reserve_person_phone'},
{ label: "预约时间范围", prop: "reservationtimestr" },
{ label: "联系电话", prop: "reserve_person_phone" },
// {label: '活动名称', prop: 'reserve_activity'},
{label: '预约事由', prop: 'reserve_cause'},
{label: '预约状态', prop: 'state_name'},
],
{ label: "预约事由", prop: "reserve_cause" },
{ label: "预约状态", prop: "state_name" }
]
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue?v=' + new Date().getTime()),
guava: httpVueLoader("/components/plugins/Guava.vue"),
"reserve-info": httpVueLoader("/components/activity/site/ReserveInfo.vue?v=" + new Date().getTime())
},
methods: {
dropdownCommand(command) {
const {type, data} = command
if (type === 'view') {
this.userid = data.reserve_person_id;
const { type, data } = command
if (type === "view") {
this.userid = data.reserve_person_id
this.openView(data)
} else if (type === 'delete') {
} else if (type === "delete") {
this.doClean(data.id)
} else if (type === 'cancel') {
} else if (type === "cancel") {
this.doRevoke(data.id)
}
},
backOption(row) {
this.$prompt('请填写反馈意见', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$prompt("请填写反馈意见", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
inputValidator: (value) => {
if (value === null) {
return '反馈意见不能为空'
return "反馈意见不能为空"
}
}
}).then(async ({value}) => {
const res = await $.post('/mobile/activity/site/info/backOption', {
id: row.id,
option: value
})
.then(async ({ value }) => {
const res = await $.post("/mobile/activity/site/info/backOption", {
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) {
await this.doSearch()
this.$notify.success({title: '提示', message: '操作成功!'});
} else {
this.$notify.warning({title: '警告', message: '操作失败!'});
}
}).catch(() => {
});
.catch(() => {})
},
async doClean(id) {
this.$confirm("您确定要删除此预约吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
this.$confirm("您确定要删除此预约吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
callback: (a, b) => {
if ("confirm" === a) {
$.post("/platform/activity/site/apply/doClean", {id}, (data) => {
if (data.code === 0) {
this.$message.success(data.msg)
this.pageData();
} else {
this.$message.warning(data.msg)
}
}, "json");
$.post(
"/platform/activity/site/apply/doClean",
{ id },
(data) => {
if (data.code === 0) {
this.$message.success(data.msg)
this.pageData()
} else {
this.$message.warning(data.msg)
}
},
"json"
)
}
}
});
})
},
async doRevoke(id) {
this.$confirm("您确定要撤销此预约吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
this.$confirm("您确定要撤销此预约吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
callback: (a, b) => {
if ("confirm" === a) {
$.post("/platform/activity/site/apply/revoke", {id}, (data) => {
if (data.code === 0) {
this.$message.success(data.msg)
this.pageData();
} else {
this.$message.warning(data.msg)
}
}, "json");
$.post(
"/platform/activity/site/apply/revoke",
{ id },
(data) => {
if (data.code === 0) {
this.$message.success(data.msg)
this.pageData()
} else {
this.$message.warning(data.msg)
}
},
"json"
)
}
}
});
})
},
openView(row) {
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
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)
},
async doSearch() {
@@ -267,14 +281,14 @@ layout("/layouts/platform.html"){
this.siteList = await this.findAllOpenSite()
},
async findAllOpenSite() {
const {data} = await $.get("/platform/activity/site/apply/getAllSite")
const { data } = await $.get("/platform/activity/site/apply/getAllSite")
return data
},
}
},
async created() {
this.activityTypeList = await activityUtil.getAllType()
this.siteList = await this.findAllOpenSite()
this.pageData();
this.pageData()
}
})
</script>
@@ -10,24 +10,26 @@ layout("/layouts/platform.html"){
<div class="search-item-label">月份:</div>
<div class="search-item-option">
<el-date-picker
style="width: 100%"
@change="doSearch"
v-model="pageForm.time"
placeholder="请选择月份"
type="month"
value-format="yyyy-MM">
</el-date-picker>
style="width: 100%"
@change="doSearch"
v-model="pageForm.time"
placeholder="请选择月份"
type="month"
value-format="yyyy-MM"
></el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">姓名工号:</div>
<div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
style="width: 100%"
@keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend"
placeholder="查询类型"
style="width: 80px;">
<el-input
placeholder="请输入内容"
clearable
v-model="pageForm.searchKeyword"
style="width: 100%"
@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.loginname"></el-option>
</el-select>
@@ -38,11 +40,14 @@ layout("/layouts/platform.html"){
<div class="search-item">
<div class="search-item-label">场地名称:</div>
<div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable clearable
placeholder="请输入场地名称"
style="width: 100%"
v-model="pageForm.siteName">
</el-input>
<el-input
@keyup.enter.native="doSearch"
clearable
clearable
placeholder="请输入场地名称"
style="width: 100%"
v-model="pageForm.siteName"
></el-input>
</div>
</div>
@@ -71,36 +76,35 @@ layout("/layouts/platform.html"){
</el-radio-group>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
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 :data="tableData" :size="tableSize" @sort-change="pageOrder" align="center" header-align="center">
<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"
:index="indexMethod"
align="center"
header-align="center"
label="序号"
type="index"
width="80px"
></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'">
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
<span v-if="[0].includes(row.stateaudittype)"
style="color: #e6a23c">{{row.state_name}}</span>
<span v-if="[0].includes(row.stateaudittype)" 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==1" style="color: #f56c6c">{{row.state_name}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right"
width="200px">
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="200px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.reserve_state == 6090" @click="doProcess(row)" size="mini"
type="primary">审核
</el-button>
<el-button v-if="row.reserve_state == 6090" @click="doProcess(row)" size="mini" type="primary">审核</el-button>
</template>
</el-table-column>
</el-table>
@@ -112,23 +116,17 @@ layout("/layouts/platform.html"){
<reserve-info ref="auditInfo">
<template #handle>
<el-tab-pane label="离退休工作处审核" name="retire">
<el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm"
:rules="formRules">
<el-form-item label="审核人">
${@shiro.getPrincipalProperty('username')}
</el-form-item>
<el-form-item label="审核时间">
{{moment().format('YYYY-MM-DD')}}
</el-form-item>
<el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm" :rules="formRules">
<el-form-item label="审核人">${@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-input maxlength="300" rows="5" type="textarea"
v-model="formData.auditOpinion"></el-input>
<el-input maxlength="300" rows="5" type="textarea" v-model="formData.auditOpinion"></el-input>
</el-form-item>
<el-form-item label="签字" prop="auditSign">
<sign :qz.sync="formData.auditSign" prefix="activitySite"></sign>
</el-form-item>
</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="primary" @click="doReview(true)">通过</el-button>
</el-row>
@@ -146,7 +144,7 @@ layout("/layouts/platform.html"){
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
const activityUtil = new typeUtil()
const vue = new Vue({
el: '#app',
el: "#app",
mixins: [initTableMixins],
data() {
return {
@@ -157,53 +155,54 @@ layout("/layouts/platform.html"){
searchName: "u.username",
searchKeyword: "",
isAudit: false,
time: "",
time: ""
},
tableColumns: [
{label: '场地名称', prop: 'site_name', sortable: true},
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true},
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true},
{ label: "场地名称", prop: "site_name", sortable: true },
{ label: "预约人姓名", prop: "reserve_person_username", sortable: true },
{ label: "预约人部门", prop: "reserve_person_unitname", sortable: true },
// {label: '开始时间', prop: 'reserve_start_time', sortable: true},
// {label: '结束时间', prop: 'reserve_end_time', sortable: true},
{label: '预约时间范围', prop: 'reservationtimestr'},
{label: '联系电话', prop: 'reserve_person_phone'},
{ label: "预约时间范围", prop: "reservationtimestr" },
{ label: "联系电话", prop: "reserve_person_phone" },
// {label: '活动名称', prop: 'reserve_activity'},
{label: '预约事由', prop: 'reserve_cause'},
{label: '预约状态', prop: 'state_name'},
{ label: "预约事由", prop: "reserve_cause" },
{ label: "预约状态", prop: "state_name" }
],
formRules: {
auditOpinion: [{required: true, message: '请签字', trigger: ['change', 'blur']}],
auditSign: [{required: true, message: '请签字', trigger: ['change', 'blur']}],
},
auditOpinion: [{ required: true, message: "请签字", trigger: ["change", "blur"] }],
auditSign: [{ required: true, message: "请签字", trigger: ["change", "blur"] }]
}
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue?v=' + new Date().getTime()),
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.0'),
guava: httpVueLoader("/components/plugins/Guava.vue"),
"reserve-info": httpVueLoader("/components/activity/site/ReserveInfo.vue?v=" + new Date().getTime()),
sign: httpVueLoader("/components/sign/sign.vue?v=2.0.0")
},
methods: {
openView(row) {
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
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)
},
doProcess(row) {
this.$refs.guava.edit()
this.$refs.auditInfo.openView(row.id, 'retire')
this.$refs.auditInfo.openView(row.id, "retire")
this.formData = {
id: row.id,
auditOpinion: null,
auditOpinion: null
}
},
async doReview(row) {
const valid = await this.$refs['auditForm'].validate()
const valid = await this.$refs["auditForm"].validate()
if (!valid) return
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,
audit: JSON.stringify(this.formData)
})
@@ -214,14 +213,14 @@ layout("/layouts/platform.html"){
}
},
async findAllOpenSite() {
const {data} = await $.get("/platform/activity/site/apply/getAllSite")
const { data } = await $.get("/platform/activity/site/apply/getAllSite")
return data
},
}
},
async created() {
this.activityTypeList = await activityUtil.getAllType()
this.siteList = await this.findAllOpenSite()
this.pageData();
this.pageData()
}
})
</script>
@@ -10,24 +10,26 @@ layout("/layouts/platform.html"){
<div class="search-item-label">月份:</div>
<div class="search-item-option">
<el-date-picker
style="width: 100%"
@change="doSearch"
v-model="pageForm.time"
placeholder="请选择月份"
type="month"
value-format="yyyy-MM">
</el-date-picker>
style="width: 100%"
@change="doSearch"
v-model="pageForm.time"
placeholder="请选择月份"
type="month"
value-format="yyyy-MM"
></el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">姓名工号:</div>
<div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
style="width: 100%"
@keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend"
placeholder="查询类型"
style="width: 80px;">
<el-input
placeholder="请输入内容"
clearable
v-model="pageForm.searchKeyword"
style="width: 100%"
@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.loginname"></el-option>
</el-select>
@@ -38,11 +40,14 @@ layout("/layouts/platform.html"){
<div class="search-item">
<div class="search-item-label">场地名称:</div>
<div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable clearable
placeholder="请输入场地名称"
style="width: 100%"
v-model="pageForm.siteName">
</el-input>
<el-input
@keyup.enter.native="doSearch"
clearable
clearable
placeholder="请输入场地名称"
style="width: 100%"
v-model="pageForm.siteName"
></el-input>
</div>
</div>
@@ -76,31 +81,32 @@ layout("/layouts/platform.html"){
</el-radio-group>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
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 :data="tableData" :size="tableSize" @sort-change="pageOrder" align="center" header-align="center">
<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"
:index="indexMethod"
align="center"
header-align="center"
label="序号"
type="index"
width="80px"
></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'">
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
<span v-if="[0].includes(row.stateaudittype)"
style="color: #e6a23c">{{row.state_name}}</span>
<span v-if="[0].includes(row.stateaudittype)" 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==1" style="color: #f56c6c">{{row.state_name}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right"
width="200px">
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="200px">
<template scope="{row}">
<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>
@@ -116,21 +122,16 @@ layout("/layouts/platform.html"){
<template #handle>
<el-tab-pane label="校工会审核" name="xghsh">
<el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm" :rules="formRules">
<el-form-item label="审核人">
${@shiro.getPrincipalProperty('username')}
</el-form-item>
<el-form-item label="审核时间">
{{moment().format('YYYY-MM-DD')}}
</el-form-item>
<el-form-item label="审核人">${@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-input maxlength="300" rows="5" type="textarea"
v-model="formData.auditOpinion"></el-input>
<el-input maxlength="300" rows="5" type="textarea" v-model="formData.auditOpinion"></el-input>
</el-form-item>
<!-- <el-form-item label="签字" prop="auditSign">-->
<!-- <sign :qz.sync="formData.auditSign" prefix="activitySite"></sign>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="签字" prop="auditSign">-->
<!-- <sign :qz.sync="formData.auditSign" prefix="activitySite"></sign>-->
<!-- </el-form-item>-->
</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="primary" @click="doReview(true)">通过</el-button>
</el-row>
@@ -143,74 +144,74 @@ layout("/layouts/platform.html"){
<reserve-info ref="reserve"></reserve-info>
</template>
</guava>
</div>
<script>
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
const activityUtil = new typeUtil()
const vue = new Vue({
el: '#app',
el: "#app",
mixins: [initTableMixins],
data() {
return {
id:null,
activityTypeList:[],
siteList:[],
id: null,
activityTypeList: [],
siteList: [],
pageForm: {
searchName: "u.username",
searchKeyword: "",
isAudit: false,
time: "",
isRetire: '0'
isRetire: "0"
},
tableColumns: [
{label: '场地名称', prop: 'site_name', sortable: true},
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true},
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true},
{ label: "场地名称", prop: "site_name", sortable: true },
{ label: "预约人姓名", prop: "reserve_person_username", sortable: true },
{ label: "预约人部门", prop: "reserve_person_unitname", sortable: true },
// {label: '开始时间', prop: 'reserve_start_time', sortable: true},
// {label: '结束时间', prop: 'reserve_end_time', sortable: true},
{label: '预约时间范围', prop: 'reservationtimestr'},
{label: '联系电话', prop: 'reserve_person_phone'},
{ label: "预约时间范围", prop: "reservationtimestr" },
{ label: "联系电话", prop: "reserve_person_phone" },
// {label: '活动项目', prop: 'reserve_activity'},
{label: '预约事由', prop: 'reserve_cause'},
{label: '预约状态', prop: 'state_name'},
{ label: "预约事由", prop: "reserve_cause" },
{ label: "预约状态", prop: "state_name" }
],
formRules:{
auditOpinion: [{required: true, message: '请签字', trigger: ['change', 'blur']}],
auditSign: [{required: true, message: '请签字', trigger: ['change', 'blur']}],
},
formRules: {
auditOpinion: [{ required: true, message: "请签字", trigger: ["change", "blur"] }],
auditSign: [{ required: true, message: "请签字", trigger: ["change", "blur"] }]
}
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue?v=' + new Date().getTime()),
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.0'),
guava: httpVueLoader("/components/plugins/Guava.vue"),
"reserve-info": httpVueLoader("/components/activity/site/ReserveInfo.vue?v=" + new Date().getTime()),
sign: httpVueLoader("/components/sign/sign.vue?v=2.0.0")
},
methods: {
openView(row) {
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
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)
},
doProcess(row){
doProcess(row) {
this.$refs.guava.edit()
this.$refs.auditInfo.openView(row.id, 'xghsh')
this.formData={
this.$refs.auditInfo.openView(row.id, "xghsh")
this.formData = {
id: row.id,
schoolOption: null,
schoolOption: null
}
},
async doReview(row){
const valid = await this.$refs['auditForm'].validate()
async doReview(row) {
const valid = await this.$refs["auditForm"].validate()
if (!valid) return
this.formData.auditPass = row
const resp = await $.post('/platform/activity/site/review/doProcess', {
id:this.formData.id,
audit:JSON.stringify(this.formData)
const resp = await $.post("/platform/activity/site/review/doProcess", {
id: this.formData.id,
audit: JSON.stringify(this.formData)
})
if (resp.code === 0) {
this.$refs.guava.index()
@@ -219,24 +220,29 @@ layout("/layouts/platform.html"){
}
},
doInstructions() {
$.post(location.href + "/doReview", this.formData, (res) => {
if (res.code == 0) {
this.$message.success(res.msg)
this.pageData();
this.$refs.guava.index()
}
}, "json");
$.post(
location.href + "/doReview",
this.formData,
(res) => {
if (res.code == 0) {
this.$message.success(res.msg)
this.pageData()
this.$refs.guava.index()
}
},
"json"
)
},
async findAllOpenSite() {
const {data} = await $.get("/platform/activity/site/apply/getAllSite")
const { data } = await $.get("/platform/activity/site/apply/getAllSite")
return data
},
}
},
async created() {
this.activityTypeList = await activityUtil.getAllType()
this.siteList = await this.findAllOpenSite()
this.pageData();
},
this.pageData()
}
})
</script>
<!--#
@@ -183,7 +183,8 @@ layout("/layouts/platform.html"){
methods: {
openView(row) {
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
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id
this.$refs.reserve.backOptionShow = role || backOptionShow
@@ -51,6 +51,10 @@ const activity = {
})
},
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) {
sublime.jumpPagePjax(item.url)
} else if (item.url) {