耳号模糊查询修改
This commit is contained in:
@@ -769,12 +769,29 @@ function handleDelete(row) {
|
||||
})
|
||||
}
|
||||
|
||||
function searchEarNumber(query) {
|
||||
if (!query) { earOptions.value = []; return }
|
||||
// 搜索耳号的方法(用于下拉框远程搜索)
|
||||
const searchEarNumber = async (query) => {
|
||||
if (!query || query.trim() === '') {
|
||||
earOptions.value = []
|
||||
return
|
||||
}
|
||||
|
||||
earLoading.value = true
|
||||
searchEarNumbers(query.trim()).then(res => {
|
||||
earOptions.value = res.data || []
|
||||
}).finally(() => earLoading.value = false)
|
||||
try {
|
||||
// 调用API搜索耳号
|
||||
const res = await searchEarNumbers(query.trim())
|
||||
if (res.code === 200 && Array.isArray(res.data)) {
|
||||
earOptions.value = res.data
|
||||
} else {
|
||||
earOptions.value = []
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('搜索耳号失败:', error)
|
||||
earOptions.value = []
|
||||
proxy.$modal.msgError('搜索耳号失败')
|
||||
} finally {
|
||||
earLoading.value = false
|
||||
}
|
||||
}
|
||||
async function handleRanchChange(ranchName) {
|
||||
if (!ranchName) {
|
||||
|
||||
Reference in New Issue
Block a user