(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-8ee66cd6"],{c7aa1:function(e,a,t){},c954:function(e,a,t){"use strict";t("c7aa1")},e275:function(e,a,t){"use strict";t.r(a);var s=function(){var e=this,a=e._self._c;return a("div",{staticClass:"modern-nota-selector"},[a("h2",{staticClass:"modern-title"},[e._v(" "+e._s(e.$t("cetak_barcode.silahkan_pilih_produk"))+" ")]),a("div",{staticClass:"modern-nota-card"},[a("el-form",{ref:"dataForm",staticClass:"modern-form",attrs:{"label-position":"top",inline:!0,rules:e.rules,model:e.temp,"label-width":"180px"}},[a("el-form-item",{staticClass:"k",attrs:{label:e.$t("cetak_barcode.nama_produk")}},[a("el-select",{staticClass:"modern-select",attrs:{filterable:"",placeholder:e.$t("cetak_barcode.pilih")},on:{change:e.updateSelectedProduct},model:{value:e.barang,callback:function(a){e.barang=a},expression:"barang"}},e._l(e.products,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{staticClass:"k",attrs:{label:e.$t("cetak_barcode.ukuran_kertas")}},[a("el-select",{staticClass:"modern-select",attrs:{placeholder:e.$t("cetak_barcode.pilih")},on:{change:function(a){return e.onChangeKertas(a)}},model:{value:e.kertas,callback:function(a){e.kertas=a},expression:"kertas"}},e._l(e.daftarKertas,(function(e){return a("el-option",{key:e.id,attrs:{label:e.nama,value:e.id}})})),1)],1),a("el-form-item",{staticClass:"k",attrs:{label:e.$t("cetak_barcode.jumlah_kolom")}},[a("el-select",{staticClass:"modern-select",attrs:{placeholder:e.$t("cetak_barcode.pilih"),disabled:e.disabled},model:{value:e.kolom,callback:function(a){e.kolom=a},expression:"kolom"}},[a("el-option",{attrs:{label:"1",value:"1"}}),a("el-option",{attrs:{label:"2",value:"2"}})],1)],1),a("el-form-item",{staticClass:"k",attrs:{label:e.$t("cetak_barcode.jumlah_baris")}},[a("el-input",{staticClass:"modern-select",attrs:{placeholder:e.$t("cetak_barcode.jumlah_baris"),type:"number",min:"1",disabled:e.disabled},on:{change:e.updateSelectedProduct},model:{value:e.baris,callback:function(a){e.baris=a},expression:"baris"}})],1),a("el-form-item",{staticClass:"k"},[a("el-checkbox",{model:{value:e.showName,callback:function(a){e.showName=a},expression:"showName"}},[e._v(e._s(e.$t("cetak_barcode.tampilkan_nama")))]),a("el-checkbox",{model:{value:e.showCodeBarcode,callback:function(a){e.showCodeBarcode=a},expression:"showCodeBarcode"}},[e._v(e._s(e.$t("cetak_barcode.tampilkan_kode_barcode")))])],1)],1),a("div",{staticClass:"modern-footer"},[a("el-button",{staticClass:"modern-btn",attrs:{type:"primary"},on:{click:e.sendSelectedProducts}},[e._v(e._s(e.$t("cetak_barcode.cetak")))])],1)],1)])},o=[],r=t("0d5e"),c={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"}],products:[],barang:"",kertas:"",kolom:null,baris:null,disabled:!1,showName:!0,showCodeBarcode:!0}},mounted:function(){this.getList()},methods:{getList:function(){var e=this;r["a"].get("/product/goods").then((function(a){console.log(a),e.products=a.data.product.filter((function(e){return null!=e.code}))}))},updateSelectedProduct:function(){var e=this;this.barang&&(this.kertas||(this.kertas=1,this.onChangeKertas(1)),this.kolom||(this.kolom=1),this.baris||(this.baris=1));var a=this.products.find((function(a){return a.id===e.barang}));a&&(this.selectedProducts=[{name:a.name,barcode:a.code,kertas:this.kertas,kolom:parseInt(this.kolom),baris:parseInt(this.baris)}])},onChangeKertas:function(e){var a=[1,2,3,4,5,6,7,8];a.includes(parseInt(e))&&(this.disabled=!0)},sendSelectedProducts:function(){if(this.barang&&this.kertas&&this.kolom&&this.baris){if(0!=this.selectedProducts.length){var e="";switch(this.kertas){case 1:e="/cetak/barcode/30x20";break;case 2:e="/cetak/barcode/33x15";break;case 3:e="/cetak/barcode/40x20";break;case 4:e="/cetak/barcode/40x30";break;case 5:e="/cetak/barcode/50x20";break;case 6:e="/cetak/barcode/50x25";break;case 7:e="/cetak/barcode/50x30";break;case 8:e="/cetak/barcode/60x40";break}if(e){var a=this.$router.resolve({path:e,query:{id:this.barang,kolom:this.kolom,baris:this.baris,showName:this.showName,showCodeBarcode:this.showCodeBarcode}});window.open(a.href,"_blank")}this.barang="",this.kertas="",this.kolom="",this.baris=""}}else this.$notify({title:this.$t("cetak_barcode.gagal"),message:this.$t("cetak_barcode.data_belum_lengkap"),type:"warning",duration:3e3})}}},l=c,i=(t("c954"),t("2877")),n=Object(i["a"])(l,s,o,!1,null,null,null);a["default"]=n.exports}}]);