|
|
@@ -4,11 +4,11 @@
|
|
|
<el-form-item label="活动类型" prop="activityType">
|
|
|
<DictSelect v-model="queryParams.activityType" :dictOptions="activityTypeOption" placeholder="请选择"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="城市" prop="activityCity">
|
|
|
- <DictSelect v-model="queryParams.activityCity" :dictOptions="cityOptions" placeholder="请选择"/>
|
|
|
+ <el-form-item label="城市" prop="cityCode">
|
|
|
+ <DictSelect v-model="queryParams.cityCode" :dictOptions="cityOptions" placeholder="请选择"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="状态" prop="activityStatus">
|
|
|
- <DictSelect v-model="queryParams.activityStatus" :dictOptions="statusOption" placeholder="请选择"/>
|
|
|
+ <el-form-item label="状态" prop="status">
|
|
|
+ <DictSelect v-model="queryParams.status" :dictOptions="statusOption" placeholder="请选择"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="活动时间" prop="dateRange">
|
|
|
<el-date-picker
|
|
|
@@ -46,11 +46,17 @@
|
|
|
</el-row>
|
|
|
|
|
|
<tableCompontent ref="tableRef" height="72vh" :loading="loading" :tableData="list" :columnData="columnData">
|
|
|
- <template v-slot:activityStatus="row">
|
|
|
- <span v-if="row.activityStatus == '1'" style="color: #85c91e">进行中</span>
|
|
|
- <span v-else-if="row.activityStatus == '3'" style="color: red">已结束</span>
|
|
|
- <span v-else>--</span>
|
|
|
+ <template v-slot:status="row">
|
|
|
+ <span v-if="row.status == '0'" style="color: #909399">未开始</span>
|
|
|
+ <span v-else-if="row.status == '1'" style="color: #67c23a">进行中</span>
|
|
|
+ <span v-else-if="row.status == '2'" style="color: #f56c6c">已结束</span>
|
|
|
+ <span v-else-if="row.status == '3'" style="color: #e6a23c">草稿</span>
|
|
|
</template>
|
|
|
+ <template v-slot:activityTime="row">
|
|
|
+ <span v-if="row.isPermanent == '0'"> {{ parseTime(row.startTime, '{y}-{m}-{d}') }} - {{ parseTime(row.endTime, '{y}-{m}-{d}') }}</span>
|
|
|
+ <span v-else>长期有效</span>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template v-slot:nickName="row">
|
|
|
<el-link type="primary" slot="reference" @click="viewStatistics(row)">查看统计</el-link>
|
|
|
</template>
|
|
|
@@ -80,7 +86,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getActivityList } from "@/api/points/rules_api";
|
|
|
+import { getCity,getActivityList } from "@/api/points/rules_api";
|
|
|
import tableCompontent from "@/components/tableCompontent/index.vue";
|
|
|
import listMixin from '@/utils/listMixin';
|
|
|
import ExpirationPoints from "./compontents/Expiration_points.vue";
|
|
|
@@ -99,25 +105,9 @@ export default {
|
|
|
return {
|
|
|
// 用户表格数据
|
|
|
list: null,
|
|
|
- activityTypeOption:[
|
|
|
- { label: '签到活动', value: '1' },
|
|
|
- { label: '新手活动', value: '2' },
|
|
|
- { label: '每日活动', value: '3' },
|
|
|
- { label: '每月活动', value: '4' }
|
|
|
- ],
|
|
|
- cityOptions: [
|
|
|
- { label: '太原', value: '1' },
|
|
|
- { label: '北京', value: '2' },
|
|
|
- { label: '上海', value: '3' },
|
|
|
- { label: '广州', value: '4' },
|
|
|
- { label: '深圳', value: '5' }
|
|
|
- ],
|
|
|
- statusOption:[
|
|
|
- {label:'进行中',value:'1'},
|
|
|
- {label:'已结束',value:'2'},
|
|
|
- {label:'未开始',value:'3'},
|
|
|
- {label:'草稿',value:'4'}
|
|
|
- ],
|
|
|
+ activityTypeOption:[],
|
|
|
+ cityOptions: [],
|
|
|
+ statusOption:[],
|
|
|
columnData:[
|
|
|
{
|
|
|
prop: 'seq',
|
|
|
@@ -128,7 +118,7 @@ export default {
|
|
|
fixed: 'left'
|
|
|
},
|
|
|
{
|
|
|
- prop: 'activityName',
|
|
|
+ prop: 'name',
|
|
|
label: '活动名称',
|
|
|
align:'center',
|
|
|
},
|
|
|
@@ -140,12 +130,14 @@ export default {
|
|
|
option:[]
|
|
|
},
|
|
|
{
|
|
|
- prop: 'activityCity',
|
|
|
+ prop: 'cityCode',
|
|
|
label: '覆盖城市',
|
|
|
align:'center',
|
|
|
+ type:'find',
|
|
|
+ option:[]
|
|
|
},
|
|
|
{
|
|
|
- prop: 'activityStatus',
|
|
|
+ prop: 'status',
|
|
|
label: '状态',
|
|
|
align:'center',
|
|
|
type: 'diy',
|
|
|
@@ -154,6 +146,7 @@ export default {
|
|
|
prop: 'activityTime',
|
|
|
label: '活动时间',
|
|
|
align:'center',
|
|
|
+ type: 'diy',
|
|
|
},
|
|
|
{
|
|
|
prop: 'nickName',
|
|
|
@@ -173,24 +166,38 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ this.getOptionList();
|
|
|
this.queryParams = {
|
|
|
...this.queryParams,
|
|
|
activityType:'',
|
|
|
- activityCity:'',
|
|
|
- activityStatus:'',
|
|
|
+ cityCode:'',
|
|
|
+ status:'',
|
|
|
dateRange:[],
|
|
|
}
|
|
|
this.isImmediateLoad = false;
|
|
|
this.getListUrl = getActivityList;
|
|
|
this.customProcessDataFun = (val) => {
|
|
|
- this.queryParams = this.DateRange(this.queryParams,val.dateRange || [],['startTime','endTime'],'s')
|
|
|
+ this.queryParams = this.DateRange(this.queryParams,val.dateRange || [],['startTime','endTime'])
|
|
|
};
|
|
|
},
|
|
|
mounted(){
|
|
|
- this.columnData.find(item => item.prop === 'activityType').option = this.activityTypeOption;
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
methods: {
|
|
|
+ async getOptionList(){
|
|
|
+ //获取活动类型,获取活动状态
|
|
|
+ const {activity_type,activity_status} = await this.useDict('activity_type','activity_status');
|
|
|
+ this.activityTypeOption = activity_type;
|
|
|
+ this.statusOption = activity_status;
|
|
|
+ //获取城市
|
|
|
+ const cityOption = await getCity({
|
|
|
+ level:'2',
|
|
|
+ parentCode:'140000'
|
|
|
+ })
|
|
|
+ this.cityOptions = cityOption.data.map(p => ({ label: p.name, value: p.code }));
|
|
|
+ this.columnData.find(item => item.prop === 'activityType').option = this.activityTypeOption;
|
|
|
+ this.columnData.find(item => item.prop === 'cityCode').option = this.cityOptions;
|
|
|
+ },
|
|
|
/** 添加:add 复制:copy 编辑:edit 查看:view */
|
|
|
handleRule(row,type) {
|
|
|
this.$refs.activityEditBoxRef?.getRow(row,type);
|