Commit df62d2ad by chenxin

fix:增加转赠记录,卡券报表,和转增开关

parent 3988fb34
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel="shortcut icon" href=./static/img/favicon.ico><title>GIC后台</title><link rel=stylesheet type=text/css href=static/fonts/iconfont.css><link rel=stylesheet type=text/css href=static/css/common.css><link rel=stylesheet href=//web-1251519181.file.myqcloud.com/components/element.2.12.0.css><link href=/marketing/static/css/main.d521cad129b55c9bbdd1b3619db757a6.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/element.2.12.0.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.36.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.04.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.10.js></script><script src=//web-1251519181.file.myqcloud.com/components/store.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/member-group.2.2.16.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-card.2.0.18.js></script><script src=//web-1251519181.file.myqcloud.com/components/confirm-people.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/people.2.0.42.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.13.js></script><script src=//web-1251519181.file.myqcloud.com/components/input.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/selector.1.2.10.js></script><script type=text/javascript src=/marketing/static/js/manifest.48538b22f71ebbe249d5.js></script><script type=text/javascript src=/marketing/static/js/vendor.cbb380c2053ab598e892.js></script><script type=text/javascript src=/marketing/static/js/main.0f6b91fdc1412fd8590e.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel="shortcut icon" href=./static/img/favicon.ico><title>GIC后台</title><link rel=stylesheet type=text/css href=static/fonts/iconfont.css><link rel=stylesheet type=text/css href=static/css/common.css><link rel=stylesheet href=//web-1251519181.file.myqcloud.com/components/element.2.12.0.css><link href=/marketing/static/css/main.a5badb259181ebb1aa957deb9dddb087.css rel=stylesheet></head><body><div id=app></div><script src=//web-1251519181.file.myqcloud.com/lib/vue/2.5.2/vue.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vue-router/3.0.2/vue-router.min.js></script><script src=//web-1251519181.file.myqcloud.com/lib/vuex/3.1.0/vuex.min.js></script><script src=//web-1251519181.file.myqcloud.com/components/element.2.12.0.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.36.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.04.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.10.js></script><script src=//web-1251519181.file.myqcloud.com/components/store.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/img-preview.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/member-group.2.2.16.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-card.2.0.18.js></script><script src=//web-1251519181.file.myqcloud.com/components/confirm-people.2.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/people.2.0.42.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.13.js></script><script src=//web-1251519181.file.myqcloud.com/components/input.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/delete.2.0.00.js></script><script src=//web-1251519181.file.myqcloud.com/components/selector.1.2.10.js></script><script src=//web-1251519181.file.myqcloud.com/components/pagination.1.0.5.js></script><script type=text/javascript src=/marketing/static/js/manifest.9f922f91799d94bcd46c.js></script><script type=text/javascript src=/marketing/static/js/vendor.cbb380c2053ab598e892.js></script><script type=text/javascript src=/marketing/static/js/main.9be40b8568322326f793.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var r=window.webpackJsonp;window.webpackJsonp=function(t,o,c){for(var i,f,u,s=0,d=[];s<t.length;s++)f=t[s],n[f]&&d.push(n[f][0]),n[f]=0;for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i]);for(r&&r(t,o,c);d.length;)d.shift()();if(c)for(s=0;s<c.length;s++)u=a(a.s=c[s]);return u};var t={},n={13:0};function a(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.e=function(e){var r=n[e];if(0===r)return new Promise(function(e){e()});if(r)return r[2];var t=new Promise(function(t,a){r=n[e]=[t,a]});r[2]=t;var o=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,a.nc&&c.setAttribute("nonce",a.nc),c.src=a.p+"static/js/"+({0:"card",1:"game",2:"wechat",3:"message",4:"ewash",5:"evaluation",6:"ecm",7:"activity",8:"recharge",9:"msg",10:"calllog"}[e]||e)+"."+{0:"6fec0dc48b24d979cc33",1:"551e4a6470ee56b6586a",2:"6fabe3cfe08d9a15700e",3:"9defabceae1a24e63a44",4:"a42f563aac5bcc14777b",5:"b53911977acd27231f56",6:"3fd4311a6553766532f4",7:"316afc54650a54995ef9",8:"e4c18978fe8698c95cc2",9:"f3c2a227d1d0d4b1e360",10:"e1d12b2946a48cf5d8cb"}[e]+".js";var i=setTimeout(f,12e4);function f(){c.onerror=c.onload=null,clearTimeout(i);var r=n[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),n[e]=void 0)}return c.onerror=c.onload=f,o.appendChild(c),t},a.m=e,a.c=t,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="/marketing/",a.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var r=window.webpackJsonp;window.webpackJsonp=function(t,o,c){for(var i,u,d,f=0,s=[];f<t.length;f++)u=t[f],n[u]&&s.push(n[u][0]),n[u]=0;for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i]);for(r&&r(t,o,c);s.length;)s.shift()();if(c)for(f=0;f<c.length;f++)d=a(a.s=c[f]);return d};var t={},n={13:0};function a(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.e=function(e){var r=n[e];if(0===r)return new Promise(function(e){e()});if(r)return r[2];var t=new Promise(function(t,a){r=n[e]=[t,a]});r[2]=t;var o=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,a.nc&&c.setAttribute("nonce",a.nc),c.src=a.p+"static/js/"+({0:"card",1:"game",2:"wechat",3:"message",4:"ewash",5:"evaluation",6:"ecm",7:"activity",8:"recharge",9:"msg",10:"calllog"}[e]||e)+"."+{0:"4d4d010009ad7aa5529a",1:"eb4aae562903a44abebc",2:"a1e67b61b2c83b1882ba",3:"30063e940a03d39ae4e5",4:"17d5d8e8e5023c0ef4dd",5:"d795b16cfdbbd7a175d3",6:"129e26b0d6d8c96ce121",7:"520a54176361c7b4f5f4",8:"1ff302476a871dc141c7",9:"ed6ba5a1645f90d782a1",10:"b15028a3ecc7d7b67d9f"}[e]+".js";var i=setTimeout(u,12e4);function u(){c.onerror=c.onload=null,clearTimeout(i);var r=n[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),n[e]=void 0)}return c.onerror=c.onload=u,o.appendChild(c),t},a.m=e,a.c=t,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="/marketing/",a.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -29,6 +29,12 @@ export default {
}
},
{
path: 'give',
name: '转赠记录',
component: () => import(/* webpackChunkName: "card" */ '../../views/card/give-list.vue'),
meta: {}
},
{
path: 'send',
name: '投放记录',
component: () => import(/* webpackChunkName: "card" */ '../../views/card/record-send.vue'),
......@@ -182,7 +188,7 @@ export default {
{
path: 'shelfanalysis/:id',
name: '卡券展架报表',
component: () => import(/* webpackChunkName: "card" */ '../../views/card/analysis.vue'),
component: () => import(/* webpackChunkName: "card" */ '../../views/card/analysis-shelf.vue'),
meta: {
type: 'shelf',
path: '/card/shelf'
......
......@@ -12,9 +12,15 @@ export const updateCardStock = params => requests(PREFIX + 'update-card-stock',
//卡券营销--卡券库--删除卡券
export const deleteCard = params => requests(PREFIX + 'delete-card', params);
//卡券营销--卡券库--卡券报表--渠道分析
//卡券营销--卡券库--展架报表--渠道分析
export const cardChannelAnalysis = params => requests(PREFIX + 'card-channel-analysis', params);
//卡券营销--卡券库--卡券报表--基础统计和转赠统计
export const cardbaseAnalysis = params => requests(PREFIX + 'card-basic-statistics', params);
//卡券营销--卡券库--卡券报表--渠道分析
export const cardChannelStatistics = params => requests(PREFIX + 'card-channel-statistics', params);
//卡券营销--卡券库--卡券报表/卡券展架--卡券报表趋势分析图
export const cardTrendEchart = params => requests(PREFIX + 'card-trend-echart', params);
......@@ -45,6 +51,9 @@ export const cardRecordPage = params => requests(PREFIX + 'card-record-page', pa
// 卡券营销--会员领取记录--获取领取记录默认时间段
export const getCouponDateLimit = params => requests(PREFIX + 'coupon-date-limit', params);
// 卡券营销--转赠记录
export const getCouponLogPage = params => requests(PREFIX + 'coup-give-log-page', params);
//卡券营销--卡券记录--投放记录/领取记录 - 投放记录
export const cardPutOnRecord = params => requests(PREFIX + 'card-put-on-record', params);
......
<template>
<section>
<!-- 渠道分析 -->
<div class="dm-form__wrap" v-if="$route.meta.type !== 'shelf'">
<h3 class="dm-title__label">
<span class="card-chart__title">渠道分析</span>
<el-date-picker class="fr ml5 mr20" v-model="dateTime2" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="cardChannelAnalysis"></el-date-picker>
</h3>
<el-table tooltipEffect="light" :data="tableList" style="width:100%" v-loading="loading">
<el-table-column v-for="(v, i) in tableHeader" :key="i" :align="v.align" :width="v.width" :min-width="v.minWidth" :prop="v.prop" :label="v.label" :formatter="v.formatter"></el-table-column>
</el-table>
</div>
<!-- 卡券报表趋势分析 -->
<div class="dm-form__wrap">
<h3 class="dm-title__label clearfix">
<span class="card-chart__title">卡券报表趋势分析</span>
<el-date-picker class="fr ml5 mr20" v-model="dateTime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="cardTrendEchart"></el-date-picker>
<el-select class="fr w200" v-model="chartParams.kpiName" placeholder="选择状态" @change="cardTrendEchart">
<el-option v-for="(v, i) in kpiNameOptions" :key="i" :label="v.label" :value="v.value"></el-option>
</el-select>
</h3>
<div id="mountNode" ref="mountNode" v-show="list.length"></div>
<div class="chart--nodata" v-show="!list.length"></div>
</div>
</section>
</template>
<script>
import { cardChannelAnalysis, cardTrendEchart } from '@/service/api/cardApi.js';
import { formatDateTimeByType } from '@/utils/index.js';
import VeLine from 'v-charts/lib/line.common';
import G2 from '@antv/g2';
export default {
name: 'card-analysis-shelf',
data() {
this.chartSettings = {
xAxisType: 'time'
};
return {
formatDateTimeByType,
dateTime: [Date.now() - 30 * 24 * 60 * 60 * 1000, Date.now()],
dateTime2: [Date.now() - 30 * 24 * 60 * 60 * 1000, Date.now()],
loading: false,
tableList: [],
chartData: {
columns: [],
rows: []
},
listParams: {
type: ''
},
kpiNameOptions: [{ label: '领取次数', value: 'card-puton1' }, { label: '使用次数', value: 'card-puton2' }, { label: '销售额', value: 'card-puton3' }], // eslint-disable-line
tableHeader: [
{ label: '渠道名称', prop: 'receiveName', align: 'left', minWidth: '200' },
{
label: '投放人次',
prop: 'issuingQuantity',
align: 'left',
width: '100',
formatter(row) {
return row.receiveCode === 'RECEIVE_005' ? '-' : row.issuingQuantity;
}
},
{
label: '领取率',
prop: 'receiveName',
align: 'left',
width: '100',
formatter(row) {
return row.receiveCode === 'RECEIVE_005' ? '-' : ((row.getedQuantity * 100) / (row.issuingQuantity === 0 ? 1 : row.issuingQuantity)).toFixed(2) + '%';
}
},
{ label: '领取数量', prop: 'getedQuantity', align: 'left', width: '100' },
{ label: '使用数量', prop: 'usageQuantity', align: 'left', width: '100' },
{
label: '核销率',
prop: 'receiveName',
align: 'left',
width: '100',
formatter(row) {
return ((row.usageQuantity * 100) / (row.getedQuantity === 0 ? 1 : row.getedQuantity)).toFixed(2) + '%';
}
},
{ label: '销售额', prop: 'saleAmount', align: 'left', width: '100' }
],
chartParams: {
kpiName: 'card-puton1',
cardId: this.$route.params.id,
beginTime: '',
endTime: '',
day: 1
},
list: []
};
},
components: {
[VeLine.name]: VeLine
},
created() {
if (this.$route.meta.type === 'shelf') {
this.chartParams = {
kpiName: 'shelf-cards1',
shelfId: this.$route.params.id,
beginTime: '',
endTime: ''
};
this.kpiNameOptions = [{ label: '领取次数', value: 'shelf-cards1' }, { label: '使用次数', value: 'shelf-cards2' }, { label: '销售额', value: 'shelf-cards3' }]; // eslint-disable-line
this.cardTrendEchart();
this.$store.commit('mutations_breadcrumb', [{ name: '营销管理', path: '' }, { name: '卡券营销', path: '' }, { name: '卡券展架', path: '/card/shelf' }, { name: '卡券展架报表', path: '' }]); // eslint-disable-line
} else {
this.chartParams = {
kpiName: 'card-puton1',
cardId: this.$route.params.id,
beginTime: '',
endTime: '',
day: 1
};
(this.kpiNameOptions = [{ label: '领取次数', value: 'card-puton1' }, { label: '使用次数', value: 'card-puton2' }, { label: '销售额', value: 'card-puton3' }]), this.cardChannelAnalysis(); // eslint-disable-line
this.cardTrendEchart();
this.$store.commit('mutations_breadcrumb', [{ name: '营销管理', path: '' }, { name: '卡券营销', path: '' }, { name: '卡券库', path: '/card/list' }, { name: '卡券报表', path: '' }]); // eslint-disable-line
}
},
methods: {
//加载列表
async cardChannelAnalysis() {
let params = {
coupCardId: this.$route.params.id,
beginTime: '',
endTime: ''
};
if (this.dateTime2) {
params.beginTime = formatDateTimeByType(this.dateTime2[0], 'yyyy-MM-dd');
params.endTime = formatDateTimeByType(this.dateTime2[1], 'yyyy-MM-dd');
} else {
params.beginTime = '';
params.endTime = '';
}
this.loading = true;
try {
let resList = await cardChannelAnalysis(params);
if (resList.errorCode === 0 && resList.result) {
this.tableList = resList.result;
} else {
this.tableList = [];
}
} catch (err) {}
this.loading = false;
},
//加载图表
async cardTrendEchart() {
if (this.dateTime) {
this.chartParams.beginTime = formatDateTimeByType(this.dateTime[0], 'yyyy-MM-dd');
this.chartParams.endTime = formatDateTimeByType(this.dateTime[1], 'yyyy-MM-dd');
} else {
this.chartParams.beginTime = '';
this.chartParams.endTime = '';
}
try {
let res = await cardTrendEchart(this.chartParams);
if (res.errorCode === 0 && res.result) {
let result = JSON.parse(res.result);
let series = result.series;
let xAxisType = result.xaxisData;
let list = [];
series.map((v, i) => {
v.data.map((w, j) => {
list.push({
day: xAxisType[j],
name: v.name,
temperature: parseInt(w.value)
});
});
});
const mountNode = this.$refs.mountNode;
const childs = Array.from(mountNode.childNodes);
childs.map(v => {
mountNode.removeChild(v);
});
this.list = list;
this.$nextTick(_ => {
this.initCharts(list);
});
}
} catch (err) {
console.log(err);
}
},
// 画图方法
initCharts(data) {
var chart = new G2.Chart({
container: 'mountNode',
forceFit: true,
height: 400
});
chart.source(data, {
day: {
range: [0, 1]
}
});
chart.tooltip({
crosshairs: {
type: 'line'
}
});
chart.axis('temperature', {
label: {
formatter: function formatter(val) {
val = Number(val);
if (val % 1 === 0) {
return val + '人次';
} else {
return '';
}
}
}
});
chart
.line()
.position('day*temperature')
.color('name');
chart
.point()
.position('day*temperature')
.color('name')
.size(4)
.shape('circle')
.style({
stroke: '#fff',
lineWidth: 1
});
chart.render();
}
}
};
</script>
<style lang="scss" scoped>
.card-chart__title {
display: inline-block;
vertical-align: middle;
padding-top: 13px;
font-weight: 700;
}
</style>
......@@ -48,7 +48,8 @@ const initForm = {
goods_discounts_number_upper_limit: 0,
goods_discounts_number_lower_limit: 0,
products_exchange_number: 0,
onlyFlag: true // 是否显示与优惠同享,默认true显示
onlyFlag: true, // 是否显示与优惠同享,默认true显示
giveFlag: 0 // 开启转赠 1开启
};
const sale_limit = { fee: 0, goods: '', flag: false, type: 0 }; //最低消费
const goods = { ok: '', no: '', flag: false };
......@@ -126,7 +127,8 @@ export default {
weimobShopList: [], // 微盟店铺list
weimobDemoCodeList: [{ pid: '', card: '', loading: false, cardList: [], save: false, cardName: '' }], // 保存的微盟店铺以及对应的微盟券号 {pid:xxxx,card:xxxx,loading:false, cardList: [], save: false, name: ''}
// cardValidity: false, // 卡券有效期是否禁用
nowWmShopData: {} // 存储wm店铺数据
nowWmShopData: {}, // 存储wm店铺数据
giveEnable: false // 支持转赠
};
},
watch: {
......@@ -273,6 +275,11 @@ export default {
}
// 支持的品牌-商品选择器
if (res.result.giveEnable) {
this.giveEnable = res.result.giveEnable;
}
// 支持的品牌-转赠功能
if (res.result.goodsEnable) {
this.xxSysp.goodsEnable = res.result.goodsEnable;
}
......@@ -517,6 +524,8 @@ export default {
// this.form.customCodeEnd = this.form.customCodeBegin = 0;
return;
}
// 自定义号段 ,转赠开关设置关闭
this.form.giveFlag = 0;
}
//验证有效期
if (this.form.cardEffectiveMode) {
......@@ -542,6 +551,7 @@ export default {
}),
//卡券营销--卡券库--保存卡券
async saveUpdateCard() {
return;
if (this.submitLoading) {
return;
}
......
......@@ -223,6 +223,11 @@
<el-alert v-show="storeMode && form.cardApplyChannel.indexOf('WMmicroMall') !== -1" title="选择的门店必须保持与微盟侧门店一致,请确认选择无误" type="warning" show-icon :closable="false" class="mt20 width80"></el-alert>
</el-form-item>
<el-form-item v-if="giveEnable && form.useCustomCode != 1" label="卡券转赠" class="is-required">
<el-switch v-model="form.giveFlag" :active-value="1" :inactive-value="0"></el-switch>
<span class="tips fz12 gray ml5">* code类型为自定义号段暂时不支持卡券转赠,转赠多次会消耗相同次数的库存,请设置足够的安全库存</span>
</el-form-item>
<el-form-item prop="image" label="(选填)封面图片">
<dm-upload-img :disabled="isEdit || isInfo" :model.sync="form.image" width="64" label="上传图片" url="/api-plug/upload-img" tips="图片建议尺寸:850px*350px,大小不超过2M"></dm-upload-img>
</el-form-item>
......
<template>
<section v-loading="loading">
<div class="pb22 clearfix">
<el-input v-model="listParams.search" class="w300" placeholder="卡券名称/卡券代码/用户信息" clearable @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-select clearable class="dm-select" v-model="listParams.giveStatus" placeholder="全部转赠状态" @change="refresh">
<el-option label="转赠中" :value="0"></el-option>
<el-option label="已完成" :value="1"></el-option>
<!-- <el-option label="转赠异常" :value="2"></el-option> -->
</el-select>
</div>
<div class="filter--box"><span class="vertical-middle pl10">转赠时间:</span><el-date-picker v-model="dateTime" :clearable="false" @change="refresh" class="w300" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> <span class="vertical-middle">领取时间:</span><el-date-picker v-model="dateTime2" @change="refresh" class="w300" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker></div>
<el-table tooltipEffect="light" :data="tableList" style="width: 100%">
<el-table-column :show-overflow-tooltip="true" min-width="120" header-align="left" align="left" prop="memberId" label="转赠会员">
<template slot-scope="scope">
<a :href="'/member/#/wechatmemberDetail?memberId=' + scope.row.fromMemberId" target="_blank">
<img class="vertical-middle table__avatar--40" :src="scope.row.fromImageUrl || defaultAvatar" width="60" height="60" />
<div class="inline-block vertical-middle">
<p class="table-name--ellipsis">{{ scope.row.fromMemberName || '--' }}</p>
<p class="fz13 gray">{{ scope.row.fromPhoneNumber || '--' }}</p>
</div>
</a>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" width="100" align="left" prop="giveTime" label="转赠时间">
<template slot-scope="scope">
<p class="cell-time">
{{ formatDateTimeByType(scope.row.giveTime, 'yyyy-MM-dd-HH-mm', true).y }}<br />
<span>{{ formatDateTimeByType(scope.row.giveTime, 'yyyy-MM-dd-HH-mm', true).h }}</span>
</p>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" width="140" align="left" prop="cardType" label="卡券类型">
<template slot-scope="scope">
<p>{{ scope.row.cardType === 0 ? '抵金券' : scope.row.cardType === 1 ? '折扣券' : '兑换券' }}</p>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" min-width="120" align="left" prop="cardName" label="卡券名称"></el-table-column>
<el-table-column :show-overflow-tooltip="true" min-width="120" align="left" prop="fromCardCode" label="转赠卡券代码"></el-table-column>
<el-table-column :show-overflow-tooltip="true" width="140" align="left" prop="cardType" label="转赠状态">
<template slot-scope="scope">
<p>{{ scope.row.giveStatus === 0 ? '转赠中' : scope.row.cardType === 1 ? '已完成' : '转赠异常' }}</p>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" min-width="120" header-align="left" align="left" prop="memberId" label="领取会员">
<template slot-scope="scope">
<a v-if="scope.row.giveStatus === 1" :href="'/member/#/wechatmemberDetail?memberId=' + scope.row.friendMemberId" target="_blank">
<img class="vertical-middle table__avatar--40" :src="scope.row.friendImageUrl || defaultAvatar" width="60" height="60" />
<div class="inline-block vertical-middle">
<p class="table-name--ellipsis">{{ scope.row.friendMemberName || '--' }}</p>
<p class="fz13 gray">{{ scope.row.friendPhoneNumber || '--' }}</p>
</div>
</a>
<span v-else>--</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" width="100" align="left" prop="receiveTime" label="领取时间">
<template slot-scope="scope">
<p v-if="scope.row.giveStatus === 1" class="cell-time">
{{ formatDateTimeByType(scope.row.receiveTime, 'yyyy-MM-dd-HH-mm', true).y }}<br />
<span>{{ formatDateTimeByType(scope.row.receiveTime, 'yyyy-MM-dd-HH-mm', true).h }}</span>
</p>
<span v-else>--</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" min-width="120" align="left" prop="friendCardCode" label="受赠卡券代码">
<template slot-scope="scope">
<span v-if="scope.row.giveStatus === 1">{{ scope.row.friendCardCode }}</span>
<span v-else>--</span>
</template>
</el-table-column>
</el-table>
<dm-pagination v-show="tableList.length" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="listParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></dm-pagination>
</section>
</template>
<script>
import { getCouponLogPage } from '@/service/api/cardApi.js';
import { formatDateTimeByType } from '@/utils/index.js';
import talbeMethods from '@/mixins/tableMethods.js';
import filterAvater from '@/mixins/filterAvater.js';
export default {
name: 'refund-list',
mixins: [talbeMethods, filterAvater],
data() {
return {
formatDateTimeByType,
dateTime: [,],
dateTime2: [,],
listParams: {
giveBeginTime: '',
giveEndTime: '',
receiveBeginTime: '',
receiveEndTime: '',
giveStatus: '',
search: '',
currentPage: 1,
pageSize: 20
},
total: 0,
loading: false,
tableList: [],
projectName: 'marketing' // 当前项目名
};
},
created() {
this.getTableList();
this.$store.commit('mutations_breadcrumb', [{ name: '营销管理', path: '' }, { name: '卡券营销', path: '' }, { name: '转赠记录', path: '' }]); // eslint-disable-line
},
methods: {
// 加载列表
async getTableList() {
this.loading = true;
this.dataTimeFormat();
try {
let res = await getCouponLogPage(this.listParams);
this.tableList = res.result.result || [];
this.total = res.result.totalCount || 0;
} catch (err) {
this.$tips({ type: 'error', message: '加载列表失败' });
}
this.loading = false;
},
/**-------辅助方法---------- */
dataTimeFormat() {
if (this.dateTime) {
this.listParams.giveBeginTime = formatDateTimeByType(this.dateTime[0], 'yyyy-MM-dd');
this.listParams.giveEndTime = formatDateTimeByType(this.dateTime[1], 'yyyy-MM-dd');
} else {
this.listParams.giveBeginTime = '';
this.listParams.giveEndTime = '';
}
if (this.dateTime2) {
this.listParams.receiveBeginTime = formatDateTimeByType(this.dateTime2[0], 'yyyy-MM-dd');
this.listParams.receiveEndTime = formatDateTimeByType(this.dateTime2[1], 'yyyy-MM-dd');
} else {
this.listParams.receiveBeginTime = '';
this.listParams.receiveEndTime = '';
}
}
}
};
</script>
......@@ -4,9 +4,9 @@
<span class="pr10">卡券共{{ total }}</span>
<el-button-group class="vertical-middle pr4">
<el-button @click="sortList('col1')">创建时间<i class="el-icon--right" :class="listParams.sortBy === 'col1' ? 'el-icon-caret-top' : listParams.sortBy === 'col1 desc' ? 'el-icon-caret-bottom' : 'el-icon-d-caret'"></i></el-button>
<el-button @click="sortList('col2')">领取量<i class="el-icon--right" :class="listParams.sortBy === 'col2' ? 'el-icon-caret-top' : listParams.sortBy === 'col2 desc' ? 'el-icon-caret-bottom' : 'el-icon-d-caret'"></i></el-button>
<!-- <el-button @click="sortList('col2')">领取量<i class="el-icon--right" :class="listParams.sortBy === 'col2' ? 'el-icon-caret-top' : listParams.sortBy === 'col2 desc' ? 'el-icon-caret-bottom' : 'el-icon-d-caret'"></i></el-button>
<el-button @click="sortList('col3')">使用量<i class="el-icon--right" :class="listParams.sortBy === 'col3' ? 'el-icon-caret-top' : listParams.sortBy === 'col3 desc' ? 'el-icon-caret-bottom' : 'el-icon-d-caret'"></i></el-button>
<el-button @click="sortList('col4')">核销率<i class="el-icon--right" :class="listParams.sortBy === 'col4' ? 'el-icon-caret-top' : listParams.sortBy === 'col4 desc' ? 'el-icon-caret-bottom' : 'el-icon-d-caret'"></i></el-button>
<el-button @click="sortList('col4')">核销率<i class="el-icon--right" :class="listParams.sortBy === 'col4' ? 'el-icon-caret-top' : listParams.sortBy === 'col4 desc' ? 'el-icon-caret-bottom' : 'el-icon-d-caret'"></i></el-button> -->
</el-button-group>
<el-select class="dm-select" v-model="listParams.cardType" placeholder="选择卡券类型" @change="refresh">
<el-option v-for="(item, index) in cardTypeOptions" :key="index" :label="item.label" :value="item.value"></el-option>
......
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