"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[25325],{69875:(e,s,i)=>{i.d(s,{A:()=>t});i(65043);const t=i.p+"static/media/Upload.4216d61323e67ba8fcaf839d79ad9d80.svg"},24659:(e,s,i)=>{i.d(s,{A:()=>r});i(65043);var t=i(67784),l=i(4701),n=i(17392),a=i(10155),u=i(70579);const d=(0,l.A)({}),o=e=>{let{onClick:s}=e;return(0,u.jsx)(n.A,{onClick:s,children:(0,u.jsx)(a.A,{})})},r=e=>{const s=d();return(0,u.jsx)(t.A,{InputProps:{...s,endAdornment:(0,u.jsxs)(u.Fragment,{children:[" ",e.iscross&&(0,u.jsx)(o,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},25325:(e,s,i)=>{i.r(s),i.d(s,{default:()=>A});var t=i(65043),l=i(11906),n=i(68903),a=i(38624),u=i(96446),d=i(24659),o=(i(69875),i(63516)),r=i(14556),p=i(73033),c=i(73216),m=i(66675),y=i(11852),T=i(96801),v=(i(17115),i(70579));const h=(0,T.Gq)("enuseloc"),x=h&&Object.keys(h).length>0?h.user_id:null;console.log("LoginuserId",x);const I={issueTypeName:"",issueType:"",statusID:""},j=p.Ik().shape({issueTypeName:p.Yj("Enter Issue Type Name").required("Issue Type Name is required"),issueType:p.Ik().nullable().required("Select Issue Type"),statusID:p.Ik().nullable().required("Select Issue Type")});const A=function(e){const s=(0,c.zy)(),i=(null===s||void 0===s?void 0:s.state)._original;console.log("issueTypeData",i);const[p,T]=(0,t.useState)(!1),h=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],x=t.useRef(null),[A,g]=(0,t.useState)(I),b=(0,r.wA)(),N=(0,c.Zp)();(0,t.useEffect)((()=>{i&&g({...A,issueTypeName:null===i||void 0===i?void 0:i.issue_type_name,issueType:{id:null===i||void 0===i?void 0:i.issue_type,name:null===i||void 0===i?void 0:i.issue_type},statusID:{id:null===i||void 0===i?void 0:i.status,name:null===i||void 0===i?void 0:i.status}})}),[i]),console.log("issueTypeData",i);const D=()=>{const{issueTypeName:e,...s}=I;g({...A,...s})};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("div",{className:"common-header-label-bold",children:[(0,v.jsx)(l.A,{onClick:()=>{N(-1)},children:(0,v.jsx)(m.A,{})}),"Update Dispute / Legal Task Type"]}),(0,v.jsx)("div",{className:"component-list",children:(0,v.jsx)(o.l1,{enableReinitialize:!0,innerRef:x,validationSchema:j,initialValues:A,onSubmit:async(e,s)=>{var t,l,n,a;const u={landIssueTypeID:null===i||void 0===i?void 0:i.id,issueTypeName:e.issueTypeName,issueType:null!==(t=e.issueType)&&void 0!==t&&t.id?null===(l=e.issueType)||void 0===l?void 0:l.id:"",status:null!==(n=e.statusID)&&void 0!==n&&n.id?null===(a=e.statusID)||void 0===a?void 0:a.id:""};console.log("finalPayload",u),s.setSubmitting(!0),await b((0,y.ObK)(u)),D(),N("/bd-masters/BdIssueType")},children:e=>{let{errors:s,handleSubmit:i,handleChange:t,handleBlur:r,setFieldValue:p,isSubmitting:c,isValid:m,touched:y,values:T}=e;return(0,v.jsx)(o.lV,{onSubmit:i,children:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(n.Ay,{container:!0,className:"component-form",children:(0,v.jsxs)(n.Ay,{container:!0,children:[(0,v.jsx)(n.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,v.jsx)(d.A,{fullWidth:!0,label:"Issue Type Name*",name:"issueTypeName",onBlur:r,value:T.issueTypeName,onChange:(e,s)=>{p("issueTypeName",s),g({...A,issueTypeName:e.target.value})},variant:"outlined",size:"small",helperText:y.issueTypeName&&s.issueTypeName,error:y.issueTypeName&&Boolean(s.issueTypeName)})}),(0,v.jsx)(n.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,v.jsx)(a.A,{name:"issueType",value:T.issueType,fullWidth:!0,options:[{id:"Dispute",name:"Dispute"},{id:"Legal",name:"Legal"}],onBlur:r,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,s)=>{p("issueType",s),g({...A,issueType:s})},renderInput:e=>(0,v.jsx)(d.A,{...e,fullWidth:!0,label:"Issue Type*",name:"issueType",variant:"outlined",helperText:s.issueType&&s.issueType,error:s.issueType&&Boolean(s.issueType)})})}),(0,v.jsx)(n.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,v.jsx)(a.A,{name:"statusID",value:T.statusID,fullWidth:!0,options:h||[],onBlur:r,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,s)=>{p("statusID",s),g({...A,statusID:s})},renderInput:e=>(0,v.jsx)(d.A,{...e,fullWidth:!0,label:"Status *",name:"statusID",variant:"outlined",helperText:s.statusID&&s.statusID,error:s.statusID&&Boolean(s.statusID)})})})]})}),(0,v.jsx)(n.Ay,{className:"d-flex justify-content-center",p:2,children:(0,v.jsx)(u.A,{children:(0,v.jsx)(l.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:c,children:"SAVE"})})})]})})}})})]})}}}]);
//# sourceMappingURL=25325.1dc2c1fb.chunk.js.map