|
|
@ -1,17 +1,47 @@ |
|
|
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
|
import { selectAllFactoryArea } from '@/api/system/dept' |
|
|
|
import { validateHanset,validateNumDot, validateEmail } from '@/utils/validator' |
|
|
|
const factoryList = await selectAllFactoryArea() |
|
|
|
// 表单校验
|
|
|
|
export const DeviceAccountsRules = reactive({ |
|
|
|
// number: [required],
|
|
|
|
name: [required], |
|
|
|
// factoryAreaNumber: [required],
|
|
|
|
// purchaseTime: [required],
|
|
|
|
// deptId: [required],
|
|
|
|
// purchaser: [required],
|
|
|
|
// supplierNumber: [required],
|
|
|
|
concurrencyStamp: [required] |
|
|
|
name: [ |
|
|
|
required, |
|
|
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
specification: [ |
|
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
type: [ |
|
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
status: [ |
|
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
power: [ |
|
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
|
{ validator:validateNumDot, message: '请输入数字格式', trigger: 'blur'} |
|
|
|
], |
|
|
|
describes: [ |
|
|
|
{ max: 600, message: '不得超过600个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
factoryAreaNumber: [ |
|
|
|
required, |
|
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
purchaseDept: [ |
|
|
|
{ max: 100, message: '不得超过100个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
purchaser: [ |
|
|
|
{ max: 300, message: '不得超过300个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
supplierNumber: [ |
|
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
purchasePrice: [ |
|
|
|
{ max: 20, message: '不得超过20个字符', trigger: 'blur' }, |
|
|
|
{ validator:validateNumDot, message: '请输入数字格式', trigger: 'blur'} |
|
|
|
], |
|
|
|
}) |
|
|
|
|
|
|
|
export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
@ -201,21 +231,6 @@ export const DeviceAccounts = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '创建时间', |
|
|
|
field: 'createTime', |
|
|
|
sort: 'custom', |
|
|
|
formatter: dateFormatter, |
|
|
|
isForm: false |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
label: '是否可用', |
|
|
|
field: 'available', |
|
|
|
sort: 'custom', |
|
|
|
dictType: DICT_TYPE.TRUE_FALSE, |
|
|
|
dictClass: 'string', |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
label: '维修状态', |
|
|
|