套餐启用增加生效时间

This commit is contained in:
wuweihua
2026-09-17 14:42:48 +08:00
parent 51c8013cd9
commit f3ef2df949
25 changed files with 684 additions and 287 deletions
@@ -40,23 +40,43 @@ const STATUS_TAG = {
/** 默认取值方式 */
export const DEFAULT_ROUND_MODE = 'HALF_UP'
/** version status: 0 draft / 1 active / 2 expired */
/** version status: 0 draft / 3 pending / 1 active / 2 expired */
export const VER_STATUS = {
DRAFT: '0',
PENDING: '3',
EFFECT: '1',
EXPIRED: '2'
}
export function versionStatusLabel(status) {
const map = { '0': '草稿', '1': '生效', '2': '失效' }
const map = {
'0': '草稿',
'3': '待生效',
'1': '生效',
'2': '失效'
}
return map[status] || status || '-'
}
export function versionStatusTag(status) {
const map = { '0': 'warning', '1': 'success', '2': 'info' }
const map = { '0': 'warning', '3': 'primary', '1': 'success', '2': 'info' }
return map[status] || 'info'
}
/** True draft only (not pending) */
export function isDraftVersion(row) {
return !!row && String(row.status) === VER_STATUS.DRAFT
}
export function isPendingVersion(row) {
return !!row && String(row.status) === VER_STATUS.PENDING
}
/** Draft or pending: may continue editing price details */
export function isPriceEditableVersion(row) {
return isDraftVersion(row) || isPendingVersion(row)
}
export function nextVersionNo(versions) {
const seqs = (versions || []).map(v => Number(v.versionSeq) || 0)
const max = seqs.length ? Math.max.apply(null, seqs) : 0