API การลา ข้าราชการ, ลูกจ้าง
This commit is contained in:
parent
6bde04376f
commit
32dcdc9336
28 changed files with 525 additions and 868 deletions
|
|
@ -80,6 +80,9 @@ export default {
|
||||||
addResign: (profileType: string, type: string, id: string) =>
|
addResign: (profileType: string, type: string, id: string) =>
|
||||||
`${retirement}/resign${profileType}/officer/add-resign/${type}/${id}`,
|
`${retirement}/resign${profileType}/officer/add-resign/${type}/${id}`,
|
||||||
|
|
||||||
|
addResignCancel: (profileType: string, type: string, id: string) =>
|
||||||
|
`${retirement}/resign${profileType}/officer-cancel/add-resign/${type}/${id}`,
|
||||||
|
|
||||||
sendApproveRetirement: (type: string, id: string) =>
|
sendApproveRetirement: (type: string, id: string) =>
|
||||||
`${retirement}/resign${type}/admin/approve/officer/${id}`,
|
`${retirement}/resign${type}/admin/approve/officer/${id}`,
|
||||||
commanderApproveRetirement: (
|
commanderApproveRetirement: (
|
||||||
|
|
@ -88,4 +91,17 @@ export default {
|
||||||
typeApprove: string,
|
typeApprove: string,
|
||||||
path: string = ""
|
path: string = ""
|
||||||
) => `${retirement}/resign${type}/admin/${typeApprove}${path}/${id}`,
|
) => `${retirement}/resign${type}/admin/${typeApprove}${path}/${id}`,
|
||||||
|
|
||||||
|
// รายการยกเลิกการลาออก
|
||||||
|
// สำหรับเจ้าหน้าที่
|
||||||
|
officerCancelResign: (typeEmp: string, id: string) =>
|
||||||
|
`${retirement}/resign${typeEmp}/admin-cancel/approve/officer/${id}`,
|
||||||
|
|
||||||
|
// สำหรับผู้บังคับบัญชา
|
||||||
|
comanderCancelResign: (typeEmp: string, action: string, id: string) =>
|
||||||
|
`${retirement}/resign${typeEmp}/admin-cancel/${action}/comander/${id}`,
|
||||||
|
|
||||||
|
// สำหรับผู้มีอำนาจ
|
||||||
|
approverCancelResign: (typeEmp: string, action: string, id: string) =>
|
||||||
|
`${retirement}/resign${typeEmp}/admin-cancel/${action}/${id}`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,11 @@ import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import { useOrganizational } from "@/modules/02_organization/store/organizational";
|
import { useOrganizational } from "@/modules/02_organization/store/organizational";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
|
@ -338,7 +342,9 @@ onMounted(async () => {
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="
|
v-if="
|
||||||
store.typeOrganizational === 'draft' &&
|
store.typeOrganizational === 'draft' &&
|
||||||
(store.isOfficer === true || store.isStaff === true)
|
(store.isOfficer === true || store.isStaff === true) &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
"
|
"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, useAttrs } from "vue";
|
import { ref, useAttrs } from "vue";
|
||||||
import { QTooltip, useQuasar } from "quasar";
|
import { QTooltip, useQuasar } from "quasar";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
|
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import type { optionData } from "@/modules/05_placement/interface/index/Main";
|
import type { optionData } from "@/modules/05_placement/interface/index/Main";
|
||||||
|
|
@ -267,6 +271,11 @@ function filterSelector(val: string, update: Function) {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,11 @@ import { useRouter } from "vue-router";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
|
|
||||||
import type { AppointMainRows } from "@/modules/05_placement/interface/request/Main";
|
import type { AppointMainRows } from "@/modules/05_placement/interface/request/Main";
|
||||||
import DialogOrder from "@/modules/05_placement/components/probation/DialogOrder/DialogSendToCommand.vue";
|
import DialogOrder from "@/modules/05_placement/components/probation/DialogOrder/DialogSendToCommand.vue";
|
||||||
|
|
@ -181,7 +185,11 @@ onMounted(async () => {
|
||||||
<div class="row q-col-gutter-sm">
|
<div class="row q-col-gutter-sm">
|
||||||
<div class="q-px-sm">
|
<div class="q-px-sm">
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="checkPermission($route)?.attrIsUpdate"
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
dense
|
dense
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,11 @@ import { useRouter } from "vue-router";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||||
|
|
||||||
|
|
@ -511,7 +515,9 @@ onMounted(() => {
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="
|
v-if="
|
||||||
checkPermission($route)?.attrIsUpdate &&
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
checkPermission($route)?.attrIsGet
|
checkPermission($route)?.attrIsGet &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
"
|
"
|
||||||
@click="onCommand"
|
@click="onCommand"
|
||||||
flat
|
flat
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,11 @@ import { ref, onMounted, computed } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -240,7 +244,11 @@ onMounted(async () => {
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="checkPermission($route)?.attrIsUpdate"
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
@click="openModalOrder"
|
@click="openModalOrder"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,11 @@ import { ref, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -445,7 +449,11 @@ onMounted(async () => {
|
||||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="checkPermission($route)?.attrIsUpdate"
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
size="14px"
|
size="14px"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,11 @@
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
@ -301,7 +305,11 @@ onMounted(async () => {
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="checkPermission($route)?.attrIsUpdate"
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
@click="openModalOrder"
|
@click="openModalOrder"
|
||||||
size="14px"
|
size="14px"
|
||||||
flat
|
flat
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,11 @@ import { ref, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -273,7 +277,11 @@ onMounted(async () => {
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="checkPermission($route)?.attrIsUpdate"
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
size="14px"
|
size="14px"
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,11 @@ import { ref, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -403,7 +407,11 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="checkPermission($route)?.attrIsUpdate"
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
@click="sendToCommand()"
|
@click="sendToCommand()"
|
||||||
size="14px"
|
size="14px"
|
||||||
flat
|
flat
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,11 @@
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||||
|
|
@ -400,7 +404,11 @@ onMounted(async () => {
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="checkPermission($route)?.attrIsUpdate"
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
@click="popup()"
|
@click="popup()"
|
||||||
size="14px"
|
size="14px"
|
||||||
flat
|
flat
|
||||||
|
|
@ -586,7 +594,8 @@ onMounted(async () => {
|
||||||
props.row.posTypeName === "อำนวยการ"
|
props.row.posTypeName === "อำนวยการ"
|
||||||
? `${props.row.posTypeName}`
|
? `${props.row.posTypeName}`
|
||||||
: ""
|
: ""
|
||||||
}} {{
|
}}
|
||||||
|
{{
|
||||||
props.row.posLevelName !== null
|
props.row.posLevelName !== null
|
||||||
? `(${props.row.posLevelName})`
|
? `(${props.row.posLevelName})`
|
||||||
: ""
|
: ""
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,11 @@ import { ref, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -353,7 +357,11 @@ onMounted(() => {
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="checkPermission($route)?.attrIsUpdate"
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
@click="popup()"
|
@click="popup()"
|
||||||
size="14px"
|
size="14px"
|
||||||
flat
|
flat
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import config from "@/app.config";
|
||||||
import genReport from "@/plugins/genreport";
|
import genReport from "@/plugins/genreport";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
|
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
|
||||||
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
||||||
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
@ -26,7 +25,6 @@ import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
|
||||||
|
|
||||||
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
|
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
|
||||||
import CardProfile from "@/components/CardProfile.vue";
|
import CardProfile from "@/components/CardProfile.vue";
|
||||||
import WorkFlow from "@/components/Workflow/Main.vue";
|
|
||||||
import DialogAddCommander from "@/modules/06_retirement/components/DialogAddCommander.vue";
|
import DialogAddCommander from "@/modules/06_retirement/components/DialogAddCommander.vue";
|
||||||
|
|
||||||
/** Use */
|
/** Use */
|
||||||
|
|
@ -57,15 +55,6 @@ const dataProfile = ref<DataProfile>();
|
||||||
const approveStep = ref<string>("");
|
const approveStep = ref<string>("");
|
||||||
const group = ref<string>("");
|
const group = ref<string>("");
|
||||||
|
|
||||||
// const approveCheck = computed(() => {
|
|
||||||
// return (
|
|
||||||
// rowsApprover.value?.commanders?.every(
|
|
||||||
// (commander) =>
|
|
||||||
// commander.approveStatus === "APPROVE" ||
|
|
||||||
// commander.approveStatus === "REJECT"
|
|
||||||
// ) ?? false
|
|
||||||
// );
|
|
||||||
// });
|
|
||||||
const idCheck = computed(() => {
|
const idCheck = computed(() => {
|
||||||
if (
|
if (
|
||||||
typeAdd.value == "COMMANDER" &&
|
typeAdd.value == "COMMANDER" &&
|
||||||
|
|
@ -86,31 +75,6 @@ const idCheck = computed(() => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// const approvePendingCheck = computed(() => {
|
|
||||||
// const commanders = rowsApprover.value?.commanders || [];
|
|
||||||
// const index = commanders.findIndex((c) => c.profileId === myProfileId.value);
|
|
||||||
|
|
||||||
// if (index === -1) {
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const currentCommander = commanders[index];
|
|
||||||
|
|
||||||
// if (currentCommander.approveStatus !== "PENDING") {
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (index === 0) {
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// const previousApproved = commanders
|
|
||||||
// .slice(0, index)
|
|
||||||
// .every(
|
|
||||||
// (c) => c.approveStatus === "APPROVE" || c.approveStatus === "REJECT"
|
|
||||||
// );
|
|
||||||
// return previousApproved;
|
|
||||||
// });
|
|
||||||
const isOfficer = ref<boolean>(false);
|
const isOfficer = ref<boolean>(false);
|
||||||
const isStaff = ref<boolean>(false);
|
const isStaff = ref<boolean>(false);
|
||||||
const profileType = ref<string>("");
|
const profileType = ref<string>("");
|
||||||
|
|
@ -213,7 +177,6 @@ const dataDetail = ref<any>({
|
||||||
reasonResign: "",
|
reasonResign: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const workflowRef = ref<any>(null);
|
|
||||||
const organizationPositionOld = ref<string>("");
|
const organizationPositionOld = ref<string>("");
|
||||||
const positionTypeOld = ref<string>("");
|
const positionTypeOld = ref<string>("");
|
||||||
const positionLevelOld = ref<string>("");
|
const positionLevelOld = ref<string>("");
|
||||||
|
|
@ -230,20 +193,6 @@ const actionPass = ref<boolean>(false);
|
||||||
const reasonReign = ref<string>("");
|
const reasonReign = ref<string>("");
|
||||||
const dateBreak = ref<Date | null>(null);
|
const dateBreak = ref<Date | null>(null);
|
||||||
|
|
||||||
const isCheckData = computed(() => {
|
|
||||||
if (
|
|
||||||
organizationPositionOld.value !== "" &&
|
|
||||||
positionTypeOld.value !== "" &&
|
|
||||||
positionLevelOld.value !== "" &&
|
|
||||||
posNo.value !== "" &&
|
|
||||||
date.value !== null &&
|
|
||||||
dataDetail.value.commanderReject !== null &&
|
|
||||||
dataDetail.value.oligarchReject !== null
|
|
||||||
) {
|
|
||||||
return true;
|
|
||||||
} else return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
/** คอลัมน์ */
|
/** คอลัมน์ */
|
||||||
const rows = ref<TypeFile[]>([]);
|
const rows = ref<TypeFile[]>([]);
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
|
@ -316,7 +265,6 @@ function diffDate() {
|
||||||
* @param id id ของผู้ใช้งาน
|
* @param id id ของผู้ใช้งาน
|
||||||
*/
|
*/
|
||||||
async function fetchData(id: string) {
|
async function fetchData(id: string) {
|
||||||
showLoader();
|
|
||||||
await http
|
await http
|
||||||
.get(config.API.resingByid(id))
|
.get(config.API.resingByid(id))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
|
|
@ -361,9 +309,6 @@ async function fetchData(id: string) {
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -394,19 +339,6 @@ function onSubmit(type: string) {
|
||||||
} else if (roleUser.value === "oligarch" && !actionPass.value) {
|
} else if (roleUser.value === "oligarch" && !actionPass.value) {
|
||||||
rejectpopUp("");
|
rejectpopUp("");
|
||||||
}
|
}
|
||||||
// if (actionPass.value) {
|
|
||||||
// if (type === "approver") {
|
|
||||||
// confirmpopUp("/comander");
|
|
||||||
// } else {
|
|
||||||
// confirmpopUp("");
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// if (type === "approver") {
|
|
||||||
// rejectpopUp("/comander");
|
|
||||||
// } else {
|
|
||||||
// rejectpopUp("");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -503,15 +435,20 @@ async function clickCancel() {
|
||||||
|
|
||||||
/** ฟังก์ชันยกเลิกการแก้ไขข้อมูลรายการตรวจสอบเงื่อนไขต่างๆ*/
|
/** ฟังก์ชันยกเลิกการแก้ไขข้อมูลรายการตรวจสอบเงื่อนไขต่างๆ*/
|
||||||
async function clickCancelConditions() {
|
async function clickCancelConditions() {
|
||||||
await fetchData(id.value);
|
const data = dataDetail.value;
|
||||||
conditions.value = false;
|
if (data) {
|
||||||
|
isNoDebt.value = data.isNoDebt;
|
||||||
|
isNoBurden.value = data.isNoBurden;
|
||||||
|
isDiscipline.value = data.isDiscipline;
|
||||||
|
conditions.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ฟังก์ชันบันทึกเงื่อนไขต่างๆ*/
|
/** ฟังก์ชันบันทึกเงื่อนไขต่างๆ*/
|
||||||
function onSubmitConditions() {
|
function onSubmitConditions() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
await http
|
||||||
.put(config.API.resignConditions(id.value), {
|
.put(config.API.resignConditions(id.value), {
|
||||||
isNoDebt: isNoDebt.value,
|
isNoDebt: isNoDebt.value,
|
||||||
isNoBurden: isNoBurden.value,
|
isNoBurden: isNoBurden.value,
|
||||||
|
|
@ -533,7 +470,7 @@ function onSubmitConditions() {
|
||||||
|
|
||||||
/** ฟังก์ชันบันทึกข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
/** ฟังก์ชันบันทึกข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||||
function onSubmitAttached() {
|
function onSubmitAttached() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, async () => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
const send = date.value !== null ? new Date(date.value).toUTCString() : "";
|
const send = date.value !== null ? new Date(date.value).toUTCString() : "";
|
||||||
const activeDate =
|
const activeDate =
|
||||||
|
|
@ -549,7 +486,7 @@ function onSubmitAttached() {
|
||||||
formData.append("AmountOld", salary.value.toString());
|
formData.append("AmountOld", salary.value.toString());
|
||||||
formData.append("remarkHorizontal", remarkHorizontal.value);
|
formData.append("remarkHorizontal", remarkHorizontal.value);
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
await http
|
||||||
.put(config.API.resingByid(id.value), formData)
|
.put(config.API.resingByid(id.value), formData)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await fetchData(id.value);
|
await fetchData(id.value);
|
||||||
|
|
@ -598,7 +535,6 @@ function updatemodalPersonal(modal: boolean) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchFile() {
|
async function fetchFile() {
|
||||||
showLoader();
|
|
||||||
await http
|
await http
|
||||||
.get(config.API.file("พ้นจากราชการ", "หลักฐานลาออก", id.value))
|
.get(config.API.file("พ้นจากราชการ", "หลักฐานลาออก", id.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
|
|
@ -606,13 +542,12 @@ async function fetchFile() {
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
hideLoader();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function uploadFiles() {
|
async function uploadFiles() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
await http
|
||||||
.post(config.API.file("พ้นจากราชการ", "หลักฐานลาออก", id.value), {
|
.post(config.API.file("พ้นจากราชการ", "หลักฐานลาออก", id.value), {
|
||||||
replace: true,
|
replace: true,
|
||||||
fileList: [
|
fileList: [
|
||||||
|
|
@ -683,9 +618,9 @@ async function downloadFiles(fileName: string) {
|
||||||
* @param id id file
|
* @param id id file
|
||||||
*/
|
*/
|
||||||
function removeFile(fileName: string) {
|
function removeFile(fileName: string) {
|
||||||
dialogRemove($q, () => {
|
dialogRemove($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
await http
|
||||||
.delete(
|
.delete(
|
||||||
config.API.fileByFile(
|
config.API.fileByFile(
|
||||||
"พ้นจากราชการ",
|
"พ้นจากราชการ",
|
||||||
|
|
@ -694,15 +629,16 @@ function removeFile(fileName: string) {
|
||||||
fileName
|
fileName
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(async () => {
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
await fetchFile();
|
await fetchFile();
|
||||||
success($q, `ลบไฟล์สำเร็จ`);
|
success($q, `ลบไฟล์สำเร็จ`);
|
||||||
hideLoader();
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -823,39 +759,6 @@ onMounted(async () => {
|
||||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||||
<div class="q-pl-sm text-weight-bold text-dark">ข้อมูลการลาออก</div>
|
<div class="q-pl-sm text-weight-bold text-dark">ข้อมูลการลาออก</div>
|
||||||
<!-- <q-space />
|
|
||||||
<div
|
|
||||||
class="q-gutter-x-sm"
|
|
||||||
v-if="
|
|
||||||
(roleUser === 'officer' && dataDetail.officerReject === null) ||
|
|
||||||
(roleUser === 'commander' &&
|
|
||||||
dataDetail.commanderReject === null &&
|
|
||||||
dataDetail.officerReject !== null) ||
|
|
||||||
(roleUser === 'oligarch' &&
|
|
||||||
dataDetail.oligarchReject === null &&
|
|
||||||
dataDetail.commanderReject !== null &&
|
|
||||||
dataDetail.officerReject !== null)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<q-btn
|
|
||||||
outline
|
|
||||||
color="primary"
|
|
||||||
dense
|
|
||||||
icon-right="check"
|
|
||||||
class="q-px-sm"
|
|
||||||
label="อนุญาต"
|
|
||||||
@click="popUp('pass')"
|
|
||||||
/>
|
|
||||||
<q-btn
|
|
||||||
outline
|
|
||||||
color="red"
|
|
||||||
dense
|
|
||||||
icon-right="close"
|
|
||||||
class="q-px-sm"
|
|
||||||
label="ยับยั้ง"
|
|
||||||
@click="popUp('passNot')"
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
<div class="row col-12 q-pa-md">
|
<div class="row col-12 q-pa-md">
|
||||||
|
|
@ -1208,51 +1111,6 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
<!-- ผลการพิจารณาของการเจ้าหน้าที่ของหน่วยงาน -->
|
|
||||||
<!-- <q-card bordered class="row col-12 text-dark q-mt-sm">
|
|
||||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
|
||||||
<div class="q-pl-sm text-weight-bold text-dark">
|
|
||||||
ผลการพิจารณาของการเจ้าหน้าที่ของหน่วยงาน
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12"><q-separator /></div>
|
|
||||||
<div class="row col-12 q-pa-md">
|
|
||||||
<div class="col-12 row bg-white q-col-gutter-md">
|
|
||||||
<div class="col-xs-6 row items-start">
|
|
||||||
<div class="col-12 text-top">สถานะ</div>
|
|
||||||
<div class="col-12 text-detail">
|
|
||||||
{{
|
|
||||||
dataDetail.officerReject !== null
|
|
||||||
? statusOrder(dataDetail.officerReject)
|
|
||||||
: "-"
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-xs-6 row items-start">
|
|
||||||
<div class="col-12 text-top">วันสุดท้ายที่ยับยั้ง</div>
|
|
||||||
<div class="col-12 text-detail">
|
|
||||||
{{
|
|
||||||
dataDetail.officerRejectDate !== null
|
|
||||||
? date2Thai(dataDetail.officerRejectDate)
|
|
||||||
: "-"
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-xs-12 row items-start">
|
|
||||||
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
|
||||||
|
|
||||||
<div class="col-12 text-detail">
|
|
||||||
{{
|
|
||||||
dataDetail.officerReject
|
|
||||||
? dataDetail.officerRejectReason
|
|
||||||
: dataDetail.officerApproveReason
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</q-card> -->
|
|
||||||
|
|
||||||
<!-- ผลการพิจารณาของผู้บังคับบัญชา -->
|
<!-- ผลการพิจารณาของผู้บังคับบัญชา -->
|
||||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||||
|
|
@ -1278,34 +1136,6 @@ onMounted(async () => {
|
||||||
<q-tooltip>เพิ่มรายชื่อผู้บังคับบัญชา</q-tooltip>
|
<q-tooltip>เพิ่มรายชื่อผู้บังคับบัญชา</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-space />
|
<q-space />
|
||||||
<!-- workflowRef?.permission.isUpdate && -->
|
|
||||||
|
|
||||||
<!-- <div
|
|
||||||
class="q-gutter-x-sm"
|
|
||||||
v-if="
|
|
||||||
dataDetail.commanderReject === null &&
|
|
||||||
dataDetail.statusMain === 'WAITTING'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<q-btn
|
|
||||||
outline
|
|
||||||
color="primary"
|
|
||||||
dense
|
|
||||||
icon-right="check"
|
|
||||||
class="q-px-sm"
|
|
||||||
label="อนุญาต"
|
|
||||||
@click="popUp('pass', 'commander')"
|
|
||||||
/>
|
|
||||||
<q-btn
|
|
||||||
outline
|
|
||||||
color="red"
|
|
||||||
dense
|
|
||||||
icon-right="close"
|
|
||||||
class="q-px-sm"
|
|
||||||
label="ยับยั้ง"
|
|
||||||
@click="popUp('passNot', 'commander')"
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
|
|
@ -1863,12 +1693,11 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-actions align="right" class="bg-white text-teal">
|
<q-card-actions align="right">
|
||||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
<!-- <DialogFooter :editvisible="true" :save="conditionPopup" /> -->
|
|
||||||
</q-form>
|
</q-form>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import { useQuasar, QForm, type QTableProps } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
|
||||||
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
||||||
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
|
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
|
||||||
|
|
||||||
|
|
@ -28,8 +27,6 @@ const router = useRouter();
|
||||||
const store = useRetirementDataStore();
|
const store = useRetirementDataStore();
|
||||||
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
|
const { fetchDataCheckIsoffice } = useRoleWorkflowDataStore();
|
||||||
const { convertStatusText } = store;
|
const { convertStatusText } = store;
|
||||||
const checkRoutePermisson = ref<boolean>(route.name == "resignDetailReject");
|
|
||||||
const mixin = useCounterMixin();
|
|
||||||
const {
|
const {
|
||||||
messageError,
|
messageError,
|
||||||
date2Thai,
|
date2Thai,
|
||||||
|
|
@ -37,20 +34,16 @@ const {
|
||||||
hideLoader,
|
hideLoader,
|
||||||
success,
|
success,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
} = mixin;
|
} = useCounterMixin();
|
||||||
|
|
||||||
|
const checkRoutePermisson = ref<boolean>(route.name == "resignDetailReject");
|
||||||
|
|
||||||
/** ตัวแปร */
|
/** ตัวแปร */
|
||||||
const roleUser = ref<string>("");
|
const roleUser = ref<string>("");
|
||||||
const dataProfile = ref<DataProfile>();
|
const dataProfile = ref<DataProfile>();
|
||||||
const group = ref<string>("");
|
const group = ref<string>("");
|
||||||
const approveStep = ref<string>("");
|
const approveStep = ref<string>("");
|
||||||
const approveCheck = computed(() => {
|
|
||||||
return (
|
|
||||||
rowsApprover.value?.commanders?.every(
|
|
||||||
(commander) => commander.approveStatus === "APPROVE"
|
|
||||||
) ?? false
|
|
||||||
);
|
|
||||||
});
|
|
||||||
const idCheck = computed(() => {
|
const idCheck = computed(() => {
|
||||||
if (
|
if (
|
||||||
typeAdd.value == "COMMANDER" &&
|
typeAdd.value == "COMMANDER" &&
|
||||||
|
|
@ -71,29 +64,6 @@ const idCheck = computed(() => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const approvePendingCheck = computed(() => {
|
|
||||||
const commanders = rowsApprover.value?.commanders || [];
|
|
||||||
const index = commanders.findIndex((c) => c.profileId === keycloakId.value);
|
|
||||||
|
|
||||||
if (index === -1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const currentCommander = commanders[index];
|
|
||||||
|
|
||||||
if (currentCommander.approveStatus !== "PENDING") {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (index === 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const previousApproved = commanders
|
|
||||||
.slice(0, index)
|
|
||||||
.every((c) => c.approveStatus === "APPROVE");
|
|
||||||
return previousApproved;
|
|
||||||
});
|
|
||||||
const isOfficer = ref<boolean>(false);
|
const isOfficer = ref<boolean>(false);
|
||||||
const isStaff = ref<boolean>(false);
|
const isStaff = ref<boolean>(false);
|
||||||
const profileType = ref<string>("");
|
const profileType = ref<string>("");
|
||||||
|
|
@ -153,15 +123,6 @@ const columnsCommanders = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "rejectDate",
|
|
||||||
align: "left",
|
|
||||||
label: "วันสุดท้ายที่ยับยั้ง",
|
|
||||||
field: "rejectDate",
|
|
||||||
sortable: true,
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const id = ref<string>(route.params.id.toString());
|
const id = ref<string>(route.params.id.toString());
|
||||||
|
|
@ -189,6 +150,9 @@ const dataDetail = ref<any>({
|
||||||
statustext: "",
|
statustext: "",
|
||||||
fullname: "",
|
fullname: "",
|
||||||
statusMain: "",
|
statusMain: "",
|
||||||
|
cancelReason: "",
|
||||||
|
remark: "",
|
||||||
|
reasonResign: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const organizationPositionOld = ref<string>("");
|
const organizationPositionOld = ref<string>("");
|
||||||
|
|
@ -290,16 +254,24 @@ function popUp(action: "pass" | "passNot", type: string) {
|
||||||
openModal();
|
openModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ฟังก์ชันยืนยันการอนุญาตหรือยับยั้งการยกเลิกการลาออก*/
|
/** ฟังก์ชันยืนยันการอนุญาตหรือไม่อนุญาตการยกเลิกการลาออก*/
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
const body = {
|
const body = {
|
||||||
reason: reasonReign.value,
|
reason: reasonReign.value,
|
||||||
reject: !actionPass.value,
|
// reject: !actionPass.value,
|
||||||
|
Date: new Date(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const action = actionPass.value ? "approve" : "reject";
|
||||||
|
|
||||||
|
const endpoint =
|
||||||
|
roleUser.value === "commander"
|
||||||
|
? config.API.comanderCancelResign("", action, id.value)
|
||||||
|
: config.API.approverCancelResign("", action, id.value);
|
||||||
await http
|
await http
|
||||||
.put(config.API.resignReject(`${roleUser.value}-cancel`, id.value), body)
|
.put(endpoint, body)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await fetchData(id.value);
|
await fetchData(id.value);
|
||||||
closeModal();
|
closeModal();
|
||||||
|
|
@ -406,10 +378,10 @@ async function checkOfficer() {
|
||||||
function onSend() {
|
function onSend() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
() => {
|
async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
await http
|
||||||
.get(config.API.sendApproveRetirement("", id.value))
|
.get(config.API.officerCancelResign("", id.value))
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await fetchData(id.value);
|
await fetchData(id.value);
|
||||||
success($q, "ส่งไปพิจารณา");
|
success($q, "ส่งไปพิจารณา");
|
||||||
|
|
@ -479,39 +451,6 @@ onMounted(async () => {
|
||||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||||
<div class="q-pl-sm text-weight-bold text-dark">ข้อมูลการลาออก</div>
|
<div class="q-pl-sm text-weight-bold text-dark">ข้อมูลการลาออก</div>
|
||||||
<!-- <q-space />
|
|
||||||
<div
|
|
||||||
class="q-gutter-x-sm"
|
|
||||||
v-if="
|
|
||||||
(roleUser === 'officer' && dataDetail.officerReject === null) ||
|
|
||||||
(roleUser === 'commander' &&
|
|
||||||
dataDetail.commanderReject === null &&
|
|
||||||
dataDetail.officerReject !== null) ||
|
|
||||||
(roleUser === 'oligarch' &&
|
|
||||||
dataDetail.oligarchReject === null &&
|
|
||||||
dataDetail.commanderReject !== null &&
|
|
||||||
dataDetail.officerReject !== null)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<q-btn
|
|
||||||
outline
|
|
||||||
color="primary"
|
|
||||||
dense
|
|
||||||
icon-right="check"
|
|
||||||
class="q-px-sm"
|
|
||||||
label="อนุญาต"
|
|
||||||
@click="popUp('pass')"
|
|
||||||
/>
|
|
||||||
<q-btn
|
|
||||||
outline
|
|
||||||
color="red"
|
|
||||||
dense
|
|
||||||
icon-right="close"
|
|
||||||
class="q-px-sm"
|
|
||||||
label="ยับยั้ง"
|
|
||||||
@click="popUp('passNot')"
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
<div class="row col-12 q-pa-md">
|
<div class="row col-12 q-pa-md">
|
||||||
|
|
@ -567,7 +506,7 @@ onMounted(async () => {
|
||||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||||
<div class="q-pl-sm text-weight-bold text-dark">
|
<div class="q-pl-sm text-weight-bold text-dark">
|
||||||
ผลการพิจารณาของผู้บังคับบัญชา {{ group }}
|
ผลการพิจารณาของผู้บังคับบัญชา
|
||||||
</div>
|
</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="
|
v-if="
|
||||||
|
|
@ -616,6 +555,7 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.name == 'comment'">
|
<div v-else-if="col.name == 'comment'">
|
||||||
<div
|
<div
|
||||||
|
class="q-gutter-x-xs"
|
||||||
v-if="
|
v-if="
|
||||||
props.row.approveStatus == 'PENDING' &&
|
props.row.approveStatus == 'PENDING' &&
|
||||||
props.row.comment == '' &&
|
props.row.comment == '' &&
|
||||||
|
|
@ -645,7 +585,7 @@ onMounted(async () => {
|
||||||
dense
|
dense
|
||||||
icon-right="close"
|
icon-right="close"
|
||||||
class="q-px-sm"
|
class="q-px-sm"
|
||||||
label="ยับยั้ง"
|
label="ไม่อนุญาต"
|
||||||
@click="popUp('passNot', 'commander')"
|
@click="popUp('passNot', 'commander')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -656,7 +596,7 @@ onMounted(async () => {
|
||||||
<div v-else-if="col.name == 'approveStatus'">
|
<div v-else-if="col.name == 'approveStatus'">
|
||||||
{{
|
{{
|
||||||
props.row.approveStatus
|
props.row.approveStatus
|
||||||
? convertStatusText(props.row.approveStatus)
|
? convertStatusText(props.row.approveStatus, "ไม่อนุญาต")
|
||||||
: "-"
|
: "-"
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -693,20 +633,18 @@ onMounted(async () => {
|
||||||
<q-tooltip>เพิ่มรายชื่อผู้มีอำนาจ</q-tooltip>
|
<q-tooltip>เพิ่มรายชื่อผู้มีอำนาจ</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-space />
|
<q-space />
|
||||||
<!-- workflowRef?.permission.isUpdate && -->
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="q-gutter-x-sm"
|
|
||||||
v-if="
|
v-if="
|
||||||
checkPermission($route)?.attrIsUpdate &&
|
!checkRoutePermisson &&
|
||||||
dataDetail.oligarchReject === null &&
|
|
||||||
dataDetail.statusMain === 'WAITTING' &&
|
|
||||||
rowsApprover &&
|
rowsApprover &&
|
||||||
rowsApprover.approvers &&
|
rowsApprover.approvers &&
|
||||||
rowsApprover.approvers[0]?.profileId == keycloakId &&
|
rowsApprover.approvers[0]?.profileId == keycloakId &&
|
||||||
rowsApprover.approvers[0]?.approveStatus == 'PENDING' &&
|
rowsApprover.approvers[0]?.approveStatus == 'PENDING' &&
|
||||||
approveCheck
|
((group === '1.1' && approveStep === 'st3') ||
|
||||||
|
(group !== '1.1' && approveStep === 'st4'))
|
||||||
"
|
"
|
||||||
|
class="q-gutter-x-sm"
|
||||||
>
|
>
|
||||||
<q-btn
|
<q-btn
|
||||||
outline
|
outline
|
||||||
|
|
@ -723,7 +661,7 @@ onMounted(async () => {
|
||||||
dense
|
dense
|
||||||
icon-right="close"
|
icon-right="close"
|
||||||
class="q-px-sm"
|
class="q-px-sm"
|
||||||
label="ยับยั้ง"
|
label="ไม่อนุญาต"
|
||||||
@click="popUp('passNot', 'oligarch')"
|
@click="popUp('passNot', 'oligarch')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -750,28 +688,24 @@ onMounted(async () => {
|
||||||
rowsApprover &&
|
rowsApprover &&
|
||||||
rowsApprover.approvers &&
|
rowsApprover.approvers &&
|
||||||
rowsApprover.approvers[0]?.approveStatus
|
rowsApprover.approvers[0]?.approveStatus
|
||||||
? convertStatusText(rowsApprover?.approvers[0].approveStatus)
|
? convertStatusText(
|
||||||
|
rowsApprover?.approvers[0].approveStatus,
|
||||||
|
"ไม่อนุญาต"
|
||||||
|
)
|
||||||
: "-"
|
: "-"
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="col-xs-6 row items-start">
|
|
||||||
<div class="col-12 text-top">วันสุดท้ายที่ยับยั้ง</div>
|
|
||||||
<div class="col-12 text-detail">
|
|
||||||
{{
|
|
||||||
dataDetail.oligarchRejectDate !== null
|
|
||||||
? date2Thai(dataDetail.oligarchRejectDate)
|
|
||||||
: "-"
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
<div class="col-xs-12 row items-start">
|
<div class="col-xs-12 row items-start">
|
||||||
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
||||||
<div class="col-12 text-detail">
|
<div class="col-12 text-detail">
|
||||||
{{
|
{{
|
||||||
dataDetail.oligarchReject
|
rowsApprover &&
|
||||||
? dataDetail.oligarchApproveReason
|
rowsApprover.approvers &&
|
||||||
: dataDetail.oligarchApproveReason
|
rowsApprover.approvers[0]?.comment
|
||||||
|
? rowsApprover?.approvers[0].comment
|
||||||
|
: "-"
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -780,6 +714,7 @@ onMounted(async () => {
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
<!-- ส่งไปพิจารณา -->
|
<!-- ส่งไปพิจารณา -->
|
||||||
|
|
||||||
<q-card
|
<q-card
|
||||||
bordered
|
bordered
|
||||||
class="row col-12 text-dark q-mt-sm q-pa-sm"
|
class="row col-12 text-dark q-mt-sm q-pa-sm"
|
||||||
|
|
@ -1046,7 +981,7 @@ onMounted(async () => {
|
||||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||||
<DialogHeader
|
<DialogHeader
|
||||||
:tittle="`${
|
:tittle="`${
|
||||||
actionPass ? 'อนุญาตยกเลิกการลาออก' : 'ยับยั้งยกเลิกการลาออก'
|
actionPass ? 'อนุญาตยกเลิกการลาออก' : 'ไม่อนุญาตยกเลิกการลาออก'
|
||||||
}`"
|
}`"
|
||||||
:close="closeModal"
|
:close="closeModal"
|
||||||
/>
|
/>
|
||||||
|
|
@ -1067,7 +1002,7 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-actions align="right" class="bg-white text-teal">
|
<q-card-actions align="right">
|
||||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,11 @@ import { useRouter } from "vue-router";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useDataStore } from "@/modules/06_retirement/store/resignMain";
|
import { useDataStore } from "@/modules/06_retirement/store/resignMain";
|
||||||
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
|
|
@ -290,7 +294,11 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
</q-select>
|
</q-select>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="checkPermission($route)?.attrIsUpdate"
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
@click="openModalOrder"
|
@click="openModalOrder"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import genReport from "@/plugins/genreport";
|
import genReport from "@/plugins/genreport";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
|
||||||
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
||||||
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
|
import { useRoleWorkflowDataStore } from "@/stores/roleWorkflow";
|
||||||
|
|
||||||
|
|
@ -28,7 +27,6 @@ import type {
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
|
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
|
||||||
import CardProfile from "@/components/CardProfile.vue";
|
import CardProfile from "@/components/CardProfile.vue";
|
||||||
import WorkFlow from "@/components/Workflow/Main.vue";
|
|
||||||
import DialogAddCommander from "@/modules/06_retirement/components/DialogAddCommander.vue";
|
import DialogAddCommander from "@/modules/06_retirement/components/DialogAddCommander.vue";
|
||||||
|
|
||||||
/** Use */
|
/** Use */
|
||||||
|
|
@ -56,14 +54,8 @@ const modalPersonal = ref<boolean>(false);
|
||||||
const personId = ref<string>("");
|
const personId = ref<string>("");
|
||||||
const roleUser = ref<string>("");
|
const roleUser = ref<string>("");
|
||||||
const dataProfile = ref<DataProfile>();
|
const dataProfile = ref<DataProfile>();
|
||||||
|
const approveStep = ref<string>("");
|
||||||
|
|
||||||
const approveCheck = computed(() => {
|
|
||||||
return (
|
|
||||||
rowsApprover.value?.commanders?.every(
|
|
||||||
(commander) => commander.approveStatus === "APPROVE"
|
|
||||||
) ?? false
|
|
||||||
);
|
|
||||||
});
|
|
||||||
const idCheck = computed(() => {
|
const idCheck = computed(() => {
|
||||||
if (
|
if (
|
||||||
typeAdd.value == "COMMANDER" &&
|
typeAdd.value == "COMMANDER" &&
|
||||||
|
|
@ -84,29 +76,6 @@ const idCheck = computed(() => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const approvePendingCheck = computed(() => {
|
|
||||||
const commanders = rowsApprover.value?.commanders || [];
|
|
||||||
const index = commanders.findIndex((c) => c.profileId === keycloakId.value);
|
|
||||||
|
|
||||||
if (index === -1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const currentCommander = commanders[index];
|
|
||||||
|
|
||||||
if (currentCommander.approveStatus !== "PENDING") {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (index === 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const previousApproved = commanders
|
|
||||||
.slice(0, index)
|
|
||||||
.every((c) => c.approveStatus === "APPROVE");
|
|
||||||
return previousApproved;
|
|
||||||
});
|
|
||||||
const isOfficer = ref<boolean>(false);
|
const isOfficer = ref<boolean>(false);
|
||||||
const isStaff = ref<boolean>(false);
|
const isStaff = ref<boolean>(false);
|
||||||
const profileType = ref<string>("");
|
const profileType = ref<string>("");
|
||||||
|
|
@ -171,6 +140,9 @@ const columnsCommanders = ref<QTableProps["columns"]>([
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "วันสุดท้ายที่ยับยั้ง",
|
label: "วันสุดท้ายที่ยับยั้ง",
|
||||||
field: "rejectDate",
|
field: "rejectDate",
|
||||||
|
format(val, row) {
|
||||||
|
return date2Thai(val);
|
||||||
|
},
|
||||||
sortable: true,
|
sortable: true,
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
|
|
@ -208,7 +180,6 @@ const dataDetail = ref<any>({
|
||||||
reasonResign: "",
|
reasonResign: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const workflowRef = ref<any>(null);
|
|
||||||
const organizationPositionOld = ref<string>("");
|
const organizationPositionOld = ref<string>("");
|
||||||
const positionTypeOld = ref<string>("");
|
const positionTypeOld = ref<string>("");
|
||||||
const positionLevelOld = ref<string>("");
|
const positionLevelOld = ref<string>("");
|
||||||
|
|
@ -225,20 +196,6 @@ const actionPass = ref<boolean>(false);
|
||||||
const reasonReign = ref<string>("");
|
const reasonReign = ref<string>("");
|
||||||
const dateBreak = ref<Date | null>(null);
|
const dateBreak = ref<Date | null>(null);
|
||||||
|
|
||||||
const isCheckData = computed(() => {
|
|
||||||
if (
|
|
||||||
organizationPositionOld.value !== "" &&
|
|
||||||
positionTypeOld.value !== "" &&
|
|
||||||
positionLevelOld.value !== "" &&
|
|
||||||
posNo.value !== "" &&
|
|
||||||
date.value !== null &&
|
|
||||||
dataDetail.value.commanderReject !== null &&
|
|
||||||
dataDetail.value.oligarchReject !== null
|
|
||||||
) {
|
|
||||||
return true;
|
|
||||||
} else return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
/** คอลัมน์ */
|
/** คอลัมน์ */
|
||||||
const rows = ref<TypeFile[]>([]);
|
const rows = ref<TypeFile[]>([]);
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
|
@ -271,13 +228,10 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/**เปิด-ปิด modal */
|
/**ฟังก์ชันปิด popup อนุญาตการลาออก,ยับยั้งการลาออก*/
|
||||||
function closeModal() {
|
function closeModal() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
}
|
}
|
||||||
function openModal() {
|
|
||||||
modal.value = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const file = ref<any>(null);
|
const file = ref<any>(null);
|
||||||
const fileList = ref<FileList[]>([]);
|
const fileList = ref<FileList[]>([]);
|
||||||
|
|
@ -293,6 +247,7 @@ const rowsFileDownload = ref<rowFile[]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
/** ฟังก์ชันคำนวนวันที่ขอลาออกจากราชการ*/
|
||||||
function diffDate() {
|
function diffDate() {
|
||||||
if (date.value !== null && dateLeave.value !== null) {
|
if (date.value !== null && dateLeave.value !== null) {
|
||||||
const time = dateLeave.value.getTime() - date.value.getTime();
|
const time = dateLeave.value.getTime() - date.value.getTime();
|
||||||
|
|
@ -306,9 +261,11 @@ function diffDate() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** นำข้อมูลมาจาก API*/
|
/**
|
||||||
|
* ฟังก์ชันดึงข้อมูลรายละเอียดการลาออก
|
||||||
|
* @param id รายการลาออก
|
||||||
|
*/
|
||||||
async function fetchData(id: string) {
|
async function fetchData(id: string) {
|
||||||
showLoader();
|
|
||||||
await http
|
await http
|
||||||
.get(config.API.resingByidEMP(id))
|
.get(config.API.resingByidEMP(id))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
|
|
@ -341,7 +298,7 @@ async function fetchData(id: string) {
|
||||||
isNoDebt.value = data.isNoDebt;
|
isNoDebt.value = data.isNoDebt;
|
||||||
isNoBurden.value = data.isNoBurden;
|
isNoBurden.value = data.isNoBurden;
|
||||||
isDiscipline.value = data.isDiscipline;
|
isDiscipline.value = data.isDiscipline;
|
||||||
|
approveStep.value = data.approveStep;
|
||||||
statusCheck.value = data.status;
|
statusCheck.value = data.status;
|
||||||
profileType.value = data.profileType;
|
profileType.value = data.profileType;
|
||||||
keycloakUserId.value = data.keycloakUserId;
|
keycloakUserId.value = data.keycloakUserId;
|
||||||
|
|
@ -352,32 +309,40 @@ async function fetchData(id: string) {
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**Pop up */
|
/**
|
||||||
|
* ฟังก์ชันเปิด popup อนุญาต,ยับยั้ง
|
||||||
|
* @param action อนุญาต, ยับยั้ง
|
||||||
|
* @param type ผู้บังคับบัญชา, ผู้มีอำนาจ
|
||||||
|
*/
|
||||||
function popUp(action: "pass" | "passNot", type: string) {
|
function popUp(action: "pass" | "passNot", type: string) {
|
||||||
reasonReign.value = "";
|
reasonReign.value = "";
|
||||||
dateBreak.value = null;
|
dateBreak.value = null;
|
||||||
actionPass.value = action === "pass";
|
actionPass.value = action === "pass";
|
||||||
roleUser.value = type;
|
roleUser.value = type;
|
||||||
openModal();
|
modal.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//เงื่อนไขpop up
|
/** ฟังก์ชันบันทึกผลการพิจารณา*/
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
if (actionPass.value) {
|
if (roleUser.value === "commander" && actionPass.value) {
|
||||||
confirmpopUp();
|
confirmpopUp("/comander");
|
||||||
} else {
|
} else if (roleUser.value === "commander" && !actionPass.value) {
|
||||||
rejectpopUp();
|
rejectpopUp("/comander");
|
||||||
|
} else if (roleUser.value === "oligarch" && actionPass.value) {
|
||||||
|
confirmpopUp("");
|
||||||
|
} else if (roleUser.value === "oligarch" && !actionPass.value) {
|
||||||
|
rejectpopUp("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//pop up ยืนยันการอนุญาต
|
/**
|
||||||
async function confirmpopUp() {
|
* ฟังก์ชันยืนยันการอนุญาตผลการพิจารณา
|
||||||
|
* @param path ประเภทของผู้พิจารณา comander === 'บังคับบัญชา', '' === 'ผู้มีอำนาจ'
|
||||||
|
*/
|
||||||
|
async function confirmpopUp(path: string) {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
async () => {
|
async () => {
|
||||||
|
|
@ -390,7 +355,8 @@ async function confirmpopUp() {
|
||||||
config.API.commanderApproveRetirement(
|
config.API.commanderApproveRetirement(
|
||||||
"-employee",
|
"-employee",
|
||||||
id.value,
|
id.value,
|
||||||
"approve"
|
"approve",
|
||||||
|
path
|
||||||
),
|
),
|
||||||
body
|
body
|
||||||
)
|
)
|
||||||
|
|
@ -411,8 +377,11 @@ async function confirmpopUp() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//pop up การยับยั้งสำเร็จ
|
/**
|
||||||
async function rejectpopUp() {
|
ฟังก์ชันยืนยันการยับยั้งผลการพิจารณา
|
||||||
|
* @param path ประเภทของผู้พิจารณา comander === 'บังคับบัญชา', '' === 'ผู้มีอำนาจ'
|
||||||
|
*/
|
||||||
|
async function rejectpopUp(path: string) {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
async () => {
|
async () => {
|
||||||
|
|
@ -426,7 +395,8 @@ async function rejectpopUp() {
|
||||||
config.API.commanderApproveRetirement(
|
config.API.commanderApproveRetirement(
|
||||||
"-employee",
|
"-employee",
|
||||||
id.value,
|
id.value,
|
||||||
"reject"
|
"reject",
|
||||||
|
path
|
||||||
),
|
),
|
||||||
body
|
body
|
||||||
)
|
)
|
||||||
|
|
@ -447,9 +417,7 @@ async function rejectpopUp() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** ฟังก์ชันยกเลิกการแก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||||
* กดยกเลิก
|
|
||||||
*/
|
|
||||||
async function clickCancel() {
|
async function clickCancel() {
|
||||||
edit.value = false;
|
edit.value = false;
|
||||||
const data = dataDetail.value;
|
const data = dataDetail.value;
|
||||||
|
|
@ -470,17 +438,20 @@ async function clickCancel() {
|
||||||
isDiscipline.value = data.isDiscipline;
|
isDiscipline.value = data.isDiscipline;
|
||||||
}
|
}
|
||||||
myForm.value?.resetValidation();
|
myForm.value?.resetValidation();
|
||||||
// await fetchData(id.value);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* กดยกเลิก
|
|
||||||
*/
|
|
||||||
async function clickCancelConditions() {
|
|
||||||
await fetchData(id.value);
|
|
||||||
conditions.value = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Function บันทึก รายการตรวจสอบเงื่อนไขต่างๆ*/
|
/** ฟังก์ขันยกเลิกการแก้ไขเงื่อนไขต่างๆ*/
|
||||||
|
async function clickCancelConditions() {
|
||||||
|
const data = dataDetail.value;
|
||||||
|
if (data) {
|
||||||
|
isNoDebt.value = data.isNoDebt;
|
||||||
|
isNoBurden.value = data.isNoBurden;
|
||||||
|
isDiscipline.value = data.isDiscipline;
|
||||||
|
conditions.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ชันบันทึกรายการตรวจสอบเงื่อนไขต่างๆ*/
|
||||||
function onSubmitConditions() {
|
function onSubmitConditions() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -504,7 +475,7 @@ function onSubmitConditions() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Function บันทึก ,แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
/** ฟังก์ชันบันทึกข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||||
function onSubmitAttached() {
|
function onSubmitAttached() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
|
@ -538,7 +509,7 @@ function onSubmitAttached() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function เพิ่ม Class เวลา Edit
|
* ฟังก์ชัน Class เวลา Edit
|
||||||
* @param val เมื่อเป็นEdit จะเปลี่ยน Class
|
* @param val เมื่อเป็นEdit จะเปลี่ยน Class
|
||||||
*/
|
*/
|
||||||
function getClass(val: boolean) {
|
function getClass(val: boolean) {
|
||||||
|
|
@ -548,17 +519,11 @@ function getClass(val: boolean) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** แปลง StatusOrder */
|
/**
|
||||||
function statusOrder(val: boolean) {
|
* ฟังก์ชันดาว์นโหลดไฟล์
|
||||||
switch (val) {
|
* @param type นามสกุลไฟล์
|
||||||
case true:
|
* @param fileName ชื่อไฟล์ที่ต้องการโหลด
|
||||||
return "ยับยั้ง";
|
*/
|
||||||
case false:
|
|
||||||
return "อนุญาต";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ดาว์นโหลดไฟล์
|
|
||||||
async function fileDownload(type: string, fileName: string) {
|
async function fileDownload(type: string, fileName: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -575,12 +540,16 @@ async function fileDownload(type: string, fileName: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ฟังก์ชันอัปเดท modal ของ popup ทะเบียนประวัติ
|
||||||
|
* @param modal modal
|
||||||
|
*/
|
||||||
function updatemodalPersonal(modal: boolean) {
|
function updatemodalPersonal(modal: boolean) {
|
||||||
modalPersonal.value = modal;
|
modalPersonal.value = modal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ชันดึงข้อมูลไฟล์*/
|
||||||
async function fetchFile() {
|
async function fetchFile() {
|
||||||
showLoader();
|
|
||||||
await http
|
await http
|
||||||
.get(config.API.file("พ้นจากราชการ", "หลักฐานลาออก", id.value))
|
.get(config.API.file("พ้นจากราชการ", "หลักฐานลาออก", id.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
|
|
@ -588,10 +557,10 @@ async function fetchFile() {
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
hideLoader();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ชันสร้าง Path ที่เก็บไฟล์*/
|
||||||
function uploadFiles() {
|
function uploadFiles() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -619,6 +588,10 @@ function uploadFiles() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ฟังก์ชันอัปโหลดไฟล์
|
||||||
|
* @param uploadUrl ที่อยู่ที่เก็บไฟล์
|
||||||
|
*/
|
||||||
async function uploadFileURL(uploadUrl: string) {
|
async function uploadFileURL(uploadUrl: string) {
|
||||||
const Data = new FormData();
|
const Data = new FormData();
|
||||||
Data.append("file", file.value);
|
Data.append("file", file.value);
|
||||||
|
|
@ -642,6 +615,10 @@ async function uploadFileURL(uploadUrl: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ฟังก์ชันโหลดไฟล์
|
||||||
|
* @param fileName ชื่อไฟล์ที่ต้องการโหลด
|
||||||
|
*/
|
||||||
async function downloadFiles(fileName: string) {
|
async function downloadFiles(fileName: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -661,13 +638,13 @@ async function downloadFiles(fileName: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ลบไฟล์
|
* ฟังก์ชันลบไฟล์
|
||||||
* @param id id file
|
* @param fileName ชื่อไฟล์ที่ต้องการลบ
|
||||||
*/
|
*/
|
||||||
function removeFile(fileName: string) {
|
function removeFile(fileName: string) {
|
||||||
dialogRemove($q, () => {
|
dialogRemove($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
await http
|
||||||
.delete(
|
.delete(
|
||||||
config.API.fileByFile(
|
config.API.fileByFile(
|
||||||
"พ้นจากราชการ",
|
"พ้นจากราชการ",
|
||||||
|
|
@ -676,20 +653,25 @@ function removeFile(fileName: string) {
|
||||||
fileName
|
fileName
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(async () => {
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
await fetchFile();
|
await fetchFile();
|
||||||
success($q, `ลบไฟล์สำเร็จ`);
|
success($q, `ลบไฟล์สำเร็จ`);
|
||||||
hideLoader();
|
|
||||||
}, 1000);
|
}, 1000);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ฟังก์ชันแปลงเหตุผลที่ลาออก
|
||||||
|
* @param val เหตุผลที่ลาออก
|
||||||
|
*/
|
||||||
function convertStatus(val: string) {
|
function convertStatus(val: string) {
|
||||||
if (/^[A-Za-z]+$/.test(val)) {
|
if (/^[A-Za-z]+$/.test(val)) {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
|
|
@ -707,12 +689,16 @@ function convertStatus(val: string) {
|
||||||
} else return val;
|
} else return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** เปิด POP UP */
|
/**
|
||||||
|
* ฟังกฺชันเปิด pop up เพิ่มรายชื่อพิจารณา
|
||||||
|
* @param type COMMANDER === ผู้บังคับบัญชา, APPROVER === ผู้มีอำนาจ
|
||||||
|
*/
|
||||||
function onAddPerson(type: string) {
|
function onAddPerson(type: string) {
|
||||||
modalAdd.value = true;
|
modalAdd.value = true;
|
||||||
typeAdd.value = type;
|
typeAdd.value = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ชันดึงข้อมูลสิทธ์ของผู้ใช่*/
|
||||||
async function checkOfficer() {
|
async function checkOfficer() {
|
||||||
try {
|
try {
|
||||||
const data = await fetchDataCheckIsoffice("SYS_RESIGN_EMP");
|
const data = await fetchDataCheckIsoffice("SYS_RESIGN_EMP");
|
||||||
|
|
@ -723,6 +709,7 @@ async function checkOfficer() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ชันยืนยันการส่งไปพิจารณา*/
|
||||||
function onSend() {
|
function onSend() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -730,20 +717,23 @@ function onSend() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.sendApproveRetirement("-employee", id.value))
|
.get(config.API.sendApproveRetirement("-employee", id.value))
|
||||||
.then(async (res) => {
|
.then(async () => {
|
||||||
await fetchData(id.value);
|
await fetchData(id.value);
|
||||||
success($q, "ส่งไปพิจารณา");
|
success($q, "ส่งไปพิจารณา");
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {});
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
"ยืนยันการส่งไปพิจารณา",
|
"ยืนยันการส่งไปพิจารณา",
|
||||||
"ต้องการส่งไปพิจารณาใช่หรือไม่"
|
"ต้องการส่งไปพิจารณาใช่หรือไม่"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ชันดึงข้อมูลตำแหน่งจาก Keycloak*/
|
||||||
async function fetchKeycloakPosition() {
|
async function fetchKeycloakPosition() {
|
||||||
if (keycloakId.value == "") {
|
if (keycloakId.value == "") {
|
||||||
await http
|
await http
|
||||||
|
|
@ -762,10 +752,10 @@ async function fetchKeycloakPosition() {
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
await fetchData(id.value),
|
fetchData(id.value),
|
||||||
await fetchKeycloakPosition(),
|
fetchKeycloakPosition(),
|
||||||
fetchFile(),
|
fetchFile(),
|
||||||
await checkOfficer(),
|
checkOfficer(),
|
||||||
]).finally(() => {
|
]).finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
|
|
@ -797,39 +787,6 @@ onMounted(async () => {
|
||||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||||
<div class="q-pl-sm text-weight-bold text-dark">ข้อมูลการลาออก</div>
|
<div class="q-pl-sm text-weight-bold text-dark">ข้อมูลการลาออก</div>
|
||||||
<!-- <q-space />
|
|
||||||
<div
|
|
||||||
class="q-gutter-x-sm"
|
|
||||||
v-if="
|
|
||||||
(roleUser === 'officer' && dataDetail.officerReject === null) ||
|
|
||||||
(roleUser === 'commander' &&
|
|
||||||
dataDetail.commanderReject === null &&
|
|
||||||
dataDetail.officerReject !== null) ||
|
|
||||||
(roleUser === 'oligarch' &&
|
|
||||||
dataDetail.oligarchReject === null &&
|
|
||||||
dataDetail.commanderReject !== null &&
|
|
||||||
dataDetail.officerReject !== null)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<q-btn
|
|
||||||
outline
|
|
||||||
color="primary"
|
|
||||||
dense
|
|
||||||
icon-right="check"
|
|
||||||
class="q-px-sm"
|
|
||||||
label="อนุญาต"
|
|
||||||
@click="popUp('pass')"
|
|
||||||
/>
|
|
||||||
<q-btn
|
|
||||||
outline
|
|
||||||
color="red"
|
|
||||||
dense
|
|
||||||
icon-right="close"
|
|
||||||
class="q-px-sm"
|
|
||||||
label="ยับยั้ง"
|
|
||||||
@click="popUp('passNot')"
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
<div class="row col-12 q-pa-md">
|
<div class="row col-12 q-pa-md">
|
||||||
|
|
@ -1011,11 +968,7 @@ onMounted(async () => {
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="
|
v-if="!checkRoutePermisson && isStaff && approveStep === 'st1'"
|
||||||
!checkRoutePermisson &&
|
|
||||||
isStaff &&
|
|
||||||
dataDetail.statusMain === 'WAITTING'
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<div v-if="!conditions">
|
<div v-if="!conditions">
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
@ -1177,51 +1130,6 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
<!-- ผลการพิจารณาของการเจ้าหน้าที่ของหน่วยงาน -->
|
|
||||||
<!-- <q-card bordered class="row col-12 text-dark q-mt-sm">
|
|
||||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
|
||||||
<div class="q-pl-sm text-weight-bold text-dark">
|
|
||||||
ผลการพิจารณาของการเจ้าหน้าที่ของหน่วยงาน
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12"><q-separator /></div>
|
|
||||||
<div class="row col-12 q-pa-md">
|
|
||||||
<div class="col-12 row bg-white q-col-gutter-md">
|
|
||||||
<div class="col-xs-6 row items-start">
|
|
||||||
<div class="col-12 text-top">สถานะ</div>
|
|
||||||
<div class="col-12 text-detail">
|
|
||||||
{{
|
|
||||||
dataDetail.officerReject !== null
|
|
||||||
? statusOrder(dataDetail.officerReject)
|
|
||||||
: "-"
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-xs-6 row items-start">
|
|
||||||
<div class="col-12 text-top">วันสุดท้ายที่ยับยั้ง</div>
|
|
||||||
<div class="col-12 text-detail">
|
|
||||||
{{
|
|
||||||
dataDetail.officerRejectDate !== null
|
|
||||||
? date2Thai(dataDetail.officerRejectDate)
|
|
||||||
: "-"
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-xs-12 row items-start">
|
|
||||||
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
|
||||||
|
|
||||||
<div class="col-12 text-detail">
|
|
||||||
{{
|
|
||||||
dataDetail.officerReject
|
|
||||||
? dataDetail.officerRejectReason
|
|
||||||
: dataDetail.officerApproveReason
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</q-card> -->
|
|
||||||
|
|
||||||
<!-- ผลการพิจารณาของผู้บังคับบัญชา -->
|
<!-- ผลการพิจารณาของผู้บังคับบัญชา -->
|
||||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||||
|
|
@ -1229,7 +1137,7 @@ onMounted(async () => {
|
||||||
ผลการพิจารณาของผู้บังคับบัญชา
|
ผลการพิจารณาของผู้บังคับบัญชา
|
||||||
</div>
|
</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
v-if="!checkRoutePermisson && isStaff && approveStep === 'st1'"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
icon="add"
|
icon="add"
|
||||||
|
|
@ -1242,33 +1150,6 @@ onMounted(async () => {
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
<q-space />
|
<q-space />
|
||||||
<!-- <div
|
|
||||||
class="q-gutter-x-sm"
|
|
||||||
v-if="
|
|
||||||
isDirector &&
|
|
||||||
dataDetail.commanderReject === null &&
|
|
||||||
dataDetail.statusMain === 'WAITTING'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<q-btn
|
|
||||||
outline
|
|
||||||
color="primary"
|
|
||||||
dense
|
|
||||||
icon-right="check"
|
|
||||||
class="q-px-sm"
|
|
||||||
label="อนุญาต"
|
|
||||||
@click="popUp('pass', 'commander')"
|
|
||||||
/>
|
|
||||||
<q-btn
|
|
||||||
outline
|
|
||||||
color="red"
|
|
||||||
dense
|
|
||||||
icon-right="close"
|
|
||||||
class="q-px-sm"
|
|
||||||
label="ยับยั้ง"
|
|
||||||
@click="popUp('passNot', 'commander')"
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
|
|
@ -1299,25 +1180,19 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.name == 'comment'">
|
<div v-else-if="col.name == 'comment'">
|
||||||
<div
|
<div
|
||||||
|
class="q-gutter-x-xs"
|
||||||
v-if="
|
v-if="
|
||||||
props.row.approveStatus == 'PENDING' &&
|
props.row.approveStatus == 'PENDING' &&
|
||||||
props.row.comment == ''
|
props.row.comment == '' &&
|
||||||
|
approveStep === 'st2'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<q-btn
|
<q-btn
|
||||||
:disable="
|
v-if="
|
||||||
statusCheck == 'NEW' ||
|
props.row.profileId === keycloakId &&
|
||||||
!approvePendingCheck ||
|
approveStep === 'st2'
|
||||||
(props.row.profileId !== keycloakId &&
|
|
||||||
checkPermission($route)?.attrIsUpdate)
|
|
||||||
"
|
|
||||||
:outline="
|
|
||||||
props.row.profileId !== keycloakId ||
|
|
||||||
statusCheck == 'NEW' ||
|
|
||||||
!approvePendingCheck
|
|
||||||
? false
|
|
||||||
: true
|
|
||||||
"
|
"
|
||||||
|
outline
|
||||||
dense
|
dense
|
||||||
color="primary"
|
color="primary"
|
||||||
icon-right="check"
|
icon-right="check"
|
||||||
|
|
@ -1325,20 +1200,13 @@ onMounted(async () => {
|
||||||
label="อนุญาต"
|
label="อนุญาต"
|
||||||
@click="popUp('pass', 'commander')"
|
@click="popUp('pass', 'commander')"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
:disable="
|
v-if="
|
||||||
statusCheck == 'NEW' ||
|
props.row.profileId === keycloakId &&
|
||||||
!approvePendingCheck ||
|
approveStep === 'st2'
|
||||||
(props.row.profileId !== keycloakId &&
|
|
||||||
checkPermission($route)?.attrIsUpdate)
|
|
||||||
"
|
|
||||||
:outline="
|
|
||||||
props.row.profileId !== keycloakId ||
|
|
||||||
statusCheck == 'NEW' ||
|
|
||||||
!approvePendingCheck
|
|
||||||
? false
|
|
||||||
: true
|
|
||||||
"
|
"
|
||||||
|
outline
|
||||||
color="red"
|
color="red"
|
||||||
dense
|
dense
|
||||||
icon-right="close"
|
icon-right="close"
|
||||||
|
|
@ -1347,6 +1215,7 @@ onMounted(async () => {
|
||||||
@click="popUp('passNot', 'commander')"
|
@click="popUp('passNot', 'commander')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else>
|
<div v-else>
|
||||||
{{ props.row.comment ? props.row.comment : "-" }}
|
{{ props.row.comment ? props.row.comment : "-" }}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1375,7 +1244,7 @@ onMounted(async () => {
|
||||||
ผลการพิจารณาของผู้มีอำนาจ
|
ผลการพิจารณาของผู้มีอำนาจ
|
||||||
</div>
|
</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
v-if="!checkRoutePermisson && isStaff && approveStep === 'st1'"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
icon="add"
|
icon="add"
|
||||||
|
|
@ -1387,17 +1256,16 @@ onMounted(async () => {
|
||||||
<q-tooltip>เพิ่มรายชื่อผู้มีอำนาจ</q-tooltip>
|
<q-tooltip>เพิ่มรายชื่อผู้มีอำนาจ</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="q-gutter-x-sm"
|
class="q-gutter-x-sm"
|
||||||
v-if="
|
v-if="
|
||||||
checkPermission($route)?.attrIsUpdate &&
|
!checkRoutePermisson &&
|
||||||
dataDetail.oligarchReject === null &&
|
|
||||||
dataDetail.statusMain === 'WAITTING' &&
|
|
||||||
rowsApprover &&
|
rowsApprover &&
|
||||||
rowsApprover.approvers &&
|
rowsApprover.approvers &&
|
||||||
rowsApprover.approvers[0]?.profileId == keycloakId &&
|
rowsApprover.approvers[0]?.profileId == keycloakId &&
|
||||||
rowsApprover.approvers[0]?.approveStatus == 'PENDING' &&
|
rowsApprover.approvers[0]?.approveStatus == 'PENDING' &&
|
||||||
approveCheck
|
approveStep === 'st3'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
@ -1451,8 +1319,10 @@ onMounted(async () => {
|
||||||
<div class="col-12 text-top">วันสุดท้ายที่ยับยั้ง</div>
|
<div class="col-12 text-top">วันสุดท้ายที่ยับยั้ง</div>
|
||||||
<div class="col-12 text-detail">
|
<div class="col-12 text-detail">
|
||||||
{{
|
{{
|
||||||
dataDetail.oligarchRejectDate !== null
|
rowsApprover &&
|
||||||
? date2Thai(dataDetail.oligarchRejectDate)
|
rowsApprover.approvers &&
|
||||||
|
rowsApprover.approvers[0]?.rejectDate
|
||||||
|
? date2Thai(rowsApprover?.approvers[0].rejectDate)
|
||||||
: "-"
|
: "-"
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1461,19 +1331,23 @@ onMounted(async () => {
|
||||||
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
||||||
<div class="col-12 text-detail">
|
<div class="col-12 text-detail">
|
||||||
{{
|
{{
|
||||||
dataDetail.oligarchReject
|
rowsApprover &&
|
||||||
? dataDetail.oligarchRejectReason
|
rowsApprover.approvers &&
|
||||||
: dataDetail.oligarchApproveReason
|
rowsApprover.approvers[0]?.comment
|
||||||
|
? rowsApprover?.approvers[0].comment
|
||||||
|
: "-"
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
|
<!-- ส่งไปพิจารณา -->
|
||||||
<q-card
|
<q-card
|
||||||
bordered
|
bordered
|
||||||
class="row col-12 text-dark q-mt-sm q-pa-sm"
|
class="row col-12 text-dark q-mt-sm q-pa-sm"
|
||||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
v-if="!checkRoutePermisson && isStaff && approveStep === 'st1'"
|
||||||
>
|
>
|
||||||
<q-btn
|
<q-btn
|
||||||
@click="onSend"
|
@click="onSend"
|
||||||
|
|
@ -1487,6 +1361,7 @@ onMounted(async () => {
|
||||||
><q-tooltip>คลิกเพื่อส่งไปพิจารณา</q-tooltip></q-btn
|
><q-tooltip>คลิกเพื่อส่งไปพิจารณา</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
<!-- แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย -->
|
<!-- แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย -->
|
||||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||||
<q-form
|
<q-form
|
||||||
|
|
@ -1505,8 +1380,9 @@ onMounted(async () => {
|
||||||
<div
|
<div
|
||||||
v-if="
|
v-if="
|
||||||
!checkRoutePermisson &&
|
!checkRoutePermisson &&
|
||||||
isStaff &&
|
(dataDetail.statusMain === 'APPROVE' ||
|
||||||
dataDetail.statusMain === 'WAITTING'
|
dataDetail.statusMain === 'REJECT') &&
|
||||||
|
isStaff
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div class="q-gutter-sm" v-if="!edit">
|
<div class="q-gutter-sm" v-if="!edit">
|
||||||
|
|
@ -1612,24 +1488,7 @@ onMounted(async () => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="col-xs-6 col-sm-3 row">
|
|
||||||
<div class="col-12">
|
|
||||||
<q-input
|
|
||||||
v-model="salary"
|
|
||||||
:outlined="edit"
|
|
||||||
dense
|
|
||||||
:readonly="!edit"
|
|
||||||
:borderless="!edit"
|
|
||||||
hide-bottom-space
|
|
||||||
:label="`${'เงินเดือน'}`"
|
|
||||||
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
|
||||||
lazy-rules
|
|
||||||
:class="getClass(edit)"
|
|
||||||
mask="###,###,###,###"
|
|
||||||
reverse-fill-mask
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
<div class="col-xs-4 row">
|
<div class="col-xs-4 row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|
@ -1731,15 +1590,9 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
</q-form>
|
</q-form>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
<!-- <WorkFlow
|
|
||||||
ref="workflowRef"
|
|
||||||
v-model:is-check-data="isCheckData"
|
|
||||||
:id="id"
|
|
||||||
sys-name="SYS_RESIGN"
|
|
||||||
/> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- popup อนุญาตการลาออก,ยับยั้งการลาออก -->
|
||||||
<q-dialog v-model="modal" persistent>
|
<q-dialog v-model="modal" persistent>
|
||||||
<q-card style="width: 800px">
|
<q-card style="width: 800px">
|
||||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||||
|
|
@ -1825,7 +1678,7 @@ onMounted(async () => {
|
||||||
<DialogAddCommander
|
<DialogAddCommander
|
||||||
v-model:modal="modalAdd"
|
v-model:modal="modalAdd"
|
||||||
:type="typeAdd"
|
:type="typeAdd"
|
||||||
:profileType="'officer'"
|
:profileType="'-employee'"
|
||||||
:get-data="fetchData"
|
:get-data="fetchData"
|
||||||
:id-check="idCheck"
|
:id-check="idCheck"
|
||||||
:keycloak-user-id="keycloakUserId"
|
:keycloak-user-id="keycloakUserId"
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,7 @@ import type {
|
||||||
} from "@/modules/06_retirement/interface/response/Main";
|
} from "@/modules/06_retirement/interface/response/Main";
|
||||||
|
|
||||||
import DialogAddCommander from "@/modules/06_retirement/components/DialogAddCommander.vue";
|
import DialogAddCommander from "@/modules/06_retirement/components/DialogAddCommander.vue";
|
||||||
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
|
|
||||||
import CardProfile from "@/components/CardProfile.vue";
|
import CardProfile from "@/components/CardProfile.vue";
|
||||||
import WorkFlow from "@/components/Workflow/Main.vue";
|
|
||||||
|
|
||||||
/** Use */
|
/** Use */
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
@ -39,22 +37,14 @@ const {
|
||||||
showLoader,
|
showLoader,
|
||||||
hideLoader,
|
hideLoader,
|
||||||
success,
|
success,
|
||||||
|
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
dialogRemove,
|
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
/** ตัวแปร */
|
/** ตัวแปร */
|
||||||
const roleUser = ref<string>("");
|
const roleUser = ref<string>("");
|
||||||
const dataProfile = ref<DataProfile>();
|
const dataProfile = ref<DataProfile>();
|
||||||
|
const approveStep = ref<string>("");
|
||||||
|
|
||||||
const approveCheck = computed(() => {
|
|
||||||
return (
|
|
||||||
rowsApprover.value?.commanders?.every(
|
|
||||||
(commander) => commander.approveStatus === "APPROVE"
|
|
||||||
) ?? false
|
|
||||||
);
|
|
||||||
});
|
|
||||||
const idCheck = computed(() => {
|
const idCheck = computed(() => {
|
||||||
if (
|
if (
|
||||||
typeAdd.value == "COMMANDER" &&
|
typeAdd.value == "COMMANDER" &&
|
||||||
|
|
@ -75,29 +65,6 @@ const idCheck = computed(() => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const approvePendingCheck = computed(() => {
|
|
||||||
const commanders = rowsApprover.value?.commanders || [];
|
|
||||||
const index = commanders.findIndex((c) => c.profileId === keycloakId.value);
|
|
||||||
|
|
||||||
if (index === -1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const currentCommander = commanders[index];
|
|
||||||
|
|
||||||
if (currentCommander.approveStatus !== "PENDING") {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (index === 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const previousApproved = commanders
|
|
||||||
.slice(0, index)
|
|
||||||
.every((c) => c.approveStatus === "APPROVE");
|
|
||||||
return previousApproved;
|
|
||||||
});
|
|
||||||
const isOfficer = ref<boolean>(false);
|
const isOfficer = ref<boolean>(false);
|
||||||
const profileType = ref<string>("");
|
const profileType = ref<string>("");
|
||||||
const keycloakUserId = ref<string>("");
|
const keycloakUserId = ref<string>("");
|
||||||
|
|
@ -155,15 +122,6 @@ const columnsCommanders = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "rejectDate",
|
|
||||||
align: "left",
|
|
||||||
label: "วันสุดท้ายที่ยับยั้ง",
|
|
||||||
field: "rejectDate",
|
|
||||||
sortable: true,
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const id = ref<string>(route.params.id.toString());
|
const id = ref<string>(route.params.id.toString());
|
||||||
|
|
@ -193,7 +151,6 @@ const dataDetail = ref<any>({
|
||||||
statusMain: "",
|
statusMain: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const workflowRef = ref<any>(null);
|
|
||||||
const organizationPositionOld = ref<string>("");
|
const organizationPositionOld = ref<string>("");
|
||||||
const positionTypeOld = ref<string>("");
|
const positionTypeOld = ref<string>("");
|
||||||
const positionLevelOld = ref<string>("");
|
const positionLevelOld = ref<string>("");
|
||||||
|
|
@ -210,32 +167,16 @@ const actionPass = ref<boolean>(false);
|
||||||
const reasonReign = ref<string>("");
|
const reasonReign = ref<string>("");
|
||||||
const dateBreak = ref<Date | null>(null);
|
const dateBreak = ref<Date | null>(null);
|
||||||
|
|
||||||
const isCheckData = computed(() => {
|
|
||||||
if (
|
|
||||||
organizationPositionOld.value !== "" &&
|
|
||||||
positionTypeOld.value !== "" &&
|
|
||||||
positionLevelOld.value !== "" &&
|
|
||||||
posNo.value !== "" &&
|
|
||||||
date.value !== null &&
|
|
||||||
dataDetail.value.commanderReject !== null &&
|
|
||||||
dataDetail.value.oligarchReject !== null
|
|
||||||
) {
|
|
||||||
return true;
|
|
||||||
} else return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
/**เปิด-ปิด modal */
|
/**เปิด-ปิด modal */
|
||||||
function closeModal() {
|
function closeModal() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
}
|
}
|
||||||
function openModal() {
|
|
||||||
modal.value = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const isNoDebt = ref<boolean>(false);
|
const isNoDebt = ref<boolean>(false);
|
||||||
const isNoBurden = ref<boolean>(false);
|
const isNoBurden = ref<boolean>(false);
|
||||||
const isDiscipline = ref<boolean>(false);
|
const isDiscipline = ref<boolean>(false);
|
||||||
|
|
||||||
|
/** ฟังก์ชันคำนวนวันที่ขอลาออกจากราชการ*/
|
||||||
function diffDate() {
|
function diffDate() {
|
||||||
if (date.value !== null && dateLeave.value !== null) {
|
if (date.value !== null && dateLeave.value !== null) {
|
||||||
const time = dateLeave.value.getTime() - date.value.getTime();
|
const time = dateLeave.value.getTime() - date.value.getTime();
|
||||||
|
|
@ -249,9 +190,11 @@ function diffDate() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** นำข้อมูลมาจาก API*/
|
/**
|
||||||
|
* ฟังก์ชันดึงข้อมูลรายละเอียดการยกเลิกลาออก
|
||||||
|
* @param id รายการยกเลิกลาออก
|
||||||
|
*/
|
||||||
async function fetchData(id: string) {
|
async function fetchData(id: string) {
|
||||||
showLoader();
|
|
||||||
await http
|
await http
|
||||||
.get(config.API.listResignEMP() + `/cancel/${id}`)
|
.get(config.API.listResignEMP() + `/cancel/${id}`)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
|
|
@ -268,43 +211,55 @@ async function fetchData(id: string) {
|
||||||
dateLeave.value = data.activeDate ? new Date(data.activeDate) : null;
|
dateLeave.value = data.activeDate ? new Date(data.activeDate) : null;
|
||||||
reason.value = data.reason ?? "";
|
reason.value = data.reason ?? "";
|
||||||
location.value = data.location ?? "";
|
location.value = data.location ?? "";
|
||||||
|
approveStep.value = data.approveStep ?? "";
|
||||||
status.value = data.status ?? "";
|
status.value = data.status ?? "";
|
||||||
remarkHorizontal.value = data.remarkHorizontal ?? "-";
|
remarkHorizontal.value = data.remarkHorizontal ?? "-";
|
||||||
isNoDebt.value = data.isNoDebt;
|
isNoDebt.value = data.isNoDebt;
|
||||||
statusCheck.value = data.status;
|
statusCheck.value = data.status;
|
||||||
isNoBurden.value = data.isNoBurden;
|
isNoBurden.value = data.isNoBurden;
|
||||||
isDiscipline.value = data.isDiscipline;
|
isDiscipline.value = data.isDiscipline;
|
||||||
|
profileType.value = data.profileType;
|
||||||
|
keycloakUserId.value = data.keycloakUserId;
|
||||||
|
|
||||||
|
rowsApprover.value = {
|
||||||
|
commanders: data.commanders,
|
||||||
|
approvers: data.approvers,
|
||||||
|
};
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**Pop up */
|
/**
|
||||||
|
* ฟังก์ชันเปิด popup อนุญาต,ไม่อนุญาต
|
||||||
|
* @param action อนุญาต, ไม่อนุญาต
|
||||||
|
* @param type ผู้บังคับบัญชา, ผู้มีอำนาจ
|
||||||
|
*/
|
||||||
function popUp(action: "pass" | "passNot", type: string) {
|
function popUp(action: "pass" | "passNot", type: string) {
|
||||||
reasonReign.value = "";
|
reasonReign.value = "";
|
||||||
dateBreak.value = null;
|
dateBreak.value = null;
|
||||||
actionPass.value = action === "pass";
|
actionPass.value = action === "pass";
|
||||||
roleUser.value = type;
|
roleUser.value = type;
|
||||||
openModal();
|
modal.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//เงื่อนไขpop up
|
/** ฟังก์ชันยืนยันการอนุญาตผลการพิจารณา*/
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
const body = {
|
const body = {
|
||||||
reason: reasonReign.value,
|
reason: reasonReign.value,
|
||||||
reject: !actionPass.value,
|
Date: new Date(),
|
||||||
};
|
};
|
||||||
|
const action = actionPass.value ? "approve" : "reject";
|
||||||
|
|
||||||
|
const endpoint =
|
||||||
|
roleUser.value === "commander"
|
||||||
|
? config.API.comanderCancelResign("-employee", action, id.value)
|
||||||
|
: config.API.approverCancelResign("-employee", action, id.value);
|
||||||
await http
|
await http
|
||||||
.put(
|
.put(endpoint, body)
|
||||||
config.API.resignRejectEMP(`${roleUser.value}-cancel`, id.value),
|
|
||||||
body
|
|
||||||
)
|
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await fetchData(id.value);
|
await fetchData(id.value);
|
||||||
closeModal();
|
closeModal();
|
||||||
|
|
@ -319,7 +274,7 @@ function onSubmit() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** กดยกเลิก*/
|
/** ฟังก์ชันยกเลิกการแก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||||
async function clickCancel() {
|
async function clickCancel() {
|
||||||
edit.value = false;
|
edit.value = false;
|
||||||
const data = dataDetail.value;
|
const data = dataDetail.value;
|
||||||
|
|
@ -342,7 +297,7 @@ async function clickCancel() {
|
||||||
myForm.value?.resetValidation();
|
myForm.value?.resetValidation();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Function บันทึก ,แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
/** ฟังก์ชันบันทึกข้อมูลเพื่อลงบัญชีแนบท้าย*/
|
||||||
function onSubmitAttached() {
|
function onSubmitAttached() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
|
@ -377,7 +332,7 @@ function onSubmitAttached() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function เพิ่ม Class เวลา Edit
|
* ฟังก์ชัน Class เวลา Edit
|
||||||
* @param val เมื่อเป็นEdit จะเปลี่ยน Class
|
* @param val เมื่อเป็นEdit จะเปลี่ยน Class
|
||||||
*/
|
*/
|
||||||
function getClass(val: boolean) {
|
function getClass(val: boolean) {
|
||||||
|
|
@ -387,37 +342,18 @@ function getClass(val: boolean) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** แปลง StatusOrder */
|
|
||||||
function statusOrder(val: boolean) {
|
|
||||||
switch (val) {
|
|
||||||
case true:
|
|
||||||
return "ยับยั้ง";
|
|
||||||
case false:
|
|
||||||
return "อนุญาต";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const isDirector = ref<boolean>(false);
|
|
||||||
const isStaff = ref<boolean>(false);
|
const isStaff = ref<boolean>(false);
|
||||||
|
|
||||||
function fetchCheckIsofficer() {
|
/**
|
||||||
http
|
* ฟังกฺชันเปิด pop up เพิ่มรายชื่อพิจารณา
|
||||||
.get(config.API.workflowKeycloakSystem("RETIREMENT_CANCEL_EMP"))
|
* @param type COMMANDER === ผู้บังคับบัญชา, APPROVER === ผู้มีอำนาจ
|
||||||
.then((res) => {
|
*/
|
||||||
isStaff.value = res.data.result.isStaff;
|
|
||||||
isDirector.value = res.data.result.isDirector;
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
messageError($q, err);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** เปิด POP UP */
|
|
||||||
function onAddPerson(type: string) {
|
function onAddPerson(type: string) {
|
||||||
modalAdd.value = true;
|
modalAdd.value = true;
|
||||||
typeAdd.value = type;
|
typeAdd.value = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ชันดึงข้อมูลสิทธ์ของผู้ใช่*/
|
||||||
async function checkOfficer() {
|
async function checkOfficer() {
|
||||||
try {
|
try {
|
||||||
const data = await fetchDataCheckIsoffice("SYS_RESIGN_EMP");
|
const data = await fetchDataCheckIsoffice("SYS_RESIGN_EMP");
|
||||||
|
|
@ -428,27 +364,31 @@ async function checkOfficer() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ชันยืนยันการส่งไปพิจารณา*/
|
||||||
function onSend() {
|
function onSend() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
() => {
|
async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
await http
|
||||||
.get(config.API.sendApproveRetirement("-employee", id.value))
|
.get(config.API.officerCancelResign("-employee", id.value))
|
||||||
.then(async (res) => {
|
.then(async () => {
|
||||||
await fetchData(id.value);
|
await fetchData(id.value);
|
||||||
success($q, "ส่งไปพิจารณา");
|
success($q, "ส่งไปพิจารณา");
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {});
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
"ยืนยันการส่งไปพิจารณา",
|
"ยืนยันการส่งไปพิจารณา",
|
||||||
"ต้องการส่งไปพิจารณาใช่หรือไม่"
|
"ต้องการส่งไปพิจารณาใช่หรือไม่"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ชันดึงข้อมูลตำแหน่งจาก Keycloak*/
|
||||||
async function fetchKeycloakPosition() {
|
async function fetchKeycloakPosition() {
|
||||||
if (keycloakId.value == "") {
|
if (keycloakId.value == "") {
|
||||||
await http
|
await http
|
||||||
|
|
@ -465,11 +405,14 @@ async function fetchKeycloakPosition() {
|
||||||
|
|
||||||
/** Hook */
|
/** Hook */
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
showLoader();
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
await fetchKeycloakPosition(),
|
|
||||||
fetchData(id.value),
|
fetchData(id.value),
|
||||||
|
fetchKeycloakPosition(),
|
||||||
checkOfficer(),
|
checkOfficer(),
|
||||||
]);
|
]).finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -487,7 +430,9 @@ onMounted(async () => {
|
||||||
@click="router.push('/retirement/resign-employee')"
|
@click="router.push('/retirement/resign-employee')"
|
||||||
/>
|
/>
|
||||||
รายละเอียดการยกเลิกลาออก
|
รายละเอียดการยกเลิกลาออก
|
||||||
{{ dataDetail.prefix.dataDetail.firstName + " " + dataDetail.lastName }}
|
{{
|
||||||
|
dataDetail.prefix + dataDetail.firstName + " " + dataDetail.lastName
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<CardProfile :type="'employee'" :data="dataProfile as DataProfile" />
|
<CardProfile :type="'employee'" :data="dataProfile as DataProfile" />
|
||||||
|
|
@ -496,39 +441,6 @@ onMounted(async () => {
|
||||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||||
<div class="q-pl-sm text-weight-bold text-dark">ข้อมูลการลาออก</div>
|
<div class="q-pl-sm text-weight-bold text-dark">ข้อมูลการลาออก</div>
|
||||||
<!-- <q-space />
|
|
||||||
<div
|
|
||||||
class="q-gutter-x-sm"
|
|
||||||
v-if="
|
|
||||||
(roleUser === 'officer' && dataDetail.officerReject === null) ||
|
|
||||||
(roleUser === 'commander' &&
|
|
||||||
dataDetail.commanderReject === null &&
|
|
||||||
dataDetail.officerReject !== null) ||
|
|
||||||
(roleUser === 'oligarch' &&
|
|
||||||
dataDetail.oligarchReject === null &&
|
|
||||||
dataDetail.commanderReject !== null &&
|
|
||||||
dataDetail.officerReject !== null)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<q-btn
|
|
||||||
outline
|
|
||||||
color="primary"
|
|
||||||
dense
|
|
||||||
icon-right="check"
|
|
||||||
class="q-px-sm"
|
|
||||||
label="อนุญาต"
|
|
||||||
@click="popUp('pass')"
|
|
||||||
/>
|
|
||||||
<q-btn
|
|
||||||
outline
|
|
||||||
color="red"
|
|
||||||
dense
|
|
||||||
icon-right="close"
|
|
||||||
class="q-px-sm"
|
|
||||||
label="ยับยั้ง"
|
|
||||||
@click="popUp('passNot')"
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
<div class="row col-12 q-pa-md">
|
<div class="row col-12 q-pa-md">
|
||||||
|
|
@ -587,7 +499,7 @@ onMounted(async () => {
|
||||||
ผลการพิจารณาของผู้บังคับบัญชา
|
ผลการพิจารณาของผู้บังคับบัญชา
|
||||||
</div>
|
</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
v-if="!checkRoutePermisson && isStaff && approveStep === 'st1'"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
icon="add"
|
icon="add"
|
||||||
|
|
@ -599,33 +511,6 @@ onMounted(async () => {
|
||||||
<q-tooltip>เพิ่มรายชื่อผู้บังคับบัญชา</q-tooltip>
|
<q-tooltip>เพิ่มรายชื่อผู้บังคับบัญชา</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-space />
|
<q-space />
|
||||||
<!-- <div
|
|
||||||
class="q-gutter-x-sm"
|
|
||||||
v-if="
|
|
||||||
isDirector &&
|
|
||||||
dataDetail.commanderReject === null &&
|
|
||||||
dataDetail.statusMain === 'WAITTING'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<q-btn
|
|
||||||
outline
|
|
||||||
color="primary"
|
|
||||||
dense
|
|
||||||
icon-right="check"
|
|
||||||
class="q-px-sm"
|
|
||||||
label="อนุญาต"
|
|
||||||
@click="popUp('pass', 'commander')"
|
|
||||||
/>
|
|
||||||
<q-btn
|
|
||||||
outline
|
|
||||||
color="red"
|
|
||||||
dense
|
|
||||||
icon-right="close"
|
|
||||||
class="q-px-sm"
|
|
||||||
label="ยับยั้ง"
|
|
||||||
@click="popUp('passNot', 'commander')"
|
|
||||||
/>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
|
|
@ -656,25 +541,19 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.name == 'comment'">
|
<div v-else-if="col.name == 'comment'">
|
||||||
<div
|
<div
|
||||||
|
class="q-gutter-x-xs"
|
||||||
v-if="
|
v-if="
|
||||||
props.row.approveStatus == 'PENDING' &&
|
props.row.approveStatus == 'PENDING' &&
|
||||||
props.row.comment == ''
|
props.row.comment == '' &&
|
||||||
|
approveStep === 'st2'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<q-btn
|
<q-btn
|
||||||
:disable="
|
v-if="
|
||||||
statusCheck == 'NEW' ||
|
props.row.profileId === keycloakId &&
|
||||||
!approvePendingCheck ||
|
approveStep === 'st2'
|
||||||
(props.row.profileId !== keycloakId &&
|
|
||||||
checkPermission($route)?.attrIsUpdate)
|
|
||||||
"
|
|
||||||
:outline="
|
|
||||||
props.row.profileId !== keycloakId ||
|
|
||||||
statusCheck == 'NEW' ||
|
|
||||||
!approvePendingCheck
|
|
||||||
? false
|
|
||||||
: true
|
|
||||||
"
|
"
|
||||||
|
outline
|
||||||
dense
|
dense
|
||||||
color="primary"
|
color="primary"
|
||||||
icon-right="check"
|
icon-right="check"
|
||||||
|
|
@ -683,24 +562,16 @@ onMounted(async () => {
|
||||||
@click="popUp('pass', 'commander')"
|
@click="popUp('pass', 'commander')"
|
||||||
/>
|
/>
|
||||||
<q-btn
|
<q-btn
|
||||||
:disable="
|
v-if="
|
||||||
statusCheck == 'NEW' ||
|
props.row.profileId === keycloakId &&
|
||||||
!approvePendingCheck ||
|
approveStep === 'st2'
|
||||||
(props.row.profileId !== keycloakId &&
|
|
||||||
checkPermission($route)?.attrIsUpdate)
|
|
||||||
"
|
|
||||||
:outline="
|
|
||||||
props.row.profileId !== keycloakId ||
|
|
||||||
statusCheck == 'NEW' ||
|
|
||||||
!approvePendingCheck
|
|
||||||
? false
|
|
||||||
: true
|
|
||||||
"
|
"
|
||||||
|
outline
|
||||||
color="red"
|
color="red"
|
||||||
dense
|
dense
|
||||||
icon-right="close"
|
icon-right="close"
|
||||||
class="q-px-sm"
|
class="q-px-sm"
|
||||||
label="ยับยั้ง"
|
label="ไม่อนุญาต"
|
||||||
@click="popUp('passNot', 'commander')"
|
@click="popUp('passNot', 'commander')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -711,7 +582,7 @@ onMounted(async () => {
|
||||||
<div v-else-if="col.name == 'approveStatus'">
|
<div v-else-if="col.name == 'approveStatus'">
|
||||||
{{
|
{{
|
||||||
props.row.approveStatus
|
props.row.approveStatus
|
||||||
? convertStatusText(props.row.approveStatus)
|
? convertStatusText(props.row.approveStatus, "ไม่อนุญาต")
|
||||||
: "-"
|
: "-"
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -732,7 +603,8 @@ onMounted(async () => {
|
||||||
ผลการพิจารณาของผู้มีอำนาจ
|
ผลการพิจารณาของผู้มีอำนาจ
|
||||||
</div>
|
</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
q-btn
|
||||||
|
v-if="!checkRoutePermisson && isStaff && approveStep === 'st1'"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
icon="add"
|
icon="add"
|
||||||
|
|
@ -748,14 +620,12 @@ onMounted(async () => {
|
||||||
<div
|
<div
|
||||||
class="q-gutter-x-sm"
|
class="q-gutter-x-sm"
|
||||||
v-if="
|
v-if="
|
||||||
checkPermission($route)?.attrIsUpdate &&
|
!checkRoutePermisson &&
|
||||||
dataDetail.oligarchReject === null &&
|
|
||||||
dataDetail.statusMain === 'WAITTING' &&
|
|
||||||
rowsApprover &&
|
rowsApprover &&
|
||||||
rowsApprover.approvers &&
|
rowsApprover.approvers &&
|
||||||
rowsApprover.approvers[0]?.profileId == keycloakId &&
|
rowsApprover.approvers[0]?.profileId == keycloakId &&
|
||||||
rowsApprover.approvers[0]?.approveStatus == 'PENDING' &&
|
rowsApprover.approvers[0]?.approveStatus == 'PENDING' &&
|
||||||
approveCheck
|
approveStep === 'st3'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
@ -773,7 +643,7 @@ onMounted(async () => {
|
||||||
dense
|
dense
|
||||||
icon-right="close"
|
icon-right="close"
|
||||||
class="q-px-sm"
|
class="q-px-sm"
|
||||||
label="ยับยั้ง"
|
label="ไม่อนุญาต"
|
||||||
@click="popUp('passNot', 'oligarch')"
|
@click="popUp('passNot', 'oligarch')"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -800,28 +670,24 @@ onMounted(async () => {
|
||||||
rowsApprover &&
|
rowsApprover &&
|
||||||
rowsApprover.approvers &&
|
rowsApprover.approvers &&
|
||||||
rowsApprover.approvers[0]?.approveStatus
|
rowsApprover.approvers[0]?.approveStatus
|
||||||
? convertStatusText(rowsApprover?.approvers[0].approveStatus)
|
? convertStatusText(
|
||||||
|
rowsApprover?.approvers[0].approveStatus,
|
||||||
|
"ไม่อนุญาต"
|
||||||
|
)
|
||||||
: "-"
|
: "-"
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="col-xs-6 row items-start">
|
|
||||||
<div class="col-12 text-top">วันสุดท้ายที่ยับยั้ง</div>
|
|
||||||
<div class="col-12 text-detail">
|
|
||||||
{{
|
|
||||||
dataDetail.oligarchRejectDate !== null
|
|
||||||
? date2Thai(dataDetail.oligarchRejectDate)
|
|
||||||
: "-"
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
<div class="col-xs-12 row items-start">
|
<div class="col-xs-12 row items-start">
|
||||||
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
<div class="col-12 text-top">ความคิดเห็นและเหตุผล</div>
|
||||||
<div class="col-12 text-detail">
|
<div class="col-12 text-detail">
|
||||||
{{
|
{{
|
||||||
dataDetail.oligarchReject
|
rowsApprover &&
|
||||||
? dataDetail.oligarchApproveReason
|
rowsApprover.approvers &&
|
||||||
: dataDetail.oligarchApproveReason
|
rowsApprover.approvers[0]?.comment
|
||||||
|
? rowsApprover?.approvers[0].comment
|
||||||
|
: "-"
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -831,7 +697,7 @@ onMounted(async () => {
|
||||||
<q-card
|
<q-card
|
||||||
bordered
|
bordered
|
||||||
class="row col-12 text-dark q-mt-sm q-pa-sm"
|
class="row col-12 text-dark q-mt-sm q-pa-sm"
|
||||||
v-if="statusCheck == 'WAITTING' && (isOfficer || isStaff)"
|
v-if="!checkRoutePermisson && isStaff && approveStep === 'st1'"
|
||||||
>
|
>
|
||||||
<q-btn
|
<q-btn
|
||||||
@click="onSend"
|
@click="onSend"
|
||||||
|
|
@ -863,8 +729,9 @@ onMounted(async () => {
|
||||||
<div
|
<div
|
||||||
v-if="
|
v-if="
|
||||||
!checkRoutePermisson &&
|
!checkRoutePermisson &&
|
||||||
isStaff &&
|
(dataDetail.statusMain === 'APPROVE' ||
|
||||||
dataDetail.statusMain === 'WAITTING'
|
dataDetail.statusMain === 'REJECT') &&
|
||||||
|
isStaff
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div class="q-gutter-sm" v-if="!edit">
|
<div class="q-gutter-sm" v-if="!edit">
|
||||||
|
|
@ -1103,7 +970,7 @@ onMounted(async () => {
|
||||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||||
<DialogHeader
|
<DialogHeader
|
||||||
:tittle="`${
|
:tittle="`${
|
||||||
actionPass ? 'อนุญาตยกเลิกการลาออก' : 'ยับยั้งยกเลิกการลาออก'
|
actionPass ? 'อนุญาตยกเลิกการลาออก' : 'ไม่อนุญาตยกเลิกการลาออก'
|
||||||
}`"
|
}`"
|
||||||
:close="closeModal"
|
:close="closeModal"
|
||||||
/>
|
/>
|
||||||
|
|
@ -1137,7 +1004,7 @@ onMounted(async () => {
|
||||||
<DialogAddCommander
|
<DialogAddCommander
|
||||||
v-model:modal="modalAdd"
|
v-model:modal="modalAdd"
|
||||||
:type="typeAdd"
|
:type="typeAdd"
|
||||||
:profileType="'officer'"
|
:profileType="'-employee'"
|
||||||
:get-data="fetchData"
|
:get-data="fetchData"
|
||||||
:id-check="idCheck"
|
:id-check="idCheck"
|
||||||
:keycloak-user-id="keycloakUserId"
|
:keycloak-user-id="keycloakUserId"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,11 @@ import { useRouter } from "vue-router";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useDataStore } from "@/modules/06_retirement/store/resignMain";
|
import { useDataStore } from "@/modules/06_retirement/store/resignMain";
|
||||||
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
import { useRetirementDataStore } from "@/modules/06_retirement/store/Main";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
|
|
@ -23,13 +27,8 @@ const stroeResign = useDataStore();
|
||||||
const { statusText } = stroe;
|
const { statusText } = stroe;
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const {
|
const { messageError, date2Thai, showLoader, hideLoader, onSearchDataTable } =
|
||||||
messageError,
|
mixin;
|
||||||
date2Thai,
|
|
||||||
showLoader,
|
|
||||||
hideLoader,
|
|
||||||
onSearchDataTable
|
|
||||||
} = mixin;
|
|
||||||
|
|
||||||
/** Table */
|
/** Table */
|
||||||
const rows = ref<ResponseItems[]>([]);
|
const rows = ref<ResponseItems[]>([]);
|
||||||
|
|
@ -291,7 +290,11 @@ onMounted(async () => {
|
||||||
</q-select>
|
</q-select>
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="checkPermission($route)?.attrIsUpdate"
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
@click="openModalOrder"
|
@click="openModalOrder"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ const {
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const pageId = ref<string>(route.params.id as string);
|
const pageId = ref<string>(route.params.id as string);
|
||||||
|
const routeName = ref<string>(route?.name as string);
|
||||||
|
|
||||||
const keyword = ref<string>("");
|
const keyword = ref<string>("");
|
||||||
const isAct = ref<boolean>(false);
|
const isAct = ref<boolean>(false);
|
||||||
|
|
||||||
|
|
@ -114,6 +116,7 @@ async function getData() {
|
||||||
keyword: keyword.value,
|
keyword: keyword.value,
|
||||||
isAct: isAct.value,
|
isAct: isAct.value,
|
||||||
keycloakId: props.keycloakUserId,
|
keycloakId: props.keycloakUserId,
|
||||||
|
type: props.profileType === "officer" ? props.profileType : "employee",
|
||||||
})
|
})
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -146,17 +149,25 @@ function onSubmit() {
|
||||||
keycloakId: items.keycloakId,
|
keycloakId: items.keycloakId,
|
||||||
}));
|
}));
|
||||||
showLoader();
|
showLoader();
|
||||||
|
const profileSuffix =
|
||||||
|
(props.profileType?.toLocaleLowerCase() as string) === "officer"
|
||||||
|
? ""
|
||||||
|
: "-employee";
|
||||||
|
|
||||||
|
const apiEndpoint =
|
||||||
|
routeName.value === "resignReject" || routeName.value === "resignRejectEMP"
|
||||||
|
? config.API.addResignCancel(
|
||||||
|
profileSuffix,
|
||||||
|
props.type?.toLocaleLowerCase() as string,
|
||||||
|
pageId.value
|
||||||
|
)
|
||||||
|
: config.API.addResign(
|
||||||
|
profileSuffix,
|
||||||
|
props.type?.toLocaleLowerCase() as string,
|
||||||
|
pageId.value
|
||||||
|
);
|
||||||
await http
|
await http
|
||||||
.post(
|
.post(apiEndpoint, body)
|
||||||
config.API.addResign(
|
|
||||||
(props.profileType?.toLocaleLowerCase() as string) == "officer"
|
|
||||||
? ""
|
|
||||||
: "-employee",
|
|
||||||
props.type?.toLocaleLowerCase() as string,
|
|
||||||
pageId.value
|
|
||||||
),
|
|
||||||
body
|
|
||||||
)
|
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await props.getData?.(pageId.value);
|
await props.getData?.(pageId.value);
|
||||||
closeDialog();
|
closeDialog();
|
||||||
|
|
@ -165,7 +176,9 @@ function onSubmit() {
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {});
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
closeDialog();
|
closeDialog();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,26 +18,26 @@ export const useRetirementDataStore = defineStore("retirement", () => {
|
||||||
case "DONE":
|
case "DONE":
|
||||||
return "ออกคำสั่งเสร็จสิ้น";
|
return "ออกคำสั่งเสร็จสิ้น";
|
||||||
case "DONECANCEL":
|
case "DONECANCEL":
|
||||||
return "ยกเลิกการลาออก";
|
return "ยกเลิกการลาออกสำเร็จ";
|
||||||
case "CANCEL":
|
case "CANCEL":
|
||||||
return "ยกเลิกการลาออก";
|
return "ยกเลิกการลาออกสำเร็จ";
|
||||||
case "DONEREJECT":
|
case "DONEREJECT":
|
||||||
return "ออกคำสั่งยกเลิกลาออกเสร็จแล้ว";
|
return "ออกคำสั่งยกเลิกลาออกเสร็จแล้ว";
|
||||||
case "CANCELING":
|
case "CANCELING":
|
||||||
return "กำลังดำเนินการยกเลิก";
|
return "กำลังดำเนิดการยกเลิกการ";
|
||||||
default:
|
default:
|
||||||
return "-";
|
return "-";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function convertStatusText(val: string) {
|
function convertStatusText(val: string, rejectText: string = "ไม่อนุมัติ") {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case "PENDING":
|
case "PENDING":
|
||||||
return "รอดำเนินการ";
|
return "รอดำเนินการ";
|
||||||
case "APPROVE":
|
case "APPROVE":
|
||||||
return "อนุญาต";
|
return "อนุญาต";
|
||||||
case "REJECT":
|
case "REJECT":
|
||||||
return "ยับยั้ง";
|
return rejectText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ export const useDataStore = defineStore("resign", () => {
|
||||||
group: "2",
|
group: "2",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "อนุมัติแล้ว",
|
name: "อนุญาต/ไม่อนุญาต",
|
||||||
value: "APPROVE",
|
value: "APPROVE",
|
||||||
group: "2",
|
group: "2",
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,11 @@ import { useRouter } from "vue-router";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||||
|
|
||||||
import type { DataOption } from "@/modules/06_retirement/interface/index/Main";
|
import type { DataOption } from "@/modules/06_retirement/interface/index/Main";
|
||||||
|
|
@ -259,7 +263,11 @@ onMounted(async () => {
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="checkPermission($route)?.attrIsUpdate"
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
@click="openModalOrder"
|
@click="openModalOrder"
|
||||||
size="14px"
|
size="14px"
|
||||||
flat
|
flat
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,11 @@ import { useRouter } from "vue-router";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||||
|
|
||||||
import type { DataOption } from "@/modules/06_retirement/interface/index/Main";
|
import type { DataOption } from "@/modules/06_retirement/interface/index/Main";
|
||||||
|
|
@ -261,7 +265,11 @@ onMounted(async () => {
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="checkPermission($route)?.attrIsUpdate"
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
@click="openModalOrder"
|
@click="openModalOrder"
|
||||||
size="14px"
|
size="14px"
|
||||||
flat
|
flat
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,11 @@
|
||||||
import { ref, onMounted, reactive, watch } from "vue";
|
import { ref, onMounted, reactive, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useRegistryEmp } from "@/modules/08_registryEmployee/stores/registry-employee";
|
import { useRegistryEmp } from "@/modules/08_registryEmployee/stores/registry-employee";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -318,7 +322,11 @@ onMounted(async () => {
|
||||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="checkPermission($route)?.attrIsUpdate"
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,11 @@ import type {
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
|
|
||||||
import DialogSendToCommand from "@/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue";
|
import DialogSendToCommand from "@/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
|
|
||||||
/** use */
|
/** use */
|
||||||
const dataStore = useDisciplineSuspendStore();
|
const dataStore = useDisciplineSuspendStore();
|
||||||
|
|
@ -338,7 +342,11 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="checkPermission($route)?.attrIsUpdate"
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
@click="openModalOrder"
|
@click="openModalOrder"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,11 @@ import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore";
|
import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
||||||
|
|
@ -444,7 +448,9 @@ onMounted(async () => {
|
||||||
v-if="
|
v-if="
|
||||||
(((isOfficer || isStaff) && snapFilter === 'SNAP2') ||
|
(((isOfficer || isStaff) && snapFilter === 'SNAP2') ||
|
||||||
roundFilter?.shortCode === 'SPECIAL') &&
|
roundFilter?.shortCode === 'SPECIAL') &&
|
||||||
periodLatest?.group1IsClose
|
periodLatest?.group1IsClose &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore";
|
import { useSalaryEmployeeListSDataStore } from "@/modules/13_salary/store/SalaryEmployeeListsStore";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import { checkPermission, checkPermissionList,checkPermissionCreate } from "@/utils/permissions";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
||||||
|
|
@ -407,7 +407,8 @@ onMounted(async () => {
|
||||||
v-if="
|
v-if="
|
||||||
(((isOfficer || isStaff) && snapFilter === 'SNAP2') ||
|
(((isOfficer || isStaff) && snapFilter === 'SNAP2') ||
|
||||||
roundFilter?.shortCode === 'SPECIAL') &&
|
roundFilter?.shortCode === 'SPECIAL') &&
|
||||||
periodLatest?.group1IsClose
|
periodLatest?.group1IsClose &&
|
||||||
|
checkPermissionList(['COMMAND']) && checkPermissionCreate('COMMAND')
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,11 @@ import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import {
|
||||||
|
checkPermission,
|
||||||
|
checkPermissionList,
|
||||||
|
checkPermissionCreate,
|
||||||
|
} from "@/utils/permissions";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useActingStore } from "@/modules/17_acting/store/Main";
|
import { useActingStore } from "@/modules/17_acting/store/Main";
|
||||||
import { useStructureTree } from "@/stores/structureTree";
|
import { useStructureTree } from "@/stores/structureTree";
|
||||||
|
|
@ -316,7 +320,11 @@ onMounted(async () => {
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
class="q-px-sm"
|
class="q-px-sm"
|
||||||
v-if="storeActing.isOfficer"
|
v-if="
|
||||||
|
storeActing.isOfficer &&
|
||||||
|
checkPermissionList(['COMMAND']) &&
|
||||||
|
checkPermissionCreate('COMMAND')
|
||||||
|
"
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue