Refactor billing options retrieval to include data permissions and add effective date handling for product imports

This commit is contained in:
wuweihua
2026-10-09 09:27:28 +08:00
parent fea34d1d10
commit c95a9861cc
42 changed files with 984 additions and 219 deletions
@@ -24,7 +24,7 @@
</div>
</template>
<div v-if="!livePersist" class="build-choice">
<div v-if="showBuildChoice" class="build-choice">
<p class="build-choice__tip">创建价格方式</p>
<div class="build-choice__cards">
<button
@@ -224,6 +224,11 @@ const hasBuildMode = computed(() => {
// Legacy / already has products: skip choice cards
return (props.products || []).some(p => p && p.productCode)
})
/** Create/newVersion only: show choice until a mode is picked */
const showBuildChoice = computed(() => {
if (props.livePersist) return false
return !isPullBuildMode(props.priceBuildMode) && !isImportBuildMode(props.priceBuildMode)
})
const choosingMode = ref(false)
const isModifyImport = computed(() => {
if (isPullBuildMode(props.priceBuildMode)) return true
@@ -1,5 +1,15 @@
<template>
<set-section-card :title="title" tone="green" :count="filteredVersions.length">
<template #action>
<el-button
type="primary"
plain
size="small"
:disabled="hasDraft"
v-hasPermi="['price:set:add']"
@click="emit('create-version')"
>新建价格版本</el-button>
</template>
<el-tabs v-model="statusTab" class="ver-tabs">
<el-tab-pane :label="tabLabel('all')" name="all" />
<el-tab-pane :label="tabLabel('0')" name="0" />
@@ -80,7 +90,7 @@ const props = defineProps({
versions: { type: Array, default: () => [] },
modelValue: { type: [Number, String], default: undefined }
})
const emit = defineEmits(['update:modelValue', 'copy-version', 'open-details', 'activate', 'reschedule', 'edit', 'remove'])
const emit = defineEmits(['update:modelValue', 'copy-version', 'create-version', 'open-details', 'activate', 'reschedule', 'edit', 'remove'])
const title = '套餐版本'
const colNo = '版本号'