From b13f8c0697c5e9e1f8bc19cd7457aeee4fde7ba9 Mon Sep 17 00:00:00 2001 From: waruneeta Date: Mon, 18 Dec 2023 17:09:55 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=9B=E0=B8=A3?= =?UTF-8?q?=E0=B8=B0=E0=B9=80=E0=B8=A0=E0=B8=97=E0=B8=84=E0=B8=B3=E0=B8=AA?= =?UTF-8?q?=E0=B8=B1=E0=B9=88=E0=B8=87=E0=B8=82=E0=B8=AD=E0=B8=87=E0=B8=A7?= =?UTF-8?q?=E0=B8=B4=E0=B8=99=E0=B8=B1=E0=B8=A2=20=E0=B9=81=E0=B8=A5?= =?UTF-8?q?=E0=B8=B0=E0=B8=AA=E0=B8=B5=E0=B8=9B=E0=B8=B8=E0=B9=88=E0=B8=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../4_Result/DialogSendToCommand.vue | 34 ++++++++++++------- .../components/4_Result/EditPage.vue | 2 +- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue b/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue index fabd59ab0..a8c053141 100644 --- a/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue +++ b/src/modules/11_discipline/components/4_Result/DialogSendToCommand.vue @@ -82,7 +82,6 @@ const Ordersave = async () => { const body = { id, }; - console.log(body); showLoader(); await http .put(config.API.reportresult(type.value as string), body) @@ -123,14 +122,21 @@ const fecthTypeOption = async () => { await http .get(config.API.typeOrder()) .then((res) => { - optionsType.value = res.data.result.filter( - (e: OpType) => - e.commandCode === "C-PM-19" || - e.commandCode === "C-PM-20" || - e.commandCode === "C-PM-27" || - e.commandCode === "C-PM-28" || - e.commandCode === "C-PM-29" - ); + if (props.title == "ส่งไปออกคำสั่งลงโทษทางวินัย") { + optionsType.value = res.data.result.filter( + (e: OpType) => + e.commandCode === "C-PM-19" || + e.commandCode === "C-PM-20" || + e.commandCode === "C-PM-27" || + e.commandCode === "C-PM-28" || + e.commandCode === "C-PM-29" + ); + } else { + optionsType.value = res.data.result.filter( + (e: OpType) => + e.commandCode === "C-PM-30" || e.commandCode === "C-PM-31" + ); + } }) .catch((e) => { messageError($q, e); @@ -151,10 +157,14 @@ watchEffect(() => { } }); -onMounted(async () => { - await fecthTypeOption(); -}); +watch( + () => props.title, + () => { + fecthTypeOption(); + } +); +