fix(client): 财务汇总往来搜索改为表头下拉框形态(验收反馈)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,9 +28,11 @@
|
||||
.sec-head{display:flex; align-items:baseline; gap:10px; margin:0 0 12px;}
|
||||
.sec-head h2{margin:0; font-size:var(--fs-h2); color:var(--heading); font-weight:700;}
|
||||
.sec-head .sh-sub{font-size:var(--fs-xs); color:var(--muted);}
|
||||
/* 汇总卡头部往来单位搜索(即时本地过滤,非 combo 单选) */
|
||||
.sec-head .sum-search{margin-left:auto; width:220px; align-self:center;}
|
||||
.block{margin-bottom:22px;}
|
||||
/* 汇总表「往来单位」列头内嵌搜索下拉(对齐 ComboSearchField:combo 原子
|
||||
+ openSearchMenu 弹层,单选精确匹配一行,非关键字子串过滤) */
|
||||
.th-party-wrap{display:flex; align-items:center; gap:10px;}
|
||||
.th-party-wrap .combo{height:34px; width:180px; flex:none;}
|
||||
|
||||
/* ====== 新增原子:条形图 .barchart / .bar ====== */
|
||||
.chart-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); padding:18px 20px 14px; transition:background-color .28s,border-color .28s;}
|
||||
@@ -110,11 +112,12 @@
|
||||
|
||||
<!-- 4. 应收/应付 汇总表 -->
|
||||
<div class="block">
|
||||
<div class="sec-head"><h2>应收 / 应付 汇总</h2><span class="sh-sub">按往来单位 · 点击行查看流水</span>
|
||||
<div class="searchbox sum-search"><svg viewBox="0 0 24 24"><use href="#i-search"/></svg><input id="sumSearch" placeholder="搜索往来单位…" oninput="sumKw=this.value; buildSummary();"></div>
|
||||
</div>
|
||||
<div class="sec-head"><h2>应收 / 应付 汇总</h2><span class="sh-sub">按往来单位 · 点击行查看流水</span></div>
|
||||
<div class="table"><table>
|
||||
<thead><tr><th>往来单位</th><th class="num">应收</th><th class="num">应付</th><th class="num">净额</th><th class="act">操作</th></tr></thead>
|
||||
<thead><tr>
|
||||
<th><div class="th-party-wrap"><span>往来单位</span><div class="combo" id="sumPartyCombo" onclick="openSumPartyFilter(this)"><input id="sumPartyInput" readonly placeholder="搜索往来单位…"><span class="caf" id="sumPartyCaf" onclick="sumPartyCafClick(event)"><svg viewBox="0 0 24 24" stroke-width="2"><use href="#i-chevron-down"/></svg></span></div></div></th>
|
||||
<th class="num">应收</th><th class="num">应付</th><th class="num">净额</th><th class="act">操作</th>
|
||||
</tr></thead>
|
||||
<tbody id="sumBody"></tbody>
|
||||
</table></div>
|
||||
</div>
|
||||
@@ -185,11 +188,27 @@ const SUMMARY=[
|
||||
{name:'川渝糖酒集团',recv:0,pay:60400}
|
||||
];
|
||||
function yuan(n){ return '¥'+n.toLocaleString(); }
|
||||
// 汇总卡「往来单位」搜索:本地即时过滤(数据已全量加载,非服务端分页,搜索口径=显示口径)
|
||||
let sumKw='';
|
||||
// 汇总表头「往来单位」下拉筛选(对齐 ComboSearchField:单选精确匹配一行,非
|
||||
// 关键字子串过滤;候选=当前汇总行往来单位,搜索口径=显示口径,不用全量往来
|
||||
// 单位库,避免选到无余额单位出空表)
|
||||
let sumPartyId=null; // 选中的 SUMMARY 下标;null=全部
|
||||
function openSumPartyFilter(t){
|
||||
openSearchMenu(t, SUMMARY.map((s,i)=>({v:i,label:s.name,sel:i===sumPartyId})), v=>{
|
||||
sumPartyId=Number(v); closeMenus(); buildSummary();
|
||||
}, {placeholder:'搜索往来单位…'});
|
||||
}
|
||||
// combo 已选中值(.has)时,点击右侧图标(此时为 ×)清除,不弹出下拉
|
||||
function sumPartyCafClick(e){
|
||||
if(sumPartyId!=null){ e.stopPropagation(); sumPartyId=null; buildSummary(); }
|
||||
}
|
||||
function buildSummary(){
|
||||
const q=sumKw.trim().toLowerCase();
|
||||
const rows=SUMMARY.map((s,i)=>({...s,i})).filter(s=>!q||s.name.toLowerCase().includes(q));
|
||||
const rows=sumPartyId==null?SUMMARY.map((s,i)=>({...s,i})):SUMMARY.map((s,i)=>({...s,i})).filter(s=>s.i===sumPartyId);
|
||||
const has=sumPartyId!=null;
|
||||
document.getElementById('sumPartyCombo').classList.toggle('has',has);
|
||||
document.getElementById('sumPartyInput').value=has?SUMMARY[sumPartyId].name:'';
|
||||
document.getElementById('sumPartyCaf').innerHTML=has
|
||||
?'<svg viewBox="0 0 24 24" stroke-width="2"><use href="#i-close"/></svg>'
|
||||
:'<svg viewBox="0 0 24 24" stroke-width="2"><use href="#i-chevron-down"/></svg>';
|
||||
document.getElementById('sumBody').innerHTML=rows.length?rows.map(s=>{
|
||||
const net=s.recv-s.pay;
|
||||
const netCls=net>0?'net-pos':(net<0?'net-neg':'');
|
||||
|
||||
Reference in New Issue
Block a user