ข้อมูลตำแหน่งลูกจ้างประจำ
This commit is contained in:
parent
26c7a66906
commit
c0d0c9232a
12 changed files with 665 additions and 331 deletions
|
|
@ -1,9 +1,12 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
|
||||
import type {
|
||||
DataResponse,
|
||||
DataRow,
|
||||
} from "../interface/response/position/ListType";
|
||||
import type { ResGroup } from "@/modules/01_metadataNew/interface/response/positionEmployee/Main";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useMainOptionDataStore } from "@/modules/01_metadataNew/stores/main";
|
||||
const storeOption = useMainOptionDataStore();
|
||||
|
|
@ -14,25 +17,8 @@ export const usePositionEmployeeDataStore = defineStore(
|
|||
"positionEmployeeStore",
|
||||
() => {
|
||||
const pathLocation = ref<string>("list_position");
|
||||
const row = ref<DataRow[]>([]);
|
||||
function save(data: DataResponse[], id: string) {
|
||||
const list = data.map((e) => ({
|
||||
...e,
|
||||
posTypes: undefined,
|
||||
posTypeId: e.posTypes?.id,
|
||||
posTypeName: e.posTypes?.posTypeName,
|
||||
posTypeRank: e.posTypes?.posTypeRank,
|
||||
createdAt: e.createdAt ? date2Thai(e.createdAt) : "",
|
||||
lastUpdatedAt: e.lastUpdatedAt ? date2Thai(e.lastUpdatedAt) : "",
|
||||
posLevelAuthority: e.posLevelAuthority
|
||||
? storeOption.posLevelAuthorityConvert(e.posLevelAuthority)
|
||||
: "-",
|
||||
})) satisfies DataRow[];
|
||||
row.value = list.filter((e) => e.posTypeId === id);
|
||||
}
|
||||
|
||||
return {
|
||||
save,
|
||||
row,
|
||||
pathLocation,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue