This commit is contained in:
		
							parent
							
								
									4374511cb2
								
							
						
					
					
						commit
						18a8c1faa5
					
				| 
						 | 
					@ -188,7 +188,11 @@ const onClick = (e, item, itemIndex) => {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    swipeRef.value[itemIndex].closeAll()
 | 
					    swipeRef.value[itemIndex].closeAll()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const isSubmit = ref(false)
 | 
				
			||||||
const submit = async () => {
 | 
					const submit = async () => {
 | 
				
			||||||
 | 
					    if (isSubmit.value) return
 | 
				
			||||||
 | 
					    isSubmit.value = true
 | 
				
			||||||
    let param = {
 | 
					    let param = {
 | 
				
			||||||
        id: id.value,
 | 
					        id: id.value,
 | 
				
			||||||
        taskId: taskId.value,
 | 
					        taskId: taskId.value,
 | 
				
			||||||
| 
						 | 
					@ -209,6 +213,7 @@ const submit = async () => {
 | 
				
			||||||
        uni.showToast({ title: error.data.msg, icon: 'none' })
 | 
					        uni.showToast({ title: error.data.msg, icon: 'none' })
 | 
				
			||||||
    } finally {
 | 
					    } finally {
 | 
				
			||||||
        uni.hideLoading()
 | 
					        uni.hideLoading()
 | 
				
			||||||
 | 
					        isSubmit.value = false
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    //   console.log(param)
 | 
					    //   console.log(param)
 | 
				
			||||||
    //   submitBackApply(param).then(res => {
 | 
					    //   submitBackApply(param).then(res => {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -202,15 +202,26 @@ const onRepairItem = (item) => {
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const isSubmit = ref(false)
 | 
				
			||||||
const handleSubmit = async () => {
 | 
					const handleSubmit = async () => {
 | 
				
			||||||
    // 提交逻辑
 | 
					    try {
 | 
				
			||||||
    const res = await repairSubmitAPI([{ taskId: taskId.value }])
 | 
					        if (isSubmit.value) return
 | 
				
			||||||
    if (res.code === 200) {
 | 
					        isSubmit.value = true
 | 
				
			||||||
        uni.showToast({
 | 
					        uni.showLoading({ title: '提交中...', mask: true })
 | 
				
			||||||
            title: '提交成功!',
 | 
					        // 提交逻辑
 | 
				
			||||||
            icon: 'none',
 | 
					        const res = await repairSubmitAPI([{ taskId: taskId.value }])
 | 
				
			||||||
        })
 | 
					        if (res.code === 200) {
 | 
				
			||||||
        uni.navigateBack()
 | 
					            uni.showToast({
 | 
				
			||||||
 | 
					                title: '提交成功!',
 | 
				
			||||||
 | 
					                icon: 'none',
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					            uni.navigateBack()
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    } catch (error) {
 | 
				
			||||||
 | 
					        console.log('🚀 ~ handleSubmit ~ error:', error)
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					        uni.hideLoading()
 | 
				
			||||||
 | 
					        isSubmit.value = false
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue