From 118156a1f08184028f303bc884fb74984ea09b38 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 29 Sep 2023 09:49:43 +0700 Subject: [PATCH 01/14] =?UTF-8?q?download=20file=20=E0=B8=88=E0=B8=B1?= =?UTF-8?q?=E0=B8=94=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=84=E0=B8=B3=E0=B8=82?= =?UTF-8?q?=E0=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../07_insignia/components/2_Manage/Tab1.vue | 51 ++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/src/modules/07_insignia/components/2_Manage/Tab1.vue b/src/modules/07_insignia/components/2_Manage/Tab1.vue index 6f042f192..af9bac3ae 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab1.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab1.vue @@ -409,10 +409,17 @@ const downloadFile = (response: any, filename: string) => { }; // เรียก file รายชื่อข้าราชการสามัญฯ const downloadFileexcel = async () => { + const findInsigniaId = DataStore.dataInsigniaType.find( + (e: any) => e.name == DataStore.typeinsignia + ); + showLoader(); await http - .get(config.API.insigniaDowanload(DataStore.requestId), { + .put(config.API.insigniaDowanload(DataStore.requestId), { responseType: "blob", + profileType: + DataStore.employeeClass == "all" ? null : DataStore.employeeClass, + InsigniaId: DataStore.typeinsignia == "all" ? null : findInsigniaId.id, }) .then(async (res) => { await downloadFile( @@ -656,33 +663,29 @@ const clickShowWarn = ( const filterSelector = (val: any, update: Function, name: any) => { update(() => { const needle = val.toLowerCase(); - if (name === 'typeinsigniaOptions') { - DataStore.typeinsignia = '' - typeinsigniaOptions.value = DataStore.typeinsigniaOptions.filter( - (v: any) => v.name.toLowerCase().indexOf(needle) > -1 - ); - } - else if(name === 'employeeClassOps'){ - DataStore.employeeClass = '' - employeeClassOps.value = DataStore.employeeClassOps.filter( - (v: any) => v.name.toLowerCase().indexOf(needle) > -1 - ); - } - else if(name === 'filterOrganizationOP'){ + if (name === "typeinsigniaOptions") { + DataStore.typeinsignia = ""; + typeinsigniaOptions.value = DataStore.typeinsigniaOptions.filter( + (v: any) => v.name.toLowerCase().indexOf(needle) > -1 + ); + } else if (name === "employeeClassOps") { + DataStore.employeeClass = ""; + employeeClassOps.value = DataStore.employeeClassOps.filter( + (v: any) => v.name.toLowerCase().indexOf(needle) > -1 + ); + } else if (name === "filterOrganizationOP") { filterOrganizationOP.value = organizationOptions.value.filter( - (v: any) => v.name.toLowerCase().indexOf(needle) > -1 - ); + (v: any) => v.name.toLowerCase().indexOf(needle) > -1 + ); } - - } - ) -} + }); +}; const clearInsigniaFilters = (name: string) => { if (name === "typeinsigniaOptions") { DataStore.typeinsignia = "all"; typeinsigniaOptions.value = DataStore.typeinsigniaOptions; - } else if (name === 'employeeClassOps') { + } else if (name === "employeeClassOps") { DataStore.employeeClass = "all"; employeeClassOps.value = DataStore.employeeClassOps; } @@ -694,7 +697,7 @@ const clearInsigniaFilters = (name: string) => {
{ ) " /> {
Date: Fri, 29 Sep 2023 09:50:13 +0700 Subject: [PATCH 02/14] =?UTF-8?q?downloadFile=20=E0=B8=88=E0=B8=B1?= =?UTF-8?q?=E0=B8=94=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=84=E0=B8=B3=E0=B8=82?= =?UTF-8?q?=E0=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../07_insignia/components/2_Manage/listManage.vue | 13 +++++++++++++ src/modules/07_insignia/store.ts | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/modules/07_insignia/components/2_Manage/listManage.vue b/src/modules/07_insignia/components/2_Manage/listManage.vue index 5e888eb7d..09298ca28 100644 --- a/src/modules/07_insignia/components/2_Manage/listManage.vue +++ b/src/modules/07_insignia/components/2_Manage/listManage.vue @@ -40,6 +40,7 @@ const modalPopupBackToEdit = ref(false); //model แก้ไข onMounted(async () => { tab.value = DataStore.mainTab; await fecthlistRound(); + DataStore.dataInsigniaType.length === 0 && (await fecthInsignia()); }); //เรียกรอบการเสนอขอพระราชทานเครื่อง @@ -123,6 +124,18 @@ const fecthType = async () => { messageError($q, err); }); }; +// เรียกประเภทเครื่องราช +const fecthInsignia = async () => { + await http + .get(config.API.insignia) + .then((res) => { + let data = res.data.result; + DataStore.fetchInsigniaType(data); + }) + .catch((err) => { + messageError($q, err); + }); +}; //เลือกรอบการแสดง const changround = async () => { diff --git a/src/modules/07_insignia/store.ts b/src/modules/07_insignia/store.ts index 982c425ac..9f1dc5269 100644 --- a/src/modules/07_insignia/store.ts +++ b/src/modules/07_insignia/store.ts @@ -37,6 +37,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => { { id: '44', title: 'บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ' } ]) const mainTab = ref("pending"); + const dataInsigniaType = ref([]) // เรียกราชชื่อการเสนอขอ const fetchData = async (data: any) => { if (data !== null) { @@ -124,6 +125,10 @@ export const useInsigniaDataStore = defineStore("insignia", () => { rows.value = listinsignia.value; } }; + // ประเภทเครื่องราช + function fetchInsigniaType(data: any) { + dataInsigniaType.value = data + } // ประเภทลูกจ้าง const profileType = (val: string) => { @@ -167,11 +172,13 @@ export const useInsigniaDataStore = defineStore("insignia", () => { employeeClass, employeeClassOps, fetchDataInsignia, + fetchInsigniaType, isLock, requestId, roleUser, requestStatus, optionReport, - convertStatus + convertStatus, + dataInsigniaType, }; }); From 1d61d79d13cce98356fcf62e92a59ec328ce9f92 Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Fri, 29 Sep 2023 10:10:59 +0700 Subject: [PATCH 03/14] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=9A?= =?UTF-8?q?=E0=B8=B1=E0=B8=84=20filter=20=E0=B8=AD=E0=B8=AD=E0=B8=81?= =?UTF-8?q?=E0=B8=84=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87/?= =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=81=E0=B8=B2=E0=B8=A8=E0=B9=80?= =?UTF-8?q?=E0=B8=81=E0=B8=A9=E0=B8=B5=E0=B8=A2=E0=B8=93=E0=B8=AD=E0=B8=B2?= =?UTF-8?q?=E0=B8=A2=E0=B8=B8=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/06_retirement/views/Main.vue | 40 +++++++++++++++--------- src/modules/10_order/store.ts | 37 ++++++++++++++-------- src/modules/10_order/views/Main.vue | 36 +++++++-------------- 3 files changed, 62 insertions(+), 51 deletions(-) diff --git a/src/modules/06_retirement/views/Main.vue b/src/modules/06_retirement/views/Main.vue index ee3a43109..ce1b2f38c 100644 --- a/src/modules/06_retirement/views/Main.vue +++ b/src/modules/06_retirement/views/Main.vue @@ -72,19 +72,17 @@ const columns = ref([ // ข้อมูลตาราง (จำลอง) const currentYear = new Date().getFullYear(); const rows = ref([]); -const yearOptions = ref([]); +const yearOptions = ref([{ id: "", year: "ทั้งหมด" }]); -onMounted(() => { - filteryear(); +onMounted(async () => { + await fetchRetirement(type.value, currentYear); + // await fetchRetirement(type.value, currentYear); }); // หาปีปัจจุบัน const filteryear = () => { - yearOptions.value = [{ id: currentYear, name: currentYear + 543 }]; - yearOptions.value.push({ id: currentYear, name: currentYear + 543 }); - // fiscalyear.value = yearOptions[0].id; - - yearOptionsFilter.value = [{ id: currentYear, name: currentYear + 543 }]; - yearOptionsFilter.value.push({ id: currentYear, name: currentYear + 543 }); + // 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); }; // ประกาศเกษียณอายุราชการ @@ -98,7 +96,7 @@ const fetchRetirement = async (type: string, year: any) => { rows.value = data.map((items: any) => ({ id: items.id, Date: date2Thai(items.createdAt), - year: items.year, + year: items.year + 543, retireNumber: items.round, total: items.total, round: items.round, @@ -106,6 +104,19 @@ const fetchRetirement = async (type: string, year: any) => { json: items.json, document: items.document, })); + let option: any[] = []; + data.map((items: any) => { + option.push({ + id: items.year, + year: (items.year + 543).toString(), + typeReport: typeReportChangeName(items.typeReport), // เปลี่ยนสถานะ + }); + }); + yearOptions.value = [{ id: 0, year: "ทั้งหมด" }]; + yearOptions.value.push(...option); + + yearOptionsFilter.value = yearOptions.value; + actionOption.value = rows.value; rows.value.sort((a, b) => a.round - b.round); // เรียงรอบมากไปน้อย checkststus(rows.value); @@ -144,10 +155,10 @@ const pagination = ref({ rowsPerPage: 10, }); -const filterSelector = (val: any, update: Function, year: any) => { +const filterSelector = (val: any, update: Function) => { update(() => { yearOptions.value = yearOptionsFilter.value.filter( - (v: any) => v.name.valueOf(val.toLowerCase()) > -1 + (v: any) => v.year.indexOf(val) > -1 ); }); }; @@ -219,8 +230,9 @@ const typeReportChangeName = (val: string) => { map-options :options="yearOptions" option-value="id" - option-label="name" + option-label="year" lazy-rules + use-input hide-bottom-space :readonly="false" :borderless="false" @@ -228,7 +240,7 @@ const typeReportChangeName = (val: string) => { :hide-dropdown-icon="false" style="min-width: 150px" @filter="(inputValue:any, - doneFn:Function) => filterSelector(inputValue, doneFn,'yearOptions' + doneFn:Function) => filterSelector(inputValue, doneFn ) " /> diff --git a/src/modules/10_order/store.ts b/src/modules/10_order/store.ts index 1a7f9e7da..168f0f029 100644 --- a/src/modules/10_order/store.ts +++ b/src/modules/10_order/store.ts @@ -45,13 +45,19 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => { DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( (item) => item.orderTypeValue === filter_1 ); - } else if (filter_1 !== "" && filter_2 !== "ทั้งหมด" && filterYear === null) { + } else if ( + filter_1 !== "" && + filter_2 !== "ทั้งหมด" && + filterYear === null + ) { DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( - (item) => item.orderTypeValue === filter_1 && item.OrderStatus === filter_2 + (item) => + item.orderTypeValue === filter_1 && item.OrderStatus === filter_2 ); } else if (filter_1 !== "" && filter_2 === "ทั้งหมด" && filterYear !== 0) { DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( - (item) => item.orderTypeValue === filter_1 && item.fiscalYear === filterYear + (item) => + item.orderTypeValue === filter_1 && item.fiscalYear === filterYear ); } else if (filter_1 === "" && filter_2 !== "ทั้งหมด" && filterYear === 0) { DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( @@ -61,27 +67,32 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => { DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( (item) => item.fiscalYear === filterYear ); - } else if (filter_1 === "" && filter_2 !== "ทั้งหมด" && filterYear !== null) { + } else if ( + filter_1 === "" && + filter_2 !== "ทั้งหมด" && + filterYear !== null + ) { DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( (item) => item.OrderStatus === filter_2 && item.fiscalYear === filterYear ); } else if (filter_1 !== "" && filter_2 !== "ทั้งหมด" && filterYear === 0) { DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( - (item) => item.OrderStatus === filter_2 && item.orderTypeValue === filter_1 + (item) => + item.OrderStatus === filter_2 && item.orderTypeValue === filter_1 ); - } else if (filter_1 !== "" && filter_2 !== "ทั้งหมด" && filterYear !== null) { + } else if ( + filter_1 !== "" && + filter_2 !== "ทั้งหมด" && + filterYear !== null + ) { DataMainUpdateOrder.value = DataMainOrigOrder.value.filter( (item) => item.orderTypeValue === filter_1 && item.OrderStatus === filter_2 && item.fiscalYear === filterYear ); - } else if ( - filter_1 == "" && - filter_2 == "ทั้งหมด" && - filterYear !== null - ) { + } else if (filter_1 == "" && filter_2 == "ทั้งหมด" && filterYear !== null) { DataMainUpdateOrder.value = DataMainOrigOrder.value; } }; @@ -144,6 +155,6 @@ export const useOrderPlacementDataStore = defineStore("placementOrder", () => { DataUpdateOrder, DataMainYearSetOrder, DataMainOrder, - nameOrderFilter + nameOrderFilter, }; -}); \ No newline at end of file +}); diff --git a/src/modules/10_order/views/Main.vue b/src/modules/10_order/views/Main.vue index 275398d09..a289f17fe 100644 --- a/src/modules/10_order/views/Main.vue +++ b/src/modules/10_order/views/Main.vue @@ -18,15 +18,6 @@ const mixin = useCounterMixin(); const { showLoader, hideLoader, messageError, date2Thai } = mixin; const DataStore = useOrderPlacementDataStore(); -const OpsFilterYear = ref({ - fiscalyearOP: [], -}); -const OpsFilterOrderType = ref({ - OrderTypeOption: [], -}); -const OpsFilterOrderStatus = ref({ - OrderStatusOption: [], -}); const pagination = ref({ descending: true, page: 1, @@ -153,14 +144,6 @@ const OriginalDataFetch = async () => { OrderType: e.orderTypeName, orderTypeValue: e.orderTypeValue, })); - // OpsFilterYear.value.fiscalYear = res.data.result.map((e: any) => ({ - // fiscalYear: Number(e.fiscalYear), - // })); - OpsFilterOrderStatus.value.OrderStatus = res.data.result.map( - (e: any) => ({ - OrderStatus: e.orderStatusName, - }) - ); console.log(fiscalyear.value); console.log(OrderStatus.value); }) @@ -199,22 +182,26 @@ const redirectToPage = (id?: string, status?: string) => { const clickAdd = () => { router.push({ name: "OrderAdd" }); }; -const Ops = ref({ - fiscalyearOP: [], -}); // รายการข้อมูลปีงบประมาณ const fiscalyear = ref(0); -const fiscalyearOP = ref([{ id: 0, name: "ทั้งหมด" }]); +const fiscalyearOP = ref([{ id: 0, name: "ทั้งหมด" }]); const fiscalyearFilter1 = ref([]); const fiscalYearFilter = async () => { await http.get(config.API.yearOptionsOrder()).then((res) => { const response = res.data.result; fiscalyearOP.value = [{ id: 0, name: "ทั้งหมด" }]; - fiscalyearOP.value.push(...response); + response.map((r: any) => { + fiscalyearOP.value.push({ id: r.id, name: r.name.toString() }); + }); fiscalyearFilter1.value = [{ id: 0, name: "ทั้งหมด" }]; - fiscalyearFilter1.value.push(...response); + response.map((r: any) => { + fiscalyearFilter1.value.push({ + id: r.id, + name: r.name.toString(), + }); + }); }); }; @@ -300,7 +287,7 @@ const filterSelector = (val: any, update: Function, refData: string) => { case "fiscalyearOP": update(() => { fiscalyearOP.value = fiscalyearFilter1.value.filter( - (v: any) => v.name.valueOf(val) > -1 + (v: any) => v.name.indexOf(val) > -1 ); }); break; @@ -347,6 +334,7 @@ const paginationLabel = (start: string, end: string, total: string) => { option-value="id" option-label="name" lazy-rules + use-input hide-bottom-space :readonly="false" :borderless="false" From 887f229017de18a8a307e4b822f2d6d2baa85906 Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Fri, 29 Sep 2023 10:26:12 +0700 Subject: [PATCH 04/14] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84?= =?UTF-8?q?=E0=B8=82=20=E0=B8=84=E0=B9=89=E0=B8=99=E0=B8=AB=E0=B8=B2?= =?UTF-8?q?=E0=B9=83=E0=B8=99=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=8A=E0=B8=B7?= =?UTF-8?q?=E0=B9=88=E0=B8=AD=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89?= =?UTF-8?q?=E0=B8=B2=E0=B8=87=E0=B8=8A=E0=B8=B1=E0=B9=88=E0=B8=A7=E0=B8=84?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/08_registryEmployee/views/Main.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/08_registryEmployee/views/Main.vue b/src/modules/08_registryEmployee/views/Main.vue index f80d1d0e3..be6e43e2e 100644 --- a/src/modules/08_registryEmployee/views/Main.vue +++ b/src/modules/08_registryEmployee/views/Main.vue @@ -310,7 +310,7 @@ const deleteData = async (id: string) => { // **** เริ่มในส่วนของการเลือกตำแหน่ง ***// const rowsPosition = ref([]); // รายการข้อมูลในตารางกำหนดตำแหน่ง const filters = ref([]); -const filterKeyword2 = ref(""); +const filterKeyword2 = ref(""); const modal = ref(false); // เปิด-ปิด dialod กำหนดตำแหน่ง const selectedPosition = ref([]); // เก็บตำแหน่งที่เลือก @@ -970,7 +970,7 @@ const showEmployeeTemp = async () => { dense ref="filterRef" debounce="300" - :model-value="filterKeyword2" + v-model="filterKeyword2" placeholder="ค้นหา" style="width: 850px; max-width: auto" > From e2d755caca32033da445aa627b4882b3c93f63bb Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 29 Sep 2023 10:27:24 +0700 Subject: [PATCH 05/14] =?UTF-8?q?filter=20=E0=B8=AA=E0=B9=88=E0=B8=87?= =?UTF-8?q?=E0=B9=84=E0=B8=9B=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=84=E0=B8=B3?= =?UTF-8?q?=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87=E0=B8=AD=E0=B8=B7=E0=B9=88?= =?UTF-8?q?=E0=B8=99=E0=B9=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/05_placement/components/Main.vue | 2 +- .../components/Other/Dialogbody.vue | 44 ++++++++++++++----- .../components/probation/MainProbation.vue | 2 +- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/src/modules/05_placement/components/Main.vue b/src/modules/05_placement/components/Main.vue index af79afc85..9ba46025c 100644 --- a/src/modules/05_placement/components/Main.vue +++ b/src/modules/05_placement/components/Main.vue @@ -425,7 +425,7 @@ function filterFnYear(val: string, update: any) { -import { ref, computed,watchEffect } from "vue"; +import { ref, computed, watchEffect } from "vue"; import { useQuasar } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import type { QTableProps } from "quasar"; @@ -25,8 +25,8 @@ const props = defineProps({ fecthlistOthet: Function, optionsType: Array, rows2: Array, - filterKeyword2:String, - type:String, + filterKeyword2: String, + type: String, }); const visibleColumns2 = ref([ "no", @@ -96,7 +96,6 @@ const emit = defineEmits([ "update:filterKeyword2", "update:type", "update:selected", - ]); const updateInput = (value: any) => { emit("update:filterKeyword2", value); @@ -107,7 +106,7 @@ const updateInputType = (value: any) => { }; //รีเซ็ตค่าในช่องค้นหา const Reset = () => { - emit("update:filterKeyword2", ""); + emit("update:filterKeyword2", ""); }; //เปิด modal ยืนยัน const clickAddlist = () => { @@ -117,7 +116,7 @@ const clickAddlist = () => { //อัพเดต ส่งไปออกคำสั่ง const addOther = async () => { let pId: string[] = []; - let Type = props.type as string + let Type = props.type as string; selected.value.forEach((e: any) => { pId.push(e.personalId); }); @@ -136,7 +135,7 @@ const addOther = async () => { .finally(() => { props.fecthlistOthet?.(); selected.value = []; - props.clickClose?.() + props.clickClose?.(); }); }; watchEffect(() => { @@ -144,6 +143,23 @@ watchEffect(() => { selected.value = []; } }); +// filter OptionsType +const OptionsTypeFn = ref([]); +function filterFnOptionsType(val: string, update: any) { + if (val == "") { + update(() => { + OptionsTypeFn.value = props.optionsType; + }); + } else { + update(() => { + if (props.optionsType) { + OptionsTypeFn.value = props.optionsType.filter( + (e: any) => e.name.search(val) !== -1 + ); + } + }); + } +}