File manager - Edit - /home/autoph/public_html/projects/ahg-hr/assets/index.4aa7aee5.js
Back
import{_ as A,b as d,e as h,w as m,c as x,j as v,F as y,r as p,o as a,d as s,f as C,t as c,m as _,h as k,k as T}from"./index.85badd64.js";import{A as w}from"./ApplicantService.ed8a9483.js";import{F as j}from"./FileService.f48416f8.js";import{L as $,b as z,D as F,P as V}from"./index.a2e6eae1.js";import{M as E}from"./index.9cc1ebc8.js";import{B as U}from"./index.cc73f214.js";import{C as Y}from"./CreateButton.69489aea.js";import{D as N}from"./DeleteButton.f13880af.js";import{E as J}from"./EditButton.f8e95215.js";import{F as G}from"./FileButton.529727d5.js";/* empty css */import{V as H}from"./ViewButton.13bd1aa9.js";import{I as Q}from"./index.0683473b.js";import"./jspdf.es.min.23081428.js";/* empty css *//* empty css */import"./vue-cleave.min.5fe175a4.js";import"./array.e024b95a.js";import{L as W}from"./Loading.585cd43f.js";import"./vue-quill.snow.37e2074d.js";/* empty css */import{F as q}from"./index.2b90fc01.js";import{I as Z}from"./index.a2c793b0.js";import{l as K}from"./lodash.436e061f.js";import{P as X}from"./index.cf4c1c51.js";import{h as ee}from"./meeting-office.7e6e2274.js";import{C as te}from"./index.80034d43.js";import{P as se}from"./index.5cc31c5b.js";import"./logo-black.7c15feb3.js";import"./logo-white.b04c5a89.js";import"./transition.47a550d7.js";import"./EmployeeService.9af9860f.js";import"./es.string.replace.52fb44b9.js";import"./Loading.vue_vue_type_style_index_0_scoped_cbded5a2_lang.ffa9415b.js";const oe={setup(){},components:{FileType:q,SidePanel:se,Modal:E,Layout:$,CreateButton:Y,Loading:W,InputGroup:Z,EditButton:J,DeleteButton:N,ViewButton:H,FileButton:G,Button:U,Pagination:X,Card:te,Icon:Q,MenuItem:z,Dropdown:F},data(){return{sidePanelHeaderTitle:"",sidePanelDescription:"",sidePanelResume:"",sidePanelCoverLetter:"",process_history:[],openCoverLetterId:null,showCoverLetter:!1,selectedCoverLetter:"",image1:V,actions:[{name:"Initial Interview",icon:"heroicons:pencil-square",class:"h-[6px] w-[6px] bg-danger-500 rounded-full inline-block ring-4 ring-opacity-30 ring-danger-500",value:1},{name:"Technical Interview",icon:"heroicons:pencil-square",class:"h-[6px] w-[6px] bg-warning-500 rounded-full inline-block ring-4 ring-opacity-30 ring-warning-500",value:2},{name:"Final Interview",icon:"heroicons:pencil-square",class:"h-[6px] w-[6px] bg-primary-500 rounded-full inline-block ring-4 ring-opacity-30 ring-primary-500",value:3},{name:"Job Offer",icon:"heroicons:pencil-square",class:"h-[6px] w-[6px] bg-success-500 rounded-full inline-block ring-4 ring-opacity-30 ring-success-500",value:4},{name:"Archive",icon:"heroicons-outline:trash"},{name:"Blocklist",icon:"material-symbols:block",value:"5"}],headerImage:ee,title:"Job Applicants",breadcrumbs:[{text:"Home",href:"/"},{text:"Recruitment",href:"/recruitment/job-applicants"},{text:"Job Applicants",active:!0}],columns:[{label:"#",field:"#"},{label:"First Name",field:"firstname"},{label:"Middle Name",field:"middlename"},{label:"Last Name",field:"lastname"},{label:"Position",field:"job.jobtitle.name"},{label:"Status",field:"status"},{label:"Date Applied",field:"created_at",formatFn:e=>this.formatDate(e)},{label:"Resume/CV",field:"resume"},{label:"Action",field:"action"}],perPageOptions:[{value:"10",label:"10"},{value:"50",label:"50"},{value:"100",label:"100"}],state:{isLoading:!1,isMounted:!1,showModal:!1,isDeleting:!1,isDownloading:!1,showRowModal:!1},items:[],form:{status:""},totalItems:0,error:[],searchQuery:"",serverOptions:{page:1,rowsPerPage:10,sortBy:"firstname",sortType:"asc"}}},watch:{serverOptions:{handler(){console.log(`perPage: ${this.serverOptions.rowsPerPage}`),this.fetchRecords()},deep:!0},searchQuery:K.debounce(function(){this.fetchRecords()},800)},computed:{perPage:function(){return this.serverOptions.rowsPerPage}},methods:{handleRowClick(e){this.state.showRowModal=!0,console.log("Clicked row"),this.sidePanelHeaderTitle=`${e.firstname} ${e.lastname}`,this.sidePanelDescription=`Applied for: ${e.job.jobtitle.name}`,this.sidePanelResume=e.resume,this.sidePanelCoverLetter=e.cover_letter,this.process_history=e.process_history,console.log(e)},closeRowModal(){this.state.showRowModal=!1},viewCoverLetter(e){this.openCoverLetterId=e},closeCoverLetter(){this.openCoverLetterId=null},handleChange(e,t){this.form.status=t,this.updateStatusRecord(e.id,this.form)},reload(){return this.$emit("refresh")},updateStatusRecord(e,t){console.log(t.status);let r="";t.status==1?r="Initial Interview":t.status==2?r="Techincal Interview":t.status==3?r="Final Interview":t.status==4?r="Job Offer":t.status==5&&(r="blocklist"),this.$swal.fire({title:"Are you sure?",text:r==""?"You want to archive this record?":"You want to proceed this application for "+r+" ? ",icon:"warning",showCancelButton:!0,confirmButtonColor:"#34c38f",cancelButtonColor:"#f46a6a",confirmButtonText:r==""?"Yes, archive it!":"Yes, proceed it!",background:this.$store.themeSettingsStore.isDark?"#1e293b":"#fff"}).then(n=>{n.value&&(r==""?w.remove(e,t).then(o=>{o.status==201?(this.$swal.fire({title:"Great!",text:"Record successfully updated.",icon:"success",timer:2e3}),this.fetchRecords()):(this.$swal.fire({title:"Ooops! something is wrong.",text:"Please contact system administrator",icon:"error",timer:2e3}),this.state.showModal=!1)}).catch(o=>{console.log(o),o.response.status==422?this.$swal.fire({title:"Ooops! something is wrong.",text:o.response.data.message,icon:"warning"}):this.$swal.fire({title:"Ooops! something is wrong.",text:"Please contact system administrator",icon:"error",timer:2e3})}).finally(()=>{this.state.isSaving=!1,this.reload()}):w.updateStatus(e,t).then(o=>{o.status==201?(this.$swal.fire({title:"Great!",text:"Record successfully updated.",icon:"success",timer:2e3}),this.fetchRecords()):(this.$swal.fire({title:"Ooops! something is wrong.",text:"Please contact system administrator",icon:"error",timer:2e3}),this.state.showModal=!1)}).catch(o=>{console.log(o),o.response.status==422?this.$swal.fire({title:"Ooops! something is wrong.",text:o.response.data.message,icon:"warning"}):this.$swal.fire({title:"Ooops! something is wrong.",text:"Please contact system administrator",icon:"error",timer:2e3})}).finally(()=>{this.state.isSaving=!1,this.reload()}))}).catch(n=>{n.response&&n.response.status==401&&this.$swal.fire({title:"Ooops! something is wrong.",text:"Error deleting record. Please contact system administrator",type:"error",icon:"error",timer:2e3})}).finally(()=>{this.state.isDeleting=!1})},applicantStatus(e){if(e==1||e==0)return"Initial Interview";if(e==2)return"Technical Interview";if(e==3)return"Final Interview"},formatDate(e){const t=new Date(e),r=new Date(t.toLocaleString("en-US",{timeZone:"UTC"})),n=new Date(r.toLocaleString("en-US",{timeZone:"Asia/Singapore"})),o=n.getFullYear(),l=String(n.getMonth()+1).padStart(2,"0"),f=String(n.getDate()).padStart(2,"0");return`${o}-${l}-${f}`},async viewAttachment(e){if(this.state.isDownloading)return;this.state.isDownloading=!0;let t=await j.Reader2("applicant",e),r;if(e.endsWith(".pdf"))r="application/pdf";else if(e.endsWith(".png"))r="image/png";else if(e.endsWith(".jpg")||e.endsWith(".jpeg"))r="image/jpeg";else if(e.endsWith(".svg"))r="image/svg+xml";else throw new Error("Unsupported file type");const n=atob(t),o=new Array(n.length);for(let g=0;g<n.length;g++)o[g]=n.charCodeAt(g);const l=new Uint8Array(o),f=new Blob([l],{type:r}),b=URL.createObjectURL(f);window.open(b),this.state.isLoadingPDF=!1},async fetchRecords(){this.state.isLoading=!0,this.state.isMounted=!1,await w.fetchRecords({keyword:this.searchQuery,page:this.serverOptions.page,per_page:this.serverOptions.rowsPerPage,sortBy:this.serverOptions.sortBy,sortType:this.serverOptions.sortType}).then(e=>{console.log("resres",e);let t=e.data.data;this.items=t.filter(r=>r.status!=4).map((r,n)=>({...r,"#":(this.serverOptions.page-1)*this.serverOptions.rowsPerPage+(n+1)})),this.totalItems=e.data.total}).finally(()=>{this.state.isLoading=!1,this.state.isMounted=!0})},handlePageChange(e){console.log(e),console.log(this.serverOptions.page),this.serverOptions.page!=e&&(this.serverOptions.page=e)},handlePerPageChange(e){this.serverOptions.page=1,this.serverOptions.rowsPerPage=e},onSortChange(e){console.log(e),e[0].type!="none"&&(this.serverOptions.sortBy=e[0].field,this.serverOptions.sortType=e[0].type)},async deleteRecord(e){this.$swal.fire({title:"Are you sure?",text:"You want to delete this record?",icon:"warning",showCancelButton:!0,confirmButtonColor:"#34c38f",cancelButtonColor:"#f46a6a",confirmButtonText:"Yes, delete it!",background:this.$store.themeSettingsStore.isDark?"#1e293b":"#fff"}).then(t=>{t.value&&(this.state.isDeleting=!0,w.remove(e).then(r=>{console.log(r),r.status==201&&(this.$swal.fire({title:"Yaaay!",text:"Record has been deleted successfully.",type:"success",icon:"success",timer:2e3}),this.fetchRecords())}))}).catch(t=>{t.response&&t.response.status==401&&this.$swal.fire({title:"Ooops! something is wrong.",text:"Error deleting record. Please contact system administrator",type:"error",icon:"error",timer:2e3})}).finally(()=>{this.state.isDeleting=!1})},viewRecord(e){this.$refs.form.resetForm(),this.$refs.form.loadRecord(e),this.$refs.form.state.showModal=!0},async submitForm(){if(console.log("Submit Form"),this.state.isLoading=!0,this.state.isSubmitted=!0,!this.v$.$invalid)try{this.state.isEdit==!0?(await w.update(this.categoryData.category_code,this.categoryData),Swal.fire("Success!","Data successfully updated.","success")):(await w.create(this.categoryData),Swal.fire("Success!","Data succesfully created.","success")),this.state.showModal=!1,this.state.isLoading=!1,this.resetData(),this.fetchRecords()}catch(e){this.error=e||"",this.state.isResetError=!0,this.state.isLoading=!1}},closeModal(){this.state.showModal=!1,this.resetData(),this.fetchRecords()},resetData(){this.state={isLoading:!1,isMounted:!1,isResetError:!1,isSubmitted:!1,showModal:!1},this.categoryData={category_code:"",category_desc:""},this.error=[]}},mounted(){this.fetchRecords()}},ie={class:"my-5"},re={key:0,class:"mt-2"},ne={class:"border border-gray-200 rounded-md p-2 mb-2"},ae={class:"text-md font-bold"},le={class:"text-gray-400 text-sm"},ce={key:1},de={class:"md:flex pb-6 items-center"},pe={class:"flex-1 md:mb-0 mb-3"},ue={class:"md:flex md:space-x-3 items-center flex-none rtl:space-x-reverse my-3 float-right"},he={class:"min-w-full divide-y divide-zinc-200 dark:divide-zinc-700"},me={class:"bg-white divide-y divide-zinc-200 dark:bg-zinc-900 dark:divide-zinc-700"},fe=["onClick"],ge=["onClick"],we=["onClick"],ve=["onClick"],ye={key:0,class:"h-[6px] w-[6px] bg-danger-500 rounded-full inline-block ring-4 ring-opacity-30 ring-danger-500"},be={key:1,class:"h-[6px] w-[6px] bg-warning-500 rounded-full inline-block ring-4 ring-opacity-30 ring-warning-500"},xe={key:2,class:"h-[6px] w-[6px] bg-primary-500 rounded-full inline-block ring-4 ring-opacity-30 ring-primary-500"},_e={class:"p-2"},Ce=["onClick"],ke={class:"text-xl"};function Pe(e,t,r,n,o,l){const f=p("Icon"),b=p("SidePanel"),g=p("InputGroup"),P=p("Button"),D=p("MenuItem"),R=p("Dropdown"),L=p("Card"),I=p("Loading"),S=p("Layout"),O=p("Modal");return a(),d(y,null,[h(S,{breadcrumbs:o.breadcrumbs},{default:m(()=>[s("div",ie,[s("div",null,[h(b,{active:o.state.showRowModal,onClose:l.closeRowModal,headerTitle:o.sidePanelHeaderTitle,headerDescription:o.sidePanelDescription},{default:m(()=>[s("div",{class:"p-2 flex items-center justify-start gap-3 cursor-pointer",onClick:t[0]||(t[0]=i=>l.viewAttachment(o.sidePanelResume))},[h(f,{icon:"line-md:download-loop",class:"text-2xl"}),t[3]||(t[3]=C(" Download Resume "))]),s("div",null,[t[4]||(t[4]=s("div",{class:"text-md font-bold mt-2"}," Cover Letter ",-1)),C(" "+c(o.sidePanelCoverLetter),1)]),o.process_history?(a(),d("div",re,[t[5]||(t[5]=s("div",{class:"text-md font-bold mt-2 mb-2"}," History ",-1)),(a(!0),d(y,null,_(o.process_history,i=>(a(),d("div",{key:i.id},[s("div",ne,[s("div",ae," To: "+c(i.action_id==1?"Initial Interview":i.action_id==2?"Technical Interview":i.action_id==3?"Final Interview":i.action_id==4?"Job Offer":""),1),s("div",le," ("+c(this.$formatDate(i.action_made))+") ",1)])]))),128))])):(a(),d("div",ce,t[6]||(t[6]=[s("div",{class:"p-2 items-center text-4xl text-color-400"}," NO DATA ",-1)])))]),_:1},8,["active","onClose","headerTitle","headerDescription"])]),h(L,{noborder:""},{default:m(()=>[s("div",de,[s("h6",pe,c(o.title),1),s("div",ue,[h(g,{modelValue:o.searchQuery,"onUpdate:modelValue":t[1]||(t[1]=i=>o.searchQuery=i),placeholder:"Search",type:"text",prependIcon:"heroicons-outline:search",merged:""},null,8,["modelValue"]),h(P,{icon:"heroicons-outline:filter",text:"Filter",btnClass:"btn-outline-secondary text-slate-600 dark:border-slate-700 dark:text-slate-300 font-normal btn-sm",iconClass:"text-lg"})])]),s("table",he,[t[7]||(t[7]=s("thead",{class:"bg-zinc-50 dark:bg-zinc-800"},[s("tr",{class:"bg-gray-100"},[s("th",{class:"px-6 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider"},"#"),s("th",{class:"px-6 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider"},"Name"),s("th",{class:"px-6 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider"},"Position"),s("th",{class:"px-6 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider"},"Status"),s("th",{class:"px-6 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider"},"Date Applied"),s("th",{class:"px-6 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider"},"Actions")])],-1)),s("tbody",me,[(a(!0),d(y,null,_(o.items,(i,M)=>(a(),d("tr",{key:i.id,class:"hover:bg-gray-100 cursor-pointer"},[s("td",{class:"p-2",onClick:u=>l.handleRowClick(i)},c(M+1),9,fe),s("td",{onClick:u=>l.handleRowClick(i)},c(i.firstname)+" "+c(i.lastname),9,ge),s("td",{onClick:u=>l.handleRowClick(i)},c(i.job?i.job.jobtitle?i.job.jobtitle.name:"Job Title Not Available":"Item Not Available"),9,we),s("td",{class:"flex items-center top-2",onClick:u=>l.handleRowClick(i)},[i.status==1||i.status==0?(a(),d("span",ye)):v("",!0),i.status==2?(a(),d("span",be)):v("",!0),i.status==3?(a(),d("span",xe)):v("",!0),s("span",_e,c(l.applicantStatus(i.status)),1)],8,ve),s("td",{onClick:u=>l.handleRowClick(i)},c(e.$formatDate(i.created_at)),9,Ce),s("td",null,[h(R,{classMenuItems:"w-[140px] z-9 absolute",teleport:"#dropdown-container"},{menus:m(()=>[(a(!0),d(y,null,_(o.actions,(u,B)=>(a(),x(D,{key:B,onClick:T(De=>l.handleChange(i,u.value),["stop"])},{default:m(()=>[s("div",{class:k([u.name==="delete"?"bg-red-500 text-red-500 bg-opacity-30 hover:bg-opacity-100 hover:text-white":"hover:bg-gray-800 hover:text-white","w-full border-b border-gray-500 border-opacity-10 px-4 py-2 text-sm flex items-center space-x-2"])},[s("span",{class:k(u.class)},null,2),s("span",null,c(u.name),1)],2)]),_:2},1032,["onClick"]))),128))]),default:m(()=>[s("span",ke,[h(f,{icon:"heroicons-outline:dots-vertical"})])]),_:2},1024)])]))),128))])])]),_:1}),o.state.isLoading?(a(),x(I,{key:0,text:"Fetching records"})):v("",!0)])]),_:1},8,["breadcrumbs"]),o.showCoverLetter?(a(),x(O,{key:0,onClose:t[2]||(t[2]=i=>o.showCoverLetter=!1)},{header:m(()=>t[8]||(t[8]=[s("h3",null,"Full Cover Letter",-1)])),body:m(()=>[s("p",null,c(o.selectedCoverLetter),1)]),_:1})):v("",!0)],64)}const at=A(oe,[["render",Pe],["__scopeId","data-v-72bc5237"]]);export{at as default};
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0.06 |
proxy
|
phpinfo
|
Settings