人员、品牌活动、答题、单身教工
This commit is contained in:
@@ -58,7 +58,7 @@ public class MsgApi {
|
||||
*/
|
||||
public void sendMsg(List<String> channels, String loginNameStr, Integer mtype, String title, String content, String imageUrl,String link) {
|
||||
try {
|
||||
/*if (!Globals.MyConfig.getBoolean("SendMsg")) {
|
||||
if (!Globals.MyConfig.getBoolean("SendMsg")) {
|
||||
log.info("发送失败,消息暂未开启!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
return;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ public class MsgApi {
|
||||
} else {
|
||||
log.info("发送失败>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
|
||||
throw new RuntimeException("Message sending failed with status code: " + status + ", Message: " + jsonObject.getString("message"));
|
||||
}*/
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package io.v.nutz.task.job.trainSingUp;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.zhgh.trainSignUp.service.TrainSignUpActivityService;
|
||||
import org.nutz.dao.Cnd;
|
||||
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.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
public class SendMsgBeforeClassJob implements Job {
|
||||
|
||||
private static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
@Inject
|
||||
private MsgApi msgApi;
|
||||
|
||||
@Inject
|
||||
private TrainSignUpActivityService trainSignUpActivityService;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) {
|
||||
//获取今天有哪些课程
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.username,
|
||||
u.loginname,
|
||||
course.courseName,
|
||||
uc.courseStartTime,
|
||||
course.courseType,
|
||||
type.lxname,
|
||||
course.courseLocation,
|
||||
course.campus
|
||||
FROM train_sign_up_user_course uc
|
||||
left join sys_user u on u.id=uc.userid
|
||||
left join train_sign_up_course course on course.id=uc.courseId
|
||||
left join train_sign_up_activity ac on ac.id=uc.activityId
|
||||
left join train_sign_up_type type on type.id = course.courseType
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("ac.isDisabled", "=", false);
|
||||
cnd.and("ac.notice", "=", true);
|
||||
|
||||
// Date date = new Date();//取时间
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// calendar.setTime(date);
|
||||
// //把日期往后增加一天.整数往后推,负数往前移动(1:表示明天、-1:表示昨天,0:表示今天)
|
||||
// calendar.add(Calendar.DATE,1);
|
||||
// //这个时间就是日期往后推一天的结果
|
||||
// date = calendar.getTime();
|
||||
|
||||
// cnd.and("LEFT ( courseStartTime, 10 )", "=", simpleDateFormat.format(date));
|
||||
|
||||
cnd.and("LEFT ( uc.courseStartTime, 10 )", "=", DateUtil.today());
|
||||
|
||||
sql.setCondition(cnd);
|
||||
|
||||
List<NutMap> list = trainSignUpActivityService.listMap(sql);
|
||||
|
||||
if (Lang.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
|
||||
list.forEach(item -> {
|
||||
String content = "“%s”老师您好:您报名的【%s】“%s”将于“%s”开始,地点为“%s%s”,请记得准时参加,祝您工作生活愉快!——校工会"
|
||||
.formatted(
|
||||
item.getString("username"),
|
||||
item.getString("lxname"),
|
||||
item.getString("courseName"),
|
||||
item.getString("courseStartTime"),
|
||||
item.getString("campus"),
|
||||
item.getString("courseLocation")
|
||||
);
|
||||
if("心理咨询".equals(item.getString("lxname")) || "8d18afc10fb84a949f0339aa09eb202f".equals(item.getString("courseType"))) {
|
||||
content = "“%s”老师您好:您预约的“心理咨询”将于“%s”开始,地点为“%s%s”,请记得准时参加,如您因故不能参加,请于今天中午12点前在报名系统取消预约,祝您工作生活愉快!——校工会"
|
||||
.formatted(
|
||||
item.getString("username"),
|
||||
item.getString("courseStartTime"),
|
||||
item.getString("campus"),
|
||||
item.getString("courseLocation")
|
||||
);
|
||||
}
|
||||
msgApi.sendMsg(List.of("DingTalk"), item.getString("loginname"), 1, "活动开始通知", content, "", "");
|
||||
// msgApi.sendWxMsg("温馨提醒","","text",content,List.of(item.getString("loginname")),"");
|
||||
// sendMsg.pushWeChatMsg("温馨提醒", content, item.getString("loginname"));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -153,9 +153,11 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
Set<String> allowChangeFieldNames = dictList.stream().map(Sys_dict::getCode).collect(Collectors.toSet());
|
||||
allowChangeFieldNames.add("member");
|
||||
allowChangeFieldNames.add("welfareMember");
|
||||
allowChangeFieldNames.add("unitid");
|
||||
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(Sys_dict::getCode, Sys_dict::getName));
|
||||
dictMap.put("member", "会员状态");
|
||||
dictMap.put("welfareMember", "福利会员状态");
|
||||
dictMap.put("unitid", "单位");
|
||||
|
||||
// 添加会员角色
|
||||
List<String> addMemberUserIds = new CopyOnWriteArrayList<>();
|
||||
@@ -391,9 +393,8 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
case "personType":
|
||||
if (siftValue instanceof List<?> && source != null && source.getPersonType() != null) {
|
||||
List<String> personTypeList = (List<String>) siftValue;
|
||||
boolean personTypeConditionMet = personTypeList.contains(source.getPersonType());
|
||||
// 必须同时满足 userState 和 personType 条件
|
||||
shouldAdd = userStateConditionMet && personTypeConditionMet;
|
||||
shouldAdd = personTypeList.contains(source.getPersonType());
|
||||
shouldRemove = !shouldAdd && user != null && user.getMember() == 1;
|
||||
}
|
||||
break;
|
||||
@@ -487,11 +488,13 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
BeanUtil.copyProperties(source, table);
|
||||
table.setId(R.UU32());
|
||||
table.setChangeTime(DateUtil.date());
|
||||
table.setIsOperate(false);
|
||||
table.setChangeOrigin(MemberChangeOrigin.SYSTEM.name());
|
||||
// 新入职教职工
|
||||
if (user == null) {
|
||||
changeTypes.add(MemberChangeType.NEW.getType());
|
||||
table.setChangeTypes(changeTypes);
|
||||
table.setChangeInfosStr("新入职");
|
||||
return table;
|
||||
}
|
||||
|
||||
@@ -509,7 +512,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
return null;
|
||||
}
|
||||
String changeInfos = changeList.stream().map(v -> {
|
||||
return v.getString("fieldName") + ":" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + "->" + HtmlUtil.cleanHtmlTag(v.getString("newValue")) + ";";
|
||||
return v.getString("fieldName") + ":" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + "—>" + HtmlUtil.cleanHtmlTag(v.getString("newValue"));
|
||||
}).collect(Collectors.joining(";"));
|
||||
|
||||
// 比较变更数据
|
||||
@@ -518,7 +521,6 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
table.setChangeTypes(changeTypes);
|
||||
table.setChangeInfos(changeList);
|
||||
table.setChangeInfosStr(changeInfos);
|
||||
table.setIsOperate(false);
|
||||
return table;
|
||||
}
|
||||
|
||||
@@ -555,7 +557,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
|
||||
return null;
|
||||
}
|
||||
String changeInfos = changeList.stream().map(v -> {
|
||||
return v.getString("fieldName") + ":" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + "->" + HtmlUtil.cleanHtmlTag(v.getString("newValue")) + ";";
|
||||
return v.getString("fieldName") + ":" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + "—>" + HtmlUtil.cleanHtmlTag(v.getString("newValue"));
|
||||
}).collect(Collectors.joining(";"));
|
||||
// 比较变更数据
|
||||
commonCompareChange(source, user, changeTypes);
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.v.nutz.base.page.Pagination;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.zhgh.qsv.service.QsvActivityService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
@@ -25,14 +26,14 @@ public class H5QsvController {
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/mobile/qsv/index.html")
|
||||
@RequiresPermissions("h5.qsv")
|
||||
@RequiresAuthentication
|
||||
public void index() {
|
||||
|
||||
}
|
||||
|
||||
// 分页查询
|
||||
@At
|
||||
@RequiresPermissions("h5.qsv")
|
||||
@RequiresAuthentication
|
||||
public Result pageData(@Valid PageForm pageForm, @Valid String category) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("category", "=", category);
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
|
||||
import io.v.nutz.zhgh.qsv.models.QsvActivity;
|
||||
import io.v.nutz.zhgh.qsv.models.QsvSubject;
|
||||
import io.v.nutz.zhgh.qsv.models.QsvUserAnswerRecord;
|
||||
@@ -42,8 +43,14 @@ public class H5QsvSurveyController {
|
||||
|
||||
@At
|
||||
@RequiresAuthentication
|
||||
public Result subjects(@Valid String activityId) {
|
||||
public Result subjects(String activityId) {
|
||||
QsvActivity activity = dao.fetch(QsvActivity.class, activityId);
|
||||
|
||||
int count = dao.count(ActivityUserScope.class, Cnd.where("groupId", "=", activity.getGroupId()).and("userId", "=", ShiroUtil.getUserId()));
|
||||
if (count != 1) {
|
||||
return Result.error("您无需参加此次投票,感谢您的关注!");
|
||||
}
|
||||
|
||||
String answerRecordId = null;
|
||||
|
||||
QsvUserAnswerRecord answerRecord = dao.fetch(QsvUserAnswerRecord.class, Cnd.where("activityId", "=", activityId)
|
||||
@@ -60,7 +67,7 @@ public class H5QsvSurveyController {
|
||||
answerRecordId = answerRecord2.getId();
|
||||
|
||||
List<QsvSubject> subjects = dao.query(QsvSubject.class, Cnd.where("id", "in", answerRecord2.getSubjectIds()));
|
||||
dao.fetchLinks(subjects, "options");
|
||||
dao.fetchLinks(subjects, "options", Cnd.NEW().asc("sortNum"));
|
||||
|
||||
for (QsvSubject subject : subjects) {
|
||||
if (subject.getUserSelectOptionIds() == null) {
|
||||
|
||||
@@ -41,6 +41,16 @@ public class QsvOption extends BaseModel {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String imgUrl;
|
||||
|
||||
@Column
|
||||
@Comment("链接地址")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String link;
|
||||
|
||||
@Column
|
||||
@Comment("详情")
|
||||
@ColDefine(customType = "longtext")
|
||||
private String description;
|
||||
|
||||
@Column
|
||||
@Comment("排序")
|
||||
@ColDefine(type = ColType.INT)
|
||||
|
||||
@@ -52,6 +52,11 @@ public class QsvSubject extends BaseModel {
|
||||
@ColDefine(type = ColType.DATE)
|
||||
private Date displayDate;
|
||||
|
||||
@Column
|
||||
@Comment("多选,最多选几个")
|
||||
@ColDefine(type = ColType.INT, width = 1)
|
||||
private Integer maxMulti;
|
||||
|
||||
@Column
|
||||
@Comment("排序")
|
||||
@ColDefine(type = ColType.INT, width = 1)
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ public class MemberChangeApplyController {
|
||||
record.setChangeOrigin(MemberChangeOrigin.PERSONAL.name());
|
||||
|
||||
|
||||
if (List.of(10030, 10060).contains(record.getApplyStateId())) {
|
||||
if (record.getApplyStateId() != null && List.of(10030, 10060).contains(record.getApplyStateId())) {
|
||||
MemberChangeToDoHandler.COMPLETE_APPLY_RE_MODIFY_TASK.exec(record, NutMap.NEW().addv("nodeName", "重新修改申请"));
|
||||
}
|
||||
// 待分工会审核
|
||||
|
||||
+41
-1
@@ -27,6 +27,8 @@ import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
@@ -94,7 +96,7 @@ public class MemberChangeBranchUnionAuditController {
|
||||
audit.setLoginname(ShiroUtil.getPlatformLoginname());
|
||||
audit.setUsername(ShiroUtil.getPlatformUsername());
|
||||
audit.setAuditTime(DateUtil.date());
|
||||
audit = dao.insert(audit);
|
||||
dao.insert(audit);
|
||||
|
||||
MemberChangeRecord record = dao.fetch(MemberChangeRecord.class, id);
|
||||
if (audit.getAuditType() == 2) {
|
||||
@@ -123,6 +125,44 @@ public class MemberChangeBranchUnionAuditController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("member.change.branchUnion.audit")
|
||||
@SLog(type = "memberChange", tag = "会员变更", msg = "分工会批量审核")
|
||||
public Object doBatchApproval(@Param("data") String[] ids){
|
||||
if (ids.length == 0) {
|
||||
return Result.error("未获取到选择数据");
|
||||
}
|
||||
|
||||
// 批量审核,那就只有一条审核的记录
|
||||
Audit audit = new Audit();
|
||||
audit.setAuditor(ShiroUtil.getUserId());
|
||||
audit.setLoginname(ShiroUtil.getPlatformLoginname());
|
||||
audit.setUsername(ShiroUtil.getPlatformUsername());
|
||||
audit.setAuditTime(DateUtil.date());
|
||||
audit.setAuditOpinion("分工会批量审核通过");
|
||||
dao.insert(audit);
|
||||
|
||||
// 查询要审核的变更记录
|
||||
List<MemberChangeRecord> recordList = dao.query(MemberChangeRecord.class, Cnd.where("id", "in", ids));
|
||||
for (MemberChangeRecord record : recordList) {
|
||||
// 批量推送待办
|
||||
MemberChangeToDoHandler.COMPLETE_UNION_TASK.exec(record, NutMap.NEW().addv("nodeName", "分工会审核完成"));
|
||||
MemberChangeToDoHandler.CREATE_SCHOOL_TASK.exec(record, null);
|
||||
|
||||
// 推送短信
|
||||
}
|
||||
|
||||
dao.update(MemberChangeRecord.class,
|
||||
Chain.make("applyStateId", 10050).add("branchUnionAuditId", audit.getId()),
|
||||
Cnd.where("id", "in", ids));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
|
||||
+14
-14
@@ -74,7 +74,7 @@ public class MemberChangeManageController {
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/member/change/manage/index.html")
|
||||
@RequiresPermissions("member.change.mange")
|
||||
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"})
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class MemberChangeManageController {
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.change.mange")
|
||||
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"})
|
||||
public Object pageData(@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "threeUnitId", required = false) String threeUnitId,
|
||||
@@ -277,7 +277,7 @@ public class MemberChangeManageController {
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("member.change.mange")
|
||||
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"})
|
||||
@SLog(tag = "会员高级管理-会员变更", msg = "分工会/校工会会员管理员提交变更")
|
||||
public Object doSubmitChange(MemberChangeRecord record) {
|
||||
// 检验是否有变更
|
||||
@@ -341,7 +341,7 @@ public class MemberChangeManageController {
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.change.mange")
|
||||
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"})
|
||||
public Object sendSms(String userid) {
|
||||
Sys_user user = userService.fetch(userid);
|
||||
/*if (Strings.isNotBlank(user.getMobile())) {
|
||||
@@ -357,7 +357,7 @@ public class MemberChangeManageController {
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.change.mange")
|
||||
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"})
|
||||
public Object allIsWelfareMember(PageForm pageForm,
|
||||
@Param(value = "startDate", required = false) String startDate,
|
||||
@Param(value = "endDate", required = false) String endDate,
|
||||
@@ -429,7 +429,7 @@ public class MemberChangeManageController {
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.change.mange")
|
||||
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"})
|
||||
public Object userUnitMove(String threeUnitId, String unitId, @Param("userId[]") String[] userId) {
|
||||
|
||||
Sys_unit unit = memberService.dao().fetch(Sys_unit.class, unitId);
|
||||
@@ -466,7 +466,7 @@ public class MemberChangeManageController {
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.change.mange")
|
||||
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"})
|
||||
public Object userPageData(PageForm pageForm,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@@ -505,7 +505,7 @@ public class MemberChangeManageController {
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("member.change.mange")
|
||||
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"})
|
||||
public Object joinWelfareMember(String[] userIds, String taskId,
|
||||
@Param(value = "threeUnitId", required = false) String threeUnitId,
|
||||
@Param(value = "unitId", required = false) String unitId) {
|
||||
@@ -548,7 +548,7 @@ public class MemberChangeManageController {
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.change.mange")
|
||||
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"})
|
||||
public Object units() {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("unitlevel", "=", 2);
|
||||
@@ -560,7 +560,7 @@ public class MemberChangeManageController {
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.change.mange")
|
||||
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"})
|
||||
public Object batchUpdatePersonType(@Param("users") String data) {
|
||||
List<Sys_user> users = Json.fromJsonAsList(Sys_user.class, data);
|
||||
for (Sys_user user : users) {
|
||||
@@ -571,7 +571,7 @@ public class MemberChangeManageController {
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.change.mange")
|
||||
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"})
|
||||
public Object batchUpdateUserState(@Param("users") String data) {
|
||||
List<Sys_user> users = Json.fromJsonAsList(Sys_user.class, data);
|
||||
for (Sys_user user : users) {
|
||||
@@ -583,7 +583,7 @@ public class MemberChangeManageController {
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresPermissions("member.change.mange")
|
||||
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"})
|
||||
public void downloadImport(HttpServletResponse response) {
|
||||
try {
|
||||
ViTool.excelResponse(response, "会员导入模版.xlsx");
|
||||
@@ -613,7 +613,7 @@ public class MemberChangeManageController {
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("member.change.mange")
|
||||
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"})
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
@SLog(type = "会员管理系统", tag = "信息维护-会员高级管理", msg = "导入会员", param = true, result = true)
|
||||
public Object doImport(TempFile file) {
|
||||
@@ -727,7 +727,7 @@ public class MemberChangeManageController {
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.change.mange")
|
||||
@RequiresPermissions(value = {"member.change.mange", "staff.member.change.mange"})
|
||||
public Object getAllChangeMemberInfo(String userId){
|
||||
List<NutMap> mapList = memberService.getAllChangeInfo(userId);
|
||||
if (Lang.isEmpty(mapList)) {
|
||||
|
||||
+41
-1
@@ -27,6 +27,8 @@ import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
@@ -116,7 +118,7 @@ public class MemberChangeSchoolUnionAuditController {
|
||||
MemberChangeToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(record, NutMap.NEW().addv("nodeName", "校工会退回"));
|
||||
} else if (audit.getAuditType() == 1) {
|
||||
MemberChangeToDoHandler.COMPLETE_PROCESS.exec(record, null);
|
||||
memberCommonService.compareChangeInfoAndUpdateMember(record.getId());
|
||||
memberCommonService.compareChangeInfoAndUpdateMember(record);
|
||||
} else {
|
||||
MemberChangeToDoHandler.REFUSE_UNION_TASK.exec(record, NutMap.NEW().addv("nodeName", "校工会审核拒绝"));
|
||||
}
|
||||
@@ -124,6 +126,44 @@ public class MemberChangeSchoolUnionAuditController {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("member.change.schoolUnion.audit")
|
||||
@SLog(type = "memberChange", tag = "会员变更", msg = "校工会批量审核")
|
||||
public Object doBatchApproval(@Param("data") String[] ids){
|
||||
if (ids.length == 0) {
|
||||
return Result.error("未获取到选择数据");
|
||||
}
|
||||
|
||||
// 批量审核,那就只有一条审核的记录
|
||||
Audit audit = new Audit();
|
||||
audit.setAuditor(ShiroUtil.getUserId());
|
||||
audit.setLoginname(ShiroUtil.getPlatformLoginname());
|
||||
audit.setUsername(ShiroUtil.getPlatformUsername());
|
||||
audit.setAuditTime(DateUtil.date());
|
||||
audit.setAuditOpinion("校工会批量审核通过");
|
||||
dao.insert(audit);
|
||||
|
||||
// 查询要审核的变更记录
|
||||
List<MemberChangeRecord> recordList = dao.query(MemberChangeRecord.class, Cnd.where("id", "in", ids));
|
||||
for (MemberChangeRecord record : recordList) {
|
||||
// 批量完成待办
|
||||
MemberChangeToDoHandler.COMPLETE_SCHOOL_TASK.exec(record, NutMap.NEW().addv("nodeName", "校工会审核完成"));
|
||||
MemberChangeToDoHandler.COMPLETE_PROCESS.exec(record, null);
|
||||
|
||||
memberCommonService.compareChangeInfoAndUpdateMember(record.getId());
|
||||
// 推送短信
|
||||
}
|
||||
|
||||
dao.update(MemberChangeRecord.class,
|
||||
Chain.make("applyStateId", 10080).add("schoolUnionAuditId", audit.getId()),
|
||||
Cnd.where("id", "in", ids));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
|
||||
@@ -78,6 +78,11 @@ public interface MemberCommonService extends ViService<Sys_user> {
|
||||
* @param recordId
|
||||
*/
|
||||
void compareChangeInfoAndUpdateMember(String recordId);
|
||||
/**
|
||||
* 存储比较变更信息并更新会员信息
|
||||
* @param record
|
||||
*/
|
||||
void compareChangeInfoAndUpdateMember(MemberChangeRecord record);
|
||||
|
||||
/**
|
||||
* 获取会员的变更信息
|
||||
|
||||
+13
-5
@@ -23,10 +23,12 @@ import io.v.nutz.zhgh.staffmanage.member.service.MemberCommonService;
|
||||
import io.v.nutz.zhgh.staffmanage.specialstaff.model.SpecialStaff;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareList;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
@@ -160,9 +162,11 @@ public class MemberCommonServiceImpl extends ViServiceImpl<Sys_user> implements
|
||||
Set<String> allowChangeFieldNames = dictList.stream().map(Sys_dict::getCode).collect(Collectors.toSet());
|
||||
allowChangeFieldNames.add("member");
|
||||
allowChangeFieldNames.add("welfareMember");
|
||||
allowChangeFieldNames.add("unitid");
|
||||
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(Sys_dict::getCode, Sys_dict::getName));
|
||||
dictMap.put("member", "会员状态");
|
||||
dictMap.put("welfareMember", "福利会员状态");
|
||||
dictMap.put("unitid", "单位");
|
||||
return NutMap.NEW().addv("allowChangeFieldNames", allowChangeFieldNames).addv("dictMap", dictMap);
|
||||
}
|
||||
|
||||
@@ -234,6 +238,12 @@ public class MemberCommonServiceImpl extends ViServiceImpl<Sys_user> implements
|
||||
@Override
|
||||
public void compareChangeInfoAndUpdateMember(String recordId) {
|
||||
MemberChangeRecord record = dao().fetch(MemberChangeRecord.class, recordId);
|
||||
compareChangeInfoAndUpdateMember(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void compareChangeInfoAndUpdateMember(MemberChangeRecord record) {
|
||||
List<NutMap> changeList = getChangeInfos(record);
|
||||
|
||||
// 如果有工会关系人员,这个user用来存储数据
|
||||
@@ -247,12 +257,11 @@ public class MemberCommonServiceImpl extends ViServiceImpl<Sys_user> implements
|
||||
}
|
||||
|
||||
if (Lang.isNotEmpty(history)) {
|
||||
history.setRecordId(recordId);
|
||||
history.setRecordId(record.getId());
|
||||
history.setChangeTime(DateUtil.date());
|
||||
history.setChangeTypes(record.getChangeTypes());
|
||||
history.setChangeOrigin(record.getChangeOrigin());
|
||||
|
||||
|
||||
// 加入会员
|
||||
if (record.getMember()) {
|
||||
int activityCount = dao().count(ActivityUserScope.class, Cnd.where("userId", "=", userId).and("groupId", "=", 1));
|
||||
@@ -340,7 +349,7 @@ public class MemberCommonServiceImpl extends ViServiceImpl<Sys_user> implements
|
||||
// 如果有工会关系变更,也需要记录变更了什么工会
|
||||
history.setChangeInfos(changeList);
|
||||
String changeInfos = changeList.stream().map(v -> {
|
||||
return v.getString("fieldName") + ":" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + "->" + HtmlUtil.cleanHtmlTag(v.getString("newValue")) + ";";
|
||||
return v.getString("fieldName") + ":" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + "->" + HtmlUtil.cleanHtmlTag(v.getString("newValue"));
|
||||
}).collect(Collectors.joining(";"));
|
||||
history.setChangeInfosStr(changeInfos);
|
||||
dao().updateIgnoreNull(info);
|
||||
@@ -351,7 +360,6 @@ public class MemberCommonServiceImpl extends ViServiceImpl<Sys_user> implements
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有变更记录
|
||||
* @param userId
|
||||
@@ -408,7 +416,7 @@ public class MemberCommonServiceImpl extends ViServiceImpl<Sys_user> implements
|
||||
|
||||
if (!ObjectUtil.equals(currentValue, previousValue)) {
|
||||
String name = fieldsMap.getOrDefault(fieldName, fieldName);
|
||||
if ("unitId".equals(fieldName)) {
|
||||
if ("unitId".equals(fieldName) || "unitid".equals(fieldName)) {
|
||||
List<Sys_unit> unitList = dao().query(Sys_unit.class,
|
||||
Cnd.where("id", "in", List.of(previousValue, currentValue)));
|
||||
Object finalPreviousValue = previousValue;
|
||||
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
package io.v.nutz.zhgh.staffmanage.single.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.staffmanage.single.model.SingleUser;
|
||||
import io.v.nutz.zhgh.staffmanage.single.service.SingleUserService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/single/myApply")
|
||||
public class SingleMyApplyController {
|
||||
|
||||
@Inject
|
||||
private SingleUserService singleUserService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/single/myApply.html")
|
||||
@RequiresPermissions("single.user.myApply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("single.user.myApply")
|
||||
public Object pageData(PageForm pageForm,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "threeUnitId", required = false) String threeUnitId,
|
||||
@Param(value = "unionGroupId", required = false) String unionGroupId,
|
||||
@Param(value = "personType", required = false) String personType,
|
||||
@Param(value = "userState", required = false) String userState,
|
||||
@Param(value = "sex", required = false) String sex,
|
||||
@Param(value = "isJoin",required = false) Boolean isJoin) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
su.*,
|
||||
u.unionname AS unionName,
|
||||
u.unitname AS unitName,
|
||||
u.username,
|
||||
u.sex,
|
||||
u.loginname,
|
||||
u.userState,
|
||||
u.personType,
|
||||
state.stateName
|
||||
FROM
|
||||
`single_user` su
|
||||
LEFT JOIN `user` u ON u.id = su.userId
|
||||
LEFT JOIN `audit_state` state ON state.stateId = su.singleState
|
||||
$condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("u.username", pageForm.getSearchKeyword());
|
||||
seg.orLike("u.loginname", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")){
|
||||
cnd.and("u.id","=",ShiroUtil.getUserId());
|
||||
}
|
||||
cnd.and("su.singleState","in",isJoin? Lang.list(8000,8010,8015,8020,8025,8030): Lang.list(8040,8045,8050,8055,8060));
|
||||
cnd.andEX("u.unionid", "=", unionId);
|
||||
cnd.andEX("u.unitid", "=", unitId);
|
||||
cnd.andEX("u.threeUnitId", "=", threeUnitId);
|
||||
cnd.andEX("u.unionGroupId", "=", unionGroupId);
|
||||
cnd.andEX("u.personType", "=", personType);
|
||||
cnd.andEX("u.userState", "=", userState);
|
||||
cnd.andEX("u.sex","=",sex);
|
||||
cnd.desc("su.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return singleUserService.listPageMap(pageForm.getPageNumber(),pageForm.getPageSize(),sql);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 退会
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("single.user.myApply")
|
||||
public Object exitSingle(String id) {
|
||||
int count = singleUserService.count(Cnd.where("id", "=", id).and("singleState", "=", "8030"));
|
||||
if (count == 1) {
|
||||
singleUserService.update(Chain.make("singleState", "8040"), Cnd.where("id", "=", id));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("single.user.myApply")
|
||||
public Object removeById(String id){
|
||||
singleUserService.delete(id);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("single.user.myApply")
|
||||
public Object doEdit(SingleUser user){
|
||||
singleUserService.updateIgnoreNull(user);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object findAuditSuccess(){
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
su.*,
|
||||
u.unionname AS unionName,
|
||||
u.unitname AS unitName,
|
||||
u.username AS userName,
|
||||
u.sex,
|
||||
u.loginname AS loginName
|
||||
FROM
|
||||
`single_user` su
|
||||
LEFT JOIN `user` u ON u.id = su.userId
|
||||
WHERE
|
||||
su.singleState = '8030'
|
||||
AND su.userId = @userId
|
||||
""").setParam("userId", ShiroUtil.getUserId());
|
||||
return singleUserService.listMap(sql).stream().findFirst().orElse(null);
|
||||
}
|
||||
}
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
package io.v.nutz.zhgh.staffmanage.single.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.staffmanage.single.model.SingleUser;
|
||||
import io.v.nutz.zhgh.staffmanage.single.service.SingleUserService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
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.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/single/schoolAudit")
|
||||
public class SingleSchoolAuditController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private SingleUserService singleUserService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/single/schoolAudit.html")
|
||||
@RequiresPermissions("single.user.schoolAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("single.user.unionAudit")
|
||||
public Object pageData(PageForm pageForm,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "threeUnitId", required = false) String threeUnitId,
|
||||
@Param(value = "unionGroupId", required = false) String unionGroupId,
|
||||
@Param(value = "personType", required = false) String personType,
|
||||
@Param(value = "userState", required = false) String userState,
|
||||
@Param(value = "isJoin", required = false) String isJoin,
|
||||
@Param(value = "isAudit", required = false) String isAudit,
|
||||
@Param(value = "sex", required = false) String sex) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
su.*,
|
||||
u.unionname AS unionName,
|
||||
u.unitname AS unitName,
|
||||
u.username,
|
||||
u.sex,
|
||||
u.loginname,
|
||||
u.userState,
|
||||
u.personType,
|
||||
state.stateName
|
||||
FROM
|
||||
`single_user` su
|
||||
LEFT JOIN `user` u ON u.id = su.userId
|
||||
LEFT JOIN `audit_state` state ON state.stateId = su.singleState
|
||||
$condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("u.username", pageForm.getSearchKeyword());
|
||||
seg.orLike("u.loginname", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
cnd.and("u.unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
cnd.andEX("u.unionid", "=", unionId);
|
||||
cnd.andEX("u.unitid", "=", unitId);
|
||||
cnd.andEX("u.threeUnitId", "=", threeUnitId);
|
||||
cnd.andEX("u.unionGroupId", "=", unionGroupId);
|
||||
cnd.andEX("u.personType", "=", personType);
|
||||
cnd.andEX("u.userState", "=", userState);
|
||||
cnd.andEX("u.sex", "=", sex);
|
||||
if ("false".equals(isJoin)) {
|
||||
cnd.and("su.singleState", ">", 8030);
|
||||
} else {
|
||||
cnd.and("su.singleState", "<=", 8030);
|
||||
}
|
||||
cnd.and("su.singleState", "true".equals(isAudit) ? ">" : "false".equals(isAudit) ? "=" : ">=", "true".equals(isJoin) ? 8020 : 8050);
|
||||
sql.setCondition(cnd);
|
||||
return singleUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("single.user.unionAudit")
|
||||
public Object doAudit(@Param("audit") Audit audit, String id, String isPass, String isJoin) {
|
||||
dao.insert(audit);
|
||||
dao.update(SingleUser.class, Chain.make("singleState", "1".equals(isPass) ? "true".equals(isJoin) ? 8030 : 8060 : "true".equals(isJoin) ? 8025 : 8055)
|
||||
.add("true".equals(isJoin) ? "joinTime" : "exitTime", new Date())
|
||||
.add("true".equals(isJoin) ? "schoolAuditId" : "exitSchoolAuditId", audit.getId()), Cnd.where("id", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("single.user.unionAudit")
|
||||
public Object doRollBack(String id, String isJoin) {
|
||||
SingleUser user = singleUserService.fetch(id);
|
||||
dao.clear(Audit.class, Cnd.where("id", "=", "true".equals(isJoin) ? user.getSchoolAuditId() : user.getExitSchoolAuditId()));
|
||||
singleUserService.update(Chain.make("true".equals(isJoin) ? "schoolAuditId" : "exitSchoolAuditId", null)
|
||||
.add("true".equals(isJoin) ? "joinTime" : "exitTime", null)
|
||||
.add("singleState", "true".equals(isJoin) ? 8020 : 8050), Cnd.where("id", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object getAuditNum(String isAudit, String unionId) {
|
||||
return singleUserService.getAuditNum("school", isAudit, unionId);
|
||||
}
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
package io.v.nutz.zhgh.staffmanage.single.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.staffmanage.single.model.SingleUser;
|
||||
import io.v.nutz.zhgh.staffmanage.single.service.SingleUserService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
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.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/single/unionAudit")
|
||||
public class SingleUnionAuditController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private SingleUserService singleUserService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/single/unionAudit.html")
|
||||
@RequiresPermissions("single.user.unionAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("single.user.unionAudit")
|
||||
public Object pageData(PageForm pageForm,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "threeUnitId", required = false) String threeUnitId,
|
||||
@Param(value = "unionGroupId", required = false) String unionGroupId,
|
||||
@Param(value = "personType", required = false) String personType,
|
||||
@Param(value = "userState", required = false) String userState,
|
||||
@Param(value = "isJoin", required = false) String isJoin,
|
||||
@Param(value = "isAudit", required = false) String isAudit,
|
||||
@Param(value = "sex", required = false) String sex) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
su.*,
|
||||
u.unionname AS unionName,
|
||||
u.unitname AS unitName,
|
||||
u.username,
|
||||
u.sex,
|
||||
u.loginname,
|
||||
u.userState,
|
||||
u.personType,
|
||||
state.stateName
|
||||
FROM
|
||||
`single_user` su
|
||||
LEFT JOIN `user` u ON u.id = su.userId
|
||||
LEFT JOIN `audit_state` state ON state.stateId = su.singleState
|
||||
$condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("u.username", pageForm.getSearchKeyword());
|
||||
seg.orLike("u.loginname", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
cnd.and("u.unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
cnd.andEX("u.unionid", "=", unionId);
|
||||
cnd.andEX("u.unitid", "=", unitId);
|
||||
cnd.andEX("u.threeUnitId", "=", threeUnitId);
|
||||
cnd.andEX("u.unionGroupId", "=", unionGroupId);
|
||||
cnd.andEX("u.personType", "=", personType);
|
||||
cnd.andEX("u.userState", "=", userState);
|
||||
cnd.andEX("u.sex", "=", sex);
|
||||
if ("false".equals(isJoin)) {
|
||||
cnd.and("su.singleState", ">", 8030);
|
||||
} else {
|
||||
cnd.and("su.singleState", "<=", 8030);
|
||||
}
|
||||
cnd.and("su.singleState", "true".equals(isAudit) ? ">" : "false".equals(isAudit) ? "=" : ">=", "true".equals(isJoin) ? 8010 : 8040);
|
||||
sql.setCondition(cnd);
|
||||
return singleUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("single.user.unionAudit")
|
||||
public Object doAudit(@Param("audit") Audit audit, String id, String isPass, String isJoin) {
|
||||
dao.insert(audit);
|
||||
dao.update(SingleUser.class, Chain.make("singleState", "1".equals(isPass) ? "true".equals(isJoin) ? 8020 : 8050 : "true".equals(isJoin) ? 8015 : 8045)
|
||||
.add("true".equals(isJoin) ? "unionAuditId" : "exitUnionAuditId", audit.getId()), Cnd.where("id", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("single.user.unionAudit")
|
||||
public Object doRollBack(String id, String isJoin) {
|
||||
SingleUser user = singleUserService.fetch(id);
|
||||
dao.clear(Audit.class, Cnd.where("id", "=", "true".equals(isJoin) ? user.getUnionAuditId() : user.getExitUnionAuditId()));
|
||||
singleUserService.update(Chain.make("true".equals(isJoin) ? "unionAuditId" : "exitUnionAuditId", null)
|
||||
.add("singleState", "true".equals(isJoin) ? 8010 : 8040), Cnd.where("id", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object getAuditNum(String isAudit,String unionId) {
|
||||
return singleUserService.getAuditNum("union", isAudit,unionId);
|
||||
}
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package io.v.nutz.zhgh.staffmanage.single.controller;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.staffmanage.single.model.SingleUser;
|
||||
import io.v.nutz.zhgh.staffmanage.single.service.SingleUserService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/single/apply")
|
||||
public class SingleUserApplyController {
|
||||
|
||||
@Inject
|
||||
private SingleUserService singleUserService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/single/apply.html")
|
||||
@RequiresPermissions("single.user.apply")
|
||||
public void index() {}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("single.user.apply")
|
||||
public Object doSubmit(SingleUser user, boolean isSubmit){
|
||||
if (isSubmit) {
|
||||
user.setSingleState("8010");
|
||||
}else {
|
||||
user.setSingleState("8000");
|
||||
}
|
||||
user.setUserId(ShiroUtil.getUserId());
|
||||
user.setApplyTime(new Date());
|
||||
singleUserService.insert(user);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("single.user.apply")
|
||||
public Object findOneSingle(String id){
|
||||
return singleUserService.findOne(id);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("single.user.apply")
|
||||
public Object doModifyInfo(SingleUser user){
|
||||
return singleUserService.updateIgnoreNull(user);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("single.user.apply")
|
||||
public Object isJoinedBeforeAndIsAudit(){
|
||||
//之前是否加入过
|
||||
List<SingleUser> singleUserList = singleUserService.query(Cnd.where("userId", "=", ShiroUtil.getUserId()).and("singleState", "=", "8060"));
|
||||
SingleUser singleUser = singleUserList.stream().min(Comparator.comparing(SingleUser::getExitTime, Comparator.nullsFirst(Comparator.naturalOrder()))).orElse(null);
|
||||
//是否有审核的记录
|
||||
SingleUser user = singleUserService.fetch(Cnd.where("userId", "=", ShiroUtil.getUserId())
|
||||
.and("singleState", "is not", null).and("singleState", "!=", "")
|
||||
.and("singleState", "<", "8060").and("singleState", ">=", "8010"));
|
||||
NutMap nutMap = new NutMap();
|
||||
nutMap.setv("singleUser",singleUser);
|
||||
nutMap.setv("auditUser",user);
|
||||
return nutMap;
|
||||
}
|
||||
}
|
||||
+36
-51
@@ -4,20 +4,19 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.result.Result;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.zhgh.staffmanage.single.service.SingleUserService;
|
||||
import io.v.nutz.base.result.Result;
|
||||
import io.v.nutz.base.utils.ViTool;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.zhgh.staffmanage.single.service.SingleUserService;
|
||||
import io.v.nutz.zhgh.staffmanage.thirtyteach.template.ThirtyTeachTemp;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
@@ -50,7 +49,7 @@ import java.util.stream.Collectors;
|
||||
public class SingleUserController {
|
||||
|
||||
@Inject
|
||||
private SingleUserService userService;
|
||||
private SingleUserService singleUserService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/single/list.html")
|
||||
@@ -68,15 +67,21 @@ public class SingleUserController {
|
||||
@Param(value = "unionGroupId", required = false) String unionGroupId,
|
||||
@Param(value = "personTypes", required = false) String[] personTypes,
|
||||
@Param(value = "userStates", required = false) String[] userStates,
|
||||
@Param(value = "age", required = false) String[] age,
|
||||
@Param(value = "campus", required = false) String campus,
|
||||
@Param(value = "sex", required = false) String sex,
|
||||
@Param(value = "memberStatus", required = false) Integer memberStatus,
|
||||
@Param(value = "position", required = false) String position,
|
||||
@Param(value = "jobTitle", required = false) String jobTitle,
|
||||
@Param(value = "searchName", required = false) String searchName,
|
||||
@Param(value = "searchKeyWord", required = false) String searchKeyWord) {
|
||||
return userService.singlePageList(pageForm.getPageNumber(), pageForm.getPageSize(), unionId, unitId, threeUnitId, unionGroupId,
|
||||
personTypes, userStates, campus, sex, memberStatus, position, jobTitle, searchName, searchKeyWord);
|
||||
@Param(value = "searchKeyWord", required = false) String searchKeyWord,
|
||||
@Param(value = "isJoin", required = false) Boolean isJoin,
|
||||
@Param(value = "education", required = false) String education,
|
||||
@Param(value = "maritalStatus", required = false) String maritalStatus) {
|
||||
Sql sql = singleUserService.singlePageList(unionId, unitId, threeUnitId, unionGroupId,
|
||||
personTypes, userStates, age, campus, sex, memberStatus, position, jobTitle,
|
||||
searchName, searchKeyWord, isJoin, education, maritalStatus);
|
||||
return singleUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@@ -91,17 +96,23 @@ public class SingleUserController {
|
||||
@Param(value = "unionGroupId", required = false) String unionGroupId,
|
||||
@Param(value = "personTypes", required = false) String personTypes,
|
||||
@Param(value = "userStates", required = false) String userStates,
|
||||
@Param(value = "age", required = false) String age,
|
||||
@Param(value = "campus", required = false) String campus,
|
||||
@Param(value = "sex", required = false) String sex,
|
||||
@Param(value = "memberStatus", required = false) Integer memberStatus,
|
||||
@Param(value = "position", required = false) String position,
|
||||
@Param(value = "jobTitle", required = false) String jobTitle,
|
||||
@Param(value = "searchName", required = false) String searchName,
|
||||
@Param(value = "searchKeyWord", required = false) String searchKeyWord) {
|
||||
@Param(value = "searchKeyWord", required = false) String searchKeyWord,
|
||||
@Param(value = "isJoin", required = false) Boolean isJoin,
|
||||
@Param(value = "education", required = false) String education,
|
||||
@Param(value = "maritalStatus", required = false) String maritalStatus) {
|
||||
try {
|
||||
ViTool.excelResponse(response, "单身教工名单.xls");
|
||||
List<NutMap> dataList = userService.singlePageList(unionId, unitId, threeUnitId, unionGroupId, Json.fromJsonAsArray(String.class, personTypes),
|
||||
Json.fromJsonAsArray(String.class, userStates), campus, sex, memberStatus, position, jobTitle, searchName, searchKeyWord);
|
||||
ViTool.excelResponse(response, "单身教工名单.xlsx");
|
||||
Sql sql = singleUserService.singlePageList(unionId, unitId, threeUnitId, unionGroupId, Json.fromJsonAsArray(String.class, personTypes),
|
||||
Json.fromJsonAsArray(String.class, userStates), Json.fromJsonAsArray(String.class, age), campus, sex, memberStatus, position,
|
||||
jobTitle, searchName, searchKeyWord, isJoin, education, maritalStatus);
|
||||
List<NutMap> dataList = singleUserService.listMap(sql);
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
ExcelExportEntity no = new ExcelExportEntity("序号", "no", 10);
|
||||
no.setFormat("isAddIndex");
|
||||
@@ -111,6 +122,12 @@ public class SingleUserController {
|
||||
propMap.forEach((k, v) -> {
|
||||
entityList.add(new ExcelExportEntity(v, k, 20));
|
||||
});
|
||||
entityList.add(new ExcelExportEntity("身高(cm)", "height", 10));
|
||||
entityList.add(new ExcelExportEntity("籍贯", "hometown", 20));
|
||||
entityList.add(new ExcelExportEntity("学历", "education", 20));
|
||||
entityList.add(new ExcelExportEntity("爱好", "hobby", 20));
|
||||
entityList.add(new ExcelExportEntity("交友意向", "intentionFriends", 50));
|
||||
entityList.add(new ExcelExportEntity("个人介绍", "personalIntroduction", 50));
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), entityList, dataList);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (IOException e) {
|
||||
@@ -119,65 +136,32 @@ public class SingleUserController {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@SLog(tag = "单身教工", msg = "删除", param = true, result = true)
|
||||
public Object delete(String userId) {
|
||||
userService.update(Chain.make("marriage", "已婚"), Cnd.where("id", "=", userId));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导入模板下载
|
||||
* @param response
|
||||
*/
|
||||
@At
|
||||
@Ok("void")
|
||||
public void downloadImport(HttpServletResponse response) {
|
||||
try {
|
||||
ViTool.excelResponse(response, "单身教工导入模版.xlsx");
|
||||
ExportParams exportParams = new ExportParams();
|
||||
List<ExcelExportEntity> list = new ArrayList<>();
|
||||
list.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
list.add(new ExcelExportEntity("身份证号码", "idCard", 20));
|
||||
list.add(new ExcelExportEntity("出生年月", "birthday", 20));
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, list, new ArrayList<>());
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Object doImport(TempFile file, boolean isFlag) {
|
||||
try {
|
||||
List<ThirtyTeachTemp> thirtyTeachImportList = ExcelImportUtil.importExcel(file.getFile(), ThirtyTeachTemp.class, new ImportParams());
|
||||
|
||||
List<Sys_user> users = userService.query();
|
||||
List<Sys_user> users = singleUserService.dao().query(Sys_user.class, Cnd.NEW());
|
||||
List<String> allUserList = users.stream().map(Sys_user::getLoginname).collect(Collectors.toList());
|
||||
|
||||
List<ThirtyTeachTemp> errorInfos = new ArrayList<>();
|
||||
List<String> insertUserIds = new ArrayList<>();
|
||||
thirtyTeachImportList.forEach(v -> {
|
||||
if (allUserList.contains(v.getLoginName().trim())){
|
||||
if (allUserList.contains(v.getLoginName().trim())) {
|
||||
insertUserIds.add(v.getLoginName());
|
||||
}else {
|
||||
} else {
|
||||
v.setRemark("获取不到该用户的工号,请检查工号是否正确!");
|
||||
errorInfos.add(v);
|
||||
}
|
||||
});
|
||||
|
||||
int i = 0;
|
||||
if (Lang.isNotEmpty(insertUserIds)){
|
||||
if (Lang.isNotEmpty(insertUserIds)) {
|
||||
if (isFlag) {
|
||||
userService.update(Chain.make("marriage", null),Cnd.where("marriage","=","未婚"));
|
||||
singleUserService.update(Chain.make("marriage", null), Cnd.where("marriage", "=", "未婚"));
|
||||
}
|
||||
i = userService.update(Chain.make("marriage", "已婚"), Cnd.where("loginname", "in", insertUserIds));
|
||||
i = singleUserService.update(Chain.make("marriage", "已婚"), Cnd.where("loginname", "in", insertUserIds));
|
||||
}
|
||||
|
||||
if (Lang.isNotEmpty(errorInfos)) {
|
||||
@@ -196,4 +180,5 @@ public class SingleUserController {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+11
-14
@@ -37,16 +37,17 @@ public class SingleUserStatisticsController {
|
||||
@At("")
|
||||
@Ok("beetl:/platform/single/statistics.html")
|
||||
@RequiresPermissions("single.user.statistics")
|
||||
public void index() {}
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("single.user.statistics")
|
||||
public Object pageData(@Param(value = "unionId",required = false) String unionId,
|
||||
@Param(value = "unitId",required = false) String unitId,
|
||||
@Param(value = "personTypes",required = false) String[] personTypes,
|
||||
@Param(value = "analyze",required = false) String analyze) {
|
||||
public Object pageData(@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "personTypes", required = false) String[] personTypes,
|
||||
@Param(value = "analyze", required = false) String analyze) {
|
||||
return userService.singleStatisticsList(personTypes, unionId, unitId, analyze);
|
||||
}
|
||||
|
||||
@@ -57,7 +58,7 @@ public class SingleUserStatisticsController {
|
||||
List<NutMap> singleUserList = userService.singleStatisticsList(personTypes, unionId, unitId, analyze);
|
||||
List<NutMap> finalMemberList = singleUserList;
|
||||
NutMap sumMap = new NutMap() {{
|
||||
addv("0".equals(analyze)?"unionCode":"unitCode", "合计");
|
||||
addv("unCode", "合计");
|
||||
addv("totalNumber", finalMemberList.stream().mapToInt(v -> v.getInt("totalNumber")).sum());
|
||||
addv("male", finalMemberList.stream().mapToInt(v -> v.getInt("male")).sum());
|
||||
addv("female", finalMemberList.stream().mapToInt(v -> v.getInt("female")).sum());
|
||||
@@ -73,13 +74,9 @@ public class SingleUserStatisticsController {
|
||||
singleUserList.add(sumMap);
|
||||
|
||||
List<ExcelExportEntity> entityList = new ArrayList<>();
|
||||
if ("0".equals(analyze)) {
|
||||
entityList.add(new ExcelExportEntity("分工会代码", "unionCode", 20));
|
||||
entityList.add(new ExcelExportEntity("分工会名称", "unionName", 20));
|
||||
}else if("1".equals(analyze)){
|
||||
entityList.add(new ExcelExportEntity("单位代码", "unitCode", 20));
|
||||
entityList.add(new ExcelExportEntity("单位名称", "unitName", 20));
|
||||
}
|
||||
entityList.add(new ExcelExportEntity("0".equals(analyze) ? "分工会代码" : "单位代码", "unCode", 20));
|
||||
entityList.add(new ExcelExportEntity("0".equals(analyze) ? "分工会名称" : "单位名称", "unName", 20));
|
||||
|
||||
entityList.add(new ExcelExportEntity("总人数", "totalNumber", 20));
|
||||
entityList.add(new ExcelExportEntity("男", "male", 20));
|
||||
entityList.add(new ExcelExportEntity("女", "female", 20));
|
||||
@@ -94,7 +91,7 @@ public class SingleUserStatisticsController {
|
||||
|
||||
try {
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + new String(("单身教工统计表.xls").getBytes("utf-8"), "ISO8859-1"));
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + new String(("单身教工统计表.xlsx").getBytes("utf-8"), "ISO8859-1"));
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), entityList, singleUserList);
|
||||
ServletOutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
package io.v.nutz.zhgh.staffmanage.single.model;
|
||||
|
||||
|
||||
import io.v.nutz.sys.models.Sys_file;
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Table
|
||||
public class SingleUser {
|
||||
|
||||
@Name
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("用户Id")
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
@Comment("出生年月")
|
||||
private String birthday;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
@Comment("联系方式")
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
@Comment("身高")
|
||||
private String height;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@Comment("籍贯")
|
||||
private String hometown;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
@Comment("学历")
|
||||
private String education;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("兴趣爱好")
|
||||
private String hobby;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
@Comment("子女情况")
|
||||
private String childrenSituation;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
@Comment("月收入")
|
||||
private String monthlyIncome;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
@Comment("住房情况")
|
||||
private String housingSituation;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@Comment("上传照片")
|
||||
private List<Sys_file> picFiles;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
@Comment("形象照片")
|
||||
private String photo;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
@Comment("婚姻状况")
|
||||
private String maritalStatus;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
@Comment("交友意向")
|
||||
private String intentionFriends;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
@Comment("个人介绍")
|
||||
private String personalIntroduction;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
@Comment("申请分工会审核ID")
|
||||
private String unionAuditId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
@Comment("申请校工会审核ID")
|
||||
private String schoolAuditId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
@Comment("退会分工会审核ID")
|
||||
private String exitUnionAuditId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
@Comment("退会校工会审核ID")
|
||||
private String exitSchoolAuditId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR,width = 10)
|
||||
@Comment("状态")
|
||||
private String singleState;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("申请时间")
|
||||
private Date applyTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("加入时间")
|
||||
private Date joinTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.DATETIME)
|
||||
@Comment("退出时间")
|
||||
private Date exitTime;
|
||||
}
|
||||
@@ -1,22 +1,22 @@
|
||||
package io.v.nutz.zhgh.staffmanage.single.service;
|
||||
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.staffmanage.single.model.SingleUser;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SingleUserService extends ViService<Sys_user> {
|
||||
public interface SingleUserService extends BaseService<SingleUser> {
|
||||
|
||||
Pagination singlePageList(Integer pageNumber,Integer pageSize, String unionId, String unitId, String threeUnitId,
|
||||
String unionGroupId, String[] personTypes, String[] userStates,
|
||||
String campus, String sex, Integer memberStatus, String position,
|
||||
String jobTitle, String searchName, String searchKeyWord);
|
||||
|
||||
List<NutMap> singlePageList(String unionId, String unitId, String threeUnitId, String unionGroupId, String[] personTypes,
|
||||
String[] userStates, String campus, String sex, Integer memberStatus, String position,
|
||||
String jobTitle, String searchName, String searchKeyWord);
|
||||
Sql singlePageList(String unionId, String unitId, String threeUnitId, String unionGroupId, String[] personTypes,
|
||||
String[] userStates, String[] age, String campus, String sex, Integer memberStatus, String position,
|
||||
String jobTitle, String searchName, String searchKeyWord,Boolean isJoin,String education,String maritalStatus);
|
||||
|
||||
List<NutMap> singleStatisticsList(String[] personTypes,String unionId,String unitId,String analyze);
|
||||
|
||||
|
||||
NutMap findOne(String id);
|
||||
|
||||
Object getAuditNum(String auditType,String isAudit,String unionId);
|
||||
}
|
||||
|
||||
+182
-191
@@ -1,18 +1,22 @@
|
||||
package io.v.nutz.zhgh.staffmanage.single.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.service.impl.BaseServiceImpl;
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import io.v.nutz.zhgh.staffmanage.single.service.SingleUserService;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.staffmanage.single.model.SingleUser;
|
||||
import io.v.nutz.zhgh.staffmanage.single.service.SingleUserService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
@@ -21,237 +25,224 @@ import org.nutz.lang.util.NutMap;
|
||||
import java.util.List;
|
||||
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class SingleUserServiceImpl extends ViServiceImpl<Sys_user> implements SingleUserService {
|
||||
public class SingleUserServiceImpl extends BaseServiceImpl<SingleUser> implements SingleUserService {
|
||||
|
||||
public SingleUserServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
|
||||
@Override
|
||||
public Pagination singlePageList(Integer pageNumber,Integer pageSize, String unionId, String unitId, String threeUnitId,
|
||||
String unionGroupId, String[] personTypes, String[] userStates,
|
||||
String campus, String sex, Integer memberStatus, String position,
|
||||
String jobTitle, String searchName, String searchKeyWord) {
|
||||
public List<NutMap> singleStatisticsList(String[] personTypes, String unionId, String unitId, String analyze) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
id,
|
||||
loginname,
|
||||
username,
|
||||
sex,
|
||||
birthday,
|
||||
mobile,
|
||||
idcard,
|
||||
personType,
|
||||
userState,
|
||||
unionid,
|
||||
unioncode,
|
||||
unionname,
|
||||
unitid,
|
||||
unitname,
|
||||
unitcode,
|
||||
threeUnitName,
|
||||
threeUnitCode,
|
||||
unionGroupName,
|
||||
position,
|
||||
jobTitle,
|
||||
campusName,
|
||||
marriage,
|
||||
education,
|
||||
hometown,
|
||||
nation
|
||||
From
|
||||
user
|
||||
$condition
|
||||
""");
|
||||
SELECT
|
||||
un.id,
|
||||
$code AS unCode,
|
||||
$name AS unName,
|
||||
( $matchSql $singleCnd un.id = $unId AND TIMESTAMPDIFF (YEAR,su.birthday,CURDATE())<25 $personCnd) AS lessTwentyFive,
|
||||
( $matchSql $singleCnd un.id = $unId AND TIMESTAMPDIFF (YEAR,su.birthday,CURDATE())>=25 AND TIMESTAMPDIFF (YEAR,su.birthday,CURDATE())<=30 $personCnd) AS thirty,
|
||||
( $matchSql $singleCnd un.id = $unId AND TIMESTAMPDIFF (YEAR,su.birthday,CURDATE())>=31 AND TIMESTAMPDIFF (YEAR,su.birthday,CURDATE())<=35 $personCnd) AS thirtyFive,
|
||||
( $matchSql $singleCnd un.id = $unId AND TIMESTAMPDIFF (YEAR,su.birthday,CURDATE())>=36 AND TIMESTAMPDIFF (YEAR,su.birthday,CURDATE())<=40 $personCnd) AS forty,
|
||||
( $matchSql $singleCnd un.id = $unId AND TIMESTAMPDIFF (YEAR,su.birthday,CURDATE())>=41 AND TIMESTAMPDIFF (YEAR,su.birthday,CURDATE())<=45 $personCnd) AS fortyFive,
|
||||
( $matchSql $singleCnd un.id = $unId AND TIMESTAMPDIFF (YEAR,su.birthday,CURDATE())>=46 AND TIMESTAMPDIFF (YEAR,su.birthday,CURDATE())<=50 $personCnd) AS fifty,
|
||||
( $matchSql $singleCnd un.id = $unId AND TIMESTAMPDIFF (YEAR,su.birthday,CURDATE())>=51 AND TIMESTAMPDIFF (YEAR,su.birthday,CURDATE())<=55 $personCnd) AS fiftyFive,
|
||||
( $matchSql $singleCnd un.id = $unId AND TIMESTAMPDIFF (YEAR,su.birthday,CURDATE())>55 $personCnd $yearCnd) AS moreFiftyFive,
|
||||
( $matchSql $singleCnd un.id = $unId $personCnd) totalNumber,
|
||||
( $matchSql $singleCnd sex = '男' AND un.id = $unId $personCnd) male,
|
||||
( $matchSql $singleCnd sex = '女' AND un.id = $unId $personCnd) female
|
||||
FROM
|
||||
$table un
|
||||
$condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
cnd.and("marriage","=","未婚");
|
||||
cnd.andEX("unionid", "=", unionId);
|
||||
cnd.andEX("unitId", "=", unitId);
|
||||
cnd.andEX("threeUnitId", "=", threeUnitId);
|
||||
cnd.andEX("unionGroupId", "=", unionGroupId);
|
||||
if (StrUtil.isNotBlank(searchName) && Strings.isNotBlank(searchKeyWord)) {
|
||||
cnd.and(new SqlExpressionGroup().andLike(searchName, searchKeyWord));
|
||||
}
|
||||
sql.setVar("matchSql", " SELECT COUNT( 1 ) FROM `single_user` su left join `user` u on su.userId=u.id where ");
|
||||
sql.setVar("code", "0".equals(analyze) ? "un.unioncode" : "un.unitcode");
|
||||
sql.setVar("name", "0".equals(analyze) ? "un.unionname" : "un.`name`");
|
||||
sql.setVar("unId", "0".equals(analyze) ? "u.unionid" : "u.unitid");
|
||||
sql.setVar("table", "0".equals(analyze) ? "sys_union" : "sys_unit");
|
||||
sql.setVar("singleCnd", " su.singleState in (8030,8040,8045,8050,8055) and ");
|
||||
|
||||
if (personTypes != null && personTypes.length > 0) {
|
||||
cnd.andEX("personType", "in", personTypes);
|
||||
}
|
||||
if (userStates != null && userStates.length > 0) {
|
||||
cnd.andEX("userState", "in", userStates);
|
||||
}
|
||||
cnd.andEX("campusName", "=", campus);
|
||||
cnd.andEX("sex", "=", sex);
|
||||
|
||||
/*cnd.andEX("member", "=", 1);*/
|
||||
cnd.andEX("memberStatus", "=", memberStatus);
|
||||
|
||||
if (Strings.isNotBlank(position)) {
|
||||
cnd.where().andLike("position", position);
|
||||
}
|
||||
if (Strings.isNotBlank(jobTitle)) {
|
||||
cnd.where().andLike("jobTitle", jobTitle);
|
||||
}
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionMemberAdmin,A06")) {
|
||||
if (ShiroUtil.hasRole("H04")) {
|
||||
cnd.and("unionId", "=", Vi.getUnionId());
|
||||
} else if (ShiroUtil.hasRole("ghxzzz")) {
|
||||
cnd.and("unionId", "=", Vi.getUnionId());
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds());
|
||||
seg.or("unionGroupId", "is", null);
|
||||
cnd.and(seg);
|
||||
}
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return listPageMap(pageNumber,pageSize,sql);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<NutMap> singleStatisticsList(String[] personTypes,String unionId, String unitId,String analyze) {
|
||||
Sql sql = null;
|
||||
CndPlus cnd = CndPlus.create();
|
||||
if ("0".equals(analyze)){//按分工会统计
|
||||
sql = Sqls.create("""
|
||||
SELECT
|
||||
un.id,
|
||||
un.unioncode AS unionCode,
|
||||
unionName,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' and un.id = unionid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())<25 $personCnd) AS lessTwentyFive,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' and un.id = unionid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())>=25 AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())<=30 $personCnd) AS thirty,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' and un.id = unionid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())>=31 AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())<=35 $personCnd) AS thirtyFive,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' and un.id = unionid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())>=36 AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())<=40 $personCnd) AS forty,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' and un.id = unionid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())>=41 AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())<=45 $personCnd) AS fortyFive,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' and un.id = unionid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())>=46 AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())<=50 $personCnd) AS fifty,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' and un.id = unionid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())>=51 AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())<=55 $personCnd) AS fiftyFive,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' and un.id = unionid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())>55 $personCnd $yearCnd) AS moreFiftyFive,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' and un.id = unionid $personCnd) totalNumber,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' and sex = '男' AND un.id = unionid $personCnd) male,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' and sex = '女' AND un.id = unionid $personCnd) female
|
||||
FROM
|
||||
sys_union un
|
||||
$condition
|
||||
""");
|
||||
if (!ShiroUtil.hasAnyRoles(Lang.array("sysadmin", "A06", "SchoolUnionMemberAdmin"))) {
|
||||
cnd.and("un.id", "=", Vi.getUnionId());
|
||||
}
|
||||
if(StrUtil.isNotBlank(unionId)) {
|
||||
cnd.and("un.id", "=", unionId);
|
||||
}
|
||||
if ("0".equals(analyze)) {
|
||||
//工会
|
||||
cnd.andEX("un.id", "=", unionId);
|
||||
cnd.asc("un.unioncode");
|
||||
}else if ("1".equals(analyze)){//按单位统计
|
||||
sql = Sqls.create("""
|
||||
SELECT
|
||||
un.id,
|
||||
un.unitcode AS unitCode,
|
||||
`name` AS unitName,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' AND un.id = unitid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())<25 $personCnd) AS lessTwentyFive,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' AND un.id = unitid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())>=26 AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())<=30 $personCnd) AS thirty,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' AND un.id = unitid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())>=31 AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())<=35 $personCnd) AS thirtyFive,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' AND un.id = unitid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())>=36 AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())<=40 $personCnd) AS forty,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' AND un.id = unitid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())>=41 AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())<=45 $personCnd) AS fortyFive,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' AND un.id = unitid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())>=46 AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())<=50 $personCnd) AS fifty,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' AND un.id = unitid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())>=51 AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())<=55 $personCnd) AS fiftyFive,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' AND un.id = unitid AND TIMESTAMPDIFF (YEAR,birthday,CURDATE())>55 $personCnd) AS moreFiftyFive,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' AND un.id = unitid $personCnd) totalNumber,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' AND sex = '男' AND un.id = unitid $personCnd) male,
|
||||
( SELECT COUNT( 1 ) FROM `user` where marriage='未婚' AND sex = '女' AND un.id = unitid $personCnd) female
|
||||
FROM
|
||||
sys_unit un
|
||||
$condition
|
||||
""");
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles(Lang.array("sysadmin", "A06", "SchoolUnionMemberAdmin"))) {
|
||||
cnd.and("un.unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
if(StrUtil.isNotBlank(unitId)) {
|
||||
} else {
|
||||
//单位
|
||||
if (StrUtil.isNotBlank(unitId)) {
|
||||
cnd.and("un.id", "=", unitId);
|
||||
}
|
||||
cnd.and("unitlevel", "=", 2).and("unitcode", "!=", "000");
|
||||
cnd.and("un.unitlevel", "=", 2).and("un.unitcode", "!=", "000");
|
||||
cnd.asc("un.unitcode");
|
||||
}
|
||||
|
||||
if (!ShiroUtil.hasAnyRoles(Lang.array("sysadmin", "A06", "H03"))) {
|
||||
cnd.and("un.unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
if (personTypes != null && personTypes.length > 0) {
|
||||
String join = StringUtils.join(personTypes, "','");
|
||||
sql.setVar("personCnd", "and personType in ('" + join + "')");
|
||||
sql.setVar("personCnd", "and u.personType in ('" + join + "')");
|
||||
}
|
||||
assert sql != null;
|
||||
cnd.groupBy("un.id");
|
||||
sql.setCondition(cnd);
|
||||
return listMap(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> singlePageList(String unionId, String unitId, String threeUnitId, String unionGroupId, String[] personTypes, String[] userStates, String campus, String sex, Integer memberStatus, String position, String jobTitle, String searchName, String searchKeyWord) {
|
||||
public Sql singlePageList(String unionId, String unitId, String threeUnitId, String unionGroupId,
|
||||
String[] personTypes, String[] userStates, String[] age, String campus, String sex,
|
||||
Integer memberStatus, String position, String jobTitle, String searchName,
|
||||
String searchKeyWord, Boolean isJoin, String education, String maritalStatus) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
id,
|
||||
loginname,
|
||||
username,
|
||||
sex,
|
||||
birthday,
|
||||
mobile,
|
||||
idcard,
|
||||
personType,
|
||||
userState,
|
||||
unionid,
|
||||
unioncode,
|
||||
unionname,
|
||||
unitid,
|
||||
unitname,
|
||||
unitcode,
|
||||
threeUnitName,
|
||||
threeUnitCode,
|
||||
unionGroupName,
|
||||
position,
|
||||
jobTitle,
|
||||
campusName,
|
||||
marriage,
|
||||
education,
|
||||
hometown,
|
||||
nation
|
||||
From
|
||||
user
|
||||
$condition
|
||||
""");
|
||||
SELECT
|
||||
su.*,
|
||||
u.loginname,
|
||||
u.username,
|
||||
u.sex,
|
||||
u.idcard,
|
||||
u.personType,
|
||||
u.userState,
|
||||
u.unionname,
|
||||
u.unitname,
|
||||
u.threeUnitName,
|
||||
u.unionGroupName
|
||||
FROM
|
||||
`single_user` su
|
||||
LEFT JOIN `user` u ON u.id = su.userId
|
||||
$condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
cnd.and("marriage","=","未婚");
|
||||
cnd.andEX("unionid", "=", unionId);
|
||||
cnd.andEX("unitId", "=", unitId);
|
||||
cnd.andEX("threeUnitId", "=", threeUnitId);
|
||||
cnd.andEX("unionGroupId", "=", unionGroupId);
|
||||
cnd.andEX("u.unionid", "=", unionId);
|
||||
cnd.andEX("u.unitId", "=", unitId);
|
||||
cnd.andEX("u.threeUnitId", "=", threeUnitId);
|
||||
cnd.andEX("u.unionGroupId", "=", unionGroupId);
|
||||
cnd.andEX("su.education", "=", education);
|
||||
cnd.andEX("su.maritalStatus", "=", maritalStatus);
|
||||
cnd.and("su.singleState", "in", isJoin ? Lang.list(8030, 8040, 8045, 8050, 8055) : Lang.list(8060));
|
||||
if (StrUtil.isNotBlank(searchName) && Strings.isNotBlank(searchKeyWord)) {
|
||||
cnd.and(new SqlExpressionGroup().andLike(searchName, searchKeyWord));
|
||||
}
|
||||
if (personTypes != null && personTypes.length > 0) {
|
||||
cnd.andEX("personType", "in", personTypes);
|
||||
cnd.andEX("u.personType", "in", personTypes);
|
||||
}
|
||||
if (userStates != null && userStates.length > 0) {
|
||||
cnd.andEX("userState", "in", userStates);
|
||||
cnd.andEX("u.userState", "in", userStates);
|
||||
}
|
||||
cnd.andEX("campusName", "=", campus);
|
||||
cnd.andEX("sex", "=", sex);
|
||||
|
||||
if (!Lang.isEmptyArray(age)) {
|
||||
if (!age[1].equals("0")) {
|
||||
cnd.and("TIMESTAMPDIFF(YEAR, u.birthday, CURDATE())", "between", age);
|
||||
}
|
||||
}
|
||||
|
||||
cnd.andEX("u.campusName", "=", campus);
|
||||
cnd.andEX("u.sex", "=", sex);
|
||||
/*cnd.andEX("member", "=", 1);*/
|
||||
cnd.andEX("memberStatus", "=", memberStatus);
|
||||
cnd.andEX("u.memberStatus", "=", memberStatus);
|
||||
|
||||
if (Strings.isNotBlank(position)) {
|
||||
cnd.where().andLike("position", position);
|
||||
cnd.where().andLike("u.position", position);
|
||||
}
|
||||
if (Strings.isNotBlank(jobTitle)) {
|
||||
cnd.where().andLike("jobTitle", jobTitle);
|
||||
cnd.where().andLike("u.jobTitle", jobTitle);
|
||||
}
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionMemberAdmin,A06")) {
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,H03,A06")) {
|
||||
if (ShiroUtil.hasRole("H04")) {
|
||||
cnd.and("unionId", "=", Vi.getUnionId());
|
||||
cnd.and("u.unionId", "=", Vi.getUnionId());
|
||||
} else if (ShiroUtil.hasRole("ghxzzz")) {
|
||||
cnd.and("unionId", "=", Vi.getUnionId());
|
||||
cnd.and("u.unionId", "=", Vi.getUnionId());
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.or("unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds());
|
||||
seg.or("unionGroupId", "is", null);
|
||||
seg.or("u.unionGroupId", "in", io.v.nutz.web.commons.utils.ShiroUtil.getUnionGroupIds());
|
||||
seg.or("u.unionGroupId", "is", null);
|
||||
cnd.and(seg);
|
||||
}
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return listMap(sql);
|
||||
return sql;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public NutMap findOne(String id) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
su.*,
|
||||
u.unionname AS unionName,
|
||||
u.unitname AS unitName,
|
||||
u.username,
|
||||
u.sex,
|
||||
u.loginname,
|
||||
u.userState,
|
||||
u.personType
|
||||
FROM
|
||||
`single_user` su
|
||||
LEFT JOIN `user` u ON u.id = su.userId
|
||||
where su.id=@id
|
||||
""").setParam("id", id);
|
||||
NutMap nutMap = (NutMap) baseService.listMap(sql).stream().findFirst().orElse(null);
|
||||
if (Strings.isNotBlank(nutMap.getString("unionAuditId"))) {
|
||||
Audit audit = baseService.dao().fetch(Audit.class, Cnd.where("id", "=", nutMap.getString("unionAuditId")));
|
||||
nutMap.setv("unionAudit", audit);
|
||||
}
|
||||
if (Strings.isNotBlank(nutMap.getString("schoolAuditId"))) {
|
||||
Audit audit = baseService.dao().fetch(Audit.class, Cnd.where("id", "=", nutMap.getString("schoolAuditId")));
|
||||
nutMap.setv("schoolAudit", audit);
|
||||
}
|
||||
if (Strings.isNotBlank(nutMap.getString("exitUnionAuditId"))) {
|
||||
Audit audit = baseService.dao().fetch(Audit.class, Cnd.where("id", "=", nutMap.getString("exitUnionAuditId")));
|
||||
nutMap.setv("exitUnionAudit", audit);
|
||||
}
|
||||
if (Strings.isNotBlank(nutMap.getString("exitSchoolAuditId"))) {
|
||||
Audit audit = baseService.dao().fetch(Audit.class, Cnd.where("id", "=", nutMap.getString("exitSchoolAuditId")));
|
||||
nutMap.setv("exitSchoolAudit", audit);
|
||||
}
|
||||
return nutMap;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getAuditNum(String auditType, String isAudit, String unionId) {
|
||||
String sqlStr = """
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
`single_user` su
|
||||
LEFT JOIN `user` u ON u.id = su.userId
|
||||
$condition
|
||||
""";
|
||||
CndPlus joinCnd = CndPlus.create();
|
||||
CndPlus exitCnd = CndPlus.create();
|
||||
String result = "true".equals(isAudit) ? ">" : "false".equals(isAudit) ? "=" : ">=";
|
||||
if ("union".equals(auditType)) {
|
||||
joinCnd.and("su.singleState", result, 8010);
|
||||
exitCnd.and("su.singleState", result, 8040);
|
||||
} else if ("school".equals(auditType)) {
|
||||
joinCnd.and("su.singleState", result, 8020);
|
||||
exitCnd.and("su.singleState", result, 8050);
|
||||
}
|
||||
joinCnd.and("su.singleState", "<=", 8030);
|
||||
exitCnd.and("su.singleState", ">", 8030);
|
||||
if (ShiroUtil.hasAnyRoles("H04")) {
|
||||
exitCnd.andEX("u.unionId", "=", Vi.getUnionId());
|
||||
joinCnd.andEX("u.unionId", "=", Vi.getUnionId());
|
||||
} else {
|
||||
exitCnd.andEX("u.unionId", "=", unionId);
|
||||
joinCnd.andEX("u.unionId", "=", unionId);
|
||||
}
|
||||
|
||||
|
||||
Sql sqlJoin = Sqls.create(sqlStr);
|
||||
sqlJoin.setCondition(joinCnd);
|
||||
Sql sqlExit = Sqls.create(sqlStr);
|
||||
sqlExit.setCondition(exitCnd);
|
||||
int joinCount = this.count(sqlJoin);
|
||||
int exitCount = this.count(sqlExit);
|
||||
NutMap nutMap = new NutMap();
|
||||
nutMap.setv("joinCount", joinCount);
|
||||
nutMap.setv("exitCount", exitCount);
|
||||
return nutMap;
|
||||
}
|
||||
}
|
||||
|
||||
+18
-4
@@ -1,15 +1,12 @@
|
||||
package io.v.nutz.zhgh.staffmanage.sourcechange.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.sys.models.Sys_dict;
|
||||
import io.v.nutz.sys.models.User;
|
||||
import io.v.nutz.sys.services.SysDictService;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.zhgh.staffmanage.member.constant.MemberChangeType;
|
||||
import io.v.nutz.zhgh.staffmanage.member.service.MemberCommonService;
|
||||
import io.v.nutz.zhgh.staffmanage.sourcechange.model.SourceChangeMiddleTable;
|
||||
import io.v.nutz.zhgh.staffmanage.sourcechange.param.pageform.SourceChangePageForm;
|
||||
@@ -28,6 +25,7 @@ import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -151,4 +149,20 @@ public class SourceChangeManageController {
|
||||
sourceChangeManageService.doSourceChange(middleTable);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sourcechange.manage")
|
||||
@SLog(tag = "人员变更管理", msg = "批量确认变更")
|
||||
public Object doBatchChange(@Param("data") String[] ids) {
|
||||
if (Lang.isEmpty(ids)) {
|
||||
return Result.error("未获取到选择数据");
|
||||
}
|
||||
List<SourceChangeMiddleTable> list = dao.query(SourceChangeMiddleTable.class, Cnd.where("id", "in", ids));
|
||||
for (SourceChangeMiddleTable middleTable : list) {
|
||||
sourceChangeManageService.doSourceChange(middleTable);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+8
@@ -3,6 +3,8 @@ package io.v.nutz.zhgh.staffmanage.sourcechange.service;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.staffmanage.sourcechange.model.SourceChangeMiddleTable;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author zzr
|
||||
@@ -17,4 +19,10 @@ public interface SourceChangeManageService extends BaseService<SourceChangeMiddl
|
||||
* @param middleTable
|
||||
*/
|
||||
void doSourceChange(SourceChangeMiddleTable middleTable);
|
||||
|
||||
|
||||
/**
|
||||
* 发送消息给新入职的老师,提醒可以入会
|
||||
*/
|
||||
void sendMsgToNewTeacher(Date date);
|
||||
}
|
||||
|
||||
+67
-25
@@ -1,10 +1,13 @@
|
||||
package io.v.nutz.zhgh.staffmanage.sourcechange.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
import io.v.nutz.base.service.impl.BaseServiceImpl;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.sys.models.Sys_union;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
@@ -12,6 +15,7 @@ import io.v.nutz.sys.models.Sys_user_role;
|
||||
import io.v.nutz.sys.models.User;
|
||||
import io.v.nutz.sys.services.SysRoleService;
|
||||
import io.v.nutz.sys.services.SysUserService;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
|
||||
import io.v.nutz.zhgh.data.model.UserHistory;
|
||||
import io.v.nutz.zhgh.staffmanage.member.constant.MemberChangeOrigin;
|
||||
@@ -21,6 +25,7 @@ import io.v.nutz.zhgh.staffmanage.sourcechange.model.SourceChangeMiddleTable;
|
||||
import io.v.nutz.zhgh.staffmanage.sourcechange.service.SourceChangeManageService;
|
||||
import io.v.nutz.zhgh.staffmanage.specialstaff.model.SpecialStaff;
|
||||
import io.v.nutz.zhgh.welfare.model.WelfareList;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
@@ -42,6 +47,7 @@ import java.util.stream.Collectors;
|
||||
* @Date 2025/2/19 14:55
|
||||
* @注释
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeMiddleTable> implements SourceChangeManageService {
|
||||
public SourceChangeManageServiceImpl(Dao dao) {
|
||||
@@ -54,15 +60,20 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
private SysRoleService sysRoleService;
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
@Inject
|
||||
private MsgApi msgApi;
|
||||
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void doSourceChange(SourceChangeMiddleTable middleTable) {
|
||||
User user = dao().fetch(User.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
|
||||
// 当前工会,用于记录记录是工会关系异动的上一个工会
|
||||
String unionname = user.getUnionname();
|
||||
// 记录当前操作的时间,用于后续区分短信通知
|
||||
Date date = DateUtil.date();
|
||||
|
||||
int count = dao().count(Sys_user.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
|
||||
|
||||
Sys_user info = new Sys_user();
|
||||
User user = new User();
|
||||
//获取可变更字段
|
||||
NutMap map = commonService.getDictAllowChangeFields();
|
||||
Set<String> allowChangeFieldNames = map.getAs("allowChangeFieldNames", Set.class);
|
||||
@@ -79,24 +90,34 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
}
|
||||
|
||||
List<String> changeTypes = new ArrayList<>();
|
||||
changeTypes.add(MemberChangeType.BASIC_CHANGE.getType());
|
||||
if (!ObjectUtil.equals(user.getUserState(), middleTable.getUserState())) {
|
||||
List<MemberChangeType> list = Arrays.stream(MemberChangeType.values())
|
||||
.filter(v -> v.getChangeTypeName().equals(middleTable.getUserState())).toList();
|
||||
if (Lang.isNotEmpty(list)) {
|
||||
changeTypes.add(list.get(0).getType());
|
||||
if (count <= 0) {
|
||||
changeTypes.add(MemberChangeType.NEW.getType());
|
||||
Sys_user sysUser = BeanUtil.copyProperties(middleTable, Sys_user.class);
|
||||
dao().insert(sysUser);
|
||||
|
||||
user = dao().fetch(User.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
|
||||
} else {
|
||||
user = dao().fetch(User.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
|
||||
|
||||
changeTypes.add(MemberChangeType.BASIC_CHANGE.getType());
|
||||
|
||||
if (!ObjectUtil.equals(user.getUserState(), middleTable.getUserState())) {
|
||||
List<MemberChangeType> list = Arrays.stream(MemberChangeType.values())
|
||||
.filter(v -> v.getChangeTypeName().equals(middleTable.getUserState())).toList();
|
||||
if (Lang.isNotEmpty(list)) {
|
||||
changeTypes.add(list.get(0).getType());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ObjectUtil.equals(user.getMember(), middleTable.getMember())){
|
||||
if (middleTable.getMember() == 1) {
|
||||
changeTypes.add(MemberChangeType.RESTORE.getType());
|
||||
} else {
|
||||
changeTypes.add(MemberChangeType.WITHDRAWAL.getType());
|
||||
if (!ObjectUtil.equals(user.getMember(), middleTable.getMember())){
|
||||
if (middleTable.getMember() == 1) {
|
||||
changeTypes.add(MemberChangeType.RESTORE.getType());
|
||||
} else {
|
||||
changeTypes.add(MemberChangeType.WITHDRAWAL.getType());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Sys_user info = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
|
||||
info = dao().fetch(Sys_user.class, Cnd.where("loginname", "=", middleTable.getLoginname()));
|
||||
String userId = info.getId();
|
||||
UserHistory history = new UserHistory();
|
||||
if (Lang.isNotEmpty(changeList)) {
|
||||
@@ -104,12 +125,12 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
}
|
||||
|
||||
if (Lang.isNotEmpty(history)) {
|
||||
history.setChangeTime(DateUtil.date());
|
||||
history.setChangeTime(date);
|
||||
history.setChangeOrigin(MemberChangeOrigin.HAND_MOVEMENT.name());
|
||||
|
||||
|
||||
// 加入会员
|
||||
if (middleTable.getMember() == 1) {
|
||||
if (middleTable.getMember() != null && middleTable.getMember() == 1) {
|
||||
int activityCount = dao().count(ActivityUserScope.class, Cnd.where("userId", "=", userId).and("groupId", "=", 1));
|
||||
int memberCount = dao().count(Sys_user_role.class, Cnd.where("userId", "=", userId).and("roleId", "=", Roles.MEMBER));
|
||||
if (activityCount <= 0) {
|
||||
@@ -140,7 +161,7 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
}
|
||||
|
||||
// 加入福利会员 是否加入福利项目
|
||||
if (middleTable.getWelfareMember() == 1 && middleTable.getIsJoinWelfareProject() != null && middleTable.getIsJoinWelfareProject()) {
|
||||
if (middleTable.getWelfareMember() != null && middleTable.getWelfareMember() == 1 && middleTable.getIsJoinWelfareProject() != null && middleTable.getIsJoinWelfareProject()) {
|
||||
WelfareList welfareList = new WelfareList();
|
||||
welfareList.setId(R.UU32());
|
||||
welfareList.setProjectId(middleTable.getWelfareProjectId());
|
||||
@@ -166,12 +187,15 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
|
||||
// 如果工会发生变更了,就是工会关系变更,记录到特殊人员表中
|
||||
if (!ObjectUtil.equals(user.getUnionid(), middleTable.getUnionid())) {
|
||||
// 当前工会,用于记录记录是工会关系异动的上一个工会
|
||||
String unionname = user.getUnionname();
|
||||
|
||||
if (dao().count(SpecialStaff.class, Cnd.where("userId", "=", userId)) > 0) {
|
||||
dao().clear(SpecialStaff.class, Cnd.where("userId", "=", userId));
|
||||
user = dao().fetch(User.class, Cnd.where("id", "=", userId));
|
||||
}
|
||||
|
||||
if (!ObjectUtil.equals(user.getUnionid(), middleTable.getUnionid())) {
|
||||
if (StrUtil.isNotBlank(middleTable.getUnionid()) && !ObjectUtil.equals(user.getUnionid(), middleTable.getUnionid())) {
|
||||
changeTypes.add(MemberChangeType.UNION_CHANGE.getType());
|
||||
Sys_union union = dao().fetch(Sys_union.class, Cnd.where("id", "=", middleTable.getUnionid()));
|
||||
|
||||
@@ -198,10 +222,14 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
dao().updateIgnoreNull(info);
|
||||
|
||||
history.setChangeInfos(changeList);
|
||||
String changeInfos = changeList.stream().map(v -> {
|
||||
return v.getString("fieldName") + ":" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + "->" + HtmlUtil.cleanHtmlTag(v.getString("newValue")) + ";";
|
||||
}).collect(Collectors.joining(";"));
|
||||
history.setChangeInfosStr(changeInfos);
|
||||
if (count <= 0) {
|
||||
history.setChangeInfosStr("新入职");
|
||||
} else {
|
||||
String changeInfos = changeList.stream().map(v -> {
|
||||
return v.getString("fieldName") + ":" + HtmlUtil.cleanHtmlTag(v.getString("sourceValue")) + "->" + HtmlUtil.cleanHtmlTag(v.getString("newValue"));
|
||||
}).collect(Collectors.joining(";"));
|
||||
history.setChangeInfosStr(changeInfos);
|
||||
}
|
||||
history.setChangeTypes(changeTypes);
|
||||
dao().insert(history);
|
||||
|
||||
@@ -211,5 +239,19 @@ public class SourceChangeManageServiceImpl extends BaseServiceImpl<SourceChangeM
|
||||
sysRoleService.clearCache();
|
||||
}
|
||||
|
||||
sendMsgToNewTeacher(date);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void sendMsgToNewTeacher(Date date) {
|
||||
List<UserHistory> historyList = dao().query(UserHistory.class, Cnd.where("changeTypes", "like", "%" + MemberChangeType.NEW.getType() + "%")
|
||||
.and("DATE_FORMAT(changeTime,'%Y-%m-%d %H:%i')", "=", DateUtil.format(date, "yyyy-MM-dd HH:mm")));
|
||||
|
||||
// for (UserHistory history : historyList) {
|
||||
// String context = "%s老师您好,欢迎加入杭医大家庭,诚挚邀请您成为工会会员,如有意愿,请您点击此条消息或前往智慧工会平台申请入会,如无意愿请忽略此消息提醒。".formatted(history.getUsername());
|
||||
// String link = Globals.AppDomain + "/platform/member/apply/submit/h5";
|
||||
// msgApi.sendMsg(List.of("DingTalk"), history.getLoginname(), 2, "入会邀请", context, "", link);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
+2
-19
@@ -13,10 +13,8 @@ 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.json.Json;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.POST;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -28,7 +26,7 @@ import java.util.List;
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@At("/platform/trainSingUp/manage/activity")
|
||||
@At("/platform/trainSingUp/manage/activity/add")
|
||||
public class TrainSignUpActivityAddController {
|
||||
|
||||
@Inject
|
||||
@@ -37,27 +35,12 @@ public class TrainSignUpActivityAddController {
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@At("/add")
|
||||
@At("")
|
||||
@RequiresPermissions("trainSingUp.manage.activity.add")
|
||||
@Ok("beetl:/platform/trainSingUp/manage/activity_add.html")
|
||||
public void add() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Ok("json:full")
|
||||
@POST
|
||||
@RequiresPermissions("trainSingUp.manage.activity.add")
|
||||
public Object doHandle(@Param(value = "data", required = false) String data) {
|
||||
TrainSignUpActivity activity = Json.fromJson(TrainSignUpActivity.class, data);
|
||||
if (StrUtil.isBlank(activity.getId())) {
|
||||
trainSignUpActivityManageService.add(activity, null);
|
||||
} else {
|
||||
trainSignUpActivityManageService.edit(activity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Ok("json:full")
|
||||
|
||||
+12
-5
@@ -6,6 +6,7 @@ import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.sys.models.Sys_dict;
|
||||
import io.v.nutz.sys.services.SysDictService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpActivity;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpActivityCourse;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpType;
|
||||
@@ -83,6 +84,7 @@ public class TrainSignUpActivityApplyController {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
tsuc.id,
|
||||
tsuc.assort,
|
||||
tsuc.activityId,
|
||||
tsuc.courseName,
|
||||
tsuc.coursePeopleNumber,
|
||||
@@ -108,22 +110,27 @@ public class TrainSignUpActivityApplyController {
|
||||
CndPlus cnd = CndPlus.create();
|
||||
cnd.andEX("type.id","=",courseTypeId);
|
||||
cnd.and("tsuc.activityId","=",activityId);
|
||||
cnd.asc("type.code");
|
||||
cnd.asc("tsuc.orderNum");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination pagination = trainSignUpActivityService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> courseList = pagination.getList();
|
||||
|
||||
List<TrainSignUpActivityCourse> activityCourseList = trainSignUpActivityService.dao().query(TrainSignUpActivityCourse.class, Cnd.where("activityId", "=", activityId));
|
||||
|
||||
Map<String, List<TrainSignUpActivityCourse>> map = activityCourseList.stream().collect(Collectors.groupingBy(TrainSignUpActivityCourse::getCourseId));
|
||||
|
||||
courseList.forEach(c -> {
|
||||
List<TrainSignUpActivityCourse> list = map.get(c.getString("id"));
|
||||
c.put("courseList", list);
|
||||
|
||||
TrainSignUpType type = trainSignUpActivityService.dao().fetch(TrainSignUpType.class, c.getString("courseType"));
|
||||
// trainSignUpActivityService.dao().fetchLinks(c, "^(courseTimeList)$", Cnd.NEW().asc("courseStartTime"));
|
||||
//已报人数
|
||||
AtomicInteger hasRegisterNum = new AtomicInteger();
|
||||
List<TrainSignUpUser> signUpUsers = trainSignUpActivityService.dao().query(TrainSignUpUser.class, Cnd.where("courseId", "=", c.getString("id")));
|
||||
signUpUsers.forEach(item -> {
|
||||
if(type.getSelfAddFamily()) {
|
||||
hasRegisterNum.getAndIncrement();
|
||||
}
|
||||
hasRegisterNum.getAndIncrement();
|
||||
if(type.getIsBringFamily() && type.getIsAddFamily()) {
|
||||
List<NutMap> mapList = item.getMobileColumnsValue();
|
||||
if(Lang.isNotEmpty(mapList)) {
|
||||
@@ -136,7 +143,7 @@ public class TrainSignUpActivityApplyController {
|
||||
});
|
||||
c.put("hasRegisterNum",hasRegisterNum.get());
|
||||
//当前用户是否报过
|
||||
c.put("isSign",trainSignUpActivityService.isSignCourseByUser(c.getString("id"), (String) io.v.nutz.web.commons.utils.ShiroUtil.getPrincipalProperty("id")));
|
||||
c.put("isSign",trainSignUpActivityService.isSignCourseByUser(c.getString("id"), (String) ShiroUtil.getPrincipalProperty("id")));
|
||||
});
|
||||
return pagination;
|
||||
}
|
||||
|
||||
+5
-3
@@ -2,18 +2,22 @@ package io.v.nutz.zhgh.trainSignUp.controller.manage;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.sys.models.Sys_home_activity;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
|
||||
import io.v.nutz.zhgh.data.model.MatchConditionStructure;
|
||||
import io.v.nutz.zhgh.data.service.MatchConditionStructureService;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.*;
|
||||
import io.v.nutz.zhgh.trainSignUp.service.TrainSignUpActivityService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
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.json.Json;
|
||||
@@ -167,6 +171,4 @@ public class TrainSignUpActivityController {
|
||||
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,11 +3,11 @@ package io.v.nutz.zhgh.trainSignUp.controller.manage;
|
||||
import cn.hutool.core.util.EnumUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.base.page.Pagination;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainMobileSignColumn;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpType;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
+8
-8
@@ -11,11 +11,11 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.ViTool;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.*;
|
||||
import io.v.nutz.zhgh.trainSignUp.service.TrainSignUpActivityService;
|
||||
import io.v.nutz.zhgh.trainSignUp.service.TrainSignUpActivityStatisticsService;
|
||||
@@ -226,10 +226,10 @@ public class TrainSignUpUserAdjustController {
|
||||
|
||||
TrainSignUpActivity activity = dao.fetch(TrainSignUpActivity.class, activityId);
|
||||
|
||||
/*if(DateUtil.compare(new Date(), activity.getActivitySignUpStartTime(), "yyyy-MM-dd HH:mm:ss") < 0) {
|
||||
if(DateUtil.compare(new Date(), activity.getActivitySignUpStartTime(), "yyyy-MM-dd HH:mm:ss") < 0) {
|
||||
return Result.error("报名未开始");
|
||||
}
|
||||
if(DateUtil.compare(new Date(), activity.getActivitySignUpEndTime(), "yyyy-MM-dd HH:mm:ss") > 0) {
|
||||
/*if(DateUtil.compare(new Date(), activity.getActivitySignUpEndTime(), "yyyy-MM-dd HH:mm:ss") > 0) {
|
||||
return Result.error("报名已结束");
|
||||
}*/
|
||||
|
||||
@@ -244,11 +244,11 @@ public class TrainSignUpUserAdjustController {
|
||||
for (SignUser sign : signUser) {
|
||||
Sys_user sysUser = dao.fetch(Sys_user.class, Cnd.where("loginname", "=", sign.getLoginname()));
|
||||
if(sysUser != null) {
|
||||
/*if(!isSingle && courseMap.get(sign.getCourseName()) == null) {
|
||||
if(!isSingle && courseMap.get(sign.getCourseName()) == null) {
|
||||
sign.setErrMsg("分活动/培训班名称有误");
|
||||
continue;
|
||||
}*/
|
||||
String courseId = importCourseId;
|
||||
}
|
||||
String courseId = isSingle ? importCourseId : courseMap.get(sign.getCourseName());
|
||||
/*if(StrUtil.isNotBlank(course.getConditionStructureId())) {
|
||||
NutMap nutMap = trainSignUpActivityService.validConditionStructure(course.getConditionStructureId());
|
||||
if(!nutMap.getBoolean("flag")) {
|
||||
@@ -290,7 +290,7 @@ public class TrainSignUpUserAdjustController {
|
||||
Sys_user sysUser = dao.fetch(Sys_user.class, Cnd.where("loginname", "=", item.getLoginname()));
|
||||
TrainSignUpUser trainSignUpUser = new TrainSignUpUser();
|
||||
trainSignUpUser.setActivityId(activityId);
|
||||
trainSignUpUser.setCourseId(importCourseId);
|
||||
trainSignUpUser.setCourseId(isSingle ? importCourseId : courseMap.get(item.getCourseName()));
|
||||
trainSignUpUser.setUserId(sysUser.getId());
|
||||
trainSignUpUser.setMobile(sysUser.getMobile());
|
||||
trainSignUpUser.setSignUpTime(new Date());
|
||||
|
||||
+5
-2
@@ -6,8 +6,9 @@ import cn.afterturn.easypoi.excel.export.ExcelExportService;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpActivity;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpCourse;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpUser;
|
||||
@@ -70,6 +71,9 @@ public class TrainSignUpUserBlackListManage {
|
||||
cnd.andEX("tsuu.activityId", "=", activityId);
|
||||
cnd.andEX("tsuu.courseId", "=", courseId);
|
||||
cnd.andEX("act.year", "=", year);
|
||||
if(ShiroUtil.hasRole("H04") && !ShiroUtil.hasAnyRoles("sysadmin, A06")) {
|
||||
cnd.and("activityMode", "=", 2).and("act.opBy", "=", ShiroUtil.getPlatformUid());
|
||||
}
|
||||
if (StrUtil.isNotBlank(userKeyWord)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
cnd.and(seg.andLike("u.username", userKeyWord).orLike("u.loginname", userKeyWord));
|
||||
@@ -77,7 +81,6 @@ public class TrainSignUpUserBlackListManage {
|
||||
if(Strings.isNotBlank(pageForm.getPageOrderName()) && Strings.isNotBlank(pageForm.getPageOrderBy())){
|
||||
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
|
||||
}
|
||||
|
||||
return trainSignUpBlackListService.pageData(pageForm, cnd, activityId, courseId);
|
||||
}
|
||||
|
||||
|
||||
+91
-102
@@ -4,11 +4,12 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.zhgh.data.service.MatchConditionStructureService;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activity.models.ActivityUserScope;
|
||||
import io.v.nutz.zhgh.data.service.MatchConditionStructureService;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.*;
|
||||
import io.v.nutz.zhgh.trainSignUp.service.TrainSignUpActivityService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
@@ -16,12 +17,13 @@ import org.nutz.dao.Dao;
|
||||
import org.nutz.integration.jedis.RedisService;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -93,9 +95,46 @@ public class MTrainSignUpActivityController {
|
||||
List<String> mySignCourseIdList = mySignCourseList.stream().map(TrainSignUpUser::getCourseId).collect(Collectors.toList());
|
||||
cnd.and("id", "in", mySignCourseIdList);
|
||||
}
|
||||
return trainSignUpActivityService.findOne(id, cnd);
|
||||
NutMap nutMap = trainSignUpActivityService.findOne(id, cnd);
|
||||
List<TrainSignUpCourse> courseList = nutMap.getAsList("courseList", TrainSignUpCourse.class);
|
||||
courseList.forEach(v -> {
|
||||
if (v.getCourseIsLimitApply() != null && v.getCourseIsLimitApply() && v.getIsSign()) {
|
||||
TrainSignUpActivityCourse course = dao.fetch(TrainSignUpActivityCourse.class, Cnd.where("courseId", "=", v.getId()));
|
||||
v.setCourseTimeName(DateUtil.format(course.getCourseStartTime(), "HH:mm") + "至" + DateUtil.format(course.getCourseEndTime(), "HH:mm") + "段");
|
||||
}
|
||||
});
|
||||
return nutMap;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("json:full")
|
||||
@ViReturn
|
||||
@RequiresAuthentication
|
||||
public Object getCourseTimeSelectList(String courseId) {
|
||||
// 查课程的时间段
|
||||
List<TrainSignUpActivityCourse> courseList = dao.query(TrainSignUpActivityCourse.class, Cnd.where("courseId", "=", courseId));
|
||||
|
||||
// 查课程的报名人数
|
||||
List<TrainSignUpUserCourse> applyUserList = dao.query(TrainSignUpUserCourse.class, Cnd.where("courseId", "=", courseId));
|
||||
// 按照课程下面时间段去分组
|
||||
Map<String, List<TrainSignUpUserCourse>> collectMap = applyUserList.stream().collect(Collectors.groupingBy(TrainSignUpUserCourse::getActivityCourseId));
|
||||
return courseList.stream().map(v -> {
|
||||
String id = v.getId();
|
||||
NutMap nutMap = NutMap.NEW();
|
||||
List<TrainSignUpUserCourse> trainSignUpUserCourses = collectMap.get(id);
|
||||
int remainingNum = v.getCourseLimitNum();
|
||||
if (Lang.isNotEmpty(trainSignUpUserCourses)) {
|
||||
remainingNum = v.getCourseLimitNum() - trainSignUpUserCourses.size();
|
||||
}
|
||||
nutMap.put("remainingNum", remainingNum);
|
||||
nutMap.put("text", DateUtil.format(v.getCourseStartTime(), "HH:mm") + "至" + DateUtil.format(v.getCourseEndTime(), "HH:mm") + "段(剩" + remainingNum + ")");
|
||||
nutMap.put("value", id);
|
||||
return nutMap;
|
||||
}).filter(v-> v.getInt("remainingNum") != 0).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("json:full")
|
||||
@POST
|
||||
@@ -103,36 +142,6 @@ public class MTrainSignUpActivityController {
|
||||
public Object doSignUp(TrainSignUpUser trainSignUpUser) {
|
||||
try {
|
||||
lock.lock();
|
||||
boolean courseByUser = trainSignUpActivityService.isSignCourseByUser(trainSignUpUser.getCourseId(), ShiroUtil.getPlatformUid());
|
||||
if(courseByUser) {
|
||||
return Result.error("您已报过该活动");
|
||||
}
|
||||
//判断人数
|
||||
int number = 0;
|
||||
TrainSignUpCourse course = trainSignUpActivityService.dao().fetch(TrainSignUpCourse.class, trainSignUpUser.getCourseId());
|
||||
TrainSignUpType type = trainSignUpActivityService.dao().fetch(TrainSignUpType.class, course.getCourseType());
|
||||
if(type != null) {
|
||||
if(type.getIsBringFamily() && type.getIsAddFamily()) {
|
||||
List<NutMap> mobileColumnsValue = trainSignUpUser.getMobileColumnsValue();
|
||||
NutMap map = mobileColumnsValue.stream().filter(o -> "xdqsrs".equals(o.getString("columnCode"))).findAny().orElse(null);
|
||||
number = map != null ? map.getInt("columnValue") : 0;
|
||||
}
|
||||
}
|
||||
boolean signFull = trainSignUpActivityService.isSignFull(trainSignUpUser.getCourseId(), number);
|
||||
if(signFull) {
|
||||
return Result.error("当前报名人数已满");
|
||||
}
|
||||
boolean signFullByUnionId = trainSignUpActivityService.isSignFullByUnionId(trainSignUpUser.getCourseId(), number);
|
||||
if(signFullByUnionId) {
|
||||
return Result.error("该活动您所在的分工会名额已报满");
|
||||
}
|
||||
|
||||
TrainSignUpActivity activity = trainSignUpActivityService.fetch(trainSignUpUser.getActivityId());
|
||||
Map<Boolean, String> childNumber = this.getChildNumber(activity, trainSignUpUser);
|
||||
if (childNumber.containsKey(false)) {
|
||||
return Result.error(childNumber.get(false));
|
||||
}
|
||||
|
||||
trainSignUpActivityService.doSignUp(trainSignUpUser);
|
||||
return Result.success("报名成功");
|
||||
} catch (Exception e) {
|
||||
@@ -228,11 +237,17 @@ public class MTrainSignUpActivityController {
|
||||
}
|
||||
TrainSignUpCourse course = dao.fetch(TrainSignUpCourse.class, courseId);
|
||||
TrainSignUpActivity activity = dao.fetch(TrainSignUpActivity.class, course.getActivityId());
|
||||
|
||||
int count = dao.count(ActivityUserScope.class, Cnd.where("groupId", "=", activity.getActivityGroupId())
|
||||
.and("userId", "=", ShiroUtil.getUserId()));
|
||||
if (count == 0) {
|
||||
return Result.error("您不在报名人员范围内");
|
||||
}
|
||||
if(DateUtil.compare(new Date(), activity.getActivitySignUpStartTime(), "yyyy-MM-dd HH:mm:ss") < 0) {
|
||||
return Result.error("报名未开始");
|
||||
}
|
||||
if(DateUtil.compare(new Date(), activity.getActivitySignUpEndTime(), "yyyy-MM-dd HH:mm:ss") > 0) {
|
||||
return Result.error("报名已结束,请致电校工会咨询,联系电话:85913629");
|
||||
return Result.error("报名已结束");
|
||||
}
|
||||
if(StrUtil.isNotBlank(cndId)) {
|
||||
NutMap nutMap = trainSignUpActivityService.validConditionStructure(cndId);
|
||||
@@ -252,7 +267,7 @@ public class MTrainSignUpActivityController {
|
||||
boolean signCourse = trainSignUpActivityService.isSignCourse(courseId, activity.getId());
|
||||
if(!signCourse) {
|
||||
if(activity.getRestrictLimit() != 3) {
|
||||
return Result.error("您选择的类型的培训班已达上限,不能再报该类型的培训班了");
|
||||
return Result.error("您选择的类型的活动已达上限,不能再报该类型的活动了,但您仍可报名参加“美味下午茶品鉴”活动");
|
||||
} else {
|
||||
return Result.error(activity.getActivityName() + "限制报" + activity.getLimitNum() + "个活动,已达上限");
|
||||
}
|
||||
@@ -261,12 +276,6 @@ public class MTrainSignUpActivityController {
|
||||
if(signFullByUnionId) {
|
||||
return Result.error("该活动您所在的分工会名额已报满");
|
||||
}
|
||||
|
||||
Map<Boolean, String> childNumber = this.getChildNumber(activity, null);
|
||||
if (childNumber.containsKey(false)) {
|
||||
return Result.error(childNumber.get(false));
|
||||
}
|
||||
|
||||
if(course.getReserveMode() == 2 && currentFamilyNumber == null) {
|
||||
//课程已报人数
|
||||
List<TrainSignUpUser> signUpUsers = dao.query(TrainSignUpUser.class, Cnd.where("courseId", "=", courseId));
|
||||
@@ -284,76 +293,56 @@ public class MTrainSignUpActivityController {
|
||||
}
|
||||
}
|
||||
|
||||
private Map<Boolean, String> getChildNumber(TrainSignUpActivity activity, TrainSignUpUser trainSignUpUser) {
|
||||
//临时活动的逻辑
|
||||
List<String> stringList = List.of("06aaf4fd9db94bf9be2a27a1ab486a20", "6faec5acb6264bb6a4395aee03804269", "f9c532d86c89474f9d61c8374539e521");
|
||||
if(stringList.contains(activity.getId())) {
|
||||
List<TrainSignUpUser> upUsers = trainSignUpActivityService.dao().query(TrainSignUpUser.class,
|
||||
Cnd.where("activityId", "in", stringList)
|
||||
.and("userId", "=", ShiroUtil.getPlatformUid()));
|
||||
if(upUsers.size() >= 2) {
|
||||
return Map.of(false, "江小娃系列活动只能报2个班");
|
||||
}
|
||||
//孩子数量
|
||||
List<NutMap> childList = upUsers.stream()
|
||||
.flatMap(o -> o.getMobileColumnsValue().stream())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
long count = childList.stream().filter(o -> o.getString("columnCode").contains("NM") && StrUtil.isNotBlank(o.getString("columnValue"))).count();
|
||||
if(trainSignUpUser != null) {
|
||||
|
||||
//获取当前填写的孩子数量
|
||||
List<NutMap> mobileColumnsValue = trainSignUpUser.getMobileColumnsValue();
|
||||
|
||||
//判断孩子姓名有没有重复
|
||||
List<String> hasSignName = new ArrayList<>();
|
||||
childList.forEach(o -> {
|
||||
if(o.getString("columnCode").contains("NM") && StrUtil.isNotBlank(o.getString("columnValue"))) {
|
||||
hasSignName.add(o.getString("columnValue"));
|
||||
}
|
||||
});
|
||||
List<String> currentSignName = mobileColumnsValue.stream().map(o -> {
|
||||
if (o.getString("columnCode").contains("NM") && StrUtil.isNotBlank(o.getString("columnValue"))) {
|
||||
return o.getString("columnValue");
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}).filter(StrUtil::isNotBlank).collect(Collectors.toList());
|
||||
|
||||
boolean hasDuplicates = new HashSet<>(currentSignName).size() < currentSignName.size();
|
||||
if(hasDuplicates) {
|
||||
return Map.of(false, "孩子姓名不能重复");
|
||||
}
|
||||
for (String o : currentSignName) {
|
||||
if(hasSignName.contains(o)) {
|
||||
return Map.of(false, "不能报名,【" + o + "】已经在其他年级组报名了");
|
||||
}
|
||||
}
|
||||
|
||||
long currentChild = mobileColumnsValue.stream().filter(o -> o.getString("columnCode").contains("NM") && StrUtil.isNotBlank(o.getString("columnValue"))).count();
|
||||
count += currentChild;
|
||||
}
|
||||
if(count > 2) {
|
||||
return Map.of(false, "江小娃系列活动只能上报2个孩子");
|
||||
@At
|
||||
@Ok("json:full")
|
||||
@RequiresAuthentication
|
||||
public Object validateSourceSignUp(String activityCourseId) {
|
||||
try {
|
||||
lock.lock();
|
||||
// 该时间段下已报名的人数
|
||||
int count = dao.count(TrainSignUpUserCourse.class, Cnd.where("activityCourseId", "=", activityCourseId));
|
||||
// 获取改时间段下的活动课程限制报名人数
|
||||
TrainSignUpActivityCourse course = dao.fetch(TrainSignUpActivityCourse.class, activityCourseId);
|
||||
Integer courseLimitNum = course.getCourseLimitNum();
|
||||
// 报名加上自己,如果大于了限制人数,那就无法报名
|
||||
if (count + 1 > courseLimitNum) {
|
||||
return Result.error("该时间段名额已报满,请选择其他时段报名");
|
||||
} else {
|
||||
return Result.success();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("报名失败");
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
return Map.of(true, "");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@Ok("json:full")
|
||||
@ViReturn
|
||||
@RequiresAuthentication
|
||||
public Object codeSign(String id, String codeCourseId, String clickCourseId) {
|
||||
if(StrUtil.isBlank(codeCourseId) || StrUtil.isBlank(clickCourseId)) {
|
||||
return Result.error("签到失败,没有获取到扫描信息");
|
||||
try {
|
||||
lock.lock();
|
||||
if(StrUtil.isBlank(codeCourseId) || StrUtil.isBlank(clickCourseId)) {
|
||||
return Result.error("签到失败,没有获取到扫描信息");
|
||||
}
|
||||
if(!codeCourseId.equals(clickCourseId)) {
|
||||
return Result.error("签到失败,二维码与您当前签到信息不符");
|
||||
}
|
||||
dao.update(TrainSignUpUserCourse.class, Chain.make("isAttend", true)
|
||||
.add("attendTime", new Date()), Cnd.where("id", "=", id));
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("签到失败");
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
if(!codeCourseId.equals(clickCourseId)) {
|
||||
return Result.error("签到失败,二维码与您当前签到信息不符");
|
||||
}
|
||||
dao.update(TrainSignUpUserCourse.class, Chain.make("isAttend", true)
|
||||
.add("attendTime", new Date()), Cnd.where("id", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,9 +4,9 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.WxTokenUtil;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpUserCourse;
|
||||
import io.v.nutz.zhgh.trainSignUp.service.TrainSignUpActivityService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.nutz.dao.Chain;
|
||||
|
||||
+11
-12
@@ -31,9 +31,12 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
@@ -108,14 +111,6 @@ public class TrainSignUpActivityStatisticsController {
|
||||
return trainSignUpActivityStatisticsService.registerUserList(courseId);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Ok("json:full")
|
||||
@RequiresPermissions("trainSingUp.statistics.activity")
|
||||
public Object getTaleColumnInfo(@Param(value = "courseId") String courseId) {
|
||||
return trainSignUpActivityStatisticsService.getTaleColumnInfo(courseId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 培训班上课签到信息
|
||||
*
|
||||
@@ -141,6 +136,7 @@ public class TrainSignUpActivityStatisticsController {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
ts.*,
|
||||
CONCAT(DATE_FORMAT(ac.courseStartTime, '%H:%i:%s'),'至',DATE_FORMAT(ac.courseEndTime, '%H:%i:%s')) AS courseTime,
|
||||
u.username,
|
||||
u.loginname,
|
||||
u.unitname,
|
||||
@@ -153,6 +149,7 @@ public class TrainSignUpActivityStatisticsController {
|
||||
ts.state
|
||||
FROM
|
||||
train_sign_up_user ts
|
||||
left join train_sign_up_activity_course ac on ts.activityCourseId = ac.id
|
||||
left join `user` u on u.id = ts. userId
|
||||
left join train_sign_up_course tsc on tsc.id = ts.courseId
|
||||
WHERE
|
||||
@@ -179,7 +176,9 @@ public class TrainSignUpActivityStatisticsController {
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("分工会", "unionname", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("性别", "sex", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("手机号", "mobile", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("生日", "birthday", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("报名时间", "signUpTime", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("报名时段", "courseTime", 20));
|
||||
// excelCommonExportEntity.add(new ExcelExportEntity("生日", "birthday", 20));
|
||||
excelCommonExportEntity.add(new ExcelExportEntity("报名状态", "stateName", 20));
|
||||
|
||||
List<TrainSignUpCourse> courseList = dao.query(TrainSignUpCourse.class, Cnd.where("activityId", "=", activityId));
|
||||
@@ -199,7 +198,7 @@ public class TrainSignUpActivityStatisticsController {
|
||||
TrainSignUpCourse course = courseMap.get(k);
|
||||
//查询课程类型
|
||||
TrainSignUpType trainSignUpType = dao.fetch(TrainSignUpType.class, Cnd.where("id", "=", course.getCourseType()));
|
||||
dao.fetchLinks(trainSignUpType, "^trainMobileSignColumnList$", Cnd.NEW().asc("columnIndex"));
|
||||
dao.fetchLinks(trainSignUpType, "^trainMobileSignColumnList$");
|
||||
|
||||
ExcelExportService service = new ExcelExportService();
|
||||
ExportParams userExportParams = new ExportParams();
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package io.v.nutz.zhgh.trainSignUp.models;
|
||||
|
||||
import cn.wizzer.framework.base.model.BaseModel;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.sys.models.Sys_file;
|
||||
import io.v.nutz.sys.models.Sys_home_activity;
|
||||
import io.v.nutz.sys.services.SysHomeConvert;
|
||||
import io.v.nutz.zhgh.data.model.MatchConditionStructure;
|
||||
import io.v.nutz.sys.models.Sys_file;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
@@ -140,7 +141,7 @@ public class TrainSignUpActivity extends BaseModel implements Serializable, SysH
|
||||
sysHomeActivity.setName(this.getActivityName());
|
||||
sysHomeActivity.setCover(this.getCover().getFilepath());
|
||||
sysHomeActivity.setUrl("/platform/trainSingUp/manage/apply");
|
||||
sysHomeActivity.setH5Url("/platform/mobile/trainSignUpActivity/trainList");
|
||||
sysHomeActivity.setH5Url("/platform/mobile/trainSignUpActivity/trainInfo?activityId=" + this.getId() + "&endTime=" + DateUtil.format(this.getActivityEndTime(), "yyyy-MM-dd HH:mm:ss"));
|
||||
if (Lang.isNotEmpty(this.getActivitySignUpStartTime())) {
|
||||
sysHomeActivity.setStartDate(this.getActivitySignUpStartTime());
|
||||
sysHomeActivity.setEndDate(this.getActivitySignUpEndTime());
|
||||
|
||||
@@ -46,5 +46,10 @@ public class TrainSignUpActivityCourse {
|
||||
@Comment("课程时间")
|
||||
private Date courseDate;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
@Comment("限制人数")
|
||||
private Integer courseLimitNum;
|
||||
|
||||
private Integer hasRegisterNum;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class TrainSignUpCourse extends BaseModel implements Serializable {
|
||||
private List<Double> courseLocationCoordinates;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@ColDefine(type = ColType.VARCHAR, width = 20)
|
||||
@Comment("课程讲师")
|
||||
private String courseInstructor;
|
||||
|
||||
@@ -71,6 +71,11 @@ public class TrainSignUpCourse extends BaseModel implements Serializable {
|
||||
@Comment("校区")
|
||||
private String campus;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Comment("报名人数是否限制")
|
||||
private Boolean courseIsLimitApply;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.INT)
|
||||
@Comment("序号")
|
||||
@@ -137,4 +142,7 @@ public class TrainSignUpCourse extends BaseModel implements Serializable {
|
||||
@Comment("分类标识")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String assort;
|
||||
|
||||
|
||||
private String courseTimeName;
|
||||
}
|
||||
|
||||
@@ -50,12 +50,6 @@ public class TrainSignUpType extends BaseModel implements Serializable {
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isAddFamily;
|
||||
|
||||
@Column
|
||||
@Comment("本人纳入总人数")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
@Default("1")
|
||||
private Boolean selfAddFamily;
|
||||
|
||||
@Many(field = "typeId")
|
||||
private List<TrainMobileSignColumn> trainMobileSignColumnList;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,11 @@ public class TrainSignUpUser implements Serializable {
|
||||
@Comment("报名时间")
|
||||
private Date signUpTime;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Comment("活动课程时段id")
|
||||
private String activityCourseId;
|
||||
|
||||
@Column
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@Comment("手机端报名字段和值")
|
||||
|
||||
@@ -3,10 +3,10 @@ package io.v.nutz.zhgh.trainSignUp.service;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.zhgh.trainSignUp.constant.TrainCourseType;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpActivity;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpCourse;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpUser;
|
||||
import io.v.nutz.zhgh.trainSignUp.constant.TrainCourseType;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
|
||||
-2
@@ -33,8 +33,6 @@ public interface TrainSignUpActivityStatisticsService extends ViService<TrainSig
|
||||
*/
|
||||
List<NutMap> registerUserList(String courseId);
|
||||
|
||||
List<NutMap> getTaleColumnInfo(String courseId);
|
||||
|
||||
/**
|
||||
* 该课程下的报名人员信息
|
||||
*
|
||||
|
||||
+68
-48
@@ -2,19 +2,20 @@ package io.v.nutz.zhgh.trainSignUp.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.sys.models.Sys_home_activity;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.data.constant.ConditionalOperational;
|
||||
import io.v.nutz.zhgh.data.constant.MatchMethod;
|
||||
import io.v.nutz.zhgh.data.model.MatchCondition;
|
||||
import io.v.nutz.zhgh.data.model.MatchConditionStructure;
|
||||
import io.v.nutz.zhgh.data.service.MatchConditionStructureService;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.*;
|
||||
import io.v.nutz.zhgh.trainSignUp.service.TrainSignUpActivityService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.aop.interceptor.async.Async;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
@@ -56,6 +57,9 @@ public class TrainSignUpActivityServiceImpl extends ViServiceImpl<TrainSignUpAct
|
||||
@Inject
|
||||
private MatchConditionStructureService matchConditionStructureService;
|
||||
|
||||
@Inject
|
||||
private MsgApi msgApi;
|
||||
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void add(TrainSignUpActivity activity, TrainSignUpCourse course) {
|
||||
@@ -65,6 +69,7 @@ public class TrainSignUpActivityServiceImpl extends ViServiceImpl<TrainSignUpAct
|
||||
activity.setConditionStructureId(null);
|
||||
activity.setConditionStructure(null);
|
||||
}
|
||||
|
||||
dao().insert(activity);
|
||||
List<TrainSignUpCourse> courseList = activity.getCourseList();
|
||||
courseList.forEach(v -> {
|
||||
@@ -132,7 +137,6 @@ public class TrainSignUpActivityServiceImpl extends ViServiceImpl<TrainSignUpAct
|
||||
//原来的上课时间
|
||||
List<TrainSignUpActivityCourse> oldActCourseTimeList = dao().query(TrainSignUpActivityCourse.class, Cnd.where("activityId", "=", activity.getId()));
|
||||
|
||||
|
||||
update(activity);
|
||||
|
||||
List<TrainSignUpTypeLimit> typeLimits = activity.getTypeLimits();
|
||||
@@ -155,7 +159,7 @@ public class TrainSignUpActivityServiceImpl extends ViServiceImpl<TrainSignUpAct
|
||||
dao().insertOrUpdate(v);
|
||||
|
||||
List<TrainSignUpActivityCourse> courseTimeList = v.getCourseTimeList();
|
||||
if(courseTimeList != null) {
|
||||
if (courseTimeList != null) {
|
||||
courseTimeList.forEach(x -> {
|
||||
x.setActivityId(activity.getId());
|
||||
x.setCourseId(v.getId());
|
||||
@@ -185,7 +189,7 @@ public class TrainSignUpActivityServiceImpl extends ViServiceImpl<TrainSignUpAct
|
||||
//现在的上课时间
|
||||
List<String> nowCourseTimeListId = new ArrayList<>();
|
||||
activity.getCourseList().stream().forEach(v -> {
|
||||
if(v.getCourseTimeList() != null) {
|
||||
if (v.getCourseTimeList() != null) {
|
||||
nowCourseTimeListId.addAll(v.getCourseTimeList().stream().map(x -> x.getId()).collect(Collectors.toList()));
|
||||
}
|
||||
});
|
||||
@@ -262,30 +266,26 @@ public class TrainSignUpActivityServiceImpl extends ViServiceImpl<TrainSignUpAct
|
||||
List<TrainSignUpCourse> courseList = activity.getCourseList();
|
||||
|
||||
courseList.forEach(c -> {
|
||||
if(StrUtil.isNotBlank(c.getCourseType())) {
|
||||
TrainSignUpType type = dao().fetch(TrainSignUpType.class, c.getCourseType());
|
||||
dao().fetchLinks(c, "^(courseTimeList)$", Cnd.NEW().asc("courseStartTime"));
|
||||
//已报人数
|
||||
AtomicInteger hasRegisterNum = new AtomicInteger();
|
||||
List<TrainSignUpUser> signUpUsers = dao().query(TrainSignUpUser.class, Cnd.where("courseId", "=", c.getId()));
|
||||
signUpUsers.forEach(item -> {
|
||||
if(type.getSelfAddFamily()) {
|
||||
hasRegisterNum.getAndIncrement();
|
||||
}
|
||||
if(type.getIsBringFamily() && type.getIsAddFamily()) {
|
||||
List<NutMap> mapList = item.getMobileColumnsValue();
|
||||
if(Lang.isNotEmpty(mapList)) {
|
||||
NutMap nutMap = mapList.stream().filter(o -> "xdqsrs".equals(o.getString("columnCode"))).findAny().orElse(null);
|
||||
if(nutMap != null) {
|
||||
hasRegisterNum.addAndGet(nutMap.getInt("columnValue"));
|
||||
}
|
||||
TrainSignUpType type = dao().fetch(TrainSignUpType.class, StrUtil.isNotBlank(c.getCourseType()) ? c.getCourseType() : "");
|
||||
dao().fetchLinks(c, "^(courseTimeList)$", Cnd.NEW().asc("courseStartTime"));
|
||||
//已报人数
|
||||
AtomicInteger hasRegisterNum = new AtomicInteger();
|
||||
List<TrainSignUpUser> signUpUsers = dao().query(TrainSignUpUser.class, Cnd.where("courseId", "=", c.getId()));
|
||||
signUpUsers.forEach(item -> {
|
||||
hasRegisterNum.getAndIncrement();
|
||||
if (type.getIsBringFamily() && type.getIsAddFamily()) {
|
||||
List<NutMap> mapList = item.getMobileColumnsValue();
|
||||
if (Lang.isNotEmpty(mapList)) {
|
||||
NutMap nutMap = mapList.stream().filter(o -> "xdqsrs".equals(o.getString("columnCode"))).findAny().orElse(null);
|
||||
if (nutMap != null) {
|
||||
hasRegisterNum.addAndGet(nutMap.getInt("columnValue"));
|
||||
}
|
||||
}
|
||||
});
|
||||
c.setHasRegisterNum(hasRegisterNum.get());
|
||||
//当前用户是否报过
|
||||
c.setIsSign(isSignCourseByUser(c.getId(), (String) ShiroUtil.getPrincipalProperty("id")));
|
||||
}
|
||||
}
|
||||
});
|
||||
c.setHasRegisterNum(hasRegisterNum.get());
|
||||
//当前用户是否报过
|
||||
c.setIsSign(isSignCourseByUser(c.getId(), (String) ShiroUtil.getPrincipalProperty("id")));
|
||||
});
|
||||
return Lang.obj2nutmap(activity);
|
||||
}
|
||||
@@ -319,10 +319,10 @@ public class TrainSignUpActivityServiceImpl extends ViServiceImpl<TrainSignUpAct
|
||||
// case 3 -> cnd.and(new Static(" ((activityEndTime > '%s' and activityStartTime < '%s') or (activitySignUpEndTime > '%s' and activitySignUpStartTime < '%s'))"
|
||||
// .formatted(dateTime, dateTime, dateTime, dateTime)));
|
||||
}
|
||||
if("my".equals(type)) {
|
||||
if ("my".equals(type)) {
|
||||
cnd.and(new Static("id in (select activityId from train_sign_up_user where userId = '%s')".formatted(ShiroUtil.getPrincipalProperty("id"))));
|
||||
}
|
||||
cnd.and("isDisabled","=",0);
|
||||
cnd.and("isDisabled", "=", 0);
|
||||
cnd.orderBy("activityEndTime", "desc");
|
||||
cnd.orderBy("isDisabled", "desc");
|
||||
Pagination pagination = listPage(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
@@ -341,17 +341,19 @@ public class TrainSignUpActivityServiceImpl extends ViServiceImpl<TrainSignUpAct
|
||||
@Override
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public void doSignUp(TrainSignUpUser trainSignUpUser) throws Exception {
|
||||
String userId = (String) ShiroUtil.getPrincipalProperty("id");
|
||||
|
||||
//查询课程
|
||||
TrainSignUpCourse course = dao().fetch(TrainSignUpCourse.class, trainSignUpUser.getCourseId());
|
||||
//查询活动
|
||||
TrainSignUpActivity activity = dao().fetch(TrainSignUpActivity.class, Cnd.where("id", "=", course.getActivityId()));
|
||||
|
||||
//如果这个课程的预留名额方式为报名人数不变
|
||||
if(course.getReserveMode() == 2) {
|
||||
if (course.getReserveMode() == 2) {
|
||||
//如果当前报名+已报小于这个课程限制人数
|
||||
//课程已报人数
|
||||
List<TrainSignUpUser> signUpUsers = dao().query(TrainSignUpUser.class, Cnd.where("courseId", "=", trainSignUpUser.getCourseId()));
|
||||
int hasRegisterNum = signUpUsers.size() + 1;//+1是算自己
|
||||
if(hasRegisterNum > course.getCoursePeopleNumber()) {
|
||||
if (hasRegisterNum > course.getCoursePeopleNumber()) {
|
||||
trainSignUpUser.setState(2);
|
||||
} else {
|
||||
trainSignUpUser.setState(1);
|
||||
@@ -361,12 +363,31 @@ public class TrainSignUpActivityServiceImpl extends ViServiceImpl<TrainSignUpAct
|
||||
}
|
||||
|
||||
if(StrUtil.isBlank(trainSignUpUser.getUserId())) {
|
||||
trainSignUpUser.setUserId(userId);
|
||||
trainSignUpUser.setUserId((String) ShiroUtil.getPrincipalProperty("id"));
|
||||
}
|
||||
trainSignUpUser.setSignUpTime(new Date());
|
||||
|
||||
dao().insert(trainSignUpUser);
|
||||
asyncInsertUserCourse(trainSignUpUser.getActivityId(), trainSignUpUser.getCourseId(), userId);
|
||||
if (StrUtil.isNotBlank(trainSignUpUser.getActivityCourseId())) {
|
||||
TrainSignUpActivityCourse fetch = dao().fetch(TrainSignUpActivityCourse.class, trainSignUpUser.getActivityCourseId());
|
||||
TrainSignUpUserCourse userCourse = new TrainSignUpUserCourse();
|
||||
userCourse.setActivityId(trainSignUpUser.getActivityId());
|
||||
userCourse.setCourseId(trainSignUpUser.getCourseId());
|
||||
userCourse.setUserId(trainSignUpUser.getUserId());
|
||||
userCourse.setCourseStartTime(fetch.getCourseStartTime());
|
||||
userCourse.setCourseEndTime(fetch.getCourseEndTime());
|
||||
userCourse.setAttend(false);
|
||||
userCourse.setAttendTime(null);
|
||||
userCourse.setActivityCourseId(fetch.getId());
|
||||
dao().insert(userCourse);
|
||||
} else {
|
||||
asyncInsertUserCourse(trainSignUpUser.getActivityId(), trainSignUpUser.getCourseId(), trainSignUpUser.getUserId());
|
||||
}
|
||||
|
||||
String username = ShiroUtil.getPlatformUsername();
|
||||
String description = username + "老师您好,您已成功报名(" + activity.getActivityName() + course.getCourseName() +"),请您按时参加";
|
||||
// msgApi.sendWxMsg("活动报名通知", "", "text", description, List.of(ShiroUtil.getPlatformLoginname()), null);
|
||||
// msgApi.sendWxMsg("");
|
||||
}
|
||||
|
||||
@Async
|
||||
@@ -427,18 +448,18 @@ public class TrainSignUpActivityServiceImpl extends ViServiceImpl<TrainSignUpAct
|
||||
sql.setCondition(cnd);
|
||||
//已经报名人数,这是教职工的
|
||||
List<NutMap> signUpUsers = listMap(sql);
|
||||
int hasRegisterNum = signUpType.getSelfAddFamily() ? signUpUsers.size() + 1 : 0;//+1是算自己
|
||||
int hasRegisterNum = signUpUsers.size() + 1;//+1是算自己
|
||||
//课程已报人数(携带的家属)
|
||||
int hasFamilyNum = 0;
|
||||
//如果携带家属,并且纳入人数,则mdzz
|
||||
if(signUpType.getIsAddFamily() && signUpType.getIsBringFamily()) {
|
||||
if (signUpType.getIsAddFamily() && signUpType.getIsBringFamily()) {
|
||||
//如果携带家属,已报人数=教职工+每个教职工携带的家属
|
||||
AtomicInteger num = new AtomicInteger();
|
||||
signUpUsers.forEach(item -> {
|
||||
List<NutMap> mapList = item.getAsList("", NutMap.class);
|
||||
if(Lang.isNotEmpty(mapList)) {
|
||||
if (Lang.isNotEmpty(mapList)) {
|
||||
NutMap nutMap = mapList.stream().filter(o -> "xdqsrs".equals(o.getString("columnCode"))).findAny().orElse(null);
|
||||
if(nutMap != null) {
|
||||
if (nutMap != null) {
|
||||
num.addAndGet(nutMap.getInt("columnValue"));
|
||||
}
|
||||
}
|
||||
@@ -459,18 +480,17 @@ public class TrainSignUpActivityServiceImpl extends ViServiceImpl<TrainSignUpAct
|
||||
int coursePeopleNumber = course.getCoursePeopleNumber();
|
||||
//课程已报人数
|
||||
List<TrainSignUpUser> signUpUsers = dao().query(TrainSignUpUser.class, Cnd.where("courseId", "=", courseId));
|
||||
//如果本人纳入总人数,则正常,但是如果不纳入,统计报名人数的时候就不算
|
||||
int hasRegisterNum = type.getSelfAddFamily() ? signUpUsers.size() + 1 : 0;//+1是算自己
|
||||
int hasRegisterNum = signUpUsers.size() + 1;//+1是算自己
|
||||
//课程已报人数(携带的家属)
|
||||
int hasFamilyNum = 0;
|
||||
//如果这个类型携带家属并且计入总人数
|
||||
if(type.getIsBringFamily() && type.getIsAddFamily()) {
|
||||
if (type.getIsBringFamily() && type.getIsAddFamily()) {
|
||||
AtomicInteger num = new AtomicInteger();
|
||||
signUpUsers.forEach(item -> {
|
||||
List<NutMap> mapList = item.getMobileColumnsValue();
|
||||
if(Lang.isNotEmpty(mapList)) {
|
||||
if (Lang.isNotEmpty(mapList)) {
|
||||
NutMap nutMap = mapList.stream().filter(o -> "xdqsrs".equals(o.getString("columnCode"))).findAny().orElse(null);
|
||||
if(nutMap != null) {
|
||||
if (nutMap != null) {
|
||||
num.addAndGet(nutMap.getInt("columnValue"));
|
||||
}
|
||||
}
|
||||
@@ -478,10 +498,10 @@ public class TrainSignUpActivityServiceImpl extends ViServiceImpl<TrainSignUpAct
|
||||
hasFamilyNum = num.get() + (currentFamilyNumber != null ? currentFamilyNumber : 0);//currentFamilyNumber是当前报名时填的家属人数
|
||||
}
|
||||
//如果预留名额模式是报名人数减少
|
||||
if(course.getReserveMode() == 1) {
|
||||
if (course.getReserveMode() == 1) {
|
||||
//如果已报人数+预留人数+当前报名(自己)+家属 > 总人数
|
||||
return (hasRegisterNum + course.getCourseReservedNumber() + hasFamilyNum) > coursePeopleNumber;
|
||||
}else {//如果预留名额模式是报名人数不变
|
||||
} else {//如果预留名额模式是报名人数不变
|
||||
//如果已报人数+当前报名(自己)+家属 > 总人数+预留人数
|
||||
return (hasRegisterNum + hasFamilyNum) > (coursePeopleNumber + course.getCourseReservedNumber());
|
||||
}
|
||||
@@ -515,7 +535,7 @@ public class TrainSignUpActivityServiceImpl extends ViServiceImpl<TrainSignUpAct
|
||||
return true;
|
||||
} else if (activity.getRestrictLimit() == 2) {
|
||||
TrainSignUpTypeLimit trainSignUpTypeLimit = dao().fetch(TrainSignUpTypeLimit.class, Cnd.where("typeId", "=", courseType).and("activityId", "=", activityId));
|
||||
if(trainSignUpTypeLimit == null) {
|
||||
if (trainSignUpTypeLimit == null) {
|
||||
return true;
|
||||
}
|
||||
//此类型的班最多可报几项
|
||||
|
||||
+4
-63
@@ -1,31 +1,23 @@
|
||||
package io.v.nutz.zhgh.trainSignUp.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainMobileSignColumn;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpCourse;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpType;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpUser;
|
||||
import io.v.nutz.zhgh.trainSignUp.service.TrainSignUpActivityStatisticsService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -50,9 +42,6 @@ public class TrainSignUpActivityStatisticsServiceImpl extends ViServiceImpl<Trai
|
||||
tsuc.coursePeopleNumber,
|
||||
tsuc.courseReservedNumber,
|
||||
type.lxname as courseType,
|
||||
type.isBringFamily,
|
||||
type.isAddFamily,
|
||||
type.selfAddFamily,
|
||||
tsuc.courseLocation,
|
||||
tsuc.courseInstructor,
|
||||
tsuc.reserveMode,
|
||||
@@ -67,32 +56,7 @@ public class TrainSignUpActivityStatisticsServiceImpl extends ViServiceImpl<Trai
|
||||
ORDER BY tsuc.orderNum
|
||||
""");
|
||||
sql.setParam("activityId", activityId);
|
||||
|
||||
Pagination list = list(pageForm, sql);
|
||||
List<NutMap> listMap = list.getList(NutMap.class);
|
||||
|
||||
//找活动报的人
|
||||
List<TrainSignUpUser> upUsers = dao().query(TrainSignUpUser.class, Cnd.where("activityId", "=", activityId));
|
||||
Map<String, List<TrainSignUpUser>> signUsers = upUsers.stream().collect(Collectors.groupingBy(TrainSignUpUser::getCourseId));
|
||||
|
||||
for (NutMap item : listMap) {
|
||||
AtomicReference<Integer> familyCount = new AtomicReference<>(0);
|
||||
List<TrainSignUpUser> users = signUsers.get(item.getString("id"));
|
||||
if (Lang.isNotEmpty(users)) {
|
||||
users.forEach(u -> {
|
||||
List<NutMap> mobileColumnsValue = u.getMobileColumnsValue();
|
||||
if (Lang.isNotEmpty(mobileColumnsValue)) {
|
||||
NutMap nutMap = mobileColumnsValue.stream().filter(o -> "xdqsrs".equals(o.getString("columnCode"))).findFirst().orElse(null);
|
||||
if (nutMap != null) {
|
||||
familyCount.updateAndGet(v -> v + (StrUtil.isNotBlank(nutMap.getString("columnValue")) ? nutMap.getInt("columnValue") : 0));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
item.setv("familyCount", familyCount.get());
|
||||
}
|
||||
list.setList(listMap);
|
||||
return list;
|
||||
return list(pageForm, sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,8 +70,7 @@ public class TrainSignUpActivityStatisticsServiceImpl extends ViServiceImpl<Trai
|
||||
u.sex,
|
||||
u.mobile,
|
||||
tsuu.signUpTime,
|
||||
tsuu.state,
|
||||
tsuu.mobileColumnsValue
|
||||
tsuu.state
|
||||
FROM
|
||||
train_sign_up_user tsuu
|
||||
LEFT JOIN `user` u ON u.id = tsuu.userId
|
||||
@@ -117,29 +80,7 @@ public class TrainSignUpActivityStatisticsServiceImpl extends ViServiceImpl<Trai
|
||||
CndPlus cnd = new CndPlus();
|
||||
cnd.andEx("tsuu.courseId", "=", courseId);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = listMap(sql);
|
||||
list.forEach(o -> {
|
||||
if(StrUtil.isNotBlank(o.getString("mobileColumnsValue"))) {
|
||||
List<NutMap> mobileColumnsValue = Json.fromJsonAsList(NutMap.class, o.getString("mobileColumnsValue"));
|
||||
if(Lang.isNotEmpty(mobileColumnsValue)) {
|
||||
mobileColumnsValue.forEach(m -> {
|
||||
o.put(m.getString("columnCode"), m.getString("columnValue"));
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> getTaleColumnInfo(String courseId) {
|
||||
TrainSignUpCourse course = dao().fetch(TrainSignUpCourse.class, courseId);
|
||||
TrainSignUpType upType = dao().fetch(TrainSignUpType.class, course.getCourseType());
|
||||
dao().fetchLinks(upType, "trainMobileSignColumnList", Cnd.NEW().asc("columnIndex"));
|
||||
|
||||
List<TrainMobileSignColumn> columnList = upType.getTrainMobileSignColumnList();
|
||||
List<NutMap> columnTableList = columnList.stream().map(o -> NutMap.NEW().setv("label", o.getColumnName()).setv("prop", o.getColumnCode())).collect(Collectors.toList());
|
||||
return columnTableList;
|
||||
return listMap(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -114,6 +114,10 @@ a, img {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
:root {
|
||||
--color-primary: #06c;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1616837257578" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4737"
|
||||
width="128" height="128">
|
||||
<defs>
|
||||
<style type="text/css"></style>
|
||||
</defs>
|
||||
<path d="M689.6 728l-409.6 97.6a129.6 129.6 0 0 1-155.2-94.4L35.2 350.4c-16-68.8 27.2-137.6 94.4-153.6l409.6-97.6c68.8-16 137.6 25.6 155.2 94.4l91.2 379.2c16 68.8-27.2 137.6-96 155.2z"
|
||||
fill="#E1E1DF" p-id="4738"></path>
|
||||
<path d="M772.8 992H259.2c-70.4 0-128-57.6-128-128V256c0-70.4 57.6-128 128-128h513.6c70.4 0 128 57.6 128 128v608c0 70.4-57.6 128-128 128z"
|
||||
fill="#4E8DF6" p-id="4739"></path>
|
||||
<path d="M976 555.2l-35.2-22.4c-14.4-9.6-35.2-4.8-43.2 9.6l-22.4 35.2c-3.2 4.8-1.6 11.2 3.2 14.4l72 43.2c4.8 3.2 11.2 1.6 14.4-3.2l22.4-35.2c9.6-12.8 4.8-33.6-11.2-41.6zM713.6 851.2l70.4 43.2c4.8 3.2 11.2 1.6 16-3.2l142.4-220.8c3.2-4.8 1.6-11.2-3.2-16l-70.4-43.2c-4.8-3.2-11.2-1.6-16 3.2l-142.4 222.4c-4.8 4.8-3.2 11.2 3.2 14.4zM694.4 976l72-48c6.4-4.8 6.4-14.4 0-19.2L704 872c-6.4-3.2-16 0-17.6 8l-11.2 86.4c1.6 8 11.2 16 19.2 9.6z"
|
||||
fill="#E1E1DF" p-id="4740"></path>
|
||||
<path d="M676.8 192H355.2c-25.6 0-48-22.4-48-48V80c0-27.2 22.4-48 48-48h321.6c27.2 0 48 20.8 48 48v64c0 25.6-22.4 48-48 48z"
|
||||
fill="#2166CC" p-id="4741"></path>
|
||||
<path d="M737.6 427.2H534.4c-14.4 0-27.2-11.2-27.2-27.2v-11.2c0-14.4 11.2-27.2 27.2-27.2h203.2c14.4 0 27.2 12.8 27.2 27.2v11.2c0 14.4-12.8 27.2-27.2 27.2zM769.6 608H534.4c-14.4 0-27.2-12.8-27.2-27.2v-11.2c0-14.4 11.2-27.2 27.2-27.2h235.2c14.4 0 27.2 12.8 27.2 27.2v11.2c0 14.4-11.2 27.2-27.2 27.2zM673.6 788.8h-139.2c-14.4 0-27.2-12.8-27.2-27.2v-11.2c0-14.4 11.2-27.2 27.2-27.2h139.2c14.4 0 27.2 12.8 27.2 27.2v11.2c0 14.4-12.8 27.2-27.2 27.2z"
|
||||
fill="#2166CC" p-id="4742"></path>
|
||||
<path d="M396.8 385.6l-88 92.8-25.6-27.2c-11.2-11.2-30.4-11.2-41.6 0-11.2 12.8-11.2 32 0 43.2l44.8 48c4.8 6.4 12.8 9.6 20.8 9.6s16-3.2 20.8-9.6l107.2-113.6c11.2-11.2 12.8-32 1.6-43.2-9.6-11.2-28.8-11.2-40 0z"
|
||||
fill="#FFFFFF" p-id="4743"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@@ -64,6 +64,7 @@
|
||||
Vue.component("text-editor", httpVueLoader("/components/plugins/TextEditor.vue?v=" + new Date().getTime()))
|
||||
|
||||
Vue.prototype.$auth = commonUtil.authService()
|
||||
Vue.prototype.$moment = moment
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar title="列表" fixed placeholder left-text="返回" left-arrow @click-left="historyBack"></van-nav-bar>
|
||||
<van-nav-bar title="列表" fixed placeholder left-text="返回" left-arrow @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
|
||||
|
||||
<van-sticky offset-top="46px">
|
||||
<van-tabs v-model="pageForm.category" @change="onRefresh">
|
||||
<van-tab v-for="item in dict.type.ACTIVITY_QSV_CATEGORY" :name="item.code" :title="item.label" :key="item.code"></van-tab>
|
||||
<van-tab v-for="item in dict.type.ACTIVITY_QSV_CATEGORY" :name="item.value" :title="item.label" :key="item.value"></van-tab>
|
||||
</van-tabs>
|
||||
</van-sticky>
|
||||
|
||||
@@ -72,9 +72,7 @@ layout("/layouts/platform_h5.html"){
|
||||
methods: {
|
||||
onLoad() {
|
||||
this.loading = true
|
||||
const loading = createListLoading()
|
||||
this.$axios
|
||||
.post("/platform/h5/qsv/pageData", this.pageForm)
|
||||
$.post("/platform/h5/qsv/pageData", this.pageForm)
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.list = this.list.concat(res.data.list)
|
||||
@@ -84,9 +82,6 @@ layout("/layouts/platform_h5.html"){
|
||||
}
|
||||
this.pageForm.pageNumber++
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
loading.close()
|
||||
this.loading = false
|
||||
this.refreshing = false
|
||||
})
|
||||
@@ -99,12 +94,9 @@ layout("/layouts/platform_h5.html"){
|
||||
},
|
||||
async itemClick(item) {
|
||||
if (item.groupId) {
|
||||
const { code, data } = await this.$axios.post("/open/common/checkGroupPermission", { groupId: item.groupId })
|
||||
if (code === 0) {
|
||||
if (!data) {
|
||||
this.$toast.fail("您没有权限参与")
|
||||
return
|
||||
}
|
||||
if (!await getScopeUser(item.groupId)) {
|
||||
this.$toast.fail("您没有权限参与")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +108,7 @@ layout("/layouts/platform_h5.html"){
|
||||
|
||||
const path = this.categoryPaths[item.category]
|
||||
if (path) {
|
||||
this.$pjaxReplace(path + "?id=" + item.id)
|
||||
pjaxReplace(path + "?id=" + item.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
@@ -72,7 +72,7 @@ layout("/layouts/platform_h5.html"){
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar title="问卷调查" left-arrow @click-left="historyBack" placeholder fixed></van-nav-bar>
|
||||
<van-nav-bar title="问卷调查" left-arrow @click-left="pjaxReplace('/mobile/index')" placeholder fixed></van-nav-bar>
|
||||
<div class="container" :style="{'padding-bottom': answerRecord.isFinish ? 0 : '84px'}">
|
||||
<van-sticky offset-top="46px">
|
||||
<!--开启计时 未完成 活动未结束-->
|
||||
@@ -156,7 +156,7 @@ layout("/layouts/platform_h5.html"){
|
||||
methods: {
|
||||
//获取活动、题目
|
||||
listSubjects() {
|
||||
this.$axios.post("/platform/h5/qsv/quiz/subjects", { activityId: this.id }).then((res) => {
|
||||
$.post("/platform/h5/qsv/quiz/subjects", { activityId: this.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.activity = res.data.activity
|
||||
this.subjects = res.data.subjects
|
||||
@@ -169,7 +169,7 @@ layout("/layouts/platform_h5.html"){
|
||||
|
||||
//获取回答记录
|
||||
getAnswerRecord() {
|
||||
this.$axios.post("/platform/h5/qsv/quiz/answerRecord", { answerRecordId: this.answerRecordId }).then((res) => {
|
||||
$.post("/platform/h5/qsv/quiz/answerRecord", { answerRecordId: this.answerRecordId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.answerRecord = res.data
|
||||
|
||||
@@ -262,7 +262,7 @@ layout("/layouts/platform_h5.html"){
|
||||
},
|
||||
|
||||
historyScore() {
|
||||
this.$axios.post("/platform/h5/qsv/quiz/historyScore", { activityId: this.activityId }).then((res) => {
|
||||
$.post("/platform/h5/qsv/quiz/historyScore", { activityId: this.activityId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.historyScores = res.data
|
||||
}
|
||||
@@ -307,7 +307,7 @@ layout("/layouts/platform_h5.html"){
|
||||
|
||||
//自动提交
|
||||
autoSubmit(loading = null) {
|
||||
this.$axios
|
||||
$
|
||||
.post("/platform/h5/qsv/quiz/submitAnswer", {
|
||||
answer: JSON.stringify({
|
||||
activityId: this.id,
|
||||
@@ -338,7 +338,7 @@ layout("/layouts/platform_h5.html"){
|
||||
async checkGroupPermission() {
|
||||
const groupId = this.activity.groupId
|
||||
if (groupId) {
|
||||
const { code, data } = await this.$axios.post("/open/common/checkGroupPermission", { groupId })
|
||||
const { code, data } = await $.post("/open/common/checkGroupPermission", { groupId })
|
||||
if (code === 0) {
|
||||
if (!data) {
|
||||
this.$dialog
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
@@ -156,7 +156,7 @@ layout("/layouts/platform_h5.html"){
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar title="问卷调查" left-arrow @click-left="historyBack" placeholder fixed></van-nav-bar>
|
||||
<van-nav-bar title="问卷调查" left-arrow @click-left="pjaxReplace('/mobile/index')" placeholder fixed></van-nav-bar>
|
||||
<div class="container" :style="{'padding-bottom': answerRecord.isFinish ? 0 : '84px'}">
|
||||
<van-sticky offset-top="46px">
|
||||
<h2 class="title">{{ activity.title }}</h2>
|
||||
@@ -269,7 +269,7 @@ layout("/layouts/platform_h5.html"){
|
||||
},
|
||||
methods: {
|
||||
getAnswerResult() {
|
||||
this.$axios.post("/platform/h5/qsv/quiz/answerResult", { answerRecordId: this.answerRecordId }).then((res) => {
|
||||
$.post("/platform/h5/qsv/quiz/answerResult", { answerRecordId: this.answerRecordId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.subjects = res.data.subjects
|
||||
this.activity = res.data.activity
|
||||
@@ -280,7 +280,7 @@ layout("/layouts/platform_h5.html"){
|
||||
|
||||
//获取回答记录
|
||||
getAnswerRecord() {
|
||||
this.$axios.post("/platform/h5/qsv/quiz/answerRecord", { answerRecordId: this.answerRecordId }).then((res) => {
|
||||
$.post("/platform/h5/qsv/quiz/answerRecord", { answerRecordId: this.answerRecordId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.answerRecord = res.data
|
||||
this.initAnswer()
|
||||
@@ -307,12 +307,12 @@ layout("/layouts/platform_h5.html"){
|
||||
},
|
||||
|
||||
historyBack() {
|
||||
this.$pjaxReplace("/platform/h5/qsv")
|
||||
pjaxReplace('/platform/h5/qsv')
|
||||
},
|
||||
|
||||
openHistory() {
|
||||
this.historyShow = true
|
||||
this.$axios.post("/platform/h5/qsv/quiz/historyScore", { activityId: this.activity.id }).then((res) => {
|
||||
$.post("/platform/h5/qsv/quiz/historyScore", { activityId: this.activity.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.historyList = res.data
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--#
|
||||
layout("/layouts/platform_h5.html"){
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
@@ -80,10 +80,21 @@ layout("/layouts/platform_h5.html"){
|
||||
resize: none;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.desc-content{
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.desc-content *{
|
||||
max-width: 100%!important;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar title="问卷调查" left-arrow @click-left="historyBack" placeholder fixed></van-nav-bar>
|
||||
<van-nav-bar title="问卷调查" left-arrow @click-left="pjaxReplace('/mobile/index')" placeholder fixed></van-nav-bar>
|
||||
<div class="container" :style="{'padding-bottom': answerRecord.isFinish ? 0 : '84px'}">
|
||||
<h2 class="title">{{ activity.title }}</h2>
|
||||
<div v-if="!isFinished">
|
||||
@@ -99,6 +110,7 @@ layout("/layouts/platform_h5.html"){
|
||||
<van-checkbox-group
|
||||
v-model="subject.userSelectOptionIds"
|
||||
:ref="'subject'+subject.id"
|
||||
:max="subject.maxMulti ? subject.maxMulti : 0"
|
||||
v-if="['radio','checkbox'].includes(subject.type)"
|
||||
>
|
||||
<van-cell-group>
|
||||
@@ -112,6 +124,7 @@ layout("/layouts/platform_h5.html"){
|
||||
<template #icon>
|
||||
<van-checkbox :name="option.id" :ref="'option'+option.id" style="margin-right: 10px"></van-checkbox>
|
||||
</template>
|
||||
|
||||
<img
|
||||
slot="right-icon"
|
||||
v-if="option.imgUrl"
|
||||
@@ -120,6 +133,14 @@ layout("/layouts/platform_h5.html"){
|
||||
style="width: 40px; height: 40px"
|
||||
@click.stop="previewOptionImg(option.imgUrl)"
|
||||
/>
|
||||
|
||||
<div slot="extra">
|
||||
<div v-if="option.description" style="color: #0a84ff" @click.stop="openDesc(option)">
|
||||
查看详情
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</van-checkbox-group>
|
||||
@@ -134,6 +155,13 @@ layout("/layouts/platform_h5.html"){
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<van-action-sheet v-model="descShow" title="详情">
|
||||
<div class="desc-content" v-html="optionDesc" @click="descClick">
|
||||
</div>
|
||||
</van-action-sheet>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -148,7 +176,10 @@ layout("/layouts/platform_h5.html"){
|
||||
remainingTime: 0,
|
||||
isFinished: false,
|
||||
answerRecord: {},
|
||||
answerRecordId: null
|
||||
answerRecordId: null,
|
||||
|
||||
descShow:false,
|
||||
optionDesc:null
|
||||
}
|
||||
},
|
||||
|
||||
@@ -164,23 +195,36 @@ layout("/layouts/platform_h5.html"){
|
||||
methods: {
|
||||
//获取活动、题目
|
||||
listSubjects() {
|
||||
this.$axios.post("/platform/h5/qsv/survey/subjects", { activityId: this.id }).then((res) => {
|
||||
$.post("/platform/h5/qsv/survey/subjects", { activityId: this.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.activity = res.data.activity
|
||||
this.subjects = res.data.subjects
|
||||
this.answerRecordId = res.data.answerRecordId
|
||||
this.getAnswerRecord()
|
||||
} else {
|
||||
vant.Dialog.alert({
|
||||
title: '温馨提示',
|
||||
message: res.msg,
|
||||
}).then(() => {
|
||||
pjaxReplace("/mobile/index")
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//获取回答记录
|
||||
getAnswerRecord() {
|
||||
this.$axios.post("/platform/h5/qsv/survey/answerRecord", { answerRecordId: this.answerRecordId }).then((res) => {
|
||||
$.post("/platform/h5/qsv/survey/answerRecord", { answerRecordId: this.answerRecordId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.answerRecord = res.data
|
||||
if (this.answerRecord.isFinish) {
|
||||
this.$toast.success("您已完成该调查")
|
||||
vant.Dialog.alert({
|
||||
title: '温馨提示',
|
||||
message: '您已完成该调查,感谢您的参与!',
|
||||
}).then(() => {
|
||||
// on close
|
||||
});
|
||||
// this.$toast.success("您已完成该调查")
|
||||
}
|
||||
this.initAnswer()
|
||||
}
|
||||
@@ -222,6 +266,21 @@ layout("/layouts/platform_h5.html"){
|
||||
vant.ImagePreview([img])
|
||||
},
|
||||
|
||||
//查看详情
|
||||
openDesc(option){
|
||||
this.descShow = true
|
||||
this.optionDesc = option.description
|
||||
},
|
||||
|
||||
//详情点击
|
||||
descClick(event){
|
||||
//如果点击的是图片
|
||||
if(event.target.tagName === 'IMG'){
|
||||
vant.ImagePreview([event.target.src])
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
//手动提交
|
||||
onSubmit() {
|
||||
const endTime = this.activity.endTime
|
||||
@@ -250,8 +309,7 @@ layout("/layouts/platform_h5.html"){
|
||||
|
||||
//自动提交
|
||||
autoSubmit(loading = null) {
|
||||
this.$axios
|
||||
.post("/platform/h5/qsv/survey/submitAnswer", {
|
||||
$.post("/platform/h5/qsv/survey/submitAnswer", {
|
||||
answer: JSON.stringify({
|
||||
activityId: this.id,
|
||||
answerRecordId: this.answerRecordId,
|
||||
@@ -269,8 +327,6 @@ layout("/layouts/platform_h5.html"){
|
||||
this.$toast.success(res.msg)
|
||||
this.getAnswerRecord()
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
if (loading) {
|
||||
loading.clear()
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ layout("/mobile/platform.html"){
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 8px 12px #ebedf0;
|
||||
line-height: 25px;
|
||||
font-size: 12px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
|
||||
@@ -158,9 +158,6 @@ layout("/mobile/platform.html"){
|
||||
<van-sticky>
|
||||
<van-nav-bar :title="trainType + '列表'" left-arrow
|
||||
@click-left="pjaxReplace('/platform/mobile/trainSignUpActivity/trainList?type=' + type)"></van-nav-bar>
|
||||
</van-sticky>
|
||||
|
||||
<van-sticky>
|
||||
<van-dropdown-menu active-color="#1867b0">
|
||||
<van-dropdown-item @change="tabChange" v-model="activityStatus"
|
||||
:options="activityOptions"></van-dropdown-item>
|
||||
@@ -171,7 +168,6 @@ layout("/mobile/platform.html"){
|
||||
<van-tabs v-if="activityStatus != '1' && assortList.length > 0" v-model="assort" type="card" color="#1867B0"
|
||||
style="margin-top: 10px" @click="tabClick">
|
||||
<van-tab v-for="item in assortList" :name="item" :title="item">
|
||||
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
|
||||
@@ -181,7 +177,7 @@ layout("/mobile/platform.html"){
|
||||
</van-notice-bar>-->
|
||||
|
||||
<template>
|
||||
<div id="parentDiv" v-model="loading" v-if="tableData.courseList && tableData.courseList.length>0">
|
||||
<div id="parentDiv" v-model="loading" v-if="tableData.courseList && tableData.courseList.length>0" style="margin-bottom: 60px">
|
||||
|
||||
<template v-for="o in tableData.courseList">
|
||||
<div style="position: relative"
|
||||
@@ -211,13 +207,24 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
<div>
|
||||
<span class="train-title">活动时间:</span>
|
||||
<span v-if="o.courseTimeList && o.courseTimeList.length > 1" @click="trainClick(o)"
|
||||
style="color: #1867b0">点我查看</span>
|
||||
<span @click="trainClick(o)" v-if="o.courseTimeList && o.courseTimeList.length === 1"
|
||||
style="color: #1867b0">
|
||||
<template v-if="o.courseName.includes('时间待定')">
|
||||
<span style="color: #e5a15e">活动时间另行通知</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span v-if="o.courseTimeList && o.courseTimeList.length > 1" @click="trainClick(o)"
|
||||
style="color: #1867b0">点我查看</span>
|
||||
<span @click="trainClick(o)" v-if="o.courseTimeList && o.courseTimeList.length === 1"
|
||||
style="color: #1867b0">
|
||||
{{o.courseTimeList[0].courseStartTime.substring(11, 19) + ' ~ ' + o.courseTimeList[0].courseEndTime.substring(11, 19)}}
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
<template v-if="o.courseTimeName">
|
||||
<div>
|
||||
<span class="train-title">报名时段:</span>
|
||||
<span style="color: #1867b0">{{o.courseTimeName}}</span>
|
||||
</div>
|
||||
</template>
|
||||
<div>
|
||||
<span @click.stop="showPic(FILE_DOMAIN + '/fileStreamPreview?id=' + tableData.wechat.id)"
|
||||
v-if="o.isSign === true && tableData.wechat"
|
||||
@@ -241,11 +248,11 @@ layout("/mobile/platform.html"){
|
||||
style="position: absolute; left: 77%; top: 58%;"
|
||||
src="/assets/mobile/svg/train/sign_up.svg"></image>
|
||||
|
||||
<div @click="trainClick(o)" v-if="activityStatus === '1' && o.isMobileSign"
|
||||
style="text-align: center; line-height: 40px; width: 40px; height: 40px;display: inline-block; font-size: 14px;
|
||||
position: absolute; right: -10px; top: 8%; background-color: #00c698; border-radius: 7px; color: white">
|
||||
签到
|
||||
</div>
|
||||
<!-- <div @click="trainClick(o)" v-if="activityStatus === '1'"-->
|
||||
<!-- style="text-align: center; line-height: 40px; width: 40px; height: 40px;display: inline-block; font-size: 14px;-->
|
||||
<!-- position: absolute; right: -10px; top: 8%; background-color: #00c698; border-radius: 7px; color: white">-->
|
||||
<!-- 签到-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
@@ -304,7 +311,14 @@ layout("/mobile/platform.html"){
|
||||
<div class="join_content">
|
||||
<van-form @submit="joinSubmit" :show-error-message="false">
|
||||
<div class="van-doc-card-two" style="margin-bottom: 16px">
|
||||
<div></div>
|
||||
<div class="van-card-header">
|
||||
活动信息
|
||||
</div>
|
||||
<div class="van-card-body">
|
||||
<van-field label="活动名称" readonly v-model="choose.courseName"></van-field>
|
||||
<van-field label="校区" readonly v-model="choose.campus"></van-field>
|
||||
<van-field label="活动地点" readonly v-model="choose.courseLocation"></van-field>
|
||||
</div>
|
||||
<div class="van-card-header">
|
||||
基础信息
|
||||
</div>
|
||||
@@ -316,6 +330,19 @@ layout("/mobile/platform.html"){
|
||||
<van-field label="性别" readonly v-model="formData.sex"></van-field>
|
||||
<van-field label="联系方式" required :rules="[{ required: true, message: '请填写联系方式' }]"
|
||||
placeholder="请填写联系方式" v-model="formData.mobile"></van-field>
|
||||
<template v-if="this.choose.courseIsLimitApply">
|
||||
<van-field label="报名时段" required :rules="[{ required: true, message: '请选择报名时段' }]"
|
||||
readonly @click="showCoursePicker = true;getCourseTimeSelectList(choose);"
|
||||
placeholder="请选择报名时段" v-model="formData.courseTimeName"></van-field>
|
||||
<van-popup v-model="showCoursePicker" position="bottom">
|
||||
<van-picker
|
||||
show-toolbar
|
||||
:columns="courseTimeSelectList"
|
||||
@confirm="onCourseConfirm"
|
||||
@cancel="showCoursePicker=false"
|
||||
></van-picker>
|
||||
</van-popup>
|
||||
</template>
|
||||
<train-dynamic-form v-model="dynamicColumnsData" ref="trainDynamicForm"></train-dynamic-form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -325,11 +352,17 @@ layout("/mobile/platform.html"){
|
||||
</van-form>
|
||||
</div>
|
||||
</van-popup>
|
||||
|
||||
|
||||
<div>
|
||||
<van-tabbar v-model="tarBarActive">
|
||||
<van-tabbar-item icon="home-o" replace @click="pjaxReplace('/platform/mobile/trainSignUpActivity/trainList')">活动报名</van-tabbar-item>
|
||||
<van-tabbar-item icon="manager-o" replace @click="pjaxReplace('/platform/mobile/trainSignUpActivity/trainList?type=my')">我的活动</van-tabbar-item>
|
||||
</van-tabbar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
let pointArray = []
|
||||
let locations = null
|
||||
let map = null
|
||||
@@ -339,6 +372,7 @@ layout("/mobile/platform.html"){
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
tarBarActive: 0,
|
||||
assort: '',
|
||||
assortList: [],
|
||||
allColumnsData: [],
|
||||
@@ -362,6 +396,9 @@ layout("/mobile/platform.html"){
|
||||
activitySignUpStartTime: null,
|
||||
choose: {},
|
||||
activity: '',
|
||||
|
||||
showCoursePicker: false,
|
||||
courseTimeSelectList: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -528,7 +565,7 @@ layout("/mobile/platform.html"){
|
||||
cancel(o) {
|
||||
vant.Dialog.confirm({
|
||||
title: '温馨提示',
|
||||
message: "您确定要<span style='color: red'>取消【" + o.courseName + "】</span>吗?\n一旦确认,可不能反悔了哟!",
|
||||
message: "您确定要<span style='color: red'>取消【" + o.courseName + "】</span>吗?",
|
||||
confirmButtonColor: '#1867b0',
|
||||
}).then(async () => {
|
||||
const resp = await $.post('/platform/mobile/trainSignUpActivity/cancelSignUp', {
|
||||
@@ -543,12 +580,24 @@ layout("/mobile/platform.html"){
|
||||
});
|
||||
},
|
||||
async signUp(o) {
|
||||
if (o.courseName.includes('时间待定')) {
|
||||
vant.Dialog.alert({
|
||||
title: '提示',
|
||||
message: '活动报名尚未开始哦,请报名其他活动吧',
|
||||
confirmButtonColor: '#1867b0'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.choose = o
|
||||
|
||||
const res = await $.post('/platform/mobile/trainSignUpActivity/validateSignUp', {
|
||||
cndId: o.conditionStructureId,
|
||||
courseId: o.id,
|
||||
})
|
||||
|
||||
if (o.courseIsLimitApply) {
|
||||
await this.getCourseTimeSelectList(o)
|
||||
}
|
||||
|
||||
if(res.code !== 0) {
|
||||
vant.Dialog.alert({
|
||||
title: '提示',
|
||||
@@ -579,6 +628,20 @@ layout("/mobile/platform.html"){
|
||||
})
|
||||
this.joinPopup = true
|
||||
},
|
||||
async getCourseTimeSelectList(o) {
|
||||
const resp = await $.post('/platform/mobile/trainSignUpActivity/getCourseTimeSelectList',{courseId: o.id})
|
||||
if (resp.code === 0) {
|
||||
this.courseTimeSelectList = resp.data
|
||||
} else {
|
||||
this.$toast.fail("获取时段信息失败,请联系管理员")
|
||||
}
|
||||
},
|
||||
onCourseConfirm(val){
|
||||
this.formData.activityCourseId = val.value
|
||||
this.$set(this.formData, "activityCourseId", val.value)
|
||||
this.$set(this.formData, "courseTimeName", val.text.substring(0, 12))
|
||||
this.showCoursePicker = false
|
||||
},
|
||||
async joinSubmit() {
|
||||
let valid = false
|
||||
try {
|
||||
@@ -609,9 +672,24 @@ layout("/mobile/platform.html"){
|
||||
return
|
||||
}
|
||||
|
||||
let flag = this.choose.courseIsLimitApply
|
||||
if (flag) {
|
||||
const resp = await $.post('/platform/mobile/trainSignUpActivity/validateSourceSignUp',{activityCourseId: this.formData.activityCourseId})
|
||||
if (resp.code !== 0) {
|
||||
vant.Dialog.alert({
|
||||
title: '温馨提示',
|
||||
message: resp.msg,
|
||||
confirmButtonColor: '#1867b0'
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let msg = '您选择了【' + this.choose.courseName + (flag ? this.formData.courseTimeName : '') + '】\n的报名,是否确认?'
|
||||
vant.Dialog.confirm({
|
||||
title: '温馨提示',
|
||||
message: '您选择了【' + this.choose.courseName + '】\n一旦确认,可不能反悔了哟',
|
||||
message: msg,
|
||||
confirmButtonColor: '#1867b0',
|
||||
}).then(async () => {
|
||||
const toast = vant.Toast.loading({
|
||||
@@ -632,7 +710,7 @@ layout("/mobile/platform.html"){
|
||||
const resp = await $.post('/platform/mobile/trainSignUpActivity/doSignUp', this.formData)
|
||||
vant.Toast(resp.msg)
|
||||
if (resp.code === 0) {
|
||||
await this.pageData()
|
||||
this.pageData()
|
||||
this.joinPopup = false
|
||||
}
|
||||
toast.clear()
|
||||
@@ -800,6 +878,7 @@ layout("/mobile/platform.html"){
|
||||
if (this.type === 'my') {
|
||||
this.activityOptions = [{text: '我报名的', value: '1'}]
|
||||
this.activityStatus = '1'
|
||||
this.tarBarActive = 1
|
||||
} else {
|
||||
this.activityOptions = [{text: '全部', value: '0'}, {text: '我报名的', value: '1'}]
|
||||
this.activityStatus = new Date().getTime() > new Date(time).getTime() ? '1' : '0'
|
||||
|
||||
@@ -68,61 +68,45 @@ layout("/mobile/platform.html"){
|
||||
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<van-nav-bar @click-left="pjaxReplace('/mobile/index')" fixed left-arrow placeholder
|
||||
title="活动列表"></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 :options="yearList" @change="formChange"
|
||||
v-model="pageForm.year"></van-dropdown-item>
|
||||
<van-dropdown-item :options="activityStatusList" @change="formChange"
|
||||
v-model="pageForm.activityStatus"></van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.year" :options="yearList"
|
||||
@change="formChange"></van-dropdown-item>
|
||||
<van-dropdown-item v-model="pageForm.activityStatus" :options="activityStatusList"
|
||||
@change="formChange"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</div>
|
||||
<!-- <van-sticky>-->
|
||||
<!-- <van-nav-bar title="活动列表" left-arrow-->
|
||||
<!-- @click-left="location.replace('/mobile/index')"></van-nav-bar>-->
|
||||
<!-- </van-sticky>-->
|
||||
<!-- <van-sticky>-->
|
||||
<!-- <van-nav-bar title="活动列表" left-arrow-->
|
||||
<!-- @click-left="location.replace('/mobile/index')"></van-nav-bar>-->
|
||||
<!-- </van-sticky>-->
|
||||
|
||||
<!-- <van-sticky>-->
|
||||
<!-- <van-tabs v-model="pageForm.activityStatus" @change="tabChange">-->
|
||||
<!-- <van-tab title="全部" name="0"></van-tab>-->
|
||||
<!-- <van-tab v-if="type !== 'my'" title="进行中" name="1"></van-tab>-->
|
||||
<!-- <van-tab v-if="type === 'my'" title="进行中" name="3"></van-tab>-->
|
||||
<!-- <van-tab title="已结束" name="2"></van-tab>-->
|
||||
<!-- </van-tabs>-->
|
||||
<!-- </van-sticky>-->
|
||||
<!-- <van-sticky>-->
|
||||
<!-- <van-tabs v-model="pageForm.activityStatus" @change="tabChange">-->
|
||||
<!-- <van-tab title="全部" name="0"></van-tab>-->
|
||||
<!-- <van-tab v-if="type !== 'my'" title="进行中" name="1"></van-tab>-->
|
||||
<!-- <van-tab v-if="type === 'my'" title="进行中" name="3"></van-tab>-->
|
||||
<!-- <van-tab title="已结束" name="2"></van-tab>-->
|
||||
<!-- </van-tabs>-->
|
||||
<!-- </van-sticky>-->
|
||||
|
||||
<div style="margin: 60px auto 80px auto">
|
||||
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
|
||||
@load="pageData"
|
||||
v-if="tableData && tableData.length>0"
|
||||
v-model="loading">
|
||||
<div class="van-doc-card" v-for="o in tableData">
|
||||
<!-- <div class="tag" v-if="moment(o.activitySignUpStartTime).unix() > moment().unix()">即将开始</div>-->
|
||||
v-model="loading"
|
||||
@load="pageData">
|
||||
<div v-for="o in tableData" class="van-doc-card">
|
||||
<!-- <div class="tag" v-if="moment(o.activitySignUpStartTime).unix() > moment().unix()">即将开始</div>-->
|
||||
<div>
|
||||
<div class="tag" style="background-color: #bc62c5" v-if="o.isDisabled">活动未开启
|
||||
</div>
|
||||
<div class="tag"
|
||||
v-else-if="!o.isDisabled && moment(o.activitySignUpStartTime).valueOf() > moment().valueOf()">
|
||||
未开始报名
|
||||
</div>
|
||||
<div class="tag"
|
||||
v-else-if="!o.isDisabled &&moment(o.activitySignUpEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.activitySignUpStartTime).valueOf()">
|
||||
报名中
|
||||
</div>
|
||||
<div class="tag" style="background-color: #f14646"
|
||||
v-else-if="!o.isDisabled &&moment(o.activityEndTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.activityStartTime).valueOf()">
|
||||
报名结束
|
||||
</div>
|
||||
<div class="tag"
|
||||
v-else-if="!o.isDisabled &&moment(o.activityStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.activityEndTime).valueOf()">
|
||||
活动进行中
|
||||
</div>
|
||||
<div class="tag" style="background-color: #f14646"
|
||||
v-else-if="!o.isDisabled &&moment().valueOf() > moment(o.activityEndTime).valueOf()">
|
||||
活动结束
|
||||
</div>
|
||||
<div class="tag" style="background-color: #bc62c5" v-if="o.isDisabled">活动未开启</div>
|
||||
<div class="tag" v-else-if="!o.isDisabled && moment(o.activitySignUpStartTime).valueOf() > moment().valueOf()">未开始报名</div>
|
||||
<div class="tag" v-else-if="!o.isDisabled &&moment(o.activitySignUpEndTime).valueOf() > moment().valueOf() && moment().valueOf() > moment(o.activitySignUpStartTime).valueOf()">报名中</div>
|
||||
<div class="tag" style="background-color: #f14646" v-else-if="!o.isDisabled &&moment(o.activityEndTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.activityStartTime).valueOf()">报名结束</div>
|
||||
<div class="tag" v-else-if="!o.isDisabled &&moment(o.activityStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.activityEndTime).valueOf()">活动进行中</div>
|
||||
<div class="tag" style="background-color: #f14646" v-else-if="!o.isDisabled &&moment().valueOf() > moment(o.activityEndTime).valueOf()">活动结束</div>
|
||||
</div>
|
||||
<div @click="welfareClick(o)">
|
||||
<div>
|
||||
@@ -134,8 +118,7 @@ layout("/mobile/platform.html"){
|
||||
v-else></van-image>
|
||||
</div>
|
||||
<div>
|
||||
<div class="van-ellipsis"
|
||||
style="margin-top: 6px; font-size: 15px;font-weight: bold;flex: 1">
|
||||
<div class="van-ellipsis" style="margin-top: 6px; font-size: 15px;font-weight: bold;flex: 1">
|
||||
{{o.activityName}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -163,9 +146,15 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
<van-empty description="暂无数据" v-else></van-empty>
|
||||
<van-empty v-else description="暂无数据"></van-empty>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<van-tabbar v-model="tarBarActive">
|
||||
<van-tabbar-item icon="home-o" replace @click="pjaxReplace('/platform/mobile/trainSignUpActivity/trainList')">活动报名</van-tabbar-item>
|
||||
<van-tabbar-item icon="manager-o" replace @click="pjaxReplace('/platform/mobile/trainSignUpActivity/trainList?type=my')">我的活动</van-tabbar-item>
|
||||
</van-tabbar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -200,7 +189,7 @@ layout("/mobile/platform.html"){
|
||||
this.pageData()
|
||||
},
|
||||
async welfareClick(o) {
|
||||
if (o.isDisabled) {
|
||||
if (o.isDisabled){
|
||||
this.$toast('活动未开启')
|
||||
return;
|
||||
}
|
||||
@@ -212,7 +201,16 @@ layout("/mobile/platform.html"){
|
||||
pjaxReplace('/platform/mobile/trainSignUpActivity/trainInfo' +
|
||||
'?activityId=' + o.id + '&endTime=' + o.activitySignUpEndTime + '&type=my' + '&startTime=' + o.activitySignUpStartTime)
|
||||
} else {
|
||||
pjaxReplace('/platform/mobile/trainSignUpActivity/activityInfo?activityId=' + o.id + '&endTime=' + o.activitySignUpEndTime)
|
||||
const scopeUser = await getScopeUser(o.activityGroupId);
|
||||
if (scopeUser === 0) {
|
||||
vant.Dialog.alert({
|
||||
title: '提示',
|
||||
message: '您不在报名人员范围内',
|
||||
confirmButtonColor: '#1867b0'
|
||||
})
|
||||
return
|
||||
}
|
||||
pjaxReplace('/platform/mobile/trainSignUpActivity/trainInfo?activityId=' + o.id + '&endTime=' + o.activitySignUpEndTime)
|
||||
}
|
||||
},
|
||||
async pageData() {
|
||||
@@ -243,7 +241,7 @@ layout("/mobile/platform.html"){
|
||||
this.pageData()
|
||||
this.closeLoading()
|
||||
},
|
||||
async init() {
|
||||
async init(){
|
||||
this.$set(this.pageForm, "activityStatus", 1)
|
||||
this.$set(this.pageForm, "year", new Date().getFullYear())
|
||||
}
|
||||
@@ -251,6 +249,9 @@ layout("/mobile/platform.html"){
|
||||
async created() {
|
||||
await this.init()
|
||||
this.type = GetQueryString('type')
|
||||
if (this.type === 'my') {
|
||||
this.tarBarActive = 1
|
||||
}
|
||||
this.pageForm.type = this.type
|
||||
this.startLoading()
|
||||
// this.pageForm.activityStatus = this.type === 'my' ? '3' : '1'
|
||||
|
||||
@@ -205,7 +205,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
|
||||
<template #view>
|
||||
|
||||
<member-all-change-info ref="memberAllChangeInfoRef"></member-all-change-info>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
@@ -317,7 +317,8 @@ layout("/layouts/platform.html"){
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("../common/memberAllChangeInfo.js"){}#-->
|
||||
<!--#include("../../member/change/common/memberAllChangeInfo.js"){}#-->
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
@@ -360,10 +361,14 @@ layout("/layouts/platform.html"){
|
||||
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.3'),
|
||||
'user-upset': httpVueLoader('/components/userpartupdate/UserPartUpdateSet.vue'),
|
||||
'user-upset-data': httpVueLoader('/components/userpartupdate/UserDataPartUpSet.vue'),
|
||||
'member-all-change-info': MEMBER_ALL_CHANGE_INFO,
|
||||
},
|
||||
methods: {
|
||||
async openUserChangeInfo({hisId}) {
|
||||
|
||||
openUserChangeInfo(row) {
|
||||
this.$refs.guava.view()
|
||||
this.$nextTick(() => {
|
||||
this.$refs.memberAllChangeInfoRef.onOpen(row.id)
|
||||
})
|
||||
},
|
||||
async getColumnInfo() {
|
||||
const {data, msg, code} = await $.post('/platform/activity/basic/scope/getUserTableColumnInfo')
|
||||
|
||||
@@ -12,13 +12,15 @@ layout("/layouts/platform.html"){
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="审核列表">
|
||||
<template #func>
|
||||
<el-button size="small" type="primary" @click="doBatchApproval" class="mr10">批量审核</el-button>
|
||||
<el-radio-group @change="search" class="mr5" size="small" v-model="pageForm.audit">
|
||||
<el-radio-button label="true">已审核</el-radio-button>
|
||||
<el-radio-button label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id" style="width: 100%">
|
||||
<el-table :data="tableData" @selection-change="handleSelectionChange" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id" style="width: 100%">
|
||||
<el-table-column type="selection" width="55" reserve-selection></el-table-column>
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号" type="index" width="80px"></el-table-column>
|
||||
<el-table-column :label="column.label"
|
||||
@@ -127,6 +129,7 @@ layout("/layouts/platform.html"){
|
||||
showApprovalForm: false,
|
||||
|
||||
changeTypeData: [],
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -135,6 +138,32 @@ layout("/layouts/platform.html"){
|
||||
'member-change-audit-info': MEMBER_CHANGE_AUDIT_INFO
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
doBatchApproval() {
|
||||
if (this.multipleSelection.length === 0){
|
||||
this.$message.warning('请勾选需要审核的人员数据')
|
||||
return
|
||||
}
|
||||
|
||||
this.$confirm('确定要将勾选的数据全部审核通过吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const ids = this.multipleSelection.map((v) => v.id)
|
||||
const resp = await $.post('/platform/member/change/branchUnion/audit/doBatchApproval', {
|
||||
data: JSON.stringify(ids)
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
openView(row){
|
||||
this.$refs.guava.view()
|
||||
this.$nextTick(() => {
|
||||
|
||||
@@ -869,7 +869,10 @@ layout("/layouts/platform.html"){
|
||||
// }
|
||||
},
|
||||
getChangeTypes(changeTypes){
|
||||
const changeTypesList = clone(changeTypes)
|
||||
if (!changeTypes) {
|
||||
return
|
||||
}
|
||||
const changeTypesList = JSON.parse(changeTypes)
|
||||
if (changeTypesList) {
|
||||
if (!changeTypesList || changeTypesList.length === 0 || !this.changeTypeData || this.changeTypeData.length === 0) return null
|
||||
return changeTypesList
|
||||
|
||||
@@ -12,13 +12,15 @@ layout("/layouts/platform.html"){
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="审核列表">
|
||||
<template #func>
|
||||
<el-button size="small" type="primary" @click="doBatchApproval" class="mr10">批量审核</el-button>
|
||||
<el-radio-group @change="search" class="mr5" size="small" v-model="pageForm.audit">
|
||||
<el-radio-button label="true">已审核</el-radio-button>
|
||||
<el-radio-button label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id" style="width: 100%">
|
||||
<el-table :data="tableData" @selection-change="handleSelectionChange" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id" style="width: 100%">
|
||||
<el-table-column type="selection" width="55" reserve-selection></el-table-column>
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号" type="index" width="80px"></el-table-column>
|
||||
<el-table-column :label="column.label"
|
||||
@@ -127,6 +129,7 @@ layout("/layouts/platform.html"){
|
||||
showApprovalForm: false,
|
||||
|
||||
changeTypeData: [],
|
||||
multipleSelection: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -135,6 +138,32 @@ layout("/layouts/platform.html"){
|
||||
'member-change-audit-info': MEMBER_CHANGE_AUDIT_INFO
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
doBatchApproval() {
|
||||
if (this.multipleSelection.length === 0){
|
||||
this.$message.warning('请勾选需要审核的人员数据')
|
||||
return
|
||||
}
|
||||
|
||||
this.$confirm('确定要将勾选的数据全部审核通过吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const ids = this.multipleSelection.map((v) => v.id)
|
||||
const resp = await $.post('/platform/member/change/schoolUnion/audit/doBatchApproval', {
|
||||
data: JSON.stringify(ids)
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
openView(row){
|
||||
this.$refs.guava.view()
|
||||
this.$nextTick(() => {
|
||||
|
||||
@@ -33,7 +33,7 @@ layout("/layouts/platform.html"){
|
||||
<el-button type="primary" @click="$refs.member.save()"
|
||||
style="position: absolute;right: 20px;top: 30px;z-index: 100">提交
|
||||
</el-button>
|
||||
<member ref="member" :id="'${@shiro.getPrincipalProperty('id')}'"></member>
|
||||
<member ref="member" :id="user.id"></member>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -45,14 +45,16 @@ layout("/layouts/platform.html"){
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {}
|
||||
return {
|
||||
user: {},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'member': httpVueLoader('/components/member/MemberInfo.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {},
|
||||
async created() {
|
||||
|
||||
this.user = JSON.parse(window.sessionStorage.getItem('user'))
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -5,8 +5,8 @@ const basicForm = {
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="150px">
|
||||
<el-form-item label="类型" prop="category">
|
||||
<el-radio-group v-model="formData.category" size="small">
|
||||
<el-radio v-for="item in dict.type.ACTIVITY_QSV_CATEGORY" :label="item.code"
|
||||
:key="item.code"
|
||||
<el-radio v-for="item in dict.type.ACTIVITY_QSV_CATEGORY" :label="item.value"
|
||||
:key="item.value"
|
||||
border>
|
||||
{{item.label}}
|
||||
</el-radio>
|
||||
@@ -71,8 +71,8 @@ const basicForm = {
|
||||
</el-popover>
|
||||
</span>
|
||||
<el-radio-group v-model="formData.mode" size="small">
|
||||
<el-radio v-for="item in dict.type.ACTIVITY_QSV_MODE" :label="item.code"
|
||||
:key="item.code"
|
||||
<el-radio v-for="item in dict.type.ACTIVITY_QSV_MODE" :label="item.value"
|
||||
:key="item.value"
|
||||
border>
|
||||
{{item.label}}
|
||||
</el-radio>
|
||||
@@ -163,8 +163,8 @@ const basicForm = {
|
||||
|
||||
<el-form-item label="得分统计模式" prop="scoreMode" v-if="formData.category==='QUIZ'">
|
||||
<el-radio-group v-model="formData.scoreMode" size="small">
|
||||
<el-radio v-for="item in dict.type.ACTIVITY_QSV_SCORE_MODE" :label="item.code"
|
||||
:key="item.code" border>
|
||||
<el-radio v-for="item in dict.type.ACTIVITY_QSV_SCORE_MODE" :label="item.value"
|
||||
:key="item.value" border>
|
||||
{{item.label}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -197,12 +197,14 @@ const basicForm = {
|
||||
`,
|
||||
dicts: ["ACTIVITY_QSV_CATEGORY", "ACTIVITY_QSV_MODE", "ACTIVITY_QSV_REPEAT_MODE", "ACTIVITY_QSV_SCORE_MODE"],
|
||||
components: {
|
||||
"drawer-user-scope": httpVueLoader("/components/module/activity/DrawerUserScope.vue")
|
||||
"drawer-user-scope": httpVueLoader("/components/plugins/DrawerUserScope.vue")
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formData: {},
|
||||
formData: {
|
||||
category: ''
|
||||
},
|
||||
formRules: {
|
||||
category: [{ required: true, message: "请选择类型", trigger: "change" }],
|
||||
title: [{ required: true, message: "请输入标题", trigger: "change" }],
|
||||
@@ -219,7 +221,7 @@ const basicForm = {
|
||||
this.dialogVisible = true
|
||||
this.getActivityGroup()
|
||||
if (id) {
|
||||
this.$axios.post("/platform/qsv/activity/findOne", { id }).then((res) => {
|
||||
$.post("/platform/qsv/activity/findOne", { id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.formData = res.data
|
||||
}
|
||||
@@ -231,7 +233,7 @@ const basicForm = {
|
||||
onSubmit() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$axios.post("/platform/qsv/activity/save", this.formData).then((res) => {
|
||||
$.post("/platform/qsv/activity/save", this.formData).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.dialogVisible = false
|
||||
@@ -242,7 +244,7 @@ const basicForm = {
|
||||
})
|
||||
},
|
||||
getActivityGroup() {
|
||||
this.$axios.post("/platform/activity/basic/scope/getActivityUserScopeGroup").then((res) => {
|
||||
$.post("/platform/activity/basic/scope/getActivityUserScopeGroup").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.activityGroupOptions = res.data
|
||||
}
|
||||
|
||||
@@ -5,18 +5,31 @@ layout("/layouts/platform.html"){
|
||||
<div id="app">
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker placeholder="年度" type="year" v-model="pageForm.year" value-format="yyyy"></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="标题">
|
||||
<el-input placeholder="标题" v-model="pageForm.title" clearable></el-input>
|
||||
</search-item>
|
||||
</search>
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker placeholder="年度" style="width: 100%" type="year" v-model="pageForm.year" value-format="yyyy"></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">标题:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="标题" v-model="pageForm.title" clearable></el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-button @click="$refs.basicFormRef.onOpen()" size="small" type="primary" class="mr5">新增</el-button>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="管理列表">
|
||||
<template #func>
|
||||
<el-button @click="$refs.basicFormRef.onOpen()" size="small" type="primary" class="mr5">新增</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder">
|
||||
@@ -80,7 +93,7 @@ layout("/layouts/platform.html"){
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/qsv/activity/delete", { id }).then((res) => {
|
||||
$.post("/platform/qsv/activity/delete", { id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("删除成功")
|
||||
this.pageData()
|
||||
|
||||
@@ -3,7 +3,7 @@ const optionImg = {
|
||||
<el-dialog :visible="visible" title="设置图片" append-to-body width="700px">
|
||||
<div style="background: #f7f8f9;text-align: center;border: solid 1px #d7d8d9;border-radius: 4px;">
|
||||
<el-upload
|
||||
action="/platform/sys/file/uploadDynamicReturnUrl"
|
||||
action="/file_server/uploadFile"
|
||||
:show-file-list="false"
|
||||
:on-success="handleSuccess"
|
||||
:before-upload="beforeUpload">
|
||||
@@ -38,7 +38,7 @@ const optionImg = {
|
||||
console.log(file)
|
||||
console.log(fileList)
|
||||
if (response.code === 0) {
|
||||
this.img = response.data
|
||||
this.img = FILE_STREAM_PREVIEW_ADDRESS + "?id=" + response.data.filepath
|
||||
// this.img = "/platform/sys/file/download?id=t38dmq4beuhrupqb54prl52t4u"
|
||||
this.$message.success("图片上传成功")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
const setting = {
|
||||
template:/*language=HTML*/`
|
||||
<el-dialog :title="title" :visible.sync="visible" append-to-body width="50%">
|
||||
<el-form :model="formData" label-width="80px">
|
||||
<el-form-item label="链接" prop="link">
|
||||
<el-input maxlength="255" placeholder="" v-model="formData.link"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="详情" prop="description">
|
||||
<text-editor v-model="formData.description"></text-editor>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="onConfirm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
`,
|
||||
data(){
|
||||
return{
|
||||
title: '设置',
|
||||
visible: false,
|
||||
formData:{},
|
||||
ext: null
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
onOpen(option,ext){
|
||||
console.log(option)
|
||||
this.formData = { ...option }
|
||||
this.ext = ext
|
||||
this.visible = true
|
||||
},
|
||||
onConfirm(){
|
||||
this.$emit('confirm', { option:this.formData,ext:this.ext })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
<!--#include('optionImg.js'){}#-->
|
||||
<!--#include('setting.js'){}#-->
|
||||
|
||||
const subjectForm = {
|
||||
template: /*language=HTML*/ `
|
||||
@@ -41,6 +42,11 @@ const subjectForm = {
|
||||
<!-- </el-option>-->
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div v-if="subject.type === 'checkbox'">
|
||||
最大选择数:
|
||||
<el-input v-model="subject.maxMulti" placeholder="最多可选数量"></el-input>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <el-input-->
|
||||
@@ -115,6 +121,14 @@ const subjectForm = {
|
||||
v-model="option.isCorrect"
|
||||
active-text="正确答案">
|
||||
</el-switch>
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-setting"
|
||||
size="mini"
|
||||
@click="openSetting(subjectIndex,optionIndex,option)">
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@@ -189,10 +203,12 @@ const subjectForm = {
|
||||
</div>
|
||||
|
||||
<option-img ref="optionImgRef" @confirm="onOptionImgConfirm"></option-img>
|
||||
<setting ref="settingRef" @confirm="onSettingConfirm"></setting>
|
||||
</div>
|
||||
`,
|
||||
components: {
|
||||
'option-img': optionImg,
|
||||
'setting': setting
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -210,12 +226,12 @@ const subjectForm = {
|
||||
this.visible = true
|
||||
if (id) {
|
||||
this.id = id
|
||||
this.$axios.post("/platform/qsv/activity/findOne", {id}).then((res) => {
|
||||
$.post("/platform/qsv/activity/findOne", {id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.activity = res.data
|
||||
}
|
||||
})
|
||||
this.$axios.post("/platform/qsv/activity/listSubjects", {activityId: id}).then((res) => {
|
||||
$.post("/platform/qsv/activity/listSubjects", {activityId: id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.subjects = res.data
|
||||
}
|
||||
@@ -277,7 +293,7 @@ const subjectForm = {
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
//添加选项
|
||||
addOption(subject) {
|
||||
subject.options.push({
|
||||
@@ -288,7 +304,7 @@ const subjectForm = {
|
||||
isCorrect: false
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
//删除选项
|
||||
removeOption(subject, optionIndex) {
|
||||
subject.options.splice(optionIndex, 1)
|
||||
@@ -301,21 +317,38 @@ const subjectForm = {
|
||||
optionIndex
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
//选项图片上传成功回调
|
||||
onOptionImgConfirm({img, ext}) {
|
||||
this.$set(this.subjects[ext.subjectIndex].options[ext.optionIndex], "imgUrl", img)
|
||||
},
|
||||
|
||||
|
||||
//删除选项图片
|
||||
removeOptionImg(subjectIndex, optionIndex){
|
||||
this.$set(this.subjects[subjectIndex].options[optionIndex], "imgUrl", null)
|
||||
console.log(this.subjects[subjectIndex])
|
||||
},
|
||||
|
||||
|
||||
//打开选项设置
|
||||
openSetting(subjectIndex, optionIndex, option){
|
||||
this.$refs.settingRef.onOpen(option, {
|
||||
subjectIndex,
|
||||
optionIndex
|
||||
})
|
||||
},
|
||||
|
||||
//选项设置确认
|
||||
onSettingConfirm({option, ext}){
|
||||
this.subjects[ext.subjectIndex].options[ext.optionIndex] = option
|
||||
console.log(this.subjects[ext.subjectIndex].options[ext.optionIndex])
|
||||
|
||||
// this.$set(this.subjects[ext.subjectIndex].options[ext.optionIndex], "isCorrect", option.isCorrect)
|
||||
// this.$set(this.subjects[ext.subjectIndex].options[ext.optionIndex], "hint", option.hint)
|
||||
},
|
||||
|
||||
//保存
|
||||
saveQuestionnaire() {
|
||||
this.$axios
|
||||
$
|
||||
.post("/platform/qsv/activity/saveSubjects", {
|
||||
activityId: this.id,
|
||||
subjects: JSON.stringify(this.subjects)
|
||||
|
||||
@@ -4,52 +4,84 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
@change="listActivity"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="问卷">
|
||||
<el-select filterable placeholder="所属问卷" style="width: 100%" @change="doSearch" v-model="pageForm.activityId">
|
||||
<el-option :label="item.title" :value="item.id" :key="item.id" v-for="item in activityOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="姓名/工号">
|
||||
<el-input v-model="pageForm.searchKeyword" placeholder="姓名/工号" clearable></el-input>
|
||||
</search-item>
|
||||
<search-item label="所属工会">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.unionId" clearable filterable>
|
||||
<el-option v-for="item in unionOptions" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属单位">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId" clearable filterable>
|
||||
<el-option v-for="item in unitOptions" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="答题日期">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.attemptDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择答题日期"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
@change="listActivity"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">问卷</div>
|
||||
<div class="search-item-option">
|
||||
<el-select filterable placeholder="所属问卷" style="width: 100%" @change="doSearch" v-model="pageForm.activityId">
|
||||
<el-option :label="item.title" :value="item.id" :key="item.id" v-for="item in activityOptions"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名/工号</div>
|
||||
<div class="search-item-option">
|
||||
<el-input v-model="pageForm.searchKeyword" placeholder="姓名/工号" clearable></el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会</div>
|
||||
<div class="search-item-option">
|
||||
<el-select placeholder="所属工会" style="width: 100%" v-model="pageForm.unionId" clearable filterable>
|
||||
<el-option v-for="item in unionOptions" :label="item.unionname" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属单位</div>
|
||||
<div class="search-item-option">
|
||||
<el-select placeholder="所属单位" style="width: 100%" v-model="pageForm.unitId" clearable filterable>
|
||||
<el-option v-for="item in unitOptions" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">答题日期</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.attemptDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择答题日期"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-button @click="exportXlsx" icon="el-icon-download" size="small" type="primary" class="mr5">导出xlsx</el-button>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="管理列表">
|
||||
<template #func>
|
||||
<el-button @click="exportXlsx" icon="el-icon-download" size="small" type="primary" class="mr5">导出xlsx</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder">
|
||||
<el-table-column label="序号" width="50" type="index" :index="indexMethod"></el-table-column>
|
||||
@@ -79,7 +111,7 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
methods: {
|
||||
listActivity() {
|
||||
this.$axios.post("/platform/qsv/quizRank/listQuiz", { year: this.pageForm.year }).then((res) => {
|
||||
$.post("/platform/qsv/quizRank/listQuiz", { year: this.pageForm.year }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.activityOptions = res.data
|
||||
if (this.activityOptions.length > 0) {
|
||||
@@ -95,12 +127,12 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
},
|
||||
exportXlsx() {
|
||||
this.$downLoad("/platform/qsv/quizRank/exportXlsx", this.pageForm)
|
||||
// this.$downLoad("/platform/qsv/quizRank/exportXlsx", this.pageForm)
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.unionOptions = await this.$businessTool.listUnion()
|
||||
this.unitOptions = await this.$businessTool.listUnit()
|
||||
this.unionOptions = await getUnionList()
|
||||
this.unitOptions = await getUnits()
|
||||
this.listActivity()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -32,7 +32,7 @@ const answer = {
|
||||
},
|
||||
|
||||
list() {
|
||||
this.$axios.post("/platform/qsv/survey/userAnswer", { activityId: this.activityId }).then((res) => {
|
||||
$.post("/platform/qsv/survey/userAnswer", { activityId: this.activityId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableColumns = res.data.tableColumns
|
||||
this.tableData = res.data.tableData
|
||||
@@ -46,7 +46,7 @@ const answer = {
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/qsv/survey/deleteUserAnswer", { id }).then((res) => {
|
||||
$.post("/platform/qsv/survey/deleteUserAnswer", { id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.list()
|
||||
@@ -56,7 +56,7 @@ const answer = {
|
||||
},
|
||||
|
||||
exportUserAnswerXlsx() {
|
||||
this.$downLoad("/platform/qsv/survey/exportUserAnswerXlsx", { activityId: this.activityId })
|
||||
// this.$downLoad("/platform/qsv/survey/exportUserAnswerXlsx", { activityId: this.activityId })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,21 +4,24 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="数据列表">
|
||||
<!-- <el-button @click="exportXlsx" icon="el-icon-download" size="small" type="primary" class="mr5">导出xlsx</el-button>-->
|
||||
</table-tool>
|
||||
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder">
|
||||
@@ -57,7 +60,7 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
methods: {
|
||||
exportXlsx() {
|
||||
this.$axios.post("/platform/qsv/survey/exportXlsx", this.pageForm)
|
||||
$.post("/platform/qsv/survey/exportXlsx", this.pageForm)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -63,7 +63,7 @@ const report = {
|
||||
onOpen(activityId) {
|
||||
this.dialogVisible = true
|
||||
this.activityId = activityId
|
||||
this.$axios.post("/platform/qsv/survey/report", { activityId }).then((res) => {
|
||||
$.post("/platform/qsv/survey/report", { activityId }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.subjects = res.data
|
||||
}
|
||||
@@ -72,8 +72,7 @@ const report = {
|
||||
openDetail(subjectId, optionId) {
|
||||
console.log(subjectId)
|
||||
console.log(optionId)
|
||||
this.$axios
|
||||
.post("/platform/qsv/survey/selectOptionUsers", {
|
||||
$.post("/platform/qsv/survey/selectOptionUsers", {
|
||||
activityId: this.activityId,
|
||||
subjectId,
|
||||
optionId
|
||||
|
||||
@@ -0,0 +1,330 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-form .el-select, .el-form .el-date-editor {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-divider {
|
||||
background-color: #1867b0;
|
||||
}
|
||||
|
||||
.el-divider__text {
|
||||
color: #1867b0;
|
||||
}
|
||||
|
||||
.w-e-text-container {
|
||||
height: 250px !important;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row justify="space-between" type="flex">
|
||||
<h3 style="color: rgb(24, 103, 176);">
|
||||
{{id?'信息编辑':'申请加入'}}
|
||||
</h3>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-form :model="formData" :rules="formRules" label-width="100px" ref="AddForm">
|
||||
<el-divider content-position="left">基本信息</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="8" :sm="24">
|
||||
<el-form-item label="姓名">
|
||||
<el-input placeholder="姓名" readonly v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="8" :sm="24">
|
||||
<el-form-item label="所属工会" prop="unionName">
|
||||
<el-input readonly v-model="formData.unionName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="8" :sm="24">
|
||||
<el-form-item label="所属单位" prop="unitName">
|
||||
<el-input readonly v-model="formData.unitName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="8" :sm="24">
|
||||
<el-form-item label="联系方式" prop="mobile">
|
||||
<el-input v-model="formData.mobile"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="8" :sm="24">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-input placeholder="性别" readonly v-model="formData.sex"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="8" :sm="24">
|
||||
<el-form-item label="出生年月" prop="birthday">
|
||||
<el-date-picker
|
||||
placeholder="出生年月"
|
||||
type="date"
|
||||
style="width: 100%"
|
||||
v-model="formData.birthday"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="8" :sm="24">
|
||||
<el-form-item label="籍贯" prop="hometown">
|
||||
<el-input v-model="formData.hometown" placeholder="请填写籍贯"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="8" :sm="24">
|
||||
<el-form-item label="学历" prop="education">
|
||||
<el-input v-model="formData.education" placeholder="请填写学历"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="8" :sm="24">
|
||||
<el-form-item label="身高(cm)" prop="height">
|
||||
<el-input v-model="formData.height" placeholder="请填写身高" type="number"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="8" :sm="24">
|
||||
<el-form-item label="婚姻状况" prop="maritalStatus">
|
||||
<el-select clearable v-model="formData.maritalStatus"
|
||||
filterable remote placeholder="请选择婚姻状况"
|
||||
style="width: 100%">
|
||||
<el-option v-for="o in maritalStatusList"
|
||||
:label="o"
|
||||
:value="o"
|
||||
:key="o"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="8" :sm="24">
|
||||
<el-form-item label="兴趣爱好" prop="hobby">
|
||||
<el-input v-model="formData.hobby" placeholder="请填写兴趣爱好"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="子女情况" prop="childrenSituation">
|
||||
<el-input v-model="formData.childrenSituation" placeholder="请填写子女情况"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="月收入" prop="monthlyIncome">
|
||||
<el-input-number style="width: 100%" v-model="formData.monthlyIncome"
|
||||
placeholder="请填写月收入"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="住房情况" prop="housingSituation">
|
||||
<el-input maxlength="100" v-model="formData.housingSituation"
|
||||
placeholder="请填写住房情况"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item required label="形象照片" prop="photo">
|
||||
<image-upload ref="imageUpload" :height="100"
|
||||
:width="100" :limit="1"
|
||||
:file-type="['png','jpg']"
|
||||
:file-size="10"
|
||||
v-model="formData.photo"></image-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item required label="上传照片" prop="picFiles">
|
||||
<file-upload :files.sync="formData.picFiles" card :max="10"
|
||||
:type="['jpg', 'png', 'jpeg']">
|
||||
<template #el-upload__tip>
|
||||
</template>
|
||||
</file-upload>
|
||||
<div class="el-upload__tip">请上传jpg、png、jpeg格式的图片,最多不超过10张</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-divider content-position="left">联谊信息</el-divider>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="24" :sm="24">
|
||||
<el-form-item label="交友意向" prop="intentionFriends">
|
||||
<el-input type="textarea" :rows="3"
|
||||
placeholder="请填写交友意向"
|
||||
v-model="formData.intentionFriends"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :lg="24" :sm="24">
|
||||
<el-form-item label="个人介绍" prop="personalIntroduction">
|
||||
<el-input type="textarea" :rows="4"
|
||||
placeholder="请填写个人介绍"
|
||||
v-model="formData.personalIntroduction"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-row class="mt10" justify="center" type="flex" v-if="!['8030'].includes(formData.singleState)">
|
||||
<el-button :disabled="disabled" @click="doSave()" style="width: 300px" type="primary">保 存
|
||||
</el-button>
|
||||
<el-button :disabled="disabled" @click="doSubmit()" style="width: 300px" type="primary">提 交
|
||||
</el-button>
|
||||
</el-row>
|
||||
|
||||
<el-row class="mt10" justify="center" type="flex" v-if="['8030'].includes(formData.singleState)">
|
||||
<el-button :disabled="disabled" @click="updateInfo()" style="width: 300px" type="primary">确 定
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
formData: {},
|
||||
id: null,
|
||||
formRules: {
|
||||
mobile: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
birthday: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
maritalStatusList: ["未婚", "离婚", "丧偶"],
|
||||
disabled: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async updateInfo() {
|
||||
const resp = await $.post(loc() + '/doModifyInfo', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
setTimeout(() => {
|
||||
sublime.jumpPagePjax('/platform/single/myApply')
|
||||
}, 1000)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
async doSave() {
|
||||
let postUrl = ''
|
||||
if (this.formData.id) {
|
||||
postUrl = '/platform/single/myApply/doEdit'
|
||||
} else {
|
||||
postUrl = '/platform/single/apply/doSubmit'
|
||||
}
|
||||
this.formData.isSubmit = false
|
||||
const resp = await $.post(postUrl, this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
setTimeout(() => {
|
||||
sublime.jumpPagePjax('/platform/single/myApply')
|
||||
}, 1000)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
async doSubmit() {
|
||||
try {
|
||||
const valid = await this.$refs['AddForm'].validate()
|
||||
if (valid) {
|
||||
let postUrl = ''
|
||||
if (this.formData.id) {
|
||||
postUrl = '/platform/single/myApply/doEdit'
|
||||
} else {
|
||||
postUrl = '/platform/single/apply/doSubmit'
|
||||
}
|
||||
this.formData.isSubmit = true
|
||||
this.formData.singleState = '8010'
|
||||
const resp = await $.post(postUrl, this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
setTimeout(() => {
|
||||
sublime.jumpPagePjax('/platform/single/myApply')
|
||||
}, 1000)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async isEdit() {
|
||||
const id = GetQueryString("id")
|
||||
this.id = id
|
||||
if (id) {
|
||||
await this.findOne(id)
|
||||
}
|
||||
},
|
||||
async findOne(id) {
|
||||
const resp = await $.get(loc() + '/findOneSingle', {id: id})
|
||||
this.formData = resp.data
|
||||
},
|
||||
initFormData() {
|
||||
if (this.id == null) {
|
||||
this.$set(this.formData, 'birthday', "${@shiro.getPrincipalProperty('birthday')}")
|
||||
this.$set(this.formData, 'mobile', "${@shiro.getPrincipalProperty('mobile')}")
|
||||
this.$set(this.formData, 'username', "${@shiro.getPrincipalProperty('username')}")
|
||||
this.$set(this.formData, 'sex', "${@shiro.getPrincipalProperty('sex')}")
|
||||
this.$set(this.formData, 'unitName', "${@shiro.getPrincipalProperty('unit').getName()}")
|
||||
this.$set(this.formData, 'unionName', "${@shiro.getPrincipalProperty('union').getUnionname()}")
|
||||
this.$set(this.formData, 'hometown', "${@shiro.getPrincipalProperty('hometown')}")
|
||||
this.$set(this.formData, 'education', "${@shiro.getPrincipalProperty('education')}")
|
||||
}
|
||||
},
|
||||
async isJoinedBeforeAndIsAudit() {
|
||||
const resp = await $.get(loc() + '/isJoinedBeforeAndIsAudit')
|
||||
if (resp.data.auditUser) {
|
||||
this.notifyWarning("您的申请正在处理中或已加入成功,请勿重复提交!")
|
||||
this.disabled = true;
|
||||
return
|
||||
}
|
||||
if (resp.data.singleUser) {
|
||||
const confirm = await this.$confirm('您之前申请加入过,是否显示以往数据?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
await this.findOne(resp.data.singleUser.id)
|
||||
this.formData.id = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
await this.isEdit()
|
||||
},
|
||||
async created() {
|
||||
this.initFormData();
|
||||
const id = GetQueryString("id")
|
||||
if (!id) {
|
||||
await this.isJoinedBeforeAndIsAudit()
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -12,7 +12,7 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
|
||||
.query-row {
|
||||
height: 70px;
|
||||
height: 55px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@@ -74,96 +74,113 @@ layout("/layouts/platform.html"){
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">性  别:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.sex" style="width: 100%" clearable
|
||||
placeholder="请选择性别">
|
||||
<el-option v-for="sex in sexOptions" :label="sex" :value="sex"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-if="searchMore">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">工会小组:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.unionGroupId" style="width: 100%"
|
||||
filterable
|
||||
clearable
|
||||
@change="getThreeUnits"
|
||||
placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in unionGroups"
|
||||
:key="item.id"
|
||||
:label="item.groupName"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">学  历:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select v-model="pageForm.education" style="width: 100%" placeholder="请选择学历" code="Education"></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">组成科室:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.threeUnitId" style="width: 100%" filterable
|
||||
clearable
|
||||
placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in threeUnits"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="search-item">
|
||||
<div class="search-item-label">人员类型:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select v-model="pageForm.personType" style="width: 100%" clearable
|
||||
placeholder="人员类型"
|
||||
code="PERSON_TYPE"></dict-select>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">单身状况:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.maritalStatus" style="width: 100%" clearable
|
||||
placeholder="请选择单身状况">
|
||||
<el-option v-for="item in maritalStatusOptions" :label="item" :value="item"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">在职状态:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select v-model="pageForm.userState" style="width: 100%" clearable
|
||||
placeholder="在职状态"
|
||||
code="USER_STATE"></dict-select>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">性  别:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.sex" style="width: 100%" clearable
|
||||
placeholder="请选择">
|
||||
<el-option v-for="sex in sexOptions" :label="sex" :value="sex"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <template v-if="searchMore">-->
|
||||
<!-- <div class="search-item">-->
|
||||
<!-- <div class="search-item-label">工会小组:</div>-->
|
||||
<!-- <div class="search-item-option">-->
|
||||
<!-- <el-select v-model="pageForm.unionGroupId" style="width: 100%"-->
|
||||
<!-- filterable-->
|
||||
<!-- clearable-->
|
||||
<!-- @change="getThreeUnits"-->
|
||||
<!-- placeholder="请选择">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in unionGroups"-->
|
||||
<!-- :key="item.id"-->
|
||||
<!-- :label="item.groupName"-->
|
||||
<!-- :value="item.id">-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">职  务:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.position"
|
||||
@keyup.enter.native="doSearch">
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="search-item">-->
|
||||
<!-- <div class="search-item-label">组成科室:</div>-->
|
||||
<!-- <div class="search-item-option">-->
|
||||
<!-- <el-select v-model="pageForm.threeUnitId" style="width: 100%" filterable-->
|
||||
<!-- clearable-->
|
||||
<!-- placeholder="请选择">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in threeUnits"-->
|
||||
<!-- :key="item.id"-->
|
||||
<!-- :label="item.name"-->
|
||||
<!-- :value="item.id">-->
|
||||
<!-- </el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <!–<div class="search-item">-->
|
||||
<!-- <div class="search-item-label">人员类型:</div>-->
|
||||
<!-- <div class="search-item-option">-->
|
||||
<!-- <dict-select v-model="pageForm.personType" style="width: 100%" clearable-->
|
||||
<!-- placeholder="人员类型"-->
|
||||
<!-- code="UserType"></dict-select>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">职  称:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.jobTitle"
|
||||
@keyup.enter.native="doSearch">
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="search-item">
|
||||
<div class="search-item-label">会员状态:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select v-model="pageForm.memberStatus" style="width: 100%" clearable
|
||||
placeholder="会员状态" code="memberStatusText"></dict-select>
|
||||
</div>
|
||||
</div>-->
|
||||
</template>
|
||||
<!-- <div class="search-item">-->
|
||||
<!-- <div class="search-item-label">在职状态:</div>-->
|
||||
<!-- <div class="search-item-option">-->
|
||||
<!-- <dict-select v-model="pageForm.userState" style="width: 100%" clearable-->
|
||||
<!-- placeholder="在职状态"-->
|
||||
<!-- code="UserState"></dict-select>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>–>-->
|
||||
|
||||
<!-- <div class="search-item">-->
|
||||
<!-- <div class="search-item-label">职  务:</div>-->
|
||||
<!-- <div class="search-item-option">-->
|
||||
<!-- <el-input placeholder="请输入内容" clearable v-model="pageForm.position"-->
|
||||
<!-- @keyup.enter.native="doSearch">-->
|
||||
<!-- </el-input>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <div class="search-item">-->
|
||||
<!-- <div class="search-item-label">职  称:</div>-->
|
||||
<!-- <div class="search-item-option">-->
|
||||
<!-- <el-input placeholder="请输入内容" clearable v-model="pageForm.jobTitle"-->
|
||||
<!-- @keyup.enter.native="doSearch">-->
|
||||
<!-- </el-input>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <!– <div class="search-item">-->
|
||||
<!-- <div class="search-item-label">会员状态:</div>-->
|
||||
<!-- <div class="search-item-option">-->
|
||||
<!-- <dict-select v-model="pageForm.memberStatus" style="width: 100%" clearable-->
|
||||
<!-- placeholder="会员状态" code="memberStatusText"></dict-select>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>–>-->
|
||||
<!-- </template>-->
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||||
<more v-model="searchMore"></more>
|
||||
<!-- <more v-model="searchMore"></more>-->
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -206,6 +223,26 @@ layout("/layouts/platform.html"){
|
||||
</el-link>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row type="flex" align="middle" class="query-row">
|
||||
<el-col class="query-row-title">年龄范围:</el-col>
|
||||
<el-col class="query-row-content">
|
||||
<el-row type="flex" style="align-items: center">
|
||||
<el-col :span="15">
|
||||
<el-slider
|
||||
v-model="pageForm.age"
|
||||
range
|
||||
show-stops
|
||||
:max="100">
|
||||
</el-slider>
|
||||
</el-col>
|
||||
<el-col :span="9" class="pl20">
|
||||
当前范围:{{ pageForm.age }}
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!--<el-row type="flex" align="middle" class="query-row">
|
||||
<el-col class="query-row-title">模糊查询:</el-col>
|
||||
<el-col class="query-row-content">
|
||||
@@ -217,8 +254,16 @@ layout("/layouts/platform.html"){
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="教工列表" :app="this">
|
||||
<template #func><!--el-icon-printer-->
|
||||
<el-button type="primary" size="small" icon="el-icon-upload2" @click="openImport">单身教工导入</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-download" @click="exportSingle">单身教工导出</el-button>
|
||||
|
||||
<el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isJoin">
|
||||
<el-radio-button :label="true">加入</el-radio-button>
|
||||
<el-radio-button :label="false">退出</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<el-button type="primary" size="small" icon="el-icon-upload2" @click="openImport">单身教工导入
|
||||
</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-download" @click="exportSingle">单身教工导出
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
@@ -260,10 +305,7 @@ layout("/layouts/platform.html"){
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
|
||||
:command="{type:'edit',data:scope.row}">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" :command="{type:'delete',data:scope.row}">
|
||||
:command="{type:'delete',data:scope.row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
@@ -276,119 +318,41 @@ layout("/layouts/platform.html"){
|
||||
|
||||
</template>
|
||||
|
||||
<template #edit_func>
|
||||
<el-button type="primary" @click="$refs.member.save()">提交</el-button>
|
||||
<template #view>
|
||||
<single-info ref="viewInfo"></single-info>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<member ref="member" :id="userId" @save="afterEdit"></member>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
|
||||
<el-tabs v-model="active">
|
||||
<el-tab-pane label="个人信息" name="info">
|
||||
<member ref="memberInfo" :id="userId" view></member>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="变更记录" name="change">
|
||||
<mem-change-records :userid="userId"></mem-change-records>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<file-import ref="viewImport" :temp_url="tempUrl"
|
||||
:post_url="postUrl" :is_show_radio="isShowRadio"></file-import>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
|
||||
<el-dialog
|
||||
title="导入"
|
||||
:visible.sync="importVisible"
|
||||
:close-on-click-modal="false"
|
||||
width="50%">
|
||||
<el-timeline>
|
||||
<el-timeline-item timestamp="下载模板" placement="top">
|
||||
<el-card>
|
||||
<el-button size="medium" type=""
|
||||
@click="location.href='/platform/single/list/downloadImport'"
|
||||
icon="el-icon-download">下载模板
|
||||
</el-button>
|
||||
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item timestamp="上传文件" placement="top">
|
||||
<el-card>
|
||||
<el-form>
|
||||
<el-form-item label="请选择更新模式">
|
||||
<el-radio-group v-model="importData.isFlag">
|
||||
<el-radio-button label="true">清空更新</el-radio-button>
|
||||
<el-radio-button label="false">追加</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-upload
|
||||
name="file"
|
||||
ref="upload"
|
||||
:on-remove="(file, fileList) => {
|
||||
importData.fileList = fileHandleRemove(file, fileList);
|
||||
importResult={
|
||||
errorCount:0,
|
||||
successCount:0,
|
||||
totalCount:0,
|
||||
errorList:[]
|
||||
}
|
||||
}"
|
||||
:on-change="(file, fileList) => {
|
||||
importData.fileList = fileHandleChange(file, fileList,{type:['xls','xlsx']})
|
||||
}"
|
||||
:auto-upload="false"
|
||||
:limit="1"
|
||||
:file-list="importData.fileList">
|
||||
<el-button size="medium" type="" icon="el-icon-upload"
|
||||
style="width: 200px">选择文件
|
||||
</el-button>
|
||||
<div class="el-upload__tip" slot="tip" style="color: #F56C6C">
|
||||
只能上传 xls/xlsx 文件
|
||||
</div>
|
||||
</el-upload>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item placement="top" timestamp="导入结果">
|
||||
<el-card shadow="never">
|
||||
<p>总记录数:{{errorInfoData.totalCount}}</p>
|
||||
<p>成功数:<span class="text-success">{{errorInfoData.successCount}}</span></p>
|
||||
<p>错误数:<span class="text-danger">{{errorInfoData.errorCount}}</span></p>
|
||||
<el-link @click="exportErrors" type="primary" v-if="errorInfoData.errorCount>0">下载错误记录
|
||||
</el-link>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="importVisible = false" :disabled="importLoading">取 消</el-button>
|
||||
<el-button type="primary" @click="doImport" :loading="importLoading">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
|
||||
<!--<script src="https://cdn.staticfile.org/xlsx/0.18.5/xlsx.full.min.js"></script>-->
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el:'#app',
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data(){
|
||||
return{
|
||||
data() {
|
||||
return {
|
||||
tempUrl:'/platform/single/list/downloadImport',
|
||||
postUrl:'/platform/single/list/doImport',
|
||||
isShowRadio:false,
|
||||
labelYear: "",
|
||||
archiveDialogVisible: false,
|
||||
archiveLoading: false,
|
||||
sexOptions: ['男', '女'],
|
||||
|
||||
maritalStatusOptions:['未婚','离异','丧偶'],
|
||||
submitLoading: false,
|
||||
pageForm: {
|
||||
personTypes: [],
|
||||
userStates: [],
|
||||
age: [0, 0],
|
||||
searchName: "username",
|
||||
isJoin:true,
|
||||
},
|
||||
|
||||
userId: "",
|
||||
@@ -401,21 +365,14 @@ layout("/layouts/platform.html"){
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'birthday', label: '出生年月', sortable: true},
|
||||
{prop: 'mobile', label: '联系电话'},
|
||||
{prop: 'idcard', label: '身份证号', width: 170},
|
||||
{prop: 'position', label: '职务', sortable: true, checked: 0},
|
||||
{prop: 'jobTitle', label: '职称', sortable: true, checked: 0},
|
||||
{prop: 'personType', label: '人员类型', sortable: true},
|
||||
{prop: 'userState', label: '在职状态', sortable: true},
|
||||
{prop: 'personType', label: '人员类型', sortable: true, checked: 0},
|
||||
{prop: 'userState', label: '在职状态', sortable: true, checked: 0},
|
||||
{prop: 'unionname', label: '所属工会', sortable: true},
|
||||
{prop: 'unitname', label: '所属单位', sortable: true},
|
||||
// {prop: 'threeUnitName', label: '所在科室', sortable: true},
|
||||
// {prop: 'unionGroupName', label: '工会小组', sortable: true},
|
||||
{prop: 'campusName', label: '所属校区', sortable: true, checked: 0},
|
||||
{prop: 'marriage', label: '婚否', checked: 0},
|
||||
{prop: 'education', label: '学历', checked: 0},
|
||||
{prop: 'hometown', label: '籍贯', checked: 0},
|
||||
{prop: 'nation', label: '民族', checked: 0},
|
||||
// {prop: 'memberNumber', label: '会员号', checked: 0},
|
||||
{prop: 'education', label: '学历', sortable: true},
|
||||
{prop: 'maritalStatus', label: '单身状况', sortable: true},
|
||||
{prop: 'threeUnitName', label: '所在科室', sortable: true, checked: 0},
|
||||
{prop: 'unionGroupName', label: '工会小组', sortable: true, checked: 0},
|
||||
],
|
||||
personTypeOptions: [],
|
||||
userStateOptions: [],
|
||||
@@ -429,34 +386,17 @@ layout("/layouts/platform.html"){
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
importVisible: false,
|
||||
importLoading: false,
|
||||
importData: {
|
||||
fileList: [],
|
||||
isFlag: false
|
||||
},
|
||||
errorInfoData: {
|
||||
totalCount: 0,
|
||||
successCount: 0,
|
||||
errorCount: 0,
|
||||
errorList: 0,
|
||||
},
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
openImport(){
|
||||
this.importData = {
|
||||
fileList: [],
|
||||
isFlag: true
|
||||
}
|
||||
this.errorInfoData = {
|
||||
totalCount: 0,
|
||||
successCount: 0,
|
||||
errorCount: 0,
|
||||
errorList: 0,
|
||||
}
|
||||
this.importVisible = true;
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
|
||||
'single-info': httpVueLoader('/components/singleuser/SingUserInfo.vue'),
|
||||
'file-import': httpVueLoader('/components/plugins/FileImport.vue')
|
||||
},
|
||||
methods: {
|
||||
openImport() {
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
checkUserStateType(state) {
|
||||
let idx = this.pageForm.userStates.indexOf(state)
|
||||
@@ -495,9 +435,10 @@ layout("/layouts/platform.html"){
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" === a) {//确认后再执行
|
||||
const resp = await $.post(loc() + "/delete", {userId});
|
||||
const resp = await $.post("/platform/single/myApply/removeById", {userId});
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
@@ -505,26 +446,20 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
});
|
||||
},
|
||||
openEdit(userId) {
|
||||
this.userId = userId
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
afterEdit() {
|
||||
this.userId = ''
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
},
|
||||
openView(userId) {
|
||||
this.active = 'info'
|
||||
this.userId = userId
|
||||
openView(id) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.viewInfo.activeName = '1'
|
||||
this.$refs.viewInfo.openView(id)
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data.id)
|
||||
} else if (type == 'edit') {
|
||||
this.openEdit(data.id)
|
||||
} else if (type == 'delete') {
|
||||
this.doDelete(data.id)
|
||||
}
|
||||
@@ -550,6 +485,7 @@ layout("/layouts/platform.html"){
|
||||
const pageForm = clone(this.pageForm)
|
||||
pageForm.personTypes = JSON.stringify(pageForm.personTypes)
|
||||
pageForm.userStates = JSON.stringify(pageForm.userStates)
|
||||
pageForm.age = JSON.stringify(pageForm.age)
|
||||
|
||||
$.post(loc() + "/pageData", pageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
@@ -562,72 +498,6 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
doImport() {
|
||||
if (this.importData.fileList.length === 0) {
|
||||
this.notifyWarning("请选择文件!")
|
||||
return
|
||||
}
|
||||
const data = new FormData();
|
||||
data.append("isFlag", this.importData.isFlag)
|
||||
this.importData.fileList.forEach((val) => {
|
||||
data.append("file", val.raw, val.raw.name);
|
||||
});
|
||||
this.importLoading = true
|
||||
$.ajax({
|
||||
url: loc() + "/doImport",
|
||||
type: "post",
|
||||
data: data,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: (data) => {
|
||||
this.importLoading = false
|
||||
if (data.code === 0 && data.data === null) {
|
||||
this.pageData();
|
||||
this.notifySuccess("导入成功")
|
||||
this.importVisible = false
|
||||
} else {
|
||||
this.notifyWarning("导入失败")
|
||||
this.errorInfoData = data.data
|
||||
}
|
||||
},
|
||||
error: (data) => {
|
||||
this.notifyWarning("导入失败")
|
||||
this.importLoading = false
|
||||
}
|
||||
});
|
||||
},
|
||||
exportErrors() {
|
||||
const data = this.errorInfoData.errorList
|
||||
|
||||
// 创建工作簿
|
||||
const workbook = XLSX.utils.book_new();
|
||||
|
||||
// 创建工作表
|
||||
const worksheet = XLSX.utils.json_to_sheet(data);
|
||||
|
||||
// 将工作表添加到工作簿
|
||||
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||
|
||||
// 将工作簿转换为二进制对象
|
||||
const excelBuffer = XLSX.write(workbook, {bookType: 'xlsx', type: 'array'});
|
||||
|
||||
// 将二进制对象转换为Blob对象
|
||||
const blob = new Blob([excelBuffer], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
|
||||
|
||||
// 创建下载链接并设置相关属性
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = '错误记录.xlsx';
|
||||
|
||||
// 模拟点击下载链接
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
// 清理下载链接
|
||||
document.body.removeChild(link);
|
||||
window.URL.revokeObjectURL(url);
|
||||
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
@@ -638,16 +508,9 @@ layout("/layouts/platform.html"){
|
||||
this.$set(this.pageForm, 'unionId', this.unions ? this.unions[0].id : null)
|
||||
this.flushUnits()
|
||||
}
|
||||
this.personTypeOptions = await getDictOptions("PERSON_TYPE")
|
||||
this.userStateOptions = await getDictOptions("USER_STATE")
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.3'),
|
||||
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
|
||||
'mem-change-records': httpVueLoader('/components/member/MemChangeRecords.vue?v=1.0.2'),
|
||||
'member-cnd': httpVueLoader('/components/member/MemberCnd.vue'),
|
||||
},
|
||||
this.personTypeOptions = await getDictOptions("UserType")
|
||||
this.userStateOptions = await getDictOptions("UserState")
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -0,0 +1,297 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<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-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select placeholder="所属工会" v-model="pageForm.unionId"
|
||||
style="width: 100%;"
|
||||
clearable="true"
|
||||
@change="flushUnits" @clear="flushUnits"
|
||||
filterable="true">
|
||||
<el-option v-for="item in unions" :label="item.unionname"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属单位:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select placeholder="所属单位" v-model="pageForm.unitId"
|
||||
style="width: 100%;"
|
||||
@change="getThreeUnits"
|
||||
clearable="true"
|
||||
filterable="true">
|
||||
<el-option v-for="item in units" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-if="searchMore">
|
||||
<template v-if="isThreeUnit">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">工会小组:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.unionGroupId" style="width: 100%"
|
||||
filterable
|
||||
clearable
|
||||
@change="getThreeUnits"
|
||||
placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in unionGroups"
|
||||
:key="item.id"
|
||||
:label="item.groupName"
|
||||
:value="item.id">
|
||||
</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.threeUnitId" style="width: 100%"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in threeUnits"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">人员类型:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select v-model="pageForm.personType" style="width: 100%"
|
||||
clearable
|
||||
placeholder="人员类型"
|
||||
code="UserType"></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">在职状态:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select v-model="pageForm.userState" style="width: 100%"
|
||||
clearable
|
||||
placeholder="在职状态"
|
||||
code="UserState"></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索
|
||||
</el-button>
|
||||
<more v-model="searchMore"></more>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="申请列表" :app="this">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isJoin">
|
||||
<el-radio-button :label="true">加入</el-radio-button>
|
||||
<el-radio-button :label="false">退出</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table ref="table" :data="tableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder"
|
||||
v-loading="tableLoading" :size="tableSize" class="vi-table">
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
:index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
show-overflow-tooltip
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="userOnline" align="center" header-align="center" label="操作" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button plain size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<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 v-if="['8000','8030'].includes(scope.row.singleState)"
|
||||
:command="{type:'modify',data:scope.row}">
|
||||
编辑
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="['8030'].includes(scope.row.singleState)"
|
||||
:command="{type:'exitSingle',data:scope.row}">
|
||||
退出
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="['8000'].includes(scope.row.singleState)"
|
||||
:command="{type:'remove',data:scope.row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="!['8000'].includes(scope.row.singleState) && ${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
|
||||
:command="{type:'remove',data:scope.row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<single-info ref="viewInfo"></single-info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
isThreeUnit: false,
|
||||
pageForm:{
|
||||
isJoin:true,
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'loginname', label: '工号', sortable: true},
|
||||
{prop: 'username', label: '姓名', sortable: true},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'mobile', label: '联系电话'},
|
||||
{prop: 'personType', label: '人员类型', sortable: true},
|
||||
{prop: 'userState', label: '在职状态', sortable: true},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'maritalStatus', label: '婚姻状况'},
|
||||
{prop: 'stateName', label: '申请状态'},
|
||||
],
|
||||
unions: [],
|
||||
units: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
|
||||
'single-info': httpVueLoader('/components/singleuser/SingUserInfo.vue')
|
||||
},
|
||||
methods: {
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type === 'view') {
|
||||
this.openView(data.id)
|
||||
} else if (type === 'modify') {
|
||||
this.openEdit(data.id)
|
||||
} else if (type === 'remove') {
|
||||
this.doDelete(data.id)
|
||||
} else if (type === 'exitSingle'){
|
||||
this.exitSingle(data.id)
|
||||
}
|
||||
},
|
||||
openView(id){
|
||||
this.$refs.guava.view()
|
||||
this.$refs.viewInfo.activeName = '1'
|
||||
this.$refs.viewInfo.openView(id)
|
||||
},
|
||||
openEdit(id){
|
||||
sublime.jumpPagePjax('/platform/single/apply?id=' + id)
|
||||
},
|
||||
async doDelete(id){
|
||||
const resp = await $.get(loc() + '/removeById',{id:id})
|
||||
if (resp.code === 0){
|
||||
this.pageData();
|
||||
this.notifySuccess(resp.msg)
|
||||
}else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
async exitSingle(id){
|
||||
const confirm = await this.$confirm('您确定要【退出】吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const resp = await $.get(loc() + '/exitSingle',{id:id})
|
||||
if (resp.code === 0){
|
||||
this.pageData();
|
||||
this.notifySuccess(resp.msg)
|
||||
}else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.$set(this.pageForm, "unionGroupId", null)
|
||||
this.$set(this.pageForm, "threeUnitId", null)
|
||||
this.units = []
|
||||
this.unionGroups = []
|
||||
this.threeUnits = []
|
||||
if (this.pageForm.unionId) {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
this.unionGroups = await unionGroupsByUnionId(this.pageForm.unionId)
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.isThreeUnit = await getConfigKey('isThreeUnit') === 'true'
|
||||
if (this.isThreeUnit) {
|
||||
this.tableColumns.forEach(v => {
|
||||
if (["threeUnitName", "unionGroupName"].includes(v.prop)) {
|
||||
v.checked = 1
|
||||
}
|
||||
})
|
||||
}
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
|
||||
this.unions = await getUnions(null, false)
|
||||
} else {
|
||||
this.unions = await getUnions(null, true)
|
||||
this.$set(this.pageForm, 'unionId', this.unions ? this.unions[0].id : null)
|
||||
this.flushUnits()
|
||||
}
|
||||
this.pageData();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,389 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名工号:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.searchKeyword">
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="flushUnits" @clear="flushUnits"
|
||||
clearable="true"
|
||||
filterable="true"
|
||||
placeholder="所属工会" style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.unionname" :value="item.id"
|
||||
v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属单位:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="getThreeUnits" clearable="true"
|
||||
filterable="true"
|
||||
placeholder="所属单位"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.unitId">
|
||||
<el-option :label="item.name" :value="item.id"
|
||||
v-for="item in units"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-if="searchMore">
|
||||
<template v-if="isThreeUnit">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">工会小组:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="getThreeUnits" clearable
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.unionGroupId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.groupName"
|
||||
:value="item.id"
|
||||
v-for="item in unionGroups">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">组成科室:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable filterable
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.threeUnitId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in threeUnits">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">人员类型:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select clearable code="UserType"
|
||||
placeholder="人员类型"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.personType"></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">在职状态:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select clearable code="UserState"
|
||||
placeholder="在职状态"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.userState"></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索
|
||||
</el-button>
|
||||
<more v-model="searchMore"></more>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="申请列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" class="mr10" size="small"
|
||||
v-model="pageForm.isJoin">
|
||||
<el-radio-button :label="true">加入({{auditNum.joinCount}})
|
||||
</el-radio-button>
|
||||
<el-radio-button :label="false">退出({{auditNum.exitCount}})
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<el-radio-group @change="doSearch" class="mr10" size="small"
|
||||
v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" class="vi-table"
|
||||
ref="table"
|
||||
row-key="id" style="width: 100%" v-loading="tableLoading">
|
||||
<el-table-column :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"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" header-align="center"
|
||||
label="操作" prop="userOnline">
|
||||
<template scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button plain size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<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:'audit',data:scope.row}"
|
||||
v-if="['8020','8050'].includes(scope.row.singleState)">
|
||||
审核
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
:command="{type:'rollback',data:scope.row}"
|
||||
v-if="['8025','8030','8055','8060'].includes(scope.row.singleState)">
|
||||
撤回
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<single-info ref="viewInfo"></single-info>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<single-info ref="auditInfo">
|
||||
<template #handle>
|
||||
<el-tab-pane label="校工会审核" name="schoolAudit">
|
||||
<el-form :model="formData" :rules="formRules" label-position="right"
|
||||
label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
value="${@shiro.getPrincipalProperty('username')}"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.auditTime"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="审核意见" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4"
|
||||
type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item prop="auditSign" label="审核签字">-->
|
||||
<!-- <sign :qz.sync="formData.auditSign"></sign>-->
|
||||
<!-- </el-form-item>-->
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button @click="doReview(0)" type="danger">
|
||||
拒绝
|
||||
</el-button>
|
||||
<el-button @click="doReview(1)" type="primary">
|
||||
通过
|
||||
</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</template>
|
||||
</single-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
id: '',
|
||||
isThreeUnit: false,
|
||||
pageForm: {
|
||||
isJoin: true,
|
||||
isAudit: false,
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'loginname', label: '工号', sortable: true},
|
||||
{prop: 'username', label: '姓名', sortable: true},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'mobile', label: '联系电话'},
|
||||
{prop: 'personType', label: '人员类型', sortable: true, checked: 0},
|
||||
{prop: 'userState', label: '在职状态', sortable: true, checked: 0},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'education', label: '学历'},
|
||||
{prop: 'maritalStatus', label: '单身状况'},
|
||||
{prop: 'stateName', label: '申请状态'},
|
||||
],
|
||||
unions: [],
|
||||
units: [],
|
||||
formRules: {
|
||||
// auditSign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
auditNum: {}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
|
||||
'single-info': httpVueLoader('/components/singleuser/SingUserInfo.vue')
|
||||
},
|
||||
methods: {
|
||||
doReview(row) {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
this.$confirm('您确定要提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const {code, msg} = await $.post(loc() + '/doAudit', {
|
||||
audit: JSON.stringify(this.formData),
|
||||
id: this.id,
|
||||
isPass: row,
|
||||
isJoin: this.pageForm.isJoin
|
||||
})
|
||||
if (code === 0) {
|
||||
this.pageData()
|
||||
await this.getAuditNum();
|
||||
this.notifySuccess(msg)
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.notifyWarning(msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
this.id = data.id;
|
||||
if (type === 'view') {
|
||||
this.openView(data.id)
|
||||
} else if (type === 'audit') {
|
||||
this.openAudit(data.id)
|
||||
} else if (type === 'rollback') {
|
||||
this.doRollBack(data.id)
|
||||
}
|
||||
},
|
||||
openView(id) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.viewInfo.openView(id)
|
||||
},
|
||||
openAudit(id) {
|
||||
this.formData = {}
|
||||
this.$set(this.formData, 'auditTime', moment().format('YYYY-MM-DD'))
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.auditInfo.activeName = 'schoolAudit'
|
||||
this.$refs.auditInfo.openView(id)
|
||||
},
|
||||
async doRollBack(id) {
|
||||
const confirm = await this.$confirm('确定要撤回该记录吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if ("confirm" === confirm) {
|
||||
const resp = await $.get(loc() + '/doRollBack', {
|
||||
id: id,
|
||||
isJoin: this.pageForm.isJoin
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.pageData();
|
||||
await this.getAuditNum();
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
async doSearch() {
|
||||
this.pageData();
|
||||
await this.getAuditNum();
|
||||
},
|
||||
async getAuditNum() {
|
||||
const resp = await $.get(loc() + '/getAuditNum', {
|
||||
isAudit: this.pageForm.isAudit,
|
||||
unionId: this.pageForm.unionId
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.auditNum = resp.data
|
||||
}
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.$set(this.pageForm, "unionGroupId", null)
|
||||
this.$set(this.pageForm, "threeUnitId", null)
|
||||
this.units = []
|
||||
this.unionGroups = []
|
||||
this.threeUnits = []
|
||||
if (this.pageForm.unionId) {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
this.unionGroups = await unionGroupsByUnionId(this.pageForm.unionId)
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.isThreeUnit = await getConfigKey('isThreeUnit') === 'true'
|
||||
if (this.isThreeUnit) {
|
||||
this.tableColumns.forEach(v => {
|
||||
if (["threeUnitName", "unionGroupName"].includes(v.prop)) {
|
||||
v.checked = 1
|
||||
}
|
||||
})
|
||||
}
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
|
||||
this.unions = await getUnions(null, false)
|
||||
} else {
|
||||
this.unions = await getUnions(null, true)
|
||||
this.$set(this.pageForm, 'unionId', this.unions ? this.unions[0].id : null)
|
||||
this.flushUnits()
|
||||
}
|
||||
this.pageData();
|
||||
await this.getAuditNum()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -87,13 +87,13 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column v-if="searchType==='按分工会统计'" align="center" header-align="center" label="分工会"
|
||||
width="220px">
|
||||
<template scope="{row}">
|
||||
<!--{{isDisPlayCode?'('+row.unionCode+')':null}}-->{{row.unionName}}
|
||||
<!--{{isDisPlayCode?'('+row.unionCode+')':null}}-->{{row.unName}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="searchType==='按单位统计'" align="center" header-align="center" label="单位"
|
||||
width="220px">
|
||||
<template scope="{row}">
|
||||
<!--{{isDisPlayCode?'('+row.unitCode+')':null}}-->{{row.unitName}}
|
||||
<!--{{isDisPlayCode?'('+row.unitCode+')':null}}-->{{row.unName}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="totalNumber" label="总人数" align="center" sortable></el-table-column>
|
||||
@@ -187,7 +187,7 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.personTypeOptions = await getDictOptions("PERSON_TYPE")
|
||||
this.personTypeOptions = await getDictOptions("UserType")
|
||||
this.unions = await getUnions(null)
|
||||
this.units = await getUnits(null)
|
||||
this.pageData();
|
||||
|
||||
@@ -0,0 +1,389 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名工号:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.searchKeyword">
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="flushUnits" @clear="flushUnits"
|
||||
clearable="true"
|
||||
filterable="true"
|
||||
placeholder="所属工会" style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.unionname" :value="item.id"
|
||||
v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属单位:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="getThreeUnits" clearable="true"
|
||||
filterable="true"
|
||||
placeholder="所属单位"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.unitId">
|
||||
<el-option :label="item.name" :value="item.id"
|
||||
v-for="item in units"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-if="searchMore">
|
||||
<template v-if="isThreeUnit">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">工会小组:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="getThreeUnits" clearable
|
||||
filterable
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.unionGroupId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.groupName"
|
||||
:value="item.id"
|
||||
v-for="item in unionGroups">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">组成科室:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable filterable
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.threeUnitId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in threeUnits">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">人员类型:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select clearable code="UserType"
|
||||
placeholder="人员类型"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.personType"></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">在职状态:</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select clearable code="UserState"
|
||||
placeholder="在职状态"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.userState"></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索
|
||||
</el-button>
|
||||
<more v-model="searchMore"></more>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="申请列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" class="mr10" size="small"
|
||||
v-model="pageForm.isJoin">
|
||||
<el-radio-button :label="true">加入({{auditNum.joinCount}})
|
||||
</el-radio-button>
|
||||
<el-radio-button :label="false">退出({{auditNum.exitCount}})
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<el-radio-group @change="doSearch" class="mr10" size="small"
|
||||
v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" class="vi-table"
|
||||
ref="table"
|
||||
row-key="id" style="width: 100%" v-loading="tableLoading">
|
||||
<el-table-column :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"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" header-align="center"
|
||||
label="操作" prop="userOnline">
|
||||
<template scope="scope">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button plain size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<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:'audit',data:scope.row}"
|
||||
v-if="['8010','8040'].includes(scope.row.singleState)">
|
||||
审核
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
:command="{type:'rollback',data:scope.row}"
|
||||
v-if="['8015','8020','8045','8050'].includes(scope.row.singleState)">
|
||||
撤回
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<single-info ref="viewInfo"></single-info>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<single-info ref="auditInfo">
|
||||
<template #handle>
|
||||
<el-tab-pane label="分工会审核" name="unionAudit">
|
||||
<el-form :model="formData" :rules="formRules" label-position="right"
|
||||
label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
value="${@shiro.getPrincipalProperty('username')}"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.auditTime"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="审核意见" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4"
|
||||
type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item prop="auditSign" label="审核签字">-->
|
||||
<!-- <sign :qz.sync="formData.auditSign"></sign>-->
|
||||
<!-- </el-form-item>-->
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button @click="doReview(0)" type="danger">
|
||||
拒绝
|
||||
</el-button>
|
||||
<el-button @click="doReview(1)" type="primary">
|
||||
通过
|
||||
</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</template>
|
||||
</single-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
id: '',
|
||||
isThreeUnit: false,
|
||||
pageForm: {
|
||||
isJoin: true,
|
||||
isAudit: false,
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'loginname', label: '工号', sortable: true},
|
||||
{prop: 'username', label: '姓名', sortable: true},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'mobile', label: '联系电话'},
|
||||
{prop: 'personType', label: '人员类型', sortable: true, checked: 0},
|
||||
{prop: 'userState', label: '在职状态', sortable: true, checked: 0},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'education', label: '学历'},
|
||||
{prop: 'maritalStatus', label: '单身状况'},
|
||||
{prop: 'stateName', label: '申请状态'},
|
||||
],
|
||||
unions: [],
|
||||
units: [],
|
||||
formRules: {
|
||||
// auditSign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
auditNum: {}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
|
||||
'single-info': httpVueLoader('/components/singleuser/SingUserInfo.vue')
|
||||
},
|
||||
methods: {
|
||||
doReview(row) {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
this.$confirm('您确定要提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const {code, msg} = await $.post(loc() + '/doAudit', {
|
||||
audit: JSON.stringify(this.formData),
|
||||
id: this.id,
|
||||
isPass: row,
|
||||
isJoin: this.pageForm.isJoin
|
||||
})
|
||||
if (code === 0) {
|
||||
this.pageData()
|
||||
await this.getAuditNum();
|
||||
this.notifySuccess(msg)
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.notifyWarning(msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
this.id = data.id;
|
||||
if (type === 'view') {
|
||||
this.openView(data.id)
|
||||
} else if (type === 'audit') {
|
||||
this.openAudit(data.id)
|
||||
} else if (type === 'rollback') {
|
||||
this.doRollBack(data.id)
|
||||
}
|
||||
},
|
||||
openView(id) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.viewInfo.openView(id)
|
||||
},
|
||||
openAudit(id) {
|
||||
this.formData = {}
|
||||
this.$set(this.formData, 'auditTime', moment().format('YYYY-MM-DD'))
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.auditInfo.activeName = 'unionAudit'
|
||||
this.$refs.auditInfo.openView(id)
|
||||
},
|
||||
async doRollBack(id) {
|
||||
const confirm = await this.$confirm('确定要撤回该记录吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if ("confirm" === confirm) {
|
||||
const resp = await $.get(loc() + '/doRollBack', {
|
||||
id: id,
|
||||
isJoin: this.pageForm.isJoin
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.pageData();
|
||||
await this.getAuditNum();
|
||||
this.notifySuccess(resp.msg)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
async doSearch() {
|
||||
this.pageData();
|
||||
await this.getAuditNum();
|
||||
},
|
||||
async getAuditNum() {
|
||||
const resp = await $.get(loc() + '/getAuditNum', {
|
||||
isAudit: this.pageForm.isAudit,
|
||||
unionId: this.pageForm.unionId
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.auditNum = resp.data
|
||||
}
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.$set(this.pageForm, "unionGroupId", null)
|
||||
this.$set(this.pageForm, "threeUnitId", null)
|
||||
this.units = []
|
||||
this.unionGroups = []
|
||||
this.threeUnits = []
|
||||
if (this.pageForm.unionId) {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
this.unionGroups = await unionGroupsByUnionId(this.pageForm.unionId)
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.isThreeUnit = await getConfigKey('isThreeUnit') === 'true'
|
||||
if (this.isThreeUnit) {
|
||||
this.tableColumns.forEach(v => {
|
||||
if (["threeUnitName", "unionGroupName"].includes(v.prop)) {
|
||||
v.checked = 1
|
||||
}
|
||||
})
|
||||
}
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
|
||||
this.unions = await getUnions(null, false)
|
||||
} else {
|
||||
this.unions = await getUnions(null, true)
|
||||
this.$set(this.pageForm, 'unionId', this.unions ? this.unions[0].id : null)
|
||||
this.flushUnits()
|
||||
}
|
||||
this.pageData();
|
||||
await this.getAuditNum();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -50,13 +50,19 @@ layout("/layouts/platform.html"){
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="变更记录(默认查询当天变更记录,如需查询更多变更记录,请选择上方【变更日期】后进行搜索)">
|
||||
<template #func>
|
||||
<el-radio-group @change="search" class="mr5" size="small" v-model="pageForm.isOperate">
|
||||
<el-button type="primary" style="margin-right: 10px" size="small" @click="doBatchChange">批量确认</el-button>
|
||||
|
||||
<el-radio-group @change="search" class="mr5" size="small"
|
||||
v-model="pageForm.isOperate">
|
||||
<el-radio-button label="true">已操作</el-radio-button>
|
||||
<el-radio-button label="false">未操作</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id" style="width: 100%">
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table"
|
||||
@selection-change="tableHandleSelectionChange"
|
||||
row-key="id" style="width: 100%">
|
||||
<el-table-column type="selection" :reserve-selection="true"></el-table-column>
|
||||
<el-table-column :index="indexMethod"
|
||||
header-align="center"
|
||||
label="序号" type="index" width="80px"></el-table-column>
|
||||
@@ -119,15 +125,16 @@ layout("/layouts/platform.html"){
|
||||
{ prop: "userState", label: "在职状态", sortable: true },
|
||||
{ prop: "personType", label: "人员类型", sortable: true },
|
||||
{ prop: "unionname", label: "所属工会", sortable: true },
|
||||
{ prop: "changeInfosStr", label: "变更详细信息", sortable: true },
|
||||
{ prop: "changeTypes", label: "变更类型", sortable: true, width: "160px" },
|
||||
{ prop: "changeTime", label: "变更时间", sortable: true },
|
||||
{ prop: "changeInfosStr", label: "变更详细信息", sortable: true, width: "300px" },
|
||||
{ prop: "changeTypes", label: "变更类型", sortable: true, width: "180px" },
|
||||
{ prop: "changeTime", label: "变更时间", sortable: true, width: "150px" },
|
||||
],
|
||||
unions: [],
|
||||
units: [],
|
||||
isView: true,
|
||||
|
||||
changeTypeData: []
|
||||
changeTypeData: [],
|
||||
checkUsers: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -135,6 +142,39 @@ layout("/layouts/platform.html"){
|
||||
'user-change-info': USER_CHANGE_INFO
|
||||
},
|
||||
methods: {
|
||||
doBatchChange(){
|
||||
if (this.checkUsers.length === 0) {
|
||||
this.$message.warning('请选择需要批量确认的用户数据')
|
||||
return
|
||||
}
|
||||
this.$confirm('确认要批量变更勾选用户吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const ids = this.checkUsers.map(item => item.id)
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '数据保存中请稍后...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
const resp = await $.post('/platform/sourcechange/manage/doBatchChange', {
|
||||
data: JSON.stringify(ids)
|
||||
})
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.$refs.table.clearSelection()
|
||||
await this.pageData()
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
tableHandleSelectionChange(val){
|
||||
this.checkUsers = val
|
||||
},
|
||||
async doSubmit(formData){
|
||||
const resp = await $.post('/platform/sourcechange/manage/doSubmit', formData)
|
||||
if (resp.code === 0) {
|
||||
@@ -149,6 +189,11 @@ layout("/layouts/platform.html"){
|
||||
this.isView = flag
|
||||
this.$refs.guava.view()
|
||||
this.$nextTick(() => {
|
||||
if (row.changeInfosStr === '新入职') {
|
||||
this.$refs.userChangeInfoRef.activeName = flag ? 'basicInfo' : 'userChangInfo'
|
||||
} else {
|
||||
this.$refs.userChangeInfoRef.activeName = 'changeInfo'
|
||||
}
|
||||
this.$refs.userChangeInfoRef.onOpen(row.id)
|
||||
})
|
||||
},
|
||||
|
||||
@@ -287,7 +287,7 @@ const USER_CHANGE_INFO = {
|
||||
|
||||
<el-row justify="end" v-if="!isView" type="flex" class="mt10">
|
||||
<el-button @click="$emit('do-back')" type="primary">返 回</el-button>
|
||||
<el-button @click="doSubmit" type="primary">提 交</el-button>
|
||||
<el-button @click="doSubmit" type="primary">确认变更</el-button>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
|
||||
@@ -309,7 +309,7 @@ const USER_CHANGE_INFO = {
|
||||
</el-table>
|
||||
<el-row justify="end" v-if="!isView || !formData.isOperate" type="flex" class="mt10">
|
||||
<el-button @click="$emit('do-back')" type="primary">返 回</el-button>
|
||||
<el-button @click="doSubmit" type="primary">提 交</el-button>
|
||||
<el-button @click="doSubmit" type="primary">确认变更</el-button>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
@@ -61,7 +61,7 @@ layout("/layouts/platform.html"){
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消"
|
||||
}).then(() => {
|
||||
this.$axios.post(loc() + "/disable", { id }).then((resp) => {
|
||||
$.post(loc() + "/disable", { id }).then((resp) => {
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
this.pageData()
|
||||
|
||||
@@ -120,7 +120,7 @@ layout("/layouts/platform.html"){
|
||||
签到二维码
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="sendMsg(row)">
|
||||
通知
|
||||
报名通知
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="openView(row)">
|
||||
查看
|
||||
@@ -223,6 +223,8 @@ layout("/layouts/platform.html"){
|
||||
courseTimeList: [],
|
||||
viewMapDialog: false,
|
||||
clickRow: {},
|
||||
|
||||
scheduledDate: '13:30'
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -231,8 +233,25 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
methods: {
|
||||
sendMsg(row) {
|
||||
this.url = `<a href="` + (APP_DOMAIN + "/platform/mobile/trainSignUpActivity/trainList") + `">点击参与</a>`
|
||||
this.$refs.sendMsg.openDialog(row.activityGroupId)
|
||||
this.$confirm('您确认要发送报名提醒吗?', '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(async ({value}) => {
|
||||
const resp = await $.post('/platform/trainSingUp/manage/activity/sendMsg' ,{
|
||||
activityId: row.id,
|
||||
activityGroupId: row.activityGroupId,
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.error('操作失败')
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
// this.url = `<a href="` + (APP_DOMAIN + "/platform/mobile/trainSignUpActivity/trainList") + `">点击参与</a>`
|
||||
// this.$refs.sendMsg.openDialog(row.activityGroupId)
|
||||
|
||||
},
|
||||
openCode(id) {
|
||||
this.$refs.openQRCode.openCode("/platform/mobile/trainSignUpActivity/trainList")
|
||||
|
||||
@@ -36,7 +36,6 @@ layout("/layouts/platform.html"){
|
||||
let map = null
|
||||
let marker = null
|
||||
let geocoder = null
|
||||
let E = window.wangEditor
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
components: {
|
||||
@@ -54,6 +53,7 @@ layout("/layouts/platform.html"){
|
||||
fromEdit: '',
|
||||
formData: {
|
||||
notice: false,
|
||||
isIntegral: false,
|
||||
courseList: [
|
||||
{courseName: '1', courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1},
|
||||
{courseName: '2', courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1}
|
||||
@@ -66,6 +66,7 @@ layout("/layouts/platform.html"){
|
||||
limitNum: 1,
|
||||
typeLimits: [],
|
||||
activityMode: 1,
|
||||
pushHome: 0,
|
||||
},
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
@@ -161,7 +162,7 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
//添加培训班
|
||||
addCourse() {
|
||||
this.formData.courseList.push({courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1})
|
||||
this.formData.courseList.push({courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false})
|
||||
},
|
||||
//删除培训班
|
||||
async removeTableCourse(index) {
|
||||
@@ -231,7 +232,7 @@ layout("/layouts/platform.html"){
|
||||
this.unionLimitIndex = index
|
||||
this.setUpUnionLimitDialog = true
|
||||
if (!this.formData.courseList[this.unionLimitIndex].unionLimit || this.formData.courseList[this.unionLimitIndex].unionLimit.length === 0) {
|
||||
const resp = await $.get('/platform/trainSingUp/manage/activity/getUnionLimit', {activityScopeId: this.formData.activityGroupId})
|
||||
const resp = await $.get('/platform/trainSingUp/manage/activity/add/getUnionLimit', {activityScopeId: this.formData.activityGroupId})
|
||||
if (resp.code === 0) {
|
||||
this.$set(this.formData.courseList[this.unionLimitIndex], 'unionLimit', resp.data)
|
||||
}
|
||||
@@ -395,7 +396,7 @@ layout("/layouts/platform.html"){
|
||||
const courseValid = this.formData.courseList.some((v, i) => {
|
||||
const basicValid = v.courseName && v.coursePeopleNumber && v.campus
|
||||
&& v.courseLocation && v.courseInstructor && v.courseType
|
||||
const timeValid = v.courseTimeList && v.courseTimeList.length > 0 && v.courseTimeList.every(x => {
|
||||
const timeValid = v.courseTimeList.length > 0 && v.courseTimeList.every(x => {
|
||||
return x.courseStartTime && x.courseEndTime && (x.courseStartTime < x.courseEndTime)
|
||||
})
|
||||
|
||||
@@ -435,18 +436,13 @@ layout("/layouts/platform.html"){
|
||||
|
||||
//cloneData.conditionStructure.conditions = cloneData.conditionStructure.conditions.filter(v => v.field && v.fieldObj && v.operational && v.value)
|
||||
|
||||
if (cloneData.cover && cloneData.cover.length > 0) {
|
||||
cloneData.cover = cloneData.cover[0]
|
||||
cloneData.activitySignUpStartTime = cloneData.activitySignTime !== undefined ? cloneData.activitySignTime[0] : null
|
||||
cloneData.activitySignUpEndTime = cloneData.activitySignTime !== undefined ? cloneData.activitySignTime[1] : null
|
||||
cloneData.activityStartTime = cloneData.activityTime !== undefined ? cloneData.activityTime[0] : null
|
||||
cloneData.activityEndTime = cloneData.activityTime !== undefined ? cloneData.activityTime[1] : null
|
||||
if(cloneData.activityStartTime !== undefined && cloneData.activityStartTime !== null) {
|
||||
cloneData.year = new Date(cloneData.activityStartTime).getFullYear()
|
||||
}
|
||||
if (cloneData.wechat && cloneData.wechat.length > 0) {
|
||||
cloneData.wechat = cloneData.wechat[0]
|
||||
}
|
||||
cloneData.activitySignUpStartTime = cloneData.activitySignTime[0]
|
||||
cloneData.activitySignUpEndTime = cloneData.activitySignTime[1]
|
||||
cloneData.activityStartTime = cloneData.activityTime[0]
|
||||
cloneData.activityEndTime = cloneData.activityTime[1]
|
||||
cloneData.year = new Date(cloneData.activityStartTime).getFullYear()
|
||||
|
||||
/*const limitNumArray = []
|
||||
this.formData.typeLimits.forEach(item => {
|
||||
limitNumArray.push({
|
||||
@@ -467,7 +463,7 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
cloneData.typeLimits = limitNumArray
|
||||
|
||||
const resp = await $.post('/platform/trainSingUp/manage/activity/doHandle', {data: JSON.stringify(cloneData)})
|
||||
const resp = await $.post('/platform/trainSingUp/manage/activity/doHandle', {data: JSON.stringify(cloneData), flag: flag})
|
||||
if (resp.code === 0) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
@@ -485,44 +481,24 @@ layout("/layouts/platform.html"){
|
||||
if (id) {
|
||||
const resp = await $.get('/platform/trainSingUp/manage/activity/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
if (resp.data.cover) {
|
||||
resp.data.cover = [resp.data.cover]
|
||||
}
|
||||
if (resp.data.wechat) {
|
||||
resp.data.wechat = [resp.data.wechat]
|
||||
}
|
||||
this.formData = resp.data
|
||||
const type = this.trainTypeList.find(o => o.code === this.formData.trainType)
|
||||
this.trainType = type ? type.name : '培训班'
|
||||
this.$nextTick(() => {
|
||||
$("#introduce").html("")
|
||||
var editor = new E("#introduce")
|
||||
editor.config.onchange = (html) => {
|
||||
this.formData.introduce = html.replace(/<p\><\/p>/g, '')
|
||||
}
|
||||
editor.create()
|
||||
editor.txt.html(resp.data.introduce)
|
||||
})
|
||||
|
||||
this.formData.courseList.forEach(item => {
|
||||
const type = this.courseTypeList.find(o => o.id === item.courseType)
|
||||
if(type && type.isBringFamily === true) {
|
||||
this.$set(item, 'isBringFamily', true)
|
||||
item.reserveMode = 1
|
||||
} else {
|
||||
this.$set(item, 'isBringFamily', false)
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
$("#introduce").html("")
|
||||
var editor = new E("#introduce")
|
||||
editor.config.onchange = (html) => {
|
||||
this.formData.introduce = html.replace(/<p\><\/p>/g, '')
|
||||
if (this.formData.courseList && this.formData.courseList.length > 0) {
|
||||
this.formData.courseList.forEach(item => {
|
||||
const type = this.courseTypeList.find(o => o.id === item.courseType)
|
||||
if (type && type.isBringFamily === true) {
|
||||
this.$set(item, 'isBringFamily', true)
|
||||
item.reserveMode = 1
|
||||
} else {
|
||||
this.$set(item, 'isBringFamily', false)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.formData.courseList.push({courseTimeList: [], isMobileSign: false, isReceiveGift: false, reserveMode: 1, courseIsLimitApply: false})
|
||||
}
|
||||
editor.create()
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
async initCnd() {
|
||||
@@ -592,7 +568,7 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
//获取培训班报名人数
|
||||
async getRegisterUserCount(courseId) {
|
||||
const resp = await $.post('/platform/trainSingUp/manage/activity/getRegisterUserCount', {courseId})
|
||||
const resp = await $.post('/platform/trainSingUp/manage/activity/add/getRegisterUserCount', {courseId})
|
||||
return resp.code === 0 ? resp.data : 0
|
||||
},
|
||||
setSignUpCondition() {
|
||||
@@ -684,16 +660,16 @@ layout("/layouts/platform.html"){
|
||||
this.trainType = type ? type.name : ''
|
||||
},
|
||||
async getHistoricalActList() {
|
||||
const resp = await $.post('/platform/trainSingUp/manage/activity/getHistoricalActList', {})
|
||||
const resp = await $.post('/platform/trainSingUp/manage/activity/add/getHistoricalActList', {})
|
||||
return resp.data
|
||||
},
|
||||
async historicalActChange(val) {
|
||||
const resp = await $.get('/platform/trainSingUp/manage/activity/findOne', {id: val})
|
||||
if (resp.code === 0) {
|
||||
resp.data.cover = [resp.data.cover]
|
||||
if (resp.data.wechat) {
|
||||
resp.data.wechat = [resp.data.wechat]
|
||||
}
|
||||
// resp.data.cover = [resp.data.cover]
|
||||
// if (resp.data.wechat) {
|
||||
// resp.data.wechat = [resp.data.wechat]
|
||||
// }
|
||||
this.formData = resp.data
|
||||
const type = this.trainTypeList.find(o => o.code === this.formData.trainType)
|
||||
this.trainType = type ? type.name : '培训班'
|
||||
@@ -736,9 +712,15 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
conditionStructure(val) {
|
||||
console.log(val)
|
||||
this.formData.courseList[this.userScopeIndex].conditionStructure = val
|
||||
},
|
||||
'formData.activityGroupId': {
|
||||
async handler(newVal, oldVal) {
|
||||
this.activityGroupList = await getActivityGroup()
|
||||
this.userScopeDialog = false
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -188,12 +188,15 @@ layout("/layouts/platform.html"){
|
||||
<div slot="header" class="clearfix"
|
||||
style="font-size: 16px;padding: 5px 0"
|
||||
@click="openApply(item)">
|
||||
<div style="width: 88%; white-space: nowrap; overflow: hidden; display: inline-block; text-overflow: ellipsis">
|
||||
{{item.activityName}}
|
||||
</div>
|
||||
<el-tooltip class="item" effect="dark" :content="item.activityName"
|
||||
placement="top-start">
|
||||
|
||||
<span v-if="item.activityName.length<=10">{{item.activityName}}</span>
|
||||
<span v-else>{{item.activityName.substr(0,10)}}...</span>
|
||||
</el-tooltip>
|
||||
<el-button @click="openApply(item)" class="reserve_btn"
|
||||
type="text">
|
||||
报名
|
||||
请选择活动报名
|
||||
</el-button>
|
||||
</div>
|
||||
<div @click="openApply(item)">
|
||||
@@ -223,13 +226,14 @@ layout("/layouts/platform.html"){
|
||||
</div>
|
||||
<div class="text e-item">
|
||||
<span style="color: gray">报名时间:</span>
|
||||
{{moment(item.activitySignUpStartTime).format('YYYY/MM/DD HH:mm')}} 至
|
||||
{{moment(item.activitySignUpEndTime).format('YYYY/MM/DD HH:mm')}}
|
||||
{{moment(item.activitySignUpStartTime)
|
||||
.format('MM/DD HH:mm')}} 至
|
||||
{{moment(item.activitySignUpEndTime).format('MM/DD HH:mm')}}
|
||||
</div>
|
||||
<div class="text item">
|
||||
<span style="color: gray">活动时间:</span>
|
||||
{{moment(item.activityStartTime).format('YYYY/MM/DD HH:mm')}} 至
|
||||
{{moment(item.activityEndTime).format('YYYY/MM/DD HH:mm')}}
|
||||
{{moment(item.activityStartTime).format('MM/DD HH:mm')}} 至
|
||||
{{moment(item.activityEndTime).format('MM/DD HH:mm')}}
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -237,7 +241,7 @@ layout("/layouts/platform.html"){
|
||||
</el-row>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
<el-empty description="暂无数据" v-else></el-empty>
|
||||
<el-empty v-else description="暂无数据"></el-empty>
|
||||
</el-row>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
@@ -246,7 +250,7 @@ layout("/layouts/platform.html"){
|
||||
<template #label_end>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.courseTypeId"
|
||||
:placeholder="'请选择' + trainType"
|
||||
:placeholder="'请选择' + trainType + '类型'"
|
||||
filterable clearable
|
||||
style="width: 100%;margin-bottom: 5px;margin-left: 10px"
|
||||
@change="doSearch">
|
||||
@@ -274,6 +278,7 @@ layout("/layouts/platform.html"){
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:width="column.width"
|
||||
:sortable="column.sortable"
|
||||
show-overflow-tooltip>
|
||||
|
||||
@@ -284,9 +289,17 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='courseTime'">
|
||||
<el-button style="padding: 0" @click="openViewCourseTime(row.id)" type="text">
|
||||
点击查看{{trainType}}时间
|
||||
</el-button>
|
||||
<template v-if="row.courseName.includes('时间待定')">
|
||||
<span style="color: #e5a15e">活动时间另行通知</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button v-if="row.courseList && row.courseList.length == 1" type="text" style="padding: 0">
|
||||
{{moment(row.courseList[0].courseStartTime).format('MM-DD HH:mm')}}至{{moment(row.courseList[0].courseStartTime).format('MM-DD HH:mm')}}
|
||||
</el-button>
|
||||
<el-button v-else style="padding: 0" @click="openViewCourseTime(row)" type="text">
|
||||
点击查看{{trainType}}时间
|
||||
</el-button>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='applyNum'">
|
||||
@@ -307,108 +320,6 @@ layout("/layouts/platform.html"){
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<el-form :model="formData" ref="form" label-width="120px">
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item label="姓名" prop="username">
|
||||
<el-input readonly v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="24">
|
||||
<el-form-item label="工号" prop="loginname">
|
||||
<el-input readonly v-model="formData.loginname"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item label="所在单位" prop="unitName">
|
||||
<el-input readonly v-model="formData.unitName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="24">
|
||||
<el-form-item label="所属工会" prop="unionName">
|
||||
<el-input readonly v-model="formData.unionName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-input readonly v-model="formData.sex"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="24">
|
||||
<el-form-item label="联系方式" prop="mobile">
|
||||
<el-input v-model="formData.mobile"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item
|
||||
v-for="(column, index) in formData.trainMobileSignColumnList"
|
||||
:prop="'trainMobileSignColumnList.' + index + '.columnValue'"
|
||||
:label="column.columnName"
|
||||
:key="column.columnCode"
|
||||
:rules="{ required: column.isRequired,
|
||||
message: (['SELECT', 'FILE'].includes(column.columnFormType) ? '请选择' : '请填写') + column.columnName,
|
||||
trigger: 'blur'}">
|
||||
<!--文本框-->
|
||||
<template v-if="!['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
|
||||
<el-input
|
||||
v-model="column.columnValue"
|
||||
:placeholder="'请填写' + column.columnName"
|
||||
:type="['INT'].includes(column.columnType) ? 'number' : ''"
|
||||
></el-input>
|
||||
</template>
|
||||
<!--选择框-->
|
||||
<template v-else-if="['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
|
||||
<el-select v-model="column.columnValue"
|
||||
clearable
|
||||
:placeholder="'请选择' + column.columnName"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in column.selectValues"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<!--时间框-->
|
||||
<template v-else-if="['DATE', 'DATETIME'].includes(column.columnType)">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
v-model="column.columnValue"
|
||||
:type="column.columnType === 'DATE' ? 'date' : 'datetime'"
|
||||
:placeholder="'请选择' + column.columnName"
|
||||
:value-format="column.columnType === 'DATE' ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss'">
|
||||
</el-date-picker>
|
||||
</template>
|
||||
<!--文件-->
|
||||
<template v-else-if="['JSON'].includes(column.columnType)">
|
||||
<file-upload
|
||||
:files.sync="column.columnValue"
|
||||
:max="column.fileNumber"
|
||||
:type="column.fileType">
|
||||
</file-upload>
|
||||
</template>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button type="primary" @click="doSubmit">提交</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
|
||||
<el-dialog :visible.sync="courseTimeListDialog" :title="trainType + '时间'" width="60%" append-to-body>
|
||||
<el-table :data="courseTimeList">
|
||||
@@ -434,6 +345,108 @@ layout("/layouts/platform.html"){
|
||||
<div id="viewMap" style="width: 100%;height: 500px"></div>
|
||||
</el-dialog>
|
||||
</guava>
|
||||
|
||||
|
||||
<el-dialog :visible.sync="applyDialog" :title="trainType + '报名'" width="50%" append-to-body>
|
||||
<el-form :model="formData" ref="form" label-width="90px">
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item label="姓名" prop="username">
|
||||
<el-input readonly v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="24">
|
||||
<el-form-item label="工号" prop="loginname">
|
||||
<el-input readonly v-model="formData.loginname"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item label="所在单位" prop="unitName">
|
||||
<el-input readonly v-model="formData.unitName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="24">
|
||||
<el-form-item label="所属工会" prop="unionName">
|
||||
<el-input readonly v-model="formData.unionName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-input readonly v-model="formData.sex"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="24">
|
||||
<el-form-item label="联系方式" prop="mobile">
|
||||
<el-input v-model="formData.mobile"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item
|
||||
v-for="(column, index) in formData.trainMobileSignColumnList"
|
||||
:prop="'trainMobileSignColumnList.' + index + '.columnValue'"
|
||||
:label="column.columnName"
|
||||
:key="column.columnCode"
|
||||
:rules="{ required: column.isRequired,
|
||||
message: (['SELECT', 'FILE'].includes(column.columnFormType) ? '请选择' : '请填写') + column.columnName,
|
||||
trigger: 'blur'}">
|
||||
<!--文本框-->
|
||||
<template v-if="!['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
|
||||
<el-input
|
||||
v-model="column.columnValue"
|
||||
:placeholder="'请填写' + column.columnName"
|
||||
:type="['INT'].includes(column.columnType) ? 'number' : ''"
|
||||
></el-input>
|
||||
</template>
|
||||
<!--选择框-->
|
||||
<template v-else-if="['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
|
||||
<el-select v-model="column.columnValue"
|
||||
:placeholder="'请选择' + column.columnName"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in column.selectValues"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<!--时间框-->
|
||||
<template v-else-if="['DATE', 'DATETIME'].includes(column.columnType)">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
v-model="column.columnValue"
|
||||
:type="column.columnType === 'DATE' ? 'date' : 'datetime'"
|
||||
:placeholder="'请选择' + column.columnName"
|
||||
:value-format="column.columnType === 'DATE' ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss'">
|
||||
</el-date-picker>
|
||||
</template>
|
||||
<!--文件-->
|
||||
<template v-else-if="['JSON'].includes(column.columnType)">
|
||||
<file-upload
|
||||
:files.sync="column.columnValue"
|
||||
:max="column.fileNumber"
|
||||
:type="column.fileType">
|
||||
</file-upload>
|
||||
</template>
|
||||
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button type="primary" @click="doSubmit">提 交</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -452,13 +465,13 @@ layout("/layouts/platform.html"){
|
||||
activityList: [],
|
||||
courseTypeList: [],
|
||||
tableColumns: [
|
||||
/* {prop: 'name', label: '活动名称'},*/
|
||||
{prop: 'courseName', label: '名称'},
|
||||
{prop: 'lxname', label: '类型'},
|
||||
{prop: 'coursePeopleNumber', label: '总人数'},
|
||||
{prop: 'courseName', label: '名称', width: '350px'},
|
||||
{prop: 'lxname', label: '类型', width: '80px'},
|
||||
{prop: 'assort', label: '标识', width: '200px'},
|
||||
// {prop: 'coursePeopleNumber', label: '总人数', width: '80px'},
|
||||
{prop: 'courseLocationCoordinates', label: '地点'},
|
||||
{prop: 'courseInstructor', label: '联系人'},
|
||||
{prop: 'courseTime', label: '时间'},
|
||||
{prop: 'courseTime', label: '时间', width: '200px'},
|
||||
{prop: 'applyNum', label: '已报名人数'},
|
||||
],
|
||||
viewMapDialog: false,
|
||||
@@ -470,20 +483,29 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
choose: {},
|
||||
trainType: '培训班',
|
||||
|
||||
applyDialog: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async doCancel(row){
|
||||
const resp = await $.post('/platform/mobile/trainSignUpActivity/cancelSignUp',{
|
||||
activityId:row.activityId,
|
||||
courseId:row.id
|
||||
const msg = '您确认要取消' + row.courseName + '的报名吗?'
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const resp = await $.post('/platform/mobile/trainSignUpActivity/cancelSignUp',{
|
||||
activityId:row.activityId,
|
||||
courseId:row.id
|
||||
})
|
||||
if (resp.code === 0){
|
||||
await this.pageData()
|
||||
this.$message.success(resp.msg)
|
||||
}else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
})
|
||||
if (resp.code === 0){
|
||||
await this.pageData()
|
||||
this.$message.success(resp.msg)
|
||||
}else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
},
|
||||
calcSignUpCount(o) {
|
||||
if(o.reserveMode === 2) {
|
||||
@@ -523,7 +545,8 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
this.$confirm('您确定要提交吗?', '提示', {
|
||||
const msg = '您确认要提交' + this.choose.courseName + '的报名吗?'
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
@@ -541,7 +564,7 @@ layout("/layouts/platform.html"){
|
||||
if (resp.code === 0) {
|
||||
await this.pageData()
|
||||
this.$message.success(resp.msg)
|
||||
this.$refs.guava.index()
|
||||
this.applyDialog = false
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
@@ -551,17 +574,22 @@ layout("/layouts/platform.html"){
|
||||
|
||||
},
|
||||
async doApply(row) {
|
||||
if (row.courseName.includes('时间待定')) {
|
||||
this.$message.warning('活动报名尚未开始哦,请报名其他活动吧')
|
||||
return
|
||||
}
|
||||
|
||||
this.choose = row
|
||||
const o = this.courseTypeList.find(v => v.id === row.courseType)
|
||||
const data = this.trainSignUpActivity
|
||||
const now = moment().valueOf()
|
||||
if (now < moment(data.activitySignUpStartTime).valueOf() || now > moment(data.activitySignUpEndTime).valueOf()) {
|
||||
this.$message.warning('报名已结束,请致电校工会咨询,联系电话:85913629')
|
||||
this.$message.warning('此活动不在报名时间内')
|
||||
return
|
||||
}
|
||||
const scopeUser = await getScopeUser(data.activityGroupId);
|
||||
if (scopeUser === 0) {
|
||||
this.$message.warning('您不在活动报名范围内')
|
||||
this.$message.warning('您不在报名人员范围内')
|
||||
return
|
||||
}
|
||||
const res = await $.post('/platform/mobile/trainSignUpActivity/validateSignUp', {
|
||||
@@ -588,9 +616,9 @@ layout("/layouts/platform.html"){
|
||||
this.formData.trainMobileSignColumnList.forEach(item => {
|
||||
item.columnValue = ''
|
||||
})
|
||||
this.$refs.form.clearValidate()
|
||||
this.$nextTick(() => {
|
||||
this.$refs.guava.edit()
|
||||
this.applyDialog = true
|
||||
// this.$refs.guava.edit()
|
||||
})
|
||||
},
|
||||
openViewMap(point) {
|
||||
@@ -649,9 +677,13 @@ layout("/layouts/platform.html"){
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
},
|
||||
async openViewCourseTime(id) {
|
||||
const resp = await $.get(loc() + '/getCourseTime', {id: id})
|
||||
this.courseTimeList = resp.data
|
||||
async openViewCourseTime(row) {
|
||||
if (row.courseList && row.courseList.length > 0) {
|
||||
this.courseTimeList = row.courseList
|
||||
} else {
|
||||
const resp = await $.get(loc() + '/getCourseTime', {id: row.id})
|
||||
this.courseTimeList = resp.data
|
||||
}
|
||||
this.courseTimeListDialog = true
|
||||
},
|
||||
},
|
||||
|
||||
@@ -3,15 +3,16 @@
|
||||
<el-row :gutter="20" type="flex" v-if="fromEdit !== 'edit'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否沿用之前活动" prop="use">
|
||||
<el-radio-group v-model="use">
|
||||
<el-radio :label="true">沿用之前活动</el-radio>
|
||||
<el-radio :label="false">不沿用之前活动</el-radio>
|
||||
<el-radio-group v-model="use" size="medium">
|
||||
<el-radio-button :label="true" border>沿用之前活动</el-radio-button>
|
||||
<el-radio-button :label="false" border>不沿用之前活动</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="use">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="往期活动" prop="historicalAct">
|
||||
<el-select v-model="historicalAct" placeholder="请选择往期活动"
|
||||
:disabled="!use"
|
||||
style="width: 100%" @change="historicalActChange">
|
||||
<el-option
|
||||
v-for="item in historicalActList"
|
||||
@@ -30,7 +31,7 @@
|
||||
<el-input maxlength="50" v-model="formData.activityName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="trainType + '通知'" prop="notice">
|
||||
<el-radio-group v-model="formData.notice" size="medium">
|
||||
<el-radio-button :label="true" border>通知</el-radio-button>
|
||||
@@ -38,15 +39,42 @@
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<!--<el-col :span="12">
|
||||
<el-form-item label="是否启用积分系统" prop="isIntegral">
|
||||
<el-radio-group size="medium" v-model="formData.isIntegral">
|
||||
<el-radio-button :label="false">不启用</el-radio-button>
|
||||
<el-radio-button :label="true">启用</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
</el-row>
|
||||
<!--<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否推送移动端" prop="pushHome">
|
||||
<el-radio-group v-model="formData.pushHome" size="medium">
|
||||
<el-radio-button :label="0">不推送</el-radio-button>
|
||||
<el-radio-button :label="1">推送列表</el-radio-button>
|
||||
<el-radio-button :label="2">推送大图</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!–<el-col :span="12">
|
||||
<el-form-item :label="trainType + '通知'" prop="notice">
|
||||
<el-radio-group v-model="formData.notice" size="medium">
|
||||
<el-radio-button :label="true" border>通知</el-radio-button>
|
||||
<el-radio-button :label="false" border>不通知</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>–>
|
||||
<!–<el-col :span="6">
|
||||
<el-form-item label="活动类型" prop="activityMode">
|
||||
<el-radio-group v-model="formData.activityMode" size="medium">
|
||||
<el-radio-button :label="1" border>校工会</el-radio-button>
|
||||
<el-radio-button :label="2" border>分工会</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>–>
|
||||
</el-row>-->
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item :rules="{required:true,message: '请选择起止时间', trigger: 'blur'}" label="活动时间"
|
||||
@@ -111,14 +139,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-form-item :rules="{required:true,message: '请输入活动介绍', trigger: 'blur'}" label="活动介绍" prop="introduce">
|
||||
<!--<el-input
|
||||
:autosize="{ minRows: 5, maxRows: 10}"
|
||||
placeholder="请输入活动介绍"
|
||||
type="textarea"
|
||||
v-model="formData.introduce">
|
||||
</el-input>-->
|
||||
<!--<div id="introduce"></div>-->
|
||||
<text-editor v-model="formData.introduce"></text-editor>
|
||||
<text-editor v-model="formData.introduce" ></text-editor>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="封面图片" prop="cover" :rules="{required:true,message: '请上传活动移动端封面图片', trigger: 'blur'}">
|
||||
@@ -325,6 +346,11 @@
|
||||
v-model="courseTimeOneKeySet.endTime">
|
||||
</el-time-select>
|
||||
<el-button @click="oneKeySetStartEndTime" size="mini" type="primary">一键设置开始/结束时间</el-button>
|
||||
<span style="color: #ac3111">报名人数是否限制:</span>
|
||||
<el-radio-group size="mini" v-model="formData.courseList[courseIndex].courseIsLimitApply">
|
||||
<el-radio-button :label="true">是</el-radio-button>
|
||||
<el-radio-button :label="false">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
|
||||
<el-table v-if="formData.courseList && formData.courseList[courseIndex]"
|
||||
@@ -344,6 +370,7 @@
|
||||
end: '23:30'
|
||||
}"
|
||||
placeholder="开始时间"
|
||||
style="width: 100%"
|
||||
v-model="row.courseStartTime">
|
||||
</el-time-select>
|
||||
</template>
|
||||
@@ -356,11 +383,21 @@
|
||||
step: '00:05',
|
||||
end: '23:30'
|
||||
}"
|
||||
style="width: 100%"
|
||||
placeholder="结束时间"
|
||||
v-model="row.courseEndTime">
|
||||
</el-time-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-if="formData.courseList[courseIndex].courseIsLimitApply">
|
||||
<el-table-column label="人数限制">
|
||||
<template scope="{row}">
|
||||
<el-input-number v-model="row.courseLimitNum" :min="1" :max="1000"
|
||||
style="width: 100%"
|
||||
placeholder="限制报名个数"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template scope="{row,$index}">
|
||||
<el-button
|
||||
|
||||
@@ -94,12 +94,6 @@ layout("/layouts/platform.html"){
|
||||
<el-radio :label="false" border>不纳入</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="formData.isBringFamily === true" prop="selfAddFamily" label="本人纳入总人数">
|
||||
<el-radio-group v-model="formData.selfAddFamily">
|
||||
<el-radio :label="true" border>纳入</el-radio>
|
||||
<el-radio :label="false" border>不纳入</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<vi-title2 title="报名填写字段">
|
||||
|
||||
@@ -51,7 +51,7 @@ layout("/layouts/platform.html"){
|
||||
<table-tool :app="this" label="人员调整">
|
||||
<template #func>
|
||||
<el-button type="primary" @click="openImport(null)" size="small">
|
||||
批量调整
|
||||
批量导入
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
@@ -89,22 +89,12 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column label="已报名人数" prop="registerNum" sortable align="center" header-align="center"
|
||||
show-overflow-tooltip>
|
||||
<template scope="{row}">
|
||||
<template v-if="row.isAddFamily && row.isBringFamily">
|
||||
<el-link v-if="row.selfAddFamily" @click="openView(row)" type="primary">
|
||||
{{row.registerNum + '家属(' + row.familyCount + ')'}}
|
||||
</el-link>
|
||||
<el-link v-else @click="openView(row)" type="primary">
|
||||
{{row.familyCount}}
|
||||
</el-link>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-link v-if="row.reserveMode === 1" @click="openView(row)" type="primary">
|
||||
{{row.registerNum + row.courseReservedNumber}}
|
||||
</el-link>
|
||||
<el-link v-if="row.reserveMode === 2" @click="openView(row)" type="primary">
|
||||
{{row.registerNum}}
|
||||
</el-link>
|
||||
</template>
|
||||
<el-link v-if="row.reserveMode === 1" @click="openView(row)" type="primary">
|
||||
{{row.registerNum + row.courseReservedNumber}}
|
||||
</el-link>
|
||||
<el-link v-if="row.reserveMode === 2" @click="openView(row)" type="primary">
|
||||
{{row.registerNum}}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -131,7 +121,7 @@ layout("/layouts/platform.html"){
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select v-model="registerForm.unionId" clearable filterable placeholder="请选择分工会"
|
||||
<el-select v-model="registerForm.unionId" clearable filterable placeholder="请选择院级工会"
|
||||
@change="getUnitList()">
|
||||
<el-option
|
||||
v-for="item in unionList"
|
||||
@@ -342,7 +332,8 @@ layout("/layouts/platform.html"){
|
||||
const f = this.tempFileList[0]
|
||||
formData.append("file", f.raw, f.raw.name)
|
||||
formData.append("activityId", this.pageForm.activityId)
|
||||
formData.append("importCourseId", this.importRow.id)
|
||||
formData.append("importCourseId", this.importRow ? this.importRow.id : '')
|
||||
formData.append("isSingle", this.isSingle)
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '数据提交中...',
|
||||
|
||||
@@ -81,22 +81,12 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column label="已报名人数" prop="registerNum" sortable align="center" header-align="center"
|
||||
show-overflow-tooltip>
|
||||
<template scope="{row}">
|
||||
<template v-if="row.isAddFamily && row.isBringFamily">
|
||||
<el-link v-if="row.selfAddFamily" @click="openView(row)" type="primary">
|
||||
{{row.registerNum + '家属(' + row.familyCount + ')'}}
|
||||
</el-link>
|
||||
<el-link v-else @click="openView(row)" type="primary">
|
||||
{{row.familyCount}}
|
||||
</el-link>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-link v-if="row.reserveMode === 1" @click="openView(row)" type="primary">
|
||||
{{row.registerNum + row.courseReservedNumber}}
|
||||
</el-link>
|
||||
<el-link v-if="row.reserveMode === 2" @click="openView(row)" type="primary">
|
||||
{{row.registerNum}}
|
||||
</el-link>
|
||||
</template>
|
||||
<el-link v-if="row.reserveMode === 1" @click="openView(row)" type="primary">
|
||||
{{row.registerNum + row.courseReservedNumber}}
|
||||
</el-link>
|
||||
<el-link v-if="row.reserveMode === 2" @click="openView(row)" type="primary">
|
||||
{{row.registerNum}}
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150px">
|
||||
@@ -120,7 +110,6 @@ layout("/layouts/platform.html"){
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
columnTable: [],
|
||||
activityList: [],
|
||||
pageForm: {
|
||||
year: new Date().getFullYear().toString(),
|
||||
@@ -145,15 +134,6 @@ layout("/layouts/platform.html"){
|
||||
{label: '报名时间', prop: 'signUpTime'},
|
||||
{label: '报名状态', prop: 'state'},
|
||||
],
|
||||
cloneTableColumns: [
|
||||
{label: '姓名', prop: 'username'},
|
||||
{label: '工号', prop: 'loginname'},
|
||||
{label: '单位', prop: 'unitname'},
|
||||
{label: '分工会', prop: 'unionname'},
|
||||
{label: '联系方式', prop: 'mobile'},
|
||||
{label: '报名时间', prop: 'signUpTime'},
|
||||
{label: '报名状态', prop: 'state'},
|
||||
],
|
||||
userSignInfo: {},
|
||||
trainType: '培训班',
|
||||
trainTypeList: [],
|
||||
@@ -193,11 +173,6 @@ layout("/layouts/platform.html"){
|
||||
this.registerUserTableData = resp_register.data
|
||||
const resp_signInfo = await $.get(loc() + '/getSignInfo', {courseId: row.id})
|
||||
this.userSignInfo = resp_signInfo.data
|
||||
const resp_columnInfo = await $.get(loc() + '/getTaleColumnInfo', {courseId: row.id})
|
||||
if(resp_columnInfo.data) {
|
||||
this.registerUserTableColumns = []
|
||||
this.registerUserTableColumns = this.cloneTableColumns.concat(resp_columnInfo.data)
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
|
||||
Reference in New Issue
Block a user