This commit is contained in:
@@ -112,6 +112,8 @@
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@focus="handleOwnerShopFocus"
|
||||
@visible-change="handleOwnerShopVisibleChange"
|
||||
@change="handleShopChange"
|
||||
/>
|
||||
</ElFormItem>
|
||||
@@ -530,10 +532,6 @@
|
||||
|
||||
onMounted(() => {
|
||||
getTableData()
|
||||
// 只有非代理账号才需要加载店铺列表
|
||||
if (!isAgentAccount.value) {
|
||||
loadShopList()
|
||||
}
|
||||
})
|
||||
|
||||
onActivated(() => {
|
||||
@@ -542,6 +540,8 @@
|
||||
|
||||
// 加载店铺列表 - 改用级联查询
|
||||
const loadShopList = async () => {
|
||||
if (shopLoading.value) return
|
||||
|
||||
shopLoading.value = true
|
||||
try {
|
||||
const res = await ShopService.getShopsCascade({ parent_id: undefined })
|
||||
@@ -559,6 +559,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
const handleOwnerShopFocus = async () => {
|
||||
if (isAgentAccount.value) return
|
||||
await loadShopList()
|
||||
}
|
||||
|
||||
const handleOwnerShopVisibleChange = async (visible: boolean) => {
|
||||
if (!visible) return
|
||||
await handleOwnerShopFocus()
|
||||
}
|
||||
|
||||
// 处理店铺选择变化
|
||||
const handleShopChange = (value: any) => {
|
||||
if (Array.isArray(value) && value.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user