api โครงสร้างอัตรากำลัง
This commit is contained in:
parent
9e1386c052
commit
0fbf803a26
4 changed files with 86 additions and 13 deletions
9
src/api/02_organizational/api.organization.ts
Normal file
9
src/api/02_organizational/api.organization.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
import env from "../index";
|
||||||
|
|
||||||
|
const organization = `${env.API_URI}/organization`;
|
||||||
|
|
||||||
|
export default {
|
||||||
|
/** โครงสร้างอัตรากำลัง*/
|
||||||
|
activeOrganization: `${organization}/active`,
|
||||||
|
createOrganization: `${organization}/draft`,
|
||||||
|
};
|
||||||
|
|
@ -47,10 +47,14 @@ import reports from "./api/reports/api.report";
|
||||||
import leave from "./api/09_leave/api.leave";
|
import leave from "./api/09_leave/api.leave";
|
||||||
|
|
||||||
/** API วินัย */
|
/** API วินัย */
|
||||||
import discipline from './api/11_discipline/api.discipline'
|
import discipline from "./api/11_discipline/api.discipline";
|
||||||
|
|
||||||
/**API ประเมิน */
|
/**API ประเมิน */
|
||||||
import evaluate from './api/12_evaluatePersonal/api.evaluate'
|
import evaluate from "./api/12_evaluatePersonal/api.evaluate";
|
||||||
|
|
||||||
|
/** API โครงสร้างอัตรากำลัง*/
|
||||||
|
import organization from "./api/02_organizational/api.organization";
|
||||||
|
|
||||||
// environment variables
|
// environment variables
|
||||||
export const compettitivePanel = import.meta.env.VITE_COMPETITIVE_EXAM_PANEL;
|
export const compettitivePanel = import.meta.env.VITE_COMPETITIVE_EXAM_PANEL;
|
||||||
export const qualifyDisableExamPanel = import.meta.env
|
export const qualifyDisableExamPanel = import.meta.env
|
||||||
|
|
@ -67,6 +71,9 @@ const API = {
|
||||||
...manageInsignia,
|
...manageInsignia,
|
||||||
...manageHoliday,
|
...manageHoliday,
|
||||||
|
|
||||||
|
// โครงสร้างอัตรากำลัง
|
||||||
|
...organization,
|
||||||
|
|
||||||
//Tree List
|
//Tree List
|
||||||
...organizationTreeList,
|
...organizationTreeList,
|
||||||
...organizationChart,
|
...organizationChart,
|
||||||
|
|
@ -102,7 +109,7 @@ const API = {
|
||||||
...discipline,
|
...discipline,
|
||||||
|
|
||||||
/**evaluate*/
|
/**evaluate*/
|
||||||
...evaluate
|
...evaluate,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,28 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, watch } from "vue";
|
import { ref, reactive, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import http from "@/plugins/http";
|
||||||
import type { QTableProps } from "quasar";
|
import config from "@/app.config";
|
||||||
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
FormDataNewStructure,
|
FormDataNewStructure,
|
||||||
FormNewStructureRef,
|
FormNewStructureRef,
|
||||||
DataOption,
|
DataOption,
|
||||||
} from "@/modules/02_organizationalNew/interface/index/Main";
|
} from "@/modules/02_organizationalNew/interface/index/Main";
|
||||||
|
|
||||||
const modal = defineModel<boolean>("newStructure", { required: true });
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
const $q = useQuasar();
|
import { useOrganizational } from "@/modules/02_organizationalNew/store/organizational";
|
||||||
const mixin = useCounterMixin();
|
|
||||||
const { dialogConfirm } = mixin;
|
const $q = useQuasar();
|
||||||
|
const store = useOrganizational();
|
||||||
|
const { dialogConfirm, showLoader, success, hideLoader, messageError } =
|
||||||
|
useCounterMixin();
|
||||||
|
|
||||||
|
const modal = defineModel<boolean>("newStructure", { required: true });
|
||||||
|
const status = defineModel<boolean>("status", { required: true });
|
||||||
|
|
||||||
const status = defineModel("status");
|
|
||||||
const rows = ref<any[]>([]);
|
|
||||||
const typeOp = ref<DataOption[]>([
|
const typeOp = ref<DataOption[]>([
|
||||||
{
|
{
|
||||||
id: "NEW",
|
id: "NEW",
|
||||||
|
|
@ -71,7 +77,18 @@ function validateForm() {
|
||||||
/** ฟังชั่น บันทึก */
|
/** ฟังชั่น บันทึก */
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
|
// http
|
||||||
|
// .post(config.API.createOrganization, formData)
|
||||||
|
// .then(() => {
|
||||||
status.value = true;
|
status.value = true;
|
||||||
|
store.typeOrganizational = "draft";
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
// })
|
||||||
|
// .catch((err) => {
|
||||||
|
// messageError($q, err);
|
||||||
|
// })
|
||||||
|
// .finally(() => {});
|
||||||
|
|
||||||
console.log(formData);
|
console.log(formData);
|
||||||
});
|
});
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
|
|
@ -80,6 +97,13 @@ function onSubmit() {
|
||||||
function close() {
|
function close() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => modal.value,
|
||||||
|
() => {
|
||||||
|
modal.value && !status.value && (formData.type = "NEW");
|
||||||
|
}
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -107,6 +131,7 @@ function close() {
|
||||||
<q-select
|
<q-select
|
||||||
for="#type"
|
for="#type"
|
||||||
ref="typeRef"
|
ref="typeRef"
|
||||||
|
:readonly="!status"
|
||||||
dense
|
dense
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
outlined
|
outlined
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
|
||||||
/** importComponents*/
|
/** importComponents*/
|
||||||
import ListView from "@/modules/02_organizationalNew/components/listView.vue";
|
import ListView from "@/modules/02_organizationalNew/components/listView.vue";
|
||||||
|
|
@ -10,6 +13,10 @@ import DialogHistory from "@/modules/02_organizationalNew/components/DialogHisto
|
||||||
|
|
||||||
/** importStore*/
|
/** importStore*/
|
||||||
import { useOrganizational } from "@/modules/02_organizationalNew/store/organizational";
|
import { useOrganizational } from "@/modules/02_organizationalNew/store/organizational";
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
const $q = useQuasar();
|
||||||
|
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
||||||
|
|
||||||
const modalNewStructure = ref<boolean>(false);
|
const modalNewStructure = ref<boolean>(false);
|
||||||
const stroe = useOrganizational();
|
const stroe = useOrganizational();
|
||||||
|
|
@ -34,6 +41,22 @@ const itemStructure = ref<any>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
async function fetchOrganizationActive() {
|
||||||
|
// showLoader();
|
||||||
|
// await http
|
||||||
|
// .get(config.API.activeOrganization)
|
||||||
|
// .then((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
// })
|
||||||
|
// .catch((err) => {
|
||||||
|
// messageError($q, err);
|
||||||
|
// console.log(err);
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// hideLoader();
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
const modalDateTime = ref<boolean>(false);
|
const modalDateTime = ref<boolean>(false);
|
||||||
function onClickDateTime() {
|
function onClickDateTime() {
|
||||||
modalDateTime.value = !modalDateTime.value;
|
modalDateTime.value = !modalDateTime.value;
|
||||||
|
|
@ -43,6 +66,10 @@ const modalHistory = ref<boolean>(false);
|
||||||
function onClickHistory() {
|
function onClickHistory() {
|
||||||
modalHistory.value = !modalHistory.value;
|
modalHistory.value = !modalHistory.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await fetchOrganizationActive();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
@ -167,7 +194,12 @@ function onClickHistory() {
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
<DialogFormNewStructure v-model:new-structure="modalNewStructure" v-model:status="isStatusData"/>
|
<!-- เพิ่มโครงสร้าง -->
|
||||||
|
<DialogFormNewStructure
|
||||||
|
v-model:new-structure="modalNewStructure"
|
||||||
|
v-model:status="isStatusData"
|
||||||
|
/>
|
||||||
|
|
||||||
<DialogDateTime :modal="modalDateTime" :close="onClickDateTime" />
|
<DialogDateTime :modal="modalDateTime" :close="onClickDateTime" />
|
||||||
|
|
||||||
<DialogHistory :modal="modalHistory" :close="onClickHistory" />
|
<DialogHistory :modal="modalHistory" :close="onClickHistory" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue