From 0d7a290bd1e309727febf28773a89a735c608bbe Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Tue, 30 Jul 2024 18:19:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86--=E6=B7=BB=E5=8A=A0loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agvManage/agvLocationrelation/index.vue | 18 +++++++++++------ .../documentSetting/businesstype/index.vue | 8 +++++++- .../documentSetting/documentsetting/index.vue | 17 ++++++++++------ .../documentSetting/jobsetting/index.vue | 17 ++++++++++------ .../documentSetting/plansetting/index.vue | 19 ++++++++++++------ .../documentSetting/recordsetting/index.vue | 18 +++++++++++------ .../documentSetting/requestsetting/index.vue | 18 +++++++++++------ .../documentSetting/switch/index.vue | 20 +++++++++++++------ .../documentSetting/transactiontype/index.vue | 19 ++++++++++++------ .../labelManage/barcode/index.vue | 18 +++++++++++------ .../labelManage/callmaterials/index.vue | 18 +++++++++++------ .../labelManage/labeltype/index.vue | 17 ++++++++++------ .../labelManage/manufacturePackage/index.vue | 18 +++++++++++------ .../labelManage/purchasePackage/index.vue | 18 +++++++++++------ .../orderManage/carrier/index.vue | 18 +++++++++++------ .../orderManage/owner/index.vue | 19 ++++++++++++------ .../orderManage/shift/index.vue | 18 +++++++++++------ .../basicDataManage/subject/mstr/index.vue | 18 +++++++++++------ .../subject/qadCostcentre/index.vue | 19 ++++++++++++------ .../subject/qadProject/index.vue | 19 ++++++++++++------ .../subject/subjectAccount/index.vue | 19 ++++++++++++------ .../wms/buttMesManage/mesBarCode/index.vue | 19 ++++++++++++------ 22 files changed, 265 insertions(+), 127 deletions(-) diff --git a/src/views/wms/agvManage/agvLocationrelation/index.vue b/src/views/wms/agvManage/agvLocationrelation/index.vue index a6689e231..1a35d6065 100644 --- a/src/views/wms/agvManage/agvLocationrelation/index.vue +++ b/src/views/wms/agvManage/agvLocationrelation/index.vue @@ -188,12 +188,18 @@ const formsSuccess = async (formType,data) => { } if(data.activeTime==0)data.activeTime = null; if(data.expireTime==0)data.expireTime = null; - if (formType === 'create') { - await AgvLocationrelationApi.createAgvLocationrelation(data) - message.success(t('common.createSuccess')) - } else { - await AgvLocationrelationApi.updateAgvLocationrelation(data) - message.success(t('common.updateSuccess')) + + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await AgvLocationrelationApi.createAgvLocationrelation(data) + message.success(t('common.createSuccess')) + } else { + await AgvLocationrelationApi.updateAgvLocationrelation(data) + message.success(t('common.updateSuccess')) + } + } finally { + basicFormRef.value.formLoading = false } basicFormRef.value.dialogVisible = false getList() diff --git a/src/views/wms/basicDataManage/documentSetting/businesstype/index.vue b/src/views/wms/basicDataManage/documentSetting/businesstype/index.vue index faff79448..db22cb30d 100644 --- a/src/views/wms/basicDataManage/documentSetting/businesstype/index.vue +++ b/src/views/wms/basicDataManage/documentSetting/businesstype/index.vue @@ -264,7 +264,7 @@ const formsSuccess = async (formType, submitData) => { data.inInventoryStatuses = data.inInventoryStatuses.join(',') } - + basicFormRef.value.formLoading = true if (formType === 'create') { await BusinesstypeApi.createBusinesstype(data) .then(async () => { @@ -279,6 +279,9 @@ const formsSuccess = async (formType, submitData) => { data.outInventoryStatuses = data.outInventoryStatuses.split(',') data.inInventoryStatuses = data.inInventoryStatuses.split(',') }) + .finally(()=>{ + basicFormRef.value.formLoading = false + }) } else { await BusinesstypeApi.updateBusinesstype(data) .then(async () => { @@ -293,6 +296,9 @@ const formsSuccess = async (formType, submitData) => { data.outInventoryStatuses = data.outInventoryStatuses.split(',') data.inInventoryStatuses = data.inInventoryStatuses.split(',') }) + .finally(()=>{ + basicFormRef.value.formLoading = false + }) } } diff --git a/src/views/wms/basicDataManage/documentSetting/documentsetting/index.vue b/src/views/wms/basicDataManage/documentSetting/documentsetting/index.vue index af47b39ba..7cbb2c584 100644 --- a/src/views/wms/basicDataManage/documentSetting/documentsetting/index.vue +++ b/src/views/wms/basicDataManage/documentSetting/documentsetting/index.vue @@ -163,12 +163,17 @@ const formsSuccess = async (formType,data) => { } if(data.activeTime==0)data.activeTime = null; if(data.expireTime==0)data.expireTime = null; - if (formType === 'create') { - await DocumentsettingApi.createDocumentsetting(data) - message.success(t('common.createSuccess')) - } else { - await DocumentsettingApi.updateDocumentsetting(data) - message.success(t('common.updateSuccess')) + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await DocumentsettingApi.createDocumentsetting(data) + message.success(t('common.createSuccess')) + } else { + await DocumentsettingApi.updateDocumentsetting(data) + message.success(t('common.updateSuccess')) + } + } finally { + basicFormRef.value.formLoading = false } basicFormRef.value.dialogVisible = false getList() diff --git a/src/views/wms/basicDataManage/documentSetting/jobsetting/index.vue b/src/views/wms/basicDataManage/documentSetting/jobsetting/index.vue index 601fabab4..c96f041dc 100644 --- a/src/views/wms/basicDataManage/documentSetting/jobsetting/index.vue +++ b/src/views/wms/basicDataManage/documentSetting/jobsetting/index.vue @@ -163,12 +163,17 @@ const formsSuccess = async (formType,data) => { } if(data.activeTime==0)data.activeTime = null; if(data.expireTime==0)data.expireTime = null; - if (formType === 'create') { - await JobsettingApi.createJobsetting(data) - message.success(t('common.createSuccess')) - } else { - await JobsettingApi.updateJobsetting(data) - message.success(t('common.updateSuccess')) + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await JobsettingApi.createJobsetting(data) + message.success(t('common.createSuccess')) + } else { + await JobsettingApi.updateJobsetting(data) + message.success(t('common.updateSuccess')) + } + } finally { + basicFormRef.value.formLoading = false } basicFormRef.value.dialogVisible = false getList() diff --git a/src/views/wms/basicDataManage/documentSetting/plansetting/index.vue b/src/views/wms/basicDataManage/documentSetting/plansetting/index.vue index a508af8d4..b71de84b7 100644 --- a/src/views/wms/basicDataManage/documentSetting/plansetting/index.vue +++ b/src/views/wms/basicDataManage/documentSetting/plansetting/index.vue @@ -162,12 +162,19 @@ const formsSuccess = async (formType,data) => { } if(data.activeTime==0)data.activeTime = null; if(data.expireTime==0)data.expireTime = null; - if (formType === 'create') { - await PlansettingApi.createPlansetting(data) - message.success(t('common.createSuccess')) - } else { - await PlansettingApi.updatePlansetting(data) - message.success(t('common.updateSuccess')) + + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await PlansettingApi.createPlansetting(data) + message.success(t('common.createSuccess')) + } else { + await PlansettingApi.updatePlansetting(data) + message.success(t('common.updateSuccess')) + } + + } finally { + basicFormRef.value.formLoading = false } basicFormRef.value.dialogVisible = false getList() diff --git a/src/views/wms/basicDataManage/documentSetting/recordsetting/index.vue b/src/views/wms/basicDataManage/documentSetting/recordsetting/index.vue index edd49235f..4b0dac5c4 100644 --- a/src/views/wms/basicDataManage/documentSetting/recordsetting/index.vue +++ b/src/views/wms/basicDataManage/documentSetting/recordsetting/index.vue @@ -163,12 +163,18 @@ const formsSuccess = async (formType,data) => { } if(data.activeTime==0)data.activeTime = null; if(data.expireTime==0)data.expireTime = null; - if (formType === 'create') { - await RecordsettingApi.createRecordsetting(data) - message.success(t('common.createSuccess')) - } else { - await RecordsettingApi.updateRecordsetting(data) - message.success(t('common.updateSuccess')) + + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await RecordsettingApi.createRecordsetting(data) + message.success(t('common.createSuccess')) + } else { + await RecordsettingApi.updateRecordsetting(data) + message.success(t('common.updateSuccess')) + } + } finally { + basicFormRef.value.formLoading = false } basicFormRef.value.dialogVisible = false getList() diff --git a/src/views/wms/basicDataManage/documentSetting/requestsetting/index.vue b/src/views/wms/basicDataManage/documentSetting/requestsetting/index.vue index fd8a1dda5..9cb8b0297 100644 --- a/src/views/wms/basicDataManage/documentSetting/requestsetting/index.vue +++ b/src/views/wms/basicDataManage/documentSetting/requestsetting/index.vue @@ -163,12 +163,18 @@ const formsSuccess = async (formType,data) => { } if(data.activeTime==0)data.activeTime = null; if(data.expireTime==0)data.expireTime = null; - if (formType === 'create') { - await RequestsettingApi.createRequestsetting(data) - message.success(t('common.createSuccess')) - } else { - await RequestsettingApi.updateRequestsetting(data) - message.success(t('common.updateSuccess')) + + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await RequestsettingApi.createRequestsetting(data) + message.success(t('common.createSuccess')) + } else { + await RequestsettingApi.updateRequestsetting(data) + message.success(t('common.updateSuccess')) + } + } finally { + basicFormRef.value.formLoading = false } basicFormRef.value.dialogVisible = false getList() diff --git a/src/views/wms/basicDataManage/documentSetting/switch/index.vue b/src/views/wms/basicDataManage/documentSetting/switch/index.vue index 78c215314..fb0ecead8 100644 --- a/src/views/wms/basicDataManage/documentSetting/switch/index.vue +++ b/src/views/wms/basicDataManage/documentSetting/switch/index.vue @@ -222,13 +222,21 @@ const searchFormClick = (searchData) => { getList() // 刷新当前列表 } const success = async (formType, data) => { - const res = await SwitchApi.updateSwitch(data) - if(true===res){ - message.success(t('common.updateSuccess')) - getList() - }else{ - message.error('修改失败') + basicFormRef.value.formLoading = true + try{ + const res = await SwitchApi.updateSwitch(data) + if(true===res){ + message.success(t('common.updateSuccess')) + getList() + }else{ + message.error('修改失败') + } + } finally { + basicFormRef.value.formLoading = false + basicFormRef.value.dialogVisible = false + } + } /** 初始化 **/ diff --git a/src/views/wms/basicDataManage/documentSetting/transactiontype/index.vue b/src/views/wms/basicDataManage/documentSetting/transactiontype/index.vue index 0e4c0f822..c9c74251a 100644 --- a/src/views/wms/basicDataManage/documentSetting/transactiontype/index.vue +++ b/src/views/wms/basicDataManage/documentSetting/transactiontype/index.vue @@ -163,12 +163,19 @@ const formsSuccess = async (formType,data) => { } if(data.activeTime==0)data.activeTime = null; if(data.expireTime==0)data.expireTime = null; - if (formType === 'create') { - await TransactiontypeApi.createTransactiontype(data) - message.success(t('common.createSuccess')) - } else { - await TransactiontypeApi.updateTransactiontype(data) - message.success(t('common.updateSuccess')) + + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await TransactiontypeApi.createTransactiontype(data) + message.success(t('common.createSuccess')) + } else { + await TransactiontypeApi.updateTransactiontype(data) + message.success(t('common.updateSuccess')) + } + + } finally { + basicFormRef.value.formLoading = false } basicFormRef.value.dialogVisible = false getList() diff --git a/src/views/wms/basicDataManage/labelManage/barcode/index.vue b/src/views/wms/basicDataManage/labelManage/barcode/index.vue index 7ad4a1afd..231a58889 100644 --- a/src/views/wms/basicDataManage/labelManage/barcode/index.vue +++ b/src/views/wms/basicDataManage/labelManage/barcode/index.vue @@ -167,12 +167,18 @@ const openForm = (type: string, row?: any) => { // form表单提交 const formsSuccess = async (formType,data) => { - if (formType === 'create') { - await BarcodeApi.createBarcode(data) - message.success(t('common.createSuccess')) - } else { - await BarcodeApi.updateBarcode(data) - message.success(t('common.updateSuccess')) + + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await BarcodeApi.createBarcode(data) + message.success(t('common.createSuccess')) + } else { + await BarcodeApi.updateBarcode(data) + message.success(t('common.updateSuccess')) + } + } finally { + basicFormRef.value.formLoading = false } basicFormRef.value.dialogVisible = false getList() diff --git a/src/views/wms/basicDataManage/labelManage/callmaterials/index.vue b/src/views/wms/basicDataManage/labelManage/callmaterials/index.vue index 72dec50cb..74d8dd474 100644 --- a/src/views/wms/basicDataManage/labelManage/callmaterials/index.vue +++ b/src/views/wms/basicDataManage/labelManage/callmaterials/index.vue @@ -235,13 +235,19 @@ const formsSuccess = async (formType,data) => { } if(data.activeTime==0)data.activeTime = null; if(data.expireTime==0)data.expireTime = null; - if (formType === 'create') { - await CallmaterialsApi.createCallmaterials(data) - message.success(t('common.createSuccess')) - } else { - await CallmaterialsApi.updateCallmaterials(data) - message.success(t('common.updateSuccess')) + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await CallmaterialsApi.createCallmaterials(data) + message.success(t('common.createSuccess')) + } else { + await CallmaterialsApi.updateCallmaterials(data) + message.success(t('common.updateSuccess')) + } + } finally { + basicFormRef.value.formLoading = false } + basicFormRef.value.dialogVisible = false getList() } diff --git a/src/views/wms/basicDataManage/labelManage/labeltype/index.vue b/src/views/wms/basicDataManage/labelManage/labeltype/index.vue index f7350997b..ec20b19ba 100644 --- a/src/views/wms/basicDataManage/labelManage/labeltype/index.vue +++ b/src/views/wms/basicDataManage/labelManage/labeltype/index.vue @@ -170,12 +170,17 @@ const openForm = (type: string, row?: any) => { // form表单提交 const formsSuccess = async (formType,data) => { - if (formType === 'create') { - await LabeltypeApi.createLabeltype(data) - message.success(t('common.createSuccess')) - } else { - await LabeltypeApi.updateLabeltype(data) - message.success(t('common.updateSuccess')) + basicFormRef.value.formLoading = true + try{ + if (formType === 'create') { + await LabeltypeApi.createLabeltype(data) + message.success(t('common.createSuccess')) + } else { + await LabeltypeApi.updateLabeltype(data) + message.success(t('common.updateSuccess')) + } + } finally { + basicFormRef.value.formLoading = false } basicFormRef.value.dialogVisible = false getList() diff --git a/src/views/wms/basicDataManage/labelManage/manufacturePackage/index.vue b/src/views/wms/basicDataManage/labelManage/manufacturePackage/index.vue index e3467083b..1abf79216 100644 --- a/src/views/wms/basicDataManage/labelManage/manufacturePackage/index.vue +++ b/src/views/wms/basicDataManage/labelManage/manufacturePackage/index.vue @@ -288,13 +288,19 @@ const handlePoint = async (row) => { // form表单提交 const formsSuccess = async (formType,data) => { - if (formType === 'create') { - await PackageApi.createPackageLabel(data) - message.success(t('common.createSuccess')) - } else { - await PackageApi.updatePackage(data) - message.success(t('common.updateSuccess')) + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await PackageApi.createPackageLabel(data) + message.success(t('common.createSuccess')) + } else { + await PackageApi.updatePackage(data) + message.success(t('common.updateSuccess')) + } + } finally { + basicFormRef.value.formLoading = false } + basicFormRef.value.dialogVisible = false getList() } diff --git a/src/views/wms/basicDataManage/labelManage/purchasePackage/index.vue b/src/views/wms/basicDataManage/labelManage/purchasePackage/index.vue index afe60badd..14ddbd0ed 100644 --- a/src/views/wms/basicDataManage/labelManage/purchasePackage/index.vue +++ b/src/views/wms/basicDataManage/labelManage/purchasePackage/index.vue @@ -284,13 +284,19 @@ const handlePoint = async (row) => { // form表单提交 const formsSuccess = async (formType,data) => { - if (formType === 'create') { - await PackageApi.createPackageLabel(data) - message.success(t('common.createSuccess')) - } else { - await PackageApi.updatePackage(data) - message.success(t('common.updateSuccess')) + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await PackageApi.createPackageLabel(data) + message.success(t('common.createSuccess')) + } else { + await PackageApi.updatePackage(data) + message.success(t('common.updateSuccess')) + } + } finally { + basicFormRef.value.formLoading = false } + basicFormRef.value.dialogVisible = false getList() } diff --git a/src/views/wms/basicDataManage/orderManage/carrier/index.vue b/src/views/wms/basicDataManage/orderManage/carrier/index.vue index 4afe308fa..dcd05eb8b 100644 --- a/src/views/wms/basicDataManage/orderManage/carrier/index.vue +++ b/src/views/wms/basicDataManage/orderManage/carrier/index.vue @@ -182,12 +182,18 @@ const formsSuccess = async (formType,data) => { } if(data.activeTime==0)data.activeTime = null; if(data.expireTime==0)data.expireTime = null; - if (formType === 'create') { - await CarrierApi.createCarrier(data) - message.success(t('common.createSuccess')) - } else { - await CarrierApi.updateCarrier(data) - message.success(t('common.updateSuccess')) + + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await CarrierApi.createCarrier(data) + message.success(t('common.createSuccess')) + } else { + await CarrierApi.updateCarrier(data) + message.success(t('common.updateSuccess')) + } + } finally { + basicFormRef.value.formLoading = false } basicFormRef.value.dialogVisible = false getList() diff --git a/src/views/wms/basicDataManage/orderManage/owner/index.vue b/src/views/wms/basicDataManage/orderManage/owner/index.vue index 5c263fb5f..32c90fb63 100644 --- a/src/views/wms/basicDataManage/orderManage/owner/index.vue +++ b/src/views/wms/basicDataManage/orderManage/owner/index.vue @@ -182,12 +182,19 @@ const formsSuccess = async (formType,data) => { } if(data.activeTime==0)data.activeTime = null; if(data.expireTime==0)data.expireTime = null; - if (formType === 'create') { - await OwnerApi.createOwner(data) - message.success(t('common.createSuccess')) - } else { - await OwnerApi.updateOwner(data) - message.success(t('common.updateSuccess')) + + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await OwnerApi.createOwner(data) + message.success(t('common.createSuccess')) + } else { + await OwnerApi.updateOwner(data) + message.success(t('common.updateSuccess')) + } + + } finally { + basicFormRef.value.formLoading = false } basicFormRef.value.dialogVisible = false getList() diff --git a/src/views/wms/basicDataManage/orderManage/shift/index.vue b/src/views/wms/basicDataManage/orderManage/shift/index.vue index 50aef449e..4ba329af0 100644 --- a/src/views/wms/basicDataManage/orderManage/shift/index.vue +++ b/src/views/wms/basicDataManage/orderManage/shift/index.vue @@ -189,12 +189,18 @@ const formsSuccess = async (formType,data) => { } if(data.activeTime==0)data.activeTime = null; if(data.expireTime==0)data.expireTime = null; - if (formType === 'create') { - await ShiftApi.createShift(data) - message.success(t('common.createSuccess')) - } else { - await ShiftApi.updateShift(data) - message.success(t('common.updateSuccess')) + + basicFormRef.value.formLoading = true + try{ + if (formType === 'create') { + await ShiftApi.createShift(data) + message.success(t('common.createSuccess')) + } else { + await ShiftApi.updateShift(data) + message.success(t('common.updateSuccess')) + } + } finally { + basicFormRef.value.formLoading = false } basicFormRef.value.dialogVisible = false getList() diff --git a/src/views/wms/basicDataManage/subject/mstr/index.vue b/src/views/wms/basicDataManage/subject/mstr/index.vue index 67ea231af..ca220e13a 100644 --- a/src/views/wms/basicDataManage/subject/mstr/index.vue +++ b/src/views/wms/basicDataManage/subject/mstr/index.vue @@ -157,13 +157,19 @@ const formsSuccess = async (formType,data) => { var isHave =Mstr.allSchemas.formSchema.some(function (item) { return item.field === 'activeTime' || item.field === 'expireTime'; }); - if (formType === 'create') { - await MstrApi.createMstr(data) - message.success(t('common.createSuccess')) - } else { - await MstrApi.updateMstr(data) - message.success(t('common.updateSuccess')) + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await MstrApi.createMstr(data) + message.success(t('common.createSuccess')) + } else { + await MstrApi.updateMstr(data) + message.success(t('common.updateSuccess')) + } + } finally { + basicFormRef.value.formLoading = false } + basicFormRef.value.dialogVisible = false getList() } diff --git a/src/views/wms/basicDataManage/subject/qadCostcentre/index.vue b/src/views/wms/basicDataManage/subject/qadCostcentre/index.vue index 42d552e1f..d0b0f19c9 100644 --- a/src/views/wms/basicDataManage/subject/qadCostcentre/index.vue +++ b/src/views/wms/basicDataManage/subject/qadCostcentre/index.vue @@ -165,12 +165,19 @@ const formsSuccess = async (formType,data) => { } if(data.activeTime==0)data.activeTime = null; if(data.expireTime==0)data.expireTime = null; - if (formType === 'create') { - await QadCostcentreApi.createQadCostcentre(data) - message.success(t('common.createSuccess')) - } else { - await QadCostcentreApi.updateQadCostcentre(data) - message.success(t('common.updateSuccess')) + + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await QadCostcentreApi.createQadCostcentre(data) + message.success(t('common.createSuccess')) + } else { + await QadCostcentreApi.updateQadCostcentre(data) + message.success(t('common.updateSuccess')) + } + + } finally { + basicFormRef.value.formLoading = false } basicFormRef.value.dialogVisible = false getList() diff --git a/src/views/wms/basicDataManage/subject/qadProject/index.vue b/src/views/wms/basicDataManage/subject/qadProject/index.vue index 4afc173b4..f34285ac2 100644 --- a/src/views/wms/basicDataManage/subject/qadProject/index.vue +++ b/src/views/wms/basicDataManage/subject/qadProject/index.vue @@ -165,12 +165,19 @@ const formsSuccess = async (formType,data) => { } if(data.activeTime==0)data.activeTime = null; if(data.expireTime==0)data.expireTime = null; - if (formType === 'create') { - await QadProjectApi.createQadProject(data) - message.success(t('common.createSuccess')) - } else { - await QadProjectApi.updateQadProject(data) - message.success(t('common.updateSuccess')) + + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await QadProjectApi.createQadProject(data) + message.success(t('common.createSuccess')) + } else { + await QadProjectApi.updateQadProject(data) + message.success(t('common.updateSuccess')) + } + + } finally { + basicFormRef.value.formLoading = false } basicFormRef.value.dialogVisible = false getList() diff --git a/src/views/wms/basicDataManage/subject/subjectAccount/index.vue b/src/views/wms/basicDataManage/subject/subjectAccount/index.vue index 1ea1e02e2..96ceefbac 100644 --- a/src/views/wms/basicDataManage/subject/subjectAccount/index.vue +++ b/src/views/wms/basicDataManage/subject/subjectAccount/index.vue @@ -174,13 +174,20 @@ const formsSuccess = async (formType,data) => { } if(data.activeTime==0)data.activeTime = null; if(data.expireTime==0)data.expireTime = null; - if (formType === 'create') { - await SubjectAccountApi.createSubjectAccount(data) - message.success(t('common.createSuccess')) - } else { - await SubjectAccountApi.updateSubjectAccount(data) - message.success(t('common.updateSuccess')) + + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await SubjectAccountApi.createSubjectAccount(data) + message.success(t('common.createSuccess')) + } else { + await SubjectAccountApi.updateSubjectAccount(data) + message.success(t('common.updateSuccess')) + } + } finally { + basicFormRef.value.formLoading = false } + basicFormRef.value.dialogVisible = false getList() } diff --git a/src/views/wms/buttMesManage/mesBarCode/index.vue b/src/views/wms/buttMesManage/mesBarCode/index.vue index 7d3c28473..0a1eebafe 100644 --- a/src/views/wms/buttMesManage/mesBarCode/index.vue +++ b/src/views/wms/buttMesManage/mesBarCode/index.vue @@ -154,13 +154,20 @@ const openForm = (type: string, row?: any) => { // form表单提交 const formsSuccess = async (formType,data) => { - if (formType === 'create') { - await MesBarCodeApi.createMesBarCode(data) - message.success(t('common.createSuccess')) - } else { - await MesBarCodeApi.updateMesBarCode(data) - message.success(t('common.updateSuccess')) + + basicFormRef.value.formLoading = true + try { + if (formType === 'create') { + await MesBarCodeApi.createMesBarCode(data) + message.success(t('common.createSuccess')) + } else { + await MesBarCodeApi.updateMesBarCode(data) + message.success(t('common.updateSuccess')) + } + } finally { + basicFormRef.value.formLoading = false } + basicFormRef.value.dialogVisible = false getList() }