From f6311716b0c2035bcd21c3acdc68691843e46ea0 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Tue, 9 Apr 2024 18:05:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qms/sampleCode/index.ts | 4 ++++ src/views/qms/sampleCode/sampleCode.data.ts | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) 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' }, }, {