Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
member
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
member
member
Commits
481057c4
Commit
481057c4
authored
Nov 26, 2021
by
chenyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: update
parent
29641494
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
34 deletions
+62
-34
allCustomersList.vue
src/components/allCustomers/allCustomersList.vue
+7
-15
index.js
src/components/allCustomers/index.js
+55
-19
No files found.
src/components/allCustomers/allCustomersList.vue
View file @
481057c4
...
...
@@ -30,23 +30,15 @@
<
el
-
input
style
=
"width:300px;"
v
-
model
=
"pageParam.phoneNameCard"
prefix
-
icon
=
"el-icon-search"
placeholder
=
"输入客户姓名/昵称/手机号码"
@
keyup
.
enter
.
native
=
"onSearch"
clearable
><
/el-input
>
<
el
-
select
v
-
model
=
"customerType"
multiple
placeholder
=
"请选择"
style
=
"width: 300px;margin-left:10px;"
>
<
el
-
option
label
=
"非会员"
value
=
"notMember"
/>
<
el
-
option
-
group
label
=
"会员"
>
<
el
-
option
label
=
"微信会员"
value
=
"wxOpenCarMember"
/>
<
el
-
option
label
=
"POS会员"
value
=
"posMember"
/>
<
/el-option-group
>
<
/el-select
>
<
el
-
select
v
-
model
=
"customerTypeLabel"
multiple
@
change
=
"selectChange"
>
<
el
-
option
style
=
"height: auto"
:
value
=
"selectedValue"
>
<
el
-
tree
:
data
=
"treeData"
show
-
checkbox
node
-
key
=
"id"
ref
=
"tree"
@
check
-
change
=
"handleCheckChange"
>
<!--
<
el
-
select
v
-
model
=
"customerTypeLabel"
multiple
@
change
=
"selectChange"
>
<
el
-
option
style
=
"height: auto;padding:0;"
:
value
=
"customerType"
>
<
el
-
tree
:
data
=
"treeData"
show
-
checkbox
node
-
key
=
"id"
default
-
expand
-
all
:
expand
-
on
-
click
-
node
=
"false"
check
-
on
-
click
-
node
:
props
=
"{label: 'label',children: 'children'
}
"
:
default
-
checked
-
keys
=
"['notMember', 'wxOpenCarMember' , 'posMember' ]"
ref
=
"tree"
@
check
-
change
=
"handleCheckChange"
>
<
/el-tree
>
<
/el-option
>
<
/el-select
>
<!--
<
el
-
select
-
tree
width
=
"120px"
multiple
placeholder
=
"请选择内容"
:
data
=
"treeData"
v
-
model
=
"customerType"
><
/el-select-tree> --
>
<
/el-select> --
>
<
el
-
button
type
=
"text"
@
click
=
"showSearch = !showSearch"
class
=
"senior-search"
>
高级搜索
<
i
:
class
=
"showSearch ? 'el-icon-d-arrow-left' : 'el-icon-d-arrow-right'"
><
/i
>
<
/el-button
>
...
...
src/components/allCustomers/index.js
View file @
481057c4
...
...
@@ -38,14 +38,17 @@ export default {
tableData
:
[],
multipleList
:
[],
// 列表select选择
customerTypeLabel
:
[
"非会员"
,
"微信会员"
,
"POS会员"
],
customerType
:
[
"notMember"
,
"wxOpenCarMember"
,
"posMember"
],
customerType
:
[],
treeData
:
[
{
value
:
'notMember'
,
label
:
'非会员'
},
{
id
:
"notMember"
,
label
:
"非会员"
},
{
value
:
'member'
,
label
:
'会员'
,
children
:
[{
value
:
'wxOpenCarMember'
,
label
:
'微信会员'
},
{
value
:
'posMember'
,
label
:
'POS会员'
}]
},
id
:
"member"
,
label
:
"会员"
,
children
:
[
{
id
:
"wxOpenCarMember"
,
label
:
"微信会员"
},
{
id
:
"posMember"
,
label
:
"POS会员"
}
]
}
],
oldCustomerType
:
""
,
showSearch
:
false
,
// 高级搜索开关
...
...
@@ -87,7 +90,14 @@ export default {
computed
:
{
pageName
:
function
()
{
// 全部客户allCustomer;非会员notMember;会员isMember;微信会员wxOpenCarMember,pos会员posMember
return
this
.
customerType
.
join
(
","
);
console
.
log
(
this
.
customerType
);
// let list = this.customerType.length
// ? this.customerType.map(el => el.value).join(",")
// : "notMember,wxOpenCarMember,posMember";
// console.log(list);
return
this
.
customerType
.
length
?
this
.
customerType
.
join
(
","
)
:
"notMember,wxOpenCarMember,posMember"
;
},
selectObj
:
function
()
{
return
{
...
...
@@ -117,18 +127,18 @@ export default {
}
},
watch
:
{
customerType
:
{
handler
(
newV
,
oldV
)
{
if
(
newV
.
length
===
0
)
{
this
.
customerType
=
[].
concat
(
oldV
);
this
.
$message
({
message
:
"客户类型不能为空"
,
type
:
"warning"
});
}
},
immediate
:
true
},
//
customerType: {
//
handler(newV, oldV) {
//
if (newV.length === 0) {
//
this.customerType = [].concat(oldV);
//
this.$message({
//
message: "客户类型不能为空",
//
type: "warning"
//
});
//
}
//
},
//
immediate: true
//
},
$route
:
function
(
n
,
o
)
{
if
(
n
.
path
===
"/allCustomers"
)
this
.
$store
.
commit
(
"mutations-slide"
,
true
);
...
...
@@ -147,6 +157,32 @@ export default {
},
beforUpdate
()
{},
methods
:
{
// selectChange(event) {
// 这个event数组只有label
// 这里主要处理框内选中项的取消选中
// let arrNew = [];
// this.customerType.forEach(item => {
// event.forEach(eventItem => {
// if (eventItem == item.label) {
// arrNew.push(item);
// }
// });
// });
// this.$refs.tree.setCheckedNodes(arrNew);
// },
// handleCheckChange(data, checked) {
// let res = this.$refs.tree.getCheckedNodes(true, true);
// let arrLabel = [];
// let arr = [];
// res.forEach(item => {
// arrLabel.push(item.label);
// arr.push(item);
// });
// console.log('arrLabel',arrLabel);
// console.log('arr',arr);
// this.customerTypeLabel = arr;
// this.customerType = arrLabel;
// },
initialize
()
{
this
.
pageParam
.
phoneNameCard
=
!!
sessionStorage
.
getItem
(
"phoneNameCard"
)
?
sessionStorage
.
getItem
(
"phoneNameCard"
)
...
...
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