diff --git a/index.cfm b/index.cfm index 2096b72..4940c5e 100644 --- a/index.cfm +++ b/index.cfm @@ -61,7 +61,7 @@
Nubes - Сверка договоров — LLM v1.0.60 — Lucee + Сверка договоров — LLM v1.0.61 — Lucee
@@ -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) {