Files
UNION_NSI/target/classes/views/platform/activity/school/ActivityRemind.html
T
2026-09-08 19:49:21 +08:00

319 lines
14 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" class="platform" 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-input v-model="pageForm.name" placeholder="请输入活动名称" clearable></el-input>-->
<el-select v-model="pageForm.activityId" placeholder="请选择活动项目" filterable clearable
style="width: 100%">
<el-option
v-for="item in activitys"
:key="item.id"
:label="item.name"
: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 v-model="pageForm.eventId" placeholder="请选择活动项目" filterable clearable
style="width: 100%">
<el-option
v-for="item in events"
:key="item.id"
:label="item.allname"
:value="item.id">
</el-option>
</el-select>
</div>
</div>-->
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="活动信息" :app="this"></table-tool>
<el-table :data="tableData" style="width: 100%;margin-bottom: 20px" row-key="id"
@sort-change="pageOrder" v-loading="tableLoading" :size="tableSize" 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"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable">
<template v-if="column.prop=='events'" scope="{row}">
<span>{{row.allName}}</span>
</template>
<template v-else-if="column.prop=='gameStyle'" scope="{row}">
<span>{{activity.school.gameStyle[row.gameStyle]}}</span>
</template>
<template v-else-if="column.prop=='startTime'" scope="{row}">
{{moment(row.startTime).format('YYYY-MM-DD')}} -
{{moment(row.endTime).format('YYYY-MM-DD')}}
</template>
<template v-else-if="column.prop=='state'"
scope="{row:{close,applyStartTime,applyEndTime,startTime,endTime}}">
<div v-html="activity.school.getStatus(close,applyStartTime,applyEndTime,startTime,endTime)"></div>
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作" width="150px">
<template scope="{row}">
<el-dropdown @command="dropdownCommand">
<el-button size="mini" :loading="row.loading">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-if="moment(row.applyEndTime).valueOf() >= moment().valueOf() && moment().valueOf() >= moment(row.applyStartTime).valueOf()"
:command="{type:'remind',row}">
发送提醒
</el-dropdown-item>
<el-dropdown-item :command="{type:'view',row}">
查看
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit>
<vi-title title="发送提醒"></vi-title>
<el-divider content-position="right">
<el-button @click="sendAllRemind" type="primary" size="mini"><i class="el-icon-position"></i> 一键发送提醒
</el-button>
</el-divider>
<el-table :data="unionData" style="width: 100%;margin-bottom: 20px" row-key="id" v-loading="tableLoading"
class="vi-table">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column type="expand" class="info">
<template slot-scope="{row}">
<el-card class="box-card">
<el-table :data="row.users" style="width: 100%;margin-bottom: 20px" row-key="id" border
stripe :size="tableSize" 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 applyColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable">
<template scope="{row}" v-if="column.prop=='divisionLevelLeadership'">
<span v-if="row.divisionLevelLeadership==true" class="text-primary"></span>
<span v-else class="text-danger"></span>
</template>
<template scope="{row:{identity}}" v-else-if="column.prop=='identity'">
<el-tag v-if="identity==1" effect="dark">运动员</el-tag>
<el-tag v-if="identity==2" type="success" effect="dark">教练</el-tag>
<el-tag v-if="identity==3" type="warning" effect="dark">领队</el-tag>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in unionColumns"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable">
<template scope="{row}" v-if="column.prop=='telephone'">
<span>{{row.telephone?row.telephone:'暂无'}}</span>
</template>
<template scope="{row}" v-if="column.prop=='unionleader'">
<span>{{row.unionleader?row.unionleader:'暂无'}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="150px">
<template scope="{row}">
<el-tooltip class="item" effect="dark" content="发送提醒" placement="top-start">
<el-button @click="sendRemind(row)" type="primary" size="mini"
icon="el-icon-message"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</template>
<template #view>
<info ref="info"></info>
</template>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
activityId: '',
planList: [],
typeList: [],
events: [],
activitys: [],
unionData: [],
unionColumns: [
{prop: 'unionname', label: '工会名称'},
{prop: 'unionleader', label: '负责人'},
{prop: 'telephone', label: '联系方式'},
{prop: 'num', label: '已报名人数'},
],
applyColumns: [
{prop: 'username', label: '姓名'},
{prop: 'loginname', label: '工号'},
{prop: 'mobile', label: '电话'},
{prop: 'sex', label: '性别'},
{prop: 'divisionLevelLeadership', label: '是否处级领导'},
{prop: 'identity', label: '身份'}
],
tableColumns: [
{prop: 'name', label: '活动名称'},
{prop: 'address', label: '活动地点'},
{prop: 'gameStyle', label: '活动类型'},
{prop: 'startTime', label: '活动日期'},
{prop: 'state', label: '活动状态'},
{prop: 'applyNum', label: '已报名人数'},
]
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'info': httpVueLoader('/components/activity/school/Info.vue'),
},
methods: {
dropdownCommand(command) {
const {type, row} = command
if (type === 'remind') {
this.openRemind(row)
} else if (type === 'view') {
this.openView(row)
}
},
openView(row) {
const {id} = row
this.$refs.guava.view()
setTimeout(()=>{
this.$refs.info.getInfo(id)
},500)
},
async openRemind(row) {
this.activityId = row.id
this.$refs.guava.edit()
const {data} = await $.get(loc() + "/getUnionRemind", {activityId: row.id})
this.unionData = data
},
sendRemind(row) {
if (!row.telephone) {
this.$notify.warning({title: '警告', message: '该工会联系方式为空,无法发送短信进行提醒!'});
return
}
this.$confirm("确定要发送提醒短信给【" + row.unionname + "】的负责人吗?", '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.get(loc() + "/sendRemind", {phone: row.telephone, unionname: row.unionname})
if(resp.code===0){
this.notifySuccess(resp.msg)
}else{
this.notifyWarning(resp.msg)
}
});
},
sendAllRemind() {
this.$confirm("确定发送提醒短信给所有未报名的分工会吗?", '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const loading = this.$loading({
lock: true,
text: '正在发送...',
spinner: 'el-icon-loading',
background: COVER_LAYER_COLOR
});
const resp = await $.get(loc() + "/sendAllRemind", {activityId: this.activityId})
loading.close()
if(resp.code===0){
this.notifySuccess(resp.msg)
}else{
this.notifyWarning(resp.msg)
}
});
},
async getActivitys() {
const {data} = await $.get(loc() + "/getActivitys")
return data;
},
async getEvents() {
const resp = await $.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
this.events = resp
}
},
async created() {
this.pageData()
this.activitys = await this.getActivitys()
this.planList = await activity.getSchoolActivityPlan()
this.unitOptions = await getUnits(null)
}
})
</script>
<!--#
}
#-->