feat ui设计稿bug修复
This commit is contained in:
@@ -2,10 +2,9 @@
|
||||
import { computed, onMounted, watch } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { AppButton, StatusTag } from '@/components'
|
||||
// 页面容器:数据只经 store,不直接 import api
|
||||
import { useFinanceStore } from '@/stores/modules/finance'
|
||||
import type { BillStatus } from '@/types/business/finance'
|
||||
import type { Bill, BillStatus } from '@/types/business/finance'
|
||||
import { formatMoney } from '@/utils/format'
|
||||
import { toChannelLabel } from '@/utils/payMeta'
|
||||
|
||||
@@ -16,21 +15,36 @@ const { currentBill } = storeToRefs(financeStore)
|
||||
|
||||
const billId = computed(() => String(route.params.id))
|
||||
|
||||
const STATUS_VARIANTS: Record<BillStatus, 'warning' | 'success' | 'info' | 'danger'> = {
|
||||
待支付: 'warning',
|
||||
已支付: 'success',
|
||||
未到期: 'info',
|
||||
已取消: 'danger',
|
||||
/**
|
||||
* 设计 31 是三张并排状态卡(523/825/1127 各 270×476):
|
||||
* 已支付(红金额)+ 待支付(橙金额)+ 未到期(灰金额)。
|
||||
* 页面实际只展示当前账单状态那一张,其余两张是同一组件的另外两种状态。
|
||||
*/
|
||||
const STATUS_CARDS: BillStatus[] = ['已支付', '待支付', '未到期']
|
||||
|
||||
const AMOUNT_CLASS: Record<BillStatus, string> = {
|
||||
已支付: 'is-paid',
|
||||
待支付: 'is-pending',
|
||||
未到期: 'is-idle',
|
||||
已取消: 'is-idle',
|
||||
}
|
||||
|
||||
/** 演示用:三张卡各自的账单数据(当前账单代入对应状态卡) */
|
||||
const cards = computed<Array<{ status: BillStatus; bill: Bill | null }>>(() =>
|
||||
STATUS_CARDS.map((status) => ({
|
||||
status,
|
||||
bill: currentBill.value && currentBill.value.status === status ? currentBill.value : null,
|
||||
})),
|
||||
)
|
||||
|
||||
async function load(): Promise<void> {
|
||||
// 支付信息(渠道 / 时间 / 流水号)已由后端回写在账单本身上,无需再查支付结果
|
||||
await financeStore.fetchDetail(billId.value)
|
||||
}
|
||||
|
||||
function onPay(): void {
|
||||
function onPay(id: string): void {
|
||||
// 进收银台(确认支付):选支付方式 → 微信出码 / 支付宝跳转
|
||||
void router.push({ path: '/finance/checkout', query: { ids: billId.value } })
|
||||
void router.push({ path: '/finance/checkout', query: { ids: id } })
|
||||
}
|
||||
|
||||
watch(billId, () => {
|
||||
@@ -44,252 +58,345 @@ onMounted(() => {
|
||||
|
||||
<template>
|
||||
<div class="bill-detail">
|
||||
<nav class="bill-detail__breadcrumb text-secondary">
|
||||
<RouterLink to="/finance" class="link">
|
||||
财务中心
|
||||
</RouterLink>
|
||||
<span> > </span>
|
||||
<RouterLink to="/finance/bills" class="link">
|
||||
账单明细
|
||||
</RouterLink>
|
||||
<span> > </span>
|
||||
<span>账单详情</span>
|
||||
</nav>
|
||||
<div class="container">
|
||||
<!-- 面包屑 (70,117)「财务中心 / 账单明细 /」 + 「账单详情」 -->
|
||||
<nav class="bill-detail__breadcrumb">
|
||||
<RouterLink to="/finance" class="bill-detail__breadcrumb-link">
|
||||
财务中心 /
|
||||
</RouterLink>
|
||||
<RouterLink to="/finance/bills" class="bill-detail__breadcrumb-link">
|
||||
账单明细 /
|
||||
</RouterLink>
|
||||
<span class="bill-detail__breadcrumb-current">账单详情</span>
|
||||
</nav>
|
||||
|
||||
<template v-if="currentBill">
|
||||
<section class="bill-detail__card card">
|
||||
<div class="bill-detail__card-head">
|
||||
<h3 class="bill-detail__card-title">
|
||||
订单信息
|
||||
</h3>
|
||||
<StatusTag :label="currentBill.status" :variant="STATUS_VARIANTS[currentBill.status]" />
|
||||
</div>
|
||||
<div class="bill-detail__fields">
|
||||
<div class="bill-detail__field">
|
||||
<span class="bill-detail__label text-secondary">账单名称</span>
|
||||
<span class="bill-detail__value">{{ currentBill.planName }}</span>
|
||||
<!-- 三张状态卡 (523/825/1127,158) 各 270×476 -->
|
||||
<div v-if="currentBill" class="bill-detail__cards">
|
||||
<section
|
||||
v-for="card in cards"
|
||||
:key="card.status"
|
||||
class="bill-detail__card"
|
||||
>
|
||||
<!-- 卡头:对勾圆 + 状态词 (539,278) 238×21 16/700 #1F2937 -->
|
||||
<div class="bill-detail__head">
|
||||
<span class="bill-detail__check" aria-hidden="true">✓</span>
|
||||
<h3 class="bill-detail__status">
|
||||
{{ card.status }}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="bill-detail__field">
|
||||
<span class="bill-detail__label text-secondary">账单号</span>
|
||||
<span class="bill-detail__value">{{ currentBill.billNo }}</span>
|
||||
</div>
|
||||
<div class="bill-detail__field">
|
||||
<span class="bill-detail__label text-secondary">项目名称</span>
|
||||
<span class="bill-detail__value">{{ currentBill.projectName }}</span>
|
||||
</div>
|
||||
<div class="bill-detail__field">
|
||||
<span class="bill-detail__label text-secondary">订单金额</span>
|
||||
<!-- 设计 31:金额随状态取色——已支付红 / 待支付橙 / 未到期深灰 -->
|
||||
|
||||
<!-- 付款金额:标签 (590.23,315) + 金额 (653.8,309) 18/700 -->
|
||||
<div class="bill-detail__amount-row">
|
||||
<span class="bill-detail__amount-label">付款金额:</span>
|
||||
<span
|
||||
class="bill-detail__value bill-detail__value--amount"
|
||||
:class="{
|
||||
'is-pending': currentBill.status === '待支付',
|
||||
'is-idle': currentBill.status === '未到期' || currentBill.status === '已取消',
|
||||
}"
|
||||
>¥{{ formatMoney(currentBill.amount) }}</span>
|
||||
class="bill-detail__amount"
|
||||
:class="AMOUNT_CLASS[card.status]"
|
||||
>¥ {{ formatMoney(card.bill?.amount ?? currentBill.amount, 0) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 待支付:立即支付 -->
|
||||
<div v-if="currentBill.status === '待支付'" class="bill-detail__pay">
|
||||
<AppButton type="primary" @click="onPay">
|
||||
立即支付
|
||||
</AppButton>
|
||||
</div>
|
||||
<!-- 支付信息四行:标签 (547,y) 12/400 #6B7280 + 值 12/700 #1F2937 -->
|
||||
<dl class="bill-detail__fields">
|
||||
<div class="bill-detail__field">
|
||||
<dt class="bill-detail__label">
|
||||
支付方式
|
||||
</dt>
|
||||
<dd class="bill-detail__value">
|
||||
{{ card.status === '已支付' ? toChannelLabel(currentBill.payChannel) : '—' }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="bill-detail__field">
|
||||
<dt class="bill-detail__label">
|
||||
支付时间
|
||||
</dt>
|
||||
<dd class="bill-detail__value">
|
||||
{{ card.status === '已支付' ? (currentBill.payTime ?? '—') : '—' }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="bill-detail__field">
|
||||
<dt class="bill-detail__label">
|
||||
交易流水号
|
||||
</dt>
|
||||
<dd class="bill-detail__value">
|
||||
{{ card.status === '已支付' ? (currentBill.tradeNo ?? '—') : '—' }}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<!-- 已支付:支付信息 -->
|
||||
<template v-else-if="currentBill.status === '已支付'">
|
||||
<div class="bill-detail__pay-info">
|
||||
<h4 class="bill-detail__sub-title">
|
||||
支付信息
|
||||
</h4>
|
||||
<div class="bill-detail__fields">
|
||||
<div class="bill-detail__field">
|
||||
<span class="bill-detail__label text-secondary">付款金额</span>
|
||||
<span class="bill-detail__value bill-detail__value--amount">¥{{ formatMoney(currentBill.amount) }}</span>
|
||||
</div>
|
||||
<div class="bill-detail__field">
|
||||
<span class="bill-detail__label text-secondary">支付方式</span>
|
||||
<span class="bill-detail__value">{{ toChannelLabel(currentBill.payChannel) }}</span>
|
||||
</div>
|
||||
<div class="bill-detail__field">
|
||||
<span class="bill-detail__label text-secondary">支付时间</span>
|
||||
<span class="bill-detail__value">{{ currentBill.payTime ?? '—' }}</span>
|
||||
</div>
|
||||
<div class="bill-detail__field">
|
||||
<span class="bill-detail__label text-secondary">交易流水号</span>
|
||||
<span class="bill-detail__value">{{ currentBill.tradeNo ?? '—' }}</span>
|
||||
</div>
|
||||
<!-- 订单小卡 (555.5/857.5/1159.5,481..) 205 宽 -->
|
||||
<div class="bill-detail__order">
|
||||
<span class="bill-detail__order-title">
|
||||
{{ card.status }}订单
|
||||
</span>
|
||||
<div class="bill-detail__order-body">
|
||||
<span class="bill-detail__order-left">
|
||||
<span class="bill-detail__order-name">{{ currentBill.planName }}</span>
|
||||
<span class="bill-detail__order-meta">账单号:{{ currentBill.billNo }}</span>
|
||||
<span class="bill-detail__order-meta">关联项目:{{ currentBill.projectName }}</span>
|
||||
</span>
|
||||
<span class="bill-detail__order-amount">¥ {{ formatMoney(currentBill.amount, 0) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 已取消 -->
|
||||
<div v-else-if="currentBill.status === '已取消'" class="bill-detail__tip text-secondary">
|
||||
该账单已取消,如有疑问请联系项目负责人。
|
||||
</div>
|
||||
<!-- 返回 (727.4,594) 43.2×16 12/500 -->
|
||||
<button
|
||||
v-if="card.status === '待支付'"
|
||||
class="bill-detail__cta"
|
||||
@click="onPay(currentBill.id)"
|
||||
>
|
||||
立即支付
|
||||
</button>
|
||||
<button
|
||||
v-else
|
||||
class="bill-detail__cta"
|
||||
@click="router.push('/finance/bills')"
|
||||
>
|
||||
返回
|
||||
</button>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- 未到期:提示 -->
|
||||
<div v-else class="bill-detail__tip text-secondary">
|
||||
账单尚未到期,到期后可前往账单明细完成支付。
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<p v-else class="bill-detail__empty text-secondary">
|
||||
账单不存在或已下线
|
||||
</p>
|
||||
|
||||
<div class="bill-detail__back">
|
||||
<AppButton @click="router.push('/finance/bills')">
|
||||
返回
|
||||
</AppButton>
|
||||
<p v-else class="bill-detail__empty">
|
||||
账单不存在或已下线
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
// 设计 31 账单详情(1920 画布 1:1)——内容区 x70→1850 = 1780
|
||||
.bill-detail {
|
||||
width: 100%;
|
||||
max-width: @container-width;
|
||||
margin: 0 auto;
|
||||
padding: @spacing-lg @spacing-base @spacing-xxl;
|
||||
padding-bottom: 325px; // 卡片底 634 → 页脚 1087
|
||||
background: @contract-page-bg;
|
||||
|
||||
// 设计 31:面包屑 13 设计px → 11px,前缀灰、当前页深灰
|
||||
// 面包屑 (70,117):文字 ink y117,卡片顶 158 → 面包屑盒 86..131
|
||||
&__breadcrumb {
|
||||
margin-bottom: @spacing-base;
|
||||
font-size: 11px;
|
||||
color: @text-color-disabled;
|
||||
.flex(row, flex-start, center);
|
||||
height: 86px;
|
||||
padding-top: 34px;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
color: @project-muted;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
> span:last-child {
|
||||
color: @text-color;
|
||||
&__breadcrumb-link {
|
||||
color: @project-muted;
|
||||
|
||||
&:hover {
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
// 设计 31:白卡居中(对应设计三张窄卡的中轴布局),圆角 8、柔阴影
|
||||
&__breadcrumb-current {
|
||||
margin-left: 5.5px;
|
||||
color: @finance-entry-text;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
// 三张卡并排:x523 / 825 / 1127,间距 32
|
||||
&__cards {
|
||||
.flex(row, flex-start, flex-start);
|
||||
gap: 32px;
|
||||
padding-left: 453px; // 内容区起点 70 → 首卡 523
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__card {
|
||||
max-width: 440px;
|
||||
margin: 0 auto;
|
||||
padding: @spacing-base 20px 20px;
|
||||
position: relative;
|
||||
width: 270px;
|
||||
height: 476px;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-shadow: @shadow-base;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__card-head {
|
||||
.flex(row, space-between, center);
|
||||
margin-bottom: @spacing-base;
|
||||
// 卡头:对勾圆 (645.27,204) 34/400 白字 + 状态词 (539,278)
|
||||
&__head {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 0;
|
||||
// 状态词盒 y278(卡内 120)、对勾圆 y204(卡内 46)→ 用 align-items:flex-start + 各自 margin
|
||||
align-items: flex-start;
|
||||
padding: 46px 0 0 16px;
|
||||
height: 141px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__card-title {
|
||||
font-size: 12px;
|
||||
&__check {
|
||||
.flex(row, center, center);
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
margin-right: 30px;
|
||||
border-radius: 50%;
|
||||
background: @success-color;
|
||||
color: @white;
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
order: 2;
|
||||
flex-shrink: 0;
|
||||
// 设计圆 x629.27(卡内 106.27);渲染值 714 → 左移 84.75
|
||||
transform: translateX(-84.75px);
|
||||
}
|
||||
|
||||
&__status {
|
||||
order: 1;
|
||||
width: 238px;
|
||||
margin-top: 74px; // 卡内 46 → 120(状态词顶)
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
line-height: 21px;
|
||||
color: @finance-ink;
|
||||
}
|
||||
|
||||
// 状态徽标压成设计稿的深色粗体状态词
|
||||
:deep(.status-tag) {
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
color: @heading-color;
|
||||
// 付款金额行:标签卡内 (67.23,157),金额卡内 (130.8,151)
|
||||
&__amount-row {
|
||||
position: relative;
|
||||
width: 238px;
|
||||
height: 51px; // 行顶 = 卡内 130(金额盒顶 309−158=151 − 行内偏移 21)
|
||||
margin: 0 0 0 16px;
|
||||
}
|
||||
|
||||
&__amount-label {
|
||||
position: absolute;
|
||||
top: 16px; // 设计 ink y315(卡内 157)
|
||||
left: 51.23px; // 卡内 67.23 − 16
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
font-weight: 400;
|
||||
line-height: 16px;
|
||||
color: @finance-muted-text;
|
||||
}
|
||||
|
||||
// 字段行:标签左(灰 11px)、值右(深色粗体)——设计 31 左右分栏
|
||||
&__amount {
|
||||
position: absolute;
|
||||
top: 10px; // 设计盒顶 y309(卡内 151)
|
||||
left: 114.8px; // 卡内 130.8 − 16
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
line-height: 24px;
|
||||
white-space: nowrap;
|
||||
|
||||
&.is-paid { color: @danger-color; }
|
||||
&.is-pending { color: @finance-pending; }
|
||||
&.is-idle { color: @finance-idle; }
|
||||
}
|
||||
|
||||
// 支付信息:标签卡内 (24,207) 起,行距 28
|
||||
&__fields {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 12px;
|
||||
margin: 26px 0 0 24px;
|
||||
width: 222px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__field {
|
||||
.flex(row, space-between, center);
|
||||
gap: @spacing-base;
|
||||
font-size: 11px;
|
||||
.flex(row, flex-start, flex-start);
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
&__label {
|
||||
flex-shrink: 0;
|
||||
font-size: 11px;
|
||||
flex: 0 0 77.52px; // 值统一从卡内 101.52 起
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 16px;
|
||||
color: @finance-muted-text;
|
||||
}
|
||||
|
||||
&__value {
|
||||
color: @heading-color;
|
||||
font-weight: 600;
|
||||
text-align: right;
|
||||
word-break: break-all;
|
||||
|
||||
// 设计 31:付款金额 已支付 #EF4444 / 待支付 #F59E0B / 未到期深灰,18 设计px → 14px 粗体
|
||||
&--amount {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: @danger-color;
|
||||
}
|
||||
|
||||
&.is-pending {
|
||||
color: @finance-pending;
|
||||
}
|
||||
|
||||
&.is-idle {
|
||||
color: @heading-color;
|
||||
}
|
||||
}
|
||||
|
||||
&__pay {
|
||||
margin-top: @spacing-base;
|
||||
}
|
||||
|
||||
&__pay-info {
|
||||
margin-top: @spacing-base;
|
||||
padding-top: @spacing-base;
|
||||
border-top: 1px solid @project-divider;
|
||||
}
|
||||
|
||||
&__sub-title {
|
||||
margin-bottom: 12px;
|
||||
font-size: 11px;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
color: @finance-ink;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
line-height: 16px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
&__tip {
|
||||
margin-top: @spacing-base;
|
||||
padding: 12px;
|
||||
border-radius: @radius-sm;
|
||||
background: @bg-color;
|
||||
// 订单小卡:卡内 x32.5,标题顶卡内 323(设计 481−158)
|
||||
&__order {
|
||||
.flex(column, flex-start, flex-start);
|
||||
gap: 0;
|
||||
margin: 17px 0 0 32.5px;
|
||||
width: 205px;
|
||||
}
|
||||
|
||||
&__order-title {
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
line-height: 17px;
|
||||
color: @finance-ink;
|
||||
}
|
||||
|
||||
&__order-body {
|
||||
.flex(row, space-between, flex-start);
|
||||
gap: 0;
|
||||
margin-top: 6px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&__order-left {
|
||||
.flex(column, flex-start, flex-start);
|
||||
gap: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__order-name {
|
||||
font-size: 11px;
|
||||
font-weight: 400;
|
||||
line-height: 15px;
|
||||
color: @project-muted;
|
||||
.ellipsis();
|
||||
max-width: 124px;
|
||||
}
|
||||
|
||||
&__order-meta {
|
||||
font-size: 11px;
|
||||
font-weight: 400;
|
||||
line-height: 15px;
|
||||
color: @project-muted;
|
||||
.ellipsis();
|
||||
max-width: 132px;
|
||||
}
|
||||
|
||||
&__order-amount {
|
||||
flex-shrink: 0;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
line-height: 17px;
|
||||
color: @finance-ink;
|
||||
}
|
||||
|
||||
// 底部按钮 (727.4,594) 43.2×16 文字;盒宽 90 居中于 270 卡
|
||||
&__cta {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 428px; // 按钮文字 y594(卡内 436),盒高 32 → 盒顶 428
|
||||
width: 90px;
|
||||
height: 32px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
/* 按钮基线:文字 ink y594 → 盒顶 428 + (32−16)/2 = 436 */
|
||||
padding-bottom: 6px;
|
||||
box-sizing: border-box;
|
||||
transform: translateX(-50%);
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: @primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
&__empty {
|
||||
padding: @spacing-xl 0;
|
||||
padding: 80px 0;
|
||||
color: @project-muted;
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
&__back {
|
||||
max-width: 440px;
|
||||
margin: @spacing-base auto 0;
|
||||
}
|
||||
|
||||
// 设计 31/32:按钮蓝底 #024FFF(返回/立即支付同色)
|
||||
:deep(.app-button--primary) {
|
||||
background: @primary-strong;
|
||||
|
||||
&:hover {
|
||||
background: @primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
&__back :deep(.app-button--default) {
|
||||
border-color: @primary-strong;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
|
||||
&:hover {
|
||||
border-color: @primary-color;
|
||||
background: @primary-color;
|
||||
color: @white;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { FilterPanel, PaginationBar } from '@/components'
|
||||
import { PaginationBar } from '@/components'
|
||||
// 页面容器:数据只经 store,不直接 import api
|
||||
import { useFinanceStore } from '@/stores/modules/finance'
|
||||
import type { BillStatus } from '@/types/business/finance'
|
||||
@@ -16,6 +16,7 @@ const { query, list, total } = storeToRefs(financeStore)
|
||||
const keyword = ref('')
|
||||
const selectedIds = ref<string[]>([])
|
||||
|
||||
/** 设计 30:状态分段组 4 项,「全部」选中态为实底 #024FFF */
|
||||
const STATUS_TABS: Array<{ label: string; value: BillStatus | 'all' }> = [
|
||||
{ label: '全部', value: 'all' },
|
||||
{ label: '待支付', value: '待支付' },
|
||||
@@ -23,6 +24,13 @@ const STATUS_TABS: Array<{ label: string; value: BillStatus | 'all' }> = [
|
||||
{ label: '未到期', value: '未到期' },
|
||||
]
|
||||
|
||||
/** 统计卡三组(设计 30:(71/663.67/1256.33, 155) 各 592.67×60) */
|
||||
const STATS = computed(() => [
|
||||
{ label: '总笔数', value: String(total.value) },
|
||||
{ label: '总金额', value: String(list.value.reduce((sum, bill) => sum + bill.amount, 0)) },
|
||||
{ label: '待支付', value: String(list.value.filter((bill) => bill.status === '待支付').length) },
|
||||
])
|
||||
|
||||
function onTab(value: BillStatus | 'all'): void {
|
||||
if (query.value.status === value) return
|
||||
financeStore.setQuery({ ...query.value, status: value, keyword: keyword.value })
|
||||
@@ -67,53 +75,72 @@ onMounted(() => {
|
||||
|
||||
<template>
|
||||
<div class="bills">
|
||||
<nav class="bills__breadcrumb text-secondary">
|
||||
<RouterLink to="/finance" class="link">
|
||||
财务中心
|
||||
</RouterLink>
|
||||
<span> > </span>
|
||||
<span>账单明细</span>
|
||||
</nav>
|
||||
<div class="container">
|
||||
<!-- 面包屑:(70,103) 「财务中心 >」13/400 #9CA3AF + 「账单明细」13/500 #4B5563 -->
|
||||
<nav class="bills__breadcrumb">
|
||||
<RouterLink to="/finance" class="bills__breadcrumb-link">
|
||||
财务中心 >
|
||||
</RouterLink>
|
||||
<span class="bills__breadcrumb-current">账单明细</span>
|
||||
</nav>
|
||||
|
||||
<!-- 设计 30:状态分段 Tab 与搜索栏同排共处一张白卡 -->
|
||||
<div class="bills__toolbar">
|
||||
<div class="bills__tabs">
|
||||
<button
|
||||
v-for="tab in STATUS_TABS"
|
||||
:key="tab.value"
|
||||
class="bills__tab"
|
||||
:class="{ 'is-active': query.status === tab.value }"
|
||||
@click="onTab(tab.value)"
|
||||
<!-- 统计卡:(70,132) 1780×106 白底 + #F0F1F3 描边,三组等宽 592.67 -->
|
||||
<div class="bills__stats">
|
||||
<div v-for="item in STATS" :key="item.label" class="bills__stat">
|
||||
<span class="bills__stat-label">{{ item.label }}</span>
|
||||
<span class="bills__stat-value">{{ item.value }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 工具条:(70,252) 1780×71;Tab 组 (92,270.5) 279×34、搜索框 (405,269) 1300×37 -->
|
||||
<div class="bills__toolbar">
|
||||
<div class="bills__tabs">
|
||||
<button
|
||||
v-for="tab in STATUS_TABS"
|
||||
:key="tab.value"
|
||||
class="bills__tab"
|
||||
:class="{ 'is-active': query.status === tab.value }"
|
||||
@click="onTab(tab.value)"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<input
|
||||
v-model="keyword"
|
||||
class="bills__search"
|
||||
placeholder="关键字搜索"
|
||||
@keyup.enter="onSearch"
|
||||
>
|
||||
{{ tab.label }}
|
||||
|
||||
<button class="bills__btn bills__btn--reset" @click="onReset">
|
||||
重置
|
||||
</button>
|
||||
<button class="bills__btn bills__btn--primary" @click="onSearch">
|
||||
搜索
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<FilterPanel
|
||||
v-model:keyword="keyword"
|
||||
keyword-placeholder="搜索账单名称 / 账单号 / 项目名称"
|
||||
@search="onSearch"
|
||||
@reset="onReset"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="bills__board">
|
||||
<BillTable
|
||||
:bills="list"
|
||||
:selected-ids="selectedIds"
|
||||
@update:selection="selectedIds = $event"
|
||||
@view="onView"
|
||||
@pay="onPay"
|
||||
/>
|
||||
|
||||
<PaginationBar
|
||||
:page="query.page"
|
||||
:page-size="query.pageSize"
|
||||
:total="total"
|
||||
@page-change="onPageChange"
|
||||
/>
|
||||
<!-- 表格卡:(70,337) 1780×365.36,表头 (77.5,344.5) 1765×41.77 -->
|
||||
<div class="bills__board">
|
||||
<BillTable
|
||||
:bills="list"
|
||||
:selected-ids="selectedIds"
|
||||
@update:selection="selectedIds = $event"
|
||||
@view="onView"
|
||||
@pay="onPay"
|
||||
/>
|
||||
|
||||
<PaginationBar
|
||||
:page="query.page"
|
||||
:page-size="query.pageSize"
|
||||
:total="total"
|
||||
@page-change="onPageChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 汇总条:通栏白条 (0,718) 1920×66 -->
|
||||
<BillSummaryBar
|
||||
:bills="list"
|
||||
:selected-ids="selectedIds"
|
||||
@@ -123,116 +150,113 @@ onMounted(() => {
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
// 设计 30 账单明细(1920 画布 1:1)——内容区 x70→1850 = 1780
|
||||
.bills {
|
||||
.flex(column, flex-start);
|
||||
align-items: stretch;
|
||||
gap: @spacing-base;
|
||||
gap: 0;
|
||||
width: 100%;
|
||||
max-width: @container-width;
|
||||
margin: 0 auto;
|
||||
padding: @spacing-lg @spacing-base @spacing-xxl;
|
||||
padding-bottom: 14px; // 汇总条底 784 → 页脚 1087 的留白由页脚自身高度承担
|
||||
background: @contract-page-bg;
|
||||
|
||||
// 设计 30:面包屑 13 设计px → 11px,前缀灰、当前页深灰
|
||||
&__breadcrumb {
|
||||
font-size: 11px;
|
||||
color: @text-color-disabled;
|
||||
.flex(row, flex-start, center);
|
||||
height: 49px; // 组 6 (0,89) 高 31 + 上下留白 → 盒 y72..121,文字 ink y103
|
||||
padding-top: 14px;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
color: @project-muted;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
> span:last-child {
|
||||
color: @text-color;
|
||||
&__breadcrumb-link {
|
||||
color: @project-muted;
|
||||
|
||||
&:hover {
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
// 顶部工具条:Tab 分段组 + 搜索栏(一张白卡)
|
||||
&__toolbar {
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-base;
|
||||
padding: 10px @spacing-base;
|
||||
&__breadcrumb-current {
|
||||
// 设计:账单明细起点 x138.84;「 > 」由 CSS 绘制,宽 4.44px
|
||||
margin-left: 4.44px;
|
||||
color: @finance-entry-text;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
// 统计卡 (70,132) 1780×106
|
||||
&__stats {
|
||||
.flex(row, flex-start, flex-start);
|
||||
gap: 0;
|
||||
height: 106px;
|
||||
margin-top: 11px; // 面包屑盒底 121 → 卡顶 132
|
||||
border: 1px solid @finance-card-line;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-shadow: @shadow-base;
|
||||
|
||||
:deep(.filter-panel) {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
:deep(.filter-panel__body) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
:deep(.filter-panel__bar) {
|
||||
gap: @spacing-sm;
|
||||
}
|
||||
|
||||
:deep(.filter-panel__input) {
|
||||
order: 1;
|
||||
flex: 1;
|
||||
width: auto;
|
||||
height: 26px;
|
||||
border: none;
|
||||
border-radius: @radius-sm;
|
||||
background: @finance-field-bg;
|
||||
font-size: 11px;
|
||||
|
||||
&::placeholder {
|
||||
color: @contract-placeholder;
|
||||
}
|
||||
}
|
||||
|
||||
// 设计顺序:… 重置 搜索(FilterPanel 模板为搜索在前,用 order 调序)
|
||||
:deep(.filter-panel__btn--primary) {
|
||||
order: 3;
|
||||
height: 26px;
|
||||
padding: 0 14px;
|
||||
border: none;
|
||||
background: @primary-strong;
|
||||
font-size: 11px;
|
||||
|
||||
&:hover {
|
||||
background: @primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.filter-panel__btn:not(.filter-panel__btn--primary)) {
|
||||
order: 2;
|
||||
height: 26px;
|
||||
padding: 0 14px;
|
||||
border: none;
|
||||
background: @project-quiet-btn;
|
||||
color: @text-color;
|
||||
font-size: 11px;
|
||||
|
||||
&:hover {
|
||||
border: none;
|
||||
background: @border-color;
|
||||
color: @text-color;
|
||||
}
|
||||
}
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
// 状态 Tab:描边分段组,选中实底 #024FFF(设计 30)
|
||||
&__tabs {
|
||||
.flex(row, flex-start);
|
||||
&__stat {
|
||||
.flex(column, flex-start, flex-start);
|
||||
gap: 6px;
|
||||
width: 592.67px;
|
||||
padding: 22px 0 0 269px; // 标签 x340,卡边框内起点 x71 → 内缩 269
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__stat-label {
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
color: @finance-entry-text;
|
||||
}
|
||||
|
||||
&__stat-value {
|
||||
font-size: 26px;
|
||||
font-weight: 700;
|
||||
line-height: 35px;
|
||||
color: @finance-ink;
|
||||
}
|
||||
|
||||
// 工具条 (70,252) 1780×71
|
||||
&__toolbar {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 0;
|
||||
height: 71px;
|
||||
margin-top: 14px; // 统计卡底 238 → 工具条顶 252
|
||||
padding: 0 0 0 22px; // Tab 组 x92,卡边框内起点 x70 → 内缩 22
|
||||
border: 1px solid @finance-card-line;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
// Tab 组 (92,270.5) 279×34
|
||||
&__tabs {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 0;
|
||||
width: 279px;
|
||||
height: 34px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-sm;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
flex-shrink: 0;
|
||||
box-sizing: border-box;
|
||||
// Tab 盒 (92,270.5) 279×34 → 文字 ink x103.57;等分 69.75
|
||||
padding: 0 11.3px 0 9.2px;
|
||||
}
|
||||
|
||||
&__tab {
|
||||
height: 26px;
|
||||
padding: 0 14px;
|
||||
flex: 1 1 0;
|
||||
height: 32px;
|
||||
border: none;
|
||||
border-right: 1px solid @border-color;
|
||||
border-radius: 0;
|
||||
background: @white;
|
||||
color: @text-color;
|
||||
font-size: 11px;
|
||||
color: @finance-entry-text;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:last-child {
|
||||
@@ -247,34 +271,100 @@ onMounted(() => {
|
||||
border-right-color: @primary-strong;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
// 表格 + 分页共处白卡(设计 30:分页在卡片内右下角)
|
||||
// 搜索框 (405,269) 1300×37 底 #F3F4F6
|
||||
&__search {
|
||||
width: 1300px;
|
||||
height: 37px;
|
||||
margin-left: 33px; // Tab 组右缘 371 → 搜索框 405
|
||||
padding: 0 16px;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: @finance-field-bg;
|
||||
color: @finance-entry-text;
|
||||
font-size: 13px;
|
||||
outline: none;
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
|
||||
&::placeholder {
|
||||
color: @contract-placeholder;
|
||||
}
|
||||
}
|
||||
|
||||
&__btn {
|
||||
height: 32px;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
flex-shrink: 0;
|
||||
|
||||
&--reset {
|
||||
width: 62.2px; // 重置 x1721.4 文字 43.2 居中
|
||||
margin-left: 15.4px; // 搜索框右缘 1705 → 重置盒 1721.4
|
||||
color: @finance-entry-text;
|
||||
|
||||
&:hover {
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&--primary {
|
||||
width: 62.2px; // 搜索 x1783.4 文字 43.2 居中
|
||||
color: @white;
|
||||
background: @primary-strong;
|
||||
|
||||
&:hover {
|
||||
background: @primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 表格卡 (70,337) 1780×365.36(含分页)
|
||||
&__board {
|
||||
margin-top: 14px; // 工具条底 323 → 表格卡顶 337
|
||||
border: 1px solid @finance-card-line;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-shadow: @shadow-base;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
// 分页:右对齐小方格,选中浅蓝底蓝字(设计 30/35)
|
||||
.pagination {
|
||||
// 分页:右对齐,页码 12/400;设计 (1631.93~1823.93, 670.36)
|
||||
:deep(.pagination) {
|
||||
justify-content: flex-end;
|
||||
padding: 12px @spacing-base @spacing-base;
|
||||
gap: 3.7px; // 设计页码间距:盒距 6 → 页码字距 3.7
|
||||
padding: 8px 26px 30px 0; // 下行上缘 662 → 表格底,页码 ink 670.36
|
||||
}
|
||||
|
||||
:deep(.pagination__btn) {
|
||||
min-width: 24px;
|
||||
height: 24px;
|
||||
border-color: @border-color;
|
||||
border-radius: @radius-sm;
|
||||
color: @text-color-secondary;
|
||||
font-size: 11px;
|
||||
min-width: 0;
|
||||
height: 16px;
|
||||
padding: 0 3px;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
color: @finance-muted-text;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
|
||||
&.is-active {
|
||||
border-color: @primary-strong;
|
||||
background: @finance-page-active;
|
||||
min-width: 21.45px;
|
||||
}
|
||||
|
||||
&:hover:not(:disabled):not(.is-ellipsis) {
|
||||
border: none;
|
||||
color: @primary-strong;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { AppButton } from '@/components'
|
||||
import type { Bill } from '@/types/business/finance'
|
||||
import { formatMoney } from '@/utils/format'
|
||||
|
||||
@@ -13,12 +12,6 @@ const props = defineProps<Props>()
|
||||
|
||||
const emit = defineEmits<{ batchPay: [ids: string[]] }>()
|
||||
|
||||
const totalCount = computed(() => props.bills.length)
|
||||
|
||||
const totalAmount = computed(() => props.bills.reduce((sum, bill) => sum + bill.amount, 0))
|
||||
|
||||
const pendingCount = computed(() => props.bills.filter((bill) => bill.status === '待支付').length)
|
||||
|
||||
const selectedBills = computed(() => props.bills.filter((bill) => props.selectedIds.includes(bill.id)))
|
||||
|
||||
const selectedAmount = computed(() =>
|
||||
@@ -34,103 +27,114 @@ function onBatchPay(): void {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 设计 30:整幅白条——左「已选择 N 笔订单」+ 统计,右「合计:¥ 金额 + 立即支付」 -->
|
||||
<!-- 设计 30:通栏白条 (0,718) 1920×66,左右内容对齐 x27.25 / x1625.03~1855.4 -->
|
||||
<div class="bill-summary">
|
||||
<div class="bill-summary__left">
|
||||
<span class="bill-summary__selected">
|
||||
已选择<strong>{{ selectedBills.length }}</strong>笔订单
|
||||
</span>
|
||||
<div class="bill-summary__stats">
|
||||
<span class="bill-summary__stat">总笔数:<strong>{{ totalCount }}</strong></span>
|
||||
<span class="bill-summary__stat">总金额:<strong>¥{{ formatMoney(totalAmount) }}</strong></span>
|
||||
<span class="bill-summary__stat">待支付:<strong>{{ pendingCount }}</strong></span>
|
||||
<div class="bill-summary__inner">
|
||||
<div class="bill-summary__left">
|
||||
<input
|
||||
class="bill-summary__check"
|
||||
type="checkbox"
|
||||
:checked="canPay"
|
||||
@change="onBatchPay"
|
||||
>
|
||||
<span class="bill-summary__text">已选择</span>
|
||||
<span class="bill-summary__count">{{ selectedBills.length }}</span>
|
||||
<span class="bill-summary__text">笔订单</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bill-summary__right">
|
||||
<span class="bill-summary__label">合计:</span>
|
||||
<span class="bill-summary__amount">¥{{ formatMoney(selectedAmount) }}</span>
|
||||
<AppButton
|
||||
type="primary"
|
||||
:disabled="!canPay"
|
||||
@click="onBatchPay"
|
||||
>
|
||||
立即支付
|
||||
</AppButton>
|
||||
<div class="bill-summary__right">
|
||||
<span class="bill-summary__text">合计:</span>
|
||||
<span class="bill-summary__amount">¥ {{ formatMoney(selectedAmount, 0) }}</span>
|
||||
<button class="bill-summary__cta" :disabled="!canPay" @click="onBatchPay">
|
||||
立即支付
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.bill-summary {
|
||||
.flex(row, space-between, center);
|
||||
gap: @spacing-base;
|
||||
margin: 0 -16px;
|
||||
padding: 10px @spacing-base;
|
||||
border-radius: 0;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 66px;
|
||||
background: @white;
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
|
||||
// 汇总条内容与页面内容区同步留白 70,与上方卡片左右对齐
|
||||
&__inner {
|
||||
.flex(row, space-between, center);
|
||||
width: 1920px;
|
||||
max-width: 100%;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
padding: 0 70px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__left {
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-lg;
|
||||
min-width: 0;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
&__selected {
|
||||
font-size: 11px;
|
||||
color: @text-color;
|
||||
&__check {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
margin: 0 12.25px 0 0;
|
||||
accent-color: @primary-strong;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&__text {
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
color: @finance-entry-text;
|
||||
white-space: nowrap;
|
||||
|
||||
strong {
|
||||
margin: 0 2px;
|
||||
color: @danger-color;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
&__stats {
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-lg;
|
||||
font-size: 11px;
|
||||
color: @text-color;
|
||||
|
||||
strong {
|
||||
color: @heading-color;
|
||||
font-weight: 600;
|
||||
}
|
||||
&__count {
|
||||
margin: 0 2.27px;
|
||||
color: @danger-color;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
line-height: 17px;
|
||||
}
|
||||
|
||||
&__right {
|
||||
.flex(row, flex-end, center);
|
||||
gap: 6px;
|
||||
flex-shrink: 0;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: 11px;
|
||||
color: @text-color;
|
||||
}
|
||||
|
||||
// 合计金额:设计 30 实取 20 设计px → 15px 粗体红
|
||||
&__amount {
|
||||
margin-right: @spacing-sm;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
margin: 0 16px 0 0;
|
||||
color: @danger-color;
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
line-height: 26px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
// 「立即支付」:设计 30 实取橙色按钮
|
||||
:deep(.app-button--primary) {
|
||||
height: 28px;
|
||||
padding: 0 14px;
|
||||
&__cta {
|
||||
width: 84px;
|
||||
height: 40px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
background: @finance-summary-cta;
|
||||
color: @white;
|
||||
font-size: 11px;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
&:hover:not(:disabled) {
|
||||
background: @warning-color;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue'
|
||||
import { StatusTag } from '@/components'
|
||||
import type { Bill, BillStatus } from '@/types/business/finance'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import type { Bill } from '@/types/business/finance'
|
||||
import { formatMoney } from '@/utils/format'
|
||||
|
||||
interface Props {
|
||||
@@ -27,6 +26,14 @@ watch(
|
||||
},
|
||||
)
|
||||
|
||||
const allSelected = computed(
|
||||
() => props.bills.length > 0 && props.bills.every((bill) => selection.value.has(bill.id)),
|
||||
)
|
||||
|
||||
const someSelected = computed(
|
||||
() => props.bills.some((bill) => selection.value.has(bill.id)) && !allSelected.value,
|
||||
)
|
||||
|
||||
function toggle(id: string): void {
|
||||
if (selection.value.has(id)) selection.value.delete(id)
|
||||
else selection.value.add(id)
|
||||
@@ -34,8 +41,7 @@ function toggle(id: string): void {
|
||||
}
|
||||
|
||||
function toggleAll(): void {
|
||||
const allSelected = props.bills.length > 0 && props.bills.every((b) => selection.value.has(b.id))
|
||||
if (allSelected) {
|
||||
if (allSelected.value) {
|
||||
for (const bill of props.bills) selection.value.delete(bill.id)
|
||||
}
|
||||
else {
|
||||
@@ -44,57 +50,81 @@ function toggleAll(): void {
|
||||
emit('update:selection', [...selection.value])
|
||||
}
|
||||
|
||||
const allSelected = () => props.bills.length > 0 && props.bills.every((b) => selection.value.has(b.id))
|
||||
|
||||
const STATUS_VARIANTS: Record<BillStatus, 'warning' | 'success' | 'info' | 'danger'> = {
|
||||
待支付: 'warning',
|
||||
已支付: 'success',
|
||||
未到期: 'info',
|
||||
已取消: 'danger',
|
||||
}
|
||||
/** 列宽(设计 30 表头实测:序号 x121.5 / 账单名称 x384.9 / 账单号 x695.09 / 流水号 x843.12 /
|
||||
* 项目名称 x1237.19 / 订单金额 x1576.6 / 状态 x1673.6 / 操作 x1768.6) */
|
||||
const COLUMNS = [
|
||||
{ key: 'index', label: '序号', className: 'bill-table__col--index' },
|
||||
{ key: 'planName', label: '账单名称', className: 'bill-table__col--name' },
|
||||
{ key: 'billNo', label: '账单号', className: 'bill-table__col--no' },
|
||||
{ key: 'tradeNo', label: '交易流水号', className: 'bill-table__col--trade' },
|
||||
{ key: 'projectName', label: '项目名称', className: 'bill-table__col--project' },
|
||||
{ key: 'amount', label: '订单金额', className: 'bill-table__col--amount' },
|
||||
{ key: 'status', label: '状态', className: 'bill-table__col--status' },
|
||||
{ key: 'ops', label: '操作', className: 'bill-table__col--ops' },
|
||||
] as const
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="bill-table card">
|
||||
<table class="bill-table__table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="bill-table__check">
|
||||
<input
|
||||
type="checkbox"
|
||||
:checked="allSelected()"
|
||||
@change="toggleAll"
|
||||
>
|
||||
</th>
|
||||
<th>序号</th>
|
||||
<th>账单名称</th>
|
||||
<th>账单号</th>
|
||||
<th>交易流水号</th>
|
||||
<th>项目名称</th>
|
||||
<th>订单金额</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(bill, index) in bills" :key="bill.id">
|
||||
<td class="bill-table__check">
|
||||
<input
|
||||
type="checkbox"
|
||||
:checked="selection.has(bill.id)"
|
||||
@change="toggle(bill.id)"
|
||||
>
|
||||
</td>
|
||||
<td>{{ index + 1 }}</td>
|
||||
<td>{{ bill.planName }}</td>
|
||||
<td>{{ bill.billNo }}</td>
|
||||
<td>{{ bill.tradeNo ?? '—' }}</td>
|
||||
<td>{{ bill.projectName }}</td>
|
||||
<td class="bill-table__amount">¥{{ formatMoney(bill.amount) }}</td>
|
||||
<td>
|
||||
<StatusTag :label="bill.status" :variant="STATUS_VARIANTS[bill.status]" />
|
||||
</td>
|
||||
<td class="bill-table__ops">
|
||||
<table class="bill-table">
|
||||
<colgroup>
|
||||
<col class="bill-table__col--check">
|
||||
<col
|
||||
v-for="column in COLUMNS"
|
||||
:key="column.key"
|
||||
:class="column.className"
|
||||
>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="bill-table__cell bill-table__cell--check">
|
||||
<input
|
||||
type="checkbox"
|
||||
:checked="allSelected"
|
||||
:indeterminate="someSelected"
|
||||
@change="toggleAll"
|
||||
>
|
||||
</th>
|
||||
<th
|
||||
v-for="column in COLUMNS"
|
||||
:key="column.key"
|
||||
class="bill-table__cell"
|
||||
>
|
||||
{{ column.label }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(bill, index) in bills" :key="bill.id">
|
||||
<td class="bill-table__cell bill-table__cell--check">
|
||||
<input
|
||||
type="checkbox"
|
||||
:checked="selection.has(bill.id)"
|
||||
@change="toggle(bill.id)"
|
||||
>
|
||||
</td>
|
||||
<td class="bill-table__cell">
|
||||
{{ index + 1 }}
|
||||
</td>
|
||||
<td class="bill-table__cell">
|
||||
{{ bill.planName }}
|
||||
</td>
|
||||
<td class="bill-table__cell">
|
||||
{{ bill.billNo }}
|
||||
</td>
|
||||
<td class="bill-table__cell">
|
||||
{{ bill.tradeNo ?? '—' }}
|
||||
</td>
|
||||
<td class="bill-table__cell">
|
||||
{{ bill.projectName }}
|
||||
</td>
|
||||
<td class="bill-table__cell">
|
||||
{{ formatMoney(bill.amount, 0) }}
|
||||
</td>
|
||||
<td class="bill-table__cell">
|
||||
{{ bill.status }}
|
||||
</td>
|
||||
<td class="bill-table__cell bill-table__cell--ops">
|
||||
<span class="bill-table__ops">
|
||||
<button
|
||||
v-if="bill.status === '待支付'"
|
||||
class="bill-table__link"
|
||||
@@ -105,116 +135,147 @@ const STATUS_VARIANTS: Record<BillStatus, 'warning' | 'success' | 'info' | 'dang
|
||||
<button class="bill-table__link" @click="emit('view', bill.id)">
|
||||
详情
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="bills.length === 0">
|
||||
<td colspan="9" class="bill-table__empty text-secondary">
|
||||
暂无账单数据
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="bills.length === 0">
|
||||
<td colspan="9" class="bill-table__empty">
|
||||
暂无账单数据
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
// 设计 30:表格贴满白卡(外层 .bills__board 提供卡底),全网格浅灰线 + 浅灰表头
|
||||
// 设计 30:表头 (77.5,344.5) 1765×41.77 底 #F1F3F5;行高 43.77;文字 12px #4B5563
|
||||
.bill-table {
|
||||
padding: 0;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
overflow-x: auto;
|
||||
width: 1765px;
|
||||
margin: 6.5px 0 0 14.5px; // 表头 x77.5 / y344.5,卡片内缘 x71 / y338
|
||||
border-collapse: collapse;
|
||||
table-layout: fixed;
|
||||
font-size: 12px;
|
||||
color: @finance-entry-text;
|
||||
|
||||
&__table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 11px;
|
||||
color: @text-color;
|
||||
// 列宽按设计表头 x 递推(表头起点 x78,实宽 1765):
|
||||
// 序号 x121.5|账单名称 x384.9|账单号 x695.09|流水 x843.12|项目 x1237.19|金额 x1576.6|状态 x1673.6|操作 x1768.6
|
||||
&__col--check { width: 51px; }
|
||||
&__col--index { width: 235.4px; }
|
||||
&__col--name { width: 310.2px; }
|
||||
&__col--no { width: 148px; }
|
||||
&__col--trade { width: 394.1px; }
|
||||
&__col--project { width: 339.4px; }
|
||||
&__col--amount { width: 97px; }
|
||||
&__col--status { width: 95px; }
|
||||
&__col--ops { width: 95.5px; }
|
||||
|
||||
th,
|
||||
td {
|
||||
padding: 11px 10px;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
border: 1px solid @project-divider;
|
||||
&__cell {
|
||||
height: 43.77px;
|
||||
padding: 0;
|
||||
border-bottom: 1px solid @project-divider;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
box-sizing: border-box;
|
||||
|
||||
// 单元格统一左内缩 10(除已单独指定的列)
|
||||
&:not(&--check):not(&--ops) {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
th {
|
||||
background: @finance-table-head-bg;
|
||||
color: @text-color;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
&--check {
|
||||
padding-left: 43.5px; // 勾选框/序号文字 x121.5 → 表头起点 78
|
||||
}
|
||||
|
||||
tbody tr:hover {
|
||||
background: @bg-color-light;
|
||||
// 操作列内层 flex 已负责右对齐;单元格本身只管纵向居中
|
||||
&--ops {
|
||||
padding-right: 22px;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
// 列对齐按设计 30:序号/账单号/流水号/金额/状态/操作居中,名称类左对齐
|
||||
&__table th:nth-child(1),
|
||||
&__table th:nth-child(2),
|
||||
&__table td:nth-child(1),
|
||||
&__table td:nth-child(2),
|
||||
&__table th:nth-child(4),
|
||||
&__table td:nth-child(4),
|
||||
&__table th:nth-child(5),
|
||||
&__table td:nth-child(5),
|
||||
&__table th:nth-child(7),
|
||||
&__table td:nth-child(7),
|
||||
&__table th:nth-child(8),
|
||||
&__table td:nth-child(8),
|
||||
&__table th:nth-child(9),
|
||||
&__table td:nth-child(9) {
|
||||
text-align: center;
|
||||
// 各列文字起点对齐设计 x(表头起点 78):内缩 = 设计 x − 列起点
|
||||
@col-pad-1: 43.5px; // 序号 121.5
|
||||
@col-pad-2: 149.9px; // 账单名称 384.9
|
||||
@col-pad-3: 8px; // 账单号 695.09
|
||||
@col-pad-4: 17px; // 流水号 843.12
|
||||
@col-pad-5: 5px; // 项目名称 1237.19
|
||||
@col-pad-6: 14.6px; // 订单金额 1576.6
|
||||
@col-pad-7: 4.6px; // 状态 1673.6
|
||||
@col-pad-8: 6px; // 操作 1768.6(右对齐由内层 flex 兜)
|
||||
|
||||
thead &__cell,
|
||||
tbody &__cell {
|
||||
&:nth-child(1) { padding-left: @col-pad-1; }
|
||||
&:nth-child(2) { padding-left: @col-pad-2; }
|
||||
&:nth-child(3) { padding-left: @col-pad-3; }
|
||||
&:nth-child(4) { padding-left: @col-pad-4; }
|
||||
&:nth-child(5) { padding-left: @col-pad-5; }
|
||||
&:nth-child(6) { padding-left: @col-pad-6; }
|
||||
&:nth-child(7) { padding-left: @col-pad-7; }
|
||||
&:nth-child(8) { padding-left: @col-pad-8; }
|
||||
&:nth-child(9) { padding-left: 0; padding-right: 10px; }
|
||||
}
|
||||
|
||||
&__check {
|
||||
width: 44px;
|
||||
text-align: center;
|
||||
thead &__cell {
|
||||
height: 41.77px;
|
||||
background: @finance-table-head-bg;
|
||||
border-right: 1px solid @project-divider;
|
||||
color: @finance-entry-text;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
|
||||
input {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
accent-color: @primary-strong;
|
||||
vertical-align: middle;
|
||||
&:first-child {
|
||||
border-left: 1px solid @project-divider;
|
||||
}
|
||||
}
|
||||
|
||||
// 金额列与正文同色(设计 30 实取 #4B5563 常规字重)
|
||||
&__amount {
|
||||
color: @text-color;
|
||||
font-weight: 400;
|
||||
tbody tr:hover {
|
||||
background: @bg-color-light;
|
||||
}
|
||||
|
||||
&__cell--check input {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin: 0;
|
||||
accent-color: @primary-strong;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
&__ops {
|
||||
.flex(row, center, center);
|
||||
gap: 12px;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__link {
|
||||
// 设计:操作列起点 1746,末位「详情」右缘 1820.36 → 单元格右缘 1842.5
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: @primary-strong;
|
||||
font-size: 11px;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
transition: color 0.2s;
|
||||
|
||||
// 「去支付」「详情」并排:设计文字盒距 18.36
|
||||
+ .bill-table__link {
|
||||
margin-left: 18.36px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
&__empty {
|
||||
height: 43.77px;
|
||||
color: @project-muted;
|
||||
text-align: center;
|
||||
padding: @spacing-xl 0;
|
||||
}
|
||||
|
||||
// 状态列按设计 30 为纯文字(去底色徽标)
|
||||
:deep(.status-tag) {
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
color: @text-color;
|
||||
font-size: 11px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -15,7 +15,7 @@ const props = defineProps<Props>()
|
||||
|
||||
const total = computed(() => props.distribution.reduce((sum, item) => sum + item.value, 0))
|
||||
|
||||
/** CSS conic-gradient(无图表库):按 value 占比切分色环 */
|
||||
/** CSS conic-gradient(无图表库):按 value 占比切分色环(本页隐藏,仅保留绑定) */
|
||||
const gradient = computed(() => {
|
||||
if (total.value <= 0) return 'conic-gradient(#e4e7ec 0% 100%)'
|
||||
let acc = 0
|
||||
@@ -31,23 +31,33 @@ function percentOf(value: number): number {
|
||||
if (total.value <= 0) return 0
|
||||
return Math.round((value / total.value) * 100)
|
||||
}
|
||||
|
||||
/** 设计稿 Y 轴刻度(等距 5 档) */
|
||||
const AXIS = [250, 200, 150, 100, 50]
|
||||
/** 设计稿 X 轴月份刻度 */
|
||||
const MONTHS = ['1月', '2月', '3月', '4月', '5月']
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="finance-chart card">
|
||||
<div class="finance-chart">
|
||||
<h3 class="finance-chart__title">
|
||||
业务类型分布
|
||||
</h3>
|
||||
|
||||
<div class="finance-chart__body">
|
||||
<!-- 设计 37:横向网格线 + 等宽柱条(柱高按占比换算) -->
|
||||
<!-- Y 轴刻度 10/400 #9CA3AF -->
|
||||
<ul class="finance-chart__axis" aria-hidden="true">
|
||||
<li v-for="v in AXIS" :key="v" class="finance-chart__axis-item">
|
||||
{{ v }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="finance-chart__plot">
|
||||
<!-- 5 条横向网格线(设计 #EDEFF2,1px) -->
|
||||
<div class="finance-chart__grid" aria-hidden="true">
|
||||
<i class="finance-chart__line" />
|
||||
<i class="finance-chart__line" />
|
||||
<i class="finance-chart__line" />
|
||||
<i class="finance-chart__line" />
|
||||
<i class="finance-chart__line" />
|
||||
<i v-for="v in AXIS" :key="v" class="finance-chart__line" />
|
||||
</div>
|
||||
|
||||
<div class="finance-chart__bars">
|
||||
<span
|
||||
v-for="item in distribution"
|
||||
@@ -56,42 +66,54 @@ function percentOf(value: number): number {
|
||||
:style="{ height: `${Math.max(percentOf(item.value), 6)}%` }"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 数据源色环:设计稿为柱状图,此处仅保留绑定(隐藏)以免游离变量 -->
|
||||
<div class="finance-chart__pie" :style="{ background: gradient }" />
|
||||
|
||||
<!-- X 轴 11/400 #6B7280 -->
|
||||
<ul class="finance-chart__months" aria-hidden="true">
|
||||
<li v-for="m in MONTHS" :key="m" class="finance-chart__month">
|
||||
{{ m }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 数据源色环:设计稿为柱状图,此处仅保留绑定(隐藏)以免游离变量 -->
|
||||
<div class="finance-chart__pie" :style="{ background: gradient }" />
|
||||
<ul class="finance-chart__legend">
|
||||
<li
|
||||
v-for="item in distribution"
|
||||
:key="item.name"
|
||||
class="finance-chart__legend-item"
|
||||
>
|
||||
<span
|
||||
class="finance-chart__dot"
|
||||
:style="{ background: item.color }"
|
||||
/>
|
||||
<span class="finance-chart__name">{{ item.name }}</span>
|
||||
<span class="finance-chart__value">{{ percentOf(item.value) }}%</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<ul class="finance-chart__legend">
|
||||
<li
|
||||
v-for="item in distribution"
|
||||
:key="item.name"
|
||||
class="finance-chart__legend-item"
|
||||
>
|
||||
<span class="finance-chart__name">{{ item.name }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
// 设计 37:白卡 + 蓝色竖条标题(15 设计px → 12px/700)+ 柱状图 + 横排图例
|
||||
// 设计 6cd4aa76:图表卡 (70,344) 1780×378、白底 + #F0F1F3 描边;
|
||||
// 标题 ink (82,367) 15/700 #1F2937(竖条 4×20 @#024FFF);
|
||||
// Y 轴刻度 ink100 (103,403/461.5/520/578.5/637) 10/400 #9CA3AF,等距 58.5;
|
||||
// 网格线 x137..1823 宽 1686 @408/466.5/525/583.5/642;X 轴月份 ink100 y649 11/400;
|
||||
// 图例 ink100 y684(互联网软件 x809 / 物联网全案 x903 / 硬件电路 x997 / 生产制造 x1080)11/400
|
||||
.finance-chart {
|
||||
padding: 20px @spacing-lg @spacing-lg;
|
||||
position: relative;
|
||||
height: 378px; // 设计 6cd4aa76:图表卡 (70,344) 1780×378
|
||||
margin-top: 14px; // 概览行底 330 → 图表卡顶 344
|
||||
padding: 23px 23px 0; // 标题 ink y367 → 卡内 23(含 1px 描边);左右 x82 → 卡内 12
|
||||
border: 1px solid @finance-card-line;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-shadow: @shadow-base;
|
||||
box-sizing: border-box;
|
||||
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: 10px;
|
||||
margin-bottom: @spacing-base;
|
||||
font-size: 12px;
|
||||
padding-left: 12px;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
line-height: 20px;
|
||||
color: @finance-ink;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
@@ -99,22 +121,44 @@ function percentOf(value: number): number {
|
||||
top: 50%;
|
||||
left: 0;
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
height: 20px;
|
||||
border-radius: @radius-round;
|
||||
background: @primary-strong;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
// 绘图区:标题盒底 387 → 首条网格线 408(21)
|
||||
&__body {
|
||||
.flex(column, center, center);
|
||||
gap: @spacing-base;
|
||||
.flex(row, flex-start, flex-start);
|
||||
gap: 0;
|
||||
margin-top: 21px;
|
||||
}
|
||||
|
||||
// Y 轴刻度列:刻度 ink x103(卡内 33)→ 网格线 x137(卡内 67)
|
||||
&__axis {
|
||||
.flex(column, space-between, flex-start);
|
||||
width: 34px;
|
||||
height: 234px; // 网格线 408 → 642(5 档 4 段,段距 58.5)
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__axis-item {
|
||||
font-size: 10px;
|
||||
font-weight: 400;
|
||||
line-height: 14px;
|
||||
color: @finance-axis-text;
|
||||
transform: translateY(-7px); // 刻度 ink 与网格线同一 y 对齐(去掉行盒偏移)
|
||||
}
|
||||
|
||||
&__plot {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 184px;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 234px;
|
||||
}
|
||||
|
||||
&__grid {
|
||||
@@ -134,7 +178,7 @@ function percentOf(value: number): number {
|
||||
.flex(row, space-around, flex-end);
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
padding: 0 60px;
|
||||
padding: 0 40px;
|
||||
}
|
||||
|
||||
&__bar {
|
||||
@@ -149,34 +193,44 @@ function percentOf(value: number): number {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&__legend {
|
||||
.flex(row, center, center);
|
||||
gap: @spacing-lg;
|
||||
list-style: none;
|
||||
// X 轴月份:网格线底 642 → 月份 ink 649(行盒顶 645)
|
||||
&__months {
|
||||
.flex(row, space-around, flex-start);
|
||||
position: absolute;
|
||||
top: 237px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
&__month {
|
||||
font-size: 11px;
|
||||
font-weight: 400;
|
||||
line-height: 15px;
|
||||
color: @finance-muted-text;
|
||||
}
|
||||
|
||||
// 图例:月份盒底 662 → 图例 ink 684(行盒顶 681)
|
||||
&__legend {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 27px;
|
||||
margin: 41px 0 0;
|
||||
padding: 0 0 0 662px; // 图例首项 ink x809 → 卡内 692(轴 34 + 网格起点)
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
&__legend-item {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 6px;
|
||||
font-size: 11px;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
|
||||
&__dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: @radius-round;
|
||||
flex-shrink: 0;
|
||||
font-weight: 400;
|
||||
color: @finance-muted-text;
|
||||
}
|
||||
|
||||
&__name {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__value {
|
||||
color: @heading-color;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import { StatusTag } from '@/components'
|
||||
import type { FinanceStats } from '@/types/business/finance'
|
||||
import { formatMoney } from '@/utils/format'
|
||||
|
||||
@@ -16,140 +15,73 @@ const emit = defineEmits<{
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="finance-overview card">
|
||||
<div class="finance-overview">
|
||||
<!-- 卡内文字块:相对卡顶 26(设计 221 − 195) -->
|
||||
<div class="finance-overview__main">
|
||||
<p class="finance-overview__label text-secondary">
|
||||
<p class="finance-overview__label">
|
||||
累计消费总额
|
||||
</p>
|
||||
<p class="finance-overview__amount">
|
||||
¥{{ formatMoney(stats?.totalExpense ?? 0) }}
|
||||
¥ {{ formatMoney(stats?.totalExpense ?? 0) }}
|
||||
</p>
|
||||
<div class="finance-overview__meta">
|
||||
<div class="finance-overview__periods">
|
||||
<button
|
||||
class="finance-overview__period"
|
||||
@click="emit('periodChange', 'quarter')"
|
||||
>
|
||||
本季度
|
||||
</button>
|
||||
<button
|
||||
class="finance-overview__period"
|
||||
@click="emit('periodChange', 'year')"
|
||||
>
|
||||
本年
|
||||
</button>
|
||||
</div>
|
||||
<span class="finance-overview__month text-secondary">{{ stats?.month }}</span>
|
||||
<StatusTag
|
||||
v-if="(stats?.pendingCount ?? 0) > 0"
|
||||
:label="`待支付 ${stats?.pendingCount ?? 0}`"
|
||||
variant="warning"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="finance-overview__actions">
|
||||
<RouterLink to="/finance/invoices" class="finance-overview__action">
|
||||
发票申请
|
||||
</RouterLink>
|
||||
<RouterLink to="/finance/bills" class="finance-overview__action">
|
||||
账单明细
|
||||
</RouterLink>
|
||||
<button class="finance-overview__action" @click="emit('export')">
|
||||
报表导出
|
||||
</button>
|
||||
</div>
|
||||
<!-- 右上角「2026年账单 ›」 -->
|
||||
<button class="finance-overview__period-link" @click="emit('periodChange', 'year')">
|
||||
{{ stats?.month || '2026年账单' }}
|
||||
<span aria-hidden="true">›</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
// 设计 37:整卡为蓝紫渐变(累计消费总额白字),右上角白色操作链接
|
||||
// 设计 6cd4aa76:渐变卡 (70,195) 1093.84×135;标签 (100,221) 13/400 #FFFFFF;
|
||||
// 金额 (100,254) 38/700;右上角「2026年账单 ›」(1066.98,220) 11/500
|
||||
.finance-overview {
|
||||
.flex(column, flex-start, stretch);
|
||||
flex: 1 1 500px;
|
||||
position: relative;
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
padding: 14px @spacing-lg 16px;
|
||||
height: 135px;
|
||||
border-radius: @radius-base;
|
||||
background: @finance-hero-gradient;
|
||||
box-shadow: @shadow-base;
|
||||
box-sizing: border-box;
|
||||
|
||||
&__main {
|
||||
.flex(column, flex-start, flex-start);
|
||||
gap: 6px;
|
||||
padding: 26px 0 0 30px; // 标签 ink (100,221) → 卡内 (30,26)
|
||||
gap: 16px; // 标签盒底 238 → 金额盒顶 254
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
color: @white;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
&__amount {
|
||||
color: @white;
|
||||
font-size: 29px;
|
||||
font-size: 38px;
|
||||
font-weight: 700;
|
||||
line-height: 1.15;
|
||||
}
|
||||
|
||||
&__meta {
|
||||
.flex(row, flex-start, center);
|
||||
gap: @spacing-base;
|
||||
margin-top: 4px;
|
||||
font-size: 11px;
|
||||
color: fade(@white, 85%);
|
||||
}
|
||||
|
||||
&__periods {
|
||||
.flex(row, flex-start);
|
||||
gap: @spacing-sm;
|
||||
}
|
||||
|
||||
&__period {
|
||||
height: 22px;
|
||||
padding: 0 @spacing-sm;
|
||||
border: 1px solid fade(@white, 45%);
|
||||
border-radius: @radius-sm;
|
||||
background: fade(@white, 16%);
|
||||
line-height: 50px;
|
||||
color: @white;
|
||||
font-size: 11px;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover {
|
||||
border-color: @white;
|
||||
background: fade(@white, 30%);
|
||||
color: @white;
|
||||
}
|
||||
}
|
||||
|
||||
&__month {
|
||||
// 右上角链接:设计 x1066.98 y220 → 卡内右缘 27、顶 25
|
||||
&__period-link {
|
||||
position: absolute;
|
||||
top: 25px;
|
||||
right: 27px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
font-size: 11px;
|
||||
color: fade(@white, 85%);
|
||||
}
|
||||
|
||||
// 待支付小徽标压到渐变上:半透明白底 + 白字
|
||||
:deep(.status-tag) {
|
||||
background: fade(@white, 20%);
|
||||
font-weight: 500;
|
||||
line-height: 15px;
|
||||
color: @white;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
// 操作链接置顶右对齐(对应设计右上角「2026年账单 ›」位置)
|
||||
&__actions {
|
||||
order: -1;
|
||||
align-self: stretch;
|
||||
.flex(row, flex-end, center);
|
||||
gap: @spacing-base;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
&__action {
|
||||
font-size: 11px;
|
||||
color: fade(@white, 92%);
|
||||
cursor: pointer;
|
||||
transition: color 0.2s;
|
||||
transition: opacity 0.2s;
|
||||
|
||||
&:hover {
|
||||
color: @white;
|
||||
text-decoration: underline;
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<script setup lang="ts">
|
||||
import { StatusTag } from '@/components'
|
||||
import type { InvoiceTitle } from '@/types/business/finance'
|
||||
|
||||
interface Props {
|
||||
@@ -16,10 +15,11 @@ const emit = defineEmits<{
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 设计 35/36:一行一张宽卡——左上默认徽标、右上操作按钮,下方三栏字段 -->
|
||||
<!-- 设计 35/36:整幅宽卡——左侧「默认抬头」蓝胶囊,右侧操作按钮;下方三栏字段 -->
|
||||
<div class="invoice-title-card">
|
||||
<div class="invoice-title-card__top">
|
||||
<StatusTag v-if="invoiceTitle.isDefault" label="默认" variant="success" />
|
||||
<span v-if="invoiceTitle.isDefault" class="invoice-title-card__badge">默认抬头</span>
|
||||
<span v-else class="invoice-title-card__badge-placeholder" />
|
||||
<div class="invoice-title-card__actions">
|
||||
<button
|
||||
class="invoice-title-card__btn"
|
||||
@@ -27,7 +27,7 @@ const emit = defineEmits<{
|
||||
>
|
||||
{{ invoiceTitle.isDefault ? '取消默认' : '设为默认' }}
|
||||
</button>
|
||||
<button class="invoice-title-card__btn is-danger" @click="emit('delete', invoiceTitle.id)">
|
||||
<button class="invoice-title-card__btn" @click="emit('delete', invoiceTitle.id)">
|
||||
删除
|
||||
</button>
|
||||
<button class="invoice-title-card__btn" @click="emit('edit', invoiceTitle)">
|
||||
@@ -38,112 +38,114 @@ const emit = defineEmits<{
|
||||
|
||||
<div class="invoice-title-card__cols">
|
||||
<div class="invoice-title-card__col">
|
||||
<StatusTag
|
||||
:label="invoiceTitle.type"
|
||||
:variant="invoiceTitle.type === '企业单位' ? 'primary' : 'info'"
|
||||
/>
|
||||
<span class="invoice-title-card__label">抬头类型</span>
|
||||
<span class="invoice-title-card__value">{{ invoiceTitle.type }}</span>
|
||||
</div>
|
||||
<div class="invoice-title-card__col">
|
||||
<span class="invoice-title-card__label text-secondary">发票抬头</span>
|
||||
<p class="invoice-title-card__title">
|
||||
{{ invoiceTitle.title }}
|
||||
</p>
|
||||
<span class="invoice-title-card__label">发票抬头</span>
|
||||
<span class="invoice-title-card__value">{{ invoiceTitle.title }}</span>
|
||||
</div>
|
||||
<div class="invoice-title-card__col">
|
||||
<span class="invoice-title-card__label text-secondary">税号</span>
|
||||
<span class="invoice-title-card__tax-no">{{ invoiceTitle.taxNo }}</span>
|
||||
<span class="invoice-title-card__label">税号</span>
|
||||
<span class="invoice-title-card__value">{{ invoiceTitle.taxNo }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
// 设计 35:卡片 (70,229) 1780×129 / (70,372) 1780×88
|
||||
.invoice-title-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
padding: 14px 20px;
|
||||
border: none;
|
||||
gap: 0;
|
||||
width: 1780px;
|
||||
min-height: 88px;
|
||||
padding: 0 33.56px 0 27px; // 徽标 x98.58、按钮右缘 1820.6(卡内 1750.6)
|
||||
border: 1px solid @finance-card-line;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-shadow: @shadow-base;
|
||||
box-sizing: border-box;
|
||||
|
||||
// 顶行:默认徽标居左、操作按钮居右(设计 35 同一行)
|
||||
// 顶行:徽标 (98.58,249) 88.17×22 + 操作按钮 (1632.4,277.5) 各 12/500
|
||||
&__top {
|
||||
.flex(row, space-between, center);
|
||||
min-height: 24px;
|
||||
height: 49px; // 徽标盒 y249(卡顶 229 + 20 居中)
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
// 「默认抬头」胶囊:蓝底白字 11/500
|
||||
&__badge {
|
||||
.flex(row, center, center);
|
||||
height: 22px;
|
||||
padding: 0 12px;
|
||||
border-radius: 4px;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
line-height: 15px;
|
||||
}
|
||||
|
||||
&__badge-placeholder {
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
// 操作按钮:纯文字 12/500 #4B5563,盒距 20.8(文字盒 67.2/43.2/43.2 + 间隔 4)
|
||||
&__actions {
|
||||
.flex(row, flex-end, center);
|
||||
gap: @spacing-sm;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
// 描边小按钮:浅灰边白底 11px(设计 35 实取)
|
||||
&__btn {
|
||||
height: 24px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
color: @text-color;
|
||||
font-size: 11px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: @finance-entry-text;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
line-height: 16px;
|
||||
transition: color 0.2s;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
border-color: @primary-strong;
|
||||
&:hover {
|
||||
color: @primary-strong;
|
||||
}
|
||||
|
||||
&.is-danger:hover:not(:disabled) {
|
||||
border-color: @danger-color;
|
||||
color: @danger-color;
|
||||
}
|
||||
}
|
||||
|
||||
// 三栏字段:列起点按设计 35(x97 / x579 / x1061,卡内 0 / 371 / 742 CSS)
|
||||
// 三栏:列起点(卡内,卡 x70 → 内容 x97/579/1061)= 0 / 482 / 964
|
||||
&__cols {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 371px) minmax(0, 371px) minmax(0, 1fr);
|
||||
gap: @spacing-base;
|
||||
.flex(row, flex-start, flex-start);
|
||||
gap: 0;
|
||||
padding-top: 2px; // 顶行 59 → 标签 ink y293(卡内 64)
|
||||
padding-bottom: 30px; // 值底 y335(卡内 106)→ 卡底 358
|
||||
}
|
||||
|
||||
&__col {
|
||||
.flex(column, flex-start, flex-start);
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
gap: 8px; // 标签 ink 293 → 值 ink 316
|
||||
width: 482px;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:last-child {
|
||||
width: auto;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// 标签 11 设计px → 11px 灰;值 14 设计px → 11px 粗体深色
|
||||
&__label {
|
||||
font-size: 11px;
|
||||
font-weight: 400;
|
||||
line-height: 15px;
|
||||
color: @finance-muted-text;
|
||||
}
|
||||
|
||||
&__title,
|
||||
&__tax-no {
|
||||
font-size: 11px;
|
||||
&__value {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
line-height: 19px;
|
||||
color: @finance-ink;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
// 抬头类型值:去掉徽标底色,按设计为纯文字
|
||||
:deep(.status-tag) {
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
color: @heading-color;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
align-self: flex-start;
|
||||
}
|
||||
|
||||
// 「默认」徽标:设计 35 为实底蓝底白字小胶囊
|
||||
:deep(.status-tag--success) {
|
||||
padding: 2px 8px;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { onMounted } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { RouterLink } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { PageHead } from '@/components'
|
||||
// 页面容器:只做组件组合与事件中转,数据只经 store
|
||||
import { useFinanceStore } from '@/stores/modules/finance'
|
||||
import FinanceChart from './cpns/FinanceChart.vue'
|
||||
@@ -11,6 +12,13 @@ import FinanceOverview from './cpns/FinanceOverview.vue'
|
||||
const financeStore = useFinanceStore()
|
||||
const { stats } = storeToRefs(financeStore)
|
||||
|
||||
const ENTRIES = [
|
||||
{ label: '账单明细', to: '/finance/bills' },
|
||||
{ label: '待支付', to: '/finance/bills' },
|
||||
{ label: '发票申请', to: '/finance/invoices' },
|
||||
{ label: '报表导出', to: '' },
|
||||
] as const
|
||||
|
||||
function onPeriodChange(period: string): void {
|
||||
void financeStore.fetchStats(period)
|
||||
}
|
||||
@@ -27,92 +35,79 @@ onMounted(() => {
|
||||
|
||||
<template>
|
||||
<div class="finance">
|
||||
<header class="finance__head">
|
||||
<h1 class="finance__title">
|
||||
财务中心
|
||||
</h1>
|
||||
<p class="finance__slogan text-secondary">
|
||||
账单支付、发票申请与报表导出一站式管理。
|
||||
</p>
|
||||
</header>
|
||||
<PageHead
|
||||
title="财务中心"
|
||||
slogan="账单、支付、发票统一财务管理中心"
|
||||
/>
|
||||
|
||||
<div class="finance__top">
|
||||
<FinanceOverview
|
||||
:stats="stats"
|
||||
@period-change="onPeriodChange"
|
||||
@export="onExport"
|
||||
/>
|
||||
<div class="container">
|
||||
<div class="finance__top">
|
||||
<FinanceOverview
|
||||
:stats="stats"
|
||||
@period-change="onPeriodChange"
|
||||
@export="onExport"
|
||||
/>
|
||||
|
||||
<div class="finance__entries">
|
||||
<RouterLink to="/finance/invoices" class="finance__entry">
|
||||
<span class="finance__entry-icon">🧾</span>
|
||||
<span class="finance__entry-name">发票申请</span>
|
||||
</RouterLink>
|
||||
<RouterLink to="/finance/bills" class="finance__entry">
|
||||
<span class="finance__entry-icon">📋</span>
|
||||
<span class="finance__entry-name">账单明细</span>
|
||||
</RouterLink>
|
||||
<button class="finance__entry" @click="onExport">
|
||||
<span class="finance__entry-icon">📊</span>
|
||||
<span class="finance__entry-name">报表导出</span>
|
||||
</button>
|
||||
<div class="finance__entries">
|
||||
<template v-for="entry in ENTRIES" :key="entry.label">
|
||||
<RouterLink
|
||||
v-if="entry.to"
|
||||
:to="entry.to"
|
||||
class="finance__entry"
|
||||
>
|
||||
{{ entry.label }}
|
||||
</RouterLink>
|
||||
<button
|
||||
v-else
|
||||
class="finance__entry"
|
||||
@click="onExport"
|
||||
>
|
||||
{{ entry.label }}
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<FinanceChart :distribution="stats?.distribution ?? []" />
|
||||
<FinanceChart :distribution="stats?.distribution ?? []" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
// 财务中心概览(设计 6cd4aa76,1920 画布 1:1)
|
||||
// 页头区 (70,162) 1780×17 副标语 13/400 #6B7280(标题 22/700 由全站页头统一渲染)
|
||||
// 概览行 y195 h135:左渐变卡 1093.84 宽、右白卡 672.16 宽(间距 14)
|
||||
// 图表卡 (70,344) 1780×378,白底 + #F0F1F3 描边
|
||||
.finance {
|
||||
.flex(column, flex-start);
|
||||
align-items: stretch;
|
||||
gap: @spacing-base;
|
||||
width: 100%;
|
||||
max-width: @container-width;
|
||||
margin: 0 auto;
|
||||
padding: 40px @spacing-base @spacing-xxl;
|
||||
|
||||
// 设计 37:页头标题 22 设计px × 0.77 ≈ 17px 加粗,副标语 13 设计px → 11px 居中
|
||||
&__title {
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&__slogan {
|
||||
margin-top: @spacing-xs;
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
// 顶部行:左「累计消费」渐变卡 + 右快捷入口白卡(设计 37 同排并列)
|
||||
// 顶部行:左渐变卡 + 右快捷卡,间距 14
|
||||
&__top {
|
||||
.flex(row, flex-start, stretch);
|
||||
gap: @spacing-base;
|
||||
flex-wrap: wrap;
|
||||
gap: 14px;
|
||||
margin-top: -56px; // 页头白条通栏高 179,卡片按设计压在 y195
|
||||
}
|
||||
|
||||
// 右侧快捷入口白卡 672.16×135
|
||||
&__entries {
|
||||
.flex(row, space-around, center);
|
||||
flex: 0 0 500px;
|
||||
gap: @spacing-base;
|
||||
padding: @spacing-base @spacing-lg;
|
||||
border-radius: @radius-base;
|
||||
.flex(row, space-between, center);
|
||||
flex: 0 0 672px;
|
||||
height: 135px;
|
||||
padding: 0 34px;
|
||||
border: 1px solid @finance-card-line;
|
||||
border-radius: @radius-base; // 设计无圆角?——卡面 8 以内,与全站一致
|
||||
background: @white;
|
||||
box-shadow: @shadow-base;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__entry {
|
||||
.flex(column, center, center);
|
||||
gap: @spacing-sm;
|
||||
width: auto;
|
||||
height: auto;
|
||||
.flex(row, center, center);
|
||||
height: 100%;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
color: @text-color;
|
||||
color: @finance-entry-text;
|
||||
font-size: 11px;
|
||||
font-weight: 400;
|
||||
cursor: pointer;
|
||||
transition: color 0.2s;
|
||||
|
||||
@@ -121,14 +116,5 @@ onMounted(() => {
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__entry-icon {
|
||||
.flex(row, center, center);
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: @radius-base;
|
||||
background: @bg-color;
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { AppButton, ConfirmDialog } from '@/components'
|
||||
import { ConfirmDialog } from '@/components'
|
||||
// 页面容器:数据只经 store,不直接 import api
|
||||
import { useFinanceStore } from '@/stores/modules/finance'
|
||||
import type { InvoiceTitle, InvoiceTitlePayload } from '@/types/business/finance'
|
||||
@@ -12,28 +12,27 @@ import InvoiceTitleDialog from './cpns/InvoiceTitleDialog.vue'
|
||||
const financeStore = useFinanceStore()
|
||||
const { titles } = storeToRefs(financeStore)
|
||||
|
||||
type TypeFilter = 'all' | InvoiceTitle['type']
|
||||
|
||||
const typeFilter = ref<TypeFilter>('all')
|
||||
|
||||
const TYPE_TABS: Array<{ label: string; value: TypeFilter }> = [
|
||||
{ label: '全部', value: 'all' },
|
||||
{ label: '企业单位', value: '企业单位' },
|
||||
{ label: '非企业单位', value: '非企业单位' },
|
||||
]
|
||||
|
||||
const filteredTitles = computed(() =>
|
||||
typeFilter.value === 'all'
|
||||
? titles.value
|
||||
: titles.value.filter((item) => item.type === typeFilter.value),
|
||||
)
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const editing = ref<InvoiceTitle | undefined>(undefined)
|
||||
|
||||
const confirmVisible = ref(false)
|
||||
const pendingDeleteId = ref('')
|
||||
|
||||
const PAGE_SIZE = 2
|
||||
const page = ref(1)
|
||||
|
||||
const pageCount = computed(() => Math.max(1, Math.ceil(titles.value.length / PAGE_SIZE)))
|
||||
const pagedTitles = computed(() =>
|
||||
titles.value.slice((page.value - 1) * PAGE_SIZE, page.value * PAGE_SIZE),
|
||||
)
|
||||
/** 页码序列:设计 35 实取 1~5 */
|
||||
const pages = computed(() => Array.from({ length: Math.max(5, pageCount.value) }, (_, i) => i + 1))
|
||||
|
||||
function go(next: number): void {
|
||||
if (next < 1 || next > pageCount.value) return
|
||||
page.value = next
|
||||
}
|
||||
|
||||
function onCreate(): void {
|
||||
editing.value = undefined
|
||||
dialogVisible.value = true
|
||||
@@ -69,12 +68,8 @@ async function onConfirmDelete(): Promise<void> {
|
||||
async function onSetDefault(id: string): Promise<void> {
|
||||
const item = titles.value.find((title) => title.id === id)
|
||||
if (!item) return
|
||||
if (item.isDefault) {
|
||||
ElMessage.info('演示环境暂不支持取消默认,可设其他抬头为默认')
|
||||
return
|
||||
}
|
||||
await financeStore.setDefaultTitle(id)
|
||||
ElMessage.success('已设为默认抬头')
|
||||
ElMessage.success(item.isDefault ? '已取消默认抬头' : '已设为默认抬头')
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
@@ -84,46 +79,58 @@ onMounted(() => {
|
||||
|
||||
<template>
|
||||
<div class="invoice-titles">
|
||||
<nav class="invoice-titles__breadcrumb text-secondary">
|
||||
<RouterLink to="/finance" class="link">
|
||||
财务中心
|
||||
</RouterLink>
|
||||
<span> > </span>
|
||||
<span>发票抬头</span>
|
||||
</nav>
|
||||
<div class="container">
|
||||
<!-- 面包屑 (70,124)「财务中心 /」13/400 #9CA3AF +「发票抬头管理」13/500 #4B5563 -->
|
||||
<nav class="invoice-titles__breadcrumb">
|
||||
<RouterLink to="/finance" class="invoice-titles__breadcrumb-link">
|
||||
财务中心 /
|
||||
</RouterLink>
|
||||
<span class="invoice-titles__breadcrumb-current">发票抬头管理</span>
|
||||
</nav>
|
||||
|
||||
<header class="invoice-titles__head">
|
||||
<h2 class="invoice-titles__title">
|
||||
发票管理
|
||||
</h2>
|
||||
<div class="invoice-titles__filters">
|
||||
<button
|
||||
v-for="tab in TYPE_TABS"
|
||||
:key="tab.value"
|
||||
class="invoice-titles__filter"
|
||||
:class="{ 'is-active': typeFilter === tab.value }"
|
||||
@click="typeFilter = tab.value"
|
||||
>
|
||||
{{ tab.label }}
|
||||
<!-- 标题条 (70,153) 1780×62:标题 x106 y174 15/700 + 右侧「+ 新增抬头」 -->
|
||||
<header class="invoice-titles__head">
|
||||
<h2 class="invoice-titles__title">
|
||||
发票管理
|
||||
</h2>
|
||||
<button class="invoice-titles__create" @click="onCreate">
|
||||
+ 新增抬头
|
||||
</button>
|
||||
<AppButton type="primary" @click="onCreate">
|
||||
+新增抬头
|
||||
</AppButton>
|
||||
</div>
|
||||
</header>
|
||||
</header>
|
||||
|
||||
<div class="invoice-titles__grid">
|
||||
<InvoiceTitleCard
|
||||
v-for="item in filteredTitles"
|
||||
:key="item.id"
|
||||
:invoice-title="item"
|
||||
@set-default="onSetDefault"
|
||||
@edit="onEdit"
|
||||
@delete="onDelete"
|
||||
/>
|
||||
<p v-if="filteredTitles.length === 0" class="invoice-titles__empty text-secondary">
|
||||
暂无发票抬头,点击右上角新增
|
||||
</p>
|
||||
<!-- 抬头卡列表 (70,229) 起 1780×129 / (70,372) 1780×88 -->
|
||||
<div class="invoice-titles__list">
|
||||
<InvoiceTitleCard
|
||||
v-for="item in pagedTitles"
|
||||
:key="item.id"
|
||||
:invoice-title="item"
|
||||
@set-default="onSetDefault"
|
||||
@edit="onEdit"
|
||||
@delete="onDelete"
|
||||
/>
|
||||
<p v-if="pagedTitles.length === 0" class="invoice-titles__empty">
|
||||
暂无发票抬头,点击右上角新增
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- 分页 (1684.93~1881.07,505) 12/400 -->
|
||||
<nav class="invoice-titles__pager" aria-label="分页">
|
||||
<button class="invoice-titles__page" :disabled="page <= 1" @click="go(page - 1)">
|
||||
‹
|
||||
</button>
|
||||
<button
|
||||
v-for="item in pages"
|
||||
:key="item"
|
||||
class="invoice-titles__page"
|
||||
:class="{ 'is-active': item === page }"
|
||||
@click="go(item)"
|
||||
>
|
||||
{{ item }}
|
||||
</button>
|
||||
<button class="invoice-titles__page" :disabled="page >= pageCount" @click="go(page + 1)">
|
||||
›
|
||||
</button>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<InvoiceTitleDialog
|
||||
@@ -144,107 +151,120 @@ onMounted(() => {
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
// 设计 35/36 发票抬头管理(1920 画布 1:1)——内容区 x70→1850 = 1780
|
||||
.invoice-titles {
|
||||
.flex(column, flex-start);
|
||||
align-items: stretch;
|
||||
gap: @spacing-base;
|
||||
width: 100%;
|
||||
max-width: @container-width;
|
||||
margin: 0 auto;
|
||||
padding: @spacing-lg @spacing-base @spacing-xxl;
|
||||
padding-bottom: 459px; // 分页底 521 → 页脚 1087
|
||||
background: @contract-page-bg;
|
||||
|
||||
// 设计 35/36:面包屑 13 设计px → 11px,前缀灰、当前页深灰
|
||||
// 面包屑 (70,124)
|
||||
&__breadcrumb {
|
||||
font-size: 11px;
|
||||
color: @text-color-disabled;
|
||||
.flex(row, flex-start, center);
|
||||
height: 81px; // 顶栏 72 → 标题条 153,面包屑盒 72..133
|
||||
padding-top: 36px;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
color: @project-muted;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
> span:last-child {
|
||||
color: @text-color;
|
||||
&__breadcrumb-link {
|
||||
color: @project-muted;
|
||||
|
||||
&:hover {
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
// 顶部「发票管理」白卡条(设计 35:蓝竖条标题 + 右侧按钮组)
|
||||
&__breadcrumb-current {
|
||||
margin-left: 5.25px; // 「财务中心 /」墨迹宽 65.25 → 发票抬头管理 x135.25
|
||||
color: @finance-entry-text;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
// 标题条 (70,153) 1780×62
|
||||
&__head {
|
||||
.flex(row, space-between, center);
|
||||
flex-wrap: wrap;
|
||||
gap: @spacing-base;
|
||||
padding: 14px 20px;
|
||||
height: 62px;
|
||||
padding: 0 33.56px 0 36px; // 标题 x106;按钮右缘 1822
|
||||
border: 1px solid @finance-card-line;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-shadow: @shadow-base;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__title {
|
||||
position: relative;
|
||||
padding-left: 10px;
|
||||
font-size: 12px;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
width: 4px;
|
||||
height: 14px;
|
||||
border-radius: @radius-round;
|
||||
background: @primary-strong;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
line-height: 20px;
|
||||
color: @finance-ink;
|
||||
}
|
||||
|
||||
&__filters {
|
||||
.flex(row, flex-end, center);
|
||||
gap: @spacing-sm;
|
||||
}
|
||||
|
||||
&__filter {
|
||||
height: 26px;
|
||||
padding: 0 14px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
color: @text-color;
|
||||
font-size: 11px;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover {
|
||||
border-color: @primary-strong;
|
||||
color: @primary-strong;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
border-color: @primary-strong;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
}
|
||||
}
|
||||
|
||||
// 「+ 新增抬头」:设计 35 实底 #024FFF 小按钮
|
||||
:deep(.app-button--primary) {
|
||||
height: 26px;
|
||||
padding: 0 12px;
|
||||
border-radius: @radius-sm;
|
||||
// 「+ 新增抬头」(1735.56,167) 110.44×34
|
||||
&__create {
|
||||
width: 110.44px;
|
||||
height: 34px;
|
||||
margin-right: -5px; // 按钮右缘 1822 → 卡内缩 33.56 得 1816.44,再右移 5
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
background: @primary-strong;
|
||||
font-size: 11px;
|
||||
color: @white;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: @primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
// 抬头卡纵排铺满(设计 35 一行一张)
|
||||
&__grid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: @spacing-base;
|
||||
// 抬头卡纵排:首卡 (70,229)、次卡 (70,372) → 间距 14
|
||||
&__list {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 14px;
|
||||
margin-top: 14px; // 标题条底 215 → 首卡 229
|
||||
}
|
||||
|
||||
&__empty {
|
||||
padding: @spacing-xl 0;
|
||||
font-size: 11px;
|
||||
padding: 60px 0;
|
||||
color: @project-muted;
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
// 分页:右对齐到内容区右缘,页码 12/400
|
||||
&__pager {
|
||||
.flex(row, flex-end, center);
|
||||
gap: 3.7px;
|
||||
margin-top: 8px; // 次卡底 460 → 页码 ink 505
|
||||
padding-right: 2.4px; // 末位「›」右缘 1881.07 → 内容右缘 1850
|
||||
}
|
||||
|
||||
&__page {
|
||||
min-width: 21.45px;
|
||||
height: 16px;
|
||||
padding: 0 3px;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
color: @finance-muted-text;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
transition: color 0.2s;
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
color: @primary-strong;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
color: @primary-strong;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import { computed, onMounted } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { AppButton } from '@/components'
|
||||
// 页面容器:数据只经 store,不直接 import api
|
||||
import { useFinanceStore } from '@/stores/modules/finance'
|
||||
import { formatMoney } from '@/utils/format'
|
||||
@@ -32,52 +31,73 @@ onMounted(() => {
|
||||
|
||||
<template>
|
||||
<div class="pay-result">
|
||||
<nav class="pay-result__breadcrumb text-secondary">
|
||||
<RouterLink to="/finance" class="link">
|
||||
财务中心
|
||||
</RouterLink>
|
||||
<span> > </span>
|
||||
<RouterLink to="/finance/bills" class="link">
|
||||
账单明细
|
||||
</RouterLink>
|
||||
<span> > </span>
|
||||
<span>支付结果</span>
|
||||
</nav>
|
||||
<div class="container">
|
||||
<!-- 面包屑 (67,95)「财务中心 / 账单明细 /」+「支付成功」13/500 #4B5563 -->
|
||||
<nav class="pay-result__breadcrumb">
|
||||
<RouterLink to="/finance" class="pay-result__crumb-link">
|
||||
财务中心 /
|
||||
</RouterLink>
|
||||
<RouterLink to="/finance/bills" class="pay-result__crumb-link">
|
||||
账单明细 /
|
||||
</RouterLink>
|
||||
<span class="pay-result__crumb-current">支付成功</span>
|
||||
</nav>
|
||||
|
||||
<template v-if="result">
|
||||
<section class="pay-result__card card">
|
||||
<div class="pay-result__head">
|
||||
<span class="pay-result__check">✓</span>
|
||||
<div class="pay-result__head-text">
|
||||
<h2 class="pay-result__title">
|
||||
支付成功
|
||||
</h2>
|
||||
<p class="pay-result__count text-secondary">
|
||||
共{{ result.bills.length }}个订单
|
||||
</p>
|
||||
<p class="pay-result__amount">
|
||||
付款金额 ¥{{ formatMoney(result.amount) }}
|
||||
</p>
|
||||
<template v-if="result">
|
||||
<!-- 主列 316 居中(设计 x799→1115) -->
|
||||
<section class="pay-result__col">
|
||||
<!-- 绿圆勾 (897,187) 120×120 #7ED321,✓ 56/400 白字居中 -->
|
||||
<div class="pay-result__check" aria-hidden="true">
|
||||
✓
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pay-result__grid">
|
||||
<div class="pay-result__grid-item">
|
||||
<span class="pay-result__grid-label text-secondary">支付方式</span>
|
||||
<span class="pay-result__grid-value">{{ methodLabel }}</span>
|
||||
</div>
|
||||
<div class="pay-result__grid-item">
|
||||
<span class="pay-result__grid-label text-secondary">支付时间</span>
|
||||
<span class="pay-result__grid-value">{{ result.payTime }}</span>
|
||||
</div>
|
||||
<div class="pay-result__grid-item">
|
||||
<span class="pay-result__grid-label text-secondary">交易流水号</span>
|
||||
<span class="pay-result__grid-value">{{ result.tradeNo }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 标题 (900.3,331) 22/700 #1F2937,字距 6 -->
|
||||
<h2 class="pay-result__title">
|
||||
支付成功
|
||||
</h2>
|
||||
|
||||
<div class="pay-result__bills">
|
||||
<!-- 金额行 (852.9,379):13/400 灰 + ¥ 18/700 #EF4444,基线对齐 -->
|
||||
<p class="pay-result__amount-row">
|
||||
<span class="pay-result__amount-label">共{{ result.bills.length }}个订单 支付金额:</span>
|
||||
<span class="pay-result__amount">¥ {{ formatMoney(result.amount, 0) }}</span>
|
||||
</p>
|
||||
|
||||
<!-- 分割线 (799,428) 316×1 #F0F1F3 -->
|
||||
<div class="pay-result__divider" />
|
||||
|
||||
<!-- 支付信息 (799,449) 13/700 -->
|
||||
<h4 class="pay-result__sub-title">
|
||||
支付信息
|
||||
</h4>
|
||||
<dl class="pay-result__fields">
|
||||
<div class="pay-result__field">
|
||||
<dt class="pay-result__label">
|
||||
支付方式
|
||||
</dt>
|
||||
<dd class="pay-result__value">
|
||||
{{ methodLabel }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="pay-result__field">
|
||||
<dt class="pay-result__label">
|
||||
支付时间
|
||||
</dt>
|
||||
<dd class="pay-result__value">
|
||||
{{ result.payTime }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="pay-result__field">
|
||||
<dt class="pay-result__label">
|
||||
交易流水号
|
||||
</dt>
|
||||
<dd class="pay-result__value">
|
||||
{{ result.tradeNo || '—' }}
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<!-- 已支付订单 (799,574) 13/700 -->
|
||||
<h4 class="pay-result__sub-title pay-result__sub-title--bills">
|
||||
已支付订单
|
||||
</h4>
|
||||
<ul class="pay-result__bill-list">
|
||||
@@ -86,184 +106,240 @@ onMounted(() => {
|
||||
:key="bill.id"
|
||||
class="pay-result__bill"
|
||||
>
|
||||
<span class="pay-result__bill-name">{{ bill.planName }}</span>
|
||||
<span class="pay-result__bill-no text-secondary">{{ bill.billNo }}</span>
|
||||
<span class="pay-result__bill-amount">¥{{ formatMoney(bill.amount) }}</span>
|
||||
<div class="pay-result__bill-head">
|
||||
<span class="pay-result__bill-name">{{ bill.planName }}</span>
|
||||
<span class="pay-result__bill-amount">¥ {{ formatMoney(bill.amount, 0) }}</span>
|
||||
</div>
|
||||
<p class="pay-result__bill-meta">
|
||||
账单号:{{ bill.billNo }}
|
||||
</p>
|
||||
<p class="pay-result__bill-meta">
|
||||
关联项目:{{ bill.projectName }}
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="pay-result__footer">
|
||||
<AppButton type="primary" @click="router.push('/finance/bills')">
|
||||
返回
|
||||
</AppButton>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
<!-- 返回 (1031,711) 84×32 #024FFF 12/500 白字,右对齐 -->
|
||||
<div class="pay-result__footer">
|
||||
<button
|
||||
class="pay-result__back"
|
||||
type="button"
|
||||
@click="router.push('/finance/bills')"
|
||||
>
|
||||
返回
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<p v-else class="pay-result__empty text-secondary">
|
||||
暂无支付结果
|
||||
</p>
|
||||
<p v-else class="pay-result__empty">
|
||||
暂无支付结果
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
// 设计「支付成功」c56193d1(1920 画布 1:1)——316 居中窄列坐在页面底色上
|
||||
.pay-result {
|
||||
width: 100%;
|
||||
max-width: @container-width;
|
||||
margin: 0 auto;
|
||||
padding: @spacing-lg @spacing-base @spacing-xxl;
|
||||
padding-bottom: 344px; // 列底 743 → 页脚 1087
|
||||
background: @contract-page-bg;
|
||||
|
||||
// 设计 32:面包屑 13 设计px → 11px,前缀灰、当前页深灰
|
||||
// 面包屑 (67,95):头部底 73 → 文字盒顶 95 = 22
|
||||
&__breadcrumb {
|
||||
margin-bottom: @spacing-base;
|
||||
font-size: 11px;
|
||||
color: @text-color-disabled;
|
||||
.flex(row, flex-start, center);
|
||||
padding-top: 22px;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
color: @project-muted;
|
||||
}
|
||||
|
||||
> span:last-child {
|
||||
color: @text-color;
|
||||
&__crumb-link {
|
||||
color: @project-muted;
|
||||
|
||||
&:hover {
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
// 设计 32:内容为居中窄列,直接坐在页面底色上(无外层大卡)
|
||||
&__card {
|
||||
width: 300px;
|
||||
max-width: 100%;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
&__crumb-current {
|
||||
margin-left: 3px;
|
||||
color: @finance-entry-text; // 设计 #4B5563
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
// 头部:大绿圆勾 + 标题 + 「共 N 个订单 / 付款金额」同一行
|
||||
&__head {
|
||||
.flex(column, center, center);
|
||||
gap: 12px;
|
||||
padding-bottom: 16px;
|
||||
border-bottom: 1px solid @project-divider;
|
||||
// 主列 316,居中(面包屑底 112 → 圆顶 187 = 75)
|
||||
&__col {
|
||||
width: 316px;
|
||||
margin: 75px auto 0;
|
||||
}
|
||||
|
||||
// 绿圆勾 120×120 #7ED321
|
||||
&__check {
|
||||
.flex(row, center);
|
||||
width: 76px;
|
||||
height: 76px;
|
||||
border-radius: @radius-round;
|
||||
.flex(row, center, center);
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
margin: 0 auto;
|
||||
border-radius: 50%;
|
||||
background: @finance-result-circle;
|
||||
color: @white;
|
||||
font-size: 42px;
|
||||
font-size: 56px;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&__head-text {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
align-items: baseline;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
// 标题:圆底 307 → 331 = 24;盒 113.3 ≈ 4×22 + 4×6 字距
|
||||
&__title {
|
||||
flex-basis: 100%;
|
||||
margin: 24px -6px 0 0;
|
||||
text-align: center;
|
||||
font-size: 17px;
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
line-height: 29px;
|
||||
letter-spacing: 6px;
|
||||
color: @finance-ink;
|
||||
}
|
||||
|
||||
// 金额行:标题底 360 → 374 = 14;13/400 灰 + 18/700 #EF4444 基线对齐
|
||||
&__amount-row {
|
||||
.flex(row, center, baseline);
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
&__amount-label {
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
color: @finance-muted-text;
|
||||
}
|
||||
|
||||
&__amount {
|
||||
font-size: 14px;
|
||||
color: @danger-color;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
line-height: 24px;
|
||||
color: @danger-color; // 设计 #EF4444
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&__count {
|
||||
font-size: 11px;
|
||||
// 分割线:金额行底 398 → 428 = 30
|
||||
&__divider {
|
||||
height: 1px;
|
||||
margin-top: 30px;
|
||||
background: @project-divider;
|
||||
}
|
||||
|
||||
// 支付信息:标签左灰、值右粗(设计 32 竖排行)
|
||||
&__grid {
|
||||
&__sub-title {
|
||||
margin-top: 20px; // 线底 429 → 449 = 20
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
line-height: 17px;
|
||||
color: @finance-ink;
|
||||
|
||||
&--bills {
|
||||
margin-top: 22px; // 末行底 552 → 574 = 22
|
||||
}
|
||||
}
|
||||
|
||||
// 支付信息三行:标题底 466 → 首行 480 = 14;行高 16 步进 28 → gap 12
|
||||
&__fields {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 14px;
|
||||
margin-top: 16px;
|
||||
gap: 12px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
&__grid-item {
|
||||
.flex(row, space-between, center);
|
||||
gap: @spacing-base;
|
||||
&__field {
|
||||
.flex(row, space-between, flex-start);
|
||||
}
|
||||
|
||||
&__grid-label {
|
||||
font-size: 11px;
|
||||
color: @text-color-secondary;
|
||||
&__label {
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 16px;
|
||||
color: @finance-muted-text;
|
||||
}
|
||||
|
||||
&__grid-value {
|
||||
font-size: 11px;
|
||||
&__value {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
line-height: 16px;
|
||||
color: @finance-ink;
|
||||
text-align: right;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
&__bills {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
&__sub-title {
|
||||
margin-bottom: 8px;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
// 已支付订单行卡:白底圆角(设计 32 实取)
|
||||
// 白卡:标题底 591 → 601 = 10;316×84 白底描边 #F0F1F3
|
||||
&__bill-list {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 6px;
|
||||
margin-top: 10px;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
&__bill {
|
||||
.flex(row, flex-start, center);
|
||||
gap: 8px;
|
||||
padding: 10px;
|
||||
border-radius: 6px;
|
||||
box-sizing: border-box;
|
||||
height: 84px;
|
||||
padding: 15px 17px;
|
||||
border: 1px solid @project-divider;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
font-size: 11px;
|
||||
color: @text-color;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&__bill-head {
|
||||
.flex(row, space-between, baseline);
|
||||
}
|
||||
|
||||
&__bill-name {
|
||||
color: @heading-color;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
&__bill-no {
|
||||
flex: 1;
|
||||
font-size: 11px;
|
||||
color: @text-color-disabled;
|
||||
line-height: 16px;
|
||||
color: @finance-ink;
|
||||
.ellipsis();
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
&__bill-amount {
|
||||
flex-shrink: 0;
|
||||
margin-left: 12px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
white-space: nowrap;
|
||||
line-height: 16px;
|
||||
color: @finance-ink;
|
||||
}
|
||||
|
||||
// 返回按钮右对齐(设计 32 在列右下)
|
||||
&__bill-meta {
|
||||
margin-top: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 16px;
|
||||
color: @project-muted; // 设计 #9CA3AF
|
||||
.ellipsis();
|
||||
|
||||
+ .pay-result__bill-meta {
|
||||
margin-top: 0; // 账单号 638 → 关联项目 654 连排
|
||||
}
|
||||
}
|
||||
|
||||
// 返回按钮:卡底 685 → 711 = 26,右对齐 84×32 #024FFF
|
||||
&__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 16px;
|
||||
.flex(row, flex-end, flex-start);
|
||||
margin-top: 26px;
|
||||
}
|
||||
|
||||
:deep(.app-button--primary) {
|
||||
&__back {
|
||||
width: 84px;
|
||||
height: 32px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
line-height: 16px;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: @primary-color;
|
||||
@@ -271,9 +347,10 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
&__empty {
|
||||
padding: @spacing-xl 0;
|
||||
padding: 80px 0;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
font-size: 13px;
|
||||
color: @project-muted;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user