2 lines
48 KiB
JavaScript
2 lines
48 KiB
JavaScript
|
|
import{j as e,T as w,d as Qu,I as s6,an as G,B as m,aj as i6,ay as N6,az as V6,aA as q6,i as d6,ah as cu,aR as t0,aS as n0,aT as a0,aU as o0,aV as s0,aW as l0,bk as c0,ak as C0,al as l6,am as T6,aD as i0,a1 as d0,b3 as h0,N as A0,b as c6,a_ as p0}from"./mui-vendor-D_SVL-Dx.js";import{L as Y,j as O,h as D,A as au,a0 as M,C as iu,O as Cu,G as d,S as P,v as hu,ad as M6,$ as e6,dP as O6,u as h6,X as A6,r as p6,c as $6,b as Yu,V as C6,W as U6,go as g0,a3 as F0}from"./index-D80MdVQn.js";import{r as c,b as L6}from"./react-vendor-CmFgShSM.js";import{I as H6,f as z6}from"./toBase64-UDzdrM-n.js";import{a as ou,u as uu,f as H}from"./redux-vendor-CfkcHgWN.js";import{r as K6}from"./resizeImage-Csf2MO3w.js";import{S as u6}from"./ShowImage-DxnwAx1k.js";import{V as G6,v as y0}from"./VetFarmEditTrafficCode-C5Hod_My.js";import{R as Y6,a as g6}from"./index.esm-C1-dCPnj.js";import{R as r6}from"./ResponsiveTable-bUYl0qDM.js";import{d as f0}from"./AddCircleOutline-5cdNoXZy.js";import{i as Q6}from"./isValidIndexWeight-C_ik-uYa.js";import{c as du}from"./checkPathStartsWith-DedybDvj.js";import{V as x0}from"./SlaughterEnterNoneReciept-By4AAznT.js";import{g as E0}from"./getDocumentStates-X7qXjbQL.js";import{d as v0}from"./Tune-BBzxV8DK.js";import{d as R0}from"./Delete-CIwpNviU.js";import{S as j0}from"./SimpleTable-tm4uaKUf.js";import{N as Xu}from"./NumberFormatCustom-BXcOcGV4.js";import{F as S0}from"./FileUploader-DvFCJiD0.js";const W6=ou("KILL_HOUSE_ASSIGNMENT_INFORMATION_AGGREGATE_LOAD_SERVICE",async(u,{dispatch:r})=>{try{r(Y());const{data:o,status:n}=await O.put("kill_house_assignment_information_aggregate_load/0/",u);return r(D()),{data:o,status:n}}catch(o){return r(D()),{error:o.response.data.result}}}),P6=({isSingular:u,item:r,updateTable:o})=>{var p;const n=uu(),[i]=c.useContext(au),[y,F]=c.useState([]),[h,A]=c.useState(),{slaughterGetAggregateLoadInformation:R}=H(g=>g.slaughterSlice),C=(g,f)=>{var _;if(g[0]){const x=(_=g[0])==null?void 0:_.file;K6(x,B=>{const L=z6(B);A(L)})}F(g)};return c.useEffect(()=>{h&&(u?n(W6({image:h,bar_key:r.key,role:M()})).then(g=>{var f,_;A(null),F([]),n(iu()),g.payload.error?i({vertical:"top",horizontal:"center",msg:g.payload.error,severity:"error"}):(i({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),(f=r==null?void 0:r.assingmentInformation)!=null&&f.realQuantity&&((_=r==null?void 0:r.assingmentInformation)!=null&&_.carWeightWithLoadImage)&&n(Cu({title:"بار به تب مدیریت بارها منتقل شد."})),o(1))}):n(W6({image:h,bar_keys:R==null?void 0:R.map(g=>g.key),role:M()})).then(g=>{var f,_;A(null),F([]),n(iu()),g.payload.error?i({vertical:"top",horizontal:"center",msg:g.payload.error,severity:"error"}):(i({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}),o(1),(f=r==null?void 0:r.assingmentInformation)!=null&&f.realQuantity&&((_=r==null?void 0:r.assingmentInformation)!=null&&_.carWeightWithLoadImage)&&n(Cu({title:"بار به تب مدیریت بارها منتقل شد."})))}))},[h,y]),e.jsxs(d,{width:"100%",children:[!u&&e.jsxs(d,{container:!0,gap:P.TINY,mb:P.SMALL,children:[e.jsx(w,{color:"error",children:"نکته:"}),e.jsx(w,{children:"این سند برای تمامی بارهایی که فاقد سند هستند ثبت خواهد شد."})]}),e.jsx(d,{mt:P.SMALL,children:e.jsx(H6,{onChange:C,images:y,maxNumber:1,showImages:!1,title:(p=r==null?void 0:r.assingmentInformation)!=null&&p.carWeightWithLoadImage?"ویرایش":"ثبت"})})]})},_0=ou("SALUGHTER_AGGREGATE_QUANTITY_SERVICE",async(u,{dispatch:r})=>{try{r(Y());const{data:o,status:n}=await O.post("kill_house_assignment_information_aggregate_load/",u);return r(D()),{data:o,status:n}}catch(o){return r(D()),{error:o.response.data.result}}}),I0=ou("PROVINCE_GET_LOAD_INFO_DASHBOARD",async(u,{dispatch:r})=>{try{r(Y());const{data:o,status:n}=await O.get("dashboard_enter_load_information",{params:{date1:u.selectedDate1,date2:u.selectedDate2,role:M(),filter:"search",value:u.text?u.text:"",role_key:u.role_key||""}});return r
|