"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[4062],{69875:(e,s,t)=>{t.d(s,{A:()=>n});t(65043);const n=t.p+"static/media/Upload.4216d61323e67ba8fcaf839d79ad9d80.svg"},24659:(e,s,t)=>{t.d(s,{A:()=>m});t(65043);var n=t(67784),l=t(4701),i=t(17392),a=t(10155),o=t(70579);const d=(0,l.A)({}),r=e=>{let{onClick:s}=e;return(0,o.jsx)(i.A,{onClick:s,children:(0,o.jsx)(a.A,{})})},m=e=>{const s=d();return(0,o.jsx)(n.A,{InputProps:{...s,endAdornment:(0,o.jsxs)(o.Fragment,{children:[" ",e.iscross&&(0,o.jsx)(r,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},4062:(e,s,t)=>{t.r(s),t.d(s,{default:()=>k});var n=t(65043),l=t(11906),i=t(68903),a=t(38624),o=t(96446),d=t(24659),r=t(53193),m=t(51292),u=t(78492),c=t(74605),h=t(14256),x=(t(69875),t(63516)),v=t(14556),p=t(73033),A=t(73216),j=t(66675),y=t(11852),b=t(96801),g=(t(17115),t(70579));const I=(0,b.Gq)("enuseloc"),N=I&&Object.keys(I).length>0?I.user_id:null;console.log("LoginuserId",N);const f={milestoneName:"",milestoneType:"",statusID:""},D=p.Ik().shape({milestoneName:p.Yj("Enter Milstone Name ").required("Milestone Name is required"),statusID:p.Ik().nullable().required("Select Status")});const k=function(e){const s=(0,A.zy)(),t=(null===s||void 0===s?void 0:s.state)._original;console.log("milestoneTypeData",t);const[p,b]=(0,n.useState)(!1),I=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],N=n.useRef(null),[k,S]=(0,n.useState)(f),T=(0,v.wA)(),C=(0,A.Zp)();(0,n.useEffect)((()=>{t&&S({...k,milestoneName:null===t||void 0===t?void 0:t.milestone_name,milestoneType:null===t||void 0===t?void 0:t.milestone_type,statusID:{id:null===t||void 0===t?void 0:t.status,name:null===t||void 0===t?void 0:t.status}})}),[t]),console.log("milestoneTypeData",t);const M=()=>{const{milestoneName:e,...s}=f;S({...k,...s})};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"common-header-label-bold",children:[(0,g.jsx)(l.A,{onClick:()=>{C(-1)},children:(0,g.jsx)(j.A,{})}),"Update Payment Milestone"]}),(0,g.jsx)("div",{className:"component-list",children:(0,g.jsx)(x.l1,{enableReinitialize:!0,innerRef:N,validationSchema:D,initialValues:k,onSubmit:async(e,s)=>{var n,l;const i={milestoneId:null===t||void 0===t?void 0:t.id,milestoneName:e.milestoneName,milestoneType:e.milestoneType?e.milestoneType:"",milestoneStatus:null!==(n=e.statusID)&&void 0!==n&&n.id?null===(l=e.statusID)||void 0===l?void 0:l.id:""};console.log("finalPayload",i),s.setSubmitting(!0),await T((0,y.pMO)(i)),M(),C("/bd-masters/PaymentMilestone")},children:e=>{let{errors:s,handleSubmit:t,handleChange:n,handleBlur:v,setFieldValue:p,isSubmitting:A,isValid:j,touched:y,values:b}=e;return(0,g.jsx)(x.lV,{onSubmit:t,children:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(i.Ay,{container:!0,className:"component-form",children:(0,g.jsxs)(i.Ay,{container:!0,children:[(0,g.jsx)(i.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,g.jsx)(d.A,{fullWidth:!0,label:"Milestone Name*",name:"milestoneName",onBlur:v,value:b.milestoneName,onChange:(e,s)=>{p("milestoneName",s),S({...k,milestoneName:e.target.value})},variant:"outlined",size:"small",helperText:y.milestoneName&&s.milestoneName,error:y.milestoneName&&Boolean(s.milestoneName)})}),(0,g.jsx)(i.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,g.jsxs)(r.A,{children:[(0,g.jsx)(m.A,{id:"milestoneType",children:"Milestone Type*"}),(0,g.jsxs)(u.A,{row:!0,"aria-labelledby":"milestoneType",name:"milestoneType",value:b.milestoneType,onChange:n,children:[(0,g.jsx)(c.A,{value:"LandOwner",control:(0,g.jsx)(h.A,{required:!0}),label:"Land Owner"}),(0,g.jsx)(c.A,{value:"LandBroker",control:(0,g.jsx)(h.A,{required:!0}),label:"Land Broker"})]})]})}),(0,g.jsx)(i.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,g.jsx)(a.A,{name:"statusID",value:b.statusID,fullWidth:!0,options:I||[],onBlur:v,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,s)=>{p("statusID",s),S({...k,statusID:s})},renderInput:e=>(0,g.jsx)(d.A,{...e,fullWidth:!0,label:"Status *",name:"statusID",variant:"outlined",helperText:s.statusID&&s.statusID,error:s.statusID&&Boolean(s.statusID)})})})]})}),(0,g.jsx)(i.Ay,{className:"d-flex justify-content-center",p:2,children:(0,g.jsx)(o.A,{children:(0,g.jsx)(l.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:A,children:"SAVE"})})})]})})}})})]})}},10155:(e,s,t)=>{var n=t(24994);s.A=void 0;var l=n(t(40039)),i=t(70579);s.A=(0,l.default)((0,i.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear")}}]);
//# sourceMappingURL=4062.3c306db7.chunk.js.map