Files
Rasadyar_FrontEnd/build/assets/NewFile-BvlwIHzj.js
2026-01-19 16:15:09 +03:30

2 lines
28 KiB
JavaScript

import{j as u,aO as S,aP as b,aQ as E,aR as P,aS as H,T as s,aT as M,p as j,ak as Pu,B as J,aI as Hu,I as ku,aJ as Lu,cl as Iu,cm as Mu}from"./mui-vendor-CkIVaoQP.js";import{G as r,S as a,_ as U,Q as Y,a0 as Du,v as Z,X as T,j as Wu,$ as xu,A as Ku,u as Nu,c as wu,M as $u,m as Ru,L as Cu,h as pu,p as Fu,hX as Ou,hY as Uu}from"./index-BHF9XhlR.js";import{r as f,j as hu,u as qu}from"./react-vendor-CmFgShSM.js";import{F as Bu}from"./FileInformation-CWcx0HMQ.js";import{S as m}from"./SimpleTable-OFQqh0WK.js";import{g as Au,u as _u}from"./useRequestFile-DJLl5omk.js";import{u as Gu}from"./useGetAllocationInformation-C1dGiG_T.js";import{T as Qu}from"./Timer-By-a-zw-.js";import{u as eu,f as zu,a as Yu}from"./redux-vendor-B7uoacJt.js";import{F as Vu,a as Ju}from"./Factor-Dw39Nwh1.js";import{S as Xu}from"./SlaughterPayProvinceFactorForm-CIOvWYq1.js";import{d as Zu}from"./NavigateNext-Cg8XXIQ9.js";import{A as u6}from"./index-rXDbFGCK.js";import"./index-CV2Xug6a.js";import"./Close-Daz6UZes.js";import"./Search-D4DyWpQE.js";import"./Delete-BMbGwban.js";import"./NumberFormatCustom-DwWPj40N.js";import"./toBase64-UEKXUH-t.js";import"./PublishedWithChanges-DLwGJTcV.js";import"./Add-B14uoYzg.js";const ju=({file:e})=>{const[c,F]=f.useState({cityOperatorName:"اپراتور شهرستان",cityOperatorMobile:"-",cityUnionName:"-",acceptedRejectedDate:"",cityState:"در انتظار تایید"}),{city:i,cityOperator:n}=e;return f.useEffect(()=>{let o,A,C,p,h;i?(o=i.cityOperatorName,A=i.cityOperatorMobile,C=i.acceptedRejectedDate,h=i.unitName,p=i.cityState==="accept"?"تایید شده":"رد شده"):(o=n==null?void 0:n.cityOperatorName,A=n.cityOperatorMobile,h=n.unitName,C=null,p="در انتظار تایید"),F({cityOperatorName:o,cityOperatorMobile:A,acceptedRejectedDate:C,cityUnionName:h,cityState:p})},[i]),u.jsx(u.Fragment,{children:u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{children:u.jsx(s,{variant:"body1",fontWeight:"bold",children:"مرحله شهرستان"})})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsx(r,{container:!0,gap:a.SMALL,children:u.jsx(r,{container:!0,gap:a.SMALL,children:c.cityState==="در انتظار تایید"?u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"درخواست منتظر انجام عملیات توسط اپراتور می باشد."}):u.jsxs(u.Fragment,{children:[u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"درخواست در تاریخ"}),u.jsx(s,{variant:"body2",fontWeight:"bold",children:c.acceptedRejectedDate?U(c.acceptedRejectedDate):"-"}),u.jsxs(s,{variant:"body2",display:"flex",gap:a.SMALL,children:[c.cityState," است."]})]})})})})})]}),u.jsx(r,{children:u.jsx(r,{xs:12,children:u.jsx(m,{columns:["نام اپراتور","نام اتحادیه","تلفن","استان","شهر","تاریخ بررسی","وضعیت",i!=null&&i.cityOperatorMessage?"دلیل رد":""],data:[[c.cityOperatorName,c.cityUnionName,c.cityOperatorMobile,n.cityOperatorProvince,n.cityOperatorCity,c!=null&&c.acceptedRejectedDate?Y(new Date(c==null?void 0:c.acceptedRejectedDate),"yyyy/MM/dd"):"",i!=null&&i.provinceAccept?"تایید شده توسط استان":c.cityState,i!=null&&i.cityOperatorMessage?i==null?void 0:i.cityOperatorMessage:""]]})})})]})]})})};ju.propTypes={file:j.PropTypes.any};const yu=({file:e,quantity:c})=>{const[F,i]=f.useState({provinceOperatorName:"اپراتور استان",provinceOperatorMobile:"-",acceptedRejectedDate:null,provinceState:"در انتظار تایید"}),{province:n,provinceOperator:o}=e;return f.useEffect(()=>{let A,C,p,h;n?(A=n.provinceOperatorName,C=n.provinceOperatorMobile,p=n.acceptedRejectedDate,h=n.provinceState==="accept"?"تایید شده":"رد شده"):(A=o==null?void 0:o.provinceOperatorName,C=o==null?void 0:o.provinceOperatorMobile,p=null,h="در انتظار تایید"),i({provinceOperatorName:A,provinceOperatorMobile:C,acceptedRejectedDate:p,provinceState:h})},[n]),u.jsx(u.Fragment,{children:u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{children:u.jsx(s,{variant:"body1",fontWeight:"bold",children:"مرحله استان"})})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsx(r,{container:!0,gap:a.SMALL,children:F.provinceState==="در انتظار تایید"?u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"درخواست منتظر انجام عملیات توسط اپراتور می باشد."}):u.jsxs(u.Fragment,{children:[u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"درخواست در تاریخ"}),u.jsx(s,{variant:"body2",fontWeight:"bold",children:F.acceptedRejectedDate?U(F.acceptedRejectedDate):"-"}),u.jsxs(s,{variant:"body2",display:"flex",gap:a.SMALL,children:[F.provinceState," است."]})]})})})})]}),u.jsx(r,{children:u.jsx(r,{xs:12,children:u.jsx(m,{columns:["نام اپراتور","تلفن","استان","تاریخ بررسی","وضعیت درخواست","وضعیت تخصیص",n!=null&&n.provinceMessage?"دلیل رد":""],data:[[F.provinceOperatorName,F.provinceOperatorMobile,o.provinceOperatorProvinc,Y(new Date(F.acceptedRejectedDate),"yyyy/MM/dd"),F.provinceState,c!==0?"در انتظار تخصیص استان":"تخصیص داده شده",n!=null&&n.provinceMessage?n==null?void 0:n.provinceMessage:""]]})})})]})]})})};yu.propTypes={file:j.PropTypes.any,quantity:j.PropTypes.any};const X=({data:e,auction:c})=>{var k,L,I,l,x,d,t,w,$,v,R,q,B,_,G,Q,ru,ou,nu,tu,iu,lu,cu,su,au;const F=eu();f.useEffect(()=>{F(Du())},[]);const{avicultureChickenPrice:i}=zu(y=>y.avicultureSlice),n=i==null?void 0:i.liveChickenPrice;let o,A,C,p,h,g;const D=Z(new Date(e.paymentDeadLine)),W=Z(),K=D.diff(W);let N=Z.duration(K).asSeconds();if(!c){let y;y=!e.killHouseFactorToProvince&&!e.provinceFactorToKillHouse?"در انتظار تایید مالی":y,y=!e.killHouseFactorToProvince&&e.provinceFactorToKillHouse?"در انتظار پرداخت کشتارگاه":y,y=e.killHouseFactorToProvince&&e.provinceFactorToKillHouse?"پرداخت شده توسط کشتارگاه":y;let z;const Su=((k=e.killHouseFactorToProvince)==null?void 0:k.factorState)==="accepted"||((L=e.killHouseFactorToPoultry)==null?void 0:L.factorState)==="accepted",bu=e&&u.jsx(Qu,{isFilePaymentTime:!0,seconds:N},"finincalTimer"),Eu=!e.killHouseFactorToProvince&&!e.provinceFactorToKillHouseForPoultry;!!e.paymentDeadLine?z=bu:Eu?z="در انتظار تایید مالی":z="در انتظار صدور تمامی فاکتورها",Su&&(z="پرداخت شده ✔"),o=["کشتارگاه","نام راننده","ماشین","نوع خرید","سند خودرو بدون بار","سند خودرو با بار","تعداد درخواست","تعداد واقعی بارگیری","وزن بار","میانگین وزن"],A=[[`${e.killHouseName} (${e.killHouseUserProvince}/${e.killHouseUserCity})`,((I=e.cars)==null?void 0:I.driverName)+` (${(l=e.cars)==null?void 0:l.driverMobile})`,`${(x=e.cars)==null?void 0:x.typeCar} با پلاک ${(d=e.cars)==null?void 0:d.pelak}`,`${e.paymentType==="credit"?"زمان دار":"نقدی"}`,u.jsxs("a",{style:{textDecoration:"none",color:"black"},href:e.barInfo.killHouseImageWithoutLoad,alt:"دانلود سند خودرو بدون بار",children:[u.jsx("img",{src:e.barInfo.killHouseImageWithoutLoad,width:"50",height:"50",alt:"بدون بار",className:"images-file"}),u.jsxs("p",{children:[e.barInfo.killHouseWeightWithoutLoad," کیلوگرم"]})]},"provinceKillRequests"),u.jsxs("a",{style:{textDecoration:"none",color:"black"},href:e.barInfo.killHouseImageWithLoad,alt:"دانلود سند خودرو با بار",children:[u.jsx("img",{src:e.barInfo.killHouseImageWithLoad,width:"50",height:"50",alt:"بدون بار",className:"images-file"},"provinceKillRequests"),u.jsxs("p",{children:[e.barInfo.killHouseWeightWithLoad," کیلوگرم"]})]},"provinceKillRequests"),e.quantity+" قطعه",e.barInfo.realQuantity+" قطعه",e.barInfo.killHouseNetWeight+" کیلوگرم",(e.barInfo.killHouseNetWeight/e.barInfo.realQuantity).toFixed(2)+" کیلوگرم"]],C=["قیمت روز","قیمت هرکیلو","سهم مرغدار","سهم اتحادیه","مانده تا سررسید 30 روزه","سهم مرغدار با ضریب سود","سهم اتحادیه با ضریب سود","جمع مبلغ قابل پرداخت","وضعیت"];let O;(t=e.provinceFactorToKillHouse)!=null&&t.poultryShareWithProfit?O=(w=e.provinceFactorToKillHouse)==null?void 0:w.poultryShareWithProfit:($=e.provinceFactorToKillHouseForPoultry)!=null&&$.poultryShareWithProfit&&(O=(v=e.provinceFactorToKillHouseForPoultry)==null?void 0:v.poultryShareWithProfit),h=[[n+" ﷼",e.provinceFactorToKillHouse?e.provinceFactorToKillHouse.provinceFactorFee+" ریال":"نامشخص",e.provinceFactorToKillHouse?e.provinceFactorToKillHouse.provinceFactorFee*e.barInfo.killHouseNetWeight+" ریال":"نامشخص",(R=e.provinceFactorToKillHouse)!=null&&R.totalShareAllocation?((q=e.provinceFactorToKillHouse)==null?void 0:q.totalShareAllocation)+" ریال":"نامشخص",z,O?`${O} ریال`:"نامشخص",(B=e.provinceFactorToKillHouse)!=null&&B.unionShareWithProfit?`${(_=e.provinceFactorToKillHouse)==null?void 0:_.unionShareWithProfit} ریال`:"نامشخص",(G=e.provinceFactorToKillHouse)!=null&&G.cost?`${((Q=e.provinceFactorToKillHouse)==null?void 0:Q.cost)+((ru=e.provinceFactorToKillHouse)==null?void 0:ru.poultryShareWithProfit)} ریال`:"نامشخص",y]],p=["قیمت روز","قیمت هرکیلو","سهم مرغدار","سهم اتحادیه","مبلغ قابل پرداخت","وضعیت"];let V;(ou=e.provinceFactorToKillHouse)!=null&&ou.cost?V=`${(nu=e.provinceFactorToKillHouse)==null?void 0:nu.cost} ریال`:(tu=e.provinceFactorToKillHouseForPoultry)!=null&&tu.cost?V=`${(iu=e.provinceFactorToKillHouseForPoultry)==null?void 0:iu.cost} ریال`:V="نامشخص",g=[[n+" ﷼",e.provinceFactorToKillHouse?e.provinceFactorToKillHouse.provinceFactorFee+" ریال":"ندارد",O?`${O} ریال`:"نامشخص",(lu=e.provinceFactorToKillHouse)!=null&&lu.totalShareAllocation?((cu=e.provinceFactorToKillHouse)==null?void 0:cu.totalShareAllocation)+" ریال":"نامشخص",V,y]],T()==="Poultry"&&(p.splice(5,3),(su=g[0])==null||su.splice(5,3),C.splice(5,4),(au=h[0])==null||au.splice(5,4))}return u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{children:u.jsx(s,{variant:"body1",fontWeight:"bold",children:"مرحله مالی"})})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsx(r,{container:!0,gap:a.SMALL,children:e.barInfo.killHouseAssignmentState==="pending"?u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"درخواست در انتظار تایید اپراتور مالی است."}):u.jsxs(u.Fragment,{children:[u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"درخواست در تاریخ"}),u.jsx(s,{variant:"body2",fontWeight:"bold",children:U(new Date(e.barInfo.acceptRejectDate))}),u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:e.barInfo.killHouseAssignmentState==="accepted"?"تایید شده است.":e.barInfo.killHouseAssignmentState==="pending"?"در انتظار تایید":"رد شده است."})]})})})})]}),u.jsx(r,{container:!0,children:u.jsxs(r,{xs:12,children:[u.jsx(m,{name:`اطلاعات بار ${e.barcod} - کد قرنطینه ${e.clearanceCode} - کد حمل و نقل ${e.trafficCode}`,columns:o,data:A}),e.paymentType==="cash"?u.jsx(m,{name:"اطلاعات مالی",columns:p,data:g}):u.jsx(m,{name:"اطلاعات مالی",columns:C,data:h})]})})]})]})};X.propTypes={item:j.PropTypes.array,data:j.PropTypes.any,auction:j.PropTypes.bool};const uu=({data:e,barCode:c})=>u.jsx(u.Fragment,{children:u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{children:u.jsx(s,{variant:"body1",fontWeight:"bold",children:"اطلاعات پرداختی کشتارگاه"})})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsx(r,{container:!0,gap:a.SMALL,children:u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"اطلاعات پرداختی کشتارگاه در این قسمت نمایش داده میشود."})})})})]}),u.jsx(r,{container:!0,children:u.jsx(r,{xs:12,children:u.jsx(m,{columns:["کد بار","کشتارگاه","تاریخ ثبت شناسه","شناسه پرداخت","مبلغ","وضعیت","پیوست"],data:[[c,`${e==null?void 0:e.killHouseName} (${e==null?void 0:e.killHouseUserProvince}/${e==null?void 0:e.killHouseUserCity})`,U(e.time),Number(e.paymentCode),`${e.totalMoney}`,e.factorState==="accepted"?"تایید شده":e.factorState==="pending"?"در انتظار تایید":"رد شده",u.jsx("a",{href:e.factorImage,children:u.jsx("img",{src:e.factorImage,alt:"Slaughter Payment Factor",width:"50",height:"50",className:"images-file"})},"SlaughterPaymentFactorImage")]]})})})]})]})});uu.propTypes={data:j.PropTypes.any,barCode:j.PropTypes.any};const fu=({item:e,i:c})=>{let F=[],i=[],n;return n=e.provinceKillRequestState==="pending"?"در انتظار تایید کشتارگاه":n,n=e.provinceKillRequestState==="accepted"?"تایید شده":n,n=e.provinceKillRequestState==="rejected"?"رد شده":n,e.provinceKillRequestMessage?(F=["نام کشتارگاه","مالک کشتارگاه","تعداد تخصیص داده شده","تاریخ تخصیص","نحوه خرید","نوع تخصیص","وضعیت درخواست","دلیل رد"],i=[e.killHouseName,e.killHouseUserName,e.mainQuantity+" قطعه",Y(new Date(e.date),"yyyy/MM/dd"),e.paymentType,e.automaticState?"اتوماتیک":"دستی",n,e.provinceKillRequestMessage]):(F=["نام کشتارگاه","مالک کشتارگاه","تعداد تخصیص داده شده","تاریخ تخصیص","نوع تخصیص","وضعیت درخواست"],i=[e.killHouseName,e.killHouseUserName,e.mainQuantity+" قطعه",Y(new Date(e.date),"yyyy/MM/dd"),e.automaticState?"اتوماتیک":"دستی",n]),u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{variant:"body1",fontWeight:"bold",children:"تخصیصات استان به کشتارگاه"})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsx(s,{variant:"body2",children:"در این قسمت جزییات تخصیصات را مشاهده می کنید."})})})]}),u.jsx(r,{children:u.jsx(r,{children:u.jsx(r,{children:u.jsx(m,{columns:F,data:[i]})})},"ProvinceAllocationInformation"+c)})]})]})};fu.propTypes={item:j.PropTypes.object,i:j.PropTypes.any};const mu=({data:e,barCode:c})=>u.jsx(u.Fragment,{children:u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{children:u.jsx(s,{variant:"body1",fontWeight:"bold",children:"اطلاعات پرداختی کشتارگاه به مرغدار"})})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsx(r,{container:!0,gap:a.SMALL,children:u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"اطلاعات پرداختی کشتارگاه در این قسمت نمایش داده میشود."})})})})]}),u.jsx(r,{container:!0,children:u.jsx(r,{xs:12,children:u.jsx(m,{columns:["کد بار","کشتارگاه","تاریخ ثبت شناسه","شناسه پرداخت","مبلغ","وضعیت","پیوست"],data:[[c,`${e==null?void 0:e.killHouseName} (${e==null?void 0:e.killHouseUserProvince}/${e==null?void 0:e.killHouseUserCity})`,U(e==null?void 0:e.time),Number(e==null?void 0:e.paymentCode),`${e.totalMoney}`,e.factorState==="accepted"?"تایید شده":e.factorState==="pending"?"در انتظار تایید":"رد شده",u.jsx("a",{href:e==null?void 0:e.factorImage,children:u.jsx("img",{src:e==null?void 0:e.factorImage,alt:"Slaughter Payment Factor",width:"50",height:"50",className:"images-file"})},"SlaughterPaymentFactorImage")]]})})})]})]})});mu.propTypes={data:j.PropTypes.any,barCode:j.PropTypes.any};const gu=({data:e})=>u.jsx(u.Fragment,{children:u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{children:u.jsx(s,{variant:"body1",fontWeight:"bold",children:"اطلاعات تایید نهایی بازرس"})})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsx(r,{container:!0,gap:a.SMALL,children:u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"وضعیت نهایی پرونده بررسی شده توسط بازرس در این مرحله نمایش داده شده است."})})})})]}),u.jsx(r,{container:!0,children:u.jsx(r,{xs:12,children:u.jsx(m,{columns:["نام بازرس","تاریخ ثبت","پیغام","وضعیت"],data:[[e.inspectorName,new Date(e.acceptRejectDate),e.message?e.message:"-",e.state==="accepted"?"تایید شده":"ابراز مشکل"]]})})})]})]})});gu.propTypes={data:j.PropTypes.any};const du=Yu("PROVINCE_CHECK_COMPLAINT",async e=>{const{data:c,status:F}=await Wu.post("check_losses/",e);return{data:c,status:F}}),vu=({item:e})=>{const[c,F]=f.useState(!1),[i]=xu(),{id:n}=hu(),[o]=f.useContext(Ku),A=eu(),C=Nu({initialValues:{rejectText:""},validationSchema:wu({rejectText:$u().required("این فیلد اجباری است!").typeError("لطفا دلیل خود را بیان کنید.")})});return f.useEffect(()=>{C.validateForm()},[]),u.jsx(u.Fragment,{children:u.jsx(r,{container:!0,children:u.jsx(r,{xs:12,children:u.jsx(r,{xs:12,children:e.complaint.state==="pending"&&u.jsx(r,{container:!0,gap:a.SMALL,padding:a.SMALL,children:u.jsx(u6,{children:c?u.jsx(Ru.div,{animate:{x:-10,opacity:1},transition:{duration:.3},initial:{opacity:0},exit:{opacity:0},children:u.jsxs(r,{flexDirection:"column",container:!0,gap:a.SMALL,children:[u.jsx(r,{children:u.jsx(Pu,{multiline:!0,rows:4,fullWidth:!0,id:"rejectText",label:"پیام خود را وارد کنید",variant:"outlined",value:C.values.rejectText,error:C.touched.rejectText?!!C.errors.rejectText:null,onChange:C.handleChange,onBlur:C.handleBlur,helperText:C.touched.rejectText&&C.errors.rejectText?C.errors.rejectText:null})}),u.jsxs(r,{container:!0,gap:a.SMALL,children:[u.jsx(r,{children:u.jsx(J,{variant:"outlined",color:"secondary",onClick:()=>{F(!1)},children:"لغو"})}),u.jsx(r,{children:u.jsx(J,{disabled:!C.isValid,variant:"outlined",onClick:()=>{A(Cu()),A(du({key:e.complaint.complaintKey,state:"rejected",role:T(),message:C.values.rejectText})).then(p=>{p.error?o({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(Au(i,n,A),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})),A(pu())})},children:"رد شکایت"})})]})]})}):u.jsxs(r,{container:!0,gap:a.SMALL,children:[u.jsx(J,{variant:"outlined",color:"secondary",onClick:()=>{F(!0)},children:"رد شکایت"}),u.jsx(J,{variant:"outlined",onClick:()=>{A(Cu()),A(du({key:e.complaint.complaintKey,state:"accepted",role:T()})).then(p=>{p.error?o({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(Au(i,n,A),o({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})),A(pu())})},children:"تایید شکایت"})]})})})})})})})};vu.propTypes={item:j.PropTypes.object};const Tu=({item:e})=>{var c,F,i,n,o,A,C,p,h,g,D,W,K,N,k,L,I,l,x,d,t,w,$;return u.jsxs(u.Fragment,{children:[u.jsx(r,{container:!0,children:u.jsx(r,{children:u.jsx(H,{variant:"body1",fontWeight:"bold",color:"secondary",children:"بررسی شکایت"})})}),u.jsxs(r,{container:!0,children:[u.jsx(m,{name:`تلفات برای این بار در تاریخ ${Fu((c=e.complaint)==null?void 0:c.createDate)} ثبت شده.`,columns:["عنوان","توضیحات","تاریخ ثبت","وضعیت","درصد تلفات","تلفات عرف","وزن واقعی","وزن با احتساب تلفات","پیوست تصویر"],data:[[(F=e.complaint)==null?void 0:F.title,(i=e.complaint)!=null&&i.description?(n=e.complaint)==null?void 0:n.description:"بدون توضیحات",Y(new Date((o=e.complaint)==null?void 0:o.createDate),"yyyy/MM/dd"),((A=e.complaint)==null?void 0:A.state)==="pending"?"در حال بررسی":((C=e.complaint)==null?void 0:C.state)==="accepted"?"تایید شده":"رد شده",(p=e.complaint)==null?void 0:p.percent,(h=e.complaint)==null?void 0:h.percentageLosses,(g=e.complaint)==null?void 0:g.realWeight,((D=e.complaint)==null?void 0:D.lossesWeight)!==0?(W=e.complaint)==null?void 0:W.lossesWeight:"تلفات بررسی نشده است",(N=(K=e.complaint)==null?void 0:K.image)!=null&&N.length?(L=(k=e.complaint)==null?void 0:k.image)==null?void 0:L.map((v,R)=>[u.jsx(r,{display:"inline-flex",children:u.jsx("a",{href:v,alt:"دانلود",children:u.jsx("img",{src:v,width:"80",height:"80",alt:"دانلود",style:{marginRight:"10px",borderRadius:"5px"}})})},`SlaughterPaymentFactorImage${R}`)]):"بدون پیوست"]]}),((I=e==null?void 0:e.complaint)==null?void 0:I.reviewer)&&u.jsxs(s,{mt:a.TINY,variant:"body2",color:v=>v.palette.grey.A700,children:[`تلفات در تاریخ ${Fu((x=(l=e==null?void 0:e.complaint)==null?void 0:l.reviewer)==null?void 0:x.createDate)} توسط ${(t=(d=e==null?void 0:e.complaint)==null?void 0:d.reviewer)==null?void 0:t.operatorname} `,(($=(w=e==null?void 0:e.complaint)==null?void 0:w.reviewer)==null?void 0:$.state)==="accepted"?"تایید ":"رد ","شده است."]})]})]})};Tu.propTypes={item:j.PropTypes.object};const e6=()=>{var g,D,W,K,N,k,L,I;const e=qu(),c=eu(),{id:F}=hu(),i=_u(F),[n]=xu(),o=(g=i==null?void 0:i.file)==null?void 0:g.process,{quantity:A,provinceAssignments:C}=Gu((D=o==null?void 0:o.poultry)==null?void 0:D.poultryRequestKey);f.useEffect(()=>{c(Ou())},[]);const p=o==null?void 0:o.provinceKillRequests;f.useEffect(()=>()=>{c(Uu())},[]);const h=o==null?void 0:o.filePaymentType;return u.jsx(u.Fragment,{children:o&&u.jsx(Hu,{mt:a.MEDIUM,display:"flex",justifyContent:"center",children:u.jsxs(r,{container:!0,direction:"column",justifyContent:"center",xs:12,sm:12,md:10,lg:10,children:[u.jsx(r,{container:!0,justifyContent:"space-between",mb:a.SMALL,children:u.jsx(r,{container:!0,alignItems:"center",children:u.jsxs(ku,{"aria-label":"delete",color:"primary",onClick:()=>e(-1),children:[u.jsx(Zu,{}),u.jsx(s,{children:"بازگشت"})]})})}),u.jsxs(Lu,{children:[u.jsx(r,{container:!0,px:a.SMALL,gap:a.TINY,justifyContent:"space-between",direction:"column",children:u.jsxs(r,{container:!0,direction:"column",children:[u.jsx(r,{container:!0,children:u.jsxs(s,{variant:"h6",children:["مشخصات پرونده با کد سفارش",(W=o==null?void 0:o.poultry)==null?void 0:W.poultryOrderCode]})}),u.jsxs(r,{container:!0,gap:a.TINY,children:[u.jsx(r,{children:(K=o==null?void 0:o.poultry)!=null&&K.poultryAuction?u.jsx(s,{variant:"body2",color:"secondary",children:"(فروش از طریق مزایده)"}):u.jsx(s,{variant:"body2",color:"secondary",children:"(فروش از طریق اتحادیه)"})}),u.jsxs(r,{children:[h==="cash"&&u.jsx(s,{variant:"body2",color:l=>l.palette.warning.dark,children:"(فروش نقدی)"}),h==="credit"&&u.jsx(s,{variant:"body2",color:l=>l.palette.warning.dark,children:"(فروش زمان دار - تا یک ماه)"}),h==="cash_credit"&&u.jsx(s,{variant:"body2",color:l=>l.palette.warning.dark,children:"(فروش بصورت نقدی و زمان دار)"})]})]})]})}),u.jsxs(Iu,{sx:{gap:a.MEDIUM,[`& .${Mu.root}`]:{}},children:[u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{}),u.jsx(P,{})]}),u.jsxs(r,{container:!0,direction:"column",width:"100%",children:[u.jsxs(r,{container:!0,children:[u.jsx(r,{children:u.jsx(H,{children:u.jsx(s,{variant:"body1",fontWeight:"bold",children:"مشخصات درخواست"})})}),u.jsx(r,{children:u.jsx(M,{color:"textSecondary",children:u.jsxs(r,{container:!0,gap:a.SMALL,children:[u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"درخواست در تاریخ"}),u.jsx(s,{variant:"body2",fontWeight:"bold",children:U((N=o==null?void 0:o.poultry)==null?void 0:N.poultryRegisterDate)}),u.jsx(s,{variant:"body2",display:"flex",gap:a.SMALL,children:"ثبت شده است."})]})})})]}),u.jsx(Bu,{file:o})]})]}),u.jsx(ju,{file:o}),!o.auctionsList&&!o.killHouseWinner&&(o==null?void 0:o.city)&&o.city.cityState==="accept"&&u.jsx(yu,{quantity:A,file:o}),!o.killHouseWinner&&C&&!!(p!=null&&p.length)&&(C==null?void 0:C.map((l,x)=>u.jsx(r,{children:u.jsx(r,{children:u.jsx(fu,{item:l,i:x})})},"ProvinceAllocationInformation"+x))),!o.killHouseWinner&&(p==null?void 0:p.map(l=>{const{killHouseRequests:x}=l;return x==null?void 0:x.filter(t=>t.barInfo!==null).map((t,w)=>{var R,q,B,_,G,Q;const $=t.barInfo&&t.provinceFactorToKillHouse&&(!t.killHouseFactorToProvince||t.killHouseFactorToProvince.factorState==="rejected")||t.provinceFactorToKillHouseForPoultry&&!t.killHouseFactorToPoultry||((R=t.killHouseFactorToPoultry)==null?void 0:R.factorState)==="rejected",v=[[t.barcod,`${t.killHouseName} (${t.killHouseUserProvince}/${t.killHouseUserCity})`,t.quantity+" قطعه",((q=t.car)==null?void 0:q.driverName)+` (${(B=t.car)==null?void 0:B.driverMobile})`,`${(_=t.car)==null?void 0:_.typeCar} با پلاک ${(G=t.car)==null?void 0:G.pelak}`,t.barInfo.killHouseNetWeight+" کیلوگرم",t.fee+" ریال",u.jsx("a",{href:t.barInfo.killHouseImageWithoutLoad,alt:"دانلود سند خودرو بدون بار",children:u.jsx("img",{src:t.barInfo.killHouseImageWithoutLoad,width:"100",height:"100",alt:"بدون بار",className:"images-file"})},"provinceKillRequests"),u.jsx("a",{href:t.barInfo.killHouseImageWithLoad,alt:"دانلود سند خودرو با بار",children:u.jsx("img",{src:t.barInfo.killHouseImageWithLoad,width:"100",height:"100",alt:"بدون بار",className:"images-file"},"provinceKillRequests")},"provinceKillRequests")]];return u.jsxs(r,{children:[u.jsx(X,{item:v,data:t,auction:!1}),t.complaint&&u.jsxs(S,{sx:{alignSelf:"flex-start",width:"100%"},children:[u.jsxs(b,{children:[u.jsx(E,{color:"secondary"}),u.jsx(P,{})]}),u.jsx(r,{xs:12,children:u.jsx(Tu,{item:t})})]}),(T()==="ProvinceFinancial"||T()==="ProvinceInspector")&&((Q=t.complaint)==null?void 0:Q.state)==="pending"&&u.jsx(vu,{item:t}),(T()==="KillHouse"||T()==="ProvinceFinancial")&&(n.includes("KillHouse")||n.includes("ProvinceFinancial"))&&$&&u.jsx(u.Fragment,{})]},"killHouseRequests"+w)})})),o.killHouseWinner&&((k=o.auction)==null?void 0:k.filter(l=>l.barInfo!==null).map((l,x)=>u.jsxs(r,{children:[u.jsx(X,{data:l,auction:!0}),T()==="ProvinceFinancial"&&n.includes("ProvinceFinancial")&&!l.provinceFactorToKillHouse&&u.jsx(Vu,{item:l})]},"killHouseRequests"+x))),o.killHouseWinner&&o.auction&&((L=o.auction)==null?void 0:L.filter(l=>l.barInfo&&!l.killHouseFactorToProvince&&l.provinceFactorToKillHouse).map((l,x)=>{var d,t;return u.jsxs(u.Fragment,{children:[u.jsx(X,{data:l,auction:!0}),T()==="KillHouse"&&n.includes("KillHouse")&&u.jsx(Xu,{factorKey:(d=l.provinceFactorToKillHouse)==null?void 0:d.provinceFactorKey,price:(t=l.provinceFactorToKillHouse)==null?void 0:t.cost,provinceFactorToKillHouse:l.provinceFactorToKillHouse},`SlaughterPayProvinceFactorForm${x}`)]})})),p==null?void 0:p.map(l=>{const{killHouseRequests:x}=l;return x==null?void 0:x.filter(d=>d.barInfo&&(d.killHouseFactorToProvince||d.killHouseFactorToPoultry)).map((d,t)=>u.jsxs(u.Fragment,{children:[(d==null?void 0:d.killHouseFactorToProvince)&&u.jsx(uu,{data:d.killHouseFactorToProvince,barCode:d.barcod},`SlaughterPaymentFactor${t}`),(d==null?void 0:d.killHouseFactorToPoultry)&&u.jsx(mu,{data:d.killHouseFactorToPoultry,barCode:d.barcod},`SlaughterPaymentFactor${t}`)]}))}),o.killHouseWinner&&((I=o.auction)==null?void 0:I.filter(l=>l.barInfo&&l.killHouseFactorToProvince).map((l,x)=>u.jsx(u.Fragment,{children:u.jsx(uu,{data:l.killHouseFactorToProvince,barCode:l.barcod},`SlaughterPaymentFactor${x}`)}))),o.allocation&&u.jsx(r,{xs:12,children:u.jsx(Ju,{process:o})}),o.provinceIncpector.acceptRejectDate&&u.jsx(gu,{data:o.provinceIncpector})]})]})]})})})};e6.propTypes={id:j.PropTypes.number};export{e6 as default};