368 lines
16 KiB
HTML
368 lines
16 KiB
HTML
<style>
|
|
.el-divider {
|
|
background-color: #409EFF !important;
|
|
}
|
|
|
|
.el-divider__text {
|
|
color: #409EFF !important;
|
|
}
|
|
|
|
.el-timeline-item__timestamp {
|
|
color: #409EFF;
|
|
}
|
|
</style>
|
|
|
|
<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-date-picker
|
|
style="width: 100%"
|
|
v-model="pageForm.year"
|
|
value-format="yyyy"
|
|
type="year"
|
|
placeholder="选择年">
|
|
</el-date-picker>
|
|
</div>
|
|
</div>
|
|
|
|
<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>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="search-item" v-if="type==1">
|
|
<div class="search-item-label">工会名称</div>
|
|
<div class="search-item-option">
|
|
<el-select v-model="pageForm.unionId" placeholder="请选择工会" filterable
|
|
clearable
|
|
style="width: 100%">
|
|
<el-option
|
|
v-for="item in unionList"
|
|
:key="item.id"
|
|
:label="item.unionname"
|
|
:value="item.id">
|
|
</el-option>
|
|
</el-select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="search-query">
|
|
<el-button type="primary" icon="el-icon-search" @click="pageData">搜索
|
|
</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"
|
|
:width="column.width"
|
|
show-overflow-tooltip
|
|
:sortable="column.sortable">
|
|
|
|
<template v-if="column.prop=='time'" scope="{row}">
|
|
<span>
|
|
{{moment(row.startTime).format('YYYY-MM-DD')}} - {{moment(row.endTime).format('YYYY-MM-DD')}}
|
|
</span>
|
|
</template>
|
|
<template scope="{row}" v-else-if="column.prop=='time2'">
|
|
{{row.applyStartTime}}-{{row.applyEndTime}}
|
|
</template>
|
|
|
|
<template v-else-if="column.prop=='projectTypeName'" scope="{row}">
|
|
{{row.projectTypeName}}({{row.projectTypeCode}})
|
|
</template>
|
|
|
|
<template v-else-if="column.prop=='tussueName'" scope="{row}">
|
|
<span v-if="row.type==40002">{{row.unionname?row.unionname:'暂无'}}</span>
|
|
<span v-if="row.type==40003">{{row.clubName?row.clubName:'暂无'}}</span>
|
|
<span v-if="row.type==40001">校工会</span>
|
|
</template>
|
|
<template v-else-if="column.prop=='state'" scope="{row}">
|
|
{{row.state===1?'未审核':row.state===2?'审核不通过':'审核通过'}}
|
|
</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 :command="{type:'view',row}">
|
|
查看
|
|
</el-dropdown-item>
|
|
|
|
<el-dropdown-item :command="{type:'edit',row}"
|
|
:disabled="row.projectTypeCode==50004">
|
|
编辑
|
|
</el-dropdown-item>
|
|
<el-dropdown-item :command="{type:'delete',row}"
|
|
:disabled="row.projectTypeCode==50004">
|
|
删除
|
|
</el-dropdown-item>
|
|
<el-dropdown-item :command="{type:'sendMsg',row}">
|
|
通知
|
|
</el-dropdown-item>
|
|
<el-dropdown-item :command="{type:'openCode',row}">
|
|
二维码
|
|
</el-dropdown-item>
|
|
<!-- <el-dropdown-item :command="{type:'export',row}">
|
|
导出人员名单
|
|
</el-dropdown-item>-->
|
|
|
|
</el-dropdown-menu>
|
|
</el-dropdown>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
|
|
<!--#include("/layouts/pagination.html"){}#-->
|
|
</el-card>
|
|
</template>
|
|
|
|
|
|
<template #view>
|
|
<tissue-info ref="info"></tissue-info>
|
|
</template>
|
|
</guava>
|
|
|
|
<send-msg ref="sendMsg" :url="url"></send-msg>
|
|
|
|
<open-qr-code ref="openQRCode" :url="url"></open-qr-code>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
var vue = new Vue({
|
|
el: '#app',
|
|
mixins: [initTableMixins],
|
|
data() {
|
|
return {
|
|
actvivtyUrl: "/platform/activity/info/mange",
|
|
selectLoading: false,
|
|
userTabLoading: false,
|
|
dialogVisible: false,
|
|
url: "",
|
|
userData: [],
|
|
userList: [],
|
|
unionList: [],
|
|
pageForm: {
|
|
type: type,
|
|
year: new Date().getFullYear() + ''
|
|
},
|
|
formData: {
|
|
tissuePersonList: []
|
|
},
|
|
tableColumns: [
|
|
{prop: 'name', label: '活动名称'},
|
|
{prop: 'address', label: '活动地点'},
|
|
{prop: 'projectTypeName', label: '活动项目类型'},
|
|
{prop: 'tussueName', label: '举办单位'},
|
|
{prop: 'time', label: '活动日期'},
|
|
{prop: 'time2', label: '报名日期', width: '300'},
|
|
{prop: 'applyTime', label: '创建时间', sortable: true},
|
|
{prop: 'state', label: '审核状态', sortable: true},
|
|
|
|
],
|
|
userColumns: [
|
|
{prop: 'userName', label: '姓名'},
|
|
{prop: 'loginName', label: '工号'},
|
|
{prop: 'sex', label: '性别'},
|
|
{prop: 'mobile', label: '联系方式'},
|
|
{prop: 'unitName', label: '所属单位'},
|
|
{prop: 'unionName', label: '所属工会'}
|
|
],
|
|
formRules: {
|
|
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
|
address: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
|
peopleNum: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
|
time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
|
type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
|
}
|
|
}
|
|
},
|
|
components: {
|
|
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
|
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
|
'tissue-info': httpVueLoader('/components/activity/school/tissueInfo.vue'),
|
|
'send-msg': httpVueLoader('/components/plugins/SendMsgByGroupId.vue'),
|
|
'open-qr-code': httpVueLoader('/components/plugins/OpenQRCode.vue'),
|
|
},
|
|
methods: {
|
|
dropdownCommand(command) {
|
|
const {type, row} = command
|
|
if (type === 'view') {
|
|
this.openView(row)
|
|
} else if (type === 'edit') {
|
|
this.openEdit(row)
|
|
} else if (type === 'delete') {
|
|
this.doDelete(row)
|
|
} else if (type === 'sendMsg') {
|
|
this.sendMsg(row)
|
|
} else if (type === 'openCode') {
|
|
this.openCode(row)
|
|
} else if (type === 'export') {
|
|
location.href = "/platform/activity/info/mange/export?id=" + row.id
|
|
}
|
|
},
|
|
openCode(row) {
|
|
this.$refs.openQRCode.openCode("/mobile/activity/unionActivity/goReg?id=" + row.id + "&signUpMethod=" + row.signUpMethod)
|
|
},
|
|
sendMsg(row) {
|
|
this.url = `<a href="` + (APP_DOMAIN + "/mobile/activity/unionActivity/goReg?id=" + row.id + "&signUpMethod=" + row.signUpMethod) + `">点击参与</a>`
|
|
this.$refs.sendMsg.openDialog(row.groupId)
|
|
},
|
|
async remoteMethod(query) {
|
|
if (query) {
|
|
this.selectLoading = true;
|
|
const {data} = await $.post(this.actvivtyUrl + "/findUser", {serachWord: query})
|
|
this.userList = data
|
|
this.selectLoading = false;
|
|
}
|
|
},
|
|
openAddUser() {
|
|
this.formData.tissuePersonList = []
|
|
this.dialogVisible = true
|
|
},
|
|
doAddUser() {
|
|
this.formData.tissuePersonList = this.userList.filter(v => this.formData.tissuePersonList.some(x => v.userId === x))
|
|
this.userData = this.userData.concat(this.formData.tissuePersonList)
|
|
this.dialogVisible = false
|
|
},
|
|
delUser(row) {
|
|
this.userData.splice(this.userData.indexOf(row.userId), 1)
|
|
this.formData.tissuePersonList.splice(this.formData.tissuePersonList.indexOf(row.userId), 1)
|
|
},
|
|
openView(row) {
|
|
const {id} = row
|
|
this.$refs.info.getInfo(id)
|
|
this.$refs.guava.view()
|
|
},
|
|
async openEdit(row) {
|
|
const {id, type} = row
|
|
if (type == 40002) {
|
|
sublime.jumpPagePjax("/platform/activity/apply/union?id=" + id)
|
|
} else if (type == 40003) {
|
|
sublime.jumpPagePjax("/platform/activity/apply/club?id=" + id)
|
|
} else {
|
|
sublime.jumpPagePjax("/platform/activity/apply/school?id=" + id)
|
|
}
|
|
/*this.$refs.guava.edit()*/
|
|
},
|
|
async openAdd() {
|
|
this.$refs.guava.edit()
|
|
this.userData = []
|
|
this.$nextTick(() => {
|
|
this.formData = {
|
|
name: '',
|
|
time: '',
|
|
peopleNum: '',
|
|
address: '',
|
|
files: [],
|
|
type: "40002",
|
|
tissuePersonList: []
|
|
}
|
|
if (this.$refs['addForm']) {
|
|
this.$refs['addForm'].resetFields()
|
|
}
|
|
})
|
|
},
|
|
async operation() {
|
|
let url = this.formData.id ? "/doEdit" : "/doAdd"
|
|
this.$refs["addForm"].validate(async (valid) => {
|
|
if (valid) {
|
|
const loading = this.$loading({
|
|
lock: true,
|
|
text: '正在提交...',
|
|
spinner: 'el-icon-loading',
|
|
background: COVER_LAYER_COLOR
|
|
});
|
|
|
|
const formData = JSON.parse(JSON.stringify(this.formData))
|
|
formData.type = this.pageForm.type
|
|
if (formData.time && formData.time.length) {
|
|
formData.startTime = formData.time[0]
|
|
formData.endTime = formData.time[1]
|
|
formData.time = undefined
|
|
}
|
|
|
|
const resp = await $.post(this.actvivtyUrl + url, {tissue: JSON.stringify(formData),})
|
|
if (resp.code === 0) {
|
|
this.pageData()
|
|
this.$refs.guava.index()
|
|
this.notifySuccess(resp.msg)
|
|
} else {
|
|
this.notifyError(resp.msg)
|
|
}
|
|
} else {
|
|
this.$notify.error({title: '错误', message: '存在未填写的的必填项'});
|
|
}
|
|
});
|
|
},
|
|
doDelete(row) {
|
|
const {id} = row
|
|
this.$confirm('确定要删除该活动吗?', '提示', {type: 'warning'}).then(async () => {
|
|
this.$set(row, "loading", true)
|
|
const resp = await $.post(this.actvivtyUrl + "/doDelete", {id: id});
|
|
if (resp.code === 0) {
|
|
this.pageData()
|
|
this.$refs.guava.index()
|
|
this.notifySuccess(resp.msg)
|
|
} else {
|
|
this.notifyError(resp.msg)
|
|
}
|
|
this.$set(row, "loading", false)
|
|
})
|
|
},
|
|
pageData() {
|
|
sublime.showLoadingbar();
|
|
this.tableLoading = true
|
|
$.post("/platform/activity/info/mange/pageData", this.pageForm, (data) => {
|
|
sublime.closeLoadingbar();
|
|
this.tableLoading = false
|
|
if (data.code === 0) {
|
|
this.tableData = data.data.list;
|
|
this.pageForm.totalCount = data.data.totalCount;
|
|
} else {
|
|
this.$message.error(data.msg);
|
|
}
|
|
}, "json");
|
|
}
|
|
},
|
|
async created() {
|
|
this.pageData()
|
|
this.unionList = await getUnions(null)
|
|
}
|
|
})
|
|
</script>
|
|
|