conexion tablas api
This commit is contained in:
@@ -49,6 +49,10 @@
|
||||
<option value="8">Carta Termino Rechazada</option>
|
||||
<option value="9">Informe Global Rechazado</option>
|
||||
<option value="10">Cancelado</option>
|
||||
<option value="11">Artículo 52</option>
|
||||
<option value="12">Artículo 91</option>
|
||||
<option value="13">Liberación articulo 52</option>
|
||||
<option value="14">Liberación articulo 91</option>
|
||||
</optgroup>
|
||||
</b-select>
|
||||
</b-field>
|
||||
@@ -75,7 +79,7 @@
|
||||
striped
|
||||
>
|
||||
<b-table-column field="nombre" label="Nombre" v-slot="props" centered>
|
||||
<span @click="servicios(props.row.idServicio)">{{
|
||||
<span @click="servicios(props.row.idCasoEspecial)">{{
|
||||
props.row.nombre
|
||||
}}</span>
|
||||
</b-table-column>
|
||||
@@ -87,7 +91,7 @@
|
||||
centered
|
||||
width="100"
|
||||
>
|
||||
<span @click="servicios(props.row.idServicio)">{{
|
||||
<span @click="servicios(props.row.idCasoEspecial)">{{
|
||||
props.row.numeroCuenta
|
||||
}}</span>
|
||||
</b-table-column>
|
||||
@@ -98,13 +102,13 @@
|
||||
v-slot="props"
|
||||
centered
|
||||
>
|
||||
<span @click="servicios(props.row.idServicio)">{{
|
||||
<span @click="servicios(props.row.idCasoEspecial)">{{
|
||||
props.row.carrera
|
||||
}}</span>
|
||||
</b-table-column>
|
||||
<b-table-column field="status" label="Status" v-slot="props" centered>
|
||||
<span
|
||||
@click="servicios(props.row.idServicio)"
|
||||
@click="servicios(props.row.idCasoEspecial)"
|
||||
class="tag"
|
||||
:class="types(props.row.idStatus)"
|
||||
>{{ props.row.status }}</span
|
||||
@@ -117,7 +121,7 @@
|
||||
v-slot="props"
|
||||
centered
|
||||
>
|
||||
<span @click="servicios(props.row.idServicio)">{{
|
||||
<span @click="servicios(props.row.idCasoEspecial)">{{
|
||||
fecha(props.row.diaCreado)
|
||||
}}</span>
|
||||
</b-table-column>
|
||||
@@ -137,18 +141,7 @@ export default {
|
||||
idUsuario: "",
|
||||
idTipoUsuario: "",
|
||||
tipoUsuario: "",
|
||||
data: [
|
||||
{ nombre: "Marco", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:1 , diaCreado: "01/01/2021" },
|
||||
{ nombre: "Marco", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:2 , diaCreado: "01/01/2021" },
|
||||
{ nombre: "Marco", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:3 , diaCreado: "01/01/2021" },
|
||||
{ nombre: "Marco", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:4 , diaCreado: "01/01/2021" },
|
||||
{ nombre: "Tomy", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:5 , diaCreado: "01/01/2021"},
|
||||
{ nombre: "Lemuel", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:6, diaCreado: "01/01/2021" },
|
||||
{ nombre: "Lemuel", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:7, diaCreado: "01/01/2021" },
|
||||
{ nombre: "Lemuel", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:8, diaCreado: "01/01/2021" },
|
||||
{ nombre: "Lemuel", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:9, diaCreado: "01/01/2021" },
|
||||
{ nombre: "Lemuel", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:10, diaCreado: "01/01/2021" },
|
||||
],
|
||||
data: [],
|
||||
total: "",
|
||||
isLoading: false,
|
||||
page: 1,
|
||||
@@ -184,59 +177,63 @@ export default {
|
||||
return "is-link";
|
||||
} else if (idStatus === 7 || idStatus === 8 || idStatus === 9 || idStatus === 10) {
|
||||
return "is-danger";
|
||||
} else if (idStatus === 11) {
|
||||
return "is-link is-light";
|
||||
} else if (idStatus === 12) {
|
||||
return "is-danger is-light";
|
||||
} else if (idStatus === 13 || idStatus === 14) {
|
||||
return "is-success is-light";
|
||||
}
|
||||
},
|
||||
fecha(date) {
|
||||
const fecha = moment(date.substr(0, 10));
|
||||
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`;
|
||||
},
|
||||
// obtenerDatos(idStatus) {
|
||||
// this.isLoading = true;
|
||||
// this.data = [];
|
||||
obtenerDatos(idStatus) {
|
||||
this.isLoading = true;
|
||||
this.data = [];
|
||||
|
||||
// axios
|
||||
// .get(
|
||||
// `${process.env.api}/servicio/servicios_admin?pagina=${this.page}&idStatus=${this.idStatus}&nombre=${this.nombre}&numeroCuenta=${this.numeroCuenta}`,
|
||||
// this.token
|
||||
// )
|
||||
// .then((res) => {
|
||||
// const servicios = res.data.servicios;
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/caso_especial/servicios_especiales?pagina=${this.page}&idStatus=${this.idStatus}&nombre=${this.nombre}&numeroCuenta=${this.numeroCuenta}`,
|
||||
this.token
|
||||
)
|
||||
.then((res) => {
|
||||
const servicios = res.data.servicios;
|
||||
|
||||
// if (servicios.length !== 0) {
|
||||
// for (let i = 0; i < servicios.length; i++) {
|
||||
// this.data.push({
|
||||
// nombre: servicios[i].Usuario.nombre,
|
||||
// numeroCuenta: servicios[i].Usuario.usuario,
|
||||
// carrera: servicios[i].Carrera.carrera,
|
||||
// fechaInicio: servicios[i].fechaInicio,
|
||||
// fechaFin: servicios[i].fechaFin,
|
||||
// status: servicios[i].Status.status,
|
||||
// diaCreado: servicios[i].createdAt,
|
||||
// idStatus: servicios[i].Status.idStatus,
|
||||
// idServicio: servicios[i].idServicio,
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// let currentTotal = servicios.length;
|
||||
// let contador;
|
||||
if (servicios.length !== 0) {
|
||||
for (let i = 0; i < servicios.length; i++) {
|
||||
this.data.push({
|
||||
nombre: servicios[i].Usuario.nombre,
|
||||
numeroCuenta: servicios[i].Usuario.usuario,
|
||||
carrera: servicios[i].Carrera.carrera,
|
||||
status: servicios[i].Status.status,
|
||||
diaCreado: servicios[i].createdAt,
|
||||
idStatus: servicios[i].Status.idStatus,
|
||||
idCasoEspecial: servicios[i].idCasoEspecial,
|
||||
});
|
||||
}
|
||||
}
|
||||
let currentTotal = servicios.length;
|
||||
let contador;
|
||||
|
||||
// for (let i = 0; i < res.data.registros / 25 + 1; i++) {
|
||||
// contador = i;
|
||||
// }
|
||||
// currentTotal = this.perPage * contador;
|
||||
// this.total = currentTotal;
|
||||
// })
|
||||
for (let i = 0; i < res.data.registros / 25 + 1; i++) {
|
||||
contador = i;
|
||||
}
|
||||
currentTotal = this.perPage * contador;
|
||||
this.total = currentTotal;
|
||||
})
|
||||
|
||||
// .catch((error) => {
|
||||
// this.error(error.response.data.message);
|
||||
// })
|
||||
.catch((error) => {
|
||||
this.error(error.response.data.message);
|
||||
})
|
||||
|
||||
// .finally(() => {
|
||||
// this.isLoading = false;
|
||||
// });
|
||||
// },
|
||||
servicios(idServicio) {
|
||||
// window.localStorage.setItem("idServicio", idServicio);
|
||||
.finally(() => {
|
||||
this.isLoading = false;
|
||||
});
|
||||
},
|
||||
servicios(idCasoEspecial) {
|
||||
window.localStorage.setItem("idCasoEspecial", idCasoEspecial);
|
||||
this.$router.push("/admin/especial/casoEspecial");
|
||||
},
|
||||
getIdLocal() {
|
||||
@@ -288,7 +285,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getIdLocal();
|
||||
//this.obtenerDatos(0);
|
||||
this.obtenerDatos(0);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -42,6 +42,10 @@
|
||||
<option value="7">Carta Aceptación Rechazada</option>
|
||||
<option value="8">Carta Termino Rechazada</option>
|
||||
<option value="9">Informe Global Rechazado</option>
|
||||
<option value="11">Artículo 52</option>
|
||||
<option value="12">Artículo 91</option>
|
||||
<option value="13">Liberación articulo 52</option>
|
||||
<option value="14">Liberación articulo 91</option>
|
||||
</optgroup>
|
||||
</b-select>
|
||||
</b-field>
|
||||
@@ -133,18 +137,7 @@ export default {
|
||||
idTipoUsuario: "",
|
||||
idUsuario: "",
|
||||
tipoUsuario: "",
|
||||
data: [
|
||||
{ nombre: "Marco", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:1 },
|
||||
{ nombre: "Marco", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:2 },
|
||||
{ nombre: "Marco", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:3 },
|
||||
{ nombre: "Marco", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:4 },
|
||||
{ nombre: "Tomy", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:5 },
|
||||
{ nombre: "Lemuel", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:6 },
|
||||
{ nombre: "Lemuel", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:7 },
|
||||
{ nombre: "Lemuel", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:8 },
|
||||
{ nombre: "Lemuel", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:9 },
|
||||
{ nombre: "Lemuel", numeroCuenta: "316019251", carrera: "Matemáticas Aplicadas y Computación", status: "status", idStatus:1 },
|
||||
],
|
||||
data: [],
|
||||
total: "",
|
||||
isLoading: false,
|
||||
page: 1,
|
||||
@@ -180,55 +173,55 @@ export default {
|
||||
return "is-link";
|
||||
} else if (idStatus === 7 || idStatus === 8 || idStatus === 9) {
|
||||
return "is-danger";
|
||||
} else if (idStatus === 11) {
|
||||
return "is-link is-light";
|
||||
} else if (idStatus === 12) {
|
||||
return "is-danger is-light";
|
||||
} else if (idStatus === 13 || idStatus === 14) {
|
||||
return "is-success is-light";
|
||||
}
|
||||
},
|
||||
fecha(date) {
|
||||
const fecha = moment(date.substr(0, 10));
|
||||
return `${fecha.date()}/${fecha.month() + 1}/${fecha.year()}`;
|
||||
},
|
||||
// obtenerDatos(idStatus) {
|
||||
// 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;
|
||||
obtenerDatos(idStatus) {
|
||||
this.isLoading = true;
|
||||
this.data = [];
|
||||
axios
|
||||
.get(
|
||||
`${process.env.api}/caso_especial/servicios_especiales?pagina=${this.page}&idStatus=${this.idStatus}&nombre=${this.nombre}&numeroCuenta=${this.numeroCuenta}`,
|
||||
this.token
|
||||
)
|
||||
.then((res) => {
|
||||
const servicios = res.data.servicios;
|
||||
if (servicios.length !== 0) {
|
||||
for (let i = 0; i < servicios.length; i++) {
|
||||
this.data.push({
|
||||
nombre: servicios[i].Usuario.nombre,
|
||||
numeroCuenta: servicios[i].Usuario.usuario,
|
||||
carrera: servicios[i].Carrera.carrera,
|
||||
status: servicios[i].Status.status,
|
||||
idStatus: servicios[i].Status.idStatus,
|
||||
});
|
||||
}
|
||||
}
|
||||
let currentTotal = servicios.length;
|
||||
let contador;
|
||||
|
||||
// if (servicios.length !== 0) {
|
||||
// for (let i = 0; i < servicios.length; i++) {
|
||||
// this.data.push({
|
||||
// nombre: servicios[i].Usuario.nombre,
|
||||
// numeroCuenta: servicios[i].Usuario.usuario,
|
||||
// carrera: servicios[i].Carrera.carrera,
|
||||
// fechaInicio: servicios[i].fechaInicio,
|
||||
// fechaFin: servicios[i].fechaFin,
|
||||
// status: servicios[i].Status.status,
|
||||
// idStatus: servicios[i].Status.idStatus,
|
||||
// cuestionario: servicios[i].idCuestionarioPrograma,
|
||||
// cartaTermino: servicios[i].cartaTermino,
|
||||
// idServicio: servicios[i].idServicio,
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// let currentTotal = servicios.length;
|
||||
// let contador;
|
||||
|
||||
// for (let i = 0; i < res.data.registros / 25 + 1; i++) {
|
||||
// contador = i;
|
||||
// }
|
||||
// currentTotal = this.perPage * contador;
|
||||
// this.total = currentTotal;
|
||||
// })
|
||||
// .catch((error) => {
|
||||
// this.error(error.response.data.message);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// this.isLoading = false;
|
||||
// });
|
||||
// },
|
||||
for (let i = 0; i < res.data.registros / 25 + 1; i++) {
|
||||
contador = i;
|
||||
}
|
||||
currentTotal = this.perPage * contador;
|
||||
this.total = currentTotal;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.error(error.response.data.message);
|
||||
})
|
||||
.finally(() => {
|
||||
this.isLoading = false;
|
||||
});
|
||||
},
|
||||
getIdLocal() {
|
||||
this.idUsuario = 1//localStorage.getItem("idUsuario");
|
||||
this.idTipoUsuario = 2//localStorage.getItem("idTipoUsuario");
|
||||
@@ -277,7 +270,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getIdLocal();
|
||||
// this.obtenerDatos(0);
|
||||
this.obtenerDatos(0);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user