support split unit for product order
This commit is contained in:
@@ -100,7 +100,7 @@ const props = defineProps<{
|
||||
order: SalesOrder;
|
||||
canReceive: boolean;
|
||||
canFulfill: boolean;
|
||||
canOperateStock: boolean;
|
||||
canStoreManager: boolean;
|
||||
}>();
|
||||
const emit = defineEmits<{
|
||||
click: [];
|
||||
@@ -113,10 +113,10 @@ const avatarText = computed(() => customerName.value.slice(0, 1) || "客");
|
||||
const photoURL = computed(() => getCustomerPhotoURL(props.order.customer, 64));
|
||||
const orderNoText = computed(() => `订单号:${props.order.orderNo || props.order.id || "未知"}`);
|
||||
const totalProductQuantity = computed(() => sumProductQuantity("quantity"));
|
||||
const fulfilledProductQuantity = computed(() => sumProductQuantity("fulfilledQuantity"));
|
||||
const productSummaryText = computed(() => `共 ${itemList.value.length} 项 · 总数量 ${totalProductQuantity.value} · 已履约 ${fulfilledProductQuantity.value}`);
|
||||
const fulfilledProductQuantity = computed(() => sumProductQuantity("fulfilledBaseQuantity"));
|
||||
const productSummaryText = computed(() => `共 ${itemList.value.length} 项 · 订单数量 ${totalProductQuantity.value} · 已履约(基础)${fulfilledProductQuantity.value}`);
|
||||
const showReceiveAction = computed(() => props.canReceive && props.order.status !== "CANCELLED" && props.order.paymentStatus !== "PAID");
|
||||
const canFulfillByPayment = computed(() => props.order.paymentStatus === "PAID" || (props.order.paymentStatus === "PARTIALLY_PAID" && props.canOperateStock));
|
||||
const canFulfillByPayment = computed(() => props.order.paymentStatus === "PAID" || props.canStoreManager);
|
||||
const showFulfillAction = computed(() => props.canFulfill && canFulfillByPayment.value && props.order.status === "ACTIVE");
|
||||
|
||||
function getPaymentStatusTheme(status?: GaoSalesPaymentStatus): "success" | "warning" | "danger" | "default" {
|
||||
@@ -132,7 +132,7 @@ function getPaymentStatusTheme(status?: GaoSalesPaymentStatus): "success" | "war
|
||||
return "default";
|
||||
}
|
||||
|
||||
function sumProductQuantity(field: "quantity" | "fulfilledQuantity"): string {
|
||||
function sumProductQuantity(field: "quantity" | "fulfilledBaseQuantity"): string {
|
||||
let total = 0;
|
||||
for (const item of itemList.value) {
|
||||
const quantity = Number(item[field] || 0);
|
||||
|
||||
Reference in New Issue
Block a user