活动管理

This commit is contained in:
yanran200730
2023-01-29 14:37:38 +08:00
parent 22f3a52a14
commit a7072daf4a
6 changed files with 150 additions and 133 deletions

View File

@@ -22,12 +22,6 @@
:limit="9">
</ai-uploader>
</el-form-item>
<el-form-item prop="beginTime" style="width: 100%;" label="开始时间">
<el-date-picker type="datetime" size="small" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择开始时间" v-model="form.beginTime"></el-date-picker>
</el-form-item>
<el-form-item prop="address" style="width: 100%;" label="结束时间">
<el-date-picker type="datetime" size="small" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择结束时间" v-model="form.endTime"></el-date-picker>
</el-form-item>
</el-form>
</template>
</ai-card>
@@ -55,8 +49,6 @@
form: {
title: '',
content: '',
beginTime: '',
endTime: '',
files: []
},
id: ''
@@ -102,7 +94,7 @@
cancel (isRefresh) {
this.$emit('change', {
type: 'list',
type: 'List',
isRefresh: !!isRefresh
})
}

View File

@@ -0,0 +1,113 @@
<template>
<ai-detail class="detail">
<template slot="title">
<ai-title title="活动详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title>
</template>
<template slot="content">
<ai-card title="基本信息">
<template #content>
<ai-wrapper
label-width="120px">
<ai-info-item label="活动标题" :value="info.title"></ai-info-item>
<ai-info-item label="活动内容" isLine>
<AiArticle :value="info.content"></AiArticle>
</ai-info-item>
<ai-info-item label="附件" isLine>
<AiFileList :fileList="info.files"></AiFileList>
</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card title="报名列表">
<template #content>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
style="margin-top: 6px;"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<!-- <el-table-column slot="options" width="90px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
</div>
</template>
</el-table-column> -->
</ai-table>
</template>
</ai-card>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
colConfigs: [
{ prop: 'userName', label: '姓名', align: 'left', width: '200px' },
{ prop: 'userPhone', label: '手机号', align: 'center' },
{ prop: 'createTime', label: '报名时间', align: 'center' }
],
search: {
size: 10,
current: 1
},
tableData: [],
total: 0,
info: {}
}
},
created () {
this.getInfo()
this.getList()
},
methods: {
getList() {
this.instance.post(`/app/appactivityinfo/signUpList?activityId=${this.params.id}`, null, {
params: {
...this.search
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.total = res.data.total
}
})
},
getInfo () {
this.instance.post(`/app/appactivityinfo/queryDetailById?id=${this.params.id}`).then(res => {
if (res.code == 0) {
if (res.data) {
this.info = res.data
}
}
})
},
cancel () {
this.$emit('change', {
type: 'List',
isRefresh: true
})
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@@ -37,10 +37,12 @@
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="options" width="140px" fixed="right" label="操作" align="center">
<el-table-column slot="options" width="180px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
<el-button type="text" :disabled="row.status !== '1'" @click="stop(row.id)">停止</el-button>
<el-button type="text" @click="remove(row.id)">删除</el-button>
</div>
</template>
@@ -70,9 +72,7 @@
total: 10,
colConfigs: [
{ prop: 'title', label: '活动标题', align: 'left', width: '200px' },
{ prop: 'signUpCount', label: '报名人数', align: 'center' },
{ prop: 'beginTime', label: '开始时间', align: 'center' },
{ prop: 'endTime', label: '结束时间', align: 'center' },
{ prop: 'signUpCount', label: '报名人数', align: 'center', format: e => e },
{ prop: 'status', label: '活动状态', align: 'center', format: e => this.statusList.filter(v => v.dictValue === e)[0].dictName }
],
tableData: [],
@@ -94,9 +94,7 @@
},
created() {
this.dict.load('epidemicDangerousAreaLevel').then(() => {
this.getList()
})
this.getList()
},
methods: {
@@ -113,8 +111,19 @@
})
},
remove(id) {
this.$confirm('确定删除该数据').then(() => {
stop (id) {
this.$confirm('确定停止该活动').then(() => {
this.instance.post(`/app/appactivityinfo/stop?id=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('停止成功!')
this.getList()
}
})
})
},
remove (id) {
this.$confirm('确定删除该活动?').then(() => {
this.instance.post(`/app/appactivityinfo/delete?ids=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
@@ -124,6 +133,15 @@
})
},
toDetail (id) {
this.$emit('change', {
type: 'Detail',
params: {
id: id || ''
}
})
},
toAdd(id) {
this.$emit('change', {
type: 'Add',