This commit is contained in:
@jyuhsin
2024-09-23 15:10:51 +08:00
parent 8563c1296b
commit 335d2603ba
12 changed files with 988 additions and 7 deletions
@@ -0,0 +1,386 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
[v-cloak] {
display: none !important;
}
#app {
max-height: 100vh;
opacity: 0;
}
.header {
height: 400px;
max-height: 400px;
background-color: white
}
.body {
background-color: white;
margin-top: 6px;
height: calc(100vh - (400px + 6px + 26px + 70px));
max-height: calc(100vh - (400px + 6px + 26px + 70px));
padding: 10px;
}
.footer {
background-color: white;
margin-top: 6px;
width: 100%;
height: 70px;
display: flex;
align-items: center;
}
.meeting_info {
height: 200px;
width: 86%;
margin: 0 auto;
transform: translateY(-60%);
background-color: white;
box-shadow: 0 8px 12px #ebedf0;
padding: 10px 10px;
border-radius: 10px;
}
.header .text {
color: white;
text-align: center;
letter-spacing: 3px;
line-height: 40px;
}
.meeting_info .meeting_name {
text-align: center;
font-weight: bold;
}
.meeting_info .meeting_address {
text-align: center;
color: grey;
font-size: 14px;
}
.van-button--block {
margin: 0 auto;
width: 170px;
}
.tag {
color: #1867b0;
font-weight: bold;
font-size: 20px;
margin-right: 6px;
}
.span_text {
color: grey;
font-size: 14px;
}
.van-col {
font-size: 14px;
}
.van-col span {
color: grey;
font-size: 14px;
}
.icon {
width: 6.4em;
height: 6.4em;
display: inline-block;
vertical-align: middle;
font-size: 10px;
-webkit-mask-size: 100%;
-webkit-mask-position: 50% 50%;
background-color: currentColor;
}
.icon_ok {
-webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E);
color: #07c160;
}
.icon_no {
-webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E);
color: #fa5151;
}
.weui-msg__text-area {
margin-bottom: 32px;
padding: 0 32px;
-webkit-box-flex: 1;
line-height: 1.6;
}
.weui-msg__text-area .weui-msg__title {
margin-bottom: 16px;
font-weight: 500;
font-size: 22px;
color: rgba(0, 0, 0, 0.9);
}
.weui-msg__desc {
font-size: 17px;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
margin-bottom: 16px;
}
.meeting_index {
width: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background-color: lightgrey;
color: white;
font-size: 20px;
font-weight: bold;
}
.meeting_peri {
width: 90%;
line-height: 19px;
margin-left: 10px
}
.meeting_primary {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
padding-right: 10px;
}
.weui-btn_primary:not(.weui-btn_disabled):visited {
color: #fff;
}
.weui-btn_primary {
background-color: #1867b0;
}
.weui-btn {
position: relative;
display: block;
width: 184px;
margin-left: auto;
margin-right: auto;
padding: 8px 24px;
box-sizing: border-box;
font-weight: 700;
font-size: 17px;
text-align: center;
text-decoration: none;
color: #fff;
line-height: 1.88235294;
border-radius: 8px;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.body .van-cell {
padding: 0;
}
.body .van-field__control--custom {
justify-content: flex-end;
}
.body .van-field__label {
min-width: 170px;
}
</style>
<div id="app">
<div v-if="isCanAudit">
<div class="header">
<div style="height: 300px; background-color: #1867b0; border-radius: 0 0 16% 16%;">
<div class="text">会议通知</div>
</div>
<div class="meeting_info">
<div class="meeting_name">{{meetingInfo.meetingName}}</div>
<div class="meeting_address">{{meetingInfo.location}}</div>
<div style="position: relative; top: 55px">
<van-row>
<van-col span="24"><span>会议类型:</span>{{typeName}}</van-col>
</van-row>
<div style="position: relative; top: 30px">
<van-row>
<van-col span="24">
<span style="color: grey; font-size: 14px;">会议时间:</span>
{{moment(meetingInfo.startTime).format('YYYY-MM-DD HH:mm')}}
</van-col>
</van-row>
<van-row>
<van-col span="24">
<span style="color: grey; font-size: 14px;">结束时间:</span>
{{moment(meetingInfo.endTime).format('YYYY-MM-DD HH:mm')}}
</van-col>
</van-row>
</div>
</div>
</div>
</div>
<div class="body">
<div><span class="tag">|</span>会议名称</div>
<div style="overflow-y: auto; height: 100%; font-size: 13px;margin-top: 16px">
<div class="meeting_primary" v-for="(item,index) in meetingInfo.meetingTimePeriods">
<van-field name="checkbox">
<template #label>
<div class="meeting_peri">
<div>{{item.timePeriodName}}</div>
<div>{{moment(item.startTime).format('YYYY-MM-DD HH:mm')}}</div>
</div>
</template>
<template #input>
<van-checkbox v-model="item.canJoin" shape="square"></van-checkbox>
</template>
</van-field>
</div>
</div>
</div>
<div class="footer">
<van-button @click="canJoin(false)" block color="#1867b0" round type="primary">
不参加
</van-button>
<van-button @click="canJoin(true)" block color="#1867b0" round type="primary">
参加
</van-button>
</div>
</div>
<div style="text-align: center; padding-top: calc(100% - 50%)" v-cloak v-else>
<div style="margin-bottom: 32px;">
<span :class="isIncorrect === true ? 'icon icon_ok' : 'icon icon_no'"></span>
</div>
<div class="weui-msg__text-area">
<h2 class="weui-msg__title">{{isIncorrect === true ? '操作成功' : '温馨提示'}}</h2>
<p class=".weui-msg__desc">{{incorrectMag}}</p>
</div>
<p style="margin-top: 190px">
<span @click="back" class="weui-btn weui-btn_primary" role="button">点击返回</span>
</p>
</div>
<van-dialog v-model="notJoinShow" title="提示" show-cancel-button :before-close="onBeforeClose">
<van-field
v-model="notJoinReason"
rows="2"
autosize
label="不参加原因"
type="textarea"
maxlength="100"
placeholder="请输入不参加原因"
show-word-limit
></van-field>
</van-dialog>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURI(r[2]);
return null;
}
const vue = new Vue({
el: '#app',
data() {
return {
notJoinShow: false,
notJoinReason: '',
meetingInfo: {},
isCanAudit: true,
incorrectMag: '',
meetingId: '',
mtpId: '',
isIncorrect: true,
typeName: '',
isJoin: true,
}
},
methods: {
async pageData() {
const res = await $.post('/mobile/meeting/notify/getMeetingInfo', {
meetingId: this.meetingId,
})
if (res.code === 0) {
this.meetingInfo = res.data
const typeList = await meetUtil.getAllMeetingType()
const type = typeList.find(o => o.id === this.meetingInfo.typeId)
this.typeName = type !== undefined ? type.meetingTypeName : ''
} else {
this.isCanAudit = false
this.incorrectMag = res.msg
this.isIncorrect = false
}
$('#app').css('opacity', '1')
},
async canJoin(type) {
this.isJoin = type
if(!type) {
const joinArray = this.meetingInfo.meetingTimePeriods.filter(o => o.canJoin === true)
if(joinArray.length === 0) {
this.$modal.alert('请选择不参加的时间段')
return
}
this.notJoinShow = true
} else {
const confirm = await vant.Dialog.confirm({
title: '提示',
message: '您确认要参加吗?',
})
if (confirm === "confirm") {
await this.joinDo()
}
}
},
async onBeforeClose(action, done) {
if (action === "confirm") {
if (this.notJoinReason) {
await this.joinDo()
} else {
this.$modal.msg('请填写不参加原因')
return done(false)
}
} else {
done(true)
}
},
async joinDo() {
const ids = this.meetingInfo.meetingTimePeriods.filter(o => o.canJoin === true).map(o => o.id)
const resp = await $.post('/mobile/meeting/notify/joinDo', {
isJoin: this.isJoin,
notJoinReason: this.notJoinReason,
ids: JSON.stringify(ids),
meetingId: this.meetingInfo.id
})
this.$modal.msg(resp.msg)
this.notJoinShow = false
},
async readDo() {
await $.post('/mobile/meeting/notify/readDo', {meetingId: this.meetingInfo.id})
},
back() {
const str = this.incorrectMag === '你不是当前会议人员' ? 'http://' + window.location.host : '/mobile/meeting/mine/go_sign?meetingId=' + this.meetingId + '&mtpId=' + this.mtpId
location.href = str
},
},
async created() {
this.meetingId = getQueryString('meetingId')
await this.pageData()
await this.readDo()
}
})
</script>
<!--#
}
#-->
@@ -62,7 +62,8 @@ layout("/layouts/platform.html"){
<el-table-column label="操作" width="300px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini">查看</el-button>
<el-button @click="sendMsg(row)" size="mini" type="primary">通知</el-button>
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
<el-button @click="doDelete(row.id)" size="mini" type="danger">删除</el-button>
</template>
@@ -97,7 +98,26 @@ layout("/layouts/platform.html"){
}
},
methods: {
async sendMsg(row) {
const resp = await $.post(loc() + '/getUserCount', {id: row.id})
if(resp.code === 0) {
const confirm = await this.$confirm('此操作将给' + resp.data + '位人员发送短信,请确认?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const resp = await $.post(loc() + '/sendMsg', {id: row.id})
if(resp.code === 0) {
this.$message.success(resp.msg)
} else {
this.$message.warning(resp.msg)
}
}
} else {
this.$message.warning(resp.msg)
}
},
openView(row) {
const {id, notifyId, hold} = row
window.location.href = '/platform/meeting/manage/createMeeting?notifyId=' + notifyId + "&hold=" + true + "&id=" + id
@@ -56,7 +56,7 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-col>
<el-col :span="12">
<!--<el-form-item label="会议时间" prop="meetingTime">
<el-form-item label="会议时间" prop="meetingTime">
<el-date-picker end-placeholder="结束日期"
format="yyyy-MM-dd HH:mm:ss"
range-separator="至" start-placeholder="开始日期"
@@ -66,8 +66,8 @@ layout("/layouts/platform.html"){
v-model="formData.meetingTime"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>-->
<el-form-item label="会议时间" prop="meetTime">
</el-form-item>
<!--<el-form-item label="会议时间" prop="meetTime">
<el-date-picker :disabled="hold"
format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择会议时间"
@@ -76,7 +76,7 @@ layout("/layouts/platform.html"){
v-model="formData.meetTime"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-form-item>-->
</el-col>
</el-row>
@@ -0,0 +1,214 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.timeTable {
color: red;
}
</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
placeholder="选择年份"
style="width: 100%" type="year"
v-model="pageForm.year"
format="yyyy"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">会议名称:</div>
<div class="search-item-option">
<el-select @change="doSearch" clearable
filterable="true"
placeholder="请输入会议名称"
style="width: 100%;" v-model="pageForm.meetingId">
<el-option :label="item.meetingName" :value="item.id" v-for="item in meetingList"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable="true" filterable="true"
@change="flushUnits" @clear="flushUnits">
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;" clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></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 class="mt10" shadow="never">
<table-tool :app="this" label="参会人员信息">
<template #func>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
align="center" header-align="center" ref="meetingTable">
<el-table-column label="序号" type="index" width="80">
<template scope="scope">
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column prop="username" label="姓名" header-align="center" align="center"
sortable></el-table-column>
<el-table-column prop="loginname" label="工号" header-align="center" align="center"
sortable></el-table-column>
<el-table-column prop="sex" label="性别" header-align="center" align="center"
sortable></el-table-column>
<el-table-column prop="mobile" label="联系方式" header-align="center" align="center"
sortable></el-table-column>
<el-table-column prop="unitname" label="所属单位" header-align="center" align="center"
sortable show-overflow-tooltip></el-table-column>
<el-table-column prop="unionname" label="所属工会" header-align="center" align="center"
sortable show-overflow-tooltip></el-table-column>
<el-table-column prop="isReadByMsg" label="是否已读" header-align="center" align="center"
sortable>
<template scope="scope">
<span v-if="scope.row.isReadByMsg === true || scope.row.isReadByMsg === 1" style="color: #0e9558">已读</span>
<span v-else>未读</span>
</template>
</el-table-column>
<el-table-column prop="isJoinByMsg" label="选择时间段" header-align="center" align="center"
sortable>
<template scope="scope">
<el-link type="primary" @click="openView(scope.row)">{{scope.row.isJoinByMsg}}</el-link>
</template>
</el-table-column>
<el-table-column label="操作" header-align="center" align="center">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="openView(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount">
</el-pagination>
</el-card>
</template>
<template #edit>
<el-table :data="leaveTableData" align="center" header-align="center">
<el-table-column prop="timePeriodName" label="会议名称" header-align="center" align="center"
sortable show-overflow-tooltip></el-table-column>
<el-table-column prop="startTime" label="开始时间" header-align="center" align="center"
sortable show-overflow-tooltip></el-table-column>
<el-table-column prop="endTime" label="结束时间" header-align="center" align="center"
sortable show-overflow-tooltip></el-table-column>
<el-table-column prop="isJoinByMsg" label="是否参加" header-align="center" align="center"
sortable show-overflow-tooltip>
<template scope="scope">
<span v-if="scope.row.isJoinByMsg === false || scope.row.isJoinByMsg === 0" style="color: red">不参加</span>
<span v-else-if="!scope.row.isJoinByMsg">未选择</span>
<span v-else>参加</span>
</template>
</el-table-column>
<el-table-column prop="notJoinReason" label="不参加原因" header-align="center" align="center"
sortable show-overflow-tooltip>
<template scope="scope">
<span v-if="scope.row.notJoinReason">{{scope.row.notJoinReason}}</span>
<span v-else>暂无</span>
</template>
</el-table-column>
</el-table>
</template>
</guava>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
window.vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
meetingList: [],
unions: [],
units: [],
leaveTableData: [],
}
},
methods: {
async openView(row) {
const resp = await $.post(loc() + "/getLeaveInfoByUser", {
meetingId: row.meetingId,
userId: row.userId
})
if(resp.code === 0) {
this.leaveTableData = resp.data
this.$refs.guava.edit()
} else {
this.$message.warning(resp.msg)
}
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
async getMeetingList() {
const {data} = await $.post(loc() + "/getMeetingList", {year: this.pageForm.year})
this.meetingList = data
if (this.meetingList.length > 0) {
this.$set(this.pageForm, "meetingId", this.meetingList[0].id)
await this.pageData()
}
},
async pageData() {
const resp = await $.post(loc() + "/pageData", this.pageForm)
if (resp.code === 0) {
this.tableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
} else {
this.$message.warning(resp.msg)
}
}
},
async created() {
this.$set(this.pageForm, 'year', new Date().getFullYear() + '')
this.unions = await getUnions()
this.flushUnits()
await this.getMeetingList()
await this.pageData()
}
})
</script>
<!--#
}
#-->