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(); + } +); +