Commit 13af6f78 authored by zhengke's avatar zhengke

修改

parent 9e5ef0fa
......@@ -107,7 +107,7 @@
</div>
</div>
<q-select outlined dense stack-label label="客户" option-value="CategoryId" option-label="CategoryName"
:options="customList" v-model="Data.CategoryId" emit-value map-options />
:options="customList" use-input @filter="filterFn" v-model="Data.CategoryId" emit-value map-options />
</div>
<div class="flex justify-between items-center q-my-lg" v-else @click="showEdit('CategoryId')">
<span>客户</span>
......@@ -192,7 +192,8 @@
label: "女",
value: 2,
}],
customList:[]
customList:[],
AllcustomList:[]
}
},
mounted(){
......@@ -202,6 +203,17 @@
this.getTypeList();
},
methods: {
//筛选客户
filterFn(val, update) {
update(() => {
if (val === '') {
this.customList = JSON.parse(JSON.stringify(this.AllcustomList))
} else {
const needle = val.toLowerCase();
this.customList = this.AllcustomList.filter(v => v.CategoryName.toLowerCase().indexOf(needle) > -1);
}
})
},
showEdit(field) {
if(this.isCanEdit){
this.editField = field
......@@ -236,6 +248,7 @@
queryCustomerCategoryList(msg).then(res => {
if (res.Code == 1) {
this.customList = res.Data;
this.AllcustomList = res.Data;
}
})
},
......
......@@ -136,7 +136,7 @@
<q-input filled v-if="objOption.CustomerType==4" stack-label maxlength="20" :dense="false" v-model="objOption.EnterpriseName" lazy-rules
ref="EnterpriseName" class="col-6 q-pr-lg q-pb-lg" />
<q-select stack-label color="primary" v-else filled label="请选择客户" option-value="CategoryId" option-label="CategoryName"
:options="customList" class="col-6 q-pr-lg q-pb-lg" v-model="objOption.CategoryId" clearable emit-value map-options />
:options="customList" class="col-6 q-pr-lg q-pb-lg" v-model="objOption.CategoryId" use-input @filter="filterFn" clearable emit-value map-options />
<template v-if="objOption.CustomerType!=4">
<div class="col-6" v-if="!isShowEdit">
<q-btn label="立即添加同行" @click="isShowEdit=true" size="sm" color="primary" />
......@@ -273,6 +273,7 @@
optionTitle: '',
typeOptions: [],
customList:[],
AllcustomList:[],
isShowEdit: false
}
},
......@@ -283,6 +284,18 @@
this.getCustomList(1);
},
methods: {
//筛选客户
filterFn(val, update) {
update(() => {
if (val === '') {
this.customList = JSON.parse(JSON.stringify(this.AllcustomList))
} else {
const needle = val.toLowerCase();
this.customList = this.AllcustomList.filter(v => v.CategoryName.toLowerCase().indexOf(needle) > -1);
}
})
},
closeCageName(){
this.isShowEdit=false;
this.objOption.CategoryName='';
......@@ -415,6 +428,7 @@
queryCustomerCategoryList(msg).then(res => {
if (res.Code == 1) {
this.customList = res.Data;
this.AllcustomList = res.Data;
}
})
}
......
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