芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/xmintal.sdektun.com/assets/revenue-DDyh3BP1.js
import{W as p}from"./vuejs3-datepicker-C6wjEZix.js";import{_ as g,c as h,a as t,j as _,v as f,b as u,g as v,r as C,o as b}from"./index-C5D-hTCr.js";const y={components:{Datepicker:p},data(){return{filter:"date",revenues:[],surcharges:[],start:new Date,end:new Date,barChart:void 0,barChart2:void 0}},methods:{loadData(){let i=this.$date.dbformat(this.start),e=this.$date.dbformat(this.end);this.$api.get("/reports/todaycollectionbybranch?s="+i+"&e="+e).then(r=>{this.revenues=r.data.payments,this.surcharges=r.data.surcharges,this.createCharts()})},createCharts(){this.createChart(this.revenues,this.barChart,"barChart"),this.createChart(this.surcharges,this.barChart2,"barChart2")},createChart(n,e,r){e&&e.destroy();var c={scales:{yAxes:[{ticks:{beginAtZero:!0}}]},legend:{display:!1},elements:{point:{radius:0}}};let a=[],o=[],l=n;for(var s in l){let d=l[s];a.push(d.branch+" ($"+this.$number.format(d.total)+" MN)"),o.push(d.total)}var n={labels:a,datasets:[{label:"Total recaudado",data:o,backgroundColor:["rgba(255, 99, 132, 0.2)","rgba(54, 162, 235, 0.2)","rgba(255, 206, 86, 0.2)","rgba(75, 192, 192, 0.2)","rgba(153, 102, 255, 0.2)","rgba(255, 159, 64, 0.2)"],borderColor:["rgba(255,99,132,1)","rgba(54, 162, 235, 1)","rgba(255, 206, 86, 1)","rgba(75, 192, 192, 1)","rgba(153, 102, 255, 1)","rgba(255, 159, 64, 1)"],borderWidth:1,fill:!1}]},m=document.getElementById(r).getContext("2d");this.barChart=new Chart(m,{type:"bar",data:n,options:c})}},mounted(){this.loadData()}},D={class:"card"},V={class:"card-body"},k={class:"filter panel-primary"},x={class:"row"},w={class:"col-md-3"},B=t("option",{value:"date"},"Filtrar por fecha",-1),N=t("option",{value:"range"},"Filtrar por rango de fechas",-1),F=[B,N],U={class:"col-md-3"},W={key:0,class:"col-md-3"},A={class:"col-md-3"},E=t("h3",{class:"cart-title"},"Cobranza por sucursal",-1),I=t("canvas",{id:"barChart",style:{height:"230px"}},null,-1),M=t("h3",{class:"cart-title"},"Ingresos por recargos por sucursal",-1),j=t("canvas",{id:"barChart2",style:{height:"230px"}},null,-1);function z(i,e,r,c,a,o){const l=C("Datepicker");return b(),h("div",D,[t("div",V,[t("div",k,[t("div",x,[t("div",w,[_(t("select",{class:"form-control form-inline","onUpdate:modelValue":e[0]||(e[0]=s=>a.filter=s)},F,512),[[f,a.filter]])]),t("div",U,[u(l,{modelValue:a.start,"onUpdate:modelValue":e[1]||(e[1]=s=>a.start=s),language:"es","use-utc":"true"},null,8,["modelValue"])]),a.filter=="range"?(b(),h("div",W,[u(l,{modelValue:a.end,"onUpdate:modelValue":e[2]||(e[2]=s=>a.end=s),language:"es","use-utc":"true"},null,8,["modelValue"])])):v("",!0),t("div",A,[t("a",{class:"btn btn-primary",onClick:e[3]||(e[3]=(...s)=>o.loadData&&o.loadData(...s))},"Filtrar")])])]),E,I,M,j])])}const Z=g(y,[["render",z]]);export{Z as default};