Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-marketing
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit eecda43d
authored
May 17, 2022
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优惠券列表;新增/编辑loading
1 parent
001b8ddb
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
268 additions
and
130 deletions
src/api/modules/couponManage.js
src/views/couponManage/editCashCoupon.vue
src/views/couponManage/editDiscountCoupon.vue
src/views/couponManage/editExchangeCoupon.vue
src/views/couponManage/editMemberService.vue
src/views/couponManage/index.vue
src/views/couponManage/receiveDetail.vue
src/views/couponManage/recordList.vue
src/api/modules/couponManage.js
View file @
eecda43
...
@@ -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
get
Merchant
ListApi
=
params
=>
{
const
get
Coupon
ListApi
=
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
({
...
@@ -151,4 +151,4 @@ const getAllGoodsApi = params => {
...
@@ -151,4 +151,4 @@ const getAllGoodsApi = params => {
})
})
}
}
export
default
{
get
Merchant
ListApi
,
couponExportApi
,
getVerificationListApi
,
verificationExportApi
,
effectiveCouponApi
,
codeVerificationApi
,
getCouponDetailApi
,
deleteCouponApi
,
createCouponApi
,
updateCouponApi
,
getAllGoodsApi
,
getListReceiveRecordApi
,
exportReceiveRecordApi
}
export
default
{
get
Coupon
ListApi
,
couponExportApi
,
getVerificationListApi
,
verificationExportApi
,
effectiveCouponApi
,
codeVerificationApi
,
getCouponDetailApi
,
deleteCouponApi
,
createCouponApi
,
updateCouponApi
,
getAllGoodsApi
,
getListReceiveRecordApi
,
exportReceiveRecordApi
}
src/views/couponManage/editCashCoupon.vue
View file @
eecda43
<!-- 编辑代金券 -->
<!-- 编辑代金券 -->
<
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,21 +521,29 @@ export default {
...
@@ -512,21 +521,29 @@ export default {
if
(
goodsName
)
{
if
(
goodsName
)
{
params
.
goodsName
=
goodsName
params
.
goodsName
=
goodsName
}
}
this
.
$apis
.
couponManage
.
getAllGoodsApi
(
params
).
then
(
res
=>
{
this
.
loading
=
true
const
goods
=
this
.
$common
.
utils
.
deepClone
(
res
.
list
)
this
.
$apis
.
couponManage
this
.
selectedAllProList
=
goods
.
getAllGoodsApi
(
params
)
if
(
goods
&&
goods
.
length
>
0
)
{
.
then
(
res
=>
{
this
.
minPirceForAll
=
goods
[
0
].
retailPrice
const
goods
=
this
.
$common
.
utils
.
deepClone
(
res
.
list
)
goods
.
forEach
((
item
,
index
)
=>
{
this
.
selectedAllProList
=
goods
if
(
item
.
retailPrice
<
this
.
minPirceForAll
)
{
if
(
goods
&&
goods
.
length
>
0
)
{
this
.
minPirceForAll
=
item
.
retailPrice
this
.
minPirceForAll
=
goods
[
0
].
retailPrice
}
goods
.
forEach
((
item
,
index
)
=>
{
})
if
(
item
.
retailPrice
<
this
.
minPirceForAll
)
{
}
else
{
this
.
minPirceForAll
=
item
.
retailPrice
this
.
priceFlag
=
true
}
}
})
this
.
routeInfo
.
addOrEdit
!=
1
?
this
.
getInfo
()
:
''
}
else
{
})
this
.
priceFlag
=
true
}
this
.
routeInfo
.
addOrEdit
!=
1
?
this
.
getInfo
()
:
''
})
.
finally
(()
=>
{
if
(
this
.
routeInfo
.
addOrEdit
==
1
)
{
this
.
loading
=
false
}
})
},
},
//选择商品
//选择商品
...
@@ -591,32 +608,41 @@ export default {
...
@@ -591,32 +608,41 @@ export default {
},
},
getInfo
()
{
getInfo
()
{
this
.
$apis
.
couponManage
.
getCouponDetailApi
({
couponId
:
this
.
routeInfo
.
id
}).
then
(
res
=>
{
this
.
loading
=
true
this
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
res
)
this
.
$apis
.
couponManage
this
.
editForm
.
effectiveTime
=
[]
.
getCouponDetailApi
({
couponId
:
this
.
routeInfo
.
id
})
this
.
editForm
.
useChannel
=
this
.
editForm
.
useChannel
+
''
.
then
(
res
=>
{
this
.
editForm
.
directionalFlag
=
this
.
editForm
.
directionalFlag
+
''
this
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
res
)
this
.
editForm
.
effectiveType
=
this
.
editForm
.
effectiveType
+
''
this
.
editForm
.
effectiveTime
=
[]
this
.
editForm
.
useBarriers
=
this
.
editForm
.
useBarriers
+
''
this
.
editForm
.
useChannel
=
this
.
editForm
.
useChannel
+
''
this
.
editForm
.
anticipatedCost
=
(
this
.
editForm
.
anticipatedCost
/
100
).
toFixed
(
2
)
this
.
editForm
.
directionalFlag
=
this
.
editForm
.
directionalFlag
+
''
//有效期
this
.
editForm
.
effectiveType
=
this
.
editForm
.
effectiveType
+
''
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
this
.
editForm
.
useBarriers
=
this
.
editForm
.
useBarriers
+
''
if
(
this
.
editForm
.
effectiveType
==
2
)
{
this
.
editForm
.
anticipatedCost
=
(
this
.
editForm
.
anticipatedCost
/
100
).
toFixed
(
2
)
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
if
(
this
.
$isGroupUp
)
{
}
this
.
editForm
.
scopeApplication
=
this
.
editForm
.
scopeApplication
+
''
this
.
editForm
.
goodsRefList
=
[]
}
if
(
this
.
editForm
.
goodsIds
&&
this
.
editForm
.
goodsIds
.
length
>
0
)
{
//有效期
this
.
editForm
.
goodsIds
.
forEach
((
goodsId
,
index
)
=>
{
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
var
good
=
this
.
selectedAllProList
.
find
(
item
=>
item
.
id
==
goodsId
)
if
(
this
.
editForm
.
effectiveType
==
2
)
{
good
.
retailPrice
=
(
good
.
retailPrice
/
100
).
toFixed
(
2
)
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
this
.
editForm
.
goodsRefList
.
push
(
good
)
}
this
.
editForm
.
goodsRefList
=
[]
if
(
this
.
editForm
.
goodsIds
&&
this
.
editForm
.
goodsIds
.
length
>
0
)
{
this
.
editForm
.
goodsIds
.
forEach
((
goodsId
,
index
)
=>
{
var
good
=
this
.
selectedAllProList
.
find
(
item
=>
item
.
id
==
goodsId
)
good
.
retailPrice
=
(
good
.
retailPrice
/
100
).
toFixed
(
2
)
this
.
editForm
.
goodsRefList
.
push
(
good
)
})
}
this
.
tableParams
.
tableOption
=
false
//去掉操作栏
this
.
$nextTick
(()
=>
{
this
.
editStatus
=
false
})
})
}
this
.
tableParams
.
tableOption
=
false
//去掉操作栏
this
.
$nextTick
(()
=>
{
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
.
stock
=
form
.
stock
obj
.
limitStockFlag
=
this
.
$isGroupUp
?
2
:
1
if
(
!
this
.
$isGroupUp
)
{
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
,
...
...
src/views/couponManage/editDiscountCoupon.vue
View file @
eecda43
<!-- 编辑折扣券 -->
<!-- 编辑折扣券 -->
<
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,27 +416,36 @@ export default {
...
@@ -407,27 +416,36 @@ export default {
},
},
getInfo
()
{
getInfo
()
{
this
.
$apis
.
couponManage
.
getCouponDetailApi
({
couponId
:
this
.
routeInfo
.
id
}).
then
(
res
=>
{
this
.
loading
=
true
console
.
log
(
res
)
this
.
$apis
.
couponManage
this
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
res
)
.
getCouponDetailApi
({
couponId
:
this
.
routeInfo
.
id
})
this
.
editForm
.
directionalFlag
=
this
.
editForm
.
directionalFlag
+
''
.
then
(
res
=>
{
this
.
editForm
.
effectiveType
=
this
.
editForm
.
effectiveType
+
''
console
.
log
(
res
)
this
.
editForm
.
useBarriers
=
this
.
editForm
.
useBarriers
+
''
this
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
res
)
this
.
editForm
.
anticipatedCost
=
(
this
.
editForm
.
anticipatedCost
/
100
).
toFixed
(
2
)
this
.
editForm
.
directionalFlag
=
this
.
editForm
.
directionalFlag
+
''
this
.
editForm
.
discountIntensity
=
(
this
.
editForm
.
discountIntensity
/
100
).
toFixed
(
2
)
this
.
editForm
.
effectiveType
=
this
.
editForm
.
effectiveType
+
''
//使用限制,满多少元可用
this
.
editForm
.
useBarriers
=
this
.
editForm
.
useBarriers
+
''
if
(
this
.
editForm
.
useBarriers
==
2
)
{
this
.
editForm
.
anticipatedCost
=
(
this
.
editForm
.
anticipatedCost
/
100
).
toFixed
(
2
)
this
.
editForm
.
full
=
this
.
editForm
.
full
this
.
editForm
.
discountIntensity
=
(
this
.
editForm
.
discountIntensity
/
100
).
toFixed
(
2
)
}
if
(
this
.
$isGroupUp
)
{
//有效期
this
.
editForm
.
scopeApplication
=
this
.
editForm
.
scopeApplication
+
''
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
}
if
(
this
.
editForm
.
effectiveType
==
2
)
{
//使用限制,满多少元可用
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
if
(
this
.
editForm
.
useBarriers
==
2
)
{
}
this
.
editForm
.
full
=
this
.
editForm
.
full
this
.
$nextTick
(()
=>
{
}
this
.
editStatus
=
false
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if
(
this
.
editForm
.
effectiveType
==
2
)
{
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
}
this
.
$nextTick
(()
=>
{
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
.
stock
=
form
.
stock
obj
.
limitStockFlag
=
this
.
$isGroupUp
?
2
:
1
if
(
!
this
.
$isGroupUp
)
{
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:根据间隔多少天限制多少次)
...
...
src/views/couponManage/editExchangeCoupon.vue
View file @
eecda43
<!-- 编辑兑换券 -->
<!-- 编辑兑换券 -->
<
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,20 +342,28 @@ export default {
...
@@ -333,20 +342,28 @@ export default {
},
},
getInfo
()
{
getInfo
()
{
this
.
$apis
.
couponManage
.
getCouponDetailApi
({
couponId
:
this
.
routeInfo
.
id
}).
then
(
res
=>
{
this
.
loading
=
true
this
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
res
)
this
.
$apis
.
couponManage
this
.
editForm
.
directionalFlag
=
this
.
editForm
.
directionalFlag
+
''
.
getCouponDetailApi
({
couponId
:
this
.
routeInfo
.
id
})
this
.
editForm
.
effectiveType
=
this
.
editForm
.
effectiveType
+
''
.
then
(
res
=>
{
this
.
editForm
.
anticipatedCost
=
(
this
.
editForm
.
anticipatedCost
/
100
).
toFixed
(
2
)
this
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
res
)
//有效期
this
.
editForm
.
directionalFlag
=
this
.
editForm
.
directionalFlag
+
''
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
this
.
editForm
.
effectiveType
=
this
.
editForm
.
effectiveType
+
''
if
(
this
.
editForm
.
effectiveType
==
2
)
{
this
.
editForm
.
anticipatedCost
=
(
this
.
editForm
.
anticipatedCost
/
100
).
toFixed
(
2
)
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
if
(
this
.
$isGroupUp
)
{
}
this
.
editForm
.
scopeApplication
=
this
.
editForm
.
scopeApplication
+
''
this
.
$nextTick
(()
=>
{
}
this
.
editStatus
=
false
//有效期
//有效类型 1:固定天数,领取后计算 2:时间段,3:无有效期
if
(
this
.
editForm
.
effectiveType
==
2
)
{
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
}
this
.
$nextTick
(()
=>
{
this
.
editStatus
=
false
})
}).
finally
(()
=>
{
this
.
loading
=
false
})
})
})
},
},
validateRules
()
{
validateRules
()
{
...
@@ -394,7 +411,12 @@ export default {
...
@@ -394,7 +411,12 @@ export default {
}
}
//库存
//库存
obj
.
stock
=
form
.
stock
obj
.
limitStockFlag
=
this
.
$isGroupUp
?
2
:
1
if
(
!
this
.
$isGroupUp
)
{
obj
.
stock
=
form
.
stock
}
else
{
obj
.
scopeApplication
=
form
.
scopeApplication
}
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
obj
.
useType
=
1
obj
.
useType
=
1
//有效期或者间隔天数使用次数
//有效期或者间隔天数使用次数
...
...
src/views/couponManage/editMemberService.vue
View file @
eecda43
<!-- 编辑会员服务 -->
<!-- 编辑会员服务 -->
<
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"
>
...
@@ -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,29 +271,42 @@ export default {
...
@@ -267,29 +271,42 @@ 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
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
res
)
this
.
$apis
.
couponManage
this
.
editForm
.
effectiveType
=
this
.
editForm
.
effectiveType
+
''
.
getCouponDetailApi
({
couponId
:
this
.
routeInfo
.
id
})
this
.
editForm
.
useType
=
this
.
editForm
.
useType
+
''
.
then
(
res
=>
{
this
.
editForm
=
this
.
$common
.
utils
.
deepClone
(
res
)
this
.
editForm
.
effectiveType
=
this
.
editForm
.
effectiveType
+
''
this
.
editForm
.
useType
=
this
.
editForm
.
useType
+
''
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
)
{
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
this
.
editForm
.
effectiveTime
=
[
this
.
editForm
.
effectiveStartTime
,
this
.
editForm
.
effectiveEndTime
]
}
}
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
//类型(0:不限制次数,1:根据有效期限制多少次,2:根据间隔多少天限制多少次)
if
(
this
.
editForm
.
useType
==
1
)
{
if
(
this
.
editForm
.
useType
==
1
)
{
this
.
editForm
.
usageTimes
=
this
.
editForm
.
useAmount
this
.
editForm
.
usageTimes
=
this
.
editForm
.
useAmount
}
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
})
},
},
validateRules
()
{
validateRules
()
{
...
@@ -364,7 +381,12 @@ export default {
...
@@ -364,7 +381,12 @@ export default {
//门店价
//门店价
obj
.
shopPrice
=
form
.
shopPrice
obj
.
shopPrice
=
form
.
shopPrice
//库存
//库存
obj
.
stock
=
form
.
stock
obj
.
limitStockFlag
=
this
.
$isGroupUp
?
2
:
1
if
(
!
this
.
$isGroupUp
)
{
obj
.
stock
=
form
.
stock
}
else
{
obj
.
scopeApplication
=
form
.
scopeApplication
}
}
}
//使用描述
//使用描述
obj
.
useDescription
=
form
.
useDescription
obj
.
useDescription
=
form
.
useDescription
...
...
src/views/couponManage/index.vue
View file @
eecda43
...
@@ -56,6 +56,7 @@
...
@@ -56,6 +56,7 @@
</template>
</template>
<
script
>
<
script
>
import
*
as
dayjs
from
'dayjs'
import
url
from
'@/assets/empty.png'
import
url
from
'@/assets/empty.png'
import
{
exportFn
}
from
'@/common/constant'
import
{
exportFn
}
from
'@/common/constant'
export
default
{
export
default
{
...
@@ -82,7 +83,7 @@ export default {
...
@@ -82,7 +83,7 @@ export default {
couponName
:
''
,
couponName
:
''
,
discountType
:
''
,
discountType
:
''
,
status
:
''
,
status
:
''
,
discountTypes
:
[
2
,
3
,
4
]
discountTypes
:
[
2
,
3
,
4
,
7
]
},
},
tableSearchForm
:
{},
tableSearchForm
:
{},
// 搜索
// 搜索
...
@@ -122,7 +123,7 @@ export default {
...
@@ -122,7 +123,7 @@ export default {
// }
// }
],
],
// 表格
// 表格
getListApi
:
this
.
$apis
.
couponManage
.
get
Merchant
ListApi
,
getListApi
:
this
.
$apis
.
couponManage
.
get
Coupon
ListApi
,
tableParams
:
{
tableParams
:
{
listName
:
'list'
,
listName
:
'list'
,
tableOption
:
true
,
tableOption
:
true
,
...
@@ -136,19 +137,51 @@ export default {
...
@@ -136,19 +137,51 @@ export default {
{
{
label
:
'券名称'
,
label
:
'券名称'
,
prop
:
'couponName'
,
prop
:
'couponName'
,
width
:
200
,
line
:
2
line
:
2
},
},
{
{
label
:
'有效期'
,
label
:
'有效期'
,
prop
:
''
prop
:
'effectiveType'
,
width
:
200
,
formatter
:
cellValue
=>
{
switch
(
cellValue
.
effectiveType
)
{
case
1
:
return
'领取后'
+
cellValue
.
effectiveDays
+
'天内有效'
case
2
:
return
dayjs
(
cellValue
.
effectiveStartTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
+
'-'
+
dayjs
(
cellValue
.
effectiveEndTime
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
case
3
:
return
'无有效期'
default
:
return
'-'
}
}
},
},
{
{
label
:
'可用次数'
,
label
:
'可用次数'
,
prop
:
''
prop
:
'useType'
,
width
:
200
,
line
:
2
,
formatter
:
cellValue
=>
{
switch
(
cellValue
.
useType
)
{
case
0
:
return
'不限制次数'
case
1
:
return
'有效期内可使用'
+
cellValue
.
useAmount
+
'次'
case
2
:
return
'有效期内'
+
cellValue
.
useLimitDays
+
'天可使用'
+
cellValue
.
useAmount
+
'次'
default
:
return
'-'
}
}
},
},
{
{
label
:
'库存'
,
label
:
'库存'
,
prop
:
''
prop
:
'stock'
,
width
:
120
,
formatter
:
cellValue
=>
{
return
cellValue
.
limitStockFlag
==
1
?
cellValue
.
stock
:
'无库存限制'
}
},
},
{
{
label
:
'使用途径'
,
label
:
'使用途径'
,
...
@@ -200,7 +233,14 @@ export default {
...
@@ -200,7 +233,14 @@ export default {
},
},
{
{
label
:
'适用范围'
,
label
:
'适用范围'
,
name
:
'application'
name
:
'scopeApplication'
,
width
:
160
,
formatter
:
cellValue
=>
{
return
{
1
:
'旗下所有店通用'
,
2
:
'旗下品牌店通用'
}[
cellValue
.
scopeApplication
]
}
},
},
{
{
label
:
'已领取'
,
label
:
'已领取'
,
...
@@ -216,7 +256,8 @@ export default {
...
@@ -216,7 +256,8 @@ export default {
attrToIcon
:
{
attrToIcon
:
{
2
:
'discount'
,
2
:
'discount'
,
3
:
'cash'
,
3
:
'cash'
,
4
:
'exchange'
4
:
'exchange'
,
7
:
'service'
},
},
baseData
:
{
baseData
:
{
discountTypeList
:
[
discountTypeList
:
[
...
@@ -231,11 +272,11 @@ export default {
...
@@ -231,11 +272,11 @@ export default {
{
{
confId
:
'4'
,
confId
:
'4'
,
confName
:
'兑换券'
confName
:
'兑换券'
},
{
confId
:
'7'
,
confName
:
'服务券'
}
}
// {
// confId: '7',
// confName: '会员服务'
// }
],
],
// directionalFlagList: [
// directionalFlagList: [
// {
// {
...
@@ -448,7 +489,7 @@ export default {
...
@@ -448,7 +489,7 @@ export default {
couponName
:
''
,
couponName
:
''
,
discountType
:
''
,
discountType
:
''
,
status
:
''
,
status
:
''
,
discountTypes
:
[
2
,
3
,
4
]
discountTypes
:
[
2
,
3
,
4
,
7
]
}
}
this
.
handleSearch
()
this
.
handleSearch
()
},
},
...
...
src/views/couponManage/receiveDetail.vue
View file @
eecda43
...
@@ -96,7 +96,8 @@ export default {
...
@@ -96,7 +96,8 @@ export default {
attrToIcon
:
{
attrToIcon
:
{
2
:
'discount'
,
2
:
'discount'
,
3
:
'cash'
,
3
:
'cash'
,
4
:
'exchange'
4
:
'exchange'
,
7
:
'service'
},
},
// 优惠券信息
// 优惠券信息
couponFormData
:
[
couponFormData
:
[
...
...
src/views/couponManage/recordList.vue
View file @
eecda43
...
@@ -98,17 +98,13 @@ export default {
...
@@ -98,17 +98,13 @@ export default {
},
},
size
:
'small'
,
size
:
'small'
,
searchForm
:
{
searchForm
:
{
// couponId:222 //卷id
//userCouponId //用户卷id
// name: '',
// daterange:''
couponName
:
''
,
couponName
:
''
,
userReq
:
''
,
userReq
:
''
,
verificationOperator
:
''
,
verificationOperator
:
''
,
orderCode
:
''
,
orderCode
:
''
,
merchantId
:
0
,
merchantId
:
0
,
discountType
:
''
,
discountType
:
''
,
discountTypes
:
[
7
]
discountTypes
:
[
2
,
3
,
4
,
7
]
},
},
tableSearchForm
:
{},
tableSearchForm
:
{},
// 搜索
// 搜索
...
@@ -219,7 +215,8 @@ export default {
...
@@ -219,7 +215,8 @@ export default {
attrToIcon
:
{
attrToIcon
:
{
2
:
'discount'
,
2
:
'discount'
,
3
:
'cash'
,
3
:
'cash'
,
4
:
'exchange'
4
:
'exchange'
,
7
:
'service'
},
},
baseData
:
{
baseData
:
{
discountTypeList
:
[
discountTypeList
:
[
...
@@ -399,7 +396,7 @@ export default {
...
@@ -399,7 +396,7 @@ export default {
// this.searchForm = { merchantId: 44184606 }
// this.searchForm = { merchantId: 44184606 }
// this.handleSearch()
// this.handleSearch()
this
.
isReload
=
false
this
.
isReload
=
false
this
.
searchForm
=
{
merchantId
:
this
.
merchantId
,
discountTypes
:
[
7
]
}
this
.
searchForm
=
{
merchantId
:
this
.
merchantId
,
discountTypes
:
[
2
,
3
,
4
,
7
]
}
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
isReload
=
true
this
.
isReload
=
true
})
})
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment