"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),a=i(17392),n=i(10155),u=i(70579);const d=(0,l.A)({}),o=e=>{let{onClick:s}=e;return(0,u.jsx)(a.A,{onClick:s,children:(0,u.jsx)(n.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:()=>j});var t=i(65043),l=i(11906),a=i(68903),n=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),v=i(96801),T=(i(17115),i(70579));const h=(0,v.Gq)("enuseloc"),x=h&&Object.keys(h).length>0?h.user_id:null;console.log("LoginuserId",x);const I={issueTypeName:"",issueType:"",statusID:""},A=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 j=function(e){const s=(0,c.zy)(),i=(null===s||void 0===s?void 0:s.state)._original;console.log("issueTypeData",i);const[p,v]=(0,t.useState)(!1),h=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],x=t.useRef(null),[j,g]=(0,t.useState)(I),b=(0,r.wA)(),N=(0,c.Zp)();(0,t.useEffect)((()=>{i&&g({...j,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 f=()=>{const{issueTypeName:e,...s}=I;g({...j,...s})};return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("div",{className:"common-header-label-bold",children:[(0,T.jsx)(l.A,{onClick:()=>{N(-1)},children:(0,T.jsx)(m.A,{})}),"Update Dispute / Legal Task Type"]}),(0,T.jsx)("div",{className:"component-list",children:(0,T.jsx)(o.l1,{enableReinitialize:!0,innerRef:x,validationSchema:A,initialValues:j,onSubmit:async(e,s)=>{var t,l,a,n;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!==(a=e.statusID)&&void 0!==a&&a.id?null===(n=e.statusID)||void 0===n?void 0:n.id:""};console.log("finalPayload",u),s.setSubmitting(!0),await b((0,y.ObK)(u)),f(),N("/bd-masters/BdIssueType")},children:e=>{let{errors:s,handleSubmit:i,handleChange:t,handleBlur:r,setFieldValue:p,isSubmitting:c,isValid:m,touched:y,values:v}=e;return(0,T.jsx)(o.lV,{onSubmit:i,children:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(a.Ay,{container:!0,className:"component-form",children:(0,T.jsxs)(a.Ay,{container:!0,children:[(0,T.jsx)(a.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,T.jsx)(d.A,{fullWidth:!0,label:"Issue Type Name*",name:"issueTypeName",onBlur:r,value:v.issueTypeName,onChange:(e,s)=>{p("issueTypeName",s),g({...j,issueTypeName:e.target.value})},variant:"outlined",size:"small",helperText:y.issueTypeName&&s.issueTypeName,error:y.issueTypeName&&Boolean(s.issueTypeName)})}),(0,T.jsx)(a.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,T.jsx)(n.A,{name:"issueType",value:v.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({...j,issueType:s})},renderInput:e=>(0,T.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,T.jsx)(a.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,T.jsx)(n.A,{name:"statusID",value:v.statusID,fullWidth:!0,options:h||[],onBlur:r,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,s)=>{p("statusID",s),g({...j,statusID:s})},renderInput:e=>(0,T.jsx)(d.A,{...e,fullWidth:!0,label:"Status *",name:"statusID",variant:"outlined",helperText:s.statusID&&s.statusID,error:s.statusID&&Boolean(s.statusID)})})})]})}),(0,T.jsx)(a.Ay,{className:"d-flex justify-content-center",p:2,children:(0,T.jsx)(u.A,{children:(0,T.jsx)(l.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:c,children:"SAVE"})})})]})})}})})]})}},10155:(e,s,i)=>{var t=i(24994);s.A=void 0;var l=t(i(40039)),a=i(70579);s.A=(0,l.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")}}]);
//# sourceMappingURL=25325.2f798ec9.chunk.js.map