"use strict";(self.webpackChunkwheelsmart_admin_react=self.webpackChunkwheelsmart_admin_react||[]).push([[2918],{18534(e,i,t){t(65043);const l=t.p+"static/media/empty-list.6fd5c5d1fceac81a14359bdcffbb13db.svg";t.d(i,["A",0,l])},32918(e,i,t){t.r(i);var l=t(89379),n=t(65043),a=t(97508),d=t(26655),r=t(11645),o=t(39998),c=t(91037),s=t(75639),m=t(47419),u=t(97190),v=t(36683),h=t(91688),p=t(79797),w=(t(18534),t(86178),t(28564)),x=t(11225),j=t(70579);const g=(0,a.Ng)(function(e){let i=e.material;return{viewLoading:i.viewLoading,materialView:i.materialView}},{getMaterialById:w.eF})(function(e){var i,t,a,w,g,b,V,A,y,f,I,k,C;let _=(0,h.useParams)().id;const M=v.A.Text;v.A.Title,v.A.Link,(0,n.useEffect)(()=>{e.getMaterialById(_)},[]);const q=[{title:"Date",description:null==e.materialView.createdon?"none":e.materialView.createdon},{title:"CODE",description:null==e.materialView.code?"none":e.materialView.code},{title:"Job Card",description:null==e.materialView.jobcard?"none":null===(i=e.materialView.jobcard)||void 0===i?void 0:i.code},{title:"Mechanic Name",description:null==e.materialView.mechanic?"none":null===(t=e.materialView.mechanic)||void 0===t?void 0:t.name},{title:"Mechanic Phone",description:null==e.materialView.mechanic?"none":null===(a=e.materialView.mechanic)||void 0===a?void 0:a.mobile},{title:"Ramp",description:null==e.materialView.ramp?"none":null===(w=e.materialView.ramp)||void 0===w?void 0:w.rampno},{title:"Vehicle",description:null==(null===(g=e.materialView.jobcard)||void 0===g||null===(b=g.vehicle)||void 0===b?void 0:b.vehicleno)?"none":null===(V=e.materialView.jobcard)||void 0===V||null===(A=V.vehicle)||void 0===A?void 0:A.vehicleno},{title:"Total Estimation",description:null==(null===(y=e.materialView.jobcard)||void 0===y?void 0:y.total_estimation)?"none":null===(f=e.materialView.jobcard)||void 0===f?void 0:f.total_estimation}];var N=[];q.forEach(e=>{null!==e.title&&N.push(e)});const E=null===e||void 0===e||null===(I=e.materialView)||void 0===I||null===(k=I.miitems)||void 0===k?void 0:k.reduce((e,i)=>e+parseInt(i.qty),0),L=[{title:"S.No",dataIndex:"index",width:70},{title:"Code",dataIndex:"code",width:120},{title:"Category",render:e=>{var i,t;return(0,j.jsx)(M,{children:null===(i=e.item)||void 0===i||null===(t=i.category)||void 0===t?void 0:t.name})},width:100},{title:"Sub Category",render:e=>{var i,t;return(0,j.jsx)(M,{children:null===(i=e.item)||void 0===i||null===(t=i.subcategory)||void 0===t?void 0:t.name})},width:100},{title:"Item",render:e=>{var i;return(0,j.jsx)(M,{children:null===(i=e.item)||void 0===i?void 0:i.name})},width:100},{title:"Item Image",render:e=>{var i,t;return(0,j.jsx)(c.A,{src:null==(null===(i=e.item)||void 0===i?void 0:i.image)?x:null===(t=e.item)||void 0===t?void 0:t.image,style:{height:"50px",objectFit:"contain"}})},width:100},{title:"Price",render:e=>{var i;return(0,j.jsx)(M,{children:null===(i=e.item)||void 0===i?void 0:i.price})},width:100},{title:"Quantity : (".concat(E,")"),render:e=>(0,j.jsx)(M,{children:e.qty}),width:100},{title:"Request Quantity",render:e=>(0,j.jsx)(M,{children:e.req_qty}),width:100},{title:"Description",render:e=>(0,j.jsx)(M,{children:e.description}),width:100}],S=null===(C=e.materialView.miitems)||void 0===C?void 0:C.map((e,i)=>(0,l.A)((0,l.A)({},e),{},{index:i+1}));return(0,j.jsxs)(n.Fragment,{children:[(0,j.jsx)(m.A,{gutter:[12,12],children:(0,j.jsx)(r.A,{span:24,children:(0,j.jsx)(p.A,{pageTitle:"Material Issue View",goBack:!0})})}),(0,j.jsx)(m.A,{gutter:[12,0],children:(0,j.jsx)(r.A,{span:24,sm:24,xs:24,md:24,children:(0,j.jsxs)(d.A,{className:"hp-border-color-black-40 hp-mb-10 ",children:[(0,j.jsx)(s.Ay,{grid:{gutter:16,xs:1,sm:2,md:6,lg:6,xl:6,xxl:5},dataSource:N,renderItem:e=>(0,j.jsx)(s.Ay.Item,{children:(0,j.jsx)(s.Ay.Item.Meta,{title:(0,j.jsx)("span",{children:e.title}),description:(0,j.jsx)("span",{children:e.description})})})}),(0,j.jsx)(o.A,{className:"hp-mt-6 hp-mb-6"}),(0,j.jsx)(u.A,{columns:L,dataSource:S,pagination:!1,size:"middle",loading:e.viewLoading})]})})})]})});t.d(i,["default",0,g])},11225(e,i,t){e.exports=t.p+"static/media/noimg.b2f3d4d2db9e6455a9f4.png"}}]);
//# sourceMappingURL=2918.c9358d05.chunk.js.map