feat:【antd】【erp 系统】stock/record 重构代码风格

This commit is contained in:
YunaiV
2025-10-04 15:39:56 +08:00
parent b0c32a2a18
commit 34167a38de
2 changed files with 7 additions and 21 deletions

View File

@@ -6,6 +6,7 @@ import { getDictOptions } from '@vben/hooks';
import { getProductSimpleList } from '#/api/erp/product/product';
import { getWarehouseSimpleList } from '#/api/erp/stock/warehouse';
import { getRangePickerDefaultProps } from '#/utils';
/** 搜索表单 */
export function useGridFormSchema(): VbenFormSchema[] {
@@ -21,7 +22,6 @@ export function useGridFormSchema(): VbenFormSchema[] {
api: getProductSimpleList,
labelField: 'name',
valueField: 'id',
filterOption: false,
},
},
{
@@ -35,7 +35,6 @@ export function useGridFormSchema(): VbenFormSchema[] {
api: getWarehouseSimpleList,
labelField: 'name',
valueField: 'id',
filterOption: false,
},
},
{
@@ -62,10 +61,8 @@ export function useGridFormSchema(): VbenFormSchema[] {
label: '创建时间',
component: 'RangePicker',
componentProps: {
placeholder: ['开始日期', '结束日期'],
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
...getRangePickerDefaultProps(),
allowClear: true,
},
},
];
@@ -113,31 +110,19 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
field: 'createTime',
title: '出入库日期',
width: 180,
cellRender: {
name: 'CellDateTime',
},
formatter: 'formatDateTime',
},
{
field: 'count',
title: '出入库数量',
width: 120,
cellRender: {
name: 'CellAmount',
props: {
digits: 2,
},
},
formatter: 'formatAmount3',
},
{
field: 'totalCount',
title: '库存量',
width: 100,
cellRender: {
name: 'CellAmount',
props: {
digits: 2,
},
},
formatter: 'formatAmount3',
},
{
field: 'creatorName',

View File

@@ -41,6 +41,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
},
rowConfig: {
keyField: 'id',
isHover: true,
},
toolbarConfig: {
refresh: true,