diff --git a/src/views/modules/purchase/cancelReceipt.vue b/src/views/modules/purchase/cancelReceipt.vue index b872323..f5466ec 100644 --- a/src/views/modules/purchase/cancelReceipt.vue +++ b/src/views/modules/purchase/cancelReceipt.vue @@ -17,7 +17,7 @@ { + const cancelRecords = [...this.currentCancelRecords] + this.cancelingRecordKeys = cancelRecords.map(record => this.getCancelRecordKey(record)) + const promises = cancelRecords.map(record => { return cancelReceipt({ receiptSequence: record.receiptSequence, site: record.contract, @@ -298,7 +314,7 @@ export default { if (result.data && result.data.code === 0) { successCount++ } else { - const record = this.currentCancelRecords[index] + const record = cancelRecords[index] errorMessages.push(this.$t('purchase.cancelReceipt.cancelItemFailed', { receiptNo: record.receiptNo || record.sourceRef1 || '', reason: result.data.msg || this.$t('purchase.cancelReceipt.cancelFailed') @@ -316,10 +332,11 @@ export default { } this.cancelDialogVisible = false - this.cancelLoading = false }).catch(() => { this.$message.error(this.$t('purchase.cancelReceipt.cancelOperationFailed')) + }).finally(() => { this.cancelLoading = false + this.cancelingRecordKeys = [] }) }, // 重置查询