parent
2a3ea39e72
commit
d9d6cdad9b
@ -4,7 +4,7 @@
|
||||
<div>
|
||||
<p class="overview-eyebrow">店铺收款账户</p>
|
||||
<h2>账户余额总览</h2>
|
||||
<p class="overview-subtitle">聚合 8 个收款平台的月度期初、收入与支出</p>
|
||||
<p class="overview-subtitle">聚合 8 个收款平台的月度期初、收入与支出(单位:万元)</p>
|
||||
</div>
|
||||
<div class="month-switcher" role="group" aria-label="选择统计月份">
|
||||
<button type="button" aria-label="上一个月" @click="changeMonth(-1)">
|
||||
@ -23,7 +23,7 @@
|
||||
<span>{{ card.label }}</span>
|
||||
<span class="card-mark" aria-hidden="true"></span>
|
||||
</div>
|
||||
<strong v-if="!loading" class="card-value" :data-summary-key="card.key">{{ card.value }}</strong>
|
||||
<strong v-if="!loading" class="card-value" :data-summary-key="card.key" :title="card.title">{{ card.value }}</strong>
|
||||
<span v-else class="card-value card-skeleton" aria-label="加载中">--</span>
|
||||
<p>{{ card.note }}</p>
|
||||
</article>
|
||||
@ -107,28 +107,32 @@ export default {
|
||||
{
|
||||
key: 'opening_balance',
|
||||
label: '期初余额合计',
|
||||
value: this.money(this.summary.opening_balance),
|
||||
value: this.moneyWan(this.summary.opening_balance),
|
||||
title: this.yuanTitle(this.summary.opening_balance),
|
||||
note: '8 个平台上月期末余额',
|
||||
className: '',
|
||||
},
|
||||
{
|
||||
key: 'income',
|
||||
label: '收入合计',
|
||||
value: this.money(this.summary.income),
|
||||
value: this.moneyWan(this.summary.income),
|
||||
title: this.yuanTitle(this.summary.income),
|
||||
note: '各平台当月收入',
|
||||
className: 'is-income',
|
||||
},
|
||||
{
|
||||
key: 'expense',
|
||||
label: '支出合计',
|
||||
value: this.money(this.summary.expense),
|
||||
value: this.moneyWan(this.summary.expense),
|
||||
title: this.yuanTitle(this.summary.expense),
|
||||
note: '各平台当月支出',
|
||||
className: 'is-expense',
|
||||
},
|
||||
{
|
||||
key: 'balance',
|
||||
label: '期末余额合计',
|
||||
value: this.money(this.summary.balance),
|
||||
value: this.moneyWan(this.summary.balance),
|
||||
title: this.yuanTitle(this.summary.balance),
|
||||
note: '期初余额 + 收入合计 - 支出合计',
|
||||
className: 'is-balance',
|
||||
},
|
||||
@ -178,6 +182,19 @@ export default {
|
||||
maximumFractionDigits: 2,
|
||||
})}`;
|
||||
},
|
||||
moneyWan(value) {
|
||||
if (value === null || value === undefined || !Number.isFinite(Number(value))) return '—';
|
||||
|
||||
return `¥${(Number(value) / 10000).toLocaleString('zh-CN', {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
})}万`;
|
||||
},
|
||||
yuanTitle(value) {
|
||||
const amount = this.money(value);
|
||||
|
||||
return amount === '—' ? '' : `原值:${amount}`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -23,6 +23,13 @@ class StoreReceivingBalanceOverviewTest extends TestCase
|
||||
$this->assertStringContainsString('params: { month: this.month }', $source);
|
||||
$this->assertStringContainsString('暂不展示不完整合计', $source);
|
||||
$this->assertStringContainsString(':aria-busy="loading', $source);
|
||||
$this->assertStringContainsString('(单位:万元)', $source);
|
||||
$this->assertStringContainsString('value: this.moneyWan(this.summary.opening_balance)', $source);
|
||||
$this->assertStringContainsString('value: this.moneyWan(this.summary.income)', $source);
|
||||
$this->assertStringContainsString('value: this.moneyWan(this.summary.expense)', $source);
|
||||
$this->assertStringContainsString('value: this.moneyWan(this.summary.balance)', $source);
|
||||
$this->assertStringContainsString('}万`;', $source);
|
||||
$this->assertStringContainsString(':title="card.title"', $source);
|
||||
}
|
||||
|
||||
public function test_overview_tab_is_placed_before_taobao_alipay_navigation(): void
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user