天河备件前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

221 lines
3.7 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const ItemRules = reactive({
number: [
{ required: true, message: '请输入备件编号', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
uom: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
})
export const ItemSearchTable = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '备件编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
fixed: 'left'
},
},
{
label: '备件名称',
field: 'name',
sort: 'custom',
isSearch: true,
table: {
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
}
]))
export const Item = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '备件编码',
field: 'number',
sort: 'custom',
isSearch: true,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '备件名称',
field: 'name',
sort: 'custom',
isSearch: true,
table: {
width: 110
},
},
{
label: '规格型号',
field: 'specifications',
sort: 'custom',
isSearch: false,
table: {
width: 110
},
},
{
label: '单位',
field: 'uom',
sort: 'custom',
isSearch: false,
table: {
width: 110
},
},
{
label: '供应商名称',
field: 'supplierName',
sort: 'custom',
isSearch: false,
table: {
width: 130
},
},
{
label: '生产厂家',
field: 'brand',
sort: 'custom',
isSearch: false,
table: {
width: 110
},
},
{
label: '最高库存',
field: 'maxInventory',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0
},
table: {
width: 110
},
},
{
label: '最低库存',
field: 'minInventory',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0
},
table: {
width: 110
},
},
{
label: '采购周期(周)',
field: 'procurementCycle',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
value: 0
},
table: {
width: 150
},
},
{
label: 'ABC分类',
field: 'classification',
sort: 'custom',
dictType: DICT_TYPE.CLASSIFICATION,
dictClass: 'string',
isTable: true,
table: {
width: 100
} ,
},
{
label: '使用地点',
field: 'usePlace',
sort: 'custom',
isSearch: false,
table: {
width: 110
},
},
{
label: '项目',
field: 'project',
sort: 'custom',
isSearch: false,
table: {
width: 110
},
},
{
label: '价格',
field: 'price',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 1,
precision: 6
}
},
{
label: '描述',
field: 'describes',
sort: 'custom',
isSearch: false,
table: {
width: 110
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
table: {
width: 180
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))