Commit ec4e9aae by chenxin

update:卡券新增适用商品参数

parent 58610fdc
<!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/css/iconfont.css><link rel=stylesheet type=text/css href=static/css/common.css><link href=/marketing/static/css/main.c6a05f592aa4dd7266858dcb2e2a0d94.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/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.20.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.02.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.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-card.2.0.02.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.15.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.04.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 type=text/javascript src=/marketing/static/js/manifest.0a85049e489e85ac5f0a.js></script><script type=text/javascript src=/marketing/static/js/vendor.41e915fffb6fa2b1b49e.js></script><script type=text/javascript src=/marketing/static/js/main.f8946f3e05345499ede2.js></script></body></html> <!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/css/iconfont.css><link rel=stylesheet type=text/css href=static/css/common.css><link href=/marketing/static/css/main.f1fef023778ddb4a6ce543781d2d8514.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/lib/elementUI/index.2.5.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/header.2.0.20.js></script><script src=//web-1251519181.file.myqcloud.com/components/footer.2.0.02.js></script><script src=//web-1251519181.file.myqcloud.com/components/card.2.0.02.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.0.01.js></script><script src=//web-1251519181.file.myqcloud.com/components/store-card.2.0.02.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.15.js></script><script src=//web-1251519181.file.myqcloud.com/components/export-excel.2.0.04.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 type=text/javascript src=/marketing/static/js/manifest.0a85049e489e85ac5f0a.js></script><script type=text/javascript src=/marketing/static/js/vendor.a8993e30b96d0f8d08ca.js></script><script type=text/javascript src=/marketing/static/js/main.0be3802914437e52440f.js></script></body></html>
\ No newline at end of file \ 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.
...@@ -192,6 +192,9 @@ a:hover { ...@@ -192,6 +192,9 @@ a:hover {
.w250{ .w250{
width: 250px!important; width: 250px!important;
} }
.w280{
width: 280px!important;
}
.w300{ .w300{
width: 300px!important; width: 300px!important;
} }
......
<template>
<div>
<span class="inline-block w100 text-right">微盟适用商品</span>
v2:{{ v2 }}
<el-select class="w250" v-model="v1" filterable placeholder=" 选择商品类目" :loading="loading" @change="handleF1Change">
<el-option v-for="item in f1" :key="item.id" :label="item.title" :value="item.id"></el-option>
</el-select>
<el-select class="w250" v-model="v2" multiple filterable remote reserve-keyword placeholder="选择商品参数" :loading="loading" @change="handleF2Change">
<el-option v-for="item in f2" :key="item.id" :label="item.title" :value="item.id"></el-option>
</el-select>
<el-select class="w250" v-model="v3" multiple filterable remote reserve-keyword placeholder="选择商品参数值" :loading="loading">
<el-option v-for="item in f3" :key="item.id" :label="item.title" :value="item.id"></el-option>
</el-select>
</div>
</template>
<script>
import axios from 'axios';
export default {
name: 'goods-filter',
data() {
return {
f1: [], // 一层的数据
v1: [],
f2: [], // 二层的数据
v2: [],
f3: [], // 三层的数据
v3: [],
loading: false,
list: [] // 行数据存储
};
},
methods: {
// 异步请求
remoteMethod(query) {
if (query !== '') {
this.loading = true;
setTimeout(() => {
this.loading = false;
this.v1 = this.f1.filter(item => {
return item.label.toLowerCase().indexOf(query.toLowerCase()) > -1;
});
}, 200);
} else {
this.v1 = [];
}
},
// 第一层改变 获取第二层数据
handleF1Change(v) {
axios.get(`http://localhost:3000/goods/${v}`).then(res => {
this.f2 = res.data.children.map(v => {
return {
title: v.title,
id: v.id
};
});
this.list[1] = this.f2;
});
},
// 第二层改变 获取第三层数据
handleF2Change(v) {
}
},
mounted() {
axios.get('http://localhost:3000/goods').then(res => {
this.f1 = res.data.map(v => {
return {
title: v.title,
id: v.id
};
});
this.list[0] = this.f1;
});
}
};
</script>
...@@ -51,9 +51,12 @@ export default { ...@@ -51,9 +51,12 @@ export default {
}, },
{ {
path: 'sendInfo/:id', path: 'sendInfo/:id',
name: '投放记录', name: '投放记录详情',
component: cardRecordSendInfo, component: cardRecordSendInfo,
meta: {} meta: {
type: 'send',
path: '/card/record/send'
}
}, },
{ {
path: 'cache', path: 'cache',
......
...@@ -18,6 +18,15 @@ export const cardChannelAnalysis = params => requests(PREFIX + 'card-channel-ana ...@@ -18,6 +18,15 @@ export const cardChannelAnalysis = params => requests(PREFIX + 'card-channel-ana
//卡券营销--卡券库--卡券报表/卡券展架--卡券报表趋势分析图 //卡券营销--卡券库--卡券报表/卡券展架--卡券报表趋势分析图
export const cardTrendEchart = params => requests(PREFIX + 'card-trend-echart', params); export const cardTrendEchart = params => requests(PREFIX + 'card-trend-echart', params);
//卡券营销--卡券库--新建/修改卡券--微盟商品适用类目
export const getCategoryList = params => requests(PREFIX + 'get-category-list', params);
//卡券营销--卡券库--新建/修改卡券--商品参数
export const getPropertyList = params => requests(PREFIX + 'get-property-list', params);
//卡券营销--卡券库--新建/修改卡券--商品参数值
export const getPropertyValueList = params => requests(PREFIX + 'get-property-value-list', params);
//卡券营销--卡券库--新建/修改卡券--放入卡券展架--所有展架集合 //卡券营销--卡券库--新建/修改卡券--放入卡券展架--所有展架集合
export const cardGetShelfs = params => requests(PREFIX + 'card-get-shelfs', params); export const cardGetShelfs = params => requests(PREFIX + 'card-get-shelfs', params);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import dmUploadImg from '@/components/upload/img'; import dmUploadImg from '@/components/upload/img';
import imgTextDrag from './partials/imgtext-drag'; import imgTextDrag from './partials/imgtext-drag';
import { formatDateTimeByType } from '@/utils/index.js'; import { formatDateTimeByType } from '@/utils/index.js';
import { cardGetShelfs, getCardDetail, saveUpdateCard, copyCardDetailService } from '@/service/api/cardApi.js'; import { cardGetShelfs, getCardDetail, saveUpdateCard, copyCardDetailService, getCategoryList, getPropertyList, getPropertyValueList } from '@/service/api/cardApi.js';
import dmGoodsInput from '@/components/goods-input/index.vue'; import dmGoodsInput from '@/components/goods-input/index.vue';
const initForm = { const initForm = {
auditingStatus: '', auditingStatus: '',
...@@ -50,6 +50,7 @@ const goods = { ok: '', no: '', flag: false }; ...@@ -50,6 +50,7 @@ const goods = { ok: '', no: '', flag: false };
export default { export default {
data() { data() {
return { return {
requestProject: 'marketing',
uuid: '', uuid: '',
loading: false, loading: false,
submitLoading: false, submitLoading: false,
...@@ -92,7 +93,23 @@ export default { ...@@ -92,7 +93,23 @@ export default {
products_exchange_number_show: false, products_exchange_number_show: false,
goodsDiscountCheck: true, goodsDiscountCheck: true,
discountAmountCheck: true discountAmountCheck: true,
// ----微盟适用商品----
f1: [], // 一层的list
goodsList: [
{
v1: '', // id
v1name: '',
f2: [], // 二层的数据
v2: '',
v2name: '',
f3: [], // 三层的数据
v3: '',
v3name: []
}
],
coupGoodsWeimobList: []
// ----微盟适用商品结束----
}; };
}, },
watch: { watch: {
...@@ -142,6 +159,7 @@ export default { ...@@ -142,6 +159,7 @@ export default {
created() { created() {
this.cardGetShelfs(); this.cardGetShelfs();
this.getCardDetail(); this.getCardDetail();
this.getCategoryList(); // 获取适用商品第一层数据
this.$store.commit('mutations_breadcrumb', [{ name: '营销管理', path: '' }, { name: '卡券营销', path: '' }, { name: '卡券库', path: '/card/list' }, { name: '卡券详情', path: '' }]); this.$store.commit('mutations_breadcrumb', [{ name: '营销管理', path: '' }, { name: '卡券营销', path: '' }, { name: '卡券库', path: '/card/list' }, { name: '卡券详情', path: '' }]);
}, },
mounted() { mounted() {
...@@ -247,6 +265,40 @@ export default { ...@@ -247,6 +265,40 @@ export default {
this.only = !!useCondition.only || false; this.only = !!useCondition.only || false;
this.form.proNoList = useCondition.proNo ? [{ name: useCondition.proNo, id: useCondition.proNo }] : []; this.form.proNoList = useCondition.proNo ? [{ name: useCondition.proNo, id: useCondition.proNo }] : [];
} }
// 微盟适用商品
// isCopy则第二三层不能编辑除非第一层变动;
if ((card.cardType === 0 || card.cardType === 1) && this.form.cardApplyChannel.indexOf('WMmicroMall') !== -1) {
this.goodsList = card.coupGoodsWeimobList.map(v => {
const f2Arr = JSON.parse(v.propValues); // 第三层的数据
return {
isCopy: this.isCopy,
v1: v.categoryId,
v1name: v.categoryName,
f2: [
{
id: v.propId,
title: v.propName,
outPropertyId: v.outPropertyId
}
],
v2: v.propId,
v2name: v.propName,
f3:
f2Arr.map(y => {
return {
id: y.valueId,
title: y.valueName,
outValueId: y.outValueId
};
}) || [],
v3: f2Arr.map(y1 => y1.valueId) || [],
v3name: f2Arr || []
};
});
this.coupGoodsWeimobList = card.coupGoodsWeimobList;
}
this.form.cardLimit = card.cardLimit; this.form.cardLimit = card.cardLimit;
if (this.form.cardLimit === 1) { if (this.form.cardLimit === 1) {
this.cardLimitRadio = 1; this.cardLimitRadio = 1;
...@@ -317,7 +369,17 @@ export default { ...@@ -317,7 +369,17 @@ export default {
}, },
//提交保存 //提交保存
async submitForm(formName) { async submitForm(formName) {
//验证 减免金额 和 折扣额度 // 验证微盟适用商品
if ((this.form.cardType === 0 || this.form.cardType === 1) && this.form.cardApplyChannel.indexOf('WMmicroMall') !== -1) {
let wmProduct = await this.handleCombine();
if (wmProduct) {
this.coupGoodsWeimobList = wmProduct;
} else {
return;
}
}
// 验证 减免金额 和 折扣额度
if (this.form.cardType === 0) { if (this.form.cardType === 0) {
if (Number(this.form.cardDenomination) <= 0) { if (Number(this.form.cardDenomination) <= 0) {
this.$tips({ type: 'warning', message: '减免金额不能小于0' }); this.$tips({ type: 'warning', message: '减免金额不能小于0' });
...@@ -334,7 +396,7 @@ export default { ...@@ -334,7 +396,7 @@ export default {
return; return;
} }
//验证号段 不能为空 起始号段和结尾号段必须位数一致 // 验证号段 不能为空 起始号段和结尾号段必须位数一致
if (this.form.useCustomCode) { if (this.form.useCustomCode) {
if (!this.form.customCodeBegin || !this.form.customCodeEnd) { if (!this.form.customCodeBegin || !this.form.customCodeEnd) {
this.$tips({ type: 'warning', message: '起始号段和结尾号段不能为空' }); this.$tips({ type: 'warning', message: '起始号段和结尾号段不能为空' });
...@@ -437,6 +499,10 @@ export default { ...@@ -437,6 +499,10 @@ export default {
} }
} }
// 微盟适用商品
if ((this.form.cardType === 0 || this.form.cardType === 1) && this.form.cardApplyChannel.indexOf('WMmicroMall') !== -1) {
card.coupGoodsWeimobList = this.coupGoodsWeimobList;
}
//卡券限制 //卡券限制
if (this.cardLimitRadio === 1) { if (this.cardLimitRadio === 1) {
card.cardLimit = 1; card.cardLimit = 1;
...@@ -524,10 +590,12 @@ export default { ...@@ -524,10 +590,12 @@ export default {
return; return;
} }
} }
// 门店展架 // 门店展架
params.shelfIds = JSON.stringify(this.form.shelfIds); params.shelfIds = JSON.stringify(this.form.shelfIds);
params.card = JSON.stringify(card); params.card = JSON.stringify(card);
this.submitLoading = true; this.submitLoading = true;
console.log(params);
saveUpdateCard(params) saveUpdateCard(params)
.then(res => { .then(res => {
this.submitLoading = false; this.submitLoading = false;
...@@ -579,6 +647,141 @@ export default { ...@@ -579,6 +647,141 @@ export default {
//检查是否为字符串 //检查是否为字符串
checkInputString(val, name) { checkInputString(val, name) {
this.form[name] = val.replace(/[^a-zA-Z0-9]*/g, '') + ''; this.form[name] = val.replace(/[^a-zA-Z0-9]*/g, '') + '';
},
// ------微盟适用商品开始-------
// 获取第一层数据
getCategoryList() {
getCategoryList({
requestProject: this.requestProject
}).then(res => {
// console.log(res);
this.f1 = res.result.map(v => {
return {
title: v.parentName + ' > ' + v.categoryName,
id: v.categoryId
};
});
});
},
// 增加一行
addLine() {
this.goodsList.push({ v1: '', f2: [], v2: '', f3: [], v3: [], list: [] });
},
// 删除一行
delLine(idx) {
this.goodsList.splice(idx, 1);
if (this.goodsList.length === 0) {
this.goodsList.push({ v1: '', f2: [], v2: '', f3: [], v3: [], list: [] });
}
},
// 第一层改变 获取第二层数据
handleF1Change(v, idx) {
// 把isCopy属性去除
if (this.isCopy && this.goodsList[idx].isCopy) {
this.goodsList[idx].isCopy = undefined;
}
this.goodsList[idx].v2 = '';
this.goodsList[idx].f2 = [];
this.goodsList[idx].v3 = [];
this.goodsList[idx].f3 = [];
this.goodsList[idx].v3name = [];
if (v) {
this.goodsList[idx].v1name = this.f1.find((value, index, array) => value.id === v).title;
getPropertyList({
requestProject: this.requestProject,
categoryId: this.goodsList[idx].v1
}).then(res => {
this.goodsList[idx].f2 = res.result.map(v => {
return {
title: v.propertyName,
id: v.propertyId,
outPropertyId: v.outPropertyId
};
});
});
} else {
this.goodsList[idx].v1name = '';
}
},
// 第二层改变 获取第三层数据
handleF2Change(v, idx) {
this.goodsList[idx].v3 = [];
this.goodsList[idx].f3 = [];
this.goodsList[idx].v3name = [];
if (v) {
this.goodsList[idx].v2name = this.goodsList[idx].f2.find((value, index, array) => value.id === v).title;
getPropertyValueList({
requestProject: this.requestProject,
propertyId: this.goodsList[idx].v2
}).then(res => {
this.goodsList[idx].f3 = res.result.map(v => {
return {
title: v.valueName,
id: v.valueId,
outValueId: v.outValueId
};
});
});
} else {
this.goodsList[idx].v2name = '';
}
},
// 校验&&组合数据
handleCombine() {
return new Promise((resolve, reject) => {
// 判断是否未填满;判断第二层是否有重复
let arr_f2 = [];
for (let i = 0, len = this.goodsList.length; i < len; i++) {
if (this.goodsList[i].v1 === '' || this.goodsList[i].v2 === '' || this.goodsList[i].v3.length === 0) {
reject(new Error('微盟适用商品填写不完整'));
}
arr_f2.push(this.goodsList[i].v2);
}
if (arr_f2.length !== [...new Set(arr_f2)].length) {
reject(new Error('微盟适用商品参数重复'));
}
resolve();
})
.then(res => {
return this.goodsList.map(v => {
let outPropertyId = ''; // 寻找 outPropertyId_outValueId
for (let ii = 0, lenn = v.f2.length; ii < lenn; ii++) {
if (v.f2[ii].id === v.v2) {
outPropertyId += v.f2[ii].outPropertyId + '_';
break;
}
}
// 第三层映射 push键值对
const propValues = v.v3.map(y => {
let idx = -1;
for (let i = 0, len = v.f3.length; i < len; i++) {
if (v.f3[i].id === y) {
idx = i;
break;
}
}
return {
valueId: v.f3[idx].id,
valueName: v.f3[idx].title,
relationIds: outPropertyId + v.f3[idx].outValueId
};
});
v.v3name = propValues;
return {
categoryId: v.v1,
categoryName: v.v1name,
propId: v.v2,
propName: v.v2name,
propValues
};
});
})
.catch(err => {
this.$tips({ type: 'warning', message: err.message });
return false;
});
} }
// ------微盟适用商品结束-------
} }
}; };
...@@ -51,6 +51,26 @@ ...@@ -51,6 +51,26 @@
<div v-show="form.cardType !== 2"><el-checkbox :disabled="isEdit || isInfo" v-model="goods.flag">适用商品</el-checkbox> <span class="fz12 gray">(至少填写一项)</span></div> <div v-show="form.cardType !== 2"><el-checkbox :disabled="isEdit || isInfo" v-model="goods.flag">适用商品</el-checkbox> <span class="fz12 gray">(至少填写一项)</span></div>
<div class="mb10" v-show="form.cardType !== 2"><span class="inline-block w100 text-right">适用商品</span> <dm-input @focus="goods.flag = true" v-model="goods.ok" :disabled="isEdit || isInfo" class="w300" placeholder="限制18个汉字内" :maxlength="18"></dm-input></div> <div class="mb10" v-show="form.cardType !== 2"><span class="inline-block w100 text-right">适用商品</span> <dm-input @focus="goods.flag = true" v-model="goods.ok" :disabled="isEdit || isInfo" class="w300" placeholder="限制18个汉字内" :maxlength="18"></dm-input></div>
<div v-show="form.cardType !== 2" class="mb10"><span class="inline-block w100 text-right">不适用商品</span> <dm-input @focus="goods.flag = true" v-model="goods.no" :disabled="isEdit || isInfo" class="w300" placeholder="限制18个汉字内" :maxlength="18"></dm-input></div> <div v-show="form.cardType !== 2" class="mb10"><span class="inline-block w100 text-right">不适用商品</span> <dm-input @focus="goods.flag = true" v-model="goods.no" :disabled="isEdit || isInfo" class="w300" placeholder="限制18个汉字内" :maxlength="18"></dm-input></div>
<!-- 微盟适用商品 -->
<div v-if="(form.cardType === 0 || form.cardType === 1) && form.cardApplyChannel.indexOf('WMmicroMall') !== -1">
<div v-for="(list, idx) in goodsList" :key="idx" class="mb10">
<span class="inline-block w100 text-right">微盟适用商品{{ idx + 1 }}</span>
<el-select :disabled="isEdit" class="w250" v-model="list.v1" filterable placeholder=" 选择商品类目" clearable :loading="loading" @change="handleF1Change($event, idx)">
<el-option v-for="item in f1" :key="item.id" :label="item.title" :value="item.id"></el-option>
</el-select>
<el-select :disabled="isEdit || list.isCopy" class="w250" v-model="list.v2" filterable remote reserve-keyword placeholder="选择商品参数" clearable :loading="loading" @change="handleF2Change($event, idx)">
<el-option v-for="item in list.f2" :key="item.id" :label="item.title" :value="item.id"></el-option>
</el-select>
<el-select :disabled="isEdit || list.isCopy" class="w250" v-model="list.v3" multiple filterable remote reserve-keyword placeholder="选择商品参数值" clearable :loading="loading">
<el-option v-for="item in list.f3" :key="item.id" :label="item.title" :value="item.id"></el-option>
</el-select>
<div v-if="isAdd || isCopy" class="inline-block">
<el-button v-show="idx === goodsList.length - 1 && goodsList.length < 10" type="primary" icon="el-icon-plus" circle @click="addLine"></el-button>
<el-button icon="el-icon-delete" circle @click="delLine(idx)"></el-button>
</div>
</div>
</div>
<!-- {{ goodsList }} -->
<!-- 兑换券 --> <!-- 兑换券 -->
<div v-show="form.cardType === 2" class="mb10"><el-checkbox :disabled="isEdit || isInfo" v-model="sale_limit.flag">消费条件</el-checkbox> <span class="fz12 gray">(至少填写一项)</span></div> <div v-show="form.cardType === 2" class="mb10"><el-checkbox :disabled="isEdit || isInfo" v-model="sale_limit.flag">消费条件</el-checkbox> <span class="fz12 gray">(至少填写一项)</span></div>
<div class="mb10" v-show="form.cardType === 2"> <div class="mb10" v-show="form.cardType === 2">
......
<template> <template>
<section class="card-record-send"> <section class="card-record-send">
<div class="pb22"> <div class="pb22">
<el-select class="vertical-middle w150" v-model="listParams.sendStatus" placeholder="投放状态" @change="search"> <el-select class="vertical-middle w150" v-model="listParams.sendStatus" placeholder="投放状态" @change="handleStatusChange">
<el-option label="成功" :value="1"></el-option> <el-option label="成功" :value="1"></el-option>
<el-option label="失败" :value="0"></el-option> <el-option label="失败" :value="0"></el-option>
</el-select> </el-select>
<el-input class="w300" v-model="listParams.search" placeholder="输入卡券名称/备注名/活动名" @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input> <div class="inline-block" v-show="listParams.sendStatus === 1">
<el-date-picker class="w280" v-model="receiveTime" type="daterange" range-separator="至" start-placeholder="领取开始时间" end-placeholder="领取结束时间" @change="refresh"></el-date-picker>
<el-date-picker class="w280" v-model="verifyTime" type="daterange" range-separator="至" start-placeholder="核销开始时间" end-placeholder="核销结束时间" @change="refresh"></el-date-picker>
<el-select class="vertical-middle w150" v-model="listParams.cardStatus" placeholder="投放状态" @change="search">
<el-option v-for="(v, i) in getStatusOptions" :key="i" :label="v.label" :value="v.value"></el-option>
</el-select>
</div>
<el-input class="w250" v-model="listParams.search" placeholder="输入会员姓名/卡号" @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-button icon="iconfont icon-icon_yunxiazai fz14" class="fr" type="primary" @click="exportRecordSendInfoEvaluate"> 下载Excel</el-button>
</div> </div>
<el-table v-show="listParams.sendStatus === 1" tooltipEffect="light" :data="recordList" style="width: 100%" row-key="putonTime" v-loading="loading"> <el-table v-show="listParams.sendStatus === 1" tooltipEffect="light" :data="recordList" style="width: 100%" row-key="putonTime" v-loading="loading">
<el-table-column width="150" align="left" prop="cardName" label="卡券名称"> <el-table-column min-width="150" align="left" prop="cardName" label="会员信息">
<template slot-scope="scope"> <!-- <template slot-scope="scope">
<p style="line-height:22px;">{{ scope.row.cardName }}</p> <p style="line-height:22px;">{{ scope.row.cardName }}</p>
<p class="fz13 gray" style="line-height:20px;">{{ scope.row.subName }}</p> <p class="fz13 gray" style="line-height:20px;">{{ scope.row.subName }}</p>
</template> </template> -->
</el-table-column> </el-table-column>
<el-table-column v-for="(v, i) in successHeader" :show-overflow-tooltip="v.tooltip" :width="v.width" :min-width="v.minWidth" :align="v.align" :key="i" :prop="v.prop" :label="v.label" :formatter="v.formatter"></el-table-column> <el-table-column v-for="(v, i) in successHeader" :show-overflow-tooltip="v.tooltip" :width="v.width" :min-width="v.minWidth" :align="v.align" :key="i" :prop="v.prop" :label="v.label" :formatter="v.formatter"></el-table-column>
<el-table-column width="150" align="left" prop="cardName" label="卡券状态"> <el-table-column min-width="100" align="left" prop="cardName" label="卡券状态">
待领取 待领取
</el-table-column> </el-table-column>
<el-table-column width="100" align="left" prop="putonTime" label="领取时间"> <el-table-column min-width="100" align="left" prop="putonTime" label="领取时间">
<template slot-scope="scope"> <template slot-scope="scope">
<p style="color:#606266;">{{ formatDateTimeByType(scope.row.putonTime, 'yyyy-MM-dd-HH-mm', true).y }}</p> <p style="color:#606266;">{{ formatDateTimeByType(scope.row.putonTime, 'yyyy-MM-dd-HH-mm', true).y }}</p>
<p style="color:#606266;">{{ formatDateTimeByType(scope.row.putonTime, 'yyyy-MM-dd-HH-mm', true).h }}</p> <p style="color:#606266;">{{ formatDateTimeByType(scope.row.putonTime, 'yyyy-MM-dd-HH-mm', true).h }}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="100" align="left" prop="putonTime" label="核销时间"> <el-table-column min-width="100" align="left" prop="putonTime" label="核销时间">
<template slot-scope="scope"> <template slot-scope="scope">
<p style="color:#606266;">{{ formatDateTimeByType(scope.row.putonTime, 'yyyy-MM-dd-HH-mm', true).y }}</p> <p style="color:#606266;">{{ formatDateTimeByType(scope.row.putonTime, 'yyyy-MM-dd-HH-mm', true).y }}</p>
<p style="color:#606266;">{{ formatDateTimeByType(scope.row.putonTime, 'yyyy-MM-dd-HH-mm', true).h }}</p> <p style="color:#606266;">{{ formatDateTimeByType(scope.row.putonTime, 'yyyy-MM-dd-HH-mm', true).h }}</p>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="100" align="left" prop="putonTime" label="订单流水"> <el-table-column min-width="100" align="left" prop="putonTime" label="订单流水">
????? ?????
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -65,6 +73,7 @@ ...@@ -65,6 +73,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination v-show="recordList.length" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="listParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></el-pagination> <el-pagination v-show="recordList.length" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="listParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></el-pagination>
<vue-gic-export-excel :dialogVisible.sync="dialogVisible" :dataArr="recordList" :type="2" :excelUrl="excelUrl" :params="params" :projectName="projectName"></vue-gic-export-excel>
</section> </section>
</template> </template>
<script> <script>
...@@ -77,85 +86,107 @@ export default { ...@@ -77,85 +86,107 @@ export default {
data() { data() {
return { return {
formatDateTimeByType, formatDateTimeByType,
getStatusOptions: [{ value: -1, label: '全部卡券状态' }, { value: 1, label: '待领取' }, { value: 2, label: '已领取' }, { value: 3, label: '已过期' }, { value: 4, label: ' 已核销' }, { value: 5, label: '已销毁' }, { value: 6, label: '已占用' }],
loading: false, loading: false,
recordList: [], recordList: [],
receiveTime: ['', ''], // 领取时间
verifyTime: ['', ''], // 核销时间
successHeader: [ successHeader: [
{ label: '活动名称', prop: 'putonName', minWidth: '150', tooltip: true, align: 'left' }, { label: '卡券代码', prop: '', tooltip: true, align: 'left' },
{ label: '投放人数', prop: 'issuingQuantity', width: '80', align: 'left' },
{ label: '领取数量', prop: 'getedQuantity', width: '80', align: 'left' },
{
label: '领取率',
prop: 'getedQuantity',
width: '80',
align: 'left',
formatter(row) {
return ((row.getedQuantity * 100) / (row.issuingQuantity === 0 ? 1 : row.issuingQuantity)).toFixed(2) + '%';
}
},
{ label: '使用数量', prop: 'usageQuantity', width: '80', align: 'left' },
{ {
label: '核销率', label: '卡券类型',
prop: 'usageQuantity', // prop: 'getedQuantity',
width: '80', width: '80',
align: 'left', align: 'left',
formatter(row) { formatter(row) {
return ((row.usageQuantity * 100) / (row.getedQuantity === 0 ? 1 : row.getedQuantity)).toFixed(2) + '%'; return 'no-------';
} }
}, },
{ label: '销售额', prop: 'saleAmount', width: '80', align: 'left' } { label: '投放状态', prop: 'aa', width: '80', align: 'left' },
{ label: '卡券状态', prop: 'aa', width: '80', align: 'left' },
{ label: '领取时间', prop: 'aa', width: '80', align: 'left' },
{ label: '核销时间', prop: 'aa', width: '80', align: 'left' },
{ label: '订单流水号', prop: 'aa', tooltip: true, minWidth: '100', align: 'left' }
], ],
listParams: { listParams: {
beginTime: '', recieveBeginTime: '',
endTime: '', recieveEndTime: '',
cardStatus: 1, verifyBeginTime: '',
verifyEndTime: '',
cardStatus: -1,
sendStatus: 1, sendStatus: 1,
recordType: 0, recordType: 0,
search: '', search: '',
currentPage: 1, currentPage: 1,
pageSize: 20 pageSize: 20
}, },
total: 0 total: 0,
// excel
dialogVisible: false,
excelUrl: '', // 下载数据的地址
params: {} // 传递的参数
}; };
}, },
created() { created() {
this.getTableList(); this.getTableList();
this.$store.commit('mutations_breadcrumb', [{ name: '营销管理', path: '' }, { name: '卡券营销', path: '' }, { name: '卡券记录', path: '' }, { name: '投放记录', path: '' }]); this.$store.commit('mutations_breadcrumb', [{ name: '营销管理', path: '' }, { name: '卡券营销', path: '' }, { name: '卡券记录', path: '' }, { name: '投放记录', path: '/card/record/send' }, { name: '投放详情', path: '' }]);
}, },
methods: { methods: {
//获取列表 //获取列表
getTableList() { async getTableList() {
this.loading = true; this.loading = true;
cardRecordPage(this.listParams).then(res => { let res;
if (res.errorCode === 0) { this.formatterTimeFunc(); // 处理时间
this.recordList = res.result.result; if (this.listParams.sendStatus === 1) {
this.total = res.result.totalCount; res = await cardRecordPage(this.listParams);
} } else {
this.loading = false; res = await cardRecordPage(this.listParams);
}
console.log(this.listParams);
if (res.errorCode === 0) {
this.recordList = res.result.result;
this.total = res.result.totalCount;
}
this.loading = false;
},
// 清除筛选条件
clear() {
Object.assign(this.listParams, {
recieveBeginTime: '',
recieveEndTime: '',
verifyBeginTime: '',
verifyEndTime: '',
cardStatus: -1,
recordType: 0,
search: '',
currentPage: 1
}); });
}, },
filterStatus(val) { handleStatusChange() {
let result = { label: '执行错误', type: 'danger' }; this.clear();
switch (val) { this.getTableList();
case 1: },
result = { label: '待发送', type: 'warning' }; // 处理时间
break; formatterTimeFunc() {
case 2: if (!this.receiveTime) {
result = { label: '正在发送', type: 'primary--flash' }; this.listParams.recieveBeginTime = this.listParams.recieveEndTime = '';
break; } else {
case 3: this.listParams.recieveBeginTime = formatDateTimeByType(this.receiveTime[0], 'yyyy-MM-dd');
result = { label: '已发送', type: 'success' }; this.listParams.recieveEndTime = formatDateTimeByType(this.receiveTime[1], 'yyyy-MM-dd');
break;
case 4:
result = { label: '无接收人', type: 'info' };
break;
case 5:
result = { label: '库存不足', type: 'info' };
break;
default:
result = { label: '投放错误', type: 'danger' };
break;
} }
return result;
if (!this.verifyTime) {
this.listParams.verifyBeginTime = this.listParams.verifyEndTime = '';
} else {
this.listParams.verifyBeginTime = formatDateTimeByType(this.verifyTime[0], 'yyyy-MM-dd');
this.listParams.verifyEndTime = formatDateTimeByType(this.verifyTime[1], 'yyyy-MM-dd');
}
},
// 导出excel
exportRecordSendInfoEvaluate() {
this.dialogVisible = true;
// return
} }
} }
}; };
......
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
loading: false, loading: false,
recordList: [], recordList: [],
recordHeader: [ recordHeader: [
{ label: '活动名称', prop: 'putonName', minWidth: '150', tooltip: true, align: 'left' }, { label: '活动名称', prop: 'putonName', tooltip: true, align: 'left' },
{ label: '投放人数', prop: 'issuingQuantity', width: '80', align: 'left' }, { label: '投放人数', prop: 'issuingQuantity', width: '80', align: 'left' },
{ label: '领取数量', prop: 'getedQuantity', width: '80', align: 'left' }, { label: '领取数量', prop: 'getedQuantity', width: '80', align: 'left' },
{ {
......
...@@ -4,7 +4,7 @@ export default { ...@@ -4,7 +4,7 @@ export default {
editAlert() { editAlert() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (this.isEdit) { if (this.isEdit) {
this.$confirm('若已修改本次游戏奖品,已发放的积分和卡券无法回溯,后果自负?', '提示', { this.$confirm('游戏设置的修改保存后生效,历史数据不受影响', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
......
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