Refactoring code module 06_retirement

This commit is contained in:
STW_TTTY\stwtt 2024-09-18 15:18:57 +07:00
parent 1225254062
commit ea921b39b0
29 changed files with 730 additions and 823 deletions

View file

@ -26,19 +26,19 @@ const emit = defineEmits([
"update:previous",
]);
const updateEdit = (value: Boolean) => {
function updateEdit(value: Boolean) {
emit("update:editvisible", value);
};
const edit = async () => {
}
async function edit() {
updateEdit(!props.editvisible);
props.edit();
};
}
/* บันทึกข้อมูล**/
const checkSave = () => {
function checkSave() {
props.validate();
props.save();
};
}
</script>
<template>
<q-card-actions class="text-primary">
@ -49,8 +49,7 @@ const checkSave = () => {
:disabled="editvisible"
:color="editvisible ? 'grey-7' : 'primary'"
@click="edit"
><!-- icon="mdi-pencil-outline"
<q-tooltip>แกไขขอม</q-tooltip> -->
>
</q-btn>
<div v-else>
<q-btn
@ -60,9 +59,7 @@ const checkSave = () => {
:color="!editvisible ? 'grey-7' : 'public'"
@click="checkSave"
>
</q-btn
><!-- icon="mdi-content-save-outline">
<q-tooltip>นท</q-tooltip> -->
</q-btn>
</div>
</q-card-actions>
</template>

View file

@ -1,12 +1,15 @@
<script setup lang="ts">
import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
/** use */
const $q = useQuasar();
@ -98,17 +101,17 @@ const checkSelected = computed(() => {
});
//popup
const saveOrder = () => {
function saveOrder() {
dialogConfirm(
$q,
() => Ordersave(),
"ยืนยันส่งไปออกคำสั่ง",
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
);
};
}
//
const Ordersave = async () => {
async function Ordersave() {
const id = selected.value.map((r) => r.id);
const body = {
id,
@ -127,17 +130,18 @@ const Ordersave = async () => {
props.getData?.();
hideLoader();
});
};
}
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
const updateInput = (value: any) => {
function updateInput(value: any) {
emit("update:filterKeyword2", value);
};
}
//
const Reset = () => {
function Reset() {
emit("update:filterKeyword2", "");
};
}
watchEffect(() => {
if (props.modal === true) {
selected.value = [];

View file

@ -3,18 +3,22 @@ import { ref, onMounted } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
import http from "@/plugins/http";
import config from "@/app.config";
import DialogSendToCommand from "@/modules/06_retirement/components/Discharged/DialogSendToCommand.vue";
import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
import type { ResponseData } from "@/modules/06_retirement/interface/response/discharged";
import DialogSendToCommand from "@/modules/06_retirement/components/Discharged/DialogSendToCommand.vue";
/** use */
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin();
const transferStore = useTransferDataStore();
const { statusText } = transferStore;
const {
date2Thai,
messageError,
@ -23,7 +27,6 @@ const {
success,
dialogMessage,
} = mixin;
const { statusText } = transferStore;
const modal = ref<boolean>(false);
@ -37,14 +40,6 @@ const visibleColumns = ref<string[]>([
"createdAt",
"statustext",
]);
const visibleColumns2 = ref<string[]>([
"no",
"fullname",
"position",
"positionLevel",
"organizationPositionOld",
"statustext",
]);
//
const filterKeyword = ref<string>("");
@ -61,6 +56,16 @@ const resetFilter = () => {
const rows = ref<ResponseData[]>([]);
const rows2 = ref<ResponseData[]>([]);
/**
* Setting Pagination
*/
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
/** คอลัมน์ */
const columns = ref<QTableProps["columns"]>([
{
@ -130,12 +135,7 @@ const columns = ref<QTableProps["columns"]>([
const openModal = () => (modal.value = true);
const closeModal = () => (modal.value = false);
/** Hook */
onMounted(async () => {
await getData();
});
const openModalOrder = () => {
function openModalOrder() {
openModal();
const row = filters.value.filter(
(r: ResponseData) =>
@ -151,10 +151,10 @@ const openModalOrder = () => {
r.date
);
rows2.value = row;
};
}
/** Fnction เรียกข้อมูลจาก API */
const getData = async () => {
async function getData() {
showLoader();
await http
.get(config.API.retirementDischarge)
@ -194,13 +194,13 @@ const getData = async () => {
.finally(() => {
hideLoader();
});
};
}
/**
* งกนลบขอม
* @param id ไอดของขอม
*/
const clickDelete = async (id: string) => {
async function clickDelete(id: string) {
dialogMessage(
$q,
`ลบข้อมูล`,
@ -211,9 +211,9 @@ const clickDelete = async (id: string) => {
async () => await deleteData(id),
async () => await getData()
);
};
}
// Api
const deleteData = async (id: string) => {
async function deleteData(id: string) {
await http
.delete(config.API.dischargeByid(id))
.then((res) => {
@ -225,16 +225,11 @@ const deleteData = async (id: string) => {
.finally(async () => {
await getData();
});
};
}
/**
* Setting Pagination
*/
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
/** Hook */
onMounted(async () => {
await getData();
});
</script>
<template>

View file

@ -4,17 +4,17 @@ import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import CurrencyInput from "@/components/CurruncyInput.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { tokenParsed } from "@/plugins/auth";
/**Import type */
import type { QForm } from "quasar";
import type { ResponseDataDetail } from "@/modules/06_retirement/interface/response/discharged";
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
import { tokenParsed } from "@/plugins/auth";
const modalPersonal = ref<boolean>(false);
const personId = ref<string>("");
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
import CurrencyInput from "@/components/CurruncyInput.vue";
/** use */
const $q = useQuasar();
const route = useRoute();
@ -30,6 +30,9 @@ const {
dialogConfirm,
} = mixin;
const modalPersonal = ref<boolean>(false);
const personId = ref<string>("");
const myForm = ref<QForm | null>(null);
const roleAdmin = ref<boolean>(false);
const edit = ref<boolean>(false);
@ -62,17 +65,8 @@ const responseData = ref<ResponseDataDetail>({
fullname: "",
});
/** Hook */
onMounted(async () => {
const user = await tokenParsed();
if (user) {
roleAdmin.value = await user.role.includes("placement1");
}
await getData();
});
/** Fnction เรียกข้อมูลจาก API */
const getData = async () => {
async function getData() {
showLoader();
await http
.get(config.API.dischargeByid(dataId))
@ -111,20 +105,20 @@ const getData = async () => {
.finally(() => {
hideLoader();
});
};
}
/**
* งก Cancle
*/
const clickCancel = async () => {
async function clickCancel() {
await getData();
edit.value = false;
};
}
/**
* งก Save
*/
const conditionSave = async () => {
async function conditionSave() {
if (myForm.value !== null) {
myForm.value.validate().then((success) => {
if (success) {
@ -139,10 +133,10 @@ const conditionSave = async () => {
}
});
}
};
}
//
const saveData = async () => {
async function saveData() {
const body = {
organization: organization.value,
reason: reason.value,
@ -167,18 +161,18 @@ const saveData = async () => {
await getData();
hideLoader();
});
};
}
/**
* Function เพ Class เวลา Edit
* @param val เมอเปนEdit จะเปลยน Class
*/
const getClass = (val: boolean) => {
function getClass(val: boolean) {
return {
"full-width inputgreen cursor-pointer": val,
"full-width cursor-pointer": !val,
};
};
}
function onclickViewinfo(id: string) {
modalPersonal.value = true;
@ -188,6 +182,15 @@ function onclickViewinfo(id: string) {
function updatemodalPersonal(modal: boolean) {
modalPersonal.value = modal;
}
/** Hook */
onMounted(async () => {
const user = await tokenParsed();
if (user) {
roleAdmin.value = await user.role.includes("placement1");
}
await getData();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">

View file

@ -1,14 +1,16 @@
<script setup lang="ts">
import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
/** use */
const $q = useQuasar();
const { statusText } = useTransferDataStore();
@ -126,17 +128,17 @@ const checkSelected = computed(() => {
});
//popup
const saveOrder = () => {
function saveOrder() {
dialogConfirm(
$q,
() => Ordersave(),
"ยืนยันส่งไปออกคำสั่ง",
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
);
};
}
//
const Ordersave = async () => {
async function Ordersave() {
const id = selected.value.map((r) => r.id);
const body = {
id,
@ -155,17 +157,18 @@ const Ordersave = async () => {
props.fecthlistRecevice?.();
hideLoader();
});
};
}
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
const updateInput = (value: any) => {
function updateInput(value: any) {
emit("update:filterKeyword2", value);
};
}
//
const Reset = () => {
function Reset() {
emit("update:filterKeyword2", "");
};
}
watchEffect(() => {
if (props.modal === true) {
selected.value = [];

View file

@ -3,13 +3,16 @@ import { ref, onMounted } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
import http from "@/plugins/http";
import config from "@/app.config";
import DialogSendToCommand from "@/modules/06_retirement/components/DismissOrder/DialogSendToCommand.vue";
import type { ResponseData } from "@/modules/06_retirement/interface/response/out";
import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
import { useTransferDataStore } from "@/modules/05_placement/store";
import type { ResponseData } from "@/modules/06_retirement/interface/response/out";
import DialogSendToCommand from "@/modules/06_retirement/components/DismissOrder/DialogSendToCommand.vue";
/** use */
const $q = useQuasar();
@ -23,7 +26,6 @@ const {
hideLoader,
success,
dialogMessage,
findOrgNameOld,
} = mixin;
const { statusText } = transferStore;
const modal = ref<boolean>(false);
@ -119,11 +121,15 @@ const columns = ref<QTableProps["columns"]>([
format: (val) => statusText(val),
},
]);
onMounted(async () => {
await getData();
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
const openModalOrder = () => {
function openModalOrder() {
openModal();
const row = filters.value.filter(
(r: ResponseData) =>
@ -139,10 +145,10 @@ const openModalOrder = () => {
r.date
);
rows2.value = row;
};
}
//
const getData = async () => {
async function getData() {
showLoader();
await http
.get(config.API.retirementOut)
@ -157,9 +163,9 @@ const getData = async () => {
.finally(() => {
hideLoader();
});
};
}
const clickDelete = async (id: string) => {
async function clickDelete(id: string) {
dialogMessage(
$q,
`ลบข้อมูล`,
@ -170,9 +176,9 @@ const clickDelete = async (id: string) => {
async () => await deleteData(id),
async () => await getData()
);
};
}
const deleteData = async (id: string) => {
async function deleteData(id: string) {
await http
.delete(config.API.outByid(id))
.then(() => {
@ -184,21 +190,19 @@ const deleteData = async (id: string) => {
.finally(async () => {
await getData();
});
};
}
const openModal = () => (modal.value = true);
const closeModal = () => (modal.value = false);
const resetFilter = () => {
function resetFilter() {
filterKeyword.value = "";
filterKeyword2.value = "";
filterRef.value.focus();
};
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
}
onMounted(async () => {
await getData();
});
</script>
<template>

View file

@ -2,9 +2,10 @@
import { onMounted, ref } from "vue";
import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { tokenParsed } from "@/plugins/auth";
/**Import type */
@ -51,7 +52,7 @@ const fullName = ref<string>("");
const status = ref<string>("");
// API
const getData = async () => {
async function getData() {
showLoader();
await http
.get(config.API.outByid(dataId))
@ -81,21 +82,21 @@ const getData = async () => {
.finally(() => {
hideLoader();
});
};
}
/**
* งก Cancle
*/
const clickCancel = async () => {
async function clickCancel() {
await getData();
edit.value = false;
myForm.value?.resetValidation();
};
}
/**
* งก Saveจาก API
*/
const onSubmit = async () => {
async function onSubmit() {
dialogMessage(
$q,
"ต้องการแก้ไขข้อมูลหรือไม่?",
@ -131,18 +132,18 @@ const onSubmit = async () => {
},
undefined
);
};
}
/**
* Function เพ Class เวลา Edit
* @param val เมอเปนEdit จะเปลยน Class
*/
const getClass = (val: boolean) => {
function getClass(val: boolean) {
return {
"full-width inputgreen cursor-pointer": val,
"full-width cursor-pointer": !val,
};
};
}
/** Hook */
onMounted(async () => {

View file

@ -2,9 +2,10 @@
import { onMounted, reactive, ref } from "vue";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import type { QForm } from "quasar";
@ -116,64 +117,8 @@ const question10Desc = ref<string>("ความคิดเห็นและ
const question10Answer = ref<any>([]);
const question10Score = ref<number>(0);
/**
* วเลอกแบบสอบถาม(จำลอง)
*/
const exitFactor = ref<any>([]);
const reasonWork = ref<any>([]);
const adjust = ref<any>([]);
const timeThink = ref<any>();
const realReason = ref<any>("");
const notExitFactor = ref<any>("");
const haveJob = ref<any>();
const suggestFriends = ref<any>();
const futureWork = ref<any>();
const suggestion = ref<any>("");
const suggestFriendsReason = ref("");
const suggestFriends_option = ref<any>([
{ label: "แนะนำ ", value: true },
{ label: "ไม่แนะนำ (ระบุ)", value: false },
]);
const haveJobReason = ref<any>("");
const haveJob_option = ref<any>([
{ label: "มี (ระบุ) ", value: true },
{ label: "ไม่มี", value: false },
]);
const futureWorkReason = ref<any>("");
const futureWork_option = ref<any>([
{ label: "อยาก ", value: true },
{ label: "ไม่อยาก (ระบุ)", value: false },
]);
const adjustOther = ref("");
const adjust_option = ref<any>([
{ label: "อัตราเงินเดือน ", value: 0 },
{ label: "สวัสดิการ", value: 1 },
{ label: "ลักษณะงาน ", value: 2 },
{ label: "ระบบการทำงาน ", value: 3 },
{ label: "ระบบสนับสนุนการปฏิบัติงาน ", value: 4 },
{ label: "การมอบหมายงานที่ชัดเจนและเหมาะสม ", value: 5 },
{ label: "การบริหารงานของผู้บังคับบัญชา", value: 6 },
{ label: "การทำงานเป็นทีมกับเพื่อนร่วมงาน ", value: 7 },
{ label: "ระบบบริหารงานภายในหน่วยงาน ", value: 8 },
{ label: "บรรยากาศในการทำงาน ", value: 9 },
{ label: "การปฏิบัติอย่างเป็นธรรม ", value: 10 },
{ label: "การยอมรับความแตกต่างหลากหลาย ", value: 11 },
{ label: "การดูแลและให้ความช่วยเหลือในช่วงเริ่มต้นปฏิบัติงาน ", value: 12 },
{ label: "การพัฒนาอย่างเป็นระบบและต่อเนื่อง ", value: 13 },
{ label: "โอกาสความก้าวหน้า ", value: 14 },
// { label: " () ", value: 15 },
]);
/**
* HOOK
*/
onMounted(async () => {
await getData();
});
//
const getData = async () => {
async function getData() {
showLoader();
await http
.get(config.API.questionExitInterview())
@ -216,15 +161,15 @@ const getData = async () => {
.finally(() => {
hideLoader();
});
};
}
/**
* งกนเชคขอมลกอนคอนเฟร
*/
const confirmClick = () => {
function confirmClick() {
dialogConfirm($q, () => putData());
};
const putData = () => {
}
function putData() {
const body = {
question1Desc: question1Desc.value,
question1Score: question1Score.value,
@ -279,7 +224,14 @@ const putData = () => {
.finally(() => {
hideLoader();
});
};
}
/**
* HOOK
*/
onMounted(async () => {
await getData();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">

View file

@ -2,17 +2,17 @@
import { ref, onMounted } from "vue";
import { useQuasar, QForm } from "quasar";
import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
/**Import type */
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/exitInterview";
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
import DialogHeader from "@/components/DialogHeader.vue";
import { checkPermission } from "@/utils/permissions";
import DialogHeader from "@/components/DialogHeader.vue";
/** use */
const $q = useQuasar(); // noti quasar
@ -157,16 +157,8 @@ const modal = ref<boolean>(false);
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
/** HOOK */
onMounted(async () => {
await fecthlist();
if (columns.value) {
visibleColumns.value = columns.value.map((r: any) => r.name);
}
});
// API
const fecthlist = async () => {
async function fecthlist() {
showLoader();
await http
.get(config.API.listExitInterview())
@ -202,10 +194,10 @@ const fecthlist = async () => {
.finally(() => {
hideLoader();
});
};
}
//
const saveAppoint = async () => {
async function saveAppoint() {
await myForm.value!.validate().then(async (result: boolean) => {
if (result) {
dialogConfirm($q, async () => {
@ -229,13 +221,13 @@ const saveAppoint = async () => {
});
}
});
};
}
/**
* งก validate DATE ไทย
* @param thaiDate นทไทย
*/
const validationDate = (thaiDate: string | null) => {
function validationDate(thaiDate: string | null) {
if (thaiDate && daterow.value) {
let a = convertThaiDateToNumeric(thaiDate);
let b = daterow.value;
@ -243,10 +235,10 @@ const validationDate = (thaiDate: string | null) => {
return a > b;
}
}
};
}
//
const convertThaiDateToNumeric = (thaiDate: string) => {
function convertThaiDateToNumeric(thaiDate: string) {
const parts = thaiDate.split(" ");
if (parts.length !== 3) return null;
const [day, month, year] = parts;
@ -267,22 +259,31 @@ const convertThaiDateToNumeric = (thaiDate: string) => {
if (!(month in monthMap)) return null;
const numericDate = `${year}${monthMap[month]}${day}`;
return numericDate;
};
}
/**
* modal Setting
*/
const openModal = () => (modal.value = true);
const closeModal = () => (modal.value = false);
const resetFilter = () => {
function resetFilter() {
filterKeyword.value = "";
filterRef.value.focus();
};
const openModalCalendar = (rows: any) => {
}
function openModalCalendar(rows: any) {
openModal();
dateBreak.value = null;
id.value = rows.id;
daterow.value = convertThaiDateToNumeric(rows.datetext);
};
}
/** HOOK */
onMounted(async () => {
await fecthlist();
if (columns.value) {
visibleColumns.value = columns.value.map((r: any) => r.name);
}
});
</script>
<template v-slot:body="props">
<div class="toptitle text-dark col-12 row items-center">
@ -445,9 +446,7 @@ const openModalCalendar = (rows: any) => {
</div>
</q-td>
<q-td key="appointDate" :props="props">
{{
props.row.appointDate ? props.row.appointDate : "-"
}}
{{ props.row.appointDate ? props.row.appointDate : "-" }}
</q-td>
<q-td key="datetext" :props="props">
{{ props.row.datetext ? props.row.datetext : "-" }}

View file

@ -2,15 +2,17 @@
import { onMounted, reactive, ref, watch } from "vue";
import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import { tokenParsed } from "@/plugins/auth";
import { useCounterMixin } from "@/stores/mixin";
/**import type*/
import type {
OptionQuestions,
OptionQuestions2,
QuestionDesc,
} from "@/modules/06_retirement/interface/request/Main";
import type { QForm } from "quasar";
@ -80,18 +82,29 @@ const haveJobReason = ref<any>("");
const futureWorkReason = ref<any>("");
const adjustOther = ref("");
/** HOOK */
onMounted(async () => {
const user = await tokenParsed();
if (user) {
roleAdmin.value = await user.role.includes("placement1");
}
await getData();
await fecthquestion();
//
const questionDesc = reactive<QuestionDesc>({
question1Desc: "",
question2Desc: "",
question3Desc: "",
question4Desc: "",
question5Desc: "",
question6Desc: "",
question7Desc: "",
question8Desc: "",
question9Desc: "",
question10Desc: "",
});
const question1Answer = ref<OptionQuestions[]>([]);
const question2Answer = ref<OptionQuestions[]>([]);
const question3Answer = ref<OptionQuestions[]>([]);
const question4Answer = ref<OptionQuestions[]>([]);
const question7Answer = ref<OptionQuestions2[]>([]);
const question8Answer = ref<OptionQuestions2[]>([]);
const question9Answer = ref<OptionQuestions2[]>([]);
//
const getData = async () => {
async function getData() {
showLoader();
await http
.get(config.API.ExitInterviewByid(dataId))
@ -133,29 +146,8 @@ const getData = async () => {
.finally(() => {
hideLoader();
});
};
//
const questionDesc = reactive<any>([
{
question1Desc: "",
question2Desc: "",
question3Desc: "",
question4Desc: "",
question5Desc: "",
question6Desc: "",
question7Desc: "",
question8Desc: "",
question9Desc: "",
question10Desc: "",
},
]);
const question1Answer = ref<OptionQuestions[]>([]);
const question2Answer = ref<OptionQuestions[]>([]);
const question3Answer = ref<OptionQuestions[]>([]);
const question4Answer = ref<OptionQuestions[]>([]);
const question7Answer = ref<OptionQuestions2[]>([]);
const question8Answer = ref<OptionQuestions2[]>([]);
const question9Answer = ref<OptionQuestions2[]>([]);
}
async function fecthquestion() {
showLoader();
await http
@ -164,8 +156,8 @@ async function fecthquestion() {
const data = await result.data.result;
//
for (let i = 1; i <= 10; i++) {
questionDesc[`question${i}Desc`] =
`${i}.` + " " + data[`question${i}Desc`];
const key = `question${i}Desc` as keyof QuestionDesc;
questionDesc[key] = `${i}.` + " " + data[key];
}
//
const Answer1 = data.question1Answer.map((e: any, index: number) => ({
@ -227,17 +219,11 @@ async function fecthquestion() {
hideLoader();
});
}
//
watch(score, () => {
scoreTotal.value = score.reduce((accumulator, object) => {
return accumulator + Number(object.score);
}, 0);
});
/**
* นทกใหคะเเนน
*/
const saveClick = () => {
function saveClick() {
if (
comment.value === "" ||
score[0].score === "" ||
@ -256,12 +242,12 @@ const saveClick = () => {
} else {
dialogConfirm($q, () => putData());
}
};
}
/**
* งคะเเนนผาน API
*/
const putData = () => {
function putData() {
const body = {
score1: Number(score[0].score),
score2: Number(score[1].score),
@ -289,7 +275,24 @@ const putData = () => {
.finally(() => {
hideLoader();
});
};
}
//
watch(score, () => {
scoreTotal.value = score.reduce((accumulator, object) => {
return accumulator + Number(object.score);
}, 0);
});
/** HOOK */
onMounted(async () => {
const user = await tokenParsed();
if (user) {
roleAdmin.value = await user.role.includes("placement1");
}
await getData();
await fecthquestion();
});
</script>
<template>

View file

@ -1,12 +1,15 @@
<script setup lang="ts">
import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
/** use */
const $q = useQuasar();
@ -101,17 +104,17 @@ const checkSelected = computed(() => {
});
//popup
const saveOrder = () => {
function saveOrder() {
dialogConfirm(
$q,
() => Ordersave(),
"ยืนยันส่งไปออกคำสั่ง",
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
);
};
}
//
const Ordersave = async () => {
async function Ordersave() {
const id = selected.value.map((r) => r.id);
const body = {
id,
@ -130,16 +133,18 @@ const Ordersave = async () => {
props.getData?.();
hideLoader();
});
};
}
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
const updateInput = (value: any) => {
function updateInput(value: any) {
emit("update:filterKeyword2", value);
};
}
//
const Reset = () => {
function Reset() {
emit("update:filterKeyword2", "");
};
}
watchEffect(() => {
if (props.modal === true) {
selected.value = [];

View file

@ -3,14 +3,16 @@ import { ref, onMounted } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useRetirementDataStore } from "@/modules/06_retirement/store";
import DialogSendToCommand from "@/modules/06_retirement/components/Expulsion/DialogSendToCommand.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useRetirementDataStore } from "@/modules/06_retirement/store";
import type { ResponseData } from "@/modules/06_retirement/interface/response/expulsion";
import DialogSendToCommand from "@/modules/06_retirement/components/Expulsion/DialogSendToCommand.vue";
/** use */
const $q = useQuasar();
const router = useRouter();
@ -51,6 +53,14 @@ const resetFilter = () => {
const rows = ref<ResponseData[]>([]);
const rows2 = ref<ResponseData[]>([]);
const filters = ref<ResponseData[]>([]);
/** Setting Pagination */
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -117,15 +127,12 @@ const columns = ref<QTableProps["columns"]>([
},
]);
/** HOOK */
onMounted(async () => {
await getData();
});
/**
* งก modal
*/
const openModalOrder = () => {
const openModal = () => (modal.value = true);
const closeModal = () => (modal.value = false);
function openModalOrder() {
openModal();
const row = filters.value.filter(
(r: ResponseData) =>
@ -141,14 +148,12 @@ const openModalOrder = () => {
r.date
);
rows2.value = row;
};
const openModal = () => (modal.value = true);
const closeModal = () => (modal.value = false);
}
/**
* นำขอมลมาจาก API
*/
const getData = async () => {
async function getData() {
showLoader();
await http
.get(config.API.retirementExpulsion)
@ -188,13 +193,13 @@ const getData = async () => {
.finally(() => {
hideLoader();
});
};
}
/**
* ลบขอม
* @param id ไอดอม
*/
const clickDelete = async (id: string) => {
async function clickDelete(id: string) {
dialogRemove(
$q,
async () => {
@ -203,9 +208,9 @@ const clickDelete = async (id: string) => {
`ลบข้อมูล`,
`ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`
);
};
}
//API
const deleteData = async (id: string) => {
async function deleteData(id: string) {
await http
.delete(config.API.expulsionByid(id))
.then((res) => {
@ -218,14 +223,11 @@ const deleteData = async (id: string) => {
hideLoader();
await getData();
});
};
}
/** Setting Pagination */
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
/** HOOK */
onMounted(async () => {
await getData();
});
</script>
<template>

View file

@ -2,19 +2,20 @@
import { onMounted, ref } from "vue";
import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import CurrencyInput from "@/components/CurruncyInput.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { tokenParsed } from "@/plugins/auth";
/**Import Type */
import type { QForm } from "quasar";
import type { ResponseDataDetail } from "@/modules/06_retirement/interface/response/expulsion";
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
const modalPersonal = ref<boolean>(false);
const personId = ref<string>("");
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
import CurrencyInput from "@/components/CurruncyInput.vue";
/** Use */
const $q = useQuasar();
const route = useRoute();
@ -30,6 +31,9 @@ const {
dialogConfirm,
} = mixin;
const modalPersonal = ref<boolean>(false);
const personId = ref<string>("");
/**ตัวแปร */
const myForm = ref<QForm | null>(null);
const roleAdmin = ref<boolean>(false);
@ -61,19 +65,10 @@ const responseData = ref<ResponseDataDetail>({
fullname: "",
});
/**Hook */
onMounted(async () => {
const user = await tokenParsed();
if (user) {
roleAdmin.value = await user.role.includes("placement1");
}
await getData();
});
/**
* นำขอมลมาจาก API
*/
const getData = async () => {
async function getData() {
showLoader();
await http
.get(config.API.expulsionByid(dataId))
@ -115,18 +110,18 @@ const getData = async () => {
.finally(() => {
hideLoader();
});
};
}
/**ฟังก์ชั่นcancel */
const clickCancel = async () => {
async function clickCancel() {
await getData();
edit.value = false;
};
}
/**
* Functionบนท
*/
const conditionSave = async () => {
async function conditionSave() {
if (myForm.value !== null) {
myForm.value.validate().then((success) => {
if (success) {
@ -141,9 +136,9 @@ const conditionSave = async () => {
}
});
}
};
}
//Save Api
const saveData = async () => {
async function saveData() {
const body = {
organization: organization.value,
reason: reason.value,
@ -168,18 +163,18 @@ const saveData = async () => {
await getData();
hideLoader();
});
};
}
/**
* Function เพ Class เวลา Edit
* @param val เมอเปนEdit จะเปลยน Class
*/
const getClass = (val: boolean) => {
function getClass(val: boolean) {
return {
"full-width inputgreen cursor-pointer": val,
"full-width cursor-pointer": !val,
};
};
}
function onclickViewinfo(id: string) {
modalPersonal.value = true;
@ -189,6 +184,15 @@ function onclickViewinfo(id: string) {
function updatemodalPersonal(modal: boolean) {
modalPersonal.value = modal;
}
/**Hook */
onMounted(async () => {
const user = await tokenParsed();
if (user) {
roleAdmin.value = await user.role.includes("placement1");
}
await getData();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
@ -377,20 +381,6 @@ function updatemodalPersonal(modal: boolean) {
</div>
<div class="col-xs-6 col-sm-3 row">
<div class="col-12">
<!-- <q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="salary"
@update:model-value="salary.toLocaleString('en-US')"
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
hide-bottom-space
:label="`${'เงินเดือน'}`"
type="number"
/> -->
<CurrencyInput
v-model="salary"
:edit="edit"

View file

@ -6,6 +6,7 @@ import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import { useRoute } from "vue-router";
import type { PersonData } from "@/modules/06_retirement/interface/index/Main";
import DialogHeader from "@/components/DialogHeader.vue";
/** Use */
@ -36,7 +37,6 @@ const props = defineProps({
const modal = ref<boolean>(false);
const retireld = ref<any>();
const type = ref<any>();
const filter = ref<string>("");
/** คอลัมน์ */
const columns = ref<any["columns"]>([
@ -76,22 +76,7 @@ const columns = ref<any["columns"]>([
align: "left",
},
]);
const rows = ref<any[]>([]);
watch(modal, () => {
if (modal.value === true) {
retireld.value = props.retireld;
formPagePersonList.page = 1;
formPagePersonList.keyword = "";
if (props.dataProfile) {
if (props.dataProfile.type === "OFFICER") {
type.value = "officer";
} else type.value = "all";
}
fecthProfile();
}
});
const rows = ref<PersonData[]>([]);
function findOrgChildName(obj: any) {
if (obj) {
@ -134,7 +119,7 @@ const maxPage = ref<number>(1);
const totalList = ref<number>(0);
// fecth profile
const fecthProfile = async () => {
async function fecthProfile() {
showLoader();
if (props?.dataProfile?.type === "OFFICER") {
formPagePersonList.keyword =
@ -200,10 +185,10 @@ const fecthProfile = async () => {
hideLoader();
});
}
};
}
//
const clickAdd = (props: any) => {
function clickAdd(props: any) {
if (retireld.value == undefined) {
retireld.value = retireld_params;
}
@ -227,17 +212,22 @@ const clickAdd = (props: any) => {
"ยืนยันการเพิ่มข้อมูล",
"ต้องการเพิ่มข้อมูลนี้ใช่หรือไม่ ?"
);
};
}
// update retireld
const updateListData = (retireld: string, pId: string) => {
function updateListData(retireld: string, pId: string) {
props.UpdateListId(retireld, pId);
};
}
function updatePageSize(newPagination: any) {
formPagePersonList.page = 1;
formPagePersonList.pageSize = newPagination.rowsPerPage;
}
function closeDialog() {
modal.value = false;
}
watch(
() => formPagePersonList.pageSize,
() => {
@ -245,9 +235,20 @@ watch(
}
);
function closeDialog() {
modal.value = false;
}
watch(modal, () => {
if (modal.value === true) {
retireld.value = props.retireld;
formPagePersonList.page = 1;
formPagePersonList.keyword = "";
if (props.dataProfile) {
if (props.dataProfile.type === "OFFICER") {
type.value = "officer";
} else type.value = "all";
}
fecthProfile();
}
});
</script>
<template>
@ -357,18 +358,6 @@ function closeDialog() {
</div>
</div>
</q-card-section>
<!-- <q-toolbar class="q-py-md">
<q-toolbar-title class="text-h6">เพมรายช </q-toolbar-title>
<q-btn
icon="close"
unelevated
round
dense
@click="modal = false"
style="color: #ff8080; background-color: #ffdede"
/>
</q-toolbar>
-->
</q-card>
</q-dialog>
</template>

View file

@ -9,6 +9,8 @@ import config from "@/app.config";
import genReport from "@/plugins/genreport";
import { useCounterMixin } from "@/stores/mixin";
import type { RetirementList } from "@/modules/06_retirement/interface/index/Main";
import DialogHeader from "@/components/DialogHeader.vue";
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
@ -55,7 +57,7 @@ const dataProfile = ref<Object>([]);
/** คอลัมน์ที่แสดง */
const columns = ref<any["columns"]>([]);
const rows = ref<any[]>([]);
const rows = ref<RetirementList[]>([]);
const visibleColumns = ref<string[]>([
"order",
"name",
@ -71,13 +73,13 @@ const visibleColumns = ref<string[]>([
/**
* งกนป Dialog
*/
const closeDialog = () => {
function closeDialog() {
modalNote.value = false;
modalUpload.value = false;
};
}
// fecthlist
const fecthlistprofile = async (id: string) => {
async function fecthlistprofile(id: string) {
showLoader();
await http
.get(config.API.listRetire(id))
@ -191,10 +193,10 @@ const fecthlistprofile = async (id: string) => {
hideLoader();
});
};
}
//
const fecthCheck = async (id: string) => {
async function fecthCheck(id: string) {
await http
.get(config.API.checkfileupload(id))
.then((res) => {
@ -203,10 +205,10 @@ const fecthCheck = async (id: string) => {
.catch((err) => {
messageError($q, err);
});
};
}
// DelProfile
const clickDelete = () => {
function clickDelete() {
dialogRemove(
$q,
async () => {
@ -230,10 +232,10 @@ const clickDelete = () => {
"ยืนยันการลบข้อมูล",
"ต้องการลบข้อมูลนี้ใช่หรือไม่ ?"
);
};
}
//
const saveNote = () => {
function saveNote() {
dialogConfirm(
$q,
async () => {
@ -257,18 +259,18 @@ const saveNote = () => {
"ยืนยันการบันทึกข้อมูล",
"ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?"
);
};
}
// ListId
const UpdateListId = (retireld: string, pId: string) => {
function UpdateListId(retireld: string, pId: string) {
profileId.value = pId;
fecthlistprofile(retireld);
};
}
//
const backHistory = () => {
function backHistory() {
window.history.back();
};
}
const visibleNote = computed(() => {
if (note.value === "" || note.value === undefined) {
@ -279,7 +281,7 @@ const visibleNote = computed(() => {
//
const modalUpload = ref<boolean>(false);
const signDate = ref<Date | null>(null);
const uploadFile = async (event: any, signDate: any) => {
async function uploadFile(event: any, signDate: any) {
if (myForm.value !== null) {
myForm.value.validate().then((successmyForm) => {
if (successmyForm) {
@ -317,7 +319,7 @@ const uploadFile = async (event: any, signDate: any) => {
}
});
}
};
}
/**
* ดาวหโหลด ไฟล
@ -341,7 +343,7 @@ async function downloadAttachment(type: string, id: string) {
}
//
const saveEdiitReport = (reason: string) => {
function saveEdiitReport(reason: string) {
const formdata = new FormData();
formdata.append("Detail", reason);
dialogConfirm(
@ -363,12 +365,12 @@ const saveEdiitReport = (reason: string) => {
"ยืนยันการแก้ไขข้อมูล",
"ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?"
);
};
}
// popup
const openmodalEditReport = () => {
function openmodalEditReport() {
modalEdit.value = true;
};
}
/** Setting Pagination */
const paging = ref<boolean>(true);
@ -378,16 +380,21 @@ const pagination = ref({
page: 1,
rowsPerPage: 10,
});
const paginationLabel = (start: number, end: number, total: number) => {
function paginationLabel(start: number, end: number, total: number) {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;
};
}
/**
* อมลในทะเบยนประว
* @param id คคล
*/
function onclickViewinfo(id: string) {
modalPersonal.value = true;
personId.value = id;
}
/** ทะเบียนประวัติ */
function updatemodalPersonal(modal: boolean) {
modalPersonal.value = modal;
}
@ -489,22 +496,6 @@ onMounted(() => {
</q-menu>
<q-tooltip>ดาวนโหลดไฟล</q-tooltip>
</q-btn>
<!-- <q-file
bg-color="white"
clearable
outlined
dense
v-model="fileUpload"
accept=".pdf"
:style="fileUpload === null ? 'width: 150px' : 'width: auto'"
label="อัปโหลดไฟล์"
v-if="statusUpload !== true"
>
<template v-slot:prepend>
<q-icon color="light-blue" name="attach_file" />
<q-tooltip>ปโหลดไฟล</q-tooltip>
</template>
</q-file> -->
</div>
<q-space />
<div class="row">

View file

@ -1,10 +1,13 @@
<script setup lang="ts">
import { ref } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRouter } from "vue-router";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import type { RoundData } from "@/modules/06_retirement/interface/index/Main";
/** Use */
const $q = useQuasar();
@ -33,11 +36,11 @@ const props = defineProps({
const modal = ref<boolean>(false);
const radio = ref<string>("");
const actionOption = ref<any>([]);
const actionOption = ref<RoundData[]>([]);
const action = ref<string>("");
//
const clickAdd = () => {
function clickAdd() {
if (props.rows) {
//
if (props.rows.length == 0) {
@ -61,13 +64,14 @@ const clickAdd = () => {
round: `รอบ ${e.round} (ประกาศ ณ วันที่ ${e.signDate})`,
}));
actionOption.value = list;
console.log("🚀 ~ clickAdd ~ actionOption.value:", actionOption.value);
}
}
}
};
}
//
const clickSelect = async (action: string) => {
async function clickSelect(action: string) {
dialogConfirm(
$q,
async () => {
@ -83,10 +87,10 @@ const clickSelect = async (action: string) => {
"ยืนยันการแก้ไขข้อมูลประกาศเกษียณ",
"ต้องการแก้ไขข้อมูลประกาศเกษียณใช่หรือไม่ ?"
);
};
}
// API
const cerateRetirement = async (data: object) => {
async function cerateRetirement(data: object) {
await http
.post(config.API.createProfile(), data)
.then((res) => {
@ -97,7 +101,7 @@ const cerateRetirement = async (data: object) => {
.catch((e) => {
messageError($q, e);
});
};
}
</script>
<template>
<q-btn

View file

@ -2,27 +2,27 @@
import { ref, onMounted } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
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";
/** Use */
const router = useRouter();
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin();
const {
showLoader,
hideLoader,
messageError,
success,
date2Thai,
findOrgName,
} = mixin;
const { showLoader, hideLoader, messageError, date2Thai, findOrgName } = mixin;
/** คอลัมน์ */
const rows = ref<any[]>([]);
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
});
const columns = ref<QTableProps["columns"]>([
{
name: "no",
@ -74,16 +74,6 @@ const columns = ref<QTableProps["columns"]>([
return name;
},
},
// {
// name: "positionExecutive",
// align: "left",
// label: "",
// sortable: true,
// field: "positionExecutive",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// },
{
name: "org",
align: "left",
@ -120,13 +110,8 @@ const visibleColumns = ref<string[]>([
"createdAt",
]);
/**Hook */
onMounted(() => {
fectListDecased();
});
/**เรียกข้อมูลจาก APi */
const fectListDecased = async () => {
async function fectListDecased() {
showLoader();
await http
.get(config.API.listDeceased())
@ -140,25 +125,24 @@ const fectListDecased = async () => {
.finally(() => {
hideLoader();
});
};
}
//
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
const resetFilter = () => {
function resetFilter() {
filterKeyword.value = "";
filterRef.value.focus();
};
}
/** Setting Pagination */
const nextPage = (id: string) => {
function nextPage(id: string) {
router.push("/retirement/deceased/" + id);
};
const pagination = ref({
sortBy: "createdAt",
descending: true,
page: 1,
rowsPerPage: 10,
}
/**Hook */
onMounted(() => {
fectListDecased();
});
</script>
<template>

View file

@ -1,22 +1,18 @@
<script setup lang="ts">
import { ref, onMounted, reactive } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
import { useRouter, useRoute } from "vue-router";
import type { QInput, QForm } from "quasar";
import type { treeTab } from "@/modules/05_placement/interface/index/Main";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type {
requestSendNoti,
DataCopyOrder,
FormActive,
ResponseOrganiz,
OrgTree,
TreeMain,
} from "@/modules/06_retirement/interface/response/Deceased";
import { useRouter, useRoute } from "vue-router";
import DialogOrgSelectOneStep from "@/components/Dialogs/DialogOrgSelectOneStep.vue";
@ -45,7 +41,6 @@ const props = defineProps({
default: () => console.log("not function"),
},
});
const itemTaps = ref<string[]>();
const profileId = ref<string>(route.params.id.toString());
const next = () => props.next();
@ -55,24 +50,10 @@ const filterRef = ref<QInput>();
const filter = ref<string>("");
const modalSelectOrg = ref<boolean>(false);
const nodes = ref<Array<OrgTree>>([]);
const selectedModal = ref<any[]>([]);
const rows = ref<DataCopyOrder[]>([]);
const editRows = ref<DataCopyOrder[]>([]);
/** active form */
const formActive = reactive<FormActive>({
activeId: "",
activeName: "",
draftId: "",
draftName: "",
orgPublishDate: null,
isPublic: false,
});
/** คอลัมน์Modal */
const rowsModal = ref<ResponseOrganiz[]>([]);
/** selcet OPtion */
const optionSelect = ref<any>([
{ id: 1, name: "อีเมล" },
@ -139,13 +120,8 @@ const columns = ref<QTableProps["columns"]>([
},
]);
/** Hook */
onMounted(async () => {
await getData();
});
/** เรียกข้อมูลจาก api */
const getData = async () => {
async function getData() {
showLoader();
await http
.get(config.API.detailByidDeceased(profileId.value))
@ -189,7 +165,7 @@ const getData = async () => {
.finally(async () => {
hideLoader();
});
};
}
/**
*งก Save
@ -213,22 +189,22 @@ async function saveData() {
});
}
const resetFilter = () => {
function resetFilter() {
// reset X
filter.value = "";
filterRef.value!.focus();
};
}
/**
* class ดรปแบบแสดงระหวางขอมลทแกไขหรอแสดงเฉยๆ
* @param val อม input สำหรบแกไขหรอไม
*/
const getClass = (val: boolean) => {
function getClass(val: boolean) {
return {
"full-width inputgreen cursor-pointer": val,
"full-width cursor-pointer": !val,
};
};
}
/**
* กดปมเพมดานบน table
@ -243,67 +219,12 @@ function clickAdd() {
/**
* ลบขอม
*/
const clickDelete = (id: string) => {
function clickDelete(id: string) {
dialogRemove($q, () => deleteData(id));
};
/** ดึงข้อมูล active */
async function getActive() {
showLoader();
await http
.get(config.API.activeOrganization)
.then((res) => {
const data = res.data.result;
formActive.activeId = data.activeId;
formActive.activeName = data.activeName;
formActive.draftId = data.draftId;
formActive.draftName = data.draftName;
formActive.orgPublishDate = data.orgPublishDate;
formActive.isPublic = data.isPublic;
getTreeData(data.activeId);
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
/** ดึงข้อมูล หน่วยงาน */
async function getTreeData(id: string) {
showLoader();
await http
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
.then((res) => {
const data = res.data.result;
nodes.value = data;
filterItemsTaps(data);
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
function filterItemsTaps(data: TreeMain[]) {
let orgTreeIds: string[] = [];
for (const child of data) {
orgTreeIds.push(child.orgTreeId);
if (child.children) {
orgTreeIds = orgTreeIds.concat(filterItemsTaps(child.children));
}
}
itemTaps.value = orgTreeIds;
return orgTreeIds;
}
/**ลบข้อมูล */
const deleteData = async (id: string) => {
async function deleteData(id: string) {
await http
.delete(config.API.detailByidDeceased(id))
.then((res) => {
@ -315,12 +236,12 @@ const deleteData = async (id: string) => {
.finally(async () => {
await getData();
});
};
}
/**
* Save อม
*/
const saveDataCopyOrder = async () => {
async function saveDataCopyOrder() {
if (myForm.value !== null) {
myForm.value.validate().then(async (result: boolean) => {
if (result) {
@ -333,9 +254,9 @@ const saveDataCopyOrder = async () => {
}
});
}
};
}
// Save
const fetchSaveCopyOrder = async () => {
async function fetchSaveCopyOrder() {
let list: requestSendNoti[] = [];
rows.value.map((r: DataCopyOrder) => {
list.push({
@ -359,10 +280,16 @@ const fetchSaveCopyOrder = async () => {
hideLoader();
getData();
});
};
const updateData = (row: DataCopyOrder) => {
}
function updateData(row: DataCopyOrder) {
editRows.value.push(row);
};
}
/** Hook */
onMounted(async () => {
await getData();
});
</script>
<template>

View file

@ -2,21 +2,18 @@
import { useRouter, useRoute } from "vue-router";
import { useQuasar } from "quasar";
import { ref, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import genReport from "@/plugins/genreport";
/** importType*/
import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
import type { ResDetailDeceased } from "@/modules/06_retirement/interface/response/Deceased";
/** importComponents*/
import CardProfile from "@/components/CardProfile.vue";
/** importStore*/
import { useCounterMixin } from "@/stores/mixin";
import { checkPermission } from "@/utils/permissions";
import genReport from "@/plugins/genreport";
import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
import type { ResDetailDeceased } from "@/modules/06_retirement/interface/response/Deceased";
import CardProfile from "@/components/CardProfile.vue";
/**use*/
const $q = useQuasar();
@ -30,13 +27,8 @@ const detail = ref<ResDetailDeceased>();
const dataProfile = ref<DataProfile>();
/** Hook */
onMounted(() => {
fetchData();
});
// API
const fetchData = async () => {
/** นำข้อมูลจาก API มาแสดง */
async function fetchData() {
showLoader();
await http
.get(config.API.detailDeceased(profileId.value))
@ -52,23 +44,23 @@ const fetchData = async () => {
.finally(() => {
hideLoader();
});
};
}
//detail deceased
const openDeceased = (id: string) => {
/** เปิดdetail ของ deceased */
function openDeceased(id: string) {
router.push(`/retirement/deceased/detail/${id}`);
};
}
//
const nextPage = (page: string) => {
/** ไปหน้าถัดไป */
function nextPage(page: string) {
window.open(page, "_blank");
};
}
/**
* งก ดาวโหลด
* @param type typeของรายละเอยด
*/
const fileDownload = async (type: string) => {
async function fileDownload(type: string) {
showLoader();
await http
.get(config.API.DeceasedReport(type, profileId.value))
@ -86,7 +78,12 @@ const fileDownload = async (type: string) => {
hideLoader();
})
.finally(() => {});
};
}
/** Hook */
onMounted(() => {
fetchData();
});
</script>
<template>

View file

@ -1,21 +1,39 @@
<script setup lang="ts">
import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogHeader from "@/components/DialogHeader.vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogHeader from "@/components/DialogHeader.vue";
/** use */
const $q = useQuasar();
const selected = ref<ResponseItems[]>([]);
const mixin = useCounterMixin();
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
/** props*/
const props = defineProps({
modal: Boolean,
closeModal: Function,
fecthlist: Function,
rows2: Array,
filterKeyword2: String,
});
/**
* งกนการ Selected Data
*/
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
}
});
/** คอลัมน์ */
const columns2 = ref<QTableProps["columns"]>([
@ -132,41 +150,17 @@ const visibleColumns2 = ref<string[]>([
"statustext",
]);
/** props*/
const props = defineProps({
modal: Boolean,
closeModal: Function,
fecthlist: Function,
rows2: Array,
filterKeyword2: String,
});
//reset
const resetFilter = () => {
filterKeyword.value = "";
filterRef.value.focus();
};
/**
* งกนการ Selected Data
*/
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
}
});
//popup
const saveOrder = () => {
/** popup ยืนยันส่งัว */
function saveOrder() {
dialogConfirm(
$q,
() => Ordersave(),
"ยืนยันส่งไปออกคำสั่ง",
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
);
};
//
const Ordersave = async () => {
}
/** ส่งไปออกคำสั่ง */
async function Ordersave() {
const id = selected.value.map((r) => r.id);
const body = {
id,
@ -185,17 +179,18 @@ const Ordersave = async () => {
props.fecthlist?.();
hideLoader();
});
};
}
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
const updateInput = (value: any) => {
function updateInput(value: any) {
emit("update:filterKeyword2", value);
};
}
//
const Reset = () => {
/** รีเซ็ตค่าในช่องค้นหา */
function Reset() {
emit("update:filterKeyword2", "");
};
}
watchEffect(() => {
if (props.modal === true) {
selected.value = [];

View file

@ -1,19 +1,23 @@
<script setup lang="ts">
import { ref, onMounted, computed } from "vue";
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useRetirementDataStore } from "@/modules/06_retirement/store";
import DialogSendToCommand from "@/modules/06_retirement/components/resign/DialogSendToCommand.vue";
import type { QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import { useCounterMixin } from "@/stores/mixin";
import { useRetirementDataStore } from "@/modules/06_retirement/store";
import { checkPermission } from "@/utils/permissions";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogSendToCommand from "@/modules/06_retirement/components/resign/DialogSendToCommand.vue";
/** use */
const $q = useQuasar(); // noti quasar
const RetirementData = useRetirementDataStore();
const { statusText } = RetirementData;
const $q = useQuasar(); // noti quasar
const router = useRouter();
const mixin = useCounterMixin();
const { messageError, date2Thai, showLoader, hideLoader } = mixin;
@ -144,19 +148,27 @@ const filterRef = ref<any>(null);
const openModal = () => (modal.value = true);
/**Setting pagination */
const pagination = ref({
sortBy: "datetext",
descending: true,
page: 1,
rowsPerPage: 10,
});
//
const closeModal = () => {
function closeModal(){
modal.value = false;
filterKeyword2.value = "";
};
//reset filter
const resetFilter = () => {
function resetFilter(){
filterKeyword.value = "";
filterRef.value.focus();
};
// Modal
const openModalOrder = async () => {
async function openModalOrder(){
openModal();
const row = await filters.value.filter(
(r: ResponseItems) =>
@ -172,13 +184,8 @@ const openModalOrder = async () => {
rows2.value = row;
};
/**Hook */
onMounted(async () => {
await fecthlist();
});
// API
const fecthlist = async () => {
async function fecthlist(){
showLoader();
await http
.get(config.API.listResign())
@ -223,12 +230,9 @@ const fecthlist = async () => {
});
};
/**Setting pagination */
const pagination = ref({
sortBy: "datetext",
descending: true,
page: 1,
rowsPerPage: 10,
/**Hook */
onMounted(async () => {
await fecthlist();
});
</script>
<template>

View file

@ -1,15 +1,17 @@
<script setup lang="ts">
import axios from "axios";
import { useRouter, useRoute } from "vue-router";
import { useQuasar, QForm } from "quasar";
import { ref, onMounted } from "vue";
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
import DialogHeader from "@/components/DialogHeader.vue";
import { useCounterMixin } from "@/stores/mixin";
import { useRetirementDataStore } from "@/modules/06_retirement/store";
import http from "@/plugins/http";
import config from "@/app.config";
import axios from "axios";
import genReport from "@/plugins/genreport";
import { tokenParsed } from "@/plugins/auth";
import { useCounterMixin } from "@/stores/mixin";
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
import DialogHeader from "@/components/DialogHeader.vue";
import type {
TypeFile,
@ -18,23 +20,17 @@ import type {
CheckBoxType,
} from "@/modules/06_retirement/interface/response/Main";
import type { QTableProps } from "quasar";
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
/** importComponents*/
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
import CardProfile from "@/components/CardProfile.vue";
import genReport from "@/plugins/genreport";
const modalPersonal = ref<boolean>(false);
const personId = ref<string>("");
/** Use */
const $q = useQuasar();
const route = useRoute();
const router = useRouter();
const checkRoutePermisson = ref<boolean>(route.name == "resignDetailbyid");
const mixin = useCounterMixin();
const RetirementData = useRetirementDataStore();
const {
messageError,
date2Thai,
@ -45,9 +41,10 @@ const {
dialogConfirm,
dialogRemove,
} = mixin;
const { statusText } = RetirementData;
/** ตัวแปร */
const modalPersonal = ref<boolean>(false);
const personId = ref<string>("");
const roleUser = ref<string>("");
const dataProfile = ref<DataProfile>();
@ -78,6 +75,7 @@ const dataDetail = ref<any>({
statustext: "",
fullname: "",
});
const organizationPositionOld = ref<string>("");
const positionTypeOld = ref<string>("");
const positionLevelOld = ref<string>("");
@ -135,33 +133,16 @@ const fileList = ref<FileList[]>([]);
const isNoDebt = ref<boolean>(false);
const isNoBurden = ref<boolean>(false);
const isDiscipline = ref<boolean>(false);
const checkboxGroup = ref<CheckBoxType[]>([]);
const checkboxOp = ref<CheckBoxType[]>([
{ label: "ไม่เป็นหนี้สหกรณ์", value: "debt" },
//
const rowsFileDownload = ref<rowFile[]>([
{
fileName: "แบบฟอร์มหนังสือขอลาออกจากราชการ",
pathName: "",
},
]);
/** Hook */
onMounted(async () => {
fetchData(id.value);
fetchFile();
const user = await tokenParsed();
if (user) {
const commander = await user.role.includes("commander");
const oligarch = await user.role.includes("oligarch");
const officer = await user.role.includes("officer");
if (commander) {
roleUser.value = "commander";
} else if (oligarch) {
roleUser.value = "oligarch";
} else if (officer) {
roleUser.value = "officer";
} else {
roleUser.value = "admin";
}
}
});
const diffDate = () => {
function diffDate() {
if (date.value !== null && dateLeave.value !== null) {
const time = dateLeave.value.getTime() - date.value.getTime();
// -
@ -172,10 +153,10 @@ const diffDate = () => {
return false;
}
return false;
};
}
/** นำข้อมูลมาจาก API*/
const fetchData = async (id: string) => {
async function fetchData(id: string) {
showLoader();
await http
.get(config.API.resingByid(id))
@ -216,18 +197,18 @@ const fetchData = async (id: string) => {
.finally(() => {
hideLoader();
});
};
}
/**Pop up */
const popUp = (action: "pass" | "passNot") => {
function popUp(action: "pass" | "passNot") {
reasonReign.value = "";
dateBreak.value = null;
actionPass.value = action === "pass";
openModal();
};
}
//pop up
const conditionPopup = () => {
function conditionPopup() {
if (myFormConfirm.value !== null) {
myFormConfirm.value.validate().then(async (check) => {
if (check) {
@ -239,10 +220,10 @@ const conditionPopup = () => {
}
});
}
};
}
//pop up
const confirmpopUp = async () => {
async function confirmpopUp() {
dialogConfirm(
$q,
async () => {
@ -265,10 +246,10 @@ const confirmpopUp = async () => {
"ยืนยันการอนุญาต",
"ต้องการยืนยันการอนุญาตการลานี้หรือไม่ ?"
);
};
}
//pop up
const rejectpopUp = async () => {
async function rejectpopUp() {
dialogConfirm(
$q,
async () => {
@ -292,26 +273,26 @@ const rejectpopUp = async () => {
"ยืนยันการยับยั้ง",
"ต้องการยืนยันการยับยั้งนี้หรือไม่ ?"
);
};
}
/**
* กดยกเล
*/
const clickCancel = async () => {
async function clickCancel() {
await fetchData(id.value);
edit.value = false;
myForm.value?.resetValidation();
};
}
/**
* กดยกเล
*/
const clickCancelConditions = async () => {
async function clickCancelConditions() {
await fetchData(id.value);
conditions.value = false;
};
}
/** Function บันทึก รายการตรวจสอบเงื่อนไขต่าง ๆ*/
const onSubmitConditions = () => {
function onSubmitConditions() {
dialogConfirm($q, () => {
showLoader();
http
@ -332,10 +313,10 @@ const onSubmitConditions = () => {
hideLoader();
});
});
};
}
/** Function บันทึก ,แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย*/
const onSubmitAttached = () => {
function onSubmitAttached() {
dialogConfirm($q, () => {
const formData = new FormData();
const send = date.value !== null ? new Date(date.value).toUTCString() : "";
@ -366,39 +347,31 @@ const onSubmitAttached = () => {
await hideLoader();
});
});
};
}
/**
* Function เพ Class เวลา Edit
* @param val เมอเปนEdit จะเปลยน Class
*/
const getClass = (val: boolean) => {
function getClass(val: boolean) {
return {
"full-width inputgreen cursor-pointer": val,
"full-width cursor-pointer": !val,
};
};
}
/** แปลง StatusOrder */
const statusOrder = (val: boolean) => {
function statusOrder(val: boolean) {
switch (val) {
case true:
return "ยับยั้ง";
case false:
return "อนุญาต";
}
};
//
const rowsFileDownload = ref<rowFile[]>([
{
fileName: "แบบฟอร์มหนังสือขอลาออกจากราชการ",
pathName: "",
},
]);
}
//
const fileDownload = async (type: string, fileName: string) => {
async function fileDownload(type: string, fileName: string) {
showLoader();
await http
.get(config.API.reportResignList(type, id.value))
@ -412,18 +385,7 @@ const fileDownload = async (type: string, fileName: string) => {
hideLoader();
})
.finally(() => {});
};
//
const downloadFile = (response: any, filename: string) => {
const link = document.createElement("a");
var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data]));
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
}
function updatemodalPersonal(modal: boolean) {
modalPersonal.value = modal;
@ -541,6 +503,27 @@ function removeFile(fileName: string) {
});
});
}
/** Hook */
onMounted(async () => {
fetchData(id.value);
fetchFile();
const user = await tokenParsed();
if (user) {
const commander = await user.role.includes("commander");
const oligarch = await user.role.includes("oligarch");
const officer = await user.role.includes("officer");
if (commander) {
roleUser.value = "commander";
} else if (oligarch) {
roleUser.value = "oligarch";
} else if (officer) {
roleUser.value = "officer";
} else {
roleUser.value = "admin";
}
}
});
</script>
<template>

View file

@ -1,12 +1,15 @@
<script setup lang="ts">
import { onMounted, reactive, ref, useAttrs, computed } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import router from "@/router";
import { useCounterMixin } from "@/stores/mixin";
import type { FormOrderPlacementMainData } from "@/modules/05_placement/interface/request/Main";
import type { DataOption } from "@/modules/05_placement/interface/index/Main";
import { useCounterMixin } from "@/stores/mixin";
import { useOrderPlacementDataStore } from "@/modules/05_placement/store";
import router from "@/router";
import { useQuasar } from "quasar";
/** Use */
const $q = useQuasar(); // noti quasar
@ -264,34 +267,25 @@ const rows = ref<FormOrderPlacementMainData[]>([
let OriginalData = ref<FormOrderPlacementMainData[]>([]);
let UpdataData = ref<FormOrderPlacementMainData[]>([]);
/**Hook */
onMounted(async () => {
await OriginalDataFetch();
fiscalYearFilter();
searchFilterTable();
OrderStatusFilter();
OrderTypeFilter();
});
/**
* งคาขอมลจาก store
*/
const OriginalDataFetch = async () => {
async function OriginalDataFetch() {
await DataStore.DataMainOrder(rows.value);
OriginalData.value = await DataStore.DataMainOrigOrder;
UpdataData.value = OriginalData.value;
};
}
//
const redirectToPage = (id?: number) => {
function redirectToPage(id?: number) {
router.push(`/placement/order/detail`);
};
}
/**
* function delete
* @param id id delete
*/
const clickDelete = (id: string) => {
function clickDelete(id: string) {
$q.dialog({
title: "ยืนยันการลบข้อมูล",
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
@ -304,18 +298,18 @@ const clickDelete = (id: string) => {
.onOk(async () => {})
.onCancel(() => {})
.onDismiss(() => {});
};
}
//route OrderplacementDetail
const clickAdd = () => {
function clickAdd() {
router.push({ name: "OrderplacementDetail" });
};
}
//
const fiscalyear = ref<number | null>(0);
const fiscalyearOP = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
const addedfiscalYearValues: number[] = [];
const fiscalYearFilter = async () => {
async function fiscalYearFilter() {
for (let data of OriginalData.value) {
const year = data.fiscalYear;
@ -328,7 +322,7 @@ const fiscalYearFilter = async () => {
addedfiscalYearValues.push(year);
}
}
};
}
/**
* เลอกประเภทคำส
@ -336,7 +330,7 @@ const fiscalYearFilter = async () => {
const OrderType = ref<string>("");
const OrderTypeOption = reactive<DataOption[]>([{ id: 0, name: "ทั้งหมด" }]);
const addedOrderTypeValues: string[] = [];
const OrderTypeFilter = async () => {
async function OrderTypeFilter() {
for (let data of OriginalData.value) {
const OrderTypeValue = data.OrderType;
if (!addedOrderTypeValues.includes(OrderTypeValue)) {
@ -347,7 +341,7 @@ const OrderTypeFilter = async () => {
addedOrderTypeValues.push(OrderTypeValue);
}
}
};
}
/**
* เลอกStatus คำส
@ -355,7 +349,7 @@ const OrderTypeFilter = async () => {
const OrderStatus = ref<string>("");
const OrderStatusOption = reactive<DataOption[]>([{ id: 1, name: "ทั้งหมด" }]);
const addedOrderStatusValues: string[] = [];
const OrderStatusFilter = async () => {
async function OrderStatusFilter() {
for (let data of OriginalData.value) {
const OrderStatusValue = data.OrderStatus;
@ -374,31 +368,42 @@ const OrderStatusFilter = async () => {
addedOrderStatusValues.push(OrderStatusValue);
}
}
};
}
//
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
const resetFilter = () => {
/** ล้างค่าในฟิลเตอร์ */
function resetFilter() {
filterKeyword.value = "";
filterRef.value.focus();
};
}
const attrs = ref<any>(useAttrs());
const searchFilterTable = async () => {
async function searchFilterTable() {
await DataStore.DataUpdateOrder(
OrderType.value,
OrderStatus.value,
fiscalyear.value
);
UpdataData.value = DataStore.DataMainUpdateOrder;
};
}
/**Setting pagination */
const paging = ref<boolean>(true);
const paginationLabel = (start: string, end: string, total: string) => {
function paginationLabel(start: string, end: string, total: string) {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;
};
}
/**Hook */
onMounted(async () => {
await OriginalDataFetch();
fiscalYearFilter();
searchFilterTable();
OrderStatusFilter();
OrderTypeFilter();
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">คำสงลาออก</div>

View file

@ -1,4 +1,48 @@
interface Pagination {
rowsPerPage: number;
}
export type { Pagination };
interface RetirementList {
id: string;
profileId: string;
order: number;
prefix: string;
firstName: string;
lastName: string;
name: string;
organization: string | null;
position: string;
positionNumber: string | null;
positionType: string;
positionLevel: string;
reason: string;
remove: string;
root: string | null;
rootId: string | null;
child1: string | null;
child1Id: string | null;
child2: string | null;
child2Id: string | null;
child3: string | null;
child3Id: string | null;
child4: string | null;
child4Id: string | null;
}
interface PersonData {
id: string;
prefix: string;
firstName: string;
lastName: string;
fullname: string;
position: string;
level: string;
organizationOrganization: string;
}
interface RoundData {
id: string;
round: string;
}
export type { Pagination, RetirementList, PersonData, RoundData };

View file

@ -7,4 +7,17 @@ interface OptionQuestions2 {
value: boolean;
}
export type { OptionQuestions, OptionQuestions2 };
interface QuestionDesc {
question1Desc: string;
question2Desc: string;
question3Desc: string;
question4Desc: string;
question5Desc: string;
question6Desc: string;
question7Desc: string;
question8Desc: string;
question9Desc: string;
question10Desc: string;
}
export type { OptionQuestions, OptionQuestions2,QuestionDesc };

View file

@ -51,6 +51,7 @@ interface CheckBoxType {
label: string;
value: string;
}
export type {
resMain,
ResponseItems,

View file

@ -26,4 +26,21 @@ interface TypeFile {
pathName: string;
}
export type { ResponseData, TypeFile };
interface ResponseDataDetail {
personId: string;
avataPath: string;
createdAt: Date;
date: Date;
id: string;
organization: string;
organizationPositionOld: string;
positionLevelOld: string;
positionNumberOld: string;
positionTypeOld: string;
reason: string;
salary: number;
status: string;
fullname: string;
}
export type { ResponseData, TypeFile,ResponseDataDetail };

View file

@ -7,8 +7,6 @@ const Listretirement = () =>
import("@/modules/06_retirement/components/ListRetirement/TableList.vue");
const ListretirementDetail = () =>
import("@/modules/06_retirement/components/ListRetirement/TableList.vue");
// const resignOrder = () =>
// import("@/modules/06_retirement/components/resign/ResignOrder.vue");
const resign = () =>
import("@/modules/06_retirement/components/resign/Resign.vue");
const resignByid = () =>
@ -25,17 +23,6 @@ const outDetail = () =>
import("@/modules/06_retirement/components/DismissOrder/outRegistry.vue");
const outDetailOnly = () =>
import("@/modules/06_retirement/components/DismissOrder/outRegistry.vue");
// const dischargedMain = () =>
// import("@/modules/06_retirement/components/Discharged/dischargedMain.vue");
// const dischargedDetails = () =>
// import(
// "@/modules/06_retirement/components/Discharged/dischargedRegistry.vue"
// );
// const expulsionMain = () =>
// import("@/modules/06_retirement/components/Expulsion/expulsionMain.vue");
// const expulsionDetails = () =>
// import("@/modules/06_retirement/components/Expulsion/expulsionRegistry.vue");
const exitInterviewMain = () =>
import("@/modules/06_retirement/components/ExitInterview/exitMain.vue");
const exitInterviewDetails = () =>

View file

@ -3,31 +3,41 @@ import { onMounted, ref, useAttrs, reactive, watch } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { storeToRefs } from "pinia";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStoreRetirement } from "@/modules/06_retirement/storeRetirement";
import type { resMain } from "@/modules/06_retirement/interface/response/Main";
import { storeToRefs } from "pinia";
import popupAdd from "../components/ListRetirement/popupAdd.vue";
import { checkPermission } from "@/utils/permissions";
const useStoreRetire = useDataStoreRetirement();
const { clickTab } = useStoreRetire;
const { tab, type } = storeToRefs(useDataStoreRetirement());
const mixin = useCounterMixin();
const { messageError, date2Thai, showLoader, hideLoader, dialogConfirm } =
mixin;
const router = useRouter();
const $q = useQuasar(); // noti quasar
import type { resMain } from "@/modules/06_retirement/interface/response/Main";
const fiscalyear = ref<number>();
import popupAdd from "@/modules/06_retirement/components/ListRetirement/popupAdd.vue";
const $q = useQuasar(); // noti quasar
const router = useRouter();
const mixin = useCounterMixin();
const useStoreRetire = useDataStoreRetirement();
const { tab, type } = storeToRefs(useDataStoreRetirement());
const { clickTab } = useStoreRetire;
const { messageError, date2Thai, showLoader, hideLoader } = mixin;
const fiscalyear = ref<number>(); //
const yearOptionsFilter = ref<any>({
yearOptions: [],
});
const actionOption = ref<resMain[]>([]);
const attrs = ref<any>(useAttrs());
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "",
descending: false,
page: 1,
rowsPerPage: 10,
});
const visibleColumns = ref<string[]>([
"no",
"signDate",
@ -85,20 +95,10 @@ const currentYear = new Date().getFullYear();
const rows = ref<resMain[]>([]);
const yearOptions = ref<any>([{ id: "", year: "ทั้งหมด" }]);
onMounted(async () => {
await fetchRetirement(type.value, currentYear);
// fiscalyear.value = currentYear + 543
// await fetchRetirement(type.value, currentYear);
});
//
const filteryear = () => {
// yearOptions.value.push({ id: currentYear, name: currentYear + 543 });
// yearOptionsFilter.value = [{ id: currentYear, name: currentYear + 543 }];
// yearOptionsFilter.value.push({ id: currentYear, name: currentYear + 543 });
fetchRetirement(type.value, currentYear);
};
//
const fetchRetirement = async (type: string, year: any) => {
async function fetchRetirement(type: string, year: any) {
showLoader();
await http
.get(config.API.retirement(type, year))
@ -155,57 +155,58 @@ const fetchRetirement = async (type: string, year: any) => {
.finally(() => {
hideLoader();
});
};
}
const checkjson = ref<boolean>();
// document
const checkststus = (data: any) => {
function checkststus(data: any) {
let jsonfasle = data.find((e: any) => e.document == false);
if (jsonfasle) {
checkjson.value = true;
} else checkjson.value = false;
};
}
//
const filterKeyword = ref<string>("");
const filterRef = ref<any>(null);
const resetFilter = () => {
/** reset ฟิลเตอร์ */
function resetFilter() {
filterKeyword.value = "";
filterRef.value.focus();
};
const attrs = ref<any>(useAttrs());
}
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "",
descending: false,
page: 1,
rowsPerPage: 10,
});
const filterSelector = (val: any, update: Function) => {
/**
* งชนฟลเตอร input
* @param val input
* @param update Function quasar
*/
function filterSelector(val: any, update: Function) {
update(() => {
yearOptions.value = yearOptionsFilter.value.filter(
(v: any) => v.year.indexOf(val) > -1
);
});
};
}
const paginationLabel = (start: string, end: string, total: string) => {
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
else return start + "-" + end + " ใน " + total;
};
const nextPage = (prop: any) => {
/**
* ไปหนาแกไขรายละเอยด
* @param prop อม
*/
function nextPage(prop: any) {
router.push(`/retirement/${prop.id}`);
};
const nextPageDetail = (prop: any) => {
router.push(`/retirement-detail/${prop.id}`);
};
}
watch(type, () => {
fetchRetirement(type.value, currentYear);
});
//
const typeReportChangeName = (val: string) => {
/**
* ไปหนารายละเอยด
* @param prop อม
*/
function nextPageDetail(prop: any) {
router.push(`/retirement-detail/${prop.id}`);
}
/** แปลง status เป็น text */
function typeReportChangeName(val: string) {
switch (val) {
case "EDIT":
return "ประกาศแก้ไขเกษียณ";
@ -216,7 +217,15 @@ const typeReportChangeName = (val: string) => {
default:
return "ประกาศข้อมูลเกษียณ";
}
};
}
watch(type, () => {
fetchRetirement(type.value, currentYear);
});
onMounted(async () => {
await fetchRetirement(type.value, currentYear);
});
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
@ -345,7 +354,6 @@ const typeReportChangeName = (val: string) => {
class="custom-header-table"
v-bind="attrs"
:visible-columns="visibleColumns"
:pagination-label="paginationLabel"
v-model:pagination="pagination"
>
<template v-slot:header="props">