"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[80666],{69875:(e,a,s)=>{s.d(a,{A:()=>l});s(65043);const l=s.p+"static/media/Upload.4216d61323e67ba8fcaf839d79ad9d80.svg"},24659:(e,a,s)=>{s.d(a,{A:()=>m});s(65043);var l=s(67784),n=s(4701),o=s(17392),t=s(10155),i=s(70579);const r=(0,n.A)({}),d=e=>{let{onClick:a}=e;return(0,i.jsx)(o.A,{onClick:a,children:(0,i.jsx)(t.A,{})})},m=e=>{const a=r();return(0,i.jsx)(l.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})}},80666:(e,a,s)=>{s.r(a),s.d(a,{default:()=>g});var l=s(65043),n=s(11906),o=s(68903),t=s(38624),i=s(96446),r=s(24659),d=s(73033),m=(s(69875),s(63516)),h=s(14556),c=s(73216),u=s(66675),p=s(11852),v=s(96801),k=(s(17115),s(70579));const x=(0,v.Gq)("enuseloc"),j=x&&Object.keys(x).length>0?x.user_id:null;console.log("LoginuserId",j);const b={taskName:"",phaseFrom:"",phaseTo:""},T=d.Ik().shape({taskName:d.Ik().nullable().required("Select Task Name"),phaseFrom:d.Ik().nullable().required("Select Phase From"),phaseTo:d.Ik().nullable().required("Select Phase To")});const g=function(e){const a=(0,c.zy)(),s=(null===a||void 0===a?void 0:a.state)._original;console.log("milestoneTypeData",s);const[d,v]=(0,l.useState)(!1),x=(0,h.d4)((e=>e.bd.projectPhase)),j=(0,h.d4)((e=>{var a,s;return null===e||void 0===e||null===(a=e.bd)||void 0===a||null===(s=a.getProjectTask)||void 0===s?void 0:s.data})),g=l.useRef(null),[A,f]=(0,l.useState)(b),_=(0,h.wA)(),F=(0,c.Zp)();(0,l.useEffect)((()=>{s&&f({...A,taskName:{id:s.bd_project_task_id,task_name:s.task_name},phaseFrom:{id:s.phase_from,phase_name:s.phase_from_name},phaseTo:{id:s.phase_to,phase_name:s.phase_to_name}})}),[s]),console.log("milestoneTypeData",s);const N=()=>{const{taskName:e,...a}=b;f({...A,...a})};return(0,l.useEffect)((()=>{_((0,p.g2n)({generalSearch:"",sortOrder:"",iDisplayStart:0,iDisplayLength:-1}));_((0,p.cUq)({}))}),[]),(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)("div",{className:"common-header-label-bold",children:[(0,k.jsx)(n.A,{onClick:()=>{F(-1)},children:(0,k.jsx)(u.A,{})}),"Update Project Task Transaction"]}),(0,k.jsx)("div",{className:"component-list",children:(0,k.jsx)(m.l1,{enableReinitialize:!0,innerRef:g,validationSchema:T,initialValues:A,onSubmit:async(e,a)=>{var l,n,o,t,i,r;const d={transactionID:null===s||void 0===s?void 0:s.id,bdProjectTaskID:null!==e&&void 0!==e&&null!==(l=e.taskName)&&void 0!==l&&l.id?null===e||void 0===e||null===(n=e.taskName)||void 0===n?void 0:n.id:"",phaseFrom:null!==e&&void 0!==e&&null!==(o=e.phaseFrom)&&void 0!==o&&o.id?null===e||void 0===e||null===(t=e.phaseFrom)||void 0===t?void 0:t.id:"",phaseTo:null!==e&&void 0!==e&&null!==(i=e.phaseTo)&&void 0!==i&&i.id?null===e||void 0===e||null===(r=e.phaseTo)||void 0===r?void 0:r.id:""};console.log("finalPayload",d),a.setSubmitting(!0),await _((0,p.d4n)(d)),N(),F("/bd-masters/ProjectTaskTransaction")},children:e=>{let{errors:a,handleSubmit:s,handleChange:l,handleBlur:d,setFieldValue:h,isSubmitting:c,isValid:u,touched:p,values:v}=e;return(0,k.jsx)(m.lV,{onSubmit:s,children:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(o.Ay,{container:!0,className:"component-form",children:(0,k.jsxs)(o.Ay,{container:!0,children:[(0,k.jsx)(o.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,k.jsx)(t.A,{fullWidth:!0,size:"small",value:v.taskName,options:j||[],getOptionLabel:e=>e.task_name||"",onChange:(e,a)=>{h("taskName",a)},renderInput:e=>(0,k.jsx)(r.A,{...e,fullWidth:!0,label:"Task Name*",name:"taskName",variant:"outlined",size:"small",helperText:a.taskName&&a.taskName,error:a.taskName&&Boolean(a.taskName)})})}),(0,k.jsx)(o.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,k.jsx)(t.A,{fullWidth:!0,size:"small",value:v.phaseFrom,options:x||[],getOptionLabel:e=>e.phase_name||"",onChange:(e,a)=>{h("phaseFrom",a)},renderInput:e=>(0,k.jsx)(r.A,{...e,fullWidth:!0,label:"Phase From*",name:"phaseFrom",variant:"outlined",size:"small",helperText:a.phaseFrom&&a.phaseFrom,error:a.phaseFrom&&Boolean(a.phaseFrom)})})}),(0,k.jsx)(o.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,k.jsx)(t.A,{fullWidth:!0,size:"small",value:v.phaseTo,options:x||[],getOptionLabel:e=>e.phase_name||"",onChange:(e,a)=>{h("phaseTo",a)},renderInput:e=>(0,k.jsx)(r.A,{...e,fullWidth:!0,label:"Phase To*",name:"phaseTo",variant:"outlined",size:"small",helperText:a.phaseTo&&a.phaseTo,error:a.phaseTo&&Boolean(a.phaseTo)})})})]})}),(0,k.jsx)(o.Ay,{className:"d-flex justify-content-center",p:2,children:(0,k.jsx)(i.A,{children:(0,k.jsx)(n.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:c,children:"SAVE"})})})]})})}})})]})}}}]);
//# sourceMappingURL=80666.75de8c11.chunk.js.map