Fix Bug #999: test echo hello - 手术/麻醉下拉框远程搜索改为本地过滤
将手术项目和麻醉项目的下拉框从远程搜索(remote)改为本地过滤(filter-method), 补充缺失的 filterSurgery/filterAnesthesia 过滤函数和 loadSurgeryAndAnesthesiaOptions 数据加载函数。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -166,14 +166,11 @@
|
||||
<el-select
|
||||
v-model="form.surgeryName"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请输入关键词搜索手术"
|
||||
:remote-method="remoteSearchSurgery"
|
||||
:loading="surgeryLoading"
|
||||
:filter-method="filterSurgery"
|
||||
style="width: 100%"
|
||||
@change="handleSurgeryChange"
|
||||
@focus="() => remoteSearchSurgery('')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in surgeryNameList"
|
||||
@@ -219,14 +216,11 @@
|
||||
<el-select
|
||||
v-model="scope.row.surgeryName"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="搜索次要手术"
|
||||
:remote-method="remoteSearchSurgery"
|
||||
:loading="surgeryLoading"
|
||||
:filter-method="filterSurgery"
|
||||
style="width: 100%"
|
||||
@change="(val) => handleSecondarySurgeryChange(val, scope.row)"
|
||||
@focus="() => remoteSearchSurgery('')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in surgeryNameList"
|
||||
@@ -264,14 +258,11 @@
|
||||
<el-select
|
||||
v-model="scope.row.anesthesiaName"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="搜索麻醉"
|
||||
:remote-method="remoteSearchAnesthesia"
|
||||
:loading="anesthesiaLoading"
|
||||
:filter-method="filterAnesthesia"
|
||||
style="width: 100%"
|
||||
@change="(val) => handleSecondaryAnesthesiaChange(val, scope.row)"
|
||||
@focus="() => remoteSearchAnesthesia('')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in anesthesiaNameList"
|
||||
@@ -560,12 +551,8 @@ const title = ref('')
|
||||
const doctorList = ref([])
|
||||
const surgeryNameList = ref([])
|
||||
const anesthesiaNameList = ref([])
|
||||
const surgeryLoading = ref(false)
|
||||
const anesthesiaLoading = ref(false)
|
||||
|
||||
// 防抖定时器
|
||||
let surgerySearchTimer = null
|
||||
let anesthesiaSearchTimer = null
|
||||
const allSurgeryItems = ref([])
|
||||
const allAnesthesiaItems = ref([])
|
||||
|
||||
// 计算总费用
|
||||
const totalCalculatedFee = computed(() => {
|
||||
@@ -624,6 +611,7 @@ watch(() => props.patientInfo, (newVal) => {
|
||||
// 挂载时加载医生列表
|
||||
onMounted(() => {
|
||||
loadDoctorList()
|
||||
loadSurgeryAndAnesthesiaOptions()
|
||||
})
|
||||
|
||||
// 获取手术申请列表
|
||||
@@ -967,6 +955,60 @@ function doSearchAnesthesia(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 本地过滤手术项目
|
||||
function filterSurgery(query) {
|
||||
if (!query) {
|
||||
surgeryNameList.value = allSurgeryItems.value
|
||||
} else {
|
||||
surgeryNameList.value = allSurgeryItems.value.filter(item =>
|
||||
(item.name && item.name.toLowerCase().includes(query.toLowerCase())) ||
|
||||
(item.busNo && item.busNo.toLowerCase().includes(query.toLowerCase()))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 本地过滤麻醉项目
|
||||
function filterAnesthesia(query) {
|
||||
if (!query) {
|
||||
anesthesiaNameList.value = allAnesthesiaItems.value
|
||||
} else {
|
||||
anesthesiaNameList.value = allAnesthesiaItems.value.filter(item =>
|
||||
(item.name && item.name.toLowerCase().includes(query.toLowerCase())) ||
|
||||
(item.busNo && item.busNo.toLowerCase().includes(query.toLowerCase()))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 加载手术和麻醉全量数据供本地过滤
|
||||
function loadSurgeryAndAnesthesiaOptions() {
|
||||
getDiagnosisTreatmentList({
|
||||
searchKey: '',
|
||||
pageNo: 1,
|
||||
pageSize: 1000
|
||||
}).then(res => {
|
||||
let data = []
|
||||
if (res.data && res.data.records) {
|
||||
data = res.data.records
|
||||
} else if (res.data && Array.isArray(res.data)) {
|
||||
data = res.data
|
||||
} else if (res.records && Array.isArray(res.records)) {
|
||||
data = res.records
|
||||
}
|
||||
allSurgeryItems.value = data.filter(item =>
|
||||
(item.categoryCode === '24' || item.categoryCode_dictText === '手术') &&
|
||||
(item.statusEnum === 2 || item.statusEnum_enumText === '启用' || !item.statusEnum)
|
||||
)
|
||||
allAnesthesiaItems.value = data.filter(item =>
|
||||
(item.categoryCode === '25' || item.categoryCode_dictText === '麻醉') &&
|
||||
(item.statusEnum === 2 || item.statusEnum_enumText === '启用' || !item.statusEnum)
|
||||
)
|
||||
surgeryNameList.value = allSurgeryItems.value
|
||||
anesthesiaNameList.value = allAnesthesiaItems.value
|
||||
}).catch(error => {
|
||||
console.error('加载手术/麻醉选项失败:', error)
|
||||
})
|
||||
}
|
||||
|
||||
// 手术项目选择变更
|
||||
function handleSurgeryChange(val) {
|
||||
// 🔧 BugFix#318: 确保 surgeryName 被正确设置
|
||||
|
||||
Reference in New Issue
Block a user