diff --git a/src/api/modules/device.ts b/src/api/modules/device.ts index e014b2b..112448b 100644 --- a/src/api/modules/device.ts +++ b/src/api/modules/device.ts @@ -33,6 +33,11 @@ import type { } from '@/types/api' export class DeviceService extends BaseService { + /** 查询未删除设备中的去重设备类型选项 */ + static getDeviceTypes(): Promise> { + return this.get>('/api/admin/devices/types') + } + // ========== 设备基础管理 ========== /** diff --git a/src/views/asset-management/asset-information/components/PackageListCard.vue b/src/views/asset-management/asset-information/components/PackageListCard.vue index 8fdcf3a..8aedbd2 100644 --- a/src/views/asset-management/asset-information/components/PackageListCard.vue +++ b/src/views/asset-management/asset-information/components/PackageListCard.vue @@ -4,6 +4,13 @@
套餐列表
+ + + + + + + () @@ -678,6 +688,7 @@ page_size: props.pageSize, total: props.total }) + const statusFilter = ref(props.status) const defaultExpandedPackageUsageIds = computed(() => props.packageList @@ -763,6 +774,8 @@ emit('page-change', page) } + const handleStatusChange = (status: number | undefined) => emit('status-change', status) + // 每页条数变化 const handleSizeChange = (size: number) => { emit('size-change', size) diff --git a/src/views/asset-management/asset-information/composables/useAssetInfo.ts b/src/views/asset-management/asset-information/composables/useAssetInfo.ts index 13dc167..8363034 100644 --- a/src/views/asset-management/asset-information/composables/useAssetInfo.ts +++ b/src/views/asset-management/asset-information/composables/useAssetInfo.ts @@ -213,12 +213,13 @@ export function useAssetInfo() { * @param page - 页码 * @param pageSize - 每页条数 */ - const loadPackageList = async (identifier: string, page: number = 1, pageSize: number = 10) => { + const loadPackageList = async (identifier: string, page: number = 1, pageSize: number = 10, status?: number) => { try { packageLoading.value = true const response = await AssetService.getAssetPackages(identifier, { page, - page_size: pageSize + page_size: pageSize, + status }) if (response.code === 0 && response.data) { // items 代表顶层主套餐关系组,必须保留其 children,不得展平。 diff --git a/src/views/asset-management/asset-information/index.vue b/src/views/asset-management/asset-information/index.vue index e9bee92..2e304bc 100644 --- a/src/views/asset-management/asset-information/index.vue +++ b/src/views/asset-management/asset-information/index.vue @@ -70,6 +70,7 @@ :total="packagePagination.total" :page="packagePagination.page" :page-size="packagePagination.pageSize" + :status="packagePagination.status" :asset-identifier="cardInfo.identifier" :bound-device-id="cardInfo.bound_device_id" :bound-device-no="cardInfo.bound_device_no" @@ -82,6 +83,7 @@ @navigate-to-order="handleNavigateToOrder" @navigate-to-refund="handleNavigateToRefund" @refresh="handlePackageRefresh" + @status-change="handlePackageStatusChange" />
@@ -321,7 +323,8 @@ const packagePagination = ref({ page: 1, pageSize: 5, - total: 0 + total: 0, + status: undefined as number | undefined }) const walletTransactionSearchToken = ref(0) @@ -723,6 +726,19 @@ packagePagination.value.total = result.total } + const handlePackageStatusChange = async (status: number | undefined) => { + if (!cardInfo.value) return + packagePagination.value.status = status + packagePagination.value.page = 1 + const result = await loadPackageList( + cardInfo.value.identifier, + 1, + packagePagination.value.pageSize, + status + ) + packagePagination.value.total = result.total + } + /** * 显示流量详单 */ diff --git a/src/views/finance/employee-collection/applications/index.vue b/src/views/finance/employee-collection/applications/index.vue index c2b1129..aae2894 100644 --- a/src/views/finance/employee-collection/applications/index.vue +++ b/src/views/finance/employee-collection/applications/index.vue @@ -154,6 +154,7 @@ { prop: 'external_transaction_no', label: '外部交易流水号', + showOverflowTooltip: true, formatter: (row: EmployeeCollectionApplication) => h( 'span', diff --git a/src/views/settings/h5-popup-configuration/index.vue b/src/views/settings/h5-popup-configuration/index.vue index 9fd0e7c..59e2917 100644 --- a/src/views/settings/h5-popup-configuration/index.vue +++ b/src/views/settings/h5-popup-configuration/index.vue @@ -153,11 +153,11 @@ v-model="form.device_types" multiple filterable - allow-create - default-first-option - placeholder="选择或输入设备类型(不选表示全量投放)" + placeholder="选择设备类型(不选表示全量投放)" style="width: 100%" - /> + > + + ([]) + const deviceTypeOptions = ref([]) const pagination = reactive({ page: 1, pageSize: 20, total: 0 }) const initialSearchState = { @@ -445,6 +446,15 @@ } } + const loadDeviceTypeOptions = async () => { + try { + const res = await DeviceService.getDeviceTypes() + if (res.code === 0) deviceTypeOptions.value = res.data || [] + } catch (error) { + console.error('获取设备类型选项失败:', error) + } + } + const handleReset = () => { Object.assign(searchForm, { ...initialSearchState }) pagination.page = 1 @@ -751,6 +761,7 @@ onMounted(() => { getTableData() + loadDeviceTypeOptions() })