Files
Rasadyar_FrontEnd/build/assets/ProvinceDispensersStockSlug-CyPDwZ22.js

2 lines
16 KiB
JavaScript
Raw Normal View History

2026-01-19 16:15:09 +03:30
import{j as u,b as J,B as X,T as L,ai as fe,b5 as xe,ak as oe,I as pe,b2 as Fe,b3 as he}from"./mui-vendor-CkIVaoQP.js";import{L as re,j as Q,h as V,A as le,p as ae,N as Ae,G as l,S as H,X as De,v as ne,W as Ce,_ as _e,O as Ee,C as ge}from"./index-BHF9XhlR.js";import{B as Pe}from"./BackButton-C3p7AEJl.js";import{r,f as ce}from"./react-vendor-CmFgShSM.js";import{a as m,u as ie}from"./redux-vendor-B7uoacJt.js";import{R as se}from"./ResponsiveTable-cmj--TTX.js";import{I as Ie,f as Te}from"./toBase64-UEKXUH-t.js";import{r as Re}from"./resizeImage-Csf2MO3w.js";import{d as ze}from"./Delete-BMbGwban.js";import{d as ke}from"./Search-D4DyWpQE.js";import"./FilterAlt-C5yvLNoT.js";import"./styled-components.browser.esm-gS9mh05b.js";import"./PublishedWithChanges-DLwGJTcV.js";const Le=m("PROVINCE_WAREHOUSE_ARCHIVE",async e=>{const{data:a,status:c}=await Q.post("ware-house-archive/",e);return{data:a,status:c}}),We=m("PROVINCE_GET_WAREHOUSE_ARCHIVE",async(e,{dispatch:a})=>{var c,x;try{a(re());const n={date1:e==null?void 0:e.date1,date2:e==null?void 0:e.date2,search:(e==null?void 0:e.search)??"filter",value:(e==null?void 0:e.value)??"",page:(e==null?void 0:e.page)??1,page_size:(e==null?void 0:e.page_size)??10};e!=null&&e.archive_type&&(n.archive_type=e.archive_type),e!=null&&e.owner_type&&(n.owner_type=e.owner_type);const{data:s,status:b}=await Q.get("ware-house-archive/",{params:n});return a(V()),{data:s,status:b}}catch(n){return a(V()),{error:((x=(c=n.response)==null?void 0:c.data)==null?void 0:x.result)||"خطا در دریافت اطلاعات"}}}),Ne=m("PROVINCE_DELETE_WAREHOUSE_ARCHIVE",async({key:e},{dispatch:a})=>{var c,x;try{a(re());const n="ware-house-archive/0/",{data:s,status:b}=await Q.delete(`${n}?key=${e}`);return a(V()),{data:s,status:b}}catch(n){return a(V()),{error:((x=(c=n.response)==null?void 0:c.data)==null?void 0:x.result)||"خطا در حذف بایگانی"}}}),Be=m("PROVINCE_GET_TOTAL_KILLHOUSE_REMAIN_WEIGHT",async(e,{dispatch:a})=>{var c,x;try{a(re());const n=typeof window<"u"?window.location.pathname:"",s=(n==null?void 0:n.split("/").filter(Boolean).pop())==="steward",b=s?"total-steward-remain-weight/":"total-kill-house-remain-weight/",S={search:(e==null?void 0:e.search)??"filter",value:(e==null?void 0:e.value)??"",page:(e==null?void 0:e.page)??1,page_size:(e==null?void 0:e.page_size)??(s?40:10),quota:(e==null?void 0:e.quota)??!1};e!=null&&e.date1&&(S.date1=e.date1),e!=null&&e.date2&&(S.date2=e.date2),s?S.owner_type=(e==null?void 0:e.owner_type)??"steward":S.role=(e==null?void 0:e.role)??"SuperAdmin";const{data:F,status:_}=await Q.get(b,{params:S});return a(V()),{data:F,status:_}}catch(n){return a(V()),{error:((x=(c=n.response)==null?void 0:c.data)==null?void 0:x.result)||"خطا در دریافت اطلاعات"}}}),Me=m("PROVINCE_GET_TOTAL_KILLHOUSE_ARCHIVE_DASHBOARD",async(e,{dispatch:a})=>{var c,x;try{a(re());const n=(e==null?void 0:e.owner_type)==="steward",s=n?"total-guild-steward-archive-dashboard/":"total-kill-house-archive-dashboard/",b={search:(e==null?void 0:e.search)??"filter",value:(e==null?void 0:e.value)??"",date1:e==null?void 0:e.date1,date2:e==null?void 0:e.date2,page:(e==null?void 0:e.page)??1,page_size:(e==null?void 0:e.page_size)??10};n?b.owner_type=e.owner_type??"steward":b.role=(e==null?void 0:e.role)??"SuperAdmin";const{data:S,status:F}=await Q.get(s,{params:b});return a(V()),{data:S,status:F}}catch(n){return a(V()),{error:((x=(c=n.response)==null?void 0:c.data)==null?void 0:x.result)||"خطا در دریافت اطلاعات"}}}),Oe=({killhouseName:e,killhouseKey:a,dayData:c,governmentalData:x,freeData:n,selectedType:s,onSuccess:b})=>{const S=ie(),F=ce(),[_]=r.useContext(le),[R,d]=r.useState(""),[U,$]=r.useState([]),[E,P]=r.useState(""),D=s==="free"?n:x,Y=()=>{const j=F.pathname.split("/").filter(Boolean);return j.includes("steward")?"steward":j.includes("killhouse")?"kill_house":j[j.length-1]||"kill_house"},z=j=>{var k;if($(j),j[0]){const A=(k=j[0])==null?void 0:k.file;Re(A,p=>{const i=Te(p);P(i)})}else P("")},Z=()=>{const j=Y(),A={role:De(),owner_key:a,archive_type:j,date:c,weight:D.am