Commit 04190ead by zhangmeng

feat:迭代3上线

parent c561c247
No preview for this file type
<!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/app.bdcb848080e2964316129cb49114d17c.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/marketing/static/js/manifest.0a85049e489e85ac5f0a.js></script><script type=text/javascript src=/marketing/static/js/vendor.b52e32600f8f7c7becf9.js></script><script type=text/javascript src=/marketing/static/js/app.266119c8e1f95146f9ce.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/css/iconfont.css><link rel=stylesheet type=text/css href=static/css/common.css><link href=/marketing/static/css/app.b9377c6fd241453c784f5df393c81bdc.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/marketing/static/js/manifest.0a85049e489e85ac5f0a.js></script><script type=text/javascript src=/marketing/static/js/vendor.d058dfa6ef5c5be87db9.js></script><script type=text/javascript src=/marketing/static/js/app.34abcdb65b4e558bb76e.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.
<template>
 <div>
  <span
    :sendSync="sendSync"
    :autoStart="autoStart"
    :defaultVal="defaultVal"
  >{{countString}}</span>
 </div>
<div>
  <span :sendSync="sendSync" :autoStart="autoStart" :defaultVal="defaultVal">{{countString}}</span>
</div>
</template>
<script>
......@@ -22,25 +18,24 @@ export default {
second: 0,
millisecond: 0,
countVal: this.defaultVal, //获取初始值
pauseTime: 0
pauseTime: 0,
nowDate:Date.now()
};
},
watch: {
countString: {
deep: true,
handler: function(val, oldVal) {
var vm = this;
if (vm.needSendSunc) {
vm.passToParent(val);
handler(val, oldVal) {
if (this.needSendSunc) {
this.passToParent(val);
}
}
},
needSendSunc: {
deep: true,
handler: function(val) {
var vm = this;
handler(val) {
if (val) {
vm.passToParent(vm.countString);
this.passToParent(this.countString);
}
}
}
......@@ -60,13 +55,12 @@ export default {
}
},
mounted() {
var vm = this;
if (vm.autoStart) {
vm.startCountFn();
if (this.autoStart) {
this.startCountFn();
}
},
computed: {
needSendSunc: function() {
needSendSunc() {
return this.sendSync;
}
},
......@@ -79,72 +73,63 @@ export default {
});
},
methods: {
counterFn: function(counterTime) {
var vm = this;
counterFn(counterTime) {
var nowDate = new Date().getTime();
if (vm.pauseTime <= 0) {
if (this.pauseTime <= 0) {
var num = counterTime - nowDate; //计算时间毫秒差
} else {
vm.pauseTime = vm.pauseTime + 10;
var num = counterTime - vm.pauseTime; //计算时间毫秒差
this.pauseTime = this.pauseTime + 10;
var num = counterTime - this.pauseTime; //计算时间毫秒差
}
// console.log(num)
if(num <= 0) {
this.stopCountFn();
this.$nextTick(_ => {
this.countString = '';
})
}
// console.log(num)
var leave1 = num % (24 * 3600 * 1000); //计算天数后剩余的毫秒数
var leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数
var leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数
vm.day = Math.floor(num / (24 * 3600 * 1000)); //计算相差天数
vm.hour = Math.floor(leave1 / (3600 * 1000)); //计算相差小时
vm.minute = Math.floor(leave2 / (60 * 1000)); //计算相差分钟
vm.second = Math.round(leave3 / 1000); //计算相差秒
if (vm.day > 0) {
vm.countString = `${vm.day}${vm.hour}小时 ${vm.minute}${
vm.second
this.day = Math.floor(num / (24 * 3600 * 1000)); //计算相差天数
this.hour = Math.floor(leave1 / (3600 * 1000)); //计算相差小时
this.minute = Math.floor(leave2 / (60 * 1000)); //计算相差分钟
this.second = Math.round(leave3 / 1000); //计算相差秒
if (this.day > 0) {
this.countString = `${this.day}${this.hour}小时 ${this.minute}${
this.second
}秒`;
} else if (vm.hour > 0) {
vm.countString = `${vm.hour}小时 ${vm.minute}${vm.second}秒`;
} else if (vm.minute > 0) {
vm.countString = `${vm.minute}${vm.second}秒`;
} else if (this.hour > 0) {
this.countString = `${this.hour}小时 ${this.minute}${this.second}秒`;
} else if (this.minute > 0) {
this.countString = `${this.minute}${this.second}秒`;
} else {
vm.countString = `${vm.second}秒`;
this.countString = `${this.second}秒`;
}
},
startCountFn: function() {
var vm = this;
if (!vm.isStart) {
vm.countVal = vm.countVal ? vm.countVal : new Date().getTime();
var timer = setInterval(function() {
vm.counterFn(vm.countVal);
startCountFn() {
if (!this.isStart) {
this.countVal = this.countVal ? this.countVal : new Date().getTime();
var timer = setInterval(_ => {
this.counterFn(this.countVal);
}, 1000);
vm.globalTimer = timer;
vm.isStart = true;
this.globalTimer = timer;
this.isStart = true;
}
},
stopCountFn: function() {
var vm = this;
if (vm.isStart) {
window.clearInterval(vm.globalTimer);
vm.globalTimer = null;
vm.isStart = false;
vm.pauseTime = new Date().getTime();
stopCountFn() {
if (this.isStart) {
window.clearInterval(this.globalTimer);
this.globalTimer = null;
this.isStart = false;
this.pauseTime = new Date().getTime();
}
},
passToParent: function(data) {
var vm = this;
passToParent(data) {
this.$emit("getDataFromChild", data);
}
},
destroyed() {
beforeDestroy() {
this.stopCountFn();
}
},
};
</script>
......@@ -93,11 +93,11 @@ import config from '@/config';
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJPG) {
this.$message.error('上传格式错误!');
this.$message.warning('只能上传JPG格式文件!');
return;
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!');
this.$message.warning('上传头像图片大小不能超过 2MB!');
return;
}
let formData = new FormData();
......
......@@ -2,23 +2,23 @@
import game from '../../views/game'
import dzp from '../../views/game/dzp/index.vue'
import dzpAddEdit from '../../views/game/dzp/addEdit.vue'
import dzpForm from '../../views/game/dzp/form.vue'
import dzpRecord from '../../views/game/dzp/record.vue'
import ggk from '../../views/game/ggk/index.vue'
import ggkAddEdit from '../../views/game/ggk/addEdit.vue'
import ggkForm from '../../views/game/ggk/form.vue'
import ggkRecord from '../../views/game/ggk/record.vue'
import ptyx from '../../views/game/ptyx/index.vue'
import ptyxAddEdit from '../../views/game/ptyx/addEdit.vue'
import ptyxForm from '../../views/game/ptyx/form.vue'
import ptyxRecord from '../../views/game/ptyx/record.vue'
import znm from '../../views/game/znm/index.vue'
import znmAddEdit from '../../views/game/znm/addEdit.vue'
import znmForm from '../../views/game/znm/form.vue'
import znmRecord from '../../views/game/znm/record.vue'
import klfl from '../../views/game/klfl/index.vue'
import klflAddEdit from '../../views/game/klfl/addEdit.vue'
import klflForm from '../../views/game/klfl/form.vue'
import klflRecord from '../../views/game/klfl/record.vue'
export default {
......@@ -38,7 +38,7 @@ export default {
{
path: 'dzp/add',
name: '大转盘新增',
component: dzpAddEdit,
component: dzpForm,
meta: {
type: 'add',
path:'/game/dzp'
......@@ -47,7 +47,7 @@ export default {
{
path: 'dzp/edit/:id',
name: '大转盘编辑',
component: dzpAddEdit,
component: dzpForm,
meta: {
type: 'edit',
path:'/game/dzp'
......@@ -56,7 +56,7 @@ export default {
{
path: 'dzp/detail/:id',
name: '大转盘查看',
component: dzpAddEdit,
component: dzpForm,
meta: {
type: 'detail',
path:'/game/dzp'
......@@ -81,7 +81,7 @@ export default {
{
path: 'ggk/add',
name: '刮刮卡新增',
component: ggkAddEdit,
component: ggkForm,
meta: {
type: 'add',
path:'/game/ggk'
......@@ -90,7 +90,7 @@ export default {
{
path: 'ggk/edit/:id',
name: '刮刮卡编辑',
component: ggkAddEdit,
component: ggkForm,
meta: {
type: 'edit',
path:'/game/ggk'
......@@ -99,7 +99,7 @@ export default {
{
path: 'ggk/detail/:id',
name: '刮刮卡详情',
component: ggkAddEdit,
component: ggkForm,
meta: {
type: 'detail',
path:'/game/ggk'
......@@ -124,7 +124,7 @@ export default {
{
path: 'ptyx/add',
name: '拼图游戏新增',
component: ptyxAddEdit,
component: ptyxForm,
meta: {
type: 'add',
path:'/game/ptyx'
......@@ -133,7 +133,7 @@ export default {
{
path: 'ptyx/edit/:id',
name: '拼图游戏编辑',
component: ptyxAddEdit,
component: ptyxForm,
meta: {
type: 'edit',
path:'/game/ptyx'
......@@ -142,7 +142,7 @@ export default {
{
path: 'ptyx/query/:id',
name: '拼图游戏详情',
component: ptyxAddEdit,
component: ptyxForm,
meta: {
type: 'query',
path:'/game/ptyx'
......@@ -167,7 +167,7 @@ export default {
{
path: 'znm/add',
name: '找你马新增',
component: znmAddEdit,
component: znmForm,
meta: {
type: 'add',
path:'/game/znm'
......@@ -176,7 +176,7 @@ export default {
{
path: 'znm/edit/:id',
name: '找你马编辑',
component: znmAddEdit,
component: znmForm,
meta: {
type: 'edit',
path:'/game/znm'
......@@ -201,7 +201,7 @@ export default {
{
path: 'klfl/add',
name: '口令福利新增',
component: klflAddEdit,
component: klflForm,
meta: {
type: 'add',
path:'/game/klfl'
......@@ -210,7 +210,7 @@ export default {
{
path: 'klfl/edit/:id',
name: '口令福利编辑',
component: klflAddEdit,
component: klflForm,
meta: {
type: 'edit',
path:'/game/klfl'
......
// mall 积分商城
import mall from '../../views/mall/index';
import couponList from '../../views/mall/coupon/list';
import couponExchange from '../../views/mall/coupon/exchange';
import couponInfo from '../../views/mall/coupon/info.vue';
import giftList from '../../views/mall/gift/list';
import giftExchange from '../../views/mall/gift/exchange';
import giftInfo from '../../views/mall/gift/info.vue';
import goodsList from '../../views/mall/goods/list';
export default {
path: 'mall',
name: '积分商城',
component: mall,
redirect: 'mall/coupon',
meta: {},
children: [
{
path: 'coupon',
name: '优惠券',
component: couponList,
meta: {
menu:'coupon'
}
},
{
path: 'coupon/exchange/:id',
name: '优惠券兑换记录',
component: couponExchange,
meta: {
menu:'coupon'
}
},
{
path: 'coupon/info',
name: '新增优惠券',
component: couponInfo,
meta: {
type:'add',
menu:'coupon'
}
},
{
path: 'coupon/info/:id',
name: '编辑优惠券',
component: couponInfo,
meta: {
type:'edit',
menu:'coupon'
}
},
{
path: 'coupon/queryinfo/:id',
name: '优惠券详情',
component: couponInfo,
meta: {
type:'info',
menu:'coupon'
}
},
{
path: 'gift',
name: '礼品',
component: giftList,
meta: {
menu:'gift'
}
},
{
path: 'gift/exchange/:id',
name: '礼品兑换记录',
component: giftExchange,
meta: {
menu:'gift'
}
},
{
path: 'gift/wxexchange/:id',
name: '微信兑换券兑换记录',
component: giftExchange,
meta: {
menu:'gift',
type:'wx'
}
},
{
path: 'gift/info',
name: '新增礼品',
component: giftInfo,
meta: {
type:'add',
menu:'gift'
}
},
{
path: 'gift/info/:id',
name: '编辑礼品',
component: giftInfo,
meta: {
type:'edit',
menu:'gift'
}
},
{
path: 'gift/queryinfo/:id',
name: '礼品详情',
component: giftInfo,
meta: {
type:'info',
menu:'gift'
}
},
{
path: 'goods',
name: '待发货',
component: goodsList,
meta: {
menu:'goods'
}
},
]
};
......@@ -4,7 +4,7 @@ import page403 from '@/views/error/403'
import page404 from '@/views/error/404'
import page500 from '@/views/error/500'
import test from './modules/test'
// import test from './modules/test'
//微信营销
import wechat from './modules/wechat'
......@@ -26,8 +26,6 @@ import calllog from './modules/calllog'
import evaluation from './modules/evaluation'
//计费中心
import recharge from './modules/recharge'
//积分商城
import mall from './modules/mall'
export default [
......@@ -38,7 +36,6 @@ export default [
redirect: '/wechat/record',
children: [
card,
mall,
ecm,
game,
message,
......@@ -69,5 +66,5 @@ export default [
name: '未知领域',
component: page404
},
test
// test
]
import { requests } from './index';
import config from '@/config';
const PREFIX = 'api-integral-mall/';
// 首页优惠券
export const getPageCardsList = (params) => requests(PREFIX + 'page-cards', params);
//更新库存
export const updateStockService = (params) => requests(PREFIX + 'update-stock', params);
//更新兑换所需积分
export const updateIntegralCostService = (params) => requests(PREFIX + 'update-integral-cost', params);
//更新兑换所需现金
export const updateCashCostService = (params) => requests(PREFIX + 'update-cash-cost', params);
//删除商品
export const deleteProService = (params) => requests(PREFIX + 'delete-pro', params);
//查看兑换记录
export const getPageExchangeLogsList = (params) => requests(PREFIX + 'page-exchange-logs', params);
//查询单个商品
export const getIntegralMallProInfo = (params) => requests(PREFIX + 'get-integral-mall-pro', params);
//基础数据-会员等级
export const getGradeList = (params) => requests(PREFIX + 'load-grade', params);
//创建修改积分商品
export const createIntegralProService = (params) => requests(PREFIX + 'create-integral-pro', params, true);
// 首页礼品列表
export const getPageGiftList = (params) => requests(PREFIX + 'page-gift', params);
// 基础数据-分类列表
export const getCategoryList = (params) => requests(PREFIX + 'load-category', params);
// 导出优惠券兑换记录
export const exportExchangeListExcel = config.api + PREFIX + 'download-exchange-list-execl';
// 导出代发货商品
export const exportOnlineListExcel = config.api + PREFIX + 'download-integral-online-excel';
// 查看物流
export const getLogisticsInfo = (params) => requests(PREFIX + 'list-logistics-traces', params);
// 基础数据-物流列表
export const getLogisticsList = (params) => requests(PREFIX + 'load-logisties', params);
// 订单发货,取消,修改物流
export const orderOptService = (params) => requests(PREFIX + 'order-opt', params);
// 首页待发货
export const getPageUndeliverList = (params) => requests(PREFIX + 'page-undeliver', params);
// 首页代发货数量
export const getNotSendCount = (params) => requests(PREFIX + 'get-not-send-count', params);
// 礼品设置热门商品
export const setHotStatusService = (params) => requests(PREFIX + 'update-hot-status', params);
// 新建礼品分类
export const createCategoryService = (params) => requests(PREFIX + 'create-gift-category', params);
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
<template>
<section class="dm-store">
<el-select v-model="storeType" placeholder="请选择" class="w200 inline-block mr5">
<el-option v-for="(v,i) in leftList" :key="i" :label="v.label" :value="v.value"></el-option>
</el-select>
<option-type v-if="storeType === 1" :uuid="newUuid" :cacheUuid="cacheUuid" :isAdd="isAdd" :isCache.sync="isSendCache"></option-type>
<option-tags v-if="storeType === 2" :uuid="newUuid" :cacheUuid="cacheUuid" :isAdd="isAdd" :isCache.sync="isSendCache"></option-tags>
<option-area v-if="storeType === 3" :uuid="newUuid" :cacheUuid="cacheUuid" :isAdd="isAdd" :isCache.sync="isSendCache"></option-area>
<option-group v-if="storeType === 4" :uuid="newUuid" :cacheUuid="cacheUuid" :isAdd="isAdd" :isCache.sync="isSendCache"></option-group>
<option-part v-if="storeType === 5" :uuid="newUuid" :cacheUuid="cacheUuid" :isAdd="isAdd" :isCache.sync="isSendCache"></option-part>
</section>
</template>
<script>
import qs from 'qs';
import uuidv1 from 'uuid/v1';
import { baseUrl } from './config';
import optionType from './optionsGroup/option-type';
import optionArea from './optionsGroup/option-area';
import optionTags from './optionsGroup/option-tags';
import optionGroup from './optionsGroup/option-group';
import optionPart from './optionsGroup/option-part';
const leftList = [{label:'所有门店',value:0},
{label:'门店类型',value:1},
{label:'门店标签',value:2},
{label:'门店区域',value:3},
{label:'门店分组',value:4},
{label:'部分门店',value:5}
];
const typeList = [{label:'自营',value:'0'},
{label:'联营',value:'1'},
{label:'代理',value:'2'},
{label:'代销',value:'3'},
{label:'托管',value:'4'}];
export default {
name:'vue-gic-store-group',
props:{
uuid:{
type:String,
default:''
},
options: {
type:Array,
default() {
return [0,1,2,3,4,5]
}
},
isAdd:{
type:Boolean,
default:true
}
},
components:{
'option-type':optionType,
'option-area':optionArea,
'option-tags':optionTags,
'option-group':optionGroup,
'option-part':optionPart
},
watch:{
storeType(val) {
if (!val) {
this.$emit('update:uuid',this.cacheUuid);
this.saveInit(this.isSendCache);
}
},
uuid(val) {
// 编辑或者详情
if (val && !this.isAdd) {
if (this.isSendCache) return;
console.log('走到这了');
this.init();
}
},
isSendCache(val) {
console.log(val)
if (val) {
this.$emit('update:uuid',this.cacheUuid);
this.$nextTick(_=> {
console.log(this.uuid)
})
}
}
},
data() {
return {
storeType:0, // 一级选择值
leftList:[],
// 创建一个新的uuid
newUuid:uuidv1().replace(/-/g,''),
// 编辑情况下的备份id
cacheUuid:uuidv1().replace(/-/g,''), // 生成uuid
// 编辑的情况下是否发送备份ID
isSendCache:false,
}
},
created() {
console.log(this.isAdd)
if (this.options instanceof Array) {
leftList.map( v => {
if (this.options.indexOf(v.value) >= 0) {
this.leftList.push(v);
}
})
}
this.init();
},
methods:{
// 获取配置项
init() {
this.storeType = 0;
/*如果没有uuid的情况下
1 设置一个新的uuid
2 并传给父级
3 保存
*/
if (this.isAdd) {
this.$emit('update:uuid',this.newUuid);
// 这是保存新的id
this.saveInit();
}
/*如果有uuid的情况下
1 创建一个新的uuid备用 newUUid
2 保存 一下这个新的uuid
3 用父级传来的uuid获取配置项
*/
else {
this.newUuid = this.uuid;
// 这里保存备份id
this.saveInit(true);
if (this.newUuid) {
this.getStoreConfig();
}
}
},
//获取配置
getStoreConfig() {
return new Promise((resolve,reject) => {
let params = {
key:this.isAdd?this.newUuid:(this.isSendCache?this.cacheUuid:this.uuid),
currentPage:1,
pageSize:20
}
this.axios.post(baseUrl + '/api-plug/get-store-widget-config?requestProject=gic-web',qs.stringify(params)).then(res => {
if (res.data.errorCode === 0) {
this.storeType = res.data.result.selectType || 0;
let list = res.data.result.config.result || [];
let computedList = [];
let name = '';
if (this.storeType === 1) {
list.map(v => {
typeList.map(w => {
if (v.id == w.value) {
computedList.push({id:v.id,name:w.label})
}
})
})
}
leftList.map(v => {
if (this.storeType === v.value) {
name = v.label;
}
})
resolve({list:this.storeType === 1?computedList:list,type:res.data.result.selectType || 0,name:name});
} else {
reject('接口错误');
}
}).catch(err => {
reject(err);
console.log(err)
})
})
},
// 保存
saveInit(isCacheUuid = false) {
let params = {
selectType:0,
key:isCacheUuid?this.cacheUuid:this.newUuid,
isAll:0,
value:'',
removeItems:'',
};
this.axios.post(baseUrl + '/api-plug/save-store-widget?requestProject=gic-web',qs.stringify(params)).then(res => {
}).catch(err => {
console.log(err)
})
},
// 判断门店是否保存
isStoreSave() {
return new Promise((resolve,reject) => {
let params = {
key:this.isAdd?this.newUuid:(this.isSendCache?this.cacheUuid:this.uuid),
selectType:this.storeType
}
if (params.selectType === 0) {
resolve(true);
}
this.axios.post(baseUrl + '/api-plug/is-empty?requestProject=gic-web',qs.stringify(params)).then(res => {
console.log(res);
if (res.data.errorCode === 0) {
resolve(res.data.result);
} else {
reject(new Error('系统错误'));
}
}).catch(err => {
reject(new Error('系统错误'));
})
})
},
}
}
</script>
<style lang="scss">
@import url('./index.css');
</style>
File mode changed from 100755 to 100644
import storeNew from "./index.vue";
import storeCard from "./store-card.vue";
import storeGroup from "./store-group.vue";
const gicStoreNew = {
install(Vue, options) {
......@@ -11,12 +12,21 @@ if (typeof window !== 'undefined' && window.Vue) {
}
export default gicStoreNew;
export const gicStoreCard = {
install(Vue, options) {
Vue.component(storeCard.name, storeCard)
}
}
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(gicStoreCard);
}
export const gicStoreGroup = {
install(Vue, options) {
Vue.component(storeGroup.name, storeGroup)
}
}
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(gicStoreGroup);
}
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
<template>
<el-popover class="vertical-baseline" placement="bottom-start" width="406" height="400" trigger="click" v-model="popoverShow">
<div class="dm-store__area" style="height: 400px;">
<!-- 左侧 -->
<div class="dm-store__left">
<div class="dm-store__list" style="height:100%;">
<div v-for="(v,i) in areaList" :key="i" class="dm-store__item" @click="clickProvince(v,i)">
<div>
<el-checkbox class="inline-block" :indeterminate="v.indeterminate" v-model="v.isCheck" @change="checkProvinceChange(v,i)"></el-checkbox>
<span class="inline-block"> {{v.provinceName}}</span>
</div>
<i class="el-icon-arrow-right"></i>
</div>
</div>
</div>
<!-- 右侧 -->
<div class="dm-store__right">
<div class="dm-store__list" style="height:100%;">
<p v-for="(v,i) in currentCityList" :key="i" class="dm-store__item">
<el-checkbox v-model="v.isCheck" @change="checkCityChange(v)">{{v.cityName}}</el-checkbox>
</p>
</div>
</div>
<!-- 操作按钮 -->
<div class="dm-store__btn">
<span class="dm-store__btn--cancel" @click="popoverShow = false">取 消</span>
<el-button class="dm-store__btn--cancel" type="text" @click="saveArea">确 定</el-button>
</div>
</div>
<!-- 展示区 -->
<div class="el-input dm-store__reference w240" slot="reference">
<div class="el-input__inner block">
已选择{{totalProvince}}个省、{{totalCity}}个市
</div>
</div>
</el-popover>
</template>
<script>
import qs from 'qs';
import { baseUrl } from '../config';
export default {
name: 'options-area',
props: {
uuid: {
type:String,
default:''
},
cacheUuid:{
type:String,
default:''
},
isAdd:{
type:Boolean,
default:true
},
isCache:{
type:Boolean,
default:false
}
},
watch: {
areaList:{
/* indeterminate isCheck
* true true 半勾选
* false false 不选
* false true 全选
*/
handler(val) {
// 全选计算省数量
this.totalProvince = this.areaList.filter(v => (!v.indeterminate && v.isCheck)).length;
this.totalCity = 0;
this.areaList.map(v => {
// 半勾选计算市数量
if ( v.isCheck && v.children.length) {
v.children.map(w => {
if (w.isCheck) {
this.totalCity ++
}
})
}
})
},
deep:true
}
},
data() {
return {
popoverShow:false,
areaList:[],
currentCityList:[],
currentIndex:0,
totalCity:0,
totalProvince:0,
defaultProps: {
children: 'children',
label: 'label',
id:'id'
},
params:{
selectType:3, // 是 int 下拉选择项
key:'', // 是 string 32位唯一值
isAll:0, // 是 int 是否勾选全部 1是 0否
value:'', //否 string isAll=0时,必填,选中项id,多个逗号分隔
removeItems:'', //否 string isAll=1,取消选中项的id,多个逗号分隔
},
}
},
created() {
this.getAreaTree();
if (!this.isAdd) {
this.copyStoreWidget();
}
console.log(this.uuid,this.cacheUuid);
},
methods:{
// 获取树形结构
async getAreaTree() {
let res = await this.axios.get(baseUrl + '/api-plug/dict-district-tree?requestProject=gic-web')
this.areaList = res.data.result.map(v => ({
isCheck:false,
indeterminate:false,
label:v.provinceName,
id:v.provinceId,
...v,
children:v.children.map(w => ({
isCheck:false,
label:w.cityName,
id:w.cityId,
...w
}))
}))
await this.getCheckedData();
},
// 获取已选择项
getCheckedData() {
return new Promise((resolve,reject) => {
let params = {
key:this.isCache ? this.cacheUuid : this.uuid,
selectType:3,
search:'',
currentPage:1,
pageSize:3000
}
this.axios.post(baseUrl + '/api-plug/list-right-data?requestProject=gic-web',qs.stringify(params)).then(res => {
let list = (res.data.result && res.data.result.result) || [];
list.map(u => u.id).map(u => {
this.areaList.map(v => {
// 全选 市一起勾选
if (u === v.provinceId) {
v.indeterminate = false;
v.isCheck = true;
v.children.map(w => {
w.isCheck = true;
})
}
// 半勾选
v.children.map(w => {
if (u === w.cityId) {
w.isCheck = true;
v.indeterminate = true;
v.isCheck = true;
}
})
})
})
}).catch(err => {
console.log(err)
})
})
},
clickProvince(item,index) {
this.currentIndex = index;
this.currentCityList = item.children || [];
},
checkProvinceChange(item,index) {
this.currentIndex = index;
this.currentCityList = item.children || [];
item.children.map(v => {
v.isCheck = item.isCheck;
});
if (item.children.length) {
const isAllCheck = item.children.every(v => v.isCheck);
const isSomeCheck = item.children.some(v => v.isCheck);
item.isCheck = isSomeCheck;
item.indeterminate = !isAllCheck && isSomeCheck;
}
},
/* indeterminate isCheck
* true true 半勾选
* false false 不选
* false true 全选
*/
checkCityChange() {
let item = this.areaList[this.currentIndex];
const isAllCheck = item.children.every(v => v.isCheck);
const isSomeCheck = item.children.some(v => v.isCheck);
item.isCheck = isSomeCheck;
item.indeterminate = !isAllCheck && isSomeCheck;
console.log(item.indeterminate,item.isCheck);
},
saveArea() {
this.params.key = this.isAdd ? this.uuid: this.cacheUuid;
let valueList = [];
this.areaList.map(v => {
// 全选 只传省ID
if(!v.indeterminate && v.isCheck) {
valueList.push(v.provinceId)
}
if(v.indeterminate && v.isCheck && v.children.length) {
// 半选 传市id
v.children.map(w => {
if (w.isCheck) {
valueList.push(w.cityId)
}
})
}
});
this.params.value = valueList.filter(v => v).join(',');
if (!this.params.value) {
this.$message({type:"warning",message:"门店选择不能为空"});
return;
}
this.axios.post(baseUrl + '/api-plug/save-store-widget?requestProject=gic-web',qs.stringify(this.params)).then(res => {
if (res.data.errorCode === 0) {
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.popoverShow = false;
} else {
this.$message({type:'error',message:'保存失败'});
}
}).catch(err => {
console.log(err)
})
},
// 把老数据拷贝到新的临时id上
copyStoreWidget() {
this.axios.get(baseUrl + '/api-plug/copy-store-widget?requestProject=gic-web&oldKey='+this.uuid+'&newKey='+this.cacheUuid).then(res => {
if(res.data.errorCode === 0) {
console.log('拷贝成功');
}
})
}
}
}
</script>
<template>
<el-popover class="vertical-baseline" placement="bottom-start" width="446" height="378" trigger="click">
<div class="dm-store__wrap" style="height: 378px;">
<!-- 左侧 -->
<div class="dm-store__left">
<div class="dm-store__state">
<span>选择</span>
<!-- <el-checkbox v-model="params.isAll" :true-label="1" :false-label="0" @change="handleCheckAllChange">所有门店</el-checkbox> -->
<!-- <span class="fz13">{{params.isAll?leftTotal:leftCheckList.length}}/{{leftTotal}}</span> -->
</div>
<div class="dm-store__search">
<el-input v-model="leftValue" placeholder="请输入门店名称" prefix-icon="el-icon-search" @change="getLeftList"></el-input>
</div>
<el-tree ref="tree" class="dm-store__list" :data="leftList" :default-expand-all="true" show-checkbox node-key="storeGroupId" :props="defaultProps"></el-tree>
</div>
<div class="dm-store__center">
<el-button type="primary" icon="el-icon-arrow-right" circle @click="saveToRight"></el-button>
<el-button icon="el-icon-close" circle :disabled="!rightCheckList.length" @click="deleteRightItems(false)"></el-button>
</div>
<!-- 右侧 -->
<div class="dm-store__right">
<div class="dm-store__state">
<span>已选<span class="fz12 gray-color">{{rightTotal}}个类型)</span></span>
<el-button type="text" @click="deleteRightAll">全部清除</el-button>
</div>
<div class="dm-store__search">
<el-input v-model="rightValue" placeholder="请输入门店名称" prefix-icon="el-icon-search" @change="getRightList"></el-input>
</div>
<el-checkbox-group v-model="rightCheckList" class="dm-store__list">
<p v-for="(v,i) in rightList" :key="i" class="dm-store__item" @mouseover="rightHoverIndex = i" @mouseout="rightHoverIndex = null">
<el-checkbox :label="v.id">{{v.name}}</el-checkbox>
<i class="el-icon-close" v-show="rightHoverIndex !== i"></i>
<i class="el-icon-circle-close" v-show="rightHoverIndex === i" @click.stop="deleteRightItems(v.id)"></i>
</p>
</el-checkbox-group>
</div>
</div>
<!-- 展示区 -->
<div class="el-input dm-store__reference w240" slot="reference">
<div class="el-input__inner dm-store__inputtag">
<el-tag size="small" v-for="v in rightList" :key="v.id" @close="deleteRightItems(v.id)" closable>{{v.name}}</el-tag>
<span class="gray-color dm-store__inputtag--tips" v-show="rightList.length === 0">请选择门店</span>
</div>
<el-popover placement="top-start" popper-class="select-shop__popper" width="300" trigger="hover">
<el-tag class="dm-store__total--tag" v-for="v in rightList" :key="v.id" @close="deleteRightItems(v.id)" closable>
{{v.name}}
</el-tag>
<span slot="reference" class="dm-store__inputtag--total" v-show="rightList.length">{{params.isAll?rightTotal:rightList.length}}</span>
</el-popover>
</div>
</el-popover>
</template>
<script>
import qs from 'qs';
import { baseUrl } from '../config';
export default {
name:'options-group',
props:{
uuid:{
type:String,
default:''
},
cacheUuid:{
type:String,
default:''
},
isAdd:{
type:Boolean,
default:true
},
isCache:{
type:Boolean,
default:false
}
},
data() {
return {
leftList:[],
rightList:[],
leftValue:'',
rightValue:'',
leftCheckList:[],
rightCheckList:[],
params:{
selectType:4, // 是 int 下拉选择项
key:'', // 是 string 32位唯一值
isAll:0, // 是 int 是否勾选全部 1是 0否
value:'', //否 string isAll=0时,必填,选中项id,多个逗号分隔
removeItems:'', //否 string isAll=1,取消选中项的id,多个逗号分隔
},
isIndeterminate: true,
rightHoverIndex:null,
rightTotal:0,
leftTotal:0,
defaultProps:{
id:'storeGroupId',
label:'storeGroupName',
children:'children'
}
}
},
created() {
this.getLeftList().then(_ => {
this.getRightList();
});
if (!this.isAdd) {
this.copyStoreWidget();
}
console.log(this.uuid,this.cacheUuid);
},
methods:{
// 拉取左侧数据
getLeftList() {
return new Promise((resolve,reject) => {
this.axios.get(baseUrl + '/api-plug/store-group-list?requestProject=gic-web&search='+this.leftValue).then(res => {
this.leftList = res.data.result || [];
resolve();
// this.leftTotal = res.data.result.totalCount || 0;
}).catch(err => {
reject();
console.log(err)
})
})
},
// 拉取右侧数据
getRightList() {
let params = {
key:this.isCache ? this.cacheUuid : this.uuid,
selectType:4,
search:this.rightValue,
currentPage:1,
pageSize:999
}
this.axios.post(baseUrl + '/api-plug/list-right-data?requestProject=gic-web',qs.stringify(params)).then(res => {
this.rightList = (res.data.result && res.data.result.result) || [];
this.rightTotal = (res.data.result && res.data.result.totalCount) || 0;
this.$nextTick(_ => {
this.$refs.tree.setCheckedKeys(this.rightList.map(v => v.id));
})
}).catch(err => {
console.log(err)
})
},
// 左侧数据移动到右侧
saveToRight() {
this.params.key = this.isAdd ? this.uuid: this.cacheUuid;
if (this.params.isAll) {
this.params.removeItems = this.leftList.filter(v => {
return this.leftCheckList.indexOf(v.tagId) < 0;
}).map(v => v.tagId).join(',');
} else {
this.params.value = this.$refs.tree.getCheckedKeys().join(',');
if (!this.params.value) {
this.$message({type:"warning",message:"门店选择不能为空"});
return;
}
}
this.axios.post(baseUrl + '/api-plug/save-store-widget?requestProject=gic-web',qs.stringify(this.params)).then(res => {
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.$nextTick(_ => {
this.getRightList();
})
}).catch(err => {
console.log(err)
})
},
// 删除右侧全部
deleteRightAll() {
this.axios.get(baseUrl + '/api-plug/remove-allitems?requestProject=gic-web&key=' + (this.isAdd ? this.uuid: this.cacheUuid)).then(res => {
if (res.data.errorCode === 0) {
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.$nextTick(_ => {
this.getRightList();
})
} else {
this.$message({type:'error',message:'清除全部失败'});
}
}).catch(err => {
console.log(err)
})
},
// 删除右侧单选或者多选数据
deleteRightItems(item) {
let params = {
key:this.isAdd ? this.uuid : this.cacheUuid,
removeItems:item || this.rightCheckList.join(',')
}
console.log(this.isAdd,this.uuid ,this.cacheUuid)
this.params.value = this.leftCheckList.join(',');
// console.log(url);
this.axios.post(baseUrl + '/api-plug/remove-items?requestProject=gic-web',qs.stringify(params)).then(res => {
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.$nextTick(_ => {
this.getRightList();
this.rightCheckList = [];
})
}).catch(err => {
console.log(err)
})
},
// 选中所有数据
handleCheckAllChange(val) {
this.leftCheckList = val ? this.leftList.map(v => v.tagId) : [];
},
// 把老数据拷贝到新的临时id上
copyStoreWidget() {
this.axios.get(baseUrl + '/api-plug/copy-store-widget?requestProject=gic-web&oldKey='+this.uuid+'&newKey='+this.cacheUuid).then(res => {
if(res.data.errorCode === 0) {
console.log('拷贝成功');
}
})
}
}
}
</script>
<template>
<el-popover class="vertical-baseline" placement="bottom-start" width="446" height="378" trigger="click">
<div class="dm-store__wrap" style="height: 378px;">
<div class="dm-store__left">
<div class="dm-store__state">
<el-checkbox v-model="params.isAll" :true-label="1" :false-label="0" @change="handleCheckAllChange">所有门店</el-checkbox>
<span class="fz13">{{computedLeftCount}}/{{leftTotal}}</span>
</div>
<div class="dm-store__search">
<el-input v-model="leftValue" placeholder="请输入标签名称" prefix-icon="el-icon-search" @change="getLeftList"></el-input>
</div>
<el-checkbox-group v-model="leftCheckList" class="dm-store__list">
<p v-for="(v,i) in leftList" :key="i" class="dm-store__item">
<el-checkbox :label="v.tagId">{{v.tagName}}</el-checkbox>
<!-- <i class="el-icon-arrow-right"></i> -->
</p>
</el-checkbox-group>
</div>
<div class="dm-store__center">
<el-button type="primary" icon="el-icon-arrow-right" circle :disabled="!leftCheckList.length" @click="saveToRight"></el-button>
<el-button icon="el-icon-close" circle :disabled="!rightCheckList.length" @click="deleteRightItems(false)"></el-button>
</div>
<div class="dm-store__right">
<div class="dm-store__state">
<span>已选<span class="fz12 gray-color">{{rightTotal}}个类型)</span></span>
<el-button type="text" @click="deleteRightAll">全部清除</el-button>
</div>
<div class="dm-store__search">
<el-input v-model="rightValue" placeholder="请输入标签名称" prefix-icon="el-icon-search" @change="rightSearch"></el-input>
</div>
<el-checkbox-group v-model="rightCheckList" class="dm-store__list">
<p v-for="(v,i) in rightList" :key="i" class="dm-store__item" @mouseover="rightHoverIndex = i" @mouseout="rightHoverIndex = null">
<el-checkbox :label="v.id">{{v.name}}</el-checkbox>
<i class="el-icon-close" v-show="rightHoverIndex !== i"></i>
<i class="el-icon-circle-close" v-show="rightHoverIndex === i" @click.stop="deleteRightItems(v.id)"></i>
</p>
<p class="dm-store__list--more" v-if="moreShow" :disabled="moreLoading"><el-button type="text" @click="loadMore">{{moreLoading?'加载中...':'加载更多'}}</el-button></p>
</el-checkbox-group>
</div>
</div>
<div class="el-input dm-store__reference w240" slot="reference">
<div class="el-input__inner dm-store__inputtag">
<el-tag size="small" v-for="v in rightList" :key="v.id" @close="deleteRightItems(v.id)" closable>{{v.name}}</el-tag>
<span class="gray-color dm-store__inputtag--tips" v-show="rightList.length === 0">请选择门店</span>
</div>
<el-popover placement="top-start" popper-class="select-shop__popper" width="300" trigger="hover">
<el-tag class="dm-store__total--tag" v-for="v in rightList" :key="v.id" @close="deleteRightItems(v.id)" closable>
{{v.name}}
</el-tag>
<span slot="reference" class="dm-store__inputtag--total" v-show="rightList.length">{{params.isAll?rightTotal:rightList.length}}</span>
</el-popover>
</div>
</el-popover>
</template>
<script>
import qs from 'qs';
import { baseUrl } from '../config';
export default {
name:'options-tags',
props:{
uuid:{
type:String,
default:''
},
cacheUuid:{
type:String,
default:''
},
isAdd:{
type:Boolean,
default:true
},
isCache:{
type:Boolean,
default:false
}
},
data() {
return {
leftList:[],
rightList:[],
leftValue:'',
rightValue:'',
leftCheckList:[],
rightCheckList:[],
params:{
selectType:2, // 是 int 下拉选择项
key:'', // 是 string 32位唯一值
isAll:0, // 是 int 是否勾选全部 1是 0否
value:'', //否 string isAll=0时,必填,选中项id,多个逗号分隔
removeItems:'', //否 string isAll=1,取消选中项的id,多个逗号分隔
},
rightParams:{
key:this.uuid,
selectType:2,
search:this.rightValue,
currentPage:1,
pageSize:20
},
rightHoverIndex:null,
rightTotal:0,
leftTotal:0,
moreShow:false,
moreLoading:false
}
},
computed:{
computedLeftCount() {
if (this.params.isAll) {
let minuend = this.leftList.length - this.leftCheckList.length;
return this.leftTotal - minuend;
} else {
return this.leftList.map(v => {
return this.leftCheckList.includes(v.tagId);
}).filter(v => v).length;
}
}
},
created() {
this.getLeftList();
this.rightSearch();
if (!this.isAdd) {
this.copyStoreWidget();
}
console.log(this.uuid,this.cacheUuid);
},
methods:{
// 右侧搜索
rightSearch() {
this.rightParams.currentPage = 1;
this.getRightList().then(res => {
this.rightList = res;
})
},
// 拉取左侧数据
getLeftList() {
this.axios.get(baseUrl + '/api-plug/tag-list?requestProject=gic-web&search='+this.leftValue).then(res => {
this.leftList = res.data.result.result || [];
this.leftTotal = res.data.result.totalCount || 0;
}).catch(err => {
console.log(err)
})
},
// 拉取右侧数据
getRightList() {
return new Promise((resolve,reject) => {
this.moreLoading = true;
this.rightParams.key = this.isCache ? this.cacheUuid : this.uuid;
this.rightParams.search = this.rightValue;
this.axios.post(baseUrl + '/api-plug/list-right-data?requestProject=gic-web',qs.stringify(this.rightParams)).then(res => {
this.moreLoading = false;
if (res.data.errorCode === 0) {
this.rightTotal = (res.data.result && res.data.result.totalCount) || 0;
let list = (res.data.result && res.data.result.result) || [];
// 没有拉取到数据,说明没有更多数据
if (list.length < 20) {
this.moreShow = false;
} else {
this.moreShow = true;
}
resolve(list);
} else {
reject(new Error('获取列表错误'));
}
}).catch(err => {
reject(new Error('获取列表错误'));
console.log(err)
});
})
},
// 左侧数据移动到右侧
saveToRight() {
this.params.key = this.isAdd ? this.uuid: this.cacheUuid;
if (this.params.isAll) {
this.params.removeItems = this.leftList.filter(v => {
return this.leftCheckList.indexOf(v.tagId) < 0;
}).map(v => v.tagId).join(',');
} else {
this.params.value = this.leftCheckList.join(',');
if (!this.params.value) {
this.$message({type:"warning",message:"门店选择不能为空"});
return;
}
}
this.axios.post(baseUrl + '/api-plug/save-store-widget?requestProject=gic-web',qs.stringify(this.params)).then(res => {
this.rightParams.currentPage = 1;
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.$nextTick(_ => {
this.getRightList().then(res => {
this.rightList = res;
})
})
}).catch(err => {
console.log(err)
})
},
// 删除右侧全部
deleteRightAll() {
this.axios.get(baseUrl + '/api-plug/remove-allitems?requestProject=gic-web&key=' + (this.isAdd ? this.uuid: this.cacheUuid)).then(res => {
if (res.data.errorCode === 0) {
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.rightParams.currentPage = 1;
this.$nextTick(_ => {
this.getRightList().then(res => {
this.rightList = res;
})
})
} else {
this.$message({type:'error',message:'清除全部失败'});
}
}).catch(err => {
console.log(err)
})
},
// 删除右侧单选或者多选数据
deleteRightItems(item) {
let params = {
key:this.isAdd ? this.uuid : this.cacheUuid,
removeItems:item || this.rightCheckList.join(',')
}
console.log(this.isAdd,this.uuid ,this.cacheUuid,this.deleteRightItems);
// return;
// debugger;
this.params.value = this.leftCheckList.join(',');
this.axios.post(baseUrl + '/api-plug/remove-items?requestProject=gic-web',qs.stringify(params)).then(res => {
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.rightParams.currentPage = 1;
this.$nextTick(_ => {
this.getRightList().then(res => {
this.rightList = res;
})
this.rightCheckList = [];
})
}).catch(err => {
console.log(err)
})
},
// 选中所有数据
handleCheckAllChange(val) {
this.leftCheckList = val ? this.leftList.map(v => v.tagId) : [];
},
// 加载更多
loadMore() {
this.rightParams.currentPage += 1;
this.getRightList().then(res => {
if (res instanceof Array) {
res.map(v => {
this.rightList.push(v);
})
}
})
},
// 把老数据拷贝到新的临时id上
copyStoreWidget() {
this.axios.get(baseUrl + '/api-plug/copy-store-widget?requestProject=gic-web&oldKey='+this.uuid+'&newKey='+this.cacheUuid).then(res => {
if(res.data.errorCode === 0) {
console.log('拷贝成功');
}
})
}
}
}
</script>
<template>
<el-popover class="vertical-baseline" placement="bottom-start" width="214" trigger="click">
<el-checkbox-group v-model="checkedList" @change="saveToRight">
<label :name="v.value" class="dm-store__type__item" v-for="(v,i) in typeList" :key="i">
<el-checkbox :label="v.value">{{v.label}}</el-checkbox>
</label>
</el-checkbox-group>
<div class="el-input dm-store__reference w240" slot="reference">
<div class="el-input__inner dm-store__inputtag">
<el-tag v-for="(v,i) in checkedList" size="small" :key="i" closable @close="delItem(v)">{{filterLabel(v)}}</el-tag>
<span class="gray-color dm-store__inputtag--tips" v-show="checkedList.length === 0">请选择门店</span>
</div>
<el-popover placement="top-start" popper-class="select-shop__popper" width="300" trigger="hover">
<el-tag v-for="(v,i) in checkedList" class="dm-store__total--tag" size="small" :key="i" closable @close="delItem(v)">{{filterLabel(v)}}</el-tag>
<span slot="reference" class="dm-store__inputtag--total" v-show="checkedList.length">{{checkedList.length}}</span>
</el-popover>
</div>
</el-popover>
</template>
<script>
import qs from 'qs';
import { baseUrl } from '../config';
export default {
name:'options-type',
props:{
uuid:{
type:String,
default:''
},
cacheUuid:{
type:String,
default:''
},
isAdd:{
type:Boolean,
default:true
},
isCache:{
type:Boolean,
default:false
}
},
created() {
this.getRightList();
if (!this.isAdd) {
this.copyStoreWidget();
}
console.log(this.uuid,this.cacheUuid);
},
data() {
return {
typeList:[
{label:'自营',value:'0'},
{label:'联营',value:'1'},
{label:'代理',value:'2'},
{label:'代销',value:'3'},
{label:'托管',value:'4'},
],
checkedList:[],
popoverShow:false,
params:{
selectType:1, // 是 int 下拉选择项
key:'', // 是 string 32位唯一值
isAll:0, // 是 int 是否勾选全部 1是 0否
value:'', //否 string isAll=0时,必填,选中项id,多个逗号分隔
removeItems:'', //否 string isAll=1,取消选中项的id,多个逗号分隔
},
}
},
methods:{
// label 的filter
filterLabel(val) {
let result = '';
this.typeList.map( v => {
if (val === v.value) {
result = v.label;
}
})
return result;
},
// 拉取右侧数据
getRightList() {
let params = {
key:this.isCache ? this.cacheUuid : this.uuid,
selectType:1,
search:'',
currentPage:1,
pageSize:20
}
this.axios.post(baseUrl + '/api-plug/list-right-data?requestProject=gic-web',qs.stringify(params)).then(res => {
if (res.data.errorCode === 0) {
this.checkedList = ((res.data.result && res.data.result.result) || []).map(v => v.id);
}
}).catch(err => {
console.log(err)
})
},
// 保存
saveToRight() {
this.params.key = this.isAdd ? this.uuid: this.cacheUuid;
this.params.value = this.checkedList.join(',');
if (!this.params.value) {
this.$message({type:"warning",message:"门店选择不能为空"});
return;
}
this.axios.post(baseUrl + '/api-plug/save-store-widget?requestProject=gic-web',qs.stringify(this.params)).then(res => {
// 如果是编辑 并且有操作 把isCache设为true 最终保存是临时id
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
}).catch(err => {
console.log(err)
})
},
// 删除右侧单选或者多选数据
delItem(v) {
let params = {
key:this.isAdd ? this.uuid : this.cacheUuid,
removeItems:v,
value:''
}
console.log(this.isAdd,this.uuid ,this.cacheUuid)
this.axios.post(baseUrl + '/api-plug/remove-items?requestProject=gic-web',qs.stringify(params)).then(res => {
if (!this.isAdd) {
this.$emit('update:isCache',true);
}
this.$nextTick(_ => {
this.getRightList();
})
}).catch(err => {
console.log(err)
})
},
// 把老数据拷贝到新的临时id上
copyStoreWidget() {
this.axios.get(baseUrl + '/api-plug/copy-store-widget?requestProject=gic-web&oldKey='+this.uuid+'&newKey='+this.cacheUuid).then(res => {
if(res.data.errorCode === 0) {
console.log('拷贝成功');
}
})
}
}
}
</script>
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
<template>
<div>
<div style="margin:40px;">
<vue-gic-store-new class="inline-block" ref="storeNew" :options="options" :uuid.sync="uuid" :isAdd="isAdd"></vue-gic-store-new>
<vue-gic-store-group class="inline-block" ref="storeNew" :options="options" :uuid.sync="uuid" :isAdd="isAdd"></vue-gic-store-group>
<el-button @click="isSaveFun" type="primary">检查是否保存</el-button> {{isSave}}
<el-button @click="getStoreConfig" type="primary">获取保存的数据</el-button> {{storeConfig}}
</div>
......@@ -21,10 +21,13 @@
<script>
import gicStoreNew from '../component/dmStore/index.vue'
import gicStoreCard from '../component/dmStore/store-card.vue'
import gicStoreGroup from '../component/dmStore/group.vue'
export default {
components:{
'vue-gic-store-new':gicStoreNew,
'vue-gic-store-card':gicStoreCard
'vue-gic-store-card':gicStoreCard,
'vue-gic-store-group':gicStoreGroup
},
data() {
......
......@@ -35,11 +35,9 @@
<el-button size="small" @click="cancelFilter">取 消</el-button>
</div>
</div>
<vue-gic-confirm-people v-show="form.memberType === 1" idType="memberId" :onlyWxMember="0" @get-data="getConfirmData" :list="memberList"></vue-gic-confirm-people>
<vue-gic-confirm-people v-show="form.memberType === 1" idType="memberId" :onlyWxMember="1" @get-data="getConfirmData" :list="memberList"></vue-gic-confirm-people>
<vue-gic-member-group v-if="form.memberType === 2" :defaltSelected="defaltSelected" :height='500' :projectName="projectName" :headerList='headerList' @handleDataTransferred="handleDataTransferred" @handleDataLeft="handleDataLeft"></vue-gic-member-group>
</div>
<!-- 只有存在卡券的情况下出现卡券通知方式 -->
<section class="dm-form__wrap">
<h3 class="dm-title__label">卡券通知方式配置</h3>
......
......@@ -3,14 +3,14 @@
<div class="game-ptyx-header pb10 clearfix">
<span class="pr10">卡券共{{total}}</span>
<el-input v-model="listParams.searchParam" class="w200" placeholder="输入名称/备注" clearable @change="cardPageList"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-button class="fr" type="primary" @click="preAddCard">添加卡券</el-button>
<el-button class="fr" type="primary" @click="shelfAddShow = true">添加卡券</el-button>
</div>
<ul class="clearfix" v-loading="loading" element-loading-text="拼命加载中" >
<card-item :item="v" v-for="(v,i) in tableList" :shelfFlag="true" :key="i" @del-shelf="delShelf"></card-item>
</ul>
<div class="text-center" v-if="tableList.length === 0">
<img class="block block-center pt100" width="60" height="60" src="../../assets/img/no-data_icon.png" alt="">
<el-button class="block block-center mt10" type="text" @click="preAddCard">添加卡券</el-button>
<el-button class="block block-center mt10" type="text" @click="shelfAddShow = true">添加卡券</el-button>
</div>
<el-pagination v-show="tableList.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>
<shelf-add :show.sync="shelfAddShow" @refresh="cardPageList"></shelf-add>
......@@ -20,9 +20,10 @@
import {cardPageList,deleteShelfCard} from '@/service/api/cardApi.js';
import cardItem from './partials/card-item';
import shelfAdd from './partials/shelf-add';
import tableMethods from '@/mixins/tableMethods.js';
export default {
name: 'card-manager',
mixins:[tableMethods],
data () {
return {
listParams:{
......@@ -40,54 +41,43 @@ export default {
},
components:{
'card-item':cardItem,
shelfAdd
'shelf-add':shelfAdd
},
created() {
this.cardPageList();
this.getTableList();
this.$store.commit('mutations_breadcrumb',[{name:'营销管理',path:''},{name:'卡券营销',path:''},{name:'卡券展架',path:'/card/shelf'},{name:'卡券展架管理',path:''}])
},
methods: {
handleSizeChange(val) {
this.listParams.pageSize = val;
this.cardPageList();
},
handleCurrentChange(val) {
this.listParams.currentPage = val;
this.cardPageList();
},
async cardPageList() {
this.loading = true;
try {
let res = await cardPageList(this.listParams);
this.tableList = res.result.result || [];
this.total = res.result.totalCount;
} catch (err) {
this.$tips({type:'error',message:'加载列表失败'});
async getTableList() {
this.loading = true;
try {
let res = await cardPageList(this.listParams);
this.tableList = res.result.result || [];
this.total = res.result.totalCount;
} catch (err) {
this.$tips({type:'error',message:'加载列表失败'});
}
this.loading = false;
},
//移除卡券
delShelf(obj) {
this.$confirm('是否移除该卡券?', '提示', {
confirmButtonText: '确定',
cancelBUttonText: '取消',
type: 'warning'
}).then(() => {
deleteShelfCard({shelfId:this.$route.params.id,coupCardId:obj.coupCardId}).then(res => {
if (res.errorCode === 0 ) {
this.$tips({type:'success',message:'删除成功'})
this.getTableList();
} else {
this.$tips({type: 'error',message: '删除失败'});
}
this.loading = false;
},
//TODO
delShelf(obj) {
this.$confirm('是否移除该卡券?', '提示', {
confirmButtonText: '确定',
cancelBUttonText: '取消',
type: 'warning'
}).then(() => {
deleteShelfCard({shelfId:this.$route.params.id,coupCardId:obj.coupCardId}).then(res => {
if (res.errorCode === 0 ) {
this.$tips({type:'success',message:'删除成功'})
this.cardPageList();
} else {
this.$tips({type: 'error',message: '删除失败'});
}
});
}).catch(() => {
this.$tips({type: 'info',message: '已取消删除'});
});
},
preAddCard(){
this.shelfAddShow = true;
}
}).catch(() => {
this.$tips({type: 'info',message: '已取消删除'});
});
}
},
}
</script>
<template>
<section>
<section class="card-record-cache">
<!-- 条件筛选区 -->
<div class="pb22">
<el-input v-model="listParams.cardName" class="w250" placeholder="请输入卡券名称" @change="search"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-input v-model="listParams.nickName" class="w250" placeholder="请输入用户昵称" @change="search"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-input v-model="listParams.cardName" class="w250" placeholder="请输入卡券名称" @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-input v-model="listParams.nickName" class="w250" placeholder="请输入用户昵称" @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-button class="fr" type="primary" icon="iconfont icon-icon_yunxiazai fz14" @click="exportTemplateReceivedExcel"> 导出记录</el-button>
</div>
<div class="filter--box">
<el-select class="dm-select pl10" v-model="listParams.cardType" placeholder="选择卡券类型" @change="search">
<el-select class="dm-select pl10" v-model="listParams.cardType" placeholder="选择卡券类型" @change="refresh">
<el-option v-for="(item,index) in cardTypeOptions" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-select class="dm-select" v-model="listParams.status" placeholder="选择卡券状态" @change="search">
<el-select class="dm-select" v-model="listParams.status" placeholder="选择卡券状态" @change="refresh">
<el-option v-for="(item,index) in statusOptions" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
<span class="vertical-middle">领取时间:</span><el-date-picker v-model="dateTime" :clearable="false" @change="search" class="w250" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
<span class="vertical-middle">关注时间:</span><el-date-picker v-model="dateTime2" @change="search" class="w250" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
<span class="vertical-middle">领取时间:</span><el-date-picker v-model="dateTime" :clearable="false" @change="refresh" class="w250" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
<span class="vertical-middle">关注时间:</span><el-date-picker v-model="dateTime2" @change="refresh" class="w250" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</div>
<!-- 列表 -->
<el-table tooltipEffect="light" :data="recordList" style="width: 100%" v-loading="recordLoading" @sort-change="sortList">
<el-table-column width="135" align="left" prop="receiveTime" label="领取时间" fixed="left">
<template slot-scope="scope">
{{formateDateTimeByType(scope.row.receiveTime,'yyyy-MM-dd-HH-mm')}}
</template>
</el-table-column>
<el-table-column width="80" align="left" prop="cardTypeExcel" label="卡券类型">
</el-table-column>
<el-table-column min-width="100" align="left" prop="cardName" label="卡券名称">
</el-table-column>
<el-table-column min-width="100" align="left" prop="cardCode" label="卡券券号">
</el-table-column>
<el-table-column min-width="100" align="left" prop="dictName" label="卡券来源">
</el-table-column>
<el-table-column min-width="100" align="left" prop="receiveTypeExcel" label="来源明细">
</el-table-column>
<el-table-column min-width="100" align="left" prop="attentionStatus" label="关注状态">
</el-table-column>
<el-table-column width="135" align="left" prop="transferDate" label="关注时间">
<template slot-scope="scope">
{{scope.row.transferDate?formateDateTimeByType(scope.row.transferDate,'yyyy-MM-dd-HH-mm'):'--'}}
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" min-width="140" header-align="left" align="left" :key="Math.random()" prop="clerkId" label="会员信息">
<template slot-scope="scope">
<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.nickName || '--'}}</p>
</div>
</template>
</el-table-column>
<el-table-column width="135" align="left" prop="receiveTime" label="领取时间" fixed="left">
<template slot-scope="scope">
{{formateDateTimeByType(scope.row.receiveTime,'yyyy-MM-dd-HH-mm')}}
</template>
</el-table-column>
<el-table-column width="80" align="left" prop="cardTypeExcel" label="卡券类型">
</el-table-column>
<el-table-column min-width="100" align="left" prop="cardName" label="卡券名称">
</el-table-column>
<el-table-column min-width="100" align="left" prop="cardCode" label="卡券券号">
</el-table-column>
<el-table-column min-width="100" align="left" prop="dictName" label="卡券来源">
</el-table-column>
<el-table-column min-width="100" align="left" prop="receiveTypeExcel" label="来源明细">
</el-table-column>
<el-table-column min-width="100" align="left" prop="attentionStatus" label="关注状态">
</el-table-column>
<el-table-column width="135" align="left" prop="transferDate" label="关注时间">
<template slot-scope="scope">
{{scope.row.transferDate?formateDateTimeByType(scope.row.transferDate,'yyyy-MM-dd-HH-mm'):'--'}}
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" min-width="140" header-align="left" align="left" :key="Math.random()" prop="clerkId" label="会员信息">
<template slot-scope="scope">
<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.nickName || '--'}}</p>
</div>
</template>
</el-table-column>
</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>
</section>
......@@ -55,9 +55,10 @@
<script>
import {formateDateTimeByType} from '@/utils/index.js';
import {templateReceiveCardPage,exportTemplateReceivedExcel} from '@/service/api/cardApi.js';
import cardOrder from './card-order';
import tableMethods from '@/mixins/tableMethods.js';
export default {
name: 'record-get',
mixins:[tableMethods],
data () {
return {
defaultAvatar:require('../../assets/img/head_default.png'),
......@@ -83,11 +84,8 @@ export default {
total:0,
}
},
components:{
'card-order':cardOrder
},
created() {
this.templateReceiveCardPage();
this.getTableList();
this.$store.commit('mutations_breadcrumb',[{name:'营销管理',path:''},{name:'卡券营销',path:''},{name:'卡券记录',path:''},{name:'临时领取记录',path:''}]);
this.$store.commit('mutations_layoutTips',`<div class="layout--tips">
<i class="el-icon-info"></i>临时领取记录仅保存未关注公众号或未使用过小程序用户领券情况
......@@ -100,22 +98,10 @@ export default {
// 列表方法
sortList(val) {
this.listParams.sortBy = (val.order === 'descending') ? (val.prop +' desc') : val.prop;
this.templateReceiveCardPage();
},
search() {
this.listParams.currentPage = 1;
this.templateReceiveCardPage();
},
handleSizeChange(val) {
this.listParams.pageSize = val;
this.templateReceiveCardPage();
},
handleCurrentChange(val) {
this.listParams.currentPage = val;
this.templateReceiveCardPage();
this.getTableList();
},
// 领取列表
async templateReceiveCardPage() {
async getTableList() {
this.recordLoading = true;
if (this.dateTime) {
this.listParams.receiveBeginTime = formateDateTimeByType(this.dateTime[0],'yyyy-MM-dd');
......
<template>
<section>
<section class="card-record-get">
<!-- 条件筛选区 -->
<div class="pb22">
<el-input v-model="listParams.search" class="w300" placeholder="请输入卡券名称/卡券代码/会员信息" @change="search"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-input v-model="listParams.search" class="w300" placeholder="请输入卡券名称/卡券代码/会员信息" @change="refresh"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-button class="fr" type="primary" icon="iconfont icon-icon_yunxiazai fz14" @click="exportReceivedRecordExcel"> 导出订单</el-button>
</div>
<div class="filter--box">
<el-select class="dm-select pl10" v-model="listParams.cardStatus" placeholder="选择卡券状态" @change="search">
<el-select class="dm-select pl10" v-model="listParams.cardStatus" placeholder="选择卡券状态" @change="refresh">
<el-option v-for="(item,index) in cardStatusOptions" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
<span class="vertical-middle">领取时间:</span><el-date-picker v-model="dateTime" :clearable="false" @change="search" class="w250" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
<span class="vertical-middle">核销时间:</span><el-date-picker v-model="dateTime2" @change="search" class="w250" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
<span class="vertical-middle">领取时间:</span><el-date-picker v-model="dateTime" :clearable="false" @change="refresh" class="w250" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
<span class="vertical-middle">核销时间:</span><el-date-picker v-model="dateTime2" @change="refresh" class="w250" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</div>
<!-- 列表 -->
<el-table tooltipEffect="light" :data="recordList" style="width: 100%" v-loading="recordLoading" @sort-change="sortList">
......@@ -29,7 +29,7 @@
<a :href="'/member/#/wechatmemberDetail?memberId='+scope.row.memberId" target="_blank">
<img class="vertical-middle table__avatar--40" :src="scope.row.thirdimgurl || defaultAvatar" width="60" height="60" />
<div class="inline-block vertical-middle">
<p class="table-name--ellipsis">{{scope.row.memberName || '--'}}</p>
<p class="table-name--ellipsis">{{ scope.row.thirdName || scope.row.memberName || '--'}}</p>
<p class="gray">{{scope.row.phoneNum || '--'}}</p>
</div>
</a>
......@@ -80,8 +80,13 @@
import {formateDateTimeByType} from '@/utils/index.js';
import {cardRecordPage,deleteCardPuton,coupcardDestroy,exportReceivedRecordExcel} from '@/service/api/cardApi.js';
import cardOrder from './card-order';
import tableMethods from '@/mixins/tableMethods.js';
export default {
name: 'record-get',
mixins:[tableMethods],
components:{
cardOrder
},
data () {
return {
defaultAvatar:require('../../assets/img/head_default.png'),
......@@ -108,11 +113,8 @@ export default {
currentObj:{}
}
},
components:{
'card-order':cardOrder
},
created() {
this.cardRecordPage();
this.getTableList();
this.$store.commit('mutations_breadcrumb',[{name:'营销管理',path:''},{name:'卡券营销',path:''},{name:'卡券记录',path:''},{name:'领取记录',path:''}]);
this.$store.commit('mutations_layoutTips',`<div class="layout--tips">
<i class="el-icon-info"></i>当天的卡券领取记录数据可在隔天下载完整内容
......@@ -125,22 +127,10 @@ export default {
// 列表方法
sortList(val) {
this.listParams.sortBy = (val.order === 'descending') ? (val.prop +' desc') : val.prop;
this.cardRecordPage();
},
search() {
this.listParams.currentPage = 1;
this.cardRecordPage();
},
handleSizeChange(val) {
this.listParams.pageSize = val;
this.cardRecordPage();
},
handleCurrentChange(val) {
this.listParams.currentPage = val;
this.cardRecordPage();
this.getTableList();
},
// 领取列表
async cardRecordPage() {
async getTableList() {
this.recordLoading = true;
if (this.dateTime) {
this.listParams.beginTime = formateDateTimeByType(this.dateTime[0],'yyyy-MM-dd');
......
......@@ -93,7 +93,7 @@
<el-select v-model="form.marketingTimesType" class="w150 vertical-middle">
<el-option v-for="(v,i) in marketingTimesTypeOptions" :key="i" :value="v.value" :label="v.label"></el-option>
</el-select>
<span class="vertical-middle" v-if="form.marketingTimesType !== 5"><el-input-number controls-position="right" class="w150" :min="1" v-model="form.marketingTimes"></el-input-number></span>
<span class="vertical-middle" v-if="form.marketingTimesType !== -1"><el-input-number controls-position="right" class="w150" :min="1" v-model="form.marketingTimes"></el-input-number></span>
<span class="pl20 fz13 gray"> * 该营销计划{{marketingTimesTips}}</span>
</el-form-item>
</section>
......@@ -435,6 +435,7 @@ export default {
this.form.expireType = result.expireType;
//处理会员等级
this.form.gradeIds = (result.gradeIds && result.gradeIds.split(',').filter(v => v)) || [];
//营销次数配置
this.form.marketingTimesType = result.marketingTimesType || 0;
this.form.marketingTimes = result.marketingTimes || 1;
......@@ -442,15 +443,15 @@ export default {
this.form.cardNoticeType = result.cardNoticeType || 0;
this.form.templateNoticeFlag = result.templateNoticeFlag || 0;
// 判断回显
if (this.form.memberType === 0) {
this.form.memberSearchDTO = result.filterJson;
} else {
this.defaltSelected = res.result.tagGroupList || [];
//会员分组
this.form.memberGroupIds = result.filterJson || '';
this.defaltSelected = res.result.tagGroupList || [];
}
if (this.form.expireType){
this.form.beginDate = result.beginDate || '';
this.form.endDate = result.endDate || '';
......@@ -476,7 +477,6 @@ export default {
}
this.form.templateUseEnable = res.result.templateUseEnable;
this.$nextTick(_ => {
this.effectActionChange(true);
});
......@@ -678,7 +678,6 @@ export default {
params.marketingTemplate = JSON.stringify(marketingTemplate);
}
// 这里判断部分门店是否为空
if (this.form.store_mode) {
let data = await this.$refs.storeCard.getRightList();
......
......@@ -85,7 +85,7 @@ export default {
}
that.$emit('sendItem',{
comName:'text',
content:that.value,
content:that.value.replace(/&amp;/g, "&"),
ecmMarketingTypeRelationId:that.ecmMarketingTypeRelationId,
urlType:that.urlType,
jumpUrlInfo:that.jumpUrlInfo
......
......@@ -343,7 +343,6 @@ export default {
},
//判断营销列表里是否有短信 提供给父级使用
hasMessageInList() {
// console.log(this.list.some(v => (v.comName === 'item-message' && v.item.type === 1)))
return this.list.some(v => (v.comName === 'item-message' && v.item.type === 1));
},
//判断营销列表里是否有卡券 提供给父级使用
......
......@@ -15,7 +15,7 @@
<ul class="right-bg-items">
<li v-for="(v,i) in systemBakImgList" :class="{'active':v.imgFieldCode === currentBg.imgFieldCode}" :key="i" @click="selectBg(v,i)">
<img :src="v.imageUrl" alt="">
<span class="right-tips">{{i>2?'自定义':'模板'}}</span>
<span class="right-tips">{{i > 2 ? '自定义' : '模板'}}</span>
</li>
</ul>
<dm-upload-img icon="el-icon-upload" @backImg="backImgBg" class="uplaod" :tipsStyle="{position: 'absolute',top: '-30px',width: '100%',left:'0px'}" :showImg="false" :model.sync="form.bgImg" width="auto" label="上传本地图片" tips=" 背景图片大小不超过1M,尺寸750*1206px"></dm-upload-img>
......@@ -293,9 +293,9 @@ export default {
this.klflDetail();
this.klflStrategyList();
this.klflPrizeList()
this.$store.commit('mutations_breadcrumb',[{name:'营销管理',path:''},{name:'游戏营销',path:'/game'},{name:'口令福利',path:'/game/klfl'},{name:'口令福利编辑',path:''}]);
this.$store.commit('mutations_breadcrumb',[{name:'营销管理',path:''},{name:'游戏营销',path:''},{name:'口令福利',path:'/game/klfl'},{name:'口令福利编辑',path:''}]);
} else if (this.$route.meta.type === 'add') {
this.$store.commit('mutations_breadcrumb',[{name:'营销管理',path:''},{name:'游戏营销',path:'/game'},{name:'口令福利',path:'/game/klfl'},{name:'口令福利新增',path:''}]);
this.$store.commit('mutations_breadcrumb',[{name:'营销管理',path:''},{name:'游戏营销',path:''},{name:'口令福利',path:'/game/klfl'},{name:'口令福利新增',path:''}]);
(async () => {
let res = await this.klflDetail(true)
let res2 = await this.klflStrategyList();
......@@ -317,8 +317,6 @@ export default {
this.prizeList[this.codeIndex].codeId = val.gameWinCodeId
this.prizeList[this.codeIndex].gameCode = val.gameCode
this.prizeList[this.codeIndex].codeStock = val.codeStock
console.log(this.prizeList[this.codeIndex])
},
setPrizeCount(obj) {
this.currentObj = obj;
......@@ -494,7 +492,7 @@ export default {
if (this.systemBtnImgList.map(v => v.imgFieldCode).indexOf(result.game.buttonImgFieldCode) < 0) {
this.systemBtnImgList.push({imgFieldCode:result.game.buttonImgFieldCode,imageUrl:result.game.buttonImgUrl})
}
this.currentBtn = {imgFieldCode:result.game.buttonImgFieldCode,imageUrl:result.game.buttonImgUrl};
this.currentBtn = {imgFieldCode:result.game.buttonImgFieldCode, imageUrl:result.game.buttonImgUrl};
}
if (result.game.activityCustom) {
this.form.gameActivityCustomId = result.game.activityCustom.gameActivityCustomId;
......@@ -518,34 +516,33 @@ export default {
this.$refs[formName].validate((valid) => {
if (valid) {
let params = {
"gameName": this.form.gameName,
"backgroudImgUrl": this.currentBg.imageUrl,
"backgroudImgFieldCode": this.currentBg.imgFieldCode,
"buttonImgUrl": this.currentBtn.imageUrl,
"buttonImgFieldCode": this.currentBtn.imgFieldCode,
"gameStartTime": formateDateTimeByType(this.form.dateTime[0],'yyyy-MM-dd-HH-mm-ss'),
"gameEndTime": formateDateTimeByType(this.form.dateTime[1],'yyyy-MM-dd-HH-mm-ss'),
"gameIntroduction": this.form.gameIntroduction,
"codeType": this.form.codeType,
"singleCode": this.form.singleCode,
"shareImgUrl": this.form.shareImg.imgUrl,
"shareImgFieldCode": this.form.shareImg.code,
"shareImgUrlWX": this.form.shareImg.wxImg,
"shareTitle": this.form.shareTitle,
"shareTextInfo": this.form.shareTextInfo,
"strategyIds": this.tableList.map(v => v.gamePrizeStrategyId).join(','),
"gameActivityId": this.$route.meta.type==="edit"? this.form.gameActivityId:'',
"activityCustom": {
"gameRuleTitleFontColor": this.form.gameRuleTitleFontColor,
"tipUrl": this.form.tipUrl,
"tipFontColor": this.form.tipFontColor,
"winRecordTitleFontColor": this.form.winRecordTitleFontColor,
"errorTipType": this.form.errorTipType,
"gameActivityCustomId": this.form.gameActivityCustomId, // get-game-klfl-edit编辑回显的 游戏自定义配置表主键ID
gameName: this.form.gameName,
backgroudImgUrl: this.currentBg.imageUrl,
backgroudImgFieldCode: this.currentBg.imgFieldCode,
buttonImgUrl: this.currentBtn.imageUrl,
buttonImgFieldCode: this.currentBtn.imgFieldCode,
gameStartTime: formateDateTimeByType(this.form.dateTime[0], 'yyyy-MM-dd-HH-mm-ss'),
gameEndTime: formateDateTimeByType(this.form.dateTime[1], 'yyyy-MM-dd-HH-mm-ss'),
gameIntroduction: this.form.gameIntroduction,
codeType: this.form.codeType,
singleCode: this.form.singleCode,
shareImgUrl: this.form.shareImg.imgUrl,
shareImgFieldCode: this.form.shareImg.code,
shareImgUrlWX: this.form.shareImg.wxImg,
shareTitle: this.form.shareTitle,
shareTextInfo: this.form.shareTextInfo,
strategyIds: this.tableList.map(v => v.gamePrizeStrategyId).join(','),
gameActivityId: this.$route.meta.type === "edit" ? this.form.gameActivityId : '',
activityCustom: {
gameRuleTitleFontColor: this.form.gameRuleTitleFontColor,
tipUrl: this.form.tipUrl,
tipFontColor: this.form.tipFontColor,
winRecordTitleFontColor: this.form.winRecordTitleFontColor,
errorTipType: this.form.errorTipType,
gameActivityCustomId: this.form.gameActivityCustomId, // get-game-klfl-edit编辑回显的 游戏自定义配置表主键ID
},
"tempActivityId": this.$route.meta.type==="add" ?this.form.gameActivityId:'' // 与上面新建不同, 这个没
tempActivityId: this.$route.meta.type === "add" ? this.form.gameActivityId : '' // 与上面新建不同, 这个没
}
let gameCodePrizeList = [];
this.prizeList.map((v,i) => {
if (v.prizeReferType == 1) { // 积分
......@@ -662,5 +659,5 @@ export default {
</script>
<style lang="scss" scoped>
@import './addEdit.scss';
@import './form.scss';
</style>
......@@ -253,7 +253,7 @@ export default {
projectName: '', // 当前项目名
sceneValue: 'member', // 场景值
useId: '', // 模板id
hasSearchData: `{"list":[{"type":"or","list":[{"type":"data","data":{"key":"authStatus","compute":"=","value":"1"}}]}],"type":"and"}`, // 当前页回显的数据(接口返回)
hasSearchData: '', // 当前页回显的数据(接口返回)
toggleTag: false, // 控制按钮显示的参数,仅供参考,可自行修改
getSaveData:'',
saveTag:false,
......@@ -426,6 +426,9 @@ export default {
this.$refs[formName].validate((valid) => {
if (valid) {
if (!this.isEdit) {
gameInfo.activityPuzzleId = '';
}
gameInfo.gameActivityId = this.form.gameActivityId || '';
gameInfo.gameName = this.form.gameName || '';
gameInfo.puzzleImgFieldCode = this.form.puzzleImg.code || '';
......
<template>
<el-dialog class="express dialog__body__nopadding" title="查看物流信息" :visible.sync="show" width="60%" :before-close="close">
<div class="express--info">
<p>收件人:{{info.clerkName || '--'}}</p>
<p>联系方式:{{info.consigneePhone || '--'}}</p>
<p>收货地址:{{info.receivingAddress || '--'}}</p>
</div>
<div class="express--order">
<div class="clearfix express--order__info" v-if="!editShow">
<div class="fl pr20">快递公司:{{info.logisticsCompanyName || '--'}}</div>
<div class="fl">运单号码:{{info.courierNumber || '--'}}</div>
<el-button class="fr express--order__info--btn" type="text" @click="editExpress">修改运单信息</el-button>
</div>
<div class="express--order__info" v-else>
<span class="pr10">快递公司:
<el-select class="vertical-middle w100" v-model="params.logisticsCompanyId" placeholder="选择快递">
<el-option v-for="v in logisticsOptions" :key="v.logisticsCompanyCode" :label="v.logisticsCompanyName" :value="v.logisticsCompanyId"></el-option>
</el-select>
</span>
<span>运单号码:
<el-input class="vertical-middle w150" v-model="params.courierNumber" placeholder="请输入快递单号"></el-input>
</span>
<el-button class="vertical-middle" type="primary" size="small" @click="submitExpress">确 认</el-button>
<el-button class="vertical-middle" size="small" @click="editShow = false">取 消</el-button>
</div>
</div>
<div class="express--list">
<div v-for="(v,i) in list" :key="i" class="express--list--item">
<span class="express--list--item__dot"></span>
<p class="express--list--item__date">{{v.date}}</p>
<p class="express--list--item__day">{{v.day}}</p>
<p class="express--list--item__time">{{v.time}}</p>
<p class="express--list--item__info">{{v.acceptStation}}</p>
</div>
<div class="no-data" v-if="list.length === 0">暂无快递数据</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="close">关 闭</el-button>
</span>
</el-dialog>
</template>
<script>
import {getLogisticsInfo,getLogisticsList,orderOptService} from '@/service/api/mallApi.js';
import {formateDateTimeByType,numberToWeekChinese} from '@/utils/index.js';
export default {
props:{
show:{
type:Boolean,
default:false
},
id:{
type:String,
default:''
}
},
watch:{
show(val) {
if (val) {
this.getLogisticsInfo();
}
}
},
data() {
return {
loading:false,
info:{},
list:[],
logisticsOptions:[],
params:{
logisticsCompanyId:'',
logisticsCompanyCode:'',
courierNumber:'',
},
editShow:false
}
},
created() {
this.getLogisticsList();
},
methods: {
close() {
this.editShow = false;
this.$emit('update:show',false);
},
editExpress() {
this.editShow = true;
this.params = {
logisticsCompanyId:this.info.logisticsCompanyId,
logisticsCompanyCode:this.info.logisticsCompanyCode,
courierNumber:this.info.courierNumber
};
},
submitExpress() {
if (!this.params.logisticsCompanyId) {
this.$tips({type:'warning',message:'请选择快递'});
return;
}
if (!this.params.courierNumber) {
this.$tips({type:'warning',message:'请填写快递单号'});
return;
}
this.logisticsOptions.map(v => {
if (v.logisticsCompanyId === this.params.logisticsCompanyId) {
this.params.logisticsCompanyCode = v.logisticsCompanyCode;
}
})
let params = {
optType:3,
integralMallProExchangeId:this.id,
logisticsCompanyId:this.params.logisticsCompanyId,
logisticsCompanyCode:this.params.logisticsCompanyCode,
courierNumber:this.params.courierNumber
};
orderOptService(params).then(res => {
if (res.errorCode === 0) {
this.$tips({type:'success',message:'修改快递信息成功'});
this.editShow = false;
this.getLogisticsInfo();
}
});
},
async getLogisticsList() {
let res = await getLogisticsList();
if (res.errorCode === 0) {
this.logisticsOptions = res.result || [];
}
},
async getLogisticsInfo() {
this.loading = true;
// let res = await getLogisticsInfo({integralMallProExchangeId:'ff80808161c2416c0161c66026d40007'});
let res = await getLogisticsInfo({integralMallProExchangeId:this.id});
if (res.errorCode === 0) {
this.info = res.result.changeLog || {};
this.list = res.result.traces || [];
this.list.map(v => {
const dateTime = new Date(v.acceptTime);
v.date = formateDateTimeByType(dateTime,'yyyy-MM-dd');
v.time = formateDateTimeByType(dateTime,'HH-mm-ss');
v.day = '周'+numberToWeekChinese(dateTime.getDay());
})
console.log(this.list)
}
this.loading = false;
console.log(res)
},
}
};
</script>
<style lang="scss" scoped>
.express{
&--info {
padding-bottom:10px;
border-bottom:1px solid #DCDFE6;
// border-top:1px solid #DCDFE6;
p {
line-height: 30px;
}
}
&--order {
padding:15px 0;
border-bottom:1px solid #DCDFE6;
&__info {
&--btn {
padding:0;
}
}
}
&--list {
background:#f0f2f5;
max-height: 250px;
overflow-y: auto;
padding:10px 0;
font-size: 13px;
&--item {
position: relative;
&::before {
content: ' ';
position: absolute;
left: 18px;
top: 0px;
height: 100%;
width: 1px;
background: #bfbfbf;
}
padding-left:15px;
display: table;
line-height: 25px;
p {
display: table-cell;
}
&__dot {
display:inline-block;
width: 7px;
height: 7px;
background: #bfbfbf;
border-radius: 50%;
margin-right: 10px;
}
&__date {
width: 80px;
}
&__day {
width: 40px;
}
&__time {
width: 80px;
}
&__info {
min-width: 100px;
}
}
}
}
</style>
<template slot-scope="scope">
<div>
<div v-if="!model[theType+'Flag']" @click="edit">
<span>{{model[theType]}}{{typeName}}</span> <i class="el-icon-edit cursor-hover"></i>
</div>
<div v-else >
<el-input-number class="w150" controls-position="right" :precision="0" v-model="model.inputValue" :min="0"></el-input-number>
<div class="pt10">
<el-button size="mini" type="primary" @click="submit">确 定</el-button>
<el-button size="mini" @click="model[theType+'Flag'] = false">取 消</el-button>
</div>
</div>
</div>
</template>
<script>
import { updateStockService, updateIntegralCostService,updateCashCostService } from '@/service/api/mallApi.js';
export default {
props: {
model: {
type: Object,
default() {
return {}
}
},
theType: String,
typeName: String
},
watch: {
},
methods:{
async submit() {
// try {
console.log(this.theType)
let res = null;
if (this.theType === 'virtualStock') { // 库存
res = await updateStockService({proId:this.model.integralMallProId,stock:this.model.inputValue});
} else if (this.theType === 'cashCost') { // 现金费用
res = await updateCashCostService({proId:this.model.integralMallProId,cost:this.model.inputValue});
} else if (this.theType === 'integralCost') { // 积分费用
res = await updateIntegralCostService({proId:this.model.integralMallProId,cost:this.model.inputValue});
}
if (res.errorCode === 0) {
this.$tips({type:'success',message: '更新成功'});
this.$emit('refresh');
} else {
this.$tips({type:'error',message: '更新失败'});
}
// } catch (err) {
// this.$tips({type:'error',message: '更新失败'});
// }
},
edit() {
this.model[this.theType + 'Flag'] = true;
this.model.inputValue = this.model[this.theType];
}
},
}
</script>
<template>
<section class="dm-wrap" v-loading="loading">
<div class="pb22 clearfix">
<el-date-picker class="w250" v-model="dateTime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="getPageExchangeLogsList"></el-date-picker>
<el-select class="vertical-middle w150" v-model="listParams.status" placeholder="选择领取状态" @change="getPageExchangeLogsList">
<el-option v-for="v in statusOptions" :key="v.value" :label="v.label" :value="v.value"></el-option>
</el-select>
<el-select class="vertical-middle w150" v-model="listParams.useStatus" placeholder="选择使用状态" @change="getPageExchangeLogsList">
<el-option v-for="v in useStatusOptions" :key="v.value" :label="v.label" :value="v.value"></el-option>
</el-select>
<el-input v-model="listParams.memberInfo" class="w300" placeholder="输入姓名/昵称/手机号" clearable @change="getPageExchangeLogsList"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-button type="primary" class="fr" icon="iconfont icon-icon_yunxiazai fz14" @click="exportExcel"> 导出列表</el-button>
</div>
<el-table tooltipEffect="light" :data="tableList" style="width: 100%">
<el-table-column v-for="(v,i) in tableHeader" :align="v.align" :key="i" :prop="v.prop" :label="v.label">
<template slot-scope="scope">
<span v-if="v.formatter" v-html="v.formatter(scope.row)"></span>
<span v-else>{{scope.row[v.prop]}}</span>
</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="[10, 20, 30, 40]" :page-size="listParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></el-pagination>
</section>
</template>
<script>
import {getPageExchangeLogsList,exportExchangeListExcel} from '@/service/api/mallApi.js';
import {formateDateTimeByType} from '@/utils/index.js';
export default {
data() {
let _vm = this;
return {
loading:false,
tableHeader:[
{label:'兑换时间',prop:'createTime',minWidth:'170',align:'left',formatter(row){
return formateDateTimeByType(row.createTime,'yyyy-MM-dd-HH-mm-ss');
}},
{label:'流水号',prop:'definedCode',minWidth:'100',align:'left'},
{label:'会员信息',prop:'issuingQuantity',minWidth:'170',align:'left',formatter(row){
return `<a href="/member/#/wechatmemberDetail?memberId=${row.memberId}" target="_blank">
<img class="vertical-middle table__avatar--40" src="${row.photoUrl}" width="60" height="60" alt="" srcset="">
<div class="inline-block vertical-middle">
<p class="table-name--ellipsis">${row.memberName || '--'}</p>
<p class="table-name--ellipsis fz13">${row.cardNum || '--'}</p>
</div>
</a>`;
}},
{label:'消耗积分',prop:'payCost',width:'80',align:'left'},
{label:'领取状态',prop:'status',width:'100',align:'left',formatter(row){
let statusLabel ='--';
_vm.statusOptions.map(v => {
if (row.status === v.value) {
statusLabel = v.label
}
});
return statusLabel;
}},
{label:'使用状态',prop:'useStatus',width:'100',align:'left',formatter(row){
return row.useStatus === 5?'已使用':'未使用';
}},
],
total:0,
statusOptions:[{label:'所有领取状态',value:-1},{label:'兑换取消(礼品)',value:0},{label:'兑换',value:1},{label:'领取(卡券)',value:2},{label:'已发货(礼品)',value:3}],
useStatusOptions:[{label:'所有使用状态',value:-1},{label:'已使用',value:5},{label:'未使用',value:0}],
listParams:{
pageSize: 20,
currentPage: 1,
status: -1,
useStatus: -1,
memberInfo: "",
integralMallProId: this.$route.params.id,
beginTime: "",
endTime: ""
},
dateTime:['',''],
tableList:[]
};
},
created() {
this.$store.commit('mutations_breadcrumb',[{name:'积分商城'},{name:'优惠券',path:'/mall/coupon'},{name:'优惠券兑换记录',path:''}]);
this.getPageExchangeLogsList();
},
methods: {
handleSizeChange(val) {
this.listParams.pageSize = val;
this.getPageExchangeLogsList();
},
handleCurrentChange(val) {
this.listParams.currentPage = val;
this.getPageExchangeLogsList();
},
async getPageExchangeLogsList() {
this.loading = true;
if (this.dateTime) {
this.listParams.beginTime = formateDateTimeByType(this.dateTime[0],'yyyy-MM-dd');
this.listParams.endTime = formateDateTimeByType(this.dateTime[1],'yyyy-MM-dd');
} else {
this.listParams.beginTime = this.listParams.senendTimedEndTime = '';
}
let res = await getPageExchangeLogsList(this.listParams);
this.tableList = res.result.rows || [];
this.total = res.result.total || 0;
this.loading = false;
},
// 导出列表
exportExcel(){
if (this.dateTime) {
this.listParams.beginTime = formateDateTimeByType(this.dateTime[0],'yyyy-MM-dd');
this.listParams.endTime = formateDateTimeByType(this.dateTime[1],'yyyy-MM-dd');
} else {
this.listParams.beginTime = this.listParams.senendTimedEndTime = '';
}
if (!this.listParams.beginTime || !this.listParams.endTime) {
this.$tips({type: 'warning',message: '时间不能为空'});
return;
}
window.location = `${exportExchangeListExcel}?integralMallProId=${this.listParams.integralMallProId}&status=${this.listParams.status}&useStatus=${this.listParams.useStatus}&memberInfo=${this.listParams.memberInfo}&beginTime=${this.listParams.beginTime}&endTime=${this.listParams.endTime}&requestProject=marketing`;
},
}
};
</script>
import {getGradeList,getCategoryList,createIntegralProService,getIntegralMallProInfo,createCategoryService} from '@/service/api/mallApi.js';
import cardTemp from '@/components/libs/cardTemp';
import dmUploadAvatar from '@/components/upload/avatar';
import {formateDateTimeByType} from '@/utils/index.js';
export default {
components:{
cardTemp,
dmUploadAvatar
},
data() {
return {
form:{
integralMallProId:'',
proReferId:'',
proName:'', // String 商品名字,优惠券就是所选券的名字。 (必填)
integralCost:100, // Number 100 积分费用 (必填)
cashCost:1, // Number 现金费用,两位小数
memberGradeArr:[], // array 适用会员 这里是数组 传给后台要拼接为字符串数组逗号隔开
limitTimes:0,
exchangeDateType:1,
exchangeTimeType:1, // 兑换时间类型 1:全部 2:部分时段
proShowStatus:1,
releaseType:1,
exchangeFixDate:['',''], // exchangeFixDateBegin // exchangeFixDateEnd,
exchangeDateDayArr:[],
exchangeDateWeekArr:[],
limitTimeBegin:'',
virtualStock:0,
weChatVirtualStock:0
},
rules:{
integralCost:{required:true,type:'number',min:0,message:'请输入积分费用',trigger:'blur'},
cashCost:{required:true,type:'number',min:0,message:'请输入现金费用',trigger:'blur'},
memberGradeArr:{required:true,type:'array',min:0,message:'请选择适用会员',trigger:'blur'},
},
memberGradeOptions:[],
exchangeDateWeekOptions:['1','2','3','4','5','6','7'],
monthOptions:Array.from(Array(31), (v,k) =>(k+1).toString()),
sendChildData:{
storeType:0,
storeGroupIds:'',
storeIds:[],
},
timeRangeList:[{}],
isLimitTimes:false,
isAdd: this.$route.meta.type === 'add',
isEdit: this.$route.meta.type === 'edit',
isInfo: this.$route.meta.type === 'info',
}
},
created () {
this.getGradeList();
// 解决响应式问题
if (!this.timeRangeList) {
this.$set(this.timeRangeList,0,{timeRange:['','']})
}
if (this.isEdit || this.isInfo) {
this.getIntegralMallProInfo();
}
},
computed:{
asideShow() {
return this.$store.state.marketing.asideShow
}
},
watch:{
'form.limitTimes'(val) {
this.isLimitTimes = (val > 0);
},
},
methods:{
async getIntegralMallProInfo() {
let res = await getIntegralMallProInfo({integralMallProId:this.$route.params.id});
if (res.errorCode === 0) {
const result = res.result;
this.form.integralMallProId = result.integralMallProId || '';
this.form.proReferId = result.proReferId || '';
this.form.proName = result.proName || '';
this.form.virtualStock = result.virtualStock || 0;
this.form.integralCost = result.integralCost || 0;
this.form.cashCost = result.cashCost || 0;
this.form.memberGradeArr = result.memberGrade?result.memberGrade.split(','):[];
this.form.limitTimes = result.limitTimes || 0;
this.form.exchangeDateType = result.exchangeDateType || 1;
this.form.exchangeTimeType = result.exchangeTimeType || 1;
this.form.proShowStatus = result.proShowStatus || 1;
this.form.releaseType = result.releaseType || 1;
this.form.exchangeFixDate = [result.exchangeFixDateBegin || '',result.exchangeFixDateEnd || ''];
this.form.exchangeDateDayArr = result.exchangeDateDay ? result.exchangeDateDay.split(',') : [];
this.form.exchangeDateWeekArr = result.exchangeDateWeek ? result.exchangeDateWeek.split(',').filter(v => v) : [];
this.form.limitTimeBegin = result.limitTimeBegin || '';
// result.showStore = 2;
this.sendChildData.storeType = result.showStore || 0;
if (result.showStore === 1) {
this.sendChildData.storeGroupIds = result.storeGroupIds || '';
} else if (result.showStore === 2) {
let list = [];
if (result.storeInfo.length) {
result.storeInfo.map(v => {
list.push(v);
})
}
this.sendChildData.storeIds = list;
}
console.log(this.sendChildData)
if (this.form.exchangeTimeType === 2 && result.timeZones) {
let list = result.timeZones.split('#').filter(v => v);
list.map((v,i)=> {
let arr = v.split('-');
this.$set(this.timeRangeList,i,{timeRange:[arr[0],arr[1]]})
});
}
}
},
//门店分组回执方法
getSelectGroupData(val) {
console.log(val);
this.sendChildData.storeType = val.storeType || 0
this.sendChildData.storeGroupIds = val.storeGroupIds || ''
this.sendChildData.storeIds = val.storeIds || []
},
async getGradeList() {
let res = await getGradeList();
if (res.errorCode === 0) {
this.memberGradeOptions = res.result || [];
}
console.log(res);
},
// 获取卡券组件回调的对象
getCardActiveObjFun(val) {
console.log(val)
if (val.coupCardId) {
this.form.virtualStock = val.couponStock || 0;
this.form.proReferId = val.coupCardId || '';
this.form.proName = val.cardName || '';
}
},
addTimeRange() {
let length = this.timeRangeList.length;
this.$set(this.timeRangeList,length,{timeRange:['','']})
},
delTimeRange(index) {
this.timeRangeList.splice(index,1);
},
submit() {
if (!this.form.proReferId ) {
this.$tips({type:'warning',message:'请选择优惠券'});
return;
}
console.log(this.timeRangeList)
let params = {
integralMallProId:this.form.integralMallProId || '',
proType:1, // 商品类型 1 优惠券,2礼品,3实物
proName:this.form.proName || '', // 商品名字,优惠券就是所选券的名字。
proReferId:this.form.proReferId || '', // 关联的卡券或者礼品
proShowStatus:this.form.proShowStatus || 1, // 商品显示状态 1:上架状态就显示 2:兑换状态下显示
integralCost:this.form.integralCost || 0,// 积分费用
cashCost:this.form.cashCost || 0, // 现金费用,两位小数
costValue:this.form.costValue || 0,
limitTimes:this.form.limitTimes,// 次数限制
memberGrade:this.form.memberGradeArr.length?this.form.memberGradeArr.join(','):'', // 适用会员,多个,逗号拼接。
exchangeDateType:this.form.exchangeDateType || 1, // 兑换日期1:全部 2:固定日期 3:每月 4:每周
exchangeTimeType:this.form.exchangeTimeType || 1, // 兑换时间类型 1:全部 2:部分时段
releaseType:this.form.releaseType || 1, // 布发状态 1立即 2定时
showStore:this.sendChildData.storeType || 0, // 显示门店 0所有 1部分分组 2部分门店
virtualStock: this.form.virtualStock || 0, //库存
}
// 判断 兑换日期
if (params.exchangeDateType === 2) {
if (this.form.exchangeFixDate) {
params.exchangeFixDateBegin = formateDateTimeByType(this.form.exchangeFixDate[0],'yyyy-MM-dd-HH-mm-ss');
params.exchangeFixDateEnd = formateDateTimeByType(this.form.exchangeFixDate[1],'yyyy-MM-dd-HH-mm-ss');
} else {
this.$tips({type:'warning',message:'兑换固定日期不能为空'});
return;
}
} else if (params.exchangeDateType === 3) {
params.exchangeDateDay = this.form.exchangeDateDayArr.length > 0 ? this.form.exchangeDateDayArr.join(','):'';
} else if (params.exchangeDateType === 4) {
params.exchangeDateWeek = this.form.exchangeDateWeekArr.length > 0 ? this.form.exchangeDateWeekArr.join(','):'';
}
// 判断 兑换时段
if (params.exchangeTimeType === 2) {
let list = [];
let flag = false;
this.timeRangeList.forEach(v => {
if (!v.timeRange || !v.timeRange[0]) {
flag = true;
} else {
list.push(v.timeRange[0]+'-'+v.timeRange[1]);
}
})
if (flag) {
this.$tips({message:'部分时段未填写完整'});
return;
}
// 如果数组为1的话也要传 #分割
if (list.length === 1) {
params.timeZones = list[0] +'#';
} else {
params.timeZones = list.length?list.join('#'):'';
}
}
// 判断发送时间
if (params.releaseType === 2) {
params.limitTimeBegin = formateDateTimeByType(this.form.limitTimeBegin,'yyyy-MM-dd-HH-mm-ss');
}
// 门店分组
if (this.sendChildData.storeType === 1) {
if (this.sendChildData.storeGroupIds) {
params.storeGroupIds = this.sendChildData.storeGroupIds || '';
}
} else if (this.sendChildData.storeType === 2){
if (this.sendChildData.storeIds) {
params.storeIds = this.sendChildData.storeIds.map(v => v.storeId).join(',');
} else {
params.storeIds ='';
}
}
console.log(params)
createIntegralProService(params).then(res => {
if(res.errorCode === 0) {
this.$router.push('/mall/coupon');
this.$tips({type:'success',message:'操作成功'});
} else {
this.$tips({type:'error',message:'操作失败'});
}
console.log(res);
}).catch(err => {
this.$tips({type:'error',message:'操作失败'});
})
}
}
};
<template>
<el-form class="dm-wrap" :model="form" ref="form" :rules="rules" label-width="120px">
<div class="border-radius2" style="padding:15px;margin-bottom:20px;">
<cardTemp pbSize="pb15" :activeId.sync="form.proReferId" @emitActiveObj="getCardActiveObjFun" :showPagination="false" :cardLimitType="3"></cardTemp>
</div>
<el-form-item prop="integralCost" label="积分费用">
<el-input-number controls-position="right" :disabled="isInfo" v-model="form.integralCost" class="w300" :precison="0" :min="0"></el-input-number>
</el-form-item>
<el-form-item prop="cashCost" label="现金费用">
<el-input-number controls-position="right" :disabled="isInfo" v-model="form.cashCost" class="w300" :precison="2" :min="0"></el-input-number>
</el-form-item>
<el-form-item prop="limitTimes" label="次数显示">
<el-checkbox :disabled="isInfo" v-model="isLimitTimes"> 每个会员限制兑换
</el-checkbox>
<el-input-number controls-position="right" :disabled="isInfo || !isLimitTimes" v-model="form.limitTimes" class="w100" :precison="0" :min="0"></el-input-number>
</el-form-item>
<el-form-item prop="memberGradeArr" label="适用会员">
<el-select v-model="form.memberGradeArr" multiple placeholder="请选择" class="w300">
<el-option v-for="item in memberGradeOptions" :key="item.gradeId" :label="item.gradeName" :value="item.gradeId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="展现门店" class="is-required">
<vue-gic-store-linkage :disabled="isInfo" :msg="sendChildData" ref="selectTree" @sendSelectGroupData="getSelectGroupData"></vue-gic-store-linkage>
</el-form-item>
<el-form-item prop="exchangeDateType" label="兑换日期" class="is-required">
<el-radio-group v-model="form.exchangeDateType" style="line-height:inherit;">
<div class="mb10"><el-radio :label="1">全部日期</el-radio></div>
<div class="mb10"><el-radio :label="2">固定日期
<el-date-picker v-model="form.exchangeFixDate" :disabled="form.exchangeDateType !== 2" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-radio></div>
<div class="mb10"><el-radio :label="3">每月
<el-select v-model="form.exchangeDateDayArr" :disabled="form.exchangeDateType !== 3" multiple filterable default-first-option placeholder="请选择">
<el-option v-for="item in monthOptions" :key="item" :label="item" :value="item"></el-option>
</el-select>
</el-radio></div>
<div class="mb10"><el-radio :label="4">每周
<el-select v-model="form.exchangeDateWeekArr" :disabled="form.exchangeDateType !== 4" multiple placeholder="请选择">
<el-option v-for="item in exchangeDateWeekOptions" :key="item" :label="item" :value="item"></el-option>
</el-select>
</el-radio></div>
</el-radio-group>
</el-form-item>
<el-form-item prop="exchangeTimeType" label="兑换时段" class="is-required">
<el-radio-group v-model="form.exchangeTimeType">
<div class="mb10"><el-radio :label="1">全部时段</el-radio></div>
<div class="mb10">
<el-radio :label="2" class="vertical-middle">部分时段</el-radio>
<span class="gray fz13 vertical-top ml20">请使用24小时制输入时间,格式如11:00至14:30</span>
</div>
<p v-for="(v,i) in timeRangeList" :key="i" class="pb10">
<el-time-picker :disabled="form.exchangeTimeType === 1" class="vertical-middle w250" is-range v-model="v.timeRange" value-format="HH:mm" format="HH:mm" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
<el-button class="vertical-middle" type="text" @click="delTimeRange(i)">删除</el-button>
</p>
<p><el-button type="text" @click="addTimeRange">添加时间段</el-button></p>
</el-radio-group>
</el-form-item>
<el-form-item prop="proShowStatus" label="显示状态">
<el-radio-group v-model="form.proShowStatus">
<el-radio :label="1">上架状态就显示</el-radio>
<el-radio :label="2">兑换状态下显示</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="releaseType" label="发布时间">
<el-radio-group v-model="form.releaseType">
<el-radio :label="1">立即发布</el-radio>
<el-radio :label="2">定时发布
<el-date-picker v-model="form.limitTimeBegin" type="datetime" placeholder="选择日期时间"></el-date-picker>
</el-radio>
</el-radio-group>
</el-form-item>
<div class="btn-wrap_fixed" :class="{'on':asideShow}">
<el-button type="primary" @click="submit('form')" v-if="!isInfo">{{isAdd?'确认新增':'确认编辑'}}</el-button>
<el-button @click="$router.go(-1)">返 回</el-button>
</div>
</el-form>
</template>
<script>
import infojs from './info.js';
export default infojs;
</script>
<template>
<section class="dm-wrap">
<div class="pb22 clearfix">
<el-button class="fr" type="primary" @click="$router.push('/mall/coupon/info')">新增优惠券</el-button>
</div>
<el-table tooltipEffect="light" :data="tableList" style="width: 100%" v-loading="loading">
<el-table-column label="商品" align="left" prop="timesStatus" min-width="140">
<template slot-scope="scope">
<div class="ellipsis-100" >
<img class="vertical-middle table__avatar--40" :src="filterAvatar(scope.row.cardType)" width="60" height="60" />
<div class="inline-block vertical-middle">
<p class="table-name--ellipsis">{{scope.row.proTitle || '--'}}</p>
<p class="fz13 gray">{{scope.row.proSubTitle || '--'}}</p>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="积分费用" align="left" prop="integralCost" width="180">
<template slot-scope="scope">
<updateCount :model="scope.row" theType="integralCost" typeName="积分" @refresh="getPageCardsList"></updateCount>
</template>
</el-table-column>
<el-table-column label="现金费用" align="left" prop="cashCost" width="180">
<template slot-scope="scope">
<updateCount :model="scope.row" theType="cashCost" typeName="元" @refresh="getPageCardsList"></updateCount>
</template>
</el-table-column>
<el-table-column label="库存" align="left" prop="virtualStock" width="180">
<template slot-scope="scope">
<updateCount :model="scope.row" theType="virtualStock" @refresh="getPageCardsList"></updateCount>
</template>
</el-table-column>
<el-table-column label="兑换次数" align="left" prop="allExchangeNumber" width="80">
<template slot-scope="scope">
<span @click="$router.push('/mall/coupon/exchange/'+scope.row.integralMallProId)" class="blue">{{scope.row.allExchangeNumber}}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="left" prop="status" width="80px">
<template slot-scope="scope" >
<span v-if="scope.row.status == 0" class="dm-status--error">删除</span>
<span v-if="scope.row.status == 1" class="dm-status--primary">正常</span>
<span v-if="scope.row.status == 2" class="dm-status--warning">上架</span>
</template>
</el-table-column>
<el-table-column label="显示状态" align="left" prop="proShowStatus" width="120">
<template slot-scope="scope" >
<span v-if="scope.row.proShowStatus == 1">上架状态就显示</span>
<span v-if="scope.row.proShowStatus == 2">兑换状态下显示</span>
</template>
</el-table-column>
<el-table-column label="操作" align="left" width="140px">
<template slot-scope="scope">
<el-button type="text" @click="$router.push('/mall/coupon/info/'+scope.row.integralMallProId)">编辑</el-button>
<dm-delete @confirm="delData(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="[10, 20, 30, 40]" :page-size="listParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></el-pagination>
</section>
</template>
<script>
import { getPageCardsList, deleteProService } from '@/service/api/mallApi.js';
import updateCount from '../common/update-count';
import {formateDateTimeByType} from '@/utils/index.js';
export default {
name: 'coupon-list',
components: {
updateCount
},
data () {
return {
defaultAvatar:require('../../../assets/img/head_default.png'),
daijinAvatar:require('../../../assets/img/credit_daijin_icon.png'),
zhekouAvatar:require('../../../assets/img/credit_zhekou_icon.png'),
duihuanAvatar:require('../../../assets/img/head_default.png'),
loading:false,
tableList:[],
listParams:{
currentPage:1,
pageSize:20
},
total:0
}
},
created() {
this.$store.commit('mutations_breadcrumb',[{name:'积分商城'},{name:'优惠券',path:''}]);
this.getPageCardsList();
},
methods: {
filterAvatar(val){
return (val === 0 ? this.daijinAvatar : (val === 1 ? this.zhekouAvatar: this.duihuanAvatar));
},
search() {
this.listParams.currentPage = 1;
this.getPageCardsList();
},
handleSizeChange(val) {
this.listParams.pageSize = val;
this.getPageCardsList();
},
handleCurrentChange(val) {
this.listParams.currentPage = val;
this.getPageCardsList();
},
async getPageCardsList() {
this.loading = true;
let res = await getPageCardsList(this.listParams);
this.tableList = [];
let result = res.result.rows || [];
result.map(v => {
v.integralCostFlag = false;
v.cashCostFlag = false;
v.virtualStockFlag = false;
v.allExchangeNumberFlag = false;
this.tableList.push(v);
})
this.total = res.result.total;
this.loading = false;
},
// 删除
delData(row) {
deleteProService({proId:row.integralMallProId}).then(res => {
this.$tips({type: 'success',message: '删除成功!'});
this.getPageCardsList();
}).catch(err => {
this.$tips({type: 'error',message: '删除失败!'});
})
}
}
}
</script>
<template>
<section class="dm-wrap" v-loading="loading">
<div class="pb22 clearfix">
<el-date-picker class="w250" v-model="dateTime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="getPageExchangeLogsList"></el-date-picker>
<el-select class="vertical-middle w150" v-model="listParams.status" placeholder="选择状态" @change="getPageExchangeLogsList">
<el-option v-for="v in statusOptions" :key="v.value" :label="v.label" :value="v.value"></el-option>
</el-select>
<el-input v-model="listParams.memberInfo" class="w300" placeholder="输入流水号/姓名/会员卡号" clearable @change="getPageExchangeLogsList"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-button type="primary" class="fr" icon="iconfont icon-icon_yunxiazai fz14" @click="exportExcel"> 导出列表</el-button>
</div>
<el-table tooltipEffect="light" :data="tableList" style="width: 100%">
<el-table-column v-for="(v,i) in tableHeader" :align="v.align" :key="i" :prop="v.prop" :label="v.label">
<template slot-scope="scope">
<span v-if="v.formatter" v-html="v.formatter(scope.row)"></span>
<span v-else>{{scope.row[v.prop]}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="left" width="100px">
<template slot-scope="scope">
<p v-if="isWxExchange">
<span type="text">{{scope.row.useStatus === 5?'已使用':'未使用'}}</span>
</p>
<p>
<el-button type="text" v-if="scope.row.status !== 1 && !isWxExchange" @click="queryExpress(scope.row)">查看物流</el-button>
<el-button type="text" v-if="isWxExchange">
<a :href="'/member/#/wechatmemberDetail?memberId='+scope.row.memberId">查看详情</a>
</el-button>
<span type="text" v-else>--</span>
</p>
</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="[10, 20, 30, 40]" :page-size="listParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></el-pagination>
<express :show.sync="expressShow" :id="expressId"></express>
</section>
</template>
<script>
import {getPageExchangeLogsList,exportExchangeListExcel} from '@/service/api/mallApi.js';
import {formateDateTimeByType} from '@/utils/index.js';
import express from '../common/express';
export default {
components: {
express
},
data() {
let _vm = this;
return {
loading:false,
defaultAvatar:require('../../../assets/img/head_default.png'),
tableHeader:[
{label:'兑换时间',prop:'createTime',minWidth:'170',align:'left',formatter(row){
return formateDateTimeByType(row.createTime,'yyyy-MM-dd-HH-mm-ss');
}},
{label:'流水号',prop:'definedCode',minWidth:'100',align:'left'},
{label:'会员信息',prop:'issuingQuantity',minWidth:'170',align:'left',formatter(row){
const photoUrl = row.photoUrl.match(/^http(s)?/) ? row.photoUrl : _vm.defaultAvatar;
return `<a href="/member/#/wechatmemberDetail?memberId=${row.memberId}" target="_blank">
<img class="vertical-middle table__avatar--40" src="${photoUrl}" width="60" height="60" alt="" srcset="">
<div class="inline-block vertical-middle">
<p class="table-name--ellipsis">${row.memberName || '--'}</p>
<p class="table-name--ellipsis fz13">${row.cardNum || '--'}</p>
</div>
</a>`;
}},
{label:'消耗积分',prop:'payCost',width:'80',align:'left'},
{label:'状态',prop:'status',width:'100',align:'left',formatter(row){
if (_vm.isWxExchange) {
return row.status === 1?'待领取':'已领取';
} else {
return row.status === 1?'待发货':'已发货';
}
}},
],
total:0,
statusOptions:[{label:'所有状态',value:-1},{label:'待发货',value:1},{label:'已发货',value:3}],
listParams:{
pageSize: 20,
currentPage: 1,
status: -1,
useStatus: -1,
memberInfo: "",
integralMallProId: this.$route.params.id,
beginTime: "",
endTime: ""
},
dateTime:['',''],
tableList:[],
expressId:'',
expressShow:false,
isWxExchange:this.$route.meta.type === 'wx'
};
},
created() {
if (this.isWxExchange) {
this.$store.commit('mutations_breadcrumb',[{name:'积分商城'},{name:'礼品',path:'/mall/gift'},{name:'微信兑换券兑换记录',path:''}]);
} else {
this.$store.commit('mutations_breadcrumb',[{name:'积分商城'},{name:'礼品',path:'/mall/gift'},{name:'礼品兑换记录',path:''}]);
}
this.getPageExchangeLogsList();
},
methods: {
handleSizeChange(val) {
this.listParams.pageSize = val;
this.getPageExchangeLogsList();
},
handleCurrentChange(val) {
this.listParams.currentPage = val;
this.getPageExchangeLogsList();
},
async getPageExchangeLogsList() {
this.loading = true;
if (this.dateTime) {
this.listParams.beginTime = formateDateTimeByType(this.dateTime[0],'yyyy-MM-dd');
this.listParams.endTime = formateDateTimeByType(this.dateTime[1],'yyyy-MM-dd');
} else {
this.listParams.beginTime = this.listParams.senendTimedEndTime = '';
}
let res = await getPageExchangeLogsList(this.listParams);
this.tableList = res.result.rows || [];
this.total = res.result.total || 0;
this.loading = false;
},
// 导出列表
exportExcel(){
if (this.dateTime) {
this.listParams.beginTime = formateDateTimeByType(this.dateTime[0],'yyyy-MM-dd');
this.listParams.endTime = formateDateTimeByType(this.dateTime[1],'yyyy-MM-dd');
} else {
this.listParams.beginTime = this.listParams.senendTimedEndTime = '';
}
if (!this.listParams.beginTime || !this.listParams.endTime) {
this.$tips({type: 'warning',message: '时间不能为空'});
return;
}
window.location = `${exportExchangeListExcel}?integralMallProId=${this.listParams.integralMallProId}&status=${this.listParams.status}&useStatus=${this.listParams.useStatus}&memberInfo=${this.listParams.memberInfo}&beginTime=${this.listParams.beginTime}&endTime=${this.listParams.endTime}&requestProject=marketing`;
},
queryExpress(row) {
this.expressShow = true;
this.expressId = row.integralMallProExchangeId;
}
}
};
</script>
<template>
<el-form class="dm-wrap" :model="form" ref="form" :rules="rules" label-width="120px">
<el-form-item prop="proName" label="礼品标题">
<el-input controls-position="right" placeholder="请输入礼品标题" :disabled="isInfo" v-model="form.proName" class="w300"></el-input>
</el-form-item>
<el-form-item label="礼品主图" class="is-required">
<dm-upload-avatar :model.sync="form.giftImg" label="上传图片" tips="规格750*750,大小≤1M"></dm-upload-avatar>
</el-form-item>
<el-form-item prop="proCategoryId" label="礼品分组">
<el-select v-model="form.proCategoryId" placeholder="请选择" class="w300">
<el-option v-for="(v,i) in categoryOptions" :key="i" :label="v.categoryName" :value="v.integralMallCategoryId"></el-option>
</el-select>
<el-button type="text" @click="createNewGroup">新建分组</el-button>
</el-form-item>
<el-form-item prop="integralCost" label="积分费用">
<el-input-number controls-position="right" :disabled="isInfo" v-model="form.integralCost" class="w300" :precison="0" :min="0"></el-input-number>
</el-form-item>
<el-form-item prop="cashCost" label="现金费用">
<el-input-number controls-position="right" :disabled="isInfo" v-model="form.cashCost" class="w300" :precison="2" :min="0"></el-input-number>
</el-form-item>
<el-form-item prop="costValue" label="礼品成本">
<el-input-number controls-position="right" :disabled="isInfo" v-model="form.costValue" class="w300" :precison="2" :min="form.cashCost"></el-input-number>
</el-form-item>
<el-form-item prop="limitTimes" label="次数显示">
<el-checkbox :disabled="isInfo" v-model="isLimitTimes"> 每个会员限制兑换
</el-checkbox>
<el-input-number controls-position="right" :disabled="isInfo || !isLimitTimes" v-model="form.limitTimes" class="w100" :precison="0" :min="0"></el-input-number>
</el-form-item>
<el-form-item prop="memberGradeArr" label="适用会员">
<el-select v-model="form.memberGradeArr" multiple placeholder="请选择" class="w300">
<el-option v-for="item in memberGradeOptions" :key="item.gradeId" :label="item.gradeName" :value="item.gradeId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="展现门店" class="is-required">
<vue-gic-store-linkage :disabled="isInfo" :msg="sendChildData" ref="selectTree" @sendSelectGroupData="getSelectGroupData"></vue-gic-store-linkage>
</el-form-item>
<el-form-item prop="exchangeDateType" label="兑换日期" class="is-required">
<el-radio-group v-model="form.exchangeDateType" style="line-height:inherit;">
<div class="mb10"><el-radio :label="1">全部日期</el-radio></div>
<div class="mb10"><el-radio :label="2">固定日期
<el-date-picker v-model="form.exchangeFixDate" :disabled="form.exchangeDateType !== 2" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-radio></div>
<div class="mb10"><el-radio :label="3">每月
<el-select v-model="form.exchangeDateDayArr" :disabled="form.exchangeDateType !== 3" multiple filterable default-first-option placeholder="请选择">
<el-option v-for="item in monthOptions" :key="item" :label="item" :value="item"></el-option>
</el-select>
</el-radio></div>
<div class="mb10"><el-radio :label="4">每周
<el-select v-model="form.exchangeDateWeekArr" :disabled="form.exchangeDateType !== 4" multiple placeholder="请选择">
<el-option v-for="item in exchangeDateWeekOptions" :key="item" :label="item" :value="item"></el-option>
</el-select>
</el-radio></div>
</el-radio-group>
</el-form-item>
<el-form-item prop="exchangeTimeType" label="兑换时段" class="is-required">
<el-radio-group v-model="form.exchangeTimeType">
<div class="mb10"><el-radio :label="1">全部时段</el-radio></div>
<div class="mb10">
<el-radio :label="2" class="vertical-middle">部分时段</el-radio>
<span class="gray fz13 vertical-top ml20">请使用24小时制输入时间,格式如11:00至14:30</span>
</div>
<p v-for="(v,i) in timeRangeList" :key="i" class="pb10">
<el-time-picker :disabled="form.exchangeTimeType === 1" class="vertical-middle w250" is-range v-model="v.timeRange" value-format="HH:mm" format="HH:mm" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
<el-button class="vertical-middle" type="text" @click="delTimeRange(i)">删除</el-button>
</p>
<p><el-button type="text" @click="addTimeRange">添加时间段</el-button></p>
</el-radio-group>
</el-form-item>
<el-form-item prop="proShowStatus" label="显示状态">
<el-radio-group v-model="form.proShowStatus">
<el-radio :label="1">上架状态就显示</el-radio>
<el-radio :label="2">兑换状态下显示</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="releaseType" label="发布时间">
<el-radio-group v-model="form.releaseType">
<el-radio :label="1">立即发布</el-radio>
<el-radio :label="2">定时发布
<el-date-picker v-model="form.limitTimeBegin" type="datetime" placeholder="选择日期时间"></el-date-picker>
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="changeType" label="兑换方式">
<el-radio-group v-model="form.changeType">
<div class="mb10">
<el-radio :label="2">快递发货,库存
<el-input-number controls-position="right" v-show="form.changeType === 2" v-model="form.virtualStock" class="w150 vertical-middle" :precison="0" :min="0"></el-input-number>
</el-radio>
</div>
<div class="mb10">
<el-radio :label="3">在线发货,库存
<el-input-number controls-position="right" v-show="form.changeType === 3" v-model="form.virtualStock" class="w150 vertical-middle" :precison="0" :min="0"></el-input-number>
</el-radio>
</div>
<div class="mb10">
<el-radio :label="1" class="vertical-middle">微信兑换券</el-radio>
<span class="gray ml20 fz13 vertical-top">礼品成本金额以选择兑换券的成本金额为准</span>
</div>
</el-radio-group>
</el-form-item>
<div v-show="form.changeType === 1" class="border-radius2" style="padding:15px;margin-bottom:20px;">
<cardTemp pbSize="pb15" :activeId.sync="form.proReferId" @emitActiveObj="getCardActiveObjFun" :showPagination="false" :cardLimitType="3"></cardTemp>
</div>
<div class="btn-wrap_fixed" :class="{'on':asideShow}">
<el-button type="primary" @click="submit('form')" v-if="!isInfo">{{isAdd?'确认新增':'确认编辑'}}</el-button>
<el-button @click="$router.go(-1)">返 回</el-button>
</div>
</el-form>
</template>
<script>
import infojs from './info.js';
export default infojs;
</script>
<template>
<el-dialog class="express dialog__body__nopadding" title="查看物流信息" :visible.sync="show" width="40%" :before-close="close">
<div class="express--info">
<p>收件人:{{info.clerkName || '--'}}</p>
<p>联系方式:{{info.consigneePhone || '--'}}</p>
<p>收货地址:{{info.receivingAddress || '--'}}</p>
<p class="pb10">快递公司:<el-select class="vertical-middle w300" v-model="params.logisticsCompanyId" placeholder="选择快递">
<el-option v-for="v in logisticsOptions" :key="v.logisticsCompanyCode" :label="v.logisticsCompanyName" :value="v.logisticsCompanyId"></el-option>
</el-select>
</p>
<p>运单号码:<el-input class="vertical-middle w300" v-model="params.courierNumber" placeholder="请输入快递单号"></el-input></p>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submit">确 定</el-button>
<el-button @click="close">关 闭</el-button>
</span>
</el-dialog>
</template>
<script>
import {getLogisticsInfo,getLogisticsList,orderOptService} from '@/service/api/mallApi.js';
export default {
props:{
show:{
type:Boolean,
default:false
},
id:{
type:String,
default:''
}
},
watch:{
show(val) {
if (val) {
this.getLogisticsInfo();
}
}
},
data() {
return {
loading:false,
info:{},
logisticsOptions:[],
params:{
logisticsCompanyId:'',
logisticsCompanyCode:'',
courierNumber:'',
},
}
},
created() {
this.getLogisticsList();
},
methods: {
close() {
this.$emit('update:show',false);
},
submit() {
if (!this.params.logisticsCompanyId) {
this.$tips({type:'warning',message:'请选择快递'});
return;
}
if (!this.params.courierNumber) {
this.$tips({type:'warning',message:'请填写快递单号'});
return;
}
this.logisticsOptions.map(v => {
if (v.logisticsCompanyId === this.params.logisticsCompanyId) {
this.params.logisticsCompanyCode = v.logisticsCompanyCode;
}
})
let params = {
optType:1,
integralMallProExchangeId:this.id,
logisticsCompanyId:this.params.logisticsCompanyId,
logisticsCompanyCode:this.params.logisticsCompanyCode,
courierNumber:this.params.courierNumber
};
orderOptService(params).then(res => {
if (res.errorCode === 0) {
this.$tips({type:'success',message:'发货成功'});
this.close();
this.$emit('refresh');
} else {
this.$tips({type:'error',message:'发货失败'});
}
});
},
async getLogisticsList() {
let res = await getLogisticsList();
if (res.errorCode === 0) {
this.logisticsOptions = res.result || [];
}
},
async getLogisticsInfo() {
this.loading = true;
let res = await getLogisticsInfo({integralMallProExchangeId:this.id});
if (res.errorCode === 0) {
this.info = res.result.changeLog || {};
}
this.loading = false;
}
}
};
</script>
<style lang="scss" scoped>
.express{
&--info {
padding-bottom:10px;
p {
line-height: 30px;
}
}
}
</style>
<template>
<div class="dm-tabs el-tabs">
<div class="el-tabs__header">
<div class="overflow-hidden">
<div id="tab-first" @click="$router.push('/mall/'+v.value)" class="el-tabs__item" v-for="(v,i) in tabs" :key="i" :class="{'is-active':v.value === $route.meta.menu}">
{{v.name === '待发货'?(v.name+'('+total+')'):v.name}}
</div>
</div>
</div>
<div class="el-tabs__content">
<router-view></router-view>
</div>
</div>
</template>
<script>
import { getNotSendCount } from '@/service/api/mallApi.js';
export default {
name: "mall",
data() {
const vm = this;
return {
activeMenu:'',
tabs:[{name:'优惠券',value:'coupon'},{name:'礼品',value:'gift'},{name:'待发货',value:'goods'}],
total:0,
};
},
created() {
this.$store.commit("mutations_breadcrumb", [{ name: "积分商城" }]);
this.$store.commit("aside_handler", false);
this.getNotSendCount();
$bus.$on('refresh-not-send-count',() => {
this.getNotSendCount();
});
},
methods:{
async getNotSendCount(){
let res = await getNotSendCount();
if (res.errorCode === 0) {
this.total = res.result;
}
}
}
};
</script>
......@@ -11,15 +11,13 @@
<el-input v-model="listParams.search" class="w200" placeholder="输入模板名称/ID/内容" clearable @change="search"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-button class="fr" type="primary" @click="$router.push('/message/record/add')">新建群发</el-button>
</div>
<el-table tooltipEffect="light" :data="messageList" style="width: 100%" v-loading="recordLoading">
<el-table tooltipEffect="light" :data="messageList" style="width: 100%" row-key="sendTime" v-loading="recordLoading">
<el-table-column v-for="(v,i) in recordHeader" :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" :fixed="v.fixed"></el-table-column>
<el-table-column label="状态" prop="sendStatus" align="left" width="140px">
<template slot-scope="scope" >
<span v-if="scope.row.sendStatus === 5"><span class="dm-status--primary--flash"></span>执行中</span>
<span v-else :class="'dm-status--' + filterStatus(scope.row.sendStatus).type">{{filterStatus(scope.row.sendStatus).label}}</span>
<div v-if="scope.row.sendStatus == 0">
<time-counts class="primary-color fz12" :defaultVal="scope.row.sendTime" :autoStart="true"></time-counts>
</div>
<time-counts v-if="scope.row.sendStatus == 0" class="primary-color fz12" :defaultVal="scope.row.sendTime" :autoStart="true"></time-counts>
</template>
</el-table-column>
<el-table-column label="操作" align="left" width="140px" fixed="right">
......
......@@ -271,6 +271,7 @@ export default {
return;
}
if (this.info.contentType === 1 ) {
this.info.content = this.info.content.replace(/&amp;/g, "&");
let flag = await this.$refs.wxText.computedTextLength();
if (!flag) return;
}
......
......@@ -2,7 +2,7 @@
* @Author: zhangmeng
* @Date: 2018-08-14 15:45:36
* @Last Modified by: zhangmeng
* @Last Modified time: 2019-01-02 20:48:09
* @Last Modified time: 2019-01-08 14:22:58
*/
<template>
<section class="dm-wrap">
......@@ -21,7 +21,7 @@
<el-input v-model="listParams.clerkName" clearable class="vertical-middle w200" placeholder="请输入发送人名称" @change="search"><i slot="prefix" class="el-input__icon el-icon-search"></i></el-input>
<el-button class="fr" type="primary" @click="$router.push('/wechat/record/add')">新建群发</el-button>
</div>
<el-table tooltipEffect="light" :data="recordList" style="width: 100%" v-loading="loading">
<el-table tooltipEffect="light" :data="recordList" style="width: 100%" row-key="sendTime" v-loading="loading">
<el-table-column v-for="(v,i) in recordHeader" :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" :fixed="v.fixed" :render-header="v.renderHeader"></el-table-column>
<el-table-column label="状态" align="left" prop="timesStatus" width="160px">
<template slot-scope="scope" >
......@@ -44,7 +44,6 @@
</dm-delete>
<el-button type="text" v-if="scope.row.sendStatus===0" @click="$router.push('/wechat/record/edit/'+scope.row.wechatTeletextId)">编辑</el-button>
<el-button type="text" v-if="scope.row.sendStatus!==0" @click="$router.push('/wechat/record/info/'+scope.row.wechatTeletextId)">详情</el-button>
</template>
</el-table-column>
</el-table>
......
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