(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0b728d"],{"1fdf":function(a,t,e){"use strict";e.r(t);var n=function(){var a=this,t=a._self._c;return t("div",{staticClass:"modern-nota-selector"},[t("h2",{staticClass:"modern-title"},[a._v(" "+a._s(a.$t("cetak_alamat_kontak.silahkan_pilih_kontak"))+" ")]),t("div",{staticClass:"modern-nota-card"},[t("el-form",{ref:"dataForm",staticClass:"modern-form",attrs:{"label-position":"top",inline:!0}},[t("el-form-item",{staticClass:"k",attrs:{label:a.$t("cetak_alamat_kontak.nama_kontak")}},[t("el-select",{staticClass:"modern-select",attrs:{filterable:"",placeholder:a.$t("cetak_alamat_kontak.pilih")},on:{change:a.updateSelectedContact},model:{value:a.kontak,callback:function(t){a.kontak=t},expression:"kontak"}},a._l(a.contacts,(function(a){return t("el-option",{key:a.id,attrs:{label:a.name,value:a.id}})})),1)],1),t("el-form-item",{staticClass:"k",attrs:{label:a.$t("cetak_alamat_kontak.ukuran_kertas")}},[t("el-select",{staticClass:"modern-select",attrs:{placeholder:a.$t("cetak_alamat_kontak.pilih")},on:{change:function(t){return a.onChangeKertas(t)}},model:{value:a.kertas,callback:function(t){a.kertas=t},expression:"kertas"}},a._l(a.daftarKertas,(function(a){return t("el-option",{key:a.id,attrs:{label:a.nama,value:a.id}})})),1)],1)],1),t("div",{staticClass:"modern-footer"},[t("el-button",{staticClass:"modern-btn",attrs:{type:"primary"},on:{click:a.sendSelectedContact}},[a._v(a._s(a.$t("cetak_alamat_kontak.cetak")))])],1)],1),t("transition",{attrs:{name:"fade"}},[a.selectedContact?t("div",{staticClass:"modern-contact-detail"},[t("h3",{staticClass:"modern-contact-title"},[t("span",{staticClass:"modern-contact-icon"},[t("i",{staticClass:"el-icon-user"})]),a._v(" "+a._s(a.$t("cetak_alamat_kontak.detail_kontak"))+" ")]),t("div",{staticClass:"modern-contact-info-row"},[t("i",{staticClass:"el-icon-user"}),t("span",[t("strong",[a._v(a._s(a.$t("cetak_alamat_kontak.nama"))+":")]),a._v(" "+a._s(a.selectedContact.name))])]),a.selectedContact.email?t("div",{staticClass:"modern-contact-info-row"},[t("i",{staticClass:"el-icon-message"}),t("span",[t("strong",[a._v(a._s(a.$t("cetak_alamat_kontak.email"))+":")]),a._v(" "+a._s(a.selectedContact.email))])]):a._e(),a.selectedContact.phone?t("div",{staticClass:"modern-contact-info-row"},[t("i",{staticClass:"el-icon-phone"}),t("span",[t("strong",[a._v(a._s(a.$t("cetak_alamat_kontak.telepon"))+":")]),a._v(" "+a._s(a.selectedContact.phone))])]):a._e(),a.selectedContact.address?t("div",{staticClass:"modern-contact-info-row"},[t("i",{staticClass:"el-icon-location-outline"}),t("span",[t("strong",[a._v(a._s(a.$t("cetak_alamat_kontak.alamat"))+":")]),a._v(" "+a._s(a.selectedContact.address))])]):a._e()]):a._e()])],1)},s=[],c=e("0d5e"),o={data:function(){return{daftarKertas:[{id:1,nama:"30 x 20 mm"},{id:2,nama:"33 x 15 mm"},{id:3,nama:"40 x 20 mm"},{id:4,nama:"40 x 30 mm"},{id:5,nama:"50 x 20 mm"},{id:6,nama:"50 x 25 mm"},{id:7,nama:"50 x 30 mm"},{id:8,nama:"60 x 40 mm"}],contacts:[],kontak:"",kertas:"",disabled:!1,selectedContact:null}},mounted:function(){this.getContacts()},methods:{getContacts:function(){var a=this;c["a"].get("/contact").then((function(t){a.contacts=t.data.contact||t.data.data||[]}))},updateSelectedContact:function(){var a=this,t=this.contacts.find((function(t){return t.id===a.kontak}));t&&(this.selectedContact={name:t.name,id:t.id,email:t.contact_email,phone:t.contact,address:t.address,kertas:this.kertas,kolom:1,baris:1})},onChangeKertas:function(a){var t=[1,2,3,4,5,6,7,8];t.includes(parseInt(a))&&(this.disabled=!0)},sendSelectedContact:function(){if(this.kontak&&this.kertas){if(this.selectedContact){var a="";switch(this.kertas){case 1:a="/#/cetak/alamat/30x20?";break;case 2:a="/#/cetak/alamat/33x15?";break;case 3:a="/#/cetak/alamat/40x20?";break;case 4:a="/#/cetak/alamat/40x30?";break;case 5:a="/#/cetak/alamat/50x20?";break;case 6:a="/#/cetak/alamat/50x25?";break;case 7:a="/#/cetak/alamat/50x30?";break;case 8:a="/#/cetak/alamat/60x40?";break}a&&(a+="id="+encodeURIComponent(this.kontak),a+="&kolom=1",a+="&baris=1",window.open(a,"_blank")),this.kontak="",this.kertas=""}}else this.$notify({title:this.$t("cetak_alamat_kontak.gagal"),message:this.$t("cetak_alamat_kontak.data_belum_lengkap"),type:"warning",duration:3e3})}}},i=o,l=e("2877"),r=Object(l["a"])(i,n,s,!1,null,null,null);t["default"]=r.exports}}]);