Sindbad~EG File Manager
"use strict";(self.webpackChunk_minimal_material_kit_react=self.webpackChunk_minimal_material_kit_react||[]).push([[906],{1906:(e,i,l)=>{l.r(i),l.d(i,{default:()=>L});var n=l(2791),t=l(7267),s=l(1614),d=l(3767),a=l(890),o=l(1889),r=l(7621),c=l(9836),v=l(3382),u=l(5855),h=l(3994),x=l(8096),j=l(9321),Z=l(3786),m=l(7391),_=l(4554),p=l(7689),b=l(5985),f=l(9434),g=l(6934),E=l(9709),y=l(9113),C=l(8141),S=l(3240),N=l(7247),I=l(7047),A=l(184);function w(){return(0,A.jsxs)(s.Z,{children:[(0,A.jsx)(d.Z,{sx:{py:3},children:(0,A.jsx)(d.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",children:(0,A.jsx)(I.Z,{variant:"h2",width:"50%",height:50})})}),(0,A.jsxs)(o.ZP,{container:!0,spacing:2,children:[(0,A.jsx)(o.ZP,{item:!0,xs:5,children:(0,A.jsx)(r.Z,{sx:{position:"relative",width:"100%",background:"#F1F1F1"},children:(0,A.jsx)(I.Z,{variant:"rectangular",width:"100%",height:400})})}),(0,A.jsx)(o.ZP,{item:!0,xs:1}),(0,A.jsx)(o.ZP,{item:!0,xs:6,children:(0,A.jsx)(c.Z,{children:(0,A.jsxs)(v.Z,{children:[(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)(I.Z,{})}),(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)(I.Z,{})})]}),(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)(I.Z,{})}),(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)(I.Z,{})})]}),(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)(I.Z,{})}),(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)(I.Z,{})})]}),(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)(I.Z,{})}),(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)(I.Z,{})})]}),(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)(I.Z,{})}),(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)(I.Z,{})})]}),(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)(I.Z,{})}),(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)(I.Z,{})})]})]})})})]})]})}const F=(0,g.ZP)("img")({top:0,width:"25%",height:"25%",objectFit:"contain"}),L=()=>{const{state:e}=(0,p.TH)(),i=(0,p.s0)(),[l,g]=(0,n.useState)([]),[I,L]=(0,n.useState)(!0),[k,O]=(0,n.useState)(!1),[P,T]=(0,n.useState)({}),[W,D]=(0,n.useState)([]),{userInfo:R}=(0,f.v9)((e=>e.auth)),[U,z]=(0,n.useState)(""),[H,M]=(0,n.useState)(!1),[V,$]=(0,n.useState)([{name:""}]),[G,q]=(0,n.useState)([]),[B,Y]=(0,n.useState)({sale_status:!1,sale_price:0,run_no:""}),J=async()=>{try{var i;const n=await S.Z.post("".concat(y.v,"/vehicle-run/get-single-vehicle/").concat(null===e||void 0===e||null===(i=e.product)||void 0===i?void 0:i.vehicle_id));if(200==(null===n||void 0===n?void 0:n.status)){var l;const e=null===n||void 0===n||null===(l=n.data)||void 0===l?void 0:l.data[0];T(e),L(!1);let i={sale_status:(null===e||void 0===e?void 0:e.sale_status)||!1,sale_price:null===e||void 0===e?void 0:e.sale_price,run_no:null===e||void 0===e?void 0:e.run_no,net_proceeds:(null===e||void 0===e?void 0:e.net_proceeds)||(null===e||void 0===e?void 0:e.sale_price)};null!==e&&void 0!==e&&e.auction_name&&null!==e&&void 0!==e&&e.lane_id&&(z(null===e||void 0===e?void 0:e.auction_name),i.lane_id=null===e||void 0===e?void 0:e.lane_id,D([{lane_id:null===e||void 0===e?void 0:e.lane_id,name:null===e||void 0===e?void 0:e.lane_name}])),Y(i),(async e=>{try{const l=await S.Z.post("".concat(y.v,"/vehicle-run/get-vehicle-fees/").concat(e));if(200==(null===l||void 0===l?void 0:l.status)){var i;let e=null===l||void 0===l||null===(i=l.data)||void 0===i?void 0:i.data;q(e)}}catch(l){b.Am.error("Error While fetching Vehicles Fees."),console.log("~ error:",l)}})(null===e||void 0===e?void 0:e.vehicle_id),(async e=>{try{const l=await S.Z.post("".concat(y.v,"/auctions-lanes/auctioneer-lanes"),{auctioneer_id:null===R||void 0===R?void 0:R.user_id});if(200==(null===l||void 0===l?void 0:l.status)){var i;let n=null===l||void 0===l||null===(i=l.data)||void 0===i?void 0:i.data;if(g(n),e){const i=n.find((i=>e===(null===i||void 0===i?void 0:i.auction_name)));(null===i||void 0===i?void 0:i.lane_names)&&D(null===i||void 0===i?void 0:i.lane_names)}}}catch(l){b.Am.error("Error While fetching Auction Lanes.")}})(null===e||void 0===e?void 0:e.auction_name)}}catch(n){b.Am.error("Error While fetching car details."),L(!1)}};(0,n.useEffect)((()=>{J(),(async()=>{try{const i=await S.Z.post("".concat(y.v,"/auctioneer-fees/get-auctioneer-fees/").concat(null===R||void 0===R?void 0:R.user_id));if(200==(null===i||void 0===i?void 0:i.status)){var e;let l=null===i||void 0===i||null===(e=i.data)||void 0===e?void 0:e.data;$(l)}}catch(i){b.Am.error("Error While fetching Auctioneer Fee List.")}})()}),[e]);const K=(e,i)=>{if("auction_name"===e){const e=l.find((e=>e.auction_name===i));z(null===e||void 0===e?void 0:e.auction_name),D(null===e||void 0===e?void 0:e.lane_names)}Y((l=>{const{auction_name:n,...t}=l;return{...t,vehicle_id:null===P||void 0===P?void 0:P.vehicle_id,[e]:i}}))};return(0,n.useEffect)((()=>{let e=G.reduce(((e,i)=>Number(e)+Number(i.fee_amount)),0);e=parseInt(null===B||void 0===B?void 0:B.sale_price)-e,Y((i=>({...i,net_proceeds:e})))}),[G]),I?(0,A.jsx)(w,{}):(0,A.jsxs)(s.Z,{children:[(0,A.jsx)(d.Z,{spacing:2,sx:{p:3},children:(0,A.jsx)(d.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",children:(0,A.jsx)(a.Z,{variant:"h3",noWrap:!0,children:"".concat((null===P||void 0===P?void 0:P.year)||""," ").concat((null===P||void 0===P?void 0:P.make)||""," ").concat((null===P||void 0===P?void 0:P.model)||""," ").concat((null===P||void 0===P?void 0:P.trim)||"")})})}),(0,A.jsxs)(o.ZP,{container:!0,spacing:2,style:{maxHeight:"52vh"},children:[(0,A.jsx)(o.ZP,{item:!0,xs:5,children:(0,A.jsxs)(r.Z,{sx:{position:"relative",width:"100%",background:"#F1F1F1"},children:[(0,A.jsx)(F,{sx:{width:"60%",height:"60%",objectFit:"contain",margin:"0 auto"},src:"".concat(y.q,"/").concat(null===P||void 0===P?void 0:P.imageUrl)}),"\xa0"]})}),(0,A.jsx)(o.ZP,{item:!0,xs:1}),(0,A.jsxs)(o.ZP,{item:!0,xs:6,style:{padding:"0px"},children:[(0,A.jsx)(c.Z,{children:(0,A.jsxs)(v.Z,{children:[(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)("b",{children:"VIN:"})}),(0,A.jsx)(h.Z,{children:(null===P||void 0===P?void 0:P.vin)||""})]}),(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)("b",{children:"COLOR:"})}),(0,A.jsxs)(h.Z,{style:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:[(null===P||void 0===P?void 0:P.color_name)||"",(null===P||void 0===P?void 0:P.color)&&(0,A.jsx)(t.Z,{style:{color:null===P||void 0===P?void 0:P.color,fontSize:"30px"}})]})]}),(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)("b",{children:"MILEAGE:"})}),(0,A.jsx)(h.Z,{children:(null===P||void 0===P?void 0:P.mileage)||""})]}),(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)("b",{children:"CONDITION LIGHT:"})}),(0,A.jsxs)(h.Z,{style:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:[1===(null===P||void 0===P?void 0:P.condition_light)?"RED":2===(null===P||void 0===P?void 0:P.condition_light)?"YELLOW":3===(null===P||void 0===P?void 0:P.condition_light)?"GREEN":"",(0,A.jsx)(t.Z,{style:{color:1===(null===P||void 0===P?void 0:P.condition_light)?"#FF0000":2===(null===P||void 0===P?void 0:P.condition_light)?"#FFBF00":3===(null===P||void 0===P?void 0:P.condition_light)?"#008000":"transparent",fontSize:"30px"}})]})]}),(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)("b",{children:"ANNOUNCEMENTS:"})}),(0,A.jsx)(h.Z,{children:(null===P||void 0===P?void 0:P.announcements)||""})]}),(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)("b",{children:"RESERVE:"})}),(0,A.jsxs)(h.Z,{children:["$ ",(null===P||void 0===P?void 0:P.reserve)||""]})]}),(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)("b",{children:"SALE STATUS:"})}),(0,A.jsx)(h.Z,{children:(0,A.jsx)(x.Z,{variant:"standard",sx:{m:1,minWidth:120},children:(0,A.jsxs)(j.Z,{labelId:"demo-simple-select-label",id:"demo-simple-select",value:B.sale_status,label:"sale_status",onChange:e=>K("sale_status",e.target.value),children:[(0,A.jsx)(Z.Z,{value:!0,children:"SOLD"}),(0,A.jsx)(Z.Z,{value:!1,children:"NOT SOLD"})]})})})]}),(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)("b",{children:"SALE PRICE:"})}),(0,A.jsx)(h.Z,{children:(0,A.jsx)(m.Z,{placeholder:"$",type:"number",value:null===B||void 0===B?void 0:B.sale_price,onChange:e=>(e=>{let i=null===G||void 0===G?void 0:G.reduce(((e,i)=>Number(e)+Number(i.fee_amount)),0);i=parseInt(e)-i,Y((l=>({...l,sale_price:parseFloat(e),net_proceeds:i})))})(e.target.value)})})]}),(null===G||void 0===G?void 0:G.length)>0&&(null===G||void 0===G?void 0:G.map(((e,i)=>(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsxs)("b",{children:[null===e||void 0===e?void 0:e.name.toUpperCase(),":"]})}),(0,A.jsx)(h.Z,{children:(0,A.jsx)(m.Z,{type:"number",placeholder:"$",value:null===e||void 0===e?void 0:e.fee_amount,onChange:i=>((e,i)=>{const l=null===G||void 0===G?void 0:G.findIndex((i=>i.auctioneer_fee_id===e));if(-1!==l){const e=[...G];e[l].fee_amount=i;let n=e.reduce(((e,i)=>Number(e)+Number(i.fee_amount)),0);n=parseInt(null===B||void 0===B?void 0:B.sale_price)-n,Y((e=>({...e,net_proceeds:n}))),q(e)}})(e.auctioneer_fee_id,i.target.value)})}),(0,A.jsx)(h.Z,{onClick:()=>(e=>{q((i=>[...i.filter((i=>i.auctioneer_fee_id!==e.auctioneer_fee_id))]))})(e),children:(0,A.jsx)(N.Z,{style:{cursor:"pointer"}})})]},i)))),H&&(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)("b",{children:"SELECT FEE:"})}),(0,A.jsx)(h.Z,{children:(0,A.jsx)(x.Z,{variant:"standard",sx:{m:1,minWidth:120},children:(0,A.jsx)(j.Z,{labelId:"demo-simple-select-label",id:"demo-simple-select",label:"select_fee",onChange:e=>(e=>{if(M(!1),null===G||void 0===G?void 0:G.some((i=>(null===i||void 0===i?void 0:i.auctioneer_fee_id)===(null===e||void 0===e?void 0:e.auctioneer_fee_id))))return b.Am.error("Fee is Already Selected!");let i=null===G||void 0===G?void 0:G.reduce(((e,i)=>Number(e)+Number(i.fee_amount)),0);i+=parseInt(null===e||void 0===e?void 0:e.fee_amount),Y((e=>({...e,net_proceeds:parseInt(null===B||void 0===B?void 0:B.sale_price)-i}))),q((i=>[...i,e]))})(e.target.value),children:null===V||void 0===V?void 0:V.map(((e,i)=>(0,A.jsx)(Z.Z,{value:e,children:null===e||void 0===e?void 0:e.name},i)))})})})]}),(0,A.jsx)(u.Z,{children:(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)("a",{onClick:()=>{M(!0)},style:{cursor:"pointer"},children:(0,A.jsx)("b",{children:(0,A.jsxs)(d.Z,{direction:"row",alignItems:"center",children:[(0,A.jsx)(C.Z,{me:2}),"ADD FEE"]})})})})}),(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)("b",{children:"NET PROCEEDS:"})}),(0,A.jsxs)(h.Z,{children:["$ ",(null===B||void 0===B?void 0:B.net_proceeds)||""]})]}),(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)("b",{children:"AUCTION:"})}),(0,A.jsx)(h.Z,{children:(0,A.jsx)(x.Z,{variant:"standard",sx:{m:1,minWidth:120},children:(0,A.jsx)(j.Z,{labelId:"demo-simple-select-label",id:"demo-simple-select",value:U,label:"sale_status",onChange:e=>K("auction_name",e.target.value),children:null===l||void 0===l?void 0:l.map(((e,i)=>(0,A.jsx)(Z.Z,{value:null===e||void 0===e?void 0:e.auction_name,children:null===e||void 0===e?void 0:e.auction_name},i)))})})})]}),W.length>0&&(0,A.jsxs)(u.Z,{children:[(0,A.jsx)(h.Z,{variant:"subtitle1",children:(0,A.jsx)("b",{children:"LANE:"})}),(0,A.jsx)(h.Z,{children:(0,A.jsx)(x.Z,{variant:"standard",sx:{m:1,minWidth:120},children:(0,A.jsx)(j.Z,{labelId:"demo-simple-select-label",id:"demo-simple-select",value:null===B||void 0===B?void 0:B.lane_id,label:"lane_id",onChange:e=>K("lane_id",e.target.value),children:null===W||void 0===W?void 0:W.map(((e,i)=>(0,A.jsx)(Z.Z,{value:null===e||void 0===e?void 0:e.lane_id,children:null===e||void 0===e?void 0:e.name},i)))})})})]}),(null===B||void 0===B?void 0:B.lane_id)&&(0,A.jsxs)(u.Z,{children:[(0,A.jsxs)(h.Z,{children:[" ",(0,A.jsx)("b",{children:"RUN #:"})]}),(0,A.jsx)(h.Z,{children:(0,A.jsx)(m.Z,{value:null===B||void 0===B?void 0:B.run_no,onChange:e=>K("run_no",e.target.value)})})]})]})}),(0,A.jsx)(_.Z,{sx:{margin:"1rem"},children:(0,A.jsx)(E.Z,{loading:k,variant:"contained",size:"large",onClick:async()=>{O(!0);let e=[],l=[];(null===G||void 0===G?void 0:G.length)>0&&(null===G||void 0===G||G.map((i=>{e.push(Number(i.auctioneer_fee_id)),l.push(Number(i.fee_amount))})));let n=null===G||void 0===G?void 0:G.reduce(((e,i)=>Number(e)+Number(i.fee_amount)),0);try{const t=await S.Z.post("".concat(y.v,"/vehicle-run/update-vehicle-status"),{...B,vehicle_id:null===P||void 0===P?void 0:P.vehicle_id,auctioneer_fee_id:e,fee_amount:l,vehicle_total_fee:n});200===(null===t||void 0===t?void 0:t.status)&&(b.Am.success("Updated Successfully!"),O(!1),i(-1))}catch(t){console.log(t),O(!1),b.Am.error("Error while saving vehicle details!")}},children:"SAVE"})})]})]})]})}},8141:(e,i,l)=>{var n=l(4836);i.Z=void 0;var t=n(l(5649)),s=l(184);i.Z=(0,t.default)((0,s.jsx)("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline")},7247:(e,i,l)=>{var n=l(4836);i.Z=void 0;var t=n(l(5649)),s=l(184);i.Z=(0,t.default)((0,s.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete")}}]);
//# sourceMappingURL=906.f6cb0be9.chunk.js.map
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists