diff --git a/src/api/qms/sampleCode/index.ts b/src/api/qms/sampleCode/index.ts index 3f8e22f45..374a97e8a 100644 --- a/src/api/qms/sampleCode/index.ts +++ b/src/api/qms/sampleCode/index.ts @@ -55,3 +55,7 @@ export const exportSampleCode = async (params) => { export const importTemplate = () => { return request.download({ url: '/qms/sample-code/get-import-template' }) } + +export const getSamplingScheme = async () => { + return await request.get({ url: `/qms/sampling-scheme/get-available-list`}) +} diff --git a/src/views/qms/sampleCode/sampleCode.data.ts b/src/views/qms/sampleCode/sampleCode.data.ts index a17eff756..69876648a 100644 --- a/src/views/qms/sampleCode/sampleCode.data.ts +++ b/src/views/qms/sampleCode/sampleCode.data.ts @@ -1,5 +1,6 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' +import {getSamplingScheme} from '@/api/qms/sampleCode/index' // 表单校验 export const SampleCodeRules = reactive({ @@ -7,7 +8,7 @@ export const SampleCodeRules = reactive({ batchUpperLimiting: [required], available: [required], }) - +const samplingSchemeList = await getSamplingScheme() export const SampleCode = useCrudSchemas(reactive([ { label: 'id', @@ -21,6 +22,16 @@ export const SampleCode = useCrudSchemas(reactive([ field: 'code', sort: 'custom', isSearch: true, + form: { + component: 'Select', + componentProps: { + options: samplingSchemeList, + optionsAlias: { + labelField: 'description', + valueField: 'code' + }, + } + } }, { label: '批量下限', @@ -84,7 +95,7 @@ export const SampleCode = useCrudSchemas(reactive([ dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 form: { - component: 'SelectV2' + component: 'Select' }, }, {