feat: 产品迭代7月份
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m51s

This commit is contained in:
luo
2026-07-27 16:30:29 +08:00
parent cc6fc9243e
commit f0a2b84e53
75 changed files with 2926 additions and 534 deletions

View File

@@ -8,7 +8,8 @@ export enum AgentRechargeStatus {
PAID = 2, // 已支付
COMPLETED = 3, // 已完成
CLOSED = 4, // 已关闭
REFUNDED = 5 // 已退款
REFUNDED = 5, // 已退款
REJECTED = 6 // 已驳回
}
// 支付方式
@@ -35,8 +36,10 @@ export interface AgentRecharge {
rejection_reason?: string | null // 拒绝原因
remark?: string // 运营备注
submitter_name?: string | null // 提交人名称
approval_source?: 'none' | 'legacy' | 'wecom' | null // 审批来源
approval_status?: string | null // 审批状态
submitter_id?: number | null
approval_provider?: 'wecom' | null
approval_instance_id?: number | null
approval_status?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | null // 企微审批状态
approval_status_name?: string | null // 审批状态名称
current_approver_summary?: string | null // 当前审批人摘要
processing_status?: string | null // 业务处理状态
@@ -55,7 +58,7 @@ export interface AgentRechargeQueryParams {
status?: AgentRechargeStatus
start_date?: string
end_date?: string
dateRange?: string[] | any // For date range picker in UI
dateRange?: string[] // For date range picker in UI
}
// 代理充值订单列表响应

View File

@@ -10,6 +10,8 @@ type ExpiryBase = 'from_activation' | 'from_purchase'
export type AssetType = 'card' | 'device'
import type { AllowedPaymentMethod } from './systemConfig'
// 网络状态
export enum NetworkStatus {
OFFLINE = 0, // 停机
@@ -104,6 +106,11 @@ export interface BatchUpdateAssetRealnamePolicyRequest {
realname_policy: AssetRealnamePolicy
}
export interface BatchUpdateAssetRealnamePolicyResponse {
realname_policy: AssetRealnamePolicy
success_count: number
}
// 换货关联资产
export interface AssetExchangeTraceAsset {
asset_type: string
@@ -135,7 +142,10 @@ export interface AssetResolveResponse {
series_id: number // 套餐系列 ID
series_name: string // 套餐系列名称
real_name_status: RealNameStatus // 实名状态0 未实名 / 1 已实名
realname_policy?: string // 实名认证策略 (none:无需实名, before_order:先实名后充值/购买, after_order:先充值/购买后实名)
realname_policy?: AssetRealnamePolicy // 实名认证策略 (none:无需实名, before_order:先实名后充值/购买, after_order:先充值/购买后实名)
effective_realname_policy?: AssetRealnamePolicy
realname_required?: boolean
allowed_payment_methods?: AllowedPaymentMethod[]
real_name_at?: string | null // 实名时间
network_status?: NetworkStatus // 网络状态0 停机 / 1 开机(仅 card
current_package: string // 当前套餐名称(无则空)
@@ -206,7 +216,7 @@ export interface AssetBoundCard {
network_status: NetworkStatus // 网络状态
real_name_status: RealNameStatus // 实名状态
real_name_at?: string | null // 实名时间
realname_policy?: string // 实名认证策略
realname_policy?: AssetRealnamePolicy // 实名认证策略
slot_position: number // 插槽位置
is_current?: boolean // 是否为设备当前使用的卡
gateway_extend?: string // Gateway 卡状态扩展字段,原样返回上游 extend
@@ -267,7 +277,7 @@ export interface AssetRealtimeStatusResponse {
// ===== 卡专属字段 =====
network_status?: NetworkStatus // 网络状态(仅 card
real_name_status?: RealNameStatus // 实名状态(仅 card
realname_policy?: string // 实名认证策略(仅 card
realname_policy?: AssetRealnamePolicy // 实名认证策略(仅 card
gateway_card_imei?: string // Gateway 返回的卡 IMEI
current_month_usage_mb?: number // 本月已用流量 MB仅 card
last_gateway_reading_mb?: number // 运营商周期月内已用流量 MB仅 card

View File

@@ -2,6 +2,13 @@ import type { BaseResponse } from './common'
export type BulkPurchasePaymentMethod = 'wallet' | 'offline'
export interface BulkPurchaseCreateRequest {
file_key: string
package_id: number
payment_method: BulkPurchasePaymentMethod
voucher_keys?: string[]
}
export enum BulkPurchaseTaskStatus {
PENDING = 1,
PROCESSING = 2,
@@ -19,37 +26,46 @@ export interface BulkPurchaseCreateResponse {
}
export interface BulkPurchaseTask {
id?: number
task_id: number
task_no?: string
id: number
task_id?: number
task_no: string
file_name: string
package_id: number
package_code: string
package_name: string
payment_method: BulkPurchasePaymentMethod
status: BulkPurchaseTaskStatus
status_name?: string
total_count?: number
success_count?: number
status_name: string
total_count: number
success_count: number
fail_count: number
failed_count?: number
total_amount?: number
success_amount?: number
failed_amount?: number
amount_summary?: Record<string, number | string>
error_code?: string
error_summary?: string
created_at?: string
updated_at?: string
started_at?: string
completed_at?: string
error_message: string
creator_name: string
voucher_keys: string[] | null
started_at: string | null
completed_at: string | null
created_at: string
updated_at: string
items?: BulkPurchaseItem[]
}
export interface BulkPurchaseItem {
id?: number
row_number?: number
line?: number
asset_identifier?: string
line: number
asset_identifier: string
package_code?: string
status: BulkPurchaseTaskStatus
status_name: string
order_id: number
order_no: string
amount: number
reason: string
iccid?: string
virtual_no?: string
package_code?: string
status?: string | number
status_name?: string
error_code?: string
error_reason?: string
error_summary?: string
}
@@ -64,4 +80,11 @@ export interface BulkPurchaseItemsResponse {
export type BulkPurchaseCreateApiResponse = BaseResponse<BulkPurchaseCreateResponse>
export type BulkPurchaseTaskApiResponse = BaseResponse<BulkPurchaseTask>
export type BulkPurchaseItemsApiResponse = BaseResponse<BulkPurchaseItemsResponse>
export interface BulkPurchaseTaskListResponse {
items: BulkPurchaseTask[]
page: number
size: number
total: number
}
export type BulkPurchaseTaskListApiResponse = BaseResponse<BulkPurchaseTaskListResponse>

View File

@@ -5,6 +5,16 @@
import { PaginationParams, ImportTask } from './common'
import type { ExpiryEstimateStatus } from './asset'
export type SpeedTierCode = -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8
export interface SetSpeedTierResponse {
code: SpeedTierCode
iccid: string
integration_id: string
iot_card_id: number
speed_tier_name: string
}
// 运营商类型
export enum Operator {
CHINA_MOBILE = 'mobile', // 中国移动

View File

@@ -3,7 +3,7 @@
*/
import { PaginationParams } from './common'
import type { ExpiryEstimateStatus } from './asset'
import type { AssetRealnamePolicy, ExpiryEstimateStatus } from './asset'
// ========== 设备状态枚举 ==========
@@ -65,7 +65,7 @@ export interface Device {
last_gateway_sync_at?: string | null // 最后 sync-info 同步时间
imei?: string // IMEI设备国际移动设备识别码
sn?: string // 设备序列号
realname_policy?: string // 实名认证策略
realname_policy?: AssetRealnamePolicy // 实名认证策略
real_name_status: 0 | 1 // 实名状态 (0:未实名, 1:已实名)
real_name_status_name: string // 实名状态名称
estimated_final_expires_at?: string | null // 当前及排队主套餐接续后的预计最终到期时间
@@ -217,6 +217,7 @@ export enum DeviceImportTaskStatus {
// 导入任务查询参数
export interface DeviceImportTaskQueryParams extends PaginationParams {
status?: DeviceImportTaskStatus // 任务状态
operation_type?: 'import' | 'assign_shop' | 'assign_series'
batch_no?: string // 批次号(模糊查询)
start_time?: string // 创建时间起始
end_time?: string // 创建时间结束
@@ -237,6 +238,11 @@ export interface DeviceImportTask {
fail_count: number // 失败数
skip_count: number // 跳过数
error_message: string // 错误信息
operation_type: 'import' | 'assign_shop' | 'assign_series'
operation_name: string
target_id: number | null
realname_policy: 'none' | 'before_order' | 'after_order'
warning_count: number
created_at: string // 创建时间
started_at: string | null // 开始处理时间
completed_at: string | null // 完成时间
@@ -244,17 +250,17 @@ export interface DeviceImportTask {
// 导入任务列表响应
export interface DeviceImportTaskListResponse {
list: DeviceImportTask[] | null // 任务列表
items: DeviceImportTask[] // 任务列表
page: number // 当前页码
page_size: number // 每页数量
size: number // 每页数量
total: number // 总数
total_pages: number // 总页数
}
// 导入结果详细项
export interface DeviceImportResultItem {
line: number // 行号
virtual_no: string // 虚拟号(原 device_no
device_identifier: string // CSV 原始设备标识
virtual_no: string // 设备虚拟号
reason: string // 原因
}
@@ -262,6 +268,19 @@ export interface DeviceImportResultItem {
export interface DeviceImportTaskDetail extends DeviceImportTask {
failed_items: DeviceImportResultItem[] | null // 失败记录详情
skipped_items: DeviceImportResultItem[] | null // 跳过记录详情
warning_items: DeviceImportResultItem[] | null // 警告记录详情
}
export interface DeviceBatchAllocationRequest {
file_key: string
operation_type: 'assign_shop' | 'assign_series'
target_id: number
}
export interface DeviceBatchAllocationResponse {
message: string
task_id: number
task_no: string
}
// ========== 批量设置设备的套餐系列绑定相关 ==========

View File

@@ -1,6 +1,14 @@
import type { BaseResponse, PaginationParams } from './common'
export type ExportTaskScene = 'device' | 'iot_card' | 'order'
export type ExportTaskScene =
| 'device'
| 'iot_card'
| 'order'
| 'package'
| 'agent_wallet_transaction'
| 'agent_recharge'
| 'refund'
| 'exchange'
export type ExportTaskFormat = 'xlsx' | 'csv'
@@ -45,6 +53,10 @@ export interface ExportTaskItem {
created_at: string
started_at?: string
completed_at?: string
creator_enterprise_id?: number | null
creator_shop_id?: number | null
creator_user_id?: number
creator_user_type?: number
}
export interface ExportTaskListResponse {

View File

@@ -125,3 +125,6 @@ export * from './bulkPurchase'
// 站内通知相关
export * from './notification'
// 企业微信审批配置相关
export * from './wecom'

View File

@@ -22,6 +22,14 @@ export type OrderPaymentMethod = 'wallet' | 'wechat' | 'alipay' | 'offline'
// 订单操作者类型
export type OrderOperatorType = 'platform' | 'agent' | 'enterprise' | 'personal_customer'
export type PurchaseRole =
| 'self_purchase'
| 'purchased_by_parent'
| 'purchased_by_platform'
| 'purchase_for_subordinate'
export type OrderAssetType = 'card' | 'device'
// 订单佣金流程状态
export enum OrderCommissionStatus {
PENDING = 1, // 待计算
@@ -71,9 +79,10 @@ export interface Order {
device_id: number | null
iot_card_id: number | null
asset_identifier?: string // 资产标识符快照ICCID 或 VirtualNo
asset_type?: string // 资产类型:single_card 或 device
purchase_role?: string // 订单渠道
asset_type?: OrderAssetType // 资产类型card 或 device
purchase_role?: PurchaseRole // 订单渠道
purchase_remark?: string // 购买备注
is_purchase_on_behalf?: boolean // 是否为代购订单
is_purchased_by_parent?: boolean // 是否由上级代购
is_expired?: boolean // 是否已过期
expires_at?: string | null // 订单超时时间
@@ -97,13 +106,13 @@ export interface OrderQueryParams {
order_type?: OrderType
order_no?: string
identifier?: string // 按资产标识符过滤ICCID 或 VirtualNo
purchase_role?: string // 订单渠道
purchase_role?: PurchaseRole // 订单渠道
buyer_phone?: string // 按买家手机号精确过滤
start_time?: string
end_time?: string
is_expired?: boolean // 是否已过期
seller_shop_id?: number // 所属代理商ID销售来源店铺ID
dateRange?: string[] | any // For date range picker in UI
dateRange?: string[] // For date range picker in UI
}
// 订单列表响应

View File

@@ -171,7 +171,7 @@ export interface PackageResponse extends PackageAllocationExpiryBaseFields {
suggested_retail_price?: number | null // 建议零售价(分),可能为 null 表示"未配置"
retail_price?: number | null // 原始代理零售价(分),可能为 null
is_gift?: boolean // 是否为赠送套餐
price_config_status?: string // 价格配置状态
price_config_status?: number // 价格配置状态0未配置1赠送0价2已配置非0
price_config_status_name?: string // 价格配置状态名称
effective_retail_price?: number | null // 有效零售价(分)
retail_price_config_status?: string // 零售价配置状态(代理视角)
@@ -180,7 +180,7 @@ export interface PackageResponse extends PackageAllocationExpiryBaseFields {
profit_margin?: number | null // 利润空间(分,仅代理用户可见)
tier_info?: CommissionTierInfo // 返佣档位信息
shelf_status?: number // 上架状态 (1:上架, 2:下架)
status?: number // 状态 (1:启用, 2:禁用)
status?: number // 状态 (0:禁用, 1:启用)
description?: string
created_at?: string
updated_at?: string
@@ -193,7 +193,6 @@ export interface PackageQueryParams extends PaginationParams {
package_name?: string // 套餐名称(模糊搜索)
series_id?: number // 系列ID
package_type?: string // 套餐类型
data_type?: string // 流量类型
shelf_status?: number // 上架状态
status?: number // 状态
}
@@ -244,7 +243,7 @@ export interface UpdatePackageRequest {
* 更新套餐状态请求
*/
export interface UpdatePackageStatusRequest {
status: number // 1:启用, 2:禁
status: number // 0:禁用, 1:启用
}
/**

View File

@@ -66,8 +66,11 @@ export interface Refund {
asset_reset: boolean
commission_deducted: boolean
submitter_name?: string | null // 提交人名称
submitter_id?: number | null
approval_provider?: 'wecom' | null
approval_instance_id?: number | null
approval_source?: 'none' | 'legacy' | 'wecom' | null // 审批来源
approval_status?: string | null // 审批状态
approval_status?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | null // 审批状态
approval_status_name?: string | null // 审批状态名称
current_approver_summary?: string | null // 当前审批人摘要
processing_status?: string | null // 业务处理状态

View File

@@ -26,6 +26,7 @@ export interface ShopResponse {
business_owner_username: string // 平台业务员账号名
business_owner_phone_summary: string // 平台业务员手机号摘要
business_owner_available: boolean // 是否仍可用于通知接收
client_login_disabled: boolean // 是否禁止 C 端新登录
}
// 店铺列表查询参数
@@ -39,6 +40,7 @@ export interface ShopQueryParams extends PaginationParams {
status?: number | null // 状态 (0:禁用, 1:启用)
contact_phone?: string // 联系电话精确查询
business_owner_account_id?: number | null // 平台业务员账号ID
client_login_disabled?: boolean
page?: number // 页码
page_size?: number // 每页数量
}
@@ -59,6 +61,7 @@ export interface CreateShopParams {
contact_name?: string // 联系人姓名
contact_phone?: string // 联系人电话
business_owner_account_id?: number | null // 平台业务员账号ID
client_login_disabled?: boolean
}
// 更新店铺参数
@@ -72,6 +75,7 @@ export interface UpdateShopParams {
contact_name?: string // 联系人姓名
contact_phone?: string // 联系人电话
business_owner_account_id?: number | null // 平台业务员账号ID
client_login_disabled?: boolean
}
// 店铺业务员候选

View File

@@ -2,6 +2,12 @@ import type { PaginationParams } from './common'
export type SystemConfigModule = 'carrier_callback' | 'c2b.payment'
export type AllowedPaymentMethod = 'wallet' | 'wechat' | 'alipay'
export const PAYMENT_CONFIG_KEYS = {
card: 'c2b.payment.card_allowed_methods',
device: 'c2b.payment.device_allowed_methods'
} as const
export type SystemConfigValueType = 'string' | 'int' | 'bool' | 'json'
export interface SystemConfigItem {
@@ -35,3 +41,16 @@ export interface UpdateSystemConfigRequest {
key: string
value: string
}
export function parsePaymentMethods(value: string): AllowedPaymentMethod[] {
try {
const parsed = JSON.parse(value)
return Array.isArray(parsed)
? parsed.filter((method): method is AllowedPaymentMethod =>
['wallet', 'wechat', 'alipay'].includes(method)
)
: []
} catch {
return []
}
}

95
src/types/api/wecom.ts Normal file
View File

@@ -0,0 +1,95 @@
import type { BaseResponse, PaginationData, PaginationParams } from './common'
export type WecomBusinessType = 'refund_approval' | 'offline_recharge_approval'
export interface WecomApplication {
id: number
corp_id: string
agent_id: number
name: string
secret?: string
callback_token?: string
encoding_aes_key?: string
credentials_set: boolean
default_creator_userid?: string | null
default_creator_name?: string | null
status: 0 | 1
status_name: string
last_connected_at: string | null
created_at: string
updated_at: string
}
export interface WecomApplicationRequest {
corp_id?: string
agent_id?: number
name?: string
secret?: string
callback_token?: string
encoding_aes_key?: string
status?: 0 | 1
}
export interface WecomMember {
application_id: number
corp_id: string
userid: string
name: string
department_ids: number[] | null
synced_at: string
}
export interface WecomSceneControlMapping {
business_field: string
control_id: string
control_type: string
option_mapping: Record<string, string>
}
export interface WecomScene {
id: number
application_id: number
business_type: WecomBusinessType
business_type_name: string
template_id: string
template_name: string
control_mapping: WecomSceneControlMapping[]
template_fingerprint: string
last_verified_at: string
status: 0 | 1
status_name: string
updated_at: string
}
export interface WecomSceneRequest {
application_id?: number
template_id?: string
control_mapping?: WecomSceneControlMapping[]
status?: 0 | 1
}
export interface WecomAccountBindingRequest {
application_id: number
userid: string
}
export interface WecomSyncMembersResponse {
application_id: number
synced_at: string
synced_count: number
}
export type WecomApplicationListResponse = BaseResponse<PaginationData<WecomApplication>>
export type WecomMemberListResponse = BaseResponse<PaginationData<WecomMember>>
export type WecomSceneListResponse = BaseResponse<PaginationData<WecomScene>>
export type WecomApplicationResponse = BaseResponse<WecomApplication>
export type WecomSceneResponse = BaseResponse<WecomScene>
export type WecomSyncMembersApiResponse = BaseResponse<WecomSyncMembersResponse>
export interface WecomMemberQueryParams extends PaginationParams {
keyword?: string
}
export interface WecomApplicationQueryParams extends PaginationParams {}
export interface WecomSceneQueryParams extends PaginationParams {}

View File

@@ -91,6 +91,7 @@ declare module 'vue' {
ElCard: typeof import('element-plus/es')['ElCard']
ElCascader: typeof import('element-plus/es')['ElCascader']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']