fix CustomerPackageDetail.vue style
This commit is contained in:
@@ -5,6 +5,7 @@ import type {
|
||||
DeliveryStatus,
|
||||
FundOperationType,
|
||||
FundRecordStatus,
|
||||
GaoCustomerPackage,
|
||||
PackageConfigStatus,
|
||||
PaymentStatus,
|
||||
RefundStatus
|
||||
@@ -117,6 +118,20 @@ export function getPackageItemAvailableQuantity(item: CustomerPackageItem): stri
|
||||
return getPackageQuantityText(item.availableQuantity);
|
||||
}
|
||||
|
||||
/** 判断套餐是否存在可用于发放的已核销收款。免费套餐可直接发放。 */
|
||||
export function canCreatePackageDelivery(customerPackage?: Pick<GaoCustomerPackage, "saleAmount" | "paidAmount">): boolean {
|
||||
const saleAmount = customerPackage?.saleAmount || 0;
|
||||
const paidAmount = customerPackage?.paidAmount || 0;
|
||||
return saleAmount === 0 || 0 < paidAmount;
|
||||
}
|
||||
|
||||
/** 判断未付清套餐的发放操作是否必须由店长执行。 */
|
||||
export function isStoreManagerRequiredForPackageDelivery(customerPackage?: Pick<GaoCustomerPackage, "saleAmount" | "paidAmount">): boolean {
|
||||
const saleAmount = customerPackage?.saleAmount || 0;
|
||||
const paidAmount = customerPackage?.paidAmount || 0;
|
||||
return 0 < paidAmount && paidAmount < saleAmount;
|
||||
}
|
||||
|
||||
function toQuantityParts(value: number | string): { value: bigint; scale: number } | undefined {
|
||||
const normalized = normalizePackageQuantity(value);
|
||||
if (!normalized) {
|
||||
|
||||
Reference in New Issue
Block a user