This commit is contained in:
@jyuhsin
2025-03-25 11:23:50 +08:00
parent 5f71d519dd
commit 7084976d72
7 changed files with 149 additions and 227 deletions
@@ -72,7 +72,7 @@ public class SiteManageController {
@At @At
@ViReturn @ViReturn
public Object doEdit(@Param("data") ActivitySiteInfo activitySiteInfo) { public Object doEdit(@Param("data") ActivitySiteInfo activitySiteInfo) {
siteInfoService.updateIgnoreNull(activitySiteInfo); siteInfoService.update(activitySiteInfo);
return null; return null;
} }
@@ -2,6 +2,7 @@ package io.v.nutz.activity.models;
import lombok.Data; import lombok.Data;
import org.nutz.dao.entity.annotation.*; import org.nutz.dao.entity.annotation.*;
import org.nutz.lang.util.NutMap;
import java.util.List; import java.util.List;
@@ -86,4 +87,9 @@ public class ActivitySiteInfo {
@Comment("预约时间") @Comment("预约时间")
@ColDefine(type = ColType.MYSQL_JSON) @ColDefine(type = ColType.MYSQL_JSON)
private List<Integer> openWeekTime; private List<Integer> openWeekTime;
@Column
@Comment("场地的禁用时间")
@ColDefine(type = ColType.MYSQL_JSON)
private List<String> notApplyTimeList;
} }
@@ -45,67 +45,22 @@ public class SendMsg {
* @throws IOException * @throws IOException
*/ */
public void sendTextMesg(String toUser,String contentValue) throws IOException { public void sendTextMesg(String toUser,String contentValue) throws IOException {
String token = getToken(CORPID,CORPSECRET);
String postData = createPostData(toUser, "text",AGENTID, "content", contentValue);
String response = post("utf-8", CONTENT_TYPE,"https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=", postData, token);
System.out.println("获取到的token======>" + token);
System.out.println("请求数据======>" + postData);
System.out.println("发送微信的响应数据======>" + response);
} }
public String getToken(String corpId, String corpSecret) throws IOException { public String getToken(String corpId, String corpSecret) throws IOException {
String resp = toAuth( "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + corpId + "&corpsecret=" + corpSecret);//拼接字符串得到url return "";
Map<String, Object> map = gson.fromJson(resp,
new TypeToken<Map<String, Object>>() {
}.getType());
System.out.println(map);
return map.get("access_token").toString();
} }
protected String toAuth(String Get_Token_Url) throws IOException { protected String toAuth(String Get_Token_Url) throws IOException {
httpClient = HttpClients.createDefault(); return "";
httpGet = new HttpGet(Get_Token_Url);
CloseableHttpResponse response = httpClient.execute(httpGet);
System.out.println(response.toString());
String resp;
try {
HttpEntity entity = response.getEntity();
System.out.println(response.getAllHeaders());
resp = EntityUtils.toString(entity, "utf-8");
EntityUtils.consume(entity);
} finally {
response.close();
}
return resp;
} }
private String createPostData(String touser, String msgtype, int agent_id, String contentKey, String contentValue) { private String createPostData(String touser, String msgtype, int agent_id, String contentKey, String contentValue) {
Map<String,Object> weChatData = new HashMap<>(); return "";
weChatData.put("touser",touser);
weChatData.put("agentid",agent_id);
weChatData.put("msgtype",msgtype);
Map<Object, Object> content = new HashMap<Object, Object>();
content.put(contentKey, contentValue);
weChatData.put("text",content);
System.out.println(gson.toJson(weChatData));
return gson.toJson(weChatData);
} }
private String post(String charset, String contentType, String url, String data, String token) throws IOException { private String post(String charset, String contentType, String url, String data, String token) throws IOException {
CloseableHttpClient httpclient = HttpClients.createDefault(); return "";
httpPost = new HttpPost(url + token);
httpPost.setHeader(CONTENT_TYPE, contentType);
httpPost.setEntity(new StringEntity(data, charset));
CloseableHttpResponse response = httpclient.execute(httpPost);
String resp;
try {
HttpEntity entity = response.getEntity();
resp = EntityUtils.toString(entity, charset);
EntityUtils.consume(entity);
} finally {
response.close();
}
return resp;
} }
@@ -7,23 +7,23 @@
<template slot="dateCell" slot-scope="{date, data}"> <template slot="dateCell" slot-scope="{date, data}">
<div class="div-Calendar"> <div class="div-Calendar">
<p :class="data.isSelected ? 'is-selected' : ''"> <p :class="data.isSelected ? 'is-selected' : ''">
{{ data.day.split('-').slice(1).join('-') }} {{ data.isSelected ? '√' : '' }} {{ data.day.split('-').slice(1).join('-') }} {{ data.isSelected ? '✔️' : '' }}
</p> </p>
<div v-if="$.parseJSON(role) === true" v-for="item in viewData.site_info"> <div v-if="$.parseJSON(role) === true" v-for="item in viewData.site_info">
<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':'#E0F4D9')}"> :style="{backgroundColor:([0].includes(item.stateaudittype)?'#FAECD9':'#E0F4D9')}">
<el-row :gutter="20" style="line-height: 30px;margin-bottom: 10px;"> <el-row style="line-height: 20px">
<el-col :span="4"> <el-col :span="4" style="font-size: 10px">
<el-button v-if="[0].includes(item.stateaudittype)" type="warning" <span v-if="[0].includes(item.stateaudittype)">待审</span>
size="mini" circle>待 <span v-if="item.stateaudittype==3">通过</span>
</el-button> <span v-if="item.stateaudittype==1">拒绝</span>
<el-button v-if="item.stateaudittype==3" type="success" size="mini" circle>通 </el-col>
</el-button> <el-col :span="20" style="font-size: 10px">
</el-col> <span>
<el-col :span="20" style="font-size: 10px"> <b>{{item.reserve_person}}</b>:{{item.start_time}}-{{item.end_time}}
<b>{{ item.reserve_person }}</b>:{{ item.start_time }}-{{ item.end_time }} </span>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</div> </div>
</div> </div>
@@ -11,7 +11,6 @@ layout("/mobile/platform.html"){
align-items: center; align-items: center;
color: white; color: white;
} }
.day { .day {
background-color: #14497e; background-color: #14497e;
display: inline-block; display: inline-block;
@@ -22,12 +21,10 @@ layout("/mobile/platform.html"){
margin-right: 6px; margin-right: 6px;
font-size: 14px; font-size: 14px;
} }
.time { .time {
width: 72%; width: 72%;
text-align: center; text-align: center;
} }
.state { .state {
width: 80px; width: 80px;
height: 36px; height: 36px;
@@ -36,31 +33,25 @@ layout("/mobile/platform.html"){
border-radius: 2px; border-radius: 2px;
color: #929292; color: #929292;
} }
.container { .container {
padding: 10px 0px; padding: 10px 0;
background-color: white; background-color: white;
width: 95%; width: 95%;
margin: 0 auto; margin: 0 auto;
border-radius: 6px; border-radius: 6px;
margin-top: 10px; margin-top: 10px;
} }
tr { tr {
line-height: 36px; line-height: 36px;
} }
.van-action-sheet__content { .van-action-sheet__content {
padding: 10px; padding: 10px;
font-size: 15px; font-size: 15px;
} }
.title { .title {
margin: 10px 0px; margin: 10px 0;
color: grey; color: grey;
} }
.top-calendar { .top-calendar {
height: 70px; height: 70px;
max-height: 70px; max-height: 70px;
@@ -73,14 +64,12 @@ layout("/mobile/platform.html"){
align-items: center; align-items: center;
background-color: #0e78c5; background-color: #0e78c5;
} }
.calendar-left { .calendar-left {
width: calc(100% - 20px); width: calc(100% - 20px);
overflow-x: auto; overflow-x: auto;
display: flex; display: flex;
height: 90%; height: 90%;
} }
.calendar-left-day { .calendar-left-day {
min-width: 65px; min-width: 65px;
height: 100%; height: 100%;
@@ -90,20 +79,17 @@ layout("/mobile/platform.html"){
justify-content: center; justify-content: center;
align-items: center; align-items: center;
color: #FFF; color: #FFF;
border-radius: 10px;
} }
.left-day-active { .left-day-active {
background-color: #0000cc; background-color: #0000cc;
} }
.left-day-disabled {
.day-info-month { background-color: lightgrey;
} }
.day-info-week { .day-info-week {
margin-bottom: 5px; margin-bottom: 5px;
} }
.calendar-right { .calendar-right {
width: 30px; width: 30px;
max-width: 30px; max-width: 30px;
@@ -115,19 +101,21 @@ layout("/mobile/platform.html"){
justify-content: center; justify-content: center;
margin-left: 5px; margin-left: 5px;
} }
.top_pop .van-popup { .top_pop .van-popup {
top: 46px; top: 46px;
} }
.van-action-sheet { .van-action-sheet {
max-height: 90%; max-height: 90%;
} }
.van-empty {
position: revert;
transform: none;
top: 0;
left: 0;
}
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<!--top栏-->
<van-nav-bar <van-nav-bar
:title="site.name" :title="site.name"
left-arrow left-arrow
@@ -139,39 +127,39 @@ layout("/mobile/platform.html"){
<div class="top-calendar"> <div class="top-calendar">
<div class="calendar-left"> <div class="calendar-left">
<div class="calendar-left-day" :class="moment(item).unix() == selectDate.unix() ? 'left-day-active':''" <div
:class="getDayClass(item)"
@click="dayClick(item)" @click="dayClick(item)"
v-for="item in weekList"> v-for="item in weekList">
<div class="day-info-week"> <div class="day-info-week">
{{getWeekTextByDate(item)}} {{getWeekTextByDate(item.day)}}
</div> </div>
<div class="day-info-month"> <div class="day-info-month">
{{moment(item).format('MM-DD')}} {{moment(item.day).format('MM-DD')}}
</div> </div>
</div> </div>
</div> </div>
<div class="calendar-right"> <div class="calendar-right">
<van-icon size="16" color="white" name="arrow-down" @click="calendarVisible=true"></van-icon> <van-icon size="16" color="white" name="arrow-down" @click="calendarVisible=true"></van-icon>
<van-calendar class="top_pop" v-model="calendarVisible" color="#246fb4" position="top" @confirm="onConfirm" <van-calendar class="top_pop" v-model="calendarVisible" color="#246fb4" position="top" @confirm="onConfirm"
:default-date="selectDate.toDate()" :default-date="selectDate?.toDate()"
:formatter="calendarFormatter" :formatter="calendarFormatter"
title="选择开始日期"></van-calendar> title="选择开始日期"></van-calendar>
</div> </div>
</div> </div>
<div class="container"> <div class="container">
<table> <table v-if="weekList.find(o => o.day === selectDate)?.disabled === false">
<tr v-for="item in timeData"> <tr v-for="item in timeData">
<td class="time">{{item.start_time + '-' + item.end_time}}</td> <td class="time">{{item.start_time + '-' + item.end_time}}</td>
<td> <td>
<div v-if="isCanRe(item)===3" class="state" style="background-color: #0e78c5;color: #fff3f3"> <div v-if="isCanRe(item)===3" class="state" style="background-color: #0e78c5;color: #fff3f3">
已预约 已预约
</div> </div>
<div v-if="isCanRe(item) === 2" class="state" style="background-color: #fff4f2; color: #cc5a45">约满 <div v-if="isCanRe(item) === 2" class="state" style="background-color: #fff4f2; color: #cc5a45">
约满
</div> </div>
<div @click="chooseTime(item)" v-if="isCanRe(item) === 1" class="state" <div @click="chooseTime(item)" v-if="isCanRe(item) === 1" class="state" style="background-color: #e8ffef; color: #52986a">
style="background-color: #e8ffef; color: #52986a">
<span v-if="!times.map(o => o.fullDay).includes(selectDate.format('YYYY-MM-DD') + ' ' + item.start_time + '-' + item.end_time)">可预约</span> <span v-if="!times.map(o => o.fullDay).includes(selectDate.format('YYYY-MM-DD') + ' ' + item.start_time + '-' + item.end_time)">可预约</span>
<span v-else> <span v-else>
<van-icon name="passed" size="26" style="line-height: 36px;position: unset"></van-icon> <van-icon name="passed" size="26" style="line-height: 36px;position: unset"></van-icon>
@@ -179,9 +167,9 @@ layout("/mobile/platform.html"){
</div> </div>
<div v-if="isCanRe(item) === 0" class="state">已过期</div> <div v-if="isCanRe(item) === 0" class="state">已过期</div>
</td> </td>
</tr> </tr>
</table> </table>
<van-empty v-else image="error" :description="moment(selectDate).format('YYYY-MM-DD') + '不能预约'"></van-empty>
</div> </div>
<div style="position: fixed; bottom: 0; width: 100%"> <div style="position: fixed; bottom: 0; width: 100%">
@@ -203,17 +191,6 @@ layout("/mobile/platform.html"){
</div> </div>
</van-cell> </van-cell>
<van-cell title="预约地点">{{site.name}}</van-cell> <van-cell title="预约地点">{{site.name}}</van-cell>
<!--<van-field
v-model="joinUser"
rows="2"
autosize
label="参加人员"
type="textarea"
maxlength="50"
placeholder="请输入参加人员"
show-word-limit
></van-field>-->
<van-field <van-field
v-model="message" v-model="message"
rows="4" rows="4"
@@ -236,16 +213,12 @@ layout("/mobile/platform.html"){
<script> <script>
moment.locale('zh_cn'); moment.locale('zh_cn');
function getQueryString(name) { function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg); var r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURI(r[2]); if (r != null) return decodeURI(r[2]);
return null; return null;
} }
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
const siteTypeUtil = new typeUtil()
const vue = new Vue({ const vue = new Vue({
el: '#app', el: '#app',
mixins: [mobileMixins], mixins: [mobileMixins],
@@ -304,6 +277,15 @@ layout("/mobile/platform.html"){
} }
}, },
methods: { methods: {
getDayClass(row) {
let classStr = 'calendar-left-day'
if(row.disabled) {
classStr += ' left-day-disabled'
} else {
classStr += moment(row.day).unix() === this.selectDate.unix() ? ' left-day-active' : ''
}
return classStr
},
close(f) { close(f) {
if (this.times.length === 1) { if (this.times.length === 1) {
vant.Toast('必须保留一个时间段') vant.Toast('必须保留一个时间段')
@@ -317,35 +299,27 @@ layout("/mobile/platform.html"){
this.setWeekList(this.selectDate) this.setWeekList(this.selectDate)
this.calendarVisible = false this.calendarVisible = false
}, },
//这里要排除掉休息日
setWeekList(startDate) { setWeekList(startDate) {
const wk = [] const wk = []
let d = null let count = 0
do {
d = moment(startDate).day()
if(!this.site.openWeekTime.includes(d)) {
startDate = moment(startDate).add(1, 'd')
}
} while (!this.site.openWeekTime.includes(d))
wk.push(moment(startDate))
let count = 1
while (wk.length < 7) { while (wk.length < 7) {
const addDate = moment(startDate).add(count, 'd') const addDate = moment(startDate).add(count, 'd')
const nextDay = addDate.day() const addDateFormat = moment(addDate).format('YYYY-MM-DD')
//这里不是休息日才能加到数组里 wk.push({
/*if (addDate.day() !== 0 && addDate.day() !== 6 && !this.holidays.includes(moment(addDate).format('YYYY-MM-DD'))) { day: addDate,
wk.push(addDate) disabled: !this.site.openWeekTime.includes(addDate.day()) || this.site.notApplyTimeList.includes(addDateFormat)
}*/ })
if(this.site.openWeekTime.includes(nextDay)) {
wk.push(addDate)
}
count++ count++
} }
this.weekList = wk this.weekList = wk
}, },
dayClick(date) { dayClick(item) {
this.selectDate = date this.selectDate = item.day
this.getReserve() if(item.disabled) {
this.$toast(moment(item.day).format('YYYY-MM-DD') + '不可预约')
} else {
this.getReserve()
}
}, },
reserve() { reserve() {
if (this.times.length === 0) { if (this.times.length === 0) {
@@ -390,13 +364,10 @@ layout("/mobile/platform.html"){
isCanRe(item) { isCanRe(item) {
const now = new Date() const now = new Date()
const end = moment().format('YYYY-MM-DD') + ' ' + item.end_time + ':00' const end = moment().format('YYYY-MM-DD') + ' ' + item.end_time + ':00'
const itemFullTime = this.selectDate.format('YYYY-MM-DD') + " " + item.start_time + "-" + item.end_time const itemFullTime = this.selectDate.format('YYYY-MM-DD') + " " + item.start_time + "-" + item.end_time
if (this.alreadyReserveRecord.includes(itemFullTime)) { if (this.alreadyReserveRecord.includes(itemFullTime)) {
return 3 return 3
} }
if (now.getTime() >= new Date(end).getTime() && this.selectDate.format('YYYY-MM-DD') === moment().format('YYYY-MM-DD')) { if (now.getTime() >= new Date(end).getTime() && this.selectDate.format('YYYY-MM-DD') === moment().format('YYYY-MM-DD')) {
return 0 return 0
} else { } else {
@@ -407,7 +378,6 @@ layout("/mobile/platform.html"){
} }
} }
}, },
async onLoad() { async onLoad() {
this.loading = true this.loading = true
const resp = await $.post('/mobile/activity/site/info/getDetail', {id: this.site_id}) const resp = await $.post('/mobile/activity/site/info/getDetail', {id: this.site_id})
@@ -436,28 +406,18 @@ layout("/mobile/platform.html"){
this.alreadyReserveRecord = resp.data.map(v => v.reserve_day + " " + v.start_time + "-" + v.end_time) this.alreadyReserveRecord = resp.data.map(v => v.reserve_day + " " + v.start_time + "-" + v.end_time)
} }
}, },
//获取最新的一个工作日设为当前时间
getLatestWorkDay() { getLatestWorkDay() {
/*const weekNum = moment().day() let selectDate = moment()
let selectDate = null if(this.site.workday === true) {
if (weekNum === 0) { if (selectDate.day() === 0) {
//周日 //周日
selectDate = moment().add(1, 'd') selectDate = moment().add(1, 'd')
} else if (weekNum === 6) { } else if (selectDate.day() === 6) {
//周六 //周六
selectDate = moment().add(2, 'd') selectDate = moment().add(2, 'd')
} else {
selectDate = moment()
}*/
let today = moment().format('YYYY-MM-DD')
let d
do {
d = moment(today).day()
if(!this.site.openWeekTime.includes(d)) {
today = moment(today).add(1, 'd')
} }
} while (!this.site.openWeekTime.includes(d)) }
return today return selectDate
} }
}, },
async created() { async created() {
@@ -158,27 +158,24 @@ layout("/layouts/platform.html"){
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="6"> <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-form-item prop="state" label="开启状态">
<el-radio-group v-model="formData.state" size="medium"> <el-switch v-model="formData.state" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
<el-radio-button :label="true">开启</el-radio-button>
<el-radio-button :label="false">禁用</el-radio-button>
</el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="3">
<el-form-item prop="state" label="是否多次预约"> <el-form-item prop="state" label="是否多次预约">
<el-radio-group v-model="formData.multiple" size="medium"> <el-switch v-model="formData.multiple" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
<el-radio-button :label="true">允许</el-radio-button>
<el-radio-button :label="false">不允许</el-radio-button>
</el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!--<el-col :span="4">
<el-form-item prop="state" label="限定工作日预约">
<el-switch v-model="formData.workday" active-color="#13ce66" inactive-color="#ff4949">
</el-switch>
</el-form-item>
</el-col>-->
<el-col :span="12"> <el-col :span="12">
<el-form-item prop="typeId" label="场地类型"> <el-form-item prop="typeId" label="场地类型">
<el-select v-model="formData.typeId" style="width: 100%" filterable <el-select v-model="formData.typeId" style="width: 100%" filterable
@@ -191,15 +188,7 @@ layout("/layouts/platform.html"){
</el-row> </el-row>
<el-row :gutter="20"> <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-col :span="12">
<el-form-item prop="openWeekTime" label="预约时间"> <el-form-item prop="openWeekTime" label="预约时间">
<el-select v-model="formData.openWeekTime" style="width: 100%" filterable <el-select v-model="formData.openWeekTime" style="width: 100%" filterable
@@ -214,6 +203,18 @@ layout("/layouts/platform.html"){
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item prop="notApplyTimeList" label="禁用时间">
<el-date-picker
style="width: 100%"
v-model="formData.notApplyTimeList"
type="dates"
value-format="yyyy-MM-dd"
clearable
placeholder="请选择禁用时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-form> </el-form>
<vi-title2 title="添加场次"> <vi-title2 title="添加场次">
@@ -5,52 +5,41 @@ layout("/layouts/platform.html"){
.text { .text {
font-size: 14px; font-size: 14px;
} }
.e-item { .e-item {
margin-bottom: 10px; margin-bottom: 10px;
} }
.el-divider--horizontal { .el-divider--horizontal {
margin: 5px 0; margin: 5px 0;
} }
.v-tab .el-card__header { .v-tab .el-card__header {
padding: 10px 15px; padding: 10px 15px;
font-weight: bold; font-weight: bold;
} }
.reserve_btn { .reserve_btn {
font-size: 16px; font-size: 16px;
float: right; float: right;
padding: 3px 0 padding: 3px 0
} }
.is-selected { .is-selected {
color: #1989FA; color: #1989FA;
} }
.div-Calendar { .div-Calendar {
box-sizing: border-box; box-sizing: border-box;
height: 100%; height: 100%;
} }
.el-carousel__button { .el-carousel__button {
background-color: #c0c4cc; background-color: #c0c4cc;
} }
.el-carousel__container { .el-carousel__container {
height: 260px; height: 260px;
} }
.el-button--mini.is-circle { .el-button--mini.is-circle {
padding: 5px; padding: 5px;
font-size: 1px; font-size: 1px;
} }
.slider { .slider {
position: relative; position: relative;
} }
.cover { .cover {
position: absolute; position: absolute;
height: 6px; height: 6px;
@@ -58,7 +47,6 @@ layout("/layouts/platform.html"){
margin: 16px 0; margin: 16px 0;
z-index: 999; z-index: 999;
} }
.cover2 { .cover2 {
position: absolute; position: absolute;
height: 6px; height: 6px;
@@ -66,43 +54,39 @@ layout("/layouts/platform.html"){
margin: 16px 0; margin: 16px 0;
z-index: 1000; z-index: 1000;
} }
.el-slider__marks-text { .el-slider__marks-text {
margin-top: 10px !important; margin-top: 10px !important;
} }
.el-slider__stop { .el-slider__stop {
z-index: 1001; z-index: 1001;
} }
.el-slider__bar { .el-slider__bar {
z-index: 1000; z-index: 1000;
} }
.el-slider__marks-text { .el-slider__marks-text {
min-width: 40px !important; min-width: 40px !important;
} }
.el-slider__button-wrapper { .el-slider__button-wrapper {
display: none !important; display: none !important;
} }
.textDia h2 { .textDia h2 {
text-align: center; text-align: center;
} }
.textDia h4 { .textDia h4 {
line-height: 26px; line-height: 26px;
} }
.textDia .el-dialog__header { .textDia .el-dialog__header {
display: none; display: none;
} }
.textDia .el-dialog__body { .textDia .el-dialog__body {
padding: 10px 20px; padding: 10px 20px;
} }
.el-calendar-day:has(.not-allow-day) {
background-color: #F5F5F5;
}
.div-Calendar p {
margin: 0;
}
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<guava ref="guava"> <guava ref="guava">
@@ -280,21 +264,16 @@ layout("/layouts/platform.html"){
删除 删除
</el-dropdown-item> </el-dropdown-item>
<!--# } #--> <!--# } #-->
<el-dropdown-item <el-dropdown-item
v-if="scope.row.reserve_person_id === '${@shiro.getPrincipalProperty('id')}'" v-if="scope.row.reserve_person_id === '${@shiro.getPrincipalProperty('id')}'"
:command="{type:'cancel',data:scope.row}"> :command="{type:'cancel',data:scope.row}">
撤销预约 撤销预约
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-row class="el-pagination-container"> <el-row class="el-pagination-container">
<el-pagination <el-pagination
@size-change="pageSizeChange" @size-change="pageSizeChange"
@@ -334,25 +313,24 @@ layout("/layouts/platform.html"){
</el-row> </el-row>
<el-calendar v-model="reserve_time"> <el-calendar v-model="reserve_time">
<template slot="dateCell" slot-scope="{date, data}"> <template slot="dateCell" slot-scope="{date, data}">
<div class="div-Calendar" @click="pushDay(data)"> <div :class="getDayClass(data)" @click="pushDay(data)">
<p :style="dayArray.includes(data.day) ? 'color: #246fb4' : ''"> <p :style="dayArray.includes(data.day) ? 'color: #246fb4' : ''">
{{ data.day.split('-').slice(1).join('-') }} {{ dayArray.includes(data.day) ? '√' : ''}} {{ data.day.split('-').slice(1).join('-') }} {{ dayArray.includes(data.day) ? '✔️' : ''}}
</p> </p>
<div v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}" <div v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}"
v-for="item in reserveViewData"> 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')}"> :style="{backgroundColor:([0].includes(item.stateaudittype)?'#FAECD9':item.reserve_state==30?'#E0F4D9':'#FEE2E2')}">
<el-row :gutter="20" style="line-height: 30px;margin-bottom: 10px;"> <el-row style="line-height: 20px">
<el-col :span="4"> <el-col :span="4" style="font-size: 10px">
<el-button v-if="[0].includes(item.stateaudittype)" type="warning" <span v-if="[0].includes(item.stateaudittype)">待审</span>
size="mini" circle>待 <span v-if="item.stateaudittype==3">通过</span>
</el-button> <span v-if="item.stateaudittype==1">拒绝</span>
<el-button v-if="item.stateaudittype==3" type="success" size="mini" circle>通
</el-button>
<el-button v-if="item.stateaudittype==1" type="danger" size="mini" circle>拒
</el-button>
</el-col> </el-col>
<el-col :span="20" style="font-size: 10px"><b>{{item.reserve_person}}</b>:{{item.start_time}}-{{item.end_time}} <el-col :span="20" style="font-size: 10px">
<span>
<b>{{item.reserve_person}}</b>:{{item.start_time}}-{{item.end_time}}
</span>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@@ -584,7 +562,7 @@ layout("/layouts/platform.html"){
}, },
components: { components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'), 'guava': httpVueLoader('/components/plugins/Guava.vue'),
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue'), 'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue?v=1.0.0'),
}, },
methods: { methods: {
diaOpen() { diaOpen() {
@@ -757,12 +735,28 @@ layout("/layouts/platform.html"){
this.openReserve(data) this.openReserve(data)
} }
}, },
getDayClass(data) {
const d = new Date(data.day).getDay()
let classStr = 'div-Calendar'
if(this.infoViewData.openweektime) {
const openWeedTime = JSON.parse(this.infoViewData.openweektime)
if(!openWeedTime.includes(d)) {
classStr += ' not-allow-day';
}
}
if(this.infoViewData.notapplytimelist) {
const notApplyTimeList = JSON.parse(this.infoViewData.notapplytimelist)
if(notApplyTimeList.includes(data.day)) {
classStr += ' not-allow-day';
}
}
if(moment(data.day).unix() < moment().unix()) {
classStr += ' not-allow-day';
}
return classStr
},
pushDay(data) { pushDay(data) {
const d = new Date(data.day).getDay() const d = new Date(data.day).getDay()
/*if (this.textData.workday === true && (d === 0 || d === 6 || this.holidays.includes(data.day))) {
this.$notify.warning({title: '警告', message: '抱歉,该场地只能预约工作日'});
return
}*/
if(this.infoViewData.openweektime) { if(this.infoViewData.openweektime) {
const openWeedTime = JSON.parse(this.infoViewData.openweektime) const openWeedTime = JSON.parse(this.infoViewData.openweektime)
if(!openWeedTime.includes(d)) { if(!openWeedTime.includes(d)) {
@@ -770,6 +764,13 @@ layout("/layouts/platform.html"){
return return
} }
} }
if(this.infoViewData.notapplytimelist) {
const notApplyTimeList = JSON.parse(this.infoViewData.notapplytimelist)
if(notApplyTimeList.includes(data.day)) {
this.$message.warning(data.day + "不能预约")
return
}
}
if (data.day < moment(new Date()).format('YYYY-MM-DD')) { if (data.day < moment(new Date()).format('YYYY-MM-DD')) {
this.$message.warning('你选择的日期已过') this.$message.warning('你选择的日期已过')
return return
@@ -782,7 +783,6 @@ layout("/layouts/platform.html"){
} }
}, },
async openAdd() { async openAdd() {
//查询用户点击的这一天已经被预约的时间段 //查询用户点击的这一天已经被预约的时间段
/*if(this.textData.multiple === false) { /*if(this.textData.multiple === false) {
const da = await this.findReserveInfoByClickDay(this.textData.id, data.day) const da = await this.findReserveInfoByClickDay(this.textData.id, data.day)