Files
UNION_HUTB/target/classes/views/mobile/activity/site/audit.html
T
2026-09-09 09:14:28 +08:00

551 lines
19 KiB
HTML

<!--#
layout("/mobile/platform.html"){
#-->
<style>
.van-hairline--top-bottom::after, .van-hairline-unset--top-bottom::after {
border: 0;
}
.van-index-bar__sidebar {
display: none;
}
.van-doc-card {
margin: 14px;
padding: 12px 12px 12px 12px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 8px 12px #ebedf0;
line-height: 20px;
font-size: 12px;
position: relative;
}
.in-sheet-card {
display: flex;
justify-content: space-between;
line-height: 24px;
}
.van-divider {
margin: 6px 0 6px 0px;
border-color: lightgray;
}
.van-button--small {
border-radius: revert;
width: 40%;
height: 30px;
}
.van-col {
line-height: 20px;
}
.title_span {
font-size: 16px;
font-weight: bold;
position: absolute;
left: -1px;
top: 11px;
color: #1867b0;
}
.title {
font-size: 13px;
font-weight: bold;
flex: 1;
overflow: hidden;
white-space: nowrap;
}
.cus_overflow {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.showMore {
color: #1867b0;
}
.cus_popup {
width: 70%;
height: 50%;
/*border-radius: 10px;*/
padding: 10px 14px;
font-size: 15px;
/*background-color: #E5E7E9;
background-image: url("https://www.transparenttextures.com/patterns/green-cup.png");*/
}
.cus_icon {
z-index: 10000;
color: white;
font-size: 35px;
position: fixed;
top: 81%;
left: 44%;
}
.userPopup {
max-height: 96%;
height: 96%;
background-color: #f6f7f9;
font-size: 14px;
position: absolute;
}
.van-row div {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.firstName {
width: 45px;
background-color: lightgrey;
border-radius: 45px;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
color: white;
}
.content {
height: 86%;
overflow: auto;
}
.no_content {
height: 100%;
overflow: auto;
}
.van-action-sheet__content {
height: 88%;
}
.van-dialog__header {
padding-top: 8px;
}
.van-dialog__confirm {
color: #1867b0;
}
.van-field__label {
width: 6em;
}
.cus_cell {
padding: 4px 0px;
font-size: 12px;
}
.van-checkbox-group {
max-height: 260px;
overflow-y: auto;
margin-top: 6px;
}
.unit {
display: inline-block;
max-width: 160px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
position: absolute;
}
.cus_button {
border-radius: 8px;
height: 26px;
}
.van-dropdown-menu__item {
flex: auto;
}
.audit_icon {
font-size: 24px;
/*position: absolute;*/
font-weight: bolder;
right: 0;
top: 5px;
}
.van-cell__value--alone {
text-align: center;
}
</style>
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<!--top栏-->
<van-nav-bar
title="场地预约审核"
left-arrow
placeholder
fixed
@click-left="history.go(-1)"
safe-area-inset-top
></van-nav-bar>
<!--筛选框-->
<div class="search-fixed">
<van-search
v-model="pageForm.searchKeyword"
shape="round"
maxlength="10"
@search="doSearch"
placeholder="请输入场地名称、场地地点进行查询"
>
</van-search>
<van-dropdown-menu>
<!--<van-dropdown-item v-model="pageForm.meetingTime" :options="meetingTimeList"
@change="doSearch"></van-dropdown-item>-->
<van-dropdown-item v-model="pageForm.typeId" :options="typeList"
@change="doSearch"></van-dropdown-item>
</van-dropdown-menu>
</div>
<!--列表-->
<div style="margin-top: 116px">
<van-list
v-model="loading"
:finished="finished" :immediate-check="false"
:finished-text="tableData.length>0?'没有更多了':''"
@load="onLoad">
<div class="van-doc-card" v-for="o in tableData">
<div @click="openView(o.id, o.modulename)">
<div style="display: flex; justify-content: space-between">
<div style="width: 74%">
<div class="van-ellipsis title">
<span class="title_span">|</span>
<span>{{o.name}}</span>
</div>
<div style="color: grey">{{o.address}}</div>
</div>
<div style="color: #1867b0;">
{{o.meetingtypename}}
</div>
</div>
<van-divider></van-divider>
<div style="margin-top: 10px">
<van-row>
<van-col span="12"><span style="color: grey">&emsp;联系人:</span>
{{o.contact_person}}
</van-col>
</van-row>
<van-row>
<van-col span="12"><span style="color: grey">联系方式:</span>
{{o.contact_phone}}
</van-col>
</van-row>
</div>
<div style="display: flex; justify-content: space-between">
<!--<div class="cus_overflow" style="line-height: 20px; width: 83%">
<span style="color: grey">开放时段:</span>
{{o.meetingdescription}}
</div>-->
<!--<span class="showMore" @click.stop="desc = o.meetingdescription; popupShow = true">查看更多</span>-->
</div>
<div style="display: flex; justify-content: flex-end; margin-top: 4px">
<div>
<van-button @click.stop="getAuditList(o)" class="cus_button"
type="primary" size="small" color="#1867b0"
style="margin-right: 8px; width: auto;">已审{{o.audit}}
</van-button>
<van-button @click.stop="openView(o.id, o.modulename)" class="cus_button"
type="primary" size="small" color="#1867b0"
style="margin-right: 8px; width: auto;">未审{{o.no_audit}}
</van-button>
</div>
</div>
</div>
</div>
</van-list>
<van-empty
v-if="mLoading==false&&tableData.length==0"
class="custom-image"
image="/none.svg"
description="暂无数据"
></van-empty>
</div>
<!--弹出框-->
<van-popup v-model:show="popupShow" class="cus_popup">
<pre style="margin: 0; white-space: break-spaces">{{desc}}</pre>
</van-popup>
<van-icon @click="popupShow = false" class="cus_icon" v-if="popupShow" name="close"></van-icon>
<!--审核人员-->
<van-action-sheet v-model:show="userShow" :title="queryType === 'notAudit' ? '预约列表' : '预约列表'"
class="userPopup" @close="popClose">
<div :class="queryType == 'notAudit' ? 'content' : 'no_content'">
<div v-if="queryType === 'notAudit'" style="text-align: right; width: 96%">
<van-tag color="#1867b0" style="margin-right: 10px" @click="cancelAll" size="large" type="primary">
取消选中
</van-tag>
<van-tag color="#1867b0" @click="allIn" size="large" type="primary">全选</van-tag>
</div>
<div class="van-doc-card in-sheet-card" v-for="(item, i) in userList">
<!--<div style="display: flex; justify-content: space-between">
<div style="width: 80%">
<span>{{moment(item.startTime).format('YYYY-MM-DD HH:mm') + ' ~ ' + moment(item.endTime).format('YYYY-MM-DD HH:mm')}}</span>
</div>
<div v-if="queryType === 'notAudit'">
<span @click="checkAll(i)">全选</span>
<span @click="toggleAll(i)" style="margin-left: 4px">反选</span>
</div>
</div>-->
<div style="width: 90%">
<div>
<span style="display: inline-block; min-width: 40px; max-width: 76px">{{item.username}}</span>
<span style="display: inline-block; width: 20px">{{item.sex}}</span>
<span style="display: inline-block; width: 76px">{{item.loginname}}</span>
<span class="unit">{{item.unitname}}</span>
</div>
<div style="width: 94%; display: flex">
<div style="color: grey;">预约时间:</div>
<div>
<div v-for="(d,index) in item.concat_day.split(',')">{{getTime(item, d)}}</div>
</div>
</div>
<!--<div style="width: 94%;">
<span style="color: grey">参加人员:</span><span>{{item.joinUser}}</span>
</div>-->
<div style="width: 94%;">
<span style="color: grey">预约事由:</span><span>{{item.reserve_cause}}</span>
</div>
<div style="width: 94%;">
<span style="color: grey">审核状态:</span><span>{{item.stateName}}</span>
</div>
<div v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('xghng')||@shiro.hasRole('A06')}"
style="width: 94%;">
<span style="color: grey">反馈意见:</span><span>{{item.back_option}}</span>
</div>
</div>
<van-checkbox-group v-model="result" ref="checkboxGroup">
<van-cell-group>
<van-cell
clickable class="cus_cell"
:key="item.id"
@click="toggle(i)">
<van-icon class="audit_icon" color="green"
v-if="queryType === 'hasAudit' && item.auditState == true"
name="passed"></van-icon>
<van-icon class="audit_icon" color="grey"
v-if="queryType === 'hasAudit' && item.auditState == false"
name="close"></van-icon>
<template #right-icon v-if="queryType === 'notAudit'">
<van-checkbox :name="item.id" ref="checkboxes"></van-checkbox>
</template>
</van-cell>
</van-cell-group>
</van-checkbox-group>
</div>
<!--<div v-if="queryType === 'notAudit'" style="display: flex; justify-content: space-evenly; position: fixed; bottom: 50px; width: 95%">
<van-button @click="audit('all', 'reject')" color="#ff976a" size="small" style="height: 38px">一键全部驳回</van-button>
<van-button @click="audit('all', 'pass')" color="#1867b0" size="small" style="height: 38px">一键全部通过</van-button>
</div>-->
</div>
<div style="position: absolute; bottom: 20px; width: 100%;z-index: 9999">
<div v-if="queryType === 'notAudit'" style="display: flex; justify-content: center">
<van-button @click="audit('many', 'reject')" color="#ff976a" size="small"
style="height: 38px;border-radius: 10px;margin-right: 20px">驳回
</van-button>
<van-button @click="audit('many', 'pass')" color="#1867b0" size="small"
style="height: 38px;border-radius: 10px">通过
</van-button>
</div>
</div>
</van-action-sheet>
<!--审核弹框-->
<van-dialog v-model:show="auditShow" @confirm="auditDo" title="温馨提示" show-cancel-button>
<div style="padding-top: 8px; text-align: center; font-size: 14px; color: #646566">{{str}}</div>
<van-divider style="margin: 12px 0 1px 0px;"></van-divider>
<van-field
v-model="reason"
rows="2"
label="审核意见:"
autosize
type="textarea"
maxlength="50"
placeholder="请输入审核意见"
show-word-limit
></van-field>
</van-dialog>
</div>
<script>
<!--# include("/platform/activity/includeJs/activityUtil.js"){} #-->
const siteTypeUtil = new typeUtil()
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
desc: '',
list: ['a', 'b'],
result: [],
reason: '',
auditShow: false,
popupShow: false,
userShow: false,
userList: [],
userClickList: [],
str: '',
type: '',
auditType: '',
queryType: '',
typeList: [],
meetingTimeList: [{text: '全部时间', value: null}, {text: '即将开始', value: 0}, {text: '已结束', value: 1}],
}
},
methods: {
getTime(o, day) {
const week = new Date(day).getDay()
const arr = ['日', '一', '二', '三', '四', '五', '六']
return moment(day).format('MM月DD日') + ' 周' + arr[week] + ' ' + o.start_time + '-' + o.end_time
},
async getAuditList(o) {
this.queryType = 'hasAudit'
const resp = await $.post('/mobile/activity/site/audit/getLeaveUser', {
siteId: o.id,
auditType: 'hasAudit',
})
if (resp.code === 0) {
this.userList = resp.data
this.userList.sort((a, b) => {
return b.auditState - a.auditState
})
this.userShow = true
}
},
cancelAll() {
this.$refs.checkboxes.forEach(item => item.toggle(false))
},
allIn() {
this.$refs.checkboxes.forEach(item => item.toggle(true))
},
checkAll(i) {
this.$refs.checkboxGroup[i].children.forEach(item => item.toggle(true))
},
toggleAll(i) {
this.$refs.checkboxGroup[i].children.forEach(item => item.toggle())
},
toggle(i) {
this.$refs.checkboxes[i].toggle();
},
async auditDo() {
let idList = this.result
if (this.type === 'all') {
idList = this.userList.map(o => o.id)
}
const resp = await $.post('/mobile/activity/site/audit/audit', {
ids: JSON.stringify(idList),
auditOpinion: this.reason,
isPass: this.auditType === 'pass'
})
if (resp.code === 0) {
vant.Toast(resp.msg)
this.doSearch()
} else {
vant.Toast('操作失败')
}
this.userShow = false
},
audit(type, auditType) {
this.type = type
this.auditType = auditType
if (type === 'many' && this.result.length === 0) {
vant.Toast('请先选择人员')
return
}
this.str = type === 'many' ? '您选择了' + this.result.length + '个人,请确认您的选择' : '您确定要一键全部审核吗?'
this.reason = auditType === 'pass' ? '同意' : '拒绝'
this.auditShow = true
},
async openView(id, modulename) {
this.queryType = 'notAudit'
this.userList = []
const resp = await $.post('/mobile/activity/site/audit/getLeaveUser', {
siteId: id,
moduleName: modulename,
auditType: 'canAudit',
})
if (resp.code === 0) {
this.userList = resp.data
this.userClickList = []
if (this.userList.length === 0) {
vant.Toast('暂无预约数据')
} else {
this.userShow = true
}
return
}
vant.Toast('系统错误,请联系管理员')
},
popClose() {
this.$nextTick(function () {
if (this.$refs.checkboxes !== undefined) {
this.$refs.checkboxes.forEach(item => item.toggle(false));
}
})
},
doSearch() {
this.pageForm.pageNumber = 1
this.tableData = []
this.finished = false
this.onLoad()
},
async onLoad() {
this.loading = true
$.post('/mobile/activity/site/audit/pageData', this.pageForm).then(res => {
if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
}
this.loading = false
})
},
},
async created() {
this.typeList = await siteTypeUtil.getAllType()
this.typeList.unshift({text: '全部场地类型'})
if (this.typeList && this.typeList.length > 0) {
this.$set(this.pageForm, "typeId", this.typeList[0].value)
}
this.$set(this.pageForm, "meetingTime", this.meetingTimeList[1].value)
this.onLoad()
}
})
</script>
<!--#
}
#-->