feat(point): point redemption in product stock list and detail

This commit is contained in:
Timi
2026-11-18 16:41:23 +08:00
parent e88374c377
commit 754e61eb5d
2 changed files with 23 additions and 2 deletions
@@ -71,6 +71,13 @@
<t-cell-group title="库存流水" theme="card" v-entrance-transition>
<t-cell title="操作类型" :note="getStockOperationText(record.operationType)" />
<t-cell title="业务类型" :note="getBizTypeText(record.bizType)" />
<t-cell
v-if="relatedRedemptionId && canReadRedemption"
title="关联积分兑换单"
note="查看兑换详情"
arrow
@click="toRedemption"
/>
<t-cell
v-if="relatedFulfillmentId && canReadFulfillment"
title="关联履约单"
@@ -202,6 +209,9 @@ const canManualRevoke = computed(() => {
&& !record.value?.revokeRecordId
&& userStore.hasPermissions(permissionCodes.productStock.manualRevoke);
});
const canReadRedemption = computed(() => userStore.hasPermissions(permissionCodes.pointRedemption.create));
const relatedRedemptionId = computed(() => record.value?.operationType === "POINT_REDEMPTION_OUT"
&& record.value.bizType === "POINT_REDEMPTION" ? record.value.bizId : "");
const canReadFulfillment = computed(() => userStore.hasPermissions(permissionCodes.orderFulfillment.read));
const relatedFulfillmentId = computed(() => record.value?.bizType === "ORDER_FULFILLMENT" ? record.value.bizId : "");
const photoItemList = computed<PhotoItem[]>(() => (record.value?.attachmentList || [])
@@ -265,6 +275,17 @@ async function openRelatedRecord(id?: string): Promise<void> {
}
}
async function toRedemption(): Promise<void> {
if (!relatedRedemptionId.value || !canReadRedemption.value) {
return;
}
await router.push({
name: "PointRedemptionDetail",
params: { id: relatedRedemptionId.value },
query: { transitionDepth: String(getCurrentRouteDepth() + 1) }
});
}
async function toFulfillment(): Promise<void> {
if (!relatedFulfillmentId.value || !canReadFulfillment.value) {
return;
+2 -2
View File
@@ -116,7 +116,7 @@
class="avatar"
/>
<div
v-else-if="record.customer"
v-else-if="record.customer || record.operationType === 'POINT_REDEMPTION_OUT'"
class="avatar fallback"
v-text="getCustomerText(record).slice(0, 1)"
/>
@@ -133,7 +133,7 @@
</template>
<template #title>
<div class="title">
<span v-if="record.customer" class="actor" v-text="getCustomerText(record)" />
<span v-if="record.customer || record.operationType === 'POINT_REDEMPTION_OUT'" class="actor" v-text="getCustomerText(record)" />
<span v-else-if="record.operator" class="actor" v-text="getOperatorText(record)" />
<strong class="operation" :class="getOperationClass(record.operationType)" v-text="getStockOperationText(record.operationType)" />
<strong class="product-name clip-text" v-text="record.productNameSnapshot || '未命名产品'" />