nuevo formateo
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
</b-field>
|
||||
</div>
|
||||
|
||||
<div class="column is-3 mb-4 pb-4 ">
|
||||
<div class="column is-3 mb-4 pb-4">
|
||||
<b-field>
|
||||
<b-select icon="information" expanded rounded v-model="idStatus">
|
||||
<optgroup>
|
||||
@@ -217,101 +217,101 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import moment from "moment";
|
||||
import axios from 'axios'
|
||||
import moment from 'moment'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
idTipoUsuario: "",
|
||||
idUsuario: "",
|
||||
tipoUsuario: "",
|
||||
idTipoUsuario: '',
|
||||
idUsuario: '',
|
||||
tipoUsuario: '',
|
||||
data: [],
|
||||
total: "",
|
||||
total: '',
|
||||
isLoading: false,
|
||||
page: 1,
|
||||
perPage: 25,
|
||||
numeroCuenta: "",
|
||||
nombre: "",
|
||||
idStatus: "",
|
||||
idServicio: "",
|
||||
numeroCuenta: '',
|
||||
nombre: '',
|
||||
idStatus: '',
|
||||
idServicio: '',
|
||||
token: {
|
||||
headers: {
|
||||
token: window.localStorage.getItem("token"),
|
||||
token: window.localStorage.getItem('token'),
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onPageChange(page) {
|
||||
this.page = page;
|
||||
this.obtenerDatos();
|
||||
this.page = page
|
||||
this.obtenerDatos()
|
||||
},
|
||||
types(idStatus) {
|
||||
if (idStatus === 1) {
|
||||
return "is-dark";
|
||||
return 'is-dark'
|
||||
} else if (idStatus === 2) {
|
||||
return "is-info";
|
||||
return 'is-info'
|
||||
} else if (idStatus === 3) {
|
||||
return "is-warning";
|
||||
return 'is-warning'
|
||||
} else if (idStatus === 4) {
|
||||
return "is-link";
|
||||
return 'is-link'
|
||||
} else if (idStatus === 5) {
|
||||
return "is-success";
|
||||
return 'is-success'
|
||||
} else if (idStatus === 6) {
|
||||
return "is-success is-light";
|
||||
return 'is-success is-light'
|
||||
} else if (idStatus === 7) {
|
||||
return "is-danger";
|
||||
return 'is-danger'
|
||||
} else if (idStatus === 8) {
|
||||
return "is-danger";
|
||||
return 'is-danger'
|
||||
} else if (idStatus === 9) {
|
||||
return "is-danger";
|
||||
return 'is-danger'
|
||||
}
|
||||
},
|
||||
botonCarta(cartaTermino, idServicio) {
|
||||
window.localStorage.setItem("idServicio", idServicio);
|
||||
window.localStorage.setItem("cartaTermino", cartaTermino);
|
||||
this.$router.push("/responsable/carta_termino");
|
||||
window.localStorage.setItem('idServicio', idServicio)
|
||||
window.localStorage.setItem('cartaTermino', cartaTermino)
|
||||
this.$router.push('/responsable/carta_termino')
|
||||
if (cartaTermino === 1) {
|
||||
return "is-success";
|
||||
return 'is-success'
|
||||
} else {
|
||||
return "is-danger";
|
||||
return 'is-danger'
|
||||
}
|
||||
},
|
||||
botonCuestionario(cuestionario, idServicio) {
|
||||
window.localStorage.setItem("idServicio", idServicio);
|
||||
window.localStorage.setItem("cuestionario", cuestionario);
|
||||
this.$router.push("/responsable/cuestionario");
|
||||
window.localStorage.setItem('idServicio', idServicio)
|
||||
window.localStorage.setItem('cuestionario', cuestionario)
|
||||
this.$router.push('/responsable/cuestionario')
|
||||
if (cuestionario === 1) {
|
||||
return "is-success";
|
||||
return 'is-success'
|
||||
} else {
|
||||
return "is-danger";
|
||||
return 'is-danger'
|
||||
}
|
||||
},
|
||||
iconoCarta(cartaTermino) {
|
||||
if (cartaTermino != null) {
|
||||
return "check";
|
||||
return 'check'
|
||||
}
|
||||
},
|
||||
iconoCuestionario(cuestionario) {
|
||||
if (cuestionario != null) {
|
||||
return "check";
|
||||
return 'check'
|
||||
}
|
||||
},
|
||||
fecha(date) {
|
||||
const fecha = moment(date.substr(0, 10));
|
||||
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`;
|
||||
const fecha = moment(date.substr(0, 10))
|
||||
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`
|
||||
},
|
||||
obtenerDatos(idStatus) {
|
||||
this.isLoading = true;
|
||||
this.data = [];
|
||||
this.isLoading = true
|
||||
this.data = []
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/servicio/servicios_responsable?idUsuario=${this.idUsuario}&pagina=${this.page}&idStatus=${this.idStatus}&nombre=${this.nombre}&numeroCuenta=${this.numeroCuenta}`,
|
||||
this.token
|
||||
)
|
||||
.then((res) => {
|
||||
const servicios = res.data.servicios;
|
||||
const servicios = res.data.servicios
|
||||
|
||||
if (servicios.length !== 0) {
|
||||
for (let i = 0; i < servicios.length; i++) {
|
||||
@@ -326,82 +326,82 @@ export default {
|
||||
cuestionario: servicios[i].idCuestionarioPrograma,
|
||||
cartaTermino: servicios[i].cartaTermino,
|
||||
idServicio: servicios[i].idServicio,
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
let currentTotal = servicios.length;
|
||||
let contador;
|
||||
let currentTotal = servicios.length
|
||||
let contador
|
||||
|
||||
for (let i = 0; i < res.data.registros / 25 + 1; i++) {
|
||||
contador = i;
|
||||
contador = i
|
||||
}
|
||||
currentTotal = this.perPage * contador;
|
||||
this.total = currentTotal;
|
||||
currentTotal = this.perPage * contador
|
||||
this.total = currentTotal
|
||||
})
|
||||
.catch((error) => {
|
||||
this.error(error.response.data.message);
|
||||
this.error(error.response.data.message)
|
||||
})
|
||||
.finally(() => {
|
||||
this.isLoading = false;
|
||||
});
|
||||
this.isLoading = false
|
||||
})
|
||||
},
|
||||
cartaAceptacion(idServicio, idStatus) {
|
||||
window.localStorage.setItem("idServicio", idServicio);
|
||||
window.localStorage.setItem("cartaAceptacion", idStatus);
|
||||
this.$router.push("/responsable/carta_aceptacion");
|
||||
window.localStorage.setItem('idServicio', idServicio)
|
||||
window.localStorage.setItem('cartaAceptacion', idStatus)
|
||||
this.$router.push('/responsable/carta_aceptacion')
|
||||
},
|
||||
getIdLocal() {
|
||||
this.idUsuario = localStorage.getItem("idUsuario");
|
||||
this.idTipoUsuario = localStorage.getItem("idTipoUsuario");
|
||||
this.tipoUsuario = localStorage.getItem("tipoUsuario");
|
||||
this.idUsuario = localStorage.getItem('idUsuario')
|
||||
this.idTipoUsuario = localStorage.getItem('idTipoUsuario')
|
||||
this.tipoUsuario = localStorage.getItem('tipoUsuario')
|
||||
|
||||
if (this.idTipoUsuario != 2 && this.tipoUsuario != "responsable") {
|
||||
localStorage.clear();
|
||||
this.$router.push("/");
|
||||
if (this.idTipoUsuario != 2 && this.tipoUsuario != 'responsable') {
|
||||
localStorage.clear()
|
||||
this.$router.push('/')
|
||||
}
|
||||
},
|
||||
error(msj) {
|
||||
let salir = false;
|
||||
let salir = false
|
||||
switch (msj) {
|
||||
case "invalid signature":
|
||||
msj = "Tu token no es valido, inicia sesión de nuevo.";
|
||||
salir = true;
|
||||
break;
|
||||
case "jwt expired":
|
||||
msj = "Tu sesión ha expirado, inicia sesión de nuevo.";
|
||||
salir = true;
|
||||
break;
|
||||
case "jwt malformed":
|
||||
msj = "No se encontro tu token, inicia sesión de nuevo.";
|
||||
salir = true;
|
||||
break;
|
||||
case "No hay token":
|
||||
msj = "Ocurrio un error al enviar tu token, inicia sesión de nuevo.";
|
||||
salir = true;
|
||||
break;
|
||||
case 'invalid signature':
|
||||
msj = 'Tu token no es valido, inicia sesión de nuevo.'
|
||||
salir = true
|
||||
break
|
||||
case 'jwt expired':
|
||||
msj = 'Tu sesión ha expirado, inicia sesión de nuevo.'
|
||||
salir = true
|
||||
break
|
||||
case 'jwt malformed':
|
||||
msj = 'No se encontro tu token, inicia sesión de nuevo.'
|
||||
salir = true
|
||||
break
|
||||
case 'No hay token':
|
||||
msj = 'Ocurrio un error al enviar tu token, inicia sesión de nuevo.'
|
||||
salir = true
|
||||
break
|
||||
}
|
||||
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Error",
|
||||
title: 'Error',
|
||||
message: msj,
|
||||
type: "is-danger",
|
||||
type: 'is-danger',
|
||||
hasIcon: true,
|
||||
icon: "alert-circle",
|
||||
iconPack: "mdi",
|
||||
ariaRole: "alertdialog",
|
||||
icon: 'alert-circle',
|
||||
iconPack: 'mdi',
|
||||
ariaRole: 'alertdialog',
|
||||
ariaModal: true,
|
||||
});
|
||||
})
|
||||
if (salir == true) {
|
||||
localStorage.clear();
|
||||
this.$router.push(`/`);
|
||||
localStorage.clear()
|
||||
this.$router.push(`/`)
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getIdLocal();
|
||||
this.obtenerDatos(0);
|
||||
this.getIdLocal()
|
||||
this.obtenerDatos(0)
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user