var T=Object.defineProperty,$=Object.defineProperties;var H=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var X=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var S=(a,e,t)=>e in a?T(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,B=(a,e)=>{for(var t in e||(e={}))X.call(e,t)&&S(a,t,e[t]);if(C)for(var t of C(e))j.call(e,t)&&S(a,t,e[t]);return a},b=(a,e)=>$(a,H(e));import{d as q,u as z,i as d,W as k,o as v,j as N,c as l,w as s,b as u,a as R,e as x,U as G,x as J,v as K,F as O,f as _,t as W,n as Q,H as Z,J as Y,aN as ee,R as te,K as ae,aq as oe,B as ne}from"./index.29cf2edd.js";/* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              */import{_ as ue}from"./StatusSelection.682823fe.js";/* empty css              *//* empty css              */import{R as le}from"./ReportService.10f7d665.js";import{f as se}from"./filters.69c883c5.js";const re=_("\u0E82\u0EB2\u0E8D\u0E9B\u0EB0\u0E81\u0EB1\u0E99"),ce=_("\u0EC0\u0E84\u0EA3\u0EA1\u0E9B\u0EB0\u0E81\u0EB1\u0E99"),ie=_("Search"),_e=_("Clear"),me=_("Excel "),Ne=q({__name:"StaffReport",setup(a){const e=[{title:"Staff",dataIndex:"staff",key:"staff"},{title:"Total",dataIndex:"total",key:"total"},{title:"Volume",dataIndex:"volume",key:"volume"}],t=z();let o=d();const r=d([]);let m=d("sell"),p=d();const D=async()=>{if(!f.value&&!E.value)return Q.warn("Please choose report date");const n={fromdate:f.value,todate:E.value,type:m.value,status:p.value};Z(),await le.getStaffReport(n).then(c=>{Y(),o.value=c.data}).catch(c=>{Y()})},M=n=>{p.value=n},w=()=>{o.value=[],r.value=[],p.value=void 0},I=()=>{const n=`PackageReport.${f.value}.${E.value}.xlsx`;ee(n,y.value)},f=k(()=>r.value[0]?r.value[0].format("YYYY-MM-DD"):null),E=k(()=>r.value[1]?r.value[1].format("YYYY-MM-DD"):null),y=k(()=>o&&o.value.length>0?o.value.map(n=>b(B({},n),{total:Number(n.total),volume:Number(n.volume)})):o.value);return(n,c)=>{const h=te,A=ae,U=oe,V=ue,g=ne,F=G,L=J;return v(),N("div",null,[l(F,{size:8,style:{"margin-bottom":"8px"}},{default:s(()=>[["ADMIN","ACCOUNTING"].includes(u(t).role)?(v(),R(A,{key:0,value:u(m),"onUpdate:value":c[0]||(c[0]=i=>K(m)?m.value=i:m=i)},{default:s(()=>[l(h,{value:"sell"},{default:s(()=>[re]),_:1}),l(h,{value:"claim"},{default:s(()=>[ce]),_:1})]),_:1},8,["value"])):x("",!0),l(U,{value:r.value,"onUpdate:value":c[1]||(c[1]=i=>r.value=i)},null,8,["value"]),l(V,{value:u(p),onChange:M},null,8,["value"]),l(g,{onClick:D},{default:s(()=>[ie]),_:1}),l(g,{onClick:w},{default:s(()=>[_e]),_:1}),l(g,{disabled:!u(o)||u(o)&&u(o).length===0,type:"primary",onClick:I},{default:s(()=>[me]),_:1},8,["disabled"])]),_:1}),u(o)?(v(),R(L,{key:0,columns:e,"data-source":u(y),pagination:!0},{bodyCell:s(({column:i,text:pe,record:P})=>[i.key==="volume"?(v(),N(O,{key:0},[_(W(u(se).formatMoney(P.volume)),1)],64)):x("",!0)]),_:1},8,["data-source"])):x("",!0)])}}});export{Ne as default};
