|
@ -1,6 +1,13 @@ |
|
|
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 * as ConfigApi from '@/api/infra/config' |
|
|
|
|
|
const autoCodeSwitch = await ConfigApi.getConfigKey('sparePartCodeAutoSwitch') |
|
|
|
|
|
const autoSwitch = ref(false) |
|
|
|
|
|
if (autoCodeSwitch == 'TRUE') { |
|
|
|
|
|
autoSwitch.value = true |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 表单校验
|
|
|
// 表单校验
|
|
|
export const SparePartRules = reactive({ |
|
|
export const SparePartRules = reactive({ |
|
|
code: [required], |
|
|
code: [required], |
|
@ -21,10 +28,10 @@ export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
isDetail:false, |
|
|
isDetail:false, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '编号', |
|
|
label: '备件编号', |
|
|
field: 'code', |
|
|
field: 'code', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isForm: false, |
|
|
isForm: !autoSwitch.value, |
|
|
isSearch: true, |
|
|
isSearch: true, |
|
|
fixed: 'left' |
|
|
fixed: 'left' |
|
|
}, |
|
|
}, |
|
|