main
bibi 3 years ago
parent 81046c919f
commit 6bb01721f5

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

@ -1,126 +1,65 @@
export const formItem = [
{
type: 'select',
label:'状态',
prop:'status',
option:[{ id:1,name:'报名未开始'},{ id:2,name:'报名进行中'},{ id:3,name:'活动未开始'},{ id:4,name:'活动进行中'},{ id:5,name:'活动已结束'}],
placeholder:'请选择状态'
label:'资讯分类',
prop:'categoryId',
option:[],
placeholder:'请选择'
},
{
type: 'time',
label:'报名时间',
start: 'registrationStartTime',
end:'registrationEndTime',
type: 'select',
label:'发布状态',
prop:'status',
option:[{ id:1,name:'未发布'},{ id:2,name:'已发布'},],
placeholder:'请选择状态'
},
{
type: 'time',
label:'活动时间',
start: 'activityStartTime',
end:'activityEndTime',
label:'创建时间',
start: 'createStartDate',
end:'createEndDate',
},
{
type: 'input',
label:'活动标题',
label:'标题',
prop:'title',
placeholder:'请输入'
},
{
type: 'input',
label:'主办方',
prop:'organizerName',
placeholder:'请输入'
},
{
type: 'input',
label:'活动联系人',
prop:'activityContact',
placeholder:'请输入'
},
]
export const columns = [
{
title: "发布时间",
dataIndex: "createDate",
width: "12%",
title: "标题",
dataIndex: "title",
width: "10%",
},
{
title: "图片",
dataIndex: "imgpic",
title: "分类",
dataIndex: "categoryName",
width: "10%",
scopedSlots: { customRender: "imgpic"}
},
{
title: "活动状态",
title: "发布状态",
dataIndex: "status",
width: "6%",
customRender: function (status) {
switch (status) {
case 1:
return '报名未开始'
return '未发布'
case 2:
return '报名进行中'
case 3:
return '活动未开始'
case 4:
return '活动进行中'
case 5:
return '活动已结束'
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: "主办方",
dataIndex: "organizerName",
width: "8%",
},
{
title: "活动内容",
dataIndex: "content",
width: "8%",
},
{
title: "报名人数",
dataIndex: "registrationNum",
width: "5%",
},
{
title: "报名时间",
width: "12%",
customRender: function (data) {
return (data.registrationStartTime + '——' + data.registrationEndTime)
}
title: "阅读量",
dataIndex: "viewsNum",
width: "10%",
},
{
title: "活动时间",
title: "创建时间",
dataIndex: "createDate",
width: "12%",
customRender: function (data) {
return (data.activityStartTime + '——' + data.activityEndTime)
}
},
{
title: "操作",
@ -131,23 +70,6 @@ export const columns = [
scopedSlots: { customRender: "action" },
},
]
export const detailColumns = [
{
title: "报名人",
dataIndex: "name",
width: "22%",
},
{
title: "报名联系方式",
dataIndex: "tel",
width: "32%",
},
{
title: "报名时间",
dataIndex: "createDate",
width: "32%",
},
]
export const pagination = {
current: 1,
total: 0,
@ -155,12 +77,4 @@ export const pagination = {
showTotal: (total) => `${total}`,
showSizeChanger: 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-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 class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="detailClose">
@ -82,8 +70,7 @@
</template>
<script>
import { activityInfo, registrationList } from "@/api/operation/activity";
import { detailColumns, detailpagination } from "./config";
import { newsInfo } from "@/api/operation/news/index.js";
export default {
props: {
show: {
@ -94,37 +81,10 @@ export default {
},
data() {
return {
tableData: [],
detailData: {},
detailColumns,
pagination: detailpagination,
};
},
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: {
detailClose() {
this.$emit("detailClose");
@ -142,14 +102,8 @@ export default {
detailId: {
handler(id) {
if (id !== null && id !== undefined) {
console.log(id);
Promise.all([
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;
newsInfo({ informationId: id }).then((res) => {
this.detailData = res.data;
});
}
},

@ -1,48 +1,21 @@
export const form = {
id:undefined,
title:undefined,
organizerId:undefined,
isShow:false,
activityObject:undefined,
categoryId:undefined,
status:undefined,
content:undefined,
registrationStartTime:undefined,
registrationEndTime:undefined,
activityStartTime:undefined,
activityEndTime:undefined,
activityAddress:undefined,
registrationNumMax:undefined,
registrationCost:undefined,
activityContact:undefined,
activityTel:undefined,
imgUrls:[]
}
export const rules = {
title:[{required:true,message:'请输入标题',trigger:'blur'}],
organizerId:[{required:true,message:'请选择',trigger:'change'}],
isShow:[{required:true,message:'请选择',trigger:'change'}],
activityObject:[{required:true,message:'请选择活动对象',trigger:'change'}],
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'}],
categoryId:[{required:true,message:'请选择分类',trigger:'change'}],
status:[{required:true,message:'请选择',trigger:'change'}],
content:[{required:true,message:'请输入',trigger:'blur'}],
}
export const options = {
isShow:[
{ id:true, name:'显示' },
{ id:false, name:'不显示' },
status:[
{ id:1, name:'未发布' },
{ id:2, name:'已发布' },
],
activityObject: [
{ id:1, name:'全部' },
{ id:2, name:'住户' },
{ id:3, name:'业主' },
{ id:4, name:'租户' },
{ id:5, name:'管家' },
],
organizer:[]
categoryId:[]
}

@ -27,41 +27,30 @@
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="organizerId" label="主办方">
<a-form-model-item prop="categoryId" label="资讯分类">
<a-select
v-model="form.organizerId"
v-model="form.categoryId"
placeholder="请选择"
style="width: 80%"
>
<a-select-option
v-for="item in options.organizer"
v-for="item in options.categoryId"
:key="item.id"
:value="item.id"
>{{ item.unit }}</a-select-option
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item prop="isShow" 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-form-model-item prop="status" label="发布状态">
<a-select
v-model="form.activityObject"
v-model="form.status"
placeholder="请选择"
style="width: 80%"
>
<a-select-option
v-for="item in options.activityObject"
v-for="item in options.status"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
@ -78,93 +67,8 @@
></a-textarea>
</a-form-model-item>
</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">
活动图片
资讯封面图片
<commonUpload
:fileList="fileList"
@handleChange="handleChange"
@ -186,11 +90,11 @@
<script>
import { form, rules, options } from "./form.js";
import {
activityInsert,
activityUpdate,
activityInfo,
organizerSelect,
} from "@/api/operation/activity";
newsInsert,
newsUpdate,
newsInfo,
itemSelect
} from "@/api/operation/news/index.js";
export default {
props: {
show: {
@ -201,7 +105,7 @@ export default {
},
data() {
return {
title: "新增活动",
title: "新增资讯",
form,
rules,
options,
@ -209,12 +113,12 @@ export default {
};
},
mounted() {
this.getOrganizer();
this.getItem();
},
methods: {
async getOrganizer() {
let res = await organizerSelect();
this.options.organizer = res.data;
async getItem() {
let res = await itemSelect();
this.options.categoryId = res.data;
},
addClose() {
this.$refs.ruleForm.resetFields();
@ -229,7 +133,7 @@ export default {
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
if (this.editId === null) {
let res = await activityInsert(this.form);
let res = await newsInsert(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
@ -238,7 +142,7 @@ export default {
}
} else {
console.log(this.form);
let res = await activityUpdate(this.form);
let res = await newsUpdate(this.form);
if (res.code === 200) {
this.$message.success(res.msg);
this.success();
@ -261,9 +165,9 @@ export default {
editId: {
handler(val) {
if (val !== null) {
this.title = "修改活动";
this.title = "修改资讯";
this.form.id = val;
activityInfo({ activityId: val }).then((res) => {
newsInfo({ informationId: val }).then((res) => {
this.form = res.data;
if (res.data.imgList.length > 0) {
console.log(res.data.imgList);
@ -284,7 +188,7 @@ export default {
}
});
} else {
this.title = "新增活动";
this.title = "新增资讯";
}
},
immediate: true,

@ -1,9 +1,9 @@
<template>
<div>
<div class="cardTitle">活动管理</div>
<div class="cardTitle">资讯管理</div>
<searchForm :formItem="formItem" @getSearch="getData($event)" @changeTime='changeTime'></searchForm>
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true"
>新增活动</a-button
>新增资讯</a-button
>
<a-table
:columns="columns"
@ -28,22 +28,6 @@
<a class="ant-dropdown-link" @click="del([row.id])"></a>
</a-space>
</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>
<div class="action">
<a-dropdown :disabled="!hasSelected">
@ -69,7 +53,7 @@
</template>
<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 addForm from "./depend/form.vue";
import detailForm from "./depend/detail.vue";
@ -108,6 +92,7 @@ export default {
},
mounted() {
this.getData();
this.getItem();
},
methods: {
async getData(data) {
@ -116,7 +101,7 @@ export default {
this.searchForm = data;
console.log(this.searchForm);
}
let res = await activityList({
let res = await newsList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
...this.searchForm
@ -125,6 +110,10 @@ export default {
this.pagination.total = res.data.total;
this.selectedRowKeys=[]
},
async getItem(){
let res = await itemSelect()
this.formItem[0].option = res.data
},
changeTime(data,start,end){
console.log(start);
this.searchForm[start] = data[0]
@ -143,7 +132,7 @@ export default {
// cancelText:'',
icon: "delete",
onOk: async () => {
let res = await activityDel({ activityIds: ids });
let res = await newsDel({ informationIds: ids });
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();

Loading…
Cancel
Save