This commit is contained in:
2024-10-09 08:48:45 +08:00
parent 875a84cfb2
commit f95a5c0af2
5 changed files with 144 additions and 64 deletions
@@ -2,8 +2,8 @@
layout("/layouts/platform.html"){
#-->
<div id="app" class="platform" v-cloak>
<guava ref="guava" padding="0 5%">
<div class="platform" id="app" v-cloak>
<guava padding="0 5%" ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button mr10">
@@ -17,65 +17,71 @@ layout("/layouts/platform.html"){
</div>
<div class="btn-group tool-button mr10">
<el-input placeholder="请输入活动名称" clearable v-model="pageForm.title"
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入活动名称"
style="width: 100%"
@keyup.enter.native="doSearch">
v-model="pageForm.title">
</el-input>
</div>
<div class="btn-group tool-button mt5 mr10">
<el-checkbox-group v-model="pageForm.sendTypes" @change="doSearch">
<el-checkbox-button label="msg" border>短信发送</el-checkbox-button>
<el-checkbox-button label="WeChat" border>微信发送</el-checkbox-button>
<el-checkbox-group @change="doSearch" v-model="pageForm.sendTypes">
<el-checkbox-button border label="msg">短信发送</el-checkbox-button>
<el-checkbox-button border label="WeChat">微信发送</el-checkbox-button>
</el-checkbox-group>
</div>
<div class="btn-group tool-button ">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool label="消息列表" :app="this">
<table-tool :app="this" label="消息列表">
<template #func>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading" :size="tableSize" class="vi-table">
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
class="vi-table"
row-key="id" style="width: 100%" v-loading="tableLoading">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
<el-table-column :index="indexMethod" align="center" header-align="center"
label="序号" type="index"
width="80px"></el-table-column>
<el-table-column
show-overflow-tooltip
align="center"
header-align="center"
v-for="column in tableColumns"
: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"
>
<template v-if="column.prop==='module'" scope="{row}">
<template scope="{row}" v-if="column.prop==='module'">
{{row.module=='hy'?'会员模块':'教代会模块'}}
</template>
<template v-else-if="column.prop==='teacherMeetingName'" scope="{row}">
<template scope="{row}" v-else-if="column.prop==='teacherMeetingName'">
{{!row.teacherMeetingId?'暂无':row.jdhallname}}
</template>
<template v-else-if="column.prop==='type'" scope="{row}">
<template scope="{row}" v-else-if="column.prop==='type'">
{{row.type=='system'?'预设团体':row.type=='user'?'自定义人员':'活动设置人员'}}
</template>
<template v-else-if="column.prop==='hold'" scope="{row}">
<template scope="{row}" v-else-if="column.prop==='hold'">
{{row.hold?'已发送':'未发送'}}
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right">
<el-table-column align="center" fixed="right" header-align="center" label="操作">
<template scope="{row}">
<el-button @click="doSend(row)" size="mini" type="success" v-if="!row.hold">发送</el-button>
<el-button @click="openView(row)" size="mini" v-if="row.hold">查看</el-button>
<el-button size="mini" type="primary" @click="openEdit(row)" v-if="!row.hold">编辑</el-button>
<el-button size="mini" type="danger" @click="doDelete(row.id)">删除</el-button>
<el-button @click="doSend(row)" size="mini" type="success">发送
</el-button>
<el-button @click="openView(row)" size="mini" v-if="row.hold">查看
</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>
</el-table-column>
@@ -217,4 +223,4 @@ layout("/layouts/platform.html"){
<!--#
}
#-->
#-->
@@ -22,7 +22,7 @@ layout("/layouts/platform.html"){
:clearable="false"
@change="yearChange"
placeholder="选择年度"
type="year" style="width: 100%"
style="width: 100%" type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
@@ -31,7 +31,8 @@ layout("/layouts/platform.html"){
<div class="search-item">
<div class="search-item-label">活动:</div>
<div class="search-item-option">
<el-select @change="activityChange" style="width: 100%" v-model="pageForm.activityId">
<el-select @change="activityChange" style="width: 100%"
v-model="pageForm.activityId">
<el-option :label="item.activityName"
:value="item.id"
v-for="item in activityList"
@@ -47,26 +48,37 @@ layout("/layouts/platform.html"){
<el-card class="mt10" shadow="never">
<table-tool :app="this" :label="trainType">
<template #func>
<el-button type="primary" size="small" @click="exportSignUser" :disabled="!pageForm.activityId">
<el-button :disabled="!pageForm.activityId" @click="exportSignUser" size="small"
type="primary">
导出报名人员
</el-button>
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize">
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
<el-table-column :index="indexMethod" align="center" header-align="center"
label="序号" type="index"
width="80px"></el-table-column>
<el-table-column :label="trainType" prop="courseName" align="center" header-align="center"
<el-table-column :label="trainType" align="center" header-align="center"
prop="courseName"
show-overflow-tooltip></el-table-column>
<el-table-column label="类型" prop="courseType" sortable align="center" header-align="center"
show-overflow-tooltip></el-table-column>
<el-table-column :label="trainType + '地点'" prop="courseLocation" sortable align="center"
header-align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="负责人" prop="courseInstructor" sortable align="center" header-align="center"
show-overflow-tooltip></el-table-column>
<el-table-column label="最多报名人数" prop="coursePeopleNumber" sortable align="center" header-align="center"
show-overflow-tooltip></el-table-column>
<el-table-column label="已报名人数" prop="registerNum" sortable align="center" header-align="center"
show-overflow-tooltip>
<el-table-column align="center" header-align="center" label="类型" prop="courseType"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column :label="trainType + '地点'" align="center" header-align="center"
prop="courseLocation"
show-overflow-tooltip sortable></el-table-column>
<el-table-column align="center" header-align="center" label="负责人"
prop="courseInstructor"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="最多报名人数"
prop="coursePeopleNumber"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="已报名人数"
prop="registerNum"
show-overflow-tooltip
sortable>
<template scope="{row}">
<el-link @click="openView(row.id)" type="primary">
{{row.registerNum + row.courseReservedNumber}}
@@ -75,7 +87,8 @@ layout("/layouts/platform.html"){
</el-table-column>
<el-table-column label="操作" width="150px">
<template scope="{row}">
<el-button @click="openView(row.id)" size="mini" type="primary">查看</el-button>
<el-button @click="openView(row.id)" size="mini" type="primary">查看
</el-button>
</template>
</el-table-column>
</el-table>
@@ -86,6 +99,23 @@ layout("/layouts/platform.html"){
<!--#include("/platform/trainSingUp/statistics/include_view.html"){}#-->
</template>
</guava>
<el-dialog
:visible.sync="messageDialogVisible"
title="发送消息"
width="30%">
<el-input
:rows="4"
placeholder="请输入内容"
type="textarea"
v-model="messageForm.messageText">
</el-input>
<span class="dialog-footer" slot="footer">
<el-button @click="messageDialogVisible = false">关 闭</el-button>
<el-button @click="doMessage" type="primary">发 送</el-button>
</span>
</el-dialog>
</div>
<script>
@@ -119,9 +149,37 @@ layout("/layouts/platform.html"){
userSignInfo: {},
trainType: '培训班',
trainTypeList: [],
messageForm: {messageText: ""},
messageDialogVisible: false,
}
},
methods: {
async doMessage() {
if (!this.messageForm.messageText) {
this.$message.error("请输入内容")
return
}
const confirm = await this.$confirm('确定要发送消息吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const resp = await $.post(loc() + '/sendMessage', {
courseId: this.messageForm.courseId,
messageText: this.messageForm.messageText
})
if (resp.code === 0) {
this.$message.success(resp.msg)
this.messageDialogVisible = false
}
}
},
openMessage() {
this.messageForm.messageText = ""
this.messageDialogVisible = true
},
activityChange(val) {
const activity = this.activityList.find(o => o.id === val)
const type = this.trainTypeList.find(o => o.code === activity.trainType)
@@ -148,6 +206,7 @@ layout("/layouts/platform.html"){
await this.getActivityList()
},
async openView(courseId) {
this.messageForm.courseId = courseId
this.$refs.guava.view()
const resp_register = await $.get(loc() + '/registerUserList', {courseId})
this.registerUserTableData = resp_register.data
@@ -1,5 +1,8 @@
<el-tabs>
<el-tab-pane label="报名人员">
<div style="display: flex;justify-content: flex-end">
<el-button type="primary" @click="openMessage" size="small">给报名人发送消息</el-button>
</div>
<el-table :data="registerUserTableData" :size="tableSize">
<el-table-column
:label="column.label"
@@ -52,4 +55,4 @@
</el-tabs>
</el-tab-pane>
</el-tabs>
</el-tabs>