This commit is contained in:
@@ -4,6 +4,13 @@
|
||||
<div class="card-header">
|
||||
<span>套餐列表</span>
|
||||
<div class="card-header-right">
|
||||
<ElSelect v-model="statusFilter" clearable placeholder="套餐状态" style="width: 140px" @change="handleStatusChange">
|
||||
<ElOption label="待生效" :value="0" />
|
||||
<ElOption label="生效中" :value="1" />
|
||||
<ElOption label="已用完" :value="2" />
|
||||
<ElOption label="已过期" :value="3" />
|
||||
<ElOption label="已失效" :value="4" />
|
||||
</ElSelect>
|
||||
<ElButton
|
||||
type="primary"
|
||||
:disabled="Boolean(props.boundDeviceId)"
|
||||
@@ -642,6 +649,7 @@
|
||||
total?: number
|
||||
page?: number
|
||||
pageSize?: number
|
||||
status?: number
|
||||
boundDeviceId?: number
|
||||
boundDeviceNo?: string
|
||||
loading?: boolean
|
||||
@@ -652,6 +660,7 @@
|
||||
total: 0,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
status: undefined,
|
||||
boundDeviceId: undefined,
|
||||
boundDeviceNo: '',
|
||||
loading: false,
|
||||
@@ -668,6 +677,7 @@
|
||||
(e: 'navigateToOrder', orderId: number): void
|
||||
(e: 'navigateToRefund', refundId: number): void
|
||||
(e: 'refresh'): void
|
||||
(e: 'status-change', status: number | undefined): void
|
||||
}
|
||||
|
||||
const emit = defineEmits<Emits>()
|
||||
@@ -678,6 +688,7 @@
|
||||
page_size: props.pageSize,
|
||||
total: props.total
|
||||
})
|
||||
const statusFilter = ref<number | undefined>(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)
|
||||
|
||||
@@ -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,不得展平。
|
||||
|
||||
@@ -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"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示流量详单
|
||||
*/
|
||||
|
||||
@@ -154,6 +154,7 @@
|
||||
{
|
||||
prop: 'external_transaction_no',
|
||||
label: '外部交易流水号',
|
||||
showOverflowTooltip: true,
|
||||
formatter: (row: EmployeeCollectionApplication) =>
|
||||
h(
|
||||
'span',
|
||||
|
||||
@@ -153,11 +153,11 @@
|
||||
v-model="form.device_types"
|
||||
multiple
|
||||
filterable
|
||||
allow-create
|
||||
default-first-option
|
||||
placeholder="选择或输入设备类型(不选表示全量投放)"
|
||||
placeholder="选择设备类型(不选表示全量投放)"
|
||||
style="width: 100%"
|
||||
/>
|
||||
>
|
||||
<ElOption v-for="item in deviceTypeOptions" :key="item" :label="item" :value="item" />
|
||||
</ElSelect>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="卡类型范围" prop="card_types">
|
||||
<ElSelect
|
||||
@@ -191,7 +191,7 @@
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox, ElTag, FormInstance, FormRules } from 'element-plus'
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { H5PopupConfigurationService, ShopService } from '@/api/modules'
|
||||
import { DeviceService, H5PopupConfigurationService, ShopService } from '@/api/modules'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { useCheckedColumns } from '@/composables/useCheckedColumns'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
@@ -270,6 +270,7 @@
|
||||
|
||||
const loading = ref(false)
|
||||
const configurationList = ref<H5PopupConfiguration[]>([])
|
||||
const deviceTypeOptions = ref<string[]>([])
|
||||
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()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user