This commit is contained in:
@@ -28,8 +28,7 @@
|
||||
type="primary"
|
||||
link
|
||||
class="package-name-link"
|
||||
@click="handleShowDailyRecords(scope.row)"
|
||||
v-permission="'package_usage:daily_records'"
|
||||
@click="handlePackageNameClick(scope.row)"
|
||||
>
|
||||
{{ scope.row.package_name }}
|
||||
</ElButton>
|
||||
@@ -105,18 +104,6 @@
|
||||
{{ formatDateTime(scope.row.expires_at) }}
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
<ElTableColumn label="操作" width="100" fixed="right">
|
||||
<template #default="scope">
|
||||
<ElButton
|
||||
type="primary"
|
||||
link
|
||||
@click="handleShowDailyRecords(scope.row)"
|
||||
v-permission="'package_usage:daily_records'"
|
||||
>
|
||||
流量详单
|
||||
</ElButton>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
</ElTable>
|
||||
<ElPagination
|
||||
v-model:current-page="pagination.page"
|
||||
@@ -146,10 +133,14 @@
|
||||
ElEmpty,
|
||||
ElPagination
|
||||
} from 'element-plus'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
import { useAssetFormatters } from '../composables/useAssetFormatters'
|
||||
import { formatDateTime } from '@/utils/business/format'
|
||||
import type { AssetPackageUsageRecord } from '@/types/api'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
|
||||
const { hasAuth } = useAuth()
|
||||
|
||||
// Props 使用 API 类型
|
||||
type PackageInfo = AssetPackageUsageRecord
|
||||
@@ -207,6 +198,15 @@
|
||||
getProgressColorByPercentage
|
||||
} = useAssetFormatters()
|
||||
|
||||
// 套餐名称点击
|
||||
const handlePackageNameClick = (packageRow: PackageInfo) => {
|
||||
if (!hasAuth('package_usage:daily_records')) {
|
||||
ElMessage.warning('您没有查看流量详单的权限')
|
||||
return
|
||||
}
|
||||
emit('showDailyRecords', { packageRow })
|
||||
}
|
||||
|
||||
// 显示流量详单
|
||||
const handleShowDailyRecords = (packageRow: PackageInfo) => {
|
||||
emit('showDailyRecords', { packageRow })
|
||||
|
||||
@@ -68,11 +68,11 @@
|
||||
set: (value) => emit('update:modelValue', value)
|
||||
})
|
||||
|
||||
const currentMode = computed(() => props.currentMode ?? 0)
|
||||
const currentMode = computed(() => Number(props.currentMode) ?? 0)
|
||||
|
||||
watch(visible, (newVal) => {
|
||||
if (newVal) {
|
||||
form.switch_mode = props.currentMode ?? 0
|
||||
form.switch_mode = Number(props.currentMode) ?? 0
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -402,7 +402,7 @@
|
||||
currentCardDetail.iccid
|
||||
}}</ElDescriptionsItem>
|
||||
|
||||
<ElDescriptionsItem label="卡接入号">{{
|
||||
<ElDescriptionsItem label="MSISDN">{{
|
||||
currentCardDetail.msisdn || '--'
|
||||
}}</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="运营商">{{
|
||||
@@ -778,7 +778,10 @@
|
||||
virtual_no: '',
|
||||
device_virtual_no: '',
|
||||
is_distributed: undefined,
|
||||
is_standalone: undefined
|
||||
is_standalone: undefined,
|
||||
is_replaced: undefined,
|
||||
iccid_start: '',
|
||||
iccid_end: ''
|
||||
}
|
||||
|
||||
// 搜索表单
|
||||
@@ -923,12 +926,12 @@
|
||||
}))
|
||||
},
|
||||
{
|
||||
label: '卡接入号',
|
||||
label: 'MSISDN',
|
||||
prop: 'msisdn',
|
||||
type: 'input',
|
||||
config: {
|
||||
clearable: true,
|
||||
placeholder: '请输入卡接入号'
|
||||
placeholder: '请输入MSISDN'
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -974,13 +977,44 @@
|
||||
{ label: '是(未绑定设备)', value: true },
|
||||
{ label: '否(已绑定设备)', value: false }
|
||||
]
|
||||
},
|
||||
{
|
||||
label: '是否有换卡记录',
|
||||
prop: 'is_replaced',
|
||||
type: 'select',
|
||||
config: {
|
||||
clearable: true,
|
||||
placeholder: '全部'
|
||||
},
|
||||
options: () => [
|
||||
{ label: '有换卡记录', value: true },
|
||||
{ label: '无换卡记录', value: false }
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'ICCID起始号',
|
||||
prop: 'iccid_start',
|
||||
type: 'input',
|
||||
config: {
|
||||
clearable: true,
|
||||
placeholder: '请输入ICCID起始号'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'ICCID结束号',
|
||||
prop: 'iccid_end',
|
||||
type: 'input',
|
||||
config: {
|
||||
clearable: true,
|
||||
placeholder: '请输入ICCID结束号'
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
// 列配置
|
||||
const columnOptions = [
|
||||
{ label: 'ICCID', prop: 'iccid' },
|
||||
{ label: '卡接入号', prop: 'msisdn' },
|
||||
{ label: 'MSISDN', prop: 'msisdn' },
|
||||
{ label: '卡虚拟号', prop: 'virtual_no' },
|
||||
{ label: '绑定设备虚拟号', prop: 'device_virtual_no' },
|
||||
{ label: '卡业务类型', prop: 'card_category' },
|
||||
@@ -1105,7 +1139,7 @@
|
||||
},
|
||||
{
|
||||
prop: 'msisdn',
|
||||
label: '卡接入号',
|
||||
label: 'MSISDN',
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
@@ -1202,7 +1236,8 @@
|
||||
{
|
||||
prop: 'data_usage_mb',
|
||||
label: '累计流量(MB)',
|
||||
width: 120
|
||||
width: 120,
|
||||
formatter: (row: StandaloneIotCard) => row.data_usage_mb?.toLocaleString() || '0'
|
||||
},
|
||||
{
|
||||
prop: 'created_at',
|
||||
|
||||
Reference in New Issue
Block a user