Browse Source

调试

master_hella_20240701
zhaoyiran 8 months ago
parent
commit
f6311716b0
  1. 4
      src/api/qms/sampleCode/index.ts
  2. 15
      src/views/qms/sampleCode/sampleCode.data.ts

4
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`})
}

15
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<CrudSchema[]>([
{
label: 'id',
@ -21,6 +22,16 @@ export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
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<CrudSchema[]>([
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'SelectV2'
component: 'Select'
},
},
{

Loading…
Cancel
Save