|
|
@ -1,17 +1,34 @@ |
|
|
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
|
import { selectAllFactoryArea } from '@/api/system/dept' |
|
|
|
import * as SupplierApi from '@/api/eam/basic/supplier' |
|
|
|
import { validateHanset,validateNumDot, validateEmail,validateNum } from '@/utils/validator' |
|
|
|
const factoryList = await selectAllFactoryArea() |
|
|
|
const supplierList = await SupplierApi.getSupplierNoPage() |
|
|
|
// 表单校验
|
|
|
|
export const MoldAccountsRules = reactive({ |
|
|
|
// number: [required],
|
|
|
|
name: [required], |
|
|
|
// factoryAreaNumber: [required],
|
|
|
|
// purchaseTime: [required],
|
|
|
|
// deptId: [required],
|
|
|
|
// purchaser: [required],
|
|
|
|
// supplierNumber: [required],
|
|
|
|
concurrencyStamp: [required] |
|
|
|
number: [ |
|
|
|
required, |
|
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
name: [ |
|
|
|
required, |
|
|
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
factoryAreaNumber: [required], |
|
|
|
purchaseDept: [ |
|
|
|
{ max: 100, message: '不得超过100个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
purchaser: [ |
|
|
|
{ max: 60, message: '不得超过60个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
purchasePrice: [ |
|
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
|
{ validator:validateNumDot, message: '请输入数字格式', trigger: 'blur'} |
|
|
|
], |
|
|
|
beat:[ |
|
|
|
{ validator:validateNum, message: '请输入数字格式', trigger: 'blur'} |
|
|
|
] |
|
|
|
}) |
|
|
|
|
|
|
|
export const MoldAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
@ -38,8 +55,19 @@ export const MoldAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
field: 'type', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: false, |
|
|
|
isForm: true, |
|
|
|
isTable: true, |
|
|
|
dictType: DICT_TYPE.DEVICE_MOLD_TYPE, |
|
|
|
dictClass: 'string', |
|
|
|
form: { |
|
|
|
component: 'Select' |
|
|
|
value: 'MOLD', |
|
|
|
component: 'Select', |
|
|
|
componentProps: { |
|
|
|
disabled: true, |
|
|
|
} |
|
|
|
}, |
|
|
|
search: { |
|
|
|
value: 'MOLD' |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
@ -114,9 +142,23 @@ export const MoldAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '供应商编号', |
|
|
|
label: '供应商', |
|
|
|
field: 'supplierNumber', |
|
|
|
sort: 'custom' |
|
|
|
sort: 'custom', |
|
|
|
table:{ |
|
|
|
width:150 |
|
|
|
}, |
|
|
|
form:{ |
|
|
|
component: 'Select', |
|
|
|
componentProps: { |
|
|
|
options: supplierList, |
|
|
|
optionsAlias: { |
|
|
|
labelField: 'name', |
|
|
|
valueField: 'number' |
|
|
|
}, |
|
|
|
placeholder: "请选择供应商" |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '出厂日期', |
|
|
@ -146,15 +188,6 @@ export const MoldAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
dictType: DICT_TYPE.TRUE_FALSE, |
|
|
|
dictClass: 'string', |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '生产次数', |
|
|
|
field: 'frequency', |
|
|
|
sort: 'custom', |
|
|
|
isForm: false, |
|
|
|
form: { |
|
|
|
component: 'InputNumber', |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '节拍', |
|
|
|
field: 'beat', |
|
|
@ -164,22 +197,6 @@ export const MoldAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
component: 'Input', |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '创建时间', |
|
|
|
field: 'createTime', |
|
|
|
sort: 'custom', |
|
|
|
formatter: dateFormatter, |
|
|
|
isForm: false |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
label: '是否可用', |
|
|
|
field: 'available', |
|
|
|
sort: 'custom', |
|
|
|
dictType: DICT_TYPE.TRUE_FALSE, |
|
|
|
dictClass: 'string', |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
label: '维修状态', |
|
|
|
field: 'status', |
|
|
|