Commit 54ea59e4 by cwq0219

merge

2 parents 9855551a b1a3a716
......@@ -3673,6 +3673,11 @@
"assert-plus": "^1.0.0"
}
},
"dayjs": {
"version": "1.10.7",
"resolved": "https://registry.nlark.com/dayjs/download/dayjs-1.10.7.tgz",
"integrity": "sha1-LPX5Gt0oEWdIRAhmoKHSbzps5Gg="
},
"de-indent": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz",
......
......@@ -9,6 +9,7 @@
},
"dependencies": {
"core-js": "^3.4.4",
"dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
......
import { http } from '@/main'
const defaultPath = 'scrm.api.coupon.'
//优惠券列表
const getMerchantListApi = params => {
params.method = `${defaultPath}list.merchant`
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
//生效/失效
const effectiveCouponApi = params => {
params.method = `${defaultPath}effective`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//删除
const deleteCouponApi = params => {
params.method = `${defaultPath}delete`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//核销记录列表
const getVerificationListApi = params => {
params.method = `${defaultPath}verification.code.verification.list`
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
//查看优惠券
const getCouponDetailApi = params => {
params.method = `${defaultPath}detail`
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
//优惠券核销
const codeVerificationApi = params => {
params.method = `${defaultPath}verification.code.verification`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//创建优惠券
const createCouponApi = params => {
params.method = `${defaultPath}create`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//修改优惠券
const updateCouponApi = params => {
params.method = `${defaultPath}update`
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getMerchantListApi, getVerificationListApi, effectiveCouponApi, codeVerificationApi, getCouponDetailApi, deleteCouponApi, createCouponApi, updateCouponApi }
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.activity.'
//分页查询活动
const getActivityPageApi = params => {
params.method = `${defaultPath}page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
//开始/结束活动
const toggleStatusApi = params => {
params.method = `${defaultPath}toggle.status`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//删除活动
const deleteActivityApi = params => {
params.method = `${defaultPath}delete`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
//置顶活动
const topActivityApi = params => {
params.method = `${defaultPath}top`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default { getActivityPageApi, toggleStatusApi, deleteActivityApi, topActivityApi }
......@@ -16,6 +16,7 @@ import '@/components'
import { start } from '@/setup'
Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.prototype.size = 'small'
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
......@@ -65,6 +65,18 @@ const staticRoutes = Object.freeze([
meta: {}
},
{
name: 'couponManage',
path: '/couponManage/index',
component: resolve => require([`@/views/couponManage/index.vue`], resolve),
meta: {}
},
{
name: 'editCashCoupon',
path: '/couponManage/editCashCoupon/:addOrEdit',
component: resolve => require([`@/views/couponManage/editCashCoupon.vue`], resolve),
meta: {}
},
{
name: 'customerTransform',
path: '/customerTransform/index',
component: resolve => require([`@/views/customerTransform/index.vue`], resolve),
......@@ -105,7 +117,18 @@ const staticRoutes = Object.freeze([
path: '/orderManage/orderDetail',
component: resolve => require([`@/views/orderManage/orderDetail.vue`], resolve),
meta: {}
},
{
name: 'detailCustomer',
path: '/customerTransform/detailCustomer',
component: resolve => require([`@/views/customerTransform/detailCustomer.vue`], resolve),
meta: {}
},
{
name: 'detaiCustomeGroup',
path: '/customerTransform/detaiCustomeGroup',
component: resolve => require([`@/views/customerTransform/detaiCustomeGroup.vue`], resolve),
meta: {}
}
])
export default staticRoutes
<!-- 编辑代金券 -->
<template>
<div class="edit-share marketing">
<div class="container edit-container">
<p class="edit-title">{{ title }}代金券</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="waysHtml">
<el-radio v-model="editForm.way" label="1" :disabled="apear!='couponAdd'">线上商品</el-radio>
<el-radio v-model="editForm.way" label="2" :disabled="apear!='couponAdd'" @change="clickWay">到店核销</el-radio>
</template>
<template slot="effectiveHtml">
<el-radio v-model="editForm.effectiveType" label="3" :disabled="apear!='couponAdd'">无有效期</el-radio><br>
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear!='couponAdd'">
<el-form-item prop="effectiveTime">
<el-date-picker
v-model="editForm.effectiveTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期" :disabled="editForm.effectiveType != 2||apear!='couponAdd'">
</el-date-picker>
</el-form-item>
</el-radio><br>
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear!='couponAdd'">
<el-form-item prop="effectiveDays">
领取后&nbsp;&nbsp;<el-input v-model="editForm.effectiveDays" style="width: 100px;" :disabled="apear!='couponAdd'|| editForm.effectiveType != 1" />&nbsp;&nbsp;天内有效
</el-form-item>
</el-radio>
</template>
<template slot="barriersHtml">
<el-radio v-model="editForm.barriers" label="1" :disabled="apear!='couponAdd'">无限制</el-radio>
<el-radio v-model="editForm.barriers" label="2" :disabled="apear!='couponAdd' || editForm.way == 2">
<el-form-item prop="full">
订单满<el-input v-model="editForm.full" placeholder="输入金额(元)" style="width: 110px;" :disabled="apear!='couponAdd'|| editForm.barriers != 2" />元可用
<span style="color:red" v-if="priceFlag">存在零售价低于代金券的商品</span>
</el-form-item>
</el-radio>
</template>
<template slot="goodsHtml">
<el-radio v-model="editForm.goods" label="1" :disabled="apear!='couponAdd'">全部商品可用</el-radio>
<el-radio v-model="editForm.goods" label="2" :disabled="apear!='couponAdd'">指定商品可用</el-radio><br>
<el-button type="primary" v-if="editForm.goods == 2" @click="chooseGoods">选择商品</el-button>
</template>
<template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 308px" :autosize="{ minRows: 2, maxRows: 4}" maxlength="200" :disabled="apear=='couponSee'" />
</template>
</glsx-combi-form>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="apear!='couponSee'" @click="handleConfirm">确定</el-button>
<el-button type="default" v-if="apear!='couponSee'" @click="handleCancel">取消</el-button>
<el-button type="default" v-if="apear=='couponSee'" @click="handleCancel">返回</el-button>
</div>
</div>
</template>
<script>
export default {
name: 'editCashCoupon',
data() {
return {
size: 'small',
title: '创建',
titleObj: {
1: '创建晒单',
2: '编辑晒单'
},
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
routeInfo: {
// 1-新增;2-编辑;3-查看
addOrEdit: 1,
id: ''
},
apear: '',
priceFlag: false,
editForm: {
couponName: '',
way: '1',
effectiveType: '3',
barriers: '1',
goods: '1'
},
editRule: {
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
effectiveDays: [{ required: true, message: '有效天数不能为空', trigger: 'blur' }],
barriers: [{ required: true, message: '请选择使用限制', trigger: 'change' }],
full: [{ required: true, message: '门槛数值不能为空', trigger: 'blur' }],
denomination: [{ required: true, message: '面值不能为空', trigger: 'change' }],
stock: [{ required: true, message: '库存不能为空', trigger: 'change' }],
goods: [{ required: true, message: '请选择适用商品', trigger: 'change' }],
useDescription: [{ required: true, message: '使用说明不能为空', trigger: 'change' }]
},
editFormData: [
{
label: '优惠券名称',
name: 'couponName',
width: '320px',
type: 'input',
maxlength: 20
},
{
label: '使用途径',
name: 'ways',
addHtml: 'waysHtml'
},
{
label: '有效期',
name: 'effectiveType',
addHtml: 'effectiveHtml'
},
{
label: '使用限制',
name: 'barriers',
addHtml: 'barriersHtml'
},
{
label: '面值',
name: 'denomination',
width: '150px',
type: 'input'
},
{
label: '库存',
name: 'stock',
width: '150px',
type: 'input'
},
{
label: '适用商品',
name: 'goods',
addHtml: 'goodsHtml'
},
{
label: '使用说明',
name: 'useDescription',
addHtml: 'useDescriptionHtml'
}
]
}
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.params
// this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
var id = this.routeInfo.id
var addOrEdit = this.routeInfo.addOrEdit
if (id) {
if(addOrEdit == 3){
this.apear = 'couponSee';
this.title = '查看';
}else if(addOrEdit == 2){
this.apear = 'couponEdit';
this.title = '编辑';
}
} else {
this.apear = 'couponAdd';
this.title = '创建';
}
},
methods: {
getInfo() {
// this.$apis.zoneList.getZoneInfoApi({ id: this.routeInfo.id }).then(res => {
// this.editForm.zoneName = res.zoneName
// this.editForm.zoneImg = res.zoneImg
// this.editForm.merchantList = res.merchantRefList
// this.editForm.merchantList.forEach(item => {
// item.merchantNo = item.merchantId
// })
// })
},
//选择到店核销使用限制默认无使用门槛
clickWay(){
this.editForm.barriers = '1'
},
validateRules(){
var form = this.editForm
if(form.effectiveType == '2'){//判断 有效期-日期选择是否验证
this.editRule.effectiveTime[0].required = true
}else {
this.editRule.effectiveTime[0].required = false
}
if(form.effectiveType == '1'){//判断 有效期-有效天数是否验证
this.editRule.effectiveDays[0].required = true
}else {
this.editRule.effectiveDays[0].required = false
}
if(form.barriers == '2'){//判断 使用限制-订单满多少可用是否验证
this.editRule.full[0].required = true
}else {
this.editRule.full[0].required = false
}
},
getCouponInfoParams() {
var obj = {};
var id = this.routeInfo.id
var form = this.$common.utils.deepClone(this.editForm)
if (id) {
obj.couponId = id;
}else{//编辑时只允许编辑使用说明
//优惠券名称
obj.couponName = form.couponName;
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
obj.discountType = '3';
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
obj.effectiveType = form.effectiveType
if (form.effectiveType == 1) {//固定天数
obj.effectiveDays = form.effectiveDays;
} else if (form.effectiveType == 2) {//时间段
const d = form.effectiveTime
if (d && d.length > 0) {
obj.effectiveStartTime = d[0] + ' 00:00:00';
obj.effectiveEndTime = d[1] + ' 23:59:59';
}
}
//使用限制 1:无限制 2:满减
obj.useBarriers = form.barriers
if (form.barriers == 2) {
//满多少减
obj.full = form.full;
}
//面值
obj.denomination = form.denomination;
//库存
obj.stock = form.stock;
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
obj.useType = 1
//有效期或者间隔天数使用次数
obj.useAmount = 1
}
//使用描述
obj.useDescription = form.useDescription;
return obj;
},
handleConfirm() {
this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.getCouponInfoParams()
console.log(params);
let method = ''
if(params.couponId){
method = 'updateCouponApi'//后台修改优惠券
}else {
method = 'createCouponApi'//后台创建优惠券
}
// this.$apis.couponManage[method](params).then(res => {
// this.$message({
// message: res.code == '0' ? '操作成功' : '操作失败',
// type: res.code == '0' ? 'success' : 'error'
// })
// if (res.code == '0') {
// this.handleCancel()
// }
// })
}
})
},
handleCancel() {
this.$router.push({
path: '/couponManage/index'
})
}
}
}
</script>
<style scoped></style>
<!-- 编辑代金券 -->
<template>
<div class="edit-share marketing">
<div class="container edit-container">
<p class="edit-title">{{ title }}会员服务</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="140px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="effectiveHtml">
<el-radio v-model="editForm.effectiveType" label="3" :disabled="apear!='couponAdd'">无有效期</el-radio><br>
<el-radio v-model="editForm.effectiveType" label="2" :disabled="apear!='couponAdd'">
<el-form-item prop="effectiveTime">
<el-date-picker
v-model="editForm.effectiveTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:disabled="editForm.effectiveType != 2||apear!='couponAdd'" clearable>
</el-date-picker>
</el-form-item>
</el-radio><br>
<el-radio v-model="editForm.effectiveType" label="1" :disabled="apear!='couponAdd'">
<el-form-item prop="effectiveDays">
领取后&nbsp;&nbsp;<el-input v-model="editForm.effectiveDays" style="width: 100px;" :disabled="apear!='couponAdd'|| editForm.effectiveType != 1" />&nbsp;&nbsp;天内有效
</el-form-item>
</el-radio>
</template>
<template slot="useTypeHtml">
<el-radio v-model="editForm.useType" label="0" :disabled="apear!='couponAdd'">无限制</el-radio><br>
<el-radio v-model="editForm.useType" label="1" :disabled="apear!='couponAdd'">
<el-form-item prop="usageTimes">
有效期内可使用&nbsp;&nbsp;
<el-input v-model="editForm.usageTimes" style="width: 100px;" :disabled="apear!='couponAdd'|| editForm.useType != 1" />&nbsp;&nbsp;次
</el-form-item>
</el-radio><br>
<el-radio v-model="editForm.useType" label="2" :disabled="apear!='couponAdd'">
<el-form-item prop="useLimitDays">
有效期内
<el-input v-model="editForm.useLimitDays" style="width: 100px;" :disabled="apear!='couponAdd'|| editForm.useType != 2" />&nbsp;&nbsp;天
&nbsp;&nbsp;可使用&nbsp;&nbsp;
</el-form-item>
<el-form-item prop="usageTimes2">
<el-input v-model="editForm.usageTimes2" style="width: 100px;" :disabled="apear!='couponAdd'|| editForm.useType != 2" />&nbsp;&nbsp;次
</el-form-item>
</el-radio>
</template>
<template slot="useDescriptionHtml">
<el-input type="textarea" v-model="editForm.useDescription" style="width: 308px" :autosize="{ minRows: 2, maxRows: 4}" maxlength="200" :disabled="apear=='couponSee'" />
</template>
</glsx-combi-form>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" v-if="apear!='couponSee'" @click="handleConfirm">确定</el-button>
<el-button type="default" v-if="apear!='couponSee'" @click="handleCancel">取消</el-button>
<el-button type="default" v-if="apear=='couponSee'" @click="handleCancel">返回</el-button>
</div>
</div>
</template>
<script>
export default {
name: 'editCashCoupon',
data() {
return {
size: 'small',
title: '创建',
titleObj: {
1: '创建晒单',
2: '编辑晒单'
},
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
// pickerOptions: {
// disabledDate(v) {//禁用当前之前的日期
// return v.getTime() < new Date().getTime() - 86400000;
// },
// disabledDate(time) {//禁用当前之后的日期
// return time.getTime() > Date.now() - 8.64e6
// }
// },
routeInfo: {
// 1-新增;2-编辑;3-查看
addOrEdit: 1,
id: ''
},
apear: '',
isDisabled: true,
editForm: {
couponName: '',
effectiveType: '3',
useType: '0',
usageTimes: 1,
usageTimes2: 1
},
editRule: {
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
effectiveType: [{ required: true, message: '请选择有效期', trigger: 'change' }],
effectiveTime: [{ required: true, message: '有效期不能为空', trigger: 'change' }],
effectiveDays: [{ required: true, message: '有效天数不能为空', trigger: 'blur' }],
useType: [{ required: true, message: '请选择使用限制', trigger: 'change' }],
usageTimes: [{ required: true, message: '使用次数不能为空', trigger: 'blur' }],
useLimitDays: [{ required: true, message: '有效期天数不能为空', trigger: 'blur' }],
usageTimes2: [{ required: true, message: '使用次数不能为空', trigger: 'blur' }],
vipPrice: [{ required: true, message: '会员价不能为空', trigger: 'change' }],
shopPrice: [{ required: true, message: '门店价不能为空', trigger: 'change' }],
stock: [{ required: true, message: '库存不能为空', trigger: 'change' }],
useDescription: [{ required: true, message: '使用说明不能为空', trigger: 'change' }]
},
editFormData: [
{
label: '服务名称',
name: 'couponName',
width: '320px',
type: 'input',
maxlength: 20
},
{
label: '有效期',
name: 'effectiveType',
addHtml: 'effectiveHtml'
},
{
label: '使用限制',
name: 'useType',
addHtml: 'useTypeHtml'
},
{
label: '会员价',
name: 'vipPrice',
width: '150px',
type: 'input'
},
{
label: '门店价',
name: 'shopPrice',
width: '150px',
type: 'input'
},
{
label: '库存',
name: 'stock',
width: '150px',
type: 'input'
},
{
label: '使用说明',
name: 'useDescription',
addHtml: 'useDescriptionHtml'
}
]
}
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.routeInfo = this.$route.params
// this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
var id = this.routeInfo.id
var addOrEdit = this.routeInfo.addOrEdit
if (id) {
if(addOrEdit == 3){
this.apear = 'couponSee';
this.title = '查看';
}else if(addOrEdit == 2){
this.apear = 'couponEdit';
this.title = '编辑';
}
this.isDisabled = true
this.editFormData[0].isDisabled = this.isDisabled
this.editFormData[3].isDisabled = this.isDisabled
this.editFormData[4].isDisabled = this.isDisabled
this.editFormData[5].isDisabled = this.isDisabled
} else {
this.apear = 'couponAdd';
this.title = '创建';
this.isDisabled = false
}
},
methods: {
getInfo() {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => {
console.log(res);
this.editForm = this.$common.utils.deepClone(res)
this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.useType = this.editForm.useType + ''
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if (this.editForm.effectiveType == 2) {
this.editForm.effectiveTime = [this.editForm.effectiveStartTime,this.editForm.effectiveEndTime]
}
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
if (this.editForm.useType == 1) {
this.editForm.usageTimes = this.editForm.useAmount;
} else if (this.editForm.useType == 2) {
this.editForm.usageTimes2 = this.editForm.useAmount;
}
})
},
validateRules(){
var form = this.editForm
if(form.effectiveType == '2'){//判断 有效期-日期选择是否验证
this.editRule.effectiveTime[0].required = true
}else {
this.editRule.effectiveTime[0].required = false
}
if(form.effectiveType == '1'){//判断 有效期-有效天数是否验证
this.editRule.effectiveDays[0].required = true
}else {
this.editRule.effectiveDays[0].required = false
}
if(form.useType == '1'){//判断 使用限制-有效期内使用次数是否验证
this.editRule.usageTimes[0].required = true
}else {
this.editRule.usageTimes[0].required = false
}
if(form.useType == '2'){//判断 使用限制-有效天数和使用次数是否验证
this.editRule.useLimitDays[0].required = true
this.editRule.usageTimes2[0].required = true
}else {
this.editRule.useLimitDays[0].required = false
this.editRule.usageTimes2[0].required = false
}
},
getCouponInfoParams() {
var obj = {};
var id = this.routeInfo.id
var form = this.$common.utils.deepClone(this.editForm)
if (id) {
obj.couponId = id;
}else{//编辑时只允许编辑使用说明
//优惠券名称
obj.couponName = form.couponName;
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
obj.discountType = '7';
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
obj.effectiveType = form.effectiveType
if (form.effectiveType == 1) {//固定天数
obj.effectiveDays = form.effectiveDays;
} else if (form.effectiveType == 2) {//时间段
const d = form.effectiveTime
if (d && d.length > 0) {
obj.effectiveStartTime = d[0] + ' 00:00:00';
obj.effectiveEndTime = d[1] + ' 23:59:59';
}
}
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
obj.useType = form.useType;
if (form.useType == 1) {
obj.useAmount = form.usageTimes;
} else if (form.useType == 2) {
obj.useLimitDays = form.useLimitDays;
obj.useAmount = form.usageTimes2;
}
//会员价
obj.vipPrice = form.vipPrice;
//门店价
obj.shopPrice = form.shopPrice;
//库存
obj.stock = form.stock;
}
//使用描述
obj.useDescription = form.useDescription;
return obj;
},
handleConfirm() {
this.validateRules()
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.getCouponInfoParams()
console.log(params);
let method = ''
if(params.couponId){
method = 'updateCouponApi'//后台修改优惠券
}else {
method = 'createCouponApi'//后台创建优惠券
}
this.$apis.couponManage[method](params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleCancel()
}
})
}
})
},
handleCancel() {
this.$router.push({
path: '/couponManage/index'
})
}
}
}
</script>
<style scoped></style>
<!-- 商品管理-门店 -->
<template>
<div class="marketing pro-group">
<div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="addCashCoupon()">新建代金券</el-button>
<el-button :size="size" type="primary" class="el-icon-plus" @click="addService()">新建会员服务</el-button>
<el-button :size="size" type="primary" class="el-icon-plus" @click="addService()">新建折扣卷</el-button>
</div>
<div class="container">
<div>
<glsx-combi-form ref="showSearch" labelWidth="100px" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleReset">重置</el-button>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="coupon" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button v-if="scope.scope.status == '1'" type="text" @click="start(scope.scope)">生效</el-button>
<el-button v-if="scope.scope.status == '2'" type="text" @click="end(scope.scope)">失效</el-button>
<el-button v-if="scope.scope.status == '1'" type="text" @click="handleEdit(2,scope.scope)">编辑</el-button>
<el-button v-if="scope.scope.status == '2' || scope.scope.status == '3'" type="text" @click="handleEdit(3,scope.scope)">查看</el-button>
<el-button v-if="scope.scope.status == '1' || scope.scope.status == '3'" type="text" @click="del(scope.scope)">删除</el-button>
<el-button type="text" @click="writeOffDetail(scope.scope)">核销详情</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 下架 -->
<glsx-dialog title="下架" :isVisible.sync="isDownVisible" @confirmDialog="handleDownConfirm" @closeDialog="handleDownClose">
<el-form ref="downRef" label-width="100px" :rules="downRules" :model="downForm">
<el-form-item label="下架备注" prop="offReason">
<el-input :size="size" v-model="downForm.offReason" placeholder="请输入下架备注" maxlength="30"></el-input>
</el-form-item>
</el-form>
</glsx-dialog>
<!-- 分享 -->
<share-dialog :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></share-dialog>
</div>
</template>
<script>
import shareDialog from '../productGroup/components/shareDialog'
export default {
name: 'coupon',
data() {
return {
size: 'small',
// 下架
isDownVisible: false,
downForm: {
id: '',
offReason: '',
goodsStatus: 0
},
downRules: {
offReason: [{ required: true, message: '请输入下架备注', trigger: 'change' }]
},
// 分享
isShareVisible: false,
shareForm: {},
// 表格
searchForm: {
couponName: '',
discountType: '',
status: ''
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '名称',
name: 'couponName',
type: 'input',
maxlength: 20
},
// {
// label: '创建日期',
// name: 'createDate',
// type: 'datePicker',
// isClear: true,
// pickerOptions: 'beforeRangePickerOptions'
// },
{
label: '优惠券类型',
name: 'discountType',
type: 'select',
width: '160px',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'discountTypeList'
},
{
label: '优惠券状态',
name: 'status',
type: 'select',
width: '160px',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'statusList'
}
],
// 表格
getListApi: this.$apis.couponManage.getMerchantListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '名称',
prop: 'couponName',
line: 2
},
{
label: '优惠券类型',
name: 'discountType',
formatter: cellValue => {
return this.baseData.discountTypeList.find(item => item.confId == cellValue.discountType).confName
}
},
{
label: '已领取',
prop: 'getAmount'
},
{
label: '剩余',
prop: 'residueAmount'
},
{
label: '优惠券状态',
name: 'status',
formatter: cellValue => {
return this.baseData.statusList.find(item => item.confId == cellValue.status).confName
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {
discountTypeList: [{
confId: '3',
confName: '代金券'
}, {
confId: '7',
confName: '会员服务'
}],
statusList: [{
confId: '1',
confName: '未生效'
}, {
confId: '2',
confName: '生效中'
}, {
confId: '3',
confName: '已失效'
}],
}
}
},
components: {
shareDialog
},
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
// delete this.tableSearchForm.createDate
resolve()
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
//生效
start(item){
this.startOrEndConfirm('生效',item)
},
//失效
end(item){
this.startOrEndConfirm('失效',item)
},
startOrEndConfirm(txt,row) {
var title = txt
var params = {}
params.couponId = row.id
if(txt == '生效'){
params.status = '2' //优惠券状态(2:生效,3:失效)
}else if(txt == '失效'){
params.status = '3' //优惠券状态(2:生效,3:失效)
}
this.secondConfirm(title, '确定要' + txt + '该优惠券?', 'couponManage', 'effectiveCouponApi', params)
},
//核销记录
writeOffDetail(row){
this.$router.push('/couponManage/writeOffDetail/' + row.id)
},
//删除
del(row){
var params = {}
params.couponId = row.id
this.secondConfirm('删除', '确定删除此优惠券?', 'couponManage', 'deleteCouponApi', params)
},
//新增代金券
addCashCoupon() {
this.$router.push('/couponManage/editCashCoupon/1')
},
//新增会员服务
addService() {
this.$router.push('/couponManage/editMemberService/1')
},
// addOrEdit:1-新增;2-编辑;3-查看
handleEdit(addOrEdit, row) {
var goto = ''
if(row.discountType == '3'){//代金券
goto = '/couponManage/editCashCoupon/'
}else if(row.discountType == '7'){//会员服务
goto = '/couponManage/editMemberService/'
}
console.log(goto + addOrEdit + '/' + row.id);
this.$router.push(goto + addOrEdit + '/' + row.id)
},
// 下架通知
handleDwonNotice(row) {
this.$alert( '你带货的' + row.goodsName + '商品现已下架,下架原因:' + row.offReason, '商品下架通知', {
confirmButtonText: '确定',
callback: action => { }
})
},
handleUpOrDown(row) {
var title = row.goodsStatus == 0 ? '上架' : '下架'
this.secondConfirm(title, '是否确认' + title + '该商品?', 'proManage', 'updateStatusProApi', { id: row.id, goodsStatus: row.goodsStatus == 0 ? 1 : 0 })
},
// 取消带货
handleTakeGood(row) {
this.secondConfirm('取消带货', '是否确认取消带货该商品?', 'proManage', 'deleteTakeProApi', { id: row.id })
},
dwonVisibleChange() {
this.$refs.downRef && this.$refs.downRef.clearValidate()
this.isDownVisible = !this.isDownVisible
},
handleDownClose() {
this.dwonVisibleChange()
this.downForm = {
id: '',
offReason: '',
goodsStatus: 0
}
},
handleDownConfirm() {
this.$refs.downRef.validate(valid => {
if (valid) {
this.$apis.proManage.updateStatusProApi(this.downForm).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleDownClose()
this.handleSearch()
}
})
}
})
},
// 置顶
handleTop(row) {
this.secondConfirm('置顶', '是否确认置顶该商品?', 'proManage', 'topProApi', { id: row.id })
},
handleShare(row) {
this.$apis.proManage.getProShareApi({ id: row.id }).then(res => {
this.shareForm = res
this.handleShareClose()
})
},
handleShareClose() {
this.isShareVisible = !this.isShareVisible
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
handleSearch() {
this.$refs.coupon.refreshTable()
},
handleReset() {
this.searchForm = {
couponName: '',
discountType: '',
status: ''
}
this.handleSearch()
}
}
}
</script>
<style scoped></style>
<!-- 商品管理-门店 -->
<template>
<div class="marketing pro-group">
<div class="container">
<div>
<glsx-combi-form ref="showSearch" labelWidth="100px" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="writeOff">优惠券核销</el-button>
<el-button :size="size" type="primary" @click="goback">返回</el-button>
</span>
</glsx-combi-form>
</div>
<div class="icon-tips icon-green" style="width: 98%;display: inline-block; margin-bottom: 20px;">
<img src="../../images/comment.png" />
<span>优惠券名称:<i>{{coupon.couponName}}</i></span>
<span>发行总量:<i>{{coupon.stock}}</i></span>
<span>核销总量:<i>{{coupon.usedAmount}}</i></span>
<span>有效期:<i>{{effective}}</i></span>
<span>使用限制:<i>{{useB}}</i></span>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="writeOffList" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 优惠券核销 -->
<glsx-dialog title="优惠券核销(请确保用户到店后核销,避免引起不必要问题)" :isVisible.sync="writeOffVisible" @confirmDialog="handleDownConfirm" @closeDialog="handleDownClose">
<el-form ref="writeOffRef" label-width="100px" :rules="writeOffRules" :model="writeOffForm">
<el-form-item label="核销码" prop="verficationCode">
<el-input :size="size" v-model="writeOffForm.verficationCode" placeholder="请输入核销码" style="width:300px;" maxlength="32"></el-input>
</el-form-item>
</el-form>
</glsx-dialog>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
export default {
name: 'writeOffDetail',
data() {
return {
size: 'small',
// 下架
writeOffVisible: false,
coupon: {
couponName: '',
stock: '',
usedAmount: ''
},
effective: '',
useB: '',
writeOffForm: {
verficationCode: ''
},
writeOffRules: {
verficationCode: [{ required: true, message: '请输入核销码', trigger: 'change' }]
},
shareForm: {},
// 表格
searchForm: {
verificationCode: ''
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '核销码',
name: 'verificationCode',
type: 'input',
maxlength: 20
}
],
// 表格
getListApi: this.$apis.couponManage.getVerificationListApi,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '核销码',
prop: 'verificationCode'
},
{
label: '手机号',
prop: 'phone'
},
{
label: '领取时间',
prop: 'createdDate',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '核销时间',
prop: 'verificationTime',
formatter: cellValue => {
return dayjs(cellValue.verificationTime).format('YYYY-MM-DD HH:mm:ss')
}
},
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {
},
}
},
components: {
},
mounted() {
this.getOptionsList('searchFormData')
this.getInfo(this.$route.params.id)
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
params.couponId = this.$route.params.id
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
getInfo(couponId) {
var params = {}
params.couponId = couponId
this.$apis.couponManage.getCouponDetailApi(params).then(res => {
this.coupon = res
this.effective = ''
this.useB = ''
var coupon = res
//有效期
if(coupon.effectiveType == 1){//固定天数,领取后计算
this.effective = coupon.effectiveDays + '天'
}else if(coupon.effectiveType == 2){//时间段
this.effective = coupon.effectiveStartTime + ' - ' + coupon.effectiveEndTime
}else if(coupon.effectiveType == 3){//无有效期
this.effective = '无有效期'
}
if(coupon.discountType == 3){//代金券
//使用限制
if(coupon.useBarriers == 1){//无限制
this.useB = '无限制'
}else if(coupon.useBarriers == 2){//满减
this.useB = '满' + coupon.full + '元可用'
}
}
if(coupon.discountType == 7){//会员服务
//使用限制
if(coupon.useType == 0){//无限制
this.useB = '无限制'
}else if(coupon.useType == 1){//有效期内可使用次数
this.useB = '有效期内可使用' + coupon.useAmount + '次'
}else if(coupon.useType == 2){//有效期内多少天内可使用次数
this.useB = '有效期内' + coupon.useLimitDays + '天可使用' + coupon.usedAmount + '次'
}
}
})
},
writeOff(){
this.writeOffVisible = !this.writeOffVisible
},
//返回
goback(){
this.$router.push('/couponManage/index')
},
dwonVisibleChange() {
this.$refs.writeOffRef && this.$refs.writeOffRef.clearValidate()
this.writeOffVisible = !this.writeOffVisible
},
handleDownClose() {
this.dwonVisibleChange()
this.writeOffForm = {
verficationCode: ''
}
},
handleDownConfirm() {
this.$refs.writeOffRef.validate(valid => {
if (valid) {
this.$apis.couponManage.codeVerificationApi(this.writeOffForm).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleDownClose()
this.handleSearch()
}
})
}
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
handleSearch() {
this.$refs.writeOffList.refreshTable()
},
handleReset() {
this.searchForm = {
verificationCode: ''
}
this.handleSearch()
}
}
}
</script>
<style scoped>
.modal-title span {
font-size: 12px;
font-weight: 400;
}
.icon-green {
background-color: rgba(3,153,69,.2);
border: 1px solid rgba(3,153,69,.2);
}
.icon-tips {
border-radius: 2px;
font-size: 12px;
color: #333;
line-height: 30px;
padding: 0 10px 0 30px;
position: relative;
}
.icon-tips span {
margin-right: 10px;
}
.icon-tips i {
font-style: normal;
color: #ff3f3f;
margin: 0 3px;
}
.icon-tips img {
position: absolute;
top: 8px;
left: 10px;
}
</style>
......@@ -7,24 +7,49 @@
<div class="info-box">
<div class="info-content">
<el-form :model="basicForm" :rules="basicRules" ref="basicForm" label-width="120px">
<el-form-item label="组名" prop="name">
<el-input v-model="basicForm.name" placeholder="为群聊设置一个组名" maxlength="10"></el-input>
</el-form-item>
<el-form-item label="群聊名称" prop="groupName">
<el-input v-model="basicForm.groupName" placeholder="设置群聊名称前缀,如新车售后一组" maxlength="10"></el-input>
<div class="form-tips">群聊名称后缀将以日期及序号进行累加,如“新车售后一组211011-1群”</div>
</el-form-item>
<el-form-item label="默认成员" prop="groupName">
<el-form-item label="选择群发账号" prop="groupName">
<el-button size="small" @click="openMembers">
<i class="el-icon-plus"></i>
全部成员
</el-button>
<!-- <el-input v-model="basicForm.groupName" placeholder="设置群聊名称前缀,如新车售后一组"></el-input> -->
<div class="form-tips">必须配置2个及以上成员</div>
</el-form-item>
<el-form-item label="选择客户" prop="select">
<el-radio-group v-model="basicForm.radio">
<el-radio :label="1">全部成员</el-radio>
<el-radio :label="2">筛选成员</el-radio>
</el-radio-group>
</el-form-item>
<div class="filter-box" v-show="basicForm.radio == 2">
<div class="filter-memeber">
<el-form-item label="性别">
<el-radio-group v-model="basicForm.sex">
<el-radio :label="1">全部</el-radio>
<el-radio :label="2">男性</el-radio>
<el-radio :label="3">女性</el-radio>
<el-radio :label="4">未知性别</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="所在群聊">
<el-select v-model="basicForm.value" multiple collapse-tags placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="添加客户时间">
<el-date-picker v-model="basicForm.date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" size="small"></el-date-picker>
</el-form-item>
<el-form-item label="标签筛选"></el-form-item>
</div>
<div class="filter-footer">
<span>将消息发送给客户符合条件的客户</span>
<div class="filter-number">
查看预计群发人数
<span>6</span>
</div>
</div>
</div>
</el-form>
<!-- 编辑入群欢迎语 -->
<div class="title">编辑入群欢迎语</div>
<div class="title">编辑群发内容</div>
<div>
<WelcomeWords :eventBus="eventBus"></WelcomeWords>
</div>
......@@ -46,7 +71,7 @@
}"
>
<el-button type="primary" @click="handleNext">确定</el-button>
<el-button type="primary" @click="handleNext">取消</el-button>
<el-button type="primary" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
......@@ -70,7 +95,29 @@ export default {
name: [{ required: true, message: '请输入组名', trigger: 'blur' }],
groupName: [{ required: true, message: '请输入群聊名称', trigger: 'blur' }]
},
membersVisible: false
membersVisible: false,
options: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎'
},
{
value: '选项4',
label: '龙须面'
},
{
value: '选项5',
label: '北京烤鸭'
}
]
}
},
// mounted() {
......@@ -82,6 +129,9 @@ export default {
methods: {
openMembers() {
this.membersVisible = !this.membersVisible
},
handleCancel() {
this.$router.go(-1)
}
}
}
......@@ -98,9 +148,6 @@ export default {
font-size: 16px;
color: #333;
border-bottom: 1px solid #d8d8d8;
&::after {
content: '';
}
}
.info-box {
display: inline-flex;
......@@ -110,7 +157,30 @@ export default {
justify-content: space-between;
.info-content {
width: calc(100% - 360px);
// flex: 1;
.filter-box {
margin-left: 120px;
background-color: #f7f7f7;
.filter-memeber {
padding: 20px 0;
border-bottom: 1px solid #dcdfe6;
}
.filter-footer {
display: flex;
padding: 14px 20px;
justify-content: space-between;
align-items: center;
color: #999;
font-size: 14px;
.filter-number {
padding: 7px 14px;
background-color: #e6e9ff;
color: #333;
span {
color: #5850ff;
}
}
}
}
}
}
......
......@@ -7,24 +7,19 @@
<div class="info-box">
<div class="info-content">
<el-form :model="basicForm" :rules="basicRules" ref="basicForm" label-width="120px">
<el-form-item label="组名" prop="name">
<el-input v-model="basicForm.name" placeholder="为群聊设置一个组名" maxlength="10"></el-input>
</el-form-item>
<el-form-item label="群聊名称" prop="groupName">
<el-input v-model="basicForm.groupName" placeholder="设置群聊名称前缀,如新车售后一组" maxlength="10"></el-input>
<div class="form-tips">群聊名称后缀将以日期及序号进行累加,如“新车售后一组211011-1群”</div>
<el-input v-model="basicForm.groupName" placeholder="群发名称仅内部可见" maxlength="10"></el-input>
</el-form-item>
<el-form-item label="默认成员" prop="groupName">
<el-form-item label="选择群主" prop="groupName">
<el-button size="small" @click="openMembers">
<i class="el-icon-plus"></i>
全部成员
全部账号
</el-button>
<!-- <el-input v-model="basicForm.groupName" placeholder="设置群聊名称前缀,如新车售后一组"></el-input> -->
<div class="form-tips">必须配置2个及以上成员</div>
<div class="form-tips">群主收到通知后,可选择他管理的客户群并群发该内容。</div>
</el-form-item>
</el-form>
<!-- 编辑入群欢迎语 -->
<div class="title">编辑入群欢迎语</div>
<div class="title">编辑群发内容</div>
<div>
<WelcomeWords :eventBus="eventBus"></WelcomeWords>
</div>
......@@ -43,7 +38,7 @@
}"
>
<el-button type="primary" @click="handleNext">确定</el-button>
<el-button type="primary" @click="handleNext">取消</el-button>
<el-button type="primary" @click="handleCancel">取消</el-button>
</div>
<glsx-dialog :title="'选择成员'" :width="'712px'" :isVisible="membersVisible" @confirmDialog="handleConfirm" @closeDialog="membersVisible = !membersVisible">
<SelectMembers ref="drawerForm" @closeDrawer="closeDrawer" @handSelectdEmp="handSelectdEmp"></SelectMembers>
......@@ -82,6 +77,9 @@ export default {
methods: {
openMembers() {
this.membersVisible = !this.membersVisible
},
handleCancel() {
this.$router.go(-1)
}
}
}
......@@ -98,9 +96,6 @@ export default {
font-size: 16px;
color: #333;
border-bottom: 1px solid #d8d8d8;
&::after {
content: '';
}
}
.info-box {
display: inline-flex;
......
<template>
<div class="container">
<div class="title">基础信息</div>
<div class="content">
<div class="content-info">
<div class="content-text">
<div class="detail-item">
<div class="detail-label">创建者:</div>
<div class="detail-value">超级管理员</div>
</div>
<div class="detail-item">
<div class="detail-label">群发内容:</div>
<div class="detail-value">超级管理员</div>
<div class="detail-tips">详见右侧视图</div>
</div>
<div class="detail-item">
<div class="detail-label">创建者:</div>
<div class="detail-value">超级管理员</div>
</div>
<div class="detail-item">
<div class="detail-label">创建者:</div>
<div class="detail-value">超级管理员</div>
</div>
</div>
<div class="title">数据统计</div>
<div class="statistics-info">
<div class="statistics-ul">
<div class="statistics-li statistics-border">
<div class="statistics-number">
<span>0</span>
人
</div>
<div>已发送群主</div>
</div>
<div class="statistics-li">
<div class="statistics-number">
<span>0</span>
人
</div>
<div>已发送群主</div>
</div>
</div>
<div class="statistics-ul">
<div class="statistics-li statistics-border">
<div class="statistics-number">
<span>0</span>
人
</div>
<div>已发送群主</div>
</div>
<div class="statistics-li">
<div class="statistics-number">
<span>0</span>
人
</div>
<div>已发送群主</div>
</div>
</div>
<div class="statistics-ul">
<div class="statistics-li">
<div class="statistics-number">
<span>0</span>
人
</div>
<div>已发送群主</div>
</div>
</div>
</div>
</div>
<Preview></Preview>
</div>
</div>
</template>
<script>
import Preview from '../components/preview.vue'
export default {
name: 'BasicInof',
components: {
Preview
},
data() {},
methods: {}
}
</script>
<style lang="scss" scope>
.container {
margin-bottom: 20px;
background-color: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
.title {
padding: 20px 0 17px 20px;
font-size: 16px;
color: #333;
border-bottom: 1px solid #d8d8d8;
}
.content {
display: flex;
align-items: flex-end;
justify-content: space-between;
box-sizing: border-box;
width: 100%;
height: 100%;
padding: 20px 24px 40px 0;
.content-info {
width: calc(100% - 360px);
.content-text {
padding-left: 52px;
height: 400px;
}
.detail-item {
display: flex;
font-size: 14px;
color: #333;
line-height: 20px;
margin-bottom: 24px;
.detail-tips {
margin-left: 8px;
color: #939393;
}
}
.statistics-info {
display: flex;
justify-content: space-between;
margin-top: 24px;
margin-left: 52px;
.statistics-ul {
border-radius: 2px;
background-color: #f6f6ff;
border: 1px solid rgba(88, 80, 255, 0.8);
}
.statistics-li {
display: inline-block;
width: 142px;
color: #424242;
font-size: 14px;
text-align: center;
margin: 42px 35px;
&.statistics-border {
padding-right: 35 px;
margin-right: 0;
border-right: 1px solid #5850ff;
}
.statistics-number {
margin-bottom: 12px;
font-size: 16px;
color: #333;
span {
font-size: 26px;
}
}
}
}
}
}
}
</style>
......@@ -41,17 +41,20 @@ export default {
currentTime: ''
}
},
created() {
this.eventBus.$on('update', val => {
console.log(val)
this.previewList = val
})
},
mounted() {
console.log(1111, this.eventBus)
const date = new Date()
let hours = date.getHours()
hours = hours < 10 ? `0${hours}` : hours
let minutes = date.getMinutes()
minutes = minutes < 10 ? `0${minutes}` : minutes
this.currentTime = `${date.getFullYear()}年${date.getMonth() + 1}月${date.getDate()}日 ${hours}:${minutes}`
this.eventBus.$on('update', val => {
console.log(val)
this.previewList = val
})
}
}
</script>
......
<template>
<div class="welcome-box">
<div class="required">入群欢迎语</div>
<div class="content">
<div class="content content-bg">
<el-input type="textarea" :rows="9" maxlength="600" show-word-limit v-model="guestForm.name" placeholder="请输入内容"></el-input>
<div>
<div class="welcome-file" v-for="itm in previewList" :key="itm.id">
<div class="welcome-file" v-for="(itm, index) in previewList" :key="itm.id">
<template v-if="itm.type == 'img'">
<img src="../../../assets/guestCustom/icon-img.png" alt="" />
<span>{{ itm.name }}</span>
......@@ -17,7 +17,7 @@
<img src="../../../assets/guestCustom/icon-applet.png" alt="" />
<span>{{ itm.title }}</span>
</template>
<i class="el-icon-circle-close"></i>
<i class="el-icon-circle-close" @click="close(index)"></i>
</div>
</div>
<div class="btn-group">
......@@ -30,11 +30,23 @@
</div>
<div class="tips-text">
<img src="../../../assets/guestCustom/tips.png" class="tips-icon" alt="" />
<span>欢迎语将在客户进群时发送一次,不设置时不发送入群欢迎语。</span>
<span>客户每个月最多接收来自同一企业的管理员的 4 条群发消息,4条消息可在同一天发送,达到上限后,无法再接收管理员的群发消息。</span>
</div>
</div>
<div class="required">发送时间</div>
<div class="content">
<el-radio-group v-model="radio">
<el-radio :label="1">立即发送</el-radio>
<el-radio :label="2">定时发送</el-radio>
</el-radio-group>
<div v-show="radio == 2" class="date-picker">
<el-date-picker v-model="value1" size="small" type="date" placeholder="选择日期"></el-date-picker>
-
<el-time-picker v-model="value2" size="small" placeholder="选择时间"></el-time-picker>
</div>
</div>
<basic-dialog :title="dialogTitle" :width="'712px'" :isVisible="dialogVisible" @confirmDialog="handleConfirm" @closeDialog="dialogVisible = !dialogVisible">
<glsx-dialog :title="dialogTitle" :width="'712px'" :isVisible="dialogVisible" @confirmDialog="handleConfirm" @closeDialog="dialogVisible = !dialogVisible">
<slot>
<el-form v-if="dialogTitle == '添加网页消息'" :model="linkForm" :rules="linkRules" ref="linkForm" label-width="120px">
<el-form-item label="网页标题" prop="name">
......@@ -65,7 +77,7 @@
</el-form-item>
</el-form>
</slot>
</basic-dialog>
</glsx-dialog>
</div>
</template>
......@@ -167,10 +179,14 @@ export default {
type: 'text',
content: 'fasf'
}
]
],
radio: '',
value1: '',
value2: ''
}
},
mounted() {
console.log(this.previewList)
this.eventBus.$emit('update', this.previewList)
},
methods: {
......@@ -239,6 +255,10 @@ export default {
default:
console.log(dialogTitle)
}
},
close(index) {
this.previewList.splice(index, 1)
this.eventBus.$emit('update', this.previewList)
}
}
}
......@@ -249,12 +269,14 @@ export default {
padding-top: 20px;
margin-left: 87px;
}
.content-bg {
background-color: #f7f7f7;
}
.content {
display: inline-block;
vertical-align: text-top;
width: calc(100% - 103px);
margin-left: 12px;
background-color: #f7f7f7;
.welcome-file {
display: flex;
align-items: center;
......@@ -311,10 +333,17 @@ export default {
}
}
}
.date-picker {
margin-top: 10px;
font-size: 14px;
color: #999;
}
}
.required {
display: inline-block;
line-height: 40px;
text-align: right;
width: 90px;
}
.required::before {
content: '*';
......
<template>
<div>
<BasicInof></BasicInof>
<div class="detail-container">
<glsx-combi-form ref="showSearch" labelWidth="90px" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="search-btns">
<el-button :size="size" type="primary" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
<!-- 表格区域 开始 -->
<GLTable ref="table" :tableData="tableData" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" :disabled="scope.scope.isRemind == 1" @click="btnClick('edit', scope.scope)">提醒发送</el-button>
</div>
</GLTable>
</div>
<div
class="footer-panel"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button type="primary" @click="handleNext">确定</el-button>
<el-button type="primary" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
import BasicInof from './components/basicInfo.vue'
export default {
components: {
BasicInof
},
data() {
return {
searchForm: {},
searchFormData: [
{
label: '群聊名称',
name: 'zoneName',
type: 'input',
maxlength: 20
},
{
label: '群主',
name: 'createDate',
type: 'select',
isClear: true,
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: 12,
value: 12
}
]
},
{
label: '送达状态',
name: 'createDate',
type: 'select',
isClear: true,
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: 12,
value: 12
}
]
}
],
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '群聊名称',
prop: 'zoneName'
},
{
label: '群主',
prop: 'zoneName'
},
{
label: '群主所在部门',
prop: 'zoneName'
},
{
label: '群客户人数',
prop: 'zoneName'
},
{
label: '消息送达状态',
prop: 'zoneName'
},
{
label: '确认发送时间',
prop: 'createdDate',
formatter: cellValue => {
return new Date(cellValue.createdDate).toLocaleDateString().replace(/\//g, '-')
}
},
{
label: '操作',
prop: 'optionBtns',
width: '140px',
addHtml: 'optionBtns',
fixed: 'right'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableData: [
{
zoneName: 'fasd',
isRemind: 1
},
{
zoneName: 'fasd',
isRemind: 2
}
]
}
},
methods: {
handleCancel() {
this.$router.go(-1)
}
}
}
</script>
<style lang="scss" scope>
.detail-container {
margin-bottom: 84px;
padding: 20px;
background-color: #ffffff;
box-shadow: 0px 1px 5px 0px rgba(38, 38, 38, 0.1);
.search-btns {
float: right;
}
}
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0px;
height: 64px;
width: 100%;
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
</style>
<template>
<div>
<BasicInof></BasicInof>
<div class="detail-container">
<div class="detail-modular">
<div class="title">员工详情</div>
<div class="detail-info">
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
<el-menu-item index="1">全部</el-menu-item>
<el-menu-item index="2">已发送员工</el-menu-item>
<el-menu-item index="3">未发送员工</el-menu-item>
<el-menu-item index="4">员工发送失败</el-menu-item>
</el-menu>
<div class="detail-total">共 {{ employeelist.length || 0 }} 人</div>
<div class="info-list">
<div class="info-item" v-for="item in employeelist" :key="item.id">
<img class="info-avatar" src="../../assets/logo.png" alt="" />
<div class="info-content">
<div class="info-text">
<div class="info-name">
{{ item.name }}
<span :class="[item.status == 1 ? 'unsend' : 'send']">{{ item.status == 1 ? '未' : '已' }}发送</span>
</div>
<div class="info-num">共{{ item.num }}个客户</div>
</div>
<div class="info-right">
<div v-if="item.status == 1">已提醒</div>
<el-button size="mini" type="primary">提醒</el-button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="detail-modular">
<div class="title">客户详情</div>
<div class="detail-info">
<el-menu :default-active="customIndex" class="el-menu-demo" mode="horizontal" @select="handleCustomSelect">
<el-menu-item index="1">全部</el-menu-item>
<el-menu-item index="2">已发送员工</el-menu-item>
<el-menu-item index="3">未发送员工</el-menu-item>
<el-menu-item index="4">员工发送失败</el-menu-item>
</el-menu>
<div class="detail-total">共 {{ employeelist.length || 0 }} 人</div>
<div class="info-list">
<div class="info-item" v-for="item in employeelist" :key="item.id">
<img class="info-avatar" src="../../assets/logo.png" alt="" />
<div class="info-content info-custom">
<div class="info-text">
<div class="info-name">
{{ item.name }}
<div :class="[item.status == 1 ? 'unsend' : 'send']">{{ item.status == 1 ? '未' : '已' }}发送</div>
</div>
</div>
<div class="info-right">
<div>通过 胡悦发送</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="footer-panel"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button type="primary" @click="handleNext">确定</el-button>
<el-button type="primary" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
import BasicInof from './components/basicInfo.vue'
export default {
components: {
BasicInof
},
data() {
return {
activeIndex: '1',
customIndex: '1',
employeelist: [
{
id: 1,
name: 'anadf',
status: 1,
num: 1,
url: 'dfsa'
},
{
id: 2,
name: 'anadf',
status: 2,
num: 1,
url: 'dfsa'
},
{
id: 3,
name: 'anadf',
status: 2,
num: 1,
url: 'dfsa'
},
{
id: 4,
name: 'anadf',
status: 2,
num: 1,
url: 'dfsa'
},
{
id: 5,
name: 'anadf',
status: 2,
num: 1,
url: 'dfsa'
},
{
id: 6,
name: 'anadf',
status: 2,
num: 1,
url: 'dfsa'
}
]
}
},
methods: {
handleSelect(val) {
console.log(val)
this.activeIndex = val
},
handleCustomSelect(val) {
this.customIndex = val
},
handleCancel() {
this.$router.go(-1)
}
}
}
</script>
<style lang="scss" scope>
.detail-container {
display: flex;
width: 100%;
justify-content: space-between;
margin-bottom: 84px;
.detail-modular {
width: calc(50% - 10px);
background-color: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
}
.title {
padding: 20px 0 17px 20px;
font-size: 16px;
color: #333;
border-bottom: 1px solid #d8d8d8;
}
.detail-info {
padding: 0 20px;
.detail-total {
padding: 31px 0 14px;
font-size: 14px;
color: #333;
line-height: 16px;
}
.info-list {
max-height: 432px;
overflow: auto;
margin-bottom: 20px;
}
.info-item {
display: flex;
align-items: center;
background-color: #f6f6ff;
border-radius: 2px;
border: 1px solid rgba(88, 80, 255, 0.8);
padding: 15px;
margin-bottom: 20px;
&:last-child {
margin-bottom: 0;
}
.info-avatar {
width: 58px;
height: 58px;
margin-right: 20px;
}
.info-content {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
.info-text {
height: 62px;
}
.info-right {
display: flex;
align-items: center;
font-size: 16px;
color: #5850ff;
line-height: 22px;
}
.info-name {
font-size: 16px;
color: #333;
font-weight: 500;
line-height: 22px;
margin-bottom: 14px;
span {
display: inline-block;
margin-left: 10px;
font-size: 14px;
}
.send {
color: #666;
}
.unsend {
padding: 3px 10px;
background-color: #eb4e4e;
color: #fff;
border-radius: 2px;
}
div {
margin-top: 10px;
font-size: 14px;
}
}
.info-num {
font-size: 14px;
color: #666;
line-height: 20px;
}
button {
margin-left: 10px;
padding: 9px 28px;
}
}
}
}
.el-menu.el-menu--horizontal {
border-bottom: none;
}
.el-menu--horizontal > .el-menu-item.is-active {
border-bottom-color: #5850ff;
color: #5850ff;
}
}
.footer-panel {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 0px;
height: 64px;
width: 100%;
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
</style>
......@@ -15,8 +15,8 @@
<span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.name }}({{ i.tips }});</span>
</div> -->
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" :disabled="scope.scope.isRemind == 1" @click="btnClick('edit', scope.scope)">提醒发送</el-button>
<el-button type="text" @click="btnClick('detail', scope.scope)">详情</el-button>
<el-button type="text" :disabled="scope.scope.isRemind == 1" @click="btnClick('edit', 1, scope.scope)">提醒发送</el-button>
<el-button type="text" @click="btnClick('detail', 2, scope.scope)">详情</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
......@@ -32,8 +32,8 @@
<span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.name }}({{ i.tips }});</span>
</div> -->
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" :disabled="scope.scope.isRemind == 1" @click="btnClick('edit', scope.scope)">提醒发送</el-button>
<el-button type="text" @click="btnClick('detail', scope.scope)">详情</el-button>
<el-button type="text" :disabled="scope.scope.isRemind == 1" @click="btnClick('edit', 2, scope.scope)">提醒发送</el-button>
<el-button type="text" @click="btnClick('detail', 2, scope.scope)">详情</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
......@@ -197,6 +197,13 @@ export default {
this.$router.push('/customerTransform/addCustomerGroup')
}
break
case 'detail':
if (type == 1) {
this.$router.push('/customerTransform/detailCustomer')
} else {
this.$router.push('/customerTransform/detaiCustomeGroup')
}
break
default:
console.log(11)
}
......
<!-- 商品管理-门店 -->
<template>
<div class="marketing pro-group">
<div class="m-b-20">
<el-button :size="size" type="primary" class="el-icon-plus" @click="addCashCoupon()">新增秒杀活动</el-button>
</div>
<div class="container">
<div>
<glsx-combi-form ref="showSearch" labelWidth="100px" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleReset">重置</el-button>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="coupon" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<template slot="activityImg" slot-scope="scope">
<img class="img-60" :src="scope.scope.activityImg"/>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button v-if="scope.scope.activityStatus == '1'" type="text" @click="start(scope.scope)">开始</el-button>
<el-button v-if="scope.scope.activityStatus == '2'" type="text" @click="end(scope.scope)">结束</el-button>
<el-button v-if="scope.scope.activityStatus == '1'" type="text" @click="handleEdit(2,scope.scope)">编辑</el-button>
<el-button v-if="scope.scope.activityStatus == '2' || scope.scope.activityStatus == '3'" type="text" @click="handleEdit(3,scope.scope)">查看</el-button>
<el-button v-if="scope.scope.activityStatus == '3'" type="text" @click="del(scope.scope)">删除</el-button>
<el-button type="text" @click="topping(scope.scope)">置顶</el-button>
<el-button v-if="scope.scope.activityStatus == '1' || scope.scope.activityStatus == '2'" type="text" @click="share(scope.scope)">分享</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 分享 -->
<share-dialog :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></share-dialog>
</div>
</template>
<script>
import shareDialog from '../productGroup/components/shareDialog'
import * as dayjs from 'dayjs'
export default {
name: 'coupon',
data() {
return {
size: 'small',
downForm: {
id: '',
offReason: '',
goodsStatus: 0
},
// 分享
isShareVisible: false,
shareForm: {},
// 表格
searchForm: {
activityName: '',
activityStatus: ''
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '活动名称',
name: 'activityName',
type: 'input',
maxlength: 20
},
{
label: '状态',
name: 'activityStatus',
type: 'select',
width: '160px',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'statusList'
}
],
// 表格
getListApi: this.$apis.seckillActivity.getActivityPageApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '活动名称',
prop: 'activityName'
},
{
label: '缩略图',
prop: 'activityImg',
addHtml: 'activityImg'
},
{
label: '浏览量(次)',
prop: 'viewAmount'
},
{
label: '销量',
prop: 'saleAmount'
},
{
label: '秒杀价(元)',
name: 'activityPrice',
formatter: cellValue => {
if(cellValue.activityPrice){
return (cellValue.activityPrice/100).toFixed(2);
}
return '';
}
},
{
label: '库存',
prop: 'goodsStock'
},
{
label: '创建日期',
name: 'createdDate',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '活动状态',
name: 'activityStatus',
formatter: cellValue => {
return this.baseData.statusList.find(item => item.confId == cellValue.activityStatus).confName
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total'},
baseData: {
statusList: [{
confId: '1',
confName: '未开始 '
}, {
confId: '2',
confName: '进行中'
}, {
confId: '3',
confName: '已结束'
}],
}
}
},
components: {
shareDialog
},
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
// delete this.tableSearchForm.createDate
resolve()
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
//开始
start(item){
this.startOrEndConfirm('开始',item)
},
//结束
end(item){
this.startOrEndConfirm('结束',item)
},
startOrEndConfirm(txt,row) {
var title = txt
var params = {}
params.id = row.id
if(txt == '开始'){
params.activityStatus = '2' //活动状态(1:未开始,2:开始,3:结束)
}else if(txt == '结束'){
params.activityStatus = '3' //活动状态(1:未开始,2:开始,3:结束)
}
this.secondConfirm(title, '确定要' + txt + '此活动?', 'seckillActivity', 'toggleStatusApi', params)
},
//置顶
topping(row){
var params = {}
params.id = row.id
this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params)
},
//删除
del(row){
var params = {}
params.id = row.id
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params)
},
//新增代金券
addCashCoupon() {
this.$router.push('/couponManage/editCashCoupon/1')
},
// addOrEdit:1-新增;2-编辑;3-查看
handleEdit(addOrEdit, row) {
var goto = ''
if(row.discountType == '3'){//代金券
goto = '/couponManage/editCashCoupon/'
}else if(row.discountType == '7'){//会员服务
goto = '/couponManage/editMemberService/'
}
console.log(goto + addOrEdit + '/' + row.id);
this.$router.push(goto + addOrEdit + '/' + row.id)
},
handleShare(row) {
this.$apis.proManage.getProShareApi({ id: row.id }).then(res => {
this.shareForm = res
this.handleShareClose()
})
},
handleShareClose() {
this.isShareVisible = !this.isShareVisible
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
handleSearch() {
this.$refs.coupon.refreshTable()
},
handleReset() {
this.searchForm = {
activityName: '',
activityStatus: ''
}
this.handleSearch()
}
}
}
</script>
<style scoped></style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!