diff --git a/src/router/index.ts b/src/router/index.ts
index d3a3459..11bab26 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -251,12 +251,25 @@ const routes: RouteRecordRaw[] = [
component: () =>
import("@/views/admin/account/cost/myOrder/index.vue"),
},
+
+ {
+ path: "balance",
+ name: "balance",
+ component: () =>
+ import("@/views/admin/account/cost/balance/index.vue"),
+ },
{
path: "myMoney",
name: "myMoney",
component: () =>
import("@/views/admin/account/cost/myMoney/index.vue"),
},
+ {
+ path: "deposit",
+ name: "deposit",
+ component: () =>
+ import("@/views/admin/account/cost/deposit/index.vue"),
+ },
{
path: "exchange",
name: "exchange",
diff --git a/src/views/admin/account/cost/balance/index.vue b/src/views/admin/account/cost/balance/index.vue
new file mode 100644
index 0000000..94d23c1
--- /dev/null
+++ b/src/views/admin/account/cost/balance/index.vue
@@ -0,0 +1,830 @@
+
+
+
+
+
+ 首页
+
+ 我的余额
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
自定义充值金额
+
+
+
+ ¥
+
+
+
+ {{ customAmountError }}
+
+
+
+
+
+
+
充值方式
+
+
+
+
+
+
+
{{ method.name }}
+
{{ method.description }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ¥{{ record.amount }}
+
+
+ {{ formatDateTime(record.rechargeTime) }}
+
+
+
+ {{ getPaymentMethodLabel(record.paymentMethod) }}
+
+
+
+ ¥{{ formatCurrency(record.accountBalance) }}
+
+
+
+ {{ getStatusLabel(record.status) }}
+
+
+
+ 详情
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 充值金额:
+ ¥{{ selectedRechargeAmount }}
+
+
+ 充值方式:
+ {{ getPaymentMethodLabel(selectedPaymentMethod) }}
+
+
+ 当前余额:
+ ¥{{ formatCurrency(balance) }}
+
+
+ 充值后余额:
+ ¥{{ formatCurrency(balance + selectedRechargeAmount) }}
+
+
+
+ 充值成功后,金额将立即到账
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/admin/account/cost/deposit/index.vue b/src/views/admin/account/cost/deposit/index.vue
new file mode 100644
index 0000000..6b14af8
--- /dev/null
+++ b/src/views/admin/account/cost/deposit/index.vue
@@ -0,0 +1,537 @@
+
+
+
+
+
+
+
+
+
+ {{ formatCurrency(accountInfo.availableBalance) }}
+ 元
+
+
+ 当前可提现金额,提现将在1-3个工作日内到账
+
+
+ 去提现
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ account.label }}
+
+
+
+
+
+
+ 处理中
+ 成功
+ 失败
+
+
+
+
+ 查询
+ 重置
+
+
+
+
+
+
+
+ {{ formatCurrency(record.amount) }}元
+
+
+
+
+ {{ getStatusText(record.status) }}
+
+
+
+
+ {{ formatDate(record.createdAt) }}
+
+
+
+ {{ record.completedAt ? formatDate(record.completedAt) : '-' }}
+
+
+
+ 查看详情
+
+
+
+
+
+
+
+
+
+
+
+
可提现金额: {{ formatCurrency(accountInfo.availableBalance) }}元
+
单笔最低提现: 1元
+
+
+
+
+
+
+ {{ accountInfo.bank }} ({{ accountInfo.number }})
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/admin/account/cost/invoice/index.vue b/src/views/admin/account/cost/invoice/index.vue
index e2a22f2..84411fe 100644
--- a/src/views/admin/account/cost/invoice/index.vue
+++ b/src/views/admin/account/cost/invoice/index.vue
@@ -1,60 +1,6 @@
-
-
-
-
-
- 可开票:
- ¥ 0.00
-
-
- 去开票
-
-
-
-
-
-
-
- 发票信息:
-
-
-
-
-
-
+
-
+
+
+
+
+ 批量去开票
+
+
+ 已选择 {{ selectedRowKeys.length }} 条记录
+
+
+
+
+
@@ -46,37 +69,400 @@
{{ dayjs(record.billing_start).format('YYYY-MM-DD HH:mm') +"~" +dayjs(record.billing_end).format('YYYY-MM-DD HH:mm') }}
+
+
+ ¥{{ record.price || '0.00' }}
+
+
+
+
+ -¥{{ record.real_amount || '0.00' }}
+
+
+
+
+
+ 去开票
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 订单数量:
+ {{ selectedRows.length }} 个订单
+
+
+ 总金额:
+ ¥{{ selectedTotalAmount.toFixed(2) }}
+
+
+
订单列表:
+
+
+ {{ order.serial_number }}
+ -¥{{ order.real_amount || '0.00' }}
+
+
+ 等 {{ selectedRows.length }} 个订单
+
+
+
+
+
+
+
+ 订单编号:
+ {{ currentInvoiceRecord?.serial_number || '-' }}
+
+
+ 开票金额:
+ ¥{{ currentInvoiceRecord?.real_amount || '0.00' }}
+
+
+
+
+
+
+
+
+
+
+
+
+ 普通发票
+ 专用发票
+ 电子发票
+
+
+
+
+
+
+ 个人
+ 企业
+
+
+
+
+
+
+
+ 个人抬头
+ 公司抬头
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
+
+/**
+ * 单个去开票
+ */
+function handleSingleInvoice(record: any) {
+ currentInvoiceRecord.value = record
+ isBatch.value = false
+ resetInvoiceForm()
+ singleInvoiceModalVisible.value = true
+}
+
+/**
+ * 批量去开票
+ */
+function handleBatchInvoice() {
+ if (selectedRowKeys.value.length === 0) {
+ message.warning('请先选择要开票的记录')
+ return
+ }
+ isBatch.value = true
+ resetInvoiceForm()
+ singleInvoiceModalVisible.value = true
+}
+
+/**
+ * 重置发票表单
+ */
+function resetInvoiceForm() {
+ invoiceFormData.invoiceType = undefined
+ invoiceFormData.billingType = undefined
+ invoiceFormData.titleType = 'company'
+ invoiceFormData.invoiceTitle = undefined
+ invoiceFormData.personalTitle = ''
+ invoiceFormData.taxNumber = ''
+ invoiceFormData.remark = ''
+
+ // 清除表单验证状态
+ nextTick(() => {
+ invoiceFormRef.value?.clearValidate()
+ })
+}
+
+/**
+ * 关闭开票模态框
+ */
+function handleInvoiceModalCancel() {
+ singleInvoiceModalVisible.value = false
+ resetInvoiceForm()
+}
+
+/**
+ * 确认开票
+ */
+async function handleSingleInvoiceConfirm() {
+ try {
+ // 验证表单
+ await invoiceFormRef.value?.validate()
+
+ singleInvoiceLoading.value = true
+
+ // 根据抬头类型获取抬头信息
+ const titleInfo = invoiceFormData.titleType === 'company'
+ ? {
+ titleType: 'company',
+ companyName: invoiceFormData.invoiceTitle,
+ taxNumber: invoiceFormData.taxNumber
+ }
+ : {
+ titleType: 'personal',
+ personalName: invoiceFormData.personalTitle
+ }
+
+ // 准备开票数据
+ const invoiceData = {
+ ...titleInfo,
+ invoiceType: invoiceFormData.invoiceType,
+ billingType: invoiceFormData.billingType,
+ remark: invoiceFormData.remark,
+ orders: isBatch.value
+ ? selectedRows.value.map(row => ({
+ id: row.id,
+ serialNumber: row.serial_number,
+ amount: row.real_amount
+ }))
+ : [{
+ id: currentInvoiceRecord.value.id,
+ serialNumber: currentInvoiceRecord.value.serial_number,
+ amount: currentInvoiceRecord.value.real_amount
+ }]
+ }
+
+ console.log('提交开票数据:', invoiceData)
+
+ // 模拟API调用延迟
+ await new Promise(resolve => setTimeout(resolve, 1500))
+
+ const successMessage = isBatch.value
+ ? `批量开票申请已提交成功,共 ${selectedRows.value.length} 条记录`
+ : '开票申请已提交成功!'
+
+ message.success(successMessage)
+ singleInvoiceModalVisible.value = false
+
+ // 清空选择
+ selectedRowKeys.value = []
+ selectedRows.value = []
+
+ // 刷新列表
+ getPageList()
+
+ } catch (error) {
+ console.error('表单验证失败:', error)
+ if (error && typeof error === 'object' && 'errorFields' in error) {
+ message.error('请完善开票信息')
+ } else {
+ const errorMessage = isBatch.value
+ ? '批量开票申请提交失败,请稍后重试'
+ : '开票申请提交失败,请稍后重试'
+ message.error(errorMessage)
+ }
+ } finally {
+ singleInvoiceLoading.value = false
+ }
+}
+
+/**
+ * 搜索发票抬头
+ */
+function handleSearchInvoiceTitle(value: string) {
+ console.log('搜索发票抬头:', value)
+ // 这里可以实现搜索逻辑
+}
+
+/**
+ * 添加发票抬头
+ */
+function handleAddInvoiceTitle() {
+ addTitleModalVisible.value = true
+}
+
+/**
+ * 确认新增发票抬头
+ */
+function handleAddTitleConfirm() {
+ if (!newTitleForm.companyName || !newTitleForm.taxNumber) {
+ message.error('请填写公司名称和纳税人识别号')
+ return
+ }
+
+ // 添加到选项列表
+ const newOption = {
+ value: newTitleForm.companyName,
+ label: newTitleForm.companyName
+ }
+
+ invoiceTitleOptions.value.push(newOption)
+
+ // 设置当前选择的发票抬头
+ invoiceFormData.invoiceTitle = newTitleForm.companyName
+ invoiceFormData.taxNumber = newTitleForm.taxNumber
+
+ // 重置表单并关闭模态框
+ Object.keys(newTitleForm).forEach(key => {
+ newTitleForm[key] = ''
+ })
+ addTitleModalVisible.value = false
+
+ message.success('发票抬头添加成功')
+}
+
+
+
\ No newline at end of file
diff --git a/src/views/admin/index.vue b/src/views/admin/index.vue
index 3404133..286fd92 100644
--- a/src/views/admin/index.vue
+++ b/src/views/admin/index.vue
@@ -61,15 +61,18 @@ const menuItems: MenuItem[] = [
visible: true,
children: [
{ path: '/layout/admin/myMoney', name: '费用总览', visible: true, disabled: false },
+ { path: '/layout/admin/balance', name: '余额管理', visible: true, disabled: false },
+ { path: '/layout/admin/invoice', name: '发票管理', disabled: false, visible: true },
+ { path: '/layout/admin/deposit', name: '提现管理', disabled: false, visible: true },
// 消费明细设置为不可见
{ path: '/layout/admin/exchange', name: '算力点兑换', visible: false, disabled: false },
{ path: '/layout/admin/myMoneyDetail', name: '消费明细', visible: false, disabled: false },
- { path: '/layout/admin/myOrder', name: '我的订单', visible: true, disabled: false },
- { path: '/layout/admin/flow', name: '账单明细', visible: true, disabled: false },
- { path: '/layout/admin/coupon', name: '优惠券(待开发)', disabled: true, visible: true },
- { path: '/layout/admin/invoice', name: '发票(待开发)', disabled: true, visible: true },
- { path: '/layout/admin/voucher', name: '代金券(待开发)', disabled: true, visible: true },
- { path: '/layout/admin/contract', name: '合同(待开发)', disabled: true, visible: true },
+ { path: '/layout/admin/myOrder', name: '订单明细', visible: true, disabled: false },
+ // { path: '/layout/admin/flow', name: '账单明细', visible: true, disabled: false },
+ // { path: '/layout/admin/coupon', name: '优惠券(待开发)', disabled: true, visible: true },
+
+ // { path: '/layout/admin/voucher', name: '代金券(待开发)', disabled: true, visible: true },
+ // { path: '/layout/admin/contract', name: '合同(待开发)', disabled: true, visible: true },
],
},
{
diff --git a/src/views/admin/instance/index.vue b/src/views/admin/instance/index.vue
index 57e2a79..c863a1f 100644
--- a/src/views/admin/instance/index.vue
+++ b/src/views/admin/instance/index.vue
@@ -7,134 +7,538 @@
容器实例
- 实例连续关机15天会释放实例,实例释放会导致数据清空且不可恢复,释放前实例在数据在。
+ 实例连续关机15天会释放实例,实例释放会导致数据清空且不可恢复,释放前实例数据仍在。
-
-
+
+
-
-
- {{ 'GPU型号:' + record.gpu_model,'GPU数量:' + record.gpu_count ,'单卡显存GB:' + record.gpu_memory_gb , 'CPU核数:' + record.cpu_cores , '内存(MB):' + record.memory_mb}}
+
+
+ {{ getStatusText(record.status) }}
+
+
+
+
+
+
+
+
{{ record.gpu_model }}
+
+ 查看详情
+
+
+
+
+
+
+
+
+ {{ getHealthStatusText(record.health_status) }}
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ {{ specDetail.gpu_model }}
+ {{ specDetail.gpu_count }}
+ {{ specDetail.gpu_memory_gb }} GB
+ {{ specDetail.cpu_cores }}
+ {{ specDetail.memory_mb }} MB
+ {{ specDetail.system_disk }} GB
+ {{ specDetail.data_disk || '无' }} GB
+ {{ specDetail.bandwidth || '100' }} Mbps
+
+
+
+
+
+
+
+
+
+
确认要重置容器实例吗?
+
• 重置将清空容器内的所有数据
+
• 系统盘和数据盘将恢复初始状态
+
• 实例配置和网络设置保持不变
+
+
+
+ 确认重置
+
+
+
+
+
+
+
+
+
确认要释放实例吗?
+
• 释放后实例将被永久删除
+
• 所有数据将无法恢复
+
• 网络配置、IP地址将被回收
+
请确保已备份重要数据!
+
+
+