"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[65695],{24659:(e,a,t)=>{t.d(a,{A:()=>r});t(65043);var l=t(67784),s=t(4701),n=t(17392),o=t(10155),m=t(70579);const i=(0,s.A)({}),u=e=>{let{onClick:a}=e;return(0,m.jsx)(n.A,{onClick:a,children:(0,m.jsx)(o.A,{})})},r=e=>{const a=i();return(0,m.jsx)(l.A,{InputProps:{...a,endAdornment:(0,m.jsxs)(m.Fragment,{children:[" ",e.iscross&&(0,m.jsx)(u,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},65695:(e,a,t)=>{t.r(a),t.d(a,{default:()=>g});var l=t(65043),s=t(11906),n=t(68903),o=t(38624),m=t(96446),i=t(24659),u=t(63516),r=t(14556),d=t(73033),c=t(73216),v=t(66675),h=t(10159),k=t(96801),x=t(70579);const A=(0,k.Gq)("enuseloc"),j=A&&Object.keys(A).length>0?A.user_id:null;console.log("LoginuserId",j);const S={taskUomName:"",uomRemark:"",uomID:"",uomStatus:""},p=d.Ik().shape({taskUomName:d.Yj().nullable().required("Enter Activity UOM Name"),uomRemark:d.Yj().nullable().required("Enter Remark"),uomID:"",uomStatus:d.Ik().nullable().required("Select Status")});const g=function(e){const a=(0,c.zy)(),t=(null===a||void 0===a?void 0:a.state)._original;console.log("UOMData",t);const[d,k]=(0,l.useState)(!1),A=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],j=l.useRef(null),[g,b]=(0,l.useState)(S),N=(0,r.wA)(),U=(0,c.Zp)(),R=()=>{U(-1)};(0,l.useEffect)((()=>{t&&b({...g,taskUomName:null===t||void 0===t?void 0:t.task_uom_name,uomStatus:{id:null===t||void 0===t?void 0:t.status,name:null===t||void 0===t?void 0:t.status},uomRemark:null===t||void 0===t?void 0:t.remark})}),[t]),console.log("UOMData",t);const f=()=>{const{taskUomName:e,...a}=S;b({...g,...a})};return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"common-header-label-bold",children:[(0,x.jsx)(s.A,{onClick:R,children:(0,x.jsx)(v.A,{})})," Update Activity UOM "]}),(0,x.jsx)("div",{className:"component-list",children:(0,x.jsx)(u.l1,{enableReinitialize:!0,innerRef:j,validationSchema:p,initialValues:g,onSubmit:async(e,a)=>{var l,s;const n={uomID:null===t||void 0===t?void 0:t.id,taskUomName:e.taskUomName,uomRemark:e.uomRemark,uomStatus:null!==(l=e.uomStatus)&&void 0!==l&&l.id?null===(s=e.uomStatus)||void 0===s?void 0:s.id:""};console.log("finalPayload",n),a.setSubmitting(!0),await N((0,h.JRz)(n)),f(),R()},children:e=>{let{errors:a,handleSubmit:t,handleChange:l,handleBlur:r,setFieldValue:d,isSubmitting:c,isValid:v,touched:h,values:k}=e;return(0,x.jsx)(u.lV,{onSubmit:t,children:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(n.Ay,{container:!0,className:"component-form",children:(0,x.jsxs)(n.Ay,{container:!0,children:[(0,x.jsx)(n.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(i.A,{fullWidth:!0,label:"Activity UOM Name*",name:"taskUomName",onBlur:r,value:k.taskUomName,onChange:(e,a)=>{d("taskUomName",a),b({...g,taskUomName:e.target.value})},variant:"outlined",size:"small",helperText:h.taskUomName&&a.taskUomName,error:h.taskUomName&&Boolean(a.taskUomName)})}),(0,x.jsx)(n.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(i.A,{fullWidth:!0,label:"Remarks*",name:"uomRemark",onBlur:r,value:k.uomRemark,onChange:(e,a)=>{d("uomRemark",a),b({...g,uomRemark:e.target.value})},variant:"outlined",size:"small",helperText:h.uomRemark&&a.uomRemark,error:h.uomRemark&&Boolean(a.uomRemark)})}),(0,x.jsx)(n.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(o.A,{name:"uomStatus",value:k.uomStatus,fullWidth:!0,options:A||[],onBlur:r,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,a)=>{d("uomStatus",a),b({...g,uomStatus:a})},renderInput:e=>(0,x.jsx)(i.A,{...e,fullWidth:!0,label:"Status *",name:"uomStatus",variant:"outlined",helperText:a.uomStatus&&a.uomStatus,error:a.uomStatus&&Boolean(a.uomStatus)})})})]})}),(0,x.jsx)(n.Ay,{className:"d-flex justify-content-center",p:2,children:(0,x.jsx)(m.A,{children:(0,x.jsx)(s.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:c,children:"SAVE"})})})]})})}})})]})}},10155:(e,a,t)=>{var l=t(24994);a.A=void 0;var s=l(t(40039)),n=t(70579);a.A=(0,s.default)((0,n.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,a,t)=>{var l=t(24994);a.A=void 0;var s=l(t(40039)),n=t(70579);a.A=(0,s.default)((0,n.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=65695.25af69ea.chunk.js.map