File manager - Edit - /home/autoph/public_html/projects/ahg-hr/assets/index.0ea46bd5.js
Back
import{_ as L,c as x,w as g,r as l,o as n,d as s,e as h,t as d,b as p,m as v,j as y,F as _,h as k}from"./index.15cec131.js";import{A as w}from"./ApplicantService.cb826c45.js";import{F as A}from"./FileService.ddeef0b3.js";import{L as M,b as z,D as F,P as $}from"./index.b7d49458.js";import{B as j}from"./index.bdcc6190.js";import{C as T}from"./CreateButton.d066970c.js";import{D as V}from"./DeleteButton.2380eae0.js";import{E}from"./EditButton.6d23f725.js";import{F as U}from"./FileButton.31355bca.js";/* empty css */import{V as Y}from"./ViewButton.17af945a.js";import{I as J}from"./index.c6b20525.js";import"./jspdf.es.min.2cbf3bf3.js";/* empty css *//* empty css */import"./vue-cleave.min.64bb37b7.js";import"./array.8551fbb7.js";import{L as N}from"./Loading.311fadfe.js";import"./vue-quill.snow.9de684a5.js";/* empty css */import{I as Q}from"./index.c252b558.js";import{l as W}from"./lodash.50734de5.js";import{P as G}from"./index.2eadc04e.js";import{h as q}from"./meeting-office.7e6e2274.js";import{C as Z}from"./index.5cb8fa8c.js";import"./logo-black.7c15feb3.js";import"./logo-white.b04c5a89.js";import"./transition.2b35576b.js";import"./EmployeeService.402d7e1b.js";import"./es.string.replace.7f4d713f.js";import"./Loading.vue_vue_type_style_index_0_scoped_cbded5a2_lang.c1f77430.js";const H={setup(){},components:{Layout:M,CreateButton:T,Loading:N,InputGroup:Q,EditButton:E,DeleteButton:V,ViewButton:Y,FileButton:U,Button:j,Pagination:G,Card:Z,Icon:J,MenuItem:z,Dropdown:F},data(){return{image1:$,actions:[{name:"On-boarding",icon:"heroicons:check-circle",class:"h-[6px] w-[6px] bg-danger-500 rounded-full inline-block ring-4 ring-opacity-30 ring-danger-500",value:5},{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:"Archive",icon:"heroicons-outline:trash",value:6}],headerImage:q,title:"Job Offer",breadcrumbs:[{text:"Home",href:"/"},{text:"Masterfile",href:"/recruitment/job-offer"},{text:"Job Offer",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},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:W.debounce(function(){this.fetchRecords()},800)},computed:{perPage:function(){return this.serverOptions.rowsPerPage}},methods:{handleChange(e,t){this.form.status=t,t==6?this.deleteRecord(e.id):this.updateStatusRecord(e.id,t)},updateStatusRecord(e,t){console.log(t);let i="";t==1?i="Initial Interview":t==2?i="Techincal Interview":t==3&&(i="Final Interview"),this.$swal.fire({title:"Are you sure?",text:"You want to proceed this application for "+i+"?",icon:"warning",showCancelButton:!0,confirmButtonColor:"#34c38f",cancelButtonColor:"#f46a6a",confirmButtonText:"Yes, proceed it!",background:this.$store.themeSettingsStore.isDark?"#1e293b":"#fff"}).then(a=>{a.value&&(this.form.status=t,w.updateStatus(e,this.form).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(a=>{a.response&&a.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)return"Initial Interview";if(e===2)return"Technical Interview";if(e===3)return"Final Interview";if(e===4)return"Job Offer"},formatDate(e){const t=new Date(e),i=new Date(t.toLocaleString("en-US",{timeZone:"UTC"})),a=new Date(i.toLocaleString("en-US",{timeZone:"Asia/Singapore"})),o=a.getFullYear(),c=String(a.getMonth()+1).padStart(2,"0"),f=String(a.getDate()).padStart(2,"0");return`${o}-${c}-${f}`},async viewAttachment(e){if(this.state.isDownloading)return;this.state.isDownloading=!0;let t=await A.Reader2("applicant",e),i;if(e.endsWith(".pdf"))i="application/pdf";else if(e.endsWith(".png"))i="image/png";else if(e.endsWith(".jpg")||e.endsWith(".jpeg"))i="image/jpeg";else if(e.endsWith(".svg"))i="image/svg+xml";else throw new Error("Unsupported file type");const a=atob(t),o=new Array(a.length);for(let u=0;u<a.length;u++)o[u]=a.charCodeAt(u);const c=new Uint8Array(o),f=new Blob([c],{type:i}),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=>{let t=e.data.data;this.items=t,console.log("www",t),this.items=t.filter(i=>i.status==4).map((i,a)=>({...i,"#":(this.serverOptions.page-1)*this.serverOptions.rowsPerPage+(a+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 archive this record?",icon:"warning",showCancelButton:!0,confirmButtonColor:"#34c38f",cancelButtonColor:"#f46a6a",confirmButtonText:"Yes, archive it!",background:this.$store.themeSettingsStore.isDark?"#1e293b":"#fff"}).then(t=>{t.value&&(this.state.isDeleting=!0,w.remove(e).then(i=>{console.log(i),i.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()}},K={class:"my-5"},X={class:"md:flex pb-6 items-center"},ee={class:"flex-1 md:mb-0 mb-3"},te={class:"md:flex md:space-x-3 items-center flex-none rtl:space-x-reverse my-3 float-right"},se={class:"min-w-full divide-y divide-zinc-200 dark:divide-zinc-700"},ie={class:"bg-white divide-y divide-zinc-200 dark:bg-zinc-900 dark:divide-zinc-700"},oe={class:"p-2"},re={class:"flex items-center top-2"},ae={key:0,class:"h-[6px] w-[6px] bg-danger-500 rounded-full inline-block ring-4 ring-opacity-30 ring-danger-500"},ne={key:1,class:"h-[6px] w-[6px] bg-warning-500 rounded-full inline-block ring-4 ring-opacity-30 ring-warning-500"},le={key:2,class:"h-[6px] w-[6px] bg-primary-500 rounded-full inline-block ring-4 ring-opacity-30 ring-primary-500"},ce={key:3,class:"h-[6px] w-[6px] bg-success-500 rounded-full inline-block ring-4 ring-opacity-30 ring-success-500"},de={class:"p-2"},pe={class:"text-xl"};function ue(e,t,i,a,o,c){const f=l("InputGroup"),b=l("Button"),u=l("FileButton"),D=l("Icon"),S=l("MenuItem"),C=l("Dropdown"),I=l("Card"),O=l("Loading"),P=l("Layout");return n(),x(P,{breadcrumbs:o.breadcrumbs},{default:g(()=>[s("div",K,[h(I,{noborder:""},{default:g(()=>[s("div",X,[s("h6",ee,d(o.title),1),s("div",te,[h(f,{modelValue:o.searchQuery,"onUpdate:modelValue":t[0]||(t[0]=r=>o.searchQuery=r),placeholder:"Search",type:"text",prependIcon:"heroicons-outline:search",merged:""},null,8,["modelValue"]),h(b,{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",se,[t[1]||(t[1]=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"},"Job Offer Date"),s("th",{class:"px-6 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider"},"Resume/CV"),s("th",{class:"px-6 py-3 text-left text-xs font-medium text-zinc-500 uppercase tracking-wider"},"Actions")])],-1)),s("tbody",ie,[(n(!0),p(_,null,v(o.items,(r,B)=>(n(),p("tr",{key:r.id},[s("td",oe,d(B+1),1),s("td",null,d(r.firstname)+" "+d(r.lastname),1),s("td",null,d(r.job?r.job.jobtitle?r.job.jobtitle.name:"Job Title Not Available":"Item Not Available"),1),s("td",re,[r.status==1||r.status==0?(n(),p("span",ae)):y("",!0),r.status==2?(n(),p("span",ne)):y("",!0),r.status==3?(n(),p("span",le)):y("",!0),r.status==4?(n(),p("span",ce)):y("",!0),s("span",de,d(c.applicantStatus(r.status)),1)]),s("td",null,d(c.formatDate(r.offered_date)),1),s("td",null,[h(u,{title:"Download Attachment",onClick:m=>c.viewAttachment(r.resume)},null,8,["onClick"])]),s("td",null,[h(C,{classMenuItems:"w-[140px] z-0"},{menus:g(()=>[(n(!0),p(_,null,v(o.actions,(m,R)=>(n(),x(S,{key:R,onClick:he=>c.handleChange(r,m.value)},{default:g(()=>[s("div",{class:k([m.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(m.class)},null,2),s("span",null,d(m.name),1)],2)]),_:2},1032,["onClick"]))),128))]),default:g(()=>[s("span",pe,[h(D,{icon:"heroicons-outline:dots-vertical"})])]),_:2},1024)])]))),128))])])]),_:1}),o.state.isLoading?(n(),x(O,{key:0,text:"Fetching records"})):y("",!0)])]),_:1},8,["breadcrumbs"])}const Ne=L(H,[["render",ue],["__scopeId","data-v-6a6c19cd"]]);export{Ne as default};
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0.09 |
proxy
|
phpinfo
|
Settings