From 9f73050a64875bce4917e20edf2a63adb5b97306 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 22 Sep 2023 11:29:16 +0700 Subject: [PATCH] =?UTF-8?q?interface=20main=20=E0=B8=AD=E0=B8=AD=E0=B8=81?= =?UTF-8?q?=E0=B8=84=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/Main.vue | 11 +++-- .../10_order/components/PopupHistory.vue | 15 ++++-- src/modules/10_order/interface/index/Main.ts | 48 +++++++++++++++++++ 3 files changed, 64 insertions(+), 10 deletions(-) diff --git a/src/modules/10_order/components/Main.vue b/src/modules/10_order/components/Main.vue index 2fabcf128..4f1a9bf28 100644 --- a/src/modules/10_order/components/Main.vue +++ b/src/modules/10_order/components/Main.vue @@ -5,6 +5,7 @@ import type { FormOrderPlacementMainData } from "@/modules/10_order/interface/re import type { DataOption, DataOption1, + OrderResult, } from "@/modules/10_order/interface/index/Main"; import { useCounterMixin } from "@/stores/mixin"; import { useOrderPlacementDataStore } from "@/modules/10_order/store"; @@ -139,8 +140,8 @@ const OriginalDataFetch = async () => { showLoader(); await http .get(config.API.listOrder()) - .then((res: any) => { - rows.value = res.data.result.map((e: any) => ({ + .then((res) => { + rows.value = res.data.result.map((e: OrderResult) => ({ orderId: e.orderId, Order: e.orderName, OrderNum: @@ -155,7 +156,7 @@ const OriginalDataFetch = async () => { orderTypeValue: e.orderTypeValue, })); }) - .catch((e: any) => { + .catch((e) => { messageError($q, e); }) .finally(async () => { @@ -240,13 +241,13 @@ const OrderStatusFilter = async () => { }; // ค้นหาในตาราง const filterKeyword = ref(""); -const filterRef = ref(null); +const filterRef = ref(null); const resetFilter = () => { filterKeyword.value = ""; filterRef.value.focus(); }; -const attrs = ref(useAttrs()); +const attrs = ref(useAttrs()); // ค้นหาประเภท และ สถานะ const searchFilterTable = async () => { if (OrderType.value == "ทั้งหมด") { diff --git a/src/modules/10_order/components/PopupHistory.vue b/src/modules/10_order/components/PopupHistory.vue index b1ccab9dd..7aa815deb 100644 --- a/src/modules/10_order/components/PopupHistory.vue +++ b/src/modules/10_order/components/PopupHistory.vue @@ -6,6 +6,11 @@ import type { QForm } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; import { useRouter } from "vue-router"; +import { + history, + ColumnData, + DataOptionInsigniaType, +} from "../interface/index/Main.ts"; const myForm = ref(); const mixin = useCounterMixin(); @@ -17,7 +22,7 @@ const props = defineProps({ OrderTypeOption: Object, }); -const OrderTypeOption = ref([]); +const OrderTypeOption = ref([]); const modal = ref(false); const employeeClass = ref(""); @@ -25,7 +30,7 @@ const reportType = ref(""); const reportYear = ref(); const reportNo = ref(""); -const columns = ref([ +const columns = ref([ { name: "no", label: "ลำดับ", @@ -67,14 +72,14 @@ const columns = ref([ style: "font-size: 14px", }, ]); -const rows = ref([]); +const rows = ref([]); // เปิด popup ประวัติ const clickOpenpopup = () => { modal.value = true; employeeClass.value = ""; if (props.OrderTypeOption != undefined) { OrderTypeOption.value = props.OrderTypeOption.filter( - (e: any) => e.name !== "ทั้งหมด" + (e: DataOptionInsigniaType) => e.name !== "ทั้งหมด" ); reportType.value = OrderTypeOption.value[0].name; let currentDate = new Date(); @@ -99,7 +104,7 @@ const clickSearch = async () => { .then((res) => { let data = res.data.result; if (data.length !== 0) { - rows.value = data.map((e: any) => ({ + rows.value = data.map((e: history) => ({ id: e.id, citizenId: e.citizenId, name: e.fullName, diff --git a/src/modules/10_order/interface/index/Main.ts b/src/modules/10_order/interface/index/Main.ts index 45d341f54..e770515ad 100644 --- a/src/modules/10_order/interface/index/Main.ts +++ b/src/modules/10_order/interface/index/Main.ts @@ -195,6 +195,50 @@ interface Assign { createdAt: Date; updatedAt: Date; } +interface OrderResult { + fiscalYear: string + orderBy: string + orderById: string + orderByOrganization: string + orderDate: Date + orderId: string + orderName: string + orderNo: string + orderStatusName: string + orderStatusValue: string + orderTypeName: string + orderTypeValue: string + signatoryBy: string + signatoryPosition: string +} +interface history { + citizenId: string, + fullName: string, + id: string + posNo: string, + position: string + +} +interface ColumnData { + name: string; + align: string; + label: string; + field: string; + headerStyle: string; + style: string; +} +interface DataOptionInsigniaType { + category: string; + commandCode: string; + createdAt: string; + createdFullName: string; + createdUserId: string; + id: string; + lastUpdateFullName: string; + lastUpdateUserId: string; + lastUpdatedAt: string | null; + name: string; +} export type { DataOption, DataOptionInsignia, @@ -213,6 +257,10 @@ export type { optionData, Certificate, Assign, + OrderResult, + history, + ColumnData, + DataOptionInsigniaType }; export { AddressDataDefualt, FamilyDataDefualt };