"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[786],{98883:(t,e,s)=>{s.r(e),s.d(e,{default:()=>o});var a=s(5947),r=s.n(a);const l={metaInfo:{title:"Report Users"},data:function(){return{isLoading:!0,serverParams:{sort:{field:"id",type:"desc"},page:1,perPage:10},limit:"10",search:"",totalRows:"",users:[],user:{}}},computed:{columns:function(){return[{label:this.$t("username"),field:"username",tdClass:"text-left",thClass:"text-left"},{label:this.$t("TotalSales"),field:"total_sales",tdClass:"text-left",thClass:"text-left",sortable:!1},{label:this.$t("TotalPurchases"),field:"total_purchases",tdClass:"text-left",thClass:"text-left",sortable:!1},{label:this.$t("Total_quotations"),field:"total_quotations",tdClass:"text-left",thClass:"text-left",sortable:!1},{label:this.$t("Total_return_sales"),field:"total_return_sales",tdClass:"text-left",thClass:"text-left",sortable:!1},{label:this.$t("Total_return_purchases"),field:"total_return_purchases",tdClass:"text-left",thClass:"text-left",sortable:!1},{label:this.$t("Total_transfers"),field:"total_transfers",tdClass:"text-left",thClass:"text-left",sortable:!1},{label:this.$t("Total_adjustments"),field:"total_adjustments",tdClass:"text-left",thClass:"text-left",sortable:!1},{label:this.$t("Action"),field:"actions",html:!0,tdClass:"text-right",thClass:"text-right",sortable:!1}]}},methods:{updateParams:function(t){this.serverParams=Object.assign({},this.serverParams,t)},onPageChange:function(t){var e=t.currentPage;this.serverParams.page!==e&&(this.updateParams({page:e}),this.Get_Users_Report(e))},onPerPageChange:function(t){var e=t.currentPerPage;this.limit!==e&&(this.limit=e,this.updateParams({page:1,perPage:e}),this.Get_Users_Report(1))},onSortChange:function(t){this.updateParams({sort:{type:t[0].type,field:t[0].field}}),this.Get_Users_Report(this.serverParams.page)},onSearch:function(t){this.search=t.searchTerm,this.Get_Users_Report(this.serverParams.page)},formatNumber:function(t,e){var s=("string"==typeof t?t:t.toString()).split(".");if(e<=0)return s[0];var a=s[1]||"";if(a.length>e)return"".concat(s[0],".").concat(a.substr(0,e));for(;a.length<e;)a+="0";return"".concat(s[0],".").concat(a)},Get_Users_Report:function(t){var e=this;r().start(),r().set(.1),axios.get("report/users?page="+t+"&SortField="+this.serverParams.sort.field+"&SortType="+this.serverParams.sort.type+"&search="+this.search+"&limit="+this.limit).then((function(t){e.users=t.data.report,e.totalRows=t.data.totalRows,r().done(),e.isLoading=!1})).catch((function(t){r().done(),setTimeout((function(){e.isLoading=!1}),500)}))}},created:function(){this.Get_Users_Report(1)}};const o=(0,s(14486).A)(l,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"main-content"},[e("breadcumb",{attrs:{page:t.$t("Users_Report"),folder:t.$t("Reports")}}),t._v(" "),t.isLoading?e("div",{staticClass:"loading_page spinner spinner-primary mr-3"}):t._e(),t._v(" "),t.isLoading?t._e():e("b-card",{staticClass:"wrapper"},[e("vue-good-table",{attrs:{mode:"remote",columns:t.columns,totalRows:t.totalRows,rows:t.users,"search-options":{placeholder:t.$t("Search_this_table"),enabled:!0},"pagination-options":{enabled:!0,mode:"records",nextLabel:"next",prevLabel:"prev"},styleClass:"tableOne table-hover vgt-table mt-3"},on:{"on-page-change":t.onPageChange,"on-per-page-change":t.onPerPageChange,"on-sort-change":t.onSortChange,"on-search":t.onSearch},scopedSlots:t._u([{key:"table-row",fn:function(s){return["actions"==s.column.field?e("span",[e("router-link",{attrs:{title:"Report",to:"/app/reports/detail_user/"+s.row.id}},[e("b-button",{attrs:{variant:"primary"}},[t._v(t._s(t.$t("Reports")))])],1)],1):t._e()]}}],null,!1,3369575762)})],1)],1)}),[],!1,null,null,null).exports}}]);