(window.webpackJsonp=window.webpackJsonp||[]).push([[223],{2071:function(e,t,r){"use strict";r.r(t);r(6),r(5),r(7),r(4),r(12),r(8),r(13);var n=r(2),c=(r(152),r(153),r(78));function o(object,e){var t=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(object,e).enumerable}))),t.push.apply(t,r)}return t}var l={components:{ModalFicha:r(2072).default},props:{dados:{type:Object,default:function(){},required:!0},fichas:{type:Array,default:function(){return[]},required:!0},findFichas:{type:Function,default:function(){return!1},required:!0},correcoes:{type:Array,default:function(){return[]},required:!0},permissoes:{type:Array,required:!0}},data:function(){return{fields:[{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"}}],currentPage:1,perPage:5,ficha:{}}},computed:function(e){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?o(Object(source),!0).forEach((function(t){Object(n.a)(e,t,source[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(source)):o(Object(source)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(source,t))}))}return e}({},Object(c.c)({empresa:"empresa/empresaAtual"})),methods:{openModalFicha:function(e){this.ficha=e.id?e:{id:this.dados.id},this.$bvModal.show("modalFicha")},deleteFicha:function(e){var t=this;this.$bvModal.msgBoxConfirm("Deseja excluir a ficha ? A operação não poderá ser desfeita.",{centered:!0,title:"Confirmação",size:"sm",okTitle:"Sim",okVariant:"primary",cancelTitle:"Não",cancelVariant:"outline-secondary",headerClass:"p-3",footerClass:"p-2 flex-row d-flex"}).then((function(r){r&&t.$fichasRacService.deleteFicha(e.id.idRac,t.empresa.sigla,e.id.sequencia).then((function(){t.$notify({title:"Confirmação",text:"Ficha excluída com sucesso.",type:"success"}),t.findFichas()})).catch((function(e){t.$notifyApiError(e,"Erro")}))}))},hasPermission:function(e){return this.permissoes.includes(e)}}},d=l,f=r(42),component=Object(f.a)(d,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("b-card",[r("div",{staticClass:"mt-4",attrs:{slot:"header"},slot:"header"},[r("b-row",[r("b-col",{staticClass:"d-flex justify-content-start"},[r("fa-icon",{staticStyle:{"font-size":"1.3rem"},attrs:{icon:"bookmark"}}),e._v(" "),r("h3",{staticClass:"ml-3"},[e._v("Fichas")])],1),e._v(" "),r("b-col",{staticClass:"d-flex justify-content-end"},[e.hasPermission("RAC_INCLUIR_FICHA")?r("b-button",{staticClass:"rounded",attrs:{size:"sm",variant:"success"},on:{click:e.openModalFicha}},[r("fa-icon",{attrs:{icon:"file"}}),e._v(" "),r("span",{staticClass:"ml-2"},[e._v("Adicionar")])],1):e._e()],1)],1)],1),e._v(" "),r("b-row",[r("b-col",{attrs:{md:"12"}},[r("b-table",{staticClass:"mt-2",staticStyle:{cursor:"pointer"},attrs:{striped:"",hover:"",fields:e.fields,items:e.fichas,"show-empty":!0,"empty-text":"Não há fichas incluídas.","per-page":e.perPage,"current-page":e.currentPage},on:{"row-clicked":e.openModalFicha},scopedSlots:e._u([{key:"table-busy",fn:function(){return[r("div",{staticClass:"text-center text-info my-2"},[r("b-spinner",{staticClass:"align-middle"}),e._v(" "),r("strong",[e._v("Carregando...")])],1)]},proxy:!0},{key:"cell(datInspecao)",fn:function(t){return[e._v("\n          "+e._s(e._f("formatDate")(t.item.datInspecao))+"\n        ")]}},{key:"cell(actions)",fn:function(t){return[e.hasPermission("RAC_EXCLUIR_FICHA")?r("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(r){return e.deleteFicha(t.item)}}},[r("fa-icon",{staticClass:"text-danger btn-table-text",attrs:{icon:"trash-alt"}})],1):e._e()]}}])}),e._v(" "),e.fichas.length>0?r("b-row",[r("b-col",{attrs:{"align-self":"end"}},[r("div",{staticClass:"text-right"},[r("b",[e._v("Itens:")]),e._v(" "+e._s(e.fichas.length))])])],1):e._e(),e._v(" "),e.fichas.length>e.perPage?r("b-pagination",{attrs:{"total-rows":e.fichas.length,"per-page":e.perPage,align:"center",pills:""},model:{value:e.currentPage,callback:function(t){e.currentPage=t},expression:"currentPage"}}):e._e()],1)],1),e._v(" "),r("ModalFicha",{attrs:{ficha:e.ficha,"find-fichas":e.findFichas,correcoes:e.correcoes,permissoes:e.permissoes}})],1)}),[],!1,null,null,null);t.default=component.exports}}]);
//# sourceMappingURL=1ea3e35-1.2.11.js.map