feat:【antd】【erp 系统】sale/out 部分重构(列表 ok)
This commit is contained in:
@@ -13,7 +13,7 @@ import { getSimpleUserList } from '#/api/system/user';
|
||||
import { getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
/** 表单的配置项 */
|
||||
export function useFormSchema(): VbenFormSchema[] {
|
||||
export function useFormSchema(formType: string): VbenFormSchema[] {
|
||||
return [
|
||||
{
|
||||
fieldName: 'id',
|
||||
@@ -82,6 +82,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
componentProps: {
|
||||
placeholder: '请输入备注',
|
||||
autoSize: { minRows: 1, maxRows: 1 },
|
||||
disabled: formType === 'detail',
|
||||
},
|
||||
formItemClass: 'col-span-2',
|
||||
},
|
||||
@@ -103,7 +104,8 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
'jpeg',
|
||||
'png',
|
||||
],
|
||||
showDescription: true,
|
||||
showDescription: formType !== 'detail',
|
||||
disabled: formType === 'detail',
|
||||
},
|
||||
formItemClass: 'col-span-3',
|
||||
},
|
||||
|
||||
@@ -140,8 +140,8 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
url="https://doc.iocoder.cn/erp/sale/"
|
||||
/>
|
||||
</template>
|
||||
<FormModal @success="handleRefresh" />
|
||||
|
||||
<FormModal @success="handleRefresh" />
|
||||
<Grid table-title="销售订单列表">
|
||||
<template #toolbar-tools>
|
||||
<TableAction
|
||||
|
||||
@@ -117,6 +117,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
const data = modalApi.getData<{ id?: number; type: string }>();
|
||||
formType.value = data.type;
|
||||
formApi.setDisabled(formType.value === 'detail');
|
||||
formApi.updateSchema(useFormSchema(formType.value));
|
||||
if (!data || !data.id) {
|
||||
// 新增时,默认选中账户
|
||||
const accountList = await getAccountSimpleList();
|
||||
|
||||
Reference in New Issue
Block a user