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

View File

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