积分与余额账务系统硬切重构

This commit is contained in:
kate522 committed 2026-08-24 15:59:11 +08:00
1 parent ca12226b39
commit 5cae5b5c93
159 files changed
+7275 -4718

No files matched your search

@@ -55,10 +55,10 @@
<n-select v-model:value="createForm.type" :options="typeOptions" />
</n-form-item>
<n-form-item label="卡密">
<n-input v-model:value="createForm.code" placeholder="手动填写唯一卡密" />
<n-input v-model:value="createForm.password" placeholder="手动填写唯一卡密" />
</n-form-item>
<n-form-item v-if="createForm.type === 'balance'" label="面额">
<n-input-number v-model:value="createForm.amount" :min="0.01" :precision="2" style="width: 100%;" />
<n-input v-model:value="createForm.amount" inputmode="decimal" placeholder="例如 10.00" />
</n-form-item>
<n-grid v-if="createForm.type === 'vip'" cols="2" :x-gap="12">
<n-grid-item>
@@ -101,7 +101,7 @@
</n-grid-item>
<n-grid-item v-if="batchForm.type === 'balance'">
<n-form-item label="面额">
<n-input-number v-model:value="batchForm.amount" :min="0.01" :precision="2" style="width: 100%;" />
<n-input v-model:value="batchForm.amount" inputmode="decimal" placeholder="例如 10.00" />
</n-form-item>
</n-grid-item>
<n-grid-item v-if="batchForm.type === 'credits'">
@@ -185,8 +185,8 @@ const filters = reactive({
const createForm = reactive({
type: 'balance',
code: '',
amount: 10,
password: '',
amount: '10.00',
level: 1,
days: 30,
points: 100,
@@ -197,7 +197,7 @@ const createForm = reactive({
const batchForm = reactive({
type: 'balance',
count: 20,
amount: 10,
amount: '10.00',
level: 1,
days: 30,
points: 100,
@@ -265,7 +265,7 @@ const pagination = computed(() => ({
const columns = [
{ title: 'ID', key: 'id', width: 70 },
{ title: '卡密', key: 'code', minWidth: 170, ellipsis: { tooltip: true } },
{ title: '卡密', key: 'password', minWidth: 170, ellipsis: { tooltip: true } },
{
title: '类型',
key: 'type_label',
@@ -408,9 +408,8 @@ async function handleCreate() {
method: 'POST',
data: {
type: createForm.type,
code: createForm.code,
password: createForm.code,
amount: createForm.amount,
password: createForm.password,
amount: String(createForm.amount ?? ''),
level: createForm.level,
days: createForm.days,
points: createForm.points,
@@ -420,7 +419,7 @@ async function handleCreate() {
})
message.success('充值卡已创建')
createVisible.value = false
createForm.code = ''
createForm.password = ''
createForm.note = ''
await loadData()
} catch (error) {
@@ -438,7 +437,7 @@ async function handleBatchCreate() {
data: {
type: batchForm.type,
count: batchForm.count,
amount: batchForm.amount,
amount: String(batchForm.amount ?? ''),
level: batchForm.level,
days: batchForm.days,
points: batchForm.points,
@@ -461,7 +460,7 @@ async function handleBatchCreate() {
function handleDisable(row) {
dialog.warning({
title: '确认禁用',
content: `确定要禁用充值卡 ${row.code} 吗?`,
content: `确定要禁用充值卡 ${row.password} 吗?`,
positiveText: '禁用',
negativeText: '取消',
onPositiveClick: async () => {
@@ -488,7 +487,7 @@ async function handleExport() {
const header = ['ID', '卡号', '面额', '余额', '状态', '使用人', '创建时间', '过期时间', '备注']
const lines = items.map((row) => [
row.id,
row.code,
row.password,
row.amount,
row.balance,
row.status_label,