From 240862be2c2d0c2143d257d594c4c3a44cd55777 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 29 Aug 2023 10:59:58 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20Code=20?= =?UTF-8?q?=E0=B9=80=E0=B8=84=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=87=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/1_Proposals/addProposals.vue | 339 +++++++++++------- .../components/1_Proposals/listProposals.vue | 74 ++-- .../07_insignia/components/2_Manage/Tab1.vue | 119 +----- .../07_insignia/components/2_Manage/Tab2.vue | 11 +- .../07_insignia/components/2_Manage/Tab3.vue | 14 +- .../07_insignia/components/2_Manage/Tab4.vue | 75 ---- .../components/2_Manage/listManage.vue | 39 +- .../components/3_result/DialogForm.vue | 247 ++----------- .../components/3_result/fileUpload.vue | 98 ++--- .../components/4_Allocate/Main.vue | 39 +- .../components/5_Borrow/DialogForm.vue | 306 +++++++++++----- .../07_insignia/components/5_Borrow/Main.vue | 25 +- src/modules/07_insignia/views/ResultPage.vue | 47 +-- 13 files changed, 548 insertions(+), 885 deletions(-) diff --git a/src/modules/07_insignia/components/1_Proposals/addProposals.vue b/src/modules/07_insignia/components/1_Proposals/addProposals.vue index 21c008961..a13f8009b 100644 --- a/src/modules/07_insignia/components/1_Proposals/addProposals.vue +++ b/src/modules/07_insignia/components/1_Proposals/addProposals.vue @@ -1,106 +1,4 @@ - + diff --git a/src/modules/07_insignia/components/1_Proposals/listProposals.vue b/src/modules/07_insignia/components/1_Proposals/listProposals.vue index 57207f646..794662ec3 100644 --- a/src/modules/07_insignia/components/1_Proposals/listProposals.vue +++ b/src/modules/07_insignia/components/1_Proposals/listProposals.vue @@ -5,9 +5,7 @@ import router from "@/router"; import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; import type { FormProprsalsRound } from " @/modules/07_insignia/interface/request/Main.ts"; -import { useRoute } from "vue-router"; import config from "@/app.config"; - import http from "@/plugins/http"; const mixin = useCounterMixin(); @@ -15,22 +13,12 @@ const { date2Thai, success, messageError, - statusLeave, - dialogMessage, - dateToISO, showLoader, hideLoader, dialogConfirm, + dialogRemove, } = mixin; -const route = useRoute(); const $q = useQuasar(); //ใช้ noti quasar -const modal = ref(false); -const pagination = ref({ - sortBy: "desc", - descending: false, - page: 1, - rowsPerPage: 10, -}); const visibleColumns = ref([ "round", @@ -194,34 +182,22 @@ const clickEdit = (col: any) => { router.push(`/insignia/round-add/${col.id}`); }; -// หัวตาราง2 const clickDelete = (id: string) => { - $q.dialog({ - title: "ยืนยันการลบข้อมูล", - message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?", - cancel: { - flat: true, - color: "negative", - }, - persistent: true, - }) - .onOk(async () => { - showLoader(); - await http - .delete(config.API.RoundInsignia(id)) - .then((res) => { - success($q, "ลบข้อมูลการเสนอขอสำเร็จ"); - fetchData(); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); - }) - .onCancel(() => {}) - .onDismiss(() => {}); + dialogRemove($q, async () => { + showLoader(); + await http + .delete(config.API.RoundInsignia(id)) + .then(() => { + success($q, "ลบข้อมูลการเสนอขอสำเร็จ"); + fetchData(); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); + }); }; const clickAdd = () => { @@ -247,12 +223,10 @@ const getRequest = async (id: string) => { showLoader(); await http .get(config.API.requestInsignia(id)) - .then((res) => { - console.log(res); + .then(() => { success($q, "ยืนยันสำเร็จ"); }) .catch((err) => { - console.log(err); messageError($q, err); }) .finally(async () => { @@ -268,16 +242,14 @@ const resetFilter = () => { filterRef.value.focus(); }; -const filterKeyword2 = ref(""); -const filterRef2 = ref(null); -const resetFilter2 = () => { - filterKeyword2.value = ""; - filterRef2.value.focus(); -}; - const attrs = ref(useAttrs()); - const paging = ref(true); +const pagination = ref({ + sortBy: "desc", + descending: false, + page: 1, + rowsPerPage: 10, +}); const paginationLabel = (start: string, end: string, total: string) => { if (paging.value == true) return " " + start + "-" + end + " ใน " + total; else return start + "-" + end + " ใน " + total; diff --git a/src/modules/07_insignia/components/2_Manage/Tab1.vue b/src/modules/07_insignia/components/2_Manage/Tab1.vue index a2f19c094..5c399ffb2 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab1.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab1.vue @@ -12,14 +12,7 @@ import DialogPopupReason from "@/components/Dialogs/PopupReason.vue"; const router = useRouter(); const mixin = useCounterMixin(); -const { - dialogRemove, - dialogConfirm, - showLoader, - hideLoader, - messageError, - success, -} = mixin; +const { dialogConfirm, showLoader, hideLoader, messageError, success } = mixin; const $q = useQuasar(); const DataStore = useInsigniaDataStore(); @@ -30,7 +23,6 @@ const modalAdd = ref(false); const modalEdit = ref(false); const rowid = ref(""); const organization = ref(""); -const fileId = ref(""); const organizationOptions = ref([{ id: "1", name: "ทั้งหมด" }]); const visibleColumns = ref([ @@ -178,7 +170,6 @@ const columns2 = ref([ ]); const rows2 = ref([]); - const person = ref([]); const props = defineProps({ tab: { @@ -205,10 +196,6 @@ const props = defineProps({ }); onMounted(async () => { - // if (DataStore.typeOc == "") { - // // organization.value = DataStore.optionsTypeOc[2].id; - // DataStore.typeOc = organization.value; - // } else organization.value = DataStore.typeOc; organization.value = await (DataStore.agency != null ? DataStore.agency : DataStore.typeOc); @@ -250,7 +237,6 @@ const fecthlistRetire = async () => { } }) .catch((e) => { - // console.log(e); messageError($q, e); }); }; @@ -271,8 +257,6 @@ const fecthlistperson = async (id: string) => { criterias: data, }) .then((res) => { - // console.log(res); - rows2.value = res.data.result.map((e: any) => ({ id: e.id, fullname: e.fullname == null ? "-" : e.fullname, @@ -283,14 +267,12 @@ const fecthlistperson = async (id: string) => { modalAdd.value = true; }) .catch((e) => { - // console.log(e); messageError($q, e); }) .finally(() => { hideLoader(); }); }; - const clickAdd = async (id: string) => { dialogConfirm( $q, @@ -306,17 +288,14 @@ const addlistperson = async (id: string) => { showLoader(); let data = { profileId: id, - // insigniaId: organization.value, insigniaPeriodId: props.roundId, }; - // console.log(data); await http .post(config.API.insigniaCreate(), data) .then(() => { success($q, "เพิ่มรายชื่อสำเร็จ"); }) .catch((err) => { - // console.log(err); messageError($q, err); }) .finally(() => { @@ -333,20 +312,11 @@ const addlistperson = async (id: string) => { }); }; -// const clickAction = (props: any, action: string) => { -// Note.value = ""; -// person.value = props; -// titleModal.value = props.name; -// actionModal.value = action; -// modalNote.value = true; -// }; const clickmodalEdit = (props: any) => { insignia.value = props.insigniaSend; - // insigniaType.value = props.insigniaLevel; person.value = props; modalEdit.value = true; fecthInsignia(); - // fecthInsigniaType(); }; const downloadFile = (response: any, filename: string) => { @@ -393,7 +363,6 @@ const clickSave = () => { const listEdit = async (profileId: string) => { let data: any = { insigniaId: insignia.value, - // insigniaTypeId: insigniaType.value, }; await http .put(config.API.insigniaEdit(profileId), data) @@ -499,7 +468,6 @@ const listdelete = async (id: string, reason: string) => { const insignia = ref(""); const insigniaOptions = ref([]); const insigniaType = ref(""); -// const insigniaTypeOptions = ref([]); const fecthInsignia = async () => { await http @@ -507,17 +475,10 @@ const fecthInsignia = async () => { .then((res) => { insigniaOptions.value = res.data.result; }) - .catch(() => { - // console.log(err); + .catch((e) => { + messageError($q, e); }); }; -// const fecthInsigniaType = async () => { -// await http(config.API.insigniaType) -// .then((res) => { -// insigniaTypeOptions.value = res.data.result; -// }) -// .catch((err) => {}); -// }; const nextPage = (id: string) => { router.push(`/registry/${id}`); @@ -559,7 +520,6 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
- { style="min-width: 150px" />
-
- + บันทึก
@@ -1002,54 +945,4 @@ const paginationLabel2 = (start: number, end: number, total: number) => { :click-close="closemodelPopupDelete" :savaForm="savaReasonDelete" /> - - - diff --git a/src/modules/07_insignia/components/2_Manage/Tab2.vue b/src/modules/07_insignia/components/2_Manage/Tab2.vue index 4cb620dca..150009aa8 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab2.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab2.vue @@ -6,11 +6,7 @@ import { useRouter } from "vue-router"; import DialogInformation from "@/components/Dialogs/Information.vue"; const router = useRouter(); -import http from "@/plugins/http"; -import config from "@/app.config"; - const DataStore = useInsigniaDataStore(); - const props = defineProps({ tab: { type: String, @@ -38,7 +34,6 @@ const visibleColumns = ref([ "position", "level", "salary", - "insigniaType", "insigniaSend", "insigniaLevel", @@ -143,12 +138,9 @@ onMounted(async () => { organization.value = await (DataStore.agency != null ? DataStore.agency : DataStore.typeOc); - // if (props.fecthInsigniaAll) { - // await props.fecthInsigniaAll(props.roundId, props.tab); - // } if (organization.value !== "" || organization.value !== undefined) { if (props.fecthInsigniaByOc) { - props.fecthInsigniaByOc( + await props.fecthInsigniaByOc( props.roundId, organization.value, "officer", @@ -207,7 +199,6 @@ const closeReson = () => {