Files
UNION_NSI/target/classes/views/mobile/meeting/audit.html
T
2026-09-08 19:49:21 +08:00

504 lines
18 KiB
HTML

<!--#
layout("/mobile/platform.html"){
#-->
<style>
.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: 13px;
position: relative;
}
.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 {
height: 80%;
background-color: #f6f7f9;
font-size: 14px;
}
.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: 84%;
overflow: auto;
}
.van-dialog__header {
padding-top: 8px;
}
.van-dialog__confirm {
color: #1867b0;
}
.van-field__label {
width: 5em;
}
.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-top-right-radius: 16px;
border-bottom-left-radius: 16px;
height: 26px;
}
.audit_icon {
font-size: 24px;
position: absolute;
font-weight: bolder;
right: 0;
}
.van-dropdown-menu__item {
flex: auto;
}
</style>
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<!--top栏-->
<van-nav-bar
@click-left="history.go(-1)"
fixed
left-arrow
placeholder
safe-area-inset-top
title="会议请假审核"
></van-nav-bar>
<!--筛选框-->
<div class="search-fixed">
<van-search
@search="doSearch"
maxlength="10"
placeholder="请输入会议名称、会议地点进行查询"
shape="round"
v-model="pageForm.searchKeyword"
>
</van-search>
<van-dropdown-menu>
<van-dropdown-item :options="meetingTimeList" @change="doSearch"
v-model="pageForm.meetingTime"></van-dropdown-item>
<van-dropdown-item :options="typeList" @change="doSearch"
v-model="pageForm.typeId"></van-dropdown-item>
</van-dropdown-menu>
</div>
<!--列表-->
<div style="margin-top: 116px">
<van-list
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''" :immediate-check="false"
@load="onLoad"
v-model="loading">
<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: 70%">
<div class="van-ellipsis title">
<span class="title_span">|</span>
<span>{{o.meetingname}}</span>
</div>
<div style="color: grey">{{o.location}}</div>
</div>
<div style="color: #1867b0;">
{{o.meetingtypename}}
</div>
</div>
<div style="margin-top: 10px">
<van-row>
<span style="color: grey">会议时间:</span>
{{o.starttime}}
<!--<van-col span="12"><span style="color: grey">结束时间:</span></van-col>-->
</van-row>
<van-row>
<!--<van-col span="12">{{o.endtime}}</van-col>-->
</van-row>
</div>
<div style="display: flex; justify-content: space-between; margin-top: 8px;">
<div class="cus_overflow" style="line-height: 20px; width: 83%">
<span style="color: grey">会议描述:</span>
{{o.meetingdescription}}
</div>
<span @click.stop="desc = o.meetingdescription; popupShow = true" class="showMore">查看更多</span>
</div>
<van-divider></van-divider>
<div style="display: flex; justify-content: flex-end; margin-top: 4px">
<div>
<van-button @click.stop="getAuditList(o)" class="cus_button"
color="#1867b0" size="small" style="margin-right: 8px; width: auto;"
type="primary">已审{{o.audit}}
</van-button>
<van-button @click.stop="openView(o.id, o.modulename)" class="cus_button"
color="#1867b0" size="small" style="margin-right: 8px; width: auto;"
type="primary">未审{{o.no_audit}}
</van-button>
</div>
</div>
</div>
</div>
</van-list>
<van-empty
class="custom-image"
description="暂无数据"
image="/none.svg"
v-if="mLoading==false&&tableData.length==0"
></van-empty>
</div>
<!--弹出框-->
<van-popup class="cus_popup" v-model:show="popupShow">
<pre style="margin: 0; white-space: break-spaces">{{desc}}</pre>
</van-popup>
<van-icon @click="popupShow = false" class="cus_icon" name="close" v-if="popupShow"></van-icon>
<!--审核人员-->
<van-action-sheet :title="queryType === 'notAudit' ? '请假人员列表' : '请假人员列表'" @close="popClose" class="userPopup"
v-model:show="userShow">
<div class="content">
<div class="van-doc-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>-->
<span>{{'会议时间:' + moment(item.startTime).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="margin-top: 4px">
<van-row>
<van-col span="24">
会议名称:
<van-tag size="medium" type="primary">{{item.timePeriodName}}</van-tag>
</van-col>
</van-row>
</div>
<van-checkbox-group ref="checkboxGroup" v-if="item.users !== null" v-model="result">
<van-cell-group>
<van-cell
:key="obj.id"
@click="toggle(i, index)" class="cus_cell"
clickable
v-for="(obj, index) in item.users">
<span style="display: inline-block; width: 40px">{{obj.username}}</span>
<span style="display: inline-block; width: 20px">{{obj.sex}}</span>
<span style="display: inline-block; width: 60px">{{obj.loginname}}</span>
<span class="unit">{{obj.unitname}}</span>
<van-icon class="audit_icon" color="green" name="passed"
v-if="queryType === 'hasAudit' && obj.auditState === true"></van-icon>
<van-icon class="audit_icon" color="grey" name="close"
v-if="queryType === 'hasAudit' && obj.auditState === false"></van-icon>
<template #right-icon v-if="queryType === 'notAudit'">
<van-checkbox :name="obj.id" ref="checkboxes"></van-checkbox>
</template>
</van-cell>
</van-cell-group>
</van-checkbox-group>
<div style="margin-top: 4px; text-align: center" v-else>暂无请假人员</div>
</div>
<div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 56px; width: 95%"
v-if="queryType === 'notAudit'">
<van-button @click="audit('many', 'reject')" color="#ff976a" size="small" style="height: 38px">驳回
</van-button>
<van-button @click="audit('many', 'pass')" color="#1867b0" size="small" style="height: 38px">通过
</van-button>
</div>
<div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 10px; width: 95%"
v-if="queryType === 'notAudit'">
<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>
</van-action-sheet>
<!--审核弹框-->
<van-dialog @confirm="auditDo" show-cancel-button title="温馨提示" v-model:show="auditShow">
<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
autosize
label="审核意见:"
maxlength="50"
placeholder="请输入审核意见"
rows="2"
show-word-limit
type="textarea"
v-model="reason"
></van-field>
</van-dialog>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
var 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: {
async getAuditList(o) {
this.queryType = 'hasAudit'
const resp = await $.post('/mobile/meeting/audit/getLeaveUser', {
meetingId: o.id,
auditType: 'hasAudit',
})
if (resp.code === 0) {
this.userList = resp.data
this.userList.forEach(item => {
if (item.users && item.users.length > 1) {
item.users.sort((a, b) => {
return b.auditState - a.auditState
})
}
})
this.userShow = 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, index) {
if (i > 0) {
let length = 0
for (let m = 0; m < i; m++) {
length += this.userList[m].users.length
}
index = length + index
}
this.$refs.checkboxes[index].toggle();
},
async auditDo() {
let idList = this.result
if (this.type === 'all') {
this.userList.forEach(item => {
if (item.users !== null && item.users !== undefined) {
idList = idList.concat(item.users.map(o => o.id))
}
})
}
const resp = await $.post('/mobile/meeting/audit/audit', {
tpuIds: JSON.stringify(idList),
auditOpinion: this.reason,
isPass: this.auditType === 'pass'
})
if (resp.code === 0) {
this.doSearch()
}
vant.Toast(resp.msg)
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/meeting/audit/getLeaveUser', {
meetingId: 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/meeting/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 meetUtil.getAllMeetingType()
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>
<!--#
}
#-->