fix FundRecordRevoke.vue style
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<section class="hero" v-entrance-transition>
|
||||
<div class="header">
|
||||
<span class="eyebrow" v-text="'资金流水'" />
|
||||
<t-tag :content="getFundStatusText(record.status)" :theme="getStatusTheme(record.status)" variant="light-outline" />
|
||||
<t-tag :content="getRecordStatusText(record)" :theme="getRecordStatusTheme(record)" variant="light-outline" />
|
||||
</div>
|
||||
<h1 class="title" v-text="getFundOperationText(record.operationType)" />
|
||||
<div class="amount">
|
||||
@@ -12,19 +12,28 @@
|
||||
<strong class="value red text-bold" v-text="formatPackageAmount(record.amount)" />
|
||||
</div>
|
||||
</section>
|
||||
<t-cell-group title="资金记录" theme="card" v-entrance-transition>
|
||||
<t-cell-group title="订单信息" theme="card" v-entrance-transition="70">
|
||||
<t-cell title="订单总价" :note="formatPackageAmount(record.salesOrderAmount)" />
|
||||
<t-cell title="剩余待收款(流水快照)" :note="formatPackageAmount(record.salesOrderUnpaidAmountSnapshot)" />
|
||||
</t-cell-group>
|
||||
<t-cell-group title="资金记录" theme="card" v-entrance-transition="140">
|
||||
<t-cell title="操作类型" :note="getFundOperationText(record.operationType)" />
|
||||
<t-cell title="状态">
|
||||
<template #note>
|
||||
<t-tag
|
||||
:content="getFundStatusText(record.status)"
|
||||
:theme="getStatusTheme(record.status)"
|
||||
:content="getRecordStatusText(record)"
|
||||
:theme="getRecordStatusTheme(record)"
|
||||
variant="light-outline"
|
||||
/>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="金额" :note="formatPackageAmount(record.amount)" />
|
||||
<t-cell v-if="record.sourceRecordId" title="原资金记录" :note="record.sourceRecordId" />
|
||||
<t-cell
|
||||
v-if="record.sourceRecordId"
|
||||
title="冲正流水"
|
||||
arrow
|
||||
@click="toSourceRecord"
|
||||
/>
|
||||
<t-cell title="备注" :note="Text.display(record.remark)" />
|
||||
<t-cell v-if="record.reason" title="拒绝/撤销原因" :note="Text.display(record.reason)" />
|
||||
<t-cell
|
||||
@@ -43,7 +52,7 @@
|
||||
/>
|
||||
</div>
|
||||
</t-cell-group>
|
||||
<t-cell-group theme="card">
|
||||
<t-cell-group theme="card" v-entrance-transition="210">
|
||||
<t-cell
|
||||
title="发起人"
|
||||
:note="record.operator?.name || record.operator?.nick || '未知'"
|
||||
@@ -66,7 +75,7 @@
|
||||
<section
|
||||
v-if="isPendingReceive || canRevoke"
|
||||
class="actions"
|
||||
v-entrance-transition="70"
|
||||
v-entrance-transition="280"
|
||||
>
|
||||
<div class="pair">
|
||||
<t-button
|
||||
@@ -144,12 +153,23 @@ const isLoading = ref(false);
|
||||
const isPendingReceive = computed(() => record.value?.operationType === "RECEIVE" && record.value.status === "PENDING");
|
||||
const canVerifyReceive = computed(() => isPendingReceive.value && userStore.hasPermissions(permissionCodes.fundReceive.verify));
|
||||
const canCancelReceive = computed(() => isPendingReceive.value && userStore.hasPermissions(permissionCodes.fundReceive.create));
|
||||
const canRevoke = computed(() => record.value?.status === "VERIFIED" && record.value.operationType !== "REVOKE" && userStore.hasPermissions(permissionCodes.fund.revoke));
|
||||
const canRevoke = computed(() => record.value?.status === "VERIFIED"
|
||||
&& record.value.operationType !== "REVOKE"
|
||||
&& !record.value.revokeRecordId
|
||||
&& userStore.hasPermissions(permissionCodes.fund.revoke));
|
||||
|
||||
function getStatusTheme(status?: FundRecordStatus): "success" | "warning" | "danger" | "default" {
|
||||
return status === "VERIFIED" ? "success" : status === "PENDING" ? "warning" : status === "REJECTED" ? "danger" : "default";
|
||||
}
|
||||
|
||||
function getRecordStatusText(recordValue: FundRecord): string {
|
||||
return recordValue.revokeRecordId ? "已被冲正" : getFundStatusText(recordValue.status);
|
||||
}
|
||||
|
||||
function getRecordStatusTheme(recordValue: FundRecord): "success" | "warning" | "danger" | "default" {
|
||||
return recordValue.revokeRecordId ? "danger" : getStatusTheme(recordValue.status);
|
||||
}
|
||||
|
||||
async function loadData(): Promise<void> {
|
||||
const id = String(route.params.id || "");
|
||||
if (!id) {
|
||||
@@ -179,6 +199,18 @@ async function toSalesOrder(): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
// ---------- 原资金记录 ----------
|
||||
|
||||
async function toSourceRecord(): Promise<void> {
|
||||
if (!record.value?.sourceRecordId) {
|
||||
return;
|
||||
}
|
||||
await router.push({
|
||||
path: `/management/fund-records/${record.value.sourceRecordId}`,
|
||||
query: { transitionDepth: String(getCurrentRouteDepth() + 1) }
|
||||
});
|
||||
}
|
||||
|
||||
function getCurrentRouteDepth(): number {
|
||||
const transitionDepth = Array.isArray(route.query.transitionDepth)
|
||||
? route.query.transitionDepth[0]
|
||||
@@ -216,7 +248,11 @@ async function verifyReceive(): Promise<void> {
|
||||
const dialog = DialogPlugin.confirm({
|
||||
title: "核销收款",
|
||||
content: "核销后该金额才会计入套餐的已收款。确定继续?",
|
||||
cancelBtn: "取消",
|
||||
confirmBtn: "核销",
|
||||
onCancel() {
|
||||
dialog.destroy();
|
||||
},
|
||||
onConfirm: async () => {
|
||||
isOperating.value = true;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user