From 5731f0d1b8472764bba1a8599e56ad8db7d64a88 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Mon, 13 Nov 2023 11:32:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AFbug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BasicForm/src/BasicForm.vue | 10 ++++++++++ .../wms/basicDataManage/itemManage/itembasic/index.vue | 3 +-- .../itemManage/itembasic/itembasic.data.ts | 6 ++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 26def832d..9eca2f7ae 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -238,6 +238,16 @@ const submitForm = async () => { // data.masterId = props.masterParmas.masterId // data.number = props.masterParmas.number // } + console.log(props.formAllSchemas.formSchema) + var isHave = props.formAllSchemas.formSchema.some(function (item) { + return item.field === 'activeTime' || item.field === 'expireTime'; + }); + if(isHave){ + if(data.activeTime >=data.expireTime){ + message.error('失效时间要大于生效时间') + return; + } + } if (formType.value === 'create') { await props.apiCreate(data) message.success(t('common.createSuccess')) diff --git a/src/views/wms/basicDataManage/itemManage/itembasic/index.vue b/src/views/wms/basicDataManage/itemManage/itembasic/index.vue index 957ed549a..16ec0bd8c 100644 --- a/src/views/wms/basicDataManage/itemManage/itembasic/index.vue +++ b/src/views/wms/basicDataManage/itemManage/itembasic/index.vue @@ -62,11 +62,10 @@ import { Itembasic, rules } from './itembasic.data' import * as defaultButtons from '@/utils/disposition/defaultButtons' import { ItemBasicTabsList } from '@/utils/disposition/tabsList' defineOptions({ name: 'Itembasic' }) - const { tableObject, tableMethods } = useTable({ getListApi: ItembasicApi.getItembasicPage // 分页接口 }) - +console.log(tableObject) const importFormRef = ref() // 列表头部按钮 const HeadButttondata = [ diff --git a/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts b/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts index 7b35f53ec..d9d207741 100644 --- a/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts +++ b/src/views/wms/basicDataManage/itemManage/itembasic/itembasic.data.ts @@ -419,7 +419,8 @@ export const Itembasic = useCrudSchemas(reactive([ // 表单校验 export const rules = reactive({ code: [ - { required: true, message: '请输入代码', trigger: 'blur' } + { required: true, message: '请输入代码', trigger: 'blur' }, + { max: 30, message: '不得超过30个字符', trigger: 'blur' }, ], name: [ { required: true, message: '请输入名称', trigger: 'blur' } @@ -487,4 +488,5 @@ export const rules = reactive({ expireTime: [ { required: true, message: '请输入失效时间', trigger: 'change' } ], -}) \ No newline at end of file +}) +console.log(Itembasic) \ No newline at end of file