This commit is contained in:
@jyuhsin
2025-06-03 10:08:15 +08:00
parent 1db8707d7f
commit 49a80c8f48
7 changed files with 826 additions and 30 deletions
@@ -474,16 +474,16 @@ public class TheRapyRecuperationUserQueryController {
exportEntities.add(new ExcelExportEntity("工会", "unionName", 20));
exportEntities.add(new ExcelExportEntity("身份证号", "idCard", 30));
exportEntities.add(new ExcelExportEntity("手机号", "mobile", 15));
if (config.getFamilyInfo() == 2) {
exportEntities.add(new ExcelExportEntity("与本人关系", "relation", 10));
exportEntities.add(new ExcelExportEntity("床型", "bedType", 20));
exportEntities.add(new ExcelExportEntity("床位数", "bedNum", 20));
exportEntities.add(new ExcelExportEntity("意向拼房人", "otherSleepUser", 20));
} else {
exportEntities.add(new ExcelExportEntity("携带家属数", "familyNumber", 20));
}
// if (config.getFamilyInfo() == 2) {
// exportEntities.add(new ExcelExportEntity("与本人关系", "relation", 10));
// exportEntities.add(new ExcelExportEntity("床型", "bedType", 20));
// exportEntities.add(new ExcelExportEntity("床位数", "bedNum", 20));
// exportEntities.add(new ExcelExportEntity("意向拼房人", "otherSleepUser", 20));
// } else {
// exportEntities.add(new ExcelExportEntity("携带家属数", "familyNumber", 20));
// }
exportEntities.add(new ExcelExportEntity("疗休养时长", "lotName", 20));
exportEntities.add(new ExcelExportEntity("集中/目的地", "baseName", 20));
exportEntities.add(new ExcelExportEntity("线路名称", "baseName", 20));
exportEntities.add(new ExcelExportEntity("旅行社", "agencyName", 20));
exportEntities.add(new ExcelExportEntity("报名时间", "signingUptime", 20));
exportEntities.add(new ExcelExportEntity("备注", "bz", 20));
@@ -0,0 +1,315 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.statistics;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.zhgh.therapyRecuperation.constant.TheRapyRecuperationState;
import io.v.nutz.zhgh.therapyRecuperation.model.*;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.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 javax.servlet.http.HttpServletResponse;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* @ClassName TheRapyRecuperationLineFragmentController
* @Author JyuHsin
* @Date 2025/5/30 16:28
* @Version 1.0
* @Description 分段式疗休养成团确认
*/
@IocBean
@At("/platform/theRapyRecuperation/fragment")
@Ok("json:full")
@Slf4j
public class TheRapyRecuperationLineFragmentController {
@Inject
private TheRapyRecuperationEnrollService enrollService;
@Inject
private MsgApi msgApi;
@Inject
private Dao dao;
@At("")
@Ok("beetl:/platform/theRapyRecuperation/statistics/fragment.html")
@RequiresPermissions("theRapyRecuperation.fragment")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("theRapyRecuperation.fragment")
public Object pageData(PageForm pageForm,
@Param(value = "startYear", required = false) Integer startYear,
@Param(value = "endYear", required = false) Integer endYear,
@Param(value = "baseManagementId") String baseManagementId,
@Param(value = "travelAgencyId") String travelAgencyId,
@Param(value = "regionalNature", required = false) String regionalNature) {
Sql sql = Sqls.create("""
SELECT
bm.*,
ta.travelAgencyName,
(select COUNT(DISTINCT specificTime) from the_rapy_recuperation_enroll where isNormal = true and takePartInBaseManagementId = bm.id) as groupCount,
(select COUNT(*) from the_rapy_recuperation_enroll where isNormal = true and takePartInBaseManagementId = bm.id) as signCount,
u.username
FROM
`the_rapy_recuperation_base_management` bm
left join the_rapy_recuperation_travel_agency ta on ta.id = bm.travelAgencyId
left join user u on u.id = bm.opBy
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("bm.year", ">=", startYear);
cnd.andEX("bm.year", "<=", endYear);
cnd.andEX("bm.id", "=", baseManagementId);
cnd.andEX("bm.regionalNature", "=", regionalNature);
cnd.andEX("bm.travelAgencyId", "=", travelAgencyId);
cnd.desc("groupCount").asc("bm.sortNumber");
sql.setCondition(cnd);
return enrollService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@ViReturn
@RequiresPermissions("theRapyRecuperation.fragment")
public Object getTravelAgency(@Param(value = "startYear", required = false) Integer startYear,
@Param(value = "endYear", required = false) Integer endYear) {
return dao.query(TheRapyRecuperationTravelAgency.class, Cnd.where("year", ">=", startYear).and("year", "<=", endYear).and("isDisabled", "=", false));
}
@At
@ViReturn
@RequiresPermissions("theRapyRecuperation.fragment")
public Object getBaseManagement(@Param(value = "startYear", required = false) Integer startYear,
@Param(value = "endYear", required = false) Integer endYear) {
return dao.query(TheRapyRecuperationBaseManagement.class, Cnd.where("year", ">=", startYear).and("year", "<=", endYear).and("isDisabled", "=", false).asc("sortNumber"));
}
@At
@ViReturn
@RequiresPermissions("theRapyRecuperation.fragment")
public Object getSignUser(PageForm pageForm,
@Param(value = "takePartInBaseManagementId", required = false) String takePartInBaseManagementId,
@Param(value = "specificTime", required = false) String specificTime) {
Sql sql = Sqls.create("""
SELECT
en.id,
en.takePartInBaseManagementId,
en.specificTime,
u.loginname,
u.username,
u.sex,
u.mobile,
u.unionname,
u.unitname
FROM
the_rapy_recuperation_enroll en
LEFT JOIN USER u ON en.loginName = u.loginname
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("en.takePartInBaseManagementId", "is not", null);
cnd.andEX("en.specificTime", "=", specificTime);
cnd.andEX("en.takePartInBaseManagementId", "=", takePartInBaseManagementId);
cnd.desc("en.specificTime");
sql.setCondition(cnd);
return enrollService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@ViReturn
@RequiresPermissions("theRapyRecuperation.fragment")
public Object getGroupInfo(PageForm pageForm,
@Param(value = "baseId", required = false) String baseId) {
Sql sql = Sqls.create("""
SELECT
en.takePartInBaseManagementId as id,
specificTime,
count( specificTime ) as userCount,
en.hasLocked
FROM
the_rapy_recuperation_enroll en
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("en.takePartInBaseManagementId", "=", baseId);
cnd.and("en.takePartInBaseManagementId", "is not", null);
cnd.groupBy("en.specificTime");
cnd.desc("en.specificTime");
sql.setCondition(cnd);
return enrollService.listMap(sql);
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("theRapyRecuperation.fragment")
public Object sendSuccess(String baseId, Boolean type) {
TheRapyRecuperationConfig config = dao.fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
if (DateUtil.compare(new Date(), config.getFragmentEndTime()) < 0) {
return Result.error("报名还未结束");
}
TheRapyRecuperationBaseManagement management = dao.fetch(TheRapyRecuperationBaseManagement.class, baseId);
//找出报名人员
List<TheRapyRecuperationEnroll> enrolls = dao.query(
TheRapyRecuperationEnroll.class,
Cnd.where("takePartInBaseManagementId", "=", baseId)
.and("isNormal", "=", true).and("year(signingUptime)", "=", DateUtil.thisYear())
.and("stateId", "not in", Lang.array(TheRapyRecuperationState.UNITFAIL, TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.SCHOOLFAIL)));
if(enrolls.size() < config.getFragmentCount()) {
return Result.error("报名人数为%s人,未达到%s人的成团条件".formatted(enrolls.size(), config.getFragmentCount()));
}
enrolls.forEach(item -> {
item.setHasLocked(true);
});
dao.update(enrolls);
//发短信
if(type) {
enrolls.forEach(item -> {
String content = "%s老师,您好!您报名的%s酒店,出行时间为%s,达到成团条件,请准时参加疗休养活动。".formatted(
item.getUserName(),
management.getBaseName(),
item.getSpecificTime()
);
//msgApi.sendTextMsg(content, item.getLoginName());
});
}
return null;
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("theRapyRecuperation.fragment")
public Object sendFail(String baseId, Boolean type) {
TheRapyRecuperationConfig config = dao.fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
if (DateUtil.compare(new Date(), config.getFragmentEndTime()) < 0) {
return Result.error("报名还未结束");
}
TheRapyRecuperationBaseManagement management = dao.fetch(TheRapyRecuperationBaseManagement.class, baseId);
//找出报名人员
List<TheRapyRecuperationEnroll> enrolls = dao.query(
TheRapyRecuperationEnroll.class,
Cnd.where("takePartInBaseManagementId", "=", baseId)
.and("isNormal", "=", true).and("year(signingUptime)", "=", DateUtil.thisYear())
.and("stateId", "not in", Lang.array(TheRapyRecuperationState.UNITFAIL, TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.SCHOOLFAIL)));
//发短信
enrolls.forEach(item -> {
String content = "%s老师,您好!您报名的%s酒店,出行时间为%s,因报名人数不足未达到成团条件,请尽快进入疗休养管理系统重新选择线路。".formatted(
item.getUserName(),
management.getBaseName(),
item.getSpecificTime()
);
//msgApi.sendTextMsg(content, item.getLoginName());
});
if(!type) {
List<String> enrollIds = enrolls.stream().map(TheRapyRecuperationEnroll::getId).collect(Collectors.toList());
List<String> bedIds = enrolls.stream().map(TheRapyRecuperationEnroll::getBedInfoId).collect(Collectors.toList());
dao.clear(TheRapyRecuperationEnroll.class, Cnd.where("takePartInBaseManagementId", "=", baseId));
dao.clear(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "in", enrollIds));
dao.clear(TheRapyRecuperationEnrollBed.class, Cnd.where("id", "in", bedIds));
} else {
List<String> idList = enrolls.stream().map(TheRapyRecuperationEnroll::getId).collect(Collectors.toList());
dao.update(TheRapyRecuperationEnroll.class, Chain.make("isNormal", false), Cnd.where("id", "in", idList));
}
return null;
}
@At
@Ok("void")
@RequiresPermissions("theRapyRecuperation.fragment")
public void doExport(@Param(value = "startYear", required = false) Integer startYear,
@Param(value = "endYear", required = false) Integer endYear,
@Param(value = "baseManagementId") String baseManagementId,
@Param(value = "travelAgencyId") String travelAgencyId,
@Param(value = "regionalNature", required = false) String regionalNature,
HttpServletResponse response) {
Sql sql = Sqls.create("""
SELECT
en.*,
bm.baseName,
ta.travelAgencyName,
u.remark
FROM
the_rapy_recuperation_enroll en
LEFT JOIN the_rapy_recuperation_base_management bm ON bm.id = en.takePartInBaseManagementId
LEFT JOIN the_rapy_recuperation_travel_agency ta ON ta.id = bm.travelAgencyId
LEFT JOIN sys_user u ON u.loginName = en.loginName
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("bm.year", ">=", startYear);
cnd.andEX("bm.year", "<=", endYear);
cnd.andEX("bm.id", "=", baseManagementId);
cnd.andEX("bm.regionalNature", "=", regionalNature);
cnd.andEX("bm.travelAgencyId", "=", travelAgencyId);
cnd.and("en.isNormal", "=", true);
cnd.and("en.stateId", "=", TheRapyRecuperationState.PASS);
cnd.and("en.takePartInBaseManagementId", "is not", null);
sql.setCondition(cnd);
List<NutMap> list = enrollService.listMap(sql);
ArrayList<ExcelExportEntity> exportEntities = new ArrayList<>();
exportEntities.add(new ExcelExportEntity("姓名", "userName", 20));
exportEntities.add(new ExcelExportEntity("工号", "loginName", 20));
exportEntities.add(new ExcelExportEntity("性别", "sex", 10));
exportEntities.add(new ExcelExportEntity("单位", "unitName", 20));
exportEntities.add(new ExcelExportEntity("工会", "unionName", 20));
exportEntities.add(new ExcelExportEntity("身份证号", "idCard", 30));
exportEntities.add(new ExcelExportEntity("手机号", "mobile", 15));
exportEntities.add(new ExcelExportEntity("酒店名称", "baseName", 20));
exportEntities.add(new ExcelExportEntity("旅行社", "agencyName", 20));
exportEntities.add(new ExcelExportEntity("报名时间", "signingUptime", 20));
exportEntities.add(new ExcelExportEntity("出行时间", "specificTime", 50));
exportEntities.add(new ExcelExportEntity("备注", "remark", 20));
try {
response.setContentType("application/octet-stream");
response.setHeader("Content-Disposition", "attachment;filename=" + new String(("报名人员.xls").getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1));
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), exportEntities, list);
workbook.write(response.getOutputStream());
workbook.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.statistics;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
@@ -192,30 +193,45 @@ public class TheRapyRecuperationLineStatisticsController {
@At
@ViReturn
@RequiresAuthentication
@Aop(TransAop.READ_COMMITTED)
public Object sendSuccess(String id, Boolean type) {
TheRapyRecuperationLineUnionSelect unionSelect = dao.fetch(TheRapyRecuperationLineUnionSelect.class, id);
TheRapyRecuperationLine line = dao.fetch(TheRapyRecuperationLine.class, unionSelect.getLineId());
if (DateUtil.compare(new Date(), unionSelect.getSignUpEndTime()) < 0) {
TheRapyRecuperationConfig config = dao.fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
if (DateUtil.compare(new Date(), config.getImplodeEndTime()) < 0) {
return Result.error("报名还未结束");
}
TheRapyRecuperationLineUnionSelect unionSelect = dao.fetch(TheRapyRecuperationLineUnionSelect.class, id);
TheRapyRecuperationLine line = dao.fetch(TheRapyRecuperationLine.class, unionSelect.getLineId());
unionSelect.setGroupSuccess(true);
unionSelect.setGroupTime(DateUtil.now());
switch (unionSelect.getSignUpMode()) {
/*switch (unionSelect.getSignUpMode()) {
case 1 -> unionSelect.setAuditState(7707);
case 2 -> unionSelect.setAuditState(7712);
case 3 -> unionSelect.setAuditState(7700);
}
}*/
unionSelect.setAuditState(7720);
dao.update(unionSelect);
//找出报名人员
List<TheRapyRecuperationEnroll> enrolls = dao.query(
TheRapyRecuperationEnroll.class,
Cnd.where("takePartInLineId", "=", id)
.and("isNormal", "=", true).and("year(signingUptime)", "=", DateUtil.thisYear())
.and("stateId", "not in", Lang.array(TheRapyRecuperationState.UNITFAIL, TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.SCHOOLFAIL)));
Integer count = line.getGroupType() == 1 ? config.getConventionalCount() : config.getBoutiqueCount();
if(enrolls.size() < count) {
return Result.error("报名人数为%s人,未达到%s人的成团条件".formatted(enrolls.size(), config.getFragmentCount()));
}
enrolls.forEach(item -> {
item.setHasLocked(true);
});
dao.update(enrolls);
//发短信
if(type) {
//找出报名人员
List<TheRapyRecuperationEnroll> enrolls = dao.query(
TheRapyRecuperationEnroll.class,
Cnd.where("takePartInLineId", "=", id)
.and("isNormal", "=", true).and("year(signingUptime)", "=", DateUtil.thisYear())
.and("stateId", "not in", Lang.array(TheRapyRecuperationState.UNITFAIL, TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.SCHOOLFAIL)));
enrolls.forEach(item -> {
String content = "%s老师,您好!您报名的%s线路,出行时间为%s,达到成团条件,请准时参加疗休养活动。".formatted(
item.getUserName(),
@@ -239,7 +255,9 @@ public class TheRapyRecuperationLineStatisticsController {
TheRapyRecuperationEnroll enroll = dao.fetch(TheRapyRecuperationEnroll.class, id);
dao.clear(TheRapyRecuperationEnroll.class, Cnd.where("id", "=", id));
dao.clear(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "=", id));
dao.clear(TheRapyRecuperationEnrollBed.class, Cnd.where("id", "=", enroll.getBedInfo().getId()));
if(enroll.getBedInfo() != null) {
dao.clear(TheRapyRecuperationEnrollBed.class, Cnd.where("id", "=", enroll.getBedInfo().getId()));
}
return null;
}
@@ -248,12 +266,15 @@ public class TheRapyRecuperationLineStatisticsController {
@RequiresAuthentication
@Aop(TransAop.READ_COMMITTED)
public Object sendFail(String id, Boolean type) {
TheRapyRecuperationLineUnionSelect unionSelect = dao.fetch(TheRapyRecuperationLineUnionSelect.class, id);
TheRapyRecuperationLine line = dao.fetch(TheRapyRecuperationLine.class, unionSelect.getLineId());
if (DateUtil.compare(new Date(), unionSelect.getSignUpEndTime()) < 0) {
TheRapyRecuperationConfig config = dao.fetch(TheRapyRecuperationConfig.class, Cnd.NEW());
if (DateUtil.compare(new Date(), config.getImplodeEndTime()) < 0) {
return Result.error("报名还未结束");
}
TheRapyRecuperationLineUnionSelect unionSelect = dao.fetch(TheRapyRecuperationLineUnionSelect.class, id);
TheRapyRecuperationLine line = dao.fetch(TheRapyRecuperationLine.class, unionSelect.getLineId());
unionSelect.setGroupSuccess(false);
unionSelect.setGroupTime(null);
dao.update(unionSelect);
@@ -163,4 +163,9 @@ public class TheRapyRecuperationLine extends BaseModel {
@Default("0")
private boolean openChoose;
@Column
@ColDefine(type = ColType.INT)
@Comment("成团类型(1.常规团 2.精品团)")
private Integer groupType;
}
@@ -0,0 +1,374 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.query-row {
height: 70px;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
}
.query-row .el-col {
overflow: hidden;
}
.query-row:not(:last-child) {
border-bottom: 1px dashed rgb(230, 230, 230);
}
.query-row-title {
width: 120px;
}
.el-table-container {
padding-top: 0;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<el-row align="middle" class="query-row" type="flex">
<el-col class="query-row-title"></el-col>
<el-col class="query-row-content">
<el-row>
<el-col :span="12">
<span>&emsp;&emsp;度:</span>
<el-date-picker
:clearable="false"
v-model="pageForm.startYear"
type="year"
value-format="yyyy"
placeholder="选择年"
style="width: 38%" @change="getTravelAgency();getBaseManagement();doSearch()">
</el-date-picker>
<span></span>
<el-date-picker
:clearable="false"
v-model="pageForm.endYear"
type="year"
value-format="yyyy"
placeholder="选择年"
style="width: 38%" @change="doSearch">
</el-date-picker>
</el-col>
<el-col :span="12">
<span>酒店名称:</span>
<el-select v-model="pageForm.baseManagementId" placeholder="请选择酒店名称"
@change="doSearch()"
filterable clearable style="width: 80%">
<el-option
v-for="item in baseManagementList"
:key="item.id"
:label="item.baseName"
:value="item.id">
</el-option>
</el-select>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row align="middle" class="query-row" type="flex">
<el-col class="query-row-title"></el-col>
<el-col class="query-row-content">
<el-row>
<el-col :span="12">
<span>&ensp;&ensp;社:</span>
<el-select v-model="pageForm.travelAgencyId" placeholder="请选择旅行社"
@change="doSearch()"
filterable clearable style="width: 80%">
<el-option
v-for="item in travelAgencyList"
:key="item.id"
:label="item.travelAgencyName"
:value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="12">
<span>路线类型:</span>
<el-select v-model="pageForm.regionalNature" filterable
placeholder="请选择线路"
style="width: 80%">
<el-option label="全部" value=""></el-option>
<el-option label="省内" value="省内"></el-option>
<el-option label="省外" value="省外"></el-option>
</el-select>
</el-col>
</el-row>
</el-col>
</el-row>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="酒店列表" :app="this"
ref="table_tool">
<template #func>
<el-button icon="el-icon-s-promotion" size="small" type="primary"
@click="doExport"
class="mr10">导出人员
</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%"
ref="table"
row-key="id" @sort-change="pageOrder"
v-loading="tableLoading">
<el-table-column align="center" header-align="center" type="index" label="序号"
width="80px" key="#index">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:width="column.width"
:sortable="column.sortable"
>
<template scope="{row}" v-if="column.prop=='lineName'">
<el-link type="primary" @click="openLine(row)">{{row.lineName}}
</el-link>
</template>
<template scope="{row}" v-else-if="column.prop=='stateName'">
{{row.stateName?row.stateName:'待成团'}}
</template>
</el-table-column>
<el-table-column label="操作" width="180px">
<template scope="{row}">
<template>
<el-button @click="openView(row)" size="mini" type="primary">
查看
</el-button>
<el-button @click="openViewUser(row)" size="mini" type="primary">
查看人员
</el-button>
<!--<el-dropdown class="ml10 mr10" trigger="click">
<el-button size="mini" type="primary">
成团确认<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="sendSuccess(row, true)"
:disabled="![null,7703,7710,7715].includes(row.auditState)">
发送通知
</el-dropdown-item>
<el-dropdown-item @click.native="sendSuccess(row, false)"
:disabled="![null,7703,7710,7715].includes(row.auditState)">
不发送通知
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button @click="sendFail(row, false)" size="mini" type="primary">
未成团确认
</el-button>-->
</template>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit>
<sign-user></sign-user>
</template>
</guava>
<el-dialog :visible.sync="userVisible" top="2%" :close-on-click-modal="false" title="报名人员">
<sign-user ref="signUser"></sign-user>
<span slot="footer" class="dialog-footer">
<el-button @click="userVisible = false" type="primary">取 消</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="groupVisible" top="2%" :close-on-click-modal="false" title="团信息">
<el-table :data="groupTableData" max-height="800">
<el-table-column label="序号" type="index" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="specificTime" label="出行时间" header-align="center" align="center" sortable></el-table-column>
<el-table-column prop="userCount" label="报名人数" header-align="center" align="center" sortable></el-table-column>
<el-table-column prop="hasLocked" label="状态" header-align="center" align="center" sortable>
<template scope="{row}">
<span v-if="row.hasLocked === true" class="text-success">已成团</span>
<span v-else>未成团</span>
</template>
</el-table-column>
<el-table-column label="操作" width="380px">
<template scope="{row}">
<el-button @click="openViewUser(row)" size="mini" type="primary">查看人员</el-button>
<el-dropdown class="ml10 mr10" trigger="click">
<el-button size="mini" type="primary">
成团确认<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="sendSuccess(row, true)">
发送通知
</el-dropdown-item>
<el-dropdown-item @click.native="sendSuccess(row, false)">
不发送通知
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button @click="sendFail(row, false)" size="mini" type="primary">
未成团确认
</el-button>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="groupVisible = false" type="primary">取 消</el-button>
</span>
</el-dialog>
</div>
<script>
<!--#include('signUser.js'){}#-->
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
groupVisible: false,
userVisible: false,
pageForm: {
startYear: moment().format('YYYY'),
endYear: moment().format('YYYY'),
regionalNature: '',
baseManagementId: '',
},
tableColumns: [
{prop: 'year', label: '年度', width: 60},
{prop: 'baseName', label: '酒店名称', sortable: true, width: 200},
{prop: 'travelAgencyName', label: '承担旅行社', sortable: true, width: 180},
{prop: 'regionalNature', label: '出行类型', sortable: true},
{prop: 'username', label: '发起人', sortable: true},
{prop: 'baseContactPerson', label: '联系人', sortable: true},
{prop: 'baseContactNumber', label: '联系电话', sortable: true},
{prop: 'groupCount', label: '团数量', width: 80},
{prop: 'signCount', label: '报名人数'},
],
modifyConfig: {},
travelAgencyList: [],
baseManagementList: [],
signUser: [],
groupTableData: [],
baseRow: {},
}
},
components: {
'sign-user': signUser
},
methods: {
async sendSuccess(row, type) {
let message = '确定要成团吗?'
if (type) {
message += "此操作将会<span style='color: red'>发送通知</span>,请再次确认!";
}
this.$confirm(message, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(async () => {
const resp = await $.post('/platform/theRapyRecuperation/fragment/sendSuccess', {
baseId: row.id,
type: type
})
if (resp.code === 0) {
await this.openView(this.baseRow)
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
})
},
sendFail(row, type) {
this.$confirm("确定发送<span style='color: red'>未成团通知</span>并<span style='color: red'>" + (type ? '保留' : '删除') + "报名记录</span>吗?", '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(async () => {
const resp = await $.post('/platform/theRapyRecuperation/fragment/sendFail', {
baseId: row.id,
type: type
})
if (resp.code === 0) {
await this.openView(this.baseRow)
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
})
},
async openView(row) {
this.baseRow = row
const res = await $.post('/platform/theRapyRecuperation/fragment/getGroupInfo', {
baseId: row.id
})
this.groupTableData = res.data
this.groupVisible = true
},
openViewUser(row) {
this.userVisible = true
this.$nextTick(() => {
this.$refs.signUser.initData(row.id)
})
},
async getTravelAgency() {
const res = await $.post('/platform/theRapyRecuperation/fragment/getTravelAgency', {
startYear: this.pageForm.startYear,
endYear: this.pageForm.endYear
})
if (res.code === 0) {
this.travelAgencyList = res.data
}
},
async getBaseManagement() {
const res = await $.post('/platform/theRapyRecuperation/fragment/getBaseManagement', {
startYear: this.pageForm.startYear,
endYear: this.pageForm.endYear
})
if (res.code === 0) {
this.baseManagementList = res.data
}
},
async getModifyConfig() {
const res = await $.post('/platform/theRapyRecuperation/TheRapyConfig/findOne')
if (res.code === 0) {
this.modifyConfig = res.data
}
},
doExport() {
window.open("/platform/theRapyRecuperation/fragment/doExport?" +
"startYear=" + this.pageForm.startYear +
"&endYear=" + this.pageForm.endYear +
"&baseManagementId=" + this.pageForm.baseManagementId +
"&travelAgencyId=" + this.pageForm.travelAgencyId +
"&regionalNature=" + this.pageForm.regionalNature
)
},
},
async created() {
await this.getModifyConfig();
await this.getTravelAgency();
await this.getBaseManagement();
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -142,7 +142,7 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt10">
<table-tool label="温馨提醒:成团确认后,将进入审核流程,报名人员不能再进行取消报名的操作" :app="this"
<table-tool label="线路列表" :app="this"
ref="table_tool">
<template #func>
<el-button icon="el-icon-s-promotion" size="small" type="primary"
@@ -199,7 +199,7 @@ layout("/layouts/platform.html"){
查看人员
</el-button>
<el-dropdown class="ml10" trigger="click">
<el-dropdown class="ml10 mr10" trigger="click">
<el-button size="mini" type="primary">
成团确认<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
@@ -215,9 +215,13 @@ layout("/layouts/platform.html"){
</el-dropdown-menu>
</el-dropdown>
<el-dropdown class="ml10 mr10" trigger="click">
<el-button @click="sendFail(row, false)" size="mini" type="primary">
未成团确认
</el-button>
<!--<el-dropdown class="ml10 mr10" trigger="click">
<el-button size="mini" type="primary">
发送未成团通知<i class="el-icon-arrow-down el-icon--right"></i>
发送未成团通知<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="sendFail(row, true)">保留报名记录
@@ -225,7 +229,7 @@ layout("/layouts/platform.html"){
<el-dropdown-item @click.native="sendFail(row, false)">删除报名记录
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-dropdown>-->
</template>
</template>
</el-table-column>
@@ -355,7 +359,7 @@ layout("/layouts/platform.html"){
{prop: 'regionalNature', label: '线路类型', sortable: true},
{prop: 'username', label: '发起人', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'estimatedFamilyNumbers', label: '最少成团人数', width: 80},
{prop: 'minimumGroupSize', label: '最少成团人数', width: 80},
{prop: 'lineNum', label: '报名人数(家属)'},
{prop: 'stateName', label: '审核状态'},
],
@@ -493,6 +497,7 @@ layout("/layouts/platform.html"){
type: type
})
if (resp.code === 0) {
this.doSearch()
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
@@ -0,0 +1,76 @@
const signUser = {
template: /*language=HTML*/ `
<div>
<el-table :data="tableData">
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
</el-table-column>
<el-table-column label="操作" width="100">
<template scope="{row}">
<el-button @click="deleteJoinUser(row)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[5,10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="pageForm.totalCount">
</el-pagination>
</div>
`,
mixins: [initTableMixins],
data() {
return {
tableData: [],
tableColumns: [
{prop: 'loginname', label: '工号'},
{prop: 'username', label: '姓名'},
{prop: 'sex', label: '性别'},
{prop: 'mobile', label: '联系方式'},
{prop: 'unionname', label: '所属工会'},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'specificTime', label: '出行时间', sortable: true},
],
}
},
methods: {
deleteJoinUser(row) {
this.$confirm('您确定要删除' + row.username + '的报名信息吗', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(async () => {
const resp = await $.post('/platform/theRapyRecuperation/statistics/deleteJoinUser', {id: row.id})
if (resp.code === 0) {
this.$message.success(resp.msg)
this.doSearch()
} else {
this.$message.warning(resp.msg)
}
})
},
async initData(baseId) {
this.pageForm.takePartInBaseManagementId = baseId
const res = await $.post('/platform/theRapyRecuperation/fragment/getSignUser', this.pageForm)
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
},
},
created() {
}
}