(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d22587f"],{e592:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t._self._c;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"app-container"},[e("div",{staticClass:"filter-container"},[e("el-button",{directives:[{name:"print",rawName:"v-print",value:"#printMe",expression:"'#printMe'"}],attrs:{type:"primary"}},[t._v(" Print ")]),e("el-button",{attrs:{type:"primary"},on:{click:t.generatePdf}},[t._v(" PDF ")])],1),e("vue-html2pdf",{ref:"html2Pdf",attrs:{id:"printMe","show-layout":!0,"float-layout":!1,"enable-download":!0,"preview-modal":!1,"pdf-quality":1,"manual-pagination":!0,"pdf-format":"a4","pdf-orientation":"portrait","pdf-content-width":"700px","html-to-pdf-options":{margin:[0,10],filename:"Daftar COA.pdf"}}},[e("template",{slot:"pdf-content"},[e("div",[e("h3",[t._v("DAFTAR AKUN")]),e("i",[t._v("Chart of Accounts (CoA)")]),e("br"),e("br")]),e("el-tree",{ref:"elTree",attrs:{data:t.list,props:t.defaultProps},scopedSlots:t._u([{key:"default",fn:function(a){var n=a.node;return e("span",{staticClass:"custom-tree-node"},[e("span",[t._v(t._s(n.label))]),e("span",{staticStyle:{"margin-left":"20px",color:"rgb(43, 142, 255)"}},[t.showAkun(n.label)?e("router-link",{staticStyle:{cursor:"pointer"},attrs:{to:t.getEditRoute(n.label)}},[t._v(" Edit ")]):t._e()],1),e("span",{staticStyle:{"margin-left":"20px","font-size":"10px",color:"green",display:"inline-block","max-width":"350px","white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis"},attrs:{title:n.data.akun_desc}},[e("i",[t._v(t._s(n.data.akun_desc))])])])}}])})],1)],2)],1)},i=[],r=a("0d5e"),o=a("6480");function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}var s={name:"ComplexTable",components:{VueHtml2pdf:o["a"]},data:function(){return{defaultProps:{children:"children",label:"name"},list:null,total:0,listLoading:!0,loading:!1}},created:function(){this.getList()},methods:{getList:function(){var t=this;this.listLoading=!0,r["a"].get("/akun").then((function(e){console.log(e);var a=e.data.akun;a.forEach((function(t){if(t.children&&"object"===l(t.children)&&!Array.isArray(t.children)){var e=Object.values(t.children);e.sort((function(t,e){return t.id-e.id})),t.children=e}})),t.list=a,t.total=a.length,t.listLoading=!1}))},showAkun:function(t){var e=["Kas dan Bank","Piutang Lain","Harta Tetap","Biaya","Pendapatan","Hutang Lain"];return e.includes(t)},getEditRoute:function(t){switch(t){case"Kas dan Bank":return"/kas/setting";case"Piutang Lain":return"/nama-debitur";case"Harta Tetap":return"/nama-aset";case"Biaya":return"/setting-biaya";case"Pendapatan":return"/setting-pendapatan";case"Hutang Lain":return"/nama-kreditur";default:return"/akun"}},generatePdf:function(){this.$refs.html2Pdf.generatePdf()}}},d=s,u=a("2877"),c=Object(u["a"])(d,n,i,!1,null,null,null);e["default"]=c.exports}}]);