From 3802d5d5a2c96d9e8f28dea53f182ceeca204428 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 22 Sep 2023 10:47:31 +0700 Subject: [PATCH] =?UTF-8?q?refactor=20=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=84?= =?UTF-8?q?=E0=B8=B3=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/10_order/components/Detail.vue | 6 +- src/modules/10_order/components/Main.vue | 58 +- .../10_order/components/PopupHistory.vue | 14 +- .../10_order/components/step/step01.vue | 686 +----------------- .../10_order/components/step/step02.vue | 38 +- .../10_order/components/step/step03.vue | 50 +- .../10_order/components/step/step04.vue | 540 ++++++++++---- src/modules/10_order/store.ts | 50 ++ 8 files changed, 526 insertions(+), 916 deletions(-) diff --git a/src/modules/10_order/components/Detail.vue b/src/modules/10_order/components/Detail.vue index 8b0b2e143..ee0574808 100644 --- a/src/modules/10_order/components/Detail.vue +++ b/src/modules/10_order/components/Detail.vue @@ -30,10 +30,8 @@ const orderId = ref(""); onUnmounted(() => { destroyLocalStorage(); }); - +// const nextStep = async () => { - // stepper.value!.next(); - localStorage.setItem("currentStep", step.value.toString()); if (orderId.value) { await http @@ -47,7 +45,6 @@ const nextStep = async () => { } }; const previousStep = async () => { - // stepper.value!.previous(); localStorage.setItem("currentStep", step.value.toString()); if (orderId.value) { await http @@ -75,7 +72,6 @@ onMounted(() => { step.value = 1; } } - if (orderId_params !== undefined) { orderId.value = orderId_params.toString(); } diff --git a/src/modules/10_order/components/Main.vue b/src/modules/10_order/components/Main.vue index 270f95849..2fabcf128 100644 --- a/src/modules/10_order/components/Main.vue +++ b/src/modules/10_order/components/Main.vue @@ -121,7 +121,6 @@ const columns = ref([ style: "font-size: 14px", }, ]); - // ข้อมูลตาราง (จำลอง) const rows = ref([]); @@ -135,7 +134,7 @@ onMounted(async () => { OrderStatusFilter(); OrderTypeFilter(); }); - +// เรียกรายการออกคำสั่ง const OriginalDataFetch = async () => { showLoader(); await http @@ -186,61 +185,23 @@ const redirectToPage = (id?: string, status?: string) => { } router.push(`/order/detail/${id}?step=${step}`); }; - -// const clickDelete = (id: string) => { -// dialogRemove( -// $q, -// () => deleteData(id), -// ); - -// }; - -// const deleteData = async (id: string) => { -// showLoader(); -// await http -// .delete(config.API.deleteOrder(id)) -// .then((res) => { -// success($q, "ลบข้อมูลสำเร็จ"); -// }) -// .catch((e) => { -// messageError($q, e); -// }) -// .finally(async () => { -// hideLoader(); -// await OriginalDataFetch(); -// fiscalYearFilter(); -// searchFilterTable(); -// OrderStatusFilter(); -// OrderTypeFilter(); -// }); -// }; - +// เพิ่มออกคำสั่ง const clickAdd = () => { router.push({ name: "OrderAdd" }); }; -// const viewDetail = (id: string, status: string) => { -// if (status == "checkPayment") { -// router.push(`${route.fullPath}/payment/${id}`); -// } else { -// router.push(`${route.fullPath}/profile/${id}`); -// } -// }; - // เลือกปีงบประมาณ const fiscalyear = ref(0); const fiscalyearOP = reactive([{ id: 0, name: "ทั้งหมด" }]); -const addedfiscalYearValues: number[] = []; const fiscalYearFilter = async () => { await http.get(config.API.yearOptionsOrder()).then((res) => { const response = res.data.result; fiscalyearOP.push(...response); }); }; - +// เรียกประเภทคำสั่ง const OrderType = ref(""); const OrderTypeOption = reactive([{ id: "", name: "ทั้งหมด" }]); -const addedOrderTypeValues: string[] = []; const OrderTypeFilter = async () => { await http .get(config.API.typeOrder()) @@ -253,9 +214,6 @@ const OrderTypeFilter = async () => { }); }; const OrderStatus = ref(""); -const OrderStatusText = ref( - DataStore.DataMainOrigOrder -); const OrderStatusOption = reactive([ { id: "", name: "ทั้งหมด" }, ]); @@ -263,7 +221,6 @@ const addedOrderStatusValues: string[] = []; const OrderStatusFilter = async () => { for (let data of OriginalData.value) { const OrderStatusValue = data.OrderStatus; - if ( OrderStatusValue === null || parseInt(OrderStatusValue) > parseInt(OrderStatusValue) @@ -290,7 +247,7 @@ const resetFilter = () => { }; const attrs = ref(useAttrs()); - +// ค้นหาประเภท และ สถานะ const searchFilterTable = async () => { if (OrderType.value == "ทั้งหมด") { OrderType.value = ""; @@ -298,7 +255,6 @@ const searchFilterTable = async () => { if (OrderStatus.value == "ทั้งหมด") { OrderStatus.value = ""; } - await DataStore.DataUpdateOrder( OrderType.value, OrderStatus.value, @@ -489,12 +445,6 @@ const paginationLabel = (start: string, end: string, total: string) => { {{ props.row.OrderStatus }} -