From d57fbd74f7d3f6f12436b390e4c6cc89a348c620 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Mon, 25 Nov 2024 14:48:52 +0800 Subject: [PATCH] =?UTF-8?q?YT-1196WMS=20=E6=A0=87=E5=87=86=E6=88=90?= =?UTF-8?q?=E6=9C=AC=E4=BB=B7=E6=A0=BC=E5=8D=95=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=97=B6=EF=BC=8C=E6=8F=90=E7=A4=BA=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=90=8E=EF=BC=8C=E9=A1=B5=E9=9D=A2=E4=B8=80=E7=9B=B4?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=EF=BC=8C=E4=B8=8D=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../itemManage/stdcostprice/index.vue | 57 ++++++++++--------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/src/views/wms/basicDataManage/itemManage/stdcostprice/index.vue b/src/views/wms/basicDataManage/itemManage/stdcostprice/index.vue index d00607fb4..d1035afbe 100644 --- a/src/views/wms/basicDataManage/itemManage/stdcostprice/index.vue +++ b/src/views/wms/basicDataManage/itemManage/stdcostprice/index.vue @@ -206,33 +206,38 @@ const openForm = (type: string, row?: any) => { } // form表单提交 -const formsSuccess = async (formType,data) => { - var isHave =Stdcostprice.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; - basicFormRef.value.formLoading = true - if (formType === 'create') { - await StdcostpriceApi.createStdcostprice(data) - message.success(t('common.createSuccess')) - } else { - await StdcostpriceApi.updateStdcostprice(data) - message.success(t('common.updateSuccess')) - } - basicFormRef.value.dialogVisible = false - basicFormRef.value.formLoading = false - if (formType === 'create') { - getList() - }else{ - buttonBaseClick('refresh',null) +const formsSuccess = async (formType, data) => { + try{ + var isHave =Stdcostprice.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; + basicFormRef.value.formLoading = true + if (formType === 'create') { + await StdcostpriceApi.createStdcostprice(data) + message.success(t('common.createSuccess')) + } else { + await StdcostpriceApi.updateStdcostprice(data) + message.success(t('common.updateSuccess')) + } + basicFormRef.value.dialogVisible = false + basicFormRef.value.formLoading = false + if (formType === 'create') { + getList() + }else{ + buttonBaseClick('refresh',null) + } + } catch { + basicFormRef.value.formLoading = false + + } } // 查询页面返回