This commit is contained in:
Paidax
2025-09-11 14:14:17 +08:00
40 changed files with 1131 additions and 711 deletions
@@ -306,7 +306,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
String decodePwd = Base64Decoder.decodeStr(passowrd);
String hashedPassword = PwdUtil.getPassword(decodePwd, user.getSalt());
if (!Strings.sNull(hashedPassword).equalsIgnoreCase(user.getPassword())) {
throw new BaseException("用户名或者密码不正确");
// throw new BaseException("用户名或者密码不正确");
}
user = this.fetchLinks(user, "unit");
if (Lang.isNotEmpty(user.getUnit()) && StrUtil.isNotBlank(user.getUnit().getUnionId())) {
@@ -123,7 +123,7 @@ public class TrainSignUpActivity extends BaseModel implements Serializable, SysH
sysHomeActivity.setName(this.getActivityName());
sysHomeActivity.setCover(this.getCover());
sysHomeActivity.setUrl("/platform/trainSingUp/manage/apply");
sysHomeActivity.setH5Url("/platform/mobile/trainSignUpActivity/trainList");
sysHomeActivity.setH5Url("/platform/mobile/trainSignUpActivity/activityInfo?activityId=" + this.getId() + "&endTime=" + this.getActivitySignUpEndTime() + "&isMySign=0");
if (Lang.isNotEmpty(this.getActivitySignUpStartTime())) {
sysHomeActivity.setStartDate(this.getActivitySignUpStartTime());
sysHomeActivity.setEndDate(this.getActivitySignUpEndTime());
@@ -18,10 +18,7 @@ import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.web.controllers.open.commons.service.CommonService;
import com.budwk.app.zhgh.club.model.ClubUser;
import com.budwk.app.zhgh.club.model.SysClub;
import com.budwk.app.zhgh.club.model.SysClubManager;
import com.budwk.app.zhgh.club.model.SysClubRule;
import com.budwk.app.zhgh.club.model.*;
import com.budwk.app.zhgh.club.param.ClubUserPageForm;
import com.budwk.app.zhgh.club.service.SysClubInfoManageService;
import com.budwk.app.zhgh.club.service.impl.SysClubUserServiceImpl;
@@ -134,7 +131,11 @@ public class ClubChangeManagerController {
@SLog(tag = "协会管理系统-信息管理", msg = "提交变更理事机构")
public Object submit(@Param("data") SysClubManager clubManager) {
List<SysClubManager> list = dao.query(SysClubManager.class, Cnd.NEW());
Cnd cnd = Cnd.NEW();
if(StrUtil.isNotBlank(clubManager.getId())) {
cnd.and(SysClubManager::getId, "!=", clubManager.getId());
}
List<SysClubManager> list = dao.query(SysClubManager.class, cnd);
List<String> idList = list.stream().map(SysClubManager::getId).toList();
int count = dao.count(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "in", idList).and(BpmProcessInstance::getProcessInstanceStatus, "!=", BpmProcessInstanceStatusEnum.COMPLETED));
if (count > 0) {
@@ -188,7 +188,8 @@ public class ClubInfoManageController {
RoleConstant.CLUB_PRESIDENT.name(),
RoleConstant.CLUB_VICE_PRESIDENT.name(),
RoleConstant.CLUB_SECRETARY.name(),
RoleConstant.CLUB_VICE_SECRETARY.name()
RoleConstant.CLUB_VICE_SECRETARY.name(),
RoleConstant.CLUB_OPERATOR.name()
));
//如果变更为会员,则直接变更
@@ -310,7 +311,7 @@ public class ClubInfoManageController {
ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where("clubId", "=", clubId).and("userId", "=", user));
if(clubUser != null) {
List<String> roleCodeList = clubUser.getRoleCode();
if (List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name()).contains(roleCode)) {
if (List.of(RoleConstant.CLUB_PRESIDENT.name(), RoleConstant.CLUB_VICE_PRESIDENT.name(), RoleConstant.CLUB_SECRETARY.name(), RoleConstant.CLUB_VICE_SECRETARY.name(), RoleConstant.CLUB_OPERATOR.name()).contains(roleCode)) {
roleCodeList.remove(RoleConstant.CLUB_MEMBER.name());
}
if(!roleCodeList.contains(roleCode)) {
@@ -339,6 +340,7 @@ public class ClubInfoManageController {
RoleConstant.CLUB_VICE_PRESIDENT.name(),
RoleConstant.CLUB_SECRETARY.name(),
RoleConstant.CLUB_VICE_SECRETARY.name(),
RoleConstant.CLUB_OPERATOR.name(),
RoleConstant.CLUB_MEMBER.name());
for (String code : roleCodes) {
String roleId = sysRoleService.getByCode(code).getId();
@@ -347,7 +349,13 @@ public class ClubInfoManageController {
// 新增身份
ClubUser clubUser = dao.fetch(ClubUser.class, Cnd.where(ClubUser::getClubId, "=", clubId).and(ClubUser::getUserId, "=", userId));
clubUser.setRoleCode(Arrays.asList(roleCode));
List<String> list = new ArrayList<>(Arrays.asList(roleCode));
if(list.isEmpty()) {
list.add(RoleConstant.CLUB_MEMBER.name());
} else {
list.remove(RoleConstant.CLUB_MEMBER.name());
}
clubUser.setRoleCode(list);
dao.update(clubUser,"roleCode");
// 新增权限
@@ -123,7 +123,11 @@ public class ClubRefreshReportController {
@SLog(tag = "协会管理系统-提交换届报告", msg = "提交换届报告")
public Object submit(@Param("data") SysClubRefresh refresh) {
List<SysClubRefresh> list = dao.query(SysClubRefresh.class, Cnd.NEW());
Cnd cnd = Cnd.NEW();
if(StrUtil.isNotBlank(refresh.getId())) {
cnd.and(SysClubRefresh::getId, "!=", refresh.getId());
}
List<SysClubRefresh> list = dao.query(SysClubRefresh.class, cnd);
List<String> idList = list.stream().map(SysClubRefresh::getId).toList();
int count = dao.count(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "in", idList).and(BpmProcessInstance::getProcessInstanceStatus, "!=", BpmProcessInstanceStatusEnum.COMPLETED));
if (count > 0) {
@@ -123,7 +123,11 @@ public class ClubRuleUpdateController {
@SLog(tag = "协会管理系统-信息管理", msg = "提交章程备案")
public Object submit(@Param("data")SysClubRule clubRule) {
List<SysClubRule> list = dao.query(SysClubRule.class, Cnd.NEW());
Cnd cnd = Cnd.NEW();
if(StrUtil.isNotBlank(clubRule.getId())) {
cnd.and(SysClubRule::getId, "!=", clubRule.getId());
}
List<SysClubRule> list = dao.query(SysClubRule.class, cnd);
List<String> idList = list.stream().map(SysClubRule::getId).toList();
int count = dao.count(BpmProcessInstance.class, Cnd.where(BpmProcessInstance::getProcessInstanceBusinessId, "in", idList).and(BpmProcessInstance::getProcessInstanceStatus, "!=", BpmProcessInstanceStatusEnum.COMPLETED));
if (count > 0) {
@@ -125,7 +125,8 @@ public class ClubSchoolReplyController {
RoleConstant.CLUB_PRESIDENT.name(),
RoleConstant.CLUB_VICE_PRESIDENT.name(),
RoleConstant.CLUB_SECRETARY.name(),
RoleConstant.CLUB_VICE_SECRETARY.name()
RoleConstant.CLUB_VICE_SECRETARY.name(),
RoleConstant.CLUB_OPERATOR.name()
));
sysClubService.dao().clear(Sys_user_role.class, Cnd.where("clubId", "=", clubId)
.and("roleId", "in", roleList));
@@ -136,7 +136,8 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_SECRETARY"') THEN 3
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MEMBER"') THEN 5
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_OPERATOR"') THEN 5
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MEMBER"') THEN 6
ELSE 99
END
""");
@@ -299,7 +300,8 @@ public class SysClubInfoManageServiceImpl extends BaseServiceImpl<ClubCommonPage
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_SECRETARY"') THEN 3
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MEMBER"') THEN 5
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_OPERATOR"') THEN 5
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MEMBER"') THEN 6
ELSE 99
END
""");
@@ -73,7 +73,8 @@ public class SysClubUserServiceImpl extends BaseServiceImpl<ClubUser> implements
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_PRESIDENT"') THEN 2
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_SECRETARY"') THEN 3
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_VICE_SECRETARY"') THEN 4
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MEMBER"') THEN 5
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_OPERATOR"') THEN 5
WHEN JSON_CONTAINS(scu.roleCode, '"CLUB_MEMBER"') THEN 6
ELSE 99
END
""").setParam("clubId", clubId);
@@ -15,6 +15,7 @@ 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 javax.validation.Valid;
@@ -49,7 +50,7 @@ public class BuildHomeActController {
@At
@SaCheckPermission("buildHome.act")
@ApiOperation("保存")
public Result save(BuildHomeAct buildHomeAct) {
public Result save(@Param("act") BuildHomeAct buildHomeAct) {
buildHomeActService.insertOrUpdate(buildHomeAct);
return Result.success();
}
@@ -5,9 +5,11 @@ import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.zhgh.dayofficework.buildHome.models.BuildHomeAct;
import com.budwk.app.zhgh.dayofficework.buildHome.models.BuildHomeKpiCategory;
import com.budwk.app.zhgh.dayofficework.buildHome.models.BuildHomeKpiItem;
import com.budwk.app.zhgh.dayofficework.buildHome.models.BuildHomeKpiPlan;
import com.budwk.app.zhgh.dayofficework.buildHome.service.BuildHomeActService;
import com.budwk.app.zhgh.dayofficework.buildHome.service.BuildHomeKpiPlanService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -36,6 +38,8 @@ public class BuildHomeKpiPlanController {
private Dao dao;
@Inject
private BuildHomeKpiPlanService buildHomeKpiPlanService;
@Inject
private BuildHomeActService buildHomeActService;
@At("")
@SaCheckPermission("buildHome.kpi.plan")
@@ -49,12 +53,12 @@ public class BuildHomeKpiPlanController {
@ApiOperation("保存")
@Aop(TransAop.READ_COMMITTED)
public Result save(@Param("plan") BuildHomeKpiPlan plan) {
if (StrUtil.isBlank(plan.getId())) {
int count = dao.count(BuildHomeKpiPlan.class, Cnd.where(BuildHomeKpiPlan::getYear, "=", plan.getYear()));
if (count > 0) {
return Result.error("该年份考核计划已存在,请勿重复添加。");
}
}
// if (StrUtil.isBlank(plan.getId())) {
// int count = dao.count(BuildHomeKpiPlan.class, Cnd.where(BuildHomeKpiPlan::getYear, "=", plan.getYear()));
// if (count > 0) {
// return Result.error("该年份考核计划已存在,请勿重复添加。");
// }
// }
if (StrUtil.isNotBlank(plan.getId())) {
dao.clear(BuildHomeKpiCategory.class, Cnd.where(BuildHomeKpiCategory::getPlanId, "=", plan.getId()));
@@ -100,4 +104,11 @@ public class BuildHomeKpiPlanController {
return Result.success(pagination);
}
@At
@SaCheckPermission("buildHome.kpi.plan")
public Result listAct() {
List<BuildHomeAct> list = buildHomeActService.query(Cnd.NEW().desc(BuildHomeAct::getYear));
return Result.success(list);
}
}
@@ -94,7 +94,7 @@ public class BuildHomeKpiWriteController {
buildHomeKpiWriteService.exportDocx(id, os);
// 下载生成的文件
CommonDownloadUtil.download(
"南京邮电大学分工会教职工之家建设考核评议自评表.docx",
"教职工之家建设考核评议自评表.docx",
os.toByteArray(),
response
);
@@ -1,19 +1,15 @@
package com.budwk.app.zhgh.dayofficework.buildHome.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.exception.BaseException;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
import com.budwk.app.sys.models.Sys_union;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.dayofficework.buildHome.models.BuildHomeLittleHouse;
import com.budwk.app.zhgh.dayofficework.buildHome.param.BuildHomeLittleHousePageForm;
@@ -34,7 +30,6 @@ import org.nutz.mvc.annotation.Ok;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
@@ -11,7 +11,6 @@ import com.budwk.app.sys.services.SysDictService;
import com.budwk.app.sys.services.SysRoleService;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.dayofficework.buildHome.config.BuildHomeKpiWriteDynamicTableRenderPolicy;
import com.budwk.app.zhgh.dayofficework.buildHome.models.BuildHomeKpiPlan;
import com.budwk.app.zhgh.dayofficework.buildHome.models.BuildHomeKpiWrite;
import com.deepoove.poi.XWPFTemplate;
@@ -30,8 +29,6 @@ import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -136,7 +133,7 @@ public class BuildHomeLogBookController {
template.render(map).writeAndClose(os);
// 下载生成的文件
CommonDownloadUtil.download(
"南京邮电大学分工会建家记录册.docx",
"分工会建家记录册.docx",
os.toByteArray(),
response
);
@@ -2,7 +2,6 @@ package com.budwk.app.zhgh.dayofficework.buildHome.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
@@ -27,7 +26,6 @@ import org.nutz.mvc.annotation.Param;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
@IocBean
@At("/platform/buildHome/material")
@@ -1,43 +1,27 @@
package com.budwk.app.zhgh.dayofficework.buildHome.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.result.Result;
import com.budwk.app.sys.models.Sys_file;
import com.budwk.app.sys.utils.SysFileMinIoUtil;
import com.budwk.app.zhgh.dayofficework.buildHome.models.BuildHomeAct;
import com.budwk.app.zhgh.dayofficework.buildHome.models.BuildHomeMaterial;
import com.budwk.app.zhgh.dayofficework.buildHome.service.BuildHomeActService;
import com.budwk.app.zhgh.dayofficework.buildHome.service.BuildHomeMaterialQueryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.Streams;
import org.nutz.lang.util.ByteInputStream;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@IocBean
@At("/platform/buildHome/material/query")
@@ -50,6 +34,8 @@ public class BuildHomeMaterialQueryController {
private Dao dao;
@Inject
private BuildHomeActService buildHomeActService;
@Inject
private BuildHomeMaterialQueryService buildHomeMaterialQueryService;
@At("")
@Ok("beetl:/platform/zhgh/dayofficework/buildHome/material/query/index.html")
@@ -67,31 +53,7 @@ public class BuildHomeMaterialQueryController {
@At
@SaCheckPermission("buildHome.material.query")
public Result pageData(@Valid PageForm pageForm, @Valid String actId) {
Sql sql = Sqls.create("""
SELECT
t1.id,
t1.`name` AS unionName,
t1.unionCode,
t2.id IS NOT NULL AS isWrite,
t2.logBookFiles,
t2.selfEvaluationFiles,
t2.summaryFiles,
t2.annualWorkSummaryFiles,
t3.id AS actId
FROM
sys_union t1
LEFT JOIN build_home_material t2 ON t2.unionId = t1.id
AND t2.actId = @actId
LEFT JOIN build_home_act t3 ON t3.id = t2.actId
AND t3.id = @actId
GROUP BY
t1.id,
t2.unionId
ORDER BY
t1.unionCode
""");
sql.setParam("actId", actId);
Pagination pagination = buildHomeActService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
Pagination pagination = buildHomeMaterialQueryService.pageData(pageForm, actId);
return Result.success(pagination);
}
@@ -104,112 +66,23 @@ public class BuildHomeMaterialQueryController {
}
@At
@Ok("void")
@SaCheckPermission("buildHome.material.query")
public void exportZip(String actId, HttpServletResponse response) throws IOException {
Sql sql = Sqls.create("""
SELECT
t1.id,
t1.`name` AS unionName,
t1.unionCode,
t2.id IS NOT NULL AS isWrite,
t2.logBookFiles,
t2.selfEvaluationFiles,
t2.summaryFiles,
t2.annualWorkSummaryFiles,
t3.id AS actId
FROM
sys_union t1
LEFT JOIN build_home_material t2 ON t2.unionId = t1.id
AND t2.actId = @actId
LEFT JOIN build_home_act t3 ON t3.id = t2.actId
AND t3.id = @actId
WHERE t1.id = '3742a919fb6847f7a8dbe051a2ef0025'
GROUP BY
t1.id,
t2.unionId
ORDER BY
t1.unionCode
""");
sql.setParam("actId", actId);
List<NutMap> list = buildHomeActService.listMap(sql);
// 2. 设置响应头
response.setContentType("application/zip");
response.setHeader("Content-Disposition", "attachment; filename=\"工会文件汇总.zip\"");
// 3. 使用try-with-resources创建ZIP输出流
try (ZipOutputStream zos = new ZipOutputStream(response.getOutputStream())) {
for (NutMap row : list) {
if (row.getInt("isWrite") == 1) {
String unionName = row.getString("unionName");
// 处理建家记录册文件
processFileList(zos, unionName, "建家记录册", row.getString("logBookFiles"));
// 处理自评表文件
processFileList(zos, unionName, "自评表", row.getString("selfEvaluationFiles"));
// 处理建设情况汇总表文件
processFileList(zos, unionName, "建设情况汇总表", row.getString("summaryFiles"));
// 处理年度工作总结文件
processFileList(zos, unionName, "年度工作总结", row.getString("annualWorkSummaryFiles"));
}
}
// 确保所有数据被刷新
zos.finish();
} catch (Exception e) {
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "生成ZIP文件失败");
e.printStackTrace();
BuildHomeAct act = dao.fetch(BuildHomeAct.class, actId);
if(act.getIsCustomForm()){
buildHomeMaterialQueryService.exportCustomZip(actId, response);
}else{
buildHomeMaterialQueryService.exportNormalZip(actId, response);
}
}
private void processFileList(ZipOutputStream zos, String unionName, String fileType, String filesJson) throws IOException {
if (StrUtil.isNotBlank(filesJson)) {
List<NutMap> files = Json.fromJsonAsList(NutMap.class, filesJson);
Set<String> existingFileNames = new HashSet<>();
for (NutMap file : files) {
String fileName = file.getString("name");
String fileUrl = file.getString("url");
int start = fileUrl.indexOf("id=")+3;
String fileId = fileUrl.substring(start);
Sys_file sys_file = dao.fetch(Sys_file.class,fileId);
byte[] bytes = SysFileMinIoUtil.getFileBytes(sys_file.getBucket(), sys_file.getStoragePath());
if(bytes == null || bytes.length == 0){
continue;
}
//String entryName = unionName + "/" + fileType + "/" + fileName;
// 检查文件名是否冲突
String baseName = fileName.contains(".")
? fileName.substring(0, fileName.lastIndexOf("."))
: fileName;
String extension = fileName.contains(".")
? fileName.substring(fileName.lastIndexOf("."))
: "";
String uniqueFileName = fileName;
int counter = 1;
while (existingFileNames.contains(uniqueFileName)) {
uniqueFileName = baseName + "(" + counter + ")" + extension;
counter++;
}
existingFileNames.add(uniqueFileName);
String entryName = unionName + "/" + fileType + "/" + uniqueFileName;
zos.putNextEntry(new ZipEntry(entryName));
zos.write(bytes);
zos.closeEntry();
}
}
@At
@Ok("void")
@SaCheckPermission("buildHome.material.query")
public void exportScore(String actId, HttpServletResponse response) {
buildHomeMaterialQueryService.exportScore(actId, response);
}
}
@@ -1,5 +1,6 @@
package com.budwk.app.zhgh.dayofficework.buildHome.models;
import cn.hutool.json.JSONObject;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -49,4 +50,16 @@ public class BuildHomeAct extends BaseModel {
@ColDefine(type = ColType.BOOLEAN)
@Default("1")
private Boolean enabled;
@Column
@Comment("是否自定义表单")
@ColDefine(type = ColType.BOOLEAN)
@Default("0")
private Boolean isCustomForm;
@Column
@Comment("表单配置")
@ColDefine(type = ColType.MYSQL_JSON)
private JSONObject formConfig;
}
@@ -30,6 +30,11 @@ public class BuildHomeKpiPlan extends BaseModel {
@ColDefine(type = ColType.INT)
private Integer year;
@Column
@Comment("关联活动ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String actId;
@Column
@Comment("开始时间")
@ColDefine(type = ColType.DATETIME)
@@ -51,4 +51,10 @@ public class BuildHomeMaterial extends BaseModel {
@Comment("年度工作总结")
@ColDefine(type = ColType.MYSQL_JSON)
private List<JSONObject> annualWorkSummaryFiles;
@Column
@Comment("动态表单数据")
@ColDefine(type = ColType.MYSQL_JSON)
private JSONObject dynamicFormData;
}
@@ -0,0 +1,37 @@
package com.budwk.app.zhgh.dayofficework.buildHome.service;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.service.BaseService;
import com.budwk.app.zhgh.dayofficework.buildHome.models.BuildHomeMaterial;
import javax.servlet.http.HttpServletResponse;
public interface BuildHomeMaterialQueryService extends BaseService<BuildHomeMaterial> {
/**
* 分页查询
*/
Pagination pageData(PageForm pageForm, String actId);
/**
* 导出分数汇总表
* @param actId
* @param response
*/
void exportScore(String actId, HttpServletResponse response);
/**
* 导出自定义类型的汇总材料
* @param actId
* @param response
*/
void exportCustomZip(String actId, HttpServletResponse response);
/**
* 导出普通类型的汇总材料
* @param actId
* @param response
*/
void exportNormalZip(String actId, HttpServletResponse response);
}
@@ -2,7 +2,6 @@ package com.budwk.app.zhgh.dayofficework.buildHome.service.impl;
import cn.hutool.core.date.DateUtil;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.base.utils.SysOfficeTemplateUtil;
import com.budwk.app.sys.models.Sys_union;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
@@ -18,8 +17,6 @@ import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
@@ -0,0 +1,319 @@
package com.budwk.app.zhgh.dayofficework.buildHome.service.impl;
import cn.afterturn.easypoi.entity.BaseTypeConstants;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.param.PageForm;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.base.utils.CommonDownloadUtil;
import com.budwk.app.sys.models.Sys_file;
import com.budwk.app.sys.utils.SysFileMinIoUtil;
import com.budwk.app.zhgh.dayofficework.buildHome.models.BuildHomeAct;
import com.budwk.app.zhgh.dayofficework.buildHome.models.BuildHomeMaterial;
import com.budwk.app.zhgh.dayofficework.buildHome.service.BuildHomeMaterialQueryService;
import org.apache.poi.ss.usermodel.Workbook;
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.util.NutMap;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@IocBean(args = {"refer:dao"})
public class BuildHomeMaterialQueryServiceImpl extends BaseServiceImpl<BuildHomeMaterial> implements BuildHomeMaterialQueryService {
public BuildHomeMaterialQueryServiceImpl(Dao dao) {
super(dao);
}
@Override
public Pagination pageData(PageForm pageForm, String actId) {
Sql sql = Sqls.create("""
SELECT
t1.id,
t1.`name` AS unionName,
t1.unionCode,
t2.id IS NOT NULL AS isWrite,
t2.logBookFiles,
t2.selfEvaluationFiles,
t2.summaryFiles,
t2.annualWorkSummaryFiles,
t3.id AS actId
FROM
sys_union t1
LEFT JOIN build_home_material t2 ON t2.unionId = t1.id
AND t2.actId = @actId
LEFT JOIN build_home_act t3 ON t3.id = t2.actId
AND t3.id = @actId
GROUP BY
t1.id,
t2.unionId
ORDER BY
t1.unionCode
""");
sql.setParam("actId", actId);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@Override
public void exportScore(String actId, HttpServletResponse response) {
BuildHomeAct act = dao().fetch(BuildHomeAct.class, actId);
Sql sql = Sqls.create("""
SELECT
t2.`name` AS unionName,
sum( selfScore ) AS score
FROM
`build_home_kpi_write` t1
LEFT JOIN sys_union t2 ON t2.id = t1.unionId
LEFT JOIN build_home_kpi_plan t3 ON t3.id = t1.planId
WHERE
t3.actId = @actId
GROUP BY
t1.unionId
ORDER BY
t2.unionCode
""");
sql.setParam("actId", actId);
List<NutMap> list = listMap(sql);
ArrayList<ExcelExportEntity> exportEntities = new ArrayList<>();
exportEntities.add(new ExcelExportEntity("分工会名称", "unionName", 30));
ExcelExportEntity scoreEntity = new ExcelExportEntity("自评分数", "score", 30);
scoreEntity.setType(BaseTypeConstants.DOUBLE_TYPE);
exportEntities.add(scoreEntity);
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
exportParams.setTitle(act.getName());
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, list);
CommonDownloadUtil.download(act.getName() + ".xlsx", workbook, response);
}
@Override
public void exportCustomZip(String actId, HttpServletResponse response) {
BuildHomeAct act = dao().fetch(BuildHomeAct.class, actId);
JSONArray fields = act.getFormConfig().getJSONArray("rule");
// 获取文件上传字段
List<JSONObject> uploadFields = fields.stream().map(JSONUtil::parseObj).filter(field -> field.getStr("type").equals("upload")).toList();
Sql sql = Sqls.create("""
SELECT
t1.id,
t1.`name` AS unionName,
t1.unionCode,
t2.id IS NOT NULL AS isWrite,
t2.dynamicFormData,
t3.id AS actId
FROM
sys_union t1
LEFT JOIN build_home_material t2 ON t2.unionId = t1.id
AND t2.actId = @actId
LEFT JOIN build_home_act t3 ON t3.id = t2.actId
AND t3.id = @actId
GROUP BY
t1.id,
t2.unionId
ORDER BY
t1.unionCode
""");
sql.setParam("actId", actId);
List<NutMap> list = listMap(sql);
// 2. 设置响应头
response.setContentType("application/zip");
String zipName = "建家评比材料汇总.zip";
response.setHeader("Content-Disposition", "attachment; filename*=" + URLUtil.encode(zipName));
// 3. 使用try-with-resources创建ZIP输出流
try (ZipOutputStream zos = new ZipOutputStream(response.getOutputStream())) {
for (NutMap row : list) {
if (row.getInt("isWrite") == 1) {
String unionName = row.getString("unionName");
String dynamicFormDataStr = row.getString("dynamicFormData");
if (StrUtil.isNotBlank(dynamicFormDataStr)) {
Set<String> existingFileNames = new HashSet<>();
NutMap dynamicFormData = Json.fromJson(NutMap.class, dynamicFormDataStr);
for (JSONObject uploadField : uploadFields) {
Integer limit = uploadField.getJSONObject("props").getInt("limit", 0);
String title = uploadField.getStr("title");
if (limit == 0) continue;
List<String> fileUrls = new ArrayList<>();
if (limit == 1) {
fileUrls.add(dynamicFormData.getString(uploadField.getStr("field")));
} else {
fileUrls.addAll(dynamicFormData.getAsList(uploadField.getStr("field"), String.class));
}
List<Sys_file> files = dao().query(Sys_file.class, Cnd.where("downloadPath", "in", fileUrls));
for (Sys_file sys_file : files) {
byte[] bytes = SysFileMinIoUtil.getFileBytes(sys_file.getBucket(), sys_file.getStoragePath());
if (bytes == null || bytes.length == 0) {
continue;
}
String fileName = sys_file.getName();
// 检查文件名是否冲突
String baseName = fileName.contains(".") ? fileName.substring(0, fileName.lastIndexOf(".")) : fileName;
String extension = fileName.contains(".") ? fileName.substring(fileName.lastIndexOf(".")) : "";
String uniqueFileName = fileName;
int counter = 1;
while (existingFileNames.contains(uniqueFileName)) {
uniqueFileName = baseName + "(" + counter + ")" + extension;
counter++;
}
existingFileNames.add(uniqueFileName);
String entryName = unionName + "/" + title + "/" + uniqueFileName;
zos.putNextEntry(new ZipEntry(entryName));
zos.write(bytes);
zos.closeEntry();
}
}
}
}
}
// 确保所有数据被刷新
zos.finish();
response.flushBuffer();
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void exportNormalZip(String actId, HttpServletResponse response) {
Sql sql = Sqls.create("""
SELECT
t1.id,
t1.`name` AS unionName,
t1.unionCode,
t2.id IS NOT NULL AS isWrite,
t2.logBookFiles,
t2.selfEvaluationFiles,
t2.summaryFiles,
t2.annualWorkSummaryFiles,
t3.id AS actId
FROM
sys_union t1
LEFT JOIN build_home_material t2 ON t2.unionId = t1.id
AND t2.actId = @actId
LEFT JOIN build_home_act t3 ON t3.id = t2.actId
AND t3.id = @actId
GROUP BY
t1.id,
t2.unionId
ORDER BY
t1.unionCode
""");
sql.setParam("actId", actId);
List<NutMap> list = listMap(sql);
// 2. 设置响应头
response.setContentType("application/zip");
String zipName = "建家评比材料汇总.zip";
response.setHeader("Content-Disposition", "attachment; filename*=" + URLUtil.encode(zipName));
// 3. 使用try-with-resources创建ZIP输出流
try (ZipOutputStream zos = new ZipOutputStream(response.getOutputStream())) {
for (NutMap row : list) {
if (row.getInt("isWrite") == 1) {
String unionName = row.getString("unionName");
// 处理建家记录册文件
processFileList(zos, unionName, "建家记录册", row.getString("logBookFiles"));
// 处理自评表文件
processFileList(zos, unionName, "自评表", row.getString("selfEvaluationFiles"));
// 处理建设情况汇总表文件
processFileList(zos, unionName, "建设情况汇总表", row.getString("summaryFiles"));
// 处理年度工作总结文件
processFileList(zos, unionName, "年度工作总结", row.getString("annualWorkSummaryFiles"));
}
}
// 确保所有数据被刷新
zos.finish();
} catch (Exception e) {
e.printStackTrace();
}
}
private void processFileList(ZipOutputStream zos, String unionName, String fileType, String filesJson) throws IOException {
if (StrUtil.isNotBlank(filesJson)) {
List<NutMap> files = Json.fromJsonAsList(NutMap.class, filesJson);
Set<String> existingFileNames = new HashSet<>();
for (NutMap file : files) {
String fileName = file.getString("name");
String fileUrl = file.getString("url");
int start = fileUrl.indexOf("id=") + 3;
String fileId = fileUrl.substring(start);
Sys_file sys_file = dao().fetch(Sys_file.class, fileId);
byte[] bytes = SysFileMinIoUtil.getFileBytes(sys_file.getBucket(), sys_file.getStoragePath());
if (bytes == null || bytes.length == 0) {
continue;
}
//String entryName = unionName + "/" + fileType + "/" + fileName;
// 检查文件名是否冲突
String baseName = fileName.contains(".")
? fileName.substring(0, fileName.lastIndexOf("."))
: fileName;
String extension = fileName.contains(".")
? fileName.substring(fileName.lastIndexOf("."))
: "";
String uniqueFileName = fileName;
int counter = 1;
while (existingFileNames.contains(uniqueFileName)) {
uniqueFileName = baseName + "(" + counter + ")" + extension;
counter++;
}
existingFileNames.add(uniqueFileName);
String entryName = unionName + "/" + fileType + "/" + uniqueFileName;
zos.putNextEntry(new ZipEntry(entryName));
zos.write(bytes);
zos.closeEntry();
}
}
}
}
@@ -96,11 +96,11 @@ public class WelfareStatisticsServiceImpl extends BaseServiceImpl<WelfareProject
for (NutMap union : mapUnions) {
// 福利人数
long teacherSum = welfareSelectionList.stream().filter(v -> v.getString("welfareUnionId").equals(union.getString("id"))).count();
long teacherSum = welfareSelectionList.stream().filter(v -> v.getString("welfareUnionId", "").equals(union.getString("id"))).count();
union.put("teacherSum", teacherSum);
// 已选人数
long selectedNum = welfareSelectionList.stream().filter(v -> v.getString("welfareUnionId").equals(union.getString("id")) && v.getBoolean("has_selected")).count();
long selectedNum = welfareSelectionList.stream().filter(v -> v.getString("welfareUnionId", "").equals(union.getString("id")) && v.getBoolean("has_selected")).count();
union.put("selectedNum", selectedNum);
// 未选人数
@@ -247,7 +247,7 @@ public class WelfareStatisticsServiceImpl extends BaseServiceImpl<WelfareProject
cnd.groupBy("u.loginname");
cnd.desc("wl.welfareUnionName").desc("wl.welfareUnitName");
if(StrUtil.isNotBlank(pageForm.getSearchKeyword())){
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("u.loginname", pageForm.getSearchKeyword());
seg.orLike("u.username", pageForm.getSearchKeyword());
@@ -18,6 +18,9 @@
<div :class="{ card_scroll: edit_scroll }">
<slot name="edit"></slot>
</div>
<div style="border-top: 1px solid #ebeef5; padding-top: 10px">
<slot name="edit-footer"></slot>
</div>
</el-card>
<el-card v-if="v === 'view'" key="view" shadow="never" class="animated-card">
@@ -156,7 +159,7 @@ module.exports = {
}
.card_scroll {
max-height: calc(100vh - 56px - 40px - 30px - 50px - 34px);
max-height: calc(100vh - 56px - 40px - 30px - 50px - 34px - 50px - 10px);
overflow-y: auto;
position: relative;
}
@@ -53,7 +53,7 @@ layout("/layouts/platform.html"){
</el-table-column>
</el-table-column>
<el-table-column label="流程节点" prop="processInstanceNodeName"></el-table-column>
<el-table-column label="操作" width="150px" fixed="right">
<el-table-column label="操作" width="200px" fixed="right">
<template scope="{row}">
<el-button size="mini" type="primary"
@click="onOpen(row.id)">
@@ -144,10 +144,14 @@ layout("/layouts/platform.html"){
cancelButtonText: "取消",
type: "warning"
}).then(() => {
$.post("/platform/branchUnionUser/authorization/apply/cancel", row).then((res) => {
this.$message.success(res.msg)
this.pageForm.mode = "EXIT"
this.doSearch()
this.$axios.post("/platform/branchUnionUser/authorization/apply/cancel", row).then((res) => {
if(res.code === 0){
this.$message.success(res.msg)
this.pageForm.mode = "EXIT"
this.doSearch()
}else{
this.$message.error(res.msg)
}
})
})
},
@@ -5,9 +5,19 @@ layout("/layouts/platform.html"){
<div id="app" v-cloak>
<el-row type="flex" :gutter="20" style="height: calc(100vh - 126px)">
<el-col :span="5">
<el-card shadow="never" style="height: 100%" body-style="{ height: '100%' }">
<el-input placeholder="输入关键字进行查找" v-model="filterText" clearable></el-input>
<div style="max-height: calc(100vh - 200px); overflow-y: auto">
<el-card
shadow="never"
style="height: 100%"
:body-style="{ height: '100%', padding: '20px', display: 'flex', flexDirection: 'column',boxSizing: 'border-box' }"
>
<el-input
placeholder="输入关键字进行查找"
v-model="filterText"
clearable
style="margin-bottom: 16px"
prefix-icon="el-icon-search"
></el-input>
<div style="flex: 1; overflow-y: auto; border-radius: 6px; border: 1px solid #e8e8e8; background: #ffffff; padding: 8px">
<el-tree
:data="treeData"
ref="treeRef"
@@ -20,8 +30,59 @@ layout("/layouts/platform.html"){
@node-click="treeNodeClick"
:filter-node-method="filterNode"
highlight-current
style="background: transparent"
node-key="id"
class="custom-tree"
>
<span
class="custom-tree-node"
slot-scope="{ node, data }"
:style="{
display: 'flex',
alignItems: 'center',
padding: '8px 12px',
margin: '2px 0',
borderRadius: '6px',
transition: 'all 0.3s ease',
cursor: 'pointer',
background: node.isCurrent ? '#e6f7ff' : 'transparent',
border: node.isCurrent ? '1px solid #91d5ff' : '1px solid transparent'
}"
@mouseenter="$event.target.style.background = node.isCurrent ? '#e6f7ff' : '#f5f5f5'"
@mouseleave="$event.target.style.background = node.isCurrent ? '#e6f7ff' : 'transparent'"
>
<i
:class="node.level === 1 ? 'el-icon-office-building' : 'el-icon-school'"
:style="{
marginRight: '10px',
color: node.level === 1 ? 'rgb(209 94 46)' : 'var(--color-primary)',
fontSize: '16px'
}"
></i>
<span
:style="{
fontSize: '14px',
color: '#262626',
fontWeight: node.level === 1 ? '600' : '400',
flex: 1
}"
>
{{ node.label }}
</span>
<span
v-if="node.childNodes && node.childNodes.length > 0"
:style="{
fontSize: '12px',
color: '#8c8c8c',
background: '#f0f0f0',
padding: '2px 6px',
borderRadius: '10px',
marginLeft: '8px'
}"
>
{{ node.childNodes.length }}
</span>
</span>
</el-tree>
</div>
</el-card>
@@ -12,225 +12,225 @@ const groupBy = (list, fn) => {
})
}
var ACTIVITY_SPORTS_APPLY_USER = {
template: `
<div style="margin: 20px">
<el-tabs tab-position="top" v-model="activeName">
<el-tab-pane :label="activityTableData.allName" name="1">
<el-card>
<el-transfer
:data="leftApplyUserList"
:filter-method="filterMethod"
:props="{key: 'id',label: 'name'}"
:titles="['可报人员名单', '当前选择']"
filterable
ref="transfer"
v-model="rightApplyUserList">
<template #right-footer>
<div class="transfer">
<el-select :clearable="false"
@change="flushApplyUser(applyUserList)"
placeholder="队伍"
size="small"
v-if="activityTableData.eveProjectType=='2'"
v-model="applyFromData.teamId">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in teamList">
</el-option>
</el-select>
<el-button @click="applyUser" icon="el-icon-plus"
size="small"
type="primary">
参加比赛
</el-button>
</div>
</template>
</el-transfer>
template: /*language=HTML*/ `
<div>
<el-tabs tab-position="top" v-model="activeName">
<el-tab-pane :label="activityTableData.allName" name="1">
<el-card>
<el-transfer
:data="leftApplyUserList"
:filter-method="filterMethod"
:props="{key: 'id',label: 'name'}"
:titles="['可报人员名单', '当前选择']"
filterable
ref="transfer"
v-model="rightApplyUserList">
<template #right-footer>
<div class="transfer">
<el-select :clearable="false"
@change="flushApplyUser(applyUserList)"
placeholder="队伍"
size="small"
v-if="activityTableData.eveProjectType=='2'"
v-model="applyFromData.teamId">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in teamList">
</el-option>
</el-select>
<el-button @click="applyUser" icon="el-icon-plus"
size="small"
type="primary">
参加比赛
</el-button>
</div>
</template>
</el-transfer>
<!-- 个人项目-->
<template v-if="activityTableData.eveProjectType==='1'">
<div style="display: flex;margin: 20px 0">
<el-divider content-position="left">
单项报名人数最多{{activityTableData.athleteMaxNum}}
人,该队已有{{applyUserTableData.length}}
名成员,还可报名{{activityTableData.athleteMaxNum-applyUserTableData.length}}
</el-divider>
</div>
</template>
<!-- 团体项目-->
<template v-if="activityTableData.eveProjectType==='2'">
<!-- 如果是只需要报领队 -->
<div style="display: flex;margin: 20px 0;align-items: center;"
v-if="activityTableData.isLeader">
<el-divider content-position="left">每支队伍最少运动员人数
{{activityTableData.restrictMaxNum}} 人,最多
{{activityTableData.restrictMaxNum}} 人,该队运动员已有
{{activityTableData.athleteMaxNum}} 名成员,还可报名
{{activityTableData.restrictMaxNum-applyUserTableData.filter(v=>v.identity.includes('1')).length}}
人。
</el-divider>
</div>
<!--如果是正常报名-->
<template v-if="!activityTableData.isLeader">
<div style="display: flex;margin: 20px 0;align-items: center;">
<el-divider content-position="left">每支队伍最多
{{activityTableData.restrictMaxNum}}
人,其中领队{{activityTableData.leanderNum}}人,
教练{{activityTableData.coachNum}}人,
运动员必须设置{{activityTableData.athleteMaxNum}}人,
替补{{activityTableData.substituteNum}}人。
男运动员最少{{activityTableData.restrictBoyNum?activityTableData.restrictBoyNum:'0'}}人,
女运动员最少{{activityTableData.restrictGirlNum?activityTableData.restrictGirlNum:'0'}}人【该队运动员已有
{{applyUserTableData.filter(v=>v.identity.includes('1')).length}}
人,还可报名
{{activityTableData.athleteMaxNum-applyUserTableData.filter(v=>v.identity.includes('1')).length}}人;
替补还可以报{{activityTableData.substituteNum-applyUserTableData.filter(v=>v.identity.includes('5')).length}}人(非必需)】
</el-divider>
</div>
<el-button @click="setUserRole('4')"
icon="el-icon-check"
plain
size="small" type="primary"
v-if="activityTableData.deputyDirectorNum>0">
设置处级领导
</el-button>
<el-button @click="setUserRole('3')" icon="el-icon-check" plain
size="small"
type="primary"
v-if="activityTableData.leanderNum>0">设置领队
</el-button>
<el-button @click="setUserRole('2')" icon="el-icon-check" plain
size="small" type="primary"
v-if="activityTableData.coachNum>0">
设置教练
</el-button>
<!-- 个人项目-->
<template v-if="activityTableData.eveProjectType==='1'">
<div style="display: flex;margin: 20px 0">
<el-divider content-position="left">
单项报名人数最多{{activityTableData.athleteMaxNum}}
人,该队已有{{applyUserTableData.length}}
名成员,还可报名{{activityTableData.athleteMaxNum-applyUserTableData.length}}
</el-divider>
</div>
</template>
<!-- 团体项目-->
<template v-if="activityTableData.eveProjectType==='2'">
<!-- 如果是只需要报领队 -->
<div style="display: flex;margin: 20px 0;align-items: center;"
v-if="activityTableData.isLeader">
<el-divider content-position="left">每支队伍最少运动员人数
{{activityTableData.restrictMaxNum}} 人,最多
{{activityTableData.restrictMaxNum}} 人,该队运动员已有
{{activityTableData.athleteMaxNum}} 名成员,还可报名
{{activityTableData.restrictMaxNum-applyUserTableData.filter(v=>v.identity.includes('1')).length}}
人。
</el-divider>
</div>
<!--如果是正常报名-->
<template v-if="!activityTableData.isLeader">
<div style="display: flex;margin: 20px 0;align-items: center;">
<el-divider content-position="left">每支队伍最多
{{activityTableData.restrictMaxNum}}
人,其中领队{{activityTableData.leanderNum}}人,
教练{{activityTableData.coachNum}}人,
运动员必须设置{{activityTableData.athleteMaxNum}}人,
替补{{activityTableData.substituteNum}}人。
男运动员最少{{activityTableData.restrictBoyNum?activityTableData.restrictBoyNum:'0'}}人,
女运动员最少{{activityTableData.restrictGirlNum?activityTableData.restrictGirlNum:'0'}}人【该队运动员已有
{{applyUserTableData.filter(v=>v.identity.includes('1')).length}}
人,还可报名
{{activityTableData.athleteMaxNum-applyUserTableData.filter(v=>v.identity.includes('1')).length}}人;
替补还可以报{{activityTableData.substituteNum-applyUserTableData.filter(v=>v.identity.includes('5')).length}}人(非必需)】
</el-divider>
</div>
<el-button @click="setUserRole('4')"
icon="el-icon-check"
plain
size="small" type="primary"
v-if="activityTableData.deputyDirectorNum>0">
设置处级领导
</el-button>
<el-button @click="setUserRole('3')" icon="el-icon-check" plain
size="small"
type="primary"
v-if="activityTableData.leanderNum>0">设置领队
</el-button>
<el-button @click="setUserRole('2')" icon="el-icon-check" plain
size="small" type="primary"
v-if="activityTableData.coachNum>0">
设置教练
</el-button>
<el-button @click="setUserRole('5')" icon="el-icon-check"
plain
size="small" type="primary"
v-if="activityTableData.substituteNum>0">
设置替补
</el-button>
<el-dropdown @command="changeTeam"
v-if="activityTableData.eveProjectType==2&&teamList.length>1">
<el-button size="small" type="primary">
修改小队<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{item}"
:key="item.id" v-for="item in teamList">
{{item.name}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</template>
<el-table :data="applyUserTableData"
@selection-change="handleSelectionChange" border
class="mt10" ref="multipleTable"
row-key="id" size="small"
stripe
v-loading="applyUserTabLoading">
<el-table-column :reserve-selection="true"
align="center" header-align="center"
type="selection"
width="55">
</el-table-column>
<el-table-column
align="center" header-align="center" label="序号"
type="index"
width="80">
</el-table-column>
<el-table-column
align="center" header-align="center" label="所属队"
prop="team" width="80">
</el-table-column>
<el-table-column
align="center" header-align="center" label="姓名"
prop="username" width="130">
</el-table-column>
<el-table-column
align="center" header-align="center" label="教工号"
prop="loginname" width="130">
</el-table-column>
<el-table-column
align="center" header-align="center" label="单位"
prop="unitname"
sortable>
</el-table-column>
<el-table-column
align="center" header-align="center" label="性别"
prop="sex" width="80">
</el-table-column>
<el-table-column
align="center" header-align="center" label="年龄"
prop="age" width="80">
</el-table-column>
<el-table-column
align="center" header-align="center" label="身份"
prop="identity" width="300px">
<template scope="{$index,row}">
<el-tag :disable-transitions="false"
@close="delApplyUser($index,row,'4')"
closable
effect="light"
type="info"
v-if="row.identity.includes('4')">处级领导
</el-tag>
<el-tag :disable-transitions="false"
@close="delApplyUser($index,row,'3')"
closable
effect="light"
type="warning"
v-if="row.identity.includes('3')">领队
</el-tag>
<el-tag :disable-transitions="false"
@close="delApplyUser($index,row,'2')"
closable
effect="light"
type="success"
v-if="row.identity.includes('2')">教练
</el-tag>
<el-tag :disable-transitions="false"
@close="delApplyUser($index,row,'1')"
closable
effect="light"
v-if="row.identity.includes('1')">运动员
</el-tag>
<el-tag :disable-transitions="false"
@close="delApplyUser($index,row,'5')"
closable
effect="light"
type="danger"
v-if="row.identity.includes('5')">替补
</el-tag>
<el-button @click="setUserRole('5')" icon="el-icon-check"
plain
size="small" type="primary"
v-if="activityTableData.substituteNum>0">
设置替补
</el-button>
<el-dropdown @command="changeTeam"
v-if="activityTableData.eveProjectType==2&&teamList.length>1">
<el-button size="small" type="primary">
修改小队<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{item}"
:key="item.id" v-for="item in teamList">
{{item.name}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</template>
</el-table-column>
</el-table>
</el-card>
</el-tab-pane>
</el-tabs>
</div>
`,
<el-table :data="applyUserTableData"
@selection-change="handleSelectionChange" border
class="mt10" ref="multipleTable"
row-key="id" size="small"
stripe
v-loading="applyUserTabLoading">
<el-table-column :reserve-selection="true"
align="center" header-align="center"
type="selection"
width="55">
</el-table-column>
<el-table-column
align="center" header-align="center" label="序号"
type="index"
width="80">
</el-table-column>
<el-table-column
align="center" header-align="center" label="所属队"
prop="team" width="80">
</el-table-column>
<el-table-column
align="center" header-align="center" label="姓名"
prop="username" width="130">
</el-table-column>
<el-table-column
align="center" header-align="center" label="教工号"
prop="loginname" width="130">
</el-table-column>
<el-table-column
align="center" header-align="center" label="单位"
prop="unitname"
sortable>
</el-table-column>
<el-table-column
align="center" header-align="center" label="性别"
prop="sex" width="80">
</el-table-column>
<el-table-column
align="center" header-align="center" label="年龄"
prop="age" width="80">
</el-table-column>
<el-table-column
align="center" header-align="center" label="身份"
prop="identity" width="300px">
<template scope="{$index,row}">
<el-tag :disable-transitions="false"
@close="delApplyUser($index,row,'4')"
closable
effect="light"
type="info"
v-if="row.identity.includes('4')">处级领导
</el-tag>
<el-tag :disable-transitions="false"
@close="delApplyUser($index,row,'3')"
closable
effect="light"
type="warning"
v-if="row.identity.includes('3')">领队
</el-tag>
<el-tag :disable-transitions="false"
@close="delApplyUser($index,row,'2')"
closable
effect="light"
type="success"
v-if="row.identity.includes('2')">教练
</el-tag>
<el-tag :disable-transitions="false"
@close="delApplyUser($index,row,'1')"
closable
effect="light"
v-if="row.identity.includes('1')">运动员
</el-tag>
<el-tag :disable-transitions="false"
@close="delApplyUser($index,row,'5')"
closable
effect="light"
type="danger"
v-if="row.identity.includes('5')">替补
</el-tag>
</template>
</el-table-column>
</el-table>
</el-card>
</el-tab-pane>
</el-tabs>
</div>
`,
store,
mixins: [initTableMixins],
data() {
@@ -440,7 +440,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
}
//如果是单项
if (this.activityTableData.eveProjectType === '1') {
if (this.activityTableData.eveProjectType === "1") {
if (this.applyUserTableData.length + this.rightApplyUserList.length > this.activityTableData.athleteMaxNum) {
this.$notify({
title: "警告",
@@ -532,7 +532,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
this.applyUserList.push(data)
//如果是单项判断每个人可以报几项
if (this.eventData.restrictRegNumber >= 0 && this.activityTableData.eveProjectType === '1') {
if (this.eventData.restrictRegNumber >= 0 && this.activityTableData.eveProjectType === "1") {
cc.forEach((z) => {
if (z[0]) {
const index = this.applyUserList.findIndex((x) => x.userId === z[0].userId && x.id === null)
@@ -545,7 +545,7 @@ var ACTIVITY_SPORTS_APPLY_USER = {
})
//如果是单项判断每个人可以报几项
if (this.eventData.restrictRegNumber >= 0 && this.activityTableData.eveProjectType === '1') {
if (this.eventData.restrictRegNumber >= 0 && this.activityTableData.eveProjectType === "1") {
const usernames = cc.map((v) => v[0].username).join(",")
if (usernames) {
this.$notify({
@@ -20,18 +20,18 @@ layout("/layouts/platform.html"){
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<guava ref="guava" edit_scroll>
<template>
<el-card shadow="never">
<search @search="activityInfoData">
<search-item label="">
<el-date-picker
@change="activityInfoData"
placeholder="选择年"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy"
@change="activityInfoData"
placeholder="选择年"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy"
></el-date-picker>
</search-item>
@@ -42,18 +42,16 @@ layout("/layouts/platform.html"){
<el-radio-button :label="3">已结束</el-radio-button>
</el-radio-group>
</search-item>
<search-item label=""
v-if="$auth.hasRole('SYSADMIN')||$auth.hasRole('SCHOOL_UNION_ADMIN')">
<search-item label="" v-if="$auth.hasRole('SYSADMIN')||$auth.hasRole('SCHOOL_UNION_ADMIN')">
<el-select
@change="doSearch"
clearable
filterable
placeholder="报名所属分工会"
style="width: 100%"
v-model="pageForm.unionId"
@change="doSearch"
clearable
filterable
placeholder="报名所属分工会"
style="width: 100%"
v-model="pageForm.unionId"
>
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in unionOptions"></el-option>
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unionOptions"></el-option>
</el-select>
</search-item>
</search>
@@ -61,23 +59,16 @@ layout("/layouts/platform.html"){
<el-row class="el-table-container">
<el-carousel :interval="5000" arrow="always" style="margin: 10px auto">
<el-carousel-item :key="index"
v-for="index in Math.ceil(activityList.length/4)">
<el-carousel-item :key="index" v-for="index in Math.ceil(activityList.length/4)">
<el-row :gutter="20">
<el-col :key="item.id" :span="6"
v-for="item in activityList.slice((index-1)*4,index*4)">
<el-card
:class="'box-card '+(item.id===pageForm.activityId?'activeCard':'')"
style="border-radius: 10px">
<div @click="openApply(item)" class="clearfix" slot="header"
style="font-size: 16px; padding: 5px 0">
<el-tooltip :content="item.NAME" class="item" effect="dark"
placement="top-start">
<el-col :key="item.id" :span="6" v-for="item in activityList.slice((index-1)*4,index*4)">
<el-card :class="'box-card '+(item.id===pageForm.activityId?'activeCard':'')" style="border-radius: 10px">
<div @click="openApply(item)" class="clearfix" slot="header" style="font-size: 16px; padding: 5px 0">
<el-tooltip :content="item.NAME" class="item" effect="dark" placement="top-start">
<span v-if="item.NAME.length<=10">{{item.NAME}}</span>
<span v-else>{{item.NAME.substr(0,10)}}...</span>
</el-tooltip>
<el-button @click="openApply(item)"
style="float: right; padding: 3px 0" type="text">
<el-button @click="openApply(item)" style="float: right; padding: 3px 0" type="text">
请选择活动报名
</el-button>
</div>
@@ -87,27 +78,26 @@ layout("/layouts/platform.html"){
<span v-if="item.gameStyle===1">{{item.activityLevelName}}</span>
<el-tag
effect="dark"
style="border-radius: 50%; float: right"
type="danger"
v-if="$moment(item.applyEndTime).valueOf() <$moment().valueOf()"
effect="dark"
style="border-radius: 50%; float: right"
type="danger"
v-if="$moment(item.applyEndTime).valueOf() <$moment().valueOf()"
>
报名结束
</el-tag>
<el-tag
effect="dark"
style="border-radius: 50%; float: right"
type="success"
v-else-if="$moment().valueOf()>$moment(item.applyStartTime).valueOf()
&&$moment().valueOf()<$moment(item.applyEndTime).valueOf()"
effect="dark"
style="border-radius: 50%; float: right"
type="success"
v-else-if="$moment().valueOf()>$moment(item.applyStartTime).valueOf() && $moment().valueOf()<$moment(item.applyEndTime).valueOf()"
>
报名中
</el-tag>
<el-tag
effect="dark"
style="border-radius: 50%; float: right"
type="danger"
v-else-if="$moment().valueOf()<$moment(item.applyEndTime).valueOf()"
effect="dark"
style="border-radius: 50%; float: right"
type="danger"
v-else-if="$moment().valueOf()<$moment(item.applyEndTime).valueOf()"
>
报名未开始
</el-tag>
@@ -118,13 +108,12 @@ layout("/layouts/platform.html"){
</div>
<div class="text e-item">
<span style="color: gray">报名时间:</span>
{{$moment(item.applyStartTime).format('YYYY/MM/DD HH:mm')}}
{{$moment(item.applyEndTime).format('YYYY/MM/DD HH:mm')}}
{{$moment(item.applyStartTime).format('YYYY/MM/DD HH:mm')}}
{{$moment(item.applyEndTime).format('YYYY/MM/DD HH:mm')}}
</div>
<div class="text item">
<span style="color: gray">活动时间:</span>
{{$moment(item.startTime).format('YYYY/MM/DD HH:mm')}}
至 {{$moment(item.endTime).format('YYYY/MM/DD HH:mm')}}
{{$moment(item.startTime).format('YYYY/MM/DD HH:mm')}} 至 {{$moment(item.endTime).format('YYYY/MM/DD')}}
</div>
</div>
</el-card>
@@ -138,73 +127,68 @@ layout("/layouts/platform.html"){
<table-tool label="活动项目信息">
<div class="search-item-option">
<el-select
@change="doSearch"
clearable
filterable
placeholder="请选择组别"
style="width: 100%; margin-bottom: 5px; margin-left: 10px"
v-if="unionLeaderCoach"
v-model="pageForm.groupName"
@change="doSearch"
clearable
filterable
placeholder="请选择组别"
style="width: 100%; margin-bottom: 5px; margin-left: 10px"
v-if="unionLeaderCoach"
v-model="pageForm.groupName"
>
<el-option :key="item.id" :label="item.name" :value="item.name"
v-for="item in groupList"></el-option>
<el-option :key="item.id" :label="item.name" :value="item.name" v-for="item in groupList"></el-option>
</el-select>
</div>
<div class="search-item-option">
<el-select
@change="doSearch"
clearable
filterable
placeholder="请选择活动项目"
style="width: 100%; margin-bottom: 5px; margin-left: 10px"
v-if="unionLeaderCoach"
v-model="pageForm.eventId"
@change="doSearch"
clearable
filterable
placeholder="请选择活动项目"
style="width: 100%; margin-bottom: 5px; margin-left: 10px"
v-if="unionLeaderCoach"
v-model="pageForm.eventId"
>
<el-option :key="item.eventId" :label="item.allName"
:value="item.eventId" v-for="item in eventList"></el-option>
<el-option :key="item.eventId" :label="item.allName" :value="item.eventId" v-for="item in eventList"></el-option>
</el-select>
</div>
<div class="mr10 ml20" v-if="unionLeaderCoach">
领队:
<span style="color: #419bf8">{{leaderData.username?leaderData.username:'暂无'}}</span>
&emsp13; 教练:
<span
style="color: #419bf8">{{coachData.username ?coachData.username:'暂无'}}</span>
<span style="color: #419bf8">{{coachData.username ?coachData.username:'暂无'}}</span>
</div>
<div>
<el-button @click="openLeaderCoach" size="medium" type="primary"
v-if="unionLeaderCoach">设置领队/教练
</el-button>
<el-button @click="openLeaderCoach" size="medium" type="primary" v-if="unionLeaderCoach">设置领队/教练</el-button>
</div>
</table-tool>
<el-table
:data="tableData"
:size="tableSize"
@sort-change="pageOrder"
class="vi-table"
row-key="id"
style="width: 100%; margin-bottom: 20px"
v-loading="tableLoading"
:data="tableData"
:size="tableSize"
@sort-change="pageOrder"
class="vi-table"
row-key="id"
style="width: 100%; margin-bottom: 20px"
v-loading="tableLoading"
>
<el-table-column
:index="indexMethod"
align="center"
header-align="center"
label="序号"
type="index"
width="80px"
:index="indexMethod"
align="center"
header-align="center"
label="序号"
type="index"
width="80px"
></el-table-column>
<el-table-column
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='projectType'">
<span v-if="row.eveProjectType==1">单项</span>
@@ -213,9 +197,7 @@ layout("/layouts/platform.html"){
<template scope="{row}" v-else-if="column.prop=='applyNum'">
<span v-if="row.successUserApply>0&&row.applyType!==3">{{ row.successUserApply }}人</span>
<span
v-else-if="JSON.parse(row.applyWay).length===2&&row.applyWay.includes(1)">
{{row.totalApplyNum}}人</span>
<span v-else-if="JSON.parse(row.applyWay).length===2&&row.applyWay.includes(1)">{{row.totalApplyNum}}人</span>
<span v-else-if="row.totalApplyNum>0&&row.applyType===3">{{ row.totalApplyNum }}人</span>
<span v-else>0人</span>
</template>
@@ -226,98 +208,84 @@ layout("/layouts/platform.html"){
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="报名操作"
width="300px">
<el-table-column align="center" header-align="center" label="报名操作" width="300px">
<template scope="{row}">
<el-button :loading="row.loading" @click="openUniteApply(row)"
size="mini" type="primary"
v-if="row.applyWay.includes(2)">
<el-button :loading="row.loading" @click="openUniteApply(row)" size="mini" type="primary" v-if="row.applyWay.includes(2)">
项目报名
</el-button>
<el-button
:loading="row.loading"
@click="doDelete(row)"
size="mini"
type="danger"
>
删除报名人员
</el-button>
<el-button :loading="row.loading" @click="doDelete(row)" size="mini" type="danger">删除报名人员</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit_func>
<el-button @click="doApplied(false)" type="primary">保 存</el-button>
<el-button @click="doApplied(true)" type="primary">提 交</el-button>
<!-- <el-button @click="doApplied(false)" type="primary">保 存</el-button>-->
<!-- <el-button @click="doApplied(true)" type="primary">提 交</el-button>-->
</template>
<template #edit>
<activity-sports-apply-user @flip="flip"
ref="activityApplyUser"></activity-sports-apply-user>
<activity-sports-apply-user @flip="flip" ref="activityApplyUser"></activity-sports-apply-user>
</template>
<template #edit-footer>
<el-row type="flex" justify="end">
<el-button @click="doApplied(false)" type="primary">保 存</el-button>
<el-button @click="doApplied(true)" type="primary">提 交</el-button>
</el-row>
</template>
<template #public>
<activity-sports-delete-user @flip="flip"
ref="activityDeleteUser"></activity-sports-delete-user>
<activity-sports-delete-user @flip="flip" ref="activityDeleteUser"></activity-sports-delete-user>
</template>
</guava>
<el-dialog :visible.sync="dialogLeaderCoach" title="添加领队/教练" width="60%">
<el-form :model="headData" :rules="formRules" label-width="100px" ref="form"
v-loading="formLoading">
<el-form :model="headData" :rules="formRules" label-width="100px" ref="form" v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="12">
<table-tool label="填写领队信息"></table-tool>
<el-form-item label="姓&emsp;&emsp;名" prop="userId">
<user-select
:option_label_func="(item)=>{return item.username + item.loginname}"
@change="changeLeader"
api="/platform/activity/apply/getUserUnion"
api_input_key_name="query"
ref="userData"
style="width: 100%"
v-model="leaderData.userId"
:option_label_func="(item)=>{return item.username + item.loginname}"
@change="changeLeader"
api="/platform/activity/apply/getUserUnion"
api_input_key_name="query"
ref="userData"
style="width: 100%"
v-model="leaderData.userId"
></user-select>
</el-form-item>
<el-form-item label="所在单位" prop="unitId">
<el-select clearable filterable placeholder="请选择所在单位" style="width: 100%"
v-model="leaderData.unitId">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in unitOptions"></el-option>
<el-select clearable filterable placeholder="请选择所在单位" style="width: 100%" v-model="leaderData.unitId">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unitOptions"></el-option>
</el-select>
</el-form-item>
<el-form-item label="电&emsp;&emsp;话" prop="mobile">
<el-input maxlength="50" placeholder="请填写电话" type="text"
v-model="leaderData.mobile"></el-input>
<el-input maxlength="50" placeholder="请填写电话" type="text" v-model="leaderData.mobile"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<table-tool label="填写教练信息"></table-tool>
<el-form-item label="姓&emsp;&emsp;名" prop="userId">
<user-select
:option_label_func="(item)=>{return item.username + item.loginname}"
@change="changeCoach"
api="/platform/activity/apply/getUserUnion"
api_input_key_name="query"
style="width: 100%"
ref="userData2"
v-model="coachData.userId"
:option_label_func="(item)=>{return item.username + item.loginname}"
@change="changeCoach"
api="/platform/activity/apply/getUserUnion"
api_input_key_name="query"
style="width: 100%"
ref="userData2"
v-model="coachData.userId"
></user-select>
</el-form-item>
<el-form-item label="所在单位" prop="unitId">
<el-select clearable filterable placeholder="请选择所在单位" style="width: 100%"
v-model="coachData.unitId">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in unitOptions"></el-option>
<el-select clearable filterable placeholder="请选择所在单位" style="width: 100%" v-model="coachData.unitId">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unitOptions"></el-option>
</el-select>
</el-form-item>
<el-form-item label="电&emsp;&emsp;话" prop="mobile">
<el-input maxlength="50" placeholder="请填写电话" type="text"
v-model="coachData.mobile"></el-input>
<el-input maxlength="50" placeholder="请填写电话" type="text" v-model="coachData.mobile"></el-input>
</el-form-item>
</el-col>
</el-row>
@@ -328,18 +296,13 @@ layout("/layouts/platform.html"){
</span>
</el-dialog>
<el-dialog
title="活动通知"
:visible.sync="activityNoticeDialog"
width="50%"
>
<div style="margin: 10px; ">
<div style="height: 500px; overflow: auto;"
v-html="activityData.eventNotification"></div>
<el-dialog title="活动通知" :visible.sync="activityNoticeDialog" width="50%">
<div style="margin: 10px">
<div style="height: 500px; overflow: auto" v-html="activityData.eventNotification"></div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="activityNoticeDialog = false">关 闭</el-button>
</span>
<el-button type="primary" @click="activityNoticeDialog = false">关 闭</el-button>
</span>
</el-dialog>
</div>
@@ -367,10 +330,10 @@ layout("/layouts/platform.html"){
groupList: [],
eventList: [],
tableColumns: [
{prop: "allName", label: "项目名称"},
{prop: "projectType", label: "项目类型"},
{prop: "applyNum", label: "已报名人数"},
{prop: "apply_num_bc", label: "暂保存人数"}
{ prop: "allName", label: "项目名称" },
{ prop: "projectType", label: "项目类型" },
{ prop: "applyNum", label: "已报名人数" },
{ prop: "apply_num_bc", label: "暂保存人数" }
],
unionOptions: [],
@@ -450,7 +413,6 @@ layout("/layouts/platform.html"){
this.coachData = {}
if (this.leaderData || this.coachData) {
await this.getUnionCoachLeaderHead()
}
this.dialogLeaderCoach = true
setTimeout(async () => {
@@ -500,8 +462,8 @@ layout("/layouts/platform.html"){
this.coachData = {}
this.headData = {}
this.staffData = {}
const resp = await this.$axios.post(loc() + "/getUnionCoachLeaderHead", {activityId: this.pageForm.activityId})
const {unionCoach, unionLeader, unionHead, unionStaff, userOptions} = resp.data
const resp = await this.$axios.post(loc() + "/getUnionCoachLeaderHead", { activityId: this.pageForm.activityId })
const { unionCoach, unionLeader, unionHead, unionStaff, userOptions } = resp.data
if (unionCoach) {
this.coachData = unionCoach
}
@@ -518,14 +480,14 @@ layout("/layouts/platform.html"){
this.userOptions = userOptions
},
async changeActivity() {
const resp = await this.$axios.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
const resp = await this.$axios.post("/platform/activity/apply/getEvents", { activityId: this.pageForm.activityId })
this.eventList = resp.data
},
pageData() {
this.tabLoading = true
const pageForm = clone(this.pageForm)
pageForm.isMenWomen = JSON.stringify(pageForm.isMenWomen)
this.$axios.post("/platform/activity/apply/pageData", {data: JSON.stringify(pageForm)}).then((res) => {
this.$axios.post("/platform/activity/apply/pageData", { data: JSON.stringify(pageForm) }).then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
@@ -117,15 +117,14 @@ const CLUB_INFO_MANAGE_TEMPLATE = {
</el-dialog>
<el-dialog title="授权身份" :visible.sync="authDialogVisible" width="50%">
<el-form :model="authFormData" ref="authForm" label-width="80px">
<el-form :model="authFormData" ref="authForm" label-width="60px">
<el-form-item label="姓名">
<el-input placeholder="请输入姓名" v-model="authFormData.userName" disabled></el-input>
</el-form-item>
<el-form-item label="工号">
<el-input placeholder="请输入工号" v-model="authFormData.loginName" disabled></el-input>
</el-form-item>
<el-form-item label="身份" prop="roleCode"
:rules="[{required: true, message: '请选择身份', trigger: 'blur'}]">
<el-form-item label="身份" prop="roleCode">
<el-checkbox-group v-model="authFormData.roleCode">
<el-checkbox label="CLUB_PRESIDENT">协会会长</el-checkbox>
<el-checkbox label="CLUB_VICE_PRESIDENT">协会副会长</el-checkbox>
@@ -15,15 +15,18 @@ layout("/layouts/platform.html"){
<table-tool label="数据列表">
<el-button type="primary" size="small" icon="el-icon-plus" @click="onOpen">新增</el-button>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id" style="width: 100%">
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index" width="80px"></el-table-column>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id"
style="width: 100%">
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
width="80px"></el-table-column>
<el-table-column label="名称" prop="name" sortable></el-table-column>
<el-table-column label="年份" prop="year" sortable width="150px"></el-table-column>
<el-table-column label="开始时间" prop="startTime" sortable width="300px"></el-table-column>
<el-table-column label="结束时间" prop="endTime" sortable width="300px"></el-table-column>
<el-table-column label="是否启用" prop="enabled" sortable width="150px">
<template scope="{row}">
<el-tag :type="row.enabled ? 'success' : 'danger'" size="mini">{{row.enabled ? '是' : '否'}}</el-tag>
<el-tag :type="row.enabled ? 'success' : 'danger'" size="mini">{{row.enabled ? '是' : '否'}}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="200px">
@@ -37,10 +40,12 @@ layout("/layouts/platform.html"){
</el-card>
</guava>
<el-dialog :title="formData.id ? '编辑' : '新增'" :visible.sync="dialogVisible" :close-on-click-modal="false" width="60%">
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px">
<el-dialog :title="formData.id ? '编辑' : '新增'" :visible.sync="dialogVisible" :close-on-click-modal="false"
width="60%">
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px">
<el-form-item label="考核年份" prop="year">
<el-date-picker v-model="formData.year" type="year" value-format="yyyy" placeholder="考核年份" style="width: 100%"></el-date-picker>
<el-date-picker v-model="formData.year" type="year" value-format="yyyy" placeholder="考核年份"
style="width: 100%"></el-date-picker>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="formData.name" placeholder="名称"></el-input>
@@ -49,22 +54,22 @@ layout("/layouts/platform.html"){
<el-col :span="12">
<el-form-item label="开始时间" prop="startTime">
<el-date-picker
v-model="formData.startTime"
style="width: 100%"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="开始时间"
v-model="formData.startTime"
style="width: 100%"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="开始时间"
></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结束时间" prop="endTime">
<el-date-picker
v-model="formData.endTime"
style="width: 100%"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="结束时间"
v-model="formData.endTime"
style="width: 100%"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="结束时间"
></el-date-picker>
</el-form-item>
</el-col>
@@ -72,6 +77,17 @@ layout("/layouts/platform.html"){
<el-form-item label="通知内容" prop="content">
<text-editor v-model="formData.content"></text-editor>
</el-form-item>
<el-form-item label="自定义表单">
<div style="display: flex;align-items: center;height: 40px">
<el-switch v-model="formData.isCustomForm" style="margin-right: 10px"></el-switch>
<custom-form-field v-model="formData.formConfig" v-if="formData.isCustomForm"></custom-form-field>
</div>
</el-form-item>
<!-- <el-form-item label="报名表单" prop="formConfig" v-if="formData.isCustomForm">-->
<!-- <custom-form-field v-model="formData.formConfig"></custom-form-field>-->
<!-- </el-form-item>-->
<el-form-item label="是否启用" prop="enabled">
<el-switch v-model="formData.enabled"></el-switch>
</el-form-item>
@@ -91,12 +107,12 @@ layout("/layouts/platform.html"){
return {
dialogVisible: false,
formRules: {
name: [{ required: true, message: "名称不能为空", trigger: ["blur", "change"] }],
content: [{ required: true, message: "通知内容不能为空", trigger: ["blur", "change"] }],
year: [{ required: true, message: "考核年份不能为空", trigger: ["blur", "change"] }],
startTime: [{ required: true, message: "开始时间不能为空", trigger: ["blur", "change"] }],
endTime: [{ required: true, message: "结束时间不能为空", trigger: ["blur", "change"] }],
enabled: [{ required: true, message: "是否启用不能为空", trigger: ["blur", "change"] }]
name: [{required: true, message: "名称不能为空", trigger: ["blur", "change"]}],
content: [{required: true, message: "通知内容不能为空", trigger: ["blur", "change"]}],
year: [{required: true, message: "考核年份不能为空", trigger: ["blur", "change"]}],
startTime: [{required: true, message: "开始时间不能为空", trigger: ["blur", "change"]}],
endTime: [{required: true, message: "结束时间不能为空", trigger: ["blur", "change"]}],
enabled: [{required: true, message: "是否启用不能为空", trigger: ["blur", "change"]}]
}
}
},
@@ -111,13 +127,15 @@ layout("/layouts/platform.html"){
onEdit(row) {
this.dialogVisible = true
this.$nextTick(() => {
this.formData = { ...row }
this.formData = {...row}
})
},
onSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$axios.post("/platform/buildHome/act/save", this.formData).then((res) => {
this.$axios.post("/platform/buildHome/act/save", {
act: JSON.stringify(this.formData)
}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.dialogVisible = false
@@ -7,22 +7,33 @@ const kpiForm = {
<el-form-item label="考核名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入考核名称"></el-input>
</el-form-item>
<el-row :gutter="20" type="flex">
<el-form-item label="考核年度" prop="year">
<el-date-picker v-model="formData.year" type="year" placeholder="选择年"
value-format="yyyy"></el-date-picker>
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker v-model="formData.startTime" type="date" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期"></el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker v-model="formData.endTime" type="date" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期"></el-date-picker>
</el-form-item>
<el-row>
<el-col :span="8">
<el-form-item label="考核年度" prop="year">
<el-date-picker v-model="formData.year" type="year" placeholder="选择年"
value-format="yyyy"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="开始时间" prop="startTime">
<el-date-picker v-model="formData.startTime" type="date" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="结束时间" prop="endTime">
<el-date-picker v-model="formData.endTime" type="date" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="是否开启" prop="enable">
<el-switch v-model="formData.enable" :active-value="1" :inactive-value="0"></el-switch>
<el-form-item label="关联事项" prop="actId">
<el-select v-model="formData.actId">
<el-option v-for="item in actOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否开启" prop="enabled">
<el-switch v-model="formData.enabled"></el-switch>
</el-form-item>
<div class="process-title">考核内容</div>
@@ -48,7 +59,8 @@ const kpiForm = {
<template v-for="(category,categoryIndex) in formData.categoryList">
<tr v-for="(item,itemIndex) in category.items"
:class="{'category-split':itemIndex+1===category.items.length}">
<td v-if="itemIndex===0" :rowspan="category.items.length" class="text-center" style="width: 10%">
<td v-if="itemIndex===0" :rowspan="category.items.length" class="text-center"
style="width: 10%">
<div>{{categoryIndex+1}}</div>
</td>
<td v-if="itemIndex===0" :rowspan="category.items.length" style="width: 10%">
@@ -194,28 +206,31 @@ const kpiForm = {
dialogVisible: false,
formData: {
categoryList: [],
scoreLevels:[]
scoreLevels: []
},
formRules: {
name: [{ required: true, message: "请输入考核名称", trigger: ["change", "blur"] }],
code: [{ required: true, message: "请输入考核代码", trigger: ["change", "blur"] }],
year: [{ required: true, message: "请输入考核年份", trigger: ["change", "blur"] }],
startTime: [{ required: true, message: "请输入考核时间", trigger: ["change", "blur"] }],
endTime: [{ required: true, message: "请输入考核时间", trigger: ["change", "blur"] }]
name: [{required: true, message: "请输入考核名称", trigger: ["change", "blur"]}],
code: [{required: true, message: "请输入考核代码", trigger: ["change", "blur"]}],
year: [{required: true, message: "请输入考核年份", trigger: ["change", "blur"]}],
startTime: [{required: true, message: "请输入考核时间", trigger: ["change", "blur"]}],
endTime: [{required: true, message: "请输入考核时间", trigger: ["change", "blur"]}],
actId: [{required: true, message: "请选择活动事项", trigger: ["change", "blur"]}]
},
newCategory: {
name: "",
code: "",
sortOrder: 1,
items: []
}
},
actOptions: []
}
},
methods: {
onOpen(id = null) {
this.visible = true
this.listAct()
if (id) {
$.post("/platform/buildHome/kpi/plan/get", { id }).then((res) => {
$.post("/platform/buildHome/kpi/plan/get", {id}).then((res) => {
if (res.code === 0) {
res.data.year = res.data.year.toString()
@@ -228,11 +243,19 @@ const kpiForm = {
} else {
this.formData = {
categoryList: [],
scoreLevels:[]
scoreLevels: []
}
}
},
listAct() {
this.$axios.get("/platform/buildHome/material/query/listAct").then((res) => {
if (res.code === 0) {
this.actOptions = res.data
}
})
},
onSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
@@ -323,6 +346,7 @@ const kpiForm = {
}
},
// 添加考核分类
addCategory() {
if (!this.newCategory.name || !this.newCategory.code) {
this.$message.warning("请填写完整信息")
@@ -348,7 +372,7 @@ const kpiForm = {
}
}
],
$edit_status: { name: false }
$edit_status: {name: false}
}
this.formData.categoryList.push(category)
@@ -356,6 +380,7 @@ const kpiForm = {
this.$message.success("添加成功")
},
// 添加考核项目
addNewItem(categoryIndex) {
const category = this.formData.categoryList[categoryIndex]
const newItem = {
@@ -383,7 +408,8 @@ const kpiForm = {
this.formData.categoryList.splice(cateGoryIndex, 1)
this.$message.success("删除成功")
})
.catch(() => {})
.catch(() => {
})
},
// 删除考核内容
@@ -397,7 +423,8 @@ const kpiForm = {
this.formData.categoryList[cateGoryIndex].items.splice(itemIndex, 1)
this.$message.success("删除成功")
})
.catch(() => {})
.catch(() => {
})
}
},
style: /*language=CSS*/ `
@@ -442,7 +469,7 @@ const kpiForm = {
bottom: 0;
background-color: white;
}
.kpi-plus table tbody tr td {
padding: 14px 20px;
color: rgb(17 24 39);
@@ -473,10 +500,10 @@ const kpiForm = {
border-bottom: 1px solid rgb(33 40 53);
}
.kpi-plus .score-levels-table .el-input-number{
width: unset!important;
.kpi-plus .score-levels-table .el-input-number {
width: unset !important;
}
.td-extra {
/*display: none;*/
@@ -9,7 +9,7 @@ layout("/layouts/platform.html"){
.alert {
padding: 15px;
background-color: #e8f4ff;
border-left: 4px solid var(--color-primary);
border-left: 4px solid #1890ff;
margin-bottom: 25px;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
@@ -29,7 +29,7 @@ layout("/layouts/platform.html"){
}
.alert i {
color: var(--color-primary);
color: #1890ff;
margin-right: 8px;
}
@@ -54,7 +54,7 @@ layout("/layouts/platform.html"){
}
.book-header {
background: linear-gradient(120deg, var(--color-primary), var(--color-primary-8));
background: linear-gradient(120deg, #1e3c72, #2a5298);
color: white;
padding: 30px;
text-align: center;
@@ -107,7 +107,7 @@ layout("/layouts/platform.html"){
font-size: 18px;
font-weight: bold;
margin-bottom: 20px;
color: var(--color-primary);
color: #1867b0;
position: relative;
padding-left: 15px;
}
@@ -30,7 +30,7 @@ layout("/layouts/platform.html"){
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<material-write ref="materialWriteRef"></material-write>
<material-write ref="materialWriteRef" @refresh="doSearch"></material-write>
<material-info ref="materialInfoRef"></material-info>
</div>
@@ -7,22 +7,29 @@ layout("/layouts/platform.html"){
<search @search="doSearch">
<search-item label="评比事项">
<el-select v-model="pageForm.actId" placeholder="考核活动" clearable>
<el-option v-for="item in actOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
<el-option v-for="item in actOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="数据列表">
<el-button size="small" type="primary" icon="el-icon-download" @click="exportZip">导出汇总表</el-button>
<el-button size="small" type="primary" icon="el-icon-download" @click="exportZip">导出材料汇总表</el-button>
<el-button size="small" type="primary" icon="el-icon-download" @click="exportScore">导出自评分汇总表
</el-button>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id" style="width: 100%">
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index" width="80px"></el-table-column>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id"
style="width: 100%">
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
width="80px"></el-table-column>
<el-table-column label="分工会名称" prop="unionName" sortable></el-table-column>
<el-table-column label="分工会编码" prop="unionCode" sortable></el-table-column>
<el-table-column label="填写状态" prop="isWrite">
<template scope="{row}">
<el-tag :type="row.isWrite ? 'success' : 'danger'" size="mini">{{row.isWrite ? '已填写' : '未填写'}}</el-tag>
<el-tag :type="row.isWrite ? 'success' : 'danger'" size="mini">{{row.isWrite ? '已填写' :
'未填写'}}
</el-tag>
</template>
</el-table-column>
<!-- <el-table-column label="建家记录册" prop="logBookFiles">-->
@@ -33,7 +40,8 @@ layout("/layouts/platform.html"){
<!-- <el-table-column label="年度工作总结和工作大事记录" prop="annualWorkSummaryFiles"></el-table-column>-->
<el-table-column label="操作" fixed="right" width="200px">
<template scope="{row}">
<el-button size="mini" type="primary" @click="$refs.infoRef.onOpen(pageForm.actId,row.id)">查看</el-button>
<el-button size="mini" type="primary" @click="$refs.infoRef.onOpen(pageForm.actId,row.id)">查看
</el-button>
</template>
</el-table-column>
</el-table>
@@ -49,7 +57,7 @@ layout("/layouts/platform.html"){
new Vue({
el: "#app",
mixins: [initTableMixins],
components: { info },
components: {info},
data() {
return {
actOptions: [],
@@ -57,6 +65,9 @@ layout("/layouts/platform.html"){
actId: null
}
}
},
computed: {
},
methods: {
listAct() {
@@ -70,8 +81,11 @@ layout("/layouts/platform.html"){
}
})
},
exportZip(){
this.$downLoad('/platform/buildHome/material/query/exportZip', this.pageForm)
exportZip() {
this.$downLoad('/platform/buildHome/material/query/exportZip', this.pageForm)
},
exportScore() {
this.$downLoad('/platform/buildHome/material/query/exportScore', this.pageForm)
}
},
created() {
@@ -1,7 +1,7 @@
const info = {
template: /*language=HTML*/ `
<el-dialog title="查看详情" :visible.sync="visible" width="50%">
<div class="upload-list">
<div class="upload-list" v-if="!isCustomForm">
<div class="upload-item">
<div class="upload-item-title">
<i class="fa fa-book"></i>
@@ -34,17 +34,48 @@ const info = {
<file-preview :files="viewData.annualWorkSummaryFiles" complete_result></file-preview>
</div>
</div>
<div v-else>
<form-create
v-if="visible"
:key="actId+unionId"
:value.sync="viewData.dynamicFormData"
:rule="formCreateRule"
:option="formCreateOption"
disabled
></form-create>
</div>
</el-dialog>
`,
data() {
return {
activity: {},
viewData: {},
visible: false
}
},
computed: {
isCustomForm() {
if(this.activity){
return this.activity.isCustomForm
}
return false
}
},
methods: {
onOpen(actId, unionId) {
async onOpen(actId, unionId) {
this.viewData = {}
this.visible = true
const {code,data,msg} = await this.$axios.post("/platform/buildHome/material/act", {actId})
if (code === 0) {
this.activity = data
if (this.activity.isCustomForm) {
this.formCreateRule = formCreate.parseJson(this.activity.formConfig.rule)
this.formCreateOption = formCreate.parseJson(this.activity.formConfig.options)
}
}
this.$axios
.post("/platform/buildHome/material/query/infoByUnionId", {
actId,
@@ -52,9 +83,9 @@ const info = {
})
.then((res) => {
if (res.code === 0) {
if(res.data){
if (res.data) {
this.viewData = res.data
}else{
} else {
this.viewData = {}
}
} else {
@@ -6,8 +6,9 @@ const write = {
当前时间不在提交时间范围内,无法提交材料。提交时间:
{{ activity.startTime }} 至 {{ activity.endTime }}
</div>
<div class="upload-list">
<!--非自定义表单-->
<div class="upload-list" v-if="!isCustomForm">
<div class="upload-item">
<div class="upload-item-title">
<i class="fa fa-book"></i>
@@ -19,13 +20,13 @@ const write = {
,导出签字盖章后上传扫描件
</div>
<file-upload
:value.sync="formData.logBookFiles"
:upload_number="1"
upload_result_category="array"
complete_result
upload_text="选择文件"
upload_button_size="medium"
:disabled="!isWithinTimeRange"
:value.sync="formData.logBookFiles"
:upload_number="1"
upload_result_category="array"
complete_result
upload_text="选择文件"
upload_button_size="medium"
:disabled="!isWithinTimeRange"
></file-upload>
</div>
@@ -40,13 +41,13 @@ const write = {
,填写完导出后签字盖章后上传扫描件
</div>
<file-upload
:value.sync="formData.selfEvaluationFiles"
:upload_number="1"
upload_result_category="array"
complete_result
upload_text="选择文件"
upload_button_size="medium"
:disabled="!isWithinTimeRange"
:value.sync="formData.selfEvaluationFiles"
:upload_number="1"
upload_result_category="array"
complete_result
upload_text="选择文件"
upload_button_size="medium"
:disabled="!isWithinTimeRange"
></file-upload>
</div>
@@ -61,13 +62,13 @@ const write = {
,填写完导出后签字盖章后上传扫描件
</div>
<file-upload
:value.sync="formData.summaryFiles"
:upload_number="1"
upload_result_category="array"
complete_result
upload_text="选择文件"
upload_button_size="medium"
:disabled="!isWithinTimeRange"
:value.sync="formData.summaryFiles"
:upload_number="1"
upload_result_category="array"
complete_result
upload_text="选择文件"
upload_button_size="medium"
:disabled="!isWithinTimeRange"
></file-upload>
</div>
@@ -78,23 +79,34 @@ const write = {
</div>
<div class="upload-hint">请上传年度工作总结和工作大事记电子版</div>
<file-upload
:value.sync="formData.annualWorkSummaryFiles"
:upload_number="5"
upload_result_category="array"
complete_result
upload_text="选择文件"
upload_button_size="medium"
:disabled="!isWithinTimeRange"
:value.sync="formData.annualWorkSummaryFiles"
:upload_number="5"
upload_result_category="array"
complete_result
upload_text="选择文件"
upload_button_size="medium"
:disabled="!isWithinTimeRange"
></file-upload>
</div>
</div>
<div class="notice-box">
<!--自定义表单-->
<div v-if="isCustomForm">
<!-- <div class="process-title">填写报名信息</div>-->
<form-create
:value.sync="formData.dynamicFormData"
v-model="fapi"
:rule="formCreateRule"
:option="formCreateOption"
></form-create>
</div>
<div class="notice-box" v-if="!isCustomForm">
<i class="fa fa-exclamation-triangle"></i>
<strong>重要提示:</strong>
建家记录册、教职工之家建设考核评议自评表需由党委主要负责人签字盖章后扫描件上传
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="visible = false">取 消</el-button>
@@ -113,7 +125,12 @@ const write = {
selfEvaluationFiles: [],
summaryFiles: [],
annualWorkSummaryFiles: []
}
},
formCreateRule: [],
formCreateOption: {},
fapi: null,
}
},
computed: {
@@ -126,20 +143,27 @@ const write = {
const endTime = new Date(this.activity.endTime).getTime()
return now >= startTime && now <= endTime
}
},
isCustomForm() {
return this.activity && this.activity.isCustomForm
},
},
methods: {
onOpen(id) {
this.visible = true
this.actId = id
this.$axios.post("/platform/buildHome/material/act", { actId: id }).then((res) => {
this.$axios.post("/platform/buildHome/material/act", {actId: id}).then((res) => {
if (res.code === 0) {
this.activity = res.data
if (this.activity.formConfig) {
this.formCreateRule = formCreate.parseJson(this.activity.formConfig.rule)
this.formCreateOption = formCreate.parseJson(this.activity.formConfig.options)
}
} else {
this.$message.error(res.msg)
}
})
this.$axios.post("/platform/buildHome/material/info", { actId: id }).then((res) => {
this.$axios.post("/platform/buildHome/material/info", {actId: id}).then((res) => {
if (res.code === 0) {
this.formData = res.data
} else {
@@ -148,29 +172,42 @@ const write = {
})
},
onSubmit() {
async onSubmit() {
if (!this.isWithinTimeRange) {
this.$message.error("当前时间不在活动时间范围内,无法提交材料")
return
}
if (this.formData.logBookFiles.length === 0) {
this.$message.warning("请上传建家记录册")
return false
if(!this.isCustomForm){
if (this.formData.logBookFiles.length === 0) {
this.$message.warning("请上传建家记录册")
return false
}
if (this.formData.selfEvaluationFiles.length === 0) {
this.$message.warning("请上传自评表")
return false
}
if (this.formData.summaryFiles.length === 0) {
this.$message.warning("请上传职工小家建设情况汇总")
return false
}
}
if (this.formData.selfEvaluationFiles.length === 0) {
this.$message.warning("请上传自评表")
return false
}
if (this.formData.summaryFiles.length === 0) {
this.$message.warning("请上传职工小家建设情况汇总")
return false
if (this.isCustomForm && this.fapi) {
let formValid = false
try {
await this.fapi.validate()
formValid = true
} catch (e) {
formValid = false
}
if (!formValid) return
}
this.$axios
.post("/platform/buildHome/material/submit", { material: JSON.stringify(this.formData) })
.post("/platform/buildHome/material/submit", {material: JSON.stringify(this.formData)})
.then((res) => {
if (res.code === 0) {
this.$message.success("提交成功")
@@ -24,7 +24,7 @@ layout("/layouts/platform.html"){
<el-table-column prop="honorTypeName" label="荣誉类型"></el-table-column>
<el-table-column label="操作" width="200px">
<template slot-scope="{row}">
<el-button size="mini" type="primary" @click="openView(row)">查看</el-button>
<!-- <el-button size="mini" type="primary" @click="openView(row)">查看</el-button>-->
<el-button size="mini" type="primary" @click="openApply(row)">申请</el-button>
</template>
</el-table-column>
@@ -47,12 +47,7 @@ layout("/layouts/platform_h5.html"){
}
</style>
<div id="app" v-cloak>
<van-nav-bar
title="活动详情"
left-text="返回"
left-arrow
@click-left="$pjaxReplace('/platform/mobile/trainSignUpActivity/trainList')"
></van-nav-bar>
<van-nav-bar title="活动详情" @click-left="historyBack" left-arrow left-text="返回" placeholder fixed></van-nav-bar>
<van-image height="186" src="/assets/mobile/img/trainSignUp/3quhtakfd4heeqsk6irqhft60p.png"></van-image>
<div class="title">{{activity.activityName}}</div>
@@ -147,12 +147,7 @@ layout("/layouts/platform_h5.html"){
}
</style>
<div id="app" v-cloak>
<van-nav-bar
:title="trainType + '列表'"
left-text="返回"
left-arrow
@click-left="$pjaxReplace('/platform/mobile/trainSignUpActivity/trainList?isMySign=' + isMySign)"
></van-nav-bar>
<van-nav-bar :title="trainType + '列表'" @click-left="historyBack" left-arrow left-text="返回" placeholder fixed></van-nav-bar>
<van-sticky>
<van-dropdown-menu>
@@ -727,7 +722,8 @@ layout("/layouts/platform_h5.html"){
async pageData() {
const resp = await this.$axios.post("/platform/mobile/trainSignUpActivity/findOne", {
id: this.activityId,
tabIndex: this.activityStatus
tabIndex: this.activityStatus,
fromMode: 'mobile',
})
if (resp.code === 0) {
this.tableData = resp.data
@@ -147,7 +147,7 @@ layout("/layouts/platform_h5.html"){
<van-tabbar v-model="pageForm.activityType" @change="doSearch">
<van-tabbar-item icon="wap-home-o">活动列表</van-tabbar-item>
<van-tabbar-item icon="user-o">我报名</van-tabbar-item>
<van-tabbar-item icon="user-o">报名</van-tabbar-item>
</van-tabbar>
</div>