Files
Rasadyar_FrontEnd/build/assets/CityHatchingInfo-CZPJ_c_O.js
2026-01-19 15:40:45 +03:30

3 lines
48 KiB
JavaScript
Raw 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{i as P6,j as r,ak as k,B as N,a3 as Y,a9 as m6,b as H6,T as _,I as au,b0 as u0,an as a0,d as f,b4 as P,ap as B,aq as W,aX as b0,am as q6,ar as K6}from"./mui-vendor-CkIVaoQP.js";import{r as B6,A as V,dn as E0,c as r0,dp as D0,fT as k0,fU as _0,C as Q6,b as R0,L as K,j as R,h as w,u as o0,M as R6,N as M6,O as U,X as d,a7 as n0,fj as H0,_ as q,p as Z,V as T6,c5 as s0,fJ as l0,fK as e0,fL as C0,fM as t0,fN as c0,fO as d0,fP as T0,G as p,S as N0,fQ as m,v as uu,fV as P0,W as N6,fW as B0}from"./index-CeyyVc1v.js";import{r as c,u as A0}from"./react-vendor-CmFgShSM.js";import{a as E6,R as g0}from"./index.esm-Bu7XMDZU.js";import{u as G,a as p0,f as I}from"./redux-vendor-B7uoacJt.js";import{d as W0}from"./Add--yVWBJhC.js";import{C as w0}from"./CityNewKillRequest-C2SXYvKb.js";import{b as h0,c as z0,C as y0,d as q0,V as K0,e as Q0,a as M0}from"./CityHatchingsArchiveOperations-DQ9mbEeF.js";import{d as x0}from"./Tune-D4M2CAhp.js";import{d as O0}from"./Sms-DasNClAG.js";import{d as v0}from"./Edit-CqBj1Y2L.js";import{d as Y0}from"./Delete-C5MyLelE.js";import{R as ru}from"./ResponsiveTable-w7hk7Uq8.js";import{S as i0}from"./SimpleTable-DBAoNnCU.js";import{S as F0}from"./ShowImage-CqhU2hmk.js";import{d as U0}from"./ToggleOffOutlined-Ch26Umk7.js";import{d as I0}from"./ToggleOn-pBgb8alR.js";var O6={},V0=P6;Object.defineProperty(O6,"__esModule",{value:!0});var j0=O6.default=void 0,G0=V0(B6()),X0=r;j0=O6.default=(0,G0.default)((0,X0.jsx)("path",{d:"M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m0 15-5-5h3V9h4v4h3z"}),"AssignmentReturned");const J0=r0().shape({looses_amount:R0().required("این فیلد اجباری است!").min(0,"عدد مثبت وارد کنید!")}),Z0=({updateTable:o,item:n})=>{const h=G(),[C]=c.useContext(V),F=(t,{resetForm:s})=>{h(h0({key:n==null?void 0:n.key,direct_losses:t.looses_amount})).then(l=>{l.payload.error?C({vertical:"top",horizontal:"center",msg:l.payload.error,severity:"error"}):(C({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(),h(Q6()))}),s()};return r.jsx("div",{children:r.jsx(E0,{initialValues:{looses_amount:""},validationSchema:J0,onSubmit:F,children:({handleChange:t,handleBlur:s})=>r.jsxs(D0,{children:[r.jsx(k0,{as:k,name:"looses_amount",label:"حجم تلفات",type:"number",onChange:t,onBlur:s,fullWidth:!0,variant:"outlined",margin:"normal",helperText:r.jsx(_0,{name:"looses_amount"})}),r.jsx(N,{type:"submit",variant:"contained",color:"primary",fullWidth:!0,children:"ثبت"})]})})})};var Y6={},m0=P6;Object.defineProperty(Y6,"__esModule",{value:!0});var S0=Y6.default=void 0,u2=m0(B6()),a2=r;S0=Y6.default=(0,u2.default)((0,a2.jsx)("path",{d:"M14 10H3v2h11zm0-4H3v2h11zM3 16h7v-2H3zm11.41 6L17 19.41 19.59 22 21 20.59 18.41 18 21 15.41 19.59 14 17 16.59 14.41 14 13 15.41 15.59 18 13 20.59z"}),"PlaylistRemove");const r2=p0("CITY_SUBMIT_MANAGE_HATCHING_RENTER_SERVICE",async(o,{dispatch:n})=>{n(K());const{data:h,status:C}=await R.put("/poultry_hatching/0/",o);return n(w()),{data:h,status:C}}),o2=p0("CITY_HATCHING_DELETE_RENTER_SERVICE",async(o,{dispatch:n})=>{n(K());try{const{data:h,status:C}=await R.put("poultry_hatching/0/",o);return n(w()),{data:h,status:C}}catch(h){return n(w()),{error:h.response.data.result}}}),n2=({item:o,updateTable:n,readOnly:h})=>{const[C,F]=c.useState(!1),t=G(),[s]=c.useContext(V),l=o0({initialValues:{fullName:(o==null?void 0:o.tenantFullname)||"",nationalCode:(o==null?void 0:o.tenantNationalCode)||"",phoneNumber:(o==null?void 0:o.tenantMobile)||"",city:(o==null?void 0:o.tenantCity)||""},validationSchema:r0({fullName:R6().required("نام و نام خانوادگی الزامی است"),nationalCode:R6().required("کد ملی الزامی است").matches(/^[0-9]{10}$/,"کد ملی باید 10 رقم باشد"),phoneNumber:R6().required("شماره تلفن الزامی است").matches(/^[0-9]{11}$/,"شماره تلفن باید 11 رقم باشد"),city:R6().required("شهر الزامی است")}),onSubmit:x=>{t(K()),t(r2({key:o==null?void 0:o.key,tenant_fullname:x.fullName,tenant_national_code:x.nationalCode,tenant_mobile:x.phoneNumber,tenant_city:x.city,has_tenant:!0})).then($=>{t(Q6()),$.payload.error?s({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(s({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),l.resetForm(),n(),F(!1)),t(w())})},enableReinitialize:!0}),i=()=>{F(!0)},H=()=>{t(K()),t(o2({delete_tenant:!0,key:o==null?void 0:o.key})).then(x=>{t(Q6()),x.payload.error||(s({vertical:"top",horizontal:"center",msg:"مستاجر با موفقیت حذف شد.",severity:"success"}),l.resetForm(),n())})},y=(o==null?void 0:o.hasTenant)&&(o==null?void 0:o.tenantFullname);return r.jsx(Y,{container:!0,spacing:3,direction:"column",children:y&&!C?r.jsx(Y,{item:!0,children:r.jsx(m6,{elevation:3,children:r.jsxs(H6,{p:2,display:"flex",justifyContent:"space-between",alignItems:"center",children:[r.jsxs("div",{children:[r.jsxs(_,{variant:"subtitle1",children:[r.jsx("strong",{children:"نام مستاجر:"})," ",o.tenantFullname]}),r.jsxs(_,{variant:"body2",children:[r.jsx("strong",{children:"کد ملی:"})," ",o.tenantNationalCode]}),r.jsxs(_,{variant:"body2",children:[r.jsx("strong",{children:"شماره تلفن:"})," ",o.tenantMobile]}),r.jsxs(_,{variant:"body2",children:[r.jsx("strong",{children:"شهر:"})," ",o.tenantCity]})]}),!h&&r.jsxs("div",{children:[r.jsx(au,{onClick:i,color:"primary",children:r.jsx(v0,{})}),r.jsx(au,{onClick:H,color:"error",children:r.jsx(Y0,{})})]})]})})}):r.jsx(Y,{item:!0,children:r.jsx(m6,{elevation:3,children:r.jsxs(H6,{p:2,component:"form",onSubmit:l.handleSubmit,children:[r.jsxs(Y,{container:!0,spacing:2,children:[r.jsx(Y,{item:!0,xs:12,md:4,children:r.jsx(k,{fullWidth:!0,label:"نام و نام خانوادگی",name:"fullName",value:l.values.fullName,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.fullName&&!!l.errors.fullName,helperText:l.touched.fullName&&l.errors.fullName,disabled:h})}),r.jsx(Y,{item:!0,xs:12,md:4,children:r.jsx(k,{fullWidth:!0,label:"کد ملی",name:"nationalCode",value:l.values.nationalCode,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.nationalCode&&!!l.errors.nationalCode,helperText:l.touched.nationalCode&&l.errors.nationalCode,disabled:h})}),r.jsx(Y,{item:!0,xs:12,md:4,children:r.jsx(k,{fullWidth:!0,label:"شماره تلفن",name:"phoneNumber",value:l.values.phoneNumber,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.phoneNumber&&!!l.errors.phoneNumber,helperText:l.touched.phoneNumber&&l.errors.phoneNumber,disabled:h})}),r.jsx(Y,{item:!0,xs:12,md:4,children:r.jsx(k,{fullWidth:!0,label:"شهر",name:"city",value:l.values.city,onChange:l.handleChange,onBlur:l.handleBlur,error:l.touched.city&&!!l.errors.city,helperText:l.touched.city&&l.errors.city,disabled:h})})]}),!h&&r.jsx(H6,{mt:2,children:r.jsx(N,{type:"submit",variant:"contained",color:"primary",disabled:l.isSubmitting,children:y?"ذخیره تغییرات":"ثبت اطلاعات"})})]})})})})};var U6={},s2=P6;Object.defineProperty(U6,"__esModule",{value:!0});var f0=U6.default=void 0,l2=s2(B6()),e2=r;f0=U6.default=(0,l2.default)((0,e2.jsx)("path",{d:"M13 8c0-2.21-1.79-4-4-4S5 5.79 5 8s1.79 4 4 4 4-1.79 4-4m2 2v2h3v3h2v-3h3v-2h-3V7h-2v3zM1 18v2h16v-2c0-2.66-5.33-4-8-4s-8 1.34-8 4"}),"PersonAddAlt1");var I6={},C2=P6;Object.defineProperty(I6,"__esModule",{value:!0});var $0=I6.default=void 0,t2=C2(B6()),c2=r;$0=I6.default=(0,t2.default)((0,c2.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow");const d2=({item:o,selectedAge1:n,selectedAge2:h,updateTable:C,readOnly:F})=>{const{userProfile:t}=I(S=>S.userSlice),s=G(),[l,i]=c.useState(null),H=S=>{i(S.currentTarget)},y=()=>{i(null)},x=!!l,$=x?"popover":void 0,[j]=c.useContext(V);return r.jsxs("div",{children:[r.jsx(au,{"aria-describedby":$,variant:"contained",color:"primary",onClick:H,children:r.jsx(x0,{})}),r.jsx(u0,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:$,open:x,anchorEl:l,onClose:y,children:r.jsxs(a0,{sx:{py:1,minWidth:200},children:[!F&&r.jsxs(r.Fragment,{children:[r.jsx(f,{title:"ثبت درخواست کشتار",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(M6({right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,title:"ثبت درخواست کشتار جدید",content:r.jsx(w0,{selectedAge1:n,selectedAge2:h,userCheck:o.poultry.userprofile.baseOrder,updateTable:C})}))},children:[r.jsx(B,{sx:{minWidth:36,color:"secondary.main"},children:r.jsx(W0,{fontSize:"small"})}),r.jsx(W,{primary:"ثبت درخواست کشتار",primaryTypographyProps:{variant:"body2"}})]})}),(o==null?void 0:o.InteractTypeName)==="مستاجر"&&r.jsx(f,{title:"ثبت مستاجر",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(U({title:"ثبت مستاجر ",content:r.jsx(n2,{item:o,updateTable:C})}))},children:[r.jsx(B,{sx:{minWidth:36,color:"primary.main"},children:r.jsx(f0,{fontSize:"small"})}),r.jsx(W,{primary:"ثبت مستاجر",primaryTypographyProps:{variant:"body2"}})]})}),(d()==="ProvinceOperator"||d()==="CityOperator"||d()==="CityPoultry"||d()==="CityJahad"||d()==="CityCommerce"||d()==="AdminX"||d()==="SuperAdmin")&&r.jsx(f,{title:o!=null&&o.violationReport?"ویرایش گزارش":"ثبت گزارش",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(U({title:o!=null&&o.violationReport?"ویرایش گزارش":"ثبت گزارش",content:r.jsx(z0,{updateTable:C,item:o})}))},children:[r.jsx(B,{sx:{minWidth:36,color:"primary.main"},children:r.jsx(v0,{fontSize:"small"})}),r.jsx(W,{primary:o!=null&&o.violationReport?"ویرایش گزارش":"ثبت گزارش",primaryTypographyProps:{variant:"body2"}})]})}),r.jsx(f,{title:"انتقال به بایگانی",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(M6({title:"انتقال به آرشیو",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:r.jsx(y0,{selectedAge1:n,selectedAge2:h,item:o,updateTable:C})}))},children:[r.jsx(B,{sx:{minWidth:36,color:"primary.main"},children:r.jsx(n0,{fontSize:"small"})}),r.jsx(W,{primary:"انتقال به بایگانی",primaryTypographyProps:{variant:"body2"}})]})}),(d()==="ProvinceOperator"||d()==="CityOperator"||d()==="AdminX"||d()==="SuperAdmin")&&r.jsx(f,{title:"ثبت تلفات",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(U({title:"ثبت تلفات",content:r.jsx(Z0,{updateTable:C,item:o})}))},children:[r.jsx(B,{sx:{minWidth:36,color:"error.main"},children:r.jsx(S0,{fontSize:"small"})}),r.jsx(W,{primary:"ثبت تلفات",primaryTypographyProps:{variant:"body2"}})]})}),r.jsx(f,{title:o!=null&&o.violation?"بازگشت از تخلف":"جوجه ریزی متخلف",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(h0({key:o==null?void 0:o.key,violation:!(o!=null&&o.violation)})).then(S=>{S.payload.error?j({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(C(),j({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:[r.jsx(B,{sx:{minWidth:36,color:o!=null&&o.violation?"primary.main":"error.main"},children:o!=null&&o.violation?r.jsx(H0,{fontSize:"small"}):r.jsx(j0,{fontSize:"small"})}),r.jsx(W,{primary:o!=null&&o.violation?"بازگشت از تخلف":"جوجه ریزی متخلف",primaryTypographyProps:{variant:"body2"}})]})})]}),(d()==="VetFarm"||d()==="CityVet"||d()==="VetSupervisor")&&r.jsx(f,{title:"ثبت تلفات پایان دوره",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(U({title:"ثبت تلفات پایان دوره",content:r.jsx(K0,{item:o,updateTable:C})}))},children:[r.jsx(B,{sx:{minWidth:36,color:"error.main"},children:r.jsx(q0,{fontSize:"small"})}),r.jsx(W,{primary:"ثبت تلفات پایان دوره",primaryTypographyProps:{variant:"body2"}})]})}),r.jsx(f,{title:"خروجی اکسل",placement:"left-start",children:r.jsxs(P,{component:"a",href:`${R.defaults.baseURL}process-for-each-hatching/?key=${o.key}`,rel:"noreferrer",children:[r.jsx(B,{sx:{minWidth:36,color:"success.main"},children:r.jsx(E6,{size:18})}),r.jsx(W,{primary:"خروجی اکسل",primaryTypographyProps:{variant:"body2"}})]})}),r.jsx(f,{title:"تیکت گزارش کشتار جوجه ریزی",placement:"left-start",children:r.jsxs(P,{onClick:()=>{y(),s(Q0({licence_number:o==null?void 0:o.licenceNumber,mobile:t==null?void 0:t.mobile})).then(S=>{S.payload.error?j({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(C(),j({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:[r.jsx(B,{sx:{minWidth:36,color:"error.main"},children:r.jsx(O0,{fontSize:"small"})}),r.jsx(W,{primary:"تیکت گزارش کشتار",primaryTypographyProps:{variant:"body2"}})]})})]})})]})},k2=({item:o,selectedAge1:n,selectedAge2:h,updateTable:C,readOnly:F})=>{const t=G(),[s]=c.useContext(V),[l,i]=c.useState(null),H=!!l,y=H?"archive-activate-popover":void 0,x=L=>{F||i(L.currentTarget)},$=()=>{i(null)},j=()=>{F||($(),t(M6({title:"انتقال به آرشیو",right:!(window.innerWidth<=600),bottom:window.innerWidth<=600,content:r.jsx(y0,{selectedAge1:n,selectedAge2:h,item:o,updateTable:C})})))},S=async()=>{var L,b,Q,T;if(!F){t(K());try{const{data:v}=await R.put("poultry_hatching/0/",{key:o==null?void 0:o.key,unknown:!1});if(t(w()),v!=null&&v.error){s({vertical:"top",horizontal:"center",msg:(v==null?void 0:v.error)||"فعال‌سازی ناموفق بود.",severity:"error"});return}C(),$(),s({vertical:"top",horizontal:"center",msg:"فعال‌سازی با موفقیت انجام شد.",severity:"success"})}catch(v){t(w());const M=((b=(L=v==null?void 0:v.response)==null?void 0:L.data)==null?void 0:b.result)||((T=(Q=v==null?void 0:v.response)==null?void 0:Q.data)==null?void 0:T.error)||(v==null?void 0:v.message)||"فعال‌سازی ناموفق بود.";s({vertical:"top",horizontal:"center",msg:M,severity:"error"}),$()}}};return r.jsxs(r.Fragment,{children:[r.jsx(au,{"aria-describedby":y,color:"primary",onClick:x,size:"small",disabled:F,children:r.jsx(x0,{})}),r.jsx(u0,{id:y,open:H,anchorEl:l,onClose:$,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:r.jsxs(a0,{sx:{py:1,minWidth:160},children:[r.jsxs(P,{onClick:j,disabled:F,children:[r.jsx(B,{sx:{minWidth:36,color:"primary.main"},children:r.jsx(n0,{fontSize:"small"})}),r.jsx(W,{primary:"بایگانی",primaryTypographyProps:{variant:"body2"}})]}),r.jsxs(P,{onClick:S,disabled:F,children:[r.jsx(B,{sx:{minWidth:36,color:"success.main"},children:r.jsx($0,{fontSize:"small"})}),r.jsx(W,{primary:"فعال سازی",primaryTypographyProps:{variant:"body2"}})]})]})})]})},_2=({readOnly:o})=>{var su,lu,eu,Cu,tu,cu,du,Au,gu,g,a,z,pu,hu;const n=G(),h=o||!1,[C,F]=c.useState(0),[t,s]=c.useState(0),[l,i]=c.useState([]),[H,y]=c.useState(0),[x,$]=c.useState(10),[j,S]=c.useState(""),[L,b]=c.useState(1),[Q,T]=c.useState([]),v=I(A=>A.userSlice.userProfile.key),M=A0(),[X]=c.useContext(V),E=A=>{S(A.target.value)},D=I(A=>A.citySlice.hatchingAdded);c.useEffect(()=>{O(1)},[D]);const O=async A=>{n(K());const u=await R.get(`poultry_hatching?search=filter&value=${j}&role=${d()}&page=${A}&page_size=${x}&age1=${C||0}&age2=${t||0}&search=filter&value=${j}`);n(w()),i(u.data.results),y(u.data.count)},W6=A=>{O(A),b(A)},w6=A=>{$(A),b(1)};c.useEffect(()=>{O(1)},[n,x]);const z6=()=>{O(L!==0?L:1)};c.useEffect(()=>{const A=l==null?void 0:l.map((u,J)=>{var yu,xu,vu,iu,Fu,ju,Su,fu,$u,Lu,bu,Eu,Du,ku,_u,Ru,Hu,Tu,Nu,Pu,Bu,Wu,wu,zu,qu,Ku,Qu,Mu,Ou,Yu,Uu,Iu,Vu,Gu,Xu,Ju,Zu,mu,u6,a6,r6,o6,n6,s6,l6,e6,C6,t6,c6,d6,A6,g6,p6,h6,y6,x6,v6,i6,F6,j6,S6,f6,$6,L6,b6,V6,G6,X6,J6;return[r.jsx(d2,{selectedAge1:null,selectedAge2:null,updateTable:z6,item:u,readOnly:h},"4"),r.jsx(f,{placement:"left",title:"جزئیات جوجه ریزی",children:r.jsx(au,{color:"primary",onClick:()=>{M(d()==="AdminX"?`${l0}/${u.key}`:d()==="Supporter"?`${e0}/${u.key}`:d()==="SuperAdmin"?`${C0}/${u.key}`:d()==="CityPoultry"?`${t0}/${u.key}`:d()==="ProvinceSupervisor"?`${c0}/${u.key}`:d()==="ProvinceOperator"?`${d0}/${u.key}`:d()==="CityJahad"?`${T0}/${u.key}`:"")},children:r.jsx(s0,{})})},u==null?void 0:u.key),L===1?J+1:J+x*(L-1)+1,r.jsx(f,{disableHoverListener:!((yu=u==null?void 0:u.killingInfo)!=null&&yu.violationMessage&&(u!=null&&u.violation)),title:u!=null&&u.violation?`متن گزارش تخلف: ${(xu=u==null?void 0:u.killingInfo)==null?void 0:xu.violationMessage}`:null,sx:{"&:hover":{cursor:u!=null&&u.violation?"pointer":"default"}},placement:"top",children:r.jsx(_,{variant:"body2",color:u!=null&&u.violation?"error":"primary",children:u!=null&&u.violation?"پیگیری":"عادی"})},u==null?void 0:u.key),u==null?void 0:u.licenceNumber,(vu=u==null?void 0:u.poultry)==null?void 0:vu.breedingUniqueId,u==null?void 0:u.CertId,((iu=u==null?void 0:u.poultry)==null?void 0:iu.unitName)||"-",`${((ju=(Fu=u==null?void 0:u.poultry)==null?void 0:Fu.userprofile)==null?void 0:ju.fullName)??"-"} (${((fu=(Su=u==null?void 0:u.poultry)==null?void 0:Su.userprofile)==null?void 0:fu.mobile)??"-"}) ${u!=null&&u.violationReport?"✉️":""}`,u!=null&&u.InteractTypeName?r.jsx(_,{variant:"body2",color:u!=null&&u.hasTenant?"success.main":"",fontWeight:u!=null&&u.hasTenant?"bold":"normal",children:u==null?void 0:u.InteractTypeName}):"-",u==null?void 0:u.PersonTypeName,u==null?void 0:u.UnionTypeName,`${((bu=(Lu=($u=u==null?void 0:u.poultry)==null?void 0:$u.address)==null?void 0:Lu.city)==null?void 0:bu.name)??"-"}/${(Eu=u==null?void 0:u.poultry)!=null&&Eu.cityOperator?(Du=u==null?void 0:u.poultry)==null?void 0:Du.cityOperator:"بدون تعاونی"}`,(ku=u==null?void 0:u.vetFarm)!=null&&ku.vetFarmMobile?`${(_u=u==null?void 0:u.vetFarm)==null?void 0:_u.vetFarmFullName} (${(Ru=u==null?void 0:u.vetFarm)==null?void 0:Ru.vetFarmMobile})`:"-",u.hall,u.period,q(u==null?void 0:u.createDate),q(u==null?void 0:u.date),(Tu=(Hu=u==null?void 0:u.poultry)==null?void 0:Hu.killingAveAge)==null?void 0:Tu.toLocaleString(),u!=null&&u.predicateDate?Z(u==null?void 0:u.predicateDate):"-",u.chickenBreed,u.age,(Nu=u==null?void 0:u.quantity)==null?void 0:Nu.toLocaleString(),(Pu=u==null?void 0:u.increaseQuantity)==null?void 0:Pu.toLocaleString(),`${u.losses} (%${(u.losses*100/u.quantity).toFixed(0)})`,r.jsx(f,{placement:"top",title:"جهت مشاهده ثبت کننده تلفات کلیک کنید",children:r.jsx(N,{style:{color:"rgba(0,0,0,0.87)"},onClick:()=>{n(U({title:"ویرایش تعداد جوجه ریزی",content:r.jsx(p,{container:!0,xs:12,children:!(u!=null&&u.directLossesInputer)&&!(u!=null&&u.directLossesInputer)?r.jsx(_,{variant:"body1",children:"برای این جوجه ریزی تلفاتی ثبت نشده است."}):r.jsxs(p,{xs:12,children:[r.jsxs(_,{variant:"body1",children:["ثبت کننده تلفات اتحادیه:"," ",u!=null&&u.directLossesInputer?`${u==null?void 0:u.directLossesInputer} در تاریخ ${Z(u==null?void 0:u.directLossesDate)}`:" - "]}),r.jsxs(_,{variant:"body1",children:["ویرایش کننده تلفات اتحادیه:",u!=null&&u.directLossesEditor?`${u==null?void 0:u.directLossesEditor} در تاریخ ${Z(u==null?void 0:u.directLossesLastEditDate)}`:" - "]})]})})}))},children:`${(Bu=u==null?void 0:u.directLosses)==null?void 0:Bu.toLocaleString()} (%${(u.directLosses*100/u.quantity).toFixed(0)})`})},u==null?void 0:u.key),`${(Wu=u==null?void 0:u.totalLosses)==null?void 0:Wu.toLocaleString()} (%${(u.totalLosses*100/u.quantity).toFixed(0)})`,`${(wu=u==null?void 0:u.totalCommitmentQuantity)==null?void 0:wu.toLocaleString()}`,`${(zu=u==null?void 0:u.totalFreeCommitmentQuantity)==null?void 0:zu.toLocaleString()}`,`${(qu=u==null?void 0:u.governmentalQuantity)==null?void 0:qu.toLocaleString()}`,`${(Ku=u==null?void 0:u.governmentalKilledQuantity)==null?void 0:Ku.toLocaleString()}`,`${(Qu=u==null?void 0:u.freeQuantity)==null?void 0:Qu.toLocaleString()}`,`${(Mu=u==null?void 0:u.freeKilledQuantity)==null?void 0:Mu.toLocaleString()}`,`${(Ou=u==null?void 0:u.outProvinceKilledQuantity)==null?void 0:Ou.toLocaleString()}`,`${(Yu=u==null?void 0:u.outProvinceKilledWeight)==null?void 0:Yu.toLocaleString()}`,`${(Uu=u==null?void 0:u.barDifferenceRequestQuantity)==null?void 0:Uu.toLocaleString()}`,`${(Iu=u==null?void 0:u.barDifferenceRequestWeight)==null?void 0:Iu.toLocaleString()}`,`${(Gu=(Vu=u==null?void 0:u.killingInfo)==null?void 0:Vu.provinceKillRequests)==null?void 0:Gu.toLocaleString()}`,`${(Ju=(Xu=u==null?void 0:u.killingInfo)==null?void 0:Xu.provinceKillRequestsQuantity)==null?void 0:Ju.toLocaleString()}`,`${(mu=(Zu=u==null?void 0:u.killingInfo)==null?void 0:Zu.provinceKillRequestsWeight)==null?void 0:mu.toLocaleString()}`,((u6=u==null?void 0:u.killedQuantity)==null?void 0:u6.toLocaleString())+` (%${((u==null?void 0:u.killedQuantity)*100/u.quantity).toFixed(0)})`,(a6=u==null?void 0:u.leftOver)==null?void 0:a6.toLocaleString(),`%${((u==null?void 0:u.leftOver)*100/(u==null?void 0:u.quantity)).toFixed(0)}`,`%${(u.totalLosses*100/u.quantity).toFixed(0)}`,`%${((u==null?void 0:u.killedQuantity)*100/u.quantity).toFixed(0)}`,`%${((u==null?void 0:u.leftOver)*100/(u==null?void 0:u.quantity)).toFixed(0)}`,`%${(((u==null?void 0:u.killedQuantity)+(u==null?void 0:u.totalLosses))*100/(u==null?void 0:u.quantity)).toFixed(0)}`,u!=null&&u.samasatDischargePercentage?`%${u==null?void 0:u.samasatDischargePercentage}`:"-",(r6=u==null?void 0:u.totalCommitment)==null?void 0:r6.toLocaleString(),(o6=u==null?void 0:u.governmentalKilledQuantity)==null?void 0:o6.toLocaleString(),(n6=u==null?void 0:u.freeKilledQuantity)==null?void 0:n6.toLocaleString(),(s6=u==null?void 0:u.totalAverageKilledWeight)==null?void 0:s6.toLocaleString(),(l6=u==null?void 0:u.totalKilledWeight)==null?void 0:l6.toLocaleString(),(e6=u==null?void 0:u.activeKill)!=null&&e6.activeKill?"دارد":"ندارد",(C6=u==null?void 0:u.activeKill)!=null&&C6.countOfRequest?u.activeKill.countOfRequest:"-",(c6=(t6=u==null?void 0:u.killingInfo)==null?void 0:t6.killHouseRequests)==null?void 0:c6.toLocaleString(),(A6=(d6=u==null?void 0:u.killingInfo)==null?void 0:d6.killHouseRequestsFirstQuantity)==null?void 0:A6.toLocaleString(),(p6=(g6=u==null?void 0:u.killingInfo)==null?void 0:g6.killHouseRequestsFirstWeight)==null?void 0:p6.toLocaleString(),(y6=(h6=u==null?void 0:u.killingInfo)==null?void 0:h6.barCompleteWithKillHouse)==null?void 0:y6.toLocaleString(),(v6=(x6=u==null?void 0:u.killingInfo)==null?void 0:x6.acceptedRealWightFinal)==null?void 0:v6.toLocaleString(),(i6=u==null?void 0:u.chainKilledQuantity)==null?void 0:i6.toLocaleString(),(F6=u==null?void 0:u.chainKilledWeight)==null?void 0:F6.toLocaleString(),(j6=u==null?void 0:u.exportKilledQuantity)==null?void 0:j6.toLocaleString(),(S6=u==null?void 0:u.exportKilledWeight)==null?void 0:S6.toLocaleString(),($6=(f6=u==null?void 0:u.killingInfo)==null?void 0:f6.wareHouseBars)==null?void 0:$6.toLocaleString(),(b6=(L6=u==null?void 0:u.killingInfo)==null?void 0:L6.wareHouseBarsQuantity)==null?void 0:b6.toLocaleString(),(G6=(V6=u==null?void 0:u.killingInfo)==null?void 0:V6.wareHouseBarsWeight)==null?void 0:G6.toLocaleString(),(J6=(X6=u==null?void 0:u.killingInfo)==null?void 0:X6.wareHouseBarsWeightLose)==null?void 0:J6.toFixed(2),u.lastChange?`${u.lastChange.fullName} (${T6(u.lastChange.role)}) در تاریخ ${q(u.lastChange.date)}`:"-",u.latestHatchingChange?`${u.latestHatchingChange.fullName} (${T6(u.latestHatchingChange.role)}) در تاریخ ${q(u.latestHatchingChange.date)}`:"-",u!=null&&u.violationReport?r.jsx(N,{onClick:()=>{var Z6;n(U({title:"گزارش ",content:r.jsx(i0,{columns:["ثبت کننده","تاریخ ثبت","تخلف","متن گزارش","سند"],data:[[u==null?void 0:u.violationReporter,Z(u==null?void 0:u.violationReportDate),u!=null&&u.violation?"دارد":"ندارد",u==null?void 0:u.violationReport,r.jsx(p,{container:!0,xs:12,justifyContent:"center",gap:1,children:(Z6=u==null?void 0:u.violationImage)==null?void 0:Z6.map(L0=>r.jsx(F0,{src:L0},J))},u==null?void 0:u.key)]]})}))},children:"مشاهده گزارش"},u==null?void 0:u.key):"بدون گزارش"]});T(A)},[l]);const ou=async A=>{A.preventDefault(),n(K()),n(m({age1:C,age2:t,tab:"active",textValue:j}));try{const u=await R.get(`poultry_hatching/?role=${d()}&age1=${C||0}&age2=${t||0}&search=filter&value=${j}&page=1&page_size=${x}`);i(u.data.results),y(u.data.count),n(w())}catch(u){console.error("Error fetching data:",u)}},D6=async A=>{A.preventDefault(),F(0),s(0),n(K()),S(""),n(m({age1:0,age2:0,tab:"active",textValue:j}));try{const u=await R.get(`poultry_hatching?role=${d()}&page=${L}&page_size=${x}&search=filter&value=${j}`);i(u.data.results),y(u.data.count)}catch(u){console.error("Error fetching data:",u)}finally{n(w())}},[nu,k6]=c.useState();c.useEffect(()=>{async function A(){try{const u=await R.get("last_update/?type=poultry_hatching");k6(u.data)}catch(u){console.error("Error fetching data:",u)}}A()},[]);const _6=r.jsxs(p,{container:!0,alignItems:"center",justifyContent:"space-between",gap:2,paddingTop:2,mb:1,xs:12,mt:2,children:[r.jsx("form",{onSubmit:ou,style:{flex:1},children:r.jsxs(p,{container:!0,alignItems:"center",gap:N0.SMALL,xs:12,children:[r.jsx(p,{sx:{width:{xs:"72px",sm:"80px"}},children:r.jsx(k,{fullWidth:!0,size:"small",label:"از سن",id:"outlined-controlled",value:C,onChange:A=>{F(A.target.value)}})}),r.jsx(p,{sx:{width:{xs:"72px",sm:"80px"}},children:r.jsx(k,{fullWidth:!0,size:"small",label:"تا سن",id:"outlined-controlled",value:t,onChange:A=>{s(A.target.value)}})}),r.jsx(k,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",value:j,sx:{maxWidth:{xs:"100%",sm:250}},onChange:E,onKeyDown:A=>{A.key==="Enter"&&ou(A)}}),r.jsx(N,{type:"submit",endIcon:r.jsx(g0,{}),children:"جستجو"}),r.jsx(f,{title:"خروجی اکسل",px:0,children:r.jsx(N,{color:"success",onClick:()=>{X({vertical:"top",horizontal:"center",msg:"فایل اکسل در حال دانلود می باشد، این علمیات ممکن است زمان بر باشد لطفا صبر کنید.",severity:"success"});const A=`${R.defaults.baseURL}0/hatching_excel/?role=${d()}&key=${v}&age1=${C||0}&age2=${t||0}&search=filter&value=${j}`;window.location.href=A},children:r.jsx(E6,{size:32})})})]})}),r.jsx(N,{onClick:D6,color:"error",children:"حذف فیلتر"})]}),{hatchingInfoFull:e}=I(A=>A.citySlice);return c.useEffect(()=>{n(m({age1:C,age2:t,tab:"active",textValue:j}))},[]),r.jsxs(p,{alignItems:"center",justifyContent:"center",mt:2,children:[r.jsx(p,{alignItems:"center",justifyContent:"center",isDashboard:!0,children:r.jsx(ru,{noPagination:!0,isDashboard:!0,title:nu&&`آخرین بروزرسانی : ${q(nu)} `,columns:["تعداد فارم","تعداد جوجه ریزی","حجم کل جوجه ریزی","حجم باقی مانده در سالن","حجم کشتار شده","وزن کشتار شده","حجم کل تلفات","حجم تلفات اتحادیه","حجم تلفات دامپزشک","مانده سالن ( 20 تا 30 روزه)","مانده سالن ( 30 تا 40 روزه)","مانده سالن ( 40 تا 50 روزه)","مانده سالن ( 50 تا 60 روزه)","بیشتر از 60 روزه"],data:[[(su=e==null?void 0:e.poultries)==null?void 0:su.toLocaleString(),(lu=e==null?void 0:e.hatchings)==null?void 0:lu.toLocaleString(),(eu=e==null?void 0:e.totalHatchingQuantity)==null?void 0:eu.toLocaleString(),(Cu=e==null?void 0:e.totalHatchingLeftOverQuantity)==null?void 0:Cu.toLocaleString(),(tu=e==null?void 0:e.totalHatchingKilledQuantity)==null?void 0:tu.toLocaleString(),(cu=e==null?void 0:e.totalHatchingKilledWeight)==null?void 0:cu.toLocaleString(),(du=e==null?void 0:e.totalHatchingAllLosses)==null?void 0:du.toLocaleString(),(Au=e==null?void 0:e.totalHatchingUnionLosses)==null?void 0:Au.toLocaleString(),(gu=e==null?void 0:e.totalHatchingVetLosses)==null?void 0:gu.toLocaleString(),(g=e==null?void 0:e.age2030)==null?void 0:g.toLocaleString(),(a=e==null?void 0:e.age3040)==null?void 0:a.toLocaleString(),(z=e==null?void 0:e.age4050)==null?void 0:z.toLocaleString(),(pu=e==null?void 0:e.age5060)==null?void 0:pu.toLocaleString(),(hu=e==null?void 0:e.ageMoreThan60)==null?void 0:hu.toLocaleString()]]})}),_6,r.jsx(ru,{data:Q,columns:["عملیات","جزئیات","ردیف","وضعیت","شماره مجوز جوجه ریزی","شناسه یکتا","مجوز بهداشتی جوجه ریزی","نام فارم","مرغدار","بهره برداری","مالکیت","ارتباط","شهر/تعاونی","دامپزشک فارم","سالن","دوره جوجه ریزی","تاریخ ثبت جوجه ریزی","تاریخ جوجه ریزی","میانگین سن کشتار","پیش بینی تاریخ کشتار","نژاد","سن","حجم جوجه ریزی","حجم افزایشی","تلفات دامپزشک","تلفات اتحادیه","تلفات کل","حجم تعهد دولتی","حجم تعهد آزاد","حجم کشتار دولتی","وزن کشتار دولتی","حجم کشتار آزاد","وزن کشتار شده آزاد","حجم فروش به خارج استان","وزن فروش به خارج استان","حجم اختلاف کشتار","وزن اختلاف کشتار","تخصیصات بدون بار","حجم تخصیصات بدون بار","وزن تخصیصات بدون بار","حجم کشتار شده","حجم مانده در سالن","درصد مانده در سالن"," تلفات"," کشتار شده"," باقی مانده در سالن","تایید تخلیه رصدیار"," تایید تخلیه در سماصط","وزن تعهد دولتی","وزن کشتار دولتی","وزن کشتار آزاد","میانگین وزن کشتار","وزن کل کشتار شده","تعداد کشتار فعال","تعداد درخواست کشتار","تعداد بارها","حجم بارها","وزن بارها","حجم بارهای تحویلی","وزن بارهای تحویلی","حجم زنجیره","وزن زنجیره","حجم صادرات","وزن صادرات","بارهای ورودی به انبار","حجم لاشه های انبار","وزن لاشه های انبار","درصد افت بارها","آخرین تغییر","سازنده جوجه ریزی","گزارش"],handlePageChange:W6,totalRows:H,page:L,perPage:x,handlePerRowsChange:w6,title:"جوجه ریزی های فعال"})]})},R2=({readOnly:o})=>{var D6,nu,k6,_6,e,su,lu,eu,Cu,tu,cu,du,Au,gu;const[,,n,h,C,F]=c.useContext(V),t=I(g=>g.userSlice.userProfile.key),{hatchingInfoFull:s}=I(g=>g.citySlice),l=A0(),i=G();c.useEffect(()=>{const g=uu(new Date).format("YYYY-MM-DD");h(g),F(g)},[]);const H=g=>{Q(g.target.value)},[y,x]=c.useState([]),[$,j]=c.useState(0),[S,L]=c.useState(10),[b,Q]=c.useState(""),[T,v]=c.useState(1),[M,X]=c.useState([]),[E,D]=c.useState(!1),O=async g=>{i(K());const a=await R.get(`poultry_hatching/?archive=true&search=filter&value=${b}&role=${d()}
&key=${t}&page=${g}&page_size=${S}${E?`&date1=${n}&date2=${C}`:""}`);i(w()),x(a.data.results),j(a.data.count)},W6=g=>{O(g),v(g)},w6=g=>{L(g),v(1)},z6=()=>{O(T!==0?T:1)};c.useEffect(()=>{const g=y==null?void 0:y.map((a,z)=>{var pu,hu,A,u,J,yu,xu,vu,iu,Fu,ju,Su,fu,$u,Lu,bu,Eu,Du,ku,_u,Ru,Hu,Tu,Nu,Pu,Bu,Wu,wu,zu,qu,Ku,Qu,Mu,Ou,Yu,Uu,Iu,Vu,Gu,Xu,Ju,Zu,mu,u6,a6,r6,o6,n6,s6,l6,e6,C6,t6,c6,d6,A6,g6,p6,h6,y6,x6,v6,i6,F6,j6,S6,f6,$6,L6,b6;return[r.jsx(M0,{item:a,updateArchive:z6,readOnly:o},z),r.jsx(f,{placement:"left",title:" جزئیات",children:r.jsx(au,{color:"primary",onClick:()=>{l(d()==="AdminX"?`${l0}/${a.key}`:d()==="Supporter"?`${e0}/${a.key}`:d()==="SuperAdmin"?`${C0}/${a.key}`:d()==="CityPoultry"?`${t0}/${a.key}`:d()==="ProvinceSupervisor"?`${c0}/${a.key}`:d()==="province"?`${d0}/${a.key}`:d()==="CityJahad"?`${P0}/${a.key}`:"")},children:r.jsx(s0,{})})},z),T===1?z+1:z+S*(T-1)+1,r.jsx(f,{disableHoverListener:!((pu=a==null?void 0:a.killingInfo)!=null&&pu.violationMessage&&(a!=null&&a.violation)),title:a!=null&&a.violation?`متن گزارش تخلف: ${(hu=a==null?void 0:a.killingInfo)==null?void 0:hu.violationMessage}`:null,sx:{"&:hover":{cursor:a!=null&&a.violation?"pointer":"default"}},placement:"top",children:r.jsx(_,{variant:"body2",color:a!=null&&a.violation?"error":"primary",children:a!=null&&a.violation?"متخلف":"عادی"})},z),a==null?void 0:a.licenceNumber,(A=a==null?void 0:a.poultry)==null?void 0:A.breedingUniqueId,(a==null?void 0:a.CertId)||"-",((u=a==null?void 0:a.poultry)==null?void 0:u.unitName)||"-",`${((yu=(J=a==null?void 0:a.poultry)==null?void 0:J.userprofile)==null?void 0:yu.fullName)??"-"} (${((vu=(xu=a==null?void 0:a.poultry)==null?void 0:xu.userprofile)==null?void 0:vu.mobile)??"-"})`,a==null?void 0:a.InteractTypeName,a==null?void 0:a.PersonTypeName,a==null?void 0:a.UnionTypeName,`${((ju=(Fu=(iu=a==null?void 0:a.poultry)==null?void 0:iu.address)==null?void 0:Fu.city)==null?void 0:ju.name)??"-"}/${(Su=a==null?void 0:a.poultry)!=null&&Su.cityOperator?(fu=a==null?void 0:a.poultry)==null?void 0:fu.cityOperator:"بدون تعاونی"}`,($u=a==null?void 0:a.vetFarm)!=null&&$u.vetFarmMobile?`${(Lu=a==null?void 0:a.vetFarm)==null?void 0:Lu.vetFarmFullName} (${(bu=a==null?void 0:a.vetFarm)==null?void 0:bu.vetFarmMobile})`:"-",(a==null?void 0:a.hall)||"-",(a==null?void 0:a.period)||"-",q(a==null?void 0:a.createDate),q(a==null?void 0:a.date),(Du=(Eu=a==null?void 0:a.poultry)==null?void 0:Eu.killingAveAge)==null?void 0:Du.toLocaleString(),a!=null&&a.predicateDate?Z(a==null?void 0:a.predicateDate):"-",a.chickenBreed||"-",(a==null?void 0:a.age)||"-",a!=null&&a.archiveDate?q(a==null?void 0:a.archiveDate):"-",a.nowAge||"-",(ku=a==null?void 0:a.quantity)==null?void 0:ku.toLocaleString(),((_u=a==null?void 0:a.increaseQuantity)==null?void 0:_u.toLocaleString())||"-",`${a.losses} (%${(a.losses*100/a.quantity).toFixed(0)})`,`${(Ru=a==null?void 0:a.directLosses)==null?void 0:Ru.toLocaleString()} (%${(a.directLosses*100/a.quantity).toFixed(0)})`,`${(Hu=a==null?void 0:a.totalLosses)==null?void 0:Hu.toLocaleString()} (%${(a.totalLosses*100/a.quantity).toFixed(0)})`,`${(Tu=a==null?void 0:a.totalCommitmentQuantity)==null?void 0:Tu.toLocaleString()}`,`${(Nu=a==null?void 0:a.totalFreeCommitmentQuantity)==null?void 0:Nu.toLocaleString()}`,`${(Pu=a==null?void 0:a.governmentalQuantity)==null?void 0:Pu.toLocaleString()}`,`${(Bu=a==null?void 0:a.governmentalKilledQuantity)==null?void 0:Bu.toLocaleString()}`,`${(Wu=a==null?void 0:a.freeQuantity)==null?void 0:Wu.toLocaleString()}`,`${(wu=a==null?void 0:a.freeKilledQuantity)==null?void 0:wu.toLocaleString()}`,`${(zu=a==null?void 0:a.outProvinceKilledQuantity)==null?void 0:zu.toLocaleString()}`,`${(qu=a==null?void 0:a.outProvinceKilledWeight)==null?void 0:qu.toLocaleString()}`,`${(Ku=a==null?void 0:a.barDifferenceRequestQuantity)==null?void 0:Ku.toLocaleString()}`,`${(Qu=a==null?void 0:a.barDifferenceRequestWeight)==null?void 0:Qu.toLocaleString()}`,`${(Ou=(Mu=a==null?void 0:a.killingInfo)==null?void 0:Mu.provinceKillRequests)==null?void 0:Ou.toLocaleString()}`,`${(Uu=(Yu=a==null?void 0:a.killingInfo)==null?void 0:Yu.provinceKillRequestsQuantity)==null?void 0:Uu.toLocaleString()}`,`${(Vu=(Iu=a==null?void 0:a.killingInfo)==null?void 0:Iu.provinceKillRequestsWeight)==null?void 0:Vu.toLocaleString()}`,((Gu=a==null?void 0:a.killedQuantity)==null?void 0:Gu.toLocaleString())+` (%${((a==null?void 0:a.killedQuantity)*100/a.quantity).toFixed(0)})`,`${(Xu=a==null?void 0:a.leftOver)==null?void 0:Xu.toLocaleString()} (%${(a.leftOver*100/a.quantity).toFixed(0)})`,`${(Ju=a==null?void 0:a.quantity)==null?void 0:Ju.toLocaleString()}`,`%${(a.totalLosses*100/a.quantity).toFixed(0)}`,`%${((a==null?void 0:a.killedQuantity)*100/a.quantity).toFixed(0)}`,`%${(((a==null?void 0:a.killedQuantity)+(a==null?void 0:a.totalLosses))*100/(a==null?void 0:a.quantity)).toFixed(0)}`,a!=null&&a.samasatDischargePercentage?`%${a==null?void 0:a.samasatDischargePercentage}`:"-",(Zu=a==null?void 0:a.totalCommitment)==null?void 0:Zu.toLocaleString(),(mu=a==null?void 0:a.governmentalKilledQuantity)==null?void 0:mu.toLocaleString(),(u6=a==null?void 0:a.freeKilledQuantity)==null?void 0:u6.toLocaleString(),(a6=a==null?void 0:a.totalAverageKilledWeight)==null?void 0:a6.toLocaleString(),(r6=a==null?void 0:a.totalKilledWeight)==null?void 0:r6.toLocaleString(),(o6=a==null?void 0:a.activeKill)!=null&&o6.activeKill?"دارد":"ندارد",(n6=a==null?void 0:a.activeKill)!=null&&n6.countOfRequest?a.activeKill.countOfRequest:"-",(l6=(s6=a==null?void 0:a.killingInfo)==null?void 0:s6.killHouseRequests)==null?void 0:l6.toLocaleString(),(C6=(e6=a==null?void 0:a.killingInfo)==null?void 0:e6.killHouseRequestsFirstQuantity)==null?void 0:C6.toLocaleString(),(c6=(t6=a==null?void 0:a.killingInfo)==null?void 0:t6.killHouseRequestsFirstWeight)==null?void 0:c6.toLocaleString(),(A6=(d6=a==null?void 0:a.killingInfo)==null?void 0:d6.barCompleteWithKillHouse)==null?void 0:A6.toLocaleString(),(p6=(g6=a==null?void 0:a.killingInfo)==null?void 0:g6.acceptedRealWightFinal)==null?void 0:p6.toLocaleString(),(h6=a==null?void 0:a.chainKilledQuantity)==null?void 0:h6.toLocaleString(),(y6=a==null?void 0:a.chainKilledWeight)==null?void 0:y6.toLocaleString(),(x6=a==null?void 0:a.exportKilledQuantity)==null?void 0:x6.toLocaleString(),(v6=a==null?void 0:a.exportKilledWeight)==null?void 0:v6.toLocaleString(),(F6=(i6=a==null?void 0:a.killingInfo)==null?void 0:i6.wareHouseBars)==null?void 0:F6.toLocaleString(),(S6=(j6=a==null?void 0:a.killingInfo)==null?void 0:j6.wareHouseBarsQuantity)==null?void 0:S6.toLocaleString(),($6=(f6=a==null?void 0:a.killingInfo)==null?void 0:f6.wareHouseBarsWeight)==null?void 0:$6.toLocaleString(),(b6=(L6=a==null?void 0:a.killingInfo)==null?void 0:L6.wareHouseBarsWeightLose)==null?void 0:b6.toFixed(2),a.lastChange?`${a.lastChange.fullName} (${T6(a.lastChange.role)}) در تاریخ ${q(a.lastChange.date)}`:"-",a.latestHatchingChange?`${a.latestHatchingChange.fullName} (${T6(a.latestHatchingChange.role)}) در تاریخ ${q(a.latestHatchingChange.date)}`:"-",a!=null&&a.violationReport?r.jsx(N,{onClick:()=>{i(U({title:"گزارش ",content:r.jsx(i0,{columns:["ثبت کننده","تاریخ ثبت","تخلف","متن گزارش","سند"],data:[[a==null?void 0:a.violationReporter,Z(a==null?void 0:a.violationReportDate),a!=null&&a.violation?"دارد":"ندارد",a==null?void 0:a.violationReport,r.jsx(F0,{src:a==null?void 0:a.violationImage},z)]]})}))},children:"نمایش"},z):"بدون گزارش"]});X(g)},[y]),c.useEffect(()=>{O(1)},[n,C,S,E]),c.useEffect(()=>{i(m(E?{tab:"archive",date1:n,date2:C,textValue:b}:{tab:"archive",textValue:b}))},[i,E,n,C]);const ou=async g=>{g.preventDefault(),i(K());try{const a=await R.get(`poultry_hatching/?archive=true&search=filter&value=${b}&role=${d()}&key=${t}&page=1&page_size=${S}${E?`&date1=${n}&date2=${C}`:""}`);i(m(E?{tab:"archive",date1:n,date2:C,textValue:b}:{tab:"archive",textValue:b})),x(a.data.results),j(a.data.count),i(w())}catch(a){console.error("Error fetching data:",a)}};return r.jsxs(p,{container:!0,xs:12,justifyContent:"center",alignItems:"center",gap:2,children:[r.jsx(p,{alignItems:"center",justifyContent:"center",isDashboard:!0,children:r.jsx(ru,{noPagination:!0,isDashboard:!0,title:null,columns:["تعداد فارم","تعداد جوجه ریزی","حجم کل جوجه ریزی","حجم باقی مانده در سالن","حجم کشتار شده","وزن کشتار شده","حجم کل تلفات","حجم تلفات اتحادیه","حجم تلفات دامپزشک","مانده سالن ( 20 تا 30 روزه)","مانده سالن ( 30 تا 40 روزه)","مانده سالن ( 40 تا 50 روزه)","مانده سالن ( 50 تا 60 روزه)","بیشتر از 60 روزه"],data:[[(D6=s==null?void 0:s.poultries)==null?void 0:D6.toLocaleString(),(nu=s==null?void 0:s.hatchings)==null?void 0:nu.toLocaleString(),(k6=s==null?void 0:s.totalHatchingQuantity)==null?void 0:k6.toLocaleString(),(_6=s==null?void 0:s.totalHatchingLeftOverQuantity)==null?void 0:_6.toLocaleString(),(e=s==null?void 0:s.totalHatchingKilledQuantity)==null?void 0:e.toLocaleString(),(su=s==null?void 0:s.totalHatchingKilledWeight)==null?void 0:su.toLocaleString(),(lu=s==null?void 0:s.totalHatchingAllLosses)==null?void 0:lu.toLocaleString(),(eu=s==null?void 0:s.totalHatchingUnionLosses)==null?void 0:eu.toLocaleString(),(Cu=s==null?void 0:s.totalHatchingVetLosses)==null?void 0:Cu.toLocaleString(),(tu=s==null?void 0:s.age2030)==null?void 0:tu.toLocaleString(),(cu=s==null?void 0:s.age3040)==null?void 0:cu.toLocaleString(),(du=s==null?void 0:s.age4050)==null?void 0:du.toLocaleString(),(Au=s==null?void 0:s.age5060)==null?void 0:Au.toLocaleString(),(gu=s==null?void 0:s.ageMoreThan60)==null?void 0:gu.toLocaleString()]]})}),r.jsxs(p,{container:!0,xs:12,justifyContent:"start",alignItems:"center",gap:2,children:[r.jsxs(p,{container:!0,gap:1,style:{borderStyle:"solid",borderWidth:"1px",padding:"5px",borderRadius:"15px",borderColor:"gray",justifyContent:"left"},alignItems:"center",children:[r.jsx(b0,{icon:r.jsx(U0,{}),checkedIcon:r.jsx(I0,{}),checked:E,onChange:()=>D(!E),color:"primary",size:"large"}),r.jsx(p,{children:r.jsx(N6,{disabled:!E,label:"از تاریخ",id:"date",renderInput:g=>r.jsx(k,{size:"small",style:{width:"160px"},...g}),value:n,onChange:g=>{h(uu(g).format("YYYY-MM-DD"))}})}),r.jsx(p,{children:r.jsx(N6,{disabled:!E,label:"تا تاریخ",id:"date",renderInput:g=>r.jsx(k,{size:"small",style:{width:"160px"},...g}),value:C,onChange:g=>{F(uu(g).format("YYYY-MM-DD"))}})})]}),r.jsx(p,{children:r.jsxs("form",{onSubmit:ou,children:[r.jsx(k,{id:"outlined-basic",size:"small",label:"جستجو",variant:"outlined",style:{width:250},onChange:H}),r.jsx(N,{type:"submit",onClick:ou,endIcon:r.jsx(g0,{}),children:"جستجو"})]})}),r.jsx(f,{title:"خروجی اکسل",children:r.jsx("a",{href:`${R.defaults.baseURL}archive_hatching_excel/?search=filter&value=${b}&role=${d()}&key=${t}${E?`&date1=${n}&date2=${C}`:""}`,rel:"noreferrer",children:r.jsx(N,{color:"success",children:r.jsx(E6,{size:32})})})})]}),r.jsx(ru,{data:M,columns:["عملیات","جزئیات","ردیف","وضعیت","شماره مجوز جوجه ریزی","شناسه یکتا","مجوز بهداشتی جوجه ریزی","نام فارم","مرغدار","بهره برداری","مالکیت","ارتباط","شهر/تعاونی","دامپزشک فارم","سالن","دوره جوجه ریزی","تاریخ ثبت جوجه ریزی","تاریخ جوجه ریزی","میانگین سن کشتار","پیش بینی تاریخ کشتار","نژاد","سن ورود به بایگانی","تاریخ ورود به بایگانی","سن فعلی","حجم جوجه ریزی","حجم افزایشی","تلفات دامپزشک","تلفات اتحادیه","تلفات کل","حجم تعهد دولتی","حجم تعهد آزاد","حجم کشتار دولتی","وزن کشتار دولتی","حجم کشتار آزاد","وزن کشتار شده آزاد","حجم فروش به خارج استان","وزن فروش به خارج استان","حجم اختلاف کشتار","وزن اختلاف کشتار","تخصیصات بدون بار","حجم تخصیصات بدون بار","وزن تخصیصات بدون بار","حجم کشتار شده"," حجم مانده در سالن"," درصد مانده در سالن"," تلفات"," کشتار شده","تایید تخلیه رصدیار"," تایید تخلیه در سماصط","وزن تعهد دولتی","وزن کشتار دولتی","وزن کشتار آزاد","میانگین وزن کشتار","وزن کل کشتار شده","تعداد کشتار فعال","تعداد درخواست کشتار","تعداد بارها","حجم بارها","وزن بارها","حجم بارهای تحویلی","وزن بارهای تحویلی","حجم زنجیره","وزن زنجیره","حجم صادرات","وزن صادرات","بارهای ورودی به انبار","حجم لاشه های انبار","وزن لاشه های انبار","درصد افت بارها","آخرین تغییر","سازنده جوجه ریزی","گزارش"],handlePageChange:W6,totalRows:$,page:T,perPage:S,handlePerRowsChange:w6,title:"بایگانی جوجه ریزی"})]})},H2=()=>{var i,H,y,x,$,j,S,L,b,Q,T,v,M,X,E;const{hatchingInfoWithDate:o,hatchingInfoFull:n}=I(D=>D.citySlice),h=G(),[,,C,F,t,s]=c.useContext(V);c.useEffect(()=>{const D=uu(new Date).format("YYYY-MM-DD");F(D),s(D)},[]),c.useEffect(()=>{h(m())},[]),c.useEffect(()=>{h(B0({selectedDate1:C,selectedDate2:t}))},[C,t]);const l=o0({initialValues:{minAge:"",maxAge:""}});return r.jsxs(H6,{bgcolor:"#f9f9f9",borderRadius:2,boxShadow:3,children:[r.jsx(q6,{style:{width:"100%"},children:r.jsx(K6,{label:r.jsx(_,{variant:"body1",gutterBottom:!0,color:"primary",fontWeight:"bold",children:"اطلاعات جوجه ریزی"})})}),r.jsxs(p,{container:!0,spacing:3,m:0,pb:2,children:[r.jsx(p,{item:!0,xs:12,children:r.jsx(ru,{noPagination:!0,title:"آمار جوجه ریزی",columns:["تعداد فارم","تعداد کل جوجه ریزی","تعداد باقی مانده در سالن","تعداد کشتار شده","وزن کشتار شده","مانده سالن (20 تا 30 روزه)","مانده سالن (30 تا 40 روزه)","مانده سالن (40 تا 50 روزه)","مانده سالن (50 تا 60 روزه)","بیشتر از 60 روزه"],data:[[(i=n==null?void 0:n.poultries)==null?void 0:i.toLocaleString(),(H=n==null?void 0:n.totalHatchingQuantity)==null?void 0:H.toLocaleString(),(y=n==null?void 0:n.totalHatchingLeftOverQuantity)==null?void 0:y.toLocaleString(),(x=n==null?void 0:n.totalHatchingKilledQuantity)==null?void 0:x.toLocaleString(),($=n==null?void 0:n.totalHatchingKilledWeight)==null?void 0:$.toLocaleString(),(j=n==null?void 0:n.age2030)==null?void 0:j.toLocaleString(),(S=n==null?void 0:n.age3040)==null?void 0:S.toLocaleString(),(L=n==null?void 0:n.age4050)==null?void 0:L.toLocaleString(),(b=n==null?void 0:n.age5060)==null?void 0:b.toLocaleString(),(Q=n==null?void 0:n.ageMoreThan60)==null?void 0:Q.toLocaleString()]]})}),r.jsx(q6,{style:{width:"100%",marginTop:8},children:r.jsx(K6,{label:r.jsx(_,{variant:"body1",color:"primary",gutterBottom:!0,fontWeight:"medium",children:"بر اساس بازه"})})}),r.jsx(p,{item:!0,xs:12,mt:2,children:r.jsxs(p,{container:!0,alignItems:"center",spacing:2,children:[r.jsx(p,{item:!0,children:r.jsx(N6,{label:"از تاریخ",renderInput:D=>r.jsx(k,{...D,size:"small",fullWidth:!0}),value:C,onChange:D=>F(uu(D).format("YYYY-MM-DD"))})}),r.jsx(p,{item:!0,children:r.jsx(N6,{label:"تا تاریخ",renderInput:D=>r.jsx(k,{...D,size:"small",fullWidth:!0}),value:t,onChange:D=>s(uu(D).format("YYYY-MM-DD"))})}),r.jsx(p,{item:!0,children:r.jsx(f,{title:"خروجی اکسل",children:r.jsx("a",{href:`${R.defaults.baseURL}hatching_date_range_excel/?date1=${C}&date2=${t}`,rel:"noreferrer",children:r.jsx(N,{variant:"contained",color:"success",children:r.jsx(E6,{size:24})})})})})]})}),r.jsx(p,{item:!0,xs:12,children:r.jsx(ru,{noPagination:!0,title:"خلاصه آمار",columns:["تعداد فارم های فعال","تعداد کل جوجه ریزی","تعداد باقی مانده در سالن","تعداد کشتار شده","وزن کشتار شده"],data:[[(T=o==null?void 0:o.poultries)==null?void 0:T.toLocaleString(),(v=o==null?void 0:o.totalHatchingQuantity)==null?void 0:v.toLocaleString(),(M=o==null?void 0:o.totalHatchingLeftOverQuantity)==null?void 0:M.toLocaleString(),(X=o==null?void 0:o.totalHatchingKilledQuantity)==null?void 0:X.toLocaleString(),(E=o==null?void 0:o.totalHatchingKilledWeight)==null?void 0:E.toLocaleString()]]})}),r.jsx(q6,{style:{width:"100%",marginTop:8},sx:{display:{xs:"none",sm:"block"}},children:r.jsx(K6,{label:r.jsx(_,{variant:"body1",color:"primary",gutterBottom:!0,fontWeight:"medium",mx:"auto",children:"گزارش مانده سالن فارم های بیشتر از 10 درصد"})})}),r.jsx(_,{variant:"body1",backgroundColor:"rgba(0, 0, 0, 0.08)",color:"primary",gutterBottom:!0,fontWeight:"medium",mt:4,mx:"auto",sx:{display:{xs:"block",sm:"none"},borderRadius:2},width:{xs:"80%",sm:"auto"},children:"گزارش مانده سالن فارم های بیشتر از 10 درصد"}),r.jsx(p,{item:!0,xs:12,container:!0,justifyContent:"center",gap:2,alignItems:"center",mt:4,px:1,children:r.jsxs(p,{container:!0,sx:{gap:2},alignItems:"center",children:[r.jsx(p,{item:!0,sx:{maxWidth:{xs:"46%",sm:"100px"}},children:r.jsx(k,{id:"minAge",label:"از سن",variant:"outlined",size:"small",value:l.values.minAge,onChange:l.handleChange,onBlur:l.handleBlur})}),r.jsx(p,{item:!0,sx:{maxWidth:{xs:"46%",sm:"100px"}},children:r.jsx(k,{id:"maxAge",label:"تا سن",variant:"outlined",size:"small",value:l.values.maxAge,onChange:l.handleChange,onBlur:l.handleBlur})}),r.jsx(p,{item:!0,children:r.jsx(f,{title:"خروجی اکسل",children:r.jsx("a",{href:`${R.defaults.baseURL}hatching_by_age_range/?min_age=${l.values.minAge}&max_age=${l.values.maxAge}`,rel:"noreferrer",children:r.jsx(N,{variant:"contained",color:"success",children:r.jsx(E6,{size:24})})})})})]})})]})]})};export{d2 as C,k2 as a,_2 as b,H2 as c,R2 as d};