Actualizado con filtro en # de inventario y guardado en archivo fijo
This commit is contained in:
+27
-10
@@ -16,9 +16,11 @@
|
||||
<div class="col">
|
||||
<input
|
||||
type="text"
|
||||
id="Inventario"
|
||||
v-on:keyup="extraeInventario()"
|
||||
class="form-control input-login-form shadow-none"
|
||||
placeholder="Número de inventario"
|
||||
/>
|
||||
/> <!-- https://www.tutorialesprogramacionya.com/vueya/detalleconcepto.php?punto=7&codigo=7&inicio=0 -->
|
||||
</div>
|
||||
<div class="col">
|
||||
<select
|
||||
@@ -43,7 +45,9 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="overflow-auto thov" v-for="item in respuesta">
|
||||
<tr @click="watchRow()" v-if="seleccionado == item.activoFijo || seleccionado == '0'">
|
||||
<tr @click="watchRow()"
|
||||
v-if="(seleccionado == item.activoFijo || seleccionado == '0')
|
||||
&& item.noInventario.indexOf(miNoInventario) != -1"> <!-- https://developer.mozilla.org/es/docs/Learn/JavaScript/First_steps/Useful_string_methods -->
|
||||
<td>{{ item.noInventario }}</td>
|
||||
<td>{{ item.activoFijo }}</td>
|
||||
<td>{{ item.modelo }}</td>
|
||||
@@ -76,7 +80,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody v-for="item in respuesta">
|
||||
<tr @click="watchRow()">
|
||||
<tr @click="watchRow()" v-if="seleccionado == item.tipo || seleccionado == '0'">
|
||||
<td class="text-primary">{{ item.noInventario }}</td>
|
||||
<td>{{ item.tipo }}</td>
|
||||
<td>{{ item.modelo }}</td>
|
||||
@@ -163,9 +167,10 @@ export default {
|
||||
"Descripción adicional"
|
||||
],
|
||||
respuesta: [],
|
||||
datosmios: [],
|
||||
tipo: [],
|
||||
datosmios : [],
|
||||
seleccionado: String,
|
||||
miNoInventario: String,
|
||||
}
|
||||
},
|
||||
|
||||
@@ -173,6 +178,7 @@ export default {
|
||||
this.getComputers();
|
||||
this.traetipo();
|
||||
this.seleccionado = "0";
|
||||
this.miNoInventario = "";
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -228,14 +234,21 @@ export default {
|
||||
},
|
||||
onDescarga(datos){
|
||||
console.log("Descargar");
|
||||
for (let i = 0, j = 0; i < datos.length; i++){
|
||||
if (this.seleccionado == "0" || this.seleccionado == datos[i].activoFijo){
|
||||
this.datosmios[j++] = datos[i];
|
||||
if (this.pcView){
|
||||
for (let i = 0, j = 0; i < datos.length; i++){
|
||||
if (this.seleccionado == "0" || this.seleccionado == datos[i].activoFijo){
|
||||
this.datosmios[j++] = datos[i];
|
||||
}
|
||||
}
|
||||
var miDato = MiXLSX.utils.json_to_sheet([],{ header : this.pcHeads});
|
||||
} else {
|
||||
for (let i = 0, j = 0; i < datos.length; i++){
|
||||
if (this.seleccionado == "0" || this.seleccionado == datos[i].tipo){
|
||||
this.datosmios[j++] = datos[i];
|
||||
}
|
||||
}
|
||||
var miDato = MiXLSX.utils.json_to_sheet([],{header : this.printerHeads}); // https://docs.sheetjs.com
|
||||
}
|
||||
var miDato = MiXLSX.utils.json_to_sheet(this.pcHeads,{
|
||||
header : this.pcHeads
|
||||
});
|
||||
MiXLSX.utils.sheet_add_json(miDato,this.datosmios,{
|
||||
skipHeader:true, origin : "A2"});
|
||||
const LibroTrabajo = MiXLSX.utils.book_new();
|
||||
@@ -247,6 +260,10 @@ export default {
|
||||
this.seleccionado = document.getElementById("tipo").value;
|
||||
console.log(this.seleccionado);
|
||||
},
|
||||
extraeInventario(){
|
||||
this.miNoInventario = document.getElementById("Inventario").value;
|
||||
console.log(this.miNoInventario);
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user