Browse Source

重复点击问题

lihuilin/feature-20251104102812-现金二期
ZhangYong 2 weeks ago
parent
commit
5d0fa3c16a
  1. 14
      src/views/moneyManage/receiveDetail/receiveService.vue

14
src/views/moneyManage/receiveDetail/receiveService.vue

@ -267,9 +267,9 @@
<span class="dialog-footer"> <span class="dialog-footer">
<el-button style="background-color: #7E91FF;" @click="closeAddForm">取消</el-button> <el-button style="background-color: #7E91FF;" @click="closeAddForm">取消</el-button>
<el-button v-if="addOrEdit == 1" style="background-color: #2741DE; margin-left: 2.5vw;" <el-button v-if="addOrEdit == 1" style="background-color: #2741DE; margin-left: 2.5vw;"
type="primary" @click="throttledhandleAddForm">确定</el-button>
type="primary" @click="throttledhandleAddForm" :disabled="ifAddDone">确定</el-button>
<el-button v-else-if="addOrEdit == 2" style="background-color: #2741DE; margin-left: 2.5vw;" <el-button v-else-if="addOrEdit == 2" style="background-color: #2741DE; margin-left: 2.5vw;"
type="primary" @click="throttledhandleEditForm">编辑</el-button>
type="primary" @click="throttledhandleEditForm" :disabled="ifReAddDone">编辑</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -428,6 +428,10 @@ const total = ref(0) // 总条数
const pageInfo = ref({ pageSize: 10, pageNum: 1 }) // const pageInfo = ref({ pageSize: 10, pageNum: 1 }) //
const numUnitList = ref(['年', '月']) const numUnitList = ref(['年', '月'])
//
const ifAddDone = ref(false)
const ifReAddDone = ref(false)
// //
const kefu = ref(true) const kefu = ref(true)
const caiwu = ref(false) const caiwu = ref(false)
@ -683,6 +687,7 @@ const handleAddForm = async () => {
if (addFormData.value.payTime) { if (addFormData.value.payTime) {
addFormData.value.payTime = moment(addFormData.value.payTime).format('YYYY-MM-DD HH:mm:ss') addFormData.value.payTime = moment(addFormData.value.payTime).format('YYYY-MM-DD HH:mm:ss')
} }
ifAddDone.value = true
const result = await request({ const result = await request({
url: '/cashCollection/add', url: '/cashCollection/add',
data: { data: {
@ -702,9 +707,11 @@ const handleAddForm = async () => {
getlist() getlist()
closeAddForm() closeAddForm()
} }
ifAddDone.value = false
} catch (error) { } catch (error) {
console.log('新增报错:', error); console.log('新增报错:', error);
ElMessage.error('请完善表单信息后提交'); ElMessage.error('请完善表单信息后提交');
ifAddDone.value = false
} }
} }
@ -732,6 +739,7 @@ const handleEditForm = async () => {
if (addFormData.value.payTime) { if (addFormData.value.payTime) {
addFormData.value.payTime = moment(addFormData.value.payTime).format('YYYY-MM-DD HH:mm:ss') addFormData.value.payTime = moment(addFormData.value.payTime).format('YYYY-MM-DD HH:mm:ss')
} }
ifReAddDone.value = true
const result = await request({ const result = await request({
url: '/cashCollection/reSubmit', url: '/cashCollection/reSubmit',
data: { data: {
@ -751,8 +759,10 @@ const handleEditForm = async () => {
getlist() getlist()
closeAddForm() closeAddForm()
} }
ifReAddDone.value = false
} catch (error) { } catch (error) {
console.log(error); console.log(error);
ifReAddDone.value = false
} }
} }

Loading…
Cancel
Save