Browse Source

fix:投诉举报重复提交问题

feature/tsjb-1.0
buaixuexideshitongxue 2 weeks ago
parent
commit
1b01eda9a2
  1. 2
      src/components/data/complaintformdialog.vue
  2. 5
      src/views/data/ComplaintCollection.vue

2
src/components/data/complaintformdialog.vue

@ -328,7 +328,7 @@
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button @click="visibleProxy = false" size="large">取消</el-button> <el-button @click="visibleProxy = false" size="large">取消</el-button>
<el-button type="primary" @click="onSubmit" size="large" :loading="submitLoading"> <el-button type="primary" @click="onSubmit" size="large" :loading="loading || submitLoading">
{{ mode === 'add' ? '添加' : '修改' }} {{ mode === 'add' ? '添加' : '修改' }}
</el-button> </el-button>
</div> </div>

5
src/views/data/ComplaintCollection.vue

@ -378,6 +378,7 @@
mode="add" mode="add"
:model="addForm" :model="addForm"
:rules="addRules" :rules="addRules"
:loading="submitting"
@submit="submitAdd" @submit="submitAdd"
/> />
@ -546,6 +547,7 @@ const createEmptyAddForm = () => ({
approvalFlow: '', approvalFlow: '',
}); });
const addShow = ref(false); const addShow = ref(false);
const submitting = ref(false); //
const addForm = ref(createEmptyAddForm()); const addForm = ref(createEmptyAddForm());
// //
const add = async () => { const add = async () => {
@ -555,6 +557,8 @@ const add = async () => {
// //
const submitAdd = async () => { const submitAdd = async () => {
if (submitting.value) return //
submitting.value = true
try { try {
const body = {...addForm.value} const body = {...addForm.value}
let res = await addComplaintCollection(body); let res = await addComplaintCollection(body);
@ -569,6 +573,7 @@ const submitAdd = async () => {
console.error(e); console.error(e);
feedback.notifyError("操作失败"); feedback.notifyError("操作失败");
} finally { } finally {
submitting.value = false
getList() getList()
} }
} }

Loading…
Cancel
Save