debug: console.log в refreshSupps (v1.0.61)
This commit is contained in:
@@ -61,7 +61,7 @@
|
||||
<body>
|
||||
<div class="topbar">
|
||||
<img src="/nubes-logo.svg" alt="Nubes">
|
||||
<span class="title">Сверка договоров — LLM <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.0.60 — Lucee</span></span>
|
||||
<span class="title">Сверка договоров — LLM <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.0.61 — Lucee</span></span>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
@@ -323,15 +323,19 @@ parseBtn.addEventListener('click', async function() {
|
||||
|
||||
// ── Обновить supplement_id/type для radio ──────────────────
|
||||
async function refreshSupps() {
|
||||
if (!contractId) return;
|
||||
if (!contractId) { console.log('refreshSupps: no contractId'); return; }
|
||||
try {
|
||||
var resp = await fetch('/api.cfm?action=query&sql=' + encodeURIComponent("SELECT s.id, s.type, s.document_id FROM supplements s WHERE s.contract_id='" + contractId + "'"));
|
||||
var data = await resp.json();
|
||||
console.log('refreshSupps: data=', data);
|
||||
console.log('refreshSupps: fileQueue doc_ids=', fileQueue.map(function(f){return f.doc_id;}));
|
||||
if (data.OK && data.ROWS) {
|
||||
data.ROWS.forEach(function(r) {
|
||||
var supp = {};
|
||||
data.COLUMNS.forEach(function(c, ci) { supp[c] = r[ci]; });
|
||||
console.log('refreshSupps: supp=', supp);
|
||||
for (var i = 0; i < fileQueue.length; i++) {
|
||||
console.log(' cmp: doc_id=' + fileQueue[i].doc_id + ' vs document_id=' + supp.document_id + ' match=' + (fileQueue[i].doc_id === supp.document_id));
|
||||
if (fileQueue[i].doc_id === supp.document_id) {
|
||||
fileQueue[i].supp_id = supp.id;
|
||||
fileQueue[i].supp_type = supp.type;
|
||||
@@ -340,7 +344,7 @@ async function refreshSupps() {
|
||||
});
|
||||
renderTable();
|
||||
}
|
||||
} catch(e) {}
|
||||
} catch(e) { console.log('refreshSupps error:', e); }
|
||||
}
|
||||
|
||||
function setInitial(suppId) {
|
||||
|
||||
Reference in New Issue
Block a user