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 46129eb0
authored
Jul 04, 2022
by
wuwx
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v2.6.0' into wuwx_dev_v2.6.0
2 parents
eceb8d0e
bf803ed1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
20 deletions
src/assets/css/public.scss
src/views/giftBag/editGift.vue
src/views/giftBag/giftDetail.vue
src/views/giftBag/selectStaffDialog.vue
src/assets/css/public.scss
View file @
46129eb
...
...
@@ -588,3 +588,13 @@ html {
.myMessage
{
z-index
:
4000
!
important
;
}
.loadingClass
{
.el-icon-loading
{
font-size
:
22px
;
}
.el-icon-loading
,
.el-loading-text
{
color
:
#5850ff
!
important
;
}
}
\ No newline at end of file
src/views/giftBag/editGift.vue
View file @
46129eb
...
...
@@ -17,7 +17,7 @@
</div>
<div
class=
"container edit-container"
>
<p
class=
"edit-title"
>
{{
title
}}
</p>
<glsx-combi-form
class=
"edit-form-container m-r-20"
ref=
"editFormRef"
:isEdit=
"isEdit"
:labelWidth=
"labelWidth"
defaultWidth=
"415px"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<glsx-combi-form
v-loading=
"loading"
class=
"edit-form-container m-r-20"
ref=
"editFormRef"
:isEdit=
"isEdit"
:labelWidth=
"labelWidth"
defaultWidth=
"415px"
:isBlock=
"true"
:formRef=
"editChildRef"
:formObj=
"editForm"
:formData=
"editFormData"
:formRules=
"editRule"
>
<div
slot=
"remarkName"
class=
"edit-tips m-t-8"
>
可根据备注名称进行查找,仅作内部查看,不展示给客户
</div>
<el-button
slot=
"selectGiftBtn"
:disabled=
"routeInfo.receivedStock"
class=
"default-blue-btn"
@
click=
"handleGiftAdd"
>
选择礼包内容
</el-button>
<div
slot=
"couponListBlock"
class=
"gift-block"
:style=
"
{ 'margin-left': labelWidth }" v-show="editForm.couponList
&&
editForm.couponList.length != 0">
...
...
@@ -46,7 +46,8 @@
<span
class=
"approval-tip"
style=
"margin-left:8px;"
>
每个用户根据领取规则限领一次礼包
</span>
</div>
<div
class=
"approval"
slot=
"approvalSlot"
>
<el-radio
:disabled=
"routeInfo.receivedStock"
v-model=
"editForm.approveFlag"
:label=
"1"
>
赠送前需审批
</el-radio>
<!--
<el-radio
:disabled=
"routeInfo.receivedStock"
v-model=
"editForm.approveFlag"
:label=
"1"
>
赠送前需审批
</el-radio>
-->
<el-radio
disabled
v-model=
"editForm.approveFlag"
:label=
"1"
>
赠送前需审批
</el-radio>
<p
class=
"approval-tip"
style=
"margin-bottom:12px;"
>
员工在赠送时需提交赠送申请,审批通过后才可赠送
</p>
<el-radio
:disabled=
"routeInfo.receivedStock"
v-model=
"editForm.approveFlag"
:label=
"2"
>
无需审批
</el-radio>
<p
class=
"approval-tip"
>
无需审批,可直接赠送给客户
</p>
...
...
@@ -61,7 +62,7 @@
<el-input
@
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"
>
<div
:class=
"['tel-item',
!item.valid ? 'valid-tel': receiveWay == 1?'realTel':'realNum
']"
v-for=
"(item, index) in phoneList"
:key=
"index"
>
{{
item
.
tel
}}
<i
style=
"cursor:pointer"
class=
"el-icon-close"
@
click=
"delPhone(item.tel)"
></i>
</div>
...
...
@@ -111,6 +112,8 @@ export default {
data
()
{
return
{
phone
:
''
,
isLoaded
:
true
,
loading
:
false
,
phoneList
:
[],
size
:
'small'
,
title
:
'新增礼包'
,
...
...
@@ -146,7 +149,7 @@ export default {
// 优惠券状态(status):1:未生效,2:生效中,3:已失效
couponList
:
[],
stock
:
1
,
approveFlag
:
1
,
approveFlag
:
2
,
receiveRule
:
1
},
totalEstimatedCost
:
''
,
...
...
@@ -279,7 +282,8 @@ export default {
},
{
confId
:
2
,
confName
:
'员工赠送时指定'
confName
:
'员工赠送时指定'
,
isDisabled
:
true
},
{
confId
:
3
,
...
...
@@ -385,14 +389,15 @@ export default {
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
this
.
routeInfo
=
this
.
$route
.
query
if
(
this
.
routeInfo
.
receivedStock
)
this
.
routeInfo
.
receivedStock
=
+
this
.
routeInfo
.
receivedStock
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)
let
arr
=
[
'name'
,
'remarkName'
,
'receiveRule'
]
this
.
editFormData
.
map
(
item
=>
{
if
(
arr
.
includes
(
item
.
name
))
{
let
arr
=
[
'name'
,
'remarkName'
,
'receiveRule'
]
this
.
editFormData
.
map
(
item
=>
{
if
(
arr
.
includes
(
item
.
name
))
{
item
.
isDisabled
=
true
}
})
...
...
@@ -408,7 +413,10 @@ export default {
this
.
editForm
.
stock
=
e
.
replace
(
/^
(
0+
)
|
[^\d]
+/g
,
''
)
},
delPhone
(
val
)
{
let
phone
=
this
.
phone
.
replace
(
new
RegExp
(
'[\n]*'
+
val
+
'[\n]*'
,
'g'
),
'\n'
)
let
phone
=
'\n'
+
this
.
phone
+
'\n'
phone
=
phone
.
replace
(
/
[\n]
/g
,
'\n\n'
)
phone
=
phone
.
replace
(
new
RegExp
(
'[\n]'
+
val
+
'[\n]'
,
'g'
),
'\n'
)
phone
=
phone
.
replace
(
/
[\n]
+/g
,
'\n'
)
phone
=
phone
.
replace
(
/^
[\n]
+/
,
''
)
this
.
phone
=
phone
this
.
formatPhone
()
...
...
@@ -433,6 +441,8 @@ export default {
this
.
phoneList
=
arr
.
filter
(
item
=>
item
.
tel
)
},
getInfo
()
{
this
.
isLoaded
=
false
this
.
loading
=
true
this
.
$apis
.
giftBag
.
getGiftInfoApi
({
id
:
this
.
routeInfo
.
id
})
.
then
(
res
=>
{
...
...
@@ -459,6 +469,7 @@ export default {
})
.
finally
(()
=>
{
this
.
loading
=
false
this
.
isLoaded
=
true
})
},
...
...
@@ -533,7 +544,6 @@ export default {
},
handleGiftConfirm
(
selectedData
)
{
console
.
log
(
selectedData
)
this
.
handleGiftClose
()
this
.
couponObj
=
selectedData
this
.
recoveryTotalPrice
()
...
...
@@ -545,7 +555,7 @@ export default {
},
handleGiftDelete
(
attr
,
idx
)
{
if
(
this
.
routeInfo
.
receivedStock
)
return
;
if
(
this
.
routeInfo
.
receivedStock
)
return
this
.
couponObj
[
attr
].
list
.
splice
(
idx
,
1
)
this
.
recoveryTotalPrice
()
this
.
recoveryGiftList
()
...
...
@@ -599,6 +609,10 @@ export default {
})
if
(
this
.
editForm
.
receiveRule
==
1
)
{
params
.
receiveDetailList
=
this
.
phoneList
.
map
(
item
=>
item
.
tel
)
let
maxLength
=
500
if
(
params
.
receiveDetailList
&&
params
.
receiveDetailList
.
length
>
maxLength
){
return
this
.
$message
.
error
(
`领取
${
this
.
receiveWay
==
1
?
'手机号'
:
'车架号'
}
不能超过
${
maxLength
}
个`
)
}
params
.
receiveWay
=
this
.
receiveWay
}
delete
params
.
staffList
...
...
@@ -636,10 +650,18 @@ export default {
},
// 创建-更新接口
insertHttp
(
params
)
{
this
.
loading
=
true
// this.loading = true
const
loadingMoadl
=
this
.
$loading
({
lock
:
true
,
text
:
'正在Loading···'
,
spinner
:
'el-icon-loading'
,
background
:
'rgba(0, 0, 0, 0.5)'
,
customClass
:
'loadingClass'
})
this
.
$apis
.
giftBag
.
insertGiftApi
(
params
)
.
then
(
res
=>
{
loadingMoadl
.
close
()
this
.
$message
({
message
:
res
.
code
==
'0'
?
'操作成功'
:
res
.
message
,
type
:
res
.
code
==
'0'
?
'success'
:
'error'
...
...
@@ -744,12 +766,19 @@ export default {
color
:
#666666
;
text-align
:
center
;
margin-right
:
4px
;
box-sizing
:
border-box
;
}
.valid-tel
{
background
:
#fff1f0
;
border
:
1px
solid
#ffa39e
;
color
:
#ff4d4f
;
}
.realTel
{
width
:
130px
;
}
.realNum
{
width
:
90px
;
}
}
//
礼包
.gift-block
{
...
...
src/views/giftBag/giftDetail.vue
View file @
46129eb
...
...
@@ -43,9 +43,10 @@
</div>
<div
slot=
"receiveDetails"
>
<span
v-if=
"editForm.receiveRule != 1"
>
{{
editForm
.
receiveRule
==
2
?
'员工赠送时指定'
:
'直接领取'
}}
</span>
<span
v-if=
"editForm.receiveRule == 1"
style=
"border: 1px dashed #333;"
>
{{
editForm
.
receiveWay
==
'1'
?
'指定手机号'
:
'指定车架号后6位'
}}
:
</span>
<span
v-if=
"editForm.receiveRule == 2 && editForm.receiveWay"
>
{{
`${editForm.receiveWay == '1' ? '手机号:' : '车架号后6位:'
}
${editForm.receiveDetails
}
`
}}
<
/span
>
<
span
v
-
if
=
"editForm.receiveRule == 1"
>
{{
editForm
.
receiveWay
==
'1'
?
'指定手机号'
:
'指定车架号后6位'
}}
:
<
/span
>
<
div
v
-
if
=
"editForm.receiveRule == 1"
class
=
"phone-wrap"
>
<span
class=
"phone
"
v-for=
"(item, id) in receiveDetailList"
:key=
"id"
>
{{
item
}}
</span>
<
span
:
class
=
"['phone',editForm.receiveWay==1?'realTel':'realNum']
"
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"
>
...
...
@@ -146,7 +147,7 @@ export default {
name
:
[{
required
:
true
,
message
:
'请输入礼包名称'
,
trigger
:
'change'
}
],
remarkName
:
[{
required
:
true
,
message
:
'请输入备注名称'
,
trigger
:
'change'
}
],
couponList
:
[{
required
:
true
,
message
:
'请选择礼包'
,
trigger
:
'change'
}
],
receiveWay
:
[{
required
:
true
,
message
:
'请选择领取
条件
'
,
trigger
:
'change'
}],
receiveWay
:
[{
required
:
true
,
message
:
'请选择领取
规则
'
,
trigger
:
'change'
}
],
staffList
:
[{
required
:
true
,
message
:
'请选择发放员工'
,
trigger
:
'change'
}
],
approveFlag
:
[{
required
:
true
,
message
:
'请选择审批要求'
,
trigger
:
'change'
}
],
stock
:
[{
required
:
true
,
message
:
'请选择库存数量'
,
trigger
:
'change'
}
]
...
...
@@ -179,7 +180,7 @@ export default {
addHtml
:
'approveFlagBlock'
}
,
{
label
:
'领取
条件
'
,
label
:
'领取
规则
'
,
name
:
'receiveWay'
,
addHtml
:
'receiveDetails'
}
,
...
...
@@ -341,7 +342,12 @@ export default {
.
phone
{
display
:
inline
-
block
;
margin
:
5
px
16
px
5
px
0
;
border
:
1px
dashed
#333
;
}
.
realTel
{
width
:
120
px
;
}
.
realNum
{
width
:
80
px
;
}
}
// 发放员工
...
...
src/views/giftBag/selectStaffDialog.vue
View file @
46129eb
...
...
@@ -22,6 +22,7 @@ export default {
// 表格组件
userInfo
:
{},
staffList
:
[],
selectList
:[],
fnCallBack
:
false
,
url
:
url
,
loading
:
true
,
...
...
@@ -72,6 +73,8 @@ export default {
mounted
()
{
this
.
userInfo
=
this
.
$globalState
.
session
this
.
selectList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
selectedStaffList
))
this
.
selectList
.
map
(
item
=>
item
.
userOneId
=
item
.
staffUUID
)
this
.
getList
({},
true
)
},
...
...
@@ -93,7 +96,9 @@ export default {
this
.
loading
=
false
this
.
fnCallBack
=
true
this
.
$refs
.
mutiProRef
.
tableTotal
=
res
.
count
this
.
recoverySelected
()
this
.
$nextTick
(()
=>
{
this
.
recoverySelected
()
})
this
.
$refs
.
mutiProRef
.
tableHeightValues
=
'50vh'
})
},
...
...
@@ -101,12 +106,24 @@ export default {
if
(
this
.
selectedStaffList
&&
this
.
selectedStaffList
.
length
)
{
this
.
selectedStaffList
.
forEach
(
row
=>
{
row
.
userOneId
=
row
.
staffUUID
this
.
$refs
.
mutiProRef
.
$refs
[
this
.
tableParams
.
mutiSelectName
+
'MutiTable'
].
toggleRowSelection
(
row
)
this
.
$nextTick
(()
=>
{
let
idx
=
this
.
$refs
.
mutiProRef
.
$refs
[
this
.
tableParams
.
mutiSelectName
+
'MutiTable'
].
data
.
findIndex
(
item
=>
item
.
userOneId
==
row
.
staffUUID
)
if
(
idx
>-
1
){
try
{
this
.
$refs
.
mutiProRef
.
$refs
[
this
.
tableParams
.
mutiSelectName
+
'MutiTable'
].
toggleRowSelection
(
this
.
$refs
.
mutiProRef
.
$refs
[
this
.
tableParams
.
mutiSelectName
+
'MutiTable'
].
data
[
idx
],
true
)
let
id
=
this
.
selectList
.
findIndex
(
item
=>
item
.
staffUUID
==
row
.
staffUUID
)
if
(
id
>-
1
)
this
.
selectList
.
splice
(
id
,
1
)
}
catch
(
err
){
console
.
log
(
err
)
}
}
})
})
}
},
handleMutiSelectConfirm
()
{
var
selectedData
=
this
.
$refs
.
mutiProRef
.
mutiSelectArr
[
this
.
tableParams
.
mutiSelectName
]
var
selectedData
=
[...
this
.
$refs
.
mutiProRef
.
mutiSelectArr
[
this
.
tableParams
.
mutiSelectName
],...
this
.
selectList
]
this
.
$emit
(
'handleMutiSelectConfirm'
,
selectedData
)
},
handleMutiSelectClose
()
{
...
...
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