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