diff --git a/src/modules/07_insignia/components/2_Manage/StatCard.vue b/src/modules/07_insignia/components/2_Manage/StatCard.vue
index c5c0e1e0b..5b0283228 100644
--- a/src/modules/07_insignia/components/2_Manage/StatCard.vue
+++ b/src/modules/07_insignia/components/2_Manage/StatCard.vue
@@ -1,9 +1,14 @@
@@ -768,7 +834,7 @@ const clearInsigniaFilters = (name: string) => {
{
- {
dense
class="custom-header-table"
:visible-columns="visibleColumns"
- :pagination-label="paginationLabel"
v-model:pagination="pagination"
>
@@ -1092,19 +1157,7 @@ const clearInsigniaFilters = (name: string) => {
-
-
-
-
+
@@ -1143,7 +1196,7 @@ const clearInsigniaFilters = (name: string) => {
- {
:filter="filterKeyword2"
row-key="fullname"
class="custom-header-table"
- :pagination-label="paginationLabel2"
v-model:pagination="pagination2"
>
@@ -1182,18 +1234,7 @@ const clearInsigniaFilters = (name: string) => {
-
-
-
-
+
diff --git a/src/modules/07_insignia/components/2_Manage/Tab2.vue b/src/modules/07_insignia/components/2_Manage/Tab2.vue
index 18527764f..fa33249f2 100644
--- a/src/modules/07_insignia/components/2_Manage/Tab2.vue
+++ b/src/modules/07_insignia/components/2_Manage/Tab2.vue
@@ -1,15 +1,22 @@
@@ -310,101 +336,101 @@ const clearInsigniaFilters = (name: string) => {
- filterSelector(inputValue, doneFn,'typeinsigniaOptions'
) "
- >
-
-
-
-
-
- ไม่มีข้อมูล
-
-
-
-
+
+
+
+
+
+ ไม่มีข้อมูล
+
+
+
+ filterSelector(inputValue, doneFn,'employeeClassOps'
) "
- >
-
-
-
-
-
- ไม่มีข้อมูล
-
-
-
+ >
+
+
+
+
+
+ ไม่มีข้อมูล
+
+
+
-
{
dense
class="custom-header-table"
:visible-columns="visibleColumns"
- :pagination-label="paginationLabel"
v-model:pagination="pagination"
>
@@ -479,19 +504,7 @@ const clearInsigniaFilters = (name: string) => {
-
-
-
-
+
import { onMounted, ref, watch, reactive } from "vue";
import { useQuasar } from "quasar";
-import type { QTableProps } from "quasar";
-import { useInsigniaDataStore } from "@/modules/07_insignia/store";
import { useRouter } from "vue-router";
-import DialogInformation from "@/components/Dialogs/Information.vue";
-import { useroleUserDataStore } from "@/stores/roleUser";
+/** import Type*/
+import type { QTableProps } from "quasar";
+
+/** import components*/
+import DialogInformation from "@/components/Dialogs/Information.vue";
+
+/** import Stores */
+import { useInsigniaDataStore } from "@/modules/07_insignia/store";
+import { useroleUserDataStore } from "@/stores/roleUser";
+/** useStore*/
+const DataStore = useInsigniaDataStore();
const roleDataStore = useroleUserDataStore();
const { adminRole } = roleDataStore;
const router = useRouter();
-const DataStore = useInsigniaDataStore();
+
const props = defineProps({
tab: {
type: String,
@@ -31,19 +38,8 @@ const employeeClassOps = ref(DataStore.employeeClassOps);
const filterOrganizationOP = ref([]);
const organization = ref("1");
const organizationOptions = ref([{ id: "1", name: "ทั้งหมด" }]);
-const visibleColumns = ref([
- "no",
- "citizenId",
- "name",
- "employeeType",
- "position",
- "level",
- "salary",
- "insigniaType",
- "insigniaSend",
- "insigniaLevel",
-]);
-// หัวตาราง
+
+/** หัวตาราง*/
const columns = ref([
{
name: "no",
@@ -145,26 +141,21 @@ const columns = ref([
style: "font-size: 14px",
},
]);
-onMounted(async () => {
- organizationOptions.value = DataStore.optionsTypeOc;
- // organization.value = await (DataStore.agency != null
- // ? DataStore.agency
- // : DataStore.typeOc);
- organization.value = await DataStore.typeOc;
- if (organization.value !== "" || organization.value !== undefined) {
- if (props.fecthInsigniaByOc) {
- await props.fecthInsigniaByOc(
- props.roundId,
- organization.value,
- "officer",
- props.tab
- );
- DataStore.mainTab = props.tab;
- }
- }
- filterOrganizationOP.value = organizationOptions.value;
-});
-const changtypeOc = async () => {
+const visibleColumns = ref([
+ "no",
+ "citizenId",
+ "name",
+ "employeeType",
+ "position",
+ "level",
+ "salary",
+ "insigniaType",
+ "insigniaSend",
+ "insigniaLevel",
+]);
+
+/** function เลือกหน่วยงาน */
+async function changtypeOc() {
if (props.fecthInsigniaByOc) {
await props.fecthInsigniaByOc(
props.roundId,
@@ -174,11 +165,17 @@ const changtypeOc = async () => {
);
}
DataStore.typeOc = organization.value;
-};
-const nextPage = (id: string) => {
- router.push(`/registry/${id}`);
-};
+}
+/**
+ * function redirect ทะเบียนประวัติิ
+ * @param id profileId
+ */
+function nextPage(id: string) {
+ router.push(`/registry/${id}`);
+}
+
+/** ข้อมูล Table*/
const filterKeyword = ref("");
const filterRef = ref(null);
const resetFilter = () => {
@@ -191,24 +188,33 @@ const pagination = ref({
page: 1,
rowsPerPage: 10,
});
-const paging = ref(true);
-const paginationLabel = (start: number, end: number, total: number) => {
- if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
- else return start + "-" + end + " ใน " + total;
-};
+/** หมายเหตุ*/
const dialogNote = ref(false);
const note = ref("");
const noteTitle = ref("");
-const showNote = (row: any) => {
+/**
+ * function openPopup แสดง หมายเหตุ
+ * @param row รายละเอียดข้อมูล
+ */
+function showNote(row: any) {
note.value = row.requestNote;
noteTitle.value = "เหตุผลการลบออก " + " " + row.name;
dialogNote.value = true;
-};
-const closeReson = () => {
+}
+
+/** function closePopup หมายเหตุ*/
+function closeReson() {
dialogNote.value = false;
-};
-const filterSelector = (val: any, update: Function, name: any) => {
+}
+
+/**
+ * function ค้นหาข้อมูลใน option
+ * @param val คำค้นหา
+ * @param update funtion
+ * @param name ชื่อ selec
+ */
+function filterSelector(val: any, update: Function, name: any) {
update(() => {
const needle = val.toLowerCase();
if (name === "typeinsigniaOptions") {
@@ -227,8 +233,13 @@ const filterSelector = (val: any, update: Function, name: any) => {
);
}
});
-};
-const clearInsigniaFilters = (name: string) => {
+}
+
+/**
+ * function clearfilter เครื่องราช
+ * @param name ชื่อ selec
+ */
+function clearInsigniaFilters(name: string) {
if (name === "typeinsigniaOptions") {
DataStore.typeinsignia = "all";
typeinsigniaOptions.value = DataStore.typeinsigniaOptions;
@@ -236,7 +247,25 @@ const clearInsigniaFilters = (name: string) => {
DataStore.employeeClass = "all";
employeeClassOps.value = DataStore.employeeClassOps;
}
-};
+}
+
+/** Hook*/
+onMounted(async () => {
+ organizationOptions.value = DataStore.optionsTypeOc;
+ organization.value = await DataStore.typeOc;
+ if (organization.value !== "" || organization.value !== undefined) {
+ if (props.fecthInsigniaByOc) {
+ await props.fecthInsigniaByOc(
+ props.roundId,
+ organization.value,
+ "officer",
+ props.tab
+ );
+ DataStore.mainTab = props.tab;
+ }
+ }
+ filterOrganizationOP.value = organizationOptions.value;
+});
@@ -400,7 +429,7 @@ const clearInsigniaFilters = (name: string) => {
- {
dense
class="custom-header-table"
:visible-columns="visibleColumns"
- :pagination-label="paginationLabel"
v-model:pagination="pagination"
>
@@ -475,19 +503,7 @@ const clearInsigniaFilters = (name: string) => {
-
-
-
-
+
diff --git a/src/modules/07_insignia/components/2_Manage/Tab4.vue b/src/modules/07_insignia/components/2_Manage/Tab4.vue
index 9d56c7f6c..a9df90e90 100644
--- a/src/modules/07_insignia/components/2_Manage/Tab4.vue
+++ b/src/modules/07_insignia/components/2_Manage/Tab4.vue
@@ -1,16 +1,22 @@
- {
:paging="true"
class="custom-header-table"
:visible-columns="visibleColumns"
- :pagination-label="paginationLabel"
v-model:pagination="pagination"
>
@@ -116,19 +116,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
-
-
-
-
+
diff --git a/src/modules/07_insignia/components/2_Manage/downloadFile.vue b/src/modules/07_insignia/components/2_Manage/downloadFile.vue
index 69972577f..e8588494d 100644
--- a/src/modules/07_insignia/components/2_Manage/downloadFile.vue
+++ b/src/modules/07_insignia/components/2_Manage/downloadFile.vue
@@ -3,11 +3,18 @@ import { ref } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useQuasar } from "quasar";
-import { useCounterMixin } from "@/stores/mixin";
-const $q = useQuasar();
+import type { Optionround } from "@/modules/07_insignia/interface/index/Main";
+
+/**import Stores */
+import { useCounterMixin } from "@/stores/mixin";
+/** use Store*/
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader } = mixin;
+
+const $q = useQuasar();
+
+/** props*/
const props = defineProps({
profileId: {
type: String,
@@ -21,12 +28,12 @@ const props = defineProps({
});
const titleReport = ref("");
-interface Optionround {
- profileId: string;
- id: string;
-}
-const downloadDocument = async (type: string) => {
+/**
+ * function ดาวน์โหลดไฟล์
+ * @param type ประเภท file
+ */
+async function downloadDocument(type: string) {
let round = [];
if (props.optionRound) {
round = props.optionRound.find((e: Optionround) => e.id === props.round);
@@ -54,8 +61,9 @@ const downloadDocument = async (type: string) => {
hideLoader();
});
}
-};
-const downloadFile = (response: any, filename: string) => {
+}
+
+function downloadFile(response: any, filename: string) {
const link = document.createElement("a");
var fileName = filename;
link.href = window.URL.createObjectURL(new Blob([response.data]));
@@ -63,7 +71,7 @@ const downloadFile = (response: any, filename: string) => {
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
-};
+}
(false);
@@ -37,14 +40,9 @@ const stat = ref({
});
const modalPopupBackToEdit = ref(false); //model แก้ไข
-onMounted(async () => {
- tab.value = DataStore.mainTab;
- await fecthlistRound();
- DataStore.dataInsigniaType.length === 0 && (await fecthInsignia());
-});
-
-//เรียกรอบการเสนอขอพระราชทานเครื่อง
-const fecthlistRound = async () => {
+/** function เรียกรอบการเสนอขอพระราชทานเครื่อง*/
+async function fecthlistRound() {
+ showLoader();
await http
.get(config.API.listRoundInsignia())
.then(async (res: any) => {
@@ -70,10 +68,13 @@ const fecthlistRound = async () => {
})
.catch((err) => {
messageError($q, err);
+ })
+ .finally(() => {
+ hideLoader();
});
-};
+}
-//เรียกดู Stat ของรอบการเสนอขอพระราชทานเครื่อง
+/** function เรียกดู Stat ของรอบการเสนอขอพระราชทานเครื่อง*/
const fecthStat = async (id: string) => {
showLoader();
await http
@@ -89,8 +90,8 @@ const fecthStat = async (id: string) => {
});
};
-// เช็คหน่วยงาน
-const fecthAgency = async () => {
+/** funcion เช็คหน่วยงาน*/
+async function fecthAgency() {
showLoader();
await http
.get(config.API.insigniaAgency())
@@ -110,9 +111,10 @@ const fecthAgency = async () => {
loading.value = true;
hideLoader();
});
-};
-// เรียกหน่วยงาน
-const fecthType = async () => {
+}
+
+/** funcion เรียกหน่อยวงาน*/
+async function fecthType() {
await http
.get(config.API.typeOc())
.then((res) => {
@@ -125,9 +127,10 @@ const fecthType = async () => {
.catch((err) => {
messageError($q, err);
});
-};
-// เรียกประเภทเครื่องราช
-const fecthInsignia = async () => {
+}
+
+/**function เรียกประเภทเครื่องราช*/
+async function fecthInsignia() {
await http
.get(config.API.insignia)
.then((res) => {
@@ -137,10 +140,10 @@ const fecthInsignia = async () => {
.catch((err) => {
messageError($q, err);
});
-};
+}
-//เลือกรอบการแสดง
-const changround = async () => {
+/** function เลือกรอบการแสดง*/
+async function changround() {
DataStore.roundId = round.value;
fecthStat(round.value); //เรียกดู Stat รอบที่เลือก
var organization = await (DataStore.agency != null //ถ้ามี agency เรียกข้อมูลตาม agency ถ้าไม่มีเรียนตาม Oc ที่เลือก
@@ -154,19 +157,25 @@ const changround = async () => {
roundName.value = `รอบการเสนอขอพระราชทานเครื่องราชฯ ปี ${
roundFilter.year + 543
}`;
-};
+}
const requestNote = ref("");
const requestStatus = ref("");
const requestId = ref("");
const document = ref("");
-//เรียกข้อมูลรายชื่อข้าราชการสามัญฯ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์ ตามรอบการเสนอขอ
-const fecthInsigniaByOc = async (
+/**
+ * function เรียกข้อมูลรายชื่อข้าราชการสามัญฯ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์ ตามรอบการเสนอขอ
+ * @param roundId id รอบการเสนอขอ
+ * @param ocId id หน่วยงาน
+ * @param role ประเภท officer,employee
+ * @param status สถานะ
+ */
+async function fecthInsigniaByOc(
roundId: string,
ocId: string,
role: string,
status: string
-) => {
+) {
if (roundId && ocId && role && status) {
showLoader();
await http
@@ -193,10 +202,10 @@ const fecthInsigniaByOc = async (
hideLoader();
});
}
-};
+}
-// ส่งรอบการเสนอขอต่อ เฉพาะ รอบที่ requestStatus st1 และ st4
-const sendToDirector = async () => {
+/**function ยืนยันการส่งรอบการเสนอขอต่อ เฉพาะ รอบที่ requestStatus st1 และ st4 */
+async function sendToDirector() {
dialogConfirm($q, async () => {
showLoader();
await http
@@ -218,26 +227,32 @@ const sendToDirector = async () => {
await fecthStat(round.value);
});
});
-};
-//แสดง popup แก้ไข
-const popupBackToEdit = async () => {
+}
+
+/** function open popup แก้ไข*/
+async function popupBackToEdit() {
modalPopupBackToEdit.value = true;
-};
-//ปิด popup แก้ไข
-const closeModalPopupBackToEdit = async () => {
+}
+/** function close popup แก้ไข*/
+async function closeModalPopupBackToEdit() {
modalPopupBackToEdit.value = false;
-};
+}
+
const modalbackInsignia2Role = ref(false);
-//แสดง popup ตีกลับ admin
+/**function open popup ตีกลับ admin*/
const popupBackToInsignia2Role = async () => {
modalbackInsignia2Role.value = true;
};
-//ปิด popup ตีกลับ admin
+/**function close popup ตีกลับ admin*/
const closepopupBackToInsignia2Role = async () => {
modalbackInsignia2Role.value = false;
};
-// ตีกลับรอบการเสนอขอ เฉพาะ รอบที่ requestStatus st3 และ insignia2Role
-const backToEdit = async (reason: string) => {
+
+/**
+ * funtion ยืนยันการ ตีกลับรอบการเสนอขอ เฉพาะ รอบที่ requestStatus st3 และ insignia2Role
+ * @param reason หมายเหตุการตีกลับ
+ */
+async function backToEdit(reason: string) {
dialogConfirm(
$q,
async () => {
@@ -269,9 +284,10 @@ const backToEdit = async (reason: string) => {
"ยืนยันการตีกลับ",
"ต้องการยืนยันการตีกลับใช่หรือไม่?"
);
-};
-// อนุมัติรอบการเสนอขอ เฉพาะ รอบที่ requestStatus st3 และ insignia2Role
-const directorApproved = async () => {
+}
+
+/**function ยืนยันการอนุมัติรอบการเสนอขอ เฉพาะ รอบที่ requestStatus st3 และ insignia2Role */
+async function directorApproved() {
dialogConfirm(
$q,
async () => {
@@ -298,9 +314,13 @@ const directorApproved = async () => {
"ยืนยันการอนุมัติ",
"ต้องการยืนยันการอนุมัติใช่หรือไม่?"
);
-};
-// ตีกลับรอบการเสนอขอ เฉพาะ รอบที่ requestStatus st5 และ adminRole
-const backToEditinsignia2Role = async (reason: string) => {
+}
+
+/**
+ * function ยืนยันการตีกลับรอบการเสนอขอ เฉพาะ รอบที่ requestStatus st5 และ adminRole
+ * @param reason หมายเหตุการตีกลับ
+ */
+async function backToEditinsignia2Role(reason: string) {
dialogConfirm($q, async () => {
await http
.put(config.API.rejectRequest(round.value, DataStore.typeOc), {
@@ -322,12 +342,10 @@ const backToEditinsignia2Role = async (reason: string) => {
closepopupBackToInsignia2Role();
});
});
-};
-// ล็อกข้อมูลรอบการเสนอขอ
-const requestSendNote = async () => {
- // var organization = await (DataStore.agency != null
- // ? DataStore.agency
- // : DataStore.typeOc);
+}
+
+/**function ยืนยันการล็อกข้อมูล*/
+async function requestSendNote() {
dialogConfirm($q, async () => {
showLoader();
await http
@@ -351,10 +369,14 @@ const requestSendNote = async () => {
await fecthStat(round.value);
});
});
-};
-// อัปโหลดไฟล์เจ้าหน้าที่
+}
+
const fileUpload = ref(null);
-const uploadFile = async (event: any) => {
+/**
+ * function อัปโหลดไฟล์เจ้าหน้าที่
+ * @param event file
+ */
+async function uploadFile(event: any) {
dialogConfirm($q, async () => {
const selectedFile = event;
const formdata = new FormData();
@@ -377,7 +399,14 @@ const uploadFile = async (event: any) => {
"ยืนยันการอัปโหลดไฟล์",
"ต้องการยืนยันการอัปโหลดไฟล์นี้หรือไม่ ?";
});
-};
+}
+
+/** hook*/
+onMounted(async () => {
+ tab.value = DataStore.mainTab;
+ await fecthlistRound();
+ DataStore.dataInsigniaType.length === 0 && (await fecthInsignia());
+});
@@ -420,6 +449,7 @@ const uploadFile = async (event: any) => {
+
{
+
{
:fecthStat="fecthStat"
/>
+
+
{
:fecthInsigniaByOc="fecthInsigniaByOc"
/>
+
+
{
:fecthInsigniaByOc="fecthInsigniaByOc"
/>
+
+
{
-
{
/>
+
import { ref, watch, computed } from "vue";
import { QForm, useQuasar } from "quasar";
-import { useCounterMixin } from "@/stores/mixin";
-import { useResultDataStore } from "@/modules/07_insignia/storeResult";
import http from "@/plugins/http";
import config from "@/app.config";
+
+/** import Type*/
import type { DataOption } from "@/modules/04_registry/components/profileType";
import DialogHeader from "@/components/DialogHeader.vue";
+/** import Stores */
+import { useCounterMixin } from "@/stores/mixin";
+import { useResultDataStore } from "@/modules/07_insignia/storeResult";
+/** useStore*/
const DataStore = useResultDataStore();
-const $q = useQuasar();
-const myForm = ref();
const mixin = useCounterMixin();
const {
date2Thai,
@@ -21,8 +23,11 @@ const {
hideLoader,
notifyError,
} = mixin;
-const status = ref("");
+const $q = useQuasar();
+const myForm = ref();
+
+const status = ref("");
const Advertise = ref("");
const issue = ref("");
const brand = ref("");
@@ -40,34 +45,31 @@ const affiliationReceived = ref("");
const receivedate = ref();
const announceDate = ref();
const invoiceDate = ref(null);
-const filterinsigniaOp2 = ref(DataStore.insigniaOp2)
+const filterinsigniaOp2 = ref(DataStore.insigniaOp2);
const employeeClass = ref("");
const employeeClassOps = ref([
{ id: "officer", name: "ข้าราชการ กทม.สามัญ" },
{ id: "employee", name: "ลูกจ้างประจำ" },
]);
-
const listPerson = ref([]);
-
const paymentOp = [
{ label: "จัดส่งทางไปรษณีย์", value: "จัดส่งทางไปรษณีย์" },
{ label: "มารับด้วยตัวเอง", value: "มารับด้วยตัวเอง" },
];
-// reset วันที่ประกาศราชกิจจานุเบกษา
-const clearAnnounceExam = () => {
+function clearAnnounceExam() {
announceDate.value = null;
-};
+}
-// reset วันที่ได้รับพระราชทานเครื่องราชอิสริยาภรณ์
-const clearDateReceivedate = () => {
+/** function reset วันที่ได้รับพระราชทานเครื่องราชอิสริยาภรณ์*/
+function clearDateReceivedate() {
receivedate.value = null;
-};
+}
-// reset วันที่จ่ายใบกำกับ
-const clearDateInvoiceDate = () => {
+/** function reset วันที่จ่ายใบกำกับ*/
+function clearDateInvoiceDate() {
invoiceDate.value = null;
-};
+}
const props = defineProps({
modal: Boolean,
@@ -90,7 +92,8 @@ const props = defineProps({
type: String,
},
});
-// เปิด popup เพิ่มราชชื่อบันทึกผล
+
+/** callback function จำทำงานเมื่อ props.modal = true เปิด popup เพิ่มราชชื่อบันทึกผล*/
watch(props, () => {
if (props.modal === true) {
employeeClass.value = "";
@@ -117,13 +120,17 @@ watch(props, () => {
}
}
});
+
+/** disbleStatus */
const disbleStatus = computed(() => {
if (employeeClass.value !== "") {
return false;
} else return true;
});
// เลือกประเภทลูกจ้าง
-const selectType = async () => {
+
+/** function เลือกประเภทลูกจ้าง */
+async function selectType() {
showLoader();
cardid.value = "";
fullName.value = "";
@@ -142,9 +149,10 @@ const selectType = async () => {
invoiceDate.value = null;
payment.value = "";
await fecthlistPerson();
-};
-// เรียกหน่วยงาน
-const fecthlistPerson = async () => {
+}
+
+/** function เรียกหน่วยงาน*/
+async function fecthlistPerson() {
await http
.get(config.API.profileOrganizRoot)
.then((res) => {
@@ -156,9 +164,13 @@ const fecthlistPerson = async () => {
.catch((e) => {
messageError($q, e);
});
-};
-// เรียกราชชื่อลูกจ้างตาม id หน่วยงาน
-const findlist = async (id: string) => {
+}
+
+/**
+ * function เรียกราชชื่อลูกจ้างตาม id หน่วยงาน
+ * @param id id หน่วยงาน
+ */
+async function findlist(id: string) {
let data = [{}];
// ข้าราชการ
if (employeeClass.value === "officer") {
@@ -183,9 +195,13 @@ const findlist = async (id: string) => {
.finally(() => {
hideLoader();
});
-};
-// เรียกข้อมูลบันทึกผลตาม id
-const fectDataByid = async (id: string) => {
+}
+
+/**
+ * function เรียกข้อมูลบันทึกผลตาม id
+ * @param id
+ */
+async function fectDataByid(id: string) {
showLoader();
if (props.profileType !== undefined) {
employeeClass.value = props.profileType.toString();
@@ -219,9 +235,10 @@ const fectDataByid = async (id: string) => {
.finally(() => {
hideLoader();
});
-};
-// บักทึกผล
-const clickSave = async () => {
+}
+
+/** function บักทึกผล*/
+async function clickSave() {
let body = {
citizanId: cardid.value, // เลขบัตร
insigniaId: brand.value, // insigniaID
@@ -247,9 +264,10 @@ const clickSave = async () => {
});
}
});
-};
-// เพิ่มแก้ ข้อมูลบันทึกผล
-const addNote = async (body: any) => {
+}
+
+/** function เพิ่มแก้ ข้อมูลบันทึกผล*/
+async function addNote(body: any) {
if (props.roundId !== undefined) {
await http
.put(config.API.noteAdd(props.roundId), body)
@@ -265,9 +283,10 @@ const addNote = async (body: any) => {
}
});
}
-};
-// หาเลขบัตรประจำตัวประชาชน
-const searchcardid = () => {
+}
+
+/** function หาเลขบัตรประจำตัวประชาชน*/
+function searchcardid() {
if (cardid.value.length === 13) {
let data = listPerson.value.find((e: any) => e.citizenId === cardid.value);
if (data) {
@@ -275,20 +294,25 @@ const searchcardid = () => {
position.value = data.positionEmployeePosition; // ตำแหน่ง
} else notifyError($q, "ไม่พบข้อมูลเลขบัตรประชาชนนี้");
}
-};
+}
+
+/**
+ * function ค้นหาข้อมูล option
+ * @param val คำค้นหา
+ * @param update function
+ * @param name ชื่อ selec
+ */
const filterSelector = (val: any, update: Function, name: any) => {
update(() => {
const needle = val.toLowerCase();
- if (name === 'insigniaOp2') {
- brand.value = ''
+ if (name === "insigniaOp2") {
+ brand.value = "";
filterinsigniaOp2.value = DataStore.insigniaOp2.filter(
- (v: any) => v.name.toLowerCase().indexOf(needle) > -1
- );
+ (v: any) => v.name.toLowerCase().indexOf(needle) > -1
+ );
}
-
- }
- )
-}
+ });
+};
diff --git a/src/modules/07_insignia/components/3_result/Dialogbody.vue b/src/modules/07_insignia/components/3_result/Dialogbody.vue
index 11bd4f011..0c9f37bcb 100644
--- a/src/modules/07_insignia/components/3_result/Dialogbody.vue
+++ b/src/modules/07_insignia/components/3_result/Dialogbody.vue
@@ -1,15 +1,15 @@
@@ -322,7 +348,7 @@ onMounted(() => {
import { ref, onMounted } from "vue";
-import type { QTableProps, QForm } from "quasar";
import { useQuasar } from "quasar";
-import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
+/** import Type*/
+import type { QTableProps, QForm } from "quasar";
+import type { TypeData } from "@/modules/07_insignia/interface/index/Main";
+
+/** import Stores */
+import { useCounterMixin } from "@/stores/mixin";
+/** useStore*/
const mixin = useCounterMixin();
const { success, messageError, hideLoader, dialogConfirm, showLoader } = mixin;
+
+const $q = useQuasar();
+const myForm = ref();
+
const fileUpload = ref(null);
const reason = ref("");
const documentTitle = ref("");
-const $q = useQuasar();
-
-const myForm = ref();
-
const filterKeyword = ref("");
const filterDoc = ref(null);
-const visibleColumnsReference = ref([
- "no",
- "fileName",
- "annotation",
- "file",
-]);
-
-// คอลัมน์ตาราง
+/** คอลัมน์ตาราง*/
const colums2 = ref([
{
name: "no",
@@ -56,27 +54,22 @@ const colums2 = ref([
sortable: false,
},
]);
-
+const visibleColumnsReference = ref([
+ "no",
+ "fileName",
+ "annotation",
+ "file",
+]);
const rows2 = ref([]);
-interface TypeData {
- fileName: string;
- reason: string;
- pathName: string;
-}
-
const props = defineProps({
roundId: {
type: String,
},
});
-onMounted(async () => {
- await getRequest();
-});
-
-// ดึงข้อมูลรายการเอกสารอ้างอิง
-const getRequest = async () => {
+/** function ดึงข้อมูลรายการเอกสารอ้างอิง */
+async function getRequest() {
showLoader();
await http
.get(config.API.requestDocNote(props.roundId as string))
@@ -97,19 +90,19 @@ const getRequest = async () => {
.finally(() => {
hideLoader();
});
-};
+}
-// เช็คฟอร์มก่อนบันทึก
-const save = () => {
+/** function เช็คฟอร์มก่อนบันทึก และยืนยันการบันทึกข้อมูล */
+function save() {
myForm.value.validate().then((result: boolean) => {
if (result) {
dialogConfirm($q, () => putRequest());
}
});
-};
+}
-// บันทึกเอกสาร
-const putRequest = async () => {
+/** function บันทึกเอกสาร */
+async function putRequest() {
showLoader();
const dataAppend = new FormData();
dataAppend.append("Name", documentTitle.value);
@@ -124,21 +117,22 @@ const putRequest = async () => {
messageError($q, e);
})
.finally(() => {
- documentTitle.value = ""
- reason.value = ""
- fileUpload.value = null
+ documentTitle.value = "";
+ reason.value = "";
+ fileUpload.value = null;
// reset เพื่อไม่ให้ฟอร์มแจ้งเตือ validate หลังบันทึกเสร็จแล้วล้างค่าฟิลด์ต่างๆ
- myForm.value.reset()
+ myForm.value.reset();
getRequest();
hideLoader();
});
-};
+}
-const resetFilterRef = () => {
+/** function resetFilter */
+function resetFilterRef() {
filterKeyword.value = "";
filterDoc.value.focus();
-};
+}
const pagination = ref({
sortBy: "filename",
@@ -146,6 +140,11 @@ const pagination = ref({
page: 1,
rowsPerPage: 10,
});
+
+/**hook*/
+onMounted(async () => {
+ await getRequest();
+});
@@ -156,42 +155,104 @@ const pagination = ref({
-
+
-
+
-
+
-
+
@@ -214,8 +275,17 @@ const pagination = ref({
}}
-
+
ดาว์โหลด PDF
diff --git a/src/modules/07_insignia/interface/index/Main.ts b/src/modules/07_insignia/interface/index/Main.ts
index 1353de759..6f8024ef5 100644
--- a/src/modules/07_insignia/interface/index/Main.ts
+++ b/src/modules/07_insignia/interface/index/Main.ts
@@ -9,4 +9,36 @@ interface OptionDataYear {
year: number;
}
-export type { OptionData, OptionDataYear };
+interface OptionReport {
+ id: string;
+ title: string;
+}
+interface Optionround {
+ profileId: string;
+ id: string;
+}
+
+interface TypeData {
+ fileName: string;
+ reason: string;
+ pathName: string;
+}
+
+interface OptionDataInsignia {
+ id: string;
+ name: string;
+ type: string;
+}
+interface InsigniaType {
+ label: string;
+ name: string;
+}
+export type {
+ OptionData,
+ OptionDataYear,
+ OptionReport,
+ Optionround,
+ TypeData,
+ OptionDataInsignia,
+ InsigniaType,
+};
diff --git a/src/modules/07_insignia/store.ts b/src/modules/07_insignia/store.ts
index 57d062b5c..c6a1e4ff3 100644
--- a/src/modules/07_insignia/store.ts
+++ b/src/modules/07_insignia/store.ts
@@ -1,28 +1,29 @@
import { defineStore } from "pinia";
import { ref } from "vue";
-import { useCounterMixin } from "@/stores/mixin";
+/**import Type */
+import type { OptionReport } from "@/modules/07_insignia/interface/index/Main";
+
+/**import Stores */
+import { useCounterMixin } from "@/stores/mixin";
+/**use Stroe */
const mixin = useCounterMixin();
const { date2Thai } = mixin;
export const useInsigniaDataStore = defineStore("insignia", () => {
- interface OptionReport {
- id: string;
- title: string;
- }
const roundId = ref("");
const optionRound = ref([]);
const isLock = ref(false);
const roleUser = ref("");
const requestId = ref("");
const requestStatus = ref("");
- let optionsTypeOc = ref([]);
- let typeOc = ref("");
+ const optionsTypeOc = ref([]);
+ const typeOc = ref("");
const agency = ref("");
- let rows = ref([]);
+ const rows = ref([]);
const listinsignia = ref([]);
const typeinsignia = ref("all");
- let typeinsigniaOptions = ref([{ id: "all", name: "ทั้งหมด" }]);
+ const typeinsigniaOptions = ref([{ id: "all", name: "ทั้งหมด" }]);
const employeeClass = ref("all");
const employeeClassOps = ref([
{ name: "ทั้งหมด", id: "all" },
@@ -30,7 +31,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
{ name: "ลูกจ้างประจำ", id: "perm" },
]);
- //รางาน
+ /** option รายงาน */
const optionReport = ref([
{
id: "45",
@@ -41,8 +42,12 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
]);
const mainTab = ref("pending");
const dataInsigniaType = ref([]);
- // เรียกราชชื่อการเสนอขอ
- const fetchData = async (data: any) => {
+
+ /**
+ * Funtioin เรียกข้อมูลรายชื่อข้าราชการสามัญ
+ * @param data ข้อมูลรายชื่อข้าราชการสามัญ
+ */
+ async function fetchData(data: any) {
if (data !== null) {
let datalist = await data.map((e: any) => ({
id: e.id,
@@ -102,15 +107,23 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
searchDataTable(typeinsignia.value, employeeClass.value);
filtertypeInsignia();
} else rows.value = [];
- };
- // เรียกข้อมูลรอบการเสนอขอ
- const fetchDataInsignia = async (data: any) => {
+ }
+
+ /**
+ * function เรียกข้อมูลรอบการเสนอขอ
+ * @param data ข้อมูลราบการเสนอขอ
+ */
+ async function fetchDataInsignia(data: any) {
isLock.value = data.isLock; // สถานะล็อกข้อมูล
requestId.value = data.requestId;
requestStatus.value = data.requestStatus; // สถานะของรอบการเสนอขอ
- };
- // เรียก Option หน่วยงานทั้งหมด
- const fetchOption = (op: any) => {
+ }
+
+ /**
+ * funntoin หา option หน่วยงสานทั้งหมด
+ * @param op
+ */
+ function fetchOption(op: any) {
const aId = agency.value ?? "00000000-0000-0000-0000-000000000000";
if (aId !== "00000000-0000-0000-0000-000000000000") {
@@ -119,11 +132,13 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
} else {
(optionsTypeOc.value = op), (typeOc.value = op[0].id);
}
- };
- // หาประเภทเครื่องราชทั้งหมดที่อยู่ในรายชื่อข้าราชการสามัญฯ
- const filtertypeInsignia = async () => {
- typeinsignia.value = "all";
+ }
+ /**
+ * funcion หาประเภทเครื่องราชทั้งหมดที่อยู่ในรายชื่อข้าราชการสามัญฯ
+ */
+ async function filtertypeInsignia() {
+ typeinsignia.value = "all";
if (listinsignia.value.length !== 0) {
// หาประเภทเครื่องราชที่ขอที่ชื่อซ้ำกัน
const double_name = [
@@ -142,9 +157,14 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
typeinsigniaOptions.value.push(listtype);
}
} else typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }];
- };
- // ค้นหาข้อมมูลราชชื่อ ตาม ประเท๓และสถานภาพ
- const searchDataTable = async (type: string, employeeClasstype: string) => {
+ }
+
+ /**
+ * function ค้นหาข้อมมูลราชชื่อ ตาม ประเภทและสถานภาพ
+ * @param type ประเภท
+ * @param employeeClasstype สถานภาพ
+ */
+ async function searchDataTable(type: string, employeeClasstype: string) {
typeinsignia.value = type;
employeeClass.value = employeeClasstype;
if (type !== "all" && employeeClasstype !== "all") {
@@ -164,14 +184,21 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
} else if (type === "all" && employeeClasstype === "all") {
rows.value = listinsignia.value;
}
- };
- // ประเภทเครื่องราช
+ }
+
+ /**
+ * function เรียกประเภทเครื่องราช
+ * @param data ประเภทเครื่องราชทั้งหมด
+ */
function fetchInsigniaType(data: any) {
dataInsigniaType.value = data;
}
- // ประเภทลูกจ้าง
- const profileType = (val: string) => {
+ /**
+ * Function convert ประเภทลูกจ้าง
+ * @param val ประเภทลูกจ้าง
+ */
+ function profileType(val: string) {
switch (val) {
case "officer":
return "ข้าราชการ กทม.สามัญ";
@@ -182,8 +209,12 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
case "temp":
return "ลูกจ้างประจำ";
}
- };
- //แปลงสถานะ
+ }
+
+ /**
+ * function convert สถานะ
+ * @param val สถานะ
+ */
function convertStatus(val: string) {
switch (val) {
case "WAITTING":
diff --git a/src/modules/07_insignia/storeAllocate.ts b/src/modules/07_insignia/storeAllocate.ts
index 0eef5cccc..a217bd841 100644
--- a/src/modules/07_insignia/storeAllocate.ts
+++ b/src/modules/07_insignia/storeAllocate.ts
@@ -1,63 +1,87 @@
import { defineStore } from "pinia";
-import { ref, } from "vue";
-import { useCounterMixin } from "@/stores/mixin";
-
-const mixin = useCounterMixin();
-const {
- date2Thai,
-} = mixin;
+import { ref } from "vue";
export const useAllocateDataStore = defineStore("insigniaallocate", () => {
- const roundId = ref('')
- const roundYear = ref()
- const insigniaName = ref('')
- const insignia = ref('')
- const insigniaOp = ref([{ name: "ทั้งหมด", id: "", type: "" }])
- const insigniaType = ref()
- const rows = ref([])
- const listInsignia = ref([])
- const mainTab = ref("")
- const type = ref([])
- const fetchDatainsignia = async (data: any) => {
- // insignia.value = ''
- insigniaOp.value = [{ name: "ทั้งหมด", id: "", type: "" }]
+ const roundId = ref("");
+ const roundYear = ref();
+ const insigniaName = ref("");
+ const insignia = ref("");
+ const insigniaOp = ref([{ name: "ทั้งหมด", id: "", type: "" }]);
+ const insigniaType = ref();
+ const rows = ref([]);
+ const listInsignia = ref([]);
+ const mainTab = ref("");
+ const type = ref([]);
+
+ /**
+ * function เรียกข้อมูลเครื่องราช
+ * @param data ข้อมูลเครื่องราช
+ */
+ async function fetchDatainsignia(data: any) {
+ insigniaOp.value = [{ name: "ทั้งหมด", id: "", type: "" }];
data.forEach((e: any) => {
- insigniaOp.value.push({ name: `${e.name} (${e.shortName})`, id: e.id, type: e.insigniaType.id })
+ insigniaOp.value.push({
+ name: `${e.name} (${e.shortName})`,
+ id: e.id,
+ type: e.insigniaType.id,
+ });
});
data.forEach((e: any) => {
type.value.push({
- name:e.name,
- shortName:e.shortName,
- })})
+ name: e.name,
+ shortName: e.shortName,
+ });
+ });
}
- const fetchDatainsigniaType = async (data: any,) => {
- insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name }))
- // mainTab.value = insigniaType.value[0].name
+ /**
+ * function เรียกประเเภทเครื่องราช
+ * @param data ข้อมูลเครื่องราช
+ */
+ async function fetchDatainsigniaType(data: any) {
+ insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name }));
}
- const listinsignia = async (data: any) => {
+
+ /**
+ * function เรียกรายการจัดสรรเครื่องราชอิสริยาภรณ์
+ * @param data ข้อมูลรายการจัดสรรเครื่องราชอิสริยาภรณ์
+ */
+ async function listinsignia(data: any) {
rows.value = [];
let list = await data.map((e: any) => ({
id: e.id,
- insignia: `${e.insignia} (${type.value.find(item => item.name === e.insignia)?.shortName || ''})`,
+ insignia: `${e.insignia} (${
+ type.value.find((item) => item.name === e.insignia)?.shortName || ""
+ })`,
insigniaId: e.insigniaId,
total: e.total,
allocate: e.allocate,
remain: e.remain,
year: e.year,
- }))
- rows.value = list
- listInsignia.value = list
- selectInsignia(insignia.value)
+ }));
+ rows.value = list;
+ listInsignia.value = list;
+ selectInsignia(insignia.value);
}
- const selectInsignia = (type: string) => {
- insignia.value = type
- if (insignia.value !== "") {
- rows.value = listInsignia.value.filter((e: any) => e.insigniaId === insignia.value)
- } else rows.value = listInsignia.value
+ /**
+ * function ค้นหาข้อมูลตามประเภทเครื่องราช
+ * @param type ประเภทเครื่องราช
+ */
+ function selectInsignia(type: string) {
+ insignia.value = type;
+ if (insignia.value !== "") {
+ rows.value = listInsignia.value.filter(
+ (e: any) => e.insigniaId === insignia.value
+ );
+ } else rows.value = listInsignia.value;
}
- const profileType = (val: string) => {
+
+ /**
+ * function convert สถานภาพ
+ * @param val สถานภาพ
+ */
+ function profileType(val: string) {
switch (val) {
case "officer":
return "ข้าราชการ กทม.สามัญ";
@@ -78,6 +102,6 @@ export const useAllocateDataStore = defineStore("insigniaallocate", () => {
selectInsignia,
profileType,
insigniaName,
- mainTab
+ mainTab,
};
});
diff --git a/src/modules/07_insignia/storeBrrow.ts b/src/modules/07_insignia/storeBrrow.ts
index 6ad37ba90..4a330aa3b 100644
--- a/src/modules/07_insignia/storeBrrow.ts
+++ b/src/modules/07_insignia/storeBrrow.ts
@@ -1,38 +1,70 @@
import { defineStore } from "pinia";
-import { ref, } from "vue";
-import { useCounterMixin } from "@/stores/mixin";
+import { ref } from "vue";
+/** import Type*/
+import type {
+ OptionData,
+ OptionDataInsignia,
+ InsigniaType,
+} from "@/modules/07_insignia/interface/index/Main";
+
+/** import Stores */
+import { useCounterMixin } from "@/stores/mixin";
+/** useStore*/
const mixin = useCounterMixin();
-const {
- date2Thai,
-} = mixin;
+const { date2Thai } = mixin;
export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
- const insignia = ref('')
- const insigniaOp = ref([{ name: "ทั้งหมด", id: "", type: "" }])
- const insigniaType = ref()
- const rows = ref([])
- const listInsignia = ref([])
+ const insignia = ref("");
+ const insigniaOp = ref([
+ { name: "ทั้งหมด", id: "", type: "" },
+ ]);
+ const insigniaType = ref();
+ const rows = ref([]);
+ const listInsignia = ref([]);
const employeeClass = ref("all");
- const employeeClassOps = ref([{ name: "ทั้งหมด", id: "all" }, { name: "ข้าราชการ กทม.สามัญ", id: "officer" }, { name: "ลูกจ้างประจำ", id: "perm" }])
- const type = ref([])
- const fetchDataInsignia = async (data: any) => {
- insignia.value = ''
- insigniaOp.value = [{ name: "ทั้งหมด", id: "", type: "" }]
+ const employeeClassOps = ref([
+ { name: "ทั้งหมด", id: "all" },
+ { name: "ข้าราชการ กทม.สามัญ", id: "officer" },
+ { name: "ลูกจ้างประจำ", id: "perm" },
+ ]);
+ const type = ref([]);
+
+ /**
+ * function เรียกข้อมุลราชชื่อเครื่อง
+ * @param data ข้อมูลเครื่องราช
+ */
+ async function fetchDataInsignia(data: any) {
+ insignia.value = "";
+ insigniaOp.value = [{ name: "ทั้งหมด", id: "", type: "" }];
data.forEach((e: any) => {
- insigniaOp.value.push({ name: `${e.name} (${e.shortName})`, id: e.id, type: e.insigniaType.id })
+ insigniaOp.value.push({
+ name: `${e.name} (${e.shortName})`,
+ id: e.id,
+ type: e.insigniaType.id,
+ });
});
data.forEach((e: any) => {
type.value.push({
- name:e.name,
- shortName:e.shortName,
- })})
- }
- const fetchDatainsigniaType = async (data: any) => {
- insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name }))
+ name: e.name,
+ shortName: e.shortName,
+ });
+ });
}
- const fetchlistinsignia = async (data: any) => {
+ /**
+ * function เรียกข้อมูลขั้นเครื่องราช
+ * @param data ข้อมูลขั้นเครื่องราช
+ */
+ async function fetchDatainsigniaType(data: any) {
+ insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name }));
+ }
+
+ /**
+ * function เรียกข้อมูล ยืม-คืนเครื่องราชฯ
+ * @param data ข้อมูล ยืม-คืนเครื่องราชฯ
+ */
+ async function fetchlistinsignia(data: any) {
rows.value = [];
let list = await data.map((e: any) => ({
id: e.id,
@@ -41,7 +73,10 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
position: e.position,
status: status(e.status),
name: e.fullName,
- type: `${e.requestInsignia} (${type.value.find(item => item.name === e.requestInsignia)?.shortName || ''})`,
+ type: `${e.requestInsignia} (${
+ type.value.find((item) => item.name === e.requestInsignia)?.shortName ||
+ ""
+ })`,
requestInsigniaId: e.requestInsigniaId,
employeeType: profileType(e.profileType),
profileType: e.profileType,
@@ -56,31 +91,44 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
typepay: e.typePayment,
address: e.address,
borrowOrganization: e.borrowOrganization,
- borrowDate: e.borrowDate !== null ? date2Thai(e.borrowDate) : '-',
+ borrowDate: e.borrowDate !== null ? date2Thai(e.borrowDate) : "-",
returnOrganization: e.returnOrganization,
- returnDate: e.returnDate !== null ? date2Thai(e.returnDate) : '-',
- returnReason: e.returnReason !== null ? e.returnReason : '-',
+ returnDate: e.returnDate !== null ? date2Thai(e.returnDate) : "-",
+ returnReason: e.returnReason !== null ? e.returnReason : "-",
}));
- rows.value = list
- listInsignia.value = list
- searchDatatable(insignia.value, employeeClass.value)
+ rows.value = list;
+ listInsignia.value = list;
+ searchDatatable(insignia.value, employeeClass.value);
}
- const searchDatatable = (type: string, employeeClass: string) => {
- if (type !== '' && employeeClass !== "all") {
- rows.value = listInsignia.value.filter((e: any) => e.requestInsigniaId == type && e.profileType == employeeClass
- )
- } else if (type !== '' && employeeClass == "all") {
- rows.value = listInsignia.value.filter((e: any) => e.requestInsigniaId == type
- )
- } else if (type == '' && employeeClass !== "all") {
- rows.value = listInsignia.value.filter((e: any) => e.profileType == employeeClass
- )
- } else if (type === '' && employeeClass === "all") {
- rows.value = listInsignia.value
+
+ /**
+ * function ค้นหาข้อมูล Table
+ * @param type ประเภทเครื่องราช
+ * @param employeeClass สถานภาพ
+ */
+ function searchDatatable(type: string, employeeClass: string) {
+ if (type !== "" && employeeClass !== "all") {
+ rows.value = listInsignia.value.filter(
+ (e: any) =>
+ e.requestInsigniaId == type && e.profileType == employeeClass
+ );
+ } else if (type !== "" && employeeClass == "all") {
+ rows.value = listInsignia.value.filter(
+ (e: any) => e.requestInsigniaId == type
+ );
+ } else if (type == "" && employeeClass !== "all") {
+ rows.value = listInsignia.value.filter(
+ (e: any) => e.profileType == employeeClass
+ );
+ } else if (type === "" && employeeClass === "all") {
+ rows.value = listInsignia.value;
}
-
}
+ /**
+ * function convert สถานะ
+ * @param val สถานะ
+ */
const status = (val: string) => {
switch (val) {
case "PENDING":
@@ -92,8 +140,13 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
case "DONE":
return "บันทึกลง ก.พ. 7 แล้ว";
}
- }
- const profileType = (val: string) => {
+ };
+
+ /**
+ * function convert สถานภาพ
+ * @param val สถานภาพ
+ */
+ function profileType(val: string) {
switch (val) {
case "officer":
return "ข้าราชการ กทม.สามัญ";
@@ -114,6 +167,6 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
profileType,
fetchlistinsignia,
searchDatatable,
- type
+ type,
};
});
diff --git a/src/modules/07_insignia/storeResult.ts b/src/modules/07_insignia/storeResult.ts
index 7cfcca968..c798aab84 100644
--- a/src/modules/07_insignia/storeResult.ts
+++ b/src/modules/07_insignia/storeResult.ts
@@ -1,48 +1,75 @@
import { defineStore } from "pinia";
-import { ref, } from "vue";
+import { ref } from "vue";
+
+/** import Type*/
+import type { OptionData } from "@/modules/07_insignia/interface/index/Main";
+
+/** import Stores */
import { useCounterMixin } from "@/stores/mixin";
-
const mixin = useCounterMixin();
-const {
- date2Thai,
-
-} = mixin;
+const { date2Thai } = mixin;
export const useResultDataStore = defineStore("insigniaResult", () => {
- const insignia = ref('')
- const insigniaOp = ref([{ name: "ทั้งหมด", id: "" }])
- const insigniaOp2 = ref([])
- const insigniaType = ref()
- const invoiceType = ref('all')
- const invoiceTypeop = ref([{ name: "ทั้งหมด", id: "all" }, { name: "ใบกำกับที่ค้างจ่าย", id: "noDate" }, { name: "ใบกำกับที่จ่ายแล้ว", id: "haveDate" }])
+ const insignia = ref("");
+ const insigniaOp = ref([{ name: "ทั้งหมด", id: "" }]);
+ const insigniaOp2 = ref([]);
+ const insigniaType = ref();
+ const invoiceType = ref("all");
+ const invoiceTypeop = ref([
+ { name: "ทั้งหมด", id: "all" },
+ { name: "ใบกำกับที่ค้างจ่าย", id: "noDate" },
+ { name: "ใบกำกับที่จ่ายแล้ว", id: "haveDate" },
+ ]);
const employeeClass = ref("all");
- const employeeClassOps = ref([{ name: "ทั้งหมด", id: "all" }, { name: "ข้าราชการ กทม.สามัญ", id: "officer" }, { name: "ลูกจ้างประจำ", id: "employee" }])
- const rows = ref([])
- const listInsignia = ref([])
- const type = ref([])
+ const employeeClassOps = ref([
+ { name: "ทั้งหมด", id: "all" },
+ { name: "ข้าราชการ กทม.สามัญ", id: "officer" },
+ { name: "ลูกจ้างประจำ", id: "employee" },
+ ]);
+ const rows = ref([]);
+ const listInsignia = ref([]);
+ const type = ref([]);
- const fetchDatainsignia = async (data: any) => {
- insignia.value = ''
- invoiceType.value = 'all'
- insigniaOp.value = [{ name: "ทั้งหมด", id: "" }]
- insigniaOp2.value = []
+ /**
+ * function เรียกประเภทเครื่องราช
+ * @param data ประเภทเครื่องราช
+ */
+ async function fetchDatainsignia(data: any) {
+ insignia.value = "";
+ invoiceType.value = "all";
+ insigniaOp.value = [{ name: "ทั้งหมด", id: "" }];
+ insigniaOp2.value = [];
data.forEach((e: any) => {
- insigniaOp.value.push({ name: `${e.name} (${e.shortName})`, id: e.id, insigniaType: e.insigniaType.id })
+ insigniaOp.value.push({
+ name: `${e.name} (${e.shortName})`,
+ id: e.id,
+ insigniaType: e.insigniaType.id,
+ });
});
data.forEach((e: any) => {
- insigniaOp2.value.push({ name: `${e.name} (${e.shortName})`, id: e.id })
+ insigniaOp2.value.push({ name: `${e.name} (${e.shortName})`, id: e.id });
});
data.forEach((e: any) => {
type.value.push({
- name:e.name,
- shortName:e.shortName,
- })
- })
-}
- const fetchDatainsigniaType = async (data: any) => {
- insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name }))
+ name: e.name,
+ shortName: e.shortName,
+ });
+ });
}
- const fetchlistinsignia = async (data: any) => {
+
+ /**
+ * function เรียกประเภทเครื่องราช
+ * @param data ประเภทเครื่องราช
+ */
+ async function fetchDatainsigniaType(data: any) {
+ insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name }));
+ }
+
+ /**
+ * function บันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์/การจ่ายใบกำกับ
+ * @param data รายชื่อข้าราชการสามัญฯ
+ */
+ async function fetchlistinsignia(data: any) {
rows.value = [];
let alllist = await data.map((e: any) => ({
id: e.id,
@@ -52,7 +79,10 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
status: status(e.status),
dateReceive: date2Thai(e.dateReceive),
name: e.prefix + e.fullName,
- type: `${e.requestInsignia} (${type.value.find(item => item.name === e.requestInsignia)?.shortName || ''})`,
+ type: `${e.requestInsignia} (${
+ type.value.find((item) => item.name === e.requestInsignia)?.shortName ||
+ ""
+ })`,
employeeType: profileType(e.profileType),
profileType: e.profileType,
date: date2Thai(e.date),
@@ -64,33 +94,51 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
datepay: date2Thai(e.datePayment),
typepay: e.typePayment,
address: e.address,
- dateReceiveInsignia:e.dateReceiveInsignia,
- dateReturnInsignia:e.dateReturnInsignia,
- docReceiveInsignia:e.docReceiveInsignia,
- docReturnInsignia:e.docReturnInsignia,
- orgReceiveInsignia:e.orgReceiveInsignia,
- orgReturnInsignia:e.orgReturnInsignia,
+ dateReceiveInsignia: e.dateReceiveInsignia,
+ dateReturnInsignia: e.dateReturnInsignia,
+ docReceiveInsignia: e.docReceiveInsignia,
+ docReturnInsignia: e.docReturnInsignia,
+ orgReceiveInsignia: e.orgReceiveInsignia,
+ orgReturnInsignia: e.orgReturnInsignia,
}));
- rows.value = alllist
- listInsignia.value = alllist
+ rows.value = alllist;
+ listInsignia.value = alllist;
searchData(invoiceType.value, employeeClass.value);
-
}
- const searchData = (invoice: string, employeeClass: string) => {
- if (invoice !== 'all' && employeeClass !== 'all') {
- let list = listInsignia.value.filter((e: any) => convertDatepay(e.datepay) === invoice && e.employeeType === profileType(employeeClass))
- rows.value = list
- } else if (invoice !== 'all' && employeeClass === 'all') {
- let list = listInsignia.value.filter((e: any) => convertDatepay(e.datepay) === invoice)
- rows.value = list
- } else if (invoice === 'all' && employeeClass !== 'all') {
- let list = listInsignia.value.filter((e: any) => e.employeeType === profileType(employeeClass))
- rows.value = list
- } else if (invoice === 'all' && employeeClass == 'all') {
- rows.value = listInsignia.value
+
+ /**
+ * function ค้นหาข้อมูลในตาราง
+ * @param invoice ใบกำกับ
+ * @param employeeClass สถารภาพ
+ */
+ function searchData(invoice: string, employeeClass: string) {
+ if (invoice !== "all" && employeeClass !== "all") {
+ let list = listInsignia.value.filter(
+ (e: any) =>
+ convertDatepay(e.datepay) === invoice &&
+ e.employeeType === profileType(employeeClass)
+ );
+ rows.value = list;
+ } else if (invoice !== "all" && employeeClass === "all") {
+ let list = listInsignia.value.filter(
+ (e: any) => convertDatepay(e.datepay) === invoice
+ );
+ rows.value = list;
+ } else if (invoice === "all" && employeeClass !== "all") {
+ let list = listInsignia.value.filter(
+ (e: any) => e.employeeType === profileType(employeeClass)
+ );
+ rows.value = list;
+ } else if (invoice === "all" && employeeClass == "all") {
+ rows.value = listInsignia.value;
}
}
- const status = (val: string) => {
+
+ /**
+ * function convert สถานะ
+ * @param val สถานะ
+ */
+ function status(val: string) {
switch (val) {
case "PENDING":
return "รอบันทึกข้อมูล";
@@ -102,6 +150,11 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
return "บันทึกลง ก.พ. 7 แล้ว";
}
}
+
+ /**
+ * function convert สถานภาพ
+ * @param val สถานภาพ
+ */
const profileType = (val: string) => {
switch (val) {
case "officer":
@@ -109,7 +162,12 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
case "employee":
return "ลูกจ้างประจำ";
}
- }
+ };
+
+ /**
+ * function convert สถานะ การจ่าย
+ * @param val สถานะ การจ่าย
+ */
const convertDatepay = (val: any) => {
switch (val) {
case null:
@@ -117,7 +175,7 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
default:
return "haveDate";
}
- }
+ };
return {
rows,
insignia,
diff --git a/src/modules/07_insignia/views/ResultPage.vue b/src/modules/07_insignia/views/ResultPage.vue
index 7b01537de..44da53cfc 100644
--- a/src/modules/07_insignia/views/ResultPage.vue
+++ b/src/modules/07_insignia/views/ResultPage.vue
@@ -1,18 +1,22 @@
@@ -555,7 +590,7 @@ const clearInsigniaFilters = (name: string) => {
v-model="fileResult"
label="บันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์"
accept=".xlsx"
- class=" full-width"
+ class="full-width"
>
@@ -587,10 +622,10 @@ const clearInsigniaFilters = (name: string) => {
v-model="fileinvoice"
label="บันทึกผลการจ่ายใบกำกับ"
accept=".xlsx"
- class=" full-width"
+ class="full-width"
>
-
+
อัพโหลดไฟล์บันทึกผลการจ่ายใบกำกับ
@@ -610,7 +645,7 @@ const clearInsigniaFilters = (name: string) => {
-
{
name="cancel"
@click.stop.prevent="
clearInsigniaFilters('insigniaTypeFilter'),
- selectorInsignia()"
+ selectorInsignia()
+ "
class="cursor-pointer"
/>
@@ -647,7 +683,7 @@ const clearInsigniaFilters = (name: string) => {
-
+
@@ -688,7 +724,6 @@ const clearInsigniaFilters = (name: string) => {
class="gt-xs q-ml-sm"
/>
-
{
doneFn:Function) => filterSelector(inputValue, doneFn,'filterEmployee'
) "
>
-
+
{
/>
-
-
- ไม่มีข้อมูล
-
-
-
+
+
+ ไม่มีข้อมูล
+
+
+
{
}
};
-onMounted(() => {
- fetchListRoind();
-});
-
/** Function get ข้อมูลรายการรอบการปฏิบัติงาน */
async function fetchListRoind() {
showLoader();
@@ -100,6 +96,11 @@ const pagination = ref({
page: 1,
rowsPerPage: 10,
});
+
+/** Hook*/
+onMounted(() => {
+ fetchListRoind();
+});
@@ -229,9 +230,6 @@ const pagination = ref({