diff --git a/src/modules/13_salary/components/SalaryLists/Dashboard.vue b/src/modules/13_salary/components/SalaryLists/Dashboard.vue index 7da38e319..63b71215f 100644 --- a/src/modules/13_salary/components/SalaryLists/Dashboard.vue +++ b/src/modules/13_salary/components/SalaryLists/Dashboard.vue @@ -4,15 +4,24 @@ import { useQuasar } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; +/** importType*/ import type { QTableProps } from "quasar"; +import type { + DataOption, + ItemsCards, +} from "@/modules/13_salary/interface/index/Main"; +import type { ResSalaryOrg } from "@/modules/13_salary/interface/response/SalaryList"; +/** importStore*/ import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore"; import { useCounterMixin } from "@/stores/mixin"; +/** use*/ const $q = useQuasar(); const store = useSalaryListSDataStore(); const { messageError, showLoader, hideLoader } = useCounterMixin(); +/** props*/ const props = defineProps({ year: Number, snapShot: String, @@ -20,111 +29,110 @@ const props = defineProps({ }); const gruup = ref(""); -const options = ref([ +const options = ref([ { id: "", name: "ทั้งหมด" }, { id: "GROUP1", name: "กลุ่ม 1" }, { id: "GROUP2", name: "กลุ่ม 2" }, ]); /** itemsCard*/ -const itemsCardAPR = ref([ +const itemsCardAPR = ref([ { - lable: "จำนวนคนทั้งหมด", + label: "จำนวนคนทั้งหมด", name: "group1", color: "secondary", total: 0, }, { - lable: "15% ของจำนวนคน", + label: "15% ของจำนวนคน", name: "group2", color: "light-blue-4", total: 0, }, { - lable: "เลือกไปแล้ว", + label: "เลือกไปแล้ว", name: "group2", color: "primary", total: 0, }, { - lable: "คงเหลือโควตา", + label: "คงเหลือโควตา", name: "group2", color: "indigo-6", total: 0, }, { - lable: "สำรอง", + label: "สำรอง", name: "group2", color: "red-6", total: 0, }, ]); -const itemsCardOCT = ref([ +const itemsCardOCT = ref([ { - lable: "จำนวนเงินคนครองปัจจุบัน", + label: "จำนวนเงินคนครองปัจจุบัน", name: "group1", color: "secondary", total: 0, }, { - lable: "วงเงิน 6%", + label: "วงเงิน 6%", name: "group2", color: "light-blue-4", total: 0, }, { - lable: "ยอดเงินที่ใช้ไป", + label: "ยอดเงินที่ใช้ไป", name: "group2", color: "primary", total: 0, }, { - lable: "วงเงิน 6%-ยอดเงินที่ใช้ไป", + label: "วงเงิน 6%-ยอดเงินที่ใช้ไป", name: "group2", color: "indigo-6", total: 0, }, { - lable: "ใช้ไปเท่าไหร่", + label: "ใช้ไปเท่าไหร่", name: "group2", color: "blue-6", total: 0, }, { - lable: "เหลือเท่าไหร่", + label: "เหลือเท่าไหร่", name: "group2", color: "green-6", total: 0, }, { - lable: "สำรอง", + label: "สำรอง", name: "group2", color: "red-6", total: 0, }, ]); -const itemsCardSpeciel = ref([ +const itemsCardSpeciel = ref([ { - lable: "จำนวนคนทั้งหมด", + label: "จำนวนคนทั้งหมด", name: "group1", color: "secondary", total: 0, }, { - lable: "เลือกไปแล้ว", + label: "เลือกไปแล้ว", name: "group2", color: "primary", total: 0, }, { - lable: "สำรอง", + label: "สำรอง", name: "group2", color: "red-6", total: 0, }, ]); - const itemsCard = computed(() => { const items = store.roundMainCode === "APR" @@ -135,7 +143,8 @@ const itemsCard = computed(() => { return items; }); -const rows = ref([]); +/** ข้อมูล Table*/ +const rows = ref([]); const columnsAPR = ref([ { name: "org", @@ -351,7 +360,6 @@ const columnsSpeciel = ref([ format: (v) => Number(v).toLocaleString(), }, ]); - const columns = computed(() => { const columnsss = store.roundMainCode === "APR" @@ -362,23 +370,7 @@ const columns = computed(() => { return columnsss; }); -const visibleColumns = ref( - store.roundMainCode === "APR" - ? ["org", "total", "fifteenPercent", "chosen", "remaining", "totalBackup"] - : store.roundMainCode === "OCT" - ? [ - "org", - "currentAmount", - "sixPercentAmount", - "spentAmount", - "sixPercentSpentAmount", - "useAmount", - "remainingAmount", - "totalBackup", - ] - : [] -); - +/** function fetch ข้อมูลสถิติ*/ function fetchDataDashboard() { showLoader(); const formData = { @@ -435,6 +427,8 @@ function fetchDataDashboard() { itemsCardSpeciel.value[0].total = quota.total; itemsCardSpeciel.value[1].total = quota.chosen; itemsCardSpeciel.value[2].total = quota.totalBackup; + console.log(res.data.result.salaryOrg); + rows.value = res.data.result.salaryOrg; }) .catch((err) => { @@ -445,6 +439,7 @@ function fetchDataDashboard() { }); } +/** HookLifecycle*/ onMounted(() => { fetchDataDashboard(); }); @@ -486,7 +481,7 @@ watch([() => props?.snapShot, () => props.roundFilter], () => {
-
{{ item.lable }}
+
{{ item.label }}
diff --git a/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue b/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue index 509466ed6..c4cc965ab 100644 --- a/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue +++ b/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue @@ -141,7 +141,6 @@ function onClickAddPerson(data: DataPerson) { type: store.tabType, ...data, }; - dialogConfirm( $q, () => { diff --git a/src/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue b/src/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue index 50547bb49..d4af1ccc9 100644 --- a/src/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue +++ b/src/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue @@ -63,15 +63,7 @@ const typeRangeOps = computed(() => { /*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */ function validateForm() { if (typeRef.value.validate()) { - // if ( - // store.roundMainCode === "APR" && - // store.remaining === 0 && - // type.value === "FULL" - // ) { - // dialogMessageNotify($q, "ไม่สามารถย้ายขั้นได้เนื่องจากโควตาคงเหลือไม่พอ"); - // } else { onSubmit(); - // } } } diff --git a/src/modules/13_salary/components/SalaryLists/DialogProperties.vue b/src/modules/13_salary/components/SalaryLists/DialogProperties.vue index 9b5b70b0c..0f9f4fc36 100644 --- a/src/modules/13_salary/components/SalaryLists/DialogProperties.vue +++ b/src/modules/13_salary/components/SalaryLists/DialogProperties.vue @@ -62,9 +62,8 @@ const typeRangeOps = computed(() => { /*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */ function validateForm() { - onSubmit(); - } - + onSubmit(); +} /** function ปืด Popup */ function close() { @@ -77,10 +76,10 @@ function onSubmit() { dialogConfirm($q, () => { showLoader(); const body = { - isPunish: isPunish.value, - isSuspension: isSuspension.value, - isAbsent: isAbsent.value, - isLeave: isLeave.value, + isPunish: isPunish.value, + isSuspension: isSuspension.value, + isAbsent: isAbsent.value, + isLeave: isLeave.value, }; http .put(config.API.salaryProperty(profileId.value), body) @@ -107,13 +106,6 @@ watch( isLeave.value = props.isLeave; } ); - -function inputEdit(val: boolean) { - return { - "full-width cursor-pointer inputgreen ": val, - "full-width cursor-pointer inputgreen": !val, - }; -}