增加失败原因和优化进度条

This commit is contained in:
wuweihua
2026-11-05 15:38:45 +08:00
parent 1727386811
commit 891fdea7d3
12 changed files with 220 additions and 38 deletions
@@ -345,7 +345,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 },
+14 -3
View File
@@ -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
}
}
@@ -44,11 +44,11 @@
</div>
</template>
<div class="build-choice">
<!-- Exclusive quote: only Excel fresh build; hide the mode picker and default IMPORT_FRESH -->
<div v-if="!onlyImportFresh" class="build-choice">
<p class="build-choice__tip">创建价格方式</p>
<div class="build-choice__cards">
<button
v-if="!onlyImportFresh"
type="button"
class="build-card build-card--pull"
:class="{ selected: isPullBuildMode(priceBuildMode) }"
@@ -59,7 +59,7 @@
<div class="build-card__desc">按产品库基础价生成套餐产品列表,可再导入 Excel 修改价格</div>
</button>
<button
v-if="showImportInherit && !onlyImportFresh"
v-if="showImportInherit"
type="button"
class="build-card build-card--import"
:class="{ selected: isImportBuildMode(priceBuildMode) }"
@@ -626,7 +626,7 @@ watch(
() => [onlyImportFresh.value, props.priceBuildMode, props.buildModeReady],
() => {
if (!onlyImportFresh.value || !props.buildModeReady) return
if (props.priceBuildMode) return
if (isImportFreshBuildMode(props.priceBuildMode)) return
if (buildModeLocked.value) return
emit('update:priceBuildMode', 'IMPORT_FRESH')
},