添砖-JAVA\Administrator
5 months ago
14 changed files with 2542 additions and 1822 deletions
File diff suppressed because it is too large
@ -1,145 +1,193 @@ |
|||||
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/sampleCode/index' |
import { getSamplingScheme } from '@/api/qms/sampleCode/index' |
||||
import {validateNum} from "@/utils/validator"; |
import { validateNum } from '@/utils/validator' |
||||
|
|
||||
// 表单校验
|
// 表单校验
|
||||
export const SampleCodeRules = reactive({ |
export const SampleCodeRules = reactive({ |
||||
code: [required], |
code: [required], |
||||
batchLowLimiting: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}], |
batchLowLimiting: [{ validator: validateNum, message: '请输入整数', trigger: 'blur' }], |
||||
batchUpperLimiting: [{ required:true, message: '该项为必填', trigger: 'blur'}, { validator:validateNum, message: '请输入整数', trigger: 'blur'}], |
batchUpperLimiting: [ |
||||
s1: [ required ], |
{ required: true, message: '该项为必填', trigger: 'blur' }, |
||||
s2: [required ], |
{ validator: validateNum, message: '请输入整数', trigger: 'blur' } |
||||
s3: [ required ], |
], |
||||
s4: [ required ], |
s1: [required], |
||||
g1: [ required ], |
s2: [required], |
||||
g2: [ required ], |
s3: [required], |
||||
g3: [ required ] |
s4: [required], |
||||
|
g1: [required], |
||||
|
g2: [required], |
||||
|
g3: [required] |
||||
}) |
}) |
||||
const samplingSchemeList = await getSamplingScheme() |
const samplingSchemeList = await getSamplingScheme() |
||||
export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([ |
export const SampleCode = useCrudSchemas( |
||||
{ |
reactive<CrudSchema[]>([ |
||||
label: '采样方案编码', |
{ |
||||
field: 'code', |
label: '采样方案编码', |
||||
sort: 'custom', |
field: 'code', |
||||
isSearch: true, |
sort: 'custom', |
||||
form: { |
isSearch: true, |
||||
component: 'Select', |
form: { |
||||
componentProps: { |
component: 'Select', |
||||
options: samplingSchemeList, |
componentProps: { |
||||
optionsAlias: { |
options: samplingSchemeList, |
||||
labelField: 'code', |
optionsAlias: { |
||||
valueField: 'code' |
labelField: 'code', |
||||
}, |
valueField: 'code' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
table: { |
||||
|
width: 175, |
||||
|
fixed: 'left' |
||||
} |
} |
||||
}, |
}, |
||||
table: { |
{ |
||||
width: 175, |
label: '批量下限', |
||||
fixed: 'left' |
field: 'batchLowLimiting', |
||||
} |
sort: 'custom', |
||||
}, |
isSearch: true, |
||||
{ |
form: { |
||||
label: '批量下限', |
component: 'InputNumber', |
||||
field: 'batchLowLimiting', |
value: 0 |
||||
sort: 'custom', |
} |
||||
isSearch: true, |
}, |
||||
form: { |
{ |
||||
component: 'InputNumber', |
label: '批量上限', |
||||
value: 0 |
field: 'batchUpperLimiting', |
||||
|
sort: 'custom', |
||||
|
isSearch: true, |
||||
|
form: { |
||||
|
component: 'InputNumber', |
||||
|
value: 0 |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: 's1', |
||||
|
field: 's1', |
||||
|
sort: 'custom' |
||||
|
}, |
||||
|
{ |
||||
|
label: 's2', |
||||
|
field: 's2', |
||||
|
sort: 'custom' |
||||
|
}, |
||||
|
{ |
||||
|
label: 's3', |
||||
|
field: 's3', |
||||
|
sort: 'custom' |
||||
|
}, |
||||
|
{ |
||||
|
label: 's4', |
||||
|
field: 's4', |
||||
|
sort: 'custom' |
||||
|
}, |
||||
|
{ |
||||
|
label: 'g1', |
||||
|
field: 'g1', |
||||
|
sort: 'custom' |
||||
}, |
}, |
||||
}, |
{ |
||||
{ |
label: 'g2', |
||||
label: '批量上限', |
field: 'g2', |
||||
field: 'batchUpperLimiting', |
sort: 'custom' |
||||
sort: 'custom', |
|
||||
isSearch: true, |
|
||||
form: { |
|
||||
component: 'InputNumber', |
|
||||
value: 0 |
|
||||
}, |
}, |
||||
}, |
{ |
||||
{ |
label: 'g3', |
||||
label: 's1', |
field: 'g3', |
||||
field: 's1', |
sort: 'custom' |
||||
sort: 'custom', |
|
||||
}, |
|
||||
{ |
|
||||
label: 's2', |
|
||||
field: 's2', |
|
||||
sort: 'custom', |
|
||||
}, |
|
||||
{ |
|
||||
label: 's3', |
|
||||
field: 's3', |
|
||||
sort: 'custom', |
|
||||
}, |
|
||||
{ |
|
||||
label: 's4', |
|
||||
field: 's4', |
|
||||
sort: 'custom', |
|
||||
}, |
|
||||
{ |
|
||||
label: 'g1', |
|
||||
field: 'g1', |
|
||||
sort: 'custom', |
|
||||
}, |
|
||||
{ |
|
||||
label: 'g2', |
|
||||
field: 'g2', |
|
||||
sort: 'custom', |
|
||||
}, |
|
||||
{ |
|
||||
label: 'g3', |
|
||||
field: 'g3', |
|
||||
sort: 'custom', |
|
||||
}, |
|
||||
{ |
|
||||
label: '创建时间', |
|
||||
field: 'createTime', |
|
||||
sort: 'custom', |
|
||||
formatter: dateFormatter, |
|
||||
isForm: false, |
|
||||
detail: { |
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
|
||||
}, |
}, |
||||
form: { |
{ |
||||
component: 'DatePicker', |
label: '是否可用', |
||||
componentProps: { |
field: 'available', |
||||
style: {width: '100%'}, |
sort: 'custom', |
||||
type: 'datetime', |
dictType: DICT_TYPE.TRUE_FALSE, |
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
||||
valueFormat: 'x', |
form: { |
||||
|
component: 'Switch', |
||||
|
value: 'TRUE', |
||||
|
componentProps: { |
||||
|
inactiveValue: 'FALSE', |
||||
|
activeValue: 'TRUE' |
||||
|
} |
||||
|
}, |
||||
|
table: { |
||||
|
width: 110 |
||||
} |
} |
||||
}, |
}, |
||||
table: { |
{ |
||||
width: 175 |
label: '创建时间', |
||||
} |
field: 'createTime', |
||||
}, |
isForm: false, |
||||
{ |
table: { |
||||
label: '是否可用', |
width: 180 |
||||
field: 'available', |
}, |
||||
sort: 'custom', |
formatter: dateFormatter, |
||||
dictType: DICT_TYPE.TRUE_FALSE, |
detail: { |
||||
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
form: { |
}, |
||||
component: 'Switch', |
form: { |
||||
value: 'TRUE', |
component: 'DatePicker', |
||||
componentProps: { |
componentProps: { |
||||
inactiveValue: 'FALSE', |
style: { width: '100%' }, |
||||
activeValue: 'TRUE' |
type: 'datetime', |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
||||
|
valueFormat: 'x' |
||||
|
} |
||||
} |
} |
||||
}, |
}, |
||||
table: { |
{ |
||||
width: 110 |
label: '创建者', |
||||
} |
field: 'creator', |
||||
}, |
table: { |
||||
{ |
width: 130 |
||||
label: '操作', |
}, |
||||
field: 'action', |
isForm: false, |
||||
isForm: false, |
isTable: true |
||||
table: { |
}, |
||||
width: 150, |
{ |
||||
fixed: 'right' |
label: '最后更新时间', |
||||
|
field: 'updateTime', |
||||
|
sort: 'custom', |
||||
|
isDetail: true, |
||||
|
isForm: false, |
||||
|
isTable: false, |
||||
|
formatter: dateFormatter, |
||||
|
detail: { |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
|
}, |
||||
|
table: { |
||||
|
width: 180 |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'DatePicker', |
||||
|
componentProps: { |
||||
|
style: { width: '100%' }, |
||||
|
type: 'datetime', |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
||||
|
valueFormat: 'x' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '最后更新者', |
||||
|
field: 'updater', |
||||
|
isDetail: true, |
||||
|
isForm: false, |
||||
|
isTable: false, |
||||
|
table: { |
||||
|
width: 150 |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '操作', |
||||
|
field: 'action', |
||||
|
isForm: false, |
||||
|
isDetail: false, |
||||
|
table: { |
||||
|
width: 150, |
||||
|
fixed: 'right' |
||||
|
} |
||||
} |
} |
||||
} |
]) |
||||
])) |
) |
||||
|
@ -1,118 +1,173 @@ |
|||||
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/samplingProcess"; |
import { getSamplingScheme } from '@/api/qms/samplingProcess' |
||||
import { validateInteger ,validateTwoNum} from '@/utils/validator' |
import { validateInteger, validateTwoNum } from '@/utils/validator' |
||||
|
|
||||
// 表单校验
|
// 表单校验
|
||||
export const SamplingProcessRules = reactive({ |
export const SamplingProcessRules = reactive({ |
||||
sampleType: [required], |
sampleType: [required], |
||||
evaluationMode: [required], |
evaluationMode: [required], |
||||
description: [required], |
description: [required], |
||||
sampleQty:[{ required: true, message: '该项为必填项', trigger: 'blur' },{validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}], |
sampleQty: [ |
||||
sampleProgCode:[{ required: true, message: '该项为必填项', trigger: 'blur' }], |
{ required: true, message: '该项为必填项', trigger: 'blur' }, |
||||
inspectionQty: [required, {validator:validateInteger, message: '请输入正确的整数', trigger: 'blur'}] |
{ validator: validateTwoNum, message: '小数点后最多2位', trigger: 'blur' } |
||||
|
], |
||||
|
sampleProgCode: [{ required: true, message: '该项为必填项', trigger: 'blur' }], |
||||
|
inspectionQty: [ |
||||
|
required, |
||||
|
{ validator: validateInteger, message: '请输入正确的整数', trigger: 'blur' } |
||||
|
] |
||||
}) |
}) |
||||
const samplingSchemeList = await getSamplingScheme() |
const samplingSchemeList = await getSamplingScheme() |
||||
export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([ |
export const SamplingProcess = useCrudSchemas( |
||||
{ |
reactive<CrudSchema[]>([ |
||||
label: '编码', |
{ |
||||
field: 'code', |
label: '编码', |
||||
sort: 'custom', |
field: 'code', |
||||
isSearch: true, |
sort: 'custom', |
||||
isForm: false, |
isSearch: true, |
||||
table: { |
isForm: false, |
||||
width: 175, |
table: { |
||||
fixed: 'left' |
width: 175, |
||||
} |
fixed: 'left' |
||||
}, |
|
||||
{ |
|
||||
label: '描述', |
|
||||
field: 'description', |
|
||||
sort: 'custom', |
|
||||
isSearch: true |
|
||||
}, |
|
||||
{ |
|
||||
label: '取样类型', |
|
||||
field: 'sampleType', |
|
||||
sort: 'custom', |
|
||||
dictType: DICT_TYPE.SAMPLING_TYPE, |
|
||||
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
||||
isSearch: true, |
|
||||
form: { |
|
||||
component: 'Select' |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
label: '评估模式', |
|
||||
field: 'evaluationMode', |
|
||||
sort: 'custom', |
|
||||
dictType: DICT_TYPE.EVALUATION_MODE, |
|
||||
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
||||
form: { |
|
||||
component: 'Select' |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
label: '样品份数', |
|
||||
field: 'sampleQty', |
|
||||
sort: 'custom' |
|
||||
}, |
|
||||
{ |
|
||||
label: '采样方案编码', |
|
||||
field: 'sampleProgCode', |
|
||||
sort: 'custom', |
|
||||
form: { |
|
||||
component: 'Select', |
|
||||
componentProps: { |
|
||||
options: samplingSchemeList, |
|
||||
optionsAlias: { |
|
||||
labelField: 'description', |
|
||||
valueField: 'code' |
|
||||
}, |
|
||||
} |
} |
||||
} |
}, |
||||
}, |
{ |
||||
{ |
label: '描述', |
||||
label: '创建时间', |
field: 'description', |
||||
field: 'createTime', |
sort: 'custom', |
||||
sort: 'custom', |
isSearch: true |
||||
formatter: dateFormatter, |
}, |
||||
isForm: false, |
{ |
||||
detail: { |
label: '取样类型', |
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
field: 'sampleType', |
||||
}, |
sort: 'custom', |
||||
form: { |
dictType: DICT_TYPE.SAMPLING_TYPE, |
||||
component: 'DatePicker', |
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
||||
componentProps: { |
isSearch: true, |
||||
style: {width: '100%'}, |
form: { |
||||
type: 'datetime', |
component: 'Select' |
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
} |
||||
valueFormat: 'x', |
}, |
||||
} |
{ |
||||
} |
label: '评估模式', |
||||
}, |
field: 'evaluationMode', |
||||
{ |
sort: 'custom', |
||||
label: '是否可用', |
dictType: DICT_TYPE.EVALUATION_MODE, |
||||
field: 'available', |
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
||||
sort: 'custom', |
form: { |
||||
dictType: DICT_TYPE.TRUE_FALSE, |
component: 'Select' |
||||
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
} |
||||
form: { |
}, |
||||
component: 'Switch', |
{ |
||||
value: 'TRUE', |
label: '样品份数', |
||||
componentProps: { |
field: 'sampleQty', |
||||
inactiveValue: 'FALSE', |
sort: 'custom' |
||||
activeValue: 'TRUE' |
}, |
||||
|
{ |
||||
|
label: '采样方案编码', |
||||
|
field: 'sampleProgCode', |
||||
|
sort: 'custom', |
||||
|
form: { |
||||
|
component: 'Select', |
||||
|
componentProps: { |
||||
|
options: samplingSchemeList, |
||||
|
optionsAlias: { |
||||
|
labelField: 'description', |
||||
|
valueField: 'code' |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
label: '是否可用', |
||||
|
field: 'available', |
||||
|
sort: 'custom', |
||||
|
dictType: DICT_TYPE.TRUE_FALSE, |
||||
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
||||
|
form: { |
||||
|
component: 'Switch', |
||||
|
value: 'TRUE', |
||||
|
componentProps: { |
||||
|
inactiveValue: 'FALSE', |
||||
|
activeValue: 'TRUE' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '创建时间', |
||||
|
field: 'createTime', |
||||
|
isForm: false, |
||||
|
table: { |
||||
|
width: 180 |
||||
|
}, |
||||
|
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, |
||||
|
isTable: false, |
||||
|
formatter: dateFormatter, |
||||
|
detail: { |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss' |
||||
|
}, |
||||
|
table: { |
||||
|
width: 180 |
||||
|
}, |
||||
|
form: { |
||||
|
component: 'DatePicker', |
||||
|
componentProps: { |
||||
|
style: { width: '100%' }, |
||||
|
type: 'datetime', |
||||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss', |
||||
|
valueFormat: 'x' |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '最后更新者', |
||||
|
field: 'updater', |
||||
|
isDetail: true, |
||||
|
isForm: false, |
||||
|
isTable: false, |
||||
|
table: { |
||||
|
width: 150 |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
label: '操作', |
||||
|
field: 'action', |
||||
|
isForm: false, |
||||
|
isDetail: false, |
||||
|
table: { |
||||
|
width: 150, |
||||
|
fixed: 'right' |
||||
} |
} |
||||
} |
} |
||||
}, |
]) |
||||
{ |
) |
||||
label: '操作', |
|
||||
field: 'action', |
|
||||
isForm: false, |
|
||||
table: { |
|
||||
width: 150, |
|
||||
fixed: 'right' |
|
||||
} |
|
||||
} |
|
||||
])) |
|
||||
|
Loading…
Reference in new issue