feat: 落地决策 209/211/213——临删联动与0量隐藏、历史检索硬过滤项单位与0价、附件列及只看未绑筛选

This commit is contained in:
lianjianwei2024
2026-10-26 15:12:09 +08:00
parent 79ab8d1ffd
commit 5de58b49ad
12 changed files with 680 additions and 459 deletions

View File

@@ -421,6 +421,10 @@ td.pcell input{width:100%;padding:3px 7px;font-size:12.5px;border:1px solid #9fb
<label class="tip" style="white-space:nowrap;cursor:pointer">
<input type="checkbox" id="qall" onchange="qAll(this)"> 全选(当前筛选)</label>
<span class="tip" id="qc" style="white-space:nowrap"></span>
<!-- 决策 213(2026-10-26 主人定):只看未绑(补绑审计)+ 覆盖面统计 -->
<label class="tip" style="white-space:nowrap;cursor:pointer">
<input type="checkbox" id="qunb" onchange="qRenderBill()"> 只看未绑</label>
<span class="tip" id="qcov" style="white-space:nowrap;color:#1273a6;font-weight:700"></span>
<span class="tip" id="qbmsg" style="flex:1;text-align:right"></span>
<button class="btn wb" onclick="qUnbind()">解绑选中</button>
<button class="btn wb" onclick="qBind()">绑定选中</button>
@@ -1858,27 +1862,35 @@ async function qRenderBill(){
QB_SIM = (s && Array.isArray(s.groups)) ? s : {groups:[],extra:[]};
QBILLS = bl.ok ? (bl.rows||[]) : [];
QBINDS = {};
QBILLS.forEach(r=>{ if(r.file_id) QBINDS[r.id]=r.file_name||'附件'; });
QBILLS.forEach(r=>{ if(r.file_id) QBINDS[r.id]={name:r.file_name||'附件', fid:r.file_id}; });
}
// 绑定信息写进行数组备注位(后台 noWB 已剔除取消采纳列,备注列纯文字展示)
/* 决策 213(2026-10-26 主人定):绑定标记不再写备注位(后台组表无备注列,旧写入是死代码)——
改为独立「附件」列徽章(billColsO/billTR 按 opts.attach 输出)。
只看未绑:勾上=各组只留未绑行、空组剔除(补绑审计不用翻页找)。 */
const enr = JSON.parse(JSON.stringify(QB_SIM));
(enr.groups||[]).concat(enr.extra||[]).forEach(g=>(g.rows||[]).forEach(r=>{
if(QBINDS[r[0]]) r[10]='已绑:'+QBINDS[r[0]];
}));
if($('qunb') && $('qunb').checked){
const keep = g => { g.rows = (g.rows||[]).filter(r => !QBINDS[r[0]]); return g.rows.length > 0; };
enr.groups = (enr.groups||[]).filter(keep);
enr.extra = (enr.extra||[]).filter(keep);
}
BILL_SORT={k:-1,dir:1};
$('qthb').innerHTML = billHeadHTML({checkbox:true, backend:true});
$('qtbb').innerHTML = renderGroups(enr,'similar',{backend:true,checkbox:true});
$('qthb').innerHTML = billHeadHTML({checkbox:true, backend:true, attach:true});
$('qtbb').innerHTML = renderGroups(enr,'similar',{backend:true,checkbox:true,attach:QBINDS});
grpTreeBind($('qsimtree'),'qtbb',enr);
$('qcgb').innerHTML = colgHTML(qBindCols()); sumw($('qgt')); colwApply($('qgt'));
// 覆盖面统计(决策 213):绑定/解绑/勾开关后随本函数刷新
const nb = Object.keys(QBINDS).length;
$('qcov').textContent = '已绑 ' + nb + ' / ' + QBILLS.length + '(' + (QBILLS.length ? Math.round(nb/QBILLS.length*100) : 0) + '%)';
}
/* 决策 154④:类似清单默认列宽——名称收窄(210→150)、项目特征加宽(260→330),复选框列固定 36;
表格走 colg(colgHTML+sumw+colwApply)→ 公共拖动器,拖动效果与后台类似清单一致 */
function qBindCols(){
// 决策 213:尾部加「附件」列(默认 100px、不锁宽——共享拖列可拖、列宽记忆)
return [['',36,'c','F']].concat(noWB(COLS.bill).map(c=>{
if(c[0]==='名称') return ['名称',150,'l'];
if(c[0]==='项目特征') return ['项目特征',330,'l','attr'];
return c;
}));
}).concat([['附件',56,'c']])); // 213 补记:100→56(主人看宽了)
}
/* 决策 154②:类似清单搜索 = 行级过滤(组头保留),不重建共享组表 */
function qFilterBill(){

View File

@@ -129,6 +129,7 @@ td.gtitle{text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellip
.sep td{background:#eef0f2;color:#456;font-style:italic;font-size:12px;padding:3px 8px}
.tg{border-radius:3px;padding:1px 6px;font-size:11px;font-weight:700}
.tg-e{background:#e8f5ec;color:#1e8e3e}.tg-s{background:#fff4e5;color:#a86300}.tg-f{background:#e7f0fb;color:#1e4e8c}
.tg-att{background:#e5f3fa;color:#1273a6} /* 决策 213:附件列「已绑」徽章(信息价蓝系) */
td.tg{text-align:center;padding-left:4px;padding-right:4px}
/* 组/清单两级把手层级(2026-10-11 主人定):组把手贴左,清单把手再缩进一层 */
tr[data-grp]>td.tg{text-align:left;padding-left:5px}

View File

@@ -654,8 +654,12 @@ function billCols() {
backend=批次侧剔除 wb 列)。既有调用 billHeadHTML()/billCols() 行为不变。 */
function billColsO(opts) {
opts = opts || {};
const base = opts.backend ? noWB(COLS.bill) : billCols();
return opts.checkbox ? [['', 36, 'c', 'F']].concat(base) : base.slice();
const base = opts.backend ? noWB(COLS.bill) : billCols().slice();
// 决策 213(2026-10-26 主人定):opts.attach=后台附件标签页组表加「附件」列——默认 56px
//(213 补记:主人看 100px 偏宽改 56,徽章只留📎)、不锁宽(共享拖列可自由拖动,列宽按
// 表头指纹记忆),仅传 attach 的表输出,工作台零影响。
if (opts.attach) base.push(['附件', 56, 'c']);
return opts.checkbox ? [['', 36, 'c', 'F']].concat(base) : base;
}
/* 复选框列导致的显示下标偏移:优先读渲染时存下的 GRP_DATA.opts,其次表上的 data-ck 标记 */
function billCkOff(tb) {
@@ -695,8 +699,18 @@ function billTR(r, grp, hide, opts) {
+ '<td class="r">' + num(r[7]) + '</td>'
+ (opts.backend ? '' : '<td class="c">' + billAdoptCellHTML(r) + '</td>'
+ '<td class="rmk">' + billRemarkCell(r) + '</td>') // 决策 204:备注格自动换行,与原数据页同款
+ (opts.attach ? '<td class="c">' + billAttachCellHTML(r, opts.attach) + '</td>' : '')
+ '</tr>';
}
/* 清单「附件」格(决策 213,2026-10-26 主人定):opts.attach = {清单id:{name,fid}} 时输出——
已绑=淡蓝📎徽章(点击走共享 saveAs 另存该询价文件,悬停显示附件名),未绑=灰—。 */
function billAttachCellHTML(r, attach) {
const a = r && attach && attach[r[0]];
if (!a) return '<span style="color:#c3cad4">—</span>';
return '<a href="javascript:void(0)" class="tg tg-att" data-fid="' + a.fid + '" data-n="' + esc(a.name || '') + '"'
+ ' title="已绑附件:' + esc(a.name || '') + '(点击另存)"'
+ ' onclick="return saveAs(\'/api/admin/inq/file/\' + this.dataset.fid, this.dataset.n)">&#128206;</a>';
}
/* 清单「取消采纳」列(2026-10-11 决策 39;2026-10-13 主人定:**工作台独有**,wb 标记、
后台 noWB() 整列隐藏——后台批次库只是存有价值的不变数据,交互列不占列):
亮灯条件(决策 68 批次B):有采纳备注(r[10])**或**有数据采纳标记(r[13],BILLROW 尾位)。
@@ -784,7 +798,7 @@ function renderGroups(d, kind, opts) {
});
// 落单组(决策 32:单个「其他」批)跟着组序连续编为第 N+1 组,与左树同号(决策 33 对齐口径)
if (kind === 'similar' && d && d.extra && d.extra.length) {
html += '<tr class="sep"><td></td><td colspan="' + CB_LAST() + '">以下清单符合筛选条件,但未形成相似组</td></tr>';
html += '<tr class="sep"><td></td><td colspan="' + (billColsO(opts).length - 1) + '">以下清单符合筛选条件,但未形成相似组</td></tr>';
d.extra.forEach((g, i) => {
const key = pfx + 'x' + i;
const bad = (g.spread != null && Number(g.spread) >= 20) ? ' bad' : '';

View File

@@ -74,7 +74,10 @@ body.histdrag, body.histdrag *{cursor:ns-resize !important}
body.histdrag{user-select:none}
/* ---- 本页搜索(决策 172,2026-10-22 主人定):命中关键字黄底 ---- */
mark.pghl{background:#ffe58a;color:inherit;padding:0}
mark.pghlcur{background:#ff9c40;color:#fff;padding:0} /* 决策 209:当前命中橙底 */
.pgsrch{width:200px;height:24px;box-sizing:border-box}
.pgsnav{height:24px;padding:0 8px;font:inherit;font-size:12px;border:1px solid #b8c4d4;border-radius:5px;background:#fff;color:#24425f;cursor:pointer;box-sizing:border-box} /* 决策 209:跳转按钮 */
.pgsnav:disabled{background:#f0f2f5;color:#a8b4c4;border-color:#d5dde8;cursor:default}
/* ---- 类似清单:左组目录树 + 分隔条(2026-10-08 主人定,样式/行为同原数据左树)---- */
#pan2.on{display:flex}
.grpbox{flex:1;display:flex;min-width:0;min-height:0}
@@ -355,7 +358,9 @@ body.grptree-dragging{cursor:col-resize !important;user-select:none}
<!-- 决策 172(2026-10-22 主人定):本页搜索——项目工料机页补一行细工具行,搜索框右上 -->
<div style="display:flex;align-items:center;gap:10px;padding:4px 10px;border-bottom:1px solid var(--line);background:#fafcff;height:30px;box-sizing:border-box">
<span id="skelbar" style="font-size:12px;color:#5a7ca6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:62%" title=""></span>
<input id="pgsrch_wb" class="mi pgsrch" style="margin-left:auto" placeholder="搜索本页数据" title="搜索本页数据,命中黄底" oninput="pageSearchGo('wb', this.value)">
<!-- 决策 209(2026-10-26 主人定):合并工料机入口同款放项目工料机页(弹框与原数据卡共用 rawMergeOpen) -->
<div class="lvbtn" style="margin-left:auto" onclick="rawMergeOpen()" title="按 名称|规格|单位 归并项目级工料机">合并工料机</div>
<input id="pgsrch_wb" class="mi pgsrch" placeholder="搜索本页数据" title="搜索本页数据,命中黄底" oninput="pageSearchGo('wb', this.value)" onkeydown="if(event.key==='Enter')pageSearchNav('wb',1)"><button class="pgsnav" data-pg="wb" data-dir="-1" title="上一个命中" onclick="pageSearchNav('wb',-1)" disabled>上一个</button><button class="pgsnav" data-pg="wb" data-dir="1" title="下一个命中(首击=从头查找)" onclick="pageSearchNav('wb',1)" disabled>下一个</button>
</div>
<table id="t0" data-page-node-id="wiHjUkOHHtafQFK4AcMWUn"><colgroup id="cg0" data-page-node-id="jrukeg9ggS0DZO8eKSBXsM"></colgroup><thead id="th0" data-page-node-id="tapJmvtyFyqqAOcTTiKGJ3"></thead><tbody id="tb0" data-page-node-id="L018lJjmeSEfM31wIxkb05"></tbody></table></div>
<div class="panel" id="pan1" data-page-node-id="E2RTvOEoRvCZtcfhCfJ9w6">
@@ -366,7 +371,7 @@ body.grptree-dragging{cursor:col-resize !important;user-select:none}
<div class="grpmain">
<div style="display:flex;align-items:center;gap:10px;padding:5px 10px;border-bottom:1px solid var(--line);background:#fafcff;position:sticky;top:0;z-index:5;height:34px;box-sizing:border-box">
<a class="lk" onclick="reloadIncon()" title="按当前工程数据与规则重算组价不一致" data-i18n="lk.reload">⟳ 重载</a>
<input id="pgsrch_incon" class="mi pgsrch" style="margin-left:auto" placeholder="搜索本页数据" title="搜索本页数据,命中黄底" oninput="pageSearchGo('incon', this.value)">
<input id="pgsrch_incon" class="mi pgsrch" style="margin-left:auto" placeholder="搜索本页数据" title="搜索本页数据,命中黄底" oninput="pageSearchGo('incon', this.value)" onkeydown="if(event.key==='Enter')pageSearchNav('incon',1)"><button class="pgsnav" data-pg="incon" data-dir="-1" title="上一个命中" onclick="pageSearchNav('incon',-1)" disabled>上一个</button><button class="pgsnav" data-pg="incon" data-dir="1" title="下一个命中(首击=从头查找)" onclick="pageSearchNav('incon',1)" disabled>下一个</button>
<span class="rawLvMount" style="display:inline-flex;gap:4px;align-items:center"></span>
</div>
<table id="t1" data-page-node-id="uDB6bv40IJMHhH2Ykznir2"><colgroup id="cg1" data-page-node-id="3VeUjy8WVpqGteUh9Wnadz"></colgroup><thead id="th1" data-page-node-id="DQAXEDDJ0ZCOU6Qq6JMzOV"></thead><tbody id="tb1" data-page-node-id="a5ErEx7b9uetj4GY0v9rZu"></tbody></table></div>
@@ -382,7 +387,7 @@ body.grptree-dragging{cursor:col-resize !important;user-select:none}
<!-- ⟳ 重载(2026-10-13 决策 46 主人定):分组结果服务端有缓存,重载=跳过缓存按当前数据与规则重算 -->
<div style="display:flex;align-items:center;gap:10px;padding:5px 10px;border-bottom:1px solid var(--line);background:#fafcff;position:sticky;top:0;z-index:5;height:34px;box-sizing:border-box">
<a class="lk" onclick="reloadSim()" title="不用缓存,按当前工程数据与分组规则重新分组(工程大要稍等)" data-i18n="lk.reload">⟳ 重载</a>
<input id="pgsrch_sim" class="mi pgsrch" style="margin-left:auto" placeholder="搜索本页数据" title="搜索本页数据,命中黄底" oninput="pageSearchGo('sim', this.value)">
<input id="pgsrch_sim" class="mi pgsrch" style="margin-left:auto" placeholder="搜索本页数据" title="搜索本页数据,命中黄底" oninput="pageSearchGo('sim', this.value)" onkeydown="if(event.key==='Enter')pageSearchNav('sim',1)"><button class="pgsnav" data-pg="sim" data-dir="-1" title="上一个命中" onclick="pageSearchNav('sim',-1)" disabled>上一个</button><button class="pgsnav" data-pg="sim" data-dir="1" title="下一个命中(首击=从头查找)" onclick="pageSearchNav('sim',1)" disabled>下一个</button>
<!-- 原数据单位工程级的层级按钮挂点(2026-10-13 决策 58:分组/清单/定额/默认列宽 迁到这里最右) -->
<span id="rawLvMount" class="rawLvMount" style="display:inline-flex;gap:4px;align-items:center"></span>
</div>
@@ -639,8 +644,11 @@ const C_LME_WB = COLS.lme;
// ④「来源」右侧加「建设单位」(比对接口与检索接口都带 bunit);
// ⑤「单价」右侧加「单价类型」、「建设单位」右侧加「地区」(fkind_name/region 由接口带出)。
const C_H=[['',30,'c','tg'],['序号',44,'c'],['档位',62,'c'],['名称',190,'l'],['单位',52,'c'],['单价',96,'r'],
['单价类型',92,'c'],['价差%',80,'r'],['来源',110,'l'],['建设单位',110,'l'],
['地区',130,'l'],['期次',96,'l'],['操作',150,'c']]; // 决策 141:取消相似度列
['单价类型',92,'c'],['价差%',80,'r'],['来源',110,'l'],['单位主体',110,'l'],
['地区',130,'l'],['期次',96,'l'],['附件',70,'c'],['操作',150,'c']];
// 决策 212(2026-10-26 主人定):①「建设单位」列名统一为「单位主体」(与工料机同列名,语义=建设单位或发布单位,清单行恒显示建设单位);
// ②补「附件」列(bill_attach 询价资料,下载走 /api/admin/inq/file 既有通道)——与工料机对齐(能合并尽合并);
// 决策 141:取消相似度列
/* 项目工料机对比框结果表(2026-10-08 主人定,16 列):
−把手(工料机行无定额可展开) −单价类型(不参与工料机比对);
+来源徽章(工程绿/信息价蓝/市场价橙) +规格型号独立列 +备注(刊物行备注,如价格区间)
@@ -693,6 +701,10 @@ function histCtxUI(){
if($('fsrcBtn')){ $('fsrcBtn').disabled = !isLme; $('fsrcBtn').title = tip || '来源全部'; }
if($('fldSrc')) $('fldSrc').title = tip;
if($('funit')) $('funit').placeholder = isLme ? '输入单位(建设单位 / 发行单位)' : '输入建设单位';
// 决策 212(2026-10-26 主人定):「收/展开项目特征」按钮分两类——清单上下文(原数据/组价不一致/
// 类似清单)恒有,工料机上下文恒无(右栏本就隐藏)。按**行类型**管(p3 里点清单行/工料机行可翻转),
// 取代 2026-10-13「仅类似清单页签显示」的页签口径;与右栏显隐(renderHist isLme)同源。
if($('fattrBtn')) $('fattrBtn').style.display = isLme ? 'none' : '';
}
/* 决策 164:历史对比框筛选与软件默认不同 → 控件标粉红(醒目)。默认口径:
来源/单价类型=全选;期次/地区=不限;本项目=页签默认(组价不一致=是,其余=否);
@@ -748,8 +760,7 @@ function syncHist(p){
histCtxUI();
const isLme = histIsLme(); // 决策 163:跟随选中行类型(右栏显隐/空表提示仍按它)
// 工料机对比不用右栏(项目特征/定额面板)——结果表占满整行(2026-10-08 主人定);
// 类似清单可手动收起右栏(2026-10-13 主人定「收项目特征」按钮)
if($('fattrBtn')) $('fattrBtn').style.display = (p==='p2') ? '' : 'none';
// 收/展项目特征按钮 2026-10-26(决策 212)起按行类型收口 histCtxUI(取代 10-13「仅类似清单页签」口径)。
if($('hattr')) $('hattr').style.display = (isLme || HATTR_FOLD) ? 'none' : '';
// 精确度按标签取默认(工料机=全部含模糊;各自记住手动选择)
if($('htier') && FLT.tierByTab[p]) $('htier').value = FLT.tierByTab[p];
@@ -846,6 +857,9 @@ async function billCtxApply(t, bid){
if(ntr){ pick('bill', r.id, ntr); ntr.scrollIntoView({block:'nearest'}); }
}
}
// 决策 209(2026-10-26 主人定):删/临删/取消临删动到现算链 → 项目工料机页签与两卡即时跟随
//(该页签切回不重取数,不补这刀就停留在操作前旧值——本次报障「两界面人工费不一致」的根因)
if(op==='del'||op==='tdel'||op==='untdel') lmeSyncAll();
}
/* 共享层规格⑥(决策 71):原数据·分部分项/措施项目 选中清单行 → 底部历史对比框加载该行比对 */
window.rawBillPick = function(tr){
@@ -1117,14 +1131,58 @@ async function refreshRaw(){
项目工料机=顶部行),输入即搜(300ms 防抖、不分大小写、包含匹配),本页主数据表
命中文字黄底(mark.pghl);目录树不参与;清空恢复。
原数据页关键字跨层级/标签保留,重画后自动重新高亮(rawDraw 包一层);
其余三页重画后高亮消失、重输即可(第一版口径)。 */
其余三页重画后高亮消失、重输即可(第一版口径)。
决策 209(2026-10-26 主人定):框右加「上一个/下一个」两枚跳转钮(灰=不可跳:
框空/无命中/唯一命中已定位/在第1处无上/在末尾无下),首击「下一个」=从头查找,
当前命中橙底(mark.pghlcur)并滚动到可视区,回车=点「下一个」,改词复位,到底不循环。 */
let PAGESRCH = { raw: '', incon: '', sim: '', wb: '' };
const PG_AREAS = { raw: 'rawbody', incon: 't1', sim: 't2', wb: 't0' };
const PG_TIMER = {};
const PGS_NAV = { raw: { i: -1 }, incon: { i: -1 }, sim: { i: -1 }, wb: { i: -1 } }; // 决策 209:各页当前命中序号(-1=未定位)
// 决策 209:搜索框右边「上一个/下一个」两枚的 HTML(初始灰)
function pgsNavBtnsHtml(key){ // 决策 209:搜索框右边的「上一个/下一个」两枚(初始灰,由 pgsSetNav 刷新)
return '<button class="pgsnav" data-pg="' + key + '" data-dir="-1" title="上一个命中"'
+ ' onclick="pageSearchNav(\'' + key + '\',-1)" disabled>上一个</button>'
+ '<button class="pgsnav" data-pg="' + key + '" data-dir="1" title="下一个命中(首击=从头查找)"'
+ ' onclick="pageSearchNav(\'' + key + '\',1)" disabled>下一个</button>';
}
// 决策 209:五态灰活唯一入口(框空/无命中/唯一已定位/第1处/末尾)
function pgsSetNav(key){ // 决策 209:按 框空/无命中/当前位置 刷两枚钮的灰活
const el = document.getElementById(PG_AREAS[key]);
const n = el ? el.querySelectorAll('mark.pghl').length : 0;
const i = PGS_NAV[key].i;
document.querySelectorAll('button.pgsnav[data-pg="' + key + '"]').forEach(b => {
const d = Number(b.dataset.dir);
b.disabled = !PAGESRCH[key] ? true
: d < 0 ? (i <= 0)
: (i < 0 ? n < 1 : i >= n - 1);
});
}
// 决策 209:命中间跳转;缺高亮(非 raw 三页重画后)先补挂再跳
function pageSearchNav(key, dir){ // 决策 209:命中间跳转;重画丢高亮先补黄底再跳
const kw = PAGESRCH[key];
if (!kw) return;
const el = document.getElementById(PG_AREAS[key]);
if (!el) return;
let marks = el.querySelectorAll('mark.pghl');
if (!marks.length) { PGS_NAV[key].i = -1; hlContainer(el, kw); marks = el.querySelectorAll('mark.pghl'); }
const n = marks.length;
if (!n) { pgsSetNav(key); return; }
let i = PGS_NAV[key].i;
if (dir > 0) { if (i >= n - 1) return; i = i < 0 ? 0 : i + 1; }
else { if (i <= 0) return; i -= 1; }
PGS_NAV[key].i = i;
marks.forEach(m => m.classList.remove('pghlcur'));
marks[i].classList.add('pghlcur');
marks[i].scrollIntoView({ block: 'center' });
pgsSetNav(key);
}
window.pageSearchBox = function(){ // 原数据标签卡行用(common.js rawTabs 渲染,工作台专用)
return '<input class="mi pgsrch" placeholder="搜索本页数据"'
+ ' title="搜索本页数据,命中黄底(目录树不参与)" value="' + esc(PAGESRCH.raw || '') + '"'
+ ' oninput="pageSearchGo(\'raw\', this.value)">';
+ ' oninput="pageSearchGo(\'raw\', this.value)"'
+ ' onkeydown="if(event.key===\'Enter\')pageSearchNav(\'raw\',1)">'
+ pgsNavBtnsHtml('raw');
};
function hlContainer(root, kw){
root.querySelectorAll('mark.pghl').forEach(m => { m.replaceWith(document.createTextNode(m.textContent)); });
@@ -1160,6 +1218,8 @@ function pageSearchGo(key, val){
PG_TIMER[key] = setTimeout(() => {
const el = document.getElementById(PG_AREAS[key]);
if (el) hlContainer(el, PAGESRCH[key]);
PGS_NAV[key].i = -1; // 决策 209:改词=回未查找态,首击「下一个」重新从头定位
pgsSetNav(key);
}, 300);
}
(function(){ // 原数据页重画后自动重新高亮 + 搜索框 × 重挂(切层级/标签/排序都走 rawDraw)
@@ -1169,6 +1229,7 @@ function pageSearchGo(key, val){
const sb = document.querySelector('#rawstabs input.pgsrch');
if (sb && !sb._fx) filterInputX(sb, () => pageSearchGo('raw', ''));
if (PAGESRCH.raw) { const el = document.getElementById('rawbody'); if (el) hlContainer(el, PAGESRCH.raw); }
PGS_NAV.raw.i = -1; pgsSetNav('raw'); // 决策 209:重画后命中重排,回未查找态
return r;
};
}());
@@ -1345,6 +1406,7 @@ function grpBillQtyEdit(td, tr, cur0){
// 决策 192(2026-10-25 主人定):填清单 → 定额自动调整——组表原地重拉(keepView),
// 公式定额子行按新清单工程量求值回填;定额编辑(grpNormQtyEdit)不回写清单,方向单向。
loadGroups(tr.closest('#tb1') ? 'inconsistent' : 'similar', false, true);
lmeSyncAll(); // 决策 209:清单工程量进 GCL 现算链 → 工料机三面即时跟随
};
inp.addEventListener('keydown', ev=>{
if(ev.key==='Enter'){ ev.preventDefault(); fin(true); }
@@ -1383,6 +1445,7 @@ function grpNormQtyEdit(td, tr, cur0){
else { delete td.dataset.expr; td.removeAttribute('title'); }
$('msg').textContent = '已保存' + (r.quantity != null ? ':= ' + numG(r.quantity) : '');
loadEditLog().then(()=>{ markGroupEH('tb1'); markGroupEH('tb2'); }); // ⑮ 红三角即时点亮
lmeSyncAll(); // 决策 209:定额工程量进消耗量现算链 → 工料机三面即时跟随
};
inp.addEventListener('keydown', ev=>{
if(ev.key==='Enter'){ ev.preventDefault(); fin(true); }
@@ -2309,6 +2372,7 @@ function renderHist(){
+ `<td>${ell(x.bunit,'—')}</td>`
+ `<td>${ell(x.region,'—')}</td>`
+ `<td class="l">${ell(x.period)}</td>`
+ `<td class="c">${x.file&&x.file_url?`<a class="lk" href="javascript:void(0)" onclick="return saveAsAtt(${i})">下载</a>`:'—'}</td>`
+ `<td class="c">${op.join(' · ')}</td>`;
return `<tr data-i="${i}"${isLme?' data-lme="1"':''} onclick="pickHistRow(${i},this)">${isLme?'':`<td class="tg">${tg}</td>`}${body}</tr>`;
}).join('')||`<tr><td colspan="${cols.length}" class="empty">${emptyMsg}</td></tr>`;
@@ -2507,6 +2571,7 @@ async function adopt(i){
else if(p==='p2') await loadGroups('similar',false,true);
else await refreshRaw();
renderHist(); // 已采纳灰标记:旧行复原、新行点亮(传递)
lmeSyncAll(); // 决策 209:采纳动到消耗量/品类行 → 工料机三面即时跟随
dlMsg('已采纳'+(r0?('('+r0.mode+':定额 '+r0.n_norm+' 条'+(r0.n_sum?('、汇总补品类 '+r0.n_sum+' 行'):'')+')'):'(仅备注)')+':'+txt,'ok');
}
/* 清单取消采纳(2026-10-09 主人定):只清备注,不动「询价附件」目录(清单采纳本就不收附件)。
@@ -2536,6 +2601,7 @@ async function cancelBillAdopt(billId, el){
else if(p==='p2') await loadGroups('similar',false,true);
else await refreshRaw();
renderHist();
lmeSyncAll(); // 决策 209:取消采纳撤定额/品类行 → 工料机三面即时跟随
dlMsg('已取消采纳'+(r.noop?'(该清单无数据采纳,仅清了备注)':'(数据已反向恢复)'),'ok');
}
@@ -2705,8 +2771,9 @@ function lmeRenderRows(){
// 显示位→数据位:取消采纳列(显示 9)不可排序;备注显示 10 = 数据 r[10],其余显示位与数据位同下标
const view=sortRows(LME_ROWS, LME_SORT.k, LME_SORT.dir, LME_NUM);
LME_VIEW=view;
// 决策 209:0 量行整行不显示后,全临删场景=0 行是**新口径常态**——提示语与「未打开工程」分开
$('tb0').innerHTML=renderLme(view,WB_OPTS)
||`<tr><td colspan="${C_LME_WB.length}" class="empty">还没有打开工程</td></tr>`;
||`<tr><td colspan="${C_LME_WB.length}" class="empty">${SID?'无数据(数量为 0 的行不显示)':'还没有打开工程'}</td></tr>`;
}
/* ================= 筛选(全部在工具条上,一处状态) ================= */