"use strict";(globalThis.webpackChunkwheelsmart_admin_react||=[]).push([[5716],{35716(a,e,t){t.r(e);var s=t(65043),d=t(62582),r=t(97508),c=(t(30064),t(89421)),i=t(26655),o=t(11645),l=t(5835),n=t(12779),p=t(47419),u=t(5397),h=t(30190),m=(t(86178),t(73847)),S=t(79797),k=t(2716),g=t(8738),x=t(70579);const A=(0,r.Ng)(function(a){let{idealStock:e,system:t}=a;return{loading:e.loading,listCount:e.listCount,drawer:e.drawer,userAccessList:t.userAccessList,updateStockParams:e.updateStockParams,updateStockList:e.updateStockList}},{updateIdealStockList:k.tM,setUpdateStockParams:k.Cp,isDrawerVisible:k.wq,clearData:k.MW})(function(a){var e,t,r,k;const{Search:A}=l.A;(0,s.useEffect)(()=>{a.clearData(),a.updateIdealStockList({...a.updateStockParams,page:1,search:"",page_size:10})},[]);const j="hp-p1-body hp-text-color-black-50 hp-text-color-dark-0 hp-font-weight-500 ",P=[{title:"S.No",dataIndex:"index",width:50},{title:"Date",render:a=>(0,x.jsx)("span",{className:j,children:a.date}),width:120},{title:"Counter",render:a=>{var e;return(0,x.jsx)("span",{className:j,children:null===(e=a.counter)||void 0===e?void 0:e.name})},width:120}],v=null===(e=a.updateStockList)||void 0===e?void 0:e.map((e,t)=>({...e,index:(a.updateStockParams.page-1)*a.updateStockParams.page_size+t+1}));return(0,x.jsxs)(p.A,{gutter:[12,12],children:[(0,x.jsx)(S.A,{pageTitle:"Ideal Stock",goBack:!1}),(0,x.jsx)(o.A,{span:24,children:(0,x.jsxs)(p.A,{gutter:[12,12],children:[(0,x.jsx)(o.A,{span:24,xs:24,sm:24,md:14,children:(0,x.jsx)(A,{placeholder:"Search for branch, department, material type...",allowClear:!0,onChange:e=>{""==e.target.value&&(a.updateIdealStockList({...a.updateStockParams,page:1,search:"",type:1}),a.setUpdateStockParams({...a.updateStockParams,page:1,search:"",type:1}))},onSearch:e=>{var t;t=e,a.updateIdealStockList({...a.updateStockParams,page:1,search:t}),a.setUpdateStockParams({...a.updateStockParams,page:1,search:t})}})}),-1!==(null===(t=a.userAccessList)||void 0===t?void 0:t.indexOf("Purchase.add_idealstock"))&&(0,x.jsx)(o.A,{span:24,xs:4,sm:4,md:4,children:(0,x.jsx)(d.N_,{to:"/pages/idealStock-Add/0",children:(0,x.jsx)(c.A,{className:"hp-w-100 hp-p-10",icon:(0,x.jsx)(m.A,{className:"hp-mr-10"}),children:!g.Fr&&"Add Ideal Stock"})})})]})}),(0,x.jsx)(o.A,{span:24,children:(0,x.jsx)(i.A,{children:(0,x.jsxs)(p.A,{className:"hp-mb-12",children:[(0,x.jsx)(o.A,{span:24,children:(0,x.jsx)(u.A,{tip:"Loading...",spinning:a.loading,delay:500,children:(0,x.jsx)(h.A,{columns:P,dataSource:v,scroll:{x:1300},pagination:!1,size:"middle",className:"hp-p-0"})})}),(0,x.jsx)(o.A,{span:24,children:(0,x.jsx)(n.A,{size:"small",current:null===(r=a.updateStockParams)||void 0===r?void 0:r.page,pageSize:null===(k=a.updateStockParams)||void 0===k?void 0:k.page_size,total:a.listCount,showTotal:function(a){return"Total "+a+" items"},showSizeChanger:!0,onChange:function(e,t){a.setUpdateStockParams({...a.updateStockParams,page_size:t,page:0==e?1:e}),a.updateIdealStockList({...a.updateStockParams,page_size:t,page:0==e?1:e})},className:"hp-mb-12 hp-mt-24 hp-float-right"})})]})})})]})});t.d(e,["default",0,A])}}]);
//# sourceMappingURL=5716.0a5b0aec.chunk.js.map