|
|
@ -196,22 +196,25 @@ const formsSuccess = async (formType,data) => { |
|
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
|
basicFormRef.value.formLoading = true |
|
|
|
if (formType === 'create') { |
|
|
|
if(routeName.value.includes('SCP')){ |
|
|
|
await SupplieritemApi.createSupplieritemSCP(data) |
|
|
|
}else{ |
|
|
|
await SupplieritemApi.createSupplieritem(data) |
|
|
|
} |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} else { |
|
|
|
if(routeName.value.includes('SCP')){ |
|
|
|
await SupplieritemApi.updateSupplieritemSCP(data) |
|
|
|
}else{ |
|
|
|
await SupplieritemApi.updateSupplieritem(data) |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
if(routeName.value.includes('SCP')){ |
|
|
|
await SupplieritemApi.createSupplieritemSCP(data) |
|
|
|
}else{ |
|
|
|
await SupplieritemApi.createSupplieritem(data) |
|
|
|
} |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} else { |
|
|
|
if(routeName.value.includes('SCP')){ |
|
|
|
await SupplieritemApi.updateSupplieritemSCP(data) |
|
|
|
}else{ |
|
|
|
await SupplieritemApi.updateSupplieritem(data) |
|
|
|
} |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
} |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
} finally { |
|
|
|
basicFormRef.value.formLoading = false |
|
|
|
} |
|
|
|
basicFormRef.value.formLoading = false |
|
|
|
basicFormRef.value.dialogVisible = false |
|
|
|
if (formType === 'create') { |
|
|
|
getList() |
|
|
|