diff --git a/src/views/wms/basicDataManage/factoryModeling/enterprise/index.vue b/src/views/wms/basicDataManage/factoryModeling/enterprise/index.vue index 5018cca59..fc7f838a7 100644 --- a/src/views/wms/basicDataManage/factoryModeling/enterprise/index.vue +++ b/src/views/wms/basicDataManage/factoryModeling/enterprise/index.vue @@ -40,7 +40,7 @@ { basicFormRef.value.open(type, row) } +// form表单提交 +const formsSuccess = async (formType,data) => { + console.log(data); + + var isHave =Enterprise.allSchemas.formSchema.some(function (item) { + return item.field === 'activeTime' || item.field === 'expireTime'; + }); + if(isHave){ + if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ + message.error('失效时间要大于生效时间') + return; + } + } + if(data.activeTime==0)data.activeTime = null; + if(data.expireTime==0)data.expireTime = null; + if (formType === 'create') { + await EnterpriseApi.createEnterprise(data) + message.success(t('common.createSuccess')) + } else { + await EnterpriseApi.updateEnterprise(data) + message.success(t('common.updateSuccess')) + } + basicFormRef.value.dialogVisible = false + getList() +} + /** 详情操作 */ const detailRef = ref() const openDetail = (row: any, titleName: any, titleValue: any) => {