This commit is contained in:
@@ -723,7 +723,7 @@
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const params = {
|
const params = {
|
||||||
page: pagination.page,
|
page: pagination.currentPage,
|
||||||
page_size: pagination.pageSize,
|
page_size: pagination.pageSize,
|
||||||
username: formFilters.name || undefined,
|
username: formFilters.name || undefined,
|
||||||
phone: formFilters.phone || undefined,
|
phone: formFilters.phone || undefined,
|
||||||
|
|||||||
@@ -28,8 +28,7 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
link
|
link
|
||||||
class="package-name-link"
|
class="package-name-link"
|
||||||
@click="handleShowDailyRecords(scope.row)"
|
@click="handlePackageNameClick(scope.row)"
|
||||||
v-permission="'package_usage:daily_records'"
|
|
||||||
>
|
>
|
||||||
{{ scope.row.package_name }}
|
{{ scope.row.package_name }}
|
||||||
</ElButton>
|
</ElButton>
|
||||||
@@ -105,18 +104,6 @@
|
|||||||
{{ formatDateTime(scope.row.expires_at) }}
|
{{ formatDateTime(scope.row.expires_at) }}
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</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>
|
</ElTable>
|
||||||
<ElPagination
|
<ElPagination
|
||||||
v-model:current-page="pagination.page"
|
v-model:current-page="pagination.page"
|
||||||
@@ -146,10 +133,14 @@
|
|||||||
ElEmpty,
|
ElEmpty,
|
||||||
ElPagination
|
ElPagination
|
||||||
} from 'element-plus'
|
} from 'element-plus'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
|
||||||
import { useAssetFormatters } from '../composables/useAssetFormatters'
|
import { useAssetFormatters } from '../composables/useAssetFormatters'
|
||||||
import { formatDateTime } from '@/utils/business/format'
|
import { formatDateTime } from '@/utils/business/format'
|
||||||
import type { AssetPackageUsageRecord } from '@/types/api'
|
import type { AssetPackageUsageRecord } from '@/types/api'
|
||||||
|
import { useAuth } from '@/composables/useAuth'
|
||||||
|
|
||||||
|
const { hasAuth } = useAuth()
|
||||||
|
|
||||||
// Props 使用 API 类型
|
// Props 使用 API 类型
|
||||||
type PackageInfo = AssetPackageUsageRecord
|
type PackageInfo = AssetPackageUsageRecord
|
||||||
@@ -207,6 +198,15 @@
|
|||||||
getProgressColorByPercentage
|
getProgressColorByPercentage
|
||||||
} = useAssetFormatters()
|
} = useAssetFormatters()
|
||||||
|
|
||||||
|
// 套餐名称点击
|
||||||
|
const handlePackageNameClick = (packageRow: PackageInfo) => {
|
||||||
|
if (!hasAuth('package_usage:daily_records')) {
|
||||||
|
ElMessage.warning('您没有查看流量详单的权限')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
emit('showDailyRecords', { packageRow })
|
||||||
|
}
|
||||||
|
|
||||||
// 显示流量详单
|
// 显示流量详单
|
||||||
const handleShowDailyRecords = (packageRow: PackageInfo) => {
|
const handleShowDailyRecords = (packageRow: PackageInfo) => {
|
||||||
emit('showDailyRecords', { packageRow })
|
emit('showDailyRecords', { packageRow })
|
||||||
|
|||||||
@@ -68,11 +68,11 @@
|
|||||||
set: (value) => emit('update:modelValue', value)
|
set: (value) => emit('update:modelValue', value)
|
||||||
})
|
})
|
||||||
|
|
||||||
const currentMode = computed(() => props.currentMode ?? 0)
|
const currentMode = computed(() => Number(props.currentMode) ?? 0)
|
||||||
|
|
||||||
watch(visible, (newVal) => {
|
watch(visible, (newVal) => {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
form.switch_mode = props.currentMode ?? 0
|
form.switch_mode = Number(props.currentMode) ?? 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -402,7 +402,7 @@
|
|||||||
currentCardDetail.iccid
|
currentCardDetail.iccid
|
||||||
}}</ElDescriptionsItem>
|
}}</ElDescriptionsItem>
|
||||||
|
|
||||||
<ElDescriptionsItem label="卡接入号">{{
|
<ElDescriptionsItem label="MSISDN">{{
|
||||||
currentCardDetail.msisdn || '--'
|
currentCardDetail.msisdn || '--'
|
||||||
}}</ElDescriptionsItem>
|
}}</ElDescriptionsItem>
|
||||||
<ElDescriptionsItem label="运营商">{{
|
<ElDescriptionsItem label="运营商">{{
|
||||||
@@ -778,7 +778,10 @@
|
|||||||
virtual_no: '',
|
virtual_no: '',
|
||||||
device_virtual_no: '',
|
device_virtual_no: '',
|
||||||
is_distributed: undefined,
|
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',
|
prop: 'msisdn',
|
||||||
type: 'input',
|
type: 'input',
|
||||||
config: {
|
config: {
|
||||||
clearable: true,
|
clearable: true,
|
||||||
placeholder: '请输入卡接入号'
|
placeholder: '请输入MSISDN'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -974,13 +977,44 @@
|
|||||||
{ label: '是(未绑定设备)', value: true },
|
{ label: '是(未绑定设备)', value: true },
|
||||||
{ label: '否(已绑定设备)', value: false }
|
{ 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 = [
|
const columnOptions = [
|
||||||
{ label: 'ICCID', prop: 'iccid' },
|
{ label: 'ICCID', prop: 'iccid' },
|
||||||
{ label: '卡接入号', prop: 'msisdn' },
|
{ label: 'MSISDN', prop: 'msisdn' },
|
||||||
{ label: '卡虚拟号', prop: 'virtual_no' },
|
{ label: '卡虚拟号', prop: 'virtual_no' },
|
||||||
{ label: '绑定设备虚拟号', prop: 'device_virtual_no' },
|
{ label: '绑定设备虚拟号', prop: 'device_virtual_no' },
|
||||||
{ label: '卡业务类型', prop: 'card_category' },
|
{ label: '卡业务类型', prop: 'card_category' },
|
||||||
@@ -1105,7 +1139,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'msisdn',
|
prop: 'msisdn',
|
||||||
label: '卡接入号',
|
label: 'MSISDN',
|
||||||
width: 160
|
width: 160
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1202,7 +1236,8 @@
|
|||||||
{
|
{
|
||||||
prop: 'data_usage_mb',
|
prop: 'data_usage_mb',
|
||||||
label: '累计流量(MB)',
|
label: '累计流量(MB)',
|
||||||
width: 120
|
width: 120,
|
||||||
|
formatter: (row: StandaloneIotCard) => row.data_usage_mb?.toLocaleString() || '0'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'created_at',
|
prop: 'created_at',
|
||||||
|
|||||||
@@ -49,7 +49,6 @@
|
|||||||
{
|
{
|
||||||
title: '基本信息',
|
title: '基本信息',
|
||||||
fields: [
|
fields: [
|
||||||
{ label: 'ID', prop: 'id' },
|
|
||||||
{ label: '套餐编码', prop: 'package_code' },
|
{ label: '套餐编码', prop: 'package_code' },
|
||||||
{ label: '套餐名称', prop: 'package_name' },
|
{ label: '套餐名称', prop: 'package_name' },
|
||||||
{ label: '套餐系列', prop: 'series_name' },
|
{ label: '套餐系列', prop: 'series_name' },
|
||||||
|
|||||||
@@ -49,7 +49,6 @@
|
|||||||
{
|
{
|
||||||
title: '基本信息',
|
title: '基本信息',
|
||||||
fields: [
|
fields: [
|
||||||
{ label: 'ID', prop: 'id' },
|
|
||||||
{ label: '系列编码', prop: 'series_code' },
|
{ label: '系列编码', prop: 'series_code' },
|
||||||
{ label: '系列名称', prop: 'series_name' },
|
{ label: '系列名称', prop: 'series_name' },
|
||||||
{
|
{
|
||||||
@@ -60,8 +59,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '描述',
|
label: '描述',
|
||||||
prop: 'description',
|
prop: 'description'
|
||||||
fullWidth: true
|
|
||||||
},
|
},
|
||||||
{ label: '创建时间', prop: 'created_at', formatter: (value) => formatDateTime(value) },
|
{ label: '创建时间', prop: 'created_at', formatter: (value) => formatDateTime(value) },
|
||||||
{ label: '更新时间', prop: 'updated_at', formatter: (value) => formatDateTime(value) }
|
{ label: '更新时间', prop: 'updated_at', formatter: (value) => formatDateTime(value) }
|
||||||
@@ -110,7 +108,6 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '梯度配置',
|
label: '梯度配置',
|
||||||
fullWidth: true,
|
|
||||||
render: (data) => {
|
render: (data) => {
|
||||||
const config = data.one_time_commission_config
|
const config = data.one_time_commission_config
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -17,8 +17,7 @@
|
|||||||
<!-- 基本信息 -->
|
<!-- 基本信息 -->
|
||||||
<div class="info-section">
|
<div class="info-section">
|
||||||
<div class="section-title">基本信息</div>
|
<div class="section-title">基本信息</div>
|
||||||
<ElDescriptions :column="2" border>
|
<ElDescriptions :column="3" border>
|
||||||
<ElDescriptionsItem label="ID">{{ detailData.id }}</ElDescriptionsItem>
|
|
||||||
<ElDescriptionsItem label="系列编码">{{
|
<ElDescriptionsItem label="系列编码">{{
|
||||||
detailData.series_code || '-'
|
detailData.series_code || '-'
|
||||||
}}</ElDescriptionsItem>
|
}}</ElDescriptionsItem>
|
||||||
@@ -47,7 +46,7 @@
|
|||||||
<!-- 佣金配置 -->
|
<!-- 佣金配置 -->
|
||||||
<div class="info-section">
|
<div class="info-section">
|
||||||
<div class="section-title">佣金配置</div>
|
<div class="section-title">佣金配置</div>
|
||||||
<ElDescriptions :column="2" border label-width="120">
|
<ElDescriptions :column="3" border label-width="120">
|
||||||
<ElDescriptionsItem label="佣金类型">
|
<ElDescriptionsItem label="佣金类型">
|
||||||
<ElTag :type="detailData.commission_type === 'fixed' ? 'success' : 'warning'">
|
<ElTag :type="detailData.commission_type === 'fixed' ? 'success' : 'warning'">
|
||||||
{{ detailData.commission_type === 'fixed' ? '固定佣金' : '梯度佣金' }}
|
{{ detailData.commission_type === 'fixed' ? '固定佣金' : '梯度佣金' }}
|
||||||
@@ -117,7 +116,7 @@
|
|||||||
<!-- 强制充值配置 -->
|
<!-- 强制充值配置 -->
|
||||||
<div class="info-section">
|
<div class="info-section">
|
||||||
<div class="section-title">强制充值配置</div>
|
<div class="section-title">强制充值配置</div>
|
||||||
<ElDescriptions :column="2" border>
|
<ElDescriptions :column="3" border>
|
||||||
<ElDescriptionsItem label="启用状态">
|
<ElDescriptionsItem label="启用状态">
|
||||||
<ElTag :type="detailData.force_recharge_enabled ? 'warning' : 'info'">
|
<ElTag :type="detailData.force_recharge_enabled ? 'warning' : 'info'">
|
||||||
{{ getEnableStatusText(detailData.force_recharge_enabled || false) }}
|
{{ getEnableStatusText(detailData.force_recharge_enabled || false) }}
|
||||||
|
|||||||
@@ -729,7 +729,7 @@
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const params = {
|
const params = {
|
||||||
page: pagination.page,
|
page: pagination.currentPage,
|
||||||
page_size: pagination.pageSize,
|
page_size: pagination.pageSize,
|
||||||
shop_name: searchForm.shop_name || undefined,
|
shop_name: searchForm.shop_name || undefined,
|
||||||
shop_code: searchForm.shop_code || undefined,
|
shop_code: searchForm.shop_code || undefined,
|
||||||
|
|||||||
Reference in New Issue
Block a user