feat(glt): 水票功能模块重构优化

- 将水票模板表单的标题从"编辑水票"改为"规则设置"
- 统一表单数据绑定方式,移除computed计算属性直接使用form绑定
- 调整includeBuyQty字段类型从string改为boolean并更新相关逻辑
- 添加normalizeBoolean函数处理布尔值转换
- 更新商品列表API调用参数从pageSize改为limit
- 优化水票模板表格列配置,调整列标题和对齐方式
- 隐藏部分不必要的表格列如备注、排序、状态等
- 移除水票编辑表单中的多余字段如用户ID、状态等
- 重构搜索组件,使用关键词搜索替换按钮添加功能
- 在表格中新增用户信息展示列,包含头像、昵称、ID和手机号
- 调整水票记录和释放记录的表格列布局和标题
- 移除表格中的操作列和修改时间列
- 修复布尔值在表单提交时的类型转换问题
- 添加表单验证前的数据类型标准化处理
This commit is contained in:
2026-02-04 02:45:24 +08:00
parent a95fa6d95d
commit 1d8da2c5be
11 changed files with 330 additions and 409 deletions

View File

@@ -20,6 +20,18 @@
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'nickname'">
<a-space>
<a-avatar :src="record.avatar" />
<div class="flex flex-col">
<div>
<span>{{ record.nickname }}</span>
<span class="text-gray-400">ID{{ record.userId }}</span>
</div>
<div><span class="text-gray-400">{{ record.phone }}</span></div>
</div>
</a-space>
</template>
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
@@ -49,7 +61,7 @@
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } from 'vue';
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
@@ -100,103 +112,67 @@
// 完整的列配置(包含所有字段)
const columns = ref<ColumnItem[]>([
{
title: '',
dataIndex: 'id',
key: 'id',
width: 90,
},
{
title: '用户水票ID',
title: '票号',
dataIndex: 'userTicketId',
key: 'userTicketId',
width: 120
width: 90
},
{
title: '用户信息',
dataIndex: 'nickname',
key: 'nickname',
width: 280
},
{
title: '名称',
dataIndex: 'templateName',
key: 'templateName',
align: 'center'
},
{
title: '变更类型',
dataIndex: 'changeType',
key: 'changeType',
width: 120
align: 'center'
},
// {
// title: '可更改',
// dataIndex: 'changeAvailable',
// key: 'changeAvailable',
// width: 120
// },
// {
// title: '更改冻结状态',
// dataIndex: 'changeFrozen',
// key: 'changeFrozen',
// width: 120
// },
// {
// title: '已使用更改',
// dataIndex: 'changeUsed',
// key: 'changeUsed',
// width: 120
// },
// {
// title: '可用后',
// dataIndex: 'availableAfter',
// key: 'availableAfter',
// width: 120
// },
// {
// title: '冻结后',
// dataIndex: 'frozenAfter',
// key: 'frozenAfter',
// width: 120
// },
// {
// title: '使用后',
// dataIndex: 'usedAfter',
// key: 'usedAfter',
// width: 120
// },
{
title: '可更改',
dataIndex: 'changeAvailable',
key: 'changeAvailable',
width: 120
},
{
title: '更改冻结状态',
dataIndex: 'changeFrozen',
key: 'changeFrozen',
width: 120
},
{
title: '已使用更改',
dataIndex: 'changeUsed',
key: 'changeUsed',
width: 120
},
{
title: '可用后',
dataIndex: 'availableAfter',
key: 'availableAfter',
width: 120
},
{
title: '冻结后',
dataIndex: 'frozenAfter',
key: 'frozenAfter',
width: 120
},
{
title: '使用后',
dataIndex: 'usedAfter',
key: 'usedAfter',
width: 120
},
{
title: '订单ID',
dataIndex: 'orderId',
key: 'orderId',
width: 120
},
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
ellipsis: true
},
{
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
width: 120
},
{
title: '排序(数字越小越靠前)',
dataIndex: 'sortNumber',
key: 'sortNumber',
width: 120
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
ellipsis: true
},
{
title: '状态, 0正常, 1冻结',
dataIndex: 'status',
key: 'status',
width: 120
},
{
title: '是否删除, 0否, 1是',
dataIndex: 'deleted',
key: 'deleted',
width: 120
},
{
title: '创建时间',
title: '核销时间',
dataIndex: 'createTime',
key: 'createTime',
width: 200,
@@ -205,24 +181,14 @@
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '修改时间',
dataIndex: 'updateTime',
key: 'updateTime',
width: 200,
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
/* 搜索 */