This commit is contained in:
@jyuhsin
2025-05-29 10:31:17 +08:00
parent ef3138ebaf
commit 554a7b9b67
10 changed files with 1020 additions and 196 deletions
@@ -0,0 +1,38 @@
package io.v.nutz.sys.models;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
/**
* @Author: JyuHsin
* @Date: 2024/6/6 15:33
* @Version: v1.0.0
* @Description: TODO
**/
@Data
@Table("sys_holiday")
public class SysHoliday {
@Name
@ColDefine
@Column
@PrevInsert(uu32 = true)
@Comment("id")
private String id;
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("名称")
@Column
private String name;
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("日期")
@Column
private String day;
@ColDefine(type = ColType.VARCHAR, width = 20)
@Comment("周几")
@Column
private String week;
}
@@ -0,0 +1,54 @@
package io.v.nutz.task.job.holiday;
import cn.hutool.http.HttpUtil;
import io.v.nutz.sys.models.SysHoliday;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import java.util.ArrayList;
import java.util.List;
/**
* @Author: JyuHsin
* @Date: 2024/6/6 15:16
* @Version: v1.0.0
* @Description: 获取所有节假日,每年执行一次
**/
@IocBean
public class HolidayJob implements Job {
private static final String URL = "https://timor.tech/api/holiday/year?type=Y";
@Inject
private Dao dao;
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
NutMap resMap = Json.fromJson(NutMap.class, HttpUtil.get(URL));
if(resMap.getInt("code") == 0) {
NutMap holidayMap = resMap.getAs("type", NutMap.class);
List<SysHoliday> result = new ArrayList<>();
holidayMap.keySet().forEach(k -> {
NutMap day = (NutMap) holidayMap.get(k);
if(day.getInt("type") == 2) {
SysHoliday h = new SysHoliday();
h.setDay(k);
h.setName(day.getString("name"));
h.setWeek(day.getString("week"));
result.add(h);
}
});
if(Lang.isNotEmpty(result)) {
dao.insert(result);
}
}
}
}
@@ -6,21 +6,26 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.SysHoliday;
import io.v.nutz.sys.models.User;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationEnroll;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
import io.v.nutz.zhgh.therapyRecuperation.service.baseManage.TheRapyRecuperationBaseManagerService;
import io.v.nutz.base.utils.ViTool;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
@@ -32,6 +37,7 @@ import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
@@ -45,11 +51,13 @@ import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
/**
* @FileName io.v.nutz.zhgh.therapyRecuperation.controller.baseManage.TheBaseManagerController
* @FileName io.v.nutz.therapyRecuperation.controller.baseManage.TheBaseManagerController
* @Description: 疗休养基地管理
* @Author zzr
* @Date 2023/6/5
@@ -71,7 +79,7 @@ public class TheRapyRecuperationBaseManagerController {
@At("")
@Ok("beetl:/platform/theRapyRecuperation/baseManage/baseManagement.html")
@RequiresPermissions("theRapyRecuperation.line")
@RequiresPermissions("theRapyRecuperation.TheBaseManagement")
public void index() {
}
@@ -92,7 +100,7 @@ public class TheRapyRecuperationBaseManagerController {
@POST
@Ok("json:full")
@ViReturn
@RequiresRoles(value = {"sysadmin", "SchoolUnionAdmin", "H04"}, logical = Logical.OR)
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object pageData(PageForm pageForm, Integer year, String lotId, String baseName, String unionId, String travelAgencyId, String regionalNature) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
@@ -114,8 +122,8 @@ public class TheRapyRecuperationBaseManagerController {
tb.files,
tb.baseContactPerson,
tb.baseContactNumber,
cast( tb.files ->> '$[0].id' AS CHAR ) AS fileId,
gh.unionname createUnionName,
tb.files as fileId,
ifnull(gh.unionname, '校工会') AS createUnionName,
u.username createUserName,
ta.travelAgencyName,
ta.contact,
@@ -133,10 +141,8 @@ public class TheRapyRecuperationBaseManagerController {
cnd.and(Cnd.likeEX("tb.baseName", baseName));
cnd.and(Cnd.likeEX("tb.travelAgencyId", travelAgencyId));
cnd.and(Cnd.likeEX("tb.regionalNature", regionalNature));
cnd.desc("tb.`year`");
cnd.asc("tb.sortNumber");
cnd.asc("tb.id");
if (!ShiroUtil.hasAnyRoles(List.of("sysadmin", "SchoolUnionAdmin"))) {
cnd.desc("regionalNature").asc("tb.sortNumber * 1").asc("tb.opBy");
if (!ShiroUtil.hasAnyRoles(List.of("sysadmin", "A06"))) {
if (ShiroUtil.hasRole("H04")) {
cnd.and("tb.createUnionId", "=", Vi.getUnionId());
}
@@ -147,6 +153,16 @@ public class TheRapyRecuperationBaseManagerController {
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@POST
@ViReturn
@RequiresAuthentication
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object getNo() {
Object sortNumber = dao.func2(TheRapyRecuperationBaseManagement.class, "max", "sortNumber");
sortNumber = Objects.requireNonNullElse(sortNumber, 0);
return Integer.parseInt(sortNumber.toString()) + 1;
}
/**
* 是否启用基地线路
@@ -192,8 +208,8 @@ public class TheRapyRecuperationBaseManagerController {
@POST
@ViReturn
@RequiresAuthentication
@RequiresRoles(value = {"sysadmin", "SchoolUnionAdmin", "H04"}, logical = Logical.OR)
public Object doSubmit(@Param("base") TheRapyRecuperationBaseManagement baseManagement) {
@RequiresRoles(value = {"sysadmin", "A06", "H04"}, logical = Logical.OR)
public Object doSubmit(TheRapyRecuperationBaseManagement baseManagement) {
baseManagement.setOpBy((String) ShiroUtil.getPrincipalProperty("id"));
baseManagement.setCreateUnionId((String) ShiroUtil.getPrincipalProperty("unionid"));
baseManagement.setOpAt(String.valueOf(new Date().getTime()));
@@ -229,7 +245,15 @@ public class TheRapyRecuperationBaseManagerController {
@ViReturn
@RequiresAuthentication
public Object listAllBase(String startYear, String endYear, String year) {
Sql sql = Sqls.create("select * from `the_rapy_recuperation_base_management` tb left join `the_rapy_recuperation_lot` lot on lot.id=tb.lotId $condition");
Sql sql = Sqls.create("""
SELECT
tb.*,
tl.lotName
FROM
`the_rapy_recuperation_base_management` tb
LEFT JOIN the_rapy_recuperation_lot tl ON tb.lotId = tl.id
$condition
""");
CndPlus cnd = new CndPlus();
cnd.andEX("tb.`year`", ">=", startYear);
@@ -254,6 +278,88 @@ public class TheRapyRecuperationBaseManagerController {
return theRapyRecuperationBaseManagerService.selectBaseAllInfo(id);
}
@At("/getTimeArray")
@ViReturn
@RequiresAuthentication
public Object getTimeArray(@Param("id") String id) {
if (StrUtil.isBlank(id)) {
return Result.error("参数错误");
}
//获取线路对应的标段
TheRapyRecuperationBaseManagement management = dao.fetch(TheRapyRecuperationBaseManagement.class, id);
TheRapyRecuperationLot lot = dao.fetch(TheRapyRecuperationLot.class, management.getLotId());
//获取当年的节假日
List<SysHoliday> holidayList = dao.query(SysHoliday.class, Cnd.where("year(day)", "=", DateUtil.thisYear()).asc("day"));
List<String> holidays = holidayList.stream().map(SysHoliday::getDay).collect(Collectors.toList());
//按月份分组
Map<Integer, List<SysHoliday>> listMap = holidayList.stream().collect(Collectors.groupingBy(o -> DateUtil.month(DateUtil.parse(o.getDay()))));
//获取前一天
listMap.forEach((k, v) -> {
SysHoliday sysHoliday = v.get(0);
Date date = DateUtil.parse(sysHoliday.getDay());
Date previousDay = DateUtil.offsetDay(date, -1);
holidays.add(DateUtil.formatDate(previousDay));
});
List<Integer> weeks = management.getWeekCheckIn();
// 解析日期
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate startDate = LocalDate.parse(DateUtil.formatDate(management.getActivityStartTime()), formatter);
LocalDate endDate = LocalDate.parse(DateUtil.formatDate(management.getActivityEndTime()), formatter);
//现在的日期
LocalDate now = LocalDate.parse(DateUtil.today(), formatter);
// 创建结果列表
List<String> resultDates = new ArrayList<>();
// 生成时间区间内的所有日期,并根据条件过滤
LocalDate currentDate = startDate;
if(!now.isBefore(startDate)) {
currentDate = now;
}
while (!currentDate.isAfter(endDate)) {
// 检查是否为节假日
String currentDateString = currentDate.format(formatter);
if (holidays.contains(currentDateString) && lot.getFilterHolidays()) {
currentDate = currentDate.plusDays(1);
continue;
}
// 检查是否为需要排除的周几
int dayOfWeek = currentDate.getDayOfWeek().getValue() % 7; // 1是周一,7是周日
if (Lang.isNotEmpty(weeks) && !weeks.contains(dayOfWeek)) {
currentDate = currentDate.plusDays(1);
continue;
}
resultDates.add(currentDateString);
// 递增日期
currentDate = currentDate.plusDays(1);
}
Sql schoolTimeSql = Sqls.create("select schoolTime from sys_user where id=@id").setParam("id", ShiroUtil.getPlatformUid());
String schoolTime = (String) Daos.query(dao, schoolTimeSql.toString(), Sqls.callback.str());
String minDate = DateUtil.formatDate(management.getActivityStartTime());
//如果入职日期在活动开始时间之后的
try {
if (StrUtil.isNotBlank(schoolTime)
&& String.valueOf(DateUtil.thisYear() - 1).equals(DateUtil.format(DateUtil.parse(schoolTime), "yyyy"))
&& DateUtil.compare(DateUtil.parse(schoolTime), management.getActivityStartTime(), "MM") > 0) {
minDate = DateUtil.format(DateUtil.offset(DateUtil.parse(schoolTime), DateField.YEAR, 1), "yyyy-MM-dd");
}
} catch (Exception e) {
e.printStackTrace();
}
return Map.of("days", resultDates,
"holidays", holidays,
"lotValue", lot.getLotValue(),
"minDate", minDate,
"maxDate", DateUtil.formatDate(management.getActivityEndTime()));
}
/**
* 目的地导入模版
@@ -358,4 +464,17 @@ public class TheRapyRecuperationBaseManagerController {
return null;
}
@At
@ViReturn
public Object getUserByLoginName(String loginName) {
return baseService.dao().fetch(User.class, Cnd.where("loginname", "=", loginName));
}
@At
@ViReturn
public Object isTakePart(String loginName) {
return baseService.dao().count(TheRapyRecuperationEnroll.class, Cnd.where("YEAR(takePartInTime)", "=", Calendar.getInstance().get(Calendar.YEAR)).and("loginname", "=", loginName));
}
}
@@ -1,7 +1,7 @@
package io.v.nutz.zhgh.therapyRecuperation.model;
import cn.afterturn.easypoi.excel.annotation.Excel;
import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationTravelAgency;
import lombok.Data;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
@@ -11,7 +11,7 @@ import java.util.Date;
import java.util.List;
/**
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationBaseManagement
* @FileName io.v.nutz.therapyRecuperation.model.TheRapyRecuperationBaseManagement
* @Description: TODO
* @Author zzr
* @Date 2023/6/5
@@ -35,10 +35,10 @@ public class TheRapyRecuperationBaseManagement {
private Integer year;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@ColDefine(type = ColType.INT)
@Comment("排序编号")
@Excel(name = "排序编号")
private String sortNumber;
private Integer sortNumber;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@@ -118,9 +118,9 @@ public class TheRapyRecuperationBaseManagement {
private String estimatedCost;
@Column
@ColDefine(type = ColType.MYSQL_JSON)
@ColDefine(type = ColType.VARCHAR, width = 100)
@Comment("缩略图")
private List<Sys_file> files;
private String files;
@Column
@ColDefine(type = ColType.INT)
@@ -152,6 +152,10 @@ public class TheRapyRecuperationBaseManagement {
@Comment("操作时间")
private String opAt;
@Column
@ColDefine(type = ColType.MYSQL_JSON)
@Comment("报名选择周几入住")
private List<Integer> weekCheckIn;
@One(field = "travelAgencyId")
private TheRapyRecuperationTravelAgency travelAgency;
@@ -5,6 +5,8 @@ import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.List;
/**
* @FileName io.v.nutz.zhgh.therapyRecuperation.model.TheRapyRecuperationLot
* @Description: TODO
@@ -44,4 +46,13 @@ public class TheRapyRecuperationLot {
@Comment("配置ID")
private String configId;
@Column
@ColDefine(type = ColType.BOOLEAN)
@Comment("排除节假日及前一天")
private Boolean filterHolidays;
@Column
@ColDefine(type = ColType.MYSQL_JSON)
@Comment("报名选择周几入住")
private List<Integer> weekCheckIn;
}
@@ -3,6 +3,12 @@ layout("/mobile/platform.html"){
#-->
<style>
.container {
height: calc(100vh - 46px - 50px - 60px);
overflow-y: auto;
position: relative;
}
.container img {
background-size: contain;
width: 100%;
@@ -17,7 +23,11 @@ layout("/mobile/platform.html"){
.content {
line-height: 26px;
padding: 0px 20px 56px 20px;
padding: 0px 10px 56px 10px;
}
.backTop {
display: none !important;
}
.title {
@@ -46,21 +56,25 @@ layout("/mobile/platform.html"){
}
.footer {
background-color: white;
position: fixed;
bottom: 0;
width: 100%;
height: 60px;
display: flex;
justify-content: space-evenly;
align-items: center;
left: 0;
}
.footer .van-button {
height: 34px;
border-radius: 6px;
width: 90% !important;
margin: 0 10px;
}
.submitButton .van-button {
height: 34px;
border-radius: 6px;
width: 90% !important;
margin: 0 10px;
}
.family_join {
@@ -81,7 +95,7 @@ layout("/mobile/platform.html"){
.join_content {
padding: 20px;
height: calc(100% - 40px - 46px - 60px);
height: calc(100% - 40px - 46px);
overflow-y: auto;
}
@@ -140,7 +154,7 @@ layout("/mobile/platform.html"){
.top_icon {
position: fixed;
bottom: 80px;
bottom: 130px;
right: 20px;
}
@@ -155,7 +169,7 @@ layout("/mobile/platform.html"){
.companionList_empty_text {
text-align: center;
padding: 10px 0px;
font-size: 14px;
font-size: 16px;
color: grey;
}
@@ -185,16 +199,60 @@ layout("/mobile/platform.html"){
align-items: center;
}
.submitButton .van-button {
height: 34px;
border-radius: 6px;
width: 90% !important;
}
.van-image-preview img {
background-color: white;
}
select-checkbox {
position: absolute;
right: 0;
}
.select-popup-footer {
margin-top: 10px;
padding: 10px;
display: flex;
justify-content: space-between;
}
.btn {
display: flex;
justify-content: space-between;
background-color: #fff;
}
.cancle {
font-size: 18px;
}
.confirm {
font-size: 18px;
}
.van-tag {
color: white !important;
}
.cal_middle {
color: #ee0a24;
background-color: #FDE6E9;
}
.cal_end {
color: #fff;
background-color: #ee0a24;
border-radius: 0 4px 4px 0;
}
.van-calendar__day--middle::after {
background-color: transparent;
}
.pdf_div {
padding-bottom: 12px;
height: calc(100vh - 46px - 178px - 24px - 60px - 70px);
}
</style>
<div id="app" v-cloak>
@@ -234,14 +292,9 @@ layout("/mobile/platform.html"){
</div>
</div>
</div>
<van-divider></van-divider>
<div v-if="baseData.content" v-html="baseData.content" class="content"></div>
<div v-else v-html="configData.notice" class="content"></div>
<!--<van-empty
v-else class="custom-image"
image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
description="暂无详细信息"
></van-empty>-->
<van-divider :style="{ color: 'orange', fontSize: '12px' }">上下滑动翻页,单击查看,再单击返回</van-divider>
<div v-if="isPdf" v-html="baseData.content" class="content"></div>
<div v-else id="demo" class="pdf_div"></div>
</div>
</van-skeleton>
@@ -251,15 +304,22 @@ layout("/mobile/platform.html"){
class="top_icon"></image>
<!--底部报名按钮-->
<div class="footer" v-if="fromUrlByMy != 'edit'">
<div class="footer" v-if="fromUrlByMy == 'find'">
<van-button @click="join"
class="join">我的填报信息
</van-button>
</div>
<div class="footer" v-else>
<template v-if="baseData.isNormal==0&&baseData.isNormalFalse>0">
<van-button @click="join"
class="join">我要报名
</van-button>
<van-button @click="join" class="join">我要报名</van-button>
</template>
<template v-else>
<van-button v-if="moment().unix() <= moment(baseData.signUpEndTime).unix()" @click="join" class="join">我要报名
</van-button>
<van-button
v-if="moment().unix() <= moment(baseData.signUpEndTime).unix() && ${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
@click="helpJoin" class="join">替他人报名
</van-button>
<van-button v-if="moment().unix() > moment(baseData.signUpEndTime).unix()" class="join">报名结束</van-button>
</template>
</div>
@@ -268,9 +328,7 @@ layout("/mobile/platform.html"){
<van-popup v-model:show="joinPopup" position="right" class="joinPopup">
<van-nav-bar @click-left="joinPopup = false" fixed left-arrow placeholder title="疗休养报名"></van-nav-bar>
<div class="join_content">
<van-form @submit="joinSubmit">
<van-form :disabled="fromUrlByMy == 'find'" @submit="joinSubmit">
<!--基础信息-->
<div class="van-doc-card" style="margin-bottom: 16px">
<div></div>
@@ -278,14 +336,25 @@ layout("/mobile/platform.html"){
基础信息
</div>
<div class="van-card-body">
<van-field label="姓名" readonly v-model="formData.userName"></van-field>
<van-field label="一卡通号" readonly v-model="formData.loginName"></van-field>
<van-field label="身份证件" name="idCard" :rules="[{ required: true }]"
placeholder="请填写身份证号、护照、台胞证等" v-model="formData.idCard"></van-field>
<van-field v-if="isHelpJoin" label="姓名" readonly v-model="formData.userName"></van-field>
<van-field v-else="!isHelpJoin" label="姓名"
:rules="[{ required: true }]"
placeholder="请输入工号或姓名进行查询" required
@click="show = true"
v-model="formData.userName"></van-field>
<van-field label="工号" readonly v-model="formData.loginName"></van-field>
<van-field label="身份证号" name="idCard" :rules="[{ required: true }]"
placeholder="请填写身份证号" v-model="formData.idCard"></van-field>
<van-field label="手机号" name="mobile" :rules="[{ required: true }]"
placeholder="请填写手机号" v-model="formData.mobile"></van-field>
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
<van-field label="报名酒店" readonly v-model="formData.baseName"></van-field>
<van-field label="活动时间" readonly @click="if(fromUrlByMy != 'find')timeVisible = true"
:rules="[{ required: true }]" placeholder="请选择活动时间" required
is-link v-model="formData.specificTime" name="specificTime"></van-field>
</div>
</div>
@@ -293,13 +362,14 @@ layout("/mobile/platform.html"){
<div class="van-doc-card" style="margin-bottom: 16px">
<div></div>
<div class="van-card-header">
床位信息
床位信息(一位教职工一间)
</div>
<div class="van-card-body">
<van-field @click="self = true; roomVisible = true" readonly is-link label="房间" name="bedType"
<van-field @click="if(fromUrlByMy != 'find'){self = true; roomVisible = true}" readonly is-link
label="房间" name="bedType"
placeholder="请选择房间" v-model="formData.bedInfo.bedType"
:rules="[{ required: true }]"></van-field>
<van-field v-if="formData.bedInfo.bedType == '标准间'" @click="self = true; bedVisible = true"
<!--<van-field v-if="formData.bedInfo.bedType == '标准间'" @click="self = true; bedVisible = true"
readonly is-link label="床位"
name="bedNum" placeholder="请选择床位" v-model="formData.bedInfo.bedNum"
:rules="[{ required: true }]"></van-field>
@@ -311,11 +381,11 @@ layout("/mobile/platform.html"){
<van-radio :name="false" shape="square">否</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field v-if="formData.bedInfo.bedType == '标准间' && formData.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
</van-field>-->
<!--<van-field v-if="formData.bedInfo.bedType == '标准间' && formData.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="若无拼房人,填写“无”即可"
v-model="formData.bedInfo.otherSleepUser"
:rules="[{ required: true }]"></van-field>
:rules="[{ required: true }]"></van-field>-->
</div>
</div>
@@ -325,7 +395,7 @@ layout("/mobile/platform.html"){
<div class="van-card-header"
style="display: flex; justify-content: space-between; align-items: center">
<span style="float:left;">随行人信息</span>
<div>
<div v-if="fromUrlByMy != 'find'">
<van-tag @click="delCompanion" size="large" type="primary" color="lightgrey">删除随行人</van-tag>
<van-tag @click="addCompanion" size="large" type="primary" color="#1867b0">添加随行人</van-tag>
</div>
@@ -335,9 +405,9 @@ layout("/mobile/platform.html"){
<van-tab v-for="item, index in formData.companionList" :title="'随行人' + (index + 1)">
<van-field label="姓名" name="userName" placeholder="请填写姓名" v-model="item.userName"
:rules="[{ required: true }]"></van-field>
<!--<van-field label="一卡通号" name="loginName" placeholder="若没有工号,请忽略此项" v-model="item.loginName"></van-field>-->
<van-field label="年龄" name="age" placeholder="请填写年龄" v-model="item.age"
type="digit" :rules="[{ required: true }]"></van-field>
<!--<van-field label="号" name="loginName" placeholder="若没有工号,请忽略此项" v-model="item.loginName"></van-field>-->
<van-field label="年龄" name="age" placeholder="请填写年龄" v-model="item.age" type="digit"
:rules="[{ required: true }]"></van-field>
<van-field :rules="[{ required: true, message: '请选择性别' }]" label="性别" name="validator">
<template #input>
<van-radio-group direction="horizontal" v-model="item.sex">
@@ -346,24 +416,27 @@ layout("/mobile/platform.html"){
</van-radio-group>
</template>
</van-field>
<van-field label="身份证" name="idCard" placeholder="请填写身份证号、护照、台胞证等"
:rules="[{ required: true }]" type="digit"
<van-field label="身份证" name="idCard" placeholder="请填写身份证号"
:rules="[{ required: true }]"
v-model="item.idCard"></van-field>
<van-field label="手机号" name="mobile" placeholder="请填写手机号"
:rules="[{ required: true }]" type="digit"
v-model="item.mobile"></van-field>
<van-field @click="companionVisible = true" readonly is-link label="与本人关系"
<van-field @click="if(fromUrlByMy != 'find')companionVisible = true" readonly is-link
label="与本人关系"
name="relation"
placeholder="随行人与本人关系" v-model="item.relation"
:rules="[{ required: true }]"></van-field>
<van-field @click="self = false; roomVisible = true" readonly is-link label="房间"
<van-field @click="if(fromUrlByMy != 'find'){self = false; roomVisible = true}" readonly
is-link label="房间"
name="bedType" placeholder="请选择房间"
v-model="item.bedInfo.bedType"></van-field>
<div style="font-size: 8px; color:orangered; padding-left: 16px; padding-bottom: 4px">
提醒:如果跟报名人员同一房间,无须选择!
</div>
<van-field v-if="item.bedInfo.bedType == '标准间'" @click="self = false; bedVisible = true"
<van-field v-if="item.bedInfo.bedType == '标准间'"
@click="if(fromUrlByMy != 'find'){self = false; bedVisible = true}"
readonly is-link label="床位"
name="bedNum" placeholder="请选择床位" v-model="item.bedInfo.bedNum"></van-field>
<van-field v-if="item.bedInfo.bedType == '标准间'"
@@ -376,7 +449,7 @@ layout("/mobile/platform.html"){
</template>
</van-field>
<van-field v-if="item.bedInfo.bedType == '标准间' && item.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
label="意向拼房人" name="otherSleepUser" placeholder="若无拼房人,填写“无”即可"
v-model="item.bedInfo.otherSleepUser"></van-field>
</van-tab>
</van-tabs>
@@ -387,15 +460,11 @@ layout("/mobile/platform.html"){
</span>
</div>
</div>
<div class="submitButton">
<div v-if="fromUrlByMy != 'find'" class="submitButton">
<van-button class="join join_submit">提交报名</van-button>
</div>
</van-form>
</div>
</van-popup>
<!--房间类型弹出框-->
@@ -403,6 +472,7 @@ layout("/mobile/platform.html"){
<van-picker
title="入住房间" show-toolbar
:columns="roomColumns"
:default-index="defaultIndex"
@confirm="roomConfirm"
@cancel="roomCancel">
</van-picker>
@@ -419,7 +489,7 @@ layout("/mobile/platform.html"){
</van-popup>
<!--随行人关系弹出框-->
<van-popup position="bottom" round v-model="companionVisible">
<van-popup position="bottom" round v-model="companionVisible" popup-style="bottom: 60px;">
<van-picker
title="与本人关系" show-toolbar
:columns="companionColumns"
@@ -428,6 +498,50 @@ layout("/mobile/platform.html"){
</van-picker>
</van-popup>
<!--时间弹出框-->
<!--<van-popup position="bottom" round v-model="timeVisible">
<van-picker
title="具体时间" show-toolbar
:columns="timeArray"
@confirm="(value, index) => {formData.specificTime = value; timeVisible = false}"
@cancel="timeVisible = false">
</van-picker>
</van-popup>-->
<van-calendar type="range" v-model="timeVisible"
ref="cal" @confirm="calConfirm"
:min-date="minDate" :max-date="maxDate"
:first-day-of-week="1" :formatter="formatter"
@select="daySelect"
:max-range="lotValue" :style="{ height: '660px' }"></van-calendar>
<van-popup position="bottom" round v-model="show" :style="{ height: '60%' }" closeable>
<van-search v-model="result" show-action style="padding: 10px;margin-top: 45px" placeholder="请输入工号或姓名搜索"
@input="delaySearch">
</van-search>
<van-cell-group>
<div>
<van-checkbox-group style="text-align: center">
<van-cell-group>
<van-cell v-for="(item, index) in userList" :key="item.index" clickable
:title="item.name"
@click="toResult(item.loginname)">
</van-cell>
</van-cell-group>
</van-checkbox-group>
</div>
</van-cell-group>
</van-popup>
<div>
<van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" replace url="/platform/mobile/theRapyRecuperation/index">疗休养报名
</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/platform/mobile/theRapyRecuperation/myRecuperation">我的疗休养
</van-tabbar-item>
</van-tabbar>
</div>
</div>
<script>
function getQueryString(name) {
@@ -437,14 +551,23 @@ layout("/mobile/platform.html"){
return null;
}
let pdfh5 = null
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
isPdf: false,
lotValue: 0,
minDate: new Date(2010, 0, 1),
maxDate: new Date(2010, 0, 31),
holidays: [],
timeVisible: false,
active: 0,
tarBarActive: 0,
roomColumns: ['大床房', '标准间'],
bedColumns: ['1', '2'],
//companionColumns: ['亲属', '朋友'],
companionColumns: ['配偶', '子女'],
bedVisible: false,
roomVisible: false,
@@ -471,10 +594,76 @@ layout("/mobile/platform.html"){
scrollTop: 0,
fromUrlByMy: '',
enrollId: '',
configData: {},
timeArray: [],
defaultIndex: 0,
isHelpJoin: false,
userList: [],
show: false,
result: '',
helpUser: 1,
weekList: {
0: '周日',
1: '周一',
2: '周二',
3: '周三',
4: '周四',
5: '周五',
6: '周六',
},
chooseDate: [],
}
},
methods: {
calConfirm(date) {
const start = moment(date[0]).format('MM月DD日')
const end = moment(date[1]).format('MM月DD日')
this.formData.specificTime = start + '-' + end
this.timeVisible = false
},
daySelect(day) {
this.chooseDate = []
const date = moment(day[0])
for (let i = 1; i <= this.lotValue - 1; i++) {
const afterDate = date.clone().add(i, 'days')
const afterDateStr = moment(afterDate).format('YYYY-MM-DD')
if(this.holidays.includes(afterDateStr)) {
this.$toast(afterDateStr + '是节假日或前一天,不能选择')
this.$refs.cal.reset(null)
break
}
this.chooseDate.push(afterDateStr)
if(i === (this.lotValue - 1)) {
const afterDate = date.clone().add(this.lotValue - 1, 'days')
const afterDateStr = moment(afterDate).format('YYYY-MM-DD')
day[1] = new Date(afterDateStr)
this.$refs.cal.reset(day)
}
}
this.$forceUpdate()
},
formatter(day) {
const date = moment(day.date).format('YYYY-MM-DD')
if(this.timeArray.indexOf(date) === -1) {
day.type = 'disabled'
}
if(this.chooseDate.length > 0 && this.chooseDate.includes(date)) {
day.className = 'cal_middle'
if(date === this.chooseDate[this.chooseDate.length - 1]) {
day.className = 'cal_end'
day.bottomInfo = '离店';
}
}
if (day.type === 'start') {
day.bottomInfo = '入住';
} else if (day.type === 'end') {
day.bottomInfo = '离店';
}
return day
},
roomCancel() {
if (!this.self) {
this.formData.companionList[this.active].bedInfo.bedType = ''
@@ -484,6 +673,14 @@ layout("/mobile/platform.html"){
roomConfirm(value, index) {
if (this.self) {
this.formData.bedInfo.bedType = value
if (value === '大床房') {
this.formData.bedInfo.bedNum = 1
this.formData.bedInfo.isSleepTogether = false
this.formData.bedInfo.otherSleepUser = ''
} else {
this.formData.bedInfo.bedNum = 2
this.formData.bedInfo.isSleepTogether = true
}
} else {
this.formData.companionList[this.active].bedInfo.bedType = value
}
@@ -501,12 +698,15 @@ layout("/mobile/platform.html"){
return value != null
},
async joinSubmit() {
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
let toast = null
if (!this.enrollId) {
toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
}
const cloneData = clone(this.formData)
cloneData.companionList.forEach((item, index) => {
if (item.userName === '') {
@@ -516,21 +716,38 @@ layout("/mobile/platform.html"){
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doSignUpForBaseManagement', {
enroll: JSON.stringify(cloneData),
})
setTimeout(() => {
if (this.enrollId) {
if (resp.code === 0) {
toast.message = '提交成功'
toast.type = 'success'
vant.Dialog.alert({
title: '温馨提示',
message: '修改成功,请务必联系并告知旅行社',
}).then(() => {
if (this.helpUser === 1) {
location.href = '/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index
}
})
} else {
toast.message = resp.msg
toast.type = 'fail'
vant.Toast(resp.msg)
}
} else {
setTimeout(() => {
toast.clear()
}, 500)
if (resp.code === 0) {
location.href = '/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index
}
}, 1000)
if (resp.code === 0) {
toast.message = '提交成功'
toast.type = 'success'
} else {
toast.message = resp.msg
toast.type = 'fail'
}
setTimeout(() => {
toast.clear()
}, 500)
if (resp.code === 0 && this.helpUser === 1) {
location.href = '/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index
} else {
this.helpJoin();
}
}, 1000)
}
},
addCompanion() {
this.formData.companionList.push({userName: '', loginName: '', sex: '', relation: '', bedInfo: {}})
@@ -538,31 +755,78 @@ layout("/mobile/platform.html"){
delCompanion() {
this.formData.companionList.splice(this.active, 1)
},
async join() {
const re = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo', {
enroll: JSON.stringify({
takePartInBaseManagementId: this.baseData.id,
isNormal: this.baseData.isNormal,
id: this.enrollId
}),
})
if (re.code !== 0) {
vant.Toast(re.msg)
return
async helpJoin() {
this.formData = {
userName: "",
loginName: "",
unionName: "",
idCard: "",
mobile: "",
baseName: this.baseData.baseName,
takePartInBaseManagementId: this.baseData.id,
companionList: [],
bedInfo: {},
}
if (this.fromUrlByMy !== 'editDo') {
this.formData = {
userName: "${@shiro.getPrincipalProperty('username')}",
loginName: "${@shiro.getPrincipalProperty('loginname')}",
unionName: "${@shiro.getPrincipalProperty('union').getUnionname()}",
idCard: "${@shiro.getPrincipalProperty('idcard')}",
mobile: "${@shiro.getPrincipalProperty('mobile')}",
baseName: this.baseData.baseName,
takePartInBaseManagementId: this.baseData.id,
companionList: [],
bedInfo: {},
this.helpUser = 0;
if(this.index == 3) {
await this.getTimeArray()
}
this.joinPopup = true
},
async join() {
this.helpUser = 1
if (this.fromUrlByMy !== 'find') {
const re = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo', {
enroll: JSON.stringify({
takePartInBaseManagementId: this.baseData.id,
isNormal: this.baseData.isNormal,
id: this.enrollId
}),
})
if (re.code !== 0) {
vant.Toast(re.msg)
return
}
if (this.fromUrlByMy !== 'editDo') {
this.formData = {
userName: "${@shiro.getPrincipalProperty('username')}",
loginName: "${@shiro.getPrincipalProperty('loginname')}",
unionName: "${@shiro.getPrincipalProperty('union').getUnionname()}",
idCard: "${@shiro.getPrincipalProperty('idcard')}",
mobile: "${@shiro.getPrincipalProperty('mobile')}",
baseName: this.baseData.baseName,
takePartInBaseManagementId: this.baseData.id,
companionList: [],
bedInfo: {},
}
this.formData.bedInfo.bedType = '大床房'
this.defaultIndex = this.formData.bedInfo.bedType === '标准间' ? "1" : "0"
this.formData.bedInfo.bedNum = 2
this.formData.bedInfo.isSleepTogether = true
}
//不是查看,是修改
const now_date = moment()//当前时间
let start = this.formData.specificTime ? this.formData.specificTime.split('-')[0] : '01月01日'
start = new Date().getFullYear() + '-' + start.replaceAll('月', '-').replaceAll('日', '')
const targetDate = new Date(start);
const previousThursdayDate = this.getPreviousThursday(targetDate);
const previousStr = previousThursdayDate.toISOString().split('T')[0]
let start_date = moment(previousStr) // 时间区间开始日期
//1.已经报名,2.当前时间大于活动开始时间(只要大于活动开始时间就表示错过了某个时间段)
if (this.enrollId && now_date >= start_date && this.formData.isTakePartIn === false) {
vant.Dialog.alert({
title: '温馨提示',
message: '您报的时间段已过,请联系管理员修改后方可修改',
})
return
}
if(this.index == 3) {
await this.getTimeArray()
}
this.$set(this.formData.bedInfo, 'bedType', '大床房')
}
this.joinPopup = true
},
@@ -574,8 +838,66 @@ layout("/mobile/platform.html"){
this.baseData = res.data
this.formData.baseName = this.baseData.baseName
this.skeLoading = false
//如果是四晚五天,就获取周一到周五
/*if (this.baseData.lotName === '四晚五天') {
this.timeArray = this.getTimeByLot1()
} else if (this.baseData.lotName === '两晚三天') {
this.timeArray = this.getTimeByLot2()
}*/
}
},
async getTimeArray() {
const res = await $.post('/platform/theRapyRecuperation/baseManagement/getTimeArray', {
id: this.id
})
this.timeArray = res.data.days
this.holidays = res.data.holidays
this.lotValue = Number(res.data.lotValue)
this.minDate = new Date(res.data.minDate)
this.maxDate = new Date(res.data.maxDate)
},
getTimeByLot1() {
let timeArray = []
let now_date = moment()//当前时间
let start_date = moment(this.baseData.activityStartTime) // 时间区间开始日期
let end_date = moment(this.baseData.activityEndTime) // 时间区间结束日期
while (start_date <= end_date) {
if (start_date.day() === 1) {
const week_start = start_date.format('MM月DD日')
const week_end = start_date.clone().add(4, 'day')
if (week_end <= end_date && now_date < start_date) {
timeArray.push(week_start + '-' + week_end.format('MM月DD日'))
}
start_date.add(7, 'day')
} else {
start_date.add(1, 'day')
}
}
return timeArray
},
getTimeByLot2() {
let timeArray = []
let now_date = moment()//当前时间
let start_date = moment(this.baseData.activityStartTime) // 时间区间开始日期
let end_date = moment(this.baseData.activityEndTime) // 时间区间结束日期
while (start_date <= end_date) {
if (start_date.day() === 5) {
const week_start = start_date.format('MM月DD日')
const week_end = start_date.clone().add(2, 'day')
if (week_end <= end_date && now_date < start_date) {
timeArray.push(week_start + '-' + week_end.format('MM月DD日'))
}
start_date.add(7, 'day')
} else {
start_date.add(1, 'day')
}
}
timeArray = timeArray.filter(v => {
return v !== '09月29日-10月01日' && v !== '10月06日-10月08日' && v !== '09月15日-09月17日'
})
return timeArray
},
// 点击图片回到顶部方法,加计时器是为了过渡顺滑
backTop() {
const that = this
@@ -611,31 +933,126 @@ layout("/mobile/platform.html"){
this.$forceUpdate()
}
},
async getConfigData() {
const resp = await $.get('/platform/theRapyRecuperation/TheRapyConfig/findOne')
this.configData = resp.data
getPreviousThursday(date) {
// 将输入日期转换为Date对象
const inputDate = new Date(date);
// 获取输入日期的星期几(0表示星期日,1表示星期一,以此类推)
const dayOfWeek = inputDate.getDay();
// 计算距离上一个周四还有多少天(0表示当前为周四)
const daysUntilPreviousThursday = (dayOfWeek + 7 - 4) % 7;
// 计算上一个周四的日期
const previousThursday = new Date(inputDate);
previousThursday.setDate(inputDate.getDate() - daysUntilPreviousThursday);
return previousThursday;
},
fn() {
this.show = true;
},
async delaySearch(query) {
if (query) {
const {data} = await $.get("/platform/fw/condolence/apply/queryUser", {query})
data.forEach(v => {
v.name = v.username + '(' + v.loginname + ')'
return v
})
this.userList = data
}
},
async toResult(loginname) {
const res = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo', {
enroll: JSON.stringify({
takePartInBaseManagementId: this.baseData.id,
isNormal: true,
id: this.enrollId
}),
loginName: loginname
})
if (res.code !== 0) {
vant.Toast(res.msg)
return
}
const resp = await $.post('/platform/theRapyRecuperation/baseManagement/getUserByLoginName', {loginName: loginname})
if (resp.code === 0) {
const o = resp.data
this.formData = {
userName: o.username,
loginName: o.loginname,
unionName: o.unionname,
idCard: o.idcard,
mobile: o.mobile,
baseName: this.baseData.baseName,
takePartInBaseManagementId: this.baseData.id,
companionList: [],
bedInfo: {},
}
}
this.show = false
},
},
async created() {
this.id = getQueryString('id') ? getQueryString('id') : ''
this.enrollId = getQueryString('enrollId') ? getQueryString('enrollId') : ''
this.index = getQueryString('index') ? getQueryString('index') : ''
await this.getConfigData()
//编辑传出来的参数
this.fromUrlByMy = getQueryString('fromUrlByMy') ? getQueryString('fromUrlByMy') : ''
if (this.enrollId) {
await this.findSignUpInfoById()
}
this.getData()
await this.getData()
try {
const parser = new DOMParser();
const doc = parser.parseFromString(this.baseData.content, 'text/html');
const link = doc.querySelector('a');
const href = link.getAttribute('href');
this.$nextTick(() => {
pdfh5 = new Pdfh5('#demo', {
pdfurl: href,
});
})
}catch (e) {
this.isPdf = true
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
vant.ImagePreview({
images: [event.target.src],
closeable: true,
})
}
})
}
this.$nextTick(() => {
pdfh5.on("complete", function () {
const imgDoc = document.querySelectorAll('img')
let array = []
let classArray = []
imgDoc.forEach(o => {
if(o.getAttribute('class') !== 'top_icon') {
classArray.push(o.getAttribute('class'))
array.push(o.getAttribute('src'))
}
})
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
const index = classArray.indexOf(event.target.className)
if(index !== -1) {
vant.ImagePreview({
images: array,
startPosition: index,
closeable: true,
})
}
}
})
})
})
},
mounted() {
window.addEventListener('scroll', this.scrollToTop)
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG') {
vant.ImagePreview([event.target.src])
}
})
},
destroyed() {
window.removeEventListener('scroll', this.scrollToTop)
@@ -321,6 +321,12 @@ layout("/mobile/platform.html"){
点击报名
</van-button>
</div>
<div style="margin-top: 4px">
<van-button @click.stop="openSignUser(item, 'line')" size="mini" type="info"
style="margin-right: 8px">
查看人员
</van-button>
</div>
</div>
</button>
@@ -362,6 +368,10 @@ layout("/mobile/platform.html"){
}
},
methods: {
async openSignUser(row, type) {
const id = type === 'line' ? row.usId : row.id
location.href = '/platform/mobile/theRapyRecuperation/userSignInfo?type=' + type + '&id=' + id
},
async clickLineRow(o) {
this.clickRow = o
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/getSelectLineById',
@@ -511,7 +521,7 @@ layout("/mobile/platform.html"){
this.createYear()
await this.getModifyConfig()
this.chooseButton = await getEnumOptions('TheRapyRecuperationType')
this.chooseButton = this.chooseButton.filter(o => o.value !== 2 && o.value !== 3)
this.chooseButton = this.chooseButton.filter(o => o.value !== 2)
const unions = await this.getTheRapyUnions()
unions.forEach(item => {
this.unionColumns.push({text: item.unionname, value: item.id})
@@ -0,0 +1,84 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
#app {
font-family: ,serif;
}
.van-index-bar {
margin-bottom: 20px;
}
.van-empty {
height: calc(100vh - 46px - 54px);
position: unset;
transform: none;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="history.back()" fixed left-arrow placeholder
title="报名人员"></van-nav-bar>
</van-sticky>
<van-search v-model="searchKeyWord" placeholder="请输入姓名查询" @search="getSignUser"></van-search>
<template v-if="Object.keys(signUserData).length > 0">
<van-index-bar :sticky-offset-top="46" :index-list="Object.keys(signUserData)">
<template v-for="(value, key) in signUserData">
<van-index-anchor :index="key"></van-index-anchor>
<van-cell v-for="item in value" :title="item.userName + '' + item.unionName + ''"></van-cell>
</template>
</van-index-bar>
</template>
<van-empty v-else description="暂无报名人员"></van-empty>
</div>
<script>
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURI(r[2]);
return null;
}
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
searchKeyWord: '',
signUserData: [],
id: '',
type: '',
}
},
methods: {
async getSignUser() {
const params = this.type === 'line' ? {usId: this.id, searchKeyWord: this.searchKeyWord} : {travelId: this.id, searchKeyWord: this.searchKeyWord}
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力查询中',
})
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/openSignUser', params)
this.signUserData = resp.data
toast.close()
},
},
async created() {
this.id = getQueryString('id')
this.type = getQueryString('type')
await this.getSignUser()
},
})
</script>
<!--#
}
#-->
@@ -76,7 +76,8 @@ layout("/layouts/platform.html"){
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="目的地列表">
<template #func>
<el-button @click="openImport" size="medium" type="primary" style="margin-right: 10px">导入目的地</el-button>
<el-button @click="openImport" size="medium" type="primary" style="margin-right: 10px">导入目的地
</el-button>
<el-button @click="openAdd" size="medium" type="primary">新建目的地</el-button>
</template>
</table-tool>
@@ -109,6 +110,9 @@ layout("/layouts/platform.html"){
<span v-if="row.lotId===item.id">{{item.lotName}}</span>
</div>
</template>
<template scope="{row}" v-else-if="column.prop==='createUserName'">
{{row.createUserName + '' + row.createUnionName + ''}}
</template>
<template scope="{row}" v-else-if="column.prop==='activityTime'">
<span>
@@ -141,7 +145,8 @@ layout("/layouts/platform.html"){
</el-col>
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="排序编号" prop="sortNumber">
<el-input maxlength="50" v-model="formData.sortNumber"></el-input>
<el-input-number maxlength="50" v-model="formData.sortNumber"
style="width: 100%"></el-input-number>
</el-form-item>
</el-col>
</el-row>
@@ -213,6 +218,32 @@ layout("/layouts/platform.html"){
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="周几入住" prop="weekIn">
<el-radio-group size="small" v-model="formData.weekIn" @input="weekChange">
<el-radio :label="1" border>不限</el-radio>
<el-radio :label="2" border>读取标段配置</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="入住时间" prop="weekCheckIn">
<el-select clearable filterable multiple
:disabled="formData.weekIn === 1"
style="width: 100%" v-model="formData.weekCheckIn">
<el-option label="周一" :value="1"></el-option>
<el-option label="周二" :value="2"></el-option>
<el-option label="周三" :value="3"></el-option>
<el-option label="周四" :value="4"></el-option>
<el-option label="周五" :value="5"></el-option>
<el-option label="周六" :value="6"></el-option>
<el-option label="周日" :value="0"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="目的地联系人" prop="baseContactPerson">
@@ -256,6 +287,7 @@ layout("/layouts/platform.html"){
<el-date-picker style="width: 100%"
type="datetime"
v-model="formData.changeEndTime"
format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
@@ -281,9 +313,10 @@ layout("/layouts/platform.html"){
<el-date-picker
placeholder="活动开始时间"
style="width: 100%"
type="date"
type="datetime"
v-model="formData.activityStartTime"
value-format="yyyy-MM-dd">
format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-col>
@@ -292,9 +325,10 @@ layout("/layouts/platform.html"){
<el-date-picker
placeholder="活动结束时间"
style="width: 100%"
type="date"
type="datetime"
v-model="formData.activityEndTime"
value-format="yyyy-MM-dd">
format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-col>
@@ -325,13 +359,9 @@ layout("/layouts/platform.html"){
<el-row :gutter="20">
<el-col :md="24" :sm="24" :xs="24">
<el-form-item label="图片上传" prop="files">
<file-upload :files.sync="formData.files" :max="1" :type="['jpg', 'jpeg', 'png']">
<template #el-upload__tip>
<div class="el-upload__tip" slot="tip">
图片类请上传jpg/png/jpeg格式,上传数量为1个
</div>
</template>
</file-upload>
<image-Upload :height="100" :width="100" :limit="1" :file-type="['png', 'jpg']"
:file-size="1"
v-model="formData.files"></image-Upload>
</el-form-item>
</el-col>
</el-row>
@@ -342,9 +372,7 @@ layout("/layouts/platform.html"){
<el-button @click="doSubmit" type="primary" v-throttle>提交</el-button>
</el-row>
</template>
<template #view>
<base-info ref="viewBaseInfo"></base-info>
</template>
<el-dialog
title="目的地导入"
@@ -391,6 +419,9 @@ layout("/layouts/platform.html"){
</span>
</el-dialog>
<template #view>
<base-info ref="viewBaseInfo"></base-info>
</template>
</guava>
</div>
<script>
@@ -416,27 +447,27 @@ layout("/layouts/platform.html"){
if (!value) {
callback(new Error('请选择变更截至时间'))
}
if (this.formData.activityStartTime) {
if (Date.parse(value) >= Date.parse(this.formData.activityStartTime)) {
callback(new Error('变更截至时间必须小于活动开始时间'))
if (this.formData.activityEndTime) {
if (Date.parse(value) >= Date.parse(this.formData.activityEndTime)) {
callback(new Error('变更截至时间必须小于活动结束时间'))
}
}
if (this.formData.signUpEndTime) {
/*if (this.formData.signUpEndTime) {
if (Date.parse(value) <= Date.parse(this.formData.signUpEndTime)) {
callback(new Error('变更截至时间必须大于活动截至时间'))
}
}
}*/
callback()
}
const validateActivityStartTime = (rule, value, callback) => {
if (!value) {
callback(new Error('请选择活动开始时间'))
}
if (this.formData.changeEndTime) {
/*if (this.formData.changeEndTime) {
if (Date.parse(value) <= Date.parse(this.formData.changeEndTime)) {
callback(new Error('活动开始时间必须大于变更截至时间'))
}
}
}*/
callback()
}
const validateActivityEndTime = (rule, value, callback) => {
@@ -483,6 +514,7 @@ layout("/layouts/platform.html"){
activityEndTime: '',
baseContactPerson: '',
baseContactNumber: '',
weekIn: 1,
},
tableColumns: [
{label: '年度', prop: 'year', sortable: true},
@@ -512,8 +544,17 @@ layout("/layouts/platform.html"){
changeEndTime: [{required: true, validator: validateChangeEndTime, trigger: ['change', 'blur']}],
files: [{required: true, message: '请上传图片', trigger: ['change', 'blur']}],
createMode: [{required: true, message: '请选择组织方式', trigger: ['change', 'blur']}],
activityStartTime: [{ required: true, validator: validateActivityStartTime, trigger: ['change', 'blur'] }],
activityEndTime: [{ required: true, validator: validateActivityEndTime, trigger: ['change', 'blur'] }],
weekIn: [{required: true, message: '请选择组织方式', trigger: ['change', 'blur']}],
activityStartTime: [{
required: true,
validator: validateActivityStartTime,
trigger: ['change', 'blur']
}],
activityEndTime: [{
required: true,
validator: validateActivityEndTime,
trigger: ['change', 'blur']
}],
estimatedCost: [{required: true, message: '请输入预计费用', trigger: ['change', 'blur']}],
},
//目的地导入
@@ -523,6 +564,20 @@ layout("/layouts/platform.html"){
}
},
methods: {
weekChange(val) {
if (val === 1) {
this.formData.weekCheckIn = []
this.$forceUpdate()
} else {
if (!this.formData.lotId) {
this.$message.warning('请先选择标段')
this.formData.weekIn = 1
return
}
const lot = this.modifyBdList.find(o => o.id === this.formData.lotId)
this.formData.weekCheckIn = lot ? lot.weekCheckIn : []
}
},
async doSearch() {
this.formData.year = this.pageForm.year;
await this.yearChange();
@@ -541,6 +596,7 @@ layout("/layouts/platform.html"){
this.formData.id = null
this.initLineContentEditor()
})
await this.getNumber()
},
async openEdit(id) {
const resp = await $.post(loc() + '/selectBaseManageById/' + id)
@@ -550,6 +606,7 @@ layout("/layouts/platform.html"){
const data = resp.data
data.year = data.year.toString()
this.formData = {...data}
this.formData.weekIn = this.formData.weekCheckIn && this.formData.weekCheckIn.length > 0 ? 2 : 1
this.initLineContentEditor(data.content)
} else {
this.notifyWarning(resp.msg)
@@ -589,8 +646,8 @@ layout("/layouts/platform.html"){
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
const resp = await $.post(loc() + '/doSubmit', {base: JSON.stringify(this.formData)})
this.formData.weekCheckIn = JSON.stringify(this.formData.weekCheckIn)
const resp = await $.post(loc() + '/doSubmit', this.formData)
loading.close()
if (resp.code === 0) {
this.$refs.guava.index()
@@ -666,12 +723,13 @@ layout("/layouts/platform.html"){
processData: false,
contentType: false,
success: (data) => {
if (data.code === 0){
requestLaterMsgFun(this, data, async () => {
this.pageData();
this.importVisible = false
}else {
this.importVisible = false
}
}, () => {
}, () => {
this.importLoading = false
})
},
error: (data) => {
this.notifyWarning("导入失败")
@@ -679,6 +737,10 @@ layout("/layouts/platform.html"){
}
});
},
async getNumber() {
const resp = await $.post(loc() + '/getNo')
this.formData.sortNumber = resp.data
},
},
async created() {
await this.initPageData();
@@ -140,43 +140,68 @@ layout("/layouts/platform.html"){
></file-upload>
</el-form-item>
<vi-title title="标段管理"></vi-title>
<el-form-item label="标段">
<el-button type="primary" @click="formData.lots.push({})"
style="float: right;">增加一条
</el-button>
<el-table :data="formData.lots" stripe style="width: 100%">
<el-table-column prop="index" label="序号" width="180">
<template scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column prop="lotName" label="标段名称">
<template scope="{row}">
<el-input v-model="row.lotName" placeholder="请输入标段名称"></el-input>
</template>
</el-table-column>
<el-table-column prop="lotValue" label="标段值">
<template scope="{row}">
<el-input v-model="row.lotValue" placeholder="请输入标段值"></el-input>
</template>
</el-table-column>
<el-table-column prop="activityCost" label="标段费用">
<template scope="{row}">
<el-input v-model="row.activityCost" placeholder="请输入标段费用"></el-input>
</template>
</el-table-column>
<!--# if(@shiro.hasRole('sysadmin')){ #-->
<el-table-column prop="index" label="操作">
<template scope="scope">
<el-button type="danger" icon="el-icon-delete"
@click="deleteLotsRow(scope)"></el-button>
</template>
<vi-title title="标段管理(温馨提示:排除节假日及前一天、报名选择周几入住,只对目的地疗休养报名时选择出行时间有作用)"></vi-title>
<el-table :data="formData.lots" stripe style="width: 100%">
<el-table-column prop="index" label="序号" width="180">
<template scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column prop="lotName" label="标段名称">
<template scope="{row}">
<el-input v-model="row.lotName" placeholder="请输入标段名称"></el-input>
</template>
</el-table-column>
<el-table-column prop="lotValue" label="标段值">
<template scope="{row}">
<el-input v-model="row.lotValue" placeholder="请输入标段值"></el-input>
</template>
</el-table-column>
<el-table-column prop="activityCost" label="标段费用">
<template scope="{row}">
<el-input v-model="row.activityCost" placeholder="请输入标段费用"></el-input>
</template>
</el-table-column>
</el-table-column>
<!--# } #-->
</el-table>
</el-form-item>
<el-table-column prop="filterHolidays" label="排除节假日及前一天">
<template scope="{row}">
<el-radio-group v-model="row.filterHolidays" size="small">
<el-radio-button :label="true">排除</el-radio-button>
<el-radio-button :label="false">不排除</el-radio-button>
</el-radio-group>
</template>
</el-table-column>
<el-table-column prop="weekCheckIn" label="报名选择周几入住" width="300px">
<template scope="{row}">
<el-select placeholder="请选择报名选择周几入住" v-model="row.weekCheckIn"
style="width: 100%;" clearable filterable multiple>
<el-option label="周一" :value="1"></el-option>
<el-option label="周二" :value="2"></el-option>
<el-option label="周三" :value="3"></el-option>
<el-option label="周四" :value="4"></el-option>
<el-option label="周五" :value="5"></el-option>
<el-option label="周六" :value="6"></el-option>
<el-option label="周日" :value="0"></el-option>
</el-select>
</template>
</el-table-column>
<!--# if(@shiro.hasRole('sysadmin')){ #-->
<el-table-column prop="index" label="操作">
<template slot="header" scope="scope">
<el-button type="primary" @click="formData.lots.push({})" size="small">
增加一条
</el-button>
</template>
<template scope="scope">
<el-button type="danger" icon="el-icon-delete" size="small"
@click="deleteLotsRow(scope)"></el-button>
</template>
</el-table-column>
<!--# } #-->
</el-table>
<vi-title title="服务须知"></vi-title>
<el-form-item label="疗休养服务须知" prop="notice">