修改维修工单选择客户时的搜索功能

This commit is contained in:
xiaofajia 2024-10-31 14:06:03 +08:00
parent 2197c2a78e
commit af2c3f27ea

View File

@ -1,5 +1,5 @@
<template>
<el-select v-model="userSelected" clearable filterable >
<el-select v-model="userSelected" clearable filterable :filter-method="handleQuery">
<el-option v-for="user in userList" :key="user.id" :label="user.cusName + ' ' + user.phoneNumber" :value="user.id"/>
</el-select>
</template>
@ -26,7 +26,9 @@ export default {
userSelected: undefined,
queryParams: {
pageNo: 1,
pageSize: 10
pageSize: 10,
cusName: null,
phoneNumber: null,
},
total: 0
}
@ -61,6 +63,14 @@ export default {
const res = await getCustomerMainPage(this.queryParams)
this.userList = res.data.records
this.total = res.data.total
},
handleQuery(data) {
if (/^\d+$/.test(data)) {
this.queryParams.phoneNumber = data
} else {
this.queryParams.cusName = data
}
this.listCustomer()
}
}
}