diff --git a/src/modules/10_order/components/Detail.vue b/src/modules/10_order/components/Detail.vue index f9bad1bd8..9e645066e 100644 --- a/src/modules/10_order/components/Detail.vue +++ b/src/modules/10_order/components/Detail.vue @@ -37,7 +37,13 @@ const nextStep = async () => { await http .put(config.API.nextStep(orderId.value)) .then(() => { - router.push(`/order/detail/${orderId.value}?step=${step.value + 1}`); + if (route.name == "disciplineOrderDatail") { + router.push( + `/discipline-order/detail/${orderId.value}?step=${step.value + 1}` + ); + } else { + router.push(`/order/detail/${orderId.value}?step=${step.value + 1}`); + } }) .catch((e) => { console.log(e); @@ -50,7 +56,13 @@ const previousStep = async () => { await http .put(config.API.prevStep(orderId.value)) .then(() => { - router.push(`/order/detail/${orderId.value}?step=${step.value - 1}`); + if (route.name == "disciplineOrderDatail") { + router.push( + `/discipline-order/detail/${orderId.value}?step=${step.value - 1}` + ); + } else { + router.push(`/order/detail/${orderId.value}?step=${step.value - 1}`); + } }) .catch((e) => { console.log(e); @@ -88,7 +100,11 @@ onMounted(() => { flat color="primary" class="q-mr-sm" - @click="router.go(-1), destroyLocalStorage()" + @click=" + route.name == 'disciplineOrderDatail' + ? router.push(`/discipline-order`) + : router.push(`/order`) + " /> ออกคำสั่ง diff --git a/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue b/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue index ed0e68db1..31757ab8c 100644 --- a/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue +++ b/src/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue @@ -113,9 +113,10 @@ function saveOrder() { dialogConfirm( $q, async () => { - success($q, `ส่งข้อมูลไปออกคำสั่งสำเร็จ`); - emit("returnPerson", selected.value); + await emit("returnPerson", selected.value, type.value); props.closeModal?.(); + type.value = ""; + selected.value = []; }, `ยืนยันการส่งไปออกคำสั่ง`, `ต้องการยืนยันการส่งไปออกคำสั่งหรือไม่` @@ -135,7 +136,7 @@ function Reset() { emit("update:filterKeyword2", ""); } -async function fecthTypeOption(){ +async function fecthTypeOption() { showLoader(); await http .get(config.API.typeOrder()) @@ -151,7 +152,7 @@ async function fecthTypeOption(){ .finally(() => { hideLoader(); }); -}; +} onMounted(() => { fecthTypeOption(); @@ -243,8 +244,7 @@ onMounted(() => { >