From 408e207f2c554731246debbdbe4a6435727d0280 Mon Sep 17 00:00:00 2001 From: songguoqiang <765017469@qq.com> Date: Fri, 19 Apr 2024 07:57:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E7=82=B9=E6=A3=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eam/basic/basciYearEquipment/index.vue | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/views/eam/basic/basciYearEquipment/index.vue b/src/views/eam/basic/basciYearEquipment/index.vue index 1e9aa76..fb1bc9a 100644 --- a/src/views/eam/basic/basciYearEquipment/index.vue +++ b/src/views/eam/basic/basciYearEquipment/index.vue @@ -181,26 +181,29 @@ const openForm = (type: string, row?: any) => { // form表单提交 const formsSuccess = async (formType, data) => { - var isHave = BasciYearEquipment.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 + try { + var isHave = BasciYearEquipment.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 BasciYearEquipmentApi.createBasciYearEquipment(data) - message.success(t('common.createSuccess')) - } else { - await BasciYearEquipmentApi.updateBasciYearEquipment(data) - message.success(t('common.updateSuccess')) - } - basicFormRef.value.dialogVisible = false - getList() + if (data.activeTime == 0) data.activeTime = null + if (data.expireTime == 0) data.expireTime = null + if (formType === 'create') { + await BasciYearEquipmentApi.createBasciYearEquipment(data) + message.success(t('common.createSuccess')) + } else { + await BasciYearEquipmentApi.updateBasciYearEquipment(data) + message.success(t('common.updateSuccess')) + } + basicFormRef.value.dialogVisible = false + getList() + }catch{ + basicFormRef.value.dialogVisible = false} } /** 详情操作 */