[bug]解决选中药库或药房对应的源仓库或目的仓库无下拉数据

This commit is contained in:
Auora
2025-11-03 11:12:19 +08:00
parent c6a27f6276
commit 93120e973a
3 changed files with 123 additions and 37 deletions

View File

@@ -797,6 +797,25 @@ watch(
{ immediate: true }
);
onMounted(() => {
document.addEventListener("click", handleClickOutside);
// 获取源仓库列表(假设 getPharmacyList 返回仓库数据)
getPharmacyList({ type: 'source' }).then(res => {
if (res.code === 200) {
sourceTypeListOptions.value = res.data; // 格式需为 [{id, name}, ...]
}
});
// 获取目的仓库列表
getPharmacyList({ type: 'purpose' }).then(res => {
if (res.code === 200) {
purposeTypeListOptions.value = res.data;
}
});
// 初始化默认仓库数据,使用药房类型(16)
handleChangeLocationType(16);
console.log(route, '!1212');
if (route.query.view) {
viewStatus.value = route.query.view;
@@ -1138,7 +1157,7 @@ function handleChangeLocationType(value) {
locationList.value = list;
}
});
} else if (value == 11) {
} else if (value == 17) {
getDispensaryList().then((res) => {
const list = res?.data || [];
if (!list.length) {