listo el relog para la hora excepcion
This commit is contained in:
parent
eac69303fd
commit
1cd26513e5
@ -2,11 +2,17 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="has-text-centered">
|
<div class="has-text-centered">
|
||||||
<p class="subtitle is-3">Hora Excepción</p>
|
<p class="subtitle is-3">Hora Excepción</p>
|
||||||
<b-button type="is-primary" @click="mostrar = true">Agregar</b-button>
|
<b-button type="is-primary" @click="mostrar = true" v-if="!mostrar"
|
||||||
|
>Agregar</b-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Relog
|
<Relog
|
||||||
:diaSeleccion="horasExcepcion"
|
:diaSeleccion="horasExcepcion"
|
||||||
|
:crearHoraExcepcion="crearHoraExcepcion"
|
||||||
|
:imprimirMensaje="imprimirMensaje"
|
||||||
|
:imprimirWarning="imprimirWarning"
|
||||||
|
:imprimirError="imprimirError"
|
||||||
tipo="crearHoraExcepcion"
|
tipo="crearHoraExcepcion"
|
||||||
v-if="mostrar"
|
v-if="mostrar"
|
||||||
/>
|
/>
|
||||||
@ -39,6 +45,9 @@ export default {
|
|||||||
imprimirMensaje: { type: Function, required: true },
|
imprimirMensaje: { type: Function, required: true },
|
||||||
imprimirWarning: { type: Function, required: true },
|
imprimirWarning: { type: Function, required: true },
|
||||||
imprimirError: { type: Function, required: true },
|
imprimirError: { type: Function, required: true },
|
||||||
|
updateIsLoading: { type: Function, required: true },
|
||||||
|
actualizarTabla: { type: Boolean, required: true },
|
||||||
|
updateActualizarTabla: { type: Function, required: true },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -54,9 +63,9 @@ export default {
|
|||||||
hora_inicio,
|
hora_inicio,
|
||||||
hora_fin,
|
hora_fin,
|
||||||
}
|
}
|
||||||
this.updateIsLoading(true)
|
// this.updateIsLoading(true)
|
||||||
axios
|
axios
|
||||||
.post(`${process.env.api}/hora_excepcion`, data)
|
.post(`${process.env.api}/hora-excepcion`, data)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.imprimirMensaje(res.data.message)
|
this.imprimirMensaje(res.data.message)
|
||||||
this.updateActualizarTabla(true)
|
this.updateActualizarTabla(true)
|
||||||
|
@ -33,7 +33,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="has-text-centered">
|
<div class="has-text-centered">
|
||||||
<b-button class="my-5" type="is-success" @click="funcionHora()"
|
<b-button
|
||||||
|
class="my-5"
|
||||||
|
type="is-success"
|
||||||
|
@click="imprimirWarning(mensajeWarning, funcionHora)"
|
||||||
>Guardar</b-button
|
>Guardar</b-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
@ -41,12 +44,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
cambiarHora: { type: Function, require: false },
|
cambiarHora: { type: Function, require: false },
|
||||||
horaExcepcion: { type: Function, require: false },
|
crearHoraExcepcion: { type: Function, require: false },
|
||||||
|
imprimirMensaje: { type: Function, required: true },
|
||||||
|
imprimirWarning: { type: Function, required: true },
|
||||||
|
imprimirError: { type: Function, required: true },
|
||||||
diaSeleccion: { type: Object, require: true },
|
diaSeleccion: { type: Object, require: true },
|
||||||
tipo: { type: String, require: true },
|
tipo: { type: String, require: true },
|
||||||
},
|
},
|
||||||
@ -64,6 +69,8 @@ export default {
|
|||||||
horaFin: new Date(`01-01-2022 17:45`),
|
horaFin: new Date(`01-01-2022 17:45`),
|
||||||
locale: 'es-ES', // Browser locale
|
locale: 'es-ES', // Browser locale
|
||||||
hourFormat: '24', // Browser locale
|
hourFormat: '24', // Browser locale
|
||||||
|
|
||||||
|
mensajeWarning: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -76,12 +83,18 @@ export default {
|
|||||||
true
|
true
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
this.horaExcepcion(
|
this.crearHoraExcepcion(
|
||||||
this.diaSeleccion.id_institucion_dia,
|
this.diaSeleccion.id_institucion_dia,
|
||||||
moment(this.horaInicio).format('HH:mm'),
|
moment(this.horaInicio).format('HH:mm'),
|
||||||
moment(this.horaFin).format('HH:mm')
|
moment(this.horaFin).format('HH:mm')
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
if (this.tipo === 'cambiarHora')
|
||||||
|
this.mensajeWarning = '¿Esta segur@ de querer actualizar esta hora?'
|
||||||
|
else
|
||||||
|
this.mensajeWarning = '¿Esta segur@ de querer crear esta hora excepción?'
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -30,6 +30,9 @@
|
|||||||
:imprimirMensaje="imprimirMensaje"
|
:imprimirMensaje="imprimirMensaje"
|
||||||
:imprimirWarning="imprimirWarning"
|
:imprimirWarning="imprimirWarning"
|
||||||
:imprimirError="imprimirError"
|
:imprimirError="imprimirError"
|
||||||
|
:updateIsLoading="updateIsLoading"
|
||||||
|
:actualizarTabla="actualizarTabla"
|
||||||
|
:updateActualizarTabla="updateActualizarTabla"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</b-table>
|
</b-table>
|
||||||
@ -37,6 +40,9 @@
|
|||||||
<div v-if="mostrar">
|
<div v-if="mostrar">
|
||||||
<Relog
|
<Relog
|
||||||
:cambiarHora="cambiarHora"
|
:cambiarHora="cambiarHora"
|
||||||
|
:imprimirMensaje="imprimirMensaje"
|
||||||
|
:imprimirWarning="imprimirWarning"
|
||||||
|
:imprimirError="imprimirError"
|
||||||
:diaSeleccion="diaSeleccion"
|
:diaSeleccion="diaSeleccion"
|
||||||
tipo="cambiarHora"
|
tipo="cambiarHora"
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user