diff --git a/src/pages/repair/testedInBound/codeList.vue b/src/pages/repair/testedInBound/codeList.vue index 89ee093..22fe6ad 100644 --- a/src/pages/repair/testedInBound/codeList.vue +++ b/src/pages/repair/testedInBound/codeList.vue @@ -109,6 +109,7 @@ const boxInfo = ref([]) const qrCode = ref('') const maInfo = ref({}) const scanQrCodeRef = ref(null) +const isSubmit = ref(false) // const typeId = ref('') // const taskId = ref('') // const maTypeName = ref('') @@ -448,25 +449,35 @@ const onHandleInbound = async () => { }) } }) - let param = { - taskId: queryParams.value.taskId, - typeId: queryParams.value.typeId, - agreementId: queryParams.value.agreementId, - maCodeList: paramsList, - } - console.log(param) - const res = await repairInputWarehouseApi(param) - if (res.code === 200) { - uni.showToast({ - title: '入库成功!', - icon: 'none', - }) - setTimeout(() => { - queryParams.value.pendingInputNum = - Number(queryParams.value.pendingInputNum) - paramsList.length - getCodeDeviceListData() - uni.$emit('onUpdate') - }, 800) + try { + if (isSubmit.value) return + isSubmit.value = true + uni.showLoading({ title: '操作中...', mask: true }) + let param = { + taskId: queryParams.value.taskId, + typeId: queryParams.value.typeId, + agreementId: queryParams.value.agreementId, + maCodeList: paramsList, + } + console.log(param) + const res = await repairInputWarehouseApi(param) + if (res.code === 200) { + uni.showToast({ + title: '入库成功!', + icon: 'none', + }) + setTimeout(() => { + queryParams.value.pendingInputNum = + Number(queryParams.value.pendingInputNum) - paramsList.length + getCodeDeviceListData() + uni.$emit('onUpdate') + }, 800) + } + } catch (error) { + console.log('🚀 ~ onHandleInbound ~ error:', error) + } finally { + isSubmit.value = false + uni.hideLoading() } } @@ -499,25 +510,35 @@ const onRejectOutbound = async () => { }) } }) - let param = { - taskId: queryParams.value.taskId, - typeId: queryParams.value.typeId, - agreementId: queryParams.value.agreementId, - maCodeList: paramsList, - } - console.log(param) - const res = await rejectWarehouseApi(param) - if (res.code === 200) { - uni.showToast({ - title: '驳回成功!', - icon: 'none', - }) - setTimeout(() => { - queryParams.value.pendingInputNum = - Number(queryParams.value.pendingInputNum) - paramsList.length - getCodeDeviceListData() - uni.$emit('onUpdate') - }, 800) + try { + if (isSubmit.value) return + isSubmit.value = true + uni.showLoading({ title: '操作中...', mask: true }) + let param = { + taskId: queryParams.value.taskId, + typeId: queryParams.value.typeId, + agreementId: queryParams.value.agreementId, + maCodeList: paramsList, + } + console.log(param) + const res = await rejectWarehouseApi(param) + if (res.code === 200) { + uni.showToast({ + title: '驳回成功!', + icon: 'none', + }) + setTimeout(() => { + queryParams.value.pendingInputNum = + Number(queryParams.value.pendingInputNum) - paramsList.length + getCodeDeviceListData() + uni.$emit('onUpdate') + }, 800) + } + } catch (error) { + console.log('🚀 ~ onRejectOutbound ~ error:', error) + } finally { + isSubmit.value = false + uni.hideLoading() } }