tuki testeaduki y andanduki
This commit is contained in:
@@ -330,7 +330,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function handlerechazarcontrato(idcontrato:number) {
|
||||
async function handleAceptarContrato(idcontrato:number) {
|
||||
if (idcontrato<=0){
|
||||
modaldata="La idcontrato da 0 o menos comunicate con el administrador";
|
||||
return;
|
||||
@@ -344,6 +344,7 @@
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(rq),
|
||||
});
|
||||
@@ -367,17 +368,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function handleAceptarContrato(idcontrato:number) {
|
||||
async function handlerechazarcontrato(idcontrato:number) {
|
||||
if (idcontrato<=0){
|
||||
modaldata="La idcontrato da 0 o menos comunicate con el administrador";
|
||||
return;
|
||||
}
|
||||
try {
|
||||
let rq = {
|
||||
idcontrato:idcontrato,
|
||||
fecha:Selmens.fecha
|
||||
}
|
||||
const responce = await fetch($urlG+"/api/contratos/rechazarPreContrato?idcontrato="+idcontrato, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Auth": String(token),
|
||||
}
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(rq),
|
||||
});
|
||||
if (responce.ok){
|
||||
let data = await responce.json();
|
||||
@@ -413,7 +420,7 @@
|
||||
{:else if Selmens.accion == "Check y Contrato"}
|
||||
<ModalCheckYContrato {garantes} men={Selmens} onCancel={handleCancelPrecontrato} onClose={() => (Selmens.accion = "")} onConfirm={handleEnviarmensaje4}/>
|
||||
{:else if Selmens.accion == "Aceptar Contrato"}
|
||||
<ModalVeryAceptarContrato onClose={() => (Selmens.accion = "")} onConfirm={handleAceptarContrato} onCancel={handleCancelPrecontrato} getContrato={ObtenerContrato} men={Selmens}/>
|
||||
<ModalVeryAceptarContrato onClose={() => (Selmens.accion = "")} onConfirm={handleAceptarContrato} onCancel={handlerechazarcontrato} getContrato={ObtenerContrato} men={Selmens}/>
|
||||
{/if}
|
||||
|
||||
<div class="container">
|
||||
@@ -466,28 +473,26 @@
|
||||
<td>{men.fecha}</td>
|
||||
<td>{men.propiedad}</td>
|
||||
|
||||
{#if mostrarleidos == false}
|
||||
<td>
|
||||
{#if mostrarleidos == false && men.accion != "Rechazo Contrato" && men.accion != "Aceptado Contrato"}
|
||||
<button
|
||||
class="btn btn-outline-primary"
|
||||
onclick={() => abrirModal(men)}
|
||||
>
|
||||
onclick={() => abrirModal(men)}>
|
||||
Expandir
|
||||
</button>
|
||||
</td>
|
||||
{:else if men.accion == "ContratoCancelado"}
|
||||
<td>
|
||||
{/if}
|
||||
{#if men.accion === "ContratoCancelado" || men.accion === "Rechazo Contrato" ||
|
||||
men.accion === "Aceptado Contrato"}
|
||||
<button
|
||||
class="btn btn-outline-danger"
|
||||
onclick={() => marcarleido(men.fecha, localStorage.getItem("email")|| "", men)}
|
||||
>
|
||||
onclick={() => marcarleido(men.fecha, localStorage.getItem("email")|| "", men)}>
|
||||
Marcar Leido
|
||||
</button>
|
||||
</td>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/each}
|
||||
{/if}
|
||||
{/each}
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user