Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-h5-ailipay
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 7d088011
authored
Mar 18, 2022
by
张权
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
bug:添加提交审批按钮
1 parent
ff942401
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
202 additions
and
70 deletions
src/api/giftApi.js
src/assets/images/icon/default.png
src/views/gift/create.vue
src/views/gift/detail.vue
src/views/gift/index.vue
src/api/giftApi.js
View file @
7d08801
...
...
@@ -11,7 +11,7 @@ export default {
data
})
},
/** 获取审批中列表 */
getInApproveGiftList
(
data
)
{
data
.
method
=
'scrm.api.coupon.weChat.directional.gift.approve.in.list'
data
.
pageSize
=
pageSize
...
...
@@ -20,6 +20,14 @@ export default {
data
})
},
/** 获取审批中列表 */
toApproveById
(
data
)
{
data
.
method
=
'scrm.api.coupon.directional.gift.commit.approve'
return
window
.
$HTTP
({
url
,
data
})
},
/** 根据id删除定向礼包 */
deleteGift
(
data
)
{
data
.
method
=
'scrm.api.coupon.directional.gift.delete'
...
...
src/assets/images/icon/default.png
0 → 100644
View file @
7d08801
3.9 KB
src/views/gift/create.vue
View file @
7d08801
...
...
@@ -162,15 +162,6 @@ export default {
}
else
this
.
flag
=
true
wxConfig
.
init
([
'thirdPartyOpenPage'
,
'onHistoryBack'
])
}
,
beforeRouteEnter
(
to
,
from
,
next
)
{
console
.
log
(
to
,
from
,
888
)
// let
{
params
:
{
giftToast
}
}
=
from
// next(vm =>
{
// if (giftToast) vm.giftToast = giftToast
//
}
)
next
()
}
,
methods
:
{
input
(
i
,
e
)
{
...
...
@@ -300,9 +291,8 @@ export default {
this
.
showLoading
(
'提交中...'
)
giftApi
.
createOrupdataGift
(
params
).
then
(
res
=>
{
this
.
hideLoading
()
console
.
log
(
res
,
'模板id'
)
if
(
res
.
approveFlag
===
2
){
const
{
approveTemplateId
,
approveNo
,
name
,
remarkName
,
anticipatedCost
,
coupons
,
giveReason
}
=
res
const
{
approveTemplateId
,
approveNo
,
name
,
remarkName
,
anticipatedCost
,
coupons
,
giveReason
,
directionalGiftId
}
=
res
let
couponStr
=
''
coupons
.
forEach
(
item
=>
{
couponStr
=
couponStr
+
`${item.couponName
}
x${item.couponAmount
}
, 预估成本${(item.couponAnticipatedCost*item.couponAmount/100).toFixed(2)
}
元\n`
...
...
@@ -344,9 +334,8 @@ export default {
.
then
((
resp
)
=>
{
console
.
log
(
resp
,
'已发起审批'
)
setTimeout
(()
=>
{
this
.
$route
.
params
.
fromWhere
=
'create'
this
.
$router
.
back
()
}
,
2000
)
this
.
$router
.
replace
({
name
:
'gift.detail'
,
query
:
{
id
:
directionalGiftId
,
approveStatus
:
999
}}
)
}
,
500
)
}
)
}
else
{
this
.
$route
.
params
.
giftToast
=
`${id ? '修改' : '创建'
}
成功`
...
...
src/views/gift/detail.vue
View file @
7d08801
...
...
@@ -90,23 +90,14 @@
{{
obj
.
giveReason
||
'-'
}}
<
/div
>
<
/div
>
<
template
v
-
if
=
"obj.receivedFlag == 1 && approveStatus!=1"
>
<
!--
<
template
v
-
if
=
"obj.receivedFlag == 1 && approveStatus!=1"
>
<
div
style
=
"z-index:4;"
class
=
"btn text-center x-center"
@
click
=
"changeGift"
>
修改
<
/div
>
<
/template
>
<!--
<
div
v
-
if
=
"obj.receivedFlag == 1 && approveStatus != 1"
class
=
"submit-btn"
>
<
div
class
=
"text-center"
@
click
=
"changeGift"
>
修改
<
/div
>
<
div
class
=
"text-center"
@
click
=
"pushApproval"
>
提交审批
<
/div
>
<
/div> --
>
<
/template> --
>
<
div
class
=
"box merchant-box"
v
-
if
=
"isShowApprovalDetail"
>
<
div
class
=
"title"
>
审批流程
<
/div
>
<
div
class
=
"connect"
:
style
=
"
{
height
:
lineHeight
+
'px'
}
"></div>
...
...
@@ -116,10 +107,11 @@
<img v-if="
pItem
.
avtive
" src="
..
/
..
/
assets
/
images
/
icon
/
active_avatar
.
png
" alt="">
<img v-else src="
..
/
..
/
assets
/
images
/
icon
/
unactive_avatar
.
png
" alt="">
</div>
<div class="
real
-
img
" :style="
{
'margin-left'
:
(
pItem
.
items
.
itemList
.
length
>
2
&&
sonId
>
0
)
?
'42px'
:
'12px'
}
">
<img v-if="
sonItem
.
length
>
1
&&
sonId
===
0
" src="
..
/
..
/
assets
/
images
/
icon
/
more_avatar
.
png
" alt="">
<div class="
real
-
img
" :style="
{
'margin-left'
:
(
pItem
.
items
.
itemList
.
length
>
1
&&
sonId
>
0
)
?
'42px'
:
'12px'
}
">
<img v-if="
sonItem
.
itemStatus
===
0
" src="
..
/
..
/
assets
/
images
/
icon
/
more_avatar
.
png
" alt="">
<img v-else-if="
sonItem
.
itemImage
" :src="
sonItem
.
itemImage
" alt="">
<img v-else src="
..
/
..
/
assets
/
images
/
icon
/
unactive_avatar
.
png
" alt="">
<!-- <van-image width="
50
" height="" v-else-if="
sonItem
.
itemImage
" :src="
sonItem
.
itemImage
" ></van-image> -->
<img v-else src="
..
/
..
/
assets
/
images
/
icon
/
default
.
png
" alt="">
</div>
<div class="
info
-
area
">
<div class="
info
">
...
...
@@ -127,7 +119,7 @@
<span class="
name
"
>
{{
sonItem
.
itemName
}}
<
/span
>
<
span
class
=
"status"
:
class
=
"setStatusClass(sonItem.itemStatus)"
>
{{
setApprovalStatus
(
sonItem
.
itemStatus
)
}}
<
/span
>
<
/span
>
<
span
class
=
"date"
v
-
if
=
"!(pItem.nodeType===2 && sonId===0)"
>
{{
dateFormat
(
sonItem
.
itemOpTime
,
'YYYY/MM/DD HH:mm'
)
}}
<
/span
>
<
span
class
=
"date"
>
{{
dateFormat
(
sonItem
.
itemOpTime
,
'YYYY/MM/DD HH:mm'
)
}}
<
/span
>
<
/div
>
<
div
class
=
"remark"
>
{{
sonItem
.
itemSpeech
||
''
}}
<
/div
>
<
/div
>
...
...
@@ -135,6 +127,16 @@
<
/div
>
<
/div
>
<
/template
>
<
div
v
-
if
=
"obj.receivedFlag == 1 && approveStatus != 1"
class
=
"submit-btn"
>
<
div
:
class
=
"isShowApprovalDetail? '': 'white'"
class
=
"text-center sub-btn"
@
click
=
"changeGift"
>
修改
<
/div
>
<
div
v
-
if
=
"!isShowApprovalDetail"
class
=
"text-center sub-btn"
@
click
=
"pushApproval"
>
提交审批
<
/div
>
<
/div
>
<
/div
>
<
/template
>
...
...
@@ -146,7 +148,7 @@ function appendZero(int) {
return
int
}
}
import
{
giftApi
}
from
'@/api'
import
{
giftApi
,
wxConfig
}
from
'@/api'
import
{
discountTypeMixin
}
from
'@/mixins'
export
default
{
name
:
''
,
...
...
@@ -165,19 +167,9 @@ export default {
mounted
()
{
const
{
approveStatus
}
=
this
.
getQuery
()
this
.
approveStatus
=
approveStatus
console
.
log
(
this
.
approveStatus
,
999
)
this
.
showLoading
()
this
.
getDetail
()
}
,
beforeRouteEnter
(
to
,
from
,
next
)
{
console
.
log
(
to
,
from
,
1
)
// let
{
params
:
{
giftToast
}
}
=
from
// next(vm =>
{
// if (giftToast) vm.giftToast = giftToast
//
}
)
next
(
vm
=>
{
}
)
wxConfig
.
init
([
'thirdPartyOpenPage'
])
}
,
methods
:
{
setCouponData
(
res
)
{
...
...
@@ -202,7 +194,6 @@ export default {
getDetail
()
{
let
{
id
}
=
this
.
getQuery
()
giftApi
.
getGiftDetail
(
id
).
then
(
res
=>
{
console
.
log
(
res
,
'详情参数'
)
this
.
hideLoading
()
res
=
this
.
setCouponData
(
res
)
this
.
flag
=
true
...
...
@@ -224,7 +215,7 @@ export default {
if
(
element
.
nodeStatus
===
2
){
element
.
avtive
=
true
}
if
(
element
?.
items
?.
itemList
?.
length
&&
element
.
items
.
itemList
.
length
>
1
){
if
(
element
.
nodeType
==
2
){
element
.
items
.
itemList
.
unshift
({
"itemName"
:
""
,
"itemParty"
:
""
,
...
...
@@ -245,7 +236,6 @@ export default {
avtive
:
true
,
items
:{
itemList
:[{
itemName
,
itemImage
,
itemStatus
,
itemOpTime
:
parseInt
(
parseInt
(
itemOpTime
)
/
1000
)
}
]
}
}
console
.
log
(
targetObj
,
typeof
itemOpTime
,
itemOpTime
)
this
.
infoList
.
push
(
targetObj
)
}
this
.
$nextTick
(()
=>
{
...
...
@@ -259,7 +249,55 @@ export default {
}
)
}
,
pushApproval
(){
console
.
log
(
this
.
obj
)
let
{
id
}
=
this
.
getQuery
()
giftApi
.
toApproveById
({
id
}
).
then
(
res
=>
{
if
(
res
.
approveFlag
===
2
){
const
{
approveTemplateId
,
approveNo
,
name
,
remarkName
,
anticipatedCost
,
coupons
,
giveReason
}
=
res
let
couponStr
=
''
coupons
.
forEach
(
item
=>
{
couponStr
=
couponStr
+
`${item.couponName
}
x${item.couponAmount
}
, 预估成本${(item.couponAnticipatedCost*item.couponAmount/100).toFixed(2)
}
元\n`
}
)
wxConfig
.
thirdPartyOpenPage
({
"oaType"
:
"10001"
,
"templateId"
:
approveTemplateId
,
"thirdNo"
:
approveNo
,
"extData"
:
{
'fieldList'
:
[
{
'title'
:
'礼包名称'
,
'type'
:
'text'
,
'value'
:
name
,
}
,
{
'title'
:
'备注名称'
,
'type'
:
'text'
,
'value'
:
remarkName
,
}
,
{
'title'
:
'预估成本'
,
'type'
:
'text'
,
'value'
:
(
anticipatedCost
/
100
).
toFixed
(
2
)
+
'元'
,
}
,
{
'title'
:
'礼包明细'
,
'type'
:
'text'
,
'value'
:
couponStr
,
}
,
{
'title'
:
'赠送原因'
,
'type'
:
'text'
,
'value'
:
giveReason
,
}
,
]
}
}
)
.
then
((
resp
)
=>
{
console
.
log
(
resp
,
'已发起审批'
)
}
)
}
else
{
this
.
showToast
(
'礼包已提交审批,请勿重复提交!'
)
}
}
)
}
,
changeGift
()
{
let
{
id
}
=
this
.
getQuery
()
...
...
@@ -273,7 +311,7 @@ export default {
return
{
0
:
'moreApproval'
,
1
:
'inApproval'
,
2
:
''
,
3
:
'turnDown'
,
4
:
'turnApproval'
}
[
id
]
}
,
dateFormat
(
dateTime
,
format
=
'YYYY-MM-DD'
)
{
if
(
dateTime
===
0
)
return
''
;
if
(
!
dateTime
)
return
''
;
const
date
=
new
Date
(
dateTime
*
1000
)
const
config
=
{
YYYY
:
date
.
getFullYear
(),
...
...
@@ -298,11 +336,18 @@ export default {
z
-
index
:
3
;
position
:
fixed
;
bottom
:
16
px
;
left
:
0
;
width
:
100
%
;
justify
-
content
:
space
-
around
;
height
:
auto
;
display
:
flex
;
.
white
{
background
-
color
:
#
fff
;
color
:
#
323233
;
border
:
1
px
solid
#
DCDEE0
;
}
div
{
width
:
1
75
px
;
width
:
1
60
px
;
height
:
36
px
;
background
:
#
3975
c6
;
box
-
shadow
:
0
px
2
px
4
px
0
px
rgba
(
57
,
117
,
198
,
0.2
);
...
...
src/views/gift/index.vue
View file @
7d08801
<
template
>
<div
class=
"index"
>
<search-box
<search-box
class=
"search"
@
search=
"search"
:keyword=
"name"
:showDropdown=
"false"
...
...
@@ -36,12 +36,10 @@
</div>
<div
class=
"info"
>
<div
class=
"text"
>
指定领取
{{
i
.
receiveWay
==
1
?
'手机号'
:
'车架号'
}}
:
{{
i
.
receiveDetails
}}
</div>
<div
class=
"text"
>
备注名称:
{{
i
.
remarkName
}}
</div>
<div
class=
"text-name"
><span
style=
"white-space:nowrap;"
>
备注名称:
</span><div
class=
"remark"
>
{{
i
.
remarkName
}}
</div></div>
<div
class=
"qr-text"
@
click
.
stop=
"createQr(i)"
>
领取二维码
</div>
</div>
<div
class=
"qr-text"
@
click
.
stop=
"createQr(i)"
>
领取二维码
</div>
</div>
<template
#
right
>
<van-button
...
...
@@ -85,11 +83,14 @@
<
template
v-if=
"tabIndex == 2"
>
<van-swipe-cell>
<div
class=
"title flex"
>
{{
i
.
name
}}
<span>
{{
i
.
name
}}
</span>
<span
v-if=
"i.approveStatus==5"
class=
"approve-btn"
@
click
.
stop=
"toAppprove(i)"
>
发起审批
</span>
</div>
<div
class=
"content"
>
<div
class=
"text item-flex"
><span
class=
"nowrap"
>
备注名称:
</span><div>
{{
i
.
remarkName
}}
</div></div>
<div
class=
"text"
>
预估成本:
{{
(
i
.
anticipatedCost
/
100
).
toFixed
(
2
)
}}
元
</div>
<div
class=
"text"
>
预估成本:
<span
style=
"font-weight:600;"
>
{{
(
i
.
anticipatedCost
/
100
).
toFixed
(
2
)
}}
</span>
元
</div>
<div
class=
"text item-flex"
><span
class=
"nowrap"
>
赠送原因:
</span><div>
{{
i
.
giveReason
}}
</div></div>
<div
v-if=
"i.approveStatus==1 || i.approveStatus==3"
class=
"text"
>
审批状态:
<span
:style=
"
{color: i.approveStatus==1 ? '#3975C6':'#F1515C','margin-right':'5px'}">
{{
i
.
approveStatus
==
1
?
'审批中'
:
'已驳回'
}}
</span>
(
{{
i
.
approveBy
}}
)
</div>
<div
class=
"text item-flex"
v-if=
"i.approveStatus==3"
><span
class=
"nowrap"
>
驳回原因:
</span><div
style=
"color: #F1515C;"
>
{{
i
.
approveExplain
}}
</div></div>
...
...
@@ -154,10 +155,11 @@ export default {
}
},
beforeRouteEnter
(
to
,
from
,
next
)
{
let
{
params
:
{
giftToast
,
fromWhere
}
}
=
from
let
{
params
:
{
giftToast
}
}
=
from
const
{
query
:
{
approveStatus
}
}
=
from
next
(
vm
=>
{
if
(
giftToast
)
vm
.
giftToast
=
giftToast
;
if
(
fromWhere
===
'create'
)
{
if
(
approveStatus
)
{
vm
.
handleChangeTab
(
2
)
vm
.
change
(
2
)
}
...
...
@@ -171,12 +173,61 @@ export default {
this
.
getList
()
})
}
else
this
.
getList
()
wxConfig
.
init
([
'shareAppMessage'
])
wxConfig
.
init
([
'shareAppMessage'
,
'thirdPartyOpenPage'
])
},
methods
:
{
toAppprove
({
id
}){
giftApi
.
toApproveById
({
id
}).
then
(
res
=>
{
if
(
res
.
approveFlag
===
2
){
const
{
approveTemplateId
,
approveNo
,
name
,
remarkName
,
anticipatedCost
,
coupons
,
giveReason
}
=
res
let
couponStr
=
''
coupons
.
forEach
(
item
=>
{
couponStr
=
couponStr
+
`
${
item
.
couponName
}
x
${
item
.
couponAmount
}
, 预估成本
${(
item
.
couponAnticipatedCost
*
item
.
couponAmount
/
100
).
toFixed
(
2
)}
元\n`
})
wxConfig
.
thirdPartyOpenPage
({
"oaType"
:
"10001"
,
"templateId"
:
approveTemplateId
,
"thirdNo"
:
approveNo
,
"extData"
:
{
'fieldList'
:
[
{
'title'
:
'礼包名称'
,
'type'
:
'text'
,
'value'
:
name
,
},
{
'title'
:
'备注名称'
,
'type'
:
'text'
,
'value'
:
remarkName
,
},
{
'title'
:
'预估成本'
,
'type'
:
'text'
,
'value'
:
(
anticipatedCost
/
100
).
toFixed
(
2
)
+
'元'
,
},
{
'title'
:
'礼包明细'
,
'type'
:
'text'
,
'value'
:
couponStr
,
},
{
'title'
:
'赠送原因'
,
'type'
:
'text'
,
'value'
:
giveReason
,
},
]
}
})
.
then
((
resp
)
=>
{
console
.
log
(
resp
,
'已发起审批'
)
})
}
else
{
this
.
showToast
(
'礼包已提交审批,请勿重复提交!'
)
}
})
},
handleChangeTab
(
id
){
this
.
$refs
.
myTab
.
handleChange
(
id
)
console
.
log
(
id
,
6666
)
},
getList
(
type
)
{
let
{
uuid
}
=
this
.
getLocalStorage
(
'dj_scrm_userInfo'
)
...
...
@@ -199,7 +250,6 @@ export default {
this
.
total
=
res
.
total
if
(
tabIndex
===
2
)
this
.
$set
(
this
.
tab
,
2
,
`审批中(
${
res
.
total
}
)`
);
}
console
.
log
(
res
)
})
},
search
(
e
)
{
...
...
@@ -269,7 +319,6 @@ export default {
appId
})
.
then
(
link
=>
{
console
.
log
(
link
)
wxConfig
.
shareAppMessage
({
title
:
e
.
name
,
...
...
@@ -308,6 +357,11 @@ export default {
</
script
>
<
style
scoped
lang=
'scss'
>
/
deep
/
.search
{
.van-icon{
color
:
#CDD1D4
;
}
}
.list-box
{
height
:
calc
(
100vh
-
100px
);
.item
{
...
...
@@ -358,18 +412,39 @@ export default {
.info
{
font-size
:
12px
;
color
:
#999999
;
position
:
relative
;
.text
{
line-height
:
16px
;
margin-bottom
:
8px
;
}
.text-name
{
line-height
:
16px
;
display
:
flex
;
.remark{
display
:
-webkit-box
;
-webkit-box-orient
:
vertical
;
-webkit-line-clamp
:
2
;
overflow
:
hidden
;
}
}
.qr-text
{
position
:
absolute
;
left
:
0
;
bottom
:
0
;
padding
:
0
5px
;
height
:
22px
;
background
:
rgba
(
57
,
117
,
198
,
0.1
);
border-radius
:
11px
;
width
:
60px
;
font-size
:
12px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
#3975C6
;
text-align
:
center
;
line-height
:
22px
;
}
}
.qr-text
{
font-size
:
12px
;
right
:
10px
;
bottom
:
16px
;
color
:
#3975c6
;
position
:
absolute
;
}
}
}
}
...
...
@@ -430,6 +505,21 @@ export default {
color
:
#282829
;
padding
:
16px
16px
10px
;
border-bottom
:
1px
solid
rgba
(
195
,
195
,
195
,
0.3
);
justify-content
:
space-between
;
.approve-btn{
width
:
66px
;
height
:
24px
;
background
:
#3975C6
;
border-radius
:
12px
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
border
:
1px
solid
#3975C6
;
font-size
:
10px
;
font-family
:
PingFangSC-Regular
,
PingFang
SC
;
font-weight
:
400
;
color
:
#FFFFFF
;
}
}
.content
{
padding
:
10px
16px
16px
;
...
...
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