add wait revoke
This commit is contained in:
@@ -28,6 +28,14 @@
|
|||||||
:theme="getStatusTheme(props.order.status)"
|
:theme="getStatusTheme(props.order.status)"
|
||||||
/>
|
/>
|
||||||
<t-tag
|
<t-tag
|
||||||
|
v-if="isCancelledPendingRefund"
|
||||||
|
content="待退款"
|
||||||
|
:theme="getStatusTheme(props.order.refundStatus)"
|
||||||
|
size="small"
|
||||||
|
variant="light-outline"
|
||||||
|
/>
|
||||||
|
<t-tag
|
||||||
|
v-else
|
||||||
:content="getSalesPaymentStatusText(props.order.paymentStatus)"
|
:content="getSalesPaymentStatusText(props.order.paymentStatus)"
|
||||||
:theme="getPaymentStatusTheme(props.order.paymentStatus)"
|
:theme="getPaymentStatusTheme(props.order.paymentStatus)"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -64,7 +72,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="actions" @click.stop>
|
<div class="actions" @click.stop>
|
||||||
<t-popover
|
<t-popover
|
||||||
v-if="props.canCancel"
|
v-if="showMoreActionMenu"
|
||||||
v-model:visible="moreVisible"
|
v-model:visible="moreVisible"
|
||||||
placement="bottom-left"
|
placement="bottom-left"
|
||||||
theme="light"
|
theme="light"
|
||||||
@@ -76,8 +84,9 @@
|
|||||||
content="更多"
|
content="更多"
|
||||||
/>
|
/>
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="menu">
|
<div class="more-menu">
|
||||||
<t-button
|
<t-button
|
||||||
|
v-if="props.canCancel"
|
||||||
class="item"
|
class="item"
|
||||||
size="extra-small"
|
size="extra-small"
|
||||||
variant="text"
|
variant="text"
|
||||||
@@ -86,6 +95,25 @@
|
|||||||
:disabled="!canCancelOrder"
|
:disabled="!canCancelOrder"
|
||||||
@click="handleCancel"
|
@click="handleCancel"
|
||||||
>取消订单</t-button>
|
>取消订单</t-button>
|
||||||
|
<t-divider />
|
||||||
|
<t-button
|
||||||
|
v-if="showRefundActions"
|
||||||
|
class="item"
|
||||||
|
size="extra-small"
|
||||||
|
variant="text"
|
||||||
|
theme="danger"
|
||||||
|
type="button"
|
||||||
|
@click="handleRefund"
|
||||||
|
>登记退款</t-button>
|
||||||
|
<t-divider />
|
||||||
|
<t-button
|
||||||
|
v-if="showRefundActions"
|
||||||
|
class="item"
|
||||||
|
size="extra-small"
|
||||||
|
variant="text"
|
||||||
|
type="button"
|
||||||
|
@click="handleConfirmNoRefund"
|
||||||
|
>确认无需退款</t-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</t-popover>
|
</t-popover>
|
||||||
@@ -127,6 +155,7 @@ const props = defineProps<{
|
|||||||
canReceive: boolean;
|
canReceive: boolean;
|
||||||
canFulfill: boolean;
|
canFulfill: boolean;
|
||||||
canCancel: boolean;
|
canCancel: boolean;
|
||||||
|
canRefund: boolean;
|
||||||
canStoreManager: boolean;
|
canStoreManager: boolean;
|
||||||
}>();
|
}>();
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@@ -134,6 +163,8 @@ const emit = defineEmits<{
|
|||||||
cancel: [];
|
cancel: [];
|
||||||
receive: [];
|
receive: [];
|
||||||
fulfill: [];
|
fulfill: [];
|
||||||
|
refund: [];
|
||||||
|
confirmNoRefund: [];
|
||||||
}>();
|
}>();
|
||||||
const moreVisible = ref(false);
|
const moreVisible = ref(false);
|
||||||
const itemList = computed(() => props.order.itemList || []);
|
const itemList = computed(() => props.order.itemList || []);
|
||||||
@@ -142,8 +173,10 @@ const avatarText = computed(() => customerName.value.slice(0, 1) || "客");
|
|||||||
const photoURL = computed(() => getCustomerPhotoURL(props.order.customer, 64));
|
const photoURL = computed(() => getCustomerPhotoURL(props.order.customer, 64));
|
||||||
const orderNoText = computed(() => `订单号:${props.order.orderNo || props.order.id || "未知"}`);
|
const orderNoText = computed(() => `订单号:${props.order.orderNo || props.order.id || "未知"}`);
|
||||||
const totalProductQuantity = computed(() => sumProductQuantity("quantity"));
|
const totalProductQuantity = computed(() => sumProductQuantity("quantity"));
|
||||||
const fulfilledProductQuantity = computed(() => sumProductQuantity("fulfilledBaseQuantity"));
|
|
||||||
const productSummaryText = computed(() => `共 ${itemList.value.length} 项 · 订单数量 ${totalProductQuantity.value}`);
|
const productSummaryText = computed(() => `共 ${itemList.value.length} 项 · 订单数量 ${totalProductQuantity.value}`);
|
||||||
|
const isCancelledPendingRefund = computed(() => props.order.status === "CANCELLED" && props.order.refundStatus === "PENDING");
|
||||||
|
const showRefundActions = computed(() => props.canRefund && isCancelledPendingRefund.value);
|
||||||
|
const showMoreActionMenu = computed(() => props.canCancel || showRefundActions.value);
|
||||||
const showReceiveAction = computed(() => props.canReceive && props.order.status !== "CANCELLED" && props.order.paymentStatus !== "PAID");
|
const showReceiveAction = computed(() => props.canReceive && props.order.status !== "CANCELLED" && props.order.paymentStatus !== "PAID");
|
||||||
const canCancelOrder = computed(() => props.order.status === "ACTIVE");
|
const canCancelOrder = computed(() => props.order.status === "ACTIVE");
|
||||||
const canFulfillByPayment = computed(() => props.order.paymentStatus === "PAID" || props.canStoreManager);
|
const canFulfillByPayment = computed(() => props.order.paymentStatus === "PAID" || props.canStoreManager);
|
||||||
@@ -157,6 +190,22 @@ function handleCancel(): void {
|
|||||||
emit("cancel");
|
emit("cancel");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleRefund(): void {
|
||||||
|
if (!showRefundActions.value || !props.order.id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
moreVisible.value = false;
|
||||||
|
emit("refund");
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleConfirmNoRefund(): void {
|
||||||
|
if (!showRefundActions.value || !props.order.id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
moreVisible.value = false;
|
||||||
|
emit("confirmNoRefund");
|
||||||
|
}
|
||||||
|
|
||||||
function getPaymentStatusTheme(status?: GaoSalesPaymentStatus): "success" | "warning" | "danger" | "default" {
|
function getPaymentStatusTheme(status?: GaoSalesPaymentStatus): "success" | "warning" | "danger" | "default" {
|
||||||
if (status === "PAID") {
|
if (status === "PAID") {
|
||||||
return "success";
|
return "success";
|
||||||
@@ -303,22 +352,12 @@ function getProductText(item: NonNullable<SalesOrder["itemList"]>[number]): stri
|
|||||||
justify-content: end;
|
justify-content: end;
|
||||||
|
|
||||||
:deep(.t-popover__content) {
|
:deep(.t-popover__content) {
|
||||||
padding: .5rem 1rem;
|
padding: .25rem .5rem;
|
||||||
border-radius: .875rem;
|
border-radius: .875rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.more {
|
.more {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
|
||||||
.menu {
|
|
||||||
padding: 0 .5rem;
|
|
||||||
min-width: 7rem;
|
|
||||||
|
|
||||||
.item {
|
|
||||||
width: 100%;
|
|
||||||
justify-content: flex-start;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.detail {
|
.detail {
|
||||||
@@ -328,6 +367,21 @@ function getProductText(item: NonNullable<SalesOrder["itemList"]>[number]): stri
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.more-menu {
|
||||||
|
--td-divider-color: var(--td-gray-color-2);
|
||||||
|
|
||||||
|
padding: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 .5rem;
|
||||||
|
font-weight: normal;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
:deep(.sales-order-cell .avatar .t-image__img) {
|
:deep(.sales-order-cell .avatar .t-image__img) {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
Reference in New Issue
Block a user