Files
Rasadyar_FrontEnd/build/assets/Poultries-CUbx924m.js

2 lines
12 KiB
JavaScript
Raw Normal View History

2026-01-19 15:55:00 +03:30
import{j as s,al as ou,ak as Y,B as N,ar as nu,d as Q,I as lu,b0 as cu,an as iu,b4 as O,ap as k,aq as w,T as M}from"./mui-vendor-CkIVaoQP.js";import{L as R,j as E,h as v,e6 as Cu,G as S,C as du,X as T,A as Au,e7 as gu,O as hu}from"./index-Vwb3Bce5.js";import{r as C,u as Fu}from"./react-vendor-CmFgShSM.js";import{a as B,u as W,f as X}from"./redux-vendor-B7uoacJt.js";import{a as fu}from"./index.esm-Bu7XMDZU.js";import{R as I}from"./ResponsiveTable-DugzNG82.js";import{d as pu}from"./Tune-DzkdDfJZ.js";import{d as xu}from"./FileDownload-CKLIQJd3.js";import{d as yu}from"./ToggleOn-DkUpTkpl.js";import{d as vu}from"./ToggleOff-Cwo-Dc_l.js";import{d as Eu}from"./Visibility-Dotz22eQ.js";import"./iconBase-BEJYyZsk.js";import"./FilterAlt-CTDmPS36.js";import"./styled-components.browser.esm-gS9mh05b.js";const ju=B("PROVINCE_EDIT_POULTRY_CITY_SERVICE",async(i,{dispatch:n})=>{try{n(R());const{data:A,status:F}=await E.put("Poultry/0/",i);return n(v()),{data:A,status:F}}catch(A){return n(v()),{error:A.response.data.result}}}),Lu=({item:i,updateTable:n})=>{const A=W(),[F,t]=C.useState(),{getCitiesOptions:f}=X(h=>h.provinceSlice),j=h=>h.label;return C.useEffect(()=>{A(Cu())},[]),s.jsxs(S,{container:!0,gap:1,width:"100%",children:[s.jsx(ou,{options:f,getOptionLabel:j,sx:{width:"100%"},onChange:(h,D)=>t(D),value:F,renderInput:h=>s.jsx(Y,{...h,label:"تعاونی"})}),s.jsx(N,{fullWidth:!0,variant:"contained",onClick:()=>{F&&A(ju({key:i.key,city_operator:F.value})).then(h=>{A(du()),n()})},children:"ثبت"})]})},K=B("POULTRIES_DASHBOARD",async(i,{dispatch:n})=>{n(R());const{data:A,status:F}=await E.get("total_poultry_hatching_dashboard",{params:{search:"filter",value:i.textValue,role:T()}});return n(v()),{data:A,status:F}}),Pu=B("GET_POULTRY_ACTIVE_LIMITED_SERVICE",async(i,{dispatch:n})=>{try{n(R());const{data:A,status:F}=await E.put("/Poultry/0/",i);return n(v()),{data:A,status:F}}catch(A){return n(v()),{error:A.response.data.result}}}),Su=()=>{const i=W(),[n]=C.useContext(Au),A=e=>{Z(e.target.value)},F=X(e=>{var u,a;return(a=(u=e.userSlice)==null?void 0:u.userProfile)==null?void 0:a.key}),[t,f]=C.useState([]),[j,h]=C.useState([]),[D,b]=C.useState(0),[L,J]=C.useState(10),[x,Z]=C.useState(""),[P,q]=C.useState(1),[uu,U]=C.useState([]),[V,d]=C.useState(!1),eu=({poultryItem:e,onToggleLimit:u})=>{const a=Fu(),[l,r]=C.useState(null),o=!!l,c=$=>{r($.currentTarget)},g=()=>{r(null)},y=()=>{i(hu({title:"ویرایش تعاونی",content:s.jsx(Lu,{updateTable:m,item:e})})),g()},p=()=>{e!=null&&e.key&&window.open(`${E.defaults.baseURL}poultry_monitoring_excel/?key=${e.key}`,"_blank"),g()},_=()=>{e!=null&&e.breedingUniqueId&&a(window.location.pathname+`${e.breedingUniqueId}?from=Poultry`),g()};return s.jsxs(S,{children:[s.jsx(Q,{title:"تنظیمات",placement:"right-start",children:s.jsx(lu,{color:"primary",className:"avicultureActiveRequestsBtn",onClick:c,children:s.jsx(pu,{})})}),s.jsx(cu,{open:o,anchorEl:l,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:s.jsxs(iu,{sx:{minWidth:220,p:1},children:[s.jsxs(O,{sx:{py:1},onClick:()=>u(!(e!=null&&e.orderLimit)),children:[s.jsx(k,{children:e!=null&&e.orderLimit?s.jsx(yu,{color:"success"}):s.jsx(vu,{color:"disabled"})}),s.jsx(w,{primary:s.jsx(M,{variant:"body2",color:"textPrimary",children:"محدودیت ثبت سفارش"})})]}),s.jsxs(O,{onClick:_,sx:{py:1},children:[s.jsx(k,{children:s.jsx(Eu,{color:"primary"})}),s.jsx(w,{primary:s.jsx(M,{variant:"body2",color:"textPrimary",children:"مشاهده جزییات"})})]}),s.jsxs(O,{disabled:T()==="VetSupervisor",onClick:y,sx:{py:1},children:[s.jsx(k,{children:s.jsx(gu,{color:"secondary"})}),s.jsx(w,{primary:s.jsx(M,{variant:"body2",color:"textPrimary",children:"ویرایش تعاونی"})})]}),s.jsxs(O,{onClick:p,sx:{py:1},children:[s.jsx(k,{children:s.jsx(xu,{color:"success"})}),s.jsx(w,{primary:s.jsx(M,{variant:"body2",color:"textPrimary",children:"خروجی اکسل"})})]})]})})]})},z=async e=>{var u,a,l;if(!V){i(R());try{const r=await E.get(`total_poultry/?search=filter&value=${x