|
@@ -263,6 +263,7 @@
|
|
<el-button
|
|
<el-button
|
|
size="small"
|
|
size="small"
|
|
type="primary"
|
|
type="primary"
|
|
|
|
+ :loading="commitLoading"
|
|
@click="checkForm(indentForm)"
|
|
@click="checkForm(indentForm)"
|
|
>
|
|
>
|
|
{{ $t('btn_submit') }}
|
|
{{ $t('btn_submit') }}
|
|
@@ -270,6 +271,7 @@
|
|
<el-button
|
|
<el-button
|
|
size="small"
|
|
size="small"
|
|
type="primary"
|
|
type="primary"
|
|
|
|
+ :loading="commitLoading"
|
|
@click="checkForm(indentForm, false)"
|
|
@click="checkForm(indentForm, false)"
|
|
>
|
|
>
|
|
{{ $t(prefix_edit + 'btn_submit_and_next') }}
|
|
{{ $t(prefix_edit + 'btn_submit_and_next') }}
|
|
@@ -566,13 +568,14 @@ const addInfo = () => {
|
|
infoVisible.value = quoteList.value.length ? 2 : 1
|
|
infoVisible.value = quoteList.value.length ? 2 : 1
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+let commitLoading = ref(false)
|
|
const $mediaRegExp = inject('mediaRegExp') as RegExp
|
|
const $mediaRegExp = inject('mediaRegExp') as RegExp
|
|
const indentForm = ref<FormInstance>()
|
|
const indentForm = ref<FormInstance>()
|
|
const checkForm = (
|
|
const checkForm = (
|
|
formEl: FormInstance | undefined,
|
|
formEl: FormInstance | undefined,
|
|
closeAfterCreate = true,
|
|
closeAfterCreate = true,
|
|
) => {
|
|
) => {
|
|
- if (!formEl) return
|
|
|
|
|
|
+ if (!formEl || commitLoading.value) return
|
|
formEl.validate((valid: boolean) => {
|
|
formEl.validate((valid: boolean) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
form.value.picture = imageList.value
|
|
form.value.picture = imageList.value
|
|
@@ -588,6 +591,7 @@ const checkForm = (
|
|
// )
|
|
// )
|
|
console.log(form.value, 'form.value')
|
|
console.log(form.value, 'form.value')
|
|
form.value.quotes = quoteList.value.map((d: any) => d.entity_id || d.id)
|
|
form.value.quotes = quoteList.value.map((d: any) => d.entity_id || d.id)
|
|
|
|
+ commitLoading.value = true
|
|
createIndent(form.value)
|
|
createIndent(form.value)
|
|
.then((response: any) => {
|
|
.then((response: any) => {
|
|
// console.log(response, 'create indent')
|
|
// console.log(response, 'create indent')
|
|
@@ -616,6 +620,11 @@ const checkForm = (
|
|
'请稍后再试. 或者按F12打开控制台, 把错误信息复制出来找管理员排查.',
|
|
'请稍后再试. 或者按F12打开控制台, 把错误信息复制出来找管理员排查.',
|
|
})
|
|
})
|
|
})
|
|
})
|
|
|
|
+ .finally(() => {
|
|
|
|
+ commitLoading.value = false
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ commitLoading.value = false
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|