Commit ec348d62 by 陈羽

update: 门店签到补充需求

parent e2ed1870
// 签到
/* eslint-disable */
export default {
path: 'sign',
name: '门店签到管理',
component: () => import(/* webpackChunkName: "signIn" */ '../../views/sign/index.vue'),
redirect: '/sign/list',
children: [
{
path: 'setting',
name: '门店签到设置',
component: () => import(/* webpackChunkName: "signIn" */ '../../views/sign/setting.vue'),
meta: {
path: '/sign/setting'
}
},
{
path: 'list',
name: '门店签到记录',
component: () => import(/* webpackChunkName: "signIn" */ '../../views/sign/list.vue'),
meta: {
path: '/sign/list'
}
}
]
};
path: 'sign',
name: '门店签到管理',
component: () =>
import ( /* webpackChunkName: "signIn" */ '../../views/sign/index.vue'),
redirect: '/sign/list',
children: [{
path: 'setting',
name: '门店签到设置',
component: () =>
import ( /* webpackChunkName: "signIn" */ '../../views/sign/setting.vue'),
meta: {
path: '/sign/setting'
}
},
{
path: 'list',
name: '门店签到记录',
component: () =>
import ( /* webpackChunkName: "signIn" */ '../../views/sign/list.vue'),
meta: {
path: '/sign/list'
}
},
{
path: 'plan',
name: '门店签到计划',
component: () =>
import ( /* webpackChunkName: "signIn" */ '../../views/sign/plan-list.vue'),
meta: {
path: '/sign/plan'
}
}
]
};
\ No newline at end of file
/* eslint-disable */
import { requests } from './index';
const PREFIX = 'api-marketing/store-sign/';
import config from '@/config';
......@@ -5,9 +6,11 @@ export const url = config.api + PREFIX;
// 获取门店签到记录分页列表
export const getPageSignLog = params => requests(PREFIX + 'page-sign-log', params);
// 获取门店签到记录分页列表
export const getPageSignPlan = params => requests(PREFIX + 'page-sign-plan', params);
// 门店签到配置保存
export const saveStoreSignSetting = params => requests(PREFIX + 'save', params);
// 门店签到配置查询
export const getStoreSignDetail = params => requests(PREFIX + 'get-detail', params);
// 门店签到计划删除
export const delSignPlan = params => requests(PREFIX + 'del-sign-plan', params);
\ No newline at end of file
<template>
<section class="dm-wrap" v-loading="loading">
<div class="pb20 clearfix">
<el-input v-model="pageParams.memberInfo" class="w300" placeholder="请输入会员姓名/手机号" clearable @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-date-picker class="w250" v-model="pageParams.time" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="refresh"></el-date-picker>
<el-input v-model="pageParams.storeName" class="w300" placeholder="请输入门店" clearable @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-input v-model="pageParams.storeName" class="w300" placeholder="会员姓名/手机号/签到计划" clearable @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
</div>
<el-table tooltipEffect="light" :data="tableList" style="width: 100%">
<el-table-column :show-overflow-tooltip="true" align="left" prop="createTime" label="签到时间">
......@@ -14,7 +14,8 @@
</p>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="left" label="签到用户">
<el-table-column :show-overflow-tooltip="true" align="left" prop="storeName" label="签到门店"></el-table-column>
<el-table-column :show-overflow-tooltip="true" align="left" label="签到会员">
<template slot-scope="scope">
<div class="memberInfo">
<img :src="scope.row.memberImage || ''" alt="" />
......@@ -25,11 +26,11 @@
</div>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="left" prop="storeSignName" label="签到计划名称"></el-table-column>
<el-table-column :show-overflow-tooltip="true" align="left" label="福利类型">
<template slot-scope="scope"> {{ scope.prizeType === '1' ? '积分' : '卡券' }}</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="left" prop="prizeTxt" label="签到福利"></el-table-column>
<el-table-column :show-overflow-tooltip="true" align="left" prop="storeName" label="签到门店"></el-table-column>
</el-table>
<dm-pagination v-show="tableList.length" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageParams.currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></dm-pagination>
</section>
......
<template>
<section class="dm-wrap" v-loading="loading">
<div class="flex pb20">
<div>
<el-select v-model="pageParams.state" placeholder="计划状态" class="w200" clearable @change="refresh">
<el-option :value="0" label="未开始"></el-option>
<el-option :value="1" label="进行中"></el-option>
<el-option :value="2" label="已结束"></el-option>
</el-select>
<el-input v-model="pageParams.storeSignName" class="w300" placeholder="计划名称" clearable @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
</div>
<el-button type="primary" @click="goAddPlan">新建计划</el-button>
</div>
<el-table tooltipEffect="light" :data="tableList" style="width: 100%">
<el-table-column :show-overflow-tooltip="true" align="left" prop="storeSignName" label="计划名称"></el-table-column>
<el-table-column :show-overflow-tooltip="true" align="left" prop="updateTime" label="最近编辑时间">
<template slot-scope="scope">
<p class="cell-time">
{{ formatDateTimeByType(scope.row.updateTime, 'yyyy-MM-dd-HH-mm', true).y }}<br />
{{ formatDateTimeByType(scope.row.updateTime, 'yyyy-MM-dd-HH-mm', true).h }}
</p>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="left" label="签到人群">
<template slot-scope="scope"> {{ scope.row.memberSearchType | memberSearchTypeFilter }}</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="left" prop="state" label="计划状态">
<template slot-scope="scope"> {{ scope.row.state | stateFilter }}</template>
</el-table-column>
<el-table-column label="操作" align="left" width="210px" fixed="right">
<template slot-scope="scope">
<!-- 只有未开始的计划可编辑 -->
<el-button type="text" v-if="scope.row.state === 0" @click="$router.push(`/sign/setting?id=${scope.row.storeSignId}`)">编辑</el-button>
<el-button type="text" v-else @click="$router.push(`/sign/setting?id=${scope.row.storeSignId}`)">查看</el-button>
<dm-delete @confirm="delPlan(scope.row)" tips="是否删除该签到计划?">
<el-button type="text">删除</el-button>
</dm-delete>
</template>
</el-table-column>
</el-table>
<dm-pagination v-show="tableList.length" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageParams.currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="pageParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></dm-pagination>
</section>
</template>
<script>
/* eslint-disable */
import { getPageSignPlan, delSignPlan } from '@/service/api/storeSign.js';
import { formatDateTimeByType } from '@/utils/index.js';
export default {
name: 'sign-record',
data() {
return {
loading: false,
projectName: 'gic-web',
pageParams: {
currentPage: 1,
pageSize: 20,
state: null
},
total: 0,
tableList: [],
// 门店单选
storeName: '',
storeDialog: false,
formatDateTimeByType
};
},
filters: {
memberSearchTypeFilter(v) {
switch (v) {
case 0: return '全部会员'; break;
case 1: return '自定义人群'; break;
case 2: return '会员分组'; break;
default: return ''; break;
}
},
stateFilter(v) {
switch (v) {
case 0: return '未开始'; break;
case 1: return '进行中'; break;
case 2: return '已结束'; break;
default: return ''; break;
}
}
},
created() {
this.$store.commit('mutations_breadcrumb', [ { name: '门店签到' }, { name: '计划列表', path: '' } ]);
this.fetch();
},
methods: {
async fetch() {
try {
this.loading = true;
const params = { ...this.pageParams };
let res = await getPageSignPlan(params);
console.log(res);
if (res.errorCode === 0 && res.result) {
this.tableList = Array.isArray(res.result.result) ? res.result.result : [];
this.total = res.result.totalCount;
} else {
this.tableList = [];
this.total = 0;
}
this.loading = false;
} catch (err) {
this.loading = false;
}
},
refresh() {
this.pageParams.currentPage = '1';
this.fetch();
},
goAddPlan() {
this.$router.push('/sign/setting')
},
async delPlan(item) {
try {
this.loading = true;
const params = { storeSignId: item.storeSignId };
let res = await delSignPlan(params);
if (res.errorCode === 0) {
this.$message.success('删除成功')
this.refresh()
} else {
this.$message.error('删除失败')
}
this.loading = false;
} catch (err) {
this.loading = false;
}
},
handleSizeChange(val) {
this.pageParams.pageSize = val;
this.fetch();
},
handleCurrentChange(val) {
this.pageParams.currentPage = val;
this.fetch();
}
}
};
</script>
<style lang="scss" scoped>
.memberInfo {
display: flex;
justify-content: flex-start;
align-items: center;
img {
display: block;
width: 40px;
height: 40px;
margin-right: 10px;
border-radius: 5px;
}
.cell-memberInfo {
color: #606266;
line-height: 20px;
font-size: 14px;
}
}
.flex {
justify-content: space-between;
width: 100%;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment