HEL-574: add segmented interest accumulation mode to interest calculator
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -1,6 +1,49 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/** @var array $me */
|
||||
$ciSegRowTpl = <<<'HTML'
|
||||
<div class="ci-seg-row" data-ci-seg-row>
|
||||
<span class="ci-seg-no num" aria-hidden="true"></span>
|
||||
<div class="ci-seg-f ci-seg-f--amt">
|
||||
<label>本金(元)</label>
|
||||
<input data-seg-f="amt" type="text" inputmode="decimal" autocomplete="off" placeholder="如 100000">
|
||||
</div>
|
||||
<div class="ci-seg-f ci-seg-f--rate">
|
||||
<label>利率</label>
|
||||
<div class="ci-seg-pair">
|
||||
<input data-seg-f="rate" type="text" inputmode="decimal" autocomplete="off" placeholder="数值">
|
||||
<select data-seg-f="kind" aria-label="利率种类">
|
||||
<option value="annual" selected>年利率 %</option>
|
||||
<option value="monthly">月利率 %</option>
|
||||
<option value="daily">日利率 %</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ci-seg-f ci-seg-f--mode">
|
||||
<label>计息方式</label>
|
||||
<select data-seg-f="daymode" aria-label="计息方式">
|
||||
<option value="manual" selected>按天数</option>
|
||||
<option value="range">按起止日期</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="ci-seg-f ci-seg-f--days" data-seg-cell="manual">
|
||||
<label>天数</label>
|
||||
<input data-seg-f="days" type="number" min="0" step="1" placeholder="正整数">
|
||||
</div>
|
||||
<div class="ci-seg-f ci-seg-f--days" data-seg-cell="range" hidden>
|
||||
<label>起止日期</label>
|
||||
<div class="ci-seg-pair">
|
||||
<input data-seg-f="d1" type="date" aria-label="起息日">
|
||||
<span class="ci-seg-sep">至</span>
|
||||
<input data-seg-f="d2" type="date" aria-label="截止日">
|
||||
</div>
|
||||
</div>
|
||||
<span class="ci-seg-out num" data-seg-out></span>
|
||||
<button type="button" class="icon-btn ci-seg-del" data-ci-seg-del aria-label="删除该段" title="删除该段">
|
||||
<svg width="13" height="13" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true"><path d="M3.5 3.5l9 9M12.5 3.5l-9 9"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
HTML;
|
||||
?>
|
||||
<div class="page-head">
|
||||
<div>
|
||||
@@ -15,6 +58,11 @@ declare(strict_types=1);
|
||||
<div class="calc-grid">
|
||||
<div class="editor-card">
|
||||
<form data-calc-interest novalidate>
|
||||
<div class="seg ci-mode" role="tablist" aria-label="利息计算模式">
|
||||
<button type="button" role="tab" data-ci-mode="single" data-active>单笔计算</button>
|
||||
<button type="button" role="tab" data-ci-mode="multi">分段累加</button>
|
||||
</div>
|
||||
<div data-ci-panel="single">
|
||||
<div class="cr-group">
|
||||
<div class="section-title" style="margin-top:0;">金额与利率</div>
|
||||
<div class="cr"><label for="ci-amt">本金(元)</label><div class="cr-ctl">
|
||||
@@ -47,6 +95,16 @@ declare(strict_types=1);
|
||||
<span class="cr-hint" style="margin:0;" data-ci-range-label></span>
|
||||
</div></div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div data-ci-panel="multi" hidden>
|
||||
<div class="cr-group">
|
||||
<div class="section-title" style="margin-top:0;">计息分段</div>
|
||||
<div class="calc-group-note" style="margin:-4px 0 10px;">适用于授信随用随取的多笔支用汇总、逾期分段变利率变本金等场景。每段利率种类可独立选择,各行分别计息后自动汇总。</div>
|
||||
<template data-ci-seg-tpl><?= $ciSegRowTpl ?></template>
|
||||
<div class="ci-seg-rows" data-ci-seg-rows></div>
|
||||
<button type="button" class="btn btn--plain btn--sm" data-ci-seg-add style="margin-top:10px;">+ 添加一段</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cr-group">
|
||||
<div class="section-title">计息口径</div>
|
||||
<div class="cr"><label for="ci-count">结息方式</label><div class="cr-ctl">
|
||||
|
||||
Reference in New Issue
Block a user