Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-micro-custom
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 46ea7f67
authored
Dec 06, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交一客一群
1 parent
0f5d368a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
116 additions
and
92 deletions
src/views/guestGroup/add.vue
src/views/guestGroup/components/selectEmp.vue
src/views/guestGroup/components/selectMembers.vue
src/views/guestGroup/add.vue
View file @
46ea7f6
...
@@ -63,7 +63,7 @@
...
@@ -63,7 +63,7 @@
<el-button
type=
"primary"
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleCancel"
>
取消
</el-button>
</div>
</div>
<basic-dialog
:title=
"'选择成员'"
:width=
"'712px'"
:isVisible=
"membersVisible"
@
confirmDialog=
"handleConfirm"
@
closeDialog=
"handleClose"
>
<basic-dialog
:title=
"'选择成员'"
:width=
"'712px'"
:isVisible=
"membersVisible"
@
confirmDialog=
"handleConfirm"
@
closeDialog=
"handleClose"
>
<SelectMembers
:key=
"key"
:selectData
.
sync=
"selectData"
ref=
"membersForm"
></SelectMembers>
<SelectMembers
v-if=
"membersVisible"
:key=
"key"
:selectData
.
sync=
"selectData"
ref=
"membersForm"
></SelectMembers>
</basic-dialog>
</basic-dialog>
</div>
</div>
</
template
>
</
template
>
...
@@ -150,27 +150,25 @@ export default {
...
@@ -150,27 +150,25 @@ export default {
methods
:
{
methods
:
{
openMembers
()
{
openMembers
()
{
this
.
membersVisible
=
!
this
.
membersVisible
this
.
membersVisible
=
!
this
.
membersVisible
if
(
this
.
membersVisible
&&
this
.
$route
.
params
.
id
)
{
//
if (this.membersVisible && this.$route.params.id) {
this
.
$nextTick
(()
=>
{
//
this.$nextTick(() => {
this
.
key
=
new
Date
()
//
this.key = new Date()
console
.
log
(
this
.
$refs
.
membersForm
)
//
console.log(this.$refs.membersForm)
this
.
$refs
.
membersForm
.
selectTable
(
this
.
basicForm
.
userList
)
//
this.$refs.membersForm.selectTable(this.basicForm.userList)
if
(
this
.
basicForm
.
userList
&&
this
.
basicForm
.
userList
.
length
!=
0
)
{
//
if (this.basicForm.userList && this.basicForm.userList.length != 0) {
this
.
basicForm
.
userList
.
map
(
item
=>
{
//
this.basicForm.userList.map(item => {
if
(
item
.
masterStatus
==
1
)
{
//
if (item.masterStatus == 1) {
this
.
selectData
=
this
.
basicForm
.
userList
//
this.selectData = this.basicForm.userList
}
//
}
})
//
})
}
//
}
})
//
})
}
//
}
},
},
handleSubmit
()
{
handleSubmit
()
{
// const previewList = this.$refs.welcome.previewList
// const previewList = this.$refs.welcome.previewList
this
.
$refs
.
basicForm
.
validate
(
valid
=>
{
this
.
$refs
.
basicForm
.
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
console
.
log
(
this
.
basicForm
,
'111'
)
console
.
log
(
this
.
basicForm
,
'122211'
)
const
params
=
{
const
params
=
{
// attachmentList: this.$refs.welcome.previewList,
// attachmentList: this.$refs.welcome.previewList,
orgName
:
this
.
basicForm
.
orgName
,
orgName
:
this
.
basicForm
.
orgName
,
...
@@ -240,6 +238,8 @@ export default {
...
@@ -240,6 +238,8 @@ export default {
this
.
key
=
new
Date
()
this
.
key
=
new
Date
()
}
else
{
}
else
{
this
.
basicForm
.
userList
.
splice
(
idx
,
1
)
this
.
basicForm
.
userList
.
splice
(
idx
,
1
)
this
.
selectData
=
this
.
basicForm
.
userList
this
.
key
=
new
Date
()
}
}
},
},
// 成员弹窗
// 成员弹窗
...
@@ -256,14 +256,15 @@ export default {
...
@@ -256,14 +256,15 @@ export default {
message
:
'必须配置两个及以上成员'
message
:
'必须配置两个及以上成员'
})
})
}
else
{
}
else
{
this
.
$refs
.
membersForm
.
resetSearch
()
//
this.$refs.membersForm.resetSearch()
this
.
basicForm
.
userList
=
this
.
$refs
.
membersForm
.
innerTags
this
.
basicForm
.
userList
=
this
.
$refs
.
membersForm
.
innerTags
this
.
selectData
=
this
.
basicForm
.
userList
this
.
openMembers
()
this
.
openMembers
()
}
}
},
},
handleClose
()
{
handleClose
()
{
// this.openMembers()
// this.openMembers()
this
.
$refs
.
membersForm
.
resetSearch
()
//
this.$refs.membersForm.resetSearch()
this
.
membersVisible
=
false
this
.
membersVisible
=
false
// if (this.$route.params.id) {
// if (this.$route.params.id) {
// this.$nextTick(() => {
// this.$nextTick(() => {
...
...
src/views/guestGroup/components/selectEmp.vue
View file @
46ea7f6
...
@@ -2,14 +2,18 @@
...
@@ -2,14 +2,18 @@
<div
class=
"select-emp-panel"
>
<div
class=
"select-emp-panel"
>
<div
class=
"scrm-p10 emp-tree-panel"
>
<div
class=
"scrm-p10 emp-tree-panel"
>
<div
class=
"popper-arrow"
></div>
<div
class=
"popper-arrow"
></div>
<div
<div
class=
"emp-scroll-panel"
:style=
"
{
class=
"emp-scroll-panel"
:style=
"
{
height: treeHeight + 'px'
height: treeHeight + 'px'
}"
}">
>
<div
class=
"tree-title"
>
所在门店/部门
</div>
<div
class=
"tree-title"
>
所在门店/部门
</div>
<el-tree
v-loading=
"loading"
:data=
"listTree"
:expand-on-click-node=
"false"
highlight-current
:props=
"defaultProps"
@
node-click=
"handleNodeClick"
></el-tree>
<el-tree
v-loading=
"loading"
:data=
"listTree"
:expand-on-click-node=
"false"
highlight-current
:props=
"defaultProps"
@
node-click=
"handleNodeClick"
></el-tree>
</div>
</div>
</div>
</div>
<el-col
<el-col
...
@@ -18,20 +22,27 @@
...
@@ -18,20 +22,27 @@
height: treeHeight + 20 + 'px'
height: treeHeight + 20 + 'px'
}"
}"
>
>
<GLTable
:key=
"key"
ref=
"saleTable"
v-loading=
"loading"
:tableData=
"tableEmpData"
:tableParams=
"tableParams"
:hasNum=
"false"
:hasPage=
"false"
@
selectionTable=
"selectionTable"
></GLTable>
<GLTable
v-loading=
"loading"
ref=
"saleTable"
:tableData=
"tableEmpData"
:tableParams=
"tableParams"
:hasNum=
"false"
:hasPage=
"false"
@
selectionTable=
"selectionTable"
></GLTable>
</el-col>
</el-col>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'selectEmp'
,
name
:
'selectEmp'
,
props
:
[
'selectData'
,
'
key
'
],
props
:
[
'selectData'
,
'
islord
'
],
data
()
{
data
()
{
return
{
return
{
treeHeight
:
0
,
treeHeight
:
0
,
staffName
:
''
,
staffName
:
''
,
listTree
:
[],
listTree
:
[],
isFirst
:
true
,
defaultProps
:
{
defaultProps
:
{
children
:
'children'
,
children
:
'children'
,
label
:
'departmentName'
label
:
'departmentName'
...
@@ -58,58 +69,38 @@ export default {
...
@@ -58,58 +69,38 @@ export default {
]
]
},
},
tableEmpData
:
[],
tableEmpData
:
[],
group
:
{},
currentArr
:
[],
allGroup
:
[],
loading
:
true
employeeList
:
[],
loading
:
true
,
currentArr
:
[]
}
},
watch
:
{
selectData
:
{
handler
(
val
)
{
console
.
log
(
val
)
if
(
val
.
length
==
0
)
{
this
.
clearSelection
()
}
else
{
this
.
$nextTick
(()
=>
{
val
.
forEach
(
i
=>
{
const
row
=
this
.
getEmployee
(
this
.
listTree
).
find
(
j
=>
j
.
staffId
==
i
.
staffId
)
console
.
log
(
row
)
this
.
clearSelect
(
row
)
})
})
}
},
immediate
:
true
}
}
},
},
methods
:
{
methods
:
{
selectionTable
(
val
)
{
selectionTable
(
val
)
{
this
.
$emit
(
'selectTable'
,
val
)
this
.
$emit
(
'selectTable'
,
val
)
this
.
allGroup
=
val
},
},
listDepartmentTree
()
{
listDepartmentTree
()
{
this
.
$apis
.
groupGuest
.
listDepartmentTree
({
merchantId
:
10001001
,
addChildrensFlag
:
true
}).
then
(
res
=>
{
const
params
=
{
merchantId
:
10001001
,
addChildrensFlag
:
true
}
if
(
this
.
islord
)
{
params
.
islord
=
this
.
islord
}
this
.
$apis
.
groupGuest
.
listDepartmentTree
(
params
).
then
(
res
=>
{
this
.
listTree
=
res
this
.
listTree
=
res
this
.
loading
=
false
this
.
loading
=
false
this
.
isFirst
=
false
// this.listTree[0].entmicroStaffResponses = this.getEmployee(this.listTree)
this
.
listTree
[
0
].
entmicroStaffResponses
=
this
.
getEmployee
(
this
.
listTree
)
console
.
log
(
this
.
listTree
)
console
.
log
(
this
.
listTree
,
this
.
selectData
)
this
.
currentArr
=
this
.
$common
.
utils
.
deepClone
(
this
.
listTree
[
0
].
entmicroStaffResponses
)
this
.
currentArr
=
this
.
$common
.
utils
.
deepClone
(
this
.
listTree
[
0
].
entmicroStaffResponses
)
this
.
gruop
=
this
.
selectData
.
find
(
i
=>
i
.
masterStatus
==
1
)
this
.
selectData
.
forEach
(
i
=>
{
const
row
=
this
.
getEmployee
(
this
.
listTree
).
find
(
j
=>
j
.
id
==
i
.
staffId
)
console
.
log
(
row
)
this
.
clearSelect
(
row
)
})
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
selectData
.
forEach
(
i
=>
{
const
row
=
this
.
getEmployee
(
this
.
listTree
).
find
(
j
=>
j
.
staffId
==
i
.
staffId
)
console
.
log
(
row
)
this
.
clearSelect
(
row
)
})
document
.
getElementsByClassName
(
'el-tree-node__expand-icon'
)[
0
].
click
()
document
.
getElementsByClassName
(
'el-tree-node__expand-icon'
)[
0
].
click
()
document
.
getElementsByClassName
(
'el-tree-node__content'
)[
0
].
click
()
document
.
getElementsByClassName
(
'el-tree-node__content'
)[
0
].
click
()
})
})
})
})
},
},
clearSelect
(
row
)
{
clearSelect
(
row
)
{
console
.
log
(
row
,
'2222'
)
this
.
$refs
.
saleTable
.
$refs
.
salelistMutiTable
.
toggleRowSelection
(
row
)
this
.
$refs
.
saleTable
.
$refs
.
salelistMutiTable
.
toggleRowSelection
(
row
)
},
},
clearSelection
()
{
clearSelection
()
{
...
@@ -135,8 +126,8 @@ export default {
...
@@ -135,8 +126,8 @@ export default {
return
arr
return
arr
},
},
searchTable
(
search
)
{
searchTable
(
search
)
{
le
t
arr
=
[]
cons
t
arr
=
[]
if
(
search
)
{
if
(
this
.
currentArr
&&
this
.
currentArr
.
length
!=
0
)
{
this
.
currentArr
.
forEach
(
item
=>
{
this
.
currentArr
.
forEach
(
item
=>
{
console
.
log
(
item
.
staffName
.
indexOf
(
search
)
!=
-
1
)
console
.
log
(
item
.
staffName
.
indexOf
(
search
)
!=
-
1
)
if
(
item
.
staffName
.
indexOf
(
search
)
!=
-
1
)
{
if
(
item
.
staffName
.
indexOf
(
search
)
!=
-
1
)
{
...
@@ -144,19 +135,26 @@ export default {
...
@@ -144,19 +135,26 @@ export default {
arr
.
push
(
item
)
arr
.
push
(
item
)
}
}
})
})
}
else
{
arr
=
this
.
$common
.
utils
.
deepClone
(
this
.
listTree
[
0
].
entmicroStaffResponses
)
}
}
this
.
tableEmpData
=
arr
this
.
tableEmpData
=
arr
}
}
},
// listEntmicroStaff(staffName) {
created
()
{
// let params = {
this
.
listDepartmentTree
()
// departmentId: this.departmentId,
// staffName: staffName ? staffName : this.staffName,
// merchantid: this.$globalState.session.merchantId
// }
// this.$apis.emp.listEntmicroStaff(params).then(res => {
// this.tableEmpData = res
// })
// }
},
},
mounted
()
{
mounted
()
{
console
.
log
(
'islord'
,
this
.
islord
)
let
clientHeight
=
document
.
documentElement
.
clientHeight
let
clientHeight
=
document
.
documentElement
.
clientHeight
this
.
treeHeight
=
clientHeight
-
80
0
this
.
treeHeight
=
clientHeight
-
65
0
console
.
log
(
this
.
selectData
,
'.....'
)
this
.
listDepartmentTree
(
)
}
}
}
}
</
script
>
</
script
>
...
...
src/views/guestGroup/components/selectMembers.vue
View file @
46ea7f6
...
@@ -4,16 +4,33 @@
...
@@ -4,16 +4,33 @@
<el-form-item
label=
"请选择成员"
>
<el-form-item
label=
"请选择成员"
>
<div
class=
"sale-select"
>
<div
class=
"sale-select"
>
<div
class=
"el-input-tag input-tag-wrapper"
@
click=
"foucusTagInput"
>
<div
class=
"el-input-tag input-tag-wrapper"
@
click=
"foucusTagInput"
>
<el-tag
v-for=
"(tag, idx) in innerTags"
:key=
"idx"
closable
:disable-transitions=
"false"
@
close=
"remove(tag)"
>
<el-tag
{{
tag
.
staffName
}}
v-for=
"(tag, idx) in innerTags"
</el-tag>
:key=
"idx"
<el-input
size=
"small"
v-model
.
trim=
"newTag"
placeholder=
"选择员工"
@
input=
"inputTag"
style=
"outline: none; border: none"
></el-input>
closable
:disable-transitions=
"false"
@
close=
"remove(tag)"
>
{{
tag
.
staffName
}}
</el-tag>
<el-input
size=
"small"
v-model
.
trim=
"newTag"
placeholder=
"选择员工"
@
input=
"inputTag"
style=
"outline: none; border: none"
></el-input>
</div>
<div>
<el-button
size=
"small"
class=
"sale-select-btn"
type=
"primary"
@
click=
"searchEmp"
>
查询
</el-button>
</div>
</div>
<div><el-button
size=
"small"
class=
"sale-select-btn"
type=
"primary"
@
click=
"searchEmp"
>
查询
</el-button></div>
</div>
</div>
<div>
<div>
<div
class=
"select-sale-panel"
>
<div
class=
"select-sale-panel"
>
<select-emp
:key=
"key"
:selectData
.
sync=
"selectData"
@
selectTable=
"selectTable"
ref=
"selectEmpTabel"
></select-emp>
<select-emp
:selectData=
"selectData"
:islord=
"islord"
@
selectTable=
"selectTable"
ref=
"selectEmpTabel"
></select-emp>
<div
class=
"popper__arrow"
></div>
<div
class=
"popper__arrow"
></div>
</div>
</div>
</div>
</div>
...
@@ -25,7 +42,7 @@
...
@@ -25,7 +42,7 @@
import
selectEmp
from
'./selectEmp.vue'
import
selectEmp
from
'./selectEmp.vue'
export
default
{
export
default
{
name
:
'SelectMembers'
,
name
:
'SelectMembers'
,
props
:
[
'selectData'
,
'
key
'
],
props
:
[
'selectData'
,
'
islord
'
],
components
:
{
components
:
{
selectEmp
selectEmp
},
},
...
@@ -40,12 +57,6 @@ export default {
...
@@ -40,12 +57,6 @@ export default {
dialog_temp
:
{}
dialog_temp
:
{}
}
}
},
},
watch
:
{
selectData
(
val
)
{
console
.
log
(
val
,
'===='
)
this
.
selectData
=
val
}
},
methods
:
{
methods
:
{
init
()
{
init
()
{
this
.
newTag
=
''
this
.
newTag
=
''
...
@@ -72,13 +83,29 @@ export default {
...
@@ -72,13 +83,29 @@ export default {
},
},
//查询
//查询
searchEmp
()
{
searchEmp
()
{
console
.
log
(
this
.
newTag
)
this
.
$refs
.
selectEmpTabel
.
searchTable
(
this
.
newTag
)
this
.
$refs
.
selectEmpTabel
.
searchTable
(
this
.
newTag
)
},
},
resetSearch
()
{
onSubmit
()
{
this
.
newTag
=
''
if
(
this
.
innerTags
.
length
==
0
)
{
this
.
$refs
.
selectEmpTabel
.
searchTable
()
this
.
$message
({
message
:
'请选择成员'
,
type
:
'error'
})
return
}
let
userIds
=
[]
this
.
innerTags
.
forEach
(
item
=>
{
userIds
.
push
(
item
.
userId
)
})
// this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
}
}
// onCancel() {
// this.$emit('closeDrawer')
// }
},
mounted
()
{
console
.
log
(
111
)
// this.listEntFollowerType()
}
}
}
}
</
script
>
</
script
>
...
@@ -149,8 +176,6 @@ export default {
...
@@ -149,8 +176,6 @@ export default {
width
:
100%
;
width
:
100%
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
max-height
:
64px
;
overflow
:
auto
;
/deep/
input
{
/deep/
input
{
/* input { */
/* input { */
/* background-color: red!important; 调试用的样式 */
/* background-color: red!important; 调试用的样式 */
...
@@ -164,7 +189,7 @@ export default {
...
@@ -164,7 +189,7 @@ export default {
}
}
}
}
.el-tag
{
.el-tag
{
margin
:
3px
4px
3px
0
;
margin
-right
:
4px
;
height
:
26px
;
height
:
26px
;
line-height
:
24px
;
line-height
:
24px
;
}
}
...
...
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