(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-231c180e"],{2580:function(t,a,e){},"2cf0":function(t,a,e){"use strict";e("2580")},"6e01":function(t,a,e){"use strict";e.r(a);var s=function(){var t=this,a=t._self._c;return a("div",{staticClass:"main-content"},[a("breadcumb",{attrs:{page:"List Lembaga",folder:"Lembaga"}}),a("b-row",[a("b-col",{attrs:{md:"12"}},[a("b-card",[a("b-row",[a("b-col",{attrs:{sm:"6"}},[a("b-row",[a("b-form-group",{staticClass:"col-md-12 w-100",attrs:{label:"Nama"}},[a("b-form-input",{attrs:{type:"text",placeholder:"Cari Nama Lembaga .."},model:{value:t.filterCompany.companyName,callback:function(a){t.$set(t.filterCompany,"companyName",a)},expression:"filterCompany.companyName"}})],1)],1)],1)],1),a("b-row",[a("b-col",{attrs:{sm:"6"}},[a("b-form-group",{staticClass:"text-left"},[a("b-button",{attrs:{size:"sm",variant:"info m-1"},on:{click:t.handleFilterCompany}},[t._v("Filter")]),a("b-button",{attrs:{size:"sm",variant:"info m-1"},on:{click:t.handleResetFilterCompany}},[t._v("Reset Filter")])],1)],1)],1),a("b-table",{staticClass:"mt-4",attrs:{hover:"",responsive:"",fields:t.fields,items:t.companies,busy:t.isBusy,"show-empty":"","current-page":t.currentPage,"per-page":0},scopedSlots:t._u([{key:"empty",fn:function(){return[a("div",{staticClass:"text-center"},[t._v(" Data lembaga tidak ada ")])]},proxy:!0},{key:"table-busy",fn:function(){return[a("div",{staticClass:"text-center text-primary my-2"},[a("b-spinner",{staticClass:"align-middle"}),a("strong",[t._v("Loading...")])],1)]},proxy:!0},{key:"cell(company_name)",fn:function(e){return[a("router-link",{attrs:{to:"/app/companies/detail/".concat(e.item.company_id)}},[t._v(" "+t._s(e.value)+" ")])]}},{key:"cell(company_status)",fn:function(e){return["active"===e.item.company_status?a("b-badge",{attrs:{variant:"success"}},[t._v("Berhasil")]):"pending"===e.item.company_status?a("b-badge",{attrs:{variant:"warning"}},[t._v("Menunggu")]):"suspend"===e.item.company_status?a("b-badge",{attrs:{variant:"danger"}},[t._v("Suspend")]):"disabled"===e.item.company_status?a("b-badge",{attrs:{variant:"danger"}},[t._v("Disable")]):t._e()]}},{key:"cell(created_at)",fn:function(a){return[t._v(" "+t._s(t.$moment(a.item.created_at).format("Y-MM-DD"))+" ")]}},{key:"cell(updated_at)",fn:function(a){return[t._v(" "+t._s(t.$moment(a.item.updated_at).format("Y-MM-DD"))+" ")]}},{key:"cell(actions)",fn:function(e){return[a("router-link",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],attrs:{to:"/app/companies/edit/".concat(e.item.company_id),title:"Edit"}},[a("i",{staticClass:"i-Eraser-2 text-25 text-success mr-2"})]),a("a",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],attrs:{href:"javascript:void(0)",title:"Delete"},on:{click:function(a){return t.handleDeleteCompany(e.item.company_id)}}},[a("i",{staticClass:"i-Close-Window text-25 text-danger"})]),"active"!==e.item.company_status?a("a",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],attrs:{href:"javascript:void(0)",title:"Approve"},on:{click:function(a){return t.handleApproveCompany(e.item.company_id)}}},[a("i",{staticClass:"i-Checked-User text-25 text-info ml-2"})]):t._e()]}}])}),a("b-col",{staticClass:"my-1",attrs:{md:"0"}},[a("b-pagination",{staticClass:"my-0",attrs:{"total-rows":t.totalCompany,"per-page":t.perPage,align:"right",size:"sm"},model:{value:t.currentPage,callback:function(a){t.currentPage=a},expression:"currentPage"}})],1)],1)],1)],1)],1)},n=[],i=(e("99af"),e("14d9"),{data:function(){return{fields:[{key:"company_name",label:"Nama Lembaga",sortable:!0,sortDirection:"desc"},{key:"company_leader",label:"Nama Pimpinan",sortable:!0,sortDirection:"desc"},{key:"company_contact_person_name",label:"Nama PIC Fundraising",sortable:!0,sortDirection:"desc"},{key:"company_status",label:"Status",sortable:!0,sortDirection:"desc"},{key:"created_at",label:"Created Date",sortable:!0,class:"text-center"},{key:"updated_at",label:"Updated Date",sortable:!0,class:"text-center"},{key:"actions",label:"Actions"}],companies:[],totalCompany:0,currentPage:1,perPage:5,filterCompany:{companyName:""},isBusy:!0,accountData:this.$store.getters["accountData"]}},watch:{currentPage:{handler:function(){this.getListCompany(this.currentPage)}}},mounted:function(){this.getListCompany(this.currentPage)},created:function(){this.checkRole()},methods:{checkRole:function(){"AA"!==this.accountData.role&&this.$router.push("*")},getListCompany:function(t){var a=this;this.$http.get("".concat("https://orchestrator.bwa.id/api/v1/","companies?company_verified=-1&limit=").concat(this.perPage,"&page=").concat(t),{headers:{Authorization:"Bearer ".concat(this.$store.getters["accessToken"])}}).then((function(t){var e=t.data;a.companies=e.data,a.totalCompany=e.meta.total,a.isBusy=!1})).catch((function(){a.$store.dispatch("error","Maaf, terjadi kesalahan")}))},handleFilterCompany:function(){var t=this,a=this.currentPage;this.totalCompany=0,this.isBusy=!0,this.$http.get("".concat("https://orchestrator.bwa.id/api/v1/","companies?company_verified=-1&q=").concat(this.filterCompany.companyName,"&limit=").concat(this.perPage,"&page=").concat(a),{headers:{Authorization:"Bearer ".concat(this.$store.getters["accessToken"])}}).then((function(a){var e=a.data;t.companies=e.data,t.totalCompany=e.meta.total,t.isBusy=!1})).catch((function(){t.$store.dispatch("error","Maaf, terjadi kesalahan")}))},handleResetFilterCompany:function(){this.filterCompany.companyName="",this.isBusy=!0,this.getListCompany(this.currentPage)},handleDeleteCompany:function(t){var a=this;this.isBusy=!0,this.$http.patch("".concat("https://orchestrator.bwa.id/api/v1/","companies/").concat(t),{company_status:"disabled"},{headers:{Authorization:"Bearer ".concat(this.$store.getters["accessToken"])}}).then((function(t){t.data;a.isBusy=!1,a.$store.dispatch("success","Lembaga berhasil didisabled"),a.getListCompany(a.currentPage)})).catch((function(){a.isBusy=!1,a.$store.dispatch("error","Maaf, terjadi kesalahan")}))},handleApproveCompany:function(t){var a=this;this.isBusy=!0,this.$http.patch("".concat("https://orchestrator.bwa.id/api/v1/","companies/").concat(t),{company_status:"active"},{headers:{Authorization:"Bearer ".concat(this.$store.getters["accessToken"])}}).then((function(t){t.data;a.isBusy=!1,a.$store.dispatch("success","Approve lembaga berhasil"),a.getListCompany(a.currentPage)})).catch((function(){a.isBusy=!1,a.$store.dispatch("error","Maaf, terjadi kesalahan")}))}}}),o=i,r=(e("2cf0"),e("2877")),c=Object(r["a"])(o,s,n,!1,null,"5c301160",null);a["default"]=c.exports}}]);