creacion de la descarga del excel

This commit is contained in:
2021-02-03 20:55:45 -06:00
parent c63ecf3064
commit 5105553dea
17 changed files with 12455 additions and 12226 deletions
+1
View File
File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
.boton-footer[data-v-02dfa168]{background-color:#b80;color:#fff;width:14rem;font-size:.8rem}.dos[data-v-02dfa168],.tres[data-v-02dfa168],.uno[data-v-02dfa168]{margin-right:1rem}.btn[data-v-02dfa168]{margin-bottom:1rem}.Azul-puma[data-v-02dfa168]{background-color:#1e3c70}.footer[data-v-02dfa168]{text-align:center;color:#fff}@media (max-width:768px){.tres[data-v-02dfa168],.uno[data-v-02dfa168]{margin-right:4rem}.dos[data-v-02dfa168]{margin-right:0}.footer[data-v-02dfa168]{font-size:.7rem}}@media (max-width:970px){.dos[data-v-02dfa168],.tres[data-v-02dfa168],.uno[data-v-02dfa168]{margin-right:.5rem}.footer[data-v-02dfa168]{font-size:.7rem}}[data-v-30e9b756]{margin:0;padding:0}.divMaster[data-v-30e9b756]{height:auto;margin:0 auto}nav[data-v-30e9b756]{padding:0}.azulUnam[data-v-30e9b756]{background-color:#1e3c70}.doradoUnam[data-v-30e9b756],.dropdown-item[data-v-30e9b756]:hover{background-color:#b80}.dropdown-itemBusqueda[data-v-30e9b756]:hover{background-color:#1e3c70;color:#fff}.nav-link[data-v-30e9b756]:focus{background-color:#1e3c70;border-radius:1rem}.nav-link[data-v-30e9b756]:hover{background-color:#1e3c70;color:#fff;border-radius:.2rem}.nav-link[data-v-30e9b756]{transition:.3s;font-size:20px}.dropdown-item[data-v-30e9b756]{padding:.3rem 1rem}.dropdown[data-v-30e9b756]{position:relative;display:inline-block;height:auto}.dropdown-content[data-v-30e9b756]{position:absolute;background-color:#f9f9f9;min-width:160px;box-shadow:0 8px 16px 0 rgba(0,0,0,.2);top:.8rem;left:-10rem;display:block}.navbar-dark[data-v-30e9b756],.navbar-toggler[data-v-30e9b756]{font-size:1rem;border:none}@media (max-width:450px){.buscador[data-v-30e9b756],.menuText[data-v-30e9b756]{display:block!important}.dropdown-menu[data-v-30e9b756]{width:80vw!important}}.divMaster{height:8rem;margin:0;width:auto}.azulUnam{background-color:#1e3c70}.sizeImg{height:5rem}.logo_acatlan_resp{display:none!important}@media (max-width:450px){.logo_acatlan,.logo_unam{display:none!important}.logo_acatlan_resp{display:block!important}.logo_acatlan_resp a img{height:5rem}}#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-align:center;color:#2c3e50}a[data-v-4dca8156]{font-size:14px;margin-bottom:6px;font-weight:400}.tableFixHead[data-v-4dca8156]{overflow-y:auto;height:100px}.tableFixHead thead th[data-v-4dca8156]{position:-webkit-sticky;position:sticky;top:0}table[data-v-4dca8156]{border-collapse:collapse;width:100%}td[data-v-4dca8156],th[data-v-4dca8156]{padding:8px 16px}th[data-v-4dca8156]{background:#eee}.button[data-v-6e1c8750]{background-color:#1b3d70;border:none;color:#fff;height:4rem;width:15rem;text-align:center;text-decoration:none;display:inline-block;font-size:1.5rem;border-radius:1rem;transition-duration:.4s;box-shadow:0 8px 16px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19);margin-left:2rem;margin-right:2rem;margin-bottom:2rem;margin-top:2rem}.button[data-v-6e1c8750]:hover{background-color:#b80;color:#fff}.button[data-v-4f1ed9c0]{background-color:#1b3d70;border:none;color:#fff;height:4rem;width:15rem;text-align:center;text-decoration:none;display:inline-block;font-size:1.5rem;border-radius:1rem;transition-duration:.4s;box-shadow:0 8px 16px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19);margin-left:2rem;margin-right:2rem;margin-bottom:2rem;margin-top:2rem}.button[data-v-4f1ed9c0]:hover{background-color:#b80;color:#fff}.button[data-v-db2fbf3a]{background-color:#1b3d70;border:none;color:#fff;height:4rem;width:15rem;text-align:center;text-decoration:none;display:inline-block;font-size:1.5rem;border-radius:1rem;transition-duration:.4s;box-shadow:0 8px 16px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19);margin-left:2rem;margin-right:2rem;margin-bottom:2rem;margin-top:2rem}.button[data-v-db2fbf3a]:hover{background-color:#b80;color:#fff}.button[data-v-2aaeffa6]{background-color:#1b3d70;border:none;color:#fff;height:2.5rem;width:14rem;text-align:center;text-decoration:none;display:inline-block;font-size:1rem;border-radius:.3rem;transition-duration:.4s;box-shadow:0 8px 16px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19);margin-top:.3rem}.button[data-v-2aaeffa6]:hover{background-color:#b80;color:#fff}
+1 -1
View File
@@ -1 +1 @@
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>censo_front</title><link href="css/app.c66205fb.css" rel="preload" as="style"><link href="css/chunk-vendors.9e1d7bb4.css" rel="preload" as="style"><link href="js/app.38c6f27e.js" rel="preload" as="script"><link href="js/chunk-vendors.7c846a9f.js" rel="preload" as="script"><link href="css/chunk-vendors.9e1d7bb4.css" rel="stylesheet"><link href="css/app.c66205fb.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but censo_front doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.7c846a9f.js"></script><script src="js/app.38c6f27e.js"></script></body></html>
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>censo_front</title><link href="css/app.531bacc5.css" rel="preload" as="style"><link href="css/chunk-vendors.9e1d7bb4.css" rel="preload" as="style"><link href="js/app.0d5f6afd.js" rel="preload" as="script"><link href="js/chunk-vendors.5bfa42cc.js" rel="preload" as="script"><link href="css/chunk-vendors.9e1d7bb4.css" rel="stylesheet"><link href="css/app.531bacc5.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but censo_front doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.5bfa42cc.js"></script><script src="js/app.0d5f6afd.js"></script></body></html>
+2
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
-2
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+12050 -12050
View File
File diff suppressed because it is too large Load Diff
+97 -72
View File
@@ -19,19 +19,21 @@
<label style=" padding-top:1rem;">Actualizar: </label>
</b-col>
<b-col sm="9">
<div v-if="opciones.length!=0">
<b-dropdown
split
block
split-variant="outline-primary"
variant="primary"
v-bind:text="opcionSeleted != '' ? opcionSeleted.nombre : campo"
class="m-2"
style="margin: 0"
>
<b-dropdown-item v-for="(opcion,index) in opciones" v-bind:key="index" @click="opcionSeleted=opcion">{{opcion.nombre}}</b-dropdown-item>
</b-dropdown>
<div class="dropdown-container" v-if="opciones.length!=0">
<div class="dropdown">
<button class="btn dropdown-toggle btn btn-outline-primary dropdown-toggle btn-block short" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{opcionSeleted != '' ? opcionSeleted.text : campo}}
</button>
<div class="dropdown-menu " aria-labelledby="dropdownMenuButton">
<div class="containerDrop" v-for="(opcion,index) in opciones" v-bind:key="index" @click="opcionSeleted=opcion">
<a class="dropdown-item"><p> {{opcion.text}}</p></a>
</div>
</div>
</div>
</div>
<b-form-input v-else v-model="campoValue" class="m-2" placeholder="Actualizar campo" style="margin: 0"></b-form-input>
</b-col>
</b-row>
@@ -46,7 +48,36 @@
</b-container>
</b-modal>
</template>
<style scoped>
.dropdown-item,.short{
width: 100%;
overflow: hidden;
white-space: pre;
text-overflow: ellipsis;
-webkit-appearance: none;
word-wrap: break-word;
text-overflow: inherit;
white-space: normal;
}
.dropdown {
position: relative ;
display: inline-block;
height: auto;
width: 100% !important;
}
.dropdown-menu{
max-height: 20rem;
width: 100%;
overflow-y: scroll;
}
</style>
<script>
import Swal from 'sweetalert2';
import axios from "axios";
import config from "../config/config.js";
@@ -66,6 +97,7 @@ export default {
}
},
methods:{
cambiar(){
this.opcionSeleted = '';
this.campoValue = '';
@@ -73,60 +105,56 @@ export default {
},
async actualizarCampo(){
try{
if(this.opcionSeleted === "" && this.campoValue === ""){
await Swal.fire(
'¿Aún no has llenado el campo a editar?',
'',
'question'
);
return;
}
let data = {};
let valueCampo = '';
if(this.opciones.length!=0){
valueCampo = this.opcionSeleted.id;
}
else{
valueCampo = this.campoValue;
}
data ={
keyTable : this.pcSelected.keyTable,
idEquipo : this.objectPc.idEquipo,
idInventario: this.objectPc.idInventario,
value: valueCampo,
equipo: false
}
if( this.pcSelected.keyTable !== 'noInventario' && this.pcSelected.keyTable !== 'noResguardo' && this.pcSelected.keyTable !== 'idUnidadResponsable'){
data.equipo = true;
}
try{
await axios.post( `${config.api}/editarCampoEquipo`, data );
await Swal.fire(
'Se actualizo con exito el campo',
'',
'success'
);
location.reload();
return;
}
catch(error){
console.log(error);
await Swal.fire(
'No se pudo actualizar el campo',
`Error en consola ${error}`,
'error'
);
return;
}
}
catch(error){
console.log(error);
}
}
if(this.opcionSeleted === "" && this.campoValue === ""){
await Swal.fire(
'¿Aún no has llenado el campo a editar?',
'',
'question'
);
return;
}
let data = {};
let valueCampo = '';
if(this.opciones.length!=0){
valueCampo = this.opcionSeleted.id;
}
else{
valueCampo = this.campoValue;
}
data ={
keyTable : this.pcSelected.keyTable,
idEquipo : this.objectPc.idEquipo,
idInventario: this.objectPc.idInventario,
value: valueCampo,
equipo: false
}
if( this.pcSelected.keyTable !== 'noInventario' && this.pcSelected.keyTable !== 'noResguardo' && this.pcSelected.keyTable !== 'idUnidadResponsable'){
data.equipo = true;
}
try{
await axios.post( `${config.api}/editarCampoEquipo`, data );
await Swal.fire(
'Se actualizo con exito el campo',
'',
'success'
);
location.reload();
return;
}
catch(error){
console.log(error);
await Swal.fire(
'No se pudo actualizar el campo',
`Error en consola ${error}`,
'error'
);
return;
}
}
catch(error){
console.log(error);
}
}
},
computed:{
selectPC : function(){
@@ -136,10 +164,7 @@ export default {
return this.campo;
}
}
},
}
</script>
</script>
+199 -55
View File
@@ -1,52 +1,93 @@
<template>
<div class="row">
<div class="col-12">
<h3 style="text-align: right; margin-bottom: 1rem;">Totales: {{pcTablesFiltrada.length}} </h3>
<div class="table-responsive" style="height : 35rem">
<table class="table tableFixHead" >
<thead>
<tr>
<th >
<div class="flex-container">
<button style="align-self: center" class="btn nav-link " type="button" aria-haspopup="true" aria-expanded="false">
Eliminar
</button>
</div>
</th>
<th v-for="(item,indexHeader) in pcHeaders" v-bind:key="indexHeader" scope="col" >
<div class="flex-container">
<div >
<button style="align-self: center" v-if="item.data.length != 0" class="btn nav-link dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{item.nombre}}
<div>
<div class="row">
<div class="col-12">
<h3 style="text-align: right; margin-bottom: 1rem;">Totales: {{pcTablesFiltrada.length}} </h3>
<div class="table-responsive" style="height : 35rem">
<table class="table tableFixHead" >
<thead>
<tr>
<th >
<div class="flex-container">
<button style="align-self: center" class="btn nav-link " type="button" aria-haspopup="true" aria-expanded="false">
Eliminar
</button>
<button style="align-self: center; width: 14rem;" v-else class="btn nav-link " type="button" aria-haspopup="true" aria-expanded="false">
{{item.nombre}}
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton" style="padding:10px;">
<b-dropdown-form >
<div class="checkBox" v-for="(type,index) in item.data" v-bind:key="index" ><b-form-checkbox @change="filtrar(indexHeader, type.nombre)" v-model="type.value" ><a>{{type.nombre}}</a></b-form-checkbox></div>
</b-dropdown-form>
</div>
</div>
</div>
</th>
</tr>
</thead>
<tbody>
<tr v-for="(pc,index) in pcTablesFiltrada" v-bind:key="index">
<td>
<b-button variant="outline-danger" @click="eliminar(pc.objectPc)">Eliminar</b-button>
</td>
<td v-for="(pcCampo,key) in pc.datos" v-bind:key="key" v-b-modal.actualizarCampo @click="pcSelected=pc.objectPc ,valueCampo=pcCampo , campo = pcHeaders[key].nombre, opciones = pcHeaders[key].data" >
{{pcCampo.value}}
</td>
</tr>
</tbody>
</table>
</th>
<th v-for="(item,indexHeader) in pcHeaders" v-bind:key="indexHeader" scope="col" >
<div class="flex-container">
<div >
<div v-if="item.data.length != 0">
<div>
<div class="dropdown">
<button role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="align-self: center" class="btn nav-link dropdown-toggle" @click="llenarFiltro( indexHeader)">
{{item.nombre}}
</button>
<div class="dropdown-menu" aria-labelledby="navbarDropdown" >
<form style="padding: 10px">
<div class="form-check" >
<input type="checkbox" :checked="seleccionado(indexHeader)" @click="seleccionarDatos(item,indexHeader)" class="form-check-input" :id="item.nombre">
<label class="form-check-label" :for="item.nombre">Seleccionar todos</label>
</div>
<b-form-checkbox-group
:id="item.nombre"
v-model="selected"
:options="item.data"
:name="item.nombre"
stacked
></b-form-checkbox-group>
</form>
<div class="dropdown-divider"></div>
<div class="text-center">
<b-button center @click="filtrar(indexHeader)">Filtrar</b-button>
</div>
</div>
</div>
</div>
</div>
<button style="align-self: center; width: 14rem;" v-else class="btn nav-link " type="button" aria-haspopup="true" aria-expanded="false">
{{item.nombre}}
</button>
</div>
</div>
</th>
</tr>
</thead>
<tbody>
<tr v-for="(pc,index) in pcTablesFiltrada" v-bind:key="index">
<td>
<b-button variant="outline-danger" @click="eliminar(pc.objectPc)">Eliminar</b-button>
</td>
<td v-for="(pcCampo,key) in pc.datos" v-bind:key="key" v-b-modal.actualizarCampo @click="pcSelected=pc.objectPc ,valueCampo=pcCampo , campo = pcHeaders[key].nombre, opciones = pcHeaders[key].data" >
{{pcCampo.value}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<Modal v-bind:campo="campo" v-bind:pcSelected="valueCampo" v-bind:opciones="opciones" v-bind:objectPc="pcSelected" />
</div>
<div class="row" style="margin-bottom: 3rem;" >
<div class="col-12">
<div class="pure-u-1 pure-u-md-1-2">
<b-button v-if="!loadExcel" class="button" @click="descargarExcel()"><a>Descargar</a></b-button>
<!-- <button class="button" @click="descargarExcel()" >
Descargar Excel
</button> -->
<div v-else class=" mb-3" style="margin-top: 3rem; ">
<b-spinner variant="primary" style="width: 5rem; height: 5rem;" label="Caragndo..."></b-spinner><br/>
<strong >Cargando...</strong>
</div>
</div>
</div>
</div>
<Modal v-bind:campo="campo" v-bind:pcSelected="valueCampo" v-bind:opciones="opciones" v-bind:objectPc="pcSelected" />
</div>
</template>
@@ -72,10 +113,74 @@ export default {
tableName: "",
opciones: [],
pcSelected: null,
opcionSeletedTable: {value: ''}
opcionSeletedTable: {value: ''},
selected: [],
link: null,
loadExcel: false,
}
},
methods: {
async descargarExcel(){
this.loadExcel = true;
const data = {
pcHeaders: this.pcHeaders,
table: this.pcTablesFiltrada
}
await axios.post( `${config.api}/createExcel`, data).then(async()=>{
this.loadExcel = false;
await Swal.fire(
'Se ha creado con exito el archvio',
'',
'success'
).then(()=>{
window.location.href = `${config.api}/getExcel`;
});
}).catch(error=>{
console.log(error);
Swal.fire({
icon: 'error',
title: 'Sucedio un error al crear el excel',
text: `${error}`,
});
});
},
async llenarFiltro(key){
for(let index in this.pcData){
let pc = this.pcData[index];
if(pc.headers[key] && !(this.selected.indexOf(pc.datos[key].value) > -1)){
this.selected.push(pc.datos[key].value);
}
}
},
seleccionado(key){
for(let index in this.pcData){
let pc = this.pcData[index];
if(!pc.headers[key] ){
return false;
}
}
return true;
},
async seleccionarDatos(datos,key){
if(this.seleccionado(key)){
this.selected = [];
}
else{
this.selected = [];
for(let index in datos.data){
this.selected.push(datos.data[index].value);
}
}
},
async filtrar(key){
for(let index in this.pcData){
let pc = this.pcData[index];
pc.headers[key] = (this.selected.indexOf(pc.datos[key].value) > -1);
}
},
async eliminar(pcData){
const swalWithBootstrapButtons = Swal.mixin({
customClass: {
@@ -119,13 +224,6 @@ export default {
}
})
},
async filtrar(key, dato){
for(let index in this.pcData){
let pc = this.pcData[index];
if(typeof pc.headers[key] !== 'undefined' && typeof pc.datos[key] !== 'undefined' && pc.datos[key].value === dato)
pc.headers[key] = !pc.headers[key];
}
},
},
async created() {
try {
@@ -171,15 +269,61 @@ export default {
};
</script>
<style scoped>
.button {
background-color: #1b3d70; /* Green */
border: none;
color: white;
height: 4rem;
width: 15rem;
text-align: center;
text-decoration: none;
display: inline-block;
border-radius: 1rem;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
margin-left: 2rem;
margin-right: 2rem;
margin-bottom: 2rem;
margin-top: 2rem;
}
.button:hover {
background-color: #bb8800;
color: white;
}
a{
font-size: 14px;
margin-bottom: 6px;
font-weight: normal;
font-size: 1.7rem;
padding-top: .6rem;
}
.tableFixHead { overflow-y: auto; height: 100px; }
.tableFixHead thead th { position: sticky; top: 0; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 8px 16px; }
th { background:#eee; }
.colorGris{
background:#eee;
}
.dropdown-item,.short{
width: 100%;
overflow: hidden;
white-space: pre;
text-overflow: ellipsis;
-webkit-appearance: none;
word-wrap: break-word;
text-overflow: inherit;
white-space: normal;
}
.dropdown {
position: relative ;
display: inline-block;
height: auto;
width: 100% !important;
}
.dropdown-menu{
max-height: 25rem;
width: 20rem;
overflow-y: scroll;
}
</style>
+3 -8
View File
@@ -9,10 +9,10 @@
<b-nav-item @click="valueText='', textSelected= 'Marca de Impresora'" v-bind:active="textSelected=='Marca de Impresora'">Marca de Impresora</b-nav-item>
<b-nav-item @click="valueText='', textSelected= 'Tipo de Uso'" v-bind:active="textSelected== 'Tipo de Uso'">Tipo de Uso </b-nav-item>
<b-nav-item @click="valueText='', textSelected= 'Procesador'" v-bind:active="textSelected== 'Procesador'">Procesador</b-nav-item>
<b-nav-item @click="valueText='', textSelected= 'Marca '" v-bind:active="textSelected== 'Sistema Operativo'">Sistema Operativo</b-nav-item>
<b-nav-item @click="valueText='', textSelected= 'Sistema Operativo'" v-bind:active="textSelected== 'Sistema Operativo'">Sistema Operativo</b-nav-item>
<b-nav-item @click="valueText='', textSelected= 'Tarjeta Grafica'" v-bind:active="textSelected== 'Tarjeta Grafica'">Tarjeta Grafica</b-nav-item>
<b-nav-item @click="valueText='', textSelected= 'Tipo de memoride Equipo'" v-bind:active="textSelected== 'Marca de Equipo'">Marca de Equipo</b-nav-item>
<b-nav-item @click="valueText='', textSelected= 'Sistema Operativoa Ram'" v-bind:active="textSelected== 'Tipo de memoria Ram'">Tipo de memoria Ram</b-nav-item>
<b-nav-item @click="valueText='', textSelected= 'Marca de Equipo'" v-bind:active="textSelected== 'Marca de Equipo'">Marca de Equipo</b-nav-item>
<b-nav-item @click="valueText='', textSelected= 'Tipo de memoria Ram'" v-bind:active="textSelected== 'Tipo de memoria Ram'">Tipo de memoria Ram</b-nav-item>
<b-nav-item @click="valueText='', textSelected= 'Tipo de Equipo de Computo'" v-bind:active="textSelected== 'Tipo de Equipo de Computo'">Tipo de Equipo de Computo</b-nav-item>
<b-nav-item @click="valueText='', textSelected= 'Unidad Responsable'" v-bind:active="textSelected== 'Unidad Responsable'">Unidad Responsable</b-nav-item>
</b-nav>
@@ -38,9 +38,6 @@
<div class="col-md-12" >
<b-form-input style="margin: .5rem;" class="fadeIn second" placeholder="Nombre del Responsable" v-model="nombreResponsable"></b-form-input>
</div>
<div class="col-md-12" >
<b-form-input style="margin: .5rem;" class="fadeIn second" placeholder="Ubicación fisica" v-model="ubicacion"></b-form-input>
</div>
<div class="col-md-12" >
<div class="pure-u-1 pure-u-md-1-2">
<button class="button " @click="agregar()" >
@@ -70,7 +67,6 @@ export default {
valueText: '',
unidadResponsable: '',
nombreResponsable: '',
ubicacion: ''
}
},
methods: {
@@ -99,7 +95,6 @@ export default {
valueText : this.valueText,
unidadResponsable : this.unidadResponsable,
nombreResponsable : this.nombreResponsable,
ubicacion : this.ubicacion,
textSelected : this.textSelected
}
+93 -27
View File
@@ -27,25 +27,46 @@
<div class="col-md-4" >
<b-form-input style="margin: .5rem;" placeholder="Velocidad de memoria Ram" v-model="velocidadMemoriaRam"></b-form-input>
</div>
<div class="col-md-4" >
<b-dropdown v-bind:text="tipoMemoriaRamSelected != null ? tipoMemoriaRamSelected.nombre : 'Tipo de Memoria Ram'" block variant="outline-primary" class="m-2">
<b-dropdown-item v-for="tipo in tipoMemoriaRam" v-bind:key="tipo.id" @click="tipoMemoriaRamSelected = tipo">{{tipo.nombre}}</b-dropdown-item>
</b-dropdown>
<div class="col-md-4">
<div class="dropdown">
<button class="btn dropdown-toggle btn btn-outline-primary dropdown-toggle btn-block short" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{tipoMemoriaRamSelected != null ? tipoMemoriaRamSelected.nombre : 'Tipo de Memoria Ram'}}
</button>
<div class="dropdown-menu " aria-labelledby="dropdownMenuButton">
<div class="containerDrop" v-for="tipo in tipoMemoriaRam" v-bind:key="tipo.id" @click="tipoMemoriaRamSelected = tipo">
<a class="dropdown-item"><p>{{tipo.nombre}}</p></a>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4" >
<b-dropdown v-bind:text="tarjetaGraficaSelected != null ? tarjetaGraficaSelected.nombre : 'Tipo de tarjeta grafica'" block variant="outline-primary" class="m-2">
<b-dropdown-item v-for="tipo in tarjetaGrafica" v-bind:key="tipo.id" @click="tarjetaGraficaSelected = tipo">{{tipo.nombre}}</b-dropdown-item>
</b-dropdown>
<div class="dropdown">
<button class="btn dropdown-toggle btn btn-outline-primary dropdown-toggle btn-block short" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{tarjetaGraficaSelected != null ? tarjetaGraficaSelected.nombre : 'Tipo de tarjeta grafica'}}
</button>
<div class="dropdown-menu " aria-labelledby="dropdownMenuButton">
<div class="containerDrop" v-for="tipo in tarjetaGrafica" v-bind:key="tipo.id" @click="tarjetaGraficaSelected = tipo">
<a class="dropdown-item"><p>{{tipo.nombre}}</p></a>
</div>
</div>
</div>
</div>
<div class="col-md-4" >
<b-form-input style="margin: .5rem;" placeholder="Canridad de memoria de la tarjeta grafica" v-model="cantidadMemoriaGrafica"></b-form-input>
<b-form-input style="margin: .5rem;" placeholder="Cantidad de memoria de la tarjeta grafica" v-model="cantidadMemoriaGrafica"></b-form-input>
</div>
<div class="col-md-4" >
<b-dropdown v-bind:text="tipoEquipoSelected != null ? tipoEquipoSelected.nombre : 'Tipo de Equipo'" block variant="outline-primary" class="m-2">
<b-dropdown-item v-for="tipo in tipoEquipo" v-bind:key="tipo.id" @click="tipoEquipoSelected = tipo">{{tipo.nombre}}</b-dropdown-item>
</b-dropdown>
<div class="dropdown">
<button class="btn dropdown-toggle btn btn-outline-primary dropdown-toggle btn-block short" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{tipoEquipoSelected != null ? tipoEquipoSelected.nombre : 'Tipo de Equipo'}}
</button>
<div class="dropdown-menu " aria-labelledby="dropdownMenuButton">
<div class="containerDrop" v-for="tipo in tipoEquipo" v-bind:key="tipo.id" @click="tipoEquipoSelected = tipo">
<a class="dropdown-item"><p>{{tipo.nombre}}</p></a>
</div>
</div>
</div>
</div>
</div>
<div class="row">
@@ -58,9 +79,16 @@
<b-form-input style="margin: .5rem;" placeholder="Versión del sistema operativo" v-model="versionOS"></b-form-input>
</div>
<div class="col-md-4" >
<b-dropdown v-bind:text="procesadorSelected != null ? procesadorSelected.nombre : 'Procesador'" block variant="outline-primary" class="m-2">
<b-dropdown-item v-for="tipo in procesador" v-bind:key="tipo.id" @click="procesadorSelected = tipo">{{tipo.nombre}}</b-dropdown-item>
</b-dropdown>
<div class="dropdown">
<button class="btn dropdown-toggle btn btn-outline-primary dropdown-toggle btn-block short" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{procesadorSelected != null ? procesadorSelected.nombre : 'Procesador'}}
</button>
<div class="dropdown-menu " aria-labelledby="dropdownMenuButton">
<div class="containerDrop" v-for="tipo in procesador" v-bind:key="tipo.id" @click="procesadorSelected = tipo">
<a class="dropdown-item"><p>{{tipo.nombre}}</p></a>
</div>
</div>
</div>
</div>
</div>
<div class="row">
@@ -88,20 +116,32 @@
</div>
<div class="row">
<div class="col-md-12" >
<b-dropdown v-bind:text="unidadSelected != null ? unidadSelected.unidadResponsable.nombre : 'Unidad Responsable'" block variant="outline-primary" class="m-2">
<b-dropdown-item v-for="tipo in unidad" v-bind:key="tipo.unidadResponsable.id" @click="unidadSelected = tipo">{{tipo.unidadResponsable.nombre}}</b-dropdown-item>
</b-dropdown>
<div class="col-md-12" style="margin: .5rem;" >
<div class="dropdown">
<button class="btn dropdown-toggle btn btn-outline-primary dropdown-toggle btn-block short" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{unidadSelected != null ? unidadSelected.unidadResponsable.nombre : 'Unidad Responsable'}}
</button>
<div class="dropdown-menu " aria-labelledby="dropdownMenuButton">
<div class="containerDrop" v-for="tipo in unidad" v-bind:key="tipo.unidadResponsable.id" @click="unidadSelected = tipo">
<a class="dropdown-item"><p>{{tipo.unidadResponsable.nombre}}</p></a>
</div>
</div>
</div>
</div>
<div class="col-md-12 " >
<b-dropdown v-bind:text="unidadSelected != null ? unidadSelected.responsable.nombre : 'Nombre del responsable'" block variant="outline-primary" class="m-2">
<b-dropdown-item v-for="tipo in unidad" v-bind:key="tipo.responsable.id" @click="unidadSelected = tipo">{{tipo.responsable.nombre}}</b-dropdown-item>
</b-dropdown>
<div class="col-md-12 " style="margin: .5rem;">
<div class="dropdown">
<button class="btn dropdown-toggle btn btn-outline-primary dropdown-toggle btn-block short" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{unidadSelected != null ? unidadSelected.responsable.nombre : 'Nombre del responsable' }}
</button>
<div class="dropdown-menu " aria-labelledby="dropdownMenuButton">
<div class="containerDrop" v-for="(tipo,index) in unidad" v-bind:key="index" @click="unidadSelected = tipo">
<a class="dropdown-item"><p>{{tipo.responsable.nombre}}</p></a>
</div>
</div>
</div>
</div>
<div class="col-md-12 " >
<b-dropdown v-bind:text="unidadSelected != null ? unidadSelected.ubicacion.nombre : 'Ubicación'" block variant="outline-primary" class="m-2">
<b-dropdown-item v-for="tipo in unidad" v-bind:key="tipo.ubicacion.id" @click="unidadSelected = tipo">{{tipo.ubicacion.nombre}}</b-dropdown-item>
</b-dropdown>
<div class="col-md-12 " >
<b-form-input style="margin: .5rem;" placeholder="Ubicación de la Unidad Responsable" v-model="ubicacionUnidad"></b-form-input>
</div>
</div>
<div class="pure-u-1 pure-u-md-1-2">
@@ -152,7 +192,8 @@ export default {
unidad: null,
unidadSelected: null,
uso: null,
usoSelected : null
usoSelected : null,
ubicacionUnidad: ""
}
},
methods: {
@@ -177,6 +218,7 @@ export default {
if(this.velocidadProcesadorGHz === "") return this.faltaCampo("Velocidad de procesador");
if(this.descripcionProcesador === "") return this.faltaCampo("Descripción del procesador");
if(this.modeloEquipo === "") return this.faltaCampo("Modelo del equipo");
if(this.ubicacionUnidad === "") return this.faltaCampo("Ubicación de la Unidad responsable");
if(this.tipoEquipoSelected === null) return this.faltaCampo("El tipo de equipo");
if(this.tipoMemoriaRamSelected === null) return this.faltaCampo("El tipo de memoria RAM");
if(this.tarjetaGraficaSelected === null) return this.faltaCampo("El tipo de tarjeta grafica");
@@ -205,6 +247,7 @@ export default {
idProcesador: this.procesadorSelected,
idUso : this.usoSelected,
unidad: this.unidadSelected,
ubicacion: this.ubicacionUnidad,
}
console.log(data);
try{
@@ -273,4 +316,27 @@ export default {
background-color: #bb8800;
color: white;
}
.dropdown-item,.short{
width: 100%;
overflow: hidden;
white-space: pre;
text-overflow: ellipsis;
-webkit-appearance: none;
word-wrap: break-word;
text-overflow: inherit;
white-space: normal;
}
.dropdown{
position: relative ;
display: inline-block;
height: auto;
width: 100% !important;
}
.dropdown-menu{
max-height: 20rem;
width: 100%;
overflow-y: scroll;
}
</style>
+1 -5
View File
@@ -23,11 +23,7 @@
<PrinterTable />
</div>
<div class="pure-u-1 pure-u-md-1-2">
<button class="button " >
Descargar Excel
</button>
</div>
</div>
</template>
+4 -1
View File
@@ -1,4 +1,7 @@
module.exports = {
publicPath: "./"
publicPath: "./",
devServer: {
host: 'localhost'
}
};