feat: 落实决策216/219/227取价锚点与公式口径,增加商业版权益和源码完整性校验

This commit is contained in:
lianjianwei2024
2026-10-27 12:16:47 +08:00
parent 5d9eaf774b
commit 380a39f8db
36 changed files with 18821 additions and 879 deletions

View File

@@ -110,6 +110,10 @@ body{font-family:"Source Han Sans SC","Noto Sans SC","Source Han Sans CN","MiSan
.qbadge{font-size:11px;color:#5a6b7f;background:#f4f8ff;border:1px solid #d8e0ec;
border-radius:3px;padding:0 5px;margin-left:4px}
.qscroll{flex:1;overflow:auto;border:1px solid #c9d4e2;border-radius:6px;background:#fff}
/* 决策 223(2026-10-27 主人定):附件页·类似清单左树容器框严格照原数据左下原型——
.grpbox 通高 flex(display:flex 只在本页定义,工作台同款在 workbench.html),
树与主区各自滚动、分隔条贴树边通高、把手垂直居中;收起态规则在 common.css 六处一套 */
#qbw .grpbox{display:flex;height:100%;min-height:0}
.qlme{width:100%;border-collapse:collapse;font-size:12.5px}
.qlme th{position:sticky;top:0;background:#eef3fa;border-bottom:1px solid #c9d4e2;
padding:6px 8px;font-weight:600;z-index:1}
@@ -360,7 +364,7 @@ td.pcell input{width:100%;padding:3px 7px;font-size:12.5px;border:1px solid #9fb
6px 分隔条 + 正中 ◀ 小把手点一下收起/展开目录栏;拖动调宽照旧、宽度照记忆) -->
<div id="presizer" class="rawsplit" style="display:none"><span class="splitbtn" title="收起/展开目录树">◀</span></div>
<!-- 类似清单(p2)的左组目录树(2026-10-08 主人定:后台同工作台;仅该标签显示) -->
<div id="simtree" style="display:none"></div>
<div id="simtree" class="grptree" style="display:none"></div>
<div id="dright">
<!-- 价格明细工具行(2026-10-12 重做):只有价格批次显示;行编辑/新增时出现「所属目录」下拉 -->
<div id="ptool" style="display:none">
@@ -425,9 +429,11 @@ td.pcell input{width:100%;padding:3px 7px;font-size:12.5px;border:1px solid #9fb
<div class="qscroll" id="qlmew"><table class="qlme" id="qtb"><colgroup id="qcgl"></colgroup><thead id="qthl"></thead><tbody id="qtbl"></tbody></table></div>
<!-- 类似清单页签(决策 153③):左组目录树 + 共享 renderGroups 组表(多复选框列勾选绑附件) -->
<div class="qscroll" id="qbw" style="display:none">
<div style="display:flex;gap:8px;align-items:flex-start;min-height:100%">
<div id="qsimtree" style="width:210px;flex:none;overflow:auto;max-height:100%"></div>
<div style="flex:1;min-width:0;overflow:auto">
<!-- 决策 223(2026-10-27 主人定):容器框严格照原数据左下原型(.grpbox flex 通高)——
树/主区各自滚动、分隔条贴树边通高、收起/展开把手垂直居中;树宽 210px 照决策 213 不变 -->
<div id="qgrbox" class="grpbox">
<div id="qsimtree" class="grptree" style="width:210px"></div>
<div id="qgmain" style="flex:1;min-width:0;overflow:auto">
<table class="qlme" id="qgt" data-ck="1" data-bk="1"><colgroup id="qcgb"></colgroup><thead id="qthb"></thead><tbody id="qtbb"></tbody></table>
</div>
</div>
@@ -1208,6 +1214,30 @@ document.addEventListener('DOMContentLoaded', function(){ $('dtabs').innerHTML =
function onWBTab(p){ loadTab(p); }
// 原数据视图:接口指向**批次库**(/api/admin/batch/{id}/raw),渲染与工作台同一份 RawView
/* 决策 214 补:明细原数据树内**单位工程间切换**也记忆(按 批次:单位工程 记上次选中行/视图/滚动) */
var RAWSEL_MEM = {};
var _rawPickBaseAdm = rawPick;
rawPick = async function(k, id, el){
if(RVSEL.k==='uw' && RVSEL.id){
const sel=document.querySelector('#drawbody tr.sel');
const sp=(function(e){for(let x=e&&e.parentElement;x&&x!==document.body;x=x.parentElement){const cs=getComputedStyle(x);if(/(auto|scroll)/.test(cs.overflowY)&&x.scrollHeight>x.clientHeight+2)return x;}return null;})(document.querySelector('#drawbody'));
RAWSEL_MEM[DID+':'+RVSEL.id]={ bid: sel?sel.dataset.bid:((RAWSEL_MEM[DID+':'+RVSEL.id]||{}).bid||null),
rvtab: RVTAB, scroll: sp?sp.scrollTop:null };
}
await _rawPickBaseAdm(k, id, el);
if(k==='uw'){
const rec=RAWSEL_MEM[DID+':'+id];
if(rec && rec.bid){
const find=()=>document.querySelector('#drawbody tr.brow[data-bid="'+rec.bid+'"]');
let tr=find();
if(!tr && rec.rvtab && rec.rvtab!==RVTAB){ rawTab(rec.rvtab); await new Promise(r=>setTimeout(r,600)); tr=find(); }
if(tr){ tr.classList.add('sel');
if(rec.scroll!=null){ const sp2=(function(e){for(let x=e&&e.parentElement;x&&x!==document.body;x=x.parentElement){const cs=getComputedStyle(x);if(/(auto|scroll)/.test(cs.overflowY)&&x.scrollHeight>x.clientHeight+2)return x;}return null;})(document.querySelector('#drawbody')); if(sp2) sp2.scrollTop=rec.scroll; }
else tr.scrollIntoView({block:'center'});
}
}
}
};
var WB_RAW = RawView({
api: function(){ return '/api/admin/batch/' + DID + '/raw'; },
idParam: 'batch_id',
@@ -1234,6 +1264,9 @@ function detLayout(mode){
$('drawbox').style.display = raw?'flex':'none';
$('dtb').style.display = raw?'none':'';
$('simtree').style.display = sim?'':'none';
// 决策 221 补(决策 223 记):rawSplitInit 在 #simtree 后动态插入的分隔条随树显隐(决策 44 单一写入点)
const simsp=$('simtree').nextElementSibling;
if(simsp && simsp.classList.contains('rawsplit')) simsp.style.display = sim?'':'none';
$('reloadsim').style.display = sim?'inline':'none'; // ⟳ 重载仅类似清单标签显示(决策 46)
dbody.classList.toggle('fx', price||raw);
dbody.classList.toggle('simflex', sim);
@@ -1373,6 +1406,14 @@ async function loadTab(pid, fresh){
try{ sessionStorage.setItem('admin_tab', pid); }catch(e){}
ldStage(40,'正在加载原数据(目录树+汇总卡)…');
await WB_RAW.load();
// 决策 214 补:回到明细原数据 → 恢复该单位工程上次选中行
(function(){
const rec=RAWSEL_MEM[DID+':'+RVSEL.id];
if(rec && rec.bid && !document.querySelector('#drawbody tr.sel')){
const tr=document.querySelector('#drawbody tr.brow[data-bid="'+rec.bid+'"]');
if(tr){ tr.classList.add('sel'); tr.scrollIntoView({block:'center'}); }
}
})();
return;
}
// 三个列表大表(p0/p1/p2):类清单组树只在 p2 数据到位后由下面的 detLayout('sim') 打开
@@ -1942,6 +1983,15 @@ $('qfile').onchange=async function(){
});
})();
/* 决策 223(2026-10-27 主人定):绑定/解绑重画保留滚动(决策 206「重绘保留滚动」铺到附件页)——
工料机页签记 #qlmew;类似清单页签记主表区 + 左树(重画前后原位恢复,不再弹回顶部)。 */
async function qKeepScroll(fn){
const els = QTAB==='lme' ? [$('qlmew')] : [$('qgmain'), $('qsimtree')];
const mem = els.map(e=>e?{e,st:e.scrollTop}:null).filter(Boolean);
await fn();
mem.forEach(m=>{ m.e.scrollTop = m.st; });
}
async function qBind(){
if(!QFID){ alert('请先在左边点选一个附件。'); return; }
const ids=qChecked();
@@ -1961,8 +2011,8 @@ async function qBind(){
const r=await qPost(`/api/admin/batch/${QBID}/inq/bind`,body);
$('qbmsg').textContent=(r.ok?'✓ ':'× ')+r.msg;
if(!r.ok) return;
if(isLme) await qLoad();
else { QB_SIM=null; await qRenderBill(); } // 绑定态变了:附件分组视图重取绑定刷新备注列
if(isLme) await qKeepScroll(qLoad);
else { QB_SIM=null; await qKeepScroll(qRenderBill); } // 绑定态变了:附件分组视图重取绑定刷新备注列
}
async function qUnbind(){
@@ -1973,8 +2023,8 @@ async function qUnbind(){
const r=await qPost(`/api/admin/batch/${QBID}/inq/unbind`,body);
$('qbmsg').textContent=(r.ok?'✓ ':'× ')+r.msg;
if(!r.ok) return;
if(QTAB==='lme') await qLoad();
else { QB_SIM=null; await qRenderBill(); }
if(QTAB==='lme') await qKeepScroll(qLoad);
else { QB_SIM=null; await qKeepScroll(qRenderBill); }
}
/* 决策 213 补记七:组表「单位工程名称」点击 → 追踪定位到本批次明细原数据树的那条清单。 */
@@ -1986,7 +2036,7 @@ window.locBill = async function(bid, uwid){
const find = () => document.querySelector('#drawbody tr.brow[data-bid="' + bid + '"]');
let tr = find();
if(!tr){ rawTab('prelim'); await new Promise(r => setTimeout(r, 800)); tr = find(); }
if(tr) tr.scrollIntoView({block:'center'});
if(tr){ tr.classList.add('sel'); tr.scrollIntoView({block:'center'}); }
else $('qmsg').textContent = '定位不到该清单(可能已被删除)';
return false;
};