(window.webpackJsonp=window.webpackJsonp||[]).push([[1082],{2823:function(t,e,n){"use strict";n.r(e);var o={name:"Inventario",data:function(){return{fieldsInventario:[{key:"actions",label:"Ação",thStyle:{width:"10% !important"}},{key:"referencia",label:"Data",thStyle:{width:"5% !important"}},{key:"idElemento",label:"Elemento",thStyle:{width:"5% !important"}},{key:"idRodovia",label:"Rodovia",thStyle:{width:"5% !important"}},{key:"kmInicial",label:"KM Inicial",thStyle:{width:"7% !important"}},{key:"kmFinal",label:"KM Final",thStyle:{width:"7% !important"}},{key:"datHorInicio",label:"Data Início",thStyle:{width:"7% !important"}},{key:"datHorFinal",label:"Data Final",thStyle:{width:"7% !important"}},{key:"idResponsavel",label:"Responsável",thStyle:{width:"5% !important"}},{key:"pista",label:"Pista",thStyle:{width:"5% !important"}},{key:"sentido",label:"Sentido",thStyle:{width:"5% !important"}},{key:"",label:"Análise",thStyle:{width:"5% !important"}}],inventario:[],errorMsg:null,infoMsg:null}},mounted:function(){this.empresa=this.$store.getters["empresa/empresaAtual"],this.findInventario()},methods:{findInventario:function(){var t=this;this.$inventarioService.findInventario(this.empresa.id).then((function(e){t.inventario=e.data})).catch((function(e){t.inventario=[],t.errorMsg=e}))},addInventario:function(){this.$router.push("/conservacao/inventario/inventarioEdit")},editInventario:function(t){this.$router.push("/conservacao/inventario/inventarioEdit/".concat(t.idInventario))},deleteInventario:function(t){var e=this;this.$bvModal.msgBoxConfirm("Deseja excluir o inventario ?").then((function(n){n&&e.$inventarioService.delete(t.idEmpresa,t.idInventario).then((function(){e.findInventario(),e.infoMsg="Inventário excluído com sucesso."}))})).catch((function(t){e.errorMsg=t}))},getPista:function(t){return console.log("getPista: ",t),"S"===t?"Simples":"Dupla"},getSentido:function(t){return"N"===t?"Norte":"L"===t?"Leste":"O"===t?"Oeste":"S"===t?"Sul":void 0}}},r=n(42),component=Object(r.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("b-row",[n("b-col",{attrs:{sm:"12"}},[n("b-card",[n("div",{attrs:{slot:"header"},slot:"header"},[n("b-row",[n("b-col",{attrs:{cols:"10"}},[n("h4",{staticClass:"primary mt-4"},[t._v("Consulta Inventário")])]),t._v(" "),n("b-col",{attrs:{cols:"2"}},[n("b-button",{staticClass:"mt-4 ml-5",attrs:{small:"",variant:"info"},on:{click:t.addInventario}},[n("fa-icon",{attrs:{icon:"file"}}),t._v(" "),n("span",{staticClass:"ml-1"},[t._v("Inserir")])],1)],1)],1)],1),t._v(" "),n("b-table",{attrs:{striped:"",hover:"",fields:t.fieldsInventario,items:t.inventario,responsive:"","show-empty":!0,"empty-text":"Não há inventarios disponíveis."},scopedSlots:t._u([{key:"cell(actions)",fn:function(e){return[n("b-button",{staticClass:"mr-2",attrs:{small:"",variant:"info"},on:{click:function(n){return t.editInventario(e.item.id)}}},[n("fa-icon",{attrs:{icon:"edit"}})],1),t._v(" "),n("b-button",{staticClass:"center",attrs:{small:"",variant:"danger"},on:{click:function(n){return t.deleteInventario(e.item.id)}}},[n("fa-icon",{attrs:{icon:"trash-alt"}})],1)]}},{key:"cell(pista)",fn:function(e){return[t._v("\n            "+t._s(t.getPista(e.item.pista))+"\n          ")]}},{key:"cell(sentido)",fn:function(e){return[t._v("\n            "+t._s(t.getSentido(e.item.sentido))+"\n          ")]}}])})],1)],1)],1),t._v(" "),n("b-alert",{staticClass:"position-fixed fixed-top m-0 rounded-0",staticStyle:{"z-index":"2000"},attrs:{show:null!=t.infoMsg,variant:"success",dismissible:"",fade:""}},[t._v(t._s(t.infoMsg))]),t._v(" "),n("b-alert",{staticClass:"position-fixed fixed-bottom m-0 rounded-0",staticStyle:{"z-index":"2000"},attrs:{show:null!=t.errorMsg,variant:"danger",dismissible:"",fade:""}},[t._v(t._s(t.errorMsg))])],1)}),[],!1,null,null,null);e.default=component.exports}}]);
//# sourceMappingURL=8e0adc0-1.2.11.js.map