feat(@vben/web-antd): erp-优化采购订单表单布局和功能

- 添加订单单号字段并设置为只读
- 将附件上传组件替换为 FileUpload
- 新增产品清单字段
- 调整表单项的布局和样式
- 优化订单产品清单的展示方式
pull/181/head
nehc 2025-07-24 17:13:15 +08:00
parent 83010b6590
commit e319888240
3 changed files with 49 additions and 24 deletions

View File

@ -12,6 +12,15 @@ import { DICT_TYPE, getDictOptions } from '#/utils';
/** 表单的配置项 */ /** 表单的配置项 */
export function useFormSchema(): VbenFormSchema[] { export function useFormSchema(): VbenFormSchema[] {
return [ return [
{
component: 'Input',
componentProps: {
placeholder: '系统自动生成',
disabled: true,
},
fieldName: 'no',
label: '订单单号',
},
{ {
component: 'ApiSelect', component: 'ApiSelect',
componentProps: { componentProps: {
@ -50,17 +59,35 @@ export function useFormSchema(): VbenFormSchema[] {
}, },
fieldName: 'remark', fieldName: 'remark',
label: '备注', label: '备注',
formItemClass: 'col-span-2', formItemClass: 'col-span-3',
}, },
{ {
component: 'Input', component: 'FileUpload',
componentProps: { componentProps: {
placeholder: '请输入附件地址', maxNumber: 5,
class: 'w-full', maxSize: 10,
accept: [
'pdf',
'doc',
'docx',
'xls',
'xlsx',
'txt',
'jpg',
'jpeg',
'png',
],
showDescription: true,
}, },
fieldName: 'fileUrl', fieldName: 'fileUrl',
label: '附件', label: '附件',
formItemClass: 'col-span-2', formItemClass: 'col-span-3',
},
{
fieldName: 'product',
label: '产品清单',
component: 'Input',
formItemClass: 'col-span-3',
}, },
{ {
component: 'InputNumber', component: 'InputNumber',
@ -214,6 +241,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
componentProps: { componentProps: {
placeholder: '请输入订单单号', placeholder: '请输入订单单号',
allowClear: true, allowClear: true,
disabled: true,
}, },
}, },
{ {

View File

@ -40,6 +40,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
border: true, border: true,
showOverflow: true, showOverflow: true,
autoResize: true, autoResize: true,
minHeight: 250,
keepSource: true, keepSource: true,
rowConfig: { rowConfig: {
keyField: 'id', keyField: 'id',

View File

@ -34,9 +34,10 @@ const [Form, formApi] = useVbenForm({
componentProps: { componentProps: {
class: 'w-full', class: 'w-full',
}, },
labelWidth: 120,
}, },
wrapperClass: 'grid-cols-2', wrapperClass: 'grid-cols-3',
layout: 'horizontal', layout: 'vertical',
schema: useFormSchema(), schema: useFormSchema(),
showDefaultActions: false, showDefaultActions: false,
}); });
@ -133,22 +134,17 @@ defineExpose({ modalApi });
:closable="true" :closable="true"
:mask-closable="true" :mask-closable="true"
> >
<Form /> <Form class="mx-3">
<template #product="slotProps">
<!-- Tab卡片 -->
<div class="border-border bg-card mt-4 rounded-lg border p-2">
<a-tabs default-active-key="1">
<a-tab-pane key="1" tab="订单产品清单">
<div class="p-4">
<PurchaseOrderItemForm <PurchaseOrderItemForm
v-bind="slotProps"
ref="itemFormRef" ref="itemFormRef"
class="w-full"
:items="formData?.items || []" :items="formData?.items || []"
:disabled="formType === 'detail'" :disabled="formType === 'detail'"
@update:items="handleUpdateItems" @update:items="handleUpdateItems"
/> />
</div> </template>
</a-tab-pane> </Form>
</a-tabs>
</div>
</Modal> </Modal>
</template> </template>