Commit 0590902c by chenxin

fix:卡券领取channel;卡券销毁;card 微盟code;card 最高最低件数

parents c0ec8bdd 2ad051f0
<!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
<!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.98b997942d132955348d313c89ad8137.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.09.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.91e68c232da2ac74756e.js></script><script type=text/javascript src=/marketing/static/js/vendor.f6e5442e18ed1c7d4a4d.js></script><script type=text/javascript src=/marketing/static/js/main.6126c60d7495c38a2553.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.
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.
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(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
!function(e){var r=window.webpackJsonp;window.webpackJsonp=function(n,a,c){for(var f,i,u,s=0,l=[];s<n.length;s++)i=n[s],t[i]&&l.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);l.length;)l.shift()();if(c)for(s=0;s<c.length;s++)u=o(o.s=c[s]);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:"05e8f1c78347261aba20",1:"eb6684ab9f11f6b91609",2:"8dfc5243f93f4e39bff3",3:"3b8c083130a8a0ae383b",4:"d155f948cc7f6cd10a1f",5:"94e2070a13c6b19e1728",6:"8071f67f02dde99e499b",7:"d542294c098249a6ebf1",8:"b54ee100686a1538ee52",9:"7c23e852688ebfec2cbb"}[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
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.
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.
......@@ -23,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.08.js"></script>
<script src="//web-1251519181.file.myqcloud.com/components/card.2.0.09.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>
......
......@@ -202,10 +202,10 @@ export default {
var that = this;
// console.log("新数据:",newData,oldData)
that.repProjectName = newData || 'gic-web';
},
$route(val) {
console.log(val);
}
// $route(val) {
// console.log(val);
// }
},
/* 接收数据 */
......
<template>
<div>
<label class="el-button el-button--primary el-button--medium" :class="{ 'is-disabled': disabled }"
>{{ disabled ? '上传中...' : label }}
<input type="file" style="display:none;" :disabled="disabled" accept="image/gif, image/jpeg,image/png" ref="uploader" v-upload="this" />
<label class="el-button el-button--primary el-button--medium" :class="{ 'is-disabled': disabled || noUse }">
<i v-if="iconClass" :class="iconClass" class="mr5"></i>
{{ disabled ? '上传中...' : label }}
<input type="file" style="display:none;" :disabled="disabled || noUse" :accept="acceptType" ref="uploader" v-upload="this" />
</label>
<span class="fz12 gray" :style="tipsStyle"> {{ tips }}</span>
</div>
......@@ -39,14 +40,41 @@ export default {
default: '上传'
},
fileType: {
// 这个不要动
type: String,
default: 'file'
},
acceptType: {
type: String,
default: 'image/gif, image/jpeg,image/png'
},
showImg: {
type: Boolean,
default: true
},
tipsStyle: Object
tipsStyle: Object,
url: {
type: String,
default: ''
},
needExtraParams: {
// 上传是否需要额外参数
type: Boolean,
default: false
},
paramsObj: {
// 额外参数以对象的形式展示 .keys一下
type: Object
},
noUse: {
// 禁用
type: Boolean,
default: false
},
iconClass: {
type: String,
default: ''
}
},
watch: {
model: {
......
......@@ -67,6 +67,13 @@ export default {
let formData = new FormData();
formData.append(binding.value.fileType, el.files[0]);
formData.append('requestProject', 'gic-web');
if (binding.value.needExtraParams) {
// 请求添加额外参数
let obj = binding.value.paramsObj || {};
Object.keys(obj).map(v => {
formData.append(v, obj[v]);
});
}
axios
.post(config.api + binding.value.url, formData)
.then(res => {
......@@ -75,6 +82,9 @@ export default {
if (res.data.errorCode === 0) {
if (binding.value.url === '/api-plug/upload-img') {
(binding.value.model.code = res.data.result[0].imageFiledCode), (binding.value.model.imgUrl = res.data.result[0].qcloudImageUrl);
} else if (binding.value.acceptType && binding.value.acceptType.includes('csv')) {
// 额外为csv
binding.value.model.code = new Date().getTime();
} else {
(binding.value.model.code = res.data.result.imageFiledCode), (binding.value.model.imgUrl = res.data.result.qcloudImageUrl);
binding.value.model.mediaId = res.data.result.imageMediaId;
......@@ -89,7 +99,7 @@ export default {
.catch(error => {
binding.value.loading = false;
binding.value.disabled = false;
binding.value.$tips({ type: 'error', message: error.msg || '上传失败' });
binding.value.$tips({ type: 'error', message: error.message || '上传失败' });
});
}
});
......
......@@ -211,14 +211,14 @@ export default {
meta: {
path: '/card/check'
}
},
{
path: 'destroy',
name: '卡券销毁',
component: () => import(/* webpackChunkName: "card" */ '../../views/card/destroy-list.vue'),
meta: {
path: '/card/destroy'
}
}
// {
// path: 'destroy',
// name: '卡券销毁',
// component: () => import(/* webpackChunkName: "card" */ '../../views/card/destroy-list.vue'),
// meta: {
// path: '/card/destroy'
// }
// }
]
};
......@@ -119,3 +119,21 @@ export const pageCoupPackageLog = params => requests(PREFIX + 'page-coup-package
//卡券营销--卡券包--根据卡券ids获取卡券列表
export const getCoupListInfo = params => requests(PREFIX + 'get-coup-list-info', params);
//卡券营销--卡券销毁--新增获取主键id/编辑获取详情
export const getCoupDestoryDetail = params => requests(PREFIX + 'get-coup-destory-detail', params);
//卡券营销--卡券销毁--导入销毁券码文件
export const importDestoryCoupCode = PREFIX + 'import-destory-coup-code';
//卡券营销--卡券销毁--保存卡券销毁计划
export const saveCoupDestoryPlan = params => requests(PREFIX + 'save-coup-destory-plan', params);
//卡券营销--卡券销毁--卡券销毁计划分页列表
export const pageCoupDestoryPlan = params => requests(PREFIX + 'page-coup-destory-plan', params);
//卡券营销--卡券销毁--导出结果
export const exportDestoryPlanCode = config.api + PREFIX + 'export-destory-plan-code?requestProject=marketing';
// 卡券营销--卡券销毁--下载模板
export const downloadDestroyCodeTemplate = config.api + PREFIX + 'download-destroy-code-template?requestProject=marketing';
......@@ -21,3 +21,9 @@ export const logout = params => requests(PREFIX + 'do-logout?requestProject=mark
// 获取显示本人btn
export const getIsShowSelf = params => requests(MARKET_PREFIX + 'is-show-self?requestProject=marketing', params);
// 查询微盟店铺列表
export const listEntepriseWeimobShop = params => requests(MARKET_PREFIX + 'list-enteprise-weimob-shop', params);
// 根据微盟店铺id查询所有店铺卡券 list-enteprise-weimob-coupon?wmPid=xxx
export const listEntepriseWeimobCoupon = params => requests(MARKET_PREFIX + 'list-enteprise-weimob-coupon', params);
......@@ -5,12 +5,12 @@
<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-button class="fr" type="danger" @click="visible = true">卡券销毁</el-button>
<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="danger" @click="showDialog('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="120" align="left" prop="cardName" label="卡券名称"></el-table-column>
<el-table-column :show-overflow-tooltip="true" width="100" align="left" prop="createTime" label="销毁时间">
<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 />
......@@ -20,29 +20,36 @@
</el-table-column>
<el-table-column :show-overflow-tooltip="true" min-width="120" align="left" prop="orderNumber" label="销毁方式">
<template slot-scope="scope">
<p class="gray">{{ scope.row.orderNumber || '--' }}</p>
<div>{{ scope.row.destoryMode ? '部分销毁' : '全部销毁' }}</div>
</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" width="100" align="left" prop="createTime" label="销毁结果">
<template>
<p>成功:<span style="color:#52C41A;">1000</span></p>
<p>失败:<span style="color:#F5222D;">0</span></p>
<el-table-column :show-overflow-tooltip="true" min-width="80" align="left" prop="cardName" label="计划销毁数量">
<template slot-scope="scope">
<div>{{ scope.row.sucessCount + scope.row.failCount || '--' }}</div>
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" min-width="80" align="left" prop="createTime" label="销毁结果">
<template slot-scope="scope">
<p>
成功:<span style="color:#52C41A;">{{ scope.row.sucessCount }}</span>
</p>
<p>
失败:<span style="color:#F5222D;">{{ scope.row.failCount }}</span>
</p>
</template>
</el-table-column>
<el-table-column label="操作" align="left" width="120px" fixed="right">
<template>
<el-button type="text">导出结果</el-button>
<template slot-scope="scope">
<el-button type="text" @click="exportExcel(scope.row)">导出结果</el-button>
</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>
<vue-gic-export-excel :dialogVisible.sync="dialogVisible" :dataArr="tableList" :type="2" :excelUrl="excelUrl" :params="params" :projectName="projectName"></vue-gic-export-excel>
<destory-dialog :show.sync="visible" />
<destory-dialog :show.sync="dialog.show" v-bind="dialog" @refresh="getTableList" />
</section>
</template>
<script>
import { coupcardCheckList, exportCoupcardCheckExcel } from '@/service/api/cardApi.js';
import { pageCoupDestoryPlan, exportDestoryPlanCode } from '@/service/api/cardApi.js';
import { formatDateTimeByType } from '@/utils/index.js';
import destoryDialog from './partials/destory-dialog';
import talbeMethods from '@/mixins/tableMethods.js';
......@@ -55,22 +62,24 @@ export default {
return {
formatDateTimeByType,
visible: false,
dialog: {
show: false,
destoryItem: '',
type: 'add'
},
dateTime: [],
listParams: {
beginTime: '',
endTime: '',
searchParam: '',
search: '',
destoryMode: '',
currentPage: 1,
pageSize: 20
},
destoryType: [{ value: 0, label: '抵金券' }, { value: 1, label: '折扣券' }, { value: 2, label: '兑换券' }], // eslint-disable-line
destoryType: [{ value: 0, label: '全部销毁' }, { value: 1, label: '部分销毁' }], // eslint-disable-line
total: 0,
loading: false,
tableList: [],
projectName: 'marketing', // 当前项目名
dialogVisible: false,
excelUrl: '', // 下载数据的地址
params: {} // 传递的参数
tableList: []
};
},
created() {
......@@ -81,31 +90,29 @@ export default {
destoryDialog
},
methods: {
showDialog(type, destoryItem) {
this.dialog.type = type;
this.dialog.show = true;
if (type !== 'add') {
this.dialog.destoryItem = destoryItem;
}
},
// 加载列表
async getTableList() {
return;
this.loading = true;
this.dataTimeFormat();
try {
let res = await coupcardCheckList(this.listParams);
let res = await pageCoupDestoryPlan(this.listParams);
this.tableList = res.result.result || [];
this.total = res.result.totalCount || 0;
this.total = res.totalCount || 0;
} catch (err) {
this.$tips({ type: 'error', message: '加载列表失败' });
}
this.loading = false;
},
// 导出列表
exportExcel() {
this.dialogVisible = true;
this.excelUrl = exportCoupcardCheckExcel;
this.dataTimeFormat();
this.params = {
searchParam: this.listParams.searchParam,
beginTime: this.listParams.beginTime,
endTime: this.listParams.endTime,
requestProject: 'marketing'
};
exportExcel({ destoryPlanId }) {
window.location = exportDestoryPlanCode + `&destoryPlanId=${destoryPlanId}`;
},
/**-------辅助方法---------- */
dataTimeFormat() {
......
......@@ -5,6 +5,7 @@ import dmUploadImg from '@/components/upload/img';
import imgTextDrag from './partials/imgtext-drag';
import { formatDateTimeByType, deepClone } from '@/utils/index.js';
import xxSysp_mix from '@/mixins/selector.js'; // 商品选择器方法
import { listEntepriseWeimobShop, listEntepriseWeimobCoupon } from '@/service/api/commonApi.js';
import { cardGetShelfs, getCardDetail, saveUpdateCard, copyCardDetailService, getCategoryList, getPropertyList, getPropertyValueList } from '@/service/api/cardApi.js';
import dmGoodsInput from '@/components/goods-input/index.vue';
const initForm = {
......@@ -44,6 +45,7 @@ const initForm = {
proNoList: [],
discount_amount_upper_limit: 0,
goods_discounts_number_upper_limit: 0,
goods_discounts_number_lower_limit: 0,
products_exchange_number: 0,
onlyFlag: true // 是否显示与优惠同享,默认true显示
};
......@@ -97,6 +99,7 @@ export default {
products_exchange_number_show: false,
goodsDiscountCheck: true,
goodsDiscountCheckLower: true,
discountAmountCheck: true,
// ----微盟适用商品----
f1: [], // 一层的list
......@@ -113,8 +116,13 @@ export default {
v3name: []
}
],
coupGoodsWeimobList: []
coupGoodsWeimobList: [],
// ----微盟适用商品结束----
wmShopAddDisabled: true, // 添加店铺是否可用
wmShopIds: [], // 保存过的店铺id不能重复选择
countFlag: 0, // 微盟店铺 0不能使用 1只能添加1条 2能添加多条
weimobShopList: [], // 微盟店铺list
weimobDemoCodeList: [] // 保存的微盟店铺以及对应的微盟券号 {pid:xxxx,card:xxxx,loading:false, cardList: [], save: false, name: ''}
};
},
watch: {
......@@ -143,6 +151,13 @@ export default {
this.form.goods_discounts_number_upper_limit = 1;
}
},
goodsDiscountCheckLower(val) {
if (val) {
this.form.goods_discounts_number_lower_limit = 0;
} else if (this.form.goods_discounts_number_lower_limit <= 0) {
this.form.goods_discounts_number_lower_limit = 1;
}
},
'form.discount_amount_upper_limit': {
handler(val) {
this.discountAmountCheck = val <= 0;
......@@ -154,6 +169,12 @@ export default {
this.goodsDiscountCheck = val <= 0;
},
immediate: true
},
'form.goods_discounts_number_lower_limit': {
handler(val) {
this.goodsDiscountCheckLower = val <= 0;
},
immediate: true
}
},
components: {
......@@ -262,6 +283,7 @@ export default {
this.goods.ok = useCondition.goods ? useCondition.goods.ok || '' : '';
this.goods.no = useCondition.goods ? useCondition.goods.no || '' : '';
this.form.goods_discounts_number_upper_limit = useCondition.goods_discounts_number_upper_limit || 0;
this.form.goods_discounts_number_lower_limit = useCondition.goods_discounts_number_lower_limit || 0;
this.form.discount_amount_upper_limit = useCondition.discount_amount_upper_limit || 0;
this.form.products_exchange_number = useCondition.products_exchange_number || 0;
if (this.goods.ok || this.goods.no) {
......@@ -272,6 +294,13 @@ export default {
this.form.proNoList = useCondition.proNo ? [{ name: useCondition.proNo, id: useCondition.proNo }] : [];
}
// 微盟券号 -- 复制不赋值
if (card.cardApplyChannel.indexOf('WMmicroMall') !== -1 && card.weimobDemoCode && this.isAdd && this.isInfo) {
this.weimobDemoCodeList = JSON.parse(card.weimobDemoCode).map(v => {
return { pid: v.pid, card: v.card, loading: false, cardList: [{ cardTemplateId: v.card, name: v.name }], save: true, name: v.name };
});
}
// 微盟适用商品
// isCopy则第二三层不能编辑除非第一层变动;
if ((card.cardType === 0 || card.cardType === 1) && this.form.cardApplyChannel.indexOf('WMmicroMall') !== -1 && card.coupGoodsWeimobList && card.coupGoodsWeimobList.length) {
......@@ -309,7 +338,6 @@ export default {
v3name: f3Arr || []
};
});
console.log(this.goodsList);
if (this.goodsList.length) {
this.goods.flag = true;
}
......@@ -506,8 +534,7 @@ export default {
no: this.goods.no
},
only: Number(this.only),
discount_amount_upper_limit: this.form.discount_amount_upper_limit,
goods_discounts_number_upper_limit: this.form.goods_discounts_number_upper_limit
discount_amount_upper_limit: this.form.discount_amount_upper_limit
};
if (this.only) {
card.useCondition.only = Number(this.only);
......@@ -532,6 +559,26 @@ export default {
}
}
// 商品上下线控制不受渠道卡券类型影响
card.useCondition.goods_discounts_number_upper_limit = this.form.goods_discounts_number_upper_limit;
card.useCondition.goods_discounts_number_lower_limit = this.form.goods_discounts_number_lower_limit;
if (card.useCondition.goods_discounts_number_upper_limit && card.useCondition.goods_discounts_number_lower_limit && card.useCondition.goods_discounts_number_lower_limit > card.useCondition.goods_discounts_number_upper_limit) {
// 最低件数不可以大于最高件数
this.$tips({ message: '最低适用商品件数不可以最低适用商品件数', type: 'warning' });
return;
}
// 微盟券号
if (this.form.cardApplyChannel.indexOf('WMmicroMall') !== -1) {
/* eslint-disable */
card.weimobDemoCode = this.weimobDemoCodeList
.filter(v => v.save)
.map(({ pid, card, name }) => { return { pid, card, name }; })
|| [];
/* eslint-disable */
}
// 微盟适用商品
if ((this.form.cardType === 0 || this.form.cardType === 1) && this.form.cardApplyChannel.indexOf('WMmicroMall') !== -1 && this.coupGoodsWeimobList.length !== 0) {
card.coupGoodsWeimobList = this.coupGoodsWeimobList;
......@@ -637,6 +684,7 @@ export default {
}
}
// 门店展架
params.shelfIds = JSON.stringify(this.form.shelfIds);
params.card = JSON.stringify(card);
......@@ -693,6 +741,62 @@ export default {
checkInputString(val, name) {
this.form[name] = val.replace(/[^a-zA-Z0-9]*/g, '') + '';
},
// ------微盟店铺开始-------
saveWmShop(saveItem, idx) {
if (!saveItem.pid || !saveItem.card) {
this.$message({ message: '该条券号保存不完整', type: '' });
return;
}
this.weimobDemoCodeList[idx].save = true;
this.weimobDemoCodeList[idx].name = saveItem.cardList.find(v => {
return v.cardTemplateId == saveItem.card;
}).name; // 保存name
this.wmShopAddDisabled = false;
this.wmShopIds.push(saveItem.pid); // 保存过得店铺新增的下拉不让选
},
delWmShop(saveItem, idx) {
const id_idx = this.wmShopIds.findIndex(v => {
return v == saveItem.pid;
});
this.wmShopIds.splice(id_idx, 1);
this.weimobDemoCodeList.splice(idx, 1);
if (this.weimobDemoCodeList.length === 0) {
this.addWmShop();
}
},
addWmShop() {
this.weimobDemoCodeList.push({ pid: '', card: '', loading: false, cardList: [], save: false, cardName: '' });
this.wmShopAddDisabled = true;
},
// 获取微盟店铺列表
getListEntepriseWeimobShop() {
listEntepriseWeimobShop().then(res => {
this.weimobDemoCodeList = [{ pid: '', card: '', loading: false, cardList: [], save: false, cardName: '' }];
this.countFlag = res.result.countFlag || 1;
this.weimobShopList = res.result.dataList || [];
});
},
// 第一层店铺change 根据微盟店铺id查询所有店铺卡券 wmPid=xxx
handleShopChange(wmPid, idx) {
if (wmPid) {
this.weimobDemoCodeList[idx].loading = true;
listEntepriseWeimobCoupon({ wmPid })
.then(res => {
this.weimobDemoCodeList[idx].cardList = res.result || [];
this.weimobDemoCodeList[idx].loading = false;
if (this.weimobDemoCodeList[idx].cardList.length === 0) {
this.$message({ message: '该店铺没有对应微盟券号', type: 'warning' });
}
})
.catch(() => {
this.weimobDemoCodeList[idx].loading = false;
});
} else {
this.weimobDemoCodeList[idx].cardList = [];
this.weimobDemoCodeList[idx].card = '';
}
},
// ---------微盟店铺结束--------
// ------微盟适用商品开始-------
// 获取第一层数据
getCategoryList() {
......@@ -889,6 +993,7 @@ export default {
this.cardGetShelfs();
this.getCardDetail();
this.getCategoryList(); // 获取适用商品第一层数据
this.getListEntepriseWeimobShop(); // 获取微盟店铺数据
if (this.isAdd) {
this.$refs.storeCard.init();
}
......
<template>
<div>
<el-form class="dm-wrap" :model="form" ref="form" :rules="rules" label-width="120px">
<el-form class="dm-wrap" :model="form" ref="form" :rules="rules" label-width="130px">
<el-form-item label="卡券类型">
<el-radio-group v-model="form.cardType" :disabled="isEdit || isInfo" @change="reset">
<el-radio :label="0">抵金券</el-radio>
......@@ -29,6 +29,26 @@
<el-input v-model="form.erpDemoCode" class="w400" placeholder="请输入demo券号" :disabled="isEdit || isInfo" @blur="checkErpDemoCode"></el-input>
</el-form-item>
<!-- 微盟微商城 微盟券号 -->
<el-form-item label="微盟券号" v-if="form.cardApplyChannel.indexOf('WMmicroMall') !== -1 && countFlag">
<div class="mb10" v-for="(saveItem, idx) in weimobDemoCodeList" :key="idx">
<el-select class="w200" :disabled="saveItem.save || isEdit || isInfo" v-model="saveItem.pid" filterable placeholder="请选择店铺" clearable @change="handleShopChange($event, idx)">
<el-option :disabled="wmShopIds.includes(item.wmPid)" v-for="item in weimobShopList" :key="item.wmPid" :label="item.wmPidName" :value="item.wmPid"></el-option>
</el-select>
<el-select :disabled="!saveItem.pid || saveItem.save || isEdit || isInfo" :loading="saveItem.loading" class="w200" v-model="saveItem.card" filterable placeholder="请选择微盟券号" clearable>
<el-option v-for="item in saveItem.cardList" :key="item.cardTemplateId" :label="item.name" :value="item.cardTemplateId"></el-option>
</el-select>
<template v-if="isAdd || isCopy">
<el-button type="text" v-if="!saveItem.save" class="ml10" @click="saveWmShop(saveItem, idx)">保存</el-button>
<el-button type="text" v-if="saveItem.save" class="ml10" @click="delWmShop(saveItem, idx)">删除</el-button>
</template>
</div>
<template v-if="isAdd || isCopy">
<el-button v-if="countFlag == 2 || isAdd || isCopy" :disabled="wmShopAddDisabled || weimobDemoCodeList.length >= weimobShopList.length" type="primary" @click="addWmShop">添加店铺</el-button>
<span class="fz12 gray ml10">* 店铺不可重复选择,新建卡券仅保存点击保存过的数据</span>
</template>
</el-form-item>
<el-form-item prop="cardColor" label="卡券颜色" style="height: 40px;">
<el-color-picker v-model="form.cardColor" :disabled="isInfo"></el-color-picker> <span class="vertical-top">{{ form.cardColor }}</span>
</el-form-item>
......@@ -41,7 +61,8 @@
<el-form-item label="优惠金额封顶" v-if="form.cardType === 1"> <el-input-number controls-position="right" :disabled="isEdit || isInfo || discountAmountCheck" v-model="form.discount_amount_upper_limit" class="200" :precision="2" :step="1" :min="0"></el-input-number>&nbsp;<el-checkbox v-model="discountAmountCheck" :disabled="isEdit || isInfo">不封顶</el-checkbox><span class="pl10 fz12 gray vertical-baseline">*该条件目前仅线上可用</span> </el-form-item>
<el-form-item label="最大商品优惠数" v-if="form.cardType === 1"> <el-input-number controls-position="right" :disabled="isEdit || isInfo || goodsDiscountCheck" v-model="form.goods_discounts_number_upper_limit" class="200" :precision="0" :step="1" :min="0"></el-input-number>&nbsp;<el-checkbox v-model="goodsDiscountCheck" :disabled="isEdit || isInfo">无上限</el-checkbox><span class="pl10 fz12 gray vertical-baseline">*该条件目前仅线上可用</span> </el-form-item>
<el-form-item label="最低适用商品件数"> <el-input-number controls-position="right" :disabled="isEdit || isInfo || goodsDiscountCheckLower" v-model="form.goods_discounts_number_lower_limit" class="200" :precision="0" :step="1" :min="0"></el-input-number>&nbsp;<el-checkbox v-model="goodsDiscountCheckLower" :disabled="isEdit || isInfo">不限</el-checkbox></el-form-item>
<el-form-item label="最高适用商品件数"> <el-input-number controls-position="right" :disabled="isEdit || isInfo || goodsDiscountCheck" v-model="form.goods_discounts_number_upper_limit" class="200" :precision="0" :step="1" :min="0"></el-input-number>&nbsp;<el-checkbox v-model="goodsDiscountCheck" :disabled="isEdit || isInfo">不限</el-checkbox></el-form-item>
<!-- 兑换券无 -->
<el-form-item prop="" label="使用条件">
......
<template>
<el-dialog title="卡券销毁" :visible.sync="show" width="600px" :before-close="close">
<el-alert title="卡券销毁将不可撤回,请注意确认操作。" type="warning" class="pb10" :closable="false" />
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="pt20">
<el-form-item label="选择卡券" prop="cardId">
<el-button v-show="!ruleForm.cardId" @click="showCardDialog = true">选择卡券</el-button>
<div v-show="ruleForm.cardId">
{{ ruleForm.cardName }}
<el-button type="text" @click="cleanCard" class="ml10">删除</el-button>
</div>
</el-form-item>
<el-form-item label="销毁方式" prop="type">
<el-radio-group v-model="ruleForm.type">
<el-radio :label="0">全部销毁</el-radio>
<el-radio :label="1">部分销毁</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="导入券码文件" prop="fileId">
<div>
<el-button icon="el-icon-upload2" class="dash-btn">点击上传</el-button>
<el-button type="text" class="ml10">点击下载文件模板</el-button>
</div>
<p style="margin-top:8px;color:#909399;font-size:12px;line-height:1;">券码数量单次最多不超过5000条</p>
</el-form-item>
</el-form>
<div v-loading="loading">
<div class="dm-title__label--tips" style="padding-bottom: 10px;"><i class="el-icon-warning pr8 warning-color"></i>卡券销毁将不可撤回,请注意确认操作。</div>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="pt20">
<el-form-item label="选择卡券" prop="cardId">
<el-button v-show="!ruleForm.cardId" @click="showCardDialog = true">选择卡券</el-button>
<div v-show="ruleForm.cardId">
{{ ruleForm.cardName }}
<el-button v-if="type === 'add'" type="text" @click="cleanCard" class="ml10">删除</el-button>
</div>
</el-form-item>
<el-form-item label="销毁方式" prop="destoryMode">
<el-radio-group :disabled="type !== 'add'" v-model="ruleForm.destoryMode">
<el-radio :label="0">全部销毁</el-radio>
<el-radio :label="1">部分销毁</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="type === 'add'" label="导入券码文件" prop="fileId">
<div>
<!-- eslint-disable-nextline -->
<div v-if="ruleForm.fileId" class="inline-block">已导入</div>
<file v-if="!ruleForm.fileId" :noUse="!ruleForm.destoryMode" needExtraParams :paramsObj="{ destoryPlanId: ruleForm.destoryPlanId }" ref="fileUpload" class="dash-btn inline-block" label="点击上传" @backImg="backImg" acceptType=".csv" tips="" :url="uploadUrl" width="50" iconClass="el-icon-upload2" /><!-- 上传 -->
<el-button type="text" class="ml10" @click="download">点击下载文件模板</el-button>
</div>
<p style="margin-top:8px;color:#909399;font-size:12px;line-height:1;">券码数量单次最多不超过5000条</p>
<p style="margin-top:8px;color:#909399;font-size:12px;line-height:1;">填写示例:‘123456(英文单引号'+券码编号文本形式)</p>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="close">取 消</el-button>
<el-button type="primary" @click="submit">确认销毁</el-button>
<el-button @click="close">关闭</el-button>
<el-button v-if="type === 'add'" type="primary" @click="submit">确认销毁</el-button>
</span>
<vue-gic-card :showCardDialog="showCardDialog" appendToBody @selectCard="selectCard" :cardLimit="3" :cardType="null"></vue-gic-card>
<vue-gic-card appendToBody :showCardDialog="showCardDialog" @selectCard="selectCard" :cardLimit="-1" :cardType="null"></vue-gic-card>
</el-dialog>
</template>
<script>
import file from '@/components/upload/file';
import { getCoupDestoryDetail, importDestoryCoupCode, saveCoupDestoryPlan, downloadDestroyCodeTemplate } from '@/service/api/cardApi.js';
export default {
name: 'destory-dialog',
props: {
show: {
type: Boolean,
default: false
},
type: {
type: String,
default: 'add' // add edit
},
destoryItem: {
type: Object,
default: () => {}
}
},
data() {
// 部分销毁必传
const checkFileId = (rule, value, callback) => {
if (this.ruleForm.destoryMode && !value) {
return callback(new Error(rule.message));
}
callback();
};
return {
loading: false,
uploadUrl: importDestoryCoupCode,
showCardDialog: false,
ruleForm: {
destoryPlanId: '',
cardId: '',
cardName: '',
type: 0,
destoryMode: 0,
fileId: ''
},
rules: {
cardId: [{ required: true, message: '请选择卡券', trigger: 'change' }],
type: [{ required: true, message: '请选择销毁方式', trigger: 'change' }],
fileId: [{ required: true, message: '请上传文件', trigger: 'change' }]
destoryMode: [{ required: true, message: '请选择销毁方式', trigger: 'change' }],
fileId: [{ validator: checkFileId, message: '请上传文件', trigger: 'change' }]
}
};
},
watch: {
show(val) {
if (val) {
if (this.type === 'add') {
this.loading = true;
getCoupDestoryDetail({})
.then(res => {
this.loading = false;
this.ruleForm.destoryPlanId = res.result;
})
.catch(() => {
this.loading = false;
});
} else {
this.ruleForm = { ...this.destoryItem };
}
}
}
},
components: {
file
},
methods: {
download() {
window.location = downloadDestroyCodeTemplate;
},
close() {
this.$refs.ruleForm.resetFields();
this.$emit('update:show', false);
......@@ -67,6 +117,19 @@ export default {
if (!valid) {
return;
}
this.loading = true;
let params = { ...this.ruleForm };
delete params.fileId;
saveCoupDestoryPlan(params)
.then(res => {
this.loading = false;
this.$message({ message: `${this.type === 'add' ? '新增' : '保存'}成功`, type: 'success' });
this.close();
this.$emit('refresh');
})
.catch(() => {
this.loading = false;
});
});
},
cleanCard() {
......@@ -82,16 +145,34 @@ export default {
this.$refs.ruleForm.validateField('cardId');
}
this.showCardDialog = false;
},
// ****上传图片***
upload() {
this.$refs.fileUpload.$el.querySelector('input').click();
},
backImg(res) {
this.ruleForm.fileId = new Date().getTime(); // 代表以及上传过文件
}
}
};
</script>
<style lang="scss" scoped>
.dash-btn {
/deep/ .dash-btn .el-button {
width: 174px;
border-style: dashed;
background: rgba(255, 255, 255, 1);
border-radius: 4px;
&:not(.is-disabled) {
background: white;
color: #606266;
border-color: #c0c4cc;
}
&.is-disabled {
color: #c0c4cc;
}
}
.dm-title__label--tips {
background: #fffbe6;
border-color: #ffe58f;
}
</style>
......@@ -75,7 +75,7 @@
</el-table-column>
<el-table-column width="100" align="left" prop="receiveName" label="核销来源">
<template slot-scope="scope">
{{ scope.row.status === 5 ? (scope.row.checkSource === 0 ? '订单核销' : '手动核销') : '--' }}
{{ filterChannel(scope.row) }}
</template>
</el-table-column>
<el-table-column min-width="100" align="left" prop="creatorName" label="创建人" v-if="$store.state.marketing.openFlag"></el-table-column>
......@@ -152,6 +152,46 @@ export default {
this.$store.commit('mutations_layoutTips', '');
},
methods: {
// 过滤渠道
// {{ scope.row.status === 5 ? (scope.row.checkSource === 0 ? '订单核销' : '手动核销') : '--' }}
filterChannel({ status, checkSource, channelType }) {
let str = '--';
if (status === 5) {
if (checkSource === 1) {
str = '手动核销';
} else {
// 手动核销
// 0: -- 1:线下订单 2:GIC微商城订单 3:微盟微商城订单 5:淘宝订单; 6:京东订单; 7:唯品会订单; 8:天猫订单;
switch (channelType) {
case 1:
str = '线下订单核销';
break;
case 2:
str = 'GIC微商城订单';
break;
case 3:
str = '微盟订单核销';
break;
case 5:
str = '淘宝订单';
break;
case 6:
str = '京东订单';
break;
case 7:
str = '唯品会订单';
break;
case 8:
str = '天猫订单';
break;
default:
str = '';
break;
}
}
}
return str;
},
// 列表方法
sortList(val) {
this.listParams.sortBy = val.order === 'descending' ? val.prop + ' desc' : val.prop;
......
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