fix: 精简账户总表冗余提额列 #1077

Merged
shanshi merged 1 commits from feature/shanshi-remove-account-raise-columns into main 2026-11-11 14:50:27 +08:00
3 changed files with 16 additions and 15 deletions

View File

@ -1733,11 +1733,6 @@ class FinanceLedgerPageData
'daily_available' => ['sort' => $a . '.daily_available', 'type' => 'number'],
'blocked_amount' => ['sort' => $a . '.blocked_amount', 'type' => 'number'],
'daily_withdraw' => ['sort' => $a . '.daily_available', 'type' => 'number'],
'clearing_days' => ['sort' => $a . '.clearing_days', 'type' => 'number'],
'raise_target' => ['sort' => "CAST({$a}.raise_target AS DECIMAL(18, 2))", 'filter' => $a . '.raise_target', 'type' => 'number'],
'raise_status' => ['sort' => $a . '.raise_status', 'type' => 'text'],
'raise_actions' => ['sort' => $a . '.raise_actions', 'type' => 'text'],
'done_actions' => ['sort' => $a . '.done_actions', 'type' => 'text'],
'next_action' => ['sort' => $a . '.next_action', 'type' => 'text'],
'remark' => ['sort' => $a . '.remark', 'type' => 'text'],
'owner' => ['sort' => $a . '.owner', 'type' => 'text'],

View File

@ -164,11 +164,6 @@
['daily_available', '可用金额(万元)', 'number', ['headerClass' => 'num', 'align' => 'end']],
['blocked_amount', '不可用金额(万元)', 'number', ['headerClass' => 'num', 'align' => 'end']],
['daily_withdraw', '每日可出(万元)', 'number', ['headerClass' => 'num', 'align' => 'end']],
['clearing_days', '预计出清天数', 'number', ['headerClass' => 'num', 'align' => 'end']],
['raise_target', '提额目标(万元)', 'number'],
['raise_status', '提额状态', 'text'],
['raise_actions', '提额动作', 'text'],
['done_actions', '已做动作', 'text'],
['next_action', '下一步', 'text'],
['remark', '备注', 'text'],
['owner', '责任人', 'text'],
@ -701,7 +696,7 @@
新增公司/账户
</button>
@endif
<div class="ledger-column-picker" data-ledger-column-picker data-column-storage-key="caiwu.financial-ledger.accounts.preferences.v2.{{ auth()->id() }}.{{ company_id() }}">
<div class="ledger-column-picker" data-ledger-column-picker data-column-storage-key="caiwu.financial-ledger.accounts.preferences.v3.{{ auth()->id() }}.{{ company_id() }}">
<button class="ledger-btn" type="button" data-ledger-column-toggle aria-expanded="false"><span class="material-icons-outlined" aria-hidden="true">view_column</span>列设置</button>
<div class="ledger-column-panel" data-ledger-column-panel role="group" aria-label="选择账户总表展示列" hidden>
<p class="ledger-column-help">拖动字段可调整列顺序;拖动表头右侧边界可调整列宽,双击边界恢复默认。</p>
@ -1026,10 +1021,10 @@
</select>
@endif
</td>
<td class="center" data-account-last4>{{ $row->account_last4 }}</td><td class="center" title="{{ $moneyYuanTitle($row->single_limit) }}">{{ $moneyWan($row->single_limit) }}</td><td class="center" title="{{ $moneyYuanTitle($row->daily_limit) }}">{{ $moneyWan($row->daily_limit) }}</td><td class="center" title="{{ $moneyYuanTitle($row->monthly_limit) }}">{{ $moneyWan($row->monthly_limit) }}</td><td class="center" title="{{ $moneyYuanTitle($row->yearly_limit) }}">{{ $moneyWan($row->yearly_limit) }}</td><td class="num" data-account-current-balance="{{ (float) $row->current_balance }}" title="{{ $moneyYuanTitle($row->current_balance) }}">{{ $moneyWan($row->current_balance) }}</td><td class="num" data-account-available-amount title="{{ $moneyYuanTitle($row->daily_available) }}">{{ $moneyWan($row->daily_available) }}</td><td class="num" data-account-blocked-amount title="{{ $moneyYuanTitle($row->blocked_amount) }}">{{ $moneyWan($row->blocked_amount) }}</td><td class="num" data-account-daily-available-amount title="{{ $moneyYuanTitle($row->daily_available) }}">{{ $moneyWan($row->daily_available) }}</td><td class="num">{{ $row->clearing_days !== null ? number_format((float) $row->clearing_days, 2) : '' }}</td><td title="{{ $moneyYuanTitle($row->raise_target) }}">{{ $moneyWan($row->raise_target) }}</td><td>{{ $row->raise_status }}</td><td>{{ $row->raise_actions }}</td><td>{{ $row->done_actions }}</td><td>{{ $row->next_action }}</td><td>{{ $row->remark }}</td><td>{{ $row->owner }}</td>
<td class="center" data-account-last4>{{ $row->account_last4 }}</td><td class="center" title="{{ $moneyYuanTitle($row->single_limit) }}">{{ $moneyWan($row->single_limit) }}</td><td class="center" title="{{ $moneyYuanTitle($row->daily_limit) }}">{{ $moneyWan($row->daily_limit) }}</td><td class="center" title="{{ $moneyYuanTitle($row->monthly_limit) }}">{{ $moneyWan($row->monthly_limit) }}</td><td class="center" title="{{ $moneyYuanTitle($row->yearly_limit) }}">{{ $moneyWan($row->yearly_limit) }}</td><td class="num" data-account-current-balance="{{ (float) $row->current_balance }}" title="{{ $moneyYuanTitle($row->current_balance) }}">{{ $moneyWan($row->current_balance) }}</td><td class="num" data-account-available-amount title="{{ $moneyYuanTitle($row->daily_available) }}">{{ $moneyWan($row->daily_available) }}</td><td class="num" data-account-blocked-amount title="{{ $moneyYuanTitle($row->blocked_amount) }}">{{ $moneyWan($row->blocked_amount) }}</td><td class="num" data-account-daily-available-amount title="{{ $moneyYuanTitle($row->daily_available) }}">{{ $moneyWan($row->daily_available) }}</td><td>{{ $row->next_action }}</td><td>{{ $row->remark }}</td><td>{{ $row->owner }}</td>
</tr>
@empty
<tr><td colspan="27"><div class="ledger-empty">没有匹配的账户数据。</div></td></tr>
<tr><td colspan="22"><div class="ledger-empty">没有匹配的账户数据。</div></td></tr>
@endforelse
</tbody>
</table>

View File

@ -140,8 +140,8 @@ class FinanceLedgerHeaderControlsTest extends FeatureTestCase
$response = $this->loginAs()->get($this->pageUrl());
$html = $response->assertOk()->getContent();
$this->assertSame(72, preg_match_all('/<details\b[^>]*data-ledger-header-details/', $html));
$this->assertSame(72, preg_match_all('/<span\b[^>]*data-ledger-header-label/', $html));
$this->assertSame(67, preg_match_all('/<details\b[^>]*data-ledger-header-details/', $html));
$this->assertSame(67, preg_match_all('/<span\b[^>]*data-ledger-header-label/', $html));
$this->assertSame(2, preg_match_all('/<select name="transactions_filter_value"/', $html));
$this->assertSame(1, preg_match_all('/<input\b[^>]*name="transactions_filter_value"[^>]*list="ledger-header-options-transactions-effective_account_short"/', $html));
$this->assertStringContainsString(
@ -522,6 +522,17 @@ class FinanceLedgerHeaderControlsTest extends FeatureTestCase
$this->assertStringContainsString('data-ledger-account-row="账户乙"', $allHtml);
$this->assertStringContainsString('data-ledger-account-row="账户丙支付宝"', $allHtml);
$this->assertStringContainsString('data-ledger-account-row="账户丁网商"', $allHtml);
$this->assertSame(1, preg_match('/<table class="ledger-table ledger-accounts-table">(.*?)<\/table>/s', $allHtml, $accountsTable));
$this->assertSame(22, substr_count($accountsTable[1], 'data-ledger-header-details'));
$this->assertSame(1, preg_match('/<tr data-ledger-account-row="账户甲">(.*?)<\/tr>/s', $allHtml, $accountRow));
$this->assertSame(22, substr_count($accountRow[1], '<td'));
$this->assertStringNotContainsString('>预计出清天数</span>', $allHtml);
$this->assertStringNotContainsString('>提额目标(万元)</span>', $allHtml);
$this->assertStringNotContainsString('>提额状态</span>', $allHtml);
$this->assertStringNotContainsString('>提额动作</span>', $allHtml);
$this->assertStringNotContainsString('>已做动作</span>', $allHtml);
$this->assertStringContainsString('caiwu.financial-ledger.accounts.preferences.v3.', $allHtml);
$this->assertStringContainsString('>下一步</span>', $allHtml);
$bankHtml = $this->loginAs()->get($this->pageUrl([
'accounts_view' => 'bank',