"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[60742],{69875:(e,a,l)=>{l.d(a,{A:()=>s});l(65043);const s=l.p+"static/media/Upload.4216d61323e67ba8fcaf839d79ad9d80.svg"},24659:(e,a,l)=>{l.d(a,{A:()=>u});l(65043);var s=l(67784),n=l(4701),t=l(17392),r=l(10155),i=l(70579);const o=(0,n.A)({}),d=e=>{let{onClick:a}=e;return(0,i.jsx)(t.A,{onClick:a,children:(0,i.jsx)(r.A,{})})},u=e=>{const a=o();return(0,i.jsx)(s.A,{InputProps:{...a,endAdornment:(0,i.jsxs)(i.Fragment,{children:[" ",e.iscross&&(0,i.jsx)(d,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},60742:(e,a,l)=>{l.r(a),l.d(a,{default:()=>g});var s=l(65043),n=l(11906),t=l(68903),r=l(38624),i=l(96446),o=l(24659),d=l(53193),u=(l(69875),l(63516)),c=l(14556),m=l(73033),p=l(73216),v=l(66675),h=l(11852),x=l(96801),I=(l(17115),l(70579));const A=(0,x.Gq)("enuseloc"),j=A&&Object.keys(A).length>0?A.user_id:null;console.log("LoginuserId",j);const k={panelName:"",remark:"",processID:"",statusID:""},D=m.Ik().shape({panelName:m.Yj("Enter Panel Name").required("Panel Name is required"),statusID:m.Ik().nullable().required("Select Status"),processID:m.Ik().nullable().required("Select Process Name")});const g=function(e){const a=(0,p.zy)(),l=(null===a||void 0===a?void 0:a.state)._original;console.log("milestoneTypeData",l);const[m,x]=(0,s.useState)(!1),A=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],j=s.useRef(null),[g,b]=(0,s.useState)(k),N=(0,c.d4)((e=>{var a;return null===(a=e.bd.getLoanProcess)||void 0===a?void 0:a.data})),f=(0,c.wA)(),y=(0,p.Zp)();(0,s.useEffect)((()=>{l&&b({...g,panelName:null===l||void 0===l?void 0:l.panel_name,remark:null===l||void 0===l?void 0:l.remark,processID:{id:l.process_id,process_name:l.process_name},statusID:{id:null===l||void 0===l?void 0:l.status,name:null===l||void 0===l?void 0:l.status}})}),[l]),console.log("milestoneTypeData",l);const S=()=>{const{panelName:e,...a}=k;b({...g,...a})};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("div",{className:"common-header-label-bold",children:[(0,I.jsx)(n.A,{onClick:()=>{y(-1)},children:(0,I.jsx)(v.A,{})}),"Update Loan Panel"]}),(0,I.jsx)("div",{className:"component-list",children:(0,I.jsx)(u.l1,{enableReinitialize:!0,innerRef:j,validationSchema:D,initialValues:g,onSubmit:async(e,a)=>{var s,n,t;const r={loanPanelId:null===l||void 0===l?void 0:l.id,panelName:e.panelName,processID:null===(s=e.processID)||void 0===s?void 0:s.id,remark:e.remark?e.remark:"",loanPanelStatus:null!==(n=e.statusID)&&void 0!==n&&n.id?null===(t=e.statusID)||void 0===t?void 0:t.id:""};console.log("finalPayload",r),a.setSubmitting(!0),await f((0,h.B1R)(r)),S(),y("/bd-masters/LoanPanel")},children:e=>{let{errors:a,handleSubmit:l,handleChange:c,handleBlur:m,setFieldValue:p,isSubmitting:v,isValid:h,touched:x,values:j}=e;return(0,I.jsx)(u.lV,{onSubmit:l,children:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(t.Ay,{container:!0,className:"component-form",children:(0,I.jsxs)(t.Ay,{container:!0,children:[(0,I.jsx)(t.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,I.jsx)(o.A,{fullWidth:!0,label:"Panel Name*",name:"panelName",onBlur:m,value:j.panelName,onChange:(e,a)=>{p("panelName",a),b({...g,panelName:e.target.value})},variant:"outlined",size:"small",helperText:x.panelName&&a.panelName,error:x.panelName&&Boolean(a.panelName)})}),(0,I.jsx)(t.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,I.jsx)(d.A,{fullWidth:!0,variant:"standard",children:(0,I.jsx)(r.A,{size:"small",value:null===j||void 0===j?void 0:j.processID,onBlur:m,options:N||[],getOptionLabel:e=>null===e||void 0===e?void 0:e.process_name,renderOption:(e,a)=>(0,s.createElement)("li",{...e,style:{textAlign:"left"},key:null===a||void 0===a?void 0:a.id},null===a||void 0===a?void 0:a.process_name),onChange:(e,a)=>{p("processID",a),b({...g,processID:a})},renderInput:e=>(0,I.jsx)(o.A,{...e,fullWidth:!0,label:"Process Name",name:"processID",variant:"outlined",size:"small",helperText:x.processID&&a.processID,error:x.processID&&Boolean(a.processID)})})})}),(0,I.jsx)(t.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,I.jsx)(o.A,{fullWidth:!0,label:"Panel Remark*",name:"remark",onBlur:m,value:j.remark,onChange:(e,a)=>{p("remark",a),b({...g,remark:e.target.value})},variant:"outlined",size:"small",helperText:x.remark&&a.remark,error:x.remark&&Boolean(a.remark)})}),(0,I.jsx)(t.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,I.jsx)(r.A,{name:"statusID",value:j.statusID,fullWidth:!0,options:A||[],onBlur:m,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,a)=>{p("statusID",a),b({...g,statusID:a})},renderInput:e=>(0,I.jsx)(o.A,{...e,fullWidth:!0,label:"Status *",name:"statusID",variant:"outlined",helperText:a.statusID&&a.statusID,error:a.statusID&&Boolean(a.statusID)})})})]})}),(0,I.jsx)(t.Ay,{className:"d-flex justify-content-center",p:2,children:(0,I.jsx)(i.A,{children:(0,I.jsx)(n.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:v,children:"SAVE"})})})]})})}})})]})}}}]);
//# sourceMappingURL=60742.384014ff.chunk.js.map