(window.webpackJsonp=window.webpackJsonp||[]).push([[206],{2055:function(t,e,n){"use strict";n.r(e);n(6),n(5),n(7),n(4),n(12),n(8),n(13);var r=n(2),c=n(78);function o(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function l(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?o(Object(source),!0).forEach((function(e){Object(r.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):o(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var d={components:{ModalFicha:n(2056).default},props:{fichaAmbiental:{type:String,default:function(){return""},required:!0},dados:{type:Object,default:function(){},required:!0},fichas:{type:Array,default:function(){return[]},required:!0},findFichas:{type:Function,default:function(){return!1},required:!0},deleteFicha:{type:Function,default:function(){return!1},required:!0},isBlockedEdit:{type:Function,default:function(){return!1},required:!0},hasPermission:{type:Function,default:function(){return!1},required:!0}},data:function(){return{currentPageFichas:1,perPageFichas:5,ficha:{}}},computed:l(l({},Object(c.c)({empresa:"empresa/empresaAtual"})),{},{rowsFichas:function(){return this.fichas.length},fieldsFichas:function(){return[{key:"datInspecao",label:"Inspeção",thStyle:{width:"10% !important"},sortable:!0},{key:"status.descricao",label:"Situação",sortable:!0},{key:"descricao",label:"Descrição",sortable:!0},{key:"actions",label:"Ações",thStyle:{width:"10% !important"}}]}}),methods:{openModalFichasInspecao:function(){this.ficha={},this.$bvModal.show("modalFichasInspecao")},editFicha:function(t){this.ficha=t,this.$bvModal.show("modalFichasInspecao")}}},f=n(42),component=Object(f.a)(d,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-card",[n("div",{staticClass:"mt-4",attrs:{slot:"header"},slot:"header"},[n("b-row",[n("b-col",{staticClass:"d-flex justify-content-start"},[n("fa-icon",{staticStyle:{"font-size":"1.3rem"},attrs:{icon:"bookmark"}}),t._v(" "),n("h3",{staticClass:"ml-3"},[t._v("Fichas")])],1),t._v(" "),n("b-col",{staticClass:"d-flex justify-content-end"},[n("b-button",{staticClass:"rounded",attrs:{size:"sm",variant:"success"},on:{click:t.openModalFichasInspecao}},[n("fa-icon",{attrs:{icon:"file"}}),t._v(" "),n("span",{staticClass:"ml-2"},[t._v("Adicionar")])],1)],1)],1)],1),t._v(" "),n("b-row",[n("b-col",{attrs:{md:"12"}},[n("b-table",{staticClass:"mt-2",staticStyle:{cursor:"pointer"},attrs:{striped:"",hover:"","show-empty":"",fields:t.fieldsFichas,items:t.fichas,"empty-text":"Não há fichas incluídas.","per-page":t.perPageFichas,"current-page":t.currentPageFichas},on:{"row-clicked":t.editFicha},scopedSlots:t._u([{key:"table-busy",fn:function(){return[n("div",{staticClass:"text-center text-info my-2"},[n("b-spinner",{staticClass:"align-middle"}),t._v(" "),n("strong",[t._v("Carregando...")])],1)]},proxy:!0},{key:"cell(datInspecao)",fn:function(e){return[t._v("\n          "+t._s(t._f("formatDate")(e.item.datInspecao))+"\n        ")]}},{key:"cell(actions)",fn:function(e){return[n("b-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],staticClass:"btn-table",attrs:{variant:"outline-danger",title:"Excluir Ficha"},on:{click:function(n){return t.deleteFicha(e.item.id.sequencia)}}},[n("fa-icon",{staticClass:"text-danger btn-table-text",attrs:{icon:"trash-alt"}})],1)]}}])}),t._v(" "),t.fichas.length>0?n("b-row",[n("b-col",{attrs:{"align-self":"end"}},[n("div",{staticClass:"text-right"},[n("b",[t._v("Itens:")]),t._v(" "+t._s(t.fichas.length))])])],1):t._e(),t._v(" "),t.fichas.length>5?n("b-pagination",{attrs:{"total-rows":t.rowsFichas,"per-page":t.perPageFichas,align:"center",pills:""},model:{value:t.currentPageFichas,callback:function(e){t.currentPageFichas=e},expression:"currentPageFichas"}}):t._e()],1)],1),t._v(" "),n("ModalFicha",{attrs:{ficha:t.ficha,"find-fichas":t.findFichas,dados:t.dados}})],1)}),[],!1,null,null,null);e.default=component.exports}}]);
//# sourceMappingURL=09d36ba-1.2.11.js.map