api รอบการขึ้นเงินเดือน
This commit is contained in:
parent
d9a1462cfc
commit
2a88403f6a
5 changed files with 746 additions and 5 deletions
|
|
@ -1,6 +1,49 @@
|
|||
import { defineStore } from "pinia";
|
||||
|
||||
import { ref } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { RowList, Row } from '@/modules/13_salary/interface/response/Main'
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
// store
|
||||
export const useSalaryDataStore = defineStore("salaryDataStore", () => {
|
||||
return {};
|
||||
const rows = ref<RowList[]>([]);
|
||||
const visibleColumns = ref<string[]>([]);
|
||||
const columns = ref<QTableProps["columns"]>([]);
|
||||
|
||||
const mixin = useCounterMixin()
|
||||
const{ date2Thai }= mixin
|
||||
|
||||
|
||||
function fetchDataMap(data: RowList[]) {
|
||||
rows.value = data.map((i: RowList) => ({
|
||||
id: i.id,
|
||||
period: i.period !== null ? statusTothai(i.period) : null,
|
||||
isActive: i.isActive !== null ? i.isActive : null,
|
||||
effectiveDate: i.effectiveDate !== null ? date2Thai(i.effectiveDate as Date) : null,
|
||||
status: i.status !== null ? i.status : null,
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* แปลง status เป็น Text
|
||||
* @param val status
|
||||
* @returns text
|
||||
*/
|
||||
function statusTothai(val: string) {
|
||||
switch (val) {
|
||||
case "SPECIAL":
|
||||
return "รอบพิเศษ";
|
||||
case "APR":
|
||||
return "รอบเมษายน";
|
||||
case "OCT":
|
||||
return "รอบตุลาคม";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
};
|
||||
return {
|
||||
rows,
|
||||
visibleColumns,
|
||||
columns,
|
||||
fetchDataMap
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue