Commit 481057c4 by chenyu

update: update

parent 29641494
......@@ -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>
......
......@@ -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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment