feat: 安装费明细统一按万元展示 #642
@ -483,7 +483,7 @@
|
||||
</div>
|
||||
<div class="installation-fee-dialog__side">
|
||||
<div class="installation-fee-dialog__total">
|
||||
<span>当前筛选合计(元)</span>
|
||||
<span>当前筛选合计(万元)</span>
|
||||
<strong data-installation-fee-current-total>¥0.00</strong>
|
||||
</div>
|
||||
<button type="button" class="installation-fee-dialog__close" data-installation-fee-close aria-label="关闭安装费明细">×</button>
|
||||
@ -525,7 +525,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">平台</th>
|
||||
<th scope="col" class="is-number">结算明细金额</th>
|
||||
<th scope="col" class="is-number">结算明细金额(万元)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody data-installation-fee-platform-rows></tbody>
|
||||
@ -539,7 +539,7 @@
|
||||
<th scope="col">店铺名称</th>
|
||||
<th scope="col">安装公司</th>
|
||||
<th scope="col">收款渠道</th>
|
||||
<th scope="col" class="is-number">结算明细金额</th>
|
||||
<th scope="col" class="is-number">结算明细金额(万元)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody data-installation-fee-rows></tbody>
|
||||
@ -621,13 +621,6 @@
|
||||
updateCount();
|
||||
}
|
||||
|
||||
function yuan(value) {
|
||||
return '¥' + Number(value || 0).toLocaleString('zh-CN', {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2
|
||||
});
|
||||
}
|
||||
|
||||
function amount(value) {
|
||||
return Number(value || 0).toLocaleString('zh-CN', {
|
||||
minimumFractionDigits: 2,
|
||||
@ -639,6 +632,14 @@
|
||||
return amount(Number(value || 0) / 10000);
|
||||
}
|
||||
|
||||
function rawYuan(value) {
|
||||
return '¥' + amount(value);
|
||||
}
|
||||
|
||||
function wanYuan(value) {
|
||||
return '¥' + wanAmount(value);
|
||||
}
|
||||
|
||||
function captionRange(value) {
|
||||
var matchFrom = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value.from);
|
||||
var matchTo = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value.to);
|
||||
@ -775,7 +776,8 @@
|
||||
});
|
||||
var amount = document.createElement('td');
|
||||
amount.className = 'is-number';
|
||||
amount.textContent = yuan(row.amount);
|
||||
amount.textContent = wanYuan(row.amount);
|
||||
amount.title = rawYuan(row.amount);
|
||||
tr.appendChild(amount);
|
||||
rowsEl.appendChild(tr);
|
||||
});
|
||||
@ -799,12 +801,14 @@
|
||||
tr.appendChild(platformCell);
|
||||
var amount = document.createElement('td');
|
||||
amount.className = 'is-number';
|
||||
amount.textContent = yuan(byPlatform[name]);
|
||||
amount.textContent = wanYuan(byPlatform[name]);
|
||||
amount.title = rawYuan(byPlatform[name]);
|
||||
tr.appendChild(amount);
|
||||
platformRowsEl.appendChild(tr);
|
||||
});
|
||||
|
||||
currentTotal.textContent = yuan(total);
|
||||
currentTotal.textContent = wanYuan(total);
|
||||
currentTotal.title = rawYuan(total);
|
||||
updateCount();
|
||||
emptyEl.hidden = rows.length > 0;
|
||||
emptyEl.textContent = allRows.length
|
||||
|
||||
@ -288,6 +288,8 @@ class ManagementCrudTest extends FeatureTestCase
|
||||
->assertSee('data-installation-fee-trend', false)
|
||||
->assertSee('data-installation-fee-package', false)
|
||||
->assertSee('data-installation-fee-non-package', false)
|
||||
->assertSeeText('当前筛选合计(万元)')
|
||||
->assertSeeText('结算明细金额(万元)')
|
||||
->assertSee('data-installation-fee-tab="platform"', false)
|
||||
->assertSee('data-installation-fee-tab="detail"', false)
|
||||
->assertSee('data-installation-fee-panel="platform"', false)
|
||||
@ -311,6 +313,9 @@ class ManagementCrudTest extends FeatureTestCase
|
||||
->assertSee('function captionRange(value)', false)
|
||||
->assertSee('function setCardValue(total, rows, value, data)', false)
|
||||
->assertSee('function wanAmount(value)', false)
|
||||
->assertSee('function wanYuan(value)', false)
|
||||
->assertSee('amount.textContent = wanYuan(row.amount)', false)
|
||||
->assertSee('currentTotal.textContent = wanYuan(total)', false)
|
||||
->assertSee('function activateTab(name, focusTab)', false)
|
||||
->assertSee("panel.style.display = selected ? 'block' : 'none'", false)
|
||||
->assertSee("tabsEl.addEventListener('click'", false)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user