diff --git a/src/views/moneyManage/receiveDetail/receiveService.vue b/src/views/moneyManage/receiveDetail/receiveService.vue index 958212b..256cc30 100644 --- a/src/views/moneyManage/receiveDetail/receiveService.vue +++ b/src/views/moneyManage/receiveDetail/receiveService.vue @@ -267,9 +267,9 @@ 取消 确定 + type="primary" @click="throttledhandleAddForm" :disabled="ifAddDone">确定 编辑 + type="primary" @click="throttledhandleEditForm" :disabled="ifReAddDone">编辑 @@ -428,6 +428,10 @@ const total = ref(0) // 总条数 const pageInfo = ref({ pageSize: 10, pageNum: 1 }) // 分页信息 const numUnitList = ref(['年', '月']) +//防止重复点击状态管理 +const ifAddDone = ref(false) +const ifReAddDone = ref(false) + // 角色标识:固定为客服(删除财务、总部财务、超级管理员标识) const kefu = ref(true) const caiwu = ref(false) @@ -683,6 +687,7 @@ const handleAddForm = async () => { if (addFormData.value.payTime) { addFormData.value.payTime = moment(addFormData.value.payTime).format('YYYY-MM-DD HH:mm:ss') } + ifAddDone.value = true const result = await request({ url: '/cashCollection/add', data: { @@ -702,9 +707,11 @@ const handleAddForm = async () => { getlist() closeAddForm() } + ifAddDone.value = false } catch (error) { console.log('新增报错:', error); ElMessage.error('请完善表单信息后提交'); + ifAddDone.value = false } } @@ -732,6 +739,7 @@ const handleEditForm = async () => { if (addFormData.value.payTime) { addFormData.value.payTime = moment(addFormData.value.payTime).format('YYYY-MM-DD HH:mm:ss') } + ifReAddDone.value = true const result = await request({ url: '/cashCollection/reSubmit', data: { @@ -751,8 +759,10 @@ const handleEditForm = async () => { getlist() closeAddForm() } + ifReAddDone.value = false } catch (error) { console.log(error); + ifReAddDone.value = false } }