front/src/utils/enableStatus.ts
zzh 76d8b473b6 feat: 查价下单加固、待排货 UI 与 EnableStatus 对齐
查价参考价提示与可选尺寸;下单尺寸必填及查价带入;待排货状态展示;货物属性/启用状态工具化及相关页面更新。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-22 19:00:56 +08:00

18 lines
527 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/** OMS EnableStatus:0=None,1=Disabled,2=Enabled(与后端 EnableStatus 枚举一致) */
export const ENABLE_STATUS = {
none: 0,
disabled: 1,
enabled: 2,
} as const
export function isEnableStatusEnabled(value: unknown): boolean {
if (value === true) return true
if (value === false || value == null) return false
const n = Number(value)
return n === ENABLE_STATUS.enabled
}
export function toEnableStatus(enabled: boolean): number {
return enabled ? ENABLE_STATUS.enabled : ENABLE_STATUS.disabled
}