Commit b25e7a1d by 前端

Merge branch 'chenwq_dev_v2.3.0' into 'v2.3.0'

v2.3.0优惠券需求开发和联调。

See merge request !132
2 parents 6ea771a9 6703d00d
...@@ -3,7 +3,7 @@ import { http } from '@/main' ...@@ -3,7 +3,7 @@ import { http } from '@/main'
const defaultPath = 'scrm.api.coupon.' const defaultPath = 'scrm.api.coupon.'
//优惠券列表 //优惠券列表
const getMerchantListApi = params => { const getCouponListApi = params => {
// params.method = `${defaultPath}list.merchant` // params.method = `${defaultPath}list.merchant`
params.method = 'scrm.backstage.coupon.list.merchant' params.method = 'scrm.backstage.coupon.list.merchant'
return http({ return http({
...@@ -25,6 +25,28 @@ const couponExportApi = params => { ...@@ -25,6 +25,28 @@ const couponExportApi = params => {
}) })
} }
//优惠券列表-集团-导出
const couponGroupExportApi = params => {
params.method = 'scrm.api.coupon.gh.group.list.export'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
//优惠券列表-门店-导出
const couponStoreExportApi = params => {
params.method = 'scrm.api.coupon.gh.store.list.export'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
//生效/失效 //生效/失效
const effectiveCouponApi = params => { const effectiveCouponApi = params => {
params.method = `${defaultPath}effective` params.method = `${defaultPath}effective`
...@@ -49,6 +71,17 @@ const deleteCouponApi = params => { ...@@ -49,6 +71,17 @@ const deleteCouponApi = params => {
}) })
} }
// 核销记录-券来源
const getPackageListApi = params => {
params.method = 'scrm.api.equity.package.gh.list.with.page'
return http({
url: 'rop-scrm-equity/router',
method: 'GET',
data: params,
sign: true
})
}
//核销记录列表 //核销记录列表
const getVerificationListApi = params => { const getVerificationListApi = params => {
params.method = `${defaultPath}verification.code.verification.list` params.method = `${defaultPath}verification.code.verification.list`
...@@ -151,4 +184,4 @@ const getAllGoodsApi = params => { ...@@ -151,4 +184,4 @@ const getAllGoodsApi = params => {
}) })
} }
export default { getMerchantListApi, couponExportApi, getVerificationListApi, verificationExportApi, effectiveCouponApi, codeVerificationApi, getCouponDetailApi, deleteCouponApi, createCouponApi, updateCouponApi, getAllGoodsApi, getListReceiveRecordApi, exportReceiveRecordApi } export default { getCouponListApi, couponExportApi, couponGroupExportApi, couponStoreExportApi, getPackageListApi, getVerificationListApi, verificationExportApi, effectiveCouponApi, codeVerificationApi, getCouponDetailApi, deleteCouponApi, createCouponApi, updateCouponApi, getAllGoodsApi, getListReceiveRecordApi, exportReceiveRecordApi }
...@@ -98,4 +98,4 @@ const verificationExportApi = params => { ...@@ -98,4 +98,4 @@ const verificationExportApi = params => {
// }) // })
// } // }
export { getRecordListApi, getVerificationCode, verificationExportApi } export default { getRecordListApi, getVerificationCode, verificationExportApi }
...@@ -179,6 +179,14 @@ html { ...@@ -179,6 +179,14 @@ html {
background-color: #999999; background-color: #999999;
} }
.marketing .back-green {
background-color: #2CCA74;
}
.marketing .back-red {
background-color: #EB4E4E;
}
.marketing .el-table .cell { .marketing .el-table .cell {
line-height: 16px; line-height: 16px;
} }
......
...@@ -83,6 +83,12 @@ const staticRoutes = Object.freeze([ ...@@ -83,6 +83,12 @@ const staticRoutes = Object.freeze([
meta: {} meta: {}
}, },
{ {
name: 'recordList',
path: '/couponManage/recordList',
component: resolve => require([`@/views/couponManage/recordList.vue`], resolve),
meta: {}
},
{
name: 'editCashCoupon', name: 'editCashCoupon',
path: '/couponManage/editCashCoupon/:addOrEdit', path: '/couponManage/editCashCoupon/:addOrEdit',
component: resolve => require([`@/views/couponManage/editCashCoupon.vue`], resolve), component: resolve => require([`@/views/couponManage/editCashCoupon.vue`], resolve),
......
...@@ -23,7 +23,7 @@ export async function bootstrap({ history, common, messenger, globalState, route ...@@ -23,7 +23,7 @@ export async function bootstrap({ history, common, messenger, globalState, route
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox Vue.prototype.$messageBox = messageBox
// 集团版集团账号 // 集团版集团账号
Vue.prototype.$isGroupUp = globalState.session.merchantModel == 1 && globalState.session.accountLevel != 4 Vue.prototype.$isGroupUp = globalState.session.accountLevel != 4
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
......
<!-- 编辑代金券 --> <!-- 编辑代金券 -->
<template> <template>
<div class="edit-share marketing p-t-20 edit-box"> <div class="edit-share marketing p-t-20 edit-box">
<div class="container edit-container" style="position: relative"> <div class="container edit-container" style="position: relative" v-loading="loading">
<div class="right_show"> <div class="right_show">
<div class="card-top"></div> <div class="card-top"></div>
<div class="slider"> <div class="slider">
...@@ -169,6 +169,7 @@ export default { ...@@ -169,6 +169,7 @@ export default {
footerLeft: '0', footerLeft: '0',
footerWidth: '0', footerWidth: '0',
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
loading: false,
routeInfo: { routeInfo: {
// 1-新增;2-编辑;3-查看 // 1-新增;2-编辑;3-查看
addOrEdit: 1, addOrEdit: 1,
...@@ -198,7 +199,8 @@ export default { ...@@ -198,7 +199,8 @@ export default {
full: '', full: '',
goods: '1', goods: '1',
goodsRefList: [], goodsRefList: [],
directionalFlag: '1' directionalFlag: '1',
scopeApplication: ''
}, },
//商品列表 //商品列表
tableParams: { tableParams: {
...@@ -319,15 +321,16 @@ export default { ...@@ -319,15 +321,16 @@ export default {
], ],
// 适用门店 // 适用门店
merchantRule: { merchantRule: {
merchantRadio: [{ required: true, message: '请选择适用范围', trigger: 'change' }] scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
}, },
merchantEditFormData: [ merchantEditFormData: [
{ {
label: '适用范围', label: '适用范围',
name: 'merchantRadio', name: 'scopeApplication',
type: 'radio', type: 'radio',
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
isDisabled: false,
optionList: [ optionList: [
{ {
confId: '1', confId: '1',
...@@ -361,6 +364,7 @@ export default { ...@@ -361,6 +364,7 @@ export default {
this.title = '查看' this.title = '查看'
let idx = this.editFormData.findIndex(item => item.name == 'editHtml') let idx = this.editFormData.findIndex(item => item.name == 'editHtml')
this.editFormData[idx].isHide = false this.editFormData[idx].isHide = false
this.setAllDisabled('merchantEditFormData')
} else if (addOrEdit == 2) { } else if (addOrEdit == 2) {
this.apear = 'couponEdit' this.apear = 'couponEdit'
this.title = '编辑' this.title = '编辑'
...@@ -474,6 +478,11 @@ export default { ...@@ -474,6 +478,11 @@ export default {
}, },
methods: { methods: {
setAllDisabled(editName) {
this[editName].forEach(item => {
item.isDisabled = true
})
},
editCoupon(attribute) { editCoupon(attribute) {
attribute.forEach(item => { attribute.forEach(item => {
let index = this.editFormData.findIndex(val => val.name == `${item}`) let index = this.editFormData.findIndex(val => val.name == `${item}`)
...@@ -512,7 +521,10 @@ export default { ...@@ -512,7 +521,10 @@ export default {
if (goodsName) { if (goodsName) {
params.goodsName = goodsName params.goodsName = goodsName
} }
this.$apis.couponManage.getAllGoodsApi(params).then(res => { this.loading = true
this.$apis.couponManage
.getAllGoodsApi(params)
.then(res => {
const goods = this.$common.utils.deepClone(res.list) const goods = this.$common.utils.deepClone(res.list)
this.selectedAllProList = goods this.selectedAllProList = goods
if (goods && goods.length > 0) { if (goods && goods.length > 0) {
...@@ -527,6 +539,11 @@ export default { ...@@ -527,6 +539,11 @@ export default {
} }
this.routeInfo.addOrEdit != 1 ? this.getInfo() : '' this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
}) })
.finally(() => {
if (this.routeInfo.addOrEdit == 1) {
this.loading = false
}
})
}, },
//选择商品 //选择商品
...@@ -591,7 +608,10 @@ export default { ...@@ -591,7 +608,10 @@ export default {
}, },
getInfo() { getInfo() {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => { this.loading = true
this.$apis.couponManage
.getCouponDetailApi({ couponId: this.routeInfo.id })
.then(res => {
this.editForm = this.$common.utils.deepClone(res) this.editForm = this.$common.utils.deepClone(res)
this.editForm.effectiveTime = [] this.editForm.effectiveTime = []
this.editForm.useChannel = this.editForm.useChannel + '' this.editForm.useChannel = this.editForm.useChannel + ''
...@@ -599,6 +619,9 @@ export default { ...@@ -599,6 +619,9 @@ export default {
this.editForm.effectiveType = this.editForm.effectiveType + '' this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.useBarriers = this.editForm.useBarriers + '' this.editForm.useBarriers = this.editForm.useBarriers + ''
this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2) this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2)
if (this.$isGroupUp) {
this.editForm.scopeApplication = this.editForm.scopeApplication + ''
}
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if (this.editForm.effectiveType == 2) { if (this.editForm.effectiveType == 2) {
...@@ -617,6 +640,9 @@ export default { ...@@ -617,6 +640,9 @@ export default {
this.editStatus = false this.editStatus = false
}) })
}) })
.finally(() => {
this.loading = false
})
}, },
validateRules() { validateRules() {
...@@ -689,7 +715,12 @@ export default { ...@@ -689,7 +715,12 @@ export default {
//面值 //面值
obj.denomination = form.denomination obj.denomination = form.denomination
//库存 //库存
obj.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
obj.stock = form.stock obj.stock = form.stock
} else {
obj.scopeApplication = form.scopeApplication
}
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次) //类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
obj.useType = 1 obj.useType = 1
//有效期或者间隔天数使用次数 //有效期或者间隔天数使用次数
...@@ -742,6 +773,7 @@ export default { ...@@ -742,6 +773,7 @@ export default {
} else { } else {
method = 'createCouponApi' //后台创建优惠券 method = 'createCouponApi' //后台创建优惠券
} }
console.log(params)
this.$apis.couponManage[method](params).then(res => { this.$apis.couponManage[method](params).then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : res.message, message: res.code == '0' ? '操作成功' : res.message,
......
<!-- 编辑折扣券 --> <!-- 编辑折扣券 -->
<template> <template>
<div class="edit-share marketing p-t-20 edit-box"> <div class="edit-share marketing p-t-20 edit-box">
<div class="container edit-container" style="position: relative"> <div class="container edit-container" style="position: relative" v-loading="loading">
<!-- <div class="right_show"> <!-- <div class="right_show">
<div class="card-top"></div> <div class="card-top"></div>
<div class="card-middle"> <div class="card-middle">
...@@ -165,6 +165,7 @@ export default { ...@@ -165,6 +165,7 @@ export default {
footerLeft: '0', footerLeft: '0',
footerWidth: '0', footerWidth: '0',
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
loading: false,
// pickerOptions: { // pickerOptions: {
// disabledDate(v) {//禁用当前之前的日期 // disabledDate(v) {//禁用当前之前的日期
// return v.getTime() < new Date().getTime() - 86400000; // return v.getTime() < new Date().getTime() - 86400000;
...@@ -200,7 +201,8 @@ export default { ...@@ -200,7 +201,8 @@ export default {
effectiveDays: '', effectiveDays: '',
anticipatedCost: '', anticipatedCost: '',
discountIntensity: '', discountIntensity: '',
directionalFlag: '1' directionalFlag: '1',
scopeApplication: ''
}, },
editRule: { editRule: {
anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }], anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
...@@ -273,15 +275,16 @@ export default { ...@@ -273,15 +275,16 @@ export default {
], ],
// 适用门店 // 适用门店
merchantRule: { merchantRule: {
merchantRadio: [{ required: true, message: '请选择适用范围', trigger: 'change' }] scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
}, },
merchantEditFormData: [ merchantEditFormData: [
{ {
label: '适用范围', label: '适用范围',
name: 'merchantRadio', name: 'scopeApplication',
type: 'radio', type: 'radio',
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
isDisabled: false,
optionList: [ optionList: [
{ {
confId: '1', confId: '1',
...@@ -316,6 +319,7 @@ export default { ...@@ -316,6 +319,7 @@ export default {
this.title = '查看' this.title = '查看'
const editHtmlIndex = this.editFormData.findIndex(val => val.addHtml == 'editHtml') const editHtmlIndex = this.editFormData.findIndex(val => val.addHtml == 'editHtml')
this.editFormData[editHtmlIndex].isHide = false this.editFormData[editHtmlIndex].isHide = false
this.setAllDisabled('merchantEditFormData')
} else if (addOrEdit == 2) { } else if (addOrEdit == 2) {
this.apear = 'couponEdit' this.apear = 'couponEdit'
this.title = '编辑' this.title = '编辑'
...@@ -375,6 +379,11 @@ export default { ...@@ -375,6 +379,11 @@ export default {
} }
}, },
methods: { methods: {
setAllDisabled(editName) {
this[editName].forEach(item => {
item.isDisabled = true
})
},
editCoupon(attribute) { editCoupon(attribute) {
attribute.forEach(item => { attribute.forEach(item => {
let index = this.editFormData.findIndex(val => val.name == `${item}`) let index = this.editFormData.findIndex(val => val.name == `${item}`)
...@@ -407,7 +416,10 @@ export default { ...@@ -407,7 +416,10 @@ export default {
}, },
getInfo() { getInfo() {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => { this.loading = true
this.$apis.couponManage
.getCouponDetailApi({ couponId: this.routeInfo.id })
.then(res => {
console.log(res) console.log(res)
this.editForm = this.$common.utils.deepClone(res) this.editForm = this.$common.utils.deepClone(res)
this.editForm.directionalFlag = this.editForm.directionalFlag + '' this.editForm.directionalFlag = this.editForm.directionalFlag + ''
...@@ -415,6 +427,9 @@ export default { ...@@ -415,6 +427,9 @@ export default {
this.editForm.useBarriers = this.editForm.useBarriers + '' this.editForm.useBarriers = this.editForm.useBarriers + ''
this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2) this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2)
this.editForm.discountIntensity = (this.editForm.discountIntensity / 100).toFixed(2) this.editForm.discountIntensity = (this.editForm.discountIntensity / 100).toFixed(2)
if (this.$isGroupUp) {
this.editForm.scopeApplication = this.editForm.scopeApplication + ''
}
//使用限制,满多少元可用 //使用限制,满多少元可用
if (this.editForm.useBarriers == 2) { if (this.editForm.useBarriers == 2) {
this.editForm.full = this.editForm.full this.editForm.full = this.editForm.full
...@@ -428,6 +443,9 @@ export default { ...@@ -428,6 +443,9 @@ export default {
this.editStatus = false this.editStatus = false
}) })
}) })
.finally(() => {
this.loading = false
})
}, },
validateRules() { validateRules() {
...@@ -488,7 +506,12 @@ export default { ...@@ -488,7 +506,12 @@ export default {
obj.full = form.full obj.full = form.full
} }
//库存 //库存
obj.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
obj.stock = form.stock obj.stock = form.stock
} else {
obj.scopeApplication = form.scopeApplication
}
//折扣 //折扣
obj.discountIntensity = (form.discountIntensity * 100).toFixed(0) obj.discountIntensity = (form.discountIntensity * 100).toFixed(0)
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次) //类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
......
<!-- 编辑兑换券 --> <!-- 编辑兑换券 -->
<template> <template>
<div class="edit-share marketing p-t-20 edit-box"> <div class="edit-share marketing p-t-20 edit-box">
<div class="container edit-container" style="position: relative"> <div class="container edit-container" style="position: relative" v-loading="loading">
<div class="right_show"> <div class="right_show">
<div class="card-top"></div> <div class="card-top"></div>
<div class="slider"> <div class="slider">
...@@ -128,6 +128,7 @@ export default { ...@@ -128,6 +128,7 @@ export default {
footerLeft: '0', footerLeft: '0',
footerWidth: '0', footerWidth: '0',
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
loading: false,
editStatus: false, editStatus: false,
// pickerOptions: { // pickerOptions: {
// disabledDate(v) {//禁用当前之前的日期 // disabledDate(v) {//禁用当前之前的日期
...@@ -160,7 +161,8 @@ export default { ...@@ -160,7 +161,8 @@ export default {
effectiveTime: [], effectiveTime: [],
effectiveDays: '', effectiveDays: '',
anticipatedCost: '', anticipatedCost: '',
directionalFlag: '1' directionalFlag: '1',
scopeApplication: ''
}, },
editRule: { editRule: {
anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }], anticipatedCost: [{ required: true, message: '请输入预估成本', trigger: 'change' }],
...@@ -219,15 +221,16 @@ export default { ...@@ -219,15 +221,16 @@ export default {
], ],
// 适用门店 // 适用门店
merchantRule: { merchantRule: {
merchantRadio: [{ required: true, message: '请选择适用范围', trigger: 'change' }] scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
}, },
merchantEditFormData: [ merchantEditFormData: [
{ {
label: '适用范围', label: '适用范围',
name: 'merchantRadio', name: 'scopeApplication',
type: 'radio', type: 'radio',
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
isDisabled: false,
optionList: [ optionList: [
{ {
confId: '1', confId: '1',
...@@ -262,6 +265,7 @@ export default { ...@@ -262,6 +265,7 @@ export default {
this.editFormData[editHtmlIndex].isHide = false this.editFormData[editHtmlIndex].isHide = false
this.showSubmit = false this.showSubmit = false
this.title = '查看' this.title = '查看'
this.setAllDisabled('merchantEditFormData')
} else if (addOrEdit == 2) { } else if (addOrEdit == 2) {
this.apear = 'couponEdit' this.apear = 'couponEdit'
this.title = '编辑' this.title = '编辑'
...@@ -309,6 +313,11 @@ export default { ...@@ -309,6 +313,11 @@ export default {
}, },
methods: { methods: {
setAllDisabled(editName) {
this[editName].forEach(item => {
item.isDisabled = true
})
},
editCoupon(attribute) { editCoupon(attribute) {
attribute.forEach(item => { attribute.forEach(item => {
let index = this.editFormData.findIndex(val => val.name == `${item}`) let index = this.editFormData.findIndex(val => val.name == `${item}`)
...@@ -333,11 +342,17 @@ export default { ...@@ -333,11 +342,17 @@ export default {
}, },
getInfo() { getInfo() {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => { this.loading = true
this.$apis.couponManage
.getCouponDetailApi({ couponId: this.routeInfo.id })
.then(res => {
this.editForm = this.$common.utils.deepClone(res) this.editForm = this.$common.utils.deepClone(res)
this.editForm.directionalFlag = this.editForm.directionalFlag + '' this.editForm.directionalFlag = this.editForm.directionalFlag + ''
this.editForm.effectiveType = this.editForm.effectiveType + '' this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2) this.editForm.anticipatedCost = (this.editForm.anticipatedCost / 100).toFixed(2)
if (this.$isGroupUp) {
this.editForm.scopeApplication = this.editForm.scopeApplication + ''
}
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if (this.editForm.effectiveType == 2) { if (this.editForm.effectiveType == 2) {
...@@ -346,6 +361,8 @@ export default { ...@@ -346,6 +361,8 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.editStatus = false this.editStatus = false
}) })
}).finally(() => {
this.loading = false
}) })
}, },
...@@ -394,7 +411,12 @@ export default { ...@@ -394,7 +411,12 @@ export default {
} }
//库存 //库存
obj.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
obj.stock = form.stock obj.stock = form.stock
} else {
obj.scopeApplication = form.scopeApplication
}
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次) //类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
obj.useType = 1 obj.useType = 1
//有效期或者间隔天数使用次数 //有效期或者间隔天数使用次数
......
<!-- 编辑会员服务 --> <!-- 编辑服务券 -->
<template> <template>
<div class="edit-share marketing p-t-20 edit-box"> <div class="edit-share marketing p-t-20 edit-box">
<div class="container edit-container"> <div class="container edit-container" v-loading="loading">
<p class="edit-title">{{ title }}会员服务</p> <p class="edit-title">{{ title }}服务券</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<template slot="effectiveHtml"> <template slot="effectiveHtml">
<el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">无有效期</el-radio> <el-radio v-model="editForm.effectiveType" label="3" :disabled="apear != 'couponAdd'">无有效期</el-radio>
...@@ -97,6 +97,7 @@ export default { ...@@ -97,6 +97,7 @@ export default {
footerLeft: '0', footerLeft: '0',
footerWidth: '0', footerWidth: '0',
editChildRef: 'editChildRef', editChildRef: 'editChildRef',
loading: false,
// pickerOptions: { // pickerOptions: {
// disabledDate(v) {//禁用当前之前的日期 // disabledDate(v) {//禁用当前之前的日期
// return v.getTime() < new Date().getTime() - 86400000; // return v.getTime() < new Date().getTime() - 86400000;
...@@ -118,7 +119,8 @@ export default { ...@@ -118,7 +119,8 @@ export default {
effectiveType: '3', effectiveType: '3',
useType: '0', useType: '0',
usageTimes: 1, usageTimes: 1,
usageTimes2: 1 usageTimes2: 1,
scopeApplication: ''
}, },
editRule: { editRule: {
couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }], couponName: [{ required: true, message: '请输入优惠券名称', trigger: 'change' }],
...@@ -179,15 +181,16 @@ export default { ...@@ -179,15 +181,16 @@ export default {
], ],
// 适用门店 // 适用门店
merchantRule: { merchantRule: {
merchantRadio: [{ required: true, message: '请选择适用范围', trigger: 'change' }] scopeApplication: [{ required: true, message: '请选择适用范围', trigger: 'change' }]
}, },
merchantEditFormData: [ merchantEditFormData: [
{ {
label: '适用范围', label: '适用范围',
name: 'merchantRadio', name: 'scopeApplication',
type: 'radio', type: 'radio',
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
isDisabled: false,
optionList: [ optionList: [
{ {
confId: '1', confId: '1',
...@@ -219,6 +222,7 @@ export default { ...@@ -219,6 +222,7 @@ export default {
if (addOrEdit == 3) { if (addOrEdit == 3) {
this.apear = 'couponSee' this.apear = 'couponSee'
this.title = '查看' this.title = '查看'
this.setAllDisabled('merchantEditFormData')
} else if (addOrEdit == 2) { } else if (addOrEdit == 2) {
this.apear = 'couponEdit' this.apear = 'couponEdit'
this.title = '编辑' this.title = '编辑'
...@@ -267,16 +271,27 @@ export default { ...@@ -267,16 +271,27 @@ export default {
}, },
methods: { methods: {
setAllDisabled(editName) {
this[editName].forEach(item => {
item.isDisabled = true
})
},
setDateString(objField, special) { setDateString(objField, special) {
var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日') var value = typeof objField == 'string' ? objField.split(' ')[0] : special ? objField.format('YYYY年MM月DD日') : objField.format('YYYY年MM月DD日')
return value return value
}, },
getInfo() { getInfo() {
this.$apis.couponManage.getCouponDetailApi({ couponId: this.routeInfo.id }).then(res => { this.loading = true
this.$apis.couponManage
.getCouponDetailApi({ couponId: this.routeInfo.id })
.then(res => {
this.editForm = this.$common.utils.deepClone(res) this.editForm = this.$common.utils.deepClone(res)
this.editForm.effectiveType = this.editForm.effectiveType + '' this.editForm.effectiveType = this.editForm.effectiveType + ''
this.editForm.useType = this.editForm.useType + '' this.editForm.useType = this.editForm.useType + ''
if (this.$isGroupUp) {
this.editForm.scopeApplication = this.editForm.scopeApplication + ''
}
//有效期 //有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期 //有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
...@@ -289,6 +304,8 @@ export default { ...@@ -289,6 +304,8 @@ export default {
} else if (this.editForm.useType == 2) { } else if (this.editForm.useType == 2) {
this.editForm.usageTimes2 = this.editForm.useAmount this.editForm.usageTimes2 = this.editForm.useAmount
} }
}).finally(() => {
this.loading = false
}) })
}, },
...@@ -332,7 +349,7 @@ export default { ...@@ -332,7 +349,7 @@ export default {
//编辑时只允许编辑使用说明 //编辑时只允许编辑使用说明
//优惠券名称 //优惠券名称
obj.couponName = form.couponName obj.couponName = form.couponName
//优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务 //优惠券类型 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:服务券
obj.discountType = '7' obj.discountType = '7'
//有效期 //有效期
...@@ -364,7 +381,12 @@ export default { ...@@ -364,7 +381,12 @@ export default {
//门店价 //门店价
obj.shopPrice = form.shopPrice obj.shopPrice = form.shopPrice
//库存 //库存
obj.limitStockFlag = this.$isGroupUp ? 2 : 1
if (!this.$isGroupUp) {
obj.stock = form.stock obj.stock = form.stock
} else {
obj.scopeApplication = form.scopeApplication
}
} }
//使用描述 //使用描述
obj.useDescription = form.useDescription obj.useDescription = form.useDescription
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<script> <script>
import glsxDialog from '@/components/glsx-dialog' import glsxDialog from '@/components/glsx-dialog'
import { getRecordListApi, getVerificationCode, verificationExportApi } from '@/api/modules/record' // import { getRecordListApi, getVerificationCode, verificationExportApi } from '@/api/modules/record'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import { dateFormat } from '@/utils/index.js' import { dateFormat } from '@/utils/index.js'
import { exportFn } from '@/common/constant' import { exportFn } from '@/common/constant'
...@@ -105,7 +105,7 @@ export default { ...@@ -105,7 +105,7 @@ export default {
// 44187877 // 44187877
searchFormTable: {}, searchFormTable: {},
// 表格组件 // 表格组件
getListApi: getRecordListApi, getListApi: this.$apis.record.getRecordListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数 // 表格参数
tableParams: { tableParams: {
...@@ -233,7 +233,7 @@ export default { ...@@ -233,7 +233,7 @@ export default {
let params = {} let params = {}
params.verficationCode = this.ruleForm.verficationCode params.verficationCode = this.ruleForm.verficationCode
// params.discountTypes=[7] // params.discountTypes=[7]
getVerificationCode(params).then(res => { this.$apis.record.getVerificationCode(params).then(res => {
if (res) { if (res) {
this.handleClose() this.handleClose()
this.handleSearch() this.handleSearch()
...@@ -262,7 +262,7 @@ export default { ...@@ -262,7 +262,7 @@ export default {
handleExport(row) { handleExport(row) {
var params = this.getParams() var params = this.getParams()
verificationExportApi(params).then(res => { this.$apis.record.verificationExportApi(params).then(res => {
exportFn(res) exportFn(res)
}) })
}, },
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<el-tab-pane label="基本信息" name="basicInfo"></el-tab-pane> <el-tab-pane label="基本信息" name="basicInfo"></el-tab-pane>
<el-tab-pane label="评价信息" name="afterOrder"></el-tab-pane> <el-tab-pane label="评价信息" name="afterOrder"></el-tab-pane>
</el-tabs> </el-tabs>
<div v-show="routeInfo.addOrEdit == '1' || (['2', '3'].includes(routeInfo.addOrEdit + '') && activeName == 'basicInfo')" class="container edit-container"> <div v-show="routeInfo.addOrEdit == '1' || (['2', '3'].includes(routeInfo.addOrEdit + '') && activeName == 'basicInfo')" v-loading="loading" class="container edit-container">
<div class="flex"> <div class="flex">
<div class="home-set-form flex-grow"> <div class="home-set-form flex-grow">
<div v-for="(item, index) in externalFormList" :key="index"> <div v-for="(item, index) in externalFormList" :key="index">
...@@ -323,6 +323,7 @@ export default { ...@@ -323,6 +323,7 @@ export default {
name: 'editProduct', name: 'editProduct',
data() { data() {
return { return {
loading: false,
dialogTableVisible: false, dialogTableVisible: false,
associationRadio: '', associationRadio: '',
templateSelection: [], templateSelection: [],
...@@ -1564,7 +1565,10 @@ export default { ...@@ -1564,7 +1565,10 @@ export default {
deleteAttrList.forEach(item => { deleteAttrList.forEach(item => {
delete params[item] delete params[item]
}) })
this.$apis.proManage.insertOrUpdateProApi(params).then(res => { this.loading = true
this.$apis.proManage
.insertOrUpdateProApi(params)
.then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : res.message, message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
...@@ -1573,6 +1577,9 @@ export default { ...@@ -1573,6 +1577,9 @@ export default {
this.cancelJump() this.cancelJump()
} }
}) })
.finally(() => {
this.loading = false
})
}, },
cancelJump() { cancelJump() {
this.$router.push({ this.$router.push({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!