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 bb1f8304
authored
Feb 20, 2022
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增礼包,礼包列表
1 parent
0b314b9e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
16 deletions
src/views/giftBag/editGift.vue
src/views/giftBag/giftList.vue
src/views/giftBag/index.vue
src/views/giftBag/selectGiftDialog.vue
src/views/giftBag/editGift.vue
View file @
bb1f830
...
...
@@ -271,6 +271,9 @@ export default {
this
.
$apis
.
giftBag
.
getGiftInfoApi
({
id
:
this
.
routeInfo
.
id
})
.
then
(
res
=>
{
res
.
data
.
couponList
.
forEach
(
item
=>
{
item
.
id
=
item
.
couponId
})
this
.
editForm
=
res
.
data
this
.
editForm
.
receiveWay
=
this
.
editForm
.
receiveWay
+
''
this
.
recoveryCoupon
()
...
...
@@ -306,7 +309,7 @@ export default {
this
.
couponObj
[
item
].
list
.
forEach
(
subItem
=>
{
// 失效券不加入预估成本
if
(
subItem
.
status
!=
'3'
)
{
this
.
totalEstimatedCost
=
this
.
totalEstimatedCost
+
subItem
.
couponAnticipatedCost
*
subItem
.
couponAmount
this
.
totalEstimatedCost
=
this
.
totalEstimatedCost
+
parseInt
(
subItem
.
couponAnticipatedCost
)
*
parseInt
(
subItem
.
couponAmount
)
}
})
})
...
...
@@ -384,6 +387,9 @@ export default {
var
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
)
params
.
staffCreateRequests
=
this
.
$common
.
utils
.
deepClone
(
params
.
staffList
)
params
.
couponCreateRequests
=
this
.
$common
.
utils
.
deepClone
(
params
.
couponList
)
params
.
couponCreateRequests
.
forEach
(
item
=>
{
item
.
couponId
=
item
.
id
})
delete
params
.
staffList
delete
params
.
couponList
if
(
this
.
routeInfo
.
addOrEdit
==
'edit'
)
{
...
...
src/views/giftBag/giftList.vue
View file @
bb1f830
...
...
@@ -29,8 +29,13 @@
<!-- 表格区域 开始 -->
<GLTable
ref=
"giftListRef"
:getListApi=
"getListApi"
:hasNum=
"false"
:noDataImg=
"url"
:searchForm=
"tableSearchForm"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
:beforeSearchFn=
"beforeSearchFn"
@
setTableFinishFun=
"setTableFinishFun"
>
<div
slot=
"giftInfo"
slot-scope=
"scope"
>
<div>
礼包明细
</div>
<div>
{{
scope
.
scope
}}
</div>
<div
class=
"p-b-12"
>
礼包明细
</div>
<div
class=
"gift-detail flex-default"
>
<div
class=
"gift-item"
v-for=
"(item, index) in scope.scope.couponList"
:key=
"index"
>
<p
:class=
"['gift-coupon-name', item.status == '3' ? ' txt-grey' : '']"
>
{{
item
.
couponName
}}
×
{{
item
.
couponAmount
}}
</p>
<p
v-show=
"item.status == '3'"
class=
"gift-tips"
>
已失效
</p>
</div>
</div>
</div>
<div
slot=
"name"
slot-scope=
"scope"
>
<el-button
:size=
"size"
type=
"text"
@
click=
"handleDetail(scope.scope)"
>
{{
scope
.
scope
.
name
}}
</el-button>
...
...
@@ -288,4 +293,27 @@ export default {
}
</
script
>
<
style
scoped
></
style
>
<
style
lang=
"scss"
>
.p-b-12
{
margin-bottom
:
14px
;
}
.gift-detail
.gift-item
{
margin-right
:
80px
;
.gift-coupon-name
{
display
:
inline-block
;
margin-right
:
7px
;
}
.gift-tips
{
display
:
inline-block
;
font-size
:
12px
;
height
:
18px
;
line-height
:
18px
;
color
:
#999999
;
background-color
:
#eeeded
;
margin-right
:
7px
;
}
}
.gift-detail
.gift-item
:last-child
{
margin-right
:
0
;
}
</
style
>
src/views/giftBag/index.vue
View file @
bb1f830
...
...
@@ -3,10 +3,10 @@
<div
class=
"gift-bag"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"handleTabClick"
>
<el-tab-pane
label=
"定向礼包"
name=
"giftList"
>
<gift-list></gift-list>
<gift-list
v-if=
"activeName == 'giftList'"
></gift-list>
</el-tab-pane>
<el-tab-pane
label=
"已领取"
name=
"receivedGiftList"
>
<receivedGiftList></receivedGiftList>
<receivedGiftList
v-if=
"activeName == 'receivedGiftList'"
></receivedGiftList>
</el-tab-pane>
</el-tabs>
</div>
...
...
src/views/giftBag/selectGiftDialog.vue
View file @
bb1f830
...
...
@@ -203,7 +203,9 @@ export default {
recoverySelected
()
{
if
(
this
.
selectedGiftList
[
this
.
activeName
].
list
&&
this
.
selectedGiftList
[
this
.
activeName
].
list
.
length
)
{
this
.
selectedGiftList
[
this
.
activeName
].
list
.
forEach
(
row
=>
{
this
.
$refs
.
giftRef
.
$refs
[
this
.
tableParams
.
mutiSelectName
+
'MutiTable'
].
toggleRowSelection
(
row
)
if
(
row
.
status
!=
'3'
)
{
this
.
$refs
.
giftRef
.
$refs
[
this
.
tableParams
.
mutiSelectName
+
'MutiTable'
].
toggleRowSelection
(
row
)
}
})
}
},
...
...
@@ -218,7 +220,7 @@ export default {
this
.
selectedSum
=
0
this
.
orderShow
.
forEach
(
itme
=>
{
this
.
selectedGiftList
[
itme
].
list
.
forEach
(
subItem
=>
{
this
.
selectedSum
=
this
.
selectedSum
+
subItem
.
couponAmount
this
.
selectedSum
=
this
.
selectedSum
+
parseInt
(
subItem
.
couponAmount
)
})
})
},
...
...
@@ -230,14 +232,16 @@ export default {
this
.
selectedGiftList
[
this
.
activeName
].
list
=
[]
val
.
forEach
(
item
=>
{
let
isSelected
=
list
.
find
(
k
=>
k
.
id
==
item
.
id
)
this
.
selectedGiftList
[
this
.
activeName
].
list
.
push
({
id
:
item
.
id
,
discountType
:
item
.
discountType
,
couponName
:
item
.
couponName
,
couponAmount
:
isSelected
?
list
.
find
(
k
=>
k
.
id
==
item
.
id
).
couponAmount
:
'1'
,
couponAnticipatedCost
:
item
.
anticipatedCost
,
status
:
'2'
})
if
(
this
.
selectedGiftList
[
this
.
activeName
].
list
.
findIndex
(
k
=>
k
.
id
==
item
.
id
)
==
'-1'
)
{
this
.
selectedGiftList
[
this
.
activeName
].
list
.
push
({
id
:
item
.
id
,
discountType
:
item
.
discountType
,
couponName
:
item
.
couponName
,
couponAmount
:
isSelected
?
list
.
find
(
k
=>
k
.
id
==
item
.
id
).
couponAmount
:
'1'
,
couponAnticipatedCost
:
item
.
anticipatedCost
,
status
:
'2'
})
}
})
list
.
forEach
(
item
=>
{
if
(
item
.
status
==
'3'
)
{
...
...
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