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