From 0a595eebd95b32231491bb5617949a7c6d3fefb3 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Wed, 10 Apr 2024 11:02:39 +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/aql/index.ts | 4 ++++ src/views/qms/aql/aql.data.ts | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/api/qms/aql/index.ts b/src/api/qms/aql/index.ts index e8726a613..dda72b699 100644 --- a/src/api/qms/aql/index.ts +++ b/src/api/qms/aql/index.ts @@ -101,3 +101,7 @@ export const exportAql = async (params) => { export const importTemplate = () => { return request.download({ url: '/qms/aql/get-import-template' }) } + +export const getSamplingScheme = async () => { + return await request.get({ url: `/qms/sampling-scheme/get-available-list`}) +} diff --git a/src/views/qms/aql/aql.data.ts b/src/views/qms/aql/aql.data.ts index f91dc68e6..f3dc3fe56 100644 --- a/src/views/qms/aql/aql.data.ts +++ b/src/views/qms/aql/aql.data.ts @@ -1,5 +1,6 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' +import {getSamplingScheme} from "@/api/qms/aql"; // 表单校验 export const AqlRules = reactive({ @@ -9,7 +10,7 @@ export const AqlRules = reactive({ sampleSize: [required], // available: [required], }) - +const samplingSchemeList = await getSamplingScheme() export const Aql = useCrudSchemas(reactive([ { label: 'id', @@ -23,6 +24,16 @@ export const Aql = useCrudSchemas(reactive([ field: 'code', sort: 'custom', isSearch: true, + form: { + component: 'Select', + componentProps: { + options: samplingSchemeList, + optionsAlias: { + labelField: 'description', + valueField: 'code' + }, + } + }, table: { width: 175, fixed: 'left' @@ -36,7 +47,7 @@ export const Aql = useCrudSchemas(reactive([ dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: true, form: { - component: 'SelectV2' + component: 'Select' }, table: { width: 130