"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[61686],{24659:(e,s,r)=>{r.d(s,{A:()=>c});r(65043);var l=r(67784),t=r(4701),a=r(17392),n=r(10155),o=r(70579);const i=(0,t.A)({}),d=e=>{let{onClick:s}=e;return(0,o.jsx)(a.A,{onClick:s,children:(0,o.jsx)(n.A,{})})},c=e=>{const s=i();return(0,o.jsx)(l.A,{InputProps:{...s,endAdornment:(0,o.jsxs)(o.Fragment,{children:[" ",e.iscross&&(0,o.jsx)(d,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},61686:(e,s,r)=>{r.r(s),r.d(s,{default:()=>N});var l=r(65043),t=r(11906),a=r(68903),n=r(38624),o=r(96446),i=r(24659),d=r(63516),c=r(14556),u=r(73033),m=r(73216),p=r(66675),v=r(10159),h=r(96801),x=r(70579);const A=(0,h.Gq)("enuseloc"),j=A&&Object.keys(A).length>0?A.user_id:null;console.log("LoginuserId",j);const b={processName:"",processOrder:null,status:""},g=u.Ik().shape({processName:u.Yj().nullable().required("Process Name is required"),status:u.Ik().nullable().required("Select Status is required"),processOrder:u.ai().nullable().positive("Order must be a positive number").required("Enter order")});const N=function(e){const s=(0,m.zy)(),r=(null===s||void 0===s?void 0:s.state)._original;console.log("ProcessData",r);const[u,h]=(0,l.useState)(!1),A=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],j=((0,c.d4)((e=>{var s;return null===(s=e.civil.getCivilProcess)||void 0===s?void 0:s.data})),l.useRef(null)),[N,f]=(0,l.useState)(b),O=(0,c.wA)(),k=(0,m.Zp)(),S=()=>{k(-1)};(0,l.useEffect)((()=>{r&&f({...N,processName:null===r||void 0===r?void 0:r.process_name,processOrder:null===r||void 0===r?void 0:r.process_order,processIsRoad:null===r||void 0===r?void 0:r.process_is_road,status:{id:null===r||void 0===r?void 0:r.status,name:null===r||void 0===r?void 0:r.status}})}),[r]),console.log("ProcessData",r);const y=()=>{const{processName:e,...s}=b;f({...N,...s})};return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"common-header-label-bold",children:[(0,x.jsx)(t.A,{onClick:S,children:(0,x.jsx)(p.A,{})})," ","Update Work Order WBS"]}),(0,x.jsx)("div",{className:"component-list",children:(0,x.jsx)(d.l1,{enableReinitialize:!0,innerRef:j,validationSchema:g,initialValues:N,onSubmit:async(e,s)=>{var l,t;const a={processID:null===r||void 0===r?void 0:r.id,processName:e.processName,processOrder:e.processOrder,status:null!==(l=e.status)&&void 0!==l&&l.id?null===(t=e.status)||void 0===t?void 0:t.id:""};console.log("finalPayload",a),s.setSubmitting(!0),await O((0,v.eXw)(a)),y(),S()},children:e=>{let{errors:s,handleSubmit:r,handleChange:l,handleBlur:c,setFieldValue:u,isSubmitting:m,isValid:p,touched:v,values:h}=e;return(0,x.jsx)(d.lV,{onSubmit:r,children:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(a.Ay,{container:!0,className:"component-form",children:(0,x.jsxs)(a.Ay,{container:!0,children:[(0,x.jsx)(a.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(i.A,{fullWidth:!0,label:"Process Name*",name:"processName",onBlur:c,value:h.processName,onChange:(e,s)=>{u("processName",s),f({...N,processName:e.target.value})},variant:"outlined",size:"small",helperText:v.processName&&s.processName,error:v.processName&&Boolean(s.processName)})}),(0,x.jsx)(a.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(i.A,{fullWidth:!0,label:"Order*",focused:!0,name:"processOrder",type:"number",onBlur:c,value:h.processOrder,onChange:(e,s)=>{u("processOrder",s),f({...N,processOrder:e.target.value})},variant:"outlined",size:"small",helperText:v.processOrder&&s.processOrder,error:v.processOrder&&Boolean(s.processOrder)})}),(0,x.jsx)(a.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(n.A,{name:"status",value:h.status,fullWidth:!0,options:A||[],onBlur:c,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,s)=>{u("status",s),f({...N,status:s})},renderInput:e=>(0,x.jsx)(i.A,{...e,fullWidth:!0,label:"Status *",name:"status",variant:"outlined",helperText:s.status&&s.status,error:s.status&&Boolean(s.status)})})})]})}),(0,x.jsx)(a.Ay,{className:"d-flex justify-content-center",p:2,children:(0,x.jsx)(o.A,{children:(0,x.jsx)(t.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:m,children:"SAVE"})})})]})})}})})]})}},10155:(e,s,r)=>{var l=r(24994);s.A=void 0;var t=l(r(40039)),a=r(70579);s.A=(0,t.default)((0,a.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")},66675:(e,s,r)=>{var l=r(24994);s.A=void 0;var t=l(r(40039)),a=r(70579);s.A=(0,t.default)((0,a.jsx)("path",{d:"M3 18h13v-2H3zm0-5h10v-2H3zm0-7v2h13V6zm18 9.59L17.42 12 21 8.41 19.59 7l-5 5 5 5z"}),"MenuOpen")}}]);
//# sourceMappingURL=61686.e77da006.chunk.js.map