(window.webpackJsonp=window.webpackJsonp||[]).push([[493,495],{1198:function(t,e,o){"use strict";o.r(e);var r={props:{editRodovia:{type:Function,default:function(){return!1}},findRodovias:{type:Function,default:function(){return!1}},items:{type:Array,default:function(){return[]}}},data:function(){return{busy:!1,currentPage:1,fields:[{key:"descricao",label:"Descrição",sortable:!0,sortKey:"descricao"},{key:"kmInicial",label:"Kilômetro Inicial (km)",sortable:!0,sortKey:"kmInicial",thStyle:{width:"14% !important"}},{key:"kmFinal",label:"Kilômetro Final (km)",sortable:!0,sortKey:"kmFinal",thStyle:{width:"14% !important"}}]}},computed:{rodovias:{get:function(){return this.items},set:function(t){this.$emit("update:items",t)}},rows:function(){return this.rodovias.length}},mounted:function(){this.findRodovias()}},n=o(42),component=Object(n.a)(r,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("b-table",{attrs:{striped:"",hover:"",fields:t.fields,items:t.rodovias,"busy-empty":!0,"show-empty":"","empty-text":"Não há dados de monitoração disponíveis.","per-page":10,"current-page":t.currentPage,busy:t.busy,"select-mode":"single",selectable:""},on:{"row-clicked":t.editRodovia},scopedSlots:t._u([{key:"table-busy",fn:function(){return[o("div",{staticClass:"text-center text-info my-2"},[o("b-spinner",{staticClass:"align-middle"}),t._v(" "),o("strong",[t._v("Carregando...")])],1)]},proxy:!0},{key:"cell(kmInicial)",fn:function(e){return[t._v(t._s(t._f("formatKm")(e.item.kmInicial)))]}},{key:"cell(kmFinal)",fn:function(e){return[t._v(t._s(t._f("formatKm")(e.item.kmFinal)))]}}])}),t._v(" "),t.rodovias.length>0?o("b-row",[o("b-col",{attrs:{"align-self":"end"}},[o("div",{staticClass:"text-right"},[o("b",[t._v("Itens:")]),t._v(" "+t._s(t.rodovias.length))])])],1):t._e(),t._v(" "),t.rodovias.length>=5?o("b-pagination",{attrs:{"total-rows":t.rows,"per-page":10,align:"center",pills:""},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}}):t._e()],1)}),[],!1,null,null,null);e.default=component.exports},1970:function(t,e,o){"use strict";o.r(e);o(6),o(5),o(7),o(4),o(12),o(8),o(13);var r=o(2),n=o(78);function c(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(object);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,o)}return e}var l={components:{Tabela:o(1198).default},data:function(){return{searchRodovias:null,rodovias:[]}},computed:function(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?c(Object(source),!0).forEach((function(e){Object(r.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):c(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}({},Object(n.c)({empresa:"empresa/empresaAtual"})),methods:{addRodovia:function(){this.$nuxt.$options.router.push({path:"/laboratorio/cadastros/rodovias/_edit"})},deleteRodovia:function(){},editRodovia:function(t){this.$nuxt.$options.router.push({path:"/laboratorio/cadastros/rodovias/".concat(t.id)})},findRodovias:function(){var t=this;this.rodovias=[],this.$rodoviaService.findRodovias(this.empresa.sigla,this.searchRodovias).then((function(e){t.rodovias=e.data})).catch((function(e){t.$notify({title:"Erro",text:e.response?e.response.data.message:e,type:"error"})}))}}},d=l,f=o(42),component=Object(f.a)(d,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"animated fadeIn"},[o("b-row",[o("b-col",{attrs:{cols:"12"}},[o("b-card",{staticClass:"wrapper"},[o("form",{attrs:{id:"rodoviasForm"}},[o("div",{attrs:{slot:"header"},slot:"header"},[o("b-row",[o("b-col",{attrs:{cols:"10"}},[o("h2",{staticClass:"primary"},[t._v("Rodovias")])]),t._v(" "),o("b-col",{attrs:{cols:"2"}},[o("div",{staticClass:"d-flex justify-content-end"},[o("b-button",{staticClass:"rounded",attrs:{size:"sm",variant:"primary"},on:{click:t.addRodovia}},[o("fa-icon",{attrs:{icon:"file"}}),t._v("   Adicionar\n                  ")],1)],1)])],1)],1),t._v(" "),o("b-row",{staticClass:"mt-4"},[o("b-col",{attrs:{cols:"6",sm:"6",md:"6",lg:"6"}},[o("b-form-group",{attrs:{label:"Pesquisar"}},[o("b-form-input",{attrs:{placeholder:"Digite sua pesquisa...",type:"text",autofocus:""},on:{input:function(e){return t.findRodovias()}},model:{value:t.searchRodovias,callback:function(e){t.searchRodovias=e},expression:"searchRodovias"}})],1)],1)],1)],1)]),t._v(" "),o("b-card",{staticClass:"mt-3"},[o("Tabela",{attrs:{items:t.rodovias,"edit-rodovia":t.editRodovia,"find-rodovias":t.findRodovias}})],1)],1)],1)],1)}),[],!1,null,null,null);e.default=component.exports}}]);
//# sourceMappingURL=522429f-1.2.11.js.map