134 lines
2.5 KiB
JavaScript
134 lines
2.5 KiB
JavaScript
|
|
// import { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
|||
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|||
|
|
|
|||
|
|
const statusOptions = [
|
|||
|
|
{ label: '审核中', value: 1 },
|
|||
|
|
{ label: '已通过', value: 2 },
|
|||
|
|
{ label: '已驳回', value: 3 }
|
|||
|
|
]
|
|||
|
|
|
|||
|
|
// CrudSchema:https://doc.iocoder.cn/vue3/crud-schema/
|
|||
|
|
const crudSchemas = reactive([
|
|||
|
|
{
|
|||
|
|
label: '产品名称',
|
|||
|
|
field: 'name',
|
|||
|
|
isSearch: true,
|
|||
|
|
isTable: true
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
label: '规格名称',
|
|||
|
|
field: 'specsName',
|
|||
|
|
isSearch: true,
|
|||
|
|
isTable: true
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
label: '供应商',
|
|||
|
|
field: 'supplier',
|
|||
|
|
isSearch: true,
|
|||
|
|
isTable: true
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
label: '采购数量',
|
|||
|
|
field: 'purchaseCount',
|
|||
|
|
isSearch: false,
|
|||
|
|
isTable: true
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
label: '采购单价',
|
|||
|
|
field: 'unitPrice',
|
|||
|
|
isSearch: false,
|
|||
|
|
isTable: true
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
label: '总金额',
|
|||
|
|
field: 'totalPrice',
|
|||
|
|
isSearch: false,
|
|||
|
|
isTable: true
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
label: '仓库',
|
|||
|
|
field: 'warehouse',
|
|||
|
|
isSearch: false,
|
|||
|
|
isTable: true
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
label: '申请人',
|
|||
|
|
field: 'applyUserName',
|
|||
|
|
isSearch: true,
|
|||
|
|
isTable: true
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
label: '申请时间',
|
|||
|
|
field: 'applyTime',
|
|||
|
|
isSearch: true,
|
|||
|
|
isTable: true,
|
|||
|
|
formatter: dateFormatter,
|
|||
|
|
detail: {
|
|||
|
|
dateFormat: 'YYYY-MM-DD'
|
|||
|
|
},
|
|||
|
|
search: {
|
|||
|
|
component: 'DatePicker',
|
|||
|
|
componentProps: {
|
|||
|
|
type: 'daterange',
|
|||
|
|
format: 'YYYY-MM-DD',
|
|||
|
|
valueFormat: 'YYYY-MM-DD',
|
|||
|
|
startPlaceholder: '申请时间',
|
|||
|
|
endPlaceholder: '申请时间'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
label: '审核人',
|
|||
|
|
field: 'auditUserName',
|
|||
|
|
isSearch: true,
|
|||
|
|
isTable: true
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
label: '审核时间',
|
|||
|
|
field: 'auditTime',
|
|||
|
|
isSearch: true,
|
|||
|
|
isTable: true,
|
|||
|
|
formatter: dateFormatter,
|
|||
|
|
detail: {
|
|||
|
|
dateFormat: 'YYYY-MM-DD'
|
|||
|
|
},
|
|||
|
|
search: {
|
|||
|
|
component: 'DatePicker',
|
|||
|
|
componentProps: {
|
|||
|
|
type: 'daterange',
|
|||
|
|
format: 'YYYY-MM-DD',
|
|||
|
|
valueFormat: 'YYYY-MM-DD',
|
|||
|
|
startPlaceholder: '审核时间',
|
|||
|
|
endPlaceholder: '审核时间'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
label: '采购状态',
|
|||
|
|
field: 'status',
|
|||
|
|
isSearch: true,
|
|||
|
|
isTable: true,
|
|||
|
|
search: {
|
|||
|
|
component: 'Select',
|
|||
|
|
api: () => statusOptions,
|
|||
|
|
componentProps: {
|
|||
|
|
optionsAlias: {
|
|||
|
|
labelField: 'label',
|
|||
|
|
valueField: 'value'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
table: {
|
|||
|
|
field: 'statusName',
|
|||
|
|
fixed: 'right'
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
label: '备注',
|
|||
|
|
field: 'remark',
|
|||
|
|
isSearch: false,
|
|||
|
|
isTable: true
|
|||
|
|
}
|
|||
|
|
])
|
|||
|
|
export const { allSchemas } = useCrudSchemas(crudSchemas)
|