Browse Source

去掉是否可用

master_hella_20240701
zhaoyiran 7 months ago
parent
commit
83d484ae66
  1. 8
      src/api/qms/samplingProcess/index.ts
  2. 14
      src/utils/validator.ts
  3. 22
      src/views/qms/aql/aql.data.ts
  4. 22
      src/views/qms/inspectionMethod/inspectionMethod.data.ts
  5. 22
      src/views/qms/sampleCode/sampleCode.data.ts
  6. 22
      src/views/qms/samplingProcess/samplingProcess.data.ts
  7. 24
      src/views/qms/samplingScheme/samplingScheme.data.ts

8
src/api/qms/samplingProcess/index.ts

@ -1,4 +1,5 @@
import request from '@/config/axios'
import { validatePercent } from '@/utils/validator'
export interface SamplingProcessVO {
id: number
@ -7,10 +8,15 @@ export interface SamplingProcessVO {
sampleType: string
evaluationMode: string
sampleSize: number
sampleProgCode: number
sampleProgCode: String
available: string
}
const rules = ref({
sampleSize:[
{validator:validatePercent,message:'百分比范围 0 ~ 100', trigger:'blur'}
]
})
// 查询采样过程列表
export const getSamplingProcessPage = async (params) => {
if (params.isSearch) {

14
src/utils/validator.ts

@ -748,6 +748,17 @@ export function validateYS(rule, value, callback) {
callback()
}
}
// 校验百分比
export function validatePercent(rule, value, callback){
if (!value) {
return callback(new Error('百分比不能为空'))
} else {
if(value < 0 || value > 100){
return callback(new Error('百分比范围 0 ~ 100'))
}
callback()
}
}
export default {
validateCode,
@ -780,5 +791,6 @@ export default {
validateName,
validateChargeperson,
validateYS,
validateMaxNumber5
validateMaxNumber5,
validatePercent
}

22
src/views/qms/aql/aql.data.ts

@ -7,7 +7,7 @@ export const AqlRules = reactive({
inspectionQualification: [required],
sampleCharacterCode: [required],
sampleSize: [required],
available: [required],
// available: [required],
})
export const Aql = useCrudSchemas(reactive<CrudSchema[]>([
@ -306,16 +306,16 @@ export const Aql = useCrudSchemas(reactive<CrudSchema[]>([
field: 'r1000',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'SelectV2'
},
},
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// form: {
// component: 'SelectV2'
// },
// },
{
label: '创建时间',
field: 'createTime',

22
src/views/qms/inspectionMethod/inspectionMethod.data.ts

@ -3,7 +3,7 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const InspectionMethodRules = reactive({
available: [required],
// available: [required],
description: [required],
})
@ -37,16 +37,16 @@ export const InspectionMethod = useCrudSchemas(reactive<CrudSchema[]>([
field: 'operationGuidance',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'SelectV2'
},
},
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// form: {
// component: 'SelectV2'
// },
// },
{
label: '文件',
field: 'videoAddress',

22
src/views/qms/sampleCode/sampleCode.data.ts

@ -6,7 +6,7 @@ import {getSamplingScheme} from '@/api/qms/sampleCode/index'
export const SampleCodeRules = reactive({
code: [required],
batchUpperLimiting: [required],
available: [required],
// available: [required],
})
const samplingSchemeList = await getSamplingScheme()
export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
@ -88,16 +88,16 @@ export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
field: 'g3',
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Select'
},
},
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// form: {
// component: 'Select'
// },
// },
{
label: '创建时间',
field: 'createTime',

22
src/views/qms/samplingProcess/samplingProcess.data.ts

@ -5,7 +5,7 @@ import { dateFormatter } from '@/utils/formatTime'
export const SamplingProcessRules = reactive({
sampleType: [required],
evaluationMode: [required],
available: [required],
// available: [required],
description: [required],
})
@ -64,16 +64,16 @@ export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([
component: 'Select'
},
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Select'
},
},
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// form: {
// component: 'Select'
// },
// },
{
label: '创建时间',
field: 'createTime',

24
src/views/qms/samplingScheme/samplingScheme.data.ts

@ -3,7 +3,7 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const SamplingSchemeRules = reactive({
available: [required],
// available: [required],
description: [required],
})
@ -28,17 +28,17 @@ export const SamplingScheme = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
isSearch: true,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'SelectV2'
},
},
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: true,
// form: {
// component: 'SelectV2'
// },
// },
{
label: '创建时间',
field: 'createTime',

Loading…
Cancel
Save