"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[32483],{69875:(e,t,n)=>{n.d(t,{A:()=>s});n(65043);const s=n.p+"static/media/Upload.4216d61323e67ba8fcaf839d79ad9d80.svg"},24659:(e,t,n)=>{n.d(t,{A:()=>d});n(65043);var s=n(67784),a=n(4701),l=n(17392),r=n(10155),o=n(70579);const i=(0,a.A)({}),c=e=>{let{onClick:t}=e;return(0,o.jsx)(l.A,{onClick:t,children:(0,o.jsx)(r.A,{})})},d=e=>{const t=i();return(0,o.jsx)(s.A,{InputProps:{...t,endAdornment:(0,o.jsxs)(o.Fragment,{children:[" ",e.iscross&&(0,o.jsx)(c,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},32483:(e,t,n)=>{n.r(t),n.d(t,{default:()=>y});var s=n(65043),a=n(11906),l=n(68903),r=n(38624),o=n(96446),i=n(24659),c=(n(69875),n(63516)),d=n(14556),u=n(73033),m=n(73216),p=n(66675),h=n(11852),x=n(96801),I=(n(17115),n(70579));const v=(0,x.Gq)("enuseloc"),D=v&&Object.keys(v).length>0?v.user_id:null;console.log("LoginuserId",D);const g={projectID:null,processPlanID:null,remark:"",categoryID:"",statusID:""},j=u.Ik().shape({statusID:u.Ik().nullable().required("Select the Status"),categoryID:u.Ik().nullable().required("Select the Category")});const y=function(e){const[t,n]=(0,s.useState)(g),u=(0,m.zy)(),x=null===u||void 0===u?void 0:u.state;console.log("DependencyExceptionData",x);const[v,D]=(0,s.useState)(!1),y=[{id:"Dependency",name:"Dependency"},{id:"SubTask",name:"SubTask"}],k=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],A=s.useRef(null),b=(0,d.wA)(),f=(0,m.Zp)(),S=()=>{f(-1)};(0,s.useEffect)((()=>{x&&n({...t,projectID:{id:x.project_id,project_name:x.project_name},processPlanID:{id:x.process_id,process_name:x.process_name},categoryID:{id:null===x||void 0===x?void 0:x.category,name:null===x||void 0===x?void 0:x.category},statusID:{id:null===x||void 0===x?void 0:x.status,name:null===x||void 0===x?void 0:x.status},remark:null===x||void 0===x?void 0:x.remark})}),[x]),console.log("DependencyExceptionData",x);const C=()=>{const{resourceRate:e,...s}=g;n({...t,...s})};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{className:"common-header-label-bold",children:(0,I.jsxs)(a.A,{onClick:S,children:[(0,I.jsx)(p.A,{}),"Dependancy Exception Update"]})}),(0,I.jsx)("div",{className:"component-list",children:(0,I.jsx)(c.l1,{enableReinitialize:!0,innerRef:A,validationSchema:j,initialValues:t,onSubmit:async(e,t)=>{var n,s,a,l;const r={exceptionID:null===x||void 0===x?void 0:x.id,remark:e.remark,categoryID:null!==(n=e.categoryID)&&void 0!==n&&n.id?null===(s=e.categoryID)||void 0===s?void 0:s.id:"",statusID:null!==(a=e.statusID)&&void 0!==a&&a.id?null===(l=e.statusID)||void 0===l?void 0:l.id:""};console.log("finalPayload",r),t.setSubmitting(!0),await b((0,h.qHp)(r)),C(),S()},children:e=>{let{errors:s,handleSubmit:d,handleChange:u,handleBlur:m,setFieldValue:p,isSubmitting:h,isValid:v,touched:D,values:g}=e;return(0,I.jsx)(c.lV,{onSubmit:d,children:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(l.Ay,{container:!0,className:"component-form",children:[(0,I.jsxs)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:[(0,I.jsx)("span",{className:"info-header",children:"Project: "}),(null===g||void 0===g?void 0:g.projectID)&&(0,I.jsxs)(I.Fragment,{children:[x.project_name,","]})," \xa0 \xa0",(0,I.jsx)("span",{className:"info-header",children:"Process: "}),(null===g||void 0===g?void 0:g.processPlanID)&&(0,I.jsx)(I.Fragment,{children:x.process_name})," \xa0 \xa0"]}),(0,I.jsxs)(l.Ay,{container:!0,children:[(0,I.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,I.jsx)(i.A,{fullWidth:!0,label:"Remark",name:"remark",onBlur:m,value:g.remark,onChange:(e,s)=>{p("remark",s),n({...t,remark:e.target.value})},variant:"outlined",size:"small",helperText:D.remark&&s.remark,error:D.remark&&Boolean(s.remark)})}),(0,I.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,I.jsx)(r.A,{name:"categoryID",value:g.categoryID,fullWidth:!0,options:y||[],onBlur:m,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,s)=>{p("categoryID",s),n({...t,categoryID:s})},renderInput:e=>(0,I.jsx)(i.A,{...e,fullWidth:!0,label:"Status *",name:"categoryID",variant:"outlined",helperText:s.categoryID&&s.categoryID,error:s.categoryID&&Boolean(s.categoryID)})})}),(0,I.jsx)(l.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,I.jsx)(r.A,{name:"statusID",value:g.statusID,fullWidth:!0,options:k||[],onBlur:m,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,s)=>{p("statusID",s),n({...t,statusID:s})},renderInput:e=>(0,I.jsx)(i.A,{...e,fullWidth:!0,label:"Status *",name:"statusID",variant:"outlined",helperText:s.statusID&&s.statusID,error:s.statusID&&Boolean(s.statusID)})})})]})]}),(0,I.jsx)(l.Ay,{className:"d-flex justify-content-center",p:2,children:(0,I.jsx)(o.A,{children:(0,I.jsx)(a.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:h,children:"SAVE"})})})]})})}})})]})}}}]);
//# sourceMappingURL=32483.8c1465b6.chunk.js.map