初始化项目

This commit is contained in:
2026-03-22 14:53:19 +08:00
parent 7888164aff
commit bd55405817
19 changed files with 362 additions and 258 deletions

View File

@@ -0,0 +1,112 @@
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table';
import { ErpAccount, erpAccountListData } from '@jeesite/erp/api/erp/account';
const { t } = useI18n('erp.account');
const modalProps = {
title: t('账户选择'),
};
const searchForm: FormProps<ErpAccount> = {
baseColProps: { md: 8, lg: 6 },
labelWidth: 90,
schemas: [
{
label: t('账户名称'),
field: 'accountName',
component: 'Input',
},
{
label: t('账户类型'),
field: 'accountType',
component: 'Select',
componentProps: {
dictType: 'account_type',
allowClear: true,
},
},
{
label: t('是否激活'),
field: 'isActive',
component: 'Select',
componentProps: {
dictType: 'is_active',
allowClear: true,
},
},
],
};
const tableColumns: BasicColumn<ErpAccount>[] = [
{
title: t('记录时间'),
dataIndex: 'createTime',
key: 'a.create_time',
sorter: true,
width: 150,
align: 'center',
fixed: 'left',
},
{
title: t('账户名称'),
dataIndex: 'accountName',
key: 'a.account_name',
sorter: true,
width: 200,
align: 'left',
},
{
title: t('账户类型'),
dataIndex: 'accountType',
key: 'a.account_type',
sorter: true,
width: 130,
align: 'left',
dictType: 'account_type',
},
{
title: t('账户卡号'),
dataIndex: 'accountCode',
key: 'a.account_code',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('当前余额'),
dataIndex: 'currentBalance',
key: 'a.current_balance',
sorter: true,
width: 130,
align: 'right',
},
{
title: t('是否激活'),
dataIndex: 'isActive',
key: 'a.is_active',
sorter: true,
width: 130,
align: 'left',
dictType: 'is_active',
},
];
const tableProps: BasicTableProps = {
api: erpAccountListData,
beforeFetch: (params) => {
params['isAll'] = true;
return params;
},
columns: tableColumns,
formConfig: searchForm,
rowKey: 'accountId',
};
export default {
modalProps,
tableProps,
itemCode: 'accountId',
itemName: 'accountName',
isShowCode: true,
};

View File

@@ -0,0 +1,120 @@
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table';
import { ErpCategory, erpCategoryListData } from '@jeesite/erp/api/erp/category';
const { t } = useI18n('erp.category');
const modalProps = {
title: t('分类选择'),
};
const searchForm: FormProps<ErpCategory> = {
baseColProps: { md: 8, lg: 6 },
labelWidth: 90,
schemas: [
{
label: t('分类名称'),
field: 'categoryName',
component: 'Input',
},
{
label: t('分类类型'),
field: 'categoryType',
component: 'Select',
componentProps: {
dictType: 'erp_type',
allowClear: true,
},
},
{
label: t('是否启用'),
field: 'isActive',
component: 'Select',
componentProps: {
dictType: 'is_active',
allowClear: true,
},
},
],
};
const tableColumns: BasicColumn<ErpCategory>[] = [
{
title: t('记录时间'),
dataIndex: 'createTime',
key: 'a.create_time',
sorter: true,
width: 150,
align: 'center',
fixed: 'left',
},
{
title: t('父级名称'),
dataIndex: 'parentName',
key: 'a.parent_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('分类名称'),
dataIndex: 'categoryName',
key: 'a.category_name',
sorter: true,
width: 130,
align: 'left',
},
{
title: t('分类类型'),
dataIndex: 'categoryType',
key: 'a.category_type',
sorter: true,
width: 130,
align: 'left',
dictType: 'erp_type',
},
{
title: t('排序序号'),
dataIndex: 'sortOrder',
key: 'a.sort_order',
sorter: true,
width: 130,
align: 'center',
},
{
title: t('是否启用'),
dataIndex: 'isActive',
key: 'a.is_active',
sorter: true,
width: 130,
align: 'left',
dictType: 'is_active',
},
{
title: t('更新时间'),
dataIndex: 'updateTime',
key: 'a.update_time',
sorter: true,
width: 150,
align: 'center',
},
];
const tableProps: BasicTableProps = {
api: erpCategoryListData,
beforeFetch: (params) => {
params['isAll'] = true;
return params;
},
columns: tableColumns,
formConfig: searchForm,
rowKey: 'categoryId',
};
export default {
modalProps,
tableProps,
itemCode: 'categoryId',
itemName: 'categoryName',
isShowCode: true,
};