"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[20227],{24659:(e,a,t)=>{t.d(a,{A:()=>u});t(65043);var l=t(67784),n=t(4701),s=t(17392),i=t(10155),d=t(70579);const o=(0,n.A)({}),r=e=>{let{onClick:a}=e;return(0,d.jsx)(s.A,{onClick:a,children:(0,d.jsx)(i.A,{})})},u=e=>{const a=o();return(0,d.jsx)(l.A,{InputProps:{...a,endAdornment:(0,d.jsxs)(d.Fragment,{children:[" ",e.iscross&&(0,d.jsx)(r,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},20227:(e,a,t)=>{t.r(a),t.d(a,{default:()=>g});var l=t(65043),n=t(68903),s=t(11906),i=t(38624),d=t(96446),o=t(63516),r=t(24659),u=t(73216),m=t(66675),c=t(14556),v=t(53193),k=t(96801),h=t(73033),A=t(67954),x=t(70579);const j={makeName:"",makeID:"",makeStatusID:""},S=h.Ik().shape({makeName:h.Yj().required("Make Name is Required"),makeStatusID:h.Ik().nullable().required("Select Status")}),p=(0,k.Gq)("enuseloc");p&&Object.keys(p).length>0&&p.user_id;const g=function(e){const a=(0,c.wA)(),[t,k]=((0,c.d4)((e=>{var a,t;return null===e||void 0===e||null===(a=e.bd)||void 0===a||null===(t=a.getLiaisonProcess)||void 0===t?void 0:t.data})),(0,c.d4)((e=>{var a,t;return null===e||void 0===e||null===(a=e.bd)||void 0===a||null===(t=a.getLiaisonProcessCategory)||void 0===t?void 0:t.data})),(0,c.d4)((e=>{var a;return null===e||void 0===e||null===(a=e.bd)||void 0===a?void 0:a.user})),l.useRef(null),(0,l.useState)(j)),[h,p]=(0,l.useState)(""),[g,I]=(0,l.useState)(""),[b,N]=(0,l.useState)();console.log(g,"statusValue");const f=(0,u.Zp)(),D=(0,u.zy)(),y=null===D||void 0===D?void 0:D.state,C=null===y||void 0===y?void 0:y._original,z=[{id:"1",name:"Active"},{id:"0",name:"In Active"}],[M,V]=(0,l.useState)([]);return(0,c.d4)((e=>{var a;return null===(a=e.bd.getFunctionalityPermissionDetail)||void 0===a?void 0:a.data})),(0,l.useEffect)((()=>{C&&k({...t,makeName:null===C||void 0===C?void 0:C.make_name,makeStatusID:{id:C.status,name:1==(null===C||void 0===C?void 0:C.status)?"Active":"InActive"}})}),[C]),console.log("BankMasterData ID",null===C||void 0===C?void 0:C.id),console.log("BankMasterData NAME",null===C||void 0===C?void 0:C.make_name),(0,x.jsxs)("div",{className:"component-list",children:[(0,x.jsx)(n.Ay,{container:!0,className:"d-flex justify-content-between align-items-center",py:1,children:(0,x.jsx)(n.Ay,{item:!0,className:"common-header-label",children:(0,x.jsxs)(s.A,{onClick:()=>{f(-1)},children:[(0,x.jsx)(m.A,{})," Update Asset Make"]})})}),(0,x.jsx)(o.l1,{enableReinitialize:!0,initialValues:t,validationSchema:S,onSubmit:async(e,t)=>{var l,n;const s={makeID:null===C||void 0===C?void 0:C.id,makeName:e.makeName?e.makeName:"",isActive:null!==(l=e.makeStatusID)&&void 0!==l&&l.id?null===(n=e.makeStatusID)||void 0===n?void 0:n.id:""};console.log("finalPayload",s),t.setSubmitting(!0),await a((0,A.ZWl)(s)),t.resetForm({}),f(-1)},children:e=>{let{errors:a,handleSubmit:t,handleChange:l,setFieldValue:u,handleBlur:m,isSubmitting:c,isValid:k,touched:h,values:A}=e;return(0,x.jsx)(o.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)(r.A,{fullWidth:!0,name:"makeName",onBlur:m,value:A.makeName,onChange:e=>{u("makeName",e.target.value)},error:h.makeName&&Boolean(a.makeName),helperText:h.makeName&&a.makeName,id:"makeName",size:"small",label:"Asset Make *",variant:"outlined"})}),(0,x.jsx)(n.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(v.A,{fullWidth:!0,variant:"standard",children:(0,x.jsx)(i.A,{name:"makeStatusID",value:A.makeStatusID,fullWidth:!0,options:z||[],onBlur:m,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,a)=>{u("makeStatusID",a)},renderInput:e=>(0,x.jsx)(r.A,{...e,fullWidth:!0,label:"Status *",name:"makeStatusID",variant:"outlined",helperText:a.makeStatusID&&a.makeStatusID,error:a.makeStatusID&&Boolean(a.makeStatusID)})})})})]})}),(0,x.jsx)(n.Ay,{className:"d-flex justify-content-center",p:2,children:(0,x.jsx)(d.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 n=l(t(40039)),s=t(70579);a.A=(0,n.default)((0,s.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 n=l(t(40039)),s=t(70579);a.A=(0,n.default)((0,s.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=20227.b048d2e8.chunk.js.map