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