File manager - Edit - /home/autoph/public_html/projects/ahg-hr/assets/index.7c0ee7c0.js
Back
import{_ as P,r,o as u,c as b,w as g,d as o,t as p,e as d,b as f,m as F,F as L,j as _}from"./index.28ae41da.js";import{A as w}from"./ApplicantService.31b24103.js";import{F as O}from"./FileService.09441775.js";import{M as T}from"./MrfService.8b5f5895.js";import{L as I,b as j,D as U,P as z}from"./index.ca4614c1.js";import{B as D}from"./index.8a5f8558.js";import{C as E}from"./CreateButton.7e6095de.js";import{D as R}from"./DeleteButton.89d918f5.js";import{E as V}from"./EditButton.4c7b9ec2.js";import{F as M}from"./FileButton.684ff0ab.js";/* empty css */import{V as Y}from"./ViewButton.d67c4349.js";import{I as G}from"./index.1b36081b.js";import"./jspdf.es.min.cdd8e899.js";/* empty css *//* empty css */import"./vue-cleave.min.10e51f16.js";import"./array.19531b35.js";import{L as $}from"./Loading.fa197db1.js";import"./vue-quill.snow.464b7516.js";/* empty css */import{I as A}from"./index.ae574076.js";import{F as Q}from"./index.975c3902.js";import{F as W}from"./index.164dfd27.js";import{T as Z}from"./index.33bd7660.js";import{T as J}from"./index.43beecaf.js";import{A as N}from"./ArchiveButton.b3f7aee7.js";import{C as H}from"./CloseButton.dacc4a7b.js";import{P as q}from"./ProceedButton.64b953f7.js";import{S as K}from"./SubmitButton.be4371c4.js";import{U as X}from"./UpdateButton.a9e9b37b.js";import{M as tt}from"./Multiselect.3c2ca79b.js";import{l as et}from"./lodash.45138f16.js";import{P as st}from"./index.4d0f347c.js";import{h as ot}from"./meeting-office.7e6e2274.js";import{C as nt}from"./index.4f06d02e.js";import{T as it}from"./index.e67e1803.js";import"./logo-black.7c15feb3.js";import"./logo-white.b04c5a89.js";import"./transition.4769b1c9.js";import"./EmployeeService.67ccb7ea.js";import"./es.string.replace.a39053f7.js";import"./Loading.vue_vue_type_style_index_0_scoped_cbded5a2_lang.e35c8e45.js";import"./index.17d4213d.js";import"./index.85943672.js";const at={components:{Button:D},props:{text:{type:String,default:null},link:[String,Object],icon:{type:String,default:"material-symbols:block"},title:{type:String,default:"Blocklist this record"},titleTheme:{type:String,default:"danger-500"},titleOffset:{type:Number,default:7}},setup(){}};function rt(t,e,s,i,n,a){const m=r("Button");return u(),b(m,{btnClass:"text-red-400 hover:text-red-500 py-2 px-1",icon:s.icon,iconClass:"text-xl",text:s.text??null,link:s.link,title:s.title,titleTheme:s.titleTheme,titleOffset:[0,s.titleOffset]},null,8,["icon","text","link","title","titleTheme","titleOffset"])}const lt=P(at,[["render",rt]]),ct={components:{BlocklistButton:lt,FormModal:W,FormGroup:Q,TextInput:J,TextArea:Z,SubmitButton:K,UpdateButton:X,CloseButton:H,DeleteButton:R,ArchiveButton:N,ProceedButton:q,FileButton:M,Loading:$,Multiselect:tt,InputGroup:A,Button:D},data(){return{form:{status:1},items:[],errors:{},state:{isEdit:!1,isSaving:!1,isLoading:!1,isDownloading:!1}}},methods:{async viewAttachment(t){if(this.state.isDownloading)return;this.state.isDownloading=!0;let e=await O.Reader2("applicant",t),s;if(t.endsWith(".pdf"))s="application/pdf";else if(t.endsWith(".png"))s="image/png";else if(t.endsWith(".jpg")||t.endsWith(".jpeg"))s="image/jpeg";else if(t.endsWith(".svg"))s="image/svg+xml";else throw new Error("Unsupported file type");const i=atob(e),n=new Array(i.length);for(let h=0;h<i.length;h++)n[h]=i.charCodeAt(h);const a=new Uint8Array(n),m=new Blob([a],{type:s}),y=URL.createObjectURL(m);window.open(y),this.state.isLoadingPDF=!1},loadRecord(t){this.resetForm(),this.state.isEdit=!0,this.items=t,console.log(this.items)},closeModal(){this.state.showModal=!1},resetForm(){this.state.isEdit=!1,this.form={status:1}},reload(){this.$emit("reload")},async saveRecord(t,e){this.state.isSaving||this.$swal.fire({title:"Are you sure?",text:"You want to proceed "+e+"'s' application?",icon:"warning",showCancelButton:!0,confirmButtonColor:"#34c38f",cancelButtonColor:"#f46a6a",confirmButtonText:"Yes",background:this.$store.themeSettingsStore.isDark?"#1e293b":"#fff"}).then(s=>{s.value&&(this.state.isSaving=!0,w.update(t,this.form).then(i=>{i.status==201?(this.$swal.fire({title:"Great!",text:"Record successfully updated.",icon:"success",timer:2e3}),this.state.showModal=!1):(this.$swal.fire({title:"Ooops! something is wrong.",text:"Please contact system administrator",icon:"error",timer:2e3}),this.state.showModal=!1)}).catch(i=>{console.log(i),i.response.status==422?this.$swal.fire({title:"Ooops! something is wrong.",text:i.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(s=>{s.response&&s.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})})},async deleteRecord(t,e){this.$swal.fire({title:"Are you sure?",text:"You want to archive this record?",icon:"warning",showCancelButton:!0,confirmButtonColor:"#34c38f",cancelButtonColor:"#f46a6a",confirmButtonText:"Yes, archive it!",background:this.$store.themeSettingsStore.isDark?"#1e293b":"#fff"}).then(s=>{s.value&&(this.state.isDeleting=!0,w.remove(t).then(i=>{this.state.showModal=!1,i.status==201&&this.$swal.fire({title:"Yaaay!",text:"Record has been archived successfully.",type:"success",icon:"success",timer:2e3})}))}).catch(s=>{s.response&&s.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,this.reload()})},async blocklistRecord(t){this.$swal.fire({title:"Are you sure?",text:"You want to blocklist this record?",icon:"warning",showCancelButton:!0,confirmButtonColor:"#34c38f",cancelButtonColor:"#f46a6a",confirmButtonText:"Yes, blocklist it!",background:this.$store.themeSettingsStore.isDark?"#1e293b":"#fff"}).then(e=>{e.value&&(this.state.isDeleting=!0,w.blocklist(t).then(s=>{this.state.showModal=!1,s.status==201&&this.$swal.fire({title:"Yaaay!",text:"Record has been blocklisted successfully.",type:"success",icon:"success",timer:2e3})}))}).catch(e=>{e.response&&e.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,this.reload()})},formatDate(t){const e=new Date(t),s=new Date(e.toLocaleString("en-US",{timeZone:"UTC"})),i=new Date(s.toLocaleString("en-US",{timeZone:"Asia/Singapore"})),n=i.getFullYear(),a=String(i.getMonth()+1).padStart(2,"0"),m=String(i.getDate()).padStart(2,"0");return`${n}-${a}-${m}`}},mounted(){}},dt={class:"flex gap-1 justify-end"},ut={class:"overflow-x-auto mt-4"},mt={class:"min-w-full divide-y divide-zinc-200 dark:divide-zinc-700"},pt={class:"bg-white divide-y divide-zinc-200 dark:bg-zinc-900 dark:divide-zinc-700"},ht={class:"px-6 py-4 whitespace-nowrap"},ft={class:"px-6 py-4 whitespace-nowrap"},gt={class:"px-6 py-4 whitespace-nowrap"},wt={class:"px-6 py-4 whitespace-nowrap"},yt={class:"px-6 py-4 whitespace-nowrap"},_t={class:"px-6 py-4"},xt={class:"px-6 py-4 whitespace-nowrap"},bt={class:"flex gap-1 justify-end mt-3"};function vt(t,e,s,i,n,a){const m=r("InputGroup"),y=r("Button"),h=r("FileButton"),v=r("ProceedButton"),C=r("ArchiveButton"),k=r("BlocklistButton"),S=r("CloseButton"),B=r("FormModal");return u(),b(B,{title:"Job Applicants",active:n.state.showModal,onSubmit:t.confirmSubmit,onClose:a.closeModal,themeClass:"bg-gray-800",sizeClass:"lg:w-11/12"},{default:g(()=>[o("div",null,p(n.items.mrf.jobtitle.name),1),o("div",dt,[d(m,{modelValue:t.searchQuery,"onUpdate:modelValue":e[0]||(e[0]=c=>t.searchQuery=c),placeholder:"Search",type:"text",prependIcon:"heroicons-outline:search",merged:""},null,8,["modelValue"]),d(y,{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"})]),o("div",ut,[o("table",mt,[e[1]||(e[1]=o("thead",{class:"bg-zinc-50 dark:bg-zinc-800"},[o("tr",{class:"bg-gray-100"},[o("th",{class:"px-6 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider"},"#"),o("th",{class:"px-6 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider"},"Full Name"),o("th",{class:"px-6 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider"},"Contact No.#"),o("th",{class:"px-6 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider"},"Date Applied"),o("th",{class:"px-6 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider"},"Resume/CV"),o("th",{class:"px-6 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider"},"Cover Letter"),o("th",{class:"px-6 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider"},"Actions")])],-1)),o("tbody",pt,[(u(!0),f(L,null,F(n.items.mrf.applicants,(c,x)=>(u(),f("tr",{key:x,class:"mb-5"},[o("td",ht,p(x+1),1),o("td",ft,p(c.firstname+" "+c.lastname),1),o("td",gt,p(c.contact_number),1),o("td",wt,p(a.formatDate(c.created_at)),1),o("td",yt,[d(h,{title:"Download Attachment",onClick:l=>a.viewAttachment(c.resume)},null,8,["onClick"])]),o("td",_t,p(c.cover_letter),1),o("td",xt,[d(v,{title:"Proceed for Initial Interview",onClick:l=>a.saveRecord(c.id,c.firstname+" "+c.lastname)},null,8,["onClick"]),d(C,{onClick:l=>a.deleteRecord(c.id)},null,8,["onClick"]),d(k,{onClick:l=>a.blocklistRecord(c.id)},null,8,["onClick"])])]))),128))])])]),o("div",bt,[d(S,{onClick:a.closeModal},null,8,["onClick"])])]),_:1},8,["active","onSubmit","onClose"])}const Ct=P(ct,[["render",vt]]);const kt={setup(){},components:{Layout:I,CreateButton:E,Loading:$,InputGroup:A,EditButton:V,DeleteButton:R,ViewButton:Y,FileButton:M,Button:D,Tooltip:it,Pagination:st,Card:nt,Icon:G,MenuItem:j,Dropdown:U,Form:Ct},data(){return{image1:z,headerImage:ot,title:"Job Applications",breadcrumbs:[{text:"Home",href:"/"},{text:"Recruitment",href:"/recruitment/job-applications"},{text:"Job Applications",active:!0}],columns:[{label:"#",field:"#"},{label:"Company",field:"mrf.company.name"},{label:"Position",field:"mrf.jobtitle.name"},{label:"Status",field:"mrf.enabled"},{label:"Date Posted",field:"mrf.created_at",formatFn:t=>this.formatDate(t)},{label:"Candidates",field:"applicant_count"},{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},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:et.debounce(function(){this.fetchRecords()},800)},computed:{perPage:function(){return this.serverOptions.rowsPerPage}},methods:{handleChange(t,e){this.form.status=e,this.updateStatusRecord(t.id,this.form)},applicantStatus(t){return t?"Active":"Inactive"},formatDate(t){const e=new Date(t),s=new Date(e.toLocaleString("en-US",{timeZone:"UTC"})),i=new Date(s.toLocaleString("en-US",{timeZone:"Asia/Singapore"})),n=i.getFullYear(),a=String(i.getMonth()+1).padStart(2,"0"),m=String(i.getDate()).padStart(2,"0");return`${n}-${a}-${m}`},fileDownload(t){O.Download(t).then(e=>{if(e.status===200){const s=new Blob([e.data]);if(window.navigator.msSaveBlob)window.navigator.msSaveBlob(s,t);else{const i=window.URL.createObjectURL(s),n=document.createElement("a");n.href=i,n.setAttribute("download",t),document.body.appendChild(n),n.click(),document.body.removeChild(n),window.URL.revokeObjectURL(i)}}else e.status===204?this.$swal.fire({title:"Ooops! Something is wrong!",text:"File not found.",icon:"error"}):console.error("Unexpected error:",e.status)}).catch(e=>{console.error("Error downloading file:",e)})},async fetchRecords(){this.state.isLoading=!0,this.state.isMounted=!1,await T.fetchRecordsWithApplicant({keyword:this.searchQuery,page:this.serverOptions.page,per_page:this.serverOptions.rowsPerPage,sortBy:this.serverOptions.sortBy,sortType:this.serverOptions.sortType}).then(t=>{console.log(t.data);let e=t.data;this.items=e.map((s,i)=>({...s,"#":(this.serverOptions.page-1)*this.serverOptions.rowsPerPage+(i+1)})),this.totalItems=t.data.total}).finally(()=>{this.state.isLoading=!1,this.state.isMounted=!0})},handlePageChange(t){console.log(t),console.log(this.serverOptions.page),this.serverOptions.page!=t&&(this.serverOptions.page=t)},handlePerPageChange(t){this.serverOptions.page=1,this.serverOptions.rowsPerPage=t},onSortChange(t){console.log(t),t[0].type!="none"&&(this.serverOptions.sortBy=t[0].field,this.serverOptions.sortType=t[0].type)},async deleteRecord(t){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(e=>{e.value&&(this.state.isDeleting=!0,w.remove(t).then(s=>{console.log(s),s.status==201&&(this.$swal.fire({title:"Yaaay!",text:"Record has been deleted successfully.",type:"success",icon:"success",timer:2e3}),this.fetchRecords())}))}).catch(e=>{e.response&&e.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(t){console.log(t),this.$refs.form.loadRecord(t),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(t){this.error=t||"",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()}},St={class:"my-5"},Bt={class:"md:flex pb-6 items-center"},Pt={class:"flex-1 md:mb-0 mb-3"},Dt={class:"md:flex md:space-x-3 items-center flex-none rtl:space-x-reverse my-3 float-right"},Ot={key:0,class:"flex items-center min-w-[150px]"},Rt={class:"text-sm text-slate-600 dark:text-slate-300 capitalize"},Mt={key:1,class:"flex items-center space-x-3 rtl:space-x-reverse"},$t={key:0,class:"h-[6px] w-[6px] bg-success-500 rounded-full inline-block ring-4 ring-opacity-30 ring-success-500"},At={key:1,class:"h-[6px] w-[6px] bg-danger-500 rounded-full inline-block ring-4 ring-opacity-30 ring-danger-500"},Ft={key:2},Lt={class:"flex items-center justify-center"},Tt={class:"flex-none h-8 w-8 rounded-md bg-slate-800 dark:bg-slate-700 text-slate-300 flex flex-col items-center justify-center text-md"},It={key:3},jt={class:"flex space-x-3 justify-center rtl:space-x-reverse"},Ut=["onClick"],zt={class:"py-4 flex justify-center"};function Et(t,e,s,i,n,a){const m=r("InputGroup"),y=r("Button"),h=r("Icon"),v=r("Tooltip"),C=r("Pagination"),k=r("vue-good-table"),S=r("Card"),B=r("Loading"),c=r("Form"),x=r("Layout");return u(),b(x,{breadcrumbs:n.breadcrumbs},{default:g(()=>[o("div",St,[d(S,{noborder:""},{default:g(()=>[o("div",Bt,[o("h6",Pt,p(n.title),1),o("div",Dt,[d(m,{modelValue:n.searchQuery,"onUpdate:modelValue":e[0]||(e[0]=l=>n.searchQuery=l),placeholder:"Search",type:"text",prependIcon:"heroicons-outline:search",merged:""},null,8,["modelValue"]),d(y,{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"})])]),d(k,{styleClass:"vgt-table lesspadding v-middle",columns:n.columns,rows:n.items,mode:"remote",search:!0,"sort-options":{enabled:!0},"pagination-options":{enabled:!0},onSortChange:a.onSortChange,"max-height":"600px"},{"table-row":g(l=>[l.column.field=="firstname"?(u(),f("span",Ot,[e[2]||(e[2]=o("span",{class:"w-8 h-8 rounded-full ltr:mr-3 rtl:ml-3 flex-none"},null,-1)),o("span",Rt,p(l.row.firstname)+" "+p(t.user1),1)])):_("",!0),l.column.field=="mrf.enabled"?(u(),f("div",Mt,[l.row.mrf.enabled?(u(),f("span",$t)):(u(),f("span",At)),o("span",null,p(a.applicantStatus(l.row.mrf.enabled)),1)])):_("",!0),l.column.field=="applicant_count"?(u(),f("div",Ft,[o("div",Lt,[o("div",Tt,p(l.row.applicant_count),1)])])):_("",!0),l.column.field=="action"?(u(),f("span",It,[o("div",jt,[d(v,{placement:"top",arrow:"",theme:"dark"},{button:g(()=>[o("div",{class:"action-btn",onClick:Vt=>a.viewRecord(l.row)},[d(h,{icon:"heroicons:eye"})],8,Ut)]),default:g(()=>[e[3]||(e[3]=o("span",null," View Applicants ",-1))]),_:2},1024)])])):_("",!0)]),"pagination-bottom":g(l=>[o("div",zt,[d(C,{total:n.totalItems,current:n.serverOptions.page,"per-page":n.serverOptions.rowsPerPage,onPageChanged:a.handlePageChange,pageChanged:l.pageChanged,perPageChanged:n.serverOptions.rowsPerPage,enableSelect:"",perPageOptions:n.perPageOptions,onChangePerPage:a.handlePerPageChange},null,8,["total","current","per-page","onPageChanged","pageChanged","perPageChanged","perPageOptions","onChangePerPage"])])]),_:1},8,["columns","rows","onSortChange"])]),_:1}),n.state.isLoading?(u(),b(B,{key:0,text:"Fetching records"})):_("",!0),d(c,{onCloseModal:e[1]||(e[1]=l=>n.state.showModal=!1),ref:"form",onReload:a.fetchRecords},null,8,["onReload"])])]),_:1},8,["breadcrumbs"])}const Fe=P(kt,[["render",Et],["__scopeId","data-v-0c5dfec2"]]);export{Fe as default};
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0.04 |
proxy
|
phpinfo
|
Settings