|
@ -1,69 +1,74 @@ |
|
|
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 { getSamplingScheme } from "@/api/qms/aql"; |
|
|
import { getSamplingScheme } from '@/api/qms/aql' |
|
|
import {validateNum, validateSampleCode} from "@/utils/validator"; |
|
|
import { validateNum, validateSampleCode } from '@/utils/validator' |
|
|
|
|
|
|
|
|
// 表单校验
|
|
|
// 表单校验
|
|
|
export const AqlRules = reactive({ |
|
|
export const AqlRules = reactive({ |
|
|
code: [required], |
|
|
code: [required], |
|
|
inspectionQualification: [required], |
|
|
inspectionQualification: [required], |
|
|
sampleCharacterCode: [required, {max: 1, message: '长度不得超过1个字符', trigger: 'blur' }, {validator: validateSampleCode, message: '请输入1个大写字母', trigger: 'blur' }], |
|
|
sampleCharacterCode: [ |
|
|
sampleQty: [required,{ validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
required, |
|
|
a0separator010: [required,{ validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
{ max: 1, message: '长度不得超过1个字符', trigger: 'blur' }, |
|
|
r0separator010: [required,{ validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
{ validator: validateSampleCode, message: '请输入1个大写字母', trigger: 'blur' } |
|
|
a0separator015: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
], |
|
|
r0separator015: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
sampleQty: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator025: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator010: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator025: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator010: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator040: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator015: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator040: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator015: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator065: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator025: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator065: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator025: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator10: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator040: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator10: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator040: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator15: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator065: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator15: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator065: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator25: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator10: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator25: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator10: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator40: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator15: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator40: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator15: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator65: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator25: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator65: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator25: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a1separator0: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator40: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r1separator0: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator40: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a1separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a0separator65: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r1separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r0separator65: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a2separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a1separator0: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r2separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r1separator0: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a4separator0: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a1separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r4separator0: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r1separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a6separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a2separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r6separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r2separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a10: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a4separator0: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r10: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r4separator0: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a15: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a6separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r15: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r6separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a25: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a10: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r25: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r10: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a40: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a15: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r40: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r15: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a65: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a25: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r65: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r25: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a100: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a40: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r100: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r40: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a150: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a65: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r150: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r65: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a250: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a100: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r250: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r100: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a400: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a150: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r400: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r150: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a650: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a250: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r650: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r250: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a1000: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
a400: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r1000: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
r400: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
|
|
|
a650: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
|
|
|
r650: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
|
|
|
a1000: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
|
|
|
|
|
r1000: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }] |
|
|
}) |
|
|
}) |
|
|
const samplingSchemeList = await getSamplingScheme() |
|
|
const samplingSchemeList = await getSamplingScheme() |
|
|
export const Aql = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
export const Aql = useCrudSchemas( |
|
|
|
|
|
reactive<CrudSchema[]>([ |
|
|
{ |
|
|
{ |
|
|
label: '采样方案编码', |
|
|
label: '采样方案编码', |
|
|
field: 'code', |
|
|
field: 'code', |
|
@ -76,7 +81,7 @@ export const Aql = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
optionsAlias: { |
|
|
optionsAlias: { |
|
|
labelField: 'description', |
|
|
labelField: 'description', |
|
|
valueField: 'code' |
|
|
valueField: 'code' |
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
table: { |
|
|
table: { |
|
@ -534,50 +539,76 @@ export const Aql = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
{ |
|
|
{ |
|
|
label: '创建时间', |
|
|
label: '创建时间', |
|
|
field: 'createTime', |
|
|
field: 'createTime', |
|
|
sort: 'custom', |
|
|
isForm: false, |
|
|
|
|
|
table: { |
|
|
|
|
|
width: 180 |
|
|
|
|
|
}, |
|
|
formatter: dateFormatter, |
|
|
formatter: dateFormatter, |
|
|
|
|
|
detail: { |
|
|
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|
|
|
|
|
}, |
|
|
|
|
|
form: { |
|
|
|
|
|
component: 'DatePicker', |
|
|
|
|
|
componentProps: { |
|
|
|
|
|
style: { width: '100%' }, |
|
|
|
|
|
type: 'datetime', |
|
|
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|
|
|
|
|
valueFormat: 'x' |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '创建者', |
|
|
|
|
|
field: 'creator', |
|
|
|
|
|
table: { |
|
|
|
|
|
width: 130 |
|
|
|
|
|
}, |
|
|
|
|
|
isForm: false, |
|
|
|
|
|
isTable: true |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '最后更新时间', |
|
|
|
|
|
field: 'updateTime', |
|
|
|
|
|
sort: 'custom', |
|
|
|
|
|
isDetail: true, |
|
|
isForm: false, |
|
|
isForm: false, |
|
|
|
|
|
isTable: false, |
|
|
|
|
|
formatter: dateFormatter, |
|
|
detail: { |
|
|
detail: { |
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|
|
}, |
|
|
}, |
|
|
|
|
|
table: { |
|
|
|
|
|
width: 180 |
|
|
|
|
|
}, |
|
|
form: { |
|
|
form: { |
|
|
component: 'DatePicker', |
|
|
component: 'DatePicker', |
|
|
componentProps: { |
|
|
componentProps: { |
|
|
style: { width: '100%' }, |
|
|
style: { width: '100%' }, |
|
|
type: 'datetime', |
|
|
type: 'datetime', |
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
|
|
valueFormat: 'x', |
|
|
valueFormat: 'x' |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '最后更新者', |
|
|
|
|
|
field: 'updater', |
|
|
|
|
|
isDetail: true, |
|
|
|
|
|
isForm: false, |
|
|
|
|
|
isTable: false, |
|
|
table: { |
|
|
table: { |
|
|
width: 175 |
|
|
width: 150 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// {
|
|
|
|
|
|
// label: '是否可用',
|
|
|
|
|
|
// field: 'available',
|
|
|
|
|
|
// sort: 'custom',
|
|
|
|
|
|
// dictType: DICT_TYPE.TRUE_FALSE,
|
|
|
|
|
|
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
|
|
// form: {
|
|
|
|
|
|
// component: 'Switch',
|
|
|
|
|
|
// value: 'TRUE',
|
|
|
|
|
|
// componentProps: {
|
|
|
|
|
|
// inactiveValue: 'FALSE',
|
|
|
|
|
|
// activeValue: 'TRUE'
|
|
|
|
|
|
// }
|
|
|
|
|
|
// },
|
|
|
|
|
|
// table: {
|
|
|
|
|
|
// width: 110
|
|
|
|
|
|
// }
|
|
|
|
|
|
// },
|
|
|
|
|
|
{ |
|
|
{ |
|
|
label: '操作', |
|
|
label: '操作', |
|
|
field: 'action', |
|
|
field: 'action', |
|
|
isForm: false, |
|
|
isForm: false, |
|
|
|
|
|
isDetail: false, |
|
|
table: { |
|
|
table: { |
|
|
width: 150, |
|
|
width: 150, |
|
|
fixed: 'right' |
|
|
fixed: 'right' |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
])) |
|
|
]) |
|
|
|
|
|
) |
|
|