fix: 店铺列表代理不显示平台业务员
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m33s

This commit is contained in:
luo
2026-08-04 16:44:11 +08:00
parent 06f39815db
commit 81d52892f5

View File

@@ -127,7 +127,7 @@
</ElCol>
</ElRow>
<ElRow :gutter="20">
<ElRow v-if="!isAgentAccount" :gutter="20">
<ElCol :span="12">
<ElFormItem label="平台业务员">
<ElSelect
@@ -331,6 +331,7 @@
import type { FormRules } from 'element-plus'
import { useCheckedColumns } from '@/composables/useCheckedColumns'
import { useAuth } from '@/composables/useAuth'
import { useUserStore } from '@/store/modules/user'
import { generateShopCode } from '@/utils/codeGenerator'
import { CommissionService, ShopService, RoleService } from '@/api/modules'
import ShopCreditLimitDialog from '@/components/business/ShopCreditLimitDialog.vue'
@@ -353,6 +354,8 @@
defineOptions({ name: 'Shop' })
const { hasAuth } = useAuth()
const userStore = useUserStore()
const isAgentAccount = computed(() => Number(userStore.info.user_type) === 3)
const canModifyShopStatus = hasAuth('shop:modify_status')
const router = useRouter()
@@ -573,23 +576,27 @@
placeholder: '请选择状态'
}
},
{
label: '平台业务员',
prop: 'business_owner_account_id',
type: 'select',
config: {
clearable: true,
filterable: true,
remote: true,
remoteMethod: (query: string) => searchPlatformSalespeople(query),
placeholder: '请选择或搜索平台业务员'
},
options: () =>
salespersonOptions.value.map((salesperson) => ({
label: `${salesperson.username} (${salesperson.phone_summary})`,
value: salesperson.id
}))
}
...(!isAgentAccount.value
? [
{
label: '平台业务员',
prop: 'business_owner_account_id',
type: 'select' as const,
config: {
clearable: true,
filterable: true,
remote: true,
remoteMethod: (query: string) => searchPlatformSalespeople(query),
placeholder: '请选择或搜索平台业务员'
},
options: () =>
salespersonOptions.value.map((salesperson) => ({
label: `${salesperson.username} (${salesperson.phone_summary})`,
value: salesperson.id
}))
}
]
: [])
])
// 列配置
@@ -972,7 +979,9 @@
loadTopLevelShops() // 加载顶级店铺用于级联选择
searchDefaultRoles('') // 加载初始默认角色列表
searchParentShops('') // 加载上级店铺选项
searchPlatformSalespeople('') // 加载启用的平台业务员选项
if (!isAgentAccount.value) {
searchPlatformSalespeople('') // 加载启用的平台业务员选项
}
})
// 获取店铺列表
@@ -989,7 +998,9 @@
parent_id: searchForm.parent_id,
level: searchForm.level,
status: searchForm.status,
business_owner_account_id: searchForm.business_owner_account_id
...(!isAgentAccount.value && {
business_owner_account_id: searchForm.business_owner_account_id
})
}
const res = await ShopService.getShops(params)
if (res.code === 0) {
@@ -1060,9 +1071,11 @@
init_password: formData.init_password,
init_phone: formData.init_phone,
default_role_id: formData.default_role_id!,
business_owner_account_id: formData.business_owner_account_id,
client_login_disabled: formData.client_login_disabled
}
if (!isAgentAccount.value) {
data.business_owner_account_id = formData.business_owner_account_id
}
// 可选字段 - parent_id 可能是数组(级联选择器)或数字
if (formData.parent_id) {
@@ -1083,9 +1096,11 @@
const data: UpdateShopParams = {
shop_name: formData.shop_name,
status: formData.status,
business_owner_account_id: formData.business_owner_account_id,
client_login_disabled: formData.client_login_disabled
}
if (!isAgentAccount.value) {
data.business_owner_account_id = formData.business_owner_account_id
}
// 可选字段
if (formData.province) data.province = formData.province