增加失败原因和优化进度条
This commit is contained in:
@@ -363,7 +363,7 @@ const billingFailStatusOptions = [
|
||||
{ label: '产品价未匹配国家', value: 24 },
|
||||
{ label: '产品价未匹配重量段', value: 25 },
|
||||
{ label: '未绑定套餐', value: 4 },
|
||||
{ label: '无生效套餐版本', value: 5 },
|
||||
{ label: '套餐未启用/无生效版本', value: 5 },
|
||||
{ label: '已生成应收账单', value: 6 },
|
||||
{ label: '产品档案缺失', value: 7 },
|
||||
{ label: '未命中价格', value: 8 },
|
||||
@@ -638,10 +638,15 @@ async function resumeRebillTask(taskId) {
|
||||
rebillProgressTotal.value = 0
|
||||
rebillProgressSuccess.value = 0
|
||||
rebillProgressFail.value = 0
|
||||
let superseded = false
|
||||
try {
|
||||
const result = await pollLocalRebillTask(taskId, applyRebillProgress)
|
||||
finishRebillFromTask(result && result.task, !!(result && result.cancelled))
|
||||
} catch (e) {
|
||||
if (e && e.superseded) {
|
||||
superseded = true
|
||||
return
|
||||
}
|
||||
const task = e && e.task
|
||||
rebillProgressStatus.value = 'exception'
|
||||
rebillProgressMessage.value = (e && e.message) || '重新计费失败'
|
||||
@@ -657,7 +662,8 @@ async function resumeRebillTask(taskId) {
|
||||
rebillProgressVisible.value = true
|
||||
scheduleHideRebillFloat()
|
||||
} finally {
|
||||
batchLoading.value = false
|
||||
// Keep loading if a newer poll replaced this one.
|
||||
if (!superseded) batchLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -711,6 +717,7 @@ async function runLocalRebill(payload, confirmText) {
|
||||
window.setTimeout(() => {
|
||||
if (batchLoading.value) rebillProgressVisible.value = false
|
||||
}, 600)
|
||||
let superseded = false
|
||||
try {
|
||||
const result = await localRebillAsync(
|
||||
payload,
|
||||
@@ -719,6 +726,10 @@ async function runLocalRebill(payload, confirmText) {
|
||||
)
|
||||
finishRebillFromTask(result && result.task, !!(result && result.cancelled))
|
||||
} catch (e) {
|
||||
if (e && e.superseded) {
|
||||
superseded = true
|
||||
return
|
||||
}
|
||||
const task = e && e.task
|
||||
rebillProgressStatus.value = 'exception'
|
||||
rebillProgressMessage.value = (e && e.message) || '重新计费失败'
|
||||
@@ -734,7 +745,7 @@ async function runLocalRebill(payload, confirmText) {
|
||||
rebillProgressVisible.value = true
|
||||
scheduleHideRebillFloat()
|
||||
} finally {
|
||||
batchLoading.value = false
|
||||
if (!superseded) batchLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user