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 a1f5f986
authored
Jun 22, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'zq_dev_v2.5.0' into 'v2.5.0'
0704定向礼包 提测合并 See merge request
!201
2 parents
5b35a5c0
ff82c491
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
378 additions
and
115 deletions
src/api/modules/giftBag.js
src/assets/css/public.scss
src/setup/qiankun.js
src/views/giftBag/editGift.vue
src/views/giftBag/giftDetail.vue
src/views/giftBag/giftList.vue
src/views/giftBag/receivedGiftList.vue
src/api/modules/giftBag.js
View file @
a1f5f98
...
...
@@ -88,14 +88,14 @@ const getDirectionalGiftListApi = params => {
}
const
getghDirectionalGiftListApi
=
params
=>
{
// params.method = 'scrm.api.coupon.directional.gift.coupon.list'
params
.
method
=
'scrm.api.coupon.gh.group.equity.coupon.list'
params
.
method
=
'scrm.api.coupon.gh.group.equity.coupon.list'
return
http
({
url
:
'rop-scrm-coupon/router'
,
method
:
'GET'
,
data
:
params
,
sign
:
true
})
}
}
const
insertGiftApi
=
params
=>
{
params
.
method
=
'scrm.api.coupon.directional.gift.create'
...
...
@@ -119,4 +119,14 @@ const templateModal = params => {
})
}
export
default
{
getFollowerStaffListApi
,
getListApi
,
giftExportApi
,
deleteGiftApi
,
getGiftInfoApi
,
getReceivedGiftInfoApi
,
exportGiftInfoApi
,
getDirectionalGiftListApi
,
insertGiftApi
,
templateModal
,
getghDirectionalGiftListApi
}
const
toVoidGift
=
params
=>
{
params
.
method
=
'scrm.api.coupon.user.directional.gift.cancel'
return
http
({
url
:
'rop-scrm-coupon/router'
,
method
:
'POST'
,
data
:
params
,
sign
:
true
})
}
export
default
{
getFollowerStaffListApi
,
getListApi
,
giftExportApi
,
deleteGiftApi
,
getGiftInfoApi
,
getReceivedGiftInfoApi
,
exportGiftInfoApi
,
getDirectionalGiftListApi
,
insertGiftApi
,
templateModal
,
getghDirectionalGiftListApi
,
toVoidGift
}
src/assets/css/public.scss
View file @
a1f5f98
...
...
@@ -580,3 +580,6 @@ html {
border-top-color
:
#e4e7ed
!
important
;
}
/* tab */
.myMessage
{
z-index
:
4000
!
important
;
}
src/setup/qiankun.js
View file @
a1f5f98
/*
* @Description:
* @Description:
* @Author: huyue
* @Date: 2022-01-20 18:06:46
* @LastEditors: huyue
...
...
@@ -38,6 +38,12 @@ export async function bootstrap({ history, common, messenger, globalState, route
Vue
.
prototype
.
$http_merchant
=
new
common
.
Http
({
response
,
request
:
request_merchant
,
sign
,
secret
,
alert
:
message
.
error
,
headers
:
{
token
:
globalState
.
session
.
token
}
})
Vue
.
prototype
.
$http_common
=
new
common
.
Http
({
response
,
signWay
:
'md5'
,
request
:
request_common
,
sign
:
sign_common
,
secret
,
alert
:
ElementUI
.
Message
.
error
,
headers
:
{
TGT
:
globalState
.
session
.
token
}
})
Vue
.
prototype
.
$http_xiaolong
=
new
common
.
Http
({
response
,
request
:
xiaolong_req
,
sign
,
secret
,
alert
:
message
.
error
,
headers
:
{
token
:
globalState
.
session
.
token
}
})
// const myToken = 'scrm-base-107ee03c-1214-48c3-a443-a2332e553b2f-rop'
// Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: myToken } })
// Vue.prototype.$http2 = new common.Http({ response, request: request2, sign, secret, alert: message.error, headers: { token: myToken } })
// Vue.prototype.$http_merchant = new common.Http({ response, request: request_merchant, sign, secret, alert: message.error, headers: { token: myToken } })
// Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: myToken } })
// Vue.prototype.$http_xiaolong = new common.Http({ response, request: xiaolong_req, sign, secret, alert: message.error, headers: { token: myToken } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
// Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
const
routesData
=
common
.
utils
.
deepClone
(
globalState
.
routers
)
...
...
src/views/giftBag/editGift.vue
View file @
a1f5f98
...
...
@@ -29,41 +29,43 @@
<div
v-for=
"(item, index) in orderShow"
:key=
"index"
>
<div
class=
"gift-box"
v-show=
"couponObj[item].list.length"
>
<!--
<div
class=
"gift-label"
>
{{
couponObj
[
item
].
label
}}
:
</div>
-->
<img
style=
"margin: 4px 12px 0 0;height:22px;width:58px;
"
:src=
"require(`@/assets/coupon/icon-$
{item}.png`)" />
<img
class=
"server-type
"
:src=
"require(`@/assets/coupon/icon-$
{item}.png`)" />
<div
class=
"gift-content"
>
<div
class=
"gift-item"
v-for=
"(subItem, subIndex) in couponObj[item].list"
:key=
"subIndex"
>
<span
:class=
"['circle', subItem.status == '3' ? ' grey' : '']"
></span>
<p
:class=
"['gift-coupon-name', subItem.status == '3' ? ' txt-grey' : '']"
>
{{
subItem
.
couponName
}}
×
{{
subItem
.
couponAmount
}}
</p>
<p
v-show=
"subItem.status == '3'"
class=
"gift-tips"
>
已失效
</p>
<i
class=
"el-icon-delete"
@
click=
"handleGiftDelete(item, subIndex)"
></i>
<i
class=
"el-icon-delete"
style=
"color: #C6C6C6;"
@
click=
"handleGiftDelete(item, subIndex)"
></i>
</div>
</div>
</div>
</div>
</div>
<div
class=
"stock"
slot=
"stockNumInput"
>
<el-input
@
input=
"
setStockNum"
:min=
"1"
:max=
"5"
v-model
.
number=
"editForm.stockNum
"
></el-input>
<el-input
@
input=
"
resetStock"
v-model=
"editForm.stock
"
></el-input>
<span
class=
"approval-tip"
style=
"margin-left:8px;"
>
每个用户根据领取规则限领一次礼包
</span>
</div>
<div
class=
"approval"
slot=
"approvalSlot"
>
<el-radio
v-model=
"editForm.approv
alRequire"
label=
"1"
>
赠送前需审批
</el-radio>
<p
class=
"approval-tip"
style=
"margin-bottom:12px;"
>
员工在赠送
钱
需提交赠送申请,审批通过后才可赠送
</p>
<el-radio
v-model=
"editForm.approv
alRequire"
label=
"2"
>
无需审批
</el-radio>
<el-radio
v-model=
"editForm.approv
eFlag"
:
label=
"1"
>
赠送前需审批
</el-radio>
<p
class=
"approval-tip"
style=
"margin-bottom:12px;"
>
员工在赠送
时
需提交赠送申请,审批通过后才可赠送
</p>
<el-radio
v-model=
"editForm.approv
eFlag"
:
label=
"2"
>
无需审批
</el-radio>
<p
class=
"approval-tip"
>
无需审批,可直接赠送给客户
</p>
</div>
<div
class=
"telArea"
slot=
"configSlot"
>
<div
v-if=
"editForm.receiveRule === 1"
class=
"telArea"
slot=
"configSlot"
>
<label
class=
"receiving"
for=
""
>
领取条件:
</label>
<el-radio-group
v-model=
"receiveWay"
>
<el-radio
label=
"1"
>
指定手机号
</el-radio>
<el-radio
label=
"2"
>
指定车架号后6位
</el-radio>
<el-radio-group
:disabled=
"routeInfo.id && routeInfo.receivedStock"
@
change=
"resetTextArea"
v-model=
"receiveWay"
>
<el-radio
:
label=
"1"
>
指定手机号
</el-radio>
<el-radio
:
label=
"2"
>
指定车架号后6位
</el-radio>
</el-radio-group>
<el-input
@
blur=
"formatPhone"
style=
"margin-left:70px;width: calc(100% - 70px);"
type=
"textarea"
v-model=
"phone"
placeholder=
"请输入领取手机号,多个手机号以空格隔开"
></el-input>
<span
class=
"approval-tip"
style=
"margin-left:70px;"
>
客户需准确输入该手机号码才能成功领取
</span>
<div>
<span
v-for=
"(item, index) in phoneList"
:key=
"index"
:style=
"
{ color: !item.valid ? 'red' : '#333', 'margin-left': '10px' }">
{{
item
.
tel
}}
<i
style=
"cursor: pointer;"
class=
"el-icon-close"
@
click=
"delPhone(item.tel)"
></i>
</span>
<div
style=
"margin-left:70px;width: calc(100% - 70px);"
>
<el-input
:disabled=
"routeInfo.id && routeInfo.receivedStock"
@
blur=
"formatPhone"
type=
"textarea"
v-model=
"phone"
:placeholder=
"placeholder"
></el-input>
<span
class=
"approval-tip"
style=
"margin-left:0;"
>
客户需准确输入该
{{
receiveWay
==
1
?
'手机号码'
:
'车架号后6位'
}}
才能成功领取
</span>
<div>
<div
:class=
"['tel-item', item.valid ? '' : 'valid-tel']"
v-for=
"(item, index) in phoneList"
:key=
"index"
>
{{
item
.
tel
}}
<i
:style=
"
{ cursor: routeInfo.id
&&
routeInfo.receivedStock ? 'not-allowed' : 'pointer' }" class="el-icon-close" @click="delPhone(item.tel)">
</i>
</div>
</div>
</div>
</div>
<!--
<div
slot=
"receiveDetails"
class=
"edit-tips m-t-8"
>
客户需要输入该
{{
editForm
.
receiveWay
==
'1'
?
'手机号'
:
'车架号后6位'
}}
才能成功领取
</div>
-->
...
...
@@ -133,18 +135,18 @@ export default {
},
editStatus
:
false
,
labelWidth
:
'144px'
,
receiveWay
:
'1'
,
receiveWay
:
1
,
editForm
:
{
name
:
''
,
remarkName
:
''
,
receiveWay
:
'1'
,
//
receiveWay: '1',
staffList
:
[],
// 优惠券类型(discountType) 1:满减券,2:折扣券,3:代金券,4:兑换券,5:购车代金券,6:商品折扣券,7:会员服务
// 优惠券状态(status):1:未生效,2:生效中,3:已失效
couponList
:
[],
stock
Num
:
1
,
approv
alRequire
:
'1'
,
receive
Config
:
'1'
stock
:
1
,
approv
eFlag
:
1
,
receive
Rule
:
1
},
totalEstimatedCost
:
''
,
orderShow
:
[
'service'
,
'cash'
,
'discount'
,
'exchange'
],
...
...
@@ -186,9 +188,9 @@ export default {
// receiveWay: [{ required: true, message: '请选择领取条件', trigger: 'change' }],
staffList
:
[{
required
:
true
,
message
:
'请选择发放员工'
,
trigger
:
'change'
}],
couponList
:
[{
required
:
true
,
message
:
'请选择礼包'
,
trigger
:
'change'
}],
stock
Num
:
[{
required
:
true
,
message
:
'请输入库存数量'
,
trigger
:
'change'
}],
approv
alRequire
:
[{
required
:
true
,
message
:
'请选择审批要求'
,
trigger
:
'change'
}],
receive
Config
:
[{
required
:
true
,
message
:
'请选择领取规则设置'
,
trigger
:
'change'
}]
stock
:
[{
required
:
true
,
message
:
'请输入库存数量'
,
trigger
:
'change'
}],
approv
eFlag
:
[{
required
:
true
,
message
:
'请选择审批要求'
,
trigger
:
'change'
}],
receive
Rule
:
[{
required
:
true
,
message
:
'请选择领取规则设置'
,
trigger
:
'change'
}]
// receiveDetails: [
// { required: true, message: '请输入领取条件', trigger: 'change' },
// {
...
...
@@ -238,35 +240,39 @@ export default {
},
{
label
:
'库存数量'
,
name
:
'stock
Num
'
,
name
:
'stock'
,
addHtml
:
'stockNumInput'
},
{
label
:
'审批要求'
,
name
:
'approv
alRequire
'
,
name
:
'approv
eFlag
'
,
addHtml
:
'approvalSlot'
},
{
label
:
'领取规则设置'
,
name
:
'receive
Config
'
,
name
:
'receive
Rule
'
,
type
:
'radio'
,
optionId
:
'confId'
,
optionLabel
:
'confName'
,
isDisabled
:
false
,
optionList
:
[
{
confId
:
'1'
,
confId
:
1
,
confName
:
'创建时指定'
},
{
confId
:
'2'
,
confId
:
2
,
confName
:
'员工赠送时指定'
},
{
confId
:
'3'
,
confId
:
3
,
confName
:
'直接领取'
}
],
suffixSlot
:
'configSlot'
suffixSlot
:
'configSlot'
,
handleRadioChange
:
()
=>
{
this
.
resetTextArea
()
}
},
// {
// label: '领取条件',
...
...
@@ -329,7 +335,6 @@ export default {
currentPeople
:
[]
}
},
components
:
{
selectStaffDialog
,
selectGiftDialog
...
...
@@ -353,7 +358,11 @@ export default {
}
}
},
computed
()
{},
computed
:
{
placeholder
()
{
return
`请输入领取
${
this
.
receiveWay
==
1
?
'手机号'
:
'车架号后6位'
}
,多个
${
this
.
receiveWay
==
1
?
'手机号'
:
'车架号'
}
以换行符隔开`
}
},
mounted
()
{
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
...
...
@@ -361,34 +370,42 @@ export default {
this
.
routeInfo
=
this
.
$route
.
query
this
.
title
=
this
.
titleObj
[
this
.
routeInfo
.
addOrEdit
]
this
.
routeInfo
.
addOrEdit
==
'add'
?
''
:
this
.
getInfo
()
if
(
this
.
routeInfo
.
id
&&
this
.
routeInfo
.
receivedStock
)
{
let
targetItem
=
this
.
editFormData
.
find
(
item
=>
item
.
name
==
'receiveRule'
)
targetItem
&&
(
targetItem
.
isDisabled
=
true
)
}
},
methods
:
{
setStockNum
(
e
)
{
if
(
+
e
<
1
)
{
this
.
editForm
.
stockNum
=
1
}
if
(
+
e
>
15
)
{
this
.
editForm
.
stockNum
=
15
}
resetTextArea
()
{
this
.
phone
=
''
this
.
phoneList
=
[]
},
resetStock
(
e
)
{
this
.
editForm
.
stock
=
e
.
replace
(
/^
(
0+
)
|
[^\d]
+/g
,
''
)
},
delPhone
(
val
)
{
if
(
this
.
phone
.
indexOf
(
'\n'
+
val
)
>
-
1
)
{
this
.
phone
=
this
.
phone
.
replace
(
'\n'
+
val
,
''
)
}
else
if
(
this
.
phone
.
indexOf
(
val
)
>
-
1
)
{
this
.
phone
=
this
.
phone
.
replace
(
val
+
'\n'
,
''
)
}
if
(
this
.
routeInfo
.
id
&&
this
.
routeInfo
.
receivedStock
)
return
let
phone
=
this
.
phone
.
replace
(
new
RegExp
(
'[\n]*'
+
val
+
'[\n]*'
,
'g'
),
'\n'
)
phone
=
phone
.
replace
(
/^
[\n]
+/
,
''
)
this
.
phone
=
phone
this
.
formatPhone
()
},
formatPhone
()
{
console
.
log
(
this
.
orderShow
)
let
phoneList
=
this
.
phone
.
split
(
'\n'
)
const
phoneReg
=
/^
(
13
[
0-9
]
|15
[
0-9
]
|16
[
0-9
]
|17
[
0-9
]
|18
[
0-9
]
|19
[
0-9
]
|14
[
0-9
])[
0-9
]{8}
$/
phoneList
=
[...
new
Set
(
phoneList
)]
// let phoneList = this.phone.split(/[\n|\s|,|,]/)
let
reg
if
(
this
.
receiveWay
==
1
)
{
reg
=
/^
(
13
[
0-9
]
|15
[
0-9
]
|16
[
0-9
]
|17
[
0-9
]
|18
[
0-9
]
|19
[
0-9
]
|14
[
0-9
])[
0-9
]{8}
$/
}
else
{
reg
=
/^
[
0-9a-zA-Z
]{6}
$/
}
let
arr
=
[]
phoneList
.
forEach
(
item
=>
{
arr
.
push
({
tel
:
item
,
valid
:
phoneR
eg
.
test
(
item
)
valid
:
r
eg
.
test
(
item
)
})
})
this
.
phoneList
=
arr
.
filter
(
item
=>
item
.
tel
)
...
...
@@ -405,7 +422,11 @@ export default {
res
.
data
.
updatedDate
=
dayjs
(
res
.
data
.
updatedDate
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
this
.
approvalStatus
=
res
.
data
.
approveStatus
-
1
this
.
editForm
=
res
.
data
this
.
editForm
.
receiveWay
=
this
.
editForm
.
receiveWay
+
''
this
.
receiveWay
=
res
.
data
.
receiveWay
||
1
if
(
res
.
data
&&
res
.
data
.
receiveDetails
)
{
this
.
phone
=
res
.
data
.
receiveDetails
.
replaceAll
(
','
,
'\n'
)
this
.
formatPhone
()
}
this
.
recoveryCoupon
()
this
.
recoveryTotalPrice
()
this
.
hasStaffBlock
(
false
)
...
...
@@ -540,6 +561,10 @@ export default {
},
handleConfirm
()
{
let
validItem
=
this
.
phoneList
.
find
(
item
=>
!
item
.
valid
)
if
(
validItem
&&
validItem
.
tel
)
{
return
this
.
$message
.
error
(
`
${
this
.
receiveWay
==
1
?
'手机号'
:
'车架号'
}${
validItem
.
tel
}
格式错误,请修改!`
)
}
this
.
$refs
.
editFormRef
.
$refs
[
this
.
editChildRef
].
validate
(
valid
=>
{
if
(
valid
)
{
var
params
=
this
.
$common
.
utils
.
deepClone
(
this
.
editForm
)
...
...
@@ -548,30 +573,40 @@ export default {
params
.
couponCreateRequests
.
forEach
(
item
=>
{
item
.
couponId
=
item
.
id
})
if
(
this
.
editForm
.
receiveRule
==
1
)
{
params
.
receiveDetailList
=
this
.
phoneList
.
map
(
item
=>
item
.
tel
)
params
.
receiveWay
=
this
.
receiveWay
}
delete
params
.
staffList
delete
params
.
couponList
if
(
this
.
routeInfo
.
addOrEdit
==
'edit'
)
{
params
.
id
=
this
.
routeInfo
.
id
if
(
this
.
editForm
.
receiveRule
==
2
)
{
let
telArr
=
[]
this
.
editForm
.
receiveDetails
&&
(
telArr
=
this
.
editForm
.
receiveDetails
.
split
(
','
))
params
.
receiveDetailList
=
[...
telArr
]
}
}
params
.
requestSource
=
1
// 插入判断是否存在审批模板
const
{
session
}
=
this
.
$globalState
this
.
$apis
.
giftBag
.
templateModal
({
merchantId
:
session
.
merchantId
}).
then
(
result
=>
{
if
(
result
.
data
&&
(
!
this
.
isChangeCoupons
||
!
this
.
isChangePeople
))
{
this
.
$confirm
(
`<div>提交后立即生效,如需审批,请在企微工作台创建</div><div>是否继续提交</div>`
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
dangerouslyUseHTMLString
:
true
})
.
then
(()
=>
{
this
.
insertHttp
(
params
)
})
.
catch
(()
=>
{})
}
else
{
this
.
insertHttp
(
params
)
}
})
// const { session } = this.$globalState
this
.
insertHttp
(
params
)
// this.$apis.giftBag.templateModal({ merchantId: session.merchantId }).then(result => {
// if (result.data && (!this.isChangeCoupons || !this.isChangePeople)) {
// this.$confirm(`<div>提交后立即生效,如需审批,请在企微工作台创建</div><div>是否继续提交</div>`, '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// dangerouslyUseHTMLString: true
// })
// .then(() => {
// this.insertHttp(params)
// })
// .catch(() => {})
// } else {
// this.insertHttp(params)
// }
// })
}
})
},
...
...
@@ -674,6 +709,23 @@ export default {
height
:
73px
;
font-family
:
auto
;
}
.tel-item
{
height
:
26px
;
display
:
inline-block
;
padding
:
0
8px
;
line-height
:
26px
;
background
:
#fafbfe
;
border-radius
:
4px
;
border
:
1px
solid
#e8e8ea
;
color
:
#666666
;
text-align
:
center
;
margin-right
:
4px
;
}
.valid-tel
{
background
:
#fff1f0
;
border
:
1px
solid
#ffa39e
;
color
:
#ff4d4f
;
}
}
//
礼包
.gift-block
{
...
...
@@ -691,6 +743,11 @@ export default {
.gift-box
{
display
:
flex
;
padding
:
10px
0
10px
10px
;
.server-type
{
margin
:
4px
12px
0
0
;
height
:
23px
;
width
:
58px
;
}
.gift-label
{
width
:
70px
;
color
:
#999999
;
...
...
src/views/giftBag/giftDetail.vue
View file @
a1f5f98
...
...
@@ -26,7 +26,8 @@
</div>
<div
v-for=
"(item, index) in orderShow"
:key=
"index"
>
<div
class=
"gift-box"
v-show=
"couponObj[item].list.length"
>
<div
class=
"gift-label"
>
{{
couponObj
[
item
].
label
}}
:
</div>
<!--
<div
class=
"gift-label"
>
{{
couponObj
[
item
].
label
}}
:
</div>
-->
<img
class=
"server-type"
:src=
"require(`@/assets/coupon/icon-$
{item}.png`)" />
<div
class=
"gift-content"
>
<div
class=
"gift-item"
v-for=
"(subItem, subIndex) in couponObj[item].list"
:key=
"subIndex"
>
<span
:class=
"['circle', subItem.status == '3' ? ' grey' : '']"
></span>
...
...
@@ -37,7 +38,12 @@
</div>
</div>
</div>
<div
slot=
"receiveDetails"
>
{{
editForm
.
receiveWay
==
'1'
?
'指定手机号'
:
'指定车架号后6位'
}}
:
{{
editForm
.
receiveDetails
}}
</div>
<div
slot=
"receiveDetails"
>
<span
style=
"border: 1px dashed #333;"
>
{{
editForm
.
receiveWay
==
'1'
?
'指定手机号'
:
'指定车架号后6位'
}}
:
</span>
<div
class=
"phone-wrap"
>
<span
class=
"phone"
v-for=
"(item,id) in receiveDetailList"
:key=
"id"
>
{{
item
}}
</span>
</div>
</div>
<div
slot=
"staffListBlock"
class=
"sale-select"
v-show=
"editForm.staffList && editForm.staffList.length != 0"
>
<div
:key=
"key"
class=
"el-input-tag input-tag-wrapper-detail"
>
<el-tag
effect=
"plain"
type=
"info"
v-for=
"(tag, idx) in editForm.staffList"
:key=
"idx"
:disable-transitions=
"false"
@
close=
"handleStaffRemove(tag, idx)"
>
...
...
@@ -80,6 +86,7 @@ export default {
footerWidth
:
'0'
,
loading
:
false
,
editChildRef
:
'editChildRef'
,
receiveDetailList
:[],
routeInfo
:
{
// add-新增;edit-编辑;detail-详情
addOrEdit
:
'add'
,
...
...
@@ -194,6 +201,9 @@ export default {
res
.
data
.
createdDate
=
dayjs
(
res
.
data
.
createdDate
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
res
.
data
.
updatedDate
=
dayjs
(
res
.
data
.
updatedDate
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
this
.
editForm
=
res
.
data
let
arr
=
[]
res
.
data
.
receiveDetails
&&
(
arr
=
res
.
data
.
receiveDetails
.
split
(
','
))
this
.
receiveDetailList
=
[...
arr
]
this
.
approvalStatus
=
res
.
data
.
approveStatus
-
1
this
.
recoveryCoupon
()
this
.
recoveryTotalPrice
()
...
...
@@ -268,6 +278,11 @@ export default {
.gift-box
{
display
:
flex
;
padding
:
10px
0
10px
10px
;
.server-type
{
margin
:
4px
12px
0
0
;
height
:
23px
;
width
:
58px
;
}
.gift-label
{
width
:
70px
;
color
:
#999999
;
...
...
@@ -299,6 +314,20 @@ export default {
}
}
}
.phone-wrap
{
width
:
878px
;
background-color
:
#F9F9F9
;
padding
:
5px
10px
;
line-height
:
14px
;
font-size
:
14px
;
box-sizing
:
border-box
;
margin-top
:
5px
;
.phone{
display
:
inline-block
;
margin
:
5px
16px
5px
0
;
border
:
1px
dashed
#333
;
}
}
//
发放员工
.sale-select
{
display
:
flex
;
...
...
src/views/giftBag/giftList.vue
View file @
a1f5f98
...
...
@@ -11,17 +11,8 @@
</div>
<div
class=
"container"
>
<div>
<glsx-combi-form
ref=
"showSearch"
:formObj=
"searchForm"
:formData=
"searchFormData"
>
<span
slot=
"footer"
>
<el-button
:size=
"size"
type=
"default"
@
click=
"handleReset"
>
重置
</el-button>
<el-button
:size=
"size"
type=
"primary"
@
click=
"handleSearch"
>
查询
</el-button>
</span>
</glsx-combi-form>
<glsx-combi-form
ref=
"showSearch"
>
<span
slot=
"footer"
class=
"footer-btns"
>
<GLButton
:size=
"size"
class=
"default-blue-btn"
type=
"default"
fn=
"导出"
@
click=
"handleExport"
>
导出
</GLButton>
</span>
</glsx-combi-form>
<GLCombiForm
@
handleOk=
"handleSearch"
@
handleRest=
"handleReset"
ref=
"showSearch"
:formObj=
"searchForm"
:formData=
"searchFormData"
></GLCombiForm>
<GLButton
style=
"float:right;margin-bottom:10px;"
:size=
"size"
class=
"default-blue-btn"
type=
"default"
fn=
"导出"
@
click=
"handleExport"
>
导出
</GLButton>
</div>
<!-- 表格区域 开始 -->
...
...
@@ -30,6 +21,7 @@
<div
class=
"p-b-12"
>
礼包明细
</div>
<div
class=
"gift-detail flex-wrap"
>
<div
class=
"gift-item"
v-for=
"(item, index) in scope.scope.couponList"
:key=
"index"
>
<img
:src=
"require(`@/assets/coupon/icon-$
{attrToIcon[item.discountType]}.png`)" />
<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>
...
...
@@ -38,12 +30,12 @@
<div
slot=
"name"
slot-scope=
"scope"
>
<p
class=
"cursor-pointer"
@
click=
"handleDetail(scope.scope)"
>
{{
scope
.
scope
.
name
}}
</p>
</div>
<div
slot=
"approveStatus"
slot-scope=
"scope"
>
<span
:style=
"
{ color: approvalStatusColor[scope.scope.approveStatus - 1] }">
{{
approvalStatusVal
[
scope
.
scope
.
approveStatus
-
1
]
}}
</span>
<div
style=
"display: flex;align-items: center;"
slot=
"approveStatus"
slot-scope=
"scope"
>
<div
class=
"approve-status"
:style=
"
{ 'background-color': approvalStatusColor[scope.scope.approveStatus - 1] }">
</div>
<span>
{{
approvalStatusVal
[
scope
.
scope
.
approveStatus
-
1
]
}}
</span>
</div>
<div
class=
"table-btns"
slot=
"auth-button"
slot-scope=
"scope"
>
<GLButton
type=
"text"
fn=
"编辑"
@
click=
"handleEdit('edit', scope.scope)"
>
编辑
</GLButton>
<GLButton
type=
"text"
fn=
"删除"
@
click=
"handleDelete(scope.scope)"
>
删除
</GLButton>
<GLTableButton
:buttonList=
"buttonList"
:buttonItem=
"scope"
:buttonNum=
"3"
></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
...
...
@@ -59,6 +51,40 @@ export default {
name
:
'giftList'
,
data
()
{
return
{
attrToIcon
:
{
2
:
'discount'
,
3
:
'cash'
,
4
:
'exchange'
,
7
:
'service'
},
buttonList
:
[
{
type
:
'GLButton'
,
name
:
row
=>
{
return
'编辑'
},
attrs
:
{
type
:
'text'
,
fn
:
'编辑'
},
listeners
:
{
click
:
row
=>
this
.
handleEdit
(
'edit'
,
row
.
scope
)
}
},
{
type
:
'GLButton'
,
name
:
row
=>
{
return
'删除'
},
attrs
:
{
type
:
'text'
,
fn
:
'删除'
},
listeners
:
{
click
:
row
=>
this
.
handleDelete
(
row
.
scope
)
}
}
],
size
:
'small'
,
url
:
url
,
searchForm
:
{
...
...
@@ -106,7 +132,10 @@ export default {
getListApi
:
this
.
$apis
.
giftBag
.
getListApi
,
tableParams
:
{
listName
:
'list'
,
tableOption
:
true
,
tableOption
:
{
width
:
120
,
align
:
'center'
},
tableColumns
:
[
{
label
:
''
,
...
...
@@ -130,11 +159,11 @@ export default {
{
label
:
'备注名称'
,
prop
:
'remarkName'
,
width
:
'200'
width
:
150
},
{
label
:
'预估成本/元'
,
width
:
20
0
,
width
:
15
0
,
prop
:
'anticipatedCost'
,
formatter
:
cellValue
=>
{
return
(
cellValue
.
anticipatedCost
/
100
).
toFixed
(
2
)
...
...
@@ -143,12 +172,28 @@ export default {
{
label
:
'发放员工'
,
prop
:
'staffList'
,
width
:
20
0
,
width
:
15
0
,
formatter
:
cellValue
=>
{
return
cellValue
.
staffList
.
map
(
item
=>
item
.
staffName
).
join
(
','
)
}
},
{
label
:
'已领取'
,
prop
:
'stock'
,
width
:
150
,
formatter
:
cellValue
=>
{
return
cellValue
.
receivedStock
||
'0'
}
},
{
label
:
'待领取'
,
prop
:
''
,
width
:
150
,
formatter
:
cellValue
=>
{
return
+
cellValue
.
stock
-
+
cellValue
.
receivedStock
||
'0'
}
},
{
label
:
'赠送原因'
,
width
:
200
,
prop
:
'giveReason'
,
...
...
@@ -158,13 +203,14 @@ export default {
},
{
label
:
'审批状态'
,
width
:
150
,
prop
:
'approveStatus'
,
addHtml
:
'approveStatus'
},
{
label
:
'创建时间'
,
prop
:
'createdDate'
,
width
:
'180'
,
width
:
180
,
formatter
:
cellValue
=>
{
return
dayjs
(
cellValue
.
createdDate
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
...
...
@@ -204,7 +250,7 @@ export default {
},
// 1 审批中;2 审批通过; 3审批驳回 4审批撤销 5待审批
// 审批状态 0审批中 1审批通过 2审批驳回
approvalStatusColor
:
[
'#
FF6D00'
,
'#2CCA74'
,
'#EB4E4E'
,
'#999999'
,
'#999999
'
],
approvalStatusColor
:
[
'#
5850FF'
,
'#2CCA74'
,
'#EB4E4E'
,
'#FDB757'
,
'#FDB757
'
],
approvalStatusVal
:
[
'审批中'
,
'审批通过'
,
'已驳回'
,
'审批撤销'
,
'待审批'
]
}
},
...
...
@@ -294,6 +340,7 @@ export default {
$title
:
encodeURI
(
addOrEdit
==
'add'
?
'新增礼包'
:
'编辑礼包'
)
}
addOrEdit
!=
'add'
&&
(
params
.
id
=
row
.
id
)
addOrEdit
!=
'add'
&&
(
params
.
receivedStock
=
row
.
receivedStock
)
this
.
$router
.
push
({
path
:
'/giftBag/editGift'
,
query
:
params
...
...
@@ -354,12 +401,28 @@ export default {
<
style
lang=
"scss"
>
.p-b-12
{
margin-bottom
:
14px
;
font-weight
:
500
;
color
:
#333333
;
}
.approve-status
{
width
:
6px
;
height
:
6px
;
border-radius
:
4px
;
margin-right
:
8px
;
display
:
inline-block
;
}
.gift-detail
.gift-item
{
margin-right
:
80px
;
display
:
flex
;
align-items
:
center
;
color
:
#333333
;
img
{
height
:
23px
;
width
:
58px
;
margin-right
:
23px
;
}
.gift-coupon-name
{
display
:
inline-block
;
margin-right
:
7px
;
}
.gift-tips
{
display
:
inline-block
;
...
...
src/views/giftBag/receivedGiftList.vue
View file @
a1f5f98
...
...
@@ -3,31 +3,36 @@
<div
class=
"marketing"
>
<div
class=
"container"
>
<div>
<
glsx-combi-form
ref=
"showSearch"
:formObj=
"searchForm"
:formData=
"searchFormData"
></glsx-combi-f
orm>
<glsx-combi-form
ref=
"showSearch"
:formObj=
"searchForm"
:formData=
"searchFormData1"
>
<
GLCombiForm
ref=
"showSearch"
@
handleOk=
"handleSearch"
@
handleRest=
"handleReset"
:formObj=
"searchForm"
:formData=
"searchFormData"
></GLCombiF
orm>
<
!--
<
glsx-combi-form
ref=
"showSearch"
:formObj=
"searchForm"
:formData=
"searchFormData1"
>
<span
slot=
"footer"
>
<el-button
:size=
"size"
type=
"default"
@
click=
"handleReset"
>
重置
</el-button>
<el-button
:size=
"size"
type=
"primary"
@
click=
"handleSearch"
>
查询
</el-button>
</span>
</glsx-combi-form>
<glsx-combi-form
ref=
"showSearch"
>
<span
slot=
"footer"
class=
"footer-btns"
>
<!--
<el-button
:size=
"size"
type=
"default"
@
click=
"handleExport"
>
导出
</el-button>
-->
<GLButton
:size=
"size"
class=
"default-blue-btn"
type=
"default"
fn=
"已领取导出"
@
click=
"handleExport"
>
导出
</GLButton>
</glsx-combi-form>
-->
<
!--
<
glsx-combi-form
ref=
"showSearch"
>
<span
slot=
"footer"
class=
"footer-btns"
>
-->
<!--
<el-button
:size=
"size"
type=
"default"
@
click=
"handleExport"
>
导出
</el-button>
-->
<!--
<GLButton
:size=
"size"
class=
"default-blue-btn"
type=
"default"
fn=
"已领取导出"
@
click=
"handleExport"
>
导出
</GLButton>
</span>
</glsx-combi-form>
</glsx-combi-form>
-->
<GLButton
style=
"float:right;margin-bottom:10px;"
:size=
"size"
class=
"default-blue-btn"
type=
"default"
fn=
"已领取导出"
@
click=
"handleExport"
>
导出
</GLButton>
</div>
<!-- 表格区域 开始 -->
<GLTable
ref=
"receivedGiftListRef"
:getListApi=
"getListApi"
:hasNum=
"false"
:noDataImg=
"url"
:searchForm=
"tableSearchForm"
:tableParams=
"tableParams"
:pageConf=
"pageConf"
:beforeSearchFn=
"beforeSearchFn"
@
setTableFinishFun=
"setTableFinishFun"
>
<span
slot=
"directionalGiftName"
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"handleDetail(scope.scope)"
>
{{
scope
.
scope
.
directionalGiftName
}}
</el-button>
<span
v-if=
"scope.scope.receiveStatus == 2"
class=
"void-label"
>
已作废
</span>
<el-tooltip
class=
"item"
effect=
"dark"
:content=
"scope.scope.cancelReason"
placement=
"top-start"
>
<p
class=
"void-reason"
v-if=
"scope.scope.receiveStatus == 2"
>
作废原因:
{{
scope
.
scope
.
cancelReason
||
'--'
}}
</p>
</el-tooltip>
</span>
<div
slot=
"giftInfo"
slot-scope=
"scope"
>
<GLTable
ref=
"giftListRef"
:hasNum=
"false"
:hasPage=
"false"
:noDataImg=
"url"
:tableParams=
"giftParams"
:tableData=
"scope.scope | filterTable"
@
setTableFinishFun=
"setGiftTableFinishFun"
></GLTable>
</div>
<div
class=
"table-btns"
slot=
"auth-button"
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"toVoid(scope.scope)"
>
作废
</el-button>
<el-button
:disabled=
"scope.scope.receiveStatus == 2"
type=
"text"
@
click=
"toVoid(scope.scope)"
>
作废
</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
...
...
@@ -36,8 +41,8 @@
<div
class=
"wrap"
>
<p
class=
"dialog-tip"
>
请先和客户沟通在确认,避免引起客诉,作废后客户将不可使用该礼包下所有优惠卷
</p>
<div
style=
"display:flex;"
>
<label
style=
"white-space:nowrap;
"
for=
""
>
作废原因:
</label>
<el-input
type=
"textarea"
v-model=
"
phone
"
placeholder=
"请输入作废原因"
></el-input>
<label
class=
"label
"
for=
""
>
作废原因:
</label>
<el-input
type=
"textarea"
v-model=
"
reason"
maxlength=
"50
"
placeholder=
"请输入作废原因"
></el-input>
</div>
</div>
</glsx-dialog>
...
...
@@ -71,13 +76,16 @@ export default {
return
{
size
:
'small'
,
url
:
url
,
curId
:
''
,
reason
:
''
,
voidDialogVisibity
:
false
,
searchForm
:
{
nickName
:
''
,
wechatUserFlag
:
''
,
giftName
:
''
,
staffName
:
''
,
createDate
:
[]
createDate
:
[],
receiveStatus
:
''
},
tableSearchForm
:
{},
// 搜索
...
...
@@ -103,9 +111,7 @@ export default {
optionLabel
:
'Name'
,
optionsName
:
'List'
,
placeholder
:
'请选择'
}
],
searchFormData1
:
[
},
{
label
:
'发放员工'
,
name
:
'staffName'
,
...
...
@@ -117,8 +123,32 @@ export default {
name
:
'createDate'
,
type
:
'datePicker'
,
pickerOptions
:
'beforeRangePickerOptions'
},
{
label
:
'领取状态'
,
name
:
'receiveStatus'
,
type
:
'select'
,
optionList
:
[],
optionId
:
'Id'
,
optionLabel
:
'Name'
,
optionsName
:
'statusList'
,
placeholder
:
'请选择'
}
],
// searchFormData1: [
// {
// label: '发放员工',
// name: 'staffName',
// type: 'input',
// placeholder: '请输入'
// },
// {
// label: '领取日期',
// name: 'createDate',
// type: 'datePicker',
// pickerOptions: 'beforeRangePickerOptions'
// }
// ],
baseData
:
{
List
:
[
{
...
...
@@ -129,6 +159,16 @@ export default {
Id
:
'2'
,
Name
:
'是'
}
],
statusList
:
[
{
Id
:
'1'
,
Name
:
'正常使用'
},
{
Id
:
'2'
,
Name
:
'已作废'
}
]
},
//礼包详情
...
...
@@ -172,7 +212,10 @@ export default {
getListApi
:
this
.
$apis
.
giftBag
.
getReceivedGiftInfoApi
,
tableParams
:
{
listName
:
'list'
,
tableOption
:
true
,
tableOption
:
{
width
:
100
,
align
:
'center'
},
tableColumns
:
[
{
label
:
''
,
...
...
@@ -195,12 +238,12 @@ export default {
{
label
:
'客户手机号'
,
prop
:
'phone'
,
width
:
'110'
width
:
150
},
{
label
:
'是否为企微客户'
,
prop
:
'wechatUserFlag'
,
width
:
'200'
,
width
:
150
,
formatter
:
cellValue
=>
{
if
(
cellValue
.
wechatUserFlag
==
1
)
{
return
'否'
...
...
@@ -282,8 +325,27 @@ export default {
// 查看
handleVoidClose
()
{
this
.
voidDialogVisibity
=
false
this
.
curId
=
''
this
.
reason
=
''
},
handleVoidConfirm
()
{
if
(
!
this
.
reason
.
trim
())
{
return
this
.
$message
({
message
:
'请输入作废原因!'
,
type
:
'error'
,
customClass
:
'myMessage'
})
}
this
.
$apis
.
giftBag
.
toVoidGift
({
userDirectionalGiftId
:
this
.
curId
,
cancelReason
:
this
.
reason
}).
then
(
res
=>
{
if
(
res
)
{
this
.
handleVoidClose
()
this
.
$message
({
message
:
'操作成功'
,
type
:
'success'
})
this
.
$refs
.
receivedGiftListRef
.
refreshTable
()
}
})
this
.
handleVoidClose
()
},
handleDetail
(
row
)
{
...
...
@@ -294,7 +356,8 @@ export default {
}
})
},
toVoid
(
scope
)
{
toVoid
(
row
)
{
this
.
curId
=
row
.
id
this
.
voidDialogVisibity
=
true
},
getParams
()
{
...
...
@@ -408,7 +471,8 @@ export default {
wechatUserFlag
:
''
,
giftName
:
''
,
staffName
:
''
,
createDate
:
[]
createDate
:
[],
receiveStatus
:
''
}
this
.
handleSearch
()
}
...
...
@@ -426,14 +490,45 @@ export default {
.marketing
/
deep
/
.el-table
th
div
{
line-height
:
normal
!important
;
}
.void-label
{
width
:
44px
;
height
:
18px
;
display
:
inline-block
;
font-size
:
12px
;
color
:
#999999
;
border-radius
:
2px
;
text-align
:
center
;
line-height
:
18px
;
background
:
#eeeded
;
margin-left
:
4px
;
}
.void-reason
{
font-size
:
10px
;
color
:
#999999
;
width
:
180px
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
margin
:
4px
0
0
;
}
.void-dialog
{
/deep/
.el-dialog__body
{
padding
:
20px
80px
;
.el-textarea__inner
{
font-family
:
auto
;
}
.wrap
{
padding-bottom
:
50px
;
.dialog-tip
{
margin-bottom
:
20px
;
}
.label
{
white-space
:
nowrap
;
margin-top
:
6px
;
}
.el-textarea__inner
{
height
:
72px
;
}
}
}
}
...
...
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