Agrega filtro convenio en automation/transaccion/test-rda y fix particular (contrato 12)
- automation: filtro contrato en SQL pacientes+RDA, numero LHXC en run() - transaccion: filtro contrato en preview/send-one/send - test-rda: filtro tipo_usuario (11/07/12), default contrato "12", acepta "12"/"012" - json_generator: detecta particular por CODCONTRATO "12"/"012" además de NIT_EMPRESA PART; fuerza tipousuario="12", codFormaPago="CLIP", plazoDias="0" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
d7afbe9b7d
commit
69372a5673
@@ -21,6 +21,11 @@
|
||||
<input type="date" id="fecha-input" value="{{ today }}"
|
||||
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Convenio <span class="text-xs text-gray-400">(vacío = todos)</span></label>
|
||||
<input type="text" id="contrato-input" placeholder="ej: 011"
|
||||
class="w-28 px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
||||
</div>
|
||||
<button onclick="previewAutomation()"
|
||||
id="btn-preview"
|
||||
class="px-6 py-2 bg-gray-600 hover:bg-gray-700 text-white font-medium rounded-lg transition-colors flex items-center gap-2 whitespace-nowrap">
|
||||
@@ -162,8 +167,10 @@ async function previewAutomation() {
|
||||
document.getElementById('btn-run').disabled = true;
|
||||
_previewData = null;
|
||||
|
||||
const contrato = document.getElementById('contrato-input').value.trim();
|
||||
const form = new FormData();
|
||||
form.append('fecha', fecha);
|
||||
if (contrato) form.append('contrato', contrato);
|
||||
|
||||
try {
|
||||
const resp = await fetch('/automation/preview', { method: 'POST', body: form, credentials: 'include' });
|
||||
@@ -253,8 +260,10 @@ async function confirmarEnvio() {
|
||||
document.getElementById('p2-badge').textContent = 'Esperando...';
|
||||
document.getElementById('p2-badge').className = 'text-sm text-gray-400';
|
||||
|
||||
const contrato = document.getElementById('contrato-input').value.trim();
|
||||
const form = new FormData();
|
||||
form.append('fecha', fecha);
|
||||
if (contrato) form.append('contrato', contrato);
|
||||
|
||||
try {
|
||||
const resp = await fetch('/automation/run', { method: 'POST', body: form, credentials: 'include' });
|
||||
|
||||
@@ -9,7 +9,14 @@
|
||||
<div class="px-6 py-4 border-b border-gray-200 flex items-center justify-between flex-wrap gap-2">
|
||||
<h3 class="font-semibold text-gray-800"><i class="fas fa-list mr-2 text-blue-500"></i>Candidatos disponibles</h3>
|
||||
<div class="flex gap-2 items-center flex-wrap">
|
||||
<input id="filtro-contrato" type="text" placeholder="Contrato (ej: 011)" value="011"
|
||||
<select id="filtro-tipo-usuario" onchange="onTipoUsuarioChange()"
|
||||
class="px-3 py-1.5 border border-gray-300 rounded-lg text-sm">
|
||||
<option value="">Tipo usuario (todos)</option>
|
||||
<option value="11">11 — EPS / Contributivo</option>
|
||||
<option value="07">07 — Póliza</option>
|
||||
<option value="12">12 — Particular</option>
|
||||
</select>
|
||||
<input id="filtro-contrato" type="text" placeholder="Contrato (ej: 011)" value="12"
|
||||
class="px-3 py-1.5 border border-gray-300 rounded-lg text-sm w-28">
|
||||
<input id="filtro-articulos" type="text" placeholder="Artículos (vacío = lista TNS)"
|
||||
class="px-3 py-1.5 border border-gray-300 rounded-lg text-sm w-52"
|
||||
@@ -176,7 +183,9 @@ async function cargarCandidatos(reset = false) {
|
||||
|
||||
const contrato = document.getElementById('filtro-contrato').value.trim();
|
||||
const articulos = document.getElementById('filtro-articulos').value.trim();
|
||||
const tipoUsuario = document.getElementById('filtro-tipo-usuario').value;
|
||||
const params = new URLSearchParams({ offset: _offset });
|
||||
if (tipoUsuario) params.append('tipo_usuario', tipoUsuario);
|
||||
if (contrato) params.append('contrato', contrato);
|
||||
if (articulos) params.append('articulos', articulos);
|
||||
|
||||
@@ -214,7 +223,9 @@ async function verMas() {
|
||||
await cargarEnviados();
|
||||
const contrato = document.getElementById('filtro-contrato').value.trim();
|
||||
const articulos = document.getElementById('filtro-articulos').value.trim();
|
||||
const tipoUsuario = document.getElementById('filtro-tipo-usuario').value;
|
||||
const params = new URLSearchParams({ offset: _offset });
|
||||
if (tipoUsuario) params.append('tipo_usuario', tipoUsuario);
|
||||
if (contrato) params.append('contrato', contrato);
|
||||
if (articulos) params.append('articulos', articulos);
|
||||
|
||||
@@ -370,6 +381,20 @@ async function enviarRDA() {
|
||||
contenido.innerHTML = html;
|
||||
}
|
||||
|
||||
function onTipoUsuarioChange() {
|
||||
const tipo = document.getElementById('filtro-tipo-usuario').value;
|
||||
const contratoInput = document.getElementById('filtro-contrato');
|
||||
if (tipo === '12') {
|
||||
contratoInput.value = '';
|
||||
contratoInput.disabled = true;
|
||||
contratoInput.classList.add('bg-gray-100', 'text-gray-400');
|
||||
} else {
|
||||
contratoInput.disabled = false;
|
||||
contratoInput.classList.remove('bg-gray-100', 'text-gray-400');
|
||||
if (!contratoInput.value) contratoInput.value = '011';
|
||||
}
|
||||
}
|
||||
|
||||
cargarCandidatos(true);
|
||||
|
||||
function esc(s) {
|
||||
|
||||
@@ -20,6 +20,11 @@
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">Convenio <span class="text-gray-400">(vacío = todos)</span></label>
|
||||
<input id="f-contrato" type="text" placeholder="ej: 011"
|
||||
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-medium text-gray-600 mb-1">Factura <span class="text-gray-400">(opcional)</span></label>
|
||||
<input id="f-factura" type="text" placeholder="Ej: LHXC03404"
|
||||
@@ -130,6 +135,7 @@ let formParams = {};
|
||||
function getParams() {
|
||||
return {
|
||||
query_id: document.getElementById('f-query').value,
|
||||
contrato: document.getElementById('f-contrato').value.trim(),
|
||||
factura: document.getElementById('f-factura').value,
|
||||
fecha_inicio: document.getElementById('f-fi').value,
|
||||
fecha_fin: document.getElementById('f-ff').value,
|
||||
|
||||
Reference in New Issue
Block a user