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