diff --git a/src/main/java/io/v/nutz/base/utils/ManyAddOrRenewUtil.java b/src/main/java/io/v/nutz/base/utils/ManyAddOrRenewUtil.java new file mode 100644 index 0000000..a74eb9d --- /dev/null +++ b/src/main/java/io/v/nutz/base/utils/ManyAddOrRenewUtil.java @@ -0,0 +1,80 @@ +package io.v.nutz.base.utils; + +import io.v.nutz.sys.models.Sys_user; +import org.nutz.dao.Dao; +import org.nutz.ioc.loader.annotation.Inject; +import org.nutz.ioc.loader.annotation.IocBean; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.*; + +/** + * @version 1.0 + * @Author zzr + * @name:ManyAddOrRenewUtil + * @Date 2024/7/24 16:16 + * @注释 + */ +@IocBean +public class ManyAddOrRenewUtil { + + @Inject + private Dao dao; + + /** + * 批量新增或更新 + * @param list + * @param mode true新增;false更新 + * @param + * @return + */ + public void addOrRenew(List list, boolean mode) { + try { + executeInBatches(list, mode); + } catch (Exception e) { + // 在实际应用中,应该有更精细的异常处理策略 + e.printStackTrace(); + } + } + + private void executeInBatches(List list, boolean mode) throws InterruptedException, ExecutionException { + int numberOfThreads = Runtime.getRuntime().availableProcessors() * 2; + ExecutorService executorService = Executors.newFixedThreadPool(numberOfThreads); + ExecutorCompletionService ecs = new ExecutorCompletionService<>(executorService); + + int batchSize = 100; + + // 在调用ecs.submit的地方添加futures列表 + List> futures = new ArrayList<>(); + for (int i = 0; i < list.size(); i += batchSize) { + final int end = Math.min(i + batchSize, list.size()); + List batch = list.subList(i, end); + + Future future = ecs.submit(() -> processBatch(batch, mode)); + futures.add(future); + } + + completeAllTasks(ecs, futures); + + // 关闭线程池 + executorService.shutdown(); + } + + private Void processBatch(List batch, boolean mode) { + // 执行数据库更新操作 + if (mode) { + dao.fastInsert(batch); + } else { + dao.update(batch); + } + return null; + } + + private void completeAllTasks(ExecutorCompletionService ecs, List> futures) throws InterruptedException, ExecutionException { + for (Future future : futures) { + // 等待任务完成 + future.get(); + } + } +} diff --git a/src/main/java/io/v/nutz/zhgh/healthCheckup/controller/HealthCheckupListController.java b/src/main/java/io/v/nutz/zhgh/healthCheckup/controller/HealthCheckupListController.java index 47ea0c3..8888e5b 100644 --- a/src/main/java/io/v/nutz/zhgh/healthCheckup/controller/HealthCheckupListController.java +++ b/src/main/java/io/v/nutz/zhgh/healthCheckup/controller/HealthCheckupListController.java @@ -61,46 +61,42 @@ public class HealthCheckupListController { Cnd cnd = Cnd.NEW(); Sql sql = Sqls.create(""" SELECT - u.id, - u.loginname, - u.username, - u.sex, - u.unionname, - u.unitname, - u.threeUnitName, - u.unionGroupName, + hcu.userId AS id, + hcu.loginname, + hcu.username, + hcu.sex, + hcu.unionname, + hcu.unitname, + hcu.threeUnitName, + hcu.unionGroupName, hcus.selectTime, hcus.subjectId, hcus.campus, - hcus.userSign, - aus.id ausid + hcus.userSign FROM - activity_user_scope aus - LEFT JOIN `user` u ON u.id = aus.userId - LEFT JOIN health_checkup_user_selection hcus ON aus.userId = hcus.selectUserId + health_checkup_user hcu + LEFT JOIN health_checkup_user_selection hcus ON hcu.userId = hcus.selectUserId AND hcus.projectId=@projectId $condition """).setParam("projectId", projectId); sql.setCondition(cnd); - cnd.andEX("aus.groupId", "=", project.getActivityGroupId()); - cnd.andEX("u.unionid", "=", unionId); - cnd.andEX("u.unitId", "=", unitId); - cnd.andEX("u.unionGroupId", "=", unionGroupId); - cnd.andEX("u.threeUnitId", "=", threeUnitId); + cnd.andEX("hcu.unionId", "=", unionId); + cnd.andEX("hcu.unitId", "=", unitId); + cnd.andEX("hcu.unionGroupId", "=", unionGroupId); + cnd.andEX("hcu.threeUnitId", "=", threeUnitId); if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) { - cnd.andEX("u.unionid", "=", Vi.getUnionId()); + cnd.andEX("hcu.unionId", "=", Vi.getUnionId()); } if (StrUtil.isNotBlank(pageForm.getSearchName()) && StrUtil.isNotBlank(pageForm.getSearchKeyword())) { cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword())); } - if (Vi.isNotBlank(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) { - cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy().equalsIgnoreCase("ascending") ? "ASC" : "DESC"); + cnd.orderBy(pageForm.getPageOrderName(), "ascending".equalsIgnoreCase(pageForm.getPageOrderBy()) ? "ASC" : "DESC"); } else { - cnd.desc("hcus.selectTime").desc("u.unitcode").desc("u.unioncode"); + cnd.desc("hcus.selectTime").asc("hcu.unitId"); } Pagination pagination = healthCheckupProjectService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql); List paginationList = pagination.getList(); @@ -111,7 +107,6 @@ public class HealthCheckupListController { HealthCheckupProjectSubject subject = subjects.stream().filter(s -> s.getId().equals(v.getString("subjectId"))).findFirst().orElse(null); v.setv("optionName", subject.getOptionName()); } - }); return pagination; } diff --git a/src/main/java/io/v/nutz/zhgh/healthCheckup/controller/HealthCheckupProjectMangeController.java b/src/main/java/io/v/nutz/zhgh/healthCheckup/controller/HealthCheckupProjectMangeController.java index 1aca41c..6e78a3f 100644 --- a/src/main/java/io/v/nutz/zhgh/healthCheckup/controller/HealthCheckupProjectMangeController.java +++ b/src/main/java/io/v/nutz/zhgh/healthCheckup/controller/HealthCheckupProjectMangeController.java @@ -5,21 +5,27 @@ import cn.hutool.core.util.StrUtil; import io.v.nutz.base.annontation.ViReturn; import io.v.nutz.zhgh.data.model.MatchConditionStructure; import io.v.nutz.zhgh.data.service.MatchConditionStructureService; -import io.v.nutz.zhgh.healthCheckup.model.HealthCheckupProject; -import io.v.nutz.zhgh.healthCheckup.model.HealthCheckupProjectSubject; +import io.v.nutz.zhgh.healthCheckup.model.*; import io.v.nutz.zhgh.healthCheckup.service.HealthCheckupProjectService; import io.v.nutz.base.query.PageForm; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.nutz.aop.interceptor.ioc.TransAop; import org.nutz.dao.Cnd; +import org.nutz.dao.Sqls; +import org.nutz.dao.sql.Sql; +import org.nutz.dao.util.Daos; import org.nutz.ioc.aop.Aop; import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.lang.Lang; +import org.nutz.lang.util.NutMap; import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; import org.nutz.mvc.annotation.Param; +import java.util.List; +import java.util.stream.Collectors; + /** * @ClassName HealthCheckupProjectMangeController * @Description TODO @@ -78,15 +84,35 @@ public class HealthCheckupProjectMangeController { @At @ViReturn - @RequiresPermissions("welfare.project.mange") + @RequiresPermissions("healthCheckup.projectMange") public Object pageData(PageForm pageForm, @Param(value = "year", required = false) Integer year, @Param(value = "name", required = false) String name) { + Sql sql = Sqls.create(""" + SELECT + hcp.id, + hcp.`year`, + hcp.`name`, + hcp.choiceTimeStart, + hcp.choiceTimeEnd, + hcp.activityGroupId, + hcp.cover, + hcp.activityGroupName, + hcp.provideTimeStart, + hcp.provideTimeEnd, + hcp.healthCheckupType, + IF((select count(userId) from health_checkup_user hcu where hcu.projectId = hcp.id) > 0,true,false) AS isHasUserList, + IF(NOW() > hcp.choiceTimeStart AND NOW() < hcp.choiceTimeEnd, true, false) AS isWithinChoiceTime + FROM + health_checkup_project hcp + $condition + """); Cnd cnd = Cnd.NEW(); - cnd.andEX("year", "=", year); - cnd.andEX("name", "=", name); - cnd.desc("choiceTimeStart"); - return healthCheckupProjectService.list(pageForm, cnd); + cnd.andEX("hcp.`year`", "=", year); + cnd.andEX("hcp.`name`", "=", name); + cnd.desc("hcp.choiceTimeStart"); + sql.setCondition(cnd); + return healthCheckupProjectService.listPageMap(pageForm.getPageNumber(),pageForm.getPageSize(),sql); } @At @@ -98,7 +124,7 @@ public class HealthCheckupProjectMangeController { @At @ViReturn @Aop(TransAop.READ_COMMITTED) - @RequiresPermissions("welfare.project.mange") + @RequiresPermissions("healthCheckup.projectMange") public Object doDelete(String id) { healthCheckupProjectService.delete(id); healthCheckupProjectService.dao().clear(HealthCheckupProjectSubject.class, Cnd.where("projectId", "=", id)); @@ -112,4 +138,56 @@ public class HealthCheckupProjectMangeController { } + /** + * 创建体检名单 + * @param healthCheckupProject + * @return + */ + @At + @ViReturn + @Aop(TransAop.READ_COMMITTED) + @RequiresPermissions("healthCheckup.projectMange") + public Object createUserList(HealthCheckupProject healthCheckupProject){ + healthCheckupProjectService.addHealthCheckupUser(healthCheckupProject); + return null; + } + + + /** + * 更新名单 + * @param healthCheckupProject + * @return + */ + @At + @ViReturn + @Aop(TransAop.READ_COMMITTED) + @RequiresPermissions("healthCheckup.projectMange") + public Object renewUserList(HealthCheckupProject healthCheckupProject){ + healthCheckupProjectService.renewHealthCheckupUser(healthCheckupProject); + return null; + } + + + /** + * 重置名单 + * @param healthCheckupProject + * @return + */ + @At + @ViReturn + @Aop(TransAop.READ_COMMITTED) + @RequiresPermissions("healthCheckup.projectMange") + public Object resetUserList(HealthCheckupProject healthCheckupProject){ + //重置名单,清空已选择的用户记录 + Sql sql = Sqls.create("select id,selectUserId from health_checkup_user_selection where projectId = @projectId").setParam("projectId",healthCheckupProject.getId()); + List list = (List) Daos.query(healthCheckupProjectService.dao(),sql.toString(),Sqls.callback.maps()); + List userSelectionIds = list.stream().map(v->v.getString("id")).collect(Collectors.toList()); + List userIds = list.stream().map(v -> v.getString("selectUserId")).collect(Collectors.toList()); + + healthCheckupProjectService.dao().clear(HealthCheckupUserSelection.class,Cnd.where("selectUserId","in",userIds)); + healthCheckupProjectService.dao().clear(HealthCheckupUserCompanion.class,Cnd.where("userSelectionId","in",userSelectionIds)); + healthCheckupProjectService.dao().clear(HealthCheckupUser.class,Cnd.where("projectId","=",healthCheckupProject.getId())); + healthCheckupProjectService.addHealthCheckupUser(healthCheckupProject); + return null; + } } diff --git a/src/main/java/io/v/nutz/zhgh/healthCheckup/model/HealthCheckupUser.java b/src/main/java/io/v/nutz/zhgh/healthCheckup/model/HealthCheckupUser.java new file mode 100644 index 0000000..6c2d443 --- /dev/null +++ b/src/main/java/io/v/nutz/zhgh/healthCheckup/model/HealthCheckupUser.java @@ -0,0 +1,93 @@ +package io.v.nutz.zhgh.healthCheckup.model; + +import io.v.nutz.base.model.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.nutz.dao.entity.annotation.*; +import org.nutz.dao.interceptor.annotation.PrevInsert; + +/** + * @version 1.0 + * @Author zzr + * @name:HealthCheckupUser + * @Date 2024/7/24 15:42 + * @注释 体检用户 + */ +@Data +@Table +@Comment("体检用户中间表") +@EqualsAndHashCode(callSuper = true) +public class HealthCheckupUser extends BaseModel { + + @Name + @Comment("ID") + @ColDefine(type = ColType.VARCHAR, width = 32) + @PrevInsert(uu32 = true) + private String id; + + @Column + @Comment("所属项目") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String projectId; + + @Column + @Comment("用户id") + @ColDefine(type = ColType.VARCHAR, width = 32) + private String userId; + + @Column + @Comment("用户姓名") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String userName; + + @Column + @Comment("性别") + @ColDefine(type = ColType.VARCHAR, width = 10) + private String sex; + + @Column + @Comment("工号") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String loginName; + + @Column + @Comment("所属工会") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String unionName; + + @Column + @Comment("工会Id") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String unionId; + + @Column + @Comment("所属单位") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String unitName; + + @Column + @Comment("单位Id") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String unitId; + + + @Column + @Comment("三级单位Id") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String threeUnitId; + + @Column + @Comment("三级单位名称") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String threeUnitName; + + @Column + @Comment("工会小组Id") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String unionGroupId; + + @Column + @Comment("工会小组名称") + @ColDefine(type = ColType.VARCHAR, width = 50) + private String unionGroupName; +} diff --git a/src/main/java/io/v/nutz/zhgh/healthCheckup/service/HealthCheckupProjectService.java b/src/main/java/io/v/nutz/zhgh/healthCheckup/service/HealthCheckupProjectService.java index 4e0f9ee..c063582 100644 --- a/src/main/java/io/v/nutz/zhgh/healthCheckup/service/HealthCheckupProjectService.java +++ b/src/main/java/io/v/nutz/zhgh/healthCheckup/service/HealthCheckupProjectService.java @@ -11,4 +11,15 @@ public interface HealthCheckupProjectService extends ViService needAddUsers = getHealthCheckupUserListByProject(healthCheckupProject); + manyAddOrRenewUtil.addOrRenew(needAddUsers, true); + } + + + @Override + @Aop(TransAop.READ_COMMITTED) + public void renewHealthCheckupUser(HealthCheckupProject healthCheckupProject) { + //全部组别人员 + List allGroupUsers = getHealthCheckupUserListByProject(healthCheckupProject); + //已选取人员 + List selectionList = dao().query(HealthCheckupUserSelection.class, Cnd.where("projectId", "=", healthCheckupProject.getId())); +// Set selectUserIds = selectionList.stream().map(HealthCheckupUserSelection::getSelectUserId).collect(Collectors.toSet()); + //已选取人员不在组别里面的人 + + // 找出在selectionList中但不在allGroupUsers中的userId,这部分人要删除体检信息 + List needDeleteUserIds = selectionList.stream() + .map(HealthCheckupUserSelection::getSelectUserId) + .filter(selectUserId -> allGroupUsers.stream() + .noneMatch(user -> user.getUserId().equals(selectUserId))) + .collect(Collectors.toList()); + + //获取生成名单中没有的用户,这部分要添加 + Sql sql = Sqls.create("select userId from health_checkup_user where projectId = @projectId").setParam("projectId", healthCheckupProject.getId()); + List sourceUserMaps = (List) Daos.query(dao(), sql.toString(), Sqls.callback.maps()); + Set sourceUserIds = sourceUserMaps.stream().map(v -> v.getString("userId")).collect(Collectors.toSet()); + //找出原来名单中没有的人,没有的就可以新增 + List canInsertUsers = allGroupUsers.stream().filter(v -> !sourceUserIds.contains(v.getId())).collect(Collectors.toList()); + + //过滤出原有名单中没有的,可以新增 + List needInsertUsers = canInsertUsers.parallelStream() + .filter(v -> !sourceUserIds.contains(v.getUserId())) + .collect(Collectors.toList()); + +// List needInsertUsers = canInsertUsers.stream().filter(v -> !healthUserIdList.contains(v.getUserId())).collect(Collectors.toList()); + + List userSelectionIds = selectionList.stream().map(HealthCheckupUserSelection::getId).collect(Collectors.toList()); + dao().clear(HealthCheckupUser.class, Cnd.where("userId", "in", needInsertUsers)); + dao().clear(HealthCheckupUserSelection.class, Cnd.where("selectUserId", "in", needInsertUsers)); + dao().clear(HealthCheckupUserCompanion.class, Cnd.where("userSelectionId", "in", userSelectionIds)); + + manyAddOrRenewUtil.addOrRenew(needInsertUsers, true); + } + + + public List getHealthCheckupUserListByProject(HealthCheckupProject healthCheckupProject) { + String projectId = healthCheckupProject.getId(); + List groupUsers = dao().query(ActivityUserScope.class, Cnd.where("groupId", "=", healthCheckupProject.getActivityGroupId())); + List userIds = groupUsers.stream().map(ActivityUserScope::getUserId).collect(Collectors.toList()); + Sql sql = Sqls.create("select id,loginname,username,sex,unitid,unitname,unionid,unionname,threeUnitId,threeUnitName,unionGroupId,unionGroupName from `user` where id in (@userIds)").setParam("userIds", userIds); + List userMapList = (List) Daos.query(dao(), sql.toString(), Sqls.callback.maps()); + return userMapList.stream().map(v -> { + HealthCheckupUser user = new HealthCheckupUser(); + user.setId(R.UU32()); + user.setProjectId(projectId); + user.setUserId(v.getString("id")); + user.setLoginName(v.getString("loginname")); + user.setUserName(v.getString("username")); + user.setSex(v.getString("sex")); + user.setUnitId(v.getString("unitid")); + user.setUnitName(v.getString("unitname")); + user.setUnionId(v.getString("unionid")); + user.setUnionName(v.getString("unionname")); + user.setThreeUnitId(v.getString("threeUnitId")); + user.setThreeUnitName(v.getString("threeUnitName")); + user.setUnionGroupId(v.getString("unionGroupId")); + user.setUnionGroupName(v.getString("unionGroupName")); + return user; + }).collect(Collectors.toList()); + } } diff --git a/src/main/java/io/v/nutz/zhgh/healthCheckup/service/impl/HealthCheckupSingleServiceImpl.java b/src/main/java/io/v/nutz/zhgh/healthCheckup/service/impl/HealthCheckupSingleServiceImpl.java index ef12d42..fb95889 100644 --- a/src/main/java/io/v/nutz/zhgh/healthCheckup/service/impl/HealthCheckupSingleServiceImpl.java +++ b/src/main/java/io/v/nutz/zhgh/healthCheckup/service/impl/HealthCheckupSingleServiceImpl.java @@ -36,16 +36,7 @@ public class HealthCheckupSingleServiceImpl extends ViServiceImpl", DateUtil.now())); - } else if (tabName.equals("end")) { - cnd.and("choiceTimeEnd", "<", DateUtil.now()); + cnd.and("hcu.userId", "=", ShiroUtil.getUserId()); + if ("ing".equals(tabName)) { + cnd.and(Cnd.exps("p.choiceTimeStart", "<", DateUtil.now()).and("p.choiceTimeEnd", ">", DateUtil.now())); + } else if ("end".equals(tabName)) { + cnd.and("p.choiceTimeEnd", "<", DateUtil.now()); } cnd.asc("selectCount"); sql.setCondition(cnd); @@ -109,7 +111,7 @@ public class MHealthCheckupListController { @ViReturn public Object doSubmit(@Param("userSelection") HealthCheckupUserSelection userSelection) { Trans.exec(() -> { - if(userSelection.getId() == null) { + if (userSelection.getId() == null) { userSelection.setSelectUserId(ShiroUtil.getPlatformUid()); userSelection.setSelectTime(new Date()); baseService.dao().insertWith(userSelection, "companionList"); @@ -143,7 +145,7 @@ public class MHealthCheckupListController { HealthCheckupUserSelection selection = baseService.dao().fetch(HealthCheckupUserSelection.class, id); baseService.dao().fetchLinks(selection, "companionList"); NutMap nutMap = Lang.obj2map(selection, NutMap.class); - if(selection.getCompanionList().size() > 0) { + if (selection.getCompanionList().size() > 0) { nutMap.put("isFamily", "是"); } else { nutMap.put("isFamily", "否"); @@ -160,11 +162,11 @@ public class MHealthCheckupListController { @At @ViReturn public Object validCondition(String cndId) { - if(StrUtil.isBlank(cndId)) { + if (StrUtil.isBlank(cndId)) { return Result.success(); } NutMap nutMap = healthCheckupProjectService.validCondition(cndId); - if(!nutMap.getBoolean("flag")) { + if (!nutMap.getBoolean("flag")) { return Result.error("选择条件:" + nutMap.getString("msg")); } return null; diff --git a/src/main/resources/views/platform/healthCheckup/listMange.html b/src/main/resources/views/platform/healthCheckup/listMange.html index 849b2ad..9fd2ba7 100644 --- a/src/main/resources/views/platform/healthCheckup/listMange.html +++ b/src/main/resources/views/platform/healthCheckup/listMange.html @@ -78,39 +78,42 @@ layout("/layouts/platform.html"){ -
-
工会小组:
-
- - - - + +
搜索 @@ -204,11 +207,8 @@ layout("/layouts/platform.html"){ - -
- diff --git a/src/main/resources/views/platform/healthCheckup/projectMange.html b/src/main/resources/views/platform/healthCheckup/projectMange.html index 610cd6c..3d0effc 100644 --- a/src/main/resources/views/platform/healthCheckup/projectMange.html +++ b/src/main/resources/views/platform/healthCheckup/projectMange.html @@ -75,25 +75,44 @@ layout("/layouts/platform.html"){ + label="操作" width="100px"> @@ -354,7 +373,7 @@ layout("/layouts/platform.html"){ name: [{required: true, message: '必填', trigger: ['blur', 'change']}], choiceTime: [{required: true, message: '必填', trigger: ['blur', 'change']}], activityGroupId: [{required: true, message: '必填', trigger: ['blur', 'change']}], - cover: [{required: true, message: '必填', trigger: ['blur', 'change']}], + // cover: [{required: true, message: '必填', trigger: ['blur', 'change']}], healthCheckupType: [{required: true, message: '必填', trigger: ['blur', 'change']}], healthCheckupProjectSubjects: [{ required: true, @@ -371,7 +390,7 @@ layout("/layouts/platform.html"){ }, {label: '出生日期', value: 'birthday', type: "date"}, ], - deleteRowIds: [] + deleteRowIds: [], } }, components: { @@ -381,6 +400,95 @@ layout("/layouts/platform.html"){ 'condition': httpVueLoader('/components/plugins/ConditionStructure.vue?v=1.0.0'), }, methods: { + dropdownCommand(command) { + const {type, data} = command + if (type === 'view') { + this.openView(data) + } else if (type === 'created') { + this.createUserList(data) + } else if (type === 'renew') { + this.renewUserList(data) + } else if (type === 'reset') { + this.resetUserList(data) + } else if (type === 'edit') { + this.openEdit(data) + } else if (type === 'delete') { + this.doDelete(data.id) + } else if (type === 'send') { + this.sendMsg(data) + } else if (type === 'code') { + this.openCode(data.id) + } + }, + async createUserList(row) { + const msg = '您确定要生成【' + row.name + '】体检名单吗?(该名单生成是按照创建时选择的可报名人员范围来生成)' + const confirm = await this.$confirm(msg, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }) + if ('confirm' !== confirm) return + const loading = this.$loading({ + lock: true, + text: '数据更新中,请稍后...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); + const resp = await $.post(loc() + '/createUserList', row) + loading.close() + if (resp.code === 0) { + this.$message.success('操作成功') + this.pageData() + } else { + this.$message.warning(resp.msg) + } + }, + async renewUserList(row) { + const msg = '您确定要更新【' + row.name + '】的体检名单吗?(如可报名人员范围发生变化会删除已选择的人员信息)' + const confirm = await this.$confirm(msg, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }) + if ('confirm' !== confirm) return + const loading = this.$loading({ + lock: true, + text: '数据更新中,请稍后...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); + const resp = await $.post(loc() + '/renewUserList', row) + loading.close() + if (resp.code === 0) { + this.$message.success('操作成功') + this.pageData() + } else { + this.$message.warning(resp.msg) + } + }, + async resetUserList(row) { + const msg = '您确定要重置【' + row.name + '】的体检名单吗?(该操作会将所有已选择的人员清空后,在进行生成)' + const confirm = await this.$confirm(msg, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }) + if ('confirm' !== confirm) return + const loading = this.$loading({ + lock: true, + text: '数据更新中,请稍后...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); + const resp = await $.post(loc() + '/resetUserList', row) + loading.close() + if (resp.code === 0) { + this.$message.success('操作成功') + this.pageData() + } else { + this.$message.warning(resp.msg) + } + }, openCode(id) { this.$refs.openQRCode.openCode("/childrenActivities?id=" + id) }, @@ -543,4 +651,4 @@ layout("/layouts/platform.html"){ \ No newline at end of file +#-->