bibi 3 years ago
parent 57b58a1f1f
commit ea988a2af1

@ -11,14 +11,14 @@ export function organizerList(params) {
export function organizerInfo(params) {
return httpService({
url: `/user/activityOrganizer/findById`,
method: 'post',
method: 'get',
params: params,
})
}
export function organizerInsert(params) {
return httpService({
url: `/user/activityOrganizer/insert`,
method: 'get',
method: 'post',
data: params,
})
}

@ -21,6 +21,7 @@
>{{ option.name }}</a-select-option
>
</a-select>
<a-range-picker v-else-if="item.type === 'time'" value-format="YYYY/MM/DD HH:mm:ss" @change="changeTime($event,item.start,item.end)" />
</a-form-model-item>
</a-form-model>
<div class="btn-box"><a-button type="primary" @click="getSearch"> </a-button>
@ -41,8 +42,13 @@ export default {
this.itemList = val
let obj = {}
for(let k of val){
if(k.type==='time'){
obj[k.start] = undefined
obj[k.end] = undefined
}else{
obj[k.prop] = undefined;
}
}
this.form = obj;
},
immediate: true
@ -63,6 +69,11 @@ export default {
this.$refs.ruleForm.resetFields();
this.$emit('getSearch', this.form)
},
changeTime(data,start,end){
this.$emit('changeTime', data,start,end)
this.form[start] = data[0]
this.form[end] = data[1]
}
},
};
</script>

@ -20,7 +20,7 @@ export default [
path: '/Activity',
name: "Activity",
title: "活动",
icon: 'form',
icon: 'notification',
hide: false,
component: resolve => require(['@/views/Operation/Activity'], resolve),
redirect: '/Activity/ActivityManage',
@ -44,6 +44,46 @@ export default [
},
]
},
{
path: '/Announcement',
name: "Announcement",
title: "公告",
icon: 'file-search',
hide: false,
component: resolve => require(['@/views/Operation/Announcement'], resolve),
redirect: '/Announcement/AnnouncementManage',
meta: {title: '公告'},
children: [
{
path: '/Announcement/AnnouncementManage',
name: "AnnouncementManage",
title: "公告管理",
hide: false,
component: resolve => require(['@/views/Operation/Announcement/_announcementManage'], resolve),
meta: {title: '公告管理'},
},
{
path: '/Announcement/AnnouncementItem',
name: "AnnouncementItem",
title: "公告分类",
hide: false,
component: resolve => require(['@/views/Operation/Announcement/_announcementItem'], resolve),
meta: {title: '公告分类'},
},
]
},
{
path: '/News',
name: "News",
title: "资讯",
icon: 'global',
hide: false,
component: resolve => require(['@/views/Operation/News'], resolve),
redirect: '/News/',
meta: {title: '活动'},
children: [
]
},
{
path: '/TaskManage',
name: "TaskManage",

@ -1,24 +1,43 @@
export const formItem = [
{
type: 'input',
label:'话题标题',
prop:'title',
placeholder:'请输入标题'
},
{
type: 'select',
label:'状态',
prop:'status',
option:[{ id:1,name:'启用中'},{ id:2,name:'禁用中'}],
option:[{ id:1,name:'报名未开始'},{ id:2,name:'报名进行中'},{ id:3,name:'活动未开始'},{ id:4,name:'活动进行中'},{ id:5,name:'活动已结束'}],
placeholder:'请选择状态'
},
{
type: 'select',
label:'是否公开',
prop:'isPublic',
placeholder:'请选择',
option:[{ id:1,name:'是'},{ id:0,name:'否'}]
type: 'time',
label:'报名时间',
start: 'registrationStartTime',
end:'registrationEndTime',
},
{
type: 'time',
label:'活动时间',
start: 'activityStartTime',
end:'activityEndTime',
},
{
type: 'input',
label:'活动标题',
prop:'title',
placeholder:'请输入'
},
{
type: 'input',
label:'主办方',
prop:'organizerName',
placeholder:'请输入'
},
{
type: 'input',
label:'活动联系人',
prop:'activityContact',
placeholder:'请输入'
},
]
export const columns = [
{

@ -1,4 +1,5 @@
export const form = {
id:undefined,
title:undefined,
organizerId:undefined,
isShow:false,

@ -1,7 +1,7 @@
<template>
<div>
<div class="cardTitle">活动管理</div>
<searchForm :formItem="formItem" @getSearch="getData($event)"></searchForm>
<searchForm :formItem="formItem" @getSearch="getData($event)" @changeTime='changeTime'></searchForm>
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true"
>新增活动</a-button
>
@ -127,6 +127,12 @@ export default {
this.pagination.total = res.data.total;
this.selectedRowKeys=[]
},
changeTime(data,start,end){
console.log(start);
this.searchForm[start] = data[0]
this.searchForm[end] = data[1]
console.log(this.searchForm);
},
edit(id) {
this.editId = id;
this.drawer.show = true;

@ -0,0 +1,65 @@
export const formItem = [
{
type: 'input',
label:'话题标题',
prop:'title',
placeholder:'请输入标题'
},
{
type: 'select',
label:'状态',
prop:'status',
option:[{ id:1,name:'启用中'},{ id:2,name:'禁用中'}],
placeholder:'请选择状态'
},
{
type: 'select',
label:'是否公开',
prop:'isPublic',
placeholder:'请选择',
option:[{ id:1,name:'是'},{ id:0,name:'否'}]
},
]
export const columns = [
{
title: "主办方单位",
dataIndex: "unit",
width: "16%",
},
{
title: "联系人",
dataIndex: "contact",
width: "12%",
},
{
title: "联系方式",
dataIndex: "tel",
width: "15%",
},
{
title: "举办次数",
dataIndex: "holdNum",
width: "12%",
},
{
title: "创建时间",
dataIndex: "createDate",
width: "20%",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}

@ -0,0 +1,25 @@
export const form = {
id:undefined,
unit:undefined,
contact:undefined,
tel:undefined,
idType:undefined,
idNumber:undefined,
remarks:undefined,
imgUrls:[],
}
export const rules = {
unit:[{required:true,message:'请输入标题',trigger:'blur'}],
contact:[{required:true,message:'请输入标题',trigger:'blur'}],
tel:[{required:true,message:'请输入标题',trigger:'blur'}],
idType:[{required:true,message:'请选择',trigger:'change'}],
idNumber:[{required:true,message:'请输入标题',trigger:'blur'}],
remarks:[{required:true,message:'请输入标题',trigger:'blur'}],
}
export const options = {
idType:[
{ id:1, name:'身份证' },
{ id:2, name:'营业执照' },
],
}

@ -0,0 +1,196 @@
<template>
<div>
<a-drawer
:title="title"
:width="720"
:visible="show"
:body-style="{ paddingBottom: '80px' }"
@close="addClose"
>
<div class="drawer-content">
基本信息
<a-divider></a-divider>
<a-form-model
ref="ruleForm"
:model="form"
:rules="rules"
layout="vertical"
>
<a-row>
<a-col :span="12">
<a-form-model-item prop="unit" label="活动联系人">
<a-input
v-model="form.unit"
placeholder="请输入主办方名称"
style="width: 80%"
></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="contact" label="联系人">
<a-input
v-model="form.contact"
placeholder="请输入联系人"
style="width: 80%"
></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="tel" label="联系方式">
<a-input
v-model="form.tel"
placeholder="请输入联系方式"
style="width: 80%"
></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="idType" label="证件类型">
<a-select
v-model="form.idType"
placeholder="请选择"
style="width: 80%"
>
<a-select-option v-for="item in options.idType" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="idNumber" label="证件号码">
<a-input
v-model="form.idNumber"
placeholder="请输入证件号码"
style="width: 80%"
></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item prop="remarks" label="备注">
<a-textarea
v-model="form.remarks"
placeholder="请输入备注"
style="width: 80%"
></a-textarea>
</a-form-model-item>
</a-col>
<a-col :span="24">
主办方图片
<commonUpload :fileList='fileList' @handleChange='handleChange'></commonUpload>
</a-col>
</a-row>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="addClose">
关闭
</a-button>
<a-button type="primary" @click="submit"> </a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import { form, rules, options } from "./form.js";
import {
organizerInsert,
organizerUpdate,
organizerInfo,
} from "@/api/operation/activity/organizer";
export default {
props: {
show: {
type: Boolean,
default: false,
},
editId: Number,
},
data() {
return {
title: "新增主办方",
form,
rules,
options,
fileList: [],
};
},
methods: {
addClose() {
this.$refs.ruleForm.resetFields();
this.fileList = [];
this.$emit("addClose");
},
success() {
this.$emit("success");
this.addClose();
},
submit() {
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
if (this.editId === null) {
let res = await organizerInsert(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
} else {
this.$message.error(res.msg);
}
} else {
console.log(this.form);
let res = await organizerUpdate(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
} else {
this.$message.error(res.msg);
}
}
}
});
},
handleChange(data) {
this.fileList = data;
this.form.imgUrls=[]
if (data[0].status === "done") {
console.log('-------done-------');
this.form.imgUrls.push(data[0].response.data);
}
},
},
watch: {
editId: {
handler(val) {
if (val !== null) {
this.title = "修改主办方";
this.form.id = val;
organizerInfo({ activityOrganizerId: val }).then((res) => {
this.form = res.data;
if (res.data.imgList.length > 0) {
console.log(res.data.imgList);
const pic = [];
for (let item of res.data.imgList) {
let obj = {
name: item.url.split("_")[0] + "." + item.url.split(".")[1],
url: this.$ImgUrl(item.url),
uid: item.url.split("_")[1],
status: "done",
thumbUrl: this.$ImgUrl(item.url),
};
pic.push(obj);
}
this.fileList = pic;
}else{
this.form.imgUrls=[]
}
});
} else {
this.title = "新增主办方";
}
},
immediate: true,
},
},
};
</script>
<style></style>

@ -1,13 +1,168 @@
<template>
<div></div>
<div>
<div class="cardTitle">活动主办方</div>
<searchForm :formItem="formItem" @getSearch="getData($event)"></searchForm>
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true"
>新增主办方</a-button
>
<a-table
:columns="columns"
:data-source="tableData"
:pagination="pagination"
:scroll="{ x: 1600 }"
@change="handleTableChange"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: selectionChoosed,
}"
:row-key="
(record, index) => {
return record.id;
}
"
>
<span slot="action" slot-scope="text, row">
<a-space>
<a class="ant-dropdown-link" @click="edit(row.id)"></a>
<a class="ant-dropdown-link" @click="del([row.id])"></a>
</a-space>
</span>
</a-table>
<div class="action">
<a-dropdown :disabled="!hasSelected">
<a-menu slot="overlay" @click="handleMenuClick">
<a-menu-item key="del"> 批量删除 </a-menu-item>
</a-menu>
<a-button> 批量操作 <a-icon type="down" /> </a-button>
</a-dropdown>
<span style="margin-left: 8px">
<template v-if="hasSelected">
{{ `已选择 ${selectedRowKeys.length}` }}
</template>
</span>
</div>
<addForm
:show="drawer.show"
@success="success"
@addClose="addClose"
:editId="editId"
></addForm>
</div>
</template>
<script>
import { organizerList, organizerDel } from "@/api/operation/activity/organizer";
import { formItem, columns, pagination } from "./depend/config";
import addForm from "./depend/form.vue";
export default {
}
components: {
addForm,
},
data() {
return {
drawer: {
show: false,
},
editId: null,
tableData: [],
searchForm: {
unit: undefined,
contact: undefined,
tel: undefined,
holdNumType: undefined,
holdNum: undefined,
createStartDate: undefined,
createEndDate: undefined,
},
formItem,
columns,
pagination,
// index
selectedRowKeys: [],
};
},
mounted() {
this.getData();
},
methods: {
async getData(data) {
if (data !== undefined) {
console.log(data);
this.searchForm = data;
console.log(this.searchForm);
}
let res = await organizerList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
unit: this.searchForm.unit,
contact: this.searchForm.contact,
tel: this.searchForm.tel,
holdNumType: this.searchForm.holdNumType,
holdNum: this.searchForm.holdNum,
createStartDate: this.searchForm.createStartDate,
createEndDate: this.searchForm.createEndDate,
});
this.tableData = res.data.rows;
this.pagination.total = res.data.total;
this.selectedRowKeys=[]
},
edit(id) {
this.editId = id;
this.drawer.show = true;
},
del(ids) {
console.log(ids);
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "delete",
onOk: async () => {
let res = await organizerDel({ activityOrganizerIds: ids });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
},
});
},
selectionChoosed(data) {
this.selectedRowKeys = data;
},
handleMenuClick(data) {
console.log(data);
if (data.key === "del") {
this.del(this.selectedRowKeys);
}
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.getData();
},
addClose() {
this.drawer.show = false;
this.editId = null;
},
success() {
this.getData();
},
},
computed: {
hasSelected() {
return this.selectedRowKeys.length > 0;
},
},
};
</script>
<style>
<style lang="less" scoped>
.table-img {
width: 40px;
height: 40px;
}
</style>

@ -0,0 +1,13 @@
<template>
<router-view></router-view>
</template>
<script>
export default {
}
</script>
<style>
</style>

@ -0,0 +1,13 @@
<template>
<router-view></router-view>
</template>
<script>
export default {
}
</script>
<style>
</style>
Loading…
Cancel
Save