feat(lme): 决策183 六价全采按骨架属性对应回填,并支持合并状态按源文件哈希重放
This commit is contained in:
@@ -445,9 +445,9 @@ body.grptree-dragging{cursor:col-resize !important;user-select:none}
|
||||
<!-- 6b 附件(**仅项目工料机标签**,2026-10-08 主人定,放价格右边):全部 / 有 / 无 ——
|
||||
有附件 = 工程行绑定了询价资料、价格行挂了刊物上传原件 -->
|
||||
<div class="fld" id="fldAtt" style="display:none"><select id="hatt" title="附件">
|
||||
<option value="all" selected>全部</option>
|
||||
<option value="yes">有</option>
|
||||
<option value="no">无</option>
|
||||
<option value="all" selected>附件</option>
|
||||
<option value="yes">有附件</option>
|
||||
<option value="no">无附件</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- 8 单位(2026-10-08 主人定:原「建设单位」改名,**放搜索框左边**)——
|
||||
@@ -505,7 +505,7 @@ body.grptree-dragging{cursor:col-resize !important;user-select:none}
|
||||
|
||||
<!-- 合并工料机(批次C,决策 69;决策 161 显示改组表:±把手、组头淡红;功能不变:默认全展开、默认勾编码最短、右上 取消|合并) -->
|
||||
<div class="mask" id="mmask">
|
||||
<div class="dlg" style="width:920px;max-width:94vw">
|
||||
<div class="dlg" style="width:1120px;max-width:96vw">
|
||||
<h4 style="display:flex;align-items:center;gap:10px">合并工料机
|
||||
<span style="flex:1"></span>
|
||||
<button class="btn" onclick="mergeApply()">合并</button>
|
||||
@@ -964,11 +964,13 @@ function renderMergeTree(){
|
||||
// 编码就不可编辑」,原编码输入框撤除);价格仍可编辑(仅项目级行)。
|
||||
// 列=勾选/序号/编码/来源/名称/规格型号/单位/数量/除税编制价/税率/含税编制价;固定顶部表头;
|
||||
// 不过滤带子数据的工料机(决策78 废止口径不变)。
|
||||
let h = '<table class="mtbl"><colgroup>'
|
||||
+ '<col style="width:34px"><col style="width:36px"><col style="width:44px"><col style="width:104px"><col style="width:92px"><col><col>'
|
||||
// 决策 173(2026-10-22 主人定):弹框加宽(1120px)+ 列宽可拖(公共 .rs 拖列逻辑)——
|
||||
// 名称 200 / 规格 150,其余列宽不变;全 px 列 → data-sumw(表宽=列宽和),拖完 colwSave 记忆。
|
||||
let h = '<table class="mtbl" data-sumw="1" style="width:1062px"><colgroup>'
|
||||
+ '<col style="width:34px"><col style="width:36px"><col style="width:44px"><col style="width:104px"><col style="width:92px"><col style="width:200px"><col style="width:150px">'
|
||||
+ '<col style="width:48px"><col style="width:86px"><col style="width:104px"><col style="width:60px"><col style="width:104px">'
|
||||
+ '</colgroup><thead><tr><th></th><th title="单选:合并后按此行的编码与三价替换全组">✓</th><th>序号</th><th>编码</th>'
|
||||
+ '<th>来源</th><th>名称</th><th>规格型号</th><th>单位</th><th>数量</th><th>除税编制价</th><th>税率</th><th>含税编制价</th></tr></thead>';
|
||||
+ '</colgroup><thead><tr><th></th><th title="单选:合并后按此行的编码与三价替换全组">✓<span class="rs"></span></th><th>序号<span class="rs"></span></th><th>编码<span class="rs"></span></th>'
|
||||
+ '<th>来源<span class="rs"></span></th><th>名称<span class="rs"></span></th><th>规格型号<span class="rs"></span></th><th>单位<span class="rs"></span></th><th>数量<span class="rs"></span></th><th>除税编制价<span class="rs"></span></th><th>税率<span class="rs"></span></th><th>含税编制价<span class="rs"></span></th></tr></thead>';
|
||||
let no = 0;
|
||||
MDATA.groups.forEach((g, gi) => {
|
||||
const qty = g.rows.reduce((s, r) => s + (Number(r.qty) || 0), 0);
|
||||
@@ -986,8 +988,13 @@ function renderMergeTree(){
|
||||
+ '<td></td>'
|
||||
+ '<td class="c"><input type="radio" name="mgr' + gi + '" data-mid="' + r.id + '" data-lvl="' + r.lvl + '"'
|
||||
+ ' data-qty="' + (Number(r.qty) || 0) + '"'
|
||||
+ ' data-ntp="' + (r.ntp == null ? '' : r.ntp) + '" data-taxrate="' + (r.sub ? '' : (r.taxrate == null ? '' : r.taxrate)) + '" data-taxp="' + (r.taxp == null ? '' : r.taxp) + '"'
|
||||
+ ' data-ntp-org="' + (r.ntp_org == null ? '' : r.ntp_org) + '" data-ntp-expr="' + (r.ntp_expr == null ? '' : r.ntp_expr) + '"'
|
||||
+ ' data-taxp-org="' + (r.taxp_org == null ? '' : r.taxp_org) + '" data-taxp-expr="' + (r.taxp_expr == null ? '' : r.taxp_expr) + '"'
|
||||
+ (r.def ? ' checked' : '') + ' title="单选:合并后全组按此行归并(数值=行现值;改价在外面·行级改价/原数据)"></td>'
|
||||
+ ' data-ntp-org="' + (r.ntp_org == null ? '' : r.ntp_org) + '" data-ntp-expr="' + (r.ntp_expr == null ? '' : r.ntp_expr) + '"'
|
||||
+ ' data-taxp-org="' + (r.taxp_org == null ? '' : r.taxp_org) + '" data-taxp-expr="' + (r.taxp_expr == null ? '' : r.taxp_expr) + '"'
|
||||
+ (isUw ? ' data-ucode="' + esc(r.code || '') + '" data-uwids="' + esc((r.uw_ids || []).join(',')) + '"'
|
||||
+ ' data-ntp="' + (r.ntp == null ? '' : r.ntp) + '" data-taxrate="' + (r.taxrate == null ? '' : r.taxrate) + '" data-taxp="' + (r.taxp == null ? '' : r.taxp) + '"'
|
||||
+ ' data-kind="' + (r.kind == null ? '' : r.kind) + '"' : '')
|
||||
+ (r.def ? ' checked' : '') + ' title="单选:合并后按此行的编码与三价替换全组"></td>'
|
||||
+ '<td class="c">' + no + '</td>'
|
||||
@@ -999,16 +1006,18 @@ function renderMergeTree(){
|
||||
+ '<td class="c">' + esc(g.unit || '—') + '</td>'
|
||||
+ '<td class="r">' + num(r.qty, 3) + '</td>'
|
||||
+ (isUw
|
||||
? '<td class="r">' + (r.ntp == null ? '—' : r.ntp) + '</td><td class="r">' + (r.taxrate == null ? '—' : r.taxrate) + '</td><td class="r">' + (r.taxp == null ? '—' : r.taxp) + '</td>'
|
||||
: '<td><input type="text" class="mi n" data-f="ntp" data-mid="' + r.id + '" value="' + (r.ntp == null ? '' : r.ntp) + '" placeholder="除税编制价"></td>'
|
||||
+ '<td><input type="text" class="mi n" data-f="taxrate" data-mid="' + r.id + '" value="' + (r.taxrate == null ? '' : r.taxrate) + '" placeholder="税率"></td>'
|
||||
+ '<td><input type="text" class="mi n" data-f="taxp" data-mid="' + r.id + '" value="' + (r.taxp == null ? '' : r.taxp) + '" placeholder="含税编制价"></td>')
|
||||
? '<td class="r">' + (r.ntp == null ? '—' : r.ntp) + '</td><td class="r">' + (r.sub ? '' : (r.taxrate == null ? '—' : r.taxrate)) + '</td><td class="r">' + (r.taxp == null ? '—' : r.taxp) + '</td>'
|
||||
: '<td class="r">' + (r.ntp == null ? '—' : r.ntp) + '</td>'
|
||||
+ '<td class="r">' + (r.sub ? '' : (r.taxrate == null ? '—' : r.taxrate)) + '</td>'
|
||||
+ '<td class="r">' + (r.taxp == null ? '—' : r.taxp) + '</td>')
|
||||
+ '</tr>';
|
||||
});
|
||||
h += '</tbody>';
|
||||
});
|
||||
h += '</table>';
|
||||
$('mtree').innerHTML = h;
|
||||
const _mt = document.querySelector('#mtree .mtbl');
|
||||
if (_mt) colwApply(_mt); // 决策 173:套列宽记忆(无记忆=当前即默认,存档供双击 .rs 回默认)
|
||||
}
|
||||
async function mergeApply(){
|
||||
const groups = [];
|
||||
@@ -1025,11 +1034,17 @@ async function mergeApply(){
|
||||
ntp: cb.dataset.ntp === '' ? null : Number(cb.dataset.ntp),
|
||||
taxrate: cb.dataset.taxrate === '' ? null : Number(cb.dataset.taxrate),
|
||||
taxp: cb.dataset.taxp === '' ? null : Number(cb.dataset.taxp),
|
||||
ntp_org: cb.dataset.ntpOrg === '' || cb.dataset.ntpOrg == null ? null : Number(cb.dataset.ntpOrg),
|
||||
ntp_expr: cb.dataset.ntpExpr === '' || cb.dataset.ntpExpr == null ? null : Number(cb.dataset.ntpExpr),
|
||||
taxp_org: cb.dataset.taxpOrg === '' || cb.dataset.taxpOrg == null ? null : Number(cb.dataset.taxpOrg),
|
||||
taxp_expr: cb.dataset.taxpExpr === '' || cb.dataset.taxpExpr == null ? null : Number(cb.dataset.taxpExpr),
|
||||
name: g.name || '', spec: g.spec || '', unit: g.unit || '',
|
||||
kind: cb.dataset.kind === '' ? null : Number(cb.dataset.kind), qty: 0 };
|
||||
} else {
|
||||
const get = f => { const i = row.querySelector('input[data-f="' + f + '"]'); return i ? i.value.trim() : ''; };
|
||||
sel = { id: Number(cb.dataset.mid), ntp: get('ntp'), taxrate: get('taxrate'), taxp: get('taxp') };
|
||||
// 决策 184:弹框全部字段只读(纯勾选归并,数值=行现值;改价在外面·行级改价/原数据)
|
||||
const d6 = k => cb.dataset[k] === '' || cb.dataset[k] == null ? null : Number(cb.dataset[k]);
|
||||
sel = { id: Number(cb.dataset.mid), ntp: d6('ntp'), taxrate: d6('taxrate'), taxp: d6('taxp'),
|
||||
ntp_org: d6('ntpOrg'), ntp_expr: d6('ntpExpr'), taxp_org: d6('taxpOrg'), taxp_expr: d6('taxpExpr') };
|
||||
}
|
||||
} else {
|
||||
hide.push(lvl === 'uw' ? { uw: 1, code: cb.dataset.ucode || '', uw_ids: (cb.dataset.uwids || '').split(',').filter(Boolean) }
|
||||
@@ -1170,6 +1185,13 @@ document.addEventListener('click', function(e){
|
||||
if(api==='lmefield'){ lmeEditField(td, tr, field); return; }
|
||||
editCell(td, api, id, field, (cur0==='—'?'':cur0));
|
||||
});
|
||||
/* 单元格编辑的通用设计(决策 175,2026-10-22 主人定,全软件统一):
|
||||
编辑框动态填满所在单元格、四边与单元格边线重合(CSS td.editing 接管,随列宽自适应)。
|
||||
绝对定位会让被清空的 td 塌陷——先按原内容锁行高,再清空挂编辑框(cellEditFill 先行)。 */
|
||||
function cellEditFill(td){
|
||||
td.classList.add('editing');
|
||||
td.style.height = td.offsetHeight + 'px';
|
||||
}
|
||||
function editCell(td, api, id, field, cur){
|
||||
// 项目特征是多行文本(fmtAttr 显示自带换行):input 会把换行整段剥掉,保存即黏团、
|
||||
// 导出也无法按编号恢复(2026-10-18 主人实测「点了再导出排序就不行」)——Attr 用 textarea,
|
||||
@@ -1182,7 +1204,7 @@ function editCell(td, api, id, field, cur){
|
||||
inp.style.width = '100%'; inp.style.boxSizing = 'border-box';
|
||||
inp.title = 'Enter 换行;Ctrl+Enter 或点其他位置保存';
|
||||
}
|
||||
td.textContent = ''; td.appendChild(inp);
|
||||
cellEditFill(td); td.textContent = ''; td.appendChild(inp);
|
||||
inp.focus(); inp.select();
|
||||
let done = false;
|
||||
const fin = async save => {
|
||||
@@ -1230,7 +1252,7 @@ function grpBillQtyEdit(td, tr, cur0){
|
||||
const bid = Number(tr.dataset.bid);
|
||||
const inp = document.createElement('input');
|
||||
inp.className = 'cellin'; inp.value = cur0.replace(/,/g, ''); inp.spellcheck = false;
|
||||
td.textContent = ''; td.appendChild(inp);
|
||||
cellEditFill(td); td.textContent = ''; td.appendChild(inp);
|
||||
inp.focus(); inp.select();
|
||||
let done = false;
|
||||
const fin = async save => {
|
||||
@@ -1262,7 +1284,7 @@ function grpNormQtyEdit(td, tr, cur0){
|
||||
inp.title = '可输入数字、数字四则(如 5+9.25+6.36)或带 GCL 的公式(GCL=清单工程量÷定额单位数字,'
|
||||
+ '纯字母单位=清单工程量),如 GCL*(5+9.25+6.36)+GCL;公式按原文保存,界面显示求值数字,'
|
||||
+ '导出时按清单工程量求值';
|
||||
td.textContent = ''; td.appendChild(inp);
|
||||
cellEditFill(td); td.textContent = ''; td.appendChild(inp);
|
||||
inp.focus(); inp.select();
|
||||
let done = false;
|
||||
const fin = async save => {
|
||||
@@ -1335,7 +1357,7 @@ function lmeEditCell(td, tr, field, cur){
|
||||
const f = this.value.replace(/[^\d.\-]/g, ''), pp = f.split('.');
|
||||
this.value = pp.length > 2 ? pp[0] + '.' + pp.slice(1).join('') : f;
|
||||
});
|
||||
td.textContent = ''; td.appendChild(inp);
|
||||
cellEditFill(td); td.textContent = ''; td.appendChild(inp);
|
||||
inp.focus(); inp.select();
|
||||
let done = false;
|
||||
const fin = async save => {
|
||||
@@ -1396,7 +1418,7 @@ function lmeEditField(td, tr, field){
|
||||
const cur = td.textContent.replace(/\u00a0/g, ' ').trim();
|
||||
const inp = document.createElement('input');
|
||||
inp.className = 'cellin'; inp.value = (cur === '—' ? '' : cur); inp.spellcheck = false;
|
||||
td.textContent = ''; td.appendChild(inp);
|
||||
cellEditFill(td); td.textContent = ''; td.appendChild(inp);
|
||||
inp.focus(); inp.select();
|
||||
let done = false;
|
||||
const fin = async save => {
|
||||
|
||||
Reference in New Issue
Block a user