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