From 39636d0e08fc5e0bed54695df190499eb72529c2 Mon Sep 17 00:00:00 2001 From: Thanit Konmek Date: Wed, 23 Aug 2023 14:57:50 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=E0=B8=A3=E0=B8=AD=E0=B8=9A=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B9=80?= =?UTF-8?q?=E0=B8=AA=E0=B8=99=E0=B8=AD=E0=B8=82=E0=B8=AD=E0=B8=9E=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=97=E0=B8=B2=E0=B8=99?= =?UTF-8?q?=E0=B9=80=E0=B8=84=E0=B8=A3=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=87?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=8A,=20=E0=B8=A3=E0=B8=B2=E0=B8=A2?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B8=A5=E0=B8=B2=E0=B8=AD=E0=B8=AD?= =?UTF-8?q?=E0=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/resign/ResignByid.vue | 99 ++++++++++++++++++- .../components/1_Proposals/addProposals.vue | 57 +++++++---- 2 files changed, 134 insertions(+), 22 deletions(-) diff --git a/src/modules/06_retirement/components/resign/ResignByid.vue b/src/modules/06_retirement/components/resign/ResignByid.vue index a5b702867..3fb04d6e2 100644 --- a/src/modules/06_retirement/components/resign/ResignByid.vue +++ b/src/modules/06_retirement/components/resign/ResignByid.vue @@ -145,6 +145,54 @@ + +
+
+ ผลการพิจารณาของผู้บังคับบัญชา +
+
+ +
+
+
+
สถานะ
+
{{ "อนุมัติ/ยับยั้ง" }}
+
+
+
วันสุดท้ายที่ยับยั้ง
+
{{ date2Thai(new Date()) }}
+
+
+
ความคิดเห็นและเหตุผล
+
{{ "ความคิดเห็นและเหตุผล" }}
+
+
+
+
+ +
+
+ ผลการพิจารณาของผู้มีอำนาจ +
+
+ +
+
+
+
สถานะ
+
{{ "อนุมัติ/ยับยั้ง" }}
+
+
+
วันสุดท้ายที่ยับยั้ง
+
{{ date2Thai(new Date()) }}
+
+
+
ความคิดเห็นและเหตุผล
+
{{ "ความคิดเห็นและเหตุผล" }}
+
+
+
+
@@ -486,19 +534,62 @@ :close="closeModal" /> - +
+
+ + + + + +
@@ -578,6 +669,7 @@ const status = ref(""); const modal = ref(false); const actionPass = ref(false); const reasonReign = ref(""); +const dateBreak = ref(null); const closeModal = () => (modal.value = false); const openModal = () => (modal.value = true); @@ -633,6 +725,7 @@ const fetchData = async (id: string) => { const popUp = (action: "pass" | "passNot") => { reasonReign.value = ""; + dateBreak.value = null; actionPass.value = action === "pass"; openModal(); // if (action === "pass") { diff --git a/src/modules/07_insignia/components/1_Proposals/addProposals.vue b/src/modules/07_insignia/components/1_Proposals/addProposals.vue index 558eab9fb..447a32b7c 100644 --- a/src/modules/07_insignia/components/1_Proposals/addProposals.vue +++ b/src/modules/07_insignia/components/1_Proposals/addProposals.vue @@ -10,7 +10,6 @@ color="primary" class="q-mr-sm" @click="clickBack" - /> {{ edit @@ -203,8 +202,15 @@ import http from "@/plugins/http"; import config from "@/app.config"; const mixin = useCounterMixin(); -const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader,dialogConfirm } = - mixin; +const { + date2Thai, + success, + dateToISO, + messageError, + showLoader, + hideLoader, + dialogConfirm, +} = mixin; const router = useRouter(); const route = useRoute(); const $q = useQuasar(); @@ -219,9 +225,9 @@ const fileDocDataUpload = ref([]); const roundInsig = ref(); const datelast = ref(1); const options = ref([ - {label:"รอบที่ 1",value:1}, - {label:"รอบที่ 2",value:2} -]) + { label: "รอบที่ 1", value: 1 }, + { label: "รอบที่ 2", value: 2 }, +]); onMounted(async () => { await fetchData(); }); @@ -238,7 +244,11 @@ const fetchData = async () => { const data = res.data.result; // const files = res.data.result.files; id.value = data.period_id; - roundInsig.value = data.period_name; + roundInsig.value = + options.value.filter((r: any) => r.value == data.period_round) + .length > 0 + ? options.value.filter((r: any) => r.value == data.period_round)[0] + : null; yearly.value = data.period_year; datelast.value = data.period_amount; dateStart.value = new Date(data.period_start); @@ -268,9 +278,13 @@ const updateYear = async (e: number) => { const editData = async (id: string) => { const formData = new FormData(); - formData.append("Name", roundInsig.value); - formData.append("year", parseInt(yearly.value).toString()); - formData.append("Amount", datelast.value.toString()); + const name = `รอบการเสนอพระราชทานเครื่องราชรอบที่ ${ + roundInsig.value.value + } ปี ${yearly.value + 543} `; + formData.append("name", name); + formData.append("year", yearly.value.toString()); + formData.append("amount", datelast.value.toString()); + formData.append("round", roundInsig.value.value); if (dateStart.value !== null) { formData.append("startDate", dateToISO(dateStart.value)); } @@ -295,9 +309,9 @@ const editData = async (id: string) => { }); console.log(formData); }; -const checkSave = () => { - dialogConfirm($q,()=> SaveData()) -} +const checkSave = () => { + dialogConfirm($q, () => SaveData()); +}; const SaveData = async () => { if (myForm.value !== null) { myForm.value.validate().then(async (success) => { @@ -324,23 +338,28 @@ const SaveData = async () => { // return valueData; // }; const updateDateRange = () => { -// console.log("test") + // console.log("test") if (roundInsig.value.value == 1) { dateStart.value = new Date(new Date().getFullYear(), 9, 1); dateEnd.value = new Date(new Date().getFullYear() + 1, 3, 29); - console.log(1) + console.log(1); } else if (roundInsig.value.value == 2) { dateStart.value = new Date(new Date().getFullYear(), 3, 29); dateEnd.value = new Date(new Date().getFullYear(), 4, 29); - console.log(2) + console.log(2); } }; const addData = async () => { const formData = new FormData(); - formData.append("name", roundInsig.value); - formData.append("year", parseInt(yearly.value).toString()); + const name = `รอบการเสนอพระราชทานเครื่องราชรอบที่ ${ + roundInsig.value.value + } ปี ${yearly.value + 543} `; + console.log(name); + formData.append("name", name); + formData.append("year", yearly.value.toString()); formData.append("amount", datelast.value.toString()); + formData.append("round", roundInsig.value.value); if (dateStart.value !== null) { formData.append("startDate", dateToISO(dateStart.value)); } @@ -356,7 +375,7 @@ const addData = async () => { showLoader(); await http - .post(config.API.listRoundInsignia("insignia"), formData) + .post(config.API.listRoundInsignia(), formData) .then(async (res) => {}) .catch((e) => { messageError($q, e);