commit
This commit is contained in:
@@ -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