import{j as e,S as c,M as r,aH as l}from"./vendor-mui-CBBEb17G.js";import{e as d,b2 as u,aA as C,gl as p,be as P,bf as x,ao as w,I as N,iS as k}from"./index-IP_FWtso.js";import{a as s}from"./vendor-react-BBazpZul.js";import{B as E}from"./index-BkhbTDKf.js";import"./vendor-utils-BveVE6Uf.js";import{S as D}from"./index-D7-0uPSw.js";import"./vendor-charts-tGnAgELZ.js";const W=()=>{const{serverDate:h}=d(t=>t.doctorData),{centerToken:o}=d(t=>t.user),[a,j]=s.useState(h),[i,f]=s.useState(u().hour(0).minute(0).second(0)),[n,S]=s.useState(u().hour(23).minute(59).second(59)),[g,b]=s.useState(""),[T,m]=s.useState(!1),y=async()=>{m(!0)};return s.useEffect(()=>{if(!o||!a||!i||!n)return;const t=`http://192.168.1.75:5555/report/EndShift?date=${C(a)}&fromTime=${p(i)}&uptoTime=${p(n)}&token=${o}`;b(t)},[a,i,n,o]),e.jsxs(D,{className:"!space-y-3 py-2 px-4 bg-white",children:[e.jsx(E,{prevRoutes:[{path:"/",title:"داشبورد"}],currentRoute:"گزارش روزانه خدمات و کالا"}),e.jsx(c,{width:"100%",p:2,direction:"row",justifyContent:"center",children:e.jsxs(c,{className:"max-w-[500px] p-1 pb-3 rounded-md bg-white",children:[e.jsx("h1",{className:"w-full py-4 text-center text-slate-800 bg-blue-300",children:"گزارش روزانه خدمات و کالا"}),e.jsxs(r,{container:!0,spacing:2,px:2,children:[e.jsxs(r,{item:!0,xs:12,children:[e.jsx(l,{className:"!pr-2 !text-[0.9rem] text-slate-700",children:"تاریخ"}),e.jsx(P,{disablePast:!1,value:a,onChange:t=>j(t)})]}),e.jsxs(r,{item:!0,xs:12,md:6,children:[e.jsx(l,{className:"!pr-2 !text-[0.9rem] text-slate-700",children:"از ساعت"}),e.jsx(x,{value:i,onChange:t=>t&&f(t)})]}),e.jsxs(r,{item:!0,xs:12,md:6,children:[e.jsx(l,{className:"!pr-2 !text-[0.9rem] text-slate-700",children:"تا ساعت"}),e.jsx(x,{value:n,onChange:t=>t&&S(t)})]}),e.jsx(r,{item:!0,xs:12,children:e.jsx(c,{direction:"row",justifyContent:"center",children:e.jsxs(w,{type:"button",onClick:y,className:"W-[200px] flex items-center gap-1",children:[e.jsx(N.PrintIcon,{}),"نمایش و چاپ"]})})})]})]})}),e.jsx(k,{open:T,modalTitle:"گزارش",pdfSource:g,onClose:()=>m(!1),modalWidth:"lg",pdfWidth:"1500",pdfHeight:"880",fullScreenMode:!0})]})};export{W as default};
