major update

This commit is contained in:
2024-10-17 17:01:42 -04:00
parent 9029993c49
commit c6f806f733
41 changed files with 899 additions and 254 deletions

View File

@@ -0,0 +1,106 @@
<template>
<Header />
<div class="flex">
<div class="">
<SideBar />
</div>
<div class=" w-full px-10 ">
<div class="text-sm breadcrumbs mb-10">
<ul>
<li>
<router-link :to="{ name: 'home' }">
Home
</router-link>
</li>
<li>
<router-link :to="{ name: 'employee' }">
employees
</router-link>
</li>
</ul>
</div>
<div class="flex start pb-10 text-2xl">Profit for Year </div>
<div class="col-span-12 font-bold ">
Profit Year
</div>
<div class="col-span-12 mb-5 text-sm text-gray-500">
{{ profit_year }}
</div>
</div>
</div>
<Footer />
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import axios from 'axios'
import authHeader from '../../services/auth.header'
import Header from '../../layouts/headers/headerauth.vue'
import SideBar from '../../layouts/sidebar/sidebar.vue'
import Footer from '../../layouts/footers/footer.vue'
export default defineComponent({
name: 'MoneyYear',
components: {
Header,
SideBar,
Footer,
},
data() {
return {
token: null,
user: null,
employees: [],
profit_year: 0,
}
},
created() {
this.userStatus()
},
mounted() {
this.get_profit_year()
},
methods: {
userStatus() {
let path = import.meta.env.VITE_BASE_URL + '/auth/whoami';
axios({
method: 'get',
url: path,
withCredentials: true,
headers: authHeader(),
})
.then((response: any) => {
if (response.data.ok) {
this.user = response.data.user;
}
})
.catch(() => {
this.user = null
})
},
get_profit_year() {
let path = import.meta.env.VITE_BASE_URL + '/money/profit/year';
axios({
method: 'get',
url: path,
headers: authHeader(),
}).then((response: any) => {
this.profit_year = response.data.total
})
},
},
})
</script>
<style scoped></style>