This commit is contained in:
@@ -220,6 +220,7 @@
|
||||
defineOptions({ name: 'EnterpriseCustomer' })
|
||||
|
||||
const { hasAuth } = useAuth()
|
||||
const canUpdateEnterpriseCustomerStatus = hasAuth('enterprise_customer:status')
|
||||
const userStore = useUserStore()
|
||||
|
||||
const router = useRouter()
|
||||
@@ -344,7 +345,7 @@
|
||||
{ label: '登录手机号', prop: 'login_phone' },
|
||||
{ label: '所在地区', prop: 'address' },
|
||||
{ label: '归属店铺', prop: 'owner_shop_name' },
|
||||
{ label: '状态', prop: 'status' },
|
||||
...(canUpdateEnterpriseCustomerStatus ? [{ label: '状态', prop: 'status' }] : []),
|
||||
{ label: '创建时间', prop: 'created_at' },
|
||||
{ label: '操作', prop: 'operation' }
|
||||
]
|
||||
@@ -457,24 +458,27 @@
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: EnterpriseItem) => row.owner_shop_name || '平台'
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
width: 100,
|
||||
formatter: (row: EnterpriseItem) => {
|
||||
return h(ElSwitch, {
|
||||
modelValue: row.status,
|
||||
activeValue: 1,
|
||||
inactiveValue: 0,
|
||||
activeText: '启用',
|
||||
inactiveText: '禁用',
|
||||
inlinePrompt: true,
|
||||
disabled: !hasAuth('enterprise_customer:status'),
|
||||
'onUpdate:modelValue': (val: string | number | boolean) =>
|
||||
handleStatusChange(row, val as number)
|
||||
})
|
||||
}
|
||||
},
|
||||
...(canUpdateEnterpriseCustomerStatus
|
||||
? [
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
width: 100,
|
||||
formatter: (row: EnterpriseItem) => {
|
||||
return h(ElSwitch, {
|
||||
modelValue: row.status,
|
||||
activeValue: 1,
|
||||
inactiveValue: 0,
|
||||
activeText: '启用',
|
||||
inactiveText: '禁用',
|
||||
inlinePrompt: true,
|
||||
'onUpdate:modelValue': (val: string | number | boolean) =>
|
||||
handleStatusChange(row, val as number)
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
: []),
|
||||
{
|
||||
prop: 'created_at',
|
||||
label: '创建时间',
|
||||
|
||||
Reference in New Issue
Block a user