Para el conteo de registros presentados en Front

This commit is contained in:
2020-11-13 09:14:49 -06:00
parent 99f2de9496
commit 571f7e14cf
2 changed files with 231 additions and 109 deletions
+81 -80
View File
@@ -1786,17 +1786,6 @@
"integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==",
"dev": true
},
"ansi-styles": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"dev": true,
"optional": true,
"requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
}
},
"cacache": {
"version": "13.0.1",
"resolved": "https://registry.npmjs.org/cacache/-/cacache-13.0.1.tgz",
@@ -1823,34 +1812,6 @@
"unique-filename": "^1.1.1"
}
},
"chalk": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"find-cache-dir": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz",
@@ -1872,25 +1833,6 @@
"path-exists": "^4.0.0"
}
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
@@ -1955,16 +1897,6 @@
"minipass": "^3.1.1"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"terser-webpack-plugin": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-2.3.8.tgz",
@@ -1981,18 +1913,6 @@
"terser": "^4.6.12",
"webpack-sources": "^1.4.3"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.0.0-beta.8",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-beta.8.tgz",
"integrity": "sha512-oouKUQWWHbSihqSD7mhymGPX1OQ4hedzAHyvm8RdyHh6m3oIvoRF+NM45i/bhNOlo8jCnuJhaSUf/6oDjv978g==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
}
}
},
@@ -11411,6 +11331,87 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.0.0-beta.9",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-beta.9.tgz",
"integrity": "sha512-mu9pg6554GbXDSO8LlxkQM6qUJzUkb/A0FJc9LgRqnU9MCnhzEXwCt1Zx5NObvFpzs2mH2dH/uUCDwL8Qaz9sA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
"integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz",
"integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.4.5.tgz",
+150 -29
View File
@@ -16,7 +16,7 @@
<span v-if="pcView">Ver impresoras</span>
<span v-else>Ver computadoras</span>
</button>
<div class="mt-3">12 equipos</div>
<div class="mt-3" >Se observan {{ contador }} registros</div>
<div class="row m-0 mt-1 mb-4">
<div class="row d-flex flex-wrap">
<div class="col-md-3 col-4 my-2">
@@ -33,30 +33,45 @@
name="tipo"
id="tipo"
@change="buscaValor()"
class="form-control select-login-form shadow-none"
>
<!-- <option value="0" selected>Todos</option>
<option v-for="opcion in tipo" :value="opcion.activoFijo">{{opcion.activoFijo}}</option> -->
class="form-control select-login-form shadow-none">
<option value="Todos" selected>Tipo</option>
<option v-show="pcView" v-for="opcion in tipo" :key="opcion.idActivoFijo" :value='opcion.activoFijo'>{{opcion.activoFijo}}</option>
<option v-show="!pcView" v-for="opcion in tipoPrinters" :key="opcion.tipo" :value='opcion.tipo'>{{opcion.tipo}}</option>
</select>
</div>
<div class="col-md-3 col-4 my-2">
<select name="" id="" class="form-control select-login-form shadow-none">
<option value="Ubicación">Ubicación</option>
<select name="Ubica" id="Ubica"
@change="buscaUbica()"
class="form-control select-login-form shadow-none">
<option value="Todos" selected>Ubicación</option>
<option v-for="opcion in Ubica" :key="opcion.ubicacion" :value='opcion.ubicacion'>{{opcion.ubicacion}}</option>
</select>
</div>
<div class="col-md-3 col-4 my-2">
<select name="Uso" id="Uso"
@change="buscaUso()"
clase="form-control select-login-form shadow-none">
<option value="Todos" selected>Uso</option>
<option v-for="opcion in uso" :key="opcion.uso" :value='opcion.uso'>{{opcion.uso}}</option>
</select>
</div>
<div class="col-md-3 col-4 my-2" v-if="pcView">
<select name="" id="" class="form-control select-login-form shadow-none">
<option value="Procesador">Procesador</option>
<select name="Procesador" id="Procesador"
@change="buscaProcesador()"
class="form-control select-login-form shadow-none">
<option value="Todos" selected>Procesador</option>
<option v-for="opcion in procesa" :key="opcion.prodis" :value='opcion.prodis'>{{opcion.prodis}}</option>
</select>
</div>
<div class="col-md-3 col-4 my-2">
<select name="" id="" class="form-control select-login-form shadow-none">
<option value="Uso">Uso</option>
<div class="col-md-3 col-4 my-2" v-show="pcView">
<select name="SisOper" id="SisOper"
@change="buscaSisOper()"
clase="form-control select-login-form shadow-none">
<option value="Todos" selected>Sistema Operativo</option>
<option v-for="opcion in os" :key="opcion.osname" :value='opcion.osname'>{{opcion.osname}}</option>
</select>
</div>
</div>
@@ -77,10 +92,8 @@
<!-- <tbody class="overflow-auto thov" v-for="item in respuesta" :key="item.noInventario">
<tr @click="watchRow(item.noInventario)"
v-if="(seleccionado == item.activoFijo || seleccionado == '0') -->
<tbody class="overflow-auto thov" v-for="item in respuesta" :key="item.noInventario">
<tr @click="watchRow(item.noInventario)"
v-if="(seleccionado == item.activoFijo || seleccionado == 'Todos')
&& item.noInventario.indexOf(miNoInventario) != -1">
<tbody class="overflow-auto thov" v-for="item in datosmios" :key="item.noInventario">
<tr @click="watchRow(item.noInventario)" >
<!-- https://developer.mozilla.org/es/docs/Learn/JavaScript/First_steps/Useful_string_methods -->
<td class="text-primary">{{ item.noInventario }}</td>
<td>{{ item.activoFijo }}</td>
@@ -123,7 +136,7 @@
<!-- <tbody v-for="item in respuesta" :key="item.noInventario">
<tr @click="watchRow(item.noInventario)" v-if="seleccionado == item.tipo || seleccionado == '0'"> -->
<tbody v-for="item in respuesta" :key="item.noInventario">
<tbody v-for="item in datosmios" :key="item.noInventario">
<tr @click="watchRow(item.noInventario)"
v-if="(seleccionado == item.tipo || seleccionado == 'Todos')
&& item.noInventario.indexOf(miNoInventario) != -1">
@@ -234,9 +247,18 @@ export default {
respuesta: [],
datosmios: [],
tipo: [],
Ubica: [],
uso: [],
procesa: [],
os: [],
tipoPrinters: [],
seleccionado: String,
seleccionadoUbica: String,
seleccionadoUso: String,
seleccionadoProcesador: String,
seleccionadoOS: String,
miNoInventario: String,
contador: 10,
file: null
}
},
@@ -244,8 +266,18 @@ export default {
created() {
this.getComputers();
this.traetipo();
this.traeUbica();
this.traeUso();
this.traeProcesador();
this.traeOS();
this.seleccionado = "Todos";
this.seleccionadoUbica = "Todos";
this.seleccionadoUso = "Todos";
this.seleccionadoProcesador = "Todos";
this.seleccionadoOS = "Todos";
this.miNoInventario = "";
this.contador = 0;
this.generaMisDatos();
},
methods: {
@@ -307,6 +339,46 @@ export default {
.then(res => this.tipo = res.data.tipo)
.catch(err => console.log(err));
},
async traeUbica(){
const localToken = window.localStorage.token;
axios.get(`${ config.api }/api/ubica`, {
headers: {
token: localToken
}
})
.then(res => this.Ubica = res.data.ubica)
.catch(err => console.log(err));
},
async traeUso(){
const localToken = window.localStorage.token;
axios.get(`${ config.api }/api/uso`, {
headers: {
token: localToken
}
})
.then(res => this.uso = res.data.uso)
.catch(err => console.log(err));
},
async traeOS(){
const localToken = window.localStorage.token;
axios.get(`${ config.api }/api/sisoper`, {
headers: {
token: localToken
}
})
.then(res => this.os = res.data.sisoper)
.catch(err => console.log(err));
},
async traeProcesador(){
const localToken = window.localStorage.token;
axios.get(`${ config.api }/api/procesador`, {
headers: {
token: localToken
}
})
.then(res => this.sisoper = res.data.procesador)
.catch(err => console.log(err));
},
async traetipoImpresora(){
const localToken = window.localStorage.token;
axios.get(`${ config.api }/api/tipoPrinters`, {
@@ -323,26 +395,67 @@ export default {
// },
changeView() {
this.loading = true;
this.contador = 0;
if (this.pcView) {
this.pcView = !this.pcView;
this.getPrinters();
this.traetipoImpresora();
this.traeUso();
this.traeUbica();
this.seleccionado = "Todos";
this.seleccionadoUbica = "Todos";
this.seleccionadoUso = "Todos";
this.seleccionadoProcesador = "Todos";
this.seleccionadoOS = "Todos";
this.miNoInventario = "";
this.tipo=[' '];
this.Ubica=[' '];
this.uso=[' '];
this.procesa=[' '];
this.os=[''];
}
else{
this.pcView = !this.pcView;
this.getComputers();
this.traetipo();
this.traeUbica();
this.traeUso();
this.traeProcesador();
this.traeOS();
this.seleccionado = "Todos";
this.seleccionadoUbica = "Todos";
this.seleccionadoUso = "Todos";
this.seleccionadoProcesador = "Todos";
this.seleccionadoOS = "Todos"
this.miNoInventario = "";
}
this.generaMisDatos();
},
admin() {
return JSON.parse(window.localStorage.isAdmin);
},
generaMisDatos(){
this.datosmios = [];
if(this.pcView){
for (let i = 0, j = 0; i < this.respuesta.length; i++){
if ((this.seleccionado == "Todos" || this.seleccionado == this.respuesta[i].activoFijo)
&& (this.seleccionadoUbica == this.respuesta[i].ubicacion || this.seleccionadoUbica == 'Todos')
&& (this.seleccionadoUso == this.respuesta[i].uso || this.seleccionadoUso == 'Todos')
&& (this.seleccionadoOS == this.respuesta[i].osname || this.seleccionadoOS == 'Todos')
&& (this.seleccionadoProcesador == this.respuesta[i].procesador || this.seleccionadoProcesador == 'Todos')
&& (this.respuesta[i].noInventario.indexOf(this.miNoInventario) != -1)){
this.datosmios[j++] = this.respuesta[i];
}
}
} else {
for (let i = 0, j = 0; i < this.respuesta.length; i++){
if (this.seleccionado == "Todos" || this.seleccionado == this.respuesta[i].tipo){
this.datosmios[j++] = this.respuesta[i];
}
}
}
this.contador = this.datosmios.length;
},
onDescarga(datos){
var miDato;
const fecha = new Date();
@@ -375,19 +488,9 @@ export default {
}
nomArch += seg;
if (this.pcView){
for (let i = 0, j = 0; i < datos.length; i++){
if (this.seleccionado == "Todos" || this.seleccionado == datos[i].activoFijo){
this.datosmios[j++] = datos[i];
}
}
nomArch = "Computadoras" + nomArch;
miDato = MiXLSX.utils.json_to_sheet([],{ header : this.pcHeads});
} else {
for (let i = 0, j = 0; i < datos.length; i++){
if (this.seleccionado == "Todos" || this.seleccionado == datos[i].tipo){
this.datosmios[j++] = datos[i];
}
}
miDato = MiXLSX.utils.json_to_sheet([],{header : this.printerHeads}); // https://docs.sheetjs.com
nomArch = "Impresoras" + nomArch;
}
@@ -401,9 +504,27 @@ export default {
},
buscaValor(){
this.seleccionado = document.getElementById("tipo").value;
this.generaMisDatos();
},
buscaUbica(){
this.seleccionadoUbica = document.getElementById("Ubica").value;
this.generaMisDatos();
},
extraeInventario(){
this.miNoInventario = document.getElementById("Inventario").value;
this.generaMisDatos();
},
buscaUso(){
this.seleccionadoUso = document.getElementById("Uso").value;
this.generaMisDatos();
},
buscaProcesador(){
this.seleccionadoProcesador = document.getElementById("Procesador").value;
this.generaMisDatos();
},
buscaSisOper(){
this.seleccionadoOS = document.getElementById("SisOper").value;
this.generaMisDatos();
},
},
}