(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{100:function(a,e,t){"use strict";t.r(e);var n=t(0),r=t.n(n),l={data:function(){return{serverError:null,errorAlert:!1,snack:!1,snackColor:null,snackText:null,search:null,daftarPeminjaman:null,daftarPeminjamanFiltered:null,overlay:!1,headers:[{text:"Kode Buku",align:"start",sortable:!0,value:"kode_buku_full"},{text:"Judul Buku",align:"start",sortable:!0,value:"judul_buku"},{text:"Jumlah Buku",align:"start",sortable:!0,value:"jumlah_buku"},{text:"Kode Peminjaman",align:"start",sortable:!0,value:"kode_peminjaman_full"},{text:"Tgl Pinjam",align:"start",sortable:!0,value:"tanggal_pinjam"},{text:"Kode Peminjam",align:"start",sortable:!0,value:"kode_user_full"},{text:"Nama Peminjam",align:"start",sortable:!0,value:"full_name"}]}},methods:{getData:function(){var a=this;a.overlay=!0,r.a.get("api/perpus/log-data/peminjaman").then((function(e){a.daftarPeminjaman=e.data.data,a.overlay=!1})).catch((function(e){a.snack=!0,a.snackColor="error",a.snackText="Tidak Bisa Mendapatkan Data Peminjaman",a.overlay=!1}))},searchPeminjaman:function(){var a=this;null!=a.search?a.daftarPeminjamanFiltered=a.daftarPeminjaman.filter((function(e){return e.kode_peminjaman_full.toLowerCase().includes(a.search.toLowerCase())||e.judul_buku.toLowerCase().includes(a.search.toLowerCase())||e.kode_user_full.toLowerCase().includes(a.search.toLowerCase())||e.full_name.toLowerCase().includes(a.search.toLowerCase())||e.tanggal_pinjam.toLowerCase().includes(a.search.toLowerCase())})):a.daftarPeminjamanFiltered=null},exportExcel:function(){var a=this;a.overlay=!0,r.a.get("api/perpus/log-data/peminjaman/export",{responseType:"blob"}).then((function(e){var t=window.URL.createObjectURL(new Blob([e.data])),n=document.createElement("a");n.href=t,n.setAttribute("download","LogPeminjaman.xlsx"),document.body.appendChild(n),n.click(),a.snack=!0,a.snackColor="success",a.snackText="Berhasil Export Log Peminjaman",a.overlay=!1})).catch((function(e){a.snack=!0,a.snackColor="error",a.snackText="Tidak Bisa Export Log Peminjaman",a.overlay=!1}))}},mounted:function(){this.getData()}},s=t(2),o=Object(s.a)(l,(function(){var a=this,e=a.$createElement,t=a._self._c||e;return t("div",{staticClass:"ma-5"},[t("v-alert",{attrs:{border:"top",color:"red lighten-2",dark:"",dismissible:""},model:{value:a.errorAlert,callback:function(e){a.errorAlert=e},expression:"errorAlert"}},a._l(a.serverError,(function(e,n){return t("ul",{key:n},[t("li",[a._v("\n        "+a._s(e[0])+"\n      ")])])})),0),a._v(" "),t("v-card",[t("v-card-title",[a._v("\n    Log Data Peminjaman\n      "),t("v-spacer"),a._v(" "),t("v-text-field",{staticClass:"mb-3",attrs:{"append-icon":"mdi-magnify",label:"Masukan Sesuatu...",hint:"Search","persistent-hint":"","single-line":"","append-outer-icon":"mdi-send"},on:{"click:append-outer":a.searchPeminjaman},model:{value:a.search,callback:function(e){a.search=e},expression:"search"}})],1),a._v(" "),t("v-btn",{staticClass:"ma-2 white--text",attrs:{disabled:null==a.daftarPeminjaman,color:"blue-grey"},on:{click:function(e){return e.preventDefault(),a.exportExcel(e)}}},[a._v("\n      Export EXCEL\n      "),t("v-icon",{attrs:{right:"",dark:""}},[a._v("mdi-cloud-download")])],1),a._v(" "),a.daftarPeminjaman&&null==a.daftarPeminjamanFiltered?t("v-data-table",{staticClass:"elevation-1",attrs:{headers:a.headers,items:a.daftarPeminjaman,"items-per-page":5}}):a._e(),a._v(" "),a.daftarPeminjaman&&null!=a.daftarPeminjamanFiltered?t("v-data-table",{staticClass:"elevation-1",attrs:{headers:a.headers,items:a.daftarPeminjamanFiltered,"items-per-page":5}}):a._e(),a._v(" "),t("v-overlay",{attrs:{absolute:!0,value:a.overlay}},[t("v-progress-circular",{attrs:{size:50,color:"white",indeterminate:""}})],1)],1),a._v(" "),t("v-snackbar",{attrs:{top:"",timeout:3e3,color:a.snackColor},scopedSlots:a._u([{key:"action",fn:function(e){var n=e.attrs;return[t("v-btn",a._b({attrs:{text:""},on:{click:function(e){a.snack=!1}}},"v-btn",n,!1),[a._v("Close")])]}}]),model:{value:a.snack,callback:function(e){a.snack=e},expression:"snack"}},[a._v("\n    "+a._s(a.snackText)+"\n\n    ")])],1)}),[],!1,null,null,null);e.default=o.exports}}]);