falta soporte para el menu de propietario de mostrar los archivos
This commit is contained in:
@@ -75,8 +75,24 @@
|
||||
contratoid = par.get("id")||"";
|
||||
}
|
||||
|
||||
function submitnuevosCanones() {
|
||||
|
||||
async function submitnuevosCanones() {
|
||||
try {
|
||||
const ret = await fetch($urlG+"/api/contratos/crearcanons",{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Auth" : String(token),
|
||||
},
|
||||
body: JSON.stringify({idcontrato: contratoid, aumento: interes})
|
||||
});
|
||||
|
||||
let data = await ret.json();
|
||||
modaldata = data.message;
|
||||
if (ret.ok) {
|
||||
refreshCanon();
|
||||
}
|
||||
} catch {
|
||||
modaldata = "Fallo al intentar alcanzar el servidor";
|
||||
}
|
||||
}
|
||||
|
||||
async function verContrato() {
|
||||
@@ -106,6 +122,53 @@
|
||||
modaldata= "fallo intentar hacer la request";
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshCanon() {
|
||||
try {
|
||||
const ret = await fetch($urlG+"/api/contratos/canon?id="+contratoid, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
}
|
||||
});
|
||||
if (!ret.ok){
|
||||
let data = await ret.json();
|
||||
modaldata = data.message;
|
||||
return;
|
||||
}
|
||||
let data = await ret.json();
|
||||
canons = data;
|
||||
return;
|
||||
} catch {
|
||||
modaldata = "No se pudo obtener la lista de canones actualizada";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function marcarPago(mes: Date) {
|
||||
try {
|
||||
const ret = await fetch($urlG+"/api/contratos/marcarPago", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({idcontrato:contratoid, fecha:mes}),
|
||||
});
|
||||
let data = await ret.json();
|
||||
modaldata = data.message;
|
||||
if (ret.ok){
|
||||
refreshCanon()
|
||||
return;
|
||||
}
|
||||
} catch {
|
||||
modaldata = "Fallo al intentar hacer la request";
|
||||
}
|
||||
}
|
||||
|
||||
async function generarTiket(mes: Date) { //WIP
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<NavBarAutocompletable/>
|
||||
@@ -114,7 +177,6 @@
|
||||
<ModalEstatico payload={modaldata} close={()=>!!(modaldata = "")}/>
|
||||
{/if}
|
||||
|
||||
<ModalConfirm />
|
||||
<div class="container-fluid mt-4 d-flex">
|
||||
<div class="col-md-4 me-4">
|
||||
<div class="card">
|
||||
@@ -222,10 +284,10 @@
|
||||
<p><strong>Pago:</strong> {canon.pago ? "Sí" : "No"}</p>
|
||||
</div>
|
||||
<div class="card-footer d-flex justify-content-between">
|
||||
<button class="btn btn-warning btn-xs" disabled={canon.pago}>
|
||||
<button class="btn btn-warning btn-xs" disabled={canon.pago} onclick={()=>marcarPago(canon.mes)}>
|
||||
Marcar Pago
|
||||
</button>
|
||||
<button class="btn btn-info btn-xs" disabled={!canon.pago}>
|
||||
<button class="btn btn-info btn-xs" disabled={!canon.pago} onclick={()=> generarTiket(canon.mes)}>
|
||||
Generar Tiket
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user