227 lines
9.5 KiB
HTML
227 lines
9.5 KiB
HTML
<!--#
|
|
layout("/layouts/platform.html"){
|
|
#-->
|
|
|
|
<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">
|
|
<el-date-picker clearable end-placeholder="结束日期"
|
|
range-separator="-"
|
|
start-placeholder="开始日期"
|
|
type="daterange"
|
|
v-model="pageForm.dateRange"
|
|
value-format="yyyy-MM-dd">
|
|
</el-date-picker>
|
|
|
|
</div>
|
|
<div class="btn-group tool-button mr10">
|
|
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入活动名称"
|
|
style="width: 100%"
|
|
v-model="pageForm.title">
|
|
</el-input>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="btn-group tool-button mt5 mr10">
|
|
<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 @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
|
</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"
|
|
class="vi-table"
|
|
row-key="id" style="width: 100%" v-loading="tableLoading">
|
|
|
|
<el-table-column :index="indexMethod" align="center" header-align="center"
|
|
label="序号" type="index"
|
|
width="80px"></el-table-column>
|
|
<el-table-column
|
|
: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 scope="{row}" v-if="column.prop==='module'">
|
|
{{row.module=='hy'?'会员模块':'教代会模块'}}
|
|
</template>
|
|
<template scope="{row}" v-else-if="column.prop==='teacherMeetingName'">
|
|
{{!row.teacherMeetingId?'暂无':row.jdhallname}}
|
|
</template>
|
|
<template scope="{row}" v-else-if="column.prop==='type'">
|
|
{{row.type=='system'?'预设团体':row.type=='user'?'自定义人员':'活动设置人员'}}
|
|
</template>
|
|
<template scope="{row}" v-else-if="column.prop==='hold'">
|
|
{{row.hold?'已发送':'未发送'}}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" fixed="right" header-align="center" label="操作">
|
|
<template scope="{row}">
|
|
<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>
|
|
|
|
</el-table>
|
|
<!--#include("/layouts/pagination.html"){}#-->
|
|
</el-card>
|
|
</template>
|
|
</guava>
|
|
</div>
|
|
<script>
|
|
const vue = new Vue({
|
|
el: "#app",
|
|
mixins: [initTableMixins],
|
|
data() {
|
|
return {
|
|
unions: [],
|
|
units: [],
|
|
pageForm: {
|
|
sendTypes: [],
|
|
},
|
|
tableColumns: [
|
|
{prop: 'title', label: '活动名称'},
|
|
// {prop: 'module', label: '所属模块'},
|
|
// {prop: 'teacherMeetingName', label: '所属教代会'},
|
|
{prop: 'type', label: '人员范围', sortable: true},
|
|
{prop: 'sendTypesName', label: '发送方式'},
|
|
{prop: 'hold', label: '是否发送'},
|
|
{prop: 'CreateTime', label: '创建时间'},
|
|
// {prop: 'content', label: '发送内容'},
|
|
]
|
|
}
|
|
},
|
|
methods: {
|
|
async doSend(row) {
|
|
const confirm = await this.$confirm('您确定要发送消息吗?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
})
|
|
if (confirm) {
|
|
const loading = this.$loading({
|
|
lock: true,
|
|
text: '正在提交...',
|
|
spinner: 'el-icon-loading',
|
|
background: COVER_LAYER_COLOR
|
|
});
|
|
const resp = await $.post(loc() + "/doSend", {
|
|
id: row.id,
|
|
sendTypes: row.sendTypes,
|
|
content: row.content
|
|
})
|
|
if (resp.code === 0) {
|
|
this.$notify.success(resp.msg)
|
|
this.pageData()
|
|
} else {
|
|
this.$notify.error(resp.msg)
|
|
}
|
|
loading.close()
|
|
|
|
|
|
}
|
|
},
|
|
async doDelete(id) {
|
|
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
})
|
|
if (confirm) {
|
|
const res = await $.post(loc() + "/doDelete", {TitleId: id})
|
|
if (res.code === 0) {
|
|
this.pageData()
|
|
this.$message.success(res.msg)
|
|
}
|
|
}
|
|
},
|
|
pageData() {
|
|
sublime.showLoadingbar();
|
|
this.tableLoading = true
|
|
|
|
const pageForm = clone(this.pageForm)
|
|
pageForm.sendTypes = JSON.stringify(pageForm.sendTypes)
|
|
pageForm.dateRange = JSON.stringify(pageForm.dateRange)
|
|
|
|
$.post(loc() + "/pageData", pageForm, (data) => {
|
|
sublime.closeLoadingbar();
|
|
this.tableLoading = false
|
|
if (data.code == 0) {
|
|
data.data.list.forEach(v => {
|
|
const a = JSON.parse(v.sendTypes).map(z => {
|
|
if (z == "msg") {
|
|
return "短信"
|
|
} else {
|
|
return "微信"
|
|
}
|
|
|
|
})
|
|
v.sendTypesName = a.toString()
|
|
})
|
|
this.tableData = data.data.list;
|
|
this.pageForm.totalCount = data.data.totalCount;
|
|
} else {
|
|
this.$message.error(data.msg);
|
|
}
|
|
}, "json");
|
|
},
|
|
async openEdit(row) {
|
|
/* const {data} = await $.post(loc() + "/getMeetingByMsgId", {id: row.id})
|
|
if (data != null) {
|
|
const confirm = await this.$confirm('此会议与会务管理系统已绑定,是否前往会务管理系统修改?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
})
|
|
if (confirm === "confirm") {
|
|
window.location.href = "/platform/meeting/manage"
|
|
}
|
|
} else {
|
|
const {id, hold} = row
|
|
window.location.href = '/platform/msgNotify/send?notifyId=' + id + "&hold=" + hold
|
|
}*/
|
|
const {id, hold} = row
|
|
window.location.href = '/platform/msgNotify/send?notifyId=' + id + "&hold=" + false
|
|
},
|
|
openView(row) {
|
|
const {id, hold} = row
|
|
window.location.href = '/platform/msgNotify/send?notifyId=' + id + "&hold=" + hold
|
|
},
|
|
|
|
},
|
|
async created() {
|
|
this.pageData();
|
|
}
|
|
|
|
})
|
|
</script>
|
|
|
|
|
|
<!--#
|
|
}
|
|
#-->
|