first commit
This commit is contained in:
@@ -0,0 +1,422 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.remindTextArea textarea {
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.remindClass {
|
||||
width: 100%;
|
||||
white-space: break-spaces;
|
||||
font-size: 14px;
|
||||
line-height: 25px;
|
||||
background-color: white;
|
||||
max-height: 600px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.el-divider {
|
||||
background-color: #1867b0;
|
||||
}
|
||||
|
||||
.el-divider__text {
|
||||
color: #1867b0;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<h3 style="color: #1867b0">场地预约</h3>
|
||||
</template>
|
||||
|
||||
<template>
|
||||
<el-divider content-position="left">申请信息填写</el-divider>
|
||||
<el-form :model="formData" :rules="formRules" label-width="120px" ref="addForm">
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约人" prop="reserve_person_username">
|
||||
<el-input readonly placeholder="预约人"
|
||||
v-model="formData.reserve_person_username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约人工号" prop="reserve_person_loginname">
|
||||
<el-input readonly placeholder="预约人工号"
|
||||
v-model="formData.reserve_person_loginname"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约人性别" prop="reserve_person_sex">
|
||||
<el-input readonly placeholder="预约人性别"
|
||||
v-model="formData.reserve_person_sex"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="reserve_person_phone">
|
||||
<el-input readonly placeholder="联系电话"
|
||||
v-model="formData.reserve_person_phone"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="申请部门" prop="reserve_person_unit">
|
||||
<el-select disabled
|
||||
placeholder="申请部门"
|
||||
v-model="formData.reserve_person_unit">
|
||||
<el-option :label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in units">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="申请工会" prop="reserve_person_unionname">
|
||||
<el-input readonly placeholder="申请工会"
|
||||
v-model="formData.reserve_person_unionname"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约场地" prop="site_id">
|
||||
<el-select clearable @change="siteChange"
|
||||
filterable placeholder="请选择预约场地"
|
||||
v-model="formData.site_id">
|
||||
<el-option :key="item.id" :label="item.name"
|
||||
:value="item.id"
|
||||
v-for="item in siteInfoList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div style="margin-top: 10px">
|
||||
<span style="color: red">提示:选择不同的预约场地,可以查看不同场地的申请情况!</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约开始时间" prop="reserve_start_time">
|
||||
<el-date-picker style="width: 100%"
|
||||
type="datetime"
|
||||
:picker-options="pickerOptions"
|
||||
placeholder="请选择预约开始时间"
|
||||
@focus="timeEditable"
|
||||
:editable="false"
|
||||
v-model="formData.reserve_start_time"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss">
|
||||
</el-date-picker>
|
||||
<!-- <span class="text-danger">由于2024年3月14,15两日开展教代会会议故无法申请该两天的场地。</span>-->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约结束时间" prop="reserve_end_time">
|
||||
<el-date-picker style="width: 100%"
|
||||
type="datetime"
|
||||
:editable="false"
|
||||
@focus="timeEditable"
|
||||
placeholder="请选择预约结束时间"
|
||||
:picker-options="pickerOptions"
|
||||
v-model="formData.reserve_end_time"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item label="预约活动项目" prop="reserve_activity">-->
|
||||
<!-- <el-input placeholder="请填写预约活动项目" maxlength="100"-->
|
||||
<!-- v-model="formData.reserve_activity"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预约事由" prop="reserve_cause">
|
||||
<el-input placeholder="请填写预约事由" maxlength="100"
|
||||
v-model="formData.reserve_cause"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="参加人数" prop="reserve_join_user_num">
|
||||
<el-input placeholder="请填写参加人数"
|
||||
v-model="formData.reserve_join_user_num"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" type="flex">
|
||||
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item label="场地需求" prop="reserve_demand">-->
|
||||
<!-- <el-input placeholder="请填写场地需求" maxlength="100"-->
|
||||
<!-- v-model="formData.reserve_demand"></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-divider content-position="left">场地预约申请情况</el-divider>
|
||||
|
||||
<el-table :data="tableData" style="width: 100%;margin-bottom: 20px;padding: 20px" row-key="id"
|
||||
@sort-change="pageOrder" v-loading="tableLoading" :size="tableSize"
|
||||
empty-text="该场地暂无预约"
|
||||
border
|
||||
class="vi-table">
|
||||
<el-table-column align="center" header-align="center" type="index"
|
||||
:index="indexMethod" label="序号"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns"
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button type="primary" @click="doSubmit()">提 交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="writeRemindDialog" top="50px" width="60%"
|
||||
append-to-body>
|
||||
<div style="padding: 0 20px">
|
||||
<h4>职工之家场地预约</h4>
|
||||
<h4>主管部门:校工会</h4>
|
||||
<h3 style="text-align: center">欢迎使用《职工之家场地预约申请流程》服务!</h3>
|
||||
<h4 style="font-weight: bold">流程说明:</h4>
|
||||
<h4 style="font-weight: bold">一、为提高职工之家场地使用效率,充分保障我校相关活动正常有序开展,特制订本管理规定。</h4>
|
||||
<h4 style="font-weight: bold">二、职工之家场地是服务于学校及各部门教职工重大会议及重要文化活动的重要场所,由校工会遵循“申请与统筹协调”相结合的原则统一调度与管理。</h4>
|
||||
<h4 style="font-weight: bold">三、场地管理</h4>
|
||||
<div style="padding-left: 30px;">
|
||||
<h4>1.校工会现有场地3个,位于校工会一层。其中多功能厅座位80个,党员之家会议室座位20个,研讨室座位12个。</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>
|
||||
</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>
|
||||
<h4 style="font-weight: bold">六、本管理规定的解释权归校工会。</h4>
|
||||
<h4 style="font-weight: bold">七、相关事项联系方式:</h4>
|
||||
<div style="padding-left: 30px;">
|
||||
<h4>多功能厅、研讨室使用咨询——校工会办公室</h4>
|
||||
<h4>联系电话:84755127</h4>
|
||||
<h4>党员之家会议室使用咨询——党委组织部、综合考核办公室</h4>
|
||||
<h4>联系电话:84755117 </h4>
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
<!-- <div v-html="config.writeRemind"></div>-->
|
||||
<div class="text-center" slot="footer">
|
||||
<el-button @click="writeRemindDialog = false" type="primary">开始办理</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
|
||||
const validateEndTime = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
callback(new Error('请选择结束时间'))
|
||||
}
|
||||
if (this.formData.reserve_start_time) {
|
||||
//判断是否跨天预约
|
||||
const startTime = this.formData.reserve_start_time.substr(0, 10);
|
||||
const endTime = value.substr(0, 10);
|
||||
if (endTime > startTime) {
|
||||
callback(new Error('预约仅限当天时间段,请勿跨天预约!'))
|
||||
}
|
||||
if (Date.parse(value) <= Date.parse(this.formData.reserve_start_time)) {
|
||||
callback(new Error('结束时间必须大于开始时间'))
|
||||
}
|
||||
}
|
||||
callback()
|
||||
}
|
||||
return {
|
||||
writeRemindDialog: false,
|
||||
units: [],
|
||||
siteInfoList: [],
|
||||
formData: {},
|
||||
tableData: [],
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
// const twoDaysLater = new Date(); // 获取当前日期
|
||||
// const day = time.getDay();
|
||||
// twoDaysLater.setDate(twoDaysLater.getDate());
|
||||
// // return time.getTime() < twoDaysLater.getTime() || [0, 6].includes(day)
|
||||
// return time.getTime() <= twoDaysLater.getTime() || [0, 6].includes(day)
|
||||
|
||||
const today = new Date();
|
||||
today.setHours(0,0,0,0);
|
||||
const day = time.getDay()
|
||||
const year = time.getFullYear();
|
||||
const month = time.getMonth();
|
||||
const date = time.getDate();
|
||||
|
||||
if (time.getTime() < today.getTime()){
|
||||
return true;
|
||||
}
|
||||
|
||||
if (year === 2024 && month === 3 && date === 28){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (year === 2024 && month === 4 && date === 11){
|
||||
return false;
|
||||
}
|
||||
|
||||
if ([0,6].includes(day)){
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
selectableRange: '08:30:00 - 17:00:00',
|
||||
},
|
||||
tableColumns: [
|
||||
{label: '场地名称', prop: 'sitename'},
|
||||
{label: '开始时间', prop: 'reserve_start_time'},
|
||||
{label: '结束时间', prop: 'reserve_end_time'},
|
||||
{label: '预约人姓名', prop: 'reserve_person_username'},
|
||||
{label: '预约人部门', prop: 'reserve_person_unitname'},
|
||||
{label: '联系电话', prop: 'reserve_person_phone'},
|
||||
{label: '预约事由', prop: 'reserve_cause'},
|
||||
],
|
||||
formRules: {
|
||||
reserve_start_time: [{required: true, message: '请选择开始时间', trigger: ['change', 'blur']}],
|
||||
site_id: [{required: true, message: '请选择预约场地', trigger: ['change', 'blur']}],
|
||||
// reserve_activity: [{required: true, message: '请选填写活动项目', trigger: ['change', 'blur']}],
|
||||
reserve_cause: [{required: true, message: '请选填写预约事由', trigger: ['change', 'blur']}],
|
||||
reserve_join_user_num: [{required: true, message: '请选填写参加人数', trigger: ['change', 'blur']}],
|
||||
// reserve_demand: [{required: true, message: '请填写场地需求', trigger: ['change', 'blur']}],
|
||||
reserve_end_time: [{required: true, validator: validateEndTime, trigger: ['change', 'blur']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
timeEditable() {//组件禁止组件里面的input输入值
|
||||
this.$nextTick(() => {
|
||||
let els = document.querySelectorAll('.el-date-picker__editor-wrap input');
|
||||
for (var i = 0; i <= els.length - 1; i++) {
|
||||
els[i].setAttribute('readonly', 'readonly');
|
||||
}
|
||||
})
|
||||
},
|
||||
async findAllOpenSite() {
|
||||
const resp = await $.get("/platform/activity/site/apply/getAllSite")
|
||||
if (resp.code === 0) {
|
||||
this.siteInfoList = resp.data
|
||||
}
|
||||
},
|
||||
async siteChange() {
|
||||
const resp = await $.get('/platform/activity/site/apply/siteChange', {siteId: this.formData.site_id})
|
||||
console.log(resp)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data
|
||||
}
|
||||
},
|
||||
async doSubmit() {
|
||||
const res = await $.get('/platform/activity/site/apply/checkApplyTime', {
|
||||
time: this.formData.reserve_start_time,
|
||||
endTime: this.formData.reserve_end_time,
|
||||
siteId: this.formData.site_id
|
||||
})
|
||||
if (res.code === 1) {
|
||||
this.$notify.warning(res.msg)
|
||||
this.formData.reserve_start_time = ''
|
||||
this.formData.reserve_end_time = ''
|
||||
return
|
||||
}
|
||||
const valid = await this.$refs['addForm'].validate()
|
||||
if (!valid) return
|
||||
|
||||
const {site_id, reserve_start_time, reserve_end_time} = this.formData
|
||||
const siteInfo = this.siteInfoList.find(v => v.id == site_id)
|
||||
|
||||
const confirm = await this.$confirm('您确定要提交【' + siteInfo.name + '】\n,时间为:' + reserve_start_time + "\n至\n" + reserve_end_time + '\n的预约吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const resp = await $.post('/platform/activity/site/apply/insert', {"siteReserve": JSON.stringify(this.formData)})
|
||||
if (resp.code === 0) {
|
||||
this.$notify.success(resp.msg);
|
||||
setTimeout(() => {
|
||||
window.location.href = '/platform/activity/site/reserve'
|
||||
}, 500)
|
||||
} else {
|
||||
this.$notify.error(resp.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
const {data} = await $.get(loc() + '/applyUserInfo')
|
||||
this.$set(this.formData, 'reserve_person_id', data.reserve_person_id)
|
||||
this.$set(this.formData, 'reserve_person_username', data.reserve_person_username)
|
||||
this.$set(this.formData, 'reserve_person_loginname', data.reserve_person_loginname)
|
||||
this.$set(this.formData, 'reserve_person_sex', data.reserve_person_sex)
|
||||
this.$set(this.formData, 'reserve_person_phone', data.reserve_person_phone)
|
||||
this.$set(this.formData, 'reserve_person_unitname', data.reserve_person_unitname)
|
||||
this.$set(this.formData, 'reserve_person_unionname', data.reserve_person_unionname)
|
||||
this.$set(this.formData, 'reserve_person_unionid', data.reserve_person_unionid)
|
||||
this.$set(this.formData, 'reserve_person_unit', '${@shiro.getPrincipalProperty("unit").getId()}')
|
||||
this.writeRemindDialog = true
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.units = await getUnits();
|
||||
await this.findAllOpenSite();
|
||||
this.initData();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,406 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-divider--horizontal {
|
||||
margin: 5px 0;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-date-picker v-model="pageForm.year"
|
||||
type="year" value-format="yyyy" style="width: 200px" placeholder="选择年">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
|
||||
style="width: 110px;">
|
||||
<el-option label="场地名称" value="name"></el-option>
|
||||
<el-option label="场地地址" value="address"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select v-model="pageForm.siteType" placeholder="场地类型" clearable
|
||||
style="width: 200px;">
|
||||
<el-option v-for="item in activityTypeList" :label="item.text" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
|
||||
</div>
|
||||
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="openAdd">新建场地</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<el-table :data="tableData" row-key="id" @sort-change="pageOrder"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column align="center" header-align="center" label="序号" type="index">
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" show-overflow-tooltip header-align="center" label="场地名称"
|
||||
prop="name"></el-table-column>
|
||||
<el-table-column align="center" show-overflow-tooltip header-align="center" label="场地地址"
|
||||
prop="address"></el-table-column>
|
||||
<el-table-column align="center" show-overflow-tooltip header-align="center" label="联系人"
|
||||
prop="contact_person"></el-table-column>
|
||||
<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}">
|
||||
<el-switch disabled v-model="row.state" 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="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>
|
||||
<el-button type="danger" @click="doDelete(row)" size="mini">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<vi-title title="填写场地信息"></vi-title>
|
||||
<div style="padding: 0 5%">
|
||||
<el-form :model="formData" ref="addForm" :rules="formRules" label-width="120px">
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="create_username" label="创建人">
|
||||
<el-input readonly v-model="formData.create_username" type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="create_time" label="创建时间">
|
||||
<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="4">
|
||||
<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="4">
|
||||
<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="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-form-item prop="typeId" label="场地类型">
|
||||
<el-select v-model="formData.typeId" style="width: 100%" filterable
|
||||
placeholder="请选择场地类型">
|
||||
<el-option v-for="item in activityTypeList" :label="item.meetingTypeName"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</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-row>
|
||||
|
||||
<el-form-item label="添加场次 " label-width="110px" class="view-header">
|
||||
<el-button style="float: right;margin-bottom: 10px" icon="el-icon-plus" size="mini"
|
||||
type="primary" @click="formData.open_hours.push({})">添加
|
||||
</el-button>
|
||||
|
||||
<el-table :data="formData.open_hours" border size="mini">
|
||||
<el-table-column prop="start_time" label="开始时间" align="center" header-align="center">
|
||||
<template slot-scope="{row}">
|
||||
<el-time-select
|
||||
placeholder="开始时间"
|
||||
v-model="row.start_time"
|
||||
:picker-options="{ start: '00:00',step: '00:30',end: '24:00'}">
|
||||
</el-time-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="end_time" label="结束时间" align="center" header-align="center">
|
||||
<template slot-scope="{row}">
|
||||
<el-time-select
|
||||
placeholder="结束时间"
|
||||
v-model="row.end_time"
|
||||
:picker-options="{start: '00:00',step: '00:30',end: '24:00',minTime: row.start_time }">
|
||||
</el-time-select>
|
||||
</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
|
||||
:disabled="formData.open_hours.length==0"
|
||||
@click="formData.open_hours.splice(scope.$index, 1)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button type="primary" :disabled="subDis" @click="operation">确 定</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const activityUtil = new typeUtil()
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
activityTypeList: [],
|
||||
tabKey: '',
|
||||
tableLoading: false,
|
||||
subDis: false,
|
||||
tableData: [],
|
||||
formData: {
|
||||
open_hours: [{}],
|
||||
sexLimit: '0'
|
||||
},
|
||||
pageForm: {
|
||||
searchName: "name",
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: "",
|
||||
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']}],
|
||||
state: [{required: true, message: '请选择开启状态', trigger: ['blur', 'change']}],
|
||||
typeId: [{required: true, message: '请选择场地类型', trigger: ['blur', 'change']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
},
|
||||
methods: {
|
||||
doDelete(row) {
|
||||
this.$confirm('此操作将删除【' + row.name + '】场地的所有信息!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: (a, b) => {
|
||||
if ("confirm" == a) {
|
||||
$.post(location.href + "/doDelete", {id: row.id}, (data) => {
|
||||
if (data.code == 0) {
|
||||
this.$message.success(data.msg)
|
||||
this.pageData();
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async operation() {
|
||||
let method = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
this.subDis = true
|
||||
this.$refs["addForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
|
||||
const {code, data, msg} = await $.post(location.href + method, {data: JSON.stringify(this.formData)})
|
||||
if (code === 0) {
|
||||
this.pageData()
|
||||
this.$message.success(msg);
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.$message.error(msg);
|
||||
}
|
||||
loading.close()
|
||||
this.subDis = false
|
||||
}
|
||||
});
|
||||
},
|
||||
async findOneSite(id) {
|
||||
const {data} = await $.get("/platform/activity/site/mange/findOneSite", {id: id})
|
||||
return data
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
async openEdit(id) {
|
||||
this.formData = await this.findOneSite(id)
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
openAdd() {
|
||||
this.formData = {
|
||||
state: true,
|
||||
multiple: true,
|
||||
open_hours: [{}],
|
||||
create_username: '${@shiro.getPrincipalProperty("username")}',
|
||||
create_time: moment().format('YYYY-MM-DD'),
|
||||
sexLimit: '0'
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
},
|
||||
doSearch() {
|
||||
this.tabKey = new Date().getTime()
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
},
|
||||
pageOrder(column) {
|
||||
this.pageForm.pageOrderName = column.prop;
|
||||
this.pageForm.pageOrderBy = column.order;
|
||||
this.pageData();
|
||||
},
|
||||
pageNumberChange(val) {
|
||||
this.pageForm.pageNumber = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageSizeChange(val) {
|
||||
this.pageForm.pageSize = val;
|
||||
this.pageData();
|
||||
},
|
||||
pageData() {
|
||||
sublime.showLoadingbar();
|
||||
this.tableLoading = true
|
||||
$.post(location.href + "/pageData", this.pageForm, (res) => {
|
||||
const {code, data, msg} = res
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (code == 0) {
|
||||
for (let i = 0; i < data.list.length; i++) {
|
||||
data.list[i].open_hours = site.reverseRankingDate(data.list[i].open_hours)
|
||||
}
|
||||
this.tableData = data.list;
|
||||
this.pageForm.totalCount = data.totalCount;
|
||||
} else {
|
||||
this.$message.error(msg);
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
this.activityTypeList = await activityUtil.getAllType()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,385 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<link rel="stylesheet" href="${base!}/assets/platform/plugins/jqFullCalendar/css/fullcalendar.css">
|
||||
<script src="${base!}/assets/platform/plugins/jqFullCalendar/js/fullcalendar.min.js"></script>
|
||||
<script src="${base!}/assets/platform/plugins/jqFullCalendar/js/moment.min.js"></script>
|
||||
|
||||
<style>
|
||||
.fc-toolbar {
|
||||
display: block !important;
|
||||
visibility: unset !important;
|
||||
}
|
||||
|
||||
.yantaoshi {
|
||||
background: #39b54a;
|
||||
}
|
||||
|
||||
.duogongnengting {
|
||||
background: #31b48d;
|
||||
}
|
||||
|
||||
.dangyuanzhijia {
|
||||
background: #9c26b0;
|
||||
}
|
||||
|
||||
.other {
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">月份:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
@change="doSearch"
|
||||
v-model="pageForm.time"
|
||||
placeholder="请选择月份"
|
||||
type="month"
|
||||
value-format="yyyy-MM">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名工号:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
style="width: 100%"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="查询类型"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="u.username"></el-option>
|
||||
<el-option label="工号" value="u.loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地名称:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable clearable
|
||||
placeholder="请输入场地名称"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.siteName">
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地类型:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.siteType" placeholder="场地类型"
|
||||
clearable filterable style="width: 100%">
|
||||
<el-option v-for="item in activityTypeList" :label="item.text"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<vi-title2 title="预约列表">
|
||||
<template #func>
|
||||
<el-button size="small" type="primary" class="el-icon-date" @click="openCalendar">预约日历
|
||||
</el-button>
|
||||
</template>
|
||||
</vi-title2>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
|
||||
align="center"
|
||||
header-align="center">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
|
||||
<template scope="{row}" v-if="column.prop==='state_name'">
|
||||
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
|
||||
<span v-if="[0].includes(row.stateaudittype)"
|
||||
style="color: #e6a23c">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right"
|
||||
width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<reserve-info ref="reserve"></reserve-info>
|
||||
</template>
|
||||
|
||||
<template #public>
|
||||
<div id="site-calendar"></div>
|
||||
</template>
|
||||
|
||||
<el-dialog title="预约详情" :visible.sync="siteInfoDialog" width="60%">
|
||||
<reserve-info ref="reserveDialogInfo"></reserve-info>
|
||||
</el-dialog>
|
||||
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const activityUtil = new typeUtil()
|
||||
let calendar = null
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
userid: "${@shiro.getPrincipalProperty('id')}",
|
||||
role: "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}",
|
||||
activityTypeList: [],
|
||||
siteList: [],
|
||||
pageForm: {
|
||||
searchName: "u.username",
|
||||
searchKeyword: "",
|
||||
isAudit: false,
|
||||
time: "",
|
||||
},
|
||||
tableColumns: [
|
||||
{label: '场地名称', prop: 'site_name', sortable: true},
|
||||
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true},
|
||||
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true},
|
||||
{label: '开始时间', prop: 'reserve_start_time', sortable: true},
|
||||
{label: '结束时间', prop: 'reserve_end_time', sortable: true},
|
||||
{label: '联系电话', prop: 'reserve_person_phone'},
|
||||
// {label: '活动名称', prop: 'reserve_activity'},
|
||||
{label: '预约事由', prop: 'reserve_cause'},
|
||||
{label: '预约状态', prop: 'state_name'},
|
||||
],
|
||||
sites: [],
|
||||
events: [],
|
||||
calendarHeight: 0,
|
||||
siteInfoDialog: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.reserve.openView(row.id)
|
||||
},
|
||||
async doDelete(id) {
|
||||
const confirm = await this.$confirm("您确定要删除此预约吗?", '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm !== 'confirm') return
|
||||
const resp = await $.post('/platform/activity/site/reserve/doDelete', {id, op: 1})
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
async getSites() {
|
||||
const {data} = await $.get(loc() + '/getSites')
|
||||
this.sites = data
|
||||
},
|
||||
|
||||
initCalendar() {
|
||||
const that = this
|
||||
if (calendar) {
|
||||
return
|
||||
}
|
||||
calendar = $('#site-calendar').fullCalendar({
|
||||
header: { //设置日历头部信息,false,则不显示头部信息。包括left,center,right左中右三个位置
|
||||
left: 'prev,next, today', //上一个、下一个、今天
|
||||
center: 'title', //标题
|
||||
right: 'month,agendaWeek,agendaDay' //月、周、日、日程列表
|
||||
},
|
||||
locale: 'zh-cn', //?没用?
|
||||
timeFormat: 'HH:mm', //日程事件的时间格式
|
||||
buttonText: { //各按钮的显示文本信息
|
||||
today: '今天',
|
||||
month: '月',
|
||||
agendaWeek: '周',
|
||||
agendaDay: '日',
|
||||
listMonth: '日程',
|
||||
},
|
||||
monthNames: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], //月份全称
|
||||
monthNamesShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], //月份简写
|
||||
dayNames: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], //周全称
|
||||
dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"], //周简写
|
||||
noEventsMessage: "当月无数据", //listview视图下,无数据提示
|
||||
allDayText: "全天", //自定义全天视图的名称
|
||||
allDaySlot: false, //是否在周日历上方显示全天
|
||||
allDayDefault: false, //是否为全天日程事件,显示这一天中所做的事情
|
||||
slotDuration: "00:30:00", //一格时间槽代表多长时间,默认00:30:00(30分钟)
|
||||
slotLabelFormat: "H(:mm)a", //日期视图左边那一列显示的每一格日期时间格式
|
||||
slotLabelInterval: "01:00:00", //日期视图左边那一列多长间隔显示一条日期文字(默认跟着slotDuration走的,可自定义)
|
||||
snapDuration: "01:00:00", //其实就是动态创建一个日程时,默认创建多长的时间块
|
||||
firstDay: 1, //一周中显示的第一天是哪天,周日是0,周一是1,类推
|
||||
hiddenDays: [], //隐藏一周中的某一天或某几天,数组形式,如隐藏周二和周五:[2,5],默认不隐藏,除非weekends设置为false。
|
||||
weekends: true, //是否显示周六和周日,设为false则不显示周六和周日。默认值为true
|
||||
weekMode: 'fixed', //月视图里显示周的模式,因每月周数不同月视图高度不定。fixed:固定显示6周高,日历高度保持不变liquid:不固定周数,高度随周数变化variable:不固定周数,但高度固定
|
||||
weekNumbers: false, //是否在日历中显示周次(一年中的第几周),如果设置为true,则会在月视图的左侧、周视图和日视图的左上角显示周数。
|
||||
weekNumberCalculation: 'iso', //周次的显示格式。
|
||||
height: that.calendarHeight, //设置日历的高度,包括header日历头部,默认未设置,高度根据aspectRatio值自适应。
|
||||
// contentHeight: 600, //设置日历主体内容的高度,不包括header部分,默认未设置,高度根据aspectRatio值自适应。
|
||||
handleWindowResize: true, //是否随浏览器窗口大小变化而自动变化。
|
||||
defaultView: 'agendaWeek', //初始化时默认视图,默认是月month,agendaWeek是周,agendaDay是当天
|
||||
slotEventOverlap: false, //事件是否可以重叠覆盖
|
||||
defaultDate: moment().format('YYYY-MM-DD'), //默认显示那一天的日期视图getDates(true)2020-05-10
|
||||
nowIndicator: false, //周/日视图中显示今天当前时间点(以红线标记),默认false不显示
|
||||
eventLimit: 2, //数据条数太多时,限制显示条数(多余的以“+2more”格式显示),默认false不限制,支持输入数字设定固定的显示条数
|
||||
eventLimitText: "更多", //当一块区域内容太多以"+2 more"格式显示时,这个more的名称自定义(应该与eventLimit: true一并用)
|
||||
dayPopoverFormat: "YYYY年M月d日预约信息", //点开"+2 more"弹出的小窗口标题,与eventLimitClick可以结合用
|
||||
render: (view) => { //method,绑定日历到id上。$('#id').fullCalendar('render');
|
||||
},
|
||||
viewRender: (view) => {
|
||||
that.getCalendarData()
|
||||
},
|
||||
eventRender: (info, element) => {
|
||||
console.log($(info.el))
|
||||
console.log(info)
|
||||
console.log(element)
|
||||
console.log(element.find('.fc-event-title'))
|
||||
element.find('.fc-title').append("<br/>申请人:" + info.reserve_person_username)
|
||||
element.find('.fc-title').append("<br/>申请事由:" + info.reserve_cause)
|
||||
element.find('.fc-title').append("<br/>申请活动:" + info.reserve_activity)
|
||||
element.find('.fc-title').append("<br/>审核状态:" + info.state_name)
|
||||
// $(info.el).html(info.event.title);
|
||||
},
|
||||
//日历数据源
|
||||
events: that.events,
|
||||
eventClick: (event, jsEvent) => {
|
||||
console.log(event)
|
||||
console.log(jsEvent)
|
||||
// that.openView(event)
|
||||
|
||||
that.siteInfoDialog = true
|
||||
setTimeout(async () => {
|
||||
await httpVueLoader('/components/activity/site/ReserveInfo.vue')()
|
||||
// that.$refs.reserveDialogInfo.openView(event.id)
|
||||
}, 1000)
|
||||
|
||||
// if (event.is_auditing === 1) {
|
||||
// sublime.jumpPagePjax('/platform/activity/site/review')
|
||||
// } else {
|
||||
//
|
||||
// }
|
||||
// this.askTypeArray = []
|
||||
// if (event.o.appointmentUser) {
|
||||
// return
|
||||
// }
|
||||
// if (new Date().getTime() > event.o.startTimeTs) {
|
||||
// return
|
||||
// }
|
||||
// this.appointmentDialogVisible = true
|
||||
// that.formData = event.o
|
||||
// if (event.askTypeList) {
|
||||
// const array = JSON.parse(event.askTypeList)
|
||||
// this.askTypeList.map(o => {
|
||||
// if (array.includes(o.code)) {
|
||||
// this.askTypeArray.push(o)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// if (this.askTypeArray && this.askTypeArray.length === 1) {
|
||||
// that.$set(that.formData, 'appointmentAskTypeValue', this.askTypeArray[0].code)
|
||||
// }
|
||||
},
|
||||
selectable: false, //是否允许通过单击或拖动选择日历中的对象,包括天和时间
|
||||
selectMirror: true, //镜像
|
||||
lazyFetching: false, //是否启用懒加载技术--即只取当前条件下的视图数据,其它数据在切换时触发,默认true只取当前视图的,false是取全视图的
|
||||
defaultTimedEventDuration: "01:00:00", //在Event Object中如果没有end参数时使用,如start=7:00pm,则该日程对象时间范围就是7:00~9:00
|
||||
defaultAllDayEventDuration: {days: 1}, //默认1天是多长,(有的是采用工作时间模式,所以支持自定义)
|
||||
});
|
||||
},
|
||||
async getCalendarData() {
|
||||
if (!calendar) {
|
||||
return
|
||||
}
|
||||
const view = calendar.fullCalendar('getView')
|
||||
//这里取时间戳
|
||||
const startTimeTs = view.start.format('YYYY-MM-DD HH:mm:ss')
|
||||
const endTimeTs = view.end.format('YYYY-MM-DD HH:mm:ss')
|
||||
const {data} = await $.get(loc() + '/getCalendarData', {
|
||||
siteId: this.pageForm.siteId,
|
||||
startTimeTs,
|
||||
endTimeTs
|
||||
})
|
||||
if (data && data.length > 0) {
|
||||
data.map(x => {
|
||||
console.log(x)
|
||||
if (x.site_id === '83dfd7d780f448aea307d2ce967b51fe') {
|
||||
x.className = 'yantaoshi'
|
||||
} else if (x.site_id === 'd6ebd7e454a24e3495b0d18438fb6a59') {
|
||||
x.className = 'duogongnengting'
|
||||
} else if (x.site_id === 'a6486481018b479ab137bac53936f15e') {
|
||||
x.className = 'dangyuanzhijia'
|
||||
} else {
|
||||
x.className = 'other'
|
||||
}
|
||||
})
|
||||
let events = data
|
||||
calendar.fullCalendar('removeEvents', () => true)
|
||||
calendar.fullCalendar('addEventSource', events, true);
|
||||
} else {
|
||||
calendar.fullCalendar('removeEvents', () => true)
|
||||
}
|
||||
},
|
||||
openCalendar() {
|
||||
this.$refs.guava.public()
|
||||
setTimeout(() => {
|
||||
this.initCalendar()
|
||||
this.getCalendarData()
|
||||
}, 500)
|
||||
},
|
||||
async findAllOpenSite() {
|
||||
const {data} = await $.get("/platform/activity/site/apply/getAllSite")
|
||||
return data
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
this.calendarHeight = window.innerHeight - 164 - 6
|
||||
}, 100)
|
||||
},
|
||||
async created() {
|
||||
this.activityTypeList = await activityUtil.getAllType()
|
||||
this.siteList = await this.findAllOpenSite()
|
||||
this.pageData()
|
||||
this.getSites()
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,273 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">月份:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
@change="doSearch"
|
||||
v-model="pageForm.time"
|
||||
placeholder="请选择月份"
|
||||
type="month"
|
||||
value-format="yyyy-MM">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名工号:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
style="width: 100%"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="查询类型"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="u.username"></el-option>
|
||||
<el-option label="工号" value="u.loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地名称:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable clearable
|
||||
placeholder="请输入场地名称"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.siteName">
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地类型:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.siteType" placeholder="场地类型"
|
||||
clearable filterable style="width: 100%">
|
||||
<el-option v-for="item in activityTypeList" :label="item.text" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="预约列表">
|
||||
<template #func>
|
||||
<el-button @click="location.href='/platform/activity/site/apply'" size="medium" type="primary">我要预约</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
|
||||
align="center"
|
||||
header-align="center">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
|
||||
<template scope="{row}" v-if="column.prop==='state_name'">
|
||||
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
|
||||
<span v-if="[0].includes(row.stateaudittype)"
|
||||
style="color: #e6a23c">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:scope.row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<!--# if(@shiro.hasRole('sysadmin')){ #-->
|
||||
<el-dropdown-item
|
||||
:command="{type:'delete',data:scope.row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
<!--# } #-->
|
||||
<el-dropdown-item
|
||||
v-if="scope.row.reserve_person_id === '${@shiro.getPrincipalProperty('id')}'
|
||||
&& (scope.row.reserve_person_union_process == null || scope.row.reserve_person_union_process == '')"
|
||||
:command="{type:'cancel',data:scope.row}">
|
||||
撤销预约
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<reserve-info ref="reserve"></reserve-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const activityUtil = new typeUtil()
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
activityTypeList: [],
|
||||
siteList: [],
|
||||
tableData: [],
|
||||
userid:'',
|
||||
pageForm: {
|
||||
searchName: "u.username",
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: "",
|
||||
time: ''
|
||||
},
|
||||
tableColumns: [
|
||||
{label: '场地名称', prop: 'site_name', sortable: true},
|
||||
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true},
|
||||
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true},
|
||||
{label: '开始时间', prop: 'reserve_start_time', sortable: true},
|
||||
{label: '结束时间', prop: 'reserve_end_time', sortable: true},
|
||||
{label: '联系电话', prop: 'reserve_person_phone'},
|
||||
{label: '预约事由', prop: 'reserve_cause'},
|
||||
{label: '预约状态', prop: 'state_name'},
|
||||
],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type === 'view') {
|
||||
this.userid = data.reserve_person_id;
|
||||
this.openView(data)
|
||||
} else if (type === 'delete') {
|
||||
this.doClean(data.id)
|
||||
} else if (type === 'cancel') {
|
||||
this.doRevoke(data.id)
|
||||
}
|
||||
},
|
||||
backOption(row) {
|
||||
this.$prompt('请填写反馈意见', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputValidator: (value) => {
|
||||
if (value === null) {
|
||||
return '反馈意见不能为空'
|
||||
}
|
||||
}
|
||||
}).then(async ({value}) => {
|
||||
const res = await $.post('/mobile/activity/site/info/backOption', {
|
||||
id: row.id,
|
||||
option: value
|
||||
})
|
||||
if (res.code === 0) {
|
||||
await this.doSearch()
|
||||
this.$notify.success({title: '提示', message: '操作成功!'});
|
||||
} else {
|
||||
this.$notify.warning({title: '警告', message: '操作失败!'});
|
||||
}
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
async doClean(id){
|
||||
this.$confirm("您确定要删除此预约吗?", '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: (a, b) => {
|
||||
if ("confirm" === a) {
|
||||
$.post("/platform/activity/site/apply/doClean", {id}, (data) => {
|
||||
if (data.code === 0) {
|
||||
this.$message.success(data.msg)
|
||||
this.pageData();
|
||||
} else {
|
||||
this.$message.warning(data.msg)
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async doRevoke(id) {
|
||||
this.$confirm("您确定要撤销此预约吗?", '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: (a, b) => {
|
||||
if ("confirm" === a) {
|
||||
$.post("/platform/activity/site/apply/revoke", {id}, (data) => {
|
||||
if (data.code === 0) {
|
||||
this.$message.success(data.msg)
|
||||
this.pageData();
|
||||
} else {
|
||||
this.$message.warning(data.msg)
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}"
|
||||
this.$refs.reserve.role = role
|
||||
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === this.userid
|
||||
this.$refs.reserve.backOptionShow = (role || backOptionShow)
|
||||
this.$refs.reserve.openView(row.id)
|
||||
},
|
||||
async doSearch() {
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageData()
|
||||
this.siteList = await this.findAllOpenSite()
|
||||
},
|
||||
async findAllOpenSite() {
|
||||
const {data} = await $.get("/platform/activity/site/apply/getAllSite")
|
||||
return data
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.activityTypeList = await activityUtil.getAllType()
|
||||
this.siteList = await this.findAllOpenSite()
|
||||
this.pageData();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,228 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">月份:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
@change="doSearch"
|
||||
v-model="pageForm.time"
|
||||
placeholder="请选择月份"
|
||||
type="month"
|
||||
value-format="yyyy-MM">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名工号:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
style="width: 100%"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="查询类型"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="u.username"></el-option>
|
||||
<el-option label="工号" value="u.loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地名称:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable clearable
|
||||
placeholder="请输入场地名称"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.siteName">
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地类型:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.siteType" placeholder="场地类型"
|
||||
clearable filterable style="width: 100%">
|
||||
<el-option v-for="item in activityTypeList" :label="item.text" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="预约列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
|
||||
align="center"
|
||||
header-align="center">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
|
||||
<template scope="{row}" v-if="column.prop==='state_name'">
|
||||
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
|
||||
<span v-if="[0].includes(row.stateaudittype)"
|
||||
style="color: #e6a23c">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right"
|
||||
width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="row.reserve_state == 6118" @click="doProcess(row)" size="mini" type="primary">审核</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit style="padding: 0 10%">
|
||||
<reserve-info ref="auditInfo">
|
||||
<template #handle>
|
||||
<el-tab-pane label="校工会审核" name="xghsh">
|
||||
<el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm">
|
||||
<el-form-item label="审核人">
|
||||
${@shiro.getPrincipalProperty('username')}
|
||||
</el-form-item>
|
||||
<el-form-item label="审核时间">
|
||||
{{moment().format('YYYY-MM-DD')}}
|
||||
</el-form-item>
|
||||
<el-form-item :rules="[{required: true, message: '请输入审核意见', trigger: ['blur']}]"
|
||||
label="审核意见"
|
||||
prop="schoolOption">
|
||||
<el-input maxlength="300" rows="5" type="textarea"
|
||||
v-model="formData.schoolOption"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row style="margin: 40px 0;text-align: right">
|
||||
<el-button type="danger" @click="doReview(false)">拒绝</el-button>
|
||||
<el-button type="primary" @click="doReview(true)">通过</el-button>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</template>
|
||||
</reserve-info>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<reserve-info ref="reserve"></reserve-info>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const activityUtil = new typeUtil()
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
activityTypeList:[],
|
||||
siteList:[],
|
||||
pageForm: {
|
||||
searchName: "u.username",
|
||||
searchKeyword: "",
|
||||
isAudit: false,
|
||||
time: "",
|
||||
},
|
||||
tableColumns: [
|
||||
{label: '场地名称', prop: 'site_name', sortable: true},
|
||||
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true},
|
||||
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true},
|
||||
{label: '开始时间', prop: 'reserve_start_time', sortable: true},
|
||||
{label: '结束时间', prop: 'reserve_end_time', sortable: true},
|
||||
{label: '联系电话', prop: 'reserve_person_phone'},
|
||||
// {label: '活动名称', prop: 'reserve_activity'},
|
||||
{label: '预约事由', prop: 'reserve_cause'},
|
||||
{label: '预约状态', prop: 'state_name'},
|
||||
],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}"
|
||||
this.$refs.reserve.role = role
|
||||
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id
|
||||
this.$refs.reserve.backOptionShow = (role || backOptionShow)
|
||||
this.$refs.reserve.openView(row.id)
|
||||
},
|
||||
doProcess(row){
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.auditInfo.openView(row.id, 'xghsh')
|
||||
this.formData={
|
||||
id: row.id,
|
||||
schoolOption: null,
|
||||
}
|
||||
},
|
||||
async doReview(row){
|
||||
const valid = await this.$refs['auditForm'].validate()
|
||||
if (!valid) return
|
||||
this.formData.reserve_state = row ? 6138 : 6128
|
||||
this.formData.isPass = row
|
||||
const resp = await $.post('/platform/activity/site/review/doProcess', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.notifySuccess(resp.msg)
|
||||
this.pageData()
|
||||
}
|
||||
},
|
||||
doInstructions() {
|
||||
$.post(location.href + "/doReview", this.formData, (res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData();
|
||||
this.$refs.guava.index()
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
async findAllOpenSite() {
|
||||
const {data} = await $.get("/platform/activity/site/apply/getAllSite")
|
||||
return data
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.activityTypeList = await activityUtil.getAllType()
|
||||
this.siteList = await this.findAllOpenSite()
|
||||
this.pageData();
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,445 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.audit-userids-select .el-select__tags {
|
||||
flex-wrap: unset;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<table-tool :app="this" label="类型列表">
|
||||
<template #func>
|
||||
<el-button @click="openAdd" size="small" type="primary">新增类型</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize"
|
||||
@sort-change="pageOrder" class="vi-table"
|
||||
row-key="id" style="width: 100%">
|
||||
|
||||
<el-table-column align="center" header-align="center" label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
align="center"
|
||||
header-align="center"
|
||||
min-width="50"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<template #edit>
|
||||
<vi-title title="基础信息"></vi-title>
|
||||
<el-form :model="formData" :rules="formRules" label-width="80px" ref="form">
|
||||
<el-form-item label="名称" prop="meetingTypeName">
|
||||
<el-input v-model="formData.meetingTypeName"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="模块名称" prop="moduleName">
|
||||
<el-input v-model="formData.moduleName"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="序号" prop="sortNum">
|
||||
<el-input-number :max="tableData.length + 1" :min="1" :precision="0"
|
||||
v-model="formData.sortNum"></el-input-number>
|
||||
</el-form-item>
|
||||
|
||||
<vi-title title="审核节点信息(温馨提醒:如审核节点没有限制,审核节点类型不选或选择不限制)"></vi-title>
|
||||
<el-table :data="formData.auditStateList">
|
||||
<el-table-column label="节点ID" prop="stateId" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-input readonly v-model="scope.row.stateId"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="审核节点名称" prop="stateName">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.stateName"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="审核节点类型" prop="auditAfterType" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.auditAfterType" clearable>
|
||||
<el-option :label="item.desc"
|
||||
:value="item.value"
|
||||
v-for="item in activityAuditTypeEnum"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="审核人" prop="selectUserId">
|
||||
<template slot-scope="scope">
|
||||
<el-select :remote-method="userRemoteMethod" class="audit-userids-select" filterable
|
||||
multiple placeholder="请输入姓名或工号查找"
|
||||
remote style="width: 100%"
|
||||
v-model="scope.row.selectUserId">
|
||||
<el-option :key="item.id" :label="item.username + '(' + item.loginname + ')'"
|
||||
:value="item.id"
|
||||
v-for="item in userList"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="筛选审核人" width="100px">
|
||||
<template scope="scope">
|
||||
<el-button @click="openUserSelect(scope.$index)" type="text">筛选用户</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="通过下个节点" pro="afterPassStateId" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.afterPassStateId">
|
||||
<el-option :label="item"
|
||||
:value="item"
|
||||
v-for="item in stateIdList"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="拒绝下个节点" pro="afterRejectStateId" width="120px">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.afterRejectStateId">
|
||||
<el-option :label="item"
|
||||
:value="item"
|
||||
v-for="item in stateIdList"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="审核类型" prop="stateAuditType" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.stateAuditType">
|
||||
<el-option :label="item.desc"
|
||||
:value="item.value"
|
||||
v-for="item in stateAuditTypeList"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column width="100px">
|
||||
<template scope="scope" slot="header">
|
||||
<el-button @click="addState"
|
||||
icon="el-icon-circle-plus-outline"
|
||||
size="mini"
|
||||
type="primary"></el-button>
|
||||
</template>
|
||||
<template scope="scope">
|
||||
<el-button @click="formData.auditStateList.splice(scope.$index, 1)"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
type="danger"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
<el-row class="mt10" justify="end" type="flex">
|
||||
<el-button @click="$refs.guava.index()">取消</el-button>
|
||||
<el-button @click="doConfirm" type="primary">确定</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<condition :fields="fields"
|
||||
:show_filter_result="true"
|
||||
@confirm="cndConfirm"
|
||||
ref="cnd"
|
||||
v-model="cnd"></condition>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
function isJson(str){
|
||||
if(typeof str == 'string'){
|
||||
try{
|
||||
var obj = JSON.parse(str);
|
||||
if (typeof obj == 'object' && obj){
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}catch (e){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
const activityUtil = new typeUtil()
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
'condition': httpVueLoader('/components/plugins/ConditionStructure.vue?v=1.0.0'),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableColumns: [
|
||||
{prop: 'meetingTypeName', label: '类型名称'},
|
||||
{prop: 'moduleName', label: '模块名称'},
|
||||
{prop: 'sortNum', label: '排序编号'}],
|
||||
stateAuditTypeList: [],
|
||||
formData: {
|
||||
auditStateList: []
|
||||
},
|
||||
formRules: {
|
||||
meetingTypeName: [{required: true, message: '请输入类型名称', trigger: ['blur', 'change']}],
|
||||
moduleName: [{required: true, message: '请输入模块名称,英文命名', trigger: ['blur', 'change']}],
|
||||
sortNum: [{required: true, message: '请输入排序编号', trigger: ['blur', 'change']}]
|
||||
},
|
||||
userList: [],
|
||||
maxStateId: 0,
|
||||
userSelectDialogVisible: false,
|
||||
cnd: {},
|
||||
fields: [],
|
||||
nodeIndex: null,
|
||||
activityAuditTypeEnum:[],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
async 'formData.auditStateList'(val) {
|
||||
const {id} = this.formData
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
let item = val[i]
|
||||
if (id) {
|
||||
if (item.isAddRow) {
|
||||
//当前行是新增的第几行
|
||||
const addIndex = i + 1 - val.filter(v => !v.isAddRow).length
|
||||
|
||||
const stateId = val[0].stateId + i * 10
|
||||
const licitStateCode = await this.checkStateId(stateId, addIndex)
|
||||
item['stateId'] = licitStateCode
|
||||
}
|
||||
} else {
|
||||
item['stateId'] = this.maxStateId + (i + 1) * 10
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// this.$set(this.formData,'auditStateList',val)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialogTitle() {
|
||||
if (this.formData.id) {
|
||||
return '编辑'
|
||||
}
|
||||
return '新增'
|
||||
},
|
||||
stateIdList() {
|
||||
return this.formData.auditStateList.map(v => v.stateId)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async checkStateId(stateId, stateIndex) {
|
||||
const resp = await $.get(loc() + '/checkStateId', {stateId, stateIndex})
|
||||
if (resp.code === 0) {
|
||||
return resp.data
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
},
|
||||
|
||||
addState() {
|
||||
this.formData.auditStateList.push({
|
||||
stateId: this.maxStateId,
|
||||
stateName: null,
|
||||
selectUserId: [],
|
||||
auditStateUserList: [],
|
||||
afterPassStateId: null,
|
||||
afterRejectStateId: null,
|
||||
isAddRow: true
|
||||
})
|
||||
},
|
||||
|
||||
async findAll() {
|
||||
const resp_data = await $.get(loc() + '/findAll')
|
||||
if (resp_data.code === 0) {
|
||||
resp_data.data.forEach(v => {
|
||||
v.auditStateList.forEach(x => {
|
||||
if (x.matchCnd) {
|
||||
x.matchCnd = JSON.parse(x.matchCnd)
|
||||
}
|
||||
})
|
||||
})
|
||||
this.tableData = resp_data.data
|
||||
}
|
||||
},
|
||||
openAdd() {
|
||||
this.formData = {
|
||||
meetingName: null,
|
||||
sortNum: this.tableData.length + 1,
|
||||
auditStateList: [{}]
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
async doConfirm() {
|
||||
try {
|
||||
const valid = await this.$refs['form'].validate()
|
||||
if (valid) {
|
||||
this.formData.auditStateList.forEach(v => {
|
||||
v['auditStateUserList'] = v.selectUserId.map(x => {
|
||||
return {userId: x}
|
||||
})
|
||||
if(v['matchCnd']) {
|
||||
const o = isJson(v['matchCnd']);
|
||||
if (!o){
|
||||
v['matchCnd'] = JSON.stringify(v['matchCnd'])
|
||||
}
|
||||
}
|
||||
})
|
||||
const resp = await $.post(loc() + '/doHandle', {data: JSON.stringify(this.formData)})
|
||||
if (resp.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.notifySuccess(resp.msg)
|
||||
this.findAll()
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
},
|
||||
async openEdit(row) {
|
||||
const d = clone(row)
|
||||
let u = []
|
||||
const {data} = await $.post(loc() + '/findOne', {module: row.moduleName})
|
||||
data.forEach(v => {
|
||||
v['selectUserId'] = v.auditStateUserList.map(x => x.userId)
|
||||
u = u.concat(v['selectUserId'])
|
||||
})
|
||||
d.auditStateList = data
|
||||
this.userList = await queryUserByIds(u)
|
||||
|
||||
this.formData = d
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
async doDelete(id) {
|
||||
try {
|
||||
const confirm = await this.$confirm('您确定要删除吗', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === 'confirm') {
|
||||
const resp = await $.post(loc() + '/delete/' + id)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.findAll()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async userRemoteMethod(query) {
|
||||
if (query) {
|
||||
this.userList = await searchUser(query)
|
||||
}
|
||||
},
|
||||
openUserSelect(node_index) {
|
||||
this.nodeIndex = node_index
|
||||
const node = this.formData.auditStateList[node_index]
|
||||
if (node.matchCnd) {
|
||||
if (this.cnd == null){
|
||||
if(this.cnd == null) {
|
||||
this.cnd = {
|
||||
method: "AND",
|
||||
conditions: [{}],
|
||||
}
|
||||
}
|
||||
}else {
|
||||
try {
|
||||
this.cnd = JSON.parse(node.matchCnd)
|
||||
}catch (e){
|
||||
this.cnd = node.matchCnd
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.cnd = {method: "AND", conditions: [{}]}
|
||||
}
|
||||
this.$refs.cnd.open(false)
|
||||
},
|
||||
async initCndFields() {
|
||||
this.cnd = {
|
||||
method: "AND",
|
||||
conditions: [{}],
|
||||
}
|
||||
/*const meet_data = await getOpenMeeting()
|
||||
const meet_options = meet_data.map(v => {
|
||||
return {"label": v.jdhallname, "value": v.id}
|
||||
})
|
||||
this.fields.push(
|
||||
{label: '教代会', value: 'jdhid', type: "select", options: meet_options}
|
||||
)*/
|
||||
const {data: role_data} = await $.get('/platform/sys/role/getAllRoles')
|
||||
const role_options = role_data.map(v => {
|
||||
return {"label": v.name, "value": v.id}
|
||||
})
|
||||
this.fields.push(
|
||||
{label: '角色', value: 'roleId', type: "select", options: role_options}
|
||||
)
|
||||
this.fields.push(
|
||||
{label: '姓名', value: 'username', options: null}
|
||||
)
|
||||
|
||||
|
||||
},
|
||||
async cndConfirm(val) {
|
||||
if (val) {
|
||||
const matchCnd = clone(val)
|
||||
if (matchCnd.conditions && matchCnd.conditions.length > 0) {
|
||||
this.formData.auditStateList[this.nodeIndex].matchCnd = matchCnd
|
||||
const resp = await $.post('/platform/userFilter/findUserByCnd', {cnd: JSON.stringify(matchCnd)})
|
||||
if (resp.code === 0) {
|
||||
if (resp.data) {
|
||||
const d = this.formData.auditStateList[this.nodeIndex]
|
||||
d.matchCnd = matchCnd
|
||||
d.selectUserId = [...new Set(d.selectUserId.concat(resp.data.map(v => v.id)))]
|
||||
|
||||
this.$set(this.formData.auditStateList, this.nodeIndex, d)
|
||||
let u = []
|
||||
this.formData.auditStateList.forEach(v => {
|
||||
u = u.concat(v.selectUserId.map(x => x))
|
||||
})
|
||||
this.userList = await queryUserByIds([...new Set(u)])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.findAll()
|
||||
this.initCndFields()
|
||||
this.maxStateId = await activityUtil.findMaxStateId()
|
||||
this.stateAuditTypeList = await getEnumOptions('AuditTypeEnum')
|
||||
this.activityAuditTypeEnum = await getEnumOptions('ActivityAuditTypeEnum')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,217 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">月份:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
@change="doSearch"
|
||||
v-model="pageForm.time"
|
||||
placeholder="请选择月份"
|
||||
type="month"
|
||||
value-format="yyyy-MM">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名工号:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
style="width: 100%"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="查询类型"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="u.username"></el-option>
|
||||
<el-option label="工号" value="u.loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地名称:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable clearable
|
||||
placeholder="请输入场地名称"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.siteName">
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">场地类型:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.siteType" placeholder="场地类型"
|
||||
clearable filterable style="width: 100%">
|
||||
<el-option v-for="item in activityTypeList" :label="item.text" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="预约列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
|
||||
align="center"
|
||||
header-align="center">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
|
||||
<template scope="{row}" v-if="column.prop==='state_name'">
|
||||
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
|
||||
<span v-if="[0].includes(row.stateaudittype)"
|
||||
style="color: #e6a23c">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right"
|
||||
width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="row.reserve_state == 6098" @click="doProcess(row)" size="mini" type="primary">审核</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit style="padding: 0 10%">
|
||||
<reserve-info ref="auditInfo">
|
||||
<template #handle>
|
||||
<el-tab-pane label="分工会审核" name="fghsh">
|
||||
<el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm">
|
||||
<el-form-item label="审核人">
|
||||
${@shiro.getPrincipalProperty('username')}
|
||||
</el-form-item>
|
||||
<el-form-item label="审核时间">
|
||||
{{moment().format('YYYY-MM-DD')}}
|
||||
</el-form-item>
|
||||
<el-form-item :rules="[{required: true, message: '请输入审核意见', trigger: ['blur']}]"
|
||||
label="审核意见"
|
||||
prop="unionOption">
|
||||
<el-input maxlength="300" rows="5" type="textarea"
|
||||
v-model="formData.unionOption"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row style="margin: 40px 0;text-align: right">
|
||||
<el-button type="danger" @click="doReview(false)">拒绝</el-button>
|
||||
<el-button type="primary" @click="doReview(true)">通过</el-button>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</template>
|
||||
</reserve-info>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<reserve-info ref="reserve"></reserve-info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const activityUtil = new typeUtil()
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data(){
|
||||
return{
|
||||
activityTypeList:[],
|
||||
siteList:[],
|
||||
pageForm: {
|
||||
searchName: "u.username",
|
||||
searchKeyword: "",
|
||||
isAudit: false,
|
||||
time: "",
|
||||
},
|
||||
tableColumns: [
|
||||
{label: '场地名称', prop: 'site_name', sortable: true},
|
||||
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true},
|
||||
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true},
|
||||
{label: '开始时间', prop: 'reserve_start_time', sortable: true},
|
||||
{label: '结束时间', prop: 'reserve_end_time', sortable: true},
|
||||
{label: '联系电话', prop: 'reserve_person_phone'},
|
||||
// {label: '活动名称', prop: 'reserve_activity'},
|
||||
{label: '预约事由', prop: 'reserve_cause'},
|
||||
{label: '预约状态', prop: 'state_name'},
|
||||
],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue'),
|
||||
},
|
||||
methods:{
|
||||
openView(row){
|
||||
this.$refs.guava.view()
|
||||
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}"
|
||||
this.$refs.reserve.role = role
|
||||
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id
|
||||
this.$refs.reserve.backOptionShow = (role || backOptionShow)
|
||||
this.$refs.reserve.openView(row.id)
|
||||
},
|
||||
doProcess(row){
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.auditInfo.openView(row.id, 'fghsh')
|
||||
this.formData={
|
||||
id: row.id,
|
||||
unionOption: null,
|
||||
}
|
||||
},
|
||||
async doReview(row){
|
||||
const valid = await this.$refs['auditForm'].validate()
|
||||
if (!valid) return
|
||||
this.formData.reserve_state = row ? 6118 : 6108
|
||||
this.formData.isPass = row
|
||||
const resp = await $.post('/platform/activity/site/unionProcess/doProcess', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.notifySuccess(resp.msg)
|
||||
this.pageData()
|
||||
}
|
||||
},
|
||||
async findAllOpenSite() {
|
||||
const {data} = await $.get("/platform/activity/site/apply/getAllSite")
|
||||
return data
|
||||
},
|
||||
},
|
||||
async created(){
|
||||
this.activityTypeList = await activityUtil.getAllType()
|
||||
this.siteList = await this.findAllOpenSite()
|
||||
this.pageData();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,228 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">月份:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
@change="doSearch"
|
||||
v-model="pageForm.time"
|
||||
placeholder="请选择月份"
|
||||
type="month"
|
||||
value-format="yyyy-MM">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名工号:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||
style="width: 100%"
|
||||
@keyup.enter.native="doSearch">
|
||||
<el-select v-model="pageForm.searchName" slot="prepend"
|
||||
placeholder="查询类型"
|
||||
style="width: 80px;">
|
||||
<el-option label="姓名" value="u.username"></el-option>
|
||||
<el-option label="工号" value="u.loginname"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="search-item">-->
|
||||
<!-- <div class="search-item-label">场地名称:</div>-->
|
||||
<!-- <div class="search-item-option">-->
|
||||
<!-- <el-input @keyup.enter.native="doSearch" clearable clearable-->
|
||||
<!-- placeholder="请输入场地名称"-->
|
||||
<!-- style="width: 100%"-->
|
||||
<!-- v-model="pageForm.siteName">-->
|
||||
<!-- </el-input>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <div class="search-item">-->
|
||||
<!-- <div class="search-item-label">场地类型:</div>-->
|
||||
<!-- <div class="search-item-option">-->
|
||||
<!-- <el-select v-model="pageForm.siteType" placeholder="场地类型"-->
|
||||
<!-- clearable filterable style="width: 100%">-->
|
||||
<!-- <el-option v-for="item in activityTypeList" :label="item.text" :value="item.value"></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="预约列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" class="mr10" size="small" v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
|
||||
align="center"
|
||||
header-align="center">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
|
||||
<template scope="{row}" v-if="column.prop==='state_name'">
|
||||
<!--<span :style="'color:'+row.state_color">{{row.state_name}}</span>-->
|
||||
<span v-if="[0].includes(row.stateaudittype)"
|
||||
style="color: #e6a23c">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==3" style="color: #67c23a">{{row.state_name}}</span>
|
||||
<span v-if="row.stateaudittype==1" style="color: #f56c6c">{{row.state_name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right"
|
||||
width="200px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button v-if="row.reserve_state == 6118" @click="doProcess(row)" size="mini" type="primary">审核</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit style="padding: 0 10%">
|
||||
<reserve-info ref="auditInfo">
|
||||
<template #handle>
|
||||
<el-tab-pane label="校工会审核" name="xghsh">
|
||||
<el-form :model="formData" label-suffix=":" label-width="100px" ref="auditForm">
|
||||
<el-form-item label="审核人">
|
||||
${@shiro.getPrincipalProperty('username')}
|
||||
</el-form-item>
|
||||
<el-form-item label="审核时间">
|
||||
{{moment().format('YYYY-MM-DD')}}
|
||||
</el-form-item>
|
||||
<el-form-item :rules="[{required: true, message: '请输入审核意见', trigger: ['blur']}]"
|
||||
label="审核意见"
|
||||
prop="schoolOption">
|
||||
<el-input maxlength="300" rows="5" type="textarea"
|
||||
v-model="formData.schoolOption"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row style="margin: 40px 0;text-align: right">
|
||||
<el-button type="danger" @click="doReview(false)">拒绝</el-button>
|
||||
<el-button type="primary" @click="doReview(true)">通过</el-button>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</template>
|
||||
</reserve-info>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<reserve-info ref="reserve"></reserve-info>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
|
||||
const activityUtil = new typeUtil()
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
activityTypeList:[],
|
||||
siteList:[],
|
||||
pageForm: {
|
||||
searchName: "u.username",
|
||||
searchKeyword: "",
|
||||
isAudit: false,
|
||||
time: "",
|
||||
},
|
||||
tableColumns: [
|
||||
{label: '场地名称', prop: 'site_name', sortable: true},
|
||||
{label: '预约人姓名', prop: 'reserve_person_username', sortable: true},
|
||||
{label: '预约人部门', prop: 'reserve_person_unitname', sortable: true},
|
||||
{label: '开始时间', prop: 'reserve_start_time', sortable: true},
|
||||
{label: '结束时间', prop: 'reserve_end_time', sortable: true},
|
||||
{label: '联系电话', prop: 'reserve_person_phone'},
|
||||
// {label: '活动名称', prop: 'reserve_activity'},
|
||||
{label: '预约事由', prop: 'reserve_cause'},
|
||||
{label: '预约状态', prop: 'state_name'},
|
||||
],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'reserve-info': httpVueLoader('/components/activity/site/ReserveInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
const role = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}"
|
||||
this.$refs.reserve.role = role
|
||||
const backOptionShow = "${@shiro.getPrincipalProperty('id')}" === row.reserve_person_id
|
||||
this.$refs.reserve.backOptionShow = (role || backOptionShow)
|
||||
this.$refs.reserve.openView(row.id)
|
||||
},
|
||||
doProcess(row){
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.auditInfo.openView(row.id, 'xghsh')
|
||||
this.formData={
|
||||
id: row.id,
|
||||
schoolOption: null,
|
||||
}
|
||||
},
|
||||
async doReview(row){
|
||||
const valid = await this.$refs['auditForm'].validate()
|
||||
if (!valid) return
|
||||
this.formData.reserve_state = row ? 6138 : 6128
|
||||
this.formData.isPass = row
|
||||
const resp = await $.post('/platform/activity/site/partyMemberHomeAudit/doProcess', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$refs.guava.index()
|
||||
this.notifySuccess(resp.msg)
|
||||
this.pageData()
|
||||
}
|
||||
},
|
||||
doInstructions() {
|
||||
$.post(location.href + "/doReview", this.formData, (res) => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData();
|
||||
this.$refs.guava.index()
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
async findAllOpenSite() {
|
||||
const {data} = await $.get("/platform/activity/site/apply/getAllSite")
|
||||
return data
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.activityTypeList = await activityUtil.getAllType()
|
||||
this.siteList = await this.findAllOpenSite()
|
||||
this.pageData();
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user