Files
Rasadyar_FrontEnd/build/assets/SlaughterMorgue-C5DfynIX.js

2 lines
24 KiB
JavaScript
Raw Normal View History

2026-02-09 09:53:38 +03:30
import{j as e,I as Su,b3 as r6,B as Y,an as V,ao as xu,aj as Xu,ak as Uu,al as Z,am as uu,ac as Du,T as o6,d as a6,a_ as n6,b5 as c6,b6 as u6,b as C6}from"./mui-vendor-D_SVL-Dx.js";import{r as a,j as s6,u as d6}from"./react-vendor-CmFgShSM.js";import{L as iu,j as eu,a0 as K,h as hu,A as wu,G as g,O as Fu,g2 as i6,c as h6,V as yu,b as Au,u as g6,v as J,$ as fu,C as ku,g4 as p6,p as x6,S as vu,dD as y6,g3 as A6,l1 as j6,l2 as F6}from"./index-D80MdVQn.js";import{R as ou}from"./ResponsiveTable-bUYl0qDM.js";import{a as l6,u as su,f as Q}from"./redux-vendor-CfkcHgWN.js";import{R as f6,a as k6}from"./index.esm-C1-dCPnj.js";import{d as t6}from"./Tune-BBzxV8DK.js";import{b as v6,s as S6,a as w6}from"./slaughter-allocate-steward-CCu9314u.js";import{S as _6,s as E6}from"./SlaughterAllocateToGuild-CeWc5BWf.js";import{N as ju}from"./NumberFormatCustom-BXcOcGV4.js";import{b as $6,a as b6}from"./slaughter-get-guilds-for-allocate-CQRKvxsV.js";import{I as T6,f as P6}from"./toBase64-UDzdrM-n.js";import{a as H6}from"./province-policy-upload-image-DZLwIF5K.js";import{c as G}from"./checkPathStartsWith-DedybDvj.js";import{B as B6}from"./BackButton-Dr-K0JXJ.js";import{d as L6}from"./Visibility-Cb7r65bM.js";import"./FilterAlt-DZsHj-WQ.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./MonthlyDataCalendar-_xfuL-Zd.js";import"./LabelField-BYhJrYEE.js";import"./PublishedWithChanges-Dz7dEVRv.js";import"./Delete-CIwpNviU.js";const G6=l6("SLAUGHTER_GET_MORGUE_DASHBOARD",async(p,{dispatch:l})=>{l(iu());const{data:w,status:d}=await eu.get("total-cold-house-dashboard-roles/",{params:{role:K(),...p}});return l(hu()),{data:w,status:d}}),R6=l6("SLAUGHTER_GET_MORGUES",async(p,{dispatch:l})=>{l(iu());const{data:w,status:d}=await eu.get("kill-house-cold-houses/",{params:{role:K()}});return l(hu()),{data:w,status:d}}),O6=({fetchApiData:p,item:l,fetchData:w,updateTable:d,priceInfo:$,remainWeight:h})=>{const[_,x]=a.useState(null),A=F=>{x(F.currentTarget)},t=()=>{x(null)},C=!!_,f=C?"popover":void 0,[i]=a.useContext(wu),k=su();return e.jsxs(g,{container:!0,children:[e.jsx(Su,{disabled:l==null?void 0:l.registrationCode,"aria-describedby":f,variant:"contained",color:"primary",onClick:A,children:e.jsx(t6,{})}),e.jsx(r6,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},id:f,open:C,anchorEl:_,onClose:t,children:e.jsx("div",{style:{padding:"20px",display:"flex",flexDirection:"column"},children:e.jsxs(g,{container:!0,direction:"column",gap:1,children:[e.jsx(Y,{variant:"outlined",onClick:()=>{t(),k(Fu({title:"ویرایش تخصیص",content:e.jsx(_6,{updateTable:w,fetchApiData:p,sellerType:"ColdHouse",sellType:"exclusive",coldHouseItemKey:l==null?void 0:l.key,priceInfo:$,editData:l,remainWeight:h})}))},children:"ویرایش"}),e.jsx(Y,{size:"small",disabled:l==null?void 0:l.registrationCode,variant:"outlined",color:"error",onClick:()=>{t(),k(v6({steward_allocation_key:l.key})).then(F=>{F.error?i({vertical:"top",horizontal:"center",msg:F.payload.error,severity:"error"}):(p(1),w(),d(),i({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"حذف"})]})})})]})},W6=({item:p,key:l,sellerType:w,fetchData:d,buyerType:$,allocationType:h,sellType:_,updateTable:x,fetchApiData:A,editData:t,priceInfo:C,coldHouseKey:f,coldHouseItemKey:i,remainWeight:k,killHouseAllocation:F})=>{var D;const v=su(),[y,R]=a.useState([]),[E,W]=a.useState([]),[T,m]=a.useState([]),[P,M]=a.useState(null),[j]=a.useContext(wu),[H,z]=a.useState(C!=null&&C.active?"true":"false"),[lu,gu]=a.useState(t!=null&&t.image?[{data_url:t.image}]:[]),[O,tu]=a.useState("own"),[pu,ru]=a.useState(1),[I,c]=a.useState(!1),u=Q(o=>o.userSlice.selectedSubUser),au=o=>{tu(o.target.value),q({key:"",item:"",buyerType:"",allocationType:""})},N=o=>{z(o.target.value),o.target.value==="false"&&s.setFieldValue("price","")},[n,q]=a.useState({key:l,item:p,buyerType:$,allocationType:h});a.useEffect(()=>{K()==="Steward"&&tu("free")},[]),a.useEffect(()=>{v(H6()).then(o=>{var r;(r=o.payload)!=null&&r.data&&r