|
@@ -27,7 +27,7 @@
|
|
|
</CtForm>
|
|
|
<Loading :visible="loading"></Loading>
|
|
|
<div class="text-center">
|
|
|
- <v-btn color="primary" class="buttons mt-3 mb-10" @click="handleSave">{{ $t('common.save') }}</v-btn>
|
|
|
+ <v-btn color="primary" class="buttons mt-3 mb-10" :loading="formLoading" @click="handleSave">{{ $t('common.save') }}</v-btn>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -48,6 +48,7 @@ const { t } = useI18n()
|
|
|
let licenseUrl = ref('')
|
|
|
// 图片预览
|
|
|
const loading = ref(false)
|
|
|
+const formLoading = ref(false)
|
|
|
|
|
|
const formItems = ref({
|
|
|
options: [
|
|
@@ -191,16 +192,21 @@ const query = reactive({})
|
|
|
const handleSave = async () => {
|
|
|
const { valid } = await CtFormRef.value.formRef.validate()
|
|
|
if (!valid) return
|
|
|
+ formLoading.value = true
|
|
|
formItems.value.options.forEach(e => {
|
|
|
if (e.noParam) return
|
|
|
query[e.key] = e.value
|
|
|
})
|
|
|
query.businessUrl = licenseUrl.value
|
|
|
if (!query.establishmentTime) return Snackbar.warning('请选择成立时间')
|
|
|
- await saveEnterpriseBusiness(query)
|
|
|
- Snackbar.success('编辑成功')
|
|
|
- isUpdate = true
|
|
|
- getBaseInfo()
|
|
|
+ try {
|
|
|
+ await saveEnterpriseBusiness(query)
|
|
|
+ Snackbar.success('编辑成功')
|
|
|
+ isUpdate = true
|
|
|
+ getBaseInfo()
|
|
|
+ } finally {
|
|
|
+ formLoading.value = false
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
let isUpdate = false // 是否同时更新基本信息
|