mostrar confirmar
This commit is contained in:
@@ -31,10 +31,16 @@
|
||||
</b-field>
|
||||
</transition>
|
||||
<b-field label="Dirección">
|
||||
<b-input type="text" v-model="nuevo.direccion" :placeholder="viejo.direccion"></b-input>
|
||||
<b-input type="text"
|
||||
v-model="nuevo.direccion"
|
||||
:placeholder="viejo.direccion">
|
||||
</b-input>
|
||||
</b-field>
|
||||
<b-field label="Teléfono">
|
||||
<b-input type="number" :placeholder="viejo.telefono" maxlength="10"></b-input>
|
||||
<b-input
|
||||
type="number"
|
||||
:placeholder="viejo.telefono"
|
||||
maxlength="10"></b-input>
|
||||
</b-field>
|
||||
<b-field label="Fecha de nacimiento">
|
||||
<b-datepicker
|
||||
@@ -44,7 +50,7 @@
|
||||
</b-datepicker>
|
||||
</b-field>
|
||||
<b-field label="ID status">
|
||||
<b-input type="" :placeholder="viejo.idStatus"></b-input>
|
||||
<b-input type="number" :placeholder="idStatus"></b-input>
|
||||
</b-field>
|
||||
<p class="is-size-5">Carta de aceptación</p>
|
||||
<br>
|
||||
@@ -98,21 +104,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import moment from 'moment'
|
||||
import validator from 'validator'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
viejo: {
|
||||
correo: 'juanito@gmail.com',
|
||||
fechaInicio: '20-05-15',
|
||||
fechaFin: '2020-11-12',
|
||||
direccion: 'La que sea',
|
||||
telefono: 5548689152,
|
||||
fechaNacimiento: '2000-02-06',
|
||||
idStatus: 1
|
||||
},
|
||||
viejo: {},
|
||||
idStatus: localStorage.getItem('idServicio'),
|
||||
nuevo: {
|
||||
correo: '',
|
||||
fechaInicioFinal: '',
|
||||
@@ -133,6 +133,23 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
obtenerRegistro () {
|
||||
this.isLoading = true
|
||||
return axios
|
||||
.get(
|
||||
`${process.env.api}/servicio/admin?idServicio=${this.idStatus}`//,
|
||||
// this.token
|
||||
)
|
||||
.then(res => {
|
||||
this.isLoading = false
|
||||
this.viejo = res.data
|
||||
console.log(this.viejo)
|
||||
})
|
||||
.catch(err => {
|
||||
this.isLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
dangerToast () {
|
||||
this.$buefy.toast.open({
|
||||
message: 'Asegurate de ingresar un PDF',
|
||||
@@ -183,14 +200,15 @@ export default {
|
||||
}
|
||||
},
|
||||
regresar () {
|
||||
localStorage.removeItem('idRegistro')
|
||||
this.$router.push('/admin/servicio')
|
||||
},
|
||||
actualizar () {
|
||||
this.isLoading = true
|
||||
// const data = {
|
||||
// a: 1
|
||||
// }
|
||||
// let data = {}
|
||||
const formData = new FormData()
|
||||
if (this.cartaAceptacion) { formData.append('cartaAceptacion', this.cartaAceptacion) }
|
||||
if (this.cartaTermino) { formData.append('cartaTermino', this.cartaTermino) }
|
||||
if (this.informeGlobal) { formData.append('informeGlobal', this.informeGlobal) }
|
||||
},
|
||||
actualizarDialog () {
|
||||
this.$buefy.dialog.confirm({
|
||||
@@ -202,6 +220,10 @@ export default {
|
||||
hasIcon: true,
|
||||
onConfirm: () => this.actualizar()
|
||||
})
|
||||
},
|
||||
fecha (date) {
|
||||
const fecha = moment(date.substr(0, 10))
|
||||
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -221,6 +243,9 @@ export default {
|
||||
fechaNacimiento: function () {
|
||||
this.nuevo.fechaNacimientoFinal = moment(this.fechaNacimiento[0])
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.obtenerRegistro()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user