add PointLedgerDetail.vue
This commit is contained in:
@@ -83,9 +83,9 @@
|
||||
v-for="item in pageResult.list"
|
||||
:key="item.id"
|
||||
class="item"
|
||||
:arrow="!!item.eventRecordId"
|
||||
:hover="!!item.eventRecordId"
|
||||
@click="toRecord(item)"
|
||||
:arrow="!!item.id"
|
||||
:hover="!!item.id"
|
||||
@click="toDetail(item)"
|
||||
>
|
||||
<template #leftIcon>
|
||||
<t-image
|
||||
@@ -410,16 +410,6 @@ function buildListOptions(): { allStores?: boolean; storeId?: string } | undefin
|
||||
|
||||
// ---------- 展示与导航 ----------
|
||||
|
||||
// function getLedgerTitle(item: PointLedger): string {
|
||||
// if (item.changeType === "EARN") {
|
||||
// return "登记事件获得积分";
|
||||
// }
|
||||
// if (item.changeType === "REVOKE") {
|
||||
// return "删除登记记录撤销积分";
|
||||
// }
|
||||
// return "人工调整积分";
|
||||
// }
|
||||
|
||||
function getLedgerDescription(item: PointLedger): string {
|
||||
const parts = [`余额 ${item.balanceBefore ?? 0} → ${item.balanceAfter ?? 0}`];
|
||||
if (item.remark) {
|
||||
@@ -441,10 +431,35 @@ function getLedgerTheme(item: PointLedger): string {
|
||||
return item.pointDelta && 0 < item.pointDelta ? "increase" : "decrease";
|
||||
}
|
||||
|
||||
async function toRecord(item: PointLedger): Promise<void> {
|
||||
if (item.eventRecordId) {
|
||||
await router.push(`/management/registration-event-records/${item.eventRecordId}`);
|
||||
async function toDetail(item: PointLedger): Promise<void> {
|
||||
if (!item.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
const snapshot: PointLedger = {
|
||||
id: item.id,
|
||||
accountId: item.accountId,
|
||||
storeId: item.storeId,
|
||||
customerId: item.customerId,
|
||||
changeType: item.changeType,
|
||||
direction: item.direction,
|
||||
pointDelta: item.pointDelta,
|
||||
balanceBefore: item.balanceBefore,
|
||||
balanceAfter: item.balanceAfter,
|
||||
ruleId: item.ruleId,
|
||||
eventId: item.eventId,
|
||||
eventRecordId: item.eventRecordId,
|
||||
sourcePayload: item.sourcePayload,
|
||||
idempotencyKey: item.idempotencyKey,
|
||||
remark: item.remark,
|
||||
operatorUserId: item.operatorUserId,
|
||||
occurredAt: item.occurredAt
|
||||
};
|
||||
await router.push({
|
||||
name: "PointLedgerDetail",
|
||||
params: { id: item.id },
|
||||
query: { snapshot: JSON.stringify(snapshot) }
|
||||
});
|
||||
}
|
||||
|
||||
async function toAdjust(): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user