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