feat:【antd】【erp 系统】stock/record 重构代码风格
This commit is contained in:
@@ -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',
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: true,
|
refresh: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user