diff --git a/src/api/07_insignia/api.insignia.ts b/src/api/07_insignia/api.insignia.ts index 7569f1683..551ade307 100644 --- a/src/api/07_insignia/api.insignia.ts +++ b/src/api/07_insignia/api.insignia.ts @@ -22,8 +22,10 @@ export default { insigniaPeriodId: any, ocId: string, role: string, - status: any - ) => `${insignia}/request/${insigniaPeriodId}/${ocId}/${role}/${status}`, + status: any, + isDeputy: boolean = false + ) => + `${insignia}/request/${insigniaPeriodId}/${ocId}/${role}/${status}/${isDeputy}`, insigniaReject: (profileId: string) => `${insignia}/request/status/reject/${profileId}`, insigniaDelete: (profileId: string) => diff --git a/src/interface/main.ts b/src/interface/main.ts index f252ca4e8..b6126d2ec 100644 --- a/src/interface/main.ts +++ b/src/interface/main.ts @@ -54,6 +54,7 @@ interface DataStructureTree { children: DataStructureTree[]; orgRootCode: string; orgRootShortName: string; + isDeputy?: boolean; } interface DataStrategy { diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue index ac0565fcf..5b11bf542 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue @@ -283,6 +283,8 @@ async function getData() { if (res.data.result.birthDate) { // กำหนดอายุ ส่งวันเกิดไปคำนวน age.value = calculateAge(res.data.result.birthDate); + } else { + age.value = null; } }) .catch((e) => { diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue index e27628e6b..48cde1fab 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue @@ -78,9 +78,11 @@ const baseColumns = ref([ sortable: true, field: "startDate", format(val, row) { - return row.isDate - ? date2Thai(row.startDate) - : (new Date(row.startDate).getFullYear() + 543).toString(); + return row.startDate + ? row.isDate + ? date2Thai(row.startDate) + : (new Date(row.startDate).getFullYear() + 543).toString() + : "-"; }, headerStyle: "font-size: 14px", style: "font-size: 14px", @@ -94,9 +96,11 @@ const baseColumns = ref([ sortable: true, field: "endDate", format(val, row) { - return row.isDate - ? date2Thai(row.endDate) - : (new Date(row.endDate).getFullYear() + 543).toString(); + return row.endDate + ? row.isDate + ? date2Thai(row.endDate) + : (new Date(row.endDate).getFullYear() + 543).toString() + : "-"; }, headerStyle: "font-size: 14px", style: "font-size: 14px", diff --git a/src/modules/07_insignia/components/2_Manage/Tab1.vue b/src/modules/07_insignia/components/2_Manage/Tab1.vue index 22f7416db..c022c0c1c 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab1.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab1.vue @@ -1,6 +1,6 @@ diff --git a/src/modules/07_insignia/components/2_Manage/Tab3.vue b/src/modules/07_insignia/components/2_Manage/Tab3.vue index e4058e3a3..2654f15b1 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab3.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab3.vue @@ -37,7 +37,7 @@ const typeinsigniaOptions = ref(DataStore.typeinsigniaOptions); // const employeeClassOps = ref(DataStore.employeeClassOps); //ประเภทข้ารายกาช const filterOrganizationOP = ref([]); // //หน่วยงาน const organization = ref("1"); -const organizationOptions = ref([{ id: "1", name: "ทั้งหมด" }]); +const isDeputy = ref(false); //เลือกสำนักปลัดหรือไม่ /** หัวตาราง*/ const columns = ref([ @@ -158,11 +158,16 @@ const visibleColumns = ref([ /** function เลือกหน่วยงาน */ async function changtypeOc() { if (props.fecthInsigniaByOc) { - await props.fecthInsigniaByOc( + isDeputy.value = await (DataStore.optionsTypeOc.findIndex( + (v: OptionData) => v.id === organization.value && v.isDeputy === true + ) > -1); + + props.fecthInsigniaByOc( props.roundId, organization.value, "officer", - props.tab + props.tab, + isDeputy.value ); } DataStore.typeOc = organization.value; @@ -266,22 +271,29 @@ function onSearch() { watch( () => DataStore.typeOc, async () => { - filterOrganizationOP.value = await DataStore.optionsTypeOc; - organization.value = await DataStore.typeOc; + filterOrganizationOP.value = DataStore.optionsTypeOc; + organization.value = DataStore.typeOc; + DataStore.selectOrganization = DataStore.typeOc; } ); /** Hook*/ onMounted(async () => { - filterOrganizationOP.value = await DataStore.optionsTypeOc; - organization.value = await DataStore.typeOc; + filterOrganizationOP.value = DataStore.optionsTypeOc; + organization.value = DataStore.typeOc; + DataStore.selectOrganization = DataStore.typeOc; if (organization.value !== "" || organization.value !== undefined) { if (props.fecthInsigniaByOc) { - await props.fecthInsigniaByOc( + isDeputy.value = await (DataStore.optionsTypeOc.findIndex( + (v: OptionData) => v.id === organization.value && v.isDeputy === true + ) > -1); + + props.fecthInsigniaByOc( props.roundId, organization.value, "officer", - props.tab + props.tab, + isDeputy.value ); DataStore.mainTab = props.tab; } diff --git a/src/modules/07_insignia/interface/index/Main.ts b/src/modules/07_insignia/interface/index/Main.ts index 98b5d0fc2..4f00083c7 100644 --- a/src/modules/07_insignia/interface/index/Main.ts +++ b/src/modules/07_insignia/interface/index/Main.ts @@ -1,10 +1,11 @@ interface OptionData { id: string | number; name: string; + isDeputy?: boolean; } interface OptionDataList { - id:string + id: string; val: string | number; name: string; } @@ -233,5 +234,5 @@ export type { Pagination, DataManageList, ResOrg, - OptionDataList + OptionDataList, }; diff --git a/src/modules/07_insignia/store.ts b/src/modules/07_insignia/store.ts index d6a99c582..c1b8892f5 100644 --- a/src/modules/07_insignia/store.ts +++ b/src/modules/07_insignia/store.ts @@ -47,6 +47,8 @@ export const useInsigniaDataStore = defineStore("insignia", () => { const isOfficer = ref(false); const isStaff = ref(false); const isDirector = ref(false); + const isDeputy = ref(false); + const selectOrganization = ref(""); /** option รายงาน */ const optionReport = ref([ @@ -285,5 +287,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => { isStaff, isOfficer, isDirector, + isDeputy, + selectOrganization, }; }); diff --git a/src/modules/07_insignia/views/01_RoundMain.vue b/src/modules/07_insignia/views/01_RoundMain.vue index 13d5bfd3e..4a163283d 100644 --- a/src/modules/07_insignia/views/01_RoundMain.vue +++ b/src/modules/07_insignia/views/01_RoundMain.vue @@ -32,7 +32,6 @@ const { const rows = ref([]); //รายการรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์ const rowsData = ref([]); //รายการรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์ const filterKeyword = ref(""); //คำค้นหาข้อมูลในตาราง -const filterRef = ref(null); const columns = ref([ { name: "period_name", @@ -103,9 +102,7 @@ const modalForm = ref(false); //แสดงรายละเอีย const actionType = ref(""); // ประเภท ดูรายละเอียด,แก้ไข const roundId = ref(""); //id ที่ต้องการ ดูรายละเอียด,แก้ไข -/** - * Function เรียกรายการรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์ - */ +/** Function เรียกรายการรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์*/ async function fetchData() { showLoader(); await http @@ -149,7 +146,7 @@ function clickDelete(id: string) { .delete(config.API.RoundInsignia(id)) .then(async () => { await fetchData(); - await success($q, "ลบข้อมูลสำเร็จ"); + success($q, "ลบข้อมูลสำเร็จ"); }) .catch((e) => { messageError($q, e); @@ -160,16 +157,6 @@ function clickDelete(id: string) { }); } -/** - * Function กำหนดค่า filterKeyword เป็นค่าว่าง - */ -function resetFilter() { - filterKeyword.value = ""; - if (filterRef.value) { - filterRef.value.focus(); - } -} - /** * function ดูข้อมูลรายละเอียดรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์ * @param action ประเภท ดูรายละเอียด,แก้ไข @@ -189,9 +176,7 @@ function onSearch() { ); } -/** - * ทำงานเมื่อ Componenets ถูกเรียกใช้งาน - */ +/** ทำงานเมื่อ Componenets ถูกเรียกใช้งาน*/ onMounted(async () => { await fetchData(); }); @@ -201,6 +186,7 @@ onMounted(async () => {
รายการรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
+
@@ -222,7 +208,6 @@ onMounted(async () => { standout dense v-model="filterKeyword" - ref="filterRef" outlined placeholder="ค้นหา" @keydown.enter="onSearch" diff --git a/src/modules/07_insignia/views/02_ManageMain.vue b/src/modules/07_insignia/views/02_ManageMain.vue index 809880059..0de4d28d8 100644 --- a/src/modules/07_insignia/views/02_ManageMain.vue +++ b/src/modules/07_insignia/views/02_ManageMain.vue @@ -40,7 +40,7 @@ const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin; * ตัวแปร */ const loadview = ref(false); //แสดง View -const hideBottom = ref(false); +// const hideBottom = ref(false); const round = ref(""); //รอยการเสนอขอ const roundName = ref(""); //ชื่อรอบการเสนอ const optionRound = ref([]); @@ -133,6 +133,7 @@ async function fetchListOrg(id: string) { (item: DataStructureTree) => ({ id: item.orgTreeId, name: item.orgName, + isDeputy: item.isDeputy, }) ); @@ -157,6 +158,7 @@ async function fecthAgency(id: string) { }) .then((res) => { DataStore.agency = res.data.result.rootId; + DataStore.selectOrganization = res.data.result.rootId; DataStore.typeOc = DataStore.agency; }) .catch((err) => { @@ -189,6 +191,7 @@ async function fetchCheckIsofficer() { DataStore.isStaff = data.isStaff; DataStore.isOfficer = data.isOfficer; DataStore.isDirector = data.isDirector; + DataStore.isDeputy = data.isDeputy; }) .catch((err) => { messageError($q, err); @@ -231,13 +234,14 @@ async function fecthInsigniaByOc( roundId: string, ocId: string, role: string, - status: string + status: string, + isDeputy: boolean = false ) { DataStore.rows = []; if (roundId && ocId && role && status) { showLoader(); await http - .get(config.API.insigniaList(roundId, ocId, role, status)) + .get(config.API.insigniaList(roundId, ocId, role, status, isDeputy)) .then(async (res) => { requestNote.value = res.data.result.requestNote; requestStatus.value = res.data.result.requestStatus; @@ -246,11 +250,11 @@ async function fecthInsigniaByOc( await DataStore.fetchData(res.data.result.items); // ส่งรายชื่อข้าราชการสามัญฯ await DataStore.fetchDataInsignia(res.data.result); // ส่งข้อมูลรอบบการแสดง // แสดงปุมล็อกข้อมูล - if (res.data.result.items !== null) { - if (res.data.result.items.length !== 0) { - hideBottom.value = true; - } else hideBottom.value = false; - } + // if (res.data.result.items !== null) { + // if (res.data.result.items.length !== 0) { + // hideBottom.value = true; + // } else hideBottom.value = false; + // } }) .catch((err) => { messageError($q, err); @@ -493,7 +497,6 @@ onUnmounted(() => { v-if=" DataStore.isOfficer && DataStore.isLock !== true && - hideBottom && checkPermission($route)?.attrIsUpdate " dense @@ -555,7 +558,7 @@ onUnmounted(() => { >
{ { flat round color="primary" - v-if="DataStore.isStaff && checkPermission($route)?.attrIsGet" + v-if="checkPermission($route)?.attrIsGet" :href="document" target="_blank" > @@ -683,9 +686,11 @@ onUnmounted(() => { >
+ (false); // สถานะการแก้ไข const insigniaReclaimId = ref(""); // ID รายการเรียกคืนเครื่องราชฯ const insigniaReclaimData = ref(); //ข้อมูลรายการเรียกคืนเครื่องราชฯ - const yearRound = ref(); //รอบการเสนอขอ const insigniaType = ref("all"); //ประเภทเครื่องราช const employeeType = ref("all"); //ตำแหน่งประเภม @@ -234,8 +233,8 @@ async function fetchInsigniaRound() { let data = res.data.result; roundData.value.push(...data); roundOps.value = roundData.value; - yearRound.value = data[0].year; if (data.length > 0) { + yearRound.value = data[0].year; isInsigniaRound.value = true; } }) diff --git a/src/modules/09_leave/components/05_Leave/DetailLeaveReject.vue b/src/modules/09_leave/components/05_Leave/DetailLeaveReject.vue index 8da9d1c98..163d8b63c 100644 --- a/src/modules/09_leave/components/05_Leave/DetailLeaveReject.vue +++ b/src/modules/09_leave/components/05_Leave/DetailLeaveReject.vue @@ -1,5 +1,5 @@