Merge branch 'main' of https://dd3skj.picp.vip/zhaoxinyu/zhgh_hhu
This commit is contained in:
@@ -1,15 +1,22 @@
|
||||
package io.v.nutz.activity.controller.site;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.activity.models.ActivitySiteInfo;
|
||||
import io.v.nutz.activity.models.ActivitySiteReserve;
|
||||
import io.v.nutz.activity.models.ActivityType;
|
||||
import io.v.nutz.activity.services.ActivityCommonService;
|
||||
import io.v.nutz.activity.services.SiteInfoService;
|
||||
import io.v.nutz.activity.services.SiteReserveService;
|
||||
import io.v.nutz.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.constant.AuditTypeEnum;
|
||||
import io.v.nutz.modules.models.AuditState;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.sys.services.SysUnitService;
|
||||
import io.v.nutz.sys.services.SysUserService;
|
||||
@@ -33,7 +40,9 @@ import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -153,6 +162,17 @@ public class SiteReserveController {
|
||||
@ViReturn
|
||||
public Object doAdd(@Param("data") ActivitySiteReserve activitySiteReserve, @Param("days") String[] days) {
|
||||
|
||||
Map<Boolean, String> validateSiteReserve = siteReserveService.validateSiteReserve(
|
||||
activitySiteReserve.getSite_id(),
|
||||
activitySiteReserve.getReserve_day(),
|
||||
activitySiteReserve.getStart_time(),
|
||||
activitySiteReserve.getEnd_time(),
|
||||
activitySiteReserve.getJoinCount()
|
||||
);
|
||||
if(validateSiteReserve.containsKey(false)) {
|
||||
return Result.error(validateSiteReserve.get(false));
|
||||
}
|
||||
|
||||
String r = R.UU32();
|
||||
activitySiteReserve.setSqid(r);
|
||||
|
||||
@@ -178,8 +198,7 @@ public class SiteReserveController {
|
||||
siteReserveService.insert(activitySiteReserve);
|
||||
}
|
||||
|
||||
//发送微信提醒审核人
|
||||
//查询状态码对应的审核人
|
||||
//发送微信提醒审核人,查询状态码对应的审核人
|
||||
Sql sql = Sqls.create("""
|
||||
select userId,u.loginname,u.username from audit_state_user asu
|
||||
left join `user` u on u.id = asu.userId left join audit_state s on s.stateId=asu.stateId $condition
|
||||
@@ -348,17 +367,17 @@ public class SiteReserveController {
|
||||
List<String> stateList = list.stream().map(o -> o.getString("stateId")).collect(Collectors.toList());
|
||||
|
||||
Sql i = Sqls.create("""
|
||||
SELECT
|
||||
SELECT
|
||||
ar.*,
|
||||
`as`.stateAuditType
|
||||
FROM
|
||||
`as`.stateAuditType
|
||||
FROM
|
||||
activity_site_reserve ar
|
||||
left join audit_state `as` on `as`.stateId = ar.reserve_state
|
||||
$condition
|
||||
""");
|
||||
cnd.and("site_id", "=", site_id)
|
||||
cnd.and("site_id", "=", site_id);
|
||||
//.and("reserve_day", "=", reserve_day)
|
||||
.and("reserve_state", "not in", stateList);
|
||||
// .and("reserve_state", "not in", stateList);
|
||||
|
||||
i.setCondition(cnd);
|
||||
List<Record> list1 = siteReserveService.list(i);
|
||||
@@ -367,4 +386,98 @@ public class SiteReserveController {
|
||||
return record;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object getAllowTime(String siteId, Integer year, Integer month) {
|
||||
if(StrUtil.isBlank(siteId)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
// 构造该月的第一天,并设置为当天的 00:00:00
|
||||
Date startDate = DateUtil.parse(year + "-" + month + "-01", "yyyy-MM-dd");
|
||||
startDate = DateUtil.beginOfMonth(startDate);
|
||||
// 获取该月最后一天 23:59:59
|
||||
Date endDate = DateUtil.endOfMonth(startDate);
|
||||
// 获取该月的所有日期(包含第一天到最后一天)
|
||||
List<DateTime> dateList = DateUtil.rangeToList(startDate, endDate, DateField.DAY_OF_MONTH);
|
||||
// 找出第一个日期往前 7 天,最后一个日期往后 15 天
|
||||
Date newStartDate = DateUtil.offsetDay(startDate, -7); // 往前 7 天
|
||||
Date newEndDate = DateUtil.offsetDay(endDate, 15); // 往后 15 天
|
||||
// 获取新的日期范围(包含前后扩展的日期)
|
||||
List<DateTime> fullDateList = DateUtil.rangeToList(newStartDate, newEndDate, DateField.DAY_OF_MONTH);
|
||||
|
||||
//查询场地
|
||||
ActivitySiteInfo siteInfo = siteInfoService.fetch(siteId);
|
||||
List<NutMap> openHours = siteInfo.getOpen_hours();
|
||||
List<Integer> weekNumList = openHours.stream().map(o -> o.getInt("weekNum")).distinct().collect(Collectors.toList());
|
||||
|
||||
List<String> result = new ArrayList<>();
|
||||
//循环时间段
|
||||
for (DateTime day : fullDateList) {
|
||||
//先判断星期
|
||||
int week = day.dayOfWeek() - 1;
|
||||
if(weekNumList.contains(week)) {
|
||||
result.add(DateUtil.format(day, "yyyy-MM-dd"));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object getTimesByDay(String siteId, String day) {
|
||||
//获取场地
|
||||
ActivitySiteInfo siteInfo = siteInfoService.fetch(siteId);
|
||||
List<NutMap> openHours = siteInfo.getOpen_hours();
|
||||
Integer maxNum = siteInfo.getMaxNum();
|
||||
|
||||
//获取星期
|
||||
DateTime dateTime = DateUtil.parse(day);
|
||||
int week = dateTime.dayOfWeek() - 1;
|
||||
|
||||
List<NutMap> result = new ArrayList<>();
|
||||
//这个是满足星期的所有时间
|
||||
List<NutMap> mapList = openHours.stream().filter(o -> o.getInt("weekNum") == week).collect(Collectors.toList());
|
||||
for (NutMap nutMap : mapList) {
|
||||
String startTime = nutMap.getString("start_time");
|
||||
String endTime = nutMap.getString("end_time");
|
||||
int timeUnit = nutMap.getInt("timeUnit");
|
||||
if(timeUnit == 0) {
|
||||
result.add(NutMap.NEW().addv("start_time", startTime).addv("end_time", endTime));
|
||||
} else {
|
||||
// 构造起始时间
|
||||
DateTime start = DateUtil.parse(startTime, "HH:mm"); // "09:00"
|
||||
DateTime end = DateUtil.parse(endTime, "HH:mm"); // "17:00"
|
||||
DateTime current = start;
|
||||
while (DateUtil.compare(current, end) < 0) { // 当前时间 <= 结束时间
|
||||
DateTime next = DateUtil.offsetSecond(current, (int) (timeUnit * 3600));
|
||||
// 如果超过结束时间,则使用 endTime
|
||||
if (DateUtil.compare(next, end) > 0) {
|
||||
result.add(NutMap.NEW().addv("start_time", DateUtil.format(current, "HH:mm")).addv("end_time", DateUtil.format(end, "HH:mm")));
|
||||
break;
|
||||
} else {
|
||||
result.add(NutMap.NEW().addv("start_time", DateUtil.format(current, "HH:mm")).addv("end_time", DateUtil.format(next, "HH:mm")));
|
||||
}
|
||||
current = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ActivityType type = siteInfoService.dao().fetch(ActivityType.class, siteInfo.getTypeId());
|
||||
List<AuditState> stateList = siteInfoService.dao().query(AuditState.class, Cnd.where("module", "=", type.getModuleName()).and("stateAuditType", "!=", AuditTypeEnum.REJECT.getValue()));
|
||||
//找预约记录
|
||||
for (NutMap nutMap : result) {
|
||||
List<ActivitySiteReserve> reserveList = siteInfoService.dao().query(
|
||||
ActivitySiteReserve.class,
|
||||
Cnd.where("site_id", "=", siteId)
|
||||
.and("reserve_day", "=", day)
|
||||
.and("start_time", "=", nutMap.getString("start_time"))
|
||||
.and("end_time", "=", nutMap.getString("end_time"))
|
||||
.and("reserve_state", "in", stateList.stream().map(AuditState::getStateId).collect(Collectors.toList()))
|
||||
);
|
||||
int count = reserveList.stream().mapToInt(ActivitySiteReserve::getJoinCount).sum();
|
||||
nutMap.addv("allowCount", maxNum);
|
||||
nutMap.addv("hasCount", count);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ActivitySiteInfo {
|
||||
@Column
|
||||
@Comment("开放时段")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List open_hours;
|
||||
private List<NutMap> open_hours;
|
||||
|
||||
@Column
|
||||
@Comment("创建人")
|
||||
@@ -68,28 +68,28 @@ public class ActivitySiteInfo {
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer typeId;
|
||||
|
||||
@Column
|
||||
@Comment("是否多次预约")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean multiple;
|
||||
|
||||
@Column
|
||||
@Comment("限定工作日预约")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean workday;
|
||||
|
||||
@Column
|
||||
@Comment("限制男女,0表示不限制,1表示限制男,2表示限制女")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer sexLimit;
|
||||
|
||||
@Column
|
||||
@Comment("预约时间")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<Integer> openWeekTime;
|
||||
|
||||
@Column
|
||||
@Comment("场地的禁用时间")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private List<NutMap> notApplyTimeList;
|
||||
|
||||
@Column
|
||||
@Comment("场地介绍")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String introduce;
|
||||
|
||||
@Column
|
||||
@Comment("可容纳人数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer maxNum;
|
||||
|
||||
@Column
|
||||
@Comment("面向预约对象(1.面向分工会,2.面向个人,3.面向集体)")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer reserveTarget;
|
||||
}
|
||||
|
||||
@@ -122,4 +122,9 @@ public class ActivitySiteReserve extends BaseModel {
|
||||
@Comment("参与人员")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String joinUser;
|
||||
|
||||
@Column
|
||||
@Comment("预约人数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer joinCount;
|
||||
}
|
||||
|
||||
@@ -4,5 +4,9 @@ package io.v.nutz.activity.services;
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import io.v.nutz.activity.models.ActivitySiteReserve;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface SiteReserveService extends BaseService<ActivitySiteReserve> {
|
||||
|
||||
Map<Boolean, String> validateSiteReserve(String siteId, String day, String startTime, String endTime, Integer joinCount);
|
||||
}
|
||||
|
||||
@@ -2,11 +2,20 @@ package io.v.nutz.activity.services.impl;
|
||||
|
||||
|
||||
import cn.wizzer.framework.base.service.BaseServiceImpl;
|
||||
import io.v.nutz.activity.models.ActivitySiteInfo;
|
||||
import io.v.nutz.activity.models.ActivitySiteReserve;
|
||||
import io.v.nutz.activity.models.ActivityType;
|
||||
import io.v.nutz.activity.services.SiteReserveService;
|
||||
import io.v.nutz.constant.AuditTypeEnum;
|
||||
import io.v.nutz.modules.models.AuditState;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2020-12-13 14:32
|
||||
@@ -14,7 +23,31 @@ import org.nutz.ioc.loader.annotation.IocBean;
|
||||
**/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class SiteReserveServiceImpl extends BaseServiceImpl<ActivitySiteReserve> implements SiteReserveService {
|
||||
|
||||
public SiteReserveServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Boolean, String> validateSiteReserve(String siteId, String day, String startTime, String endTime, Integer joinCount) {
|
||||
ActivitySiteInfo siteInfo = dao().fetch(ActivitySiteInfo.class, siteId);
|
||||
|
||||
ActivityType type = dao().fetch(ActivityType.class, siteInfo.getTypeId());
|
||||
|
||||
List<AuditState> stateList = dao().query(AuditState.class, Cnd.where("module", "=", type.getModuleName()).and("stateAuditType", "!=", AuditTypeEnum.REJECT.getValue()));
|
||||
|
||||
List<ActivitySiteReserve> reserveList = dao().query(
|
||||
ActivitySiteReserve.class,
|
||||
Cnd.where("site_id", "=", siteId)
|
||||
.and("reserve_day", "=", day)
|
||||
.and("start_time", "=", startTime)
|
||||
.and("end_time", "=", endTime)
|
||||
.and("reserve_state", "in", stateList.stream().map(AuditState::getStateId).collect(Collectors.toList()))
|
||||
);
|
||||
int count = reserveList.stream().mapToInt(ActivitySiteReserve::getJoinCount).sum();
|
||||
if((count + joinCount) >= siteInfo.getMaxNum()) {
|
||||
return Map.of(false, "预约人数已满");
|
||||
}
|
||||
return Map.of(true, "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,82 +32,27 @@
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="预约基本信息" name="2">
|
||||
<el-form label-suffix=":" label-position="left" style="padding: 20px 0">
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约人">
|
||||
{{ viewData.reserve_person }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别">
|
||||
{{ viewData.sex }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工号">
|
||||
{{ viewData.loginname }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属单位">
|
||||
{{ viewData.reserve_person_unit }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话">
|
||||
{{ viewData.reserve_person_phone }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约时间">
|
||||
<span style="color: #409EFF">
|
||||
({{ viewData.concat_day }}) {{ viewData.start_time }} - {{ viewData.end_time }}
|
||||
</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row gutter="20">
|
||||
<!--<el-col :span="12">
|
||||
<el-form-item label="预约人单位">
|
||||
{{ viewData.reserve_person_unit }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系方式">
|
||||
{{ viewData.reserve_person_phone }}
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
</el-row>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="场地名称">
|
||||
{{ viewData.site_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约状态">
|
||||
<span v-if="[0].includes(viewData.stateaudittype)"
|
||||
style="color: #e6a23c">{{ viewData.state_name }}</span>
|
||||
<span v-if="viewData.stateaudittype==3" style="color: #67c23a">{{ viewData.state_name }}</span>
|
||||
<span v-if="viewData.stateaudittype==1" style="color: #f56c6c">{{ viewData.state_name }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- <el-form-item label="参与人员">
|
||||
<div style="word-break: break-all" v-html="viewData.joinuser"></div>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="预约事由">
|
||||
<div style="word-break: break-all" v-html="viewData.reserve_cause"></div>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="$.parseJSON(backOptionShow) == true" label="反馈意见">
|
||||
<div>{{ viewData.back_option }}</div>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<el-descriptions class="margin-top" :column="3" border>
|
||||
<el-descriptions-item label="预约人">{{ viewData.reserve_person }}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">{{ viewData.sex }}</el-descriptions-item>
|
||||
<el-descriptions-item label="工号">{{ viewData.loginname }}</el-descriptions-item>
|
||||
<el-descriptions-item label="所属单位">{{ viewData.reserve_person_unit }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{ viewData.reserve_person_phone }}</el-descriptions-item>
|
||||
<el-descriptions-item label="预约时间">({{ viewData.concat_day }}) {{ viewData.start_time }} - {{ viewData.end_time }}</el-descriptions-item>
|
||||
<el-descriptions-item label="场地名称">{{ viewData.site_name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="预约状态" :span="2">
|
||||
<span v-if="[0].includes(viewData.stateaudittype)"
|
||||
style="color: #e6a23c">{{ viewData.state_name }}</span>
|
||||
<span v-if="viewData.stateaudittype==3" style="color: #67c23a">{{ viewData.state_name }}</span>
|
||||
<span v-if="viewData.stateaudittype==1" style="color: #f56c6c">{{ viewData.state_name }}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预约事由" :span="3">
|
||||
<div style="word-break: break-all" v-html="viewData.reserve_cause"></div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item v-if="$.parseJSON(backOptionShow) == true" label="反馈意见">
|
||||
<div style="word-break: break-all" v-html="viewData.back_option"></div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
</el-tab-pane>
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 13px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
@@ -220,7 +220,6 @@ layout("/mobile/platform.html"){
|
||||
<span class="title_span">|</span>
|
||||
<span>{{o.name}}</span>
|
||||
</div>
|
||||
<div style="color: grey">{{o.address}}</div>
|
||||
</div>
|
||||
<div style="color: #1867b0;">
|
||||
{{o.meetingtypename}}
|
||||
@@ -230,21 +229,22 @@ layout("/mobile/platform.html"){
|
||||
<van-divider></van-divider>
|
||||
|
||||
<div style="margin-top: 10px">
|
||||
<van-row>
|
||||
<van-col span="24"><span style="color: grey"> 联系人:</span>
|
||||
{{o.contact_person}}
|
||||
</van-col>
|
||||
</van-row>
|
||||
<van-row>
|
||||
<van-col span="24"><span style="color: grey">联系方式:</span>{{o.contact_phone}}</van-col>
|
||||
</van-row>
|
||||
<!--<van-row>
|
||||
<van-col span="24"><span style="color: grey">已预约人数:</span>{{o.count}}</van-col>
|
||||
</van-row>-->
|
||||
<van-row>
|
||||
<van-col span="24"><span style="color: grey">开放时间:</span><span v-if="o.workday === true">工作日</span>
|
||||
{{o.open_time}}</van-col>
|
||||
</van-row>
|
||||
<div>
|
||||
<span>场地地址:</span>
|
||||
<span>{{o.address}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span> 联系人:</span>
|
||||
<span>{{o.contact_person}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>联系方式:</span>
|
||||
<span>{{o.contact_phone}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>场地介绍:</span>
|
||||
<span @click.stop="viewIntroduce(o)" style="color: #0e5996; text-decoration: underline;">点我查看</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -258,35 +258,9 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
|
||||
<van-popup round v-model:show="show" class="pop">
|
||||
<div style="text-align: center;padding: 10px 0; font-size: 20px">爱心母婴室管理规定</div>
|
||||
<div>一、基本原则</div>
|
||||
<div style="padding-left: 30px;">
|
||||
<p>1.使用对象:有哺乳需求的本校在职女教职工。</p>
|
||||
<p>2.开放时间:工作日8:00--17:30。</p>
|
||||
<p>3.使用制度:实行预约登记制。凡有哺乳需求的女教职工提前向校工会提出使用申请,经审核通过并开通权限后即可使用。</p>
|
||||
<p>4.日常管理:由校工会负责。</p>
|
||||
</div>
|
||||
|
||||
<div>二、管理人员</div>
|
||||
<div style="padding-left: 30px;">
|
||||
<p>1.负责爱心母婴室使用登记管理。</p>
|
||||
<p>2.定期保养设备,确保正常使用。</p>
|
||||
<p>3.保持室内整洁、卫生安全,做好保洁消毒记录。</p>
|
||||
<p>4.定期收集意见和建议,不断改进服务。</p>
|
||||
</div>
|
||||
<div>三、使用人员</div>
|
||||
<div style="padding-left: 30px;">
|
||||
<p>1.遵守学校安全管理制度和爱心母婴室管理规定。</p>
|
||||
<p>2.严禁吸烟,安全使用电器,爱护公物,损坏赔偿。</p>
|
||||
<p>3.保持室内卫生清洁,勿大声喧哗,不影响楼内工作秩序。</p>
|
||||
<p>4.妥善保管自带物品,冰存的母乳须贴上姓名标签并及时取走。</p>
|
||||
<p>5.不得擅自携他人入内,不做和哺乳无关事宜,使用完毕及时离开。</p>
|
||||
<p>6.欢迎在《爱心母婴室使用意见簿》上留下您宝贵的意见和建议。</p>
|
||||
</div>
|
||||
<br/>
|
||||
<p>联系人:曾钰媛梦 84894774、15850692181</p>
|
||||
|
||||
<van-button color="#246fb4" @click="toReserve" type="primary" style="width: 100%">已知晓并遵守</van-button>
|
||||
<div style="text-align: center; margin: 10px; font-size: 18px">场地介绍</div>
|
||||
<div v-html="viewData.introduce"></div>
|
||||
<van-button color="#246fb4" @click="show = false" type="primary" style="width: 100%">关闭</van-button>
|
||||
</van-popup>
|
||||
</div>
|
||||
|
||||
@@ -302,10 +276,19 @@ layout("/mobile/platform.html"){
|
||||
typeList: [],
|
||||
show: false,
|
||||
siteId: '',
|
||||
viewData: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
viewIntroduce(o) {
|
||||
this.viewData = o
|
||||
this.show = true
|
||||
},
|
||||
openView(o) {
|
||||
if(o.reservetarget === 1 && "${@shiro.hasRole('H04')}" === 'false' && "${@shiro.hasRole('sysadmin')}" === 'false') {
|
||||
vant.Toast('该场地只能分工会主席预约')
|
||||
return
|
||||
}
|
||||
this.siteId = o.id
|
||||
if (o.sexlimit === 1 || o.sexlimit === 2) {
|
||||
const sex = o.sexlimit === 1 ? '男' : '女'
|
||||
@@ -318,10 +301,6 @@ layout("/mobile/platform.html"){
|
||||
location.href = '/mobile/activity/site/info/reserve?id=' + o.id
|
||||
}
|
||||
},
|
||||
toReserve() {
|
||||
location.href = '/mobile/activity/site/info/reserve?id=' + this.siteId
|
||||
this.show = false
|
||||
},
|
||||
doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.tableData = []
|
||||
@@ -356,4 +335,4 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
@@ -179,11 +179,11 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<van-action-sheet v-model="show" title="确认预约信息">
|
||||
|
||||
<van-cell title="预约人">{{person}}</van-cell>
|
||||
<van-cell title="性别">${@shiro.getPrincipalProperty('sex')}</van-cell>
|
||||
<van-cell title="工号">${@shiro.getPrincipalProperty('loginname')}</van-cell>
|
||||
<van-cell title="所属单位">{{unit}}</van-cell>
|
||||
<van-cell title="联系电话">{{phone}}</van-cell>
|
||||
<van-cell title="预约人">{{formData.reserve_person}}</van-cell>
|
||||
<van-cell title="性别">{{formData.sex}}</van-cell>
|
||||
<van-cell title="工号">{{formData.loginname}}</van-cell>
|
||||
<van-cell title="所属单位">{{formData.reserve_person_unit}}</van-cell>
|
||||
<van-cell title="联系电话">{{formData.reserve_person_phone}}</van-cell>
|
||||
<van-cell title="预约时间">
|
||||
<div v-for="time in times">
|
||||
<van-tag closeable size="medium" type="primary" @close="close(time.fullDay)">
|
||||
@@ -192,8 +192,13 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
</van-cell>
|
||||
<van-cell title="预约地点">{{site.name}}</van-cell>
|
||||
<van-field name="stepper" label="预约人数">
|
||||
<template #input>
|
||||
<van-stepper v-model="formData.joinCount"></van-stepper>
|
||||
</template>
|
||||
</van-field>
|
||||
<van-field
|
||||
v-model="message"
|
||||
v-model="formData.message"
|
||||
rows="4"
|
||||
autosize
|
||||
label="预约事由"
|
||||
@@ -204,7 +209,7 @@ layout("/mobile/platform.html"){
|
||||
></van-field>
|
||||
|
||||
<div style="margin: 20px 0px; display: flex; justify-content: space-between;padding: 0px 22px;">
|
||||
<van-button @click="message = '';show = false" color="#246fb4" style="width: 47%" size="small" plain
|
||||
<van-button @click="formData.message = '';show = false" color="#246fb4" style="width: 47%" size="small" plain
|
||||
type="info">关闭
|
||||
</van-button>
|
||||
<van-button @click="reserveDo" color="#246fb4" style="width: 47%" size="small" type="info">确认</van-button>
|
||||
@@ -226,10 +231,7 @@ layout("/mobile/platform.html"){
|
||||
data() {
|
||||
return {
|
||||
isLoad: false,
|
||||
person: "${@shiro.getPrincipalProperty('username')}",
|
||||
unit: "${@shiro.getPrincipalProperty('unit').getName()}",
|
||||
phone: "${@shiro.getPrincipalProperty('mobile')}",
|
||||
message: '',
|
||||
formData: {},
|
||||
show: false,
|
||||
site_id: '',
|
||||
site: {},
|
||||
@@ -241,8 +243,7 @@ layout("/mobile/platform.html"){
|
||||
selectDate: null,
|
||||
//已经预约的记录
|
||||
alreadyReserveRecord: [],
|
||||
holidays: ['2022-06-03', '2022-06-04', '2022-06-05', '2022-09-10', '2022-09-11', '2022-09-12',
|
||||
'2022-10-01', '2022-10-02', '2022-10-03', '2022-10-04', '2022-10-05', '2022-10-06', '2022-10-07',],
|
||||
allowDayList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -269,11 +270,6 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
calendarFormatter() {
|
||||
return (day) => {
|
||||
// 休息日不能选择
|
||||
/*let week = day.date.getDay()
|
||||
if (week === 0 || week === 6) {
|
||||
day.type = 'disabled'
|
||||
}*/
|
||||
return day
|
||||
}
|
||||
}
|
||||
@@ -307,7 +303,7 @@ layout("/mobile/platform.html"){
|
||||
while (wk.length < 7) {
|
||||
const addDate = moment(startDate).add(count, 'd')
|
||||
let dis = false
|
||||
if(this.site.openWeekTime && !this.site.openWeekTime.includes(addDate.day())) {
|
||||
if(this.allowDayList.length > 0 && !this.allowDayList.includes(moment(addDate).format('YYYY-MM-DD'))) {
|
||||
dis = true
|
||||
}
|
||||
wk.push({
|
||||
@@ -331,14 +327,27 @@ layout("/mobile/platform.html"){
|
||||
vant.Toast('请选择要预约的时段')
|
||||
return
|
||||
}
|
||||
this.$set(this.formData, "reserve_person", '${@shiro.getPrincipalProperty("username")}')
|
||||
this.$set(this.formData, "sex", "${@shiro.getPrincipalProperty('sex')}")
|
||||
this.$set(this.formData, "loginname", "${@shiro.getPrincipalProperty('loginname')}")
|
||||
this.$set(this.formData, "reserve_person_unit", '${@shiro.getPrincipalProperty("unit").getName()}')
|
||||
this.$set(this.formData, "reserve_person_phone", '${@shiro.getPrincipalProperty("mobile")}')
|
||||
|
||||
if(this.site.reserveTarget === 1 || this.site.reserveTarget === 3) {
|
||||
this.$set(this.formData, "joinCount", this.site.maxNum)
|
||||
} else {
|
||||
this.$set(this.formData, "joinCount", 1)
|
||||
}
|
||||
|
||||
this.show = true
|
||||
},
|
||||
async reserveDo() {
|
||||
const resp = await $.post('/mobile/activity/site/info/reserveDo', {
|
||||
siteId: this.site_id,
|
||||
times: JSON.stringify(this.times),
|
||||
message: this.message,
|
||||
joinUser: this.joinUser,
|
||||
message: this.formData.message,
|
||||
joinUser: this.formData.joinUser,
|
||||
joinCount: this.formData.joinCount,
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
vant.Toast('预约成功')
|
||||
@@ -361,6 +370,7 @@ layout("/mobile/platform.html"){
|
||||
if (index > -1) {
|
||||
this.times.splice(index, 1)
|
||||
} else {
|
||||
this.times = []
|
||||
cloneItem.day = this.selectDate.format('YYYY-MM-DD')
|
||||
cloneItem.fullDay = cloneItem.day + ' ' + cloneItem.start_time + '-' + cloneItem.end_time
|
||||
this.times.push(cloneItem)
|
||||
@@ -395,11 +405,7 @@ layout("/mobile/platform.html"){
|
||||
if (now.getTime() >= new Date(end).getTime() && this.selectDate.format('YYYY-MM-DD') === moment().format('YYYY-MM-DD')) {
|
||||
return 0
|
||||
} else {
|
||||
if (this.site.multiple) {
|
||||
return 1
|
||||
} else {
|
||||
return item.hasReserve === true ? 2 : 1
|
||||
}
|
||||
return item.hasCount >= item.allowCount ? 2 : 1
|
||||
}
|
||||
},
|
||||
async onLoad() {
|
||||
@@ -411,16 +417,11 @@ layout("/mobile/platform.html"){
|
||||
this.loading = false
|
||||
},
|
||||
async getReserve() {
|
||||
const resp = await $.post('/mobile/activity/site/info/getReserve', {
|
||||
const { data } = await $.get("/platform/activity/site/reserve/getTimesByDay", {
|
||||
siteId: this.site_id,
|
||||
day: moment(this.selectDate).format('YYYY-MM-DD'),
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
resp.data.forEach(item => {
|
||||
item.isClick = true
|
||||
})
|
||||
this.timeData = resp.data
|
||||
}
|
||||
this.timeData = data
|
||||
},
|
||||
async getMyReservation() {
|
||||
const resp = await $.post('/mobile/activity/site/info/getMyReservation', {
|
||||
@@ -430,26 +431,23 @@ layout("/mobile/platform.html"){
|
||||
this.alreadyReserveRecord = resp.data.map(v => v.reserve_day + " " + v.start_time + "-" + v.end_time)
|
||||
}
|
||||
},
|
||||
getLatestWorkDay() {
|
||||
let selectDate = moment()
|
||||
if(this.site.workday === true) {
|
||||
if (selectDate.day() === 0) {
|
||||
//周日
|
||||
selectDate = moment().add(1, 'd')
|
||||
} else if (selectDate.day() === 6) {
|
||||
//周六
|
||||
selectDate = moment().add(2, 'd')
|
||||
}
|
||||
}
|
||||
return selectDate
|
||||
}
|
||||
async getAllowTime(year = null, month = null) {
|
||||
const m = moment(this.selectDate, "YYYY年M月")
|
||||
const { data } = await $.get("/platform/activity/site/reserve/getAllowTime", {
|
||||
siteId: this.site_id,
|
||||
year: year != null ? year : m.year(),
|
||||
month: month != null ? month : m.month() + 1,
|
||||
})
|
||||
this.allowDayList = data
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.site_id = getQueryString('id')
|
||||
this.selectDate = moment()
|
||||
await this.getReserve()
|
||||
await this.onLoad()
|
||||
this.selectDate = this.getLatestWorkDay()
|
||||
this.setWeekList(this.selectDate)
|
||||
await this.getAllowTime()
|
||||
await this.setWeekList(this.selectDate)
|
||||
await this.getMyReservation()
|
||||
this.isLoad = true
|
||||
}
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-divider--horizontal {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
@@ -57,24 +55,6 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column align="center" show-overflow-tooltip header-align="center" label="联系方式"
|
||||
prop="contact_phone"></el-table-column>
|
||||
|
||||
<el-table-column align="center" show-overflow-tooltip header-align="center" label="每日开放场次"
|
||||
prop="count">
|
||||
<template slot-scope="{row}">
|
||||
<el-tooltip class="item" effect="dark" placement="right">
|
||||
<div slot="content">
|
||||
<div v-if="row.open_hours" v-for="item in row.open_hours">
|
||||
{{item.start_time}} - {{item.end_time}}
|
||||
<el-divider></el-divider>
|
||||
</div>
|
||||
<div v-else>暂无开放场次</div>
|
||||
</div>
|
||||
<el-link :underline="false" type="primary">
|
||||
<i class="el-icon-view el-icon--left"></i>{{row.open_hours.length}}
|
||||
</el-link>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" :show-overflow-tooltip="true" header-align="center" label="开启状态"
|
||||
prop="state">
|
||||
<template slot-scope="{row}">
|
||||
@@ -83,22 +63,6 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" :show-overflow-tooltip="true" header-align="center" label="是否多次预约"
|
||||
prop="multiple">
|
||||
<template slot-scope="{row}">
|
||||
<el-switch disabled v-model="row.multiple" active-color="#13ce66"
|
||||
inactive-color="#ff4949"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!--<el-table-column align="center" :show-overflow-tooltip="true" header-align="center" label="限定工作日预约"
|
||||
prop="workday">
|
||||
<template slot-scope="{row}">
|
||||
<el-switch disabled v-model="row.workday" active-color="#13ce66"
|
||||
inactive-color="#ff4949"></el-switch>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
<el-table-column align="center" label="操作" width="250px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button type="primary" @click="openEdit(row.id)" size="mini">编辑</el-button>
|
||||
@@ -114,9 +78,35 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<vi-title title="填写场地信息"></vi-title>
|
||||
<vi-title title="输入场地信息"></vi-title>
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules" label-width="120px">
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="name" label="场地名称">
|
||||
<el-input maxlength="100" placeholder="请输入场地名称" v-model="formData.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="address" label="场地地址">
|
||||
<el-input maxlength="100" placeholder="请输入场地地址" v-model="formData.address"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="contact_person" label="联系人">
|
||||
<el-input v-model="formData.contact_person" placeholder="请输入联系人" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="contact_phone" label="联系方式">
|
||||
<el-input v-model="formData.contact_phone" placeholder="请输入联系方式" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="create_username" label="创建人">
|
||||
@@ -128,54 +118,10 @@ layout("/layouts/platform.html"){
|
||||
<el-input readonly v-model="formData.create_time" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="name" label="场地名称">
|
||||
<el-input maxlength="100" placeholder="请填写场地名称" v-model="formData.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="address" label="场地地址">
|
||||
<el-input maxlength="100" placeholder="请填写场地地址" v-model="formData.address"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="contact_person" label="联系人">
|
||||
<el-input v-model="formData.contact_person" placeholder="请填写联系人" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="contact_phone" label="联系方式">
|
||||
<el-input v-model="formData.contact_phone" placeholder="请填写联系方式" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item prop="sexLimit" label="性别限制">
|
||||
<el-radio-group v-model="formData.sexLimit" size="medium">
|
||||
<el-radio-button label="0">不限制</el-radio-button>
|
||||
<el-radio-button label="1">男</el-radio-button>
|
||||
<el-radio-button label="2">女</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item prop="state" label="开启状态">
|
||||
<el-switch v-model="formData.state" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="3">
|
||||
<el-form-item prop="state" label="是否多次预约">
|
||||
<el-switch v-model="formData.multiple" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="typeId" label="场地类型">
|
||||
<el-select v-model="formData.typeId" style="width: 100%" filterable
|
||||
@@ -185,22 +131,45 @@ layout("/layouts/platform.html"){
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="reserveTarget" label="面向对象">
|
||||
<el-radio-group v-model="formData.reserveTarget" size="medium">
|
||||
<el-radio-button :label="1">面向分工会</el-radio-button>
|
||||
<el-radio-button :label="2">面向个人</el-radio-button>
|
||||
<el-radio-button :label="3">面向集体</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="sexLimit" label="性别限制">
|
||||
<el-radio-group v-model="formData.sexLimit" size="medium">
|
||||
<el-radio-button :label="0">不限制</el-radio-button>
|
||||
<el-radio-button :label="1">男</el-radio-button>
|
||||
<el-radio-button :label="2">女</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="state" label="开启状态">
|
||||
<el-radio-group v-model="formData.state" size="medium">
|
||||
<el-radio-button :label="true">开启</el-radio-button>
|
||||
<el-radio-button :label="false">禁用</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="openWeekTime" label="预约时间">
|
||||
<el-select v-model="formData.openWeekTime" style="width: 100%" filterable
|
||||
placeholder="请选择预约时间" 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>
|
||||
<el-form-item label="容纳人数" prop="maxNum">
|
||||
<el-input v-model="formData.maxNum" placeholder="请输入容纳人数" type="number"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -210,8 +179,11 @@ layout("/layouts/platform.html"){
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="场地介绍">
|
||||
<text-editor v-model="formData.introduce"></text-editor>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<vi-title2 title="添加场次">
|
||||
<vi-title2 title="添加场次(温馨提醒:如果设置了预约时间单位,那么系统会在开始时间至结束时间范围内,按照设置的单位来拆分成多个时间段,如果未设置或者为0,则表示开始时间至结束时间是一个时间段)">
|
||||
<template #func>
|
||||
<el-button type="primary" @click="formData.open_hours.push({})">
|
||||
添加
|
||||
@@ -219,9 +191,25 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
</vi-title2>
|
||||
<el-table :data="formData.open_hours" border size="mini">
|
||||
|
||||
<el-table-column prop="weekNum" label="星期" align="center" header-align="center">
|
||||
<template slot-scope="{row}">
|
||||
<el-select style="width: 100%" v-model="row.weekNum" filterable placeholder="请选择星期">
|
||||
<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>
|
||||
|
||||
<el-table-column prop="start_time" label="开始时间" align="center" header-align="center">
|
||||
<template slot-scope="{row}">
|
||||
<el-time-select
|
||||
style="width: 100%"
|
||||
placeholder="开始时间"
|
||||
v-model="row.start_time"
|
||||
:picker-options="{ start: '00:00',step: '00:30',end: '24:00'}">
|
||||
@@ -232,6 +220,7 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column prop="end_time" label="结束时间" align="center" header-align="center">
|
||||
<template slot-scope="{row}">
|
||||
<el-time-select
|
||||
style="width: 100%"
|
||||
placeholder="结束时间"
|
||||
v-model="row.end_time"
|
||||
:picker-options="{start: '00:00',step: '00:30',end: '24:00',minTime: row.start_time }">
|
||||
@@ -239,6 +228,12 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="timeUnit" label="预约时间单位(小时)" align="center" header-align="center">
|
||||
<template slot-scope="{row}">
|
||||
<el-input-number style="width: 100%" v-model="row.timeUnit" placeholder="请输入预约时间单位" :step="0.5"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" header-align="center" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" icon="el-icon-delete" circle
|
||||
@@ -363,8 +358,9 @@ layout("/layouts/platform.html"){
|
||||
tableData: [],
|
||||
formData: {
|
||||
open_hours: [{}],
|
||||
sexLimit: '0',
|
||||
sexLimit: 0,
|
||||
notApplyTimeList: [],
|
||||
reserveTarget: 2,
|
||||
},
|
||||
pageForm: {
|
||||
searchName: "name",
|
||||
@@ -377,13 +373,15 @@ layout("/layouts/platform.html"){
|
||||
year: ""
|
||||
},
|
||||
formRules: {
|
||||
name: [{required: true, message: '请填写场地名称', trigger: ['blur', 'change']}],
|
||||
address: [{required: true, message: '请填写场地地址', trigger: ['blur', 'change']}],
|
||||
contact_person: [{required: true, message: '请填写联系人', trigger: ['blur', 'change']}],
|
||||
contact_phone: [{required: true, message: '请填写联系电话', trigger: ['blur', 'change']}],
|
||||
name: [{required: true, message: '请输入场地名称', trigger: ['blur', 'change']}],
|
||||
address: [{required: true, message: '请输入场地地址', trigger: ['blur', 'change']}],
|
||||
contact_person: [{required: true, message: '请输入联系人', trigger: ['blur', 'change']}],
|
||||
contact_phone: [{required: true, message: '请输入联系方式', trigger: ['blur', 'change']}],
|
||||
state: [{required: true, message: '请选择开启状态', trigger: ['blur', 'change']}],
|
||||
typeId: [{required: true, message: '请选择场地类型', trigger: ['blur', 'change']}],
|
||||
openWeekTime: [{required: true, message: '请选择预约时间', trigger: ['blur', 'change']}],
|
||||
reserveTarget: [{required: true, message: '请选择面向对象', trigger: ['blur', 'change']}],
|
||||
maxNum: [{required: true, message: '请输入容纳人数', trigger: ['blur', 'change']}],
|
||||
},
|
||||
|
||||
setUpTimeDialog: false,
|
||||
@@ -470,9 +468,9 @@ layout("/layouts/platform.html"){
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: (a, b) => {
|
||||
if ("confirm" == a) {
|
||||
if ("confirm" === a) {
|
||||
$.post(location.href + "/doDelete", {id: row.id}, (data) => {
|
||||
if (data.code == 0) {
|
||||
if (data.code === 0) {
|
||||
this.$message.success(data.msg)
|
||||
this.pageData();
|
||||
} else {
|
||||
@@ -525,12 +523,12 @@ layout("/layouts/platform.html"){
|
||||
openAdd() {
|
||||
this.formData = {
|
||||
state: true,
|
||||
multiple: true,
|
||||
open_hours: [{}],
|
||||
create_username: '${@shiro.getPrincipalProperty("username")}',
|
||||
create_time: moment().format('YYYY-MM-DD'),
|
||||
sexLimit: '0',
|
||||
notApplyTimeList: [],
|
||||
reserveTarget: 2,
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
|
||||
@@ -563,7 +561,7 @@ layout("/layouts/platform.html"){
|
||||
const {code, data, msg} = res
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (code == 0) {
|
||||
if (code === 0) {
|
||||
for (let i = 0; i < data.list.length; i++) {
|
||||
data.list[i].open_hours = site.reverseRankingDate(data.list[i].open_hours)
|
||||
}
|
||||
|
||||
@@ -50,9 +50,6 @@ layout("/layouts/platform.html"){
|
||||
prop="reserve_person_unit"></el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="联系方式"
|
||||
prop="reserve_person_phone"></el-table-column>
|
||||
<el-table-column align="center" sortable show-overflow-tooltip header-align="center"
|
||||
label="预约天数"
|
||||
prop="days"></el-table-column>
|
||||
<el-table-column align="center" sortable show-overflow-tooltip header-align="center"
|
||||
label="预约日期"
|
||||
prop="concat_day"></el-table-column>
|
||||
|
||||
@@ -31,7 +31,7 @@ layout("/layouts/platform.html"){
|
||||
background-color: #c0c4cc;
|
||||
}
|
||||
.el-carousel__container {
|
||||
height: 260px;
|
||||
height: 222px;
|
||||
}
|
||||
.el-button--mini.is-circle {
|
||||
padding: 5px;
|
||||
@@ -69,18 +69,6 @@ layout("/layouts/platform.html"){
|
||||
.el-slider__button-wrapper {
|
||||
display: none !important;
|
||||
}
|
||||
.textDia h2 {
|
||||
text-align: center;
|
||||
}
|
||||
.textDia h4 {
|
||||
line-height: 26px;
|
||||
}
|
||||
.textDia .el-dialog__header {
|
||||
display: none;
|
||||
}
|
||||
.textDia .el-dialog__body {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
.el-calendar-day:has(.not-allow-day) {
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
@@ -98,9 +86,6 @@ layout("/layouts/platform.html"){
|
||||
<el-option v-for="item in activityTypeList" :label="item.text" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button">
|
||||
<span style="border: 1px grey solid; margin: 0px 10px;"></span>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button">
|
||||
<el-date-picker
|
||||
@@ -132,8 +117,7 @@ layout("/layouts/platform.html"){
|
||||
<el-card class="box-card" style="border-radius: 10px">
|
||||
<div slot="header" class="clearfix" style="font-size: 16px;padding: 5px 0">
|
||||
<span>{{item.name}}</span>
|
||||
<el-button @click="textDia(item)" class="reserve_btn" type="text">预 约
|
||||
</el-button>
|
||||
<el-button @click="onReserve(item)" class="reserve_btn" type="text">预约</el-button>
|
||||
</div>
|
||||
<div @click="siteChange(item.id)">
|
||||
<div class="text e-item">
|
||||
@@ -141,39 +125,16 @@ layout("/layouts/platform.html"){
|
||||
{{item.address}}
|
||||
</div>
|
||||
<div class="text e-item">
|
||||
<span style="color: gray">联系人:</span>
|
||||
<span style="color: gray">联 系 人:</span>
|
||||
{{(item.unitname ? item.unitname : '') + ' ' + item.contact_person}}
|
||||
</div>
|
||||
<div class="text e-item">
|
||||
<span style="color: gray">联系方式:</span>
|
||||
{{item.contact_phone}}
|
||||
</div>
|
||||
<!--<div class="text e-item">
|
||||
<span style="color: gray">已预约人数:</span>
|
||||
<i class="el-icon-user el-icon--left"></i>{{item.count}}
|
||||
</div>-->
|
||||
|
||||
<div class="text item">
|
||||
<span style="color: gray">开放时间:</span>
|
||||
<span v-if="item.open_hours && item.open_hours.length === 1">
|
||||
<span v-if="item.workday === true" style="color: gray">工作日</span>
|
||||
<span>{{item.open_hours[0].start_time + ' - ' + item.open_hours[0].end_time}}</span>
|
||||
</span>
|
||||
<el-tooltip v-if="item.open_hours && item.open_hours.length > 1"
|
||||
class="item" effect="dark" placement="right">
|
||||
<el-link :underline="false" type="primary">
|
||||
<span v-if="item.workday === true" style="color: gray">工作日</span>
|
||||
<i class="el-icon-view el-icon--left"></i>
|
||||
{{item.open_hours.length}}
|
||||
</el-link>
|
||||
<div slot="content">
|
||||
<div v-if="item.open_hours" v-for="hour in item.open_hours">
|
||||
{{hour.start_time}} - {{hour.end_time}}
|
||||
<el-divider></el-divider>
|
||||
</div>
|
||||
<div v-else>暂无开放场次</div>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<div class="text e-item">
|
||||
<span style="color: gray">场地介绍:</span>
|
||||
<el-link @click="viewIntroduce(item)" type="primary" style="position: relative; top: -2px">点击查看</el-link>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -184,11 +145,11 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<el-row class="v-tab">
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>预约列表</span>
|
||||
<el-button style="float: right" type="primary" @click="siteChange()" size="mini">全 部
|
||||
</el-button>
|
||||
</div>
|
||||
<vi-title2 title="预约列表">
|
||||
<template #func>
|
||||
<el-button style="float: right" type="primary" @click="siteChange()" size="mini">全部</el-button>
|
||||
</template>
|
||||
</vi-title2>
|
||||
|
||||
<el-table :data="tableData" row-key="id"
|
||||
v-loading="tableLoading">
|
||||
@@ -205,9 +166,6 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column align="center" sortable show-overflow-tooltip header-align="center"
|
||||
label="所属单位"
|
||||
prop="reserve_person_unit"></el-table-column>
|
||||
<el-table-column align="center" sortable show-overflow-tooltip header-align="center"
|
||||
label="预约天数"
|
||||
prop="days"></el-table-column>
|
||||
<el-table-column align="center" sortable show-overflow-tooltip header-align="center"
|
||||
label="预约日期"
|
||||
prop="concat_day"></el-table-column>
|
||||
@@ -241,9 +199,6 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right"
|
||||
width="200px">
|
||||
<template scope="scope">
|
||||
<!--<el-button @click="() => {dropdownCommand({type:'view',data:scope.row})}" size="mini">查看</el-button>
|
||||
<el-button type="danger" @click="() => {dropdownCommand({type:'delete',data:scope.row})}" size="mini">删除</el-button>-->
|
||||
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
@@ -297,18 +252,6 @@ layout("/layouts/platform.html"){
|
||||
<div style="font-size: large;color: #303133">
|
||||
您正在预约【<span style="color: #409EFF">{{infoViewData.name}}</span>】活动场地
|
||||
</div>
|
||||
<div style="color:#909399;">
|
||||
<span>开放日期为:</span>
|
||||
<span style="color: #303133">
|
||||
{{ infoViewData.openWeedTimeStr }}
|
||||
</span>
|
||||
<span>,开放时间段为:</span>
|
||||
<span v-for="(item, index) in infoViewData.open_hours" style="color: #303133">
|
||||
<span v-if="infoViewData.workday === true && index === 0">工作日</span>
|
||||
【{{item.start_time}} - {{item.end_time}}】
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-calendar v-model="reserve_time">
|
||||
@@ -319,7 +262,7 @@ layout("/layouts/platform.html"){
|
||||
</p>
|
||||
<div v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}"
|
||||
v-for="item in reserveViewData">
|
||||
<div v-if="data.day.toString()==item.reserve_day"
|
||||
<div v-if="data.day.toString() == item.reserve_day"
|
||||
:style="{backgroundColor:([0].includes(item.stateaudittype)?'#FAECD9':item.reserve_state==30?'#E0F4D9':'#FEE2E2')}">
|
||||
<el-row style="line-height: 20px">
|
||||
<el-col :span="4" style="font-size: 10px">
|
||||
@@ -348,12 +291,12 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog title="新增场地预约" class="dia" :close-on-click-modal="false" @open="diaOpen" @close="diaClose"
|
||||
:visible.sync="addDialogVisible" custom-class="ViewDialogClass" width="70%">
|
||||
<el-dialog title="新增场地预约" class="dia" :close-on-click-modal="false" @close="diaClose" top="2%"
|
||||
:visible.sync="addDialogVisible" custom-class="ViewDialogClass" width="50%">
|
||||
|
||||
<vi-title :title="'您已选择的预约日期为:'+ dayArray.toString()" style="margin-left: 48px"></vi-title>
|
||||
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules" size="small" label-position="right"
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules" label-position="right"
|
||||
label-width="100px">
|
||||
<el-form-item label="预约人" prop="reserve_person">
|
||||
<el-select disabled allow-create style="width: 100%" v-model="formData.reserve_person" filterable remote
|
||||
@@ -380,70 +323,24 @@ layout("/layouts/platform.html"){
|
||||
v-model="formData.reserve_person_phone"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!--<el-form-item label="可选时间段">
|
||||
<div class="slider">
|
||||
<div class="cover" v-for="se in optional"
|
||||
:style="'width:'+getWidth(se[0],se[1])+'px;left:' +getLeft(se[0])+'px'"></div>
|
||||
|
||||
<div class="cover2" v-for="se in selected" v-if="!infoViewData.multiple"
|
||||
:style="'width:'+getWidth(se[0],se[1])+'px;left:' +getLeft(se[0])+'px'"></div>
|
||||
|
||||
<el-slider
|
||||
disabled
|
||||
v-model="value"
|
||||
range
|
||||
show-stops
|
||||
:format-tooltip="formatTooltip"
|
||||
:marks="marks"
|
||||
:min="min"
|
||||
:step="step"
|
||||
:max="max">
|
||||
</el-slider>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label=" ">
|
||||
<div style="display: flex;align-items: center">提示:
|
||||
<i class="fa fa-circle ml5" style="color: #409EFF"></i>  可选时段    
|
||||
<i class="fa fa-circle ml5" style="color: #E4E7ED"></i>  已选/未开放时段
|
||||
</div>
|
||||
</el-form-item>-->
|
||||
|
||||
<el-form-item label="预约时间" prop="time">
|
||||
<el-select v-model="formData.time" style="width: 100%" filterable @change="timeChange"
|
||||
placeholder="请选择预约时间">
|
||||
<el-option v-for="item in infoViewData.open_hours"
|
||||
:label="item.disabled ? item.start_time + ' - ' + item.end_time + '(已约满)' : item.start_time + ' - ' + item.end_time"
|
||||
:disabled="item.disabled"
|
||||
<el-option v-for="item in allowTimeList"
|
||||
:label="item.hasCount >= item.allowCount ? item.start_time + ' - ' + item.end_time + '(已约满)' : item.start_time + ' - ' + item.end_time"
|
||||
:disabled="item.hasCount >= item.allowCount"
|
||||
:value="item.start_time + '-' + item.end_time"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!--<el-form-item label="预约时间" prop="start_time">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-time-select
|
||||
style="width: 95%;float: left"
|
||||
placeholder="起始时间"
|
||||
:clearable="false"
|
||||
v-model="formData.start_time"
|
||||
:picker-options="{start: infoViewData.open_hours?infoViewData.open_hours[0].start_time:'',step: '00:30',
|
||||
end:infoViewData.open_hours?infoViewData.open_hours[infoViewData.open_hours.length-1].end_time:''}">
|
||||
</el-time-select>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-time-select
|
||||
style="width: 95%;float: right"
|
||||
placeholder="结束时间"
|
||||
:clearable="false"
|
||||
@change="selectEnd()"
|
||||
v-model="formData.end_time"
|
||||
:picker-options="{start: addMinute(formData.start_time?formData.start_time:'',30),step: '00:30',
|
||||
end:infoViewData.open_hours?infoViewData.open_hours[infoViewData.open_hours.length-1].end_time:''}">
|
||||
</el-time-select>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="预约人数" prop="joinCount">
|
||||
<el-input-number
|
||||
:disabled="infoViewData.reservetarget === 1 || infoViewData.reservetarget === 3"
|
||||
v-model="formData.joinCount"
|
||||
:min="1" :max="9999"
|
||||
label="请输入预约人数"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="预约事由" prop="reserve_cause">
|
||||
<el-input maxlength="1000" placeholder="请输入预约事由" autosize v-model="formData.reserve_cause"
|
||||
@@ -457,36 +354,10 @@ layout("/layouts/platform.html"){
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="drawer" class="textDia" top="3%">
|
||||
<h2>爱心母婴室管理规定</h2>
|
||||
<h4 style="font-weight: bold">一、基本原则</h4>
|
||||
<div style="padding-left: 30px;">
|
||||
<h4>1.使用对象:有哺乳需求的本校在职女教职工。</h4>
|
||||
<h4>2.开放时间:工作日8:00--17:30。</h4>
|
||||
<h4>3.使用制度:实行预约登记制。凡有哺乳需求的女教职工提前向校工会提出使用申请,经审核通过并开通权限后即可使用。</h4>
|
||||
<h4>4.日常管理:由校工会负责。</h4>
|
||||
</div>
|
||||
<h4 style="font-weight: bold">二、管理人员</h4>
|
||||
<div style="padding-left: 30px;">
|
||||
<h4>1.负责爱心母婴室使用登记管理。</h4>
|
||||
<h4>2.定期保养设备,确保正常使用。</h4>
|
||||
<h4>3.保持室内整洁、卫生安全,做好保洁消毒记录。</h4>
|
||||
<h4>4.定期收集意见和建议,不断改进服务。</h4>
|
||||
</div>
|
||||
<h4 style="font-weight: bold">三、使用人员</h4>
|
||||
<div style="padding-left: 30px;">
|
||||
<h4>1.遵守学校安全管理制度和爱心母婴室管理规定。</h4>
|
||||
<h4>2.严禁吸烟,安全使用电器,爱护公物,损坏赔偿。</h4>
|
||||
<h4>3.保持室内卫生清洁,勿大声喧哗,不影响楼内工作秩序。</h4>
|
||||
<h4>4.妥善保管自带物品,冰存的母乳须贴上姓名标签并及时取走。</h4>
|
||||
<h4>5.不得擅自携他人入内,不做和哺乳无关事宜,使用完毕及时离开。</h4>
|
||||
<h4>6.欢迎在《爱心母婴室使用意见簿》上留下您宝贵的意见和建议。</h4>
|
||||
</div>
|
||||
<br/>
|
||||
<h4>联系人:曾钰媛梦 84894774、15850692181</h4>
|
||||
|
||||
<el-dialog :visible.sync="drawer" title="场地介绍" width="40%" top="3%">
|
||||
<div v-html="viewData.introduce"></div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="openReserve(textData)">已知晓并遵守</el-button>
|
||||
<el-button type="primary" @click="drawer = false">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@@ -494,28 +365,13 @@ layout("/layouts/platform.html"){
|
||||
<script>
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const activityUtil = new typeUtil()
|
||||
const HOUR1 = 60 * 60 * 1000
|
||||
const HOUR8 = HOUR1 * 8
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
activityTypeList: [],
|
||||
textData: {},
|
||||
drawer: false,
|
||||
step: 0.5,
|
||||
max: 24,
|
||||
min: 0,
|
||||
slider_width: 0,
|
||||
single_width: 0,
|
||||
marks: {},
|
||||
//本次选择
|
||||
value: [0, 0],
|
||||
//已选
|
||||
selected: [],
|
||||
//可选
|
||||
optional: [],
|
||||
siteList: [],
|
||||
restaurants: [],
|
||||
reserve_time: '',
|
||||
@@ -550,14 +406,18 @@ layout("/layouts/platform.html"){
|
||||
formRules: {
|
||||
reserve_person: [{required: true, message: '请填写预约人', trigger: ['blur', 'change']}],
|
||||
reserve_person_unit: [{required: true, message: '请填写单位', trigger: ['blur', 'change']}],
|
||||
reserve_person_phone: [{required: true, message: '请填写联系方式', trigger: ['blur', 'change']}],
|
||||
reserve_person_phone: [{required: true, message: '请填写联系电话', trigger: ['blur', 'change']}],
|
||||
start_time: [{required: true, message: '请选择预约时间', trigger: ['blur', 'change']}],
|
||||
time: [{required: true, message: '请选择预约时间', trigger: ['blur', 'change']}],
|
||||
joinCount: [{required: true, message: '请输入预约人数', trigger: ['blur', 'change']}],
|
||||
/*reserve_cause: [{required: true, message: '请选择预约事由', trigger: ['blur', 'change']}],*/
|
||||
},
|
||||
dayArray: [],
|
||||
holidays: ['2022-06-03', '2022-06-04', '2022-06-05', '2022-09-10', '2022-09-11', '2022-09-12',
|
||||
'2022-10-01', '2022-10-02', '2022-10-03', '2022-10-04', '2022-10-05', '2022-10-06', '2022-10-07',],
|
||||
allowDayList: [],
|
||||
allowTimeList: [],
|
||||
|
||||
viewData: {},
|
||||
reverseData: {},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -565,13 +425,9 @@ layout("/layouts/platform.html"){
|
||||
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue?v=1.0.0'),
|
||||
},
|
||||
methods: {
|
||||
diaOpen() {
|
||||
if (this.infoViewData.multiple === true ||
|
||||
(this.infoViewData.open_hours.length === 1 && this.infoViewData.open_hours[0].disabled !== true)) {
|
||||
this.formData.time = this.infoViewData.open_hours[0].start_time + '-' + this.infoViewData.open_hours[0].end_time
|
||||
this.formData.start_time = this.infoViewData.open_hours[0].start_time
|
||||
this.formData.end_time = this.infoViewData.open_hours[0].end_time
|
||||
}
|
||||
viewIntroduce(item) {
|
||||
this.viewData = item
|
||||
this.drawer = true
|
||||
},
|
||||
diaClose() {
|
||||
this.formData.time = ''
|
||||
@@ -618,74 +474,6 @@ layout("/layouts/platform.html"){
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
addMinute(val, minute) {
|
||||
if (val) {
|
||||
return moment("1970-01-01 " + val).add(minute, 'm').format("HH:mm");
|
||||
}
|
||||
},
|
||||
flushSliderWidth() {
|
||||
this.slider_width = document.getElementsByClassName("slider")[0].clientWidth
|
||||
this.single_width = this.slider_width / (this.max - this.min)
|
||||
},
|
||||
getWidth(before, end) {
|
||||
return this.single_width * (end - before) - 6
|
||||
},
|
||||
getLeft(num) {
|
||||
return this.single_width * (num - this.min) + 3
|
||||
},
|
||||
getMarks() {
|
||||
for (let i = this.min; i < this.max; i++) {
|
||||
this.marks[i] = moment(i * HOUR1 - HOUR8).format('HH:mm')
|
||||
}
|
||||
this.marks[this.max] = moment(this.max * HOUR1 - HOUR8).format('HH:mm')
|
||||
},
|
||||
//验证是否可行
|
||||
verification(val) {
|
||||
const before = val[0]
|
||||
const end = val[1]
|
||||
|
||||
//是否在可选范围内
|
||||
const optionalFlag = this.optional.some(v => before >= v[0] && end <= v[1])
|
||||
|
||||
//是否没有被选
|
||||
const noSelectedFlag = !this.selected.some(v => {
|
||||
return (before >= v[0] && before <= v[1]) || (end >= v[0] && end <= v[1]) || (before <= v[0] && end >= v[1])
|
||||
})
|
||||
|
||||
return optionalFlag && noSelectedFlag
|
||||
},
|
||||
formatTooltip(val) {
|
||||
return moment(val * HOUR1 - HOUR8).format('HH:mm')
|
||||
},
|
||||
async selectEnd() {
|
||||
const {reserve_day, start_time, end_time, site_id} = this.formData
|
||||
const {open_hours} = this.infoViewData
|
||||
let mySelectStartTime = reserve_day + " " + start_time;
|
||||
|
||||
//判断预约时间是否在小于当前时间 若小于提示用户选择错误
|
||||
if (mySelectStartTime < moment().format("YYYY-MM-DD HH:mm:ss")) {
|
||||
this.$message.warning('您选中的预约时间已超过当前时间,请重新选择')
|
||||
|
||||
this.$set(this.formData, 'start_time', '')
|
||||
this.$set(this.formData, 'end_time', '')
|
||||
return;
|
||||
}
|
||||
|
||||
//判断预约时间是否已被预约 若已预约提示用户选择错误
|
||||
if (await this.checkReserve(reserve_day, start_time, end_time, site_id) > 0) {
|
||||
this.$message.warning('该时段已被预约,请重新选择')
|
||||
this.$set(this.formData, 'start_time', '')
|
||||
this.$set(this.formData, 'end_time', '')
|
||||
return
|
||||
}
|
||||
|
||||
//判断预约时间是否开放 若未开放提示用户选择错误
|
||||
if (!open_hours.some(v => start_time >= v.start_time && end_time <= v.end_time)) {
|
||||
this.$message.warning('您选中预约时间暂未开放,请重新选择')
|
||||
this.$set(this.formData, 'start_time', '')
|
||||
this.$set(this.formData, 'end_time', '')
|
||||
}
|
||||
},
|
||||
async siteChange(id) {
|
||||
this.pageForm.siteId = id
|
||||
this.pageData()
|
||||
@@ -711,19 +499,14 @@ layout("/layouts/platform.html"){
|
||||
this.addDialogVisible = false
|
||||
this.formData.end_time = ''
|
||||
},
|
||||
textDia(data) {
|
||||
this.textData = data
|
||||
onReserve(data) {
|
||||
if(data.reservetarget === 1 && "${@shiro.hasRole('H04')}" === 'false' && "${@shiro.hasRole('sysadmin')}" === 'false') {
|
||||
this.$message.warning('该场地只能分工会主席预约')
|
||||
return
|
||||
}
|
||||
this.reverseData = data
|
||||
this.dayArray = []
|
||||
/*if (data.typeid === 1) {
|
||||
if("${@shiro.getPrincipalProperty('sex')}" == '女'){
|
||||
this.drawer = true
|
||||
} else {
|
||||
this.$notify.warning({title: '警告', message: '抱歉,该场地仅限女性会员预约'});
|
||||
return
|
||||
}
|
||||
} else {
|
||||
this.openReserve(data)
|
||||
}*/
|
||||
this.getAllowTime()
|
||||
if (data.sexlimit === 1 || data.sexlimit === 2) {
|
||||
const sex = data.sexlimit === 1 ? '男' : '女'
|
||||
if ("${@shiro.getPrincipalProperty('sex')}" === sex) {
|
||||
@@ -738,6 +521,9 @@ layout("/layouts/platform.html"){
|
||||
getDayClass(data) {
|
||||
const d = new Date(data.day).getDay()
|
||||
let classStr = 'div-Calendar'
|
||||
if(this.allowDayList.length > 0 && !this.allowDayList.includes(data.day)) {
|
||||
classStr += ' not-allow-day';
|
||||
}
|
||||
if(this.infoViewData.openweektime) {
|
||||
const openWeedTime = JSON.parse(this.infoViewData.openweektime)
|
||||
if(!openWeedTime.includes(d)) {
|
||||
@@ -750,23 +536,22 @@ layout("/layouts/platform.html"){
|
||||
classStr += ' not-allow-day';
|
||||
}
|
||||
}
|
||||
if(moment(data.day).unix() < moment().unix()) {
|
||||
if(moment(data.day).isBefore(moment().startOf('day'))) {
|
||||
classStr += ' not-allow-day';
|
||||
}
|
||||
return classStr
|
||||
},
|
||||
pushDay(data) {
|
||||
const d = new Date(data.day).getDay()
|
||||
if(this.infoViewData.openweektime) {
|
||||
const openWeedTime = JSON.parse(this.infoViewData.openweektime)
|
||||
if(!openWeedTime.includes(d)) {
|
||||
this.$message.warning('该场地只能预约' + this.infoViewData.openWeedTimeStr)
|
||||
return
|
||||
}
|
||||
async pushDay(data) {
|
||||
this.$nextTick(async () => {
|
||||
await this.getAllowTime(moment(data.day).year(), moment(data.day).month() + 1)
|
||||
})
|
||||
if (this.allowDayList.length > 0 && !this.allowDayList.includes(data.day)) {
|
||||
this.$message.warning(data.day + "不能预约")
|
||||
return
|
||||
}
|
||||
if(this.infoViewData.notapplytimelist) {
|
||||
if (this.infoViewData.notapplytimelist) {
|
||||
const notApplyTimeList = JSON.parse(this.infoViewData.notapplytimelist)
|
||||
if(notApplyTimeList.includes(data.day)) {
|
||||
if (notApplyTimeList.includes(data.day)) {
|
||||
this.$message.warning(data.day + "不能预约")
|
||||
return
|
||||
}
|
||||
@@ -778,67 +563,34 @@ layout("/layouts/platform.html"){
|
||||
if (this.dayArray.includes(data.day)) {
|
||||
this.dayArray.splice(this.dayArray.indexOf(data.day), 1)
|
||||
} else {
|
||||
this.dayArray = []
|
||||
this.dayArray.push(data.day)
|
||||
this.dayArray.sort()
|
||||
}
|
||||
},
|
||||
async openAdd() {
|
||||
//查询用户点击的这一天已经被预约的时间段
|
||||
/*if(this.textData.multiple === false) {
|
||||
const da = await this.findReserveInfoByClickDay(this.textData.id, data.day)
|
||||
const daMap = da.map(o => o.start_time + '-' + o.end_time)
|
||||
this.infoViewData.open_hours.forEach(item => {
|
||||
const str = item.start_time + '-' + item.end_time
|
||||
if (daMap.includes(str)) {
|
||||
item.disabled = true
|
||||
} else {
|
||||
item.disabled = false
|
||||
}
|
||||
})
|
||||
}*/
|
||||
if (this.dayArray && this.dayArray.length === 0) {
|
||||
this.$message.warning('请选择预约日期')
|
||||
return
|
||||
}
|
||||
|
||||
//this.$set(this.formData, "reserve_day", data.day)
|
||||
this.$set(this.formData, "reserve_person", '${@shiro.getPrincipalProperty("username")}')
|
||||
this.$set(this.formData, "reserve_person_unit", '${@shiro.getPrincipalProperty("unit").getName()}')
|
||||
this.$set(this.formData, "reserve_person_phone", '${@shiro.getPrincipalProperty("mobile")}')
|
||||
|
||||
/*this.reserveViewData.filter(v => {
|
||||
if (v.reserve_day === data.day) {
|
||||
let start = this.transNum(v.start_time)
|
||||
let end = this.transNum(v.end_time)
|
||||
this.selected.push([start, end])
|
||||
}
|
||||
})*/
|
||||
|
||||
const {open_hours} = this.infoViewData
|
||||
|
||||
open_hours.sort((a, b) => this.transNum(a.start_time) - this.transNum(b.start_time))
|
||||
|
||||
this.min = this.transNum(open_hours[0].start_time)
|
||||
this.min = this.min % 1 === 0 ? this.min : this.min - 0.5
|
||||
this.max = this.transNum(open_hours[open_hours.length - 1].end_time)
|
||||
this.max = this.max % 1 === 0 ? this.max : this.max + 0.5
|
||||
|
||||
this.optional = open_hours.map(v => [this.transNum(v.start_time), this.transNum(v.end_time)])
|
||||
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
|
||||
if(this.infoViewData.reservetarget === 1 || this.infoViewData.reservetarget === 3) {
|
||||
this.$set(this.formData, "joinCount", this.infoViewData.maxnum)
|
||||
} else {
|
||||
this.$set(this.formData, "joinCount", 1)
|
||||
}
|
||||
|
||||
this.allowTimeList = await this.getTimesByDay()
|
||||
this.addDialogVisible = true
|
||||
|
||||
this.$nextTick(() => {
|
||||
|
||||
this.flushSliderWidth()
|
||||
$(window).resize(() => {
|
||||
vue.flushSliderWidth()
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
async doDelete(id, op) {
|
||||
if (op === 2) {
|
||||
@@ -867,9 +619,6 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
});
|
||||
},
|
||||
transNum(hm) {
|
||||
return (moment("1970-01-01 " + hm).valueOf() + HOUR8) / HOUR1
|
||||
},
|
||||
async doAdd() {
|
||||
if (!this.formData.time) {
|
||||
this.$message.warning('未选择预约时间')
|
||||
@@ -877,13 +626,6 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
const s = this.formData.time.split('-')[0]
|
||||
const e = this.formData.time.split('-')[1]
|
||||
const t = this.infoViewData.open_hours.find(x => {
|
||||
return x.start_time === s && x.end_time === e
|
||||
})
|
||||
if (t && t.disabled === true) {
|
||||
this.$message.warning('该时间段已约满')
|
||||
return
|
||||
}
|
||||
if (moment().unix() >= moment(this.formData.reserve_day + ' ' + e + ':00').unix()) {
|
||||
this.$message.warning('您预约的时间段已过')
|
||||
return
|
||||
@@ -897,7 +639,6 @@ layout("/layouts/platform.html"){
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
|
||||
const {code, msg} = await $.post(location.href + "/doAdd", {
|
||||
data: JSON.stringify(this.formData),
|
||||
days: JSON.stringify(this.dayArray)
|
||||
@@ -924,19 +665,13 @@ layout("/layouts/platform.html"){
|
||||
this.$refs.reserve.openView(row.id)
|
||||
},
|
||||
async openReserve(data) {
|
||||
this.drawer = false
|
||||
data.open_hours = site.reverseRankingDate(data.open_hours)
|
||||
this.reserveViewData = await this.findReserveInfo(data.id)
|
||||
this.reserveViewData.forEach(item => {
|
||||
/*this.reserveViewData.forEach(item => {
|
||||
item.index = 0
|
||||
})
|
||||
})*/
|
||||
this.formData.site_id = data.id
|
||||
this.infoViewData = data
|
||||
if(this.infoViewData.openweektime) {
|
||||
const openWeedTime = JSON.parse(this.infoViewData.openweektime)
|
||||
const weekDays = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"]
|
||||
this.infoViewData.openWeedTimeStr = openWeedTime.map((day) => weekDays[day]).join(",")
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
async doSearch() {
|
||||
@@ -976,45 +711,61 @@ layout("/layouts/platform.html"){
|
||||
const {data} = await $.get("/platform/activity/site/reserve/findReserveInfo", {siteId})
|
||||
return data;
|
||||
},
|
||||
async findReserveInfoByClickDay(siteId, day) {
|
||||
const {data} = await $.get("/platform/activity/site/reserve/findReserveInfo", {
|
||||
siteId: siteId,
|
||||
day: day
|
||||
})
|
||||
return data;
|
||||
},
|
||||
async findOneSite(id) {
|
||||
const {data} = await $.get("/platform/activity/site/mange/findOneSite", {id: id})
|
||||
return data
|
||||
},
|
||||
async checkReserve(reserve_day, start_time, end_time, site_id) {
|
||||
const {data} = await $.get("/platform/activity/site/reserve/checkReserve", {
|
||||
reserve_day,
|
||||
start_time,
|
||||
end_time,
|
||||
site_id
|
||||
})
|
||||
return data
|
||||
},
|
||||
async findAllOpenSite(siteId) {
|
||||
const {data} = await $.get("/platform/activity/site/reserve/findAllOpenSite", {
|
||||
time: this.pageForm.time,
|
||||
siteId: siteId,
|
||||
siteType: this.pageForm.siteType,
|
||||
})
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
data[i].open_hours = JSON.parse(data[i].open_hours)
|
||||
data[i].open_hours = site.reverseRankingDate(data[i].open_hours)
|
||||
}
|
||||
return data
|
||||
},
|
||||
async getAllowTime(year = null, month = null) {
|
||||
const titleText = $('.el-calendar__title').text().trim().replaceAll(' ', '')
|
||||
const m = moment(titleText, "YYYY年M月")
|
||||
const { data } = await $.get("/platform/activity/site/reserve/getAllowTime", {
|
||||
siteId: this.reverseData.id,
|
||||
year: year != null ? year : m.year(),
|
||||
month: month != null ? month : m.month() + 1,
|
||||
})
|
||||
this.allowDayList = data
|
||||
},
|
||||
async getTimesByDay() {
|
||||
const { data } = await $.get("/platform/activity/site/reserve/getTimesByDay", {
|
||||
siteId: this.reverseData.id,
|
||||
day: moment(this.reserve_time).format('YYYY-MM-DD'),
|
||||
})
|
||||
return data
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.activityTypeList = await activityUtil.getAllType()
|
||||
this.siteList = await this.findAllOpenSite()
|
||||
this.pageData();
|
||||
this.getMarks();
|
||||
}
|
||||
await this.getAllowTime()
|
||||
this.pageData()
|
||||
this.$nextTick(() => {
|
||||
// 点击前一个月
|
||||
let prevBtn = document.querySelector(
|
||||
".el-calendar__button-group .el-button-group>button:nth-child(1)"
|
||||
);
|
||||
prevBtn.addEventListener("click", e => {
|
||||
this.getAllowTime()
|
||||
})
|
||||
//点击下一个月
|
||||
let nextBtn = document.querySelector(
|
||||
".el-calendar__button-group .el-button-group>button:nth-child(3)"
|
||||
);
|
||||
nextBtn.addEventListener("click", () => {
|
||||
this.getAllowTime()
|
||||
});
|
||||
//点击今天
|
||||
let todayBtn = document.querySelector(
|
||||
".el-calendar__button-group .el-button-group>button:nth-child(2)"
|
||||
);
|
||||
todayBtn.addEventListener("click", () => {
|
||||
this.getAllowTime()
|
||||
});
|
||||
})
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
|
||||
Reference in New Issue
Block a user