diff --git a/src/components/business/CustomerAccountDialog.vue b/src/components/business/CustomerAccountDialog.vue new file mode 100644 index 0000000..1831ff1 --- /dev/null +++ b/src/components/business/CustomerAccountDialog.vue @@ -0,0 +1,286 @@ + + + + + diff --git a/src/router/routes/asyncRoutes.ts b/src/router/routes/asyncRoutes.ts index cf9000c..a2f76db 100644 --- a/src/router/routes/asyncRoutes.ts +++ b/src/router/routes/asyncRoutes.ts @@ -611,89 +611,89 @@ export const asyncRoutes: AppRouteRecord[] = [ // } // }, // 物联网卡管理系统模块 - { - path: '/card-management', - name: 'CardManagement', - component: RoutesAlias.Home, - meta: { - title: 'menus.cardManagement.title', - icon: '' - }, - children: [ - // { - // path: 'card-detail', - // name: 'CardDetail', - // component: RoutesAlias.CardDetail, - // meta: { - // title: 'menus.cardManagement.cardDetail', - // keepAlive: true - // } - // }, - { - path: 'card-assign', - name: 'CardAssign', - component: RoutesAlias.CardAssign, - meta: { - title: 'menus.cardManagement.cardAssign', - keepAlive: true - } - }, - { - path: 'card-shutdown', - name: 'CardShutdown', - component: RoutesAlias.CardShutdown, - meta: { - title: 'menus.cardManagement.cardShutdown', - keepAlive: true - } - }, - { - path: 'my-cards', - name: 'MyCards', - component: RoutesAlias.MyCards, - meta: { - title: 'menus.cardManagement.myCards', - keepAlive: true - } - }, - { - path: 'card-transfer', - name: 'CardTransfer', - component: RoutesAlias.CardTransfer, - meta: { - title: 'menus.cardManagement.cardTransfer', - keepAlive: true - } - }, - { - path: 'card-replacement', - name: 'CardReplacement', - component: RoutesAlias.CardReplacement, - meta: { - title: 'menus.cardManagement.cardReplacement', - keepAlive: true - } - }, - { - path: 'package-gift', - name: 'PackageGift', - component: RoutesAlias.PackageGift, - meta: { - title: 'menus.cardManagement.packageGift', - keepAlive: true - } - }, - { - path: 'card-change-card', - name: 'CardChangeCard', - component: RoutesAlias.CardChangeCard, - meta: { - title: 'menus.cardManagement.cardChange', - keepAlive: true - } - } - ] - }, + // { + // path: '/card-management', + // name: 'CardManagement', + // component: RoutesAlias.Home, + // meta: { + // title: 'menus.cardManagement.title', + // icon: '' + // }, + // children: [ + // // { + // // path: 'card-detail', + // // name: 'CardDetail', + // // component: RoutesAlias.CardDetail, + // // meta: { + // // title: 'menus.cardManagement.cardDetail', + // // keepAlive: true + // // } + // // }, + // { + // path: 'card-assign', + // name: 'CardAssign', + // component: RoutesAlias.CardAssign, + // meta: { + // title: 'menus.cardManagement.cardAssign', + // keepAlive: true + // } + // }, + // { + // path: 'card-shutdown', + // name: 'CardShutdown', + // component: RoutesAlias.CardShutdown, + // meta: { + // title: 'menus.cardManagement.cardShutdown', + // keepAlive: true + // } + // }, + // { + // path: 'my-cards', + // name: 'MyCards', + // component: RoutesAlias.MyCards, + // meta: { + // title: 'menus.cardManagement.myCards', + // keepAlive: true + // } + // }, + // { + // path: 'card-transfer', + // name: 'CardTransfer', + // component: RoutesAlias.CardTransfer, + // meta: { + // title: 'menus.cardManagement.cardTransfer', + // keepAlive: true + // } + // }, + // { + // path: 'card-replacement', + // name: 'CardReplacement', + // component: RoutesAlias.CardReplacement, + // meta: { + // title: 'menus.cardManagement.cardReplacement', + // keepAlive: true + // } + // }, + // { + // path: 'package-gift', + // name: 'PackageGift', + // component: RoutesAlias.PackageGift, + // meta: { + // title: 'menus.cardManagement.packageGift', + // keepAlive: true + // } + // }, + // { + // path: 'card-change-card', + // name: 'CardChangeCard', + // component: RoutesAlias.CardChangeCard, + // meta: { + // title: 'menus.cardManagement.cardChange', + // keepAlive: true + // } + // } + // ] + // }, { path: '/package-management', name: 'PackageManagement', @@ -815,15 +815,6 @@ export const asyncRoutes: AppRouteRecord[] = [ // keepAlive: true // } // }, - { - path: 'customer-account', - name: 'CustomerAccount', - component: RoutesAlias.CustomerAccount, - meta: { - title: 'menus.accountManagement.customerAccount', - keepAlive: true - } - }, { path: 'enterprise-cards', name: 'EnterpriseCards', @@ -965,16 +956,6 @@ export const asyncRoutes: AppRouteRecord[] = [ keepAlive: true } }, - { - path: 'allocation-record-detail', - name: 'AllocationRecordDetail', - component: RoutesAlias.AllocationRecordDetail, - meta: { - title: 'menus.assetManagement.allocationRecordDetail', - isHide: true, - keepAlive: false - } - }, { path: 'card-replacement-request', name: 'CardReplacementRequest', @@ -993,16 +974,6 @@ export const asyncRoutes: AppRouteRecord[] = [ keepAlive: true } }, - { - path: 'authorization-detail', - name: 'AuthorizationDetail', - component: RoutesAlias.AuthorizationDetail, - meta: { - title: 'menus.assetManagement.authorizationDetail', - isHide: true, - keepAlive: false - } - }, { path: 'enterprise-devices', name: 'EnterpriseDevices', diff --git a/src/router/routesAlias.ts b/src/router/routesAlias.ts index 82dd3e6..afb3917 100644 --- a/src/router/routesAlias.ts +++ b/src/router/routesAlias.ts @@ -80,7 +80,6 @@ export enum RoutesAlias { CustomerManagement = '/account-management/customer', // 客户管理 CustomerRole = '/account-management/customer-role', // 客户角色 AgentManagement = '/account-management/agent', // 代理商管理 - CustomerAccount = '/account-management/customer-account', // 客户账号管理 ShopAccount = '/account-management/shop-account', // 代理账号管理 EnterpriseCustomer = '/account-management/enterprise-customer', // 企业客户管理 EnterpriseCards = '/account-management/enterprise-cards', // 企业卡管理 @@ -97,10 +96,8 @@ export enum RoutesAlias { DeviceList = '/asset-management/device-list', // 设备列表 DeviceDetail = '/asset-management/device-detail', // 设备详情 AssetAssign = '/asset-management/asset-assign', // 资产分配(分配记录) - AllocationRecordDetail = '/asset-management/allocation-record-detail', // 分配记录详情 CardReplacementRequest = '/asset-management/card-replacement-request', // 换卡申请 AuthorizationRecords = '/asset-management/authorization-records', // 授权记录 - AuthorizationDetail = '/asset-management/authorization-detail', // 授权记录详情 EnterpriseDevices = '/asset-management/enterprise-devices', // 企业设备列表 // 账户管理 diff --git a/src/types/components.d.ts b/src/types/components.d.ts index 07fa003..d16a15d 100644 --- a/src/types/components.d.ts +++ b/src/types/components.d.ts @@ -78,6 +78,7 @@ declare module 'vue' { CommentWidget: typeof import('./../components/custom/comment-widget/index.vue')['default'] CommissionDisplay: typeof import('./../components/business/CommissionDisplay.vue')['default'] ContainerSettings: typeof import('./../components/core/layouts/art-settings-panel/widget/ContainerSettings.vue')['default'] + CustomerAccountDialog: typeof import('./../components/business/CustomerAccountDialog.vue')['default'] ElAlert: typeof import('element-plus/es')['ElAlert'] ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElButton: typeof import('element-plus/es')['ElButton'] diff --git a/src/views/account-management/customer-account/index.vue b/src/views/account-management/customer-account/index.vue deleted file mode 100644 index a7134fc..0000000 --- a/src/views/account-management/customer-account/index.vue +++ /dev/null @@ -1,571 +0,0 @@ - - - - - diff --git a/src/views/account-management/enterprise-cards/index.vue b/src/views/account-management/enterprise-cards/index.vue index 70e1676..a53811d 100644 --- a/src/views/account-management/enterprise-cards/index.vue +++ b/src/views/account-management/enterprise-cards/index.vue @@ -175,7 +175,7 @@ > 失败项详情 - + diff --git a/src/views/account-management/enterprise-customer/index.vue b/src/views/account-management/enterprise-customer/index.vue index e8f7540..19e2bfa 100644 --- a/src/views/account-management/enterprise-customer/index.vue +++ b/src/views/account-management/enterprise-customer/index.vue @@ -168,6 +168,12 @@ + + + @@ -208,6 +214,7 @@ import type { SearchFormItem } from '@/types' import { useCheckedColumns } from '@/composables/useCheckedColumns' import ArtButtonTable from '@/components/core/forms/ArtButtonTable.vue' + import CustomerAccountDialog from '@/components/business/CustomerAccountDialog.vue' import { formatDateTime } from '@/utils/business/format' import { BgColorEnum } from '@/enums/appEnum' @@ -217,6 +224,7 @@ const dialogVisible = ref(false) const passwordDialogVisible = ref(false) + const customerAccountDialogVisible = ref(false) const loading = ref(false) const submitLoading = ref(false) const passwordSubmitLoading = ref(false) @@ -439,7 +447,7 @@ { prop: 'operation', label: '操作', - width: 260, + width: 340, fixed: 'right', formatter: (row: EnterpriseItem) => { return h('div', { style: 'display: flex; gap: 8px;' }, [ @@ -448,6 +456,11 @@ iconClass: BgColorEnum.SECONDARY, onClick: () => showDialog('edit', row) }), + h(ArtButtonTable, { + text: '查看客户', + iconClass: BgColorEnum.PRIMARY, + onClick: () => viewCustomerAccounts(row) + }), h(ArtButtonTable, { text: '卡授权', iconClass: BgColorEnum.PRIMARY, @@ -710,6 +723,12 @@ } } + // 查看客户账号 + const viewCustomerAccounts = (row: EnterpriseItem) => { + currentEnterpriseId.value = row.id + customerAccountDialogVisible.value = true + } + // 卡管理 const manageCards = (row: EnterpriseItem) => { router.push({ diff --git a/src/views/asset-management/allocation-record-detail/index.vue b/src/views/asset-management/allocation-record-detail/index.vue deleted file mode 100644 index 1375763..0000000 --- a/src/views/asset-management/allocation-record-detail/index.vue +++ /dev/null @@ -1,189 +0,0 @@ - - - - - diff --git a/src/views/asset-management/asset-assign/index.vue b/src/views/asset-management/asset-assign/index.vue index 44aec1a..0f453ee 100644 --- a/src/views/asset-management/asset-assign/index.vue +++ b/src/views/asset-management/asset-assign/index.vue @@ -40,6 +40,35 @@ + + + + + {{ currentRecord.allocation_no }} + + + {{ currentRecord.allocation_name }} + + + + + {{ currentRecord.asset_type_name }} + + + {{ currentRecord.asset_identifier }} + {{ currentRecord.from_owner_name }} + {{ currentRecord.to_owner_name }} + {{ currentRecord.operator_name }} + {{ currentRecord.related_card_count }} + {{ formatDateTime(currentRecord.created_at) }} + {{ currentRecord.remark || '--' }} + + + @@ -59,7 +88,9 @@ const router = useRouter() const loading = ref(false) + const detailDialogVisible = ref(false) const tableRef = ref() + const currentRecord = ref(null) // 搜索表单初始值 const initialSearchState = { @@ -199,7 +230,7 @@ { prop: 'asset_identifier', label: '资产标识符', - minWidth: 180 + minWidth: 200 }, { prop: 'from_owner_name', @@ -265,7 +296,7 @@ const res = await CardService.getAssetAllocationRecords(params) if (res.code === 0) { - recordList.value = res.data.list || [] + recordList.value = res.data.items || [] pagination.total = res.data.total || 0 } } catch (error) { @@ -307,10 +338,8 @@ // 查看详情 const viewDetail = (row: AssetAllocationRecord) => { - router.push({ - path: '/asset-management/allocation-record-detail', - query: { id: row.id } - }) + currentRecord.value = row + detailDialogVisible.value = true } diff --git a/src/views/asset-management/authorization-detail/index.vue b/src/views/asset-management/authorization-detail/index.vue deleted file mode 100644 index c552492..0000000 --- a/src/views/asset-management/authorization-detail/index.vue +++ /dev/null @@ -1,118 +0,0 @@ - - - - - diff --git a/src/views/asset-management/authorization-records/index.vue b/src/views/asset-management/authorization-records/index.vue index aad6f83..8cc7fac 100644 --- a/src/views/asset-management/authorization-records/index.vue +++ b/src/views/asset-management/authorization-records/index.vue @@ -36,6 +36,36 @@ + + + + {{ currentRecord.enterprise_id }} + {{ currentRecord.enterprise_name }} + {{ currentRecord.card_id }} + {{ currentRecord.iccid }} + {{ currentRecord.msisdn || '--' }} + {{ currentRecord.authorized_by }} + {{ currentRecord.authorizer_name }} + + + {{ getAuthorizerTypeText(currentRecord.authorizer_type) }} + + + {{ formatDateTime(currentRecord.authorized_at) }} + + + {{ getStatusText(currentRecord.status) }} + + + {{ currentRecord.remark || '--' }} + + + + @@ -85,11 +115,13 @@ const router = useRouter() const loading = ref(false) + const detailDialogVisible = ref(false) const remarkDialogVisible = ref(false) const remarkLoading = ref(false) const tableRef = ref() const remarkFormRef = ref() const currentRecordId = ref(0) + const currentRecord = ref(null) // 搜索表单初始值 const initialSearchState = { @@ -172,7 +204,6 @@ // 列配置 const columnOptions = [ - { label: 'ID', prop: 'id' }, { label: 'ICCID', prop: 'iccid' }, { label: '手机号', prop: 'msisdn' }, { label: '企业名称', prop: 'enterprise_name' }, @@ -180,8 +211,6 @@ { label: '授权人类型', prop: 'authorizer_type' }, { label: '授权时间', prop: 'authorized_at' }, { label: '状态', prop: 'status' }, - { label: '回收人', prop: 'revoker_name' }, - { label: '回收时间', prop: 'revoked_at' }, { label: '备注', prop: 'remark' }, { label: '操作', prop: 'operation' } ] @@ -210,20 +239,16 @@ // 动态列配置 const { columnChecks, columns } = useCheckedColumns(() => [ - { - prop: 'id', - label: 'ID', - width: 80 - }, { prop: 'iccid', label: 'ICCID', - minWidth: 180 + minWidth: 200 }, { prop: 'msisdn', label: '手机号', - width: 120 + width: 130, + formatter: (row: AuthorizationItem) => row.msisdn || '-' }, { prop: 'enterprise_name', @@ -238,7 +263,7 @@ { prop: 'authorizer_type', label: '授权人类型', - width: 100, + width: 110, formatter: (row: AuthorizationItem) => { return h(ElTag, { type: getAuthorizerTypeTag(row.authorizer_type) }, () => getAuthorizerTypeText(row.authorizer_type) @@ -259,18 +284,6 @@ return h(ElTag, { type: getStatusTag(row.status) }, () => getStatusText(row.status)) } }, - { - prop: 'revoker_name', - label: '回收人', - width: 120, - formatter: (row: AuthorizationItem) => row.revoker_name || '-' - }, - { - prop: 'revoked_at', - label: '回收时间', - width: 180, - formatter: (row: AuthorizationItem) => (row.revoked_at ? formatDateTime(row.revoked_at) : '-') - }, { prop: 'remark', label: '备注', @@ -286,7 +299,7 @@ formatter: (row: AuthorizationItem) => { return h('div', { style: 'display: flex; gap: 8px;' }, [ h(ArtButtonTable, { - type: 'view', + text: '详情', onClick: () => viewDetail(row) }), h(ArtButtonTable, { @@ -371,10 +384,8 @@ // 查看详情 const viewDetail = (row: AuthorizationItem) => { - router.push({ - path: '/asset-management/authorization-detail', - query: { id: row.id } - }) + currentRecord.value = row + detailDialogVisible.value = true } // 显示修改备注对话框 diff --git a/src/views/asset-management/iot-card-management/index.vue b/src/views/asset-management/iot-card-management/index.vue index fd37e83..eaf1434 100644 --- a/src/views/asset-management/iot-card-management/index.vue +++ b/src/views/asset-management/iot-card-management/index.vue @@ -284,7 +284,7 @@ > 失败项详情 - + @@ -362,7 +362,7 @@ > 失败项详情 - + diff --git a/src/views/product/shop/index.vue b/src/views/product/shop/index.vue index 9ddb738..8ed70d4 100644 --- a/src/views/product/shop/index.vue +++ b/src/views/product/shop/index.vue @@ -180,6 +180,9 @@ + + + @@ -199,6 +202,7 @@ import type { FormRules } from 'element-plus' import { useCheckedColumns } from '@/composables/useCheckedColumns' import ArtButtonTable from '@/components/core/forms/ArtButtonTable.vue' + import CustomerAccountDialog from '@/components/business/CustomerAccountDialog.vue' import { ShopService } from '@/api/modules' import type { SearchFormItem } from '@/types' import type { ShopResponse } from '@/types/api' @@ -209,9 +213,11 @@ const dialogType = ref('add') const dialogVisible = ref(false) + const customerAccountDialogVisible = ref(false) const loading = ref(false) const submitLoading = ref(false) const parentShopLoading = ref(false) + const currentShopId = ref(0) const parentShopList = ref([]) const searchParentShopList = ref([]) @@ -405,12 +411,13 @@ { prop: 'shop_name', label: '店铺名称', - minWidth: 150 + minWidth: 120 }, { prop: 'shop_code', label: '店铺编号', - width: 120 + width: 150, + showOverflowTooltip: true }, { prop: 'level', @@ -423,7 +430,7 @@ { prop: 'region', label: '所在地区', - minWidth: 180, + minWidth: 170, formatter: (row: ShopResponse) => { const parts: string[] = [] if (row.province) parts.push(row.province) @@ -446,7 +453,7 @@ { prop: 'status', label: '状态', - width: 100, + width: 80, formatter: (row: ShopResponse) => { return h(ElSwitch, { modelValue: row.status, @@ -469,10 +476,14 @@ { prop: 'operation', label: '操作', - width: 150, + width: 220, fixed: 'right', formatter: (row: ShopResponse) => { return h('div', { style: 'display: flex; gap: 8px;' }, [ + h(ArtButtonTable, { + text: '查看客户', + onClick: () => viewCustomerAccounts(row) + }), h(ArtButtonTable, { type: 'edit', onClick: () => showDialog('edit', row) @@ -733,6 +744,12 @@ getShopList() } + // 查看客户账号 + const viewCustomerAccounts = (row: ShopResponse) => { + currentShopId.value = row.id + customerAccountDialogVisible.value = true + } + // 状态切换 const handleStatusChange = async (row: ShopResponse, newStatus: number) => { const oldStatus = row.status