main
bibi 3 years ago
parent 81046c919f
commit 6bb01721f5

@ -109,7 +109,7 @@ export default {
// cancelText:'', // cancelText:'',
icon: "delete", icon: "delete",
onOk: async () => { onOk: async () => {
let res = await newsItemDel({ activityOrganizerIds: ids }); let res = await newsItemDel({ informationCategoryIds: ids });
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.msg); this.$message.success(res.msg);
this.getData(); this.getData();

@ -1,126 +1,65 @@
export const formItem = [ export const formItem = [
{ {
type: 'select', type: 'select',
label:'状态', label:'资讯分类',
prop:'status', prop:'categoryId',
option:[{ id:1,name:'报名未开始'},{ id:2,name:'报名进行中'},{ id:3,name:'活动未开始'},{ id:4,name:'活动进行中'},{ id:5,name:'活动已结束'}], option:[],
placeholder:'请选择状态' placeholder:'请选择'
}, },
{ {
type: 'time', type: 'select',
label:'报名时间', label:'发布状态',
start: 'registrationStartTime', prop:'status',
end:'registrationEndTime', option:[{ id:1,name:'未发布'},{ id:2,name:'已发布'},],
placeholder:'请选择状态'
}, },
{ {
type: 'time', type: 'time',
label:'活动时间', label:'创建时间',
start: 'activityStartTime', start: 'createStartDate',
end:'activityEndTime', end:'createEndDate',
}, },
{ {
type: 'input', type: 'input',
label:'活动标题', label:'标题',
prop:'title', prop:'title',
placeholder:'请输入' placeholder:'请输入'
}, },
{
type: 'input',
label:'主办方',
prop:'organizerName',
placeholder:'请输入'
},
{
type: 'input',
label:'活动联系人',
prop:'activityContact',
placeholder:'请输入'
},
] ]
export const columns = [ export const columns = [
{ {
title: "发布时间", title: "标题",
dataIndex: "createDate", dataIndex: "title",
width: "12%", width: "10%",
}, },
{ {
title: "图片", title: "分类",
dataIndex: "imgpic", dataIndex: "categoryName",
width: "10%", width: "10%",
scopedSlots: { customRender: "imgpic"}
}, },
{ {
title: "活动状态", title: "发布状态",
dataIndex: "status", dataIndex: "status",
width: "6%", width: "6%",
customRender: function (status) { customRender: function (status) {
switch (status) { switch (status) {
case 1: case 1:
return '报名未开始' return '未发布'
case 2: case 2:
return '报名进行中' return '已发布'
case 3:
return '活动未开始'
case 4:
return '活动进行中'
case 5:
return '活动已结束'
}
}
},
{
title: "活动标题",
dataIndex: "title",
width: "8%",
},
{
title: "活动地点",
dataIndex: "activityAddress",
width: "8%",
},
{
title: "是否显示在app",
dataIndex: "isShow",
width: "5%",
customRender: function (isShow) {
switch (isShow) {
case true:
return '显示'
case false:
return '不显示'
} }
} }
}, },
{ {
title: "主办方", title: "阅读量",
dataIndex: "organizerName", dataIndex: "viewsNum",
width: "8%", width: "10%",
},
{
title: "活动内容",
dataIndex: "content",
width: "8%",
},
{
title: "报名人数",
dataIndex: "registrationNum",
width: "5%",
},
{
title: "报名时间",
width: "12%",
customRender: function (data) {
return (data.registrationStartTime + '——' + data.registrationEndTime)
}
}, },
{ {
title: "活动时间", title: "创建时间",
dataIndex: "createDate",
width: "12%", width: "12%",
customRender: function (data) {
return (data.activityStartTime + '——' + data.activityEndTime)
}
}, },
{ {
title: "操作", title: "操作",
@ -131,23 +70,6 @@ export const columns = [
scopedSlots: { customRender: "action" }, scopedSlots: { customRender: "action" },
}, },
] ]
export const detailColumns = [
{
title: "报名人",
dataIndex: "name",
width: "22%",
},
{
title: "报名联系方式",
dataIndex: "tel",
width: "32%",
},
{
title: "报名时间",
dataIndex: "createDate",
width: "32%",
},
]
export const pagination = { export const pagination = {
current: 1, current: 1,
total: 0, total: 0,
@ -156,11 +78,3 @@ export const pagination = {
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
} }
export const detailpagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}

@ -59,18 +59,6 @@
</a-descriptions> </a-descriptions>
报名记录 报名记录
<a-divider></a-divider> <a-divider></a-divider>
<a-table
:columns="detailColumns"
:data-source="tableData"
:pagination="pagination"
:scroll="{ x: 600 }"
@change="handleTableChange"
:row-key="
(record, index) => {
return record.id;
}
"
></a-table>
</div> </div>
<div class="drawer-footer"> <div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="detailClose"> <a-button :style="{ marginRight: '8px' }" @click="detailClose">
@ -82,8 +70,7 @@
</template> </template>
<script> <script>
import { activityInfo, registrationList } from "@/api/operation/activity"; import { newsInfo } from "@/api/operation/news/index.js";
import { detailColumns, detailpagination } from "./config";
export default { export default {
props: { props: {
show: { show: {
@ -94,37 +81,10 @@ export default {
}, },
data() { data() {
return { return {
tableData: [],
detailData: {}, detailData: {},
detailColumns,
pagination: detailpagination,
}; };
}, },
mounted() {}, mounted() {},
filters: {
activityObject(value) {
switch (value) {
case 1:
return "全部";
break;
case 2:
return "住户";
break;
case 3:
return "业主";
break;
case 4:
return "租户";
break;
case 5:
return "管家";
break;
default:
break;
}
},
},
methods: { methods: {
detailClose() { detailClose() {
this.$emit("detailClose"); this.$emit("detailClose");
@ -142,14 +102,8 @@ export default {
detailId: { detailId: {
handler(id) { handler(id) {
if (id !== null && id !== undefined) { if (id !== null && id !== undefined) {
console.log(id); newsInfo({ informationId: id }).then((res) => {
Promise.all([ this.detailData = res.data;
activityInfo({ activityId: id }),
registrationList({ activityId: id }),
]).then((res) => {
this.detailData = res[0].data;
this.tableData = res[1].data.rows;
this.pagination.total = res[1].data.total;
}); });
} }
}, },

@ -1,48 +1,21 @@
export const form = { export const form = {
id:undefined, id:undefined,
title:undefined, title:undefined,
organizerId:undefined, categoryId:undefined,
isShow:false, status:undefined,
activityObject:undefined,
content:undefined, content:undefined,
registrationStartTime:undefined,
registrationEndTime:undefined,
activityStartTime:undefined,
activityEndTime:undefined,
activityAddress:undefined,
registrationNumMax:undefined,
registrationCost:undefined,
activityContact:undefined,
activityTel:undefined,
imgUrls:[] imgUrls:[]
} }
export const rules = { export const rules = {
title:[{required:true,message:'请输入标题',trigger:'blur'}], title:[{required:true,message:'请输入标题',trigger:'blur'}],
organizerId:[{required:true,message:'请选择',trigger:'change'}], categoryId:[{required:true,message:'请选择分类',trigger:'change'}],
isShow:[{required:true,message:'请选择',trigger:'change'}], status:[{required:true,message:'请选择',trigger:'change'}],
activityObject:[{required:true,message:'请选择活动对象',trigger:'change'}], content:[{required:true,message:'请输入',trigger:'blur'}],
content:[{required:true,message:'请输入内容',trigger:'blur'}],
registrationStartTime:[{required:true,message:'请选择',trigger:'change'}],
registrationEndTime:[{required:true,message:'请选择',trigger:'change'}],
activityStartTime:[{required:true,message:'请选择',trigger:'change'}],
activityEndTime:[{required:true,message:'请选择',trigger:'change'}],
activityAddress:[{required:true,message:'请输入活动地址',trigger:'blur'}],
registrationNumMax:[{required:true,message:'请输入人数上限',trigger:'blur'}],
registrationCost:[{required:true,message:'请输入报名费用',trigger:'blur'}],
activityContact:[{required:true,message:'请输入活动联系人',trigger:'blur'}],
activityTel:[{required:true,message:'请输入活动联系方式',trigger:'blur'}],
} }
export const options = { export const options = {
isShow:[ status:[
{ id:true, name:'显示' }, { id:1, name:'未发布' },
{ id:false, name:'不显示' }, { id:2, name:'已发布' },
], ],
activityObject: [ categoryId:[]
{ id:1, name:'全部' },
{ id:2, name:'住户' },
{ id:3, name:'业主' },
{ id:4, name:'租户' },
{ id:5, name:'管家' },
],
organizer:[]
} }

@ -27,41 +27,30 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item prop="organizerId" label="主办方"> <a-form-model-item prop="categoryId" label="资讯分类">
<a-select <a-select
v-model="form.organizerId" v-model="form.categoryId"
placeholder="请选择" placeholder="请选择"
style="width: 80%" style="width: 80%"
> >
<a-select-option <a-select-option
v-for="item in options.organizer" v-for="item in options.categoryId"
:key="item.id" :key="item.id"
:value="item.id" :value="item.id"
>{{ item.unit }}</a-select-option >{{ item.name }}</a-select-option
> >
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item prop="isShow" label="是否显示"> <a-form-model-item prop="status" label="发布状态">
<a-switch
checked-children="开"
un-checked-children="关"
v-model="form.isShow"
style="margin-left: 20px"
>
</a-switch>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="activityObject" label="活动对象">
<a-select <a-select
v-model="form.activityObject" v-model="form.status"
placeholder="请选择" placeholder="请选择"
style="width: 80%" style="width: 80%"
> >
<a-select-option <a-select-option
v-for="item in options.activityObject" v-for="item in options.status"
:key="item.id" :key="item.id"
:value="item.id" :value="item.id"
>{{ item.name }}</a-select-option >{{ item.name }}</a-select-option
@ -78,93 +67,8 @@
></a-textarea> ></a-textarea>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">
<a-form-model-item
prop="registrationStartTime"
label="报名开始时间"
>
<a-date-picker
v-model="form.registrationStartTime"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item
prop="registrationEndTime"
label="报名结束时间"
>
<a-date-picker
v-model="form.registrationEndTime"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="activityStartTime" label="活动开始时间">
<a-date-picker
v-model="form.activityStartTime"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="activityEndTime" label="活动结束时间">
<a-date-picker
v-model="form.activityEndTime"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="registrationNumMax" label="报名人数上限">
<a-input-number
v-model="form.registrationNumMax"
placeholder="请输入人数"
:min="0"
style="width: 30%"
></a-input-number>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="activityAddress" label="活动地址">
<a-input
v-model="form.activityAddress"
placeholder="请输入活动地址"
style="width: 80%"
></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="registrationCost" label="报名费用">
<a-input-number
v-model="form.registrationCost"
placeholder="请输入费用"
:min="0"
style="width: 30%"
></a-input-number>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="activityContact" label="活动联系人">
<a-input
v-model="form.activityContact"
placeholder="请输入活动联系人"
style="width: 80%"
></a-input>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="activityTel" label="活动联系方式">
<a-input
v-model="form.activityTel"
placeholder="请输入活动联系人"
style="width: 80%"
></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24"> <a-col :span="24">
活动图片 资讯封面图片
<commonUpload <commonUpload
:fileList="fileList" :fileList="fileList"
@handleChange="handleChange" @handleChange="handleChange"
@ -186,11 +90,11 @@
<script> <script>
import { form, rules, options } from "./form.js"; import { form, rules, options } from "./form.js";
import { import {
activityInsert, newsInsert,
activityUpdate, newsUpdate,
activityInfo, newsInfo,
organizerSelect, itemSelect
} from "@/api/operation/activity"; } from "@/api/operation/news/index.js";
export default { export default {
props: { props: {
show: { show: {
@ -201,7 +105,7 @@ export default {
}, },
data() { data() {
return { return {
title: "新增活动", title: "新增资讯",
form, form,
rules, rules,
options, options,
@ -209,12 +113,12 @@ export default {
}; };
}, },
mounted() { mounted() {
this.getOrganizer(); this.getItem();
}, },
methods: { methods: {
async getOrganizer() { async getItem() {
let res = await organizerSelect(); let res = await itemSelect();
this.options.organizer = res.data; this.options.categoryId = res.data;
}, },
addClose() { addClose() {
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
@ -229,7 +133,7 @@ export default {
this.$refs.ruleForm.validate(async (valid) => { this.$refs.ruleForm.validate(async (valid) => {
if (valid) { if (valid) {
if (this.editId === null) { if (this.editId === null) {
let res = await activityInsert(this.form); let res = await newsInsert(this.form);
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.msg); this.$message.success(res.msg);
this.success(); this.success();
@ -238,7 +142,7 @@ export default {
} }
} else { } else {
console.log(this.form); console.log(this.form);
let res = await activityUpdate(this.form); let res = await newsUpdate(this.form);
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.msg); this.$message.success(res.msg);
this.success(); this.success();
@ -261,9 +165,9 @@ export default {
editId: { editId: {
handler(val) { handler(val) {
if (val !== null) { if (val !== null) {
this.title = "修改活动"; this.title = "修改资讯";
this.form.id = val; this.form.id = val;
activityInfo({ activityId: val }).then((res) => { newsInfo({ informationId: val }).then((res) => {
this.form = res.data; this.form = res.data;
if (res.data.imgList.length > 0) { if (res.data.imgList.length > 0) {
console.log(res.data.imgList); console.log(res.data.imgList);
@ -284,7 +188,7 @@ export default {
} }
}); });
} else { } else {
this.title = "新增活动"; this.title = "新增资讯";
} }
}, },
immediate: true, immediate: true,

@ -1,9 +1,9 @@
<template> <template>
<div> <div>
<div class="cardTitle">活动管理</div> <div class="cardTitle">资讯管理</div>
<searchForm :formItem="formItem" @getSearch="getData($event)" @changeTime='changeTime'></searchForm> <searchForm :formItem="formItem" @getSearch="getData($event)" @changeTime='changeTime'></searchForm>
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true" <a-button style="margin: 10px" class="add-btn" @click="drawer.show = true"
>新增活动</a-button >新增资讯</a-button
> >
<a-table <a-table
:columns="columns" :columns="columns"
@ -28,22 +28,6 @@
<a class="ant-dropdown-link" @click="del([row.id])"></a> <a class="ant-dropdown-link" @click="del([row.id])"></a>
</a-space> </a-space>
</span> </span>
<span slot="imgpic" slot-scope="text, row">
<img
v-if="row.imgList.length > 0"
:src="$ImgUrl(row.imgList[0].url)"
class="table-img"
alt=""
/>
<span v-else></span>
</span>
<span slot="switch" slot-scope="switchV, row">
<a-switch
checked-children="开" un-checked-children="关"
:checked="switchV === 1"
@change="handleEnable(row)"
></a-switch>
</span>
</a-table> </a-table>
<div class="action"> <div class="action">
<a-dropdown :disabled="!hasSelected"> <a-dropdown :disabled="!hasSelected">
@ -69,7 +53,7 @@
</template> </template>
<script> <script>
import { activityList, activityDel } from "@/api/operation/activity"; import { newsList, newsDel,itemSelect } from "@/api/operation/news/index.js";
import { formItem, columns, pagination } from "./depend/config"; import { formItem, columns, pagination } from "./depend/config";
import addForm from "./depend/form.vue"; import addForm from "./depend/form.vue";
import detailForm from "./depend/detail.vue"; import detailForm from "./depend/detail.vue";
@ -108,6 +92,7 @@ export default {
}, },
mounted() { mounted() {
this.getData(); this.getData();
this.getItem();
}, },
methods: { methods: {
async getData(data) { async getData(data) {
@ -116,7 +101,7 @@ export default {
this.searchForm = data; this.searchForm = data;
console.log(this.searchForm); console.log(this.searchForm);
} }
let res = await activityList({ let res = await newsList({
pageNum: this.pagination.current, pageNum: this.pagination.current,
size: this.pagination.pageSize, size: this.pagination.pageSize,
...this.searchForm ...this.searchForm
@ -125,6 +110,10 @@ export default {
this.pagination.total = res.data.total; this.pagination.total = res.data.total;
this.selectedRowKeys=[] this.selectedRowKeys=[]
}, },
async getItem(){
let res = await itemSelect()
this.formItem[0].option = res.data
},
changeTime(data,start,end){ changeTime(data,start,end){
console.log(start); console.log(start);
this.searchForm[start] = data[0] this.searchForm[start] = data[0]
@ -143,7 +132,7 @@ export default {
// cancelText:'', // cancelText:'',
icon: "delete", icon: "delete",
onOk: async () => { onOk: async () => {
let res = await activityDel({ activityIds: ids }); let res = await newsDel({ informationIds: ids });
if (res.code === 200) { if (res.code === 200) {
this.$message.success(res.msg); this.$message.success(res.msg);
this.getData(); this.getData();

Loading…
Cancel
Save