Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
office
haoban-3
Commits
da61eba1
Commit
da61eba1
authored
Jul 15, 2022
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 选择成员组件
parent
51a0f0e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
17 deletions
+43
-17
select-clerk.vue
...ds/actCodeManage/components/select-clerk/select-clerk.vue
+43
-17
No files found.
src/views/salesleads/actCodeManage/components/select-clerk/select-clerk.vue
View file @
da61eba1
...
...
@@ -188,25 +188,47 @@ export default {
// 全选所有导购
onSelectAll
()
{
// 只能全选本页,或者取消本页的全选
this
.
storeClerkList
.
forEach
(
el
=>
{
if
(
!
el
.
disabled
&&
this
.
selected
.
length
<
this
.
max
)
{
el
.
selected
=
this
.
selectAll
.
selected
;
this
.
onSelectStore
(
el
,
true
);
const
storeClerkList
=
this
.
storeClerkList
.
filter
(
el
=>
!
el
.
disabled
);
if
(
storeClerkList
.
length
>
0
)
{
const
isSelectedAll
=
storeClerkList
.
every
(
el
=>
el
.
selected
)
||
this
.
selected
.
length
>=
this
.
max
;
if
(
isSelectedAll
)
{
storeClerkList
.
forEach
(
el
=>
{
el
.
selected
=
false
;
el
.
indeterminate
=
false
;
});
this
.
selected
.
forEach
(
el
=>
(
el
.
selected
=
false
));
this
.
selected
=
[];
}
else
{
storeClerkList
.
forEach
(
el
=>
{
if
(
this
.
selected
.
length
<
this
.
max
&&
!
el
.
selected
)
{
el
.
selected
=
true
;
this
.
onSelectStore
(
el
,
true
);
}
});
}
}
);
}
this
.
updateAllState
();
},
// 全选门店下的导购
onSelectStore
(
store
,
isAll
)
{
store
.
clerkList
.
forEach
(
el
=>
{
if
(
!
el
.
disabled
&&
this
.
selected
.
length
<
this
.
max
)
{
el
.
selected
=
store
.
selected
;
this
.
onSelectClerk
(
el
,
store
,
true
);
const
clerkList
=
store
.
clerkList
.
filter
(
el
=>
!
el
.
disabled
);
if
(
clerkList
.
length
>
0
)
{
let
isSelectedAll
=
clerkList
.
every
(
el
=>
el
.
selected
)
||
this
.
selected
.
length
>=
this
.
max
;
clerkList
.
forEach
(
el
=>
{
if
(
isSelectedAll
)
{
el
.
selected
=
false
;
this
.
onSelectClerk
(
el
,
store
,
true
);
}
else
{
if
(
this
.
selected
.
length
<
this
.
max
&&
!
el
.
selected
)
{
el
.
selected
=
true
;
this
.
onSelectClerk
(
el
,
store
,
true
);
}
}
});
this
.
updateStoreState
(
store
);
if
(
!
isAll
)
{
this
.
updateAllState
();
}
});
this
.
updateStoreState
(
store
);
if
(
!
isAll
)
{
this
.
updateAllState
();
}
},
// 选择单个导购
...
...
@@ -227,11 +249,14 @@ export default {
if
(
this
.
selected
.
length
<
this
.
max
)
{
this
.
selected
.
push
(
clerk
);
}
else
{
clerk
.
selected
=
false
;
this
.
$message
.
warning
(
`最多只能选择
${
this
.
max
}
个导购`
);
}
}
else
{
const
index
=
this
.
selected
.
findIndex
(
el
=>
el
.
clerkId
==
clerk
.
clerkId
);
this
.
selected
.
splice
(
index
,
1
);
if
(
index
>=
0
)
{
this
.
selected
.
splice
(
index
,
1
);
}
}
if
(
!
isAll
)
{
this
.
updateStoreState
(
store
);
...
...
@@ -239,9 +264,10 @@ export default {
}
},
onDelAll
()
{
this
.
selectAll
.
selected
=
false
;
this
.
selectAll
.
indeterminate
=
false
;
this
.
onSelectAll
();
if
(
this
.
selected
.
length
>
0
)
{
this
.
selectAll
.
selected
=
false
;
this
.
onSelectAll
();
}
},
onDel
(
index
)
{
const
clerk
=
this
.
selected
[
index
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment