File manager - Edit - /home/autoph/public_html/projects/ahg-hr/assets/index.6a2bc3c7.js
Back
import{H as V}from"./HelperService.abd89797.js";import{a as v,_ as L,r as i,o as c,c as g,w as p,j as h,d as l,k as q,e as s,b,t as R,f as W,h as H}from"./index.15cec131.js";import{w as K,L as J}from"./index.b7d49458.js";import{L as D}from"./Loading.311fadfe.js";import{l as X}from"./lodash.50734de5.js";import{B as M}from"./index.bdcc6190.js";import{C as Z}from"./CreateButton.d066970c.js";import{D as ee}from"./DeleteButton.2380eae0.js";import{E as te}from"./EditButton.6d23f725.js";/* empty css */import{I}from"./index.c6b20525.js";import"./jspdf.es.min.2cbf3bf3.js";/* empty css *//* empty css */import"./vue-cleave.min.64bb37b7.js";import{c as oe,a as P,V as se}from"./array.8551fbb7.js";import"./vue-quill.snow.9de684a5.js";/* empty css */import{I as ie}from"./index.c252b558.js";import{P as re}from"./index.2eadc04e.js";import{F as T}from"./index.a76a1867.js";import{F as A}from"./index.87425b49.js";import{T as U}from"./index.1cc0a20b.js";import{T as G}from"./index.d6cd085f.js";import{C as z}from"./CloseButton.6961055e.js";import{S as Y}from"./SubmitButton.f654365f.js";import{U as j}from"./UpdateButton.07cc80b7.js";import{E as ne}from"./EmployeeService.402d7e1b.js";import{P as ae}from"./PayrollItemsService.c89c1bf4.js";import{M as N}from"./Multiselect.a8e1703e.js";import{F as $}from"./index.03e5c851.js";import{F as Q}from"./index.cd54b5fb.js";import{p as le,j as ce}from"./scr-1.d9aaecca.js";import{C as de}from"./index.5cb8fa8c.js";import{A as me}from"./ActionCellRenderer.d906592c.js";import{F as ue}from"./FileService.ddeef0b3.js";import{A as pe}from"./main.esm.6f68e095.js";import"./logo-black.7c15feb3.js";import"./logo-white.b04c5a89.js";import"./transition.2b35576b.js";import"./es.string.replace.7f4d713f.js";import"./Loading.vue_vue_type_style_index_0_scoped_cbded5a2_lang.c1f77430.js";import"./index.59b1a56c.js";import"./index.a1e4de31.js";import"./ViewButton.17af945a.js";const k="https://staging-ahg-hr-api.autohub.ph/api/v1/payment-contribution",fe="https://staging-ahg-hr-api.autohub.ph/api/v1/get-employee-loans",he="https://staging-ahg-hr-api.autohub.ph/api/v1/employee-contribution-activation",w={fetchRecords(e={}){return v.get(`${k}`,{params:e})},fetchRecord(e){return v.get(`${k}/${e}`)},fetchEmployeeLoan(e={}){return v.get(`${fe}`,{params:e})},async create(e){return v.post(`${k}`,e)},async update(e,t){return v.put(`${k}/${e}`,t)},async remove(e){return v.delete(`${k}/${e}`)},async activate(e,t){return v.put(`${he}/${e}`,t)}},ge={components:{FileType:Q,Fileinput:$,FormModal:A,FormGroup:T,TextInput:G,TextArea:U,SubmitButton:Y,UpdateButton:j,CloseButton:z,Loading:D,Multiselect:N},data(){return{frequencyOptions:[{value:"1",label:"1st Cutoff"},{value:"2",label:"2nd Cutoff"},{value:"3",label:"Every Cutoff"}],employeeOptions:"",payrollItemsOptions:"",form:{employee_id:"",contribution_id:"",amount:"",frequency:"",term:"",monthly:"",balance:"",effectivity_date:"",attachment:"",remarks:"",paused:""},errors:{},state:{isEdit:!1,isSaving:!1,isLoading:!1,isEmployeeLoading:!1,isLoadingContributionType:!1},fileIcons:{pdf:le,jpg:ce,default:""},datePickerConfig:{allowInput:!0,dateFormat:"Y-m-d"}}},methods:{async fetchEmployee(){this.state.isEmployeeLoading=!0,await ne.fetchAllEmployeePayrollAccessRecords({dealership_id:this.$store.userSettings.activeDealership}).then(e=>{e.status==200&&(this.employeeOptions=e.data.map(t=>({value:t.employee_id,label:t.employee_id+" - "+t.firstname+" "+t.lastname})))}).catch(e=>{console.log(e)}),this.state.isEmployeeLoading=!1},async fetchPayrollItemsType(){this.state.isLoadingContributionType=!0,await ae.fetchRecords().then(e=>{e.status==200&&(this.payrollItemsOptions=e.data.data.filter(t=>t.tag=="contribution").map(t=>({value:t.id,label:t.name})))}).catch(e=>{console.log(e)}),this.state.isLoadingContributionType=!1},loadRecord(e){this.resetForm(),this.state.isEdit=!0,this.form=e},closeModal(){this.state.showModal=!1},resetForm(){this.state.isEdit=!1,this.form={employee_id:"",contribution_id:"",amount:"",frequency:"",term:"",monthly:"",balance:"",effectivity_date:"",attachment:"",remarks:"",paused:""}},reload(){this.$emit("reload")},async saveRecord(){if(this.state.isSaving=!0,this.state.isEdit){const e=this.form.id;await w.update(e,this.form).then(t=>{t.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(t=>{console.log(t),t.response.status==422?this.$swal.fire({title:"Ooops! something is wrong.",text:t.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()})}else{this.state.isSaving=!1;let e=new FormData;Object.keys(this.form).forEach(t=>{e.append(t,this.form[t])}),await w.create(e).then(t=>{t.status==201&&(this.$swal.fire({title:"Great!",text:"Record successfully saved.",icon:"success",timer:2e3}),this.state.showModal=!1,this.resetForm(),this.reload())}).catch(t=>{console.log(t),t.response.status==422?this.$swal.fire({title:"Ooops! something is wrong.",text:t.response.data.message,icon:"warning"}):this.$swal.fire({title:"Ooops! something is wrong.",text:"Please contact system administrator",icon:"error",timer:2e3})})}},async submitForm(){try{await oe().shape({employee_id:P().required("Employee field is required"),contribution_id:P().required("Contribution field is required"),amount:P().required("Amount field is required"),frequency:P().required("Frequency field is required"),effectivity_date:P().required("Effectivity Date field is required")}).validate(this.form,{abortEarly:!1}),this.$swal.fire({title:"Are you sure you want to save this record?",text:"",icon:"question",showCancelButton:!0,confirmButtonColor:"#34c38f",cancelButtonColor:"#f46a6a",confirmButtonText:"Yes",cancelButtonText:"No"}).then(t=>{t.value&&this.saveRecord()})}catch(e){if(e instanceof se){const t={};e.inner.forEach(r=>{t[r.path]=r.message}),this.errors=t}this.state.isSaving=!1}},calculateMonthly(){this.form.monthly=(this.form.amount/this.form.term).toFixed(2),this.form.balance=this.form.amount}},watch:{},mounted(){this.fetchPayrollItemsType(),this.fetchEmployee()}},ye={class:"text-slate-600 dark:text-slate-400 text-sm font-normal"},be={class:"relative"},ve={key:0,class:"text-[#ec4899]"},_e={class:"relative"},we={key:0,class:"text-[#ec4899]"},xe={class:"grid grid-cols-2 gap-2"},Ce={class:"relative"},Pe={key:0,class:"text-[#ec4899]"},ke={class:"grid grid-cols-2 gap-2"},Re={key:0,class:"text-[#ec4899]"},Ee={class:"flex gap-1 justify-end"};function Se(e,t,r,d,o,n){const y=i("Loading"),f=i("Multiselect"),u=i("FormGroup"),_=i("TextInput"),x=i("flat-pickr"),C=i("TextArea"),E=i("SubmitButton"),S=i("UpdateButton"),B=i("CloseButton"),O=i("FormModal");return c(),g(O,{title:o.state.isEdit?"Edit Contribution Record":"Create Contribution Record",active:o.state.showModal,onSubmit:e.confirmSubmit,onClose:n.closeModal,themeClass:o.state.isEdit?"bg-primary-600":"bg-gray-800",sizeClass:"lg:w-2/4"},{default:p(()=>[o.state.isEdit&&o.state.isLoading?(c(),g(y,{key:0,text:"Fetching record"})):h("",!0),l("div",ye,[l("form",{onSubmit:t[7]||(t[7]=q((...m)=>e.confirmSubmit&&e.confirmSubmit(...m),["prevent"])),class:"space-y-4"},[o.state.isSaving?(c(),g(y,{key:0,text:"Saving record"})):h("",!0),s(u,{label:"Employee",isRequired:!0},{default:p(()=>[l("div",be,[s(f,{modelValue:o.form.employee_id,"onUpdate:modelValue":t[0]||(t[0]=m=>o.form.employee_id=m),"close-on-select":!0,searchable:!0,id:"employee_id",class:"h-[48px]",loading:o.state.isEmployeeLoading,options:o.employeeOptions},null,8,["modelValue","loading","options"])]),o.errors.employee_id?(c(),b("div",ve,"Employee field is required")):h("",!0)]),_:1}),s(u,{label:"Contribution Type",isRequired:!0},{default:p(()=>[l("div",_e,[s(f,{modelValue:o.form.contribution_id,"onUpdate:modelValue":t[1]||(t[1]=m=>o.form.contribution_id=m),"close-on-select":!0,searchable:!0,id:"contribution_id",class:"h-[48px]",loading:o.state.isLoadingContributionType,options:o.payrollItemsOptions},null,8,["modelValue","loading","options"])]),o.errors.contribution_id?(c(),b("div",we,"Contribution Type field is required")):h("",!0)]),_:1}),l("div",xe,[s(u,{label:"Amount",isRequired:!0},{default:p(()=>[s(_,{type:"text",placeholder:"Input amount",modelValue:o.form.amount,"onUpdate:modelValue":t[2]||(t[2]=m=>o.form.amount=m),error:o.errors.amount,classInput:"h-[48px]"},null,8,["modelValue","error"])]),_:1}),s(u,{label:"Frequency",isRequired:!0},{default:p(()=>[l("div",Ce,[s(f,{modelValue:o.form.frequency,"onUpdate:modelValue":t[3]||(t[3]=m=>o.form.frequency=m),"close-on-select":!0,searchable:!0,id:"frequency",class:"h-[48px]",options:o.frequencyOptions},null,8,["modelValue","options"])]),o.errors.frequency?(c(),b("div",Pe,"Frequency field is required")):h("",!0)]),_:1})]),l("div",ke,[s(u,{label:"Total Credits"},{default:p(()=>[s(_,{type:"text",placeholder:"Input balance ",modelValue:o.form.credit,"onUpdate:modelValue":t[4]||(t[4]=m=>o.form.credit=m),error:o.errors.credit,classInput:"h-[48px]"},null,8,["modelValue","error"])]),_:1}),s(u,{label:"Effectivity Date",isRequired:!0},{default:p(()=>[s(x,{modelValue:o.form.effectivity_date,"onUpdate:modelValue":t[5]||(t[5]=m=>o.form.effectivity_date=m),class:"form-control h-[48px]",config:o.datePickerConfig,placeholder:"YYYY-MM-DD"},null,8,["modelValue","config"]),o.errors.effectivity_date?(c(),b("div",Re,"Effectivity Date field is required")):h("",!0)]),_:1})]),s(u,{label:"Remarks"},{default:p(()=>[s(C,{modelValue:o.form.remarks,"onUpdate:modelValue":t[6]||(t[6]=m=>o.form.remarks=m),error:o.errors.remarks,rows:"2",placeholder:"Enter text here",classInput:"w-full"},null,8,["modelValue","error"])]),_:1}),l("div",Ee,[o.state.isEdit?(c(),g(S,{key:1,onClick:n.submitForm},null,8,["onClick"])):(c(),g(E,{key:0,onClick:n.submitForm},null,8,["onClick"])),s(B,{onClick:n.closeModal},null,8,["onClick"])])],32)])]),_:1},8,["title","active","onSubmit","onClose","themeClass"])}const Be=L(ge,[["render",Se]]),Oe={components:{Icon:I,ActionCellRenderer:me,AgGridVue:pe,FileType:Q,Fileinput:$,FormModal:A,FormGroup:T,TextInput:G,TextArea:U,Button:M,SubmitButton:Y,UpdateButton:j,CloseButton:z,Loading:D,Multiselect:N},data(){return{paginationPageSize:10,paginationPageSizeSelector:[10,25,50],colDefs:[{field:"#",flex:1},{field:"amount",filter:!0,floatingFilter:!0,flex:2},{field:"date paid",filter:!0,floatingFilter:!0,flex:2}],loans:[],paymentName:"",attachment:"",state:{isEdit:!1,isSaving:!1,isLoading:!1}}},methods:{async viewAttachment(e){if(this.state.isDownloading)return;this.state.isDownloading=!0;let t=await ue.Reader2("employee-loans",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 d=atob(t),o=new Array(d.length);for(let u=0;u<d.length;u++)o[u]=d.charCodeAt(u);const n=new Uint8Array(o),y=new Blob([n],{type:r}),f=URL.createObjectURL(y);window.open(f),this.state.isLoadingPDF=!1},onGridReady(e){this.gridApi=e.api},exportToCsv(){this.gridApi?this.gridApi.exportDataAsCsv({onlySelected:!1,columnKeys:this.colDefs.filter(e=>e.field!=="actions").map(e=>e.field)}):console.error("Grid API is not ready.")},async loadRecord(e,t){this.state.isLoading=!0,console.log("loan",this.state.isLoading),this.loans=[],this.paymentName=t,await w.fetchRecord(e).then(r=>{this.loans=r.data.map((d,o)=>({...d,"#":o+1,amount:V.formatNumber(d.amount),"date paid":d.date_contributed?this.$formatDate(d.date_contributed):"Not Yet Paid"}))}),this.state.isLoading=!1,console.log("loan",this.state.isLoading)},closeModal(){this.state.showModal=!1},resetForm(){this.state.isEdit=!1,this.form={employee_id:"",loan_id:"",amount:"",frequency:"",term:"",monthly:"",balance:"",effectivity_date:"",attachment:"",remarks:"",paused:""}},reload(){this.$emit("reload")}},mounted(){}},Fe={class:"text-slate-600 dark:text-slate-400 text-sm font-normal"},Ve={class:"ag-grid-toolbar flex items-center justify-between px-4 py-2 bg-gray-100 border-t rounded-t-xl border-gray-200"},Le={class:"flex items-center justify-center gap-4 text-gray-900 text-lg font-bold"},qe={class:"flex items-center gap-4"},De={class:"relative z-10 flex items-center transition-colors duration-300 group-hover:text-white"};function Me(e,t,r,d,o,n){const y=i("Loading"),f=i("Icon"),u=i("Button"),_=i("ag-grid-vue"),x=i("FormModal");return c(),g(x,{title:"Payment Contribution History",active:o.state.showModal,onSubmit:e.confirmSubmit,onClose:n.closeModal,themeClass:"bg-gray-800",sizeClass:"lg:w-3/4"},{default:p(()=>[o.state.isLoading?(c(),g(y,{key:0,text:"Fetching record"})):h("",!0),l("div",Fe,[l("form",{onSubmit:t[0]||(t[0]=q((...C)=>e.confirmSubmit&&e.confirmSubmit(...C),["prevent"])),class:""},[l("div",Ve,[l("div",Le,R(o.paymentName),1),l("div",qe,[s(u,{icon:"mdi:microsoft-excel",text:"Export to CSV",btnClass:"relative overflow-hidden font-normal px-4 py-2 rounded-lg shadow-md bg-white text-gray-900 border group transition-colors duration-300 group-hover:border-green-500",iconClass:"text-2xl",onClick:n.exportToCsv},{default:p(()=>[t[2]||(t[2]=l("span",{class:"absolute inset-0 bg-green-500 transition-transform duration-300 transform -translate-x-full group-hover:translate-x-0"},null,-1)),l("span",De,[s(f,{icon:"mdi:microsoft-excel",class:"text-2xl mr-2"}),t[1]||(t[1]=W(" Export to CSV "))])]),_:1},8,["onClick"])])]),s(_,{ref:"agGrid",rowData:o.loans,columnDefs:o.colDefs,style:{height:"500px"},class:"ag-theme-quartz",pagination:!0,paginationPageSize:o.paginationPageSize,paginationPageSizeSelector:o.paginationPageSizeSelector,onGridReady:n.onGridReady},null,8,["rowData","columnDefs","paginationPageSize","paginationPageSizeSelector","onGridReady"])],32)])]),_:1},8,["active","onSubmit","onClose"])}const Ie=L(Oe,[["render",Me]]),Te={mixins:[K],components:{View:Ie,Layout:J,CreateButton:Z,DeleteButton:ee,InputGroup:ie,Loading:D,EditButton:te,Pagination:re,Form:Be,Card:de,Icon:I,Button:M},setup(){},data(){return{title:"Employee Payment Contributions",breadcrumbs:[{text:"Home",href:"/"},{text:"Employee Management",href:"/employee-payment-contribution"},{text:"Employee Payment Contributions",active:!0}],columns:[{label:"#",field:"#"},{label:"Employee ID",field:"employee_id"},{label:"Name",field:"fullname"},{label:"Contribution Type",field:"payroll_item.name"},{label:"Amount",field:"amount",formatFn:e=>V.formatNumber(e)},{label:"Credit",field:"credit",formatFn:e=>V.formatNumber(e)},{label:"Paused",field:"paused"},{label:"Action",field:"action"}],perPageOptions:[{value:"10",label:"10"},{value:"50",label:"50"},{value:"100",label:"100"}],items:[],totalItems:0,searchQuery:null,serverOptions:{page:1,rowsPerPage:10,sortBy:"created_at",sortType:"asc"},state:{isLoading:!1,isEdit:!1,isDeleting:!1}}},watch:{serverOptions:{handler(){console.log(`perPage: ${this.serverOptions.rowsPerPage}`),this.fetchRecords()},deep:!0},searchQuery:X.debounce(function(){this.fetchRecords()},800)},computed:{perPage:function(){return this.serverOptions.rowsPerPage}},methods:{onRowClick(e){this.viewPayment(e.row.id,e.row.payroll_item.name),console.log("clicked",e.row.id,e.row)},viewPayment(e,t){this.$refs.view.loadRecord(e,t),this.$refs.view.state.showModal=!0},async reloadRecords(){await this.fetchRecords()},async fetchRecords(){this.state.isLoading=!0,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("response");let t=e.data.data;console.log(t),this.items=t,this.items=t.map((r,d)=>({...r,"#":(this.serverOptions.page-1)*this.serverOptions.rowsPerPage+(d+1)})),this.totalItems=e.data.total}).finally(()=>{this.state.isLoading=!1})},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 activateContribution(e,t){this.$swal.fire({title:"Are you sure?",text:"You want to "+t+" this record?",icon:"warning",showCancelButton:!0,confirmButtonColor:"#34c38f",cancelButtonColor:"#f46a6a",confirmButtonText:"Yes, "+t+" it!",background:this.$store.themeSettingsStore.isDark?"#1e293b":"#fff",html:t=="pause"?` <label>Date to be resume? </label> <input id="swal-input" type="date" style="width: 70%; padding: 8px; border: 1px solid #ced4da; border-radius: 4px;" placeholder="Enter Date"></input>`:"",preConfirm:()=>{if(t=="pause"){const r=document.getElementById("swal-input").value;return r?this.to_resume_date=r:(this.$swal.showValidationMessage("The date resume field is required"),!1)}}}).then(r=>{if(r.value)try{w.activate(e,{formType:t,to_resume_date:this.to_resume_date}).then(d=>{d.status==200&&this.$swal.fire({title:"Yaaay!",text:"Record has been deleted successfully.",type:"success",icon:"success",timer:2e3}),this.reloadRecords()})}catch(d){console.log(d)}}).catch(r=>{r.response&&r.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})},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=>{console.log(t.value),t.value&&(this.state.isDeleting=!0,w.remove(e).then(r=>{r.status==200&&this.$swal.fire({title:"Yaaay!",text:"Record has been deleted successfully.",type:"success",icon:"success",timer:2e3}),this.reloadRecords()}))}).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})},createRecord(){this.$refs.form.resetForm(),this.$refs.form.state.showModal=!0},editRecord(e){this.$refs.form.resetForm(),this.$refs.form.loadRecord(e),this.$refs.form.state.showModal=!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}},mounted(){this.fetchRecords()}},Ae={class:"my-5"},Ue={class:"md:flex pb-6 items-center"},Ge={class:"flex-1 md:mb-0 mb-3"},ze={key:0,class:"flex gap-1"},Ye={key:1,class:"flex gap-1"},je={key:2,class:"flex gap-1 capitalize"},Ne={key:3,class:"flex items-center gap-1"},$e={class:"py-4 flex justify-end"};function Qe(e,t,r,d,o,n){const y=i("InputGroup"),f=i("Button"),u=i("EditButton"),_=i("DeleteButton"),x=i("Pagination"),C=i("vue-good-table"),E=i("Card"),S=i("Loading"),B=i("Form"),O=i("View"),m=i("Layout");return c(),g(m,{breadcrumbs:o.breadcrumbs},{default:p(()=>[l("div",Ae,[s(E,{noborder:""},{default:p(()=>[l("div",Ue,[l("h6",Ge,R(o.title),1),l("div",{class:H(["md:flex md:space-x-3 items-center flex-none rtl:space-x-reverse my-3 float-right",e.window.width<768?"space-x-rb":""])},[s(y,{modelValue:o.searchQuery,"onUpdate:modelValue":t[0]||(t[0]=a=>o.searchQuery=a),placeholder:"Search",type:"text",prependIcon:"heroicons-outline:search",merged:""},null,8,["modelValue"]),s(f,{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(f,{icon:"heroicons-outline:plus-sm",text:"Add Record",btnClass:" btn-dark font-normal btn-sm ",iconClass:"text-lg",onClick:t[1]||(t[1]=a=>n.createRecord())})],2)]),s(C,{styleClass:"vgt-table lesspadding v-middle",columns:o.columns,rows:o.items,mode:"remote",search:!0,"sort-options":{enabled:!0},"pagination-options":{enabled:!0},onSortChange:n.onSortChange,"max-height":"600px",onRowClick:n.onRowClick,rowStyleClass:"cursor-pointer hover:bg-gray-100"},{"table-row":p(a=>[a.column.field=="paused"?(c(),b("div",ze,R(a.row.paused?"Yes":"No"),1)):h("",!0),a.column.field=="fullname"?(c(),b("div",Ye,R(a.row.employee.firstname+" "+a.row.employee.lastname),1)):h("",!0),a.column.field=="payroll_item.name"?(c(),b("div",je,R(a.row.payroll_item.name),1)):h("",!0),a.column.field=="action"?(c(),b("div",Ne,[a.row.paused?(c(),g(f,{key:1,btnClass:"text-warning-500 hover:text-warning-700 py-2 px-1",icon:"ic:twotone-play-circle-filled-white",iconClass:"text-2xl",onClick:F=>n.activateContribution(a.row.id,"resume")},null,8,["onClick"])):(c(),g(f,{key:0,btnClass:"text-warning-500 hover:text-warning-700 py-2 px-1",icon:"ic:twotone-pause-circle-filled",iconClass:"text-2xl",onClick:F=>n.activateContribution(a.row.id,"pause")},null,8,["onClick"])),s(u,{onClick:q(F=>n.editRecord(a.row),["stop"])},null,8,["onClick"]),s(_,{onClick:F=>n.deleteRecord(a.row.id)},null,8,["onClick"])])):h("",!0)]),"pagination-bottom":p(a=>[l("div",$e,[s(x,{total:o.totalItems,current:o.serverOptions.page,"per-page":o.serverOptions.rowsPerPage,onPageChanged:n.handlePageChange,pageChanged:a.pageChanged,perPageChanged:o.serverOptions.rowsPerPage,enableSelect:"",perPageOptions:o.perPageOptions,onChangePerPage:n.handlePerPageChange},null,8,["total","current","per-page","onPageChanged","pageChanged","perPageChanged","perPageOptions","onChangePerPage"])])]),_:1},8,["columns","rows","onSortChange","onRowClick"])]),_:1}),o.state.isLoading?(c(),g(S,{key:0,text:"Fetching records"})):h("",!0),s(B,{onCloseModal:t[2]||(t[2]=a=>o.state.showModal=!1),ref:"form",onReload:n.fetchRecords},null,8,["onReload"]),s(O,{onCloseModal:t[3]||(t[3]=a=>o.state.showModal=!1),ref:"view"},null,512)])]),_:1},8,["breadcrumbs"])}const At=L(Te,[["render",Qe]]);export{At as default};
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings