This commit is contained in:
王创世 2024-06-21 14:25:25 +08:00
parent a2a6ade27d
commit 22d848f7f2
6 changed files with 411 additions and 39 deletions

View File

@ -32,6 +32,7 @@
"vue": "~2.6.14",
"vue-clipboard2": "^0.3.1",
"vue-cropper": "^0.6.5",
"vue-qr": "^4.0.9",
"vue-router": "^3.5.1",
"vuex": "^3.6.2",
"vuex-router-sync": "^5.0.0"

View File

@ -29,8 +29,24 @@
<!-- />-->
<!-- </div>-->
<!-- </template>-->
<template #start="{ row }">
<div>{{row.activity_start_time}}</div>
<div>-</div>
<div>{{row.activity_end_time}}</div>
</template>
<template #sign="{ row }">
<div v-if="row.activity_type==1||row.activity_type==4">
<div>{{row.signup_start_time}}</div>
<div>-</div>
<div>{{row.signup_end_time}}</div>
</div>
<div v-if="row.activity_type!=1&&row.activity_type!=4">
-
</div>
</template>
<template #top="{ row }">
<t-tag @click="topNews(row)" theme="success" variant="light" style="cursor: pointer">置顶</t-tag>
<t-button theme="success" size="small" v-if="row.weigh==0" @click="topNews(row)">点击置顶</t-button>
<t-button theme="warning" size="small" v-if="row.weigh>0" @click="topNewsDel(row)">取消置顶</t-button>
</template>
<template #money="{ row }">
<div v-if="row.activity_type==4">
@ -39,6 +55,7 @@
<span>{{row.money}}</span>
</div>
<div v-if="row.money==0">
<span>免费</span>
</div>
</div>
@ -46,6 +63,18 @@
-
</div>
</template>
<template #qr_code="{ row }">
<div style="text-align: center;" v-if="row.activity_type==4 || row.activity_type==1">
<vue-qr v-if="row.if_sign==2"
:text="$store.state.user.apiUrl+'?id='+row.id+'&association_id='+association.association_id"
width="100"
height="100"
></vue-qr>
</div>
<div v-if="row.activity_type!=4 && row.activity_type!=1 && row.if_sign==1">
-
</div>
</template>
<template #activity_type="{ row }">
<div style="text-align: center;">
<span v-if="row.activity_type==1">协会活动</span>
@ -79,10 +108,17 @@
</div>
</div>
<t-dialog header="报名详情" :confirmBtn="null" :visible="infoMode" :onClose="onCloseMy" width="65%" top="50px">
<div style="height: 600px;overflow-y: scroll;">
<div style="height: 650px;overflow-y: scroll;">
<div style="text-align: right">
<t-button @click="exportList(0)"><CloudDownloadIcon slot="icon" />导出</t-button>
</div>
<div v-if="infoIfAuditing==2">
<t-tabs v-model="InfotabIndex" @change="InfotabIndexChange">
<t-tab-panel value="2" label="已通过" :destroyOnHide="false"></t-tab-panel>
<t-tab-panel value="1" label="待审核" :destroyOnHide="false"></t-tab-panel>
<t-tab-panel value="3" label="已拒绝" :destroyOnHide="false"></t-tab-panel>
</t-tabs>
</div>
<t-table
rowKey="index"
:data="info_list"
@ -94,8 +130,26 @@
table-layout="auto"
cellEmptyContent="-"
>
<template #nikename="{ row }">
<a :href="$store.state.user.apiUrl+'/dist/#/user/user_info?id='+row.member_id" target="_blank">{{row.nikename}}</a>
</template>
<template #sign="{ row }">
<t-tag v-if="row.sign==1" theme="success">已签到</t-tag>
<t-tag v-if="row.sign==2" theme="warning">未签到</t-tag>
</template>
<template #photo_image="{ row }">
<img :src="$store.state.user.apiUrl+row.photo_image" style="width: 50px;height: 50px">
<img v-if="row.photo_image!=''&&row.photo_image!=null" :src="$store.state.user.apiUrl+row.photo_image" style="width: 50px;height: 50px">
<div v-if="row.photo_image==''||row.photo_image==null"></div>
</template>
<template #select="{ row }">
<div v-if="infoIfAuditing==2&&InfotabIndex==1">
<t-popconfirm content="确认要拒绝吗?" @confirm="updateType(row,3)">
<t-button theme="danger" variant="base">拒绝</t-button>
</t-popconfirm>
<t-popconfirm content="确认要通过吗?" @confirm="updateType(row,2)">
<t-button theme="success" style="margin-left: 15px">通过</t-button>
</t-popconfirm>
</div>
</template>
</t-table>
<div style="margin-top: 30px">
@ -200,6 +254,31 @@
<t-option key="2" label="不显示" value="2"/>
</t-select>
</t-form-item>
<t-form-item label="报名范围" name="range" >
<t-select v-model="addForm.range" :style="{ width: '480px' }">
<t-option key="1" label="会员" value="1"/>
<!-- <t-option key="2" label="非会员" value="2"/>-->
<t-option key="3" label="不限制" value="3"/>
</t-select>
</t-form-item>
<t-form-item label="报名审核" name="if_auditing" >
<t-select v-model="addForm.if_auditing" :style="{ width: '480px' }">
<t-option key="1" label="否" value="1"/>
<t-option key="2" label="是" value="2"/>
</t-select>
</t-form-item>
<t-form-item label="报名人数" name="number" >
<t-input placeholder="请输入报名人数0为不限制" v-model="addForm.number" :style="{ width: '480px' }"/>
</t-form-item>
<t-form-item label="签到" name="if_sign" >
<t-select v-model="addForm.if_sign" :style="{ width: '480px' }">
<t-option label="否" value="1"/>
<t-option label="是" value="2"/>
</t-select>
</t-form-item>
<t-form-item v-if="addForm.if_sign==2" label="签到积分" name="custom_points">
<t-input placeholder="请输入签到积分" v-model="addForm.custom_points" :style="{ width: '480px' }"/>
</t-form-item>
<t-form-item v-if="addForm.activity_type==4" label="付费金额" name="money">
<t-input placeholder="请输入付费金额0为免费" v-model="addForm.money" :style="{ width: '480px' }"/>
</t-form-item>
@ -233,7 +312,7 @@
:format-response="formatResponseVideo"
></t-upload>
</t-form-item>
<t-form-item label="活动主图">
<t-form-item label="活动主图" >
<t-upload
ref="uploadRef2"
:action="$store.state.user.apiUrl+'/api/common/upload'"
@ -246,30 +325,32 @@
:format-response="formatResponse"
></t-upload>
</t-form-item>
<t-form-item label="活动排序" name="weigh">
<t-input placeholder="请输入排序" v-model="addForm.weigh" :style="{ width: '480px' }"/>
</t-form-item>
<t-form-item label="报名开始时间" name="activity_start_time">
<t-date-picker :clearable="true" placeholder="活动开始时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.activity_start_time"></t-date-picker>
</t-form-item>
<t-form-item label="报名结束时间" name="activity_end_time">
<t-date-picker :clearable="true" placeholder="活动结束时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.activity_end_time"></t-date-picker>
</t-form-item>
<t-form-item label="活动开始时间" name="activity_start_time">
<t-date-picker :clearable="true" placeholder="活动开始时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.activity_start_time"></t-date-picker>
</t-form-item>
<t-form-item label="活动结束时间" name="activity_end_time">
<t-date-picker :clearable="true" placeholder="活动结束时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.activity_end_time"></t-date-picker>
</t-form-item>
<div style="width: 100%"></div>
<!-- <t-form-item label="活动排序" name="weigh">-->
<!-- <t-input placeholder="请输入排序" v-model="addForm.weigh" :style="{ width: '480px' }"/>-->
<!-- </t-form-item>-->
<template v-if="addForm.activity_type==1||addForm.activity_type==4">
<t-form-item label="报名开始时间" name="signup_start_time">
<t-date-picker :clearable="true" placeholder="报名开始时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.signup_start_time"></t-date-picker>
</t-form-item>
<t-form-item label="报名结束时间" name="signup_end_time">
<t-date-picker :clearable="true" placeholder="报名结束时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.signup_end_time"></t-date-picker>
</t-form-item>
</template>
<t-form-item label="活动开始时间" name="activity_start_time">
<t-date-picker :clearable="true" placeholder="活动开始时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.activity_start_time"></t-date-picker>
</t-form-item>
<t-form-item label="活动结束时间" name="activity_end_time">
<t-date-picker :clearable="true" placeholder="活动结束时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.activity_end_time"></t-date-picker>
</t-form-item>
</t-form>
</t-dialog>
@ -350,6 +431,7 @@
</t-form>
</div>
</t-dialog>
</t-card>
</template>
@ -358,19 +440,21 @@
import store from "@/store";
import {Editor, Toolbar} from '@wangeditor/editor-for-vue';
import {CloudDownloadIcon} from "tdesign-icons-vue";
import VueQr from 'vue-qr'
import axios from "axios";
export default {
components: {Editor, Toolbar,CloudDownloadIcon},
components: {Editor, Toolbar,CloudDownloadIcon,VueQr},
data() {
return {
questionnaireData: [{
type: 1, title: '', wight:0,option: [{name: 'A', val: ""}, {name: 'B', val: ""}]
}],
InfotabIndex:'2',
tabIndex: '1',
visible: false,
infoMode: false,
addForm: {
weigh:0,
// weigh:0,
money:'0',
activity_name: '',
activity_desc: '',
@ -382,6 +466,13 @@ export default {
activity_location: '',
activity_type: null,
if_display_registrants:null,
signup_start_time:'',
signup_end_time:'',
if_auditing:'1',
range:'3',
number:'',
if_sign:'1',
custom_points:''
},
activity_video:'',
activity_video_show:[],
@ -396,6 +487,8 @@ export default {
{colKey: 'phone', title: '手机号', align: 'center'},
{colKey: 'position_name', title: '职位', align: 'center'},
{colKey: 'application_time', title: '报名时间', align: 'center'},
{colKey: 'sign', title: '是否签到', align: 'center'},
{colKey: 'select', title: '操作', width: 200, align: 'center'},
],
info_pagination: {
page: 1,
@ -404,12 +497,12 @@ export default {
},
list: [],
columns: [
{colKey: 'weigh', title: '排序', align: 'center',width: 80,},
{colKey: 'activity_name', title: '活动标题', align: 'center',width: 300,},
{colKey: 'activity_name', title: '活动标题', align: 'center',width: 150,},
{colKey: 'activity_type', title: '活动类别', width: 200, align: 'center'},
{colKey: 'qr_code', title: '签到二维码', width: 200, align: 'center'},
{colKey: 'start', title: '活动时间', align: 'center'},
{colKey: 'sign', title: '报名时间', align: 'center'},
{colKey: 'money', title: '付费金额', align: 'center'},
{colKey: 'activity_start_time', title: '活动开始时间', align: 'center'},
{colKey: 'activity_end_time', title: '活动结束时间', align: 'center'},
{colKey: 'activity_location', title: '活动地点', align: 'center'},
{colKey: 'top', title: '置顶', align: 'center'},
{colKey: 'select', title: '操作', width: 200, align: 'center'},
@ -468,7 +561,8 @@ export default {
JuanTotal:0,
JuanId:0,
getType:3,
association:{}
infoIfAuditing:1,//
association:{},
}
},
beforeDestroy() {
@ -486,6 +580,23 @@ export default {
this.getList();
},
methods: {
updateType(d,type){
this.$request
.post('/application/updateType', {id: d.id,type:type})
.then((res) => {
if (res.code == 1) {
this.$message.success('审核成功');
this.info_pagination.page = 1;
this.openInfoDo();
} else {
this.$message.error(res.msg);
}
console.log(res);
})
.catch((e) => {
console.log(e);
});
},
openJuanMode(d){
this.JuanModeList=[];
this.JuanMode=true;
@ -495,6 +606,23 @@ export default {
this.getType=d.activity_type;
this.openJuanModeList();
},
topNewsDel(row){
console.log(row);
this.$request
.post('/common/listcancel', {id: row.id,type:'activity'})
.then((res) => {
if (res.code == 1) {
this.$message.success('取消置顶成功');
this.getList();
} else {
this.$message.error(res.msg);
}
console.log(res);
})
.catch((e) => {
console.log(e);
});
},
topNews(row){
console.log(row);
this.$request
@ -701,7 +829,8 @@ export default {
.post("/application/getList", {
activity_id: this.infoId,
page: this.info_pagination.page,
size: this.info_pagination.size
size: this.info_pagination.size,
type:this.InfotabIndex
})
.then((res) => {
console.log(res);
@ -716,11 +845,31 @@ export default {
});
},
openInfo(d) {
console.log(d);
this.info_list=[];
this.info_pagination.page=1;
this.info_pagination.total=0;
this.infoMode = true;
this.infoId = d.id;
this.infoIfAuditing=d.if_auditing;
// if(d.if_auditing==1){
// this.InfotabIndex='2';
// }else{
// this.InfotabIndex='1';
// }
if(d.if_auditing!=2){
this.info_columns = this.info_columns.filter(column => column.colKey !== 'sign');
}else{
this.info_columns= [
{colKey: 'photo_image', title: '形象照', align: 'center'},
{colKey: 'nikename', title: '姓名', align: 'center'},
{colKey: 'phone', title: '手机号', align: 'center'},
{colKey: 'position_name', title: '职位', align: 'center'},
{colKey: 'application_time', title: '报名时间', align: 'center'},
{colKey: 'sign', title: '是否签到', align: 'center'},
{colKey: 'select', title: '操作', width: 200, align: 'center'},
];
}
this.openInfoDo();
},
formatResponseVideo(res){
@ -757,7 +906,7 @@ export default {
this.addMode = true;
this.isEdit = false;
this.addForm = {
weigh:0,
// weigh:0,
money:0,
activity_name: '',
activity_desc: '',
@ -769,6 +918,13 @@ export default {
activity_location: '',
activity_type: null,
if_display_registrants:null,
signup_start_time:'',
signup_end_time:'',
if_auditing:'1',
range:'3',
number:'',
if_sign:'1',
custom_points:''
};
},
edit(d) {
@ -779,7 +935,7 @@ export default {
}else{
this.activity_video_show = [{url: store.state.user.apiUrl + d.video,name:d.video}];
}
this.addForm.weigh = d.weigh;
// this.addForm.weigh = d.weigh;
this.addForm.activity_name = d.activity_name;
this.addForm.activity_desc = d.activity_desc;
this.addForm.activity_image_show = [{url: store.state.user.apiUrl + d.activity_image}];
@ -791,9 +947,23 @@ export default {
this.addForm.activity_type = d.activity_type;
this.addForm.if_display_registrants = d.if_display_registrants;
this.addForm.money = d.money;
this.addForm.signup_start_time= d.signup_start_time;
this.addForm.signup_end_time=d.signup_end_time;
this.addForm.if_auditing=String(d.if_auditing);
this.addForm.range=String(d.range);
this.addForm.number=String(d.number);
this.addForm.if_sign=String(d.if_sign);
this.addForm.custom_points=String(d.custom_points);
this.addMode = true;
this.isEdit = true;
},
InfotabIndexChange(d){
this.info_list=[];
this.info_pagination.page=1;
this.info_pagination.total=0;
this.openInfoDo();
},
tabIndexChange(d) {
console.log(d);
this.pagination.page = 1;
@ -844,10 +1014,24 @@ export default {
this.$message.error('活动结束时间不能为空');
return;
}
if(this.addForm.activity_type==1||this.addForm.activity_type==4){
if (this.addForm.signup_start_time == '') {
this.$message.error('报名开始时间不能为空');
return;
}
if (this.addForm.signup_end_time == '') {
this.$message.error('报名结束时间不能为空');
return;
}
}
if (this.addForm.activity_location == '') {
this.$message.error('活动地址不能为空');
return;
}
if(this.addForm.activity_type==2||this.addForm.activity_type==3){
this.addForm.signup_start_time=this.addForm.activity_start_time;
this.addForm.signup_end_time=this.addForm.activity_end_time;
}
console.log(this.addForm);
var url = '/activity/add';
if (this.isEdit) {

View File

@ -0,0 +1,160 @@
<template>
<t-card :bordered="false">
<div class="form-step-container">
<t-button @click="add">新增置顶</t-button>
<t-table
rowKey="index"
:data="list"
:columns="columns"
:stripe="false"
:bordered="false"
:hover="true"
size="large"
table-layout="auto"
cellEmptyContent="-"
>
<template #select="{ row }">
<t-space size="24px" v-if="row.id!=0">
<t-button theme="warning" @click="edit(row)">编辑</t-button>
<t-popconfirm content="确认删除吗?" @confirm="del(row)">
<t-button theme="danger" >删除</t-button>
</t-popconfirm>
</t-space>
</template>
</t-table>
</div>
<t-dialog header="新增首页置顶" :visible="addMode" :onClose="onCloseMy" @confirm="onSubmit" width="650px">
<t-form>
<t-form-item label="活动名称" name="password">
<t-select
v-model="activity_id"
:filterable="true"
placeholder="搜索活动名称"
style="display: inline-block"
>
<t-option v-for="(item,index) in options" :title="item.activity_name" :value="item.id" :key="index" :label="item.activity_name"></t-option>
</t-select>
</t-form-item>
<t-form-item label="排序" name="weigh">
<t-input placeholder="请输入排序" v-model="weigh"/>
</t-form-item>
</t-form>
</t-dialog>
</t-card>
</template>
<script lang="ts">
export default {
data() {
return {
weigh:0,
activity_id: '',
addMode: false,
isEdit: false,
editID:0,
list: [],
options:[],
columns: [
{colKey: 'weigh', title: '排序'},
{colKey: 'activity_name', title: '活动名称'},
{colKey: 'select', title: '操作', width: 200},
],
}
},
mounted() {
//this.member_id=this.$route.query.id;
this.getList();
this.getOptionsList();
},
methods: {
getOptionsList() {
this.$request
.post("/activity", {page: 1, size: 10000})
.then((res) => {
console.log(res);
if (res.code == 1) {
this.options = res.data.ret;
}
})
.catch((e) => {
console.log(e);
});
},
del(d){
console.log(d);
this.$request
.post('/activity_index/del',{id:d.id})
.then((res) => {
if(res.code==1){
this.$message.success(res.msg);
this.getList();
}else {
this.$message.error(res.msg);
}
console.log(res);
})
.catch((e) => {
console.log(e);
});
},
add(){
this.activity_id='';
this.weigh= 0;
this.addMode=true;
this.isEdit=false;
this.editID=0;
},
edit(d){
console.log(d);
this.editID=d.id;
this.activity_id=d.activity_id;
this.weigh=d.weigh;
this.addMode=true;
this.isEdit=true;
},
getList() {
this.$request
.post("/activity_index/index")
.then((res) => {
console.log(res);
this.list = res.data.ret;
})
.catch((e) => {
console.log(e);
});
},
onSubmit() {
if (this.activity_id == '') {
this.$message.error('请选择活动');
return;
}
var url='/activity_index/add';
if(this.isEdit){
url='/activity_index/update';
}
this.$request
.post(url,{activity_id:this.activity_id,weigh:this.weigh,id:this.editID})
.then((res) => {
if(res.code==1){
this.$message.success(res.msg);
this.addMode=false;
this.getList();
}else {
this.$message.error(res.msg);
}
console.log(res);
})
.catch((e) => {
console.log(e);
});
},
onCloseMy() {
this.addMode = false;
}
}
}
</script>
<style scoped lang="less">
</style>

View File

@ -23,7 +23,8 @@
</t-space>
</template>
<template #top="{ row }">
<t-tag @click="topNews(row)" theme="success" variant="light" style="cursor: pointer">置顶</t-tag>
<t-button theme="success" size="small" v-if="row.weigh==0" @click="topNews(row)">点击置顶</t-button>
<t-button theme="warning" size="small" v-if="row.weigh>0" @click="topNewsDel(row)">取消置顶</t-button>
</template>
</t-table>
<div style="margin-top: 30px">
@ -234,6 +235,23 @@ export default {
console.log(e);
});
},
topNewsDel(row){
console.log(row);
this.$request
.post('/common/listcancel', {id: row.news_id,type:'news'})
.then((res) => {
if (res.code == 1) {
this.$message.success('取消置顶成功');
this.getList();
} else {
this.$message.error(res.msg);
}
console.log(res);
})
.catch((e) => {
console.log(e);
});
},
del(d) {
console.log(d);
this.$request

View File

@ -215,12 +215,15 @@ export default {
}
if (dis == 1) {
this.content = '您提交的信息修改已通过审核!';
}else{
}
this.$request
.post("/member_log/update", {
member_id: this.member_id,
id: this.id,
if_xianshi: dis,
if_member: dis,
content: this.content,
member_log: JSON.stringify(this.updateInfo.member_log)
})

View File

@ -66,6 +66,12 @@ export default [
name: 'activityIndex',
component: () => import('@/pages/activity/activity_index.vue'),
meta: { title: '活动列表' },
},
{
path: 'activity_top',
name: 'activityTop',
component: () => import('@/pages/activity/activity_top.vue'),
meta: { title: '活动首页置顶' },
}
],
},