Commit c0ec8bdd by chenxin

fix: 上线内容:

1.卡券包功能
2.ecm 营销事件 卡券放开领取限制+通知处新增无微信客服/群发接口,历史数据保存不允许保存微信客服/群发接口;
parents 5dd9a73e c1337476
<!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.a1e4d33916edf51c6d2f71a0f83eeb33.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.33.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.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.13.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.38.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.1.95.js></script><script type=text/javascript src=/marketing/static/js/manifest.2ff8c9514bdd567d0c15.js></script><script type=text/javascript src=/marketing/static/js/vendor.810e43468685c3e36778.js></script><script type=text/javascript src=/marketing/static/js/main.561b7ea36330b1580a67.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.4024df166b12865b28ec79c7cdbbfc99.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.33.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.08.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.13.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.38.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.1.95.js></script><script type=text/javascript src=/marketing/static/js/manifest.a07a12f2c6778dd2b4b9.js></script><script type=text/javascript src=/marketing/static/js/vendor.810e43468685c3e36778.js></script><script type=text/javascript src=/marketing/static/js/main.b8d3f67831e301913bfb.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.
!function(e){var r=window.webpackJsonp;window.webpackJsonp=function(n,a,c){for(var i,u,f,s=0,l=[];s<n.length;s++)u=n[s],t[u]&&l.push(t[u][0]),t[u]=0;for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i]);for(r&&r(n,a,c);l.length;)l.shift()();if(c)for(s=0;s<c.length;s++)f=o(o.s=c[s]);return f};var n={},t={12:0};function o(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var r=t[e];if(0===r)return new Promise(function(e){e()});if(r)return r[2];var n=new Promise(function(n,o){r=t[e]=[n,o]});r[2]=n;var a=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,o.nc&&c.setAttribute("nonce",o.nc),c.src=o.p+"static/js/"+({0:"game",1:"card",2:"wechat",3:"message",4:"ewash",5:"evaluation",6:"ecm",7:"recharge",8:"msg",9:"calllog"}[e]||e)+"."+{0:"3e60aeb001783811cefe",1:"d9a72550621ce9d3e95b",2:"e04323d416b97e80951a",3:"e41254445cc97187ca9a",4:"be0c8ab7b7fe18eb35df",5:"874eba462c04264ff0dc",6:"6d471386e2e38425c8ab",7:"7800a1645705a6640145",8:"4b4e327d76f3e16d4b51",9:"fecc3d1064e01cef69e9"}[e]+".js";var i=setTimeout(u,12e4);function u(){c.onerror=c.onload=null,clearTimeout(i);var r=t[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return c.onerror=c.onload=u,a.appendChild(c),n},o.m=e,o.c=n,o.d=function(e,r,n){o.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,"a",r),r},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.p="/marketing/",o.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var r=window.webpackJsonp;window.webpackJsonp=function(n,a,c){for(var f,i,u,d=0,s=[];d<n.length;d++)i=n[d],t[i]&&s.push(t[i][0]),t[i]=0;for(f in a)Object.prototype.hasOwnProperty.call(a,f)&&(e[f]=a[f]);for(r&&r(n,a,c);s.length;)s.shift()();if(c)for(d=0;d<c.length;d++)u=o(o.s=c[d]);return u};var n={},t={12:0};function o(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.e=function(e){var r=t[e];if(0===r)return new Promise(function(e){e()});if(r)return r[2];var n=new Promise(function(n,o){r=t[e]=[n,o]});r[2]=n;var a=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,o.nc&&c.setAttribute("nonce",o.nc),c.src=o.p+"static/js/"+({0:"card",1:"game",2:"wechat",3:"ewash",4:"evaluation",5:"message",6:"ecm",7:"recharge",8:"msg",9:"calllog"}[e]||e)+"."+{0:"36fe5afdc7c6d5768c03",1:"d34e761f66c65eafa27d",2:"e04323d416b97e80951a",3:"17e1a8a57cff3e36f17d",4:"03dd6d15caeafabf671c",5:"73ec2f1707504c4de588",6:"4789a0054f630738550c",7:"7800a1645705a6640145",8:"4b4e327d76f3e16d4b51",9:"fecc3d1064e01cef69e9"}[e]+".js";var f=setTimeout(i,12e4);function i(){c.onerror=c.onload=null,clearTimeout(f);var r=t[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),t[e]=void 0)}return c.onerror=c.onload=i,a.appendChild(c),n},o.m=e,o.c=n,o.d=function(e,r,n){o.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,"a",r),r},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.p="/marketing/",o.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
......@@ -10,27 +10,6 @@
<link rel="stylesheet" href="//web-1251519181.file.myqcloud.com/components/element.2.12.0.css">
<!-- element 皮肤 -->
<!-- <link rel="stylesheet" type="text/css" href="http://web-1251519181.file.myqcloud.com/lib/elementUI/theme.1.0.1/index.css"> -->
<!-- GrowingIO Analytics code version 2.1 -->
<!-- Copyright 2015-2018 GrowingIO, Inc. More info available at http://www.growingio.com -->
<!-- <script type='text/javascript'>
!(function(e, t, n, g, i) {
(e[i] =
e[i] ||
function() {
(e[i].q = e[i].q || []).push(arguments);
}),
(n = t.createElement('script')),
(tag = t.getElementsByTagName('script')[0]),
(n.async = 1),
(n.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + g),
tag.parentNode.insertBefore(n, tag);
})(window, document, 'script', 'assets.giocdn.com/2.1/gio.js', 'gio');
gio('init', '8be12240a3749eab', {});
//custom page code begin here
//custom page code end here
gio('send');
</script> -->
<!-- End GrowingIO Analytics code version: 2.1 -->
</head>
<body>
<div id="app"></div>
......@@ -44,7 +23,7 @@
<!-- 组件引用cdn -->
<script src="//web-1251519181.file.myqcloud.com/components/header.2.0.33.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.02.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/card.2.0.08.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>
......
......@@ -58,6 +58,49 @@ export default {
]
},
{
path: 'merge',
name: '卡券包',
component: () => import(/* webpackChunkName: "card" */ '../../views/card/merge.vue'),
meta: {},
redirect: 'merge/list',
children: [
{
path: 'list',
name: '卡券包列表',
component: () => import(/* webpackChunkName: "card" */ '../../views/card/merge-list.vue'),
meta: {
path: '/card/merge/list'
}
},
{
path: 'record-list',
name: '卡券包领取记录',
component: () => import(/* webpackChunkName: "card" */ '../../views/card/merge-record-list.vue'),
meta: {
path: '/card/merge/record-list'
}
},
{
path: 'add',
name: '新建卡券包',
component: () => import(/* webpackChunkName: "card" */ '../../views/card/merge-form.vue'),
meta: {
path: '/card/merge/list',
type: 'add'
}
},
{
path: 'edit/:id',
name: '编辑卡券包',
component: () => import(/* webpackChunkName: "card" */ '../../views/card/merge-form.vue'),
meta: {
path: '/card/merge/list',
type: 'edit'
}
}
]
},
{
path: 'groupsend',
name: '新建卡券群发',
component: () => import(/* webpackChunkName: "card" */ '../../views/card/group-send.vue'),
......
......@@ -62,7 +62,7 @@ export default {
meta: {
path: '/message/record'
}
},
}
// {
// path: 'import-send',
// name: '导入发送列表',
......@@ -71,23 +71,23 @@ export default {
// path: '/message/importSend'
// }
// },
{
path: 'import-send/add',
name: '手工导入群发',
component: () => import(/* webpackChunkName: "message" */ '../../views/message/importSendForm.vue'),
meta: {
type: 'add',
path: '/message/importSend'
}
},
{
path: 'import-send/info/:id',
name: '手工导入群发详情',
component: () => import(/* webpackChunkName: "message" */ '../../views/message/importSendForm.vue'),
meta: {
type: 'info',
path: '/message/importSend'
}
}
// {
// path: 'import-send/add',
// name: '手工导入群发',
// component: () => import(/* webpackChunkName: "message" */ '../../views/message/importSendForm.vue'),
// meta: {
// type: 'add',
// path: '/message/importSend'
// }
// },
// {
// path: 'import-send/info/:id',
// name: '手工导入群发详情',
// component: () => import(/* webpackChunkName: "message" */ '../../views/message/importSendForm.vue'),
// meta: {
// type: 'info',
// path: '/message/importSend'
// }
// }
]
};
......@@ -101,3 +101,21 @@ export const templateReceiveCardPage = params => requests(PREFIX + 'template-rec
// 导出临时卡券记录
export const exportTemplateReceivedExcel = config.api + PREFIX + 'export-template-receive-excel';
//卡券营销--卡券包--卡券包列表
export const pageCoupPackage = params => requests(PREFIX + 'page-coup-package', params);
//卡券营销--卡券包--新增/修改卡券包
export const saveCoupPackage = params => requests(PREFIX + 'create-coup-package', params);
//卡券营销--卡券包--查看卡券包详情
export const coupPackageDetail = params => requests(PREFIX + 'coup-package-detail', params);
//卡券营销--卡券包--删除卡券包
export const deleteCoupPackage = params => requests(PREFIX + 'delete-coup-package', params);
//卡券营销--卡券包--卡券包领取日志分页列表
export const pageCoupPackageLog = params => requests(PREFIX + 'page-coup-package-log', params);
//卡券营销--卡券包--根据卡券ids获取卡券列表
export const getCoupListInfo = params => requests(PREFIX + 'get-coup-list-info', params);
......@@ -5,7 +5,7 @@
<el-select class="dm-select w160" v-model="listParams.cardType" clearable placeholder="所有销毁方式" @change="refresh">
<el-option v-for="(item, index) in destoryType" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input v-model="listParams.searchParam" class="w300" placeholder="请输入卡券名称名称" clearable @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-input v-model="listParams.searchParam" class="w300" placeholder="请输入卡券名称" clearable @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-button class="fr" type="danger" @click="visible = true">卡券销毁</el-button>
</div>
<el-table tooltipEffect="light" :data="tableList" style="width: 100%" v-loading="loading">
......
<template>
<div class="dm-wrap" v-loading="loading">
<el-form ref="form" :model="ruleForm" label-width="140px" :rules="rules">
<el-form-item prop="name" label="卡券包名称">
<dm-input v-model="ruleForm.name" class="w300" placeholder="请输入卡券包名称" :byteType="1" :maxlength="10"></dm-input>
</el-form-item>
<el-form-item prop="effectiveMode" label="发送时间">
<!-- <el-select class="w300" v-model="ruleForm.effectiveMode">
<el-option v-for="(v, i) in sendTypeOptions" :key="i" :value="v.value" :label="v.label"></el-option>
</el-select> -->
<el-radio-group v-model="ruleForm.effectiveMode">
<el-radio :label="0">不限</el-radio>
<el-radio :label="1">选择时间段</el-radio>
</el-radio-group>
<br />
<el-date-picker v-if="ruleForm.effectiveMode" class="w300 mt10" v-model="dateTime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions"></el-date-picker>
</el-form-item>
<el-form-item label="营销场景">
<el-select class="w300" v-model="ruleForm.sceneSettingId" placeholder="选择营销场景">
<el-option v-for="item in sceneSettingIdOptions" :key="item.sceneSettingId" :label="item.sceneName" :value="item.sceneSettingId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="cardIds" label="新增卡券">
<el-button @click="showCardDialog = true">添加卡券</el-button>
<el-table v-if="ruleForm.cardIds" class="mt20" :data="tableData" style="width: 100%">
<el-table-column min-width="120" align="left" prop="cardName" label="卡券名称">
<template slot-scope="scope">
<p style="line-height:22px;">{{ scope.row.cardName }}</p>
<p class="fz13 gray" style="line-height:20px;">{{ scope.row.subName }}</p>
</template>
</el-table-column>
<el-table-column min-width="120" align="left" label="有效期">
<template slot-scope="scope">
<span v-if="scope.row.cardEffectiveMode !== 0">领取后第{{ scope.row.startDay + 1 }}-{{ scope.row.limitDay + scope.row.startDay }}</span>
<span v-if="scope.row.cardEffectiveMode === 0">{{ formatDateTimeByType(scope.row.beginDate, 'yyyy-MM-dd') }}{{ formatDateTimeByType(scope.row.endDate, 'yyyy-MM-dd') }}</span>
</template>
</el-table-column>
<el-table-column min-width="120" align="left" label="领取限制">
<template slot-scope="scope">
<span>每人限制{{ scope.row.cardLimit }}</span>
</template>
</el-table-column>
<el-table-column min-width="120" align="left" label="适用门店">
<template slot-scope="scope">
<span>{{ scope.row.storeMode === 0 ? '所有门店' : scope.row.storeMode === 1 ? '部分分组' : '部分门店' }}</span>
</template>
</el-table-column>
<el-table-column min-width="120" align="left" label="库存">
<template slot-scope="scope">
<span v-if="scope.row.auditingStatus !== -1">{{ scope.row.couponStock }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="left" width="80px" fixed="right">
<template slot-scope="scope">
<el-button type="text" @click="del(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="saveForm">{{ isAdd ? '新增' : '保存' }}</el-button>
</el-form-item>
</el-form>
<vue-gic-card :showCardDialog="showCardDialog" @selectCard="selectCard" :cardLimit="-1" :cardType="null"></vue-gic-card>
</div>
</template>
<script>
import { saveCoupPackage, coupPackageDetail, getCoupListInfo } from '@/service/api/cardApi.js';
import { sceneSettingList } from '@/service/api/wechatApi.js';
import { formatDateTimeByType } from '@/utils/index.js';
export default {
name: 'merge-form',
data() {
const validateSendType = (rule, value, callback) => {
console.log(this.dateTime);
if (this.ruleForm.effectiveMode) {
if ((this.dateTime && !this.dateTime[0]) || !this.dateTime) {
callback(new Error('请选择发送时间'));
}
}
callback();
};
return {
loading: false,
showCardDialog: false,
ruleForm: {
cardPackageId: '',
cardIds: '', // 卡券ids,多个id用逗号隔开
name: '',
effectiveMode: 0,
sceneSettingId: ''
},
dateTime: [],
rules: {
name: [{ required: true, message: '请输入卡券包名称', trigger: 'change' }],
effectiveMode: [{ required: true, validator: validateSendType, trigger: 'change' }],
cardIds: [{ required: true, message: '请选择卡券', trigger: 'change' }]
},
pickerOptions: {
disabledDate(now) {
return now.getTime() < Date.now() - 24 * 60 * 60 * 1000;
}
},
tableData: [],
sceneSettingIdOptions: [],
isAdd: this.$route.meta.type === 'add',
isEdit: this.$route.meta.type === 'edit'
};
},
methods: {
formatDateTimeByType,
del({ coupCardId }) {
let arr = this.ruleForm.cardIds.split(',');
const idx = arr.findIndex(v => {
return v === coupCardId;
});
arr.splice(idx, 1);
this.ruleForm.cardIds = arr.join();
if (this.ruleForm.cardIds) {
this.getCoupListInfo();
} else {
this.tableData = [];
}
},
async sceneSettingList() {
let res = await sceneSettingList();
this.sceneSettingIdOptions = res.result || [];
},
// 获取卡券list
async getCoupListInfo() {
this.loading = true;
getCoupListInfo({ cardIds: this.ruleForm.cardIds })
.then(res => {
this.loading = false;
this.tableData = res.result || [];
})
.catch(() => {
this.loading = false;
});
},
//选择卡券后置
selectCard(val) {
let arr = this.ruleForm.cardIds ? this.ruleForm.cardIds.split(',') : [];
if (val) {
if (!arr.includes(val.coupCardId)) {
arr.push(val.coupCardId);
this.ruleForm.cardIds = arr.join();
this.$refs.form.validateField('cardIds');
this.getCoupListInfo();
this.showCardDialog = false;
} else {
this.$tips({ type: 'warning', message: '卡券已存在' });
}
} else {
this.showCardDialog = false;
}
},
saveForm() {
this.$refs.form.validate(valid => {
if (!valid) {
return;
}
this.loading = true;
let params = { ...this.ruleForm };
if (this.ruleForm.effectiveMode) {
params.beginDate = formatDateTimeByType(this.dateTime[0], 'yyyy-MM-dd-HH-mm-ss');
params.endDate = formatDateTimeByType(this.dateTime[1], 'yyyy-MM-dd-HH-mm-ss');
}
if (this.isAdd) {
delete params.cardPackageId;
}
saveCoupPackage(params)
.then(res => {
this.$tips({ type: 'success', message: '操作成功' });
this.$router.push('/card/merge/list');
this.loading = false;
})
.catch(err => {
this.$tips({ type: 'error', message: err.message || '操作失败' });
this.loading = false;
});
});
},
getInfo() {
this.loading = true;
coupPackageDetail({ cardPackageId: this.$route.params.id })
.then(res => {
this.ruleForm = { ...res.result };
if (this.ruleForm.effectiveMode) {
this.dateTime = [res.result.beginDate, res.result.endDate];
}
this.getCoupListInfo();
this.loading = false;
})
.catch(err => {
this.$tips({ type: 'error', message: err.message || '获取详情失败' });
this.loading = false;
});
}
},
mounted() {
this.sceneSettingList();
if (this.isEdit) {
this.getInfo();
}
},
created() {
this.$store.commit('mutations_breadcrumb', [{ name: '营销管理', path: '' }, { name: '卡券营销', path: '' }, { name: '卡券包', path: '' }, { name: this.isAdd ? '新建卡券包' : '编辑卡券包', path: '' }]); // eslint-disable-line
}
};
</script>
<template>
<section class="dm-wrap">
<div class="pb22 clearfix">
<el-date-picker class="w400" v-model="dateTime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="refresh"></el-date-picker>
<el-select class="dm-select w160" v-model="listParams.sceneSettingId" clearable placeholder="所有营销场景" @change="refresh">
<el-option v-for="item in sceneSettingIdOptions" :key="item.sceneSettingId" :label="item.sceneName" :value="item.sceneSettingId"></el-option>
</el-select>
<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-button class="fr" type="primary" @click="$router.push('/card/merge/add')">新建卡券包</el-button>
</div>
<el-table tooltipEffect="light" :data="tableList" style="width: 100%" v-loading="loading">
<el-table-column :show-overflow-tooltip="true" min-width="140" align="left" prop="name" label="卡券包名称"></el-table-column>
<el-table-column :show-overflow-tooltip="true" min-width="100" align="left" prop="createTime" label="创建时间">
<template slot-scope="scope">
<p class="cell-time">
{{ formatDateTimeByType(scope.row.createTime, 'yyyy-MM-dd-HH-mm', true).y }}<br />
<span>{{ formatDateTimeByType(scope.row.createTime, 'yyyy-MM-dd-HH-mm', true).h }}</span>
</p>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" min-width="140" align="left" prop="createTime" label="有效期">
<template slot-scope="scope">
<span v-if="scope.row.effectiveMode">
{{ formatDateTimeByType(scope.row.beginDate, 'yyyy-MM-dd') }}
~<br />
{{ formatDateTimeByType(scope.row.endDate, 'yyyy-MM-dd') }}
</span>
<span v-else>不限</span>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" min-width="120" align="left" prop="cardSize" label="卡券数量"></el-table-column>
<el-table-column :show-overflow-tooltip="true" width="120" align="left" prop="sceneSettingName" label="场景值">
<template slot-scope="scope">{{ scope.row.sceneSettingName || '--' }}</template>
</el-table-column>
<el-table-column label="操作" align="left" width="120px" fixed="right">
<template slot-scope="scope">
<el-button type="text" @click="$router.push(`/card/merge/edit/${scope.row.cardPackageId}`)">修改</el-button>
<dm-delete @confirm="del(scope.row)" tips="是否删除该卡券包?">
<el-button type="text">删除</el-button>
</dm-delete>
</template>
</el-table-column>
</el-table>
<el-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"></el-pagination>
</section>
</template>
<script>
import { pageCoupPackage, deleteCoupPackage } from '@/service/api/cardApi.js';
import { sceneSettingList } from '@/service/api/wechatApi.js';
import { formatDateTimeByType } from '@/utils/index.js';
import talbeMethods from '@/mixins/tableMethods.js';
import filterAvater from '@/mixins/filterAvater.js';
export default {
name: 'destory-list',
mixins: [talbeMethods, filterAvater],
data() {
return {
formatDateTimeByType,
visible: false,
dateTime: [],
listParams: {
sceneSettingId: '',
beginTime: '',
endTime: '',
search: '',
currentPage: 1,
pageSize: 20
},
sceneSettingIdOptions: [],
total: 0,
loading: false,
tableList: [],
projectName: 'marketing', // 当前项目名
dialogVisible: false,
excelUrl: '', // 下载数据的地址
params: {} // 传递的参数
};
},
created() {
this.getTableList();
this.sceneSettingList();
this.$store.commit('mutations_breadcrumb', [{ name: '营销管理', path: '' }, { name: '卡券营销', path: '' }, { name: '卡券包', path: '' }, { name: '卡券包列表', path: '' }]); // eslint-disable-line
},
methods: {
del({ cardPackageId }) {
this.loading = true;
deleteCoupPackage({ cardPackageId })
.then(() => {
this.loading = false;
this.$tips({ type: 'success', message: '删除成功' });
this.getTableList();
})
.catch(err => {
this.$tips({ type: 'error', message: err.message || '操作失败' });
this.loading = false;
});
},
// 加载列表
async getTableList() {
this.loading = true;
this.dataTimeFormat();
try {
let res = await pageCoupPackage(this.listParams);
this.tableList = res.result.result || [];
this.total = res.result.totalCount || 0;
} catch (err) {
this.$tips({ type: 'error', message: '加载列表失败' });
}
this.loading = false;
},
async sceneSettingList() {
let res = await sceneSettingList();
this.sceneSettingIdOptions = res.result || [];
},
/**-------辅助方法---------- */
dataTimeFormat() {
if (this.dateTime) {
this.listParams.beginTime = formatDateTimeByType(this.dateTime[0], 'yyyy-MM-dd');
this.listParams.endTime = formatDateTimeByType(this.dateTime[1], 'yyyy-MM-dd');
} else {
this.listParams.beginTime = '';
this.listParams.endTime = '';
}
}
}
};
</script>
<template>
<section class="dm-wrap">
<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-input v-model="listParams.receiveCode" class="w300" placeholder="请输入投放渠道" clearable @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input> -->
<el-select class="dm-select w160" v-model="listParams.sceneSettingId" clearable placeholder="所有营销场景" @change="refresh">
<el-option v-for="item in sceneSettingIdOptions" :key="item.sceneSettingId" :label="item.sceneName" :value="item.sceneSettingId"></el-option>
</el-select>
</div>
<el-table tooltipEffect="light" :data="tableList" style="width: 100%" v-loading="loading">
<el-table-column :show-overflow-tooltip="true" min-width="100" align="left" prop="receiveTime" label="领取时间">
<template slot-scope="scope">
<p 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>
</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 :href="'/member/#/wechatmemberDetail?memberId=' + scope.row.memberId" target="_blank">
<img class="vertical-middle table__avatar--40" :src="scope.row.imageUrl || defaultAvatar" width="60" height="60" />
<div class="inline-block vertical-middle">
<p class="table-name--ellipsis">{{ scope.row.memberName || '--' }}</p>
<p class="fz13 gray">{{ scope.row.phoneNumber || '--' }}</p>
</div>
</a>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" min-width="120" align="left" prop="cardPackageName" label="卡券包名称"></el-table-column>
<el-table-column :show-overflow-tooltip="true" min-width="120" align="left" prop="receivePositionName" label="领取位置"></el-table-column>
<el-table-column :show-overflow-tooltip="true" min-width="120" align="left" prop="receiveName" label="投放渠道"></el-table-column>
<el-table-column :show-overflow-tooltip="true" min-width="120" align="left" prop="sceneSettingName" label="场景值"></el-table-column>
</el-table>
<el-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"></el-pagination>
</section>
</template>
<script>
import { pageCoupPackageLog } from '@/service/api/cardApi.js';
import { sceneSettingList } from '@/service/api/wechatApi.js';
import { formatDateTimeByType } from '@/utils/index.js';
import talbeMethods from '@/mixins/tableMethods.js';
import filterAvater from '@/mixins/filterAvater.js';
export default {
name: 'destory-list',
mixins: [talbeMethods, filterAvater],
data() {
return {
formatDateTimeByType,
visible: false,
listParams: {
search: '',
receiveCode: '',
sceneSettingId: '',
currentPage: 1,
pageSize: 20
},
sceneSettingIdOptions: [],
total: 0,
loading: false,
tableList: [],
projectName: 'marketing', // 当前项目名
dialogVisible: false,
excelUrl: '', // 下载数据的地址
params: {} // 传递的参数
};
},
created() {
this.getTableList();
this.sceneSettingList();
this.$store.commit('mutations_breadcrumb', [{ name: '营销管理', path: '' }, { name: '卡券营销', path: '' }, { name: '卡券包', path: '' }, { name: '卡券包领取记录', path: '' }]); // eslint-disable-line
},
methods: {
// 加载列表
async getTableList() {
this.loading = true;
try {
let res = await pageCoupPackageLog(this.listParams);
this.tableList = res.result.result || [];
this.total = res.result.totalCount || 0;
} catch (err) {
this.$tips({ type: 'error', message: '加载列表失败' });
}
this.loading = false;
},
async sceneSettingList() {
let res = await sceneSettingList();
this.sceneSettingIdOptions = res.result || [];
}
}
};
</script>
<template>
<router-view></router-view>
</template>
<script>
export default {
data() {
return {};
}
};
</script>
......@@ -27,7 +27,7 @@
<el-button @click="close">取 消</el-button>
<el-button type="primary" @click="submit">确认销毁</el-button>
</span>
<vue-gic-card :showCardDialog="showCardDialog" @selectCard="selectCard" :cardLimit="3" :cardType="null"></vue-gic-card>
<vue-gic-card :showCardDialog="showCardDialog" appendToBody @selectCard="selectCard" :cardLimit="3" :cardType="null"></vue-gic-card>
</el-dialog>
</template>
......
......@@ -26,6 +26,7 @@ export default {
// 消费触发错误提示
// error_cost_info: '',
// error_cost_count_info: '',
cardNoticeType: 0, // info 老数据用得到
form: {
memberType: 0,
ecmPlanName: '',
......@@ -240,6 +241,7 @@ export default {
this.form.marketingTimes = result.marketingTimes || 1;
//'0-不通知 1-微信对话框 2-模板消息 补发通知 0-不补发 1-补发'
this.form.cardNoticeType = result.cardNoticeType || 0;
this.cardNoticeType = result.cardNoticeType || 0;
this.form.templateNoticeFlag = result.templateNoticeFlag || 0;
// 判断回显
if (this.form.memberType === 0) {
......@@ -318,11 +320,11 @@ export default {
let template = null;
this.templateOptions = res.result.marketingTemplateList || [];
if (!this.isAdd) {
template = res.result.customMarketingTemplate;
template = res.result.customMarketingTemplate || res.result.marketingTemplateList[0];
} else {
template = res.result.marketingTemplateList[0];
}
this.triggerCode = template.triggerCode;
this.triggerCode = template ? template.triggerCode : '';
// 模板消息
if (template) {
this.templateInit(template);
......@@ -608,6 +610,10 @@ export default {
},
// 保存
saveEcmInfo(params) {
if (this.isEdit && this.form.cardNoticeType === 1) {
this.$tips({ type: 'warning', message: `修改卡券目前不支持微信客服/群发接口` });
return false;
}
if (this.loading) {
return;
}
......
......@@ -182,7 +182,7 @@
<!-- 营销事件组件 -->
<section class="dm-form__wrap">
<h3 class="dm-title__label">营销事件</h3>
<marketing-event ref="marketingEvent" @has-card="hasCard" v-if="ecmPlanId" :ecmPlanId="ecmPlanId" :isSupportVar="form.effectType === 0" :code="code" :enabledMessageState="enabledMessageState"></marketing-event>
<marketing-event ref="marketingEvent" @has-card="hasCard" v-if="ecmPlanId" :ecmPlanId="ecmPlanId" :isSupportVar="form.effectType === 0" :code="code" :enabledMessageState="enabledMessageState" :cardLimitType="-1"></marketing-event>
</section>
<!-- 只有存在卡券的情况下出现卡券通知方式 -->
<section class="dm-form__wrap" v-if="currentCard.comName">
......@@ -194,7 +194,7 @@
<i class="iconfont icon-xinxixianshi pl5 gray"></i>
</el-tooltip>
</el-radio>
<el-radio v-model="form.cardNoticeType" :label="1"
<el-radio v-if="isEdit && cardNoticeType === 1" v-model="form.cardNoticeType" :label="1"
>微信{{ form.effectType ? '群发' : '客服' }}接口
<el-tooltip placement="top-start" :content="form.effectType ? '建议大规模发券、智能营销定时计划使用,占用每个会员每月4次的营销次数。' : '客服接口需要用户在24小时之内与微信公众号互动才能发送成功,不占用每个用户每月4条的群发次数。'">
<i class="iconfont icon-xinxixianshi pl5 gray"></i>
......@@ -214,7 +214,6 @@
<el-option v-for="(v, i) in templateOptions" :key="i" :label="v.templateName" :value="v.triggerCode"></el-option>
</el-select>
</el-form-item>
<!-- 如果时效是实时(0)并且通知方式是微信群发接口(1) 出现补发设置-->
<el-form-item label="补发设置" prop="templateNoticeFlag" v-if="form.cardNoticeType === 1 && form.effectType === 0">
<el-checkbox v-model="form.templateNoticeFlag" :true-label="1" :false-label="0"
......
......@@ -65,6 +65,8 @@ export default {
return '领取限制领取1~100的卡券,系统已过滤,符合条件共';
} else if (this.cardLimitType === 3) {
return '领取限制领取<100的卡券不支持选择,系统已过滤,符合条件共';
} else if (this.cardLimitType === -1) {
return '该选择器可筛选所有领取限制卡券,共';
} else {
return '领取限制>1的卡券不支持选择,系统已过滤,符合条件共';
}
......
......@@ -30,7 +30,7 @@
</transition>
</div>
<!-- 弹窗组件 -->
<component :is="dialogCom" @sendItem="saveToList" :item="currentItem" :show.sync="dialogShow" :isSupportVar="isSupportVar"></component>
<component :is="dialogCom" @sendItem="saveToList" :item="currentItem" :show.sync="dialogShow" :isSupportVar="isSupportVar" :cardLimitType="cardLimitType"></component>
</section>
</template>
......@@ -104,6 +104,10 @@ export default {
isSupportVar: {
type: Boolean,
default: false
},
cardLimitType: {
type: Number,
default: 1
}
},
data() {
......@@ -260,9 +264,13 @@ export default {
}
// 接口请求 保存
saveUpdateMarketingType({ marketingType: JSON.stringify(params) }).then(res => {
this.getMarketingList();
});
saveUpdateMarketingType({ marketingType: JSON.stringify(params) })
.then(res => {
this.getMarketingList();
})
.catch(err => {
this.$message({ message: err.data.message, type: 'error' });
});
},
// 新增前置 不能超过营销事件限制数量
addItem(v) {
......@@ -280,11 +288,17 @@ export default {
// 删除操作
delItem(item) {
console.log(item);
deleteMarketingType({ ecmMarketingTypeRelationId: item.item.ecmMarketingTypeRelationId }).then(res => {
if (res.errorCode === 0) {
this.getMarketingList();
}
});
deleteMarketingType({ ecmMarketingTypeRelationId: item.item.ecmMarketingTypeRelationId, ecmPlanId: this.ecmPlanId })
.then(res => {
if (res.errorCode === 0) {
this.getMarketingList();
} else {
this.$message({ message: res.message, type: 'error' });
}
})
.catch(err => {
this.$message({ message: err.data.message, type: 'error' });
});
},
// 编辑前置
editItem(obj) {
......
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