un corte que hago a las 19hs
This commit is contained in:
@@ -1,21 +1,63 @@
|
||||
<script lang="ts">
|
||||
import type { MensajeDto } from "../types";
|
||||
import { urlG } from "../stores/urlStore";
|
||||
import type { GaranteDto, MensajeDto } from "../types";
|
||||
|
||||
let {men, onCancel, onConfirm, putErrorModal}: {men: MensajeDto,
|
||||
onCancel:()=>void,
|
||||
onConfirm:()=>void,
|
||||
putErrorModal:(txt:string)=>void} = $props();
|
||||
let {men, garantes , onCancel, onConfirm, onClose
|
||||
} : {
|
||||
men: MensajeDto,
|
||||
garantes: GaranteDto[],
|
||||
onCancel:()=>void,
|
||||
onClose:()=>void,
|
||||
onConfirm:()=>void } = $props();
|
||||
|
||||
let confirmaGarantes: boolean = $state(false);
|
||||
|
||||
async function getGaranteData() {
|
||||
try {
|
||||
const responce = await fetch($urlG+"". {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Auth": String(sessionStorage.getItem("token")),
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="modal show d-block" tabindex="-1" role="dialog" aria-labelledby="staticModalLabel" aria-hidden="true" style="background-color: rgba(0,0,0,0.5);">
|
||||
<div class="modal-dialog modal-xl" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="staticModalLabel">Lista de Garantes y subir Contrato</h5>
|
||||
<button type="button" class="btn-close" aria-label="Close" onclick={onClose}></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>DNI</th>
|
||||
<th>Nombre</th>
|
||||
<th>Apellido</th>
|
||||
<th>Domicilio</th>
|
||||
<th>Celular</th>
|
||||
<th>Domicilio Laboral</th>
|
||||
<th>Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each garantes as garante, index}
|
||||
<tr>
|
||||
<td>{index + 1}</td>
|
||||
<td>{garante.Dni}</td>
|
||||
<td>{garante.Nombre}</td>
|
||||
<td>{garante.Apellido}</td>
|
||||
<td>{garante.Domicilio}</td>
|
||||
<td>{garante.Celular}</td>
|
||||
<td>{garante.Domiciliolaboral}</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="checkbox" bind:checked={confirmaGarantes} disabled={confirmaGarantes}>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer d-flex justify-content-between">
|
||||
<button class="btn btn-primary" disabled={!confirmaGarantes} onclick={() => onConfirm()} >
|
||||
Subir
|
||||
</button>
|
||||
<button type="button" class="btn btn-danger" onclick={onCancel}>Cancelar Contrato</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,17 +10,21 @@
|
||||
import ModalPrecontrato from "../Componentes/ModalPrecontrato.svelte";
|
||||
import { get } from "svelte/store";
|
||||
import ModalAddGarantes from "../Componentes/ModalAddGarantes.svelte";
|
||||
import { Accordion } from "@sveltestrap/sveltestrap";
|
||||
import ModalCheckYContrato from "../Componentes/ModalCheckYContrato.svelte";
|
||||
|
||||
const token = sessionStorage.getItem("token");
|
||||
let mensajes: MensajeDto[] = $state([]);
|
||||
let showspinner:boolean =$state(false);
|
||||
let mostrarleidos: boolean = $state(false);
|
||||
let modaldata:string =$state("");
|
||||
let Selmens: MensajeDto = $state({accion: "",receptor:"", fecha: Date.UTC, mensaje:"", propiedad:0, remitente:""});
|
||||
let Selmens: MensajeDto = $state({accion:""});
|
||||
|
||||
let show:boolean = $state(false);
|
||||
let setCantGarantes = $state(0);
|
||||
|
||||
let garantes:GaranteDto[] = $state([]);
|
||||
|
||||
onMount(async () => {
|
||||
SinLeer();
|
||||
})
|
||||
@@ -72,8 +76,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
async function marcarleido( fecha: Date, email: string, men:MensajeDto ) {
|
||||
show = true;
|
||||
|
||||
@@ -104,7 +106,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
function abrirModal(mensaje: MensajeDto) {
|
||||
function abrirModal(mensaje: MensajeDto) {
|
||||
if (mensaje.accion === "Nuevo Alquiler") {
|
||||
Selmens = { ...mensaje };
|
||||
return;
|
||||
@@ -115,6 +117,12 @@
|
||||
setCantGarantes = Number(Selmens.mensaje.split(" ").reverse()[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mensaje.accion === "Check y Contrato"){
|
||||
Selmens = {...mensaje};
|
||||
let idcontrato = Number(Selmens.mensaje.split(" ").reverse()[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
async function handleEnviarmensaje2(data: {opcionVenta:boolean, cantGarantes:number, mesesHastaAumento:number}) {
|
||||
@@ -197,6 +205,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
function handleCancelPrecontrato(): void {
|
||||
|
||||
}
|
||||
|
||||
async function handleEnviarmensaje4() {
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<NavBarAutocompletable/>
|
||||
@@ -205,20 +221,14 @@
|
||||
<ModalEstatico payload={modaldata} close={()=>!!(modaldata = "")} />
|
||||
{/if}
|
||||
|
||||
<!--
|
||||
<ModalConfirm
|
||||
{show}
|
||||
{title}
|
||||
{message}
|
||||
onCancel={() => (show = false)}
|
||||
onConfirm={()=>1+1}
|
||||
/>
|
||||
-->
|
||||
{#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}/>
|
||||
{:else if Selmens.accion == "Check y Contrato"}
|
||||
<ModalCheckYContrato {garantes} men={Selmens} onCancel={handleCancelPrecontrato} onClose={() => (Selmens.accion = "")} onConfirm={handleEnviarmensaje4}/>
|
||||
{/if}
|
||||
|
||||
<div class="container">
|
||||
<br>
|
||||
<BarraHorizontalConTexto text="Notificaciones"/>
|
||||
@@ -271,24 +281,23 @@
|
||||
|
||||
{#if mostrarleidos == false}
|
||||
<td>
|
||||
<div class="d-flex">
|
||||
|
||||
<button
|
||||
class="btn btn-outline-primary"
|
||||
onclick={() => abrirModal(men)}
|
||||
>
|
||||
Expandir
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="btn btn-outline-danger"
|
||||
onclick={() => marcarleido(men.fecha, localStorage.getItem("email")|| "", men)}
|
||||
>
|
||||
Marcar Leido
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
class="btn btn-outline-primary"
|
||||
onclick={() => abrirModal(men)}
|
||||
>
|
||||
Expandir
|
||||
</button>
|
||||
</td>
|
||||
{/if}
|
||||
{:else if men.accion == "ContratoCancelado"}
|
||||
<td>
|
||||
<button
|
||||
class="btn btn-outline-danger"
|
||||
onclick={() => marcarleido(men.fecha, localStorage.getItem("email")|| "", men)}
|
||||
>
|
||||
Marcar Leido
|
||||
</button>
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user