Commit c2a851f4 authored by zhengke's avatar zhengke

修改

parent 10c1b787
...@@ -120,9 +120,17 @@ ...@@ -120,9 +120,17 @@
@clear="resetSearch" maxlength="20" /> @clear="resetSearch" maxlength="20" />
</div> </div>
<div class="col-3"> <div class="col-3">
<q-select filled stack-label option-value="Id" @input="resetSearch" option-label="EmployeeName" ref="ID" v-model="msg.CreateBy" <q-select filled stack-label use-input option-value="Id" clearable @input="resetSearch"
:options="EmployeeList" label="直属上级" :dense="false" class="col-6 q-pr-lg q-pb-lg" emit-value option-label="EmployeeName" v-model="msg.CreateBy" :options="EmployeeList"
map-options /> label="直属上级" :dense="false" emit-value map-options @filter="filterFn">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
</div> </div>
</div> </div>
</div> </div>
...@@ -305,6 +313,7 @@ ...@@ -305,6 +313,7 @@
commonId: 0, commonId: 0,
showEditPrice: false, //是否显示改价表单 showEditPrice: false, //是否显示改价表单
EmployeeList:[], //员工列表 EmployeeList:[], //员工列表
AllemployeeList: [], //所有员工列表
isShowviewQuo:false, isShowviewQuo:false,
rId:0 rId:0
} }
...@@ -337,18 +346,32 @@ ...@@ -337,18 +346,32 @@
closeQuota(){ closeQuota(){
this.isShowviewQuo=false; this.isShowviewQuo=false;
}, },
//筛选员工
filterFn(val, update) {
update(() => {
if (val === '') {
this.EmployeeList = JSON.parse(JSON.stringify(this.AllemployeeList))
} else {
const needle = val.toLowerCase()
this.EmployeeList = this.AllemployeeList.filter(v => v.EmployeeName.toLowerCase().indexOf(needle) > -1)
}
})
},
Employee() { Employee() {
var qMsg = { var qMsg = {
EmployeeName: '' EmployeeName: ''
} }
queryEmployee(qMsg).then(res => { queryEmployee(qMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.EmployeeList = res.Data; var jsonData = res.Data;
var obj = { if (jsonData && jsonData.length > 0) {
EmployeeName: '请选择', jsonData.unshift({
Id: 0 Id: 0,
EmployeeName: "请选择"
});
this.AllemployeeList = JSON.parse(JSON.stringify(jsonData));
this.EmployeeList = JSON.parse(JSON.stringify(jsonData));;
} }
this.EmployeeList.unshift(obj);
} }
}).catch(() => { }).catch(() => {
......
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