เพิ่มอัตรากำลังลูกจ้างประจำ

This commit is contained in:
Warunee Tamkoo 2024-03-14 16:03:27 +07:00
parent a7f3529e56
commit 748a878deb
22 changed files with 6106 additions and 0 deletions

View file

@ -0,0 +1,82 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
/** importComponents*/
import TreeView from "@/modules/16_positionEmployee/components/TreeView.vue";
/** importStore*/
import { usePositionEmp } from "@/modules/16_positionEmployee/store/organizational";
import { useCounterMixin } from "@/stores/mixin";
/** use*/
const $q = useQuasar();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const store = usePositionEmp();
/** สถานะ*/
const isStatusData = ref<boolean>(false); //
/** ประวัติโครงสร้าง*/
const historyId = ref<string>(""); // ID
const count = ref<number>(0);
/** function เรียกข้อมูลโครงสร้าง แบบปัจุบันและ แบบร่าง*/
async function fetchOrganizationActive() {
showLoader();
await http
.get(config.API.activeOrganization)
.then((res) => {
const data = res.data.result;
if (data) {
store.fetchDataActive(data);
if (data.activeName === null && data.draftName === null) {
isStatusData.value = false;
} else {
isStatusData.value = true;
if (isStatusData.value) {
if (data.activeName === null) {
// ishasActive.value = true;
store.typeOrganizational = "draft";
} else if (data.draftName === null) {
// ishasDraft.value = true;
store.typeOrganizational = "current";
}
}
}
}
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
/** lifecycleHook */
onMounted(async () => {
store.typeOrganizational = "current";
await fetchOrganizationActive();
});
</script>
<template>
<div class="row items-center">
<div class="toptitle text-dark row items-center q-py-xs">
ตรากำลงลกจางประจำฯ
</div>
</div>
<q-card flat bordered>
<q-card class="my-card">
<q-card-section style="padding: 0px">
<TreeView v-model:historyId="historyId" v-model:count="count" />
</q-card-section>
</q-card>
</q-card>
</template>
<style scoped></style>