From 14a5d8ed3fc2835d5d8f275c20793a9709c054ac Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Wed, 10 Apr 2024 17:28:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/qms/aql/index.vue | 1 - src/views/qms/sampleCode/index.vue | 10 +++++++++- src/views/qms/sampleCode/sampleCode.data.ts | 17 +++++------------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/views/qms/aql/index.vue b/src/views/qms/aql/index.vue index 76a3e5a65..378d5b12c 100644 --- a/src/views/qms/aql/index.vue +++ b/src/views/qms/aql/index.vue @@ -243,7 +243,6 @@ const onChange = async (field, value, formRef) => { const suffix = field.slice(1); // 构建对应的 "r" 字段名 const correspondingField = field.startsWith("a") ? "r" + suffix : "a" + suffix ; -console.log(correspondingField) // 如果有值,则更新对应的 "r" 字段 if (value) { // 查找并更新对应 "r" 字段的值和属性 diff --git a/src/views/qms/sampleCode/index.vue b/src/views/qms/sampleCode/index.vue index 0c31d4587..a3129680c 100644 --- a/src/views/qms/sampleCode/index.vue +++ b/src/views/qms/sampleCode/index.vue @@ -48,6 +48,7 @@ :apiCreate="SampleCodeApi.createSampleCode" @searchTableSuccess="searchTableSuccess" :isBusiness="false" + @onChange="onChange" /> @@ -65,6 +66,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import Detail from '@/components/Detail/src/Detail.vue' +import {connection} from "@antv/x6/es/registry/attr/connection"; defineOptions({ name: 'SampleCode' }) @@ -234,7 +236,13 @@ const searchFormClick = (searchData) => { } getList() // 刷新当前列表 } - +const onChange = async (field, value, formRef) => { + var upperLimit = formRef.value.formModel.batchUpperLimiting + var lowLimit = formRef.value.formModel.batchLowLimiting + if(parseInt(upperLimit) <= parseInt(lowLimit)){ + message.warning("批量上限须大于批量下限") + } +} /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/qms/sampleCode/sampleCode.data.ts b/src/views/qms/sampleCode/sampleCode.data.ts index eeefd1c1b..cfdc96795 100644 --- a/src/views/qms/sampleCode/sampleCode.data.ts +++ b/src/views/qms/sampleCode/sampleCode.data.ts @@ -1,12 +1,15 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' import {getSamplingScheme} from '@/api/qms/sampleCode/index' +import {validateNum} from "@/utils/validator"; // 表单校验 export const SampleCodeRules = reactive({ code: [required], - batchUpperLimiting: [required], - // available: [required], + batchLowLimiting: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}], + batchUpperLimiting: [ + { required:true, message: '该项为必填', trigger: 'blur'}, + { validator:validateNum, message: '请输入整数', trigger: 'blur'}], }) const samplingSchemeList = await getSamplingScheme() export const SampleCode = useCrudSchemas(reactive([ @@ -92,16 +95,6 @@ export const SampleCode = useCrudSchemas(reactive([ field: 'g3', sort: 'custom', }, - // { - // label: '是否可用', - // field: 'available', - // sort: 'custom', - // dictType: DICT_TYPE.TRUE_FALSE, - // dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - // form: { - // component: 'Select' - // }, - // }, { label: '创建时间', field: 'createTime',