Merge branch 'develop' into devTee
This commit is contained in:
commit
6e065b562c
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";
|
||||
|
||||
/** API วินัย */
|
||||
import discipline from './api/11_discipline/api.discipline'
|
||||
import discipline from "./api/11_discipline/api.discipline";
|
||||
|
||||
/**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
|
||||
export const compettitivePanel = import.meta.env.VITE_COMPETITIVE_EXAM_PANEL;
|
||||
export const qualifyDisableExamPanel = import.meta.env
|
||||
|
|
@ -67,6 +71,9 @@ const API = {
|
|||
...manageInsignia,
|
||||
...manageHoliday,
|
||||
|
||||
// โครงสร้างอัตรากำลัง
|
||||
...organization,
|
||||
|
||||
//Tree List
|
||||
...organizationTreeList,
|
||||
...organizationChart,
|
||||
|
|
@ -102,7 +109,7 @@ const API = {
|
|||
...discipline,
|
||||
|
||||
/**evaluate*/
|
||||
...evaluate
|
||||
...evaluate,
|
||||
};
|
||||
|
||||
export default {
|
||||
|
|
|
|||
|
|
@ -1,22 +1,28 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QTableProps } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
import type {
|
||||
FormDataNewStructure,
|
||||
FormNewStructureRef,
|
||||
DataOption,
|
||||
} from "@/modules/02_organizationalNew/interface/index/Main";
|
||||
|
||||
const modal = defineModel<boolean>("newStructure", { required: true });
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm } = mixin;
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useOrganizational } from "@/modules/02_organizationalNew/store/organizational";
|
||||
|
||||
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[]>([
|
||||
{
|
||||
id: "NEW",
|
||||
|
|
@ -71,7 +77,18 @@ function validateForm() {
|
|||
/** ฟังชั่น บันทึก */
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
// http
|
||||
// .post(config.API.createOrganization, formData)
|
||||
// .then(() => {
|
||||
status.value = true;
|
||||
store.typeOrganizational = "draft";
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// messageError($q, err);
|
||||
// })
|
||||
// .finally(() => {});
|
||||
|
||||
console.log(formData);
|
||||
});
|
||||
modal.value = false;
|
||||
|
|
@ -80,6 +97,13 @@ function onSubmit() {
|
|||
function close() {
|
||||
modal.value = false;
|
||||
}
|
||||
|
||||
watch(
|
||||
() => modal.value,
|
||||
() => {
|
||||
modal.value && !status.value && (formData.type = "NEW");
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<template>
|
||||
|
|
@ -107,6 +131,7 @@ function close() {
|
|||
<q-select
|
||||
for="#type"
|
||||
ref="typeRef"
|
||||
:readonly="!status"
|
||||
dense
|
||||
hide-bottom-space
|
||||
outlined
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
<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*/
|
||||
import ListView from "@/modules/02_organizationalNew/components/listView.vue";
|
||||
|
|
@ -10,6 +13,10 @@ import DialogHistory from "@/modules/02_organizationalNew/components/DialogHisto
|
|||
|
||||
/** importStore*/
|
||||
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 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);
|
||||
function onClickDateTime() {
|
||||
modalDateTime.value = !modalDateTime.value;
|
||||
|
|
@ -43,6 +66,10 @@ const modalHistory = ref<boolean>(false);
|
|||
function onClickHistory() {
|
||||
modalHistory.value = !modalHistory.value;
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchOrganizationActive();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="row">
|
||||
|
|
@ -167,7 +194,12 @@ function onClickHistory() {
|
|||
</div>
|
||||
</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" />
|
||||
|
||||
<DialogHistory :modal="modalHistory" :close="onClickHistory" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue