dasborad เลื่อนค่าจ้างลูกจ้างประจำ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-03-27 17:58:48 +07:00
parent 1e25bfc4b6
commit 4c3d5c8fb8
5 changed files with 119 additions and 70 deletions

View file

@ -71,6 +71,8 @@ export default {
salaryListPeriodProfileByIdEmp: (id: string) => salaryListPeriodProfileByIdEmp: (id: string) =>
`${salaryPeriodEmp}/profile/${id}`, `${salaryPeriodEmp}/profile/${id}`,
salaryDashboardEmp: `${salaryPeriodEmp}/summary/all`,
salaryPeriodStatusEmp: (type: string, periodId: string, rootId: string) => salaryPeriodStatusEmp: (type: string, periodId: string, rootId: string) =>
`${salaryPeriodEmp}/${type}/approve/${periodId}/${rootId}`, `${salaryPeriodEmp}/${type}/approve/${periodId}/${rootId}`,
salaryPeriodStatusCommentEmp: ( salaryPeriodStatusCommentEmp: (

View file

@ -1,10 +1,24 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch, onMounted, reactive, computed } from "vue"; import { ref, onMounted, watch, computed } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore"; import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore";
import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar();
const store = useSalaryEmployeeListSDataStore(); const store = useSalaryEmployeeListSDataStore();
const { messageError, showLoader, hideLoader } = useCounterMixin();
const props = defineProps({
year: Number,
snapShot: String,
roundFilter: Object,
});
/** itemsCard*/ /** itemsCard*/
const itemsCardAPR = ref([ const itemsCardAPR = ref([
@ -255,22 +269,49 @@ const visibleColumns = ref<string[]>(
: [] : []
); );
const isLoad = ref<boolean>(true); function fetchDataDashboard() {
watch( const formData = {
() => store.roundMainCode, year: props?.year,
() => { group: "",
isLoad.value = false; period: props?.roundFilter?.id,
setTimeout(() => { snapshot: props?.snapShot,
isLoad.value = true; };
}, 200); http
.post(config.API.salaryDashboardEmp, formData)
.then((res) => {
const quota = res.data.result.dashboard;
itemsCardAPR.value[0].total = quota.total;
itemsCardAPR.value[1].total = quota.fifteenPercent;
itemsCardAPR.value[2].total = quota.chosen;
itemsCardAPR.value[3].total = quota.remaining;
itemsCardAPR.value[4].total = quota.totalBackup;
itemsCardOCT.value[0].total = quota.currentAmount;
itemsCardOCT.value[1].total = quota.sixPercentAmount;
itemsCardOCT.value[2].total = quota.spentAmount;
itemsCardOCT.value[3].total = quota.sixPercentSpentAmount;
itemsCardOCT.value[4].total = quota.useAmount;
itemsCardOCT.value[5].total = quota.remainingAmount;
itemsCardOCT.value[6].total = quota.totalBackup;
rows.value = res.data.result.salaryOrg;
})
.catch((err) => {
messageError($q, err);
});
} }
); onMounted(() => {
fetchDataDashboard();
});
watch([() => props?.snapShot, () => props.roundFilter], () => {
fetchDataDashboard();
});
</script> </script>
<template> <template>
<!-- Card โควต --> <!-- Card โควต -->
<div v-if="isLoad">
<div class="row col-12 q-pa-md bg-grey-2"> <div class="row col-12 q-pa-md bg-grey-2">
<div class="row col-12 q-col-gutter-sm"> <div class="row col-12 q-col-gutter-sm">
<div <div
@ -350,7 +391,6 @@ watch(
</template> </template>
</d-table> </d-table>
</div> </div>
</div>
</template> </template>
<style scoped></style> <style scoped></style>

View file

@ -137,9 +137,11 @@ function fetchListPerson() {
* @param data อมลคนทเพ * @param data อมลคนทเพ
*/ */
function onClickAddPerson(data: DataPerson) { function onClickAddPerson(data: DataPerson) {
data.rank = undefined;
const body: DataPersonReq = { const body: DataPersonReq = {
id: store.groupId, id: store.groupId,
type: store.tabType, type: store.tabType,
...data, ...data,
}; };

View file

@ -74,6 +74,7 @@ interface DataPerson {
prefix: string; prefix: string;
root: string; root: string;
rootId: string; rootId: string;
rank: string | undefined;
} }
interface DataPeriod { interface DataPeriod {

View file

@ -437,7 +437,11 @@ onMounted(() => {
</q-card> </q-card>
</div> </div>
<div v-else> <div v-else>
<PageDashBoard /> <PageDashBoard
:year="year"
:snapShot="snapFilter"
:roundFilter="roundFilter"
/>
</div> </div>
</q-card> </q-card>