fix PackageConfig*.vue style
This commit is contained in:
@@ -43,6 +43,11 @@ export function normalizeProductQuantity(value: number | string): string | undef
|
||||
return fraction ? `${integer}.${fraction}` : integer;
|
||||
}
|
||||
|
||||
/** 根据产品数量规则返回数量控件步长。允许小数时固定步进 0.1。 */
|
||||
export function getProductQuantityStep(product?: Pick<Product, "allowDecimalQuantity">): number {
|
||||
return product?.allowDecimalQuantity ? .1 : 1;
|
||||
}
|
||||
|
||||
export function getProductTypeText(type?: ProductType): string {
|
||||
return ({ SERVICE: "服务", GOODS: "实物", CONSUMABLE: "消耗品" } as Record<string, string>)[type || ""] || "未知";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user