refactor ออกคำสั่ง
This commit is contained in:
parent
8dfa5ca02e
commit
3802d5d5a2
8 changed files with 526 additions and 916 deletions
|
|
@ -121,7 +121,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
// ข้อมูลตาราง (จำลอง)
|
||||
const rows = ref<FormOrderPlacementMainData[]>([]);
|
||||
|
||||
|
|
@ -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<number | null>(0);
|
||||
const fiscalyearOP = reactive<DataOption[]>([{ 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<string>("");
|
||||
const OrderTypeOption = reactive<DataOption1[]>([{ id: "", name: "ทั้งหมด" }]);
|
||||
const addedOrderTypeValues: string[] = [];
|
||||
const OrderTypeFilter = async () => {
|
||||
await http
|
||||
.get(config.API.typeOrder())
|
||||
|
|
@ -253,9 +214,6 @@ const OrderTypeFilter = async () => {
|
|||
});
|
||||
};
|
||||
const OrderStatus = ref<string>("");
|
||||
const OrderStatusText = ref<FormOrderPlacementMainData[]>(
|
||||
DataStore.DataMainOrigOrder
|
||||
);
|
||||
const OrderStatusOption = reactive<DataOption1[]>([
|
||||
{ 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<any>(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) => {
|
|||
<q-td key="OrderStatus" :props="props">
|
||||
{{ props.row.OrderStatus }}
|
||||
</q-td>
|
||||
<!-- <q-td auto-width>
|
||||
<q-btn dense size="12px" flat round color="red" @click.stop="clickDelete(props.row.orderId)"
|
||||
icon="mdi-delete">
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td> -->
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue