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.
313 lines
5.6 KiB
313 lines
5.6 KiB
10 months ago
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
||
|
import { dateFormatter } from '@/utils/formatTime'
|
||
|
|
||
|
// 表单校验
|
||
|
export const ItemRules = reactive({
|
||
|
name: [
|
||
|
{ required: true, message: '请输入备件名称', trigger: 'blur' },
|
||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
|
||
|
],
|
||
|
uom: [
|
||
|
{ required: true, message: '请选择备件单位', trigger: 'blur' },
|
||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
|
||
|
],
|
||
|
classification: [
|
||
|
{ required: true, message: '请选择备件分类', trigger: 'blur' },
|
||
|
],
|
||
|
})
|
||
|
|
||
|
export const Item = useCrudSchemas(reactive<CrudSchema[]>([
|
||
|
{
|
||
|
label: '备件编号',
|
||
|
field: 'number',
|
||
|
sort: 'custom',
|
||
|
isSearch: true,
|
||
|
isForm: false,
|
||
|
table: {
|
||
|
width: 180,
|
||
|
fixed: 'left'
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '备件名称',
|
||
|
field: 'name',
|
||
|
sort: 'custom',
|
||
|
isSearch: true,
|
||
|
table: {
|
||
|
width: 110,
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '规格',
|
||
|
field: 'specifications',
|
||
|
sort: 'custom',
|
||
|
},
|
||
|
{
|
||
|
label: '是否常储',
|
||
|
field: 'isConstant',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
isSearch: false,
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 110,
|
||
|
},
|
||
|
tableForm: {
|
||
|
type: 'Select',
|
||
|
inactiveValue: 'FALSE',
|
||
|
disabled: true
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
label: '科目',
|
||
|
field: 'subject',
|
||
|
sort: 'custom',
|
||
|
dictType: DICT_TYPE.ITEM_SUBJECT,
|
||
|
dictClass: 'string',
|
||
|
isSearch: false,
|
||
|
isTable: true,
|
||
|
tableForm: {
|
||
|
type: 'Select'
|
||
|
}
|
||
|
},
|
||
|
|
||
|
{
|
||
|
label: '科目代码',
|
||
|
field: 'subjectCode',
|
||
|
sort: 'custom',
|
||
|
isTable: true,
|
||
|
},
|
||
|
{
|
||
|
label: '单位',
|
||
|
field: 'uom',
|
||
|
sort: 'custom',
|
||
|
dictType: DICT_TYPE.UOM,
|
||
|
dictClass: 'string',
|
||
|
isSearch: false,
|
||
|
isTable: true,
|
||
|
tableForm: {
|
||
|
type: 'Select'
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
label: '类别',
|
||
|
field: 'category',
|
||
|
sort: 'custom',
|
||
|
dictType: DICT_TYPE.ITEM_CATEGORY,
|
||
|
dictClass: 'string',
|
||
|
isSearch: false,
|
||
|
isTable: true,
|
||
|
tableForm: {
|
||
|
type: 'Select'
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
label: '备件分类',
|
||
|
field: 'classification',
|
||
|
sort: 'custom',
|
||
|
dictType: DICT_TYPE.CLASSIFICATION,
|
||
|
dictClass: 'string',
|
||
|
isSearch: false,
|
||
|
isTable: true,
|
||
|
tableForm: {
|
||
|
type: 'Select'
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
label: '区域',
|
||
|
field: 'region',
|
||
|
sort: 'custom',
|
||
|
dictType: DICT_TYPE.ITEM_REGION,
|
||
|
dictClass: 'string',
|
||
|
isSearch: false,
|
||
|
isTable: true,
|
||
|
tableForm: {
|
||
|
type: 'Select'
|
||
|
}
|
||
|
},
|
||
|
// {
|
||
|
// label: '单价',
|
||
|
// field: 'singlePrice',
|
||
|
// sort: 'custom',
|
||
|
// },
|
||
|
{
|
||
|
label: '重采购点',
|
||
|
field: 'reprocurement',
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 110,
|
||
|
},
|
||
|
form: {
|
||
|
component: 'InputNumber',
|
||
|
value: 0
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '安全库存',
|
||
|
field: 'safetyStock',
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 110,
|
||
|
},
|
||
|
form: {
|
||
|
component: 'InputNumber',
|
||
|
value: 0
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '成本中心',
|
||
|
field: 'cost',
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 110,
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '采购员',
|
||
|
field: 'purchaser',
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 100,
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '财务',
|
||
|
field: 'financer',
|
||
|
sort: 'custom',
|
||
|
},
|
||
|
{
|
||
|
label: '是否以旧换新',
|
||
|
field: 'isRadeIn',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
isSearch: false,
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 140
|
||
|
},
|
||
|
tableForm: {
|
||
|
type: 'Select',
|
||
|
inactiveValue: 'FALSE',
|
||
|
disabled: true
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
label: '是否框架协议',
|
||
|
field: 'isFramework',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
isSearch: false,
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 140
|
||
|
},
|
||
|
tableForm: {
|
||
|
type: 'Select',
|
||
|
inactiveValue: 'FALSE',
|
||
|
disabled: true
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
// {
|
||
|
// label: '是否可用',
|
||
|
// field: 'available',
|
||
|
// dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
// dictClass: 'string',
|
||
|
// isSearch: false,
|
||
|
// isTable: true,
|
||
|
// sort: 'custom',
|
||
|
// table: {
|
||
|
// width: 150
|
||
|
// },
|
||
|
// tableForm: {
|
||
|
// type: 'Select',
|
||
|
// inactiveValue: 'FALSE',
|
||
|
// disabled: true
|
||
|
// },
|
||
|
// form: {
|
||
|
// component: 'Switch',
|
||
|
// value: 'TRUE',
|
||
|
// componentProps: {
|
||
|
// inactiveValue: 'FALSE',
|
||
|
// activeValue: 'TRUE'
|
||
|
// }
|
||
|
// }
|
||
|
// },
|
||
|
{
|
||
|
label: '创建时间',
|
||
|
field: 'createTime',
|
||
|
sort: 'custom',
|
||
|
formatter: dateFormatter,
|
||
|
isForm: false,
|
||
|
table: {
|
||
|
width: 170
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '描述',
|
||
|
field: 'describes',
|
||
|
sort: 'custom',
|
||
|
},
|
||
|
{
|
||
|
label: '操作',
|
||
|
field: 'action',
|
||
|
isForm: false,
|
||
|
table: {
|
||
|
width: 180,
|
||
|
fixed: 'right'
|
||
|
}
|
||
|
}
|
||
|
]))
|
||
|
|
||
|
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',
|
||
|
}
|
||
|
]))
|