2022-06-07 18:50:55 +00:00
|
|
|
<template>
|
|
|
|
<div class="columns is-vcentered">
|
|
|
|
<div class="column">
|
|
|
|
<b-button
|
|
|
|
type="is-info"
|
|
|
|
@click="
|
2022-07-11 14:15:10 +00:00
|
|
|
$alertsGenericos.imprimirWarning(
|
|
|
|
$buefy,
|
2022-07-13 04:23:31 +00:00
|
|
|
'¿Esta segur@ de querer reenviar la contraseña de este operador?',
|
2022-06-07 18:50:55 +00:00
|
|
|
updatePassword
|
|
|
|
)
|
|
|
|
"
|
|
|
|
expanded
|
|
|
|
rounded
|
|
|
|
>
|
2022-07-13 04:23:31 +00:00
|
|
|
Reenviar Contraseña
|
2022-06-07 18:50:55 +00:00
|
|
|
</b-button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<b-loading :is-full-page="true" v-model="isLoading" :can-cancel="false" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import axios from 'axios'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
isLoading: false,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
admin: { type: Object, required: true },
|
|
|
|
updateIsLoading: { type: Function, required: true },
|
|
|
|
operador: { type: Object, required: true },
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
updatePassword() {
|
2022-07-13 04:23:31 +00:00
|
|
|
const data = {
|
|
|
|
id_operador: this.operador.id_operador,
|
2022-06-07 18:50:55 +00:00
|
|
|
}
|
2022-07-13 04:23:31 +00:00
|
|
|
|
|
|
|
this.isLoading = true
|
|
|
|
axios
|
|
|
|
.put(
|
|
|
|
`${process.env.api}/operador/update-password`,
|
|
|
|
data,
|
2022-07-19 16:41:33 +00:00
|
|
|
this.$getToken.token()
|
2022-07-13 04:23:31 +00:00
|
|
|
)
|
|
|
|
.then((res) => {
|
|
|
|
this.isLoading = false
|
|
|
|
this.$alertsGenericos.imprimirMensaje(this.$buefy, res.data.message)
|
|
|
|
})
|
|
|
|
.catch((err) => {
|
|
|
|
this.isLoading = false
|
2022-08-05 23:41:37 +00:00
|
|
|
this.$alertsGenericos.imprimirError(
|
|
|
|
this.$buefy,
|
|
|
|
this.$router,
|
|
|
|
err.response.data
|
|
|
|
)
|
2022-07-13 04:23:31 +00:00
|
|
|
})
|
2022-06-07 18:50:55 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style></style>
|