|
|
@ -1,6 +1,13 @@ |
|
|
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|
|
|
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({ |
|
|
|
code: [required], |
|
|
@ -21,10 +28,10 @@ export const SparePart = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
isDetail:false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '编号', |
|
|
|
label: '备件编号', |
|
|
|
field: 'code', |
|
|
|
sort: 'custom', |
|
|
|
isForm: false, |
|
|
|
isForm: !autoSwitch.value, |
|
|
|
isSearch: true, |
|
|
|
fixed: 'left' |
|
|
|
}, |
|
|
|