PageSourceSearch

https://ripplemind.com/_next/static/chunks/pages/salary-management…/designation-637490c7fe35a8ec.js

js ripplemind.com collected 2026-10-06 13:16:47 UTC 10,384 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7175],{90470:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});var n=a(91373);let s=(0,n.Z)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},31012:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});var n=a(91373);let s=(0,n.Z)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},87764:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});var n=a(91373);let s=(0,n.Z)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},13671:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});var n=a(91373);let s=(0,n.Z)("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},59022:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/salary-management/company/[companyId]/designation",function(){return a(60639)}])},42689:function(e,t,a){"use strict";a.r(t);var n=a(85893),s=a(67294),r=a(41664),i=a.n(r),l=a(11163),c=a(88446),o=a(86501);t.default=e=>{let{children:t}=e,a=(0,l.useRouter)(),{companyId:r}=a.query,[d,u]=(0,s.useState)(null),[m,h]=(0,s.useState)(!0),p=[{name:"Employees",path:"/salary-management/company/".concat(r,"/employees")},{name:"Departments",path:"/salary-management/company/".concat(r,"/department")},{name:"Attendance",path:"/salary-management/company/".concat(r,"/attendance")},{name:"Designations",path:"/salary-management/company/".concat(r,"/designation")},{name:"Salary List",path:"/salary-management/company/".concat(r,"/salary-list")},{name:"Holidays",path:"/salary-management/company/".concat(r,"/holidays")},{name:"Religion",path:"/salary-management/company/".concat(r,"/religion")}].sort((e,t)=>e.name.localeCompare(t.name));return(0,s.useEffect)(()=>{if(!r)return;let e=async()=>{var e,t,a;try{let t=await c.Z.post("/payroll/company/company-by-id",{company_id:r});u(null===(e=t.data)||void 0===e?void 0:e.data)}catch(e){o.ZP.error((null==e?void 0:null===(t=e.response)||void 0===t?void 0:null===(a=t.data)||void 0===a?void 0:a.message)||"Error fetching company"),console.error("❌ Error fetching company:",e)}finally{h(!1)}};e()},[r]),(0,n.jsxs)("div",{className:"flex min-h-screen",children:[(0,n.jsxs)("aside",{className:"w-64 flex-shrink-0 bg-gray-900 text-white p-4",children:[m?(0,n.jsx)("h2",{className:"text-lg font-bold mb-6",children:"Loading..."}):(0,n.jsxs)("div",{className:"flex items-center gap-3 my-3",children:[(null==d?void 0:d.logo_url)&&(0,n.jsx)("img",{src:d.logo_url,alt:d.company_name,className:"w-12 h-12 rounded-full object-cover border border-gray-700"}),(0,n.jsx)("h2",{className:"text-lg font-bold truncate",children:(null==d?void 0:d.company_name)||"Company"})]}),(0,n.jsx)("ul",{className:"space-y-2 mb-6",children:p.map(e=>(0,n.jsx)("li",{children:(0,n.jsx)(i(),{href:e.path,children:(0,n.jsx)("span",{className:"block px-3 py-2 rounded-md cursor-pointer transition-colors ".concat(a.asPath.startsWith(e.path)?"bg-gray-700 font-semibold":"hover:bg-gray-800"),children:e.name})})},e.path))}),(0,n.jsx)(i(),{href:"/salary-management/company",children:(0,n.jsx)("span",{className:"block mt-6 text-sm text-gray-300 hover:text-white",children:"← Back to Companies"})})]}),(0,n.jsx)("main",{className:"flex-1 p-3 bg-gray-100 overflow-x-auto",children:(0,n.jsx)("div",{className:"min-w-[1200px]",children:t})})]})}},60639:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return b}});var n=a(85893),s=a(67294),r=a(88446),i=a(86501),l=a(90044),c=a(87083),o=a(41664),d=a.n(o),u=a(17866),m=a(8823),h=a(90470),p=a(13671),y=a(31012),x=a(87764),g=e=>{let{companyId:t}=e,[a,o]=(0,s.useState)(0),[g,f]=(0,s.useState)([]),[v,j]=(0,s.useState)(1),[b,N]=(0,s.useState)(20),[Z,w]=(0,s.useState)(!1),[S,_]=(0,s.useState)(""),[k,P]=(0,s.useState)({sortKey:"id",sortType:-1}
1),[E,C]=(0,s.useState)(!1),D={display:"flex",justifyContent:"center",width:"100%"},R=async(e,a)=>{let n=window.confirm("Are you sure you want to delete this designation?");if(n)try{let n=await r.Z.patch("/payroll/designation/delete",{designationId:e,company_id:t});if(200===n.status)i.ZP.success("designation deactivated successfully."),a();else throw Error("Unexpected response status")}catch(e){console.error("Error deleting designation:",e),i.ZP.error("An error occurred while deactivating the designation.")}},A=async()=>{C(!0);try{var e,a;let n=await r.Z.post("/payroll/designation/list",{page_enabled:"y",page:v,limit:b,sortDetails:k,searchDetails:[],searchDetailsAnd:[{basicSearchKey:"",basicSearchValue:"",basicSearchType:""}],searchQuery:S,company_id:t}),s=(null===(e=n.data)||void 0===e?void 0:e.data)||[];f(s),o((null===(a=n.data)||void 0===a?void 0:a.count)||0)}catch(e){console.error("Failed to fetch Designation list:",e)}finally{C(!1)}};return(0,s.useEffect)(()=>{A()},[v,b,k,S]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"px-4 pt-4",children:[(0,n.jsx)("h1",{className:"text-2xl mb-1",children:"Designation Details (".concat(a,")")}),(0,n.jsxs)("div",{className:"flex flex-row space-x-3",children:[(0,n.jsx)(c.ZP,{content:(0,n.jsx)("span",{className:"text-xs",children:"Add New"}),placement:"bottom",children:(0,n.jsx)(d(),{href:"/salary-management/company/".concat(t,"/designation/add"),children:(0,n.jsx)("button",{className:"bg-gray-300 hover:bg-gray-400 px-3 py-2 rounded text-sm leading-none h-10",children:(0,n.jsx)(y.Z,{className:"w-4 h-4 text-gray-700"})})})}),(0,n.jsx)(c.ZP,{content:(0,n.jsx)("span",{className:"text-xs",children:"Search"}),placement:"bottom",children:(0,n.jsx)("button",{className:"p-2 bg-gray-300 hover:bg-gray-400 py-2 px-3 rounded ml-1",onClick:()=>w(e=>!e),children:(0,n.jsx)(x.Z,{className:"w-4 h-4 text-gray-700"})})})]})]}),Z&&(0,n.jsx)("div",{className:"flex items-center gap-2 p-4",children:(0,n.jsx)("input",{type:"text",placeholder:"Search by name",className:"border-2 border-gray-300 rounded px-4 py-2 w-full max-w-xs text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",onChange:e=>_(e.target.value)})}),(0,n.jsx)("div",{className:"pt-2 p-4",children:(0,n.jsx)(l.ZP,{columns:[{name:(0,n.jsx)("div",{style:D,children:"Action"}),width:"160px",cell:e=>(0,n.jsxs)("div",{style:D,children:[(0,n.jsx)(c.ZP,{content:(0,n.jsx)("span",{children:"Edit"}),placement:"bottom",children:(0,n.jsx)(d(),{href:"/salary-management/company/".concat(t,"/designation/").concat(e.id,"/edit"),children:(0,n.jsx)("button",{className:"m-1 inline p-5 bg-gray-300 hover:bg-gray-400 text-black py-2 px-4 rounded",children:(0,n.jsx)(h.Z,{className:"w-4 h-4 text-gray-700"})})})}),(0,n.jsx)(c.ZP,{content:(0,n.jsx)("span",{children:"Delete"}),placement:"bottom",children:(0,n.jsx)("button",{className:"m-1 inline p-5 bg-gray-300 hover:bg-gray-400 text-black py-2 px-4 rounded",onClick:()=>R(e.id,A),children:(0,n.jsx)(p.Z,{className:"w-4 h-4 text-gray-700"})})})]})},{name:(0,n.jsx)("div",{style:D,children:"ID"}),id:"id",minWidth:"80px",cell:e=>(0,n.jsx)("div",{style:D,children:(0,u.Z)(e.id)}),sortable:!0},{name:(0,n.jsx)("div",{style:D,children:"Department"}),id:"department",minWidth:"120px",cell:e=>(0,n.jsx)("div",{children:(0,u.Z)(e.department.name)})},{name:(0,n.jsx)("div",{style:D,children:"Name"}),id:"name",minWidth:"120px",cell:e=>(0,n.jsx)("div",{children:(0,u.Z)(e.name)}),sortable:!0},{name:(0,n.jsx)("div",{style:D,children:"Description"}),id:"description",minWidth:"120px",cell:e=>(0,n.jsx)("div",{children:(0,u.Z)(e.description)}),sortable:!0},{name:(0,n.jsx)("div",{style:D,children:"Status"}),id:"is_active",minWidth:"120px",cell:e=>(0,n.jsx)("div",{children:e.is_active?"Yes":"No"}),sortable:!0},{name:(0,n.jsx)("div",{style:D,children:"Operator"}),id:"operator_id",minWidth:"120px",cell:e=>{var t;return(0,n.jsx)("div",{children:(0,u.Z)(null===(t=e.operatorDetails[0])||void 0===t?void 0:t.user_name)})},sortable:!0}],data:g,progressPending:E,pagination:!0,paginationServer:!0,paginationPerPage:b,paginationRowsPerPageOptions:[5,10,20,30,50,100],paginationTotalRows:a,onChangeRowsPerPage:e=>{j(1),N(e)},onChangePage:e=>{j(e)},sortServer:!0,defaultSortFieldId:"col_".concat(k.sortKey),defaultSortAsc:1===k.sortType,onSort:(e,t)=>{let a={sortKey:"string"==typeof(null==e?void 0:e.id)?e.id.replace("col_",""):"id",sortType:"desc"===t?-1:1};P(a)},fixedHeader:!0,fixedHeaderScrollHeight:"64vh",customStyles:m.Z,highlightOnHover:!0})})]})},f=a(64270),v=a(42689),j=a(11846),b=()=>{let e=(0,f.P)("companyId");return!e||e<1?null:(0,n.jsx)(j.Z,{children:(0,n.jsx)(v.default,{children:(0,n.jsx)(g,{companyId:e})})})}},28646:function(e,t,a){"use strict";var n=a(85893),s=a(41664),r=a.n(s),i=a(11163);a(67294),t.Z=()=>{let e=(0,i.useRouter)(),t=e.asPath;return(0,n.jsxs)("div",{className:"md:mx-28 text-center text-red-500 p-10 bg-gray-100 text-xl",children:["Your are not Logged in to use this functionality .......! ",(0,n.jsx)("br",{}),(0,n.jsx)(r(),{className:"text-blue-500",href:"/login?re_url=".concat(t),children:"Click here to Login"})]})}},8823:function(e,t){"use strict";t.Z={headCells:{style:{border:"1px solid #f1f1f1",fontSize:"14px",backgroundColor:"#e1e1e1"}},cells:{style:{border:"1px solid #f1f1f1",paddingLeft:"7px",paddingRight:"7px"}}}},11846:function(e,t,a){"use strict";a.d(t,{Z:function(){return l}});var n=a(85893),s=a(48583),r=a(94543),i=a(28646);function l(e){let{children:t}=e,a=(0,s.Dv)(r.ZP);return a.isLoggedIn?t:(0,n.jsx)(i.Z,{})}},17866:function(e,t){"use strict";t.Z=e=>{try{if("string"==typeof e||"number"==typeof e)return"".concat(e);return"-"}catch(e){return console.error(e),"-----"}}},64270:function(e,t,a){"use strict";a.d(t,{N:function(){return i},P:function(){return r}});var n=a(11163),s=a(67294);
1function r(e){let t=(0,n.useRouter)(),[a,r]=(0,s.useState)(null);return(0,s.useEffect)(()=>{if(t.isReady){let a=t.query[e];if("string"==typeof a){let e=Number(a);e>=1&&r(e)}}},[t.isReady,t.query,e]),a}function i(e){let t=(0,n.useRouter)(),[a,r]=(0,s.useState)(null);return(0,s.useEffect)(()=>{if(t.isReady){let a=t.query[e];"string"==typeof a&&""!==a.trim()&&r(a)}},[t.isReady,t.query,e]),a}}},function(e){e.O(0,[44,5655,9774,2888,179],function(){return e(e.s=59022)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.