añadida informacion a la pantalla de añadirgarantes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from "svelte";
|
||||
import NavBarAutocompletable from "../Componentes/NavBarAutocompletable.svelte";
|
||||
import type { GaranteDto, MensajeDto } from "../types";
|
||||
import type { GaranteDto, MensajeDto, PreContratoData } from "../types";
|
||||
import ModalEstatico from "../Componentes/ModalEstatico.svelte";
|
||||
import { urlG } from "../stores/urlStore";
|
||||
import ModalConfirm from "../Componentes/ModalConfirm.svelte";
|
||||
@@ -113,6 +113,7 @@
|
||||
if (mensaje.accion === "Carge Garantes") {
|
||||
Selmens = { ...mensaje };
|
||||
setCantGarantes = Number(Selmens.mensaje.split(" ").reverse()[1]);
|
||||
ObtenerDatosPreContrato();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -467,6 +468,28 @@
|
||||
}
|
||||
showConsultaCompra = false; Selmens.accion = "";
|
||||
}
|
||||
|
||||
let datosprecontrato: PreContratoData = $state({});
|
||||
async function ObtenerDatosPreContrato(){
|
||||
try {
|
||||
const req = await fetch($urlG + "/api/precontrato/preCargaGarantes/data?propiedadId="+Selmens.propiedad, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
"Auth": token || "",
|
||||
}
|
||||
});
|
||||
const data = await req.json();
|
||||
if (req.ok){
|
||||
datosprecontrato = data;
|
||||
return;
|
||||
}
|
||||
modaldata = data.message;
|
||||
|
||||
} catch {
|
||||
modaldata = "Fallo al obtener los datos del precontrato";
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<NavBarAutocompletable/>
|
||||
@@ -478,7 +501,7 @@
|
||||
{#if Selmens.accion == "Nuevo Alquiler" }
|
||||
<ModalPrecontrato onClose={() => (Selmens.accion = "")} onSubmit={handleEnviarmensaje2} />
|
||||
{:else if Selmens.accion == "Carge Garantes"}
|
||||
<ModalAddGarantes maxGarantes={setCantGarantes} onClose={() => (Selmens.accion = "")} onSubmit={handleEnviarmensaje3}/>
|
||||
<ModalAddGarantes maxGarantes={setCantGarantes} onClose={() => (Selmens.accion = "")} onSubmit={handleEnviarmensaje3} {datosprecontrato}/>
|
||||
{:else if Selmens.accion == "Check y Contrato"}
|
||||
<ModalCheckYContrato {garantes} men={Selmens} onCancel={handleCancelPrecontrato} onClose={() => (Selmens.accion = "")} onConfirm={handleEnviarmensaje4}/>
|
||||
{:else if Selmens.accion == "Aceptar Contrato"}
|
||||
@@ -565,4 +588,4 @@
|
||||
</table>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user