Files
Rasadyar_FrontEnd/build/assets/DownloadReport-B1ClAw4a.js

2 lines
13 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{j as u,p as O,b as z,T as s,am as P}from"./mui-vendor-CkIVaoQP.js";import{r as L,j as _}from"./react-vendor-CmFgShSM.js";import{n as G,o as J,p as E,q as Q,j as $,t as V,G as I,v as N}from"./index-Cr86_nOs.js";import{a as U,u as X}from"./redux-vendor-B7uoacJt.js";import{l as K}from"./ChickenLogo-BK6_Z2uq.js";const l={page:{width:"210mm",height:"297mm",display:"flex",margin:"0 auto",flexDirection:"column",position:"relative",direction:"rtl",fontFamily:"nazanin",fontWeight:"bold"},container:{width:"95%",alignSelf:"center",pageBreakInside:"avoid"},invoiceTable:{width:"100%",borderCollapse:"collapse",alignSelf:"center"},tableCell:{border:"1px solid #000",pAlign:"left",textAlign:"center",fontSize:12},tableHeader:{pageBreakAfter:"auto"},headerRow:{color:"black",pageBreakInside:"avoid",pageBreakAfter:"auto"},tableRowEven:{backgroundColor:"rgba(170, 183, 255, 0.3)"},logo:{width:"60px",height:"auto",marginBottom:"10px"},contentContainer:{display:"flex",justifyContent:"space-between",marginTop:"20px",marginLeft:"100px",marginRight:"30px"},contentInLine:{display:"flex",flexDirection:"column",alignItems:"center"},mainTitle:{fontFamily:"nazanin",fontSize:11,pAlign:"center",fontWeight:"bolder"},signature:{display:"flex",flexDirection:"column",alignItems:"flex-end",marginLeft:"20px"},watermarkContainer:{position:"fixed",top:450,left:0,right:30,bottom:0,justifyContent:"center",alignItems:"center",opacity:.2,zIndex:-1},watermarkp:{fontSize:100,fontWeight:"bolder",color:"grey",transform:"rotate(-45deg)",left:"50%"},title:{fontSize:12,fontWeight:"bolder",pAlign:"center"},titleTopic:{marginTop:"10px",fontSize:12,fontWeight:"bolder",pAlign:"center"},firsttitle:{fontSize:14,fontWeight:"bolder",marginLeft:"40px",pAlign:"center"},options:{padding:"10px",marginTop:"15px",display:"flex",flexDirection:"column",alignItems:"flex-start"},divider:{width:"100%",height:"2px",backgroundColor:"red",marginBottom:5},pTitleContainer:{pAlign:"right",margin:"15px",textAlign:"justify",textJustify:"inter-word"},tableHeaderCell:{backgroundColor:"rgba(255, 229, 153, 0.5)",fontSize:12,border:"1px solid #000",padding:"4px",textAlign:"center",fontWeight:"bold"}},W=L.forwardRef((o,D)=>{const{sDate:F}=o,{date:r}=o,{fnumber:H}=o,{receiver:B}=o,{item:v}=o,{itemOutProvince:w}=o,f=G(),S=J();return u.jsxs("div",{ref:D,children:[u.jsxs("div",{style:l.page,children:[u.jsxs("div",{style:l.contentContainer,children:[u.jsxs("div",{style:l.contentInLine,children:[u.jsx("img",{alt:"logo",src:K,style:l.logo}),u.jsx("span",{style:l.mainTitle,children:"اتحادیه سراسری تعاونی‌های کشاورزی پرورش دهندگان مرغ گوشتی ایران"}),u.jsxs("span",{style:l.title,children:["اتحادیه شرکت های تعاونی کشاورزی مرغداران "," "," ",f]})]}),u.jsx("div",{children:u.jsx("span",{style:l.firsttitle,children:"بسمه تعالی"})}),u.jsxs("div",{style:l.options,children:[u.jsxs("span",{style:l.title,children:["شماره: ",H]}),u.jsxs("span",{style:l.titleTopic,children:["تاریخ: ",E(r)]}),u.jsx("span",{style:l.titleTopic,children:"پیوست: -"})]})]}),u.jsx("hr",{style:l.divider}),u.jsxs("p",{style:l.pTitleContainer,children:[u.jsxs("strong",{style:{fontSize:"20px"},children:[B,u.jsx("br",{}),"با سلام",u.jsx("br",{})]}),"احتراماً گزارش تخصیص مورخ ",E(F),"، مرغ گوشتی استان جهت استحضار بحضورتان ارسال میگردد."]}),u.jsx("div",{style:l.container,children:u.jsxs("table",{style:l.invoiceTable,children:[u.jsx("thead",{style:l.tableHeader,children:u.jsxs("tr",{style:l.headerRow,children:[u.jsx("th",{style:l.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:l.tableHeaderCell,children:"نام خریدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"تلفن"}),u.jsx("th",{style:l.tableHeaderCell,children:"شهر"}),u.jsx("th",{style:l.tableHeaderCell,children:"مرغدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"تلفن"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعداد"}),u.jsx("th",{style:l.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:l.tableHeaderCell,children:"جمع کل"})]})}),u.jsx("tbody",{children:v==null?void 0:v.map((e,d)=>{var c;return(c=e==null?void 0:e.provinceKillRequest)==null?void 0:c.map((t,i)=>{var C,h,x,n,y,j,p,A,b,g;return u.jsxs("tr",{style:d%2===0?l.tableRowEven:{},children:[i===0&&u.jsxs(u.Fragment,{children:[u.jsx("td",{style:l.tableCell,rowSpan:(C=e==null?void 0:e.provinceKillRequest)==null?void 0:C.length,children:d+1}),u.jsx("td",{style:l.tableCell,rowSpan:(h=e==null?void 0:e.provinceKillRequest)==null?void 0:h.length,children:e==null?void 0:e.name}),u.jsx("td",{style:l.tableCell,rowSpan:(x=e==null?void 0:e.provinceKillRequest)==null?void 0:x.length,children:(y=(n=e==null?void 0:e.killHouseOperator)==null?void 0:n.user)==null?void 0:y.mobile}),u.jsx("td",{style:l.tableCell,rowSpan:(j=e==null?void 0:e.provinceKillRequest)==null?void 0:j.length,children:(b=(A=(p=e==null?void 0:e.killHouseOperator)==null?void 0:p.user)==null?void 0:A.city)==null?void 0:b.cityName})]}),u.jsx("td",{style:l.tableCell,children:t==null?void 0:t.poultry}),u.jsx("td",{style:l.tableCell,children:t==null?void 0:t.poultryMobile}),u.jsx("td",{style:l.tableCell,children:t==null?void 0:t.quantity}),u.jsx("td",{style:l.tableCell,children:t==null?void 0:t.IndexWeight}),i===0&&u.jsx("td",{style:l.tableCell,rowSpan:(g=e==null?void 0:e.provinceKillRequest)==null?void 0:g.length,children:e==null?void 0:e.totalQuantity})]},`${d}-${i}`)})})})]})})]}),u.jsxs("div",{style:l.page,children:[u.jsxs("div",{style:l.contentContainer,children:[u.jsxs("div",{style:l.contentInLine,children:[u.jsx("img",{alt:"logo",src:K,style:l.logo}),u.jsx("span",{style:l.mainTitle,children:"اتحادیه سراسری تعاونی‌های کشاورزی پرورش دهندگان مرغ گوشتی ایران"}),u.jsxs("span",{style:l.title,children:["اتحادیه شرکت های تعاونی کشاورزی مرغداران "," "," ",f]})]}),u.jsx("div",{children:u.jsx("span",{style:l.firsttitle,children:"بسمه تعالی"})}),u.jsxs("div",{style:l.options,children:[u.jsxs("span",{style:l.title,children:["شماره: ",H]}),u.jsxs("span",{style:l.titleTopic,children:["تاریخ: ",E(r)]}),u.jsx("span",{style:l.titleTopic,children:"پیوست: -"})]})]}),u.jsx("hr",{style:l.divider}),u.jsx("p",{style:l.pTitleContainer,children:u.jsxs("strong",{style:{fontSize:"20px"},children:["گزارش فروش خارج از استان مورخ ",E(F)]})}),u.jsx("div",{style:l.container,children:u.jsxs("table",{style:l.invoiceTable,children:[u.jsx("thead",{style:l.tableHeader,children:u.jsxs("tr",{style:l.headerRow,children:[u.jsx("th",{style:l.tableHeaderCell,children:"ردیف"}),u.jsx("th",{style:l.tableHeaderCell,children:"نام مرغدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"نام خریدار"}),u.jsx("th",{style:l.tableHeaderCell,children:"تلفن"}),u.jsx("th",{style:l.tableHeaderCell,children:"شهر"}),u.jsx("th",{style:l.tableHeaderCell,children:"میانگین وزن"}),u.jsx("th",{style:l.tableHeaderCell,children:"تعداد کل"}),u.jsx("th",{style:l.tableHeaderCell,children:"نوع"})]})}),u.jsx("tbody",{children:w==null?void 0:w.map((e,d)=>{var c,t,i,C,h,x,n;return u.jsxs("tr",{style:d%2===0?l.tableRowEven:{},children:[u.jsx("td",{style:l.tableCell,children:d+1}),u.jsxs("td",{style:l.tableCell,children:[(c=e==null?void 0:e.poultry)==null?void 0:c.unitName," (",(i=(t=e==null?void 0:e.poultry)==null?void 0:t.user)==null?void 0:i.mobile,")"]}),u.jsxs("td",{style:l.tableCell,children:[(C=e==null?void 0:e.buyer)==null?void 0:C.firstName," ",(h=e==null?void 0:e.buyer)==null?void 0:h.lastName]}),u.jsx("td",{style:l.tableCell,children:(x=e==null?void 0:e.buyer)==null?void 0:x.mobile}),u.jsx("td",{style:l.tableCell,children:(n=e==null?void 0:e.buyer)==null?void 0:n.city}),u.jsx("td",{style:l.tableCell,children:e==null?void 0:e.IndexWeight}),u.jsx("td",{style:l.tableCell,children:e==null?void 0:e.quantity}),u.jsx("td",{style:l.tableCell,children:e!=null&&e.freezing?"انجماد":"معمولی"})]},d)})})]})}),u.jsx("div",{style:l.container,children:u.jsxs("span",{style:{color:"gray",fontSize:"12px"},children:["این گزارش در تاریخ ",E(r)," و ساعت"," ",Q(r)," صادر شده است."]})}),u.jsxs("div",{style:{flexDirection:"row",marginTop:"20px"},children:[u.jsx("div",{style:l.signature,children:u.jsxs("div",{style:l.contentInLine,children:[u.jsx("span",{style:l.title,children:S}),u.jsxs("span",{style:l.title,children:["مدیرعامل اتحادیه مرغداران"," ",f]})]})}),u.jsx("div",{style:l.watermarkContainer,children:u.jsx("p",{style:l.watermarkp,children:"سامانه رصدیار "})})]})]})]})});W.displayName="ProvinceSendLetterFactorReport";W.propTypes={item:O.PropTypes.any};const Z=U("PROVINCE_GET_ALLOCATION_LETTER",async(o,{dispatch:D})=>{const{data:F,status:r}=await $.get("province_request_letter/?date="+o);return{data:F,status:r}}),lu=()=>{var f,S,e,d,c,t,i,C,h,x;const o={box:{border:"1px solid #ccc",borderRadius:"4px",padding:"10px",marginBottom:"20px"},innerBox:{border:"1px solid #eee",borderRadius:"4px",padding:"5px",marginBottom:"5px",backgroundColor:"#fbfbea"}},{name:D}=_(),F=L.useRef(),[r,H]=L.useState(null),B=X(),v=()=>{try{const n=B(Z(N(new Date).format("YYYY-MM-DD")));H(n)}catch(n){console.error(n)}},w=V.useReactToPrint({content:()=>F.current,documentTitle:"گزارش کشتار روزانه"});return L.useEffect(()=>{D==="ds"&&v()},[]),u.jsx(z,{children:u.jsxs("div",{style:{marginTop:"10px"},children:[u.jsx("h4",{style:{textDecoration:"underline",color:"blue",cursor:"pointer"},onClick:()=>{w()},children:"جهت دانلود گزارش بصورت فایل پی دی اف کلیک کنید."}),u.jsx(I,{container:!0,xs:12,justifyContent:"center",children:u.jsxs(I,{container:!0,xs:10,spacing:2,justifyContent:"start",children:[(e=(S=(f=r==null?void 0:r.payload)==null?void 0:f.data)==null?void 0:S.allocation)==null?void 0:e.map((n,y)=>{var j,p,A,b,g,T;return u.jsx(I,{xs:12,sm:3,lg:2,children:u.jsxs(z,{style:o.box,children:[u.jsxs(s,{color:"primary",variant:"h6",children:["ردیف: ",y+1]}),u.jsxs(s,{children:["نام خریدار: ",n==null?void 0:n.name]}),u.jsxs(s,{children:["تلفن: ",(p=(j=n==null?void 0:n.killHouseOperator)==null?void 0:j.user)==null?void 0:p.mobile]}),u.jsxs(s,{children:["شهر: ",(g=(b=(A=n==null?void 0:n.killHouseOperator)==null?void 0:A.user)==null?void 0:b.city)==null?void 0:g.cityName]}),u.jsxs(s,{children:["تعداد کل: ",n==null?void 0:n.totalQuantity]}),u.jsx(P,{}),u.jsx(s,{color:"error",variant:"subtitle1",children:"جزئیات سفارش"}),(T=n==null?void 0:n.provinceKillRequest)==null?void 0:T.map((a,Y)=>u.jsxs(z,{style:o.innerBox,children:[u.jsxs(s,{children:["مرغدار: ",a==null?void 0:a.poultry]}),u.jsxs(s,{children:["تلفن مرغدار: ",a==null?void 0:a.poultryMobile]}),u.jsxs(s,{children:["تعداد: ",a==null?void 0:a.quantity]}),u.jsxs(s,{children:["میانگین وزن: ",a==null?void 0:a.IndexWeight]})]},Y))]})},y)}),(t=(c=(d=r==null?void 0:r.payload)==null?void 0:d.data)==null?void 0:c.outProvince)==null?void 0:t.map((n,y)=>{var j,p,A,b,g,T,a,Y,M;return u.jsx(I,{xs:12,sm:3,lg:2,children:u.jsxs(z,{style:o.box,children:[u.jsxs(s,{color:"primary",variant:"h6",children:["ردیف: ",((p=(j=r==null?void 0:r.payload)==null?void 0:j.data)==null?void 0:p.allocation.length)+y+1]}),u.jsx(s,{color:"error",variant:"subtitle1",children:"فروش خارج از استان"}),u.jsx(P,{}),u.jsxs(s,{children:["نام مرغدار: ",(A=n==null?void 0:n.poultry)==null?void 0:A.unitName," (",(g=(b=n==null?void 0:n.poultry)==null?void 0:b.user)==null?void 0:g.mobile,")"]}),u.jsxs(s,{children:["نام خریدار: ",(T=n==null?void 0:n.buyer)==null?void 0:T.firstName," ",(a=n==null?void 0:n.buyer)==null?void 0:a.lastName]}),u.jsxs(s,{children:["تلفن: ",(Y=n==null?void 0:n.buyer)==null?void 0:Y.mobile]}),u.jsxs(s,{children:["شهر: ",(M=n==null?void 0:n.buyer)==null?void 0:M.city]}),u.jsxs(s,{children:["میانگین وزن: ",n==null?void 0:n.IndexWeight]}),u.jsxs(s,{children:["تعداد کل: ",n==null?void 0:n.quantity]}),u.jsxs(s,{children:["نوع: ",n!=null&&n.freezing?"انجماد":"معمولی"]})]})},y)})]})}),u.jsx("div",{style:{visibility:"hidden",position:"absolute",overflow:"hidden",width:0,height:0},children:u.jsx("div",{style:{width:"100%"},children:u.jsx(W,{ref:F,sDate:N(new Date).format("YYYY-MM-DD"),date:N(new Date).format("YYYY-MM-DD hh:mm:ss"),fnumber:N(new Date).format("YYYYMMDD"),receiver:"معاونت محترم بهبود تولیدات دامی سازمان جهاد کشاورزی استان ",item:(C=(i=r==null?void 0:r.payload)==null?void 0:i.data)==null?void 0:C.allocation,itemOutProvince:(x=(h=r==null?void 0:r.payload)==null?void 0:h.data)==null?void 0:x.outProvince})})})]})})};export{lu as default};