interface main ออกคำสั่ง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-22 11:29:16 +07:00
parent 7d3c48142c
commit 9f73050a64
3 changed files with 64 additions and 10 deletions

View file

@ -5,6 +5,7 @@ import type { FormOrderPlacementMainData } from "@/modules/10_order/interface/re
import type { import type {
DataOption, DataOption,
DataOption1, DataOption1,
OrderResult,
} from "@/modules/10_order/interface/index/Main"; } from "@/modules/10_order/interface/index/Main";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useOrderPlacementDataStore } from "@/modules/10_order/store"; import { useOrderPlacementDataStore } from "@/modules/10_order/store";
@ -139,8 +140,8 @@ const OriginalDataFetch = async () => {
showLoader(); showLoader();
await http await http
.get(config.API.listOrder()) .get(config.API.listOrder())
.then((res: any) => { .then((res) => {
rows.value = res.data.result.map((e: any) => ({ rows.value = res.data.result.map((e: OrderResult) => ({
orderId: e.orderId, orderId: e.orderId,
Order: e.orderName, Order: e.orderName,
OrderNum: OrderNum:
@ -155,7 +156,7 @@ const OriginalDataFetch = async () => {
orderTypeValue: e.orderTypeValue, orderTypeValue: e.orderTypeValue,
})); }));
}) })
.catch((e: any) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
.finally(async () => { .finally(async () => {
@ -240,13 +241,13 @@ const OrderStatusFilter = async () => {
}; };
// //
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");
const filterRef = ref<any>(null); const filterRef = ref<HTMLInputElement | null>(null);
const resetFilter = () => { const resetFilter = () => {
filterKeyword.value = ""; filterKeyword.value = "";
filterRef.value.focus(); filterRef.value.focus();
}; };
const attrs = ref<any>(useAttrs()); const attrs = ref<string | null>(useAttrs());
// //
const searchFilterTable = async () => { const searchFilterTable = async () => {
if (OrderType.value == "ทั้งหมด") { if (OrderType.value == "ทั้งหมด") {

View file

@ -6,6 +6,11 @@ import type { QForm } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import {
history,
ColumnData,
DataOptionInsigniaType,
} from "../interface/index/Main.ts";
const myForm = ref<QForm>(); const myForm = ref<QForm>();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
@ -17,7 +22,7 @@ const props = defineProps({
OrderTypeOption: Object, OrderTypeOption: Object,
}); });
const OrderTypeOption = ref<any>([]); const OrderTypeOption = ref<DataOptionInsigniaType[]>([]);
const modal = ref<boolean>(false); const modal = ref<boolean>(false);
const employeeClass = ref<string>(""); const employeeClass = ref<string>("");
@ -25,7 +30,7 @@ const reportType = ref<string>("");
const reportYear = ref<number | null>(); const reportYear = ref<number | null>();
const reportNo = ref<string>(""); const reportNo = ref<string>("");
const columns = ref<any["columns"]>([ const columns = ref<ColumnData[]>([
{ {
name: "no", name: "no",
label: "ลำดับ", label: "ลำดับ",
@ -67,14 +72,14 @@ const columns = ref<any["columns"]>([
style: "font-size: 14px", style: "font-size: 14px",
}, },
]); ]);
const rows = ref<any>([]); const rows = ref<history[]>([]);
// popup // popup
const clickOpenpopup = () => { const clickOpenpopup = () => {
modal.value = true; modal.value = true;
employeeClass.value = ""; employeeClass.value = "";
if (props.OrderTypeOption != undefined) { if (props.OrderTypeOption != undefined) {
OrderTypeOption.value = props.OrderTypeOption.filter( OrderTypeOption.value = props.OrderTypeOption.filter(
(e: any) => e.name !== "ทั้งหมด" (e: DataOptionInsigniaType) => e.name !== "ทั้งหมด"
); );
reportType.value = OrderTypeOption.value[0].name; reportType.value = OrderTypeOption.value[0].name;
let currentDate = new Date(); let currentDate = new Date();
@ -99,7 +104,7 @@ const clickSearch = async () => {
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
if (data.length !== 0) { if (data.length !== 0) {
rows.value = data.map((e: any) => ({ rows.value = data.map((e: history) => ({
id: e.id, id: e.id,
citizenId: e.citizenId, citizenId: e.citizenId,
name: e.fullName, name: e.fullName,

View file

@ -195,6 +195,50 @@ interface Assign {
createdAt: Date; createdAt: Date;
updatedAt: 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 { export type {
DataOption, DataOption,
DataOptionInsignia, DataOptionInsignia,
@ -213,6 +257,10 @@ export type {
optionData, optionData,
Certificate, Certificate,
Assign, Assign,
OrderResult,
history,
ColumnData,
DataOptionInsigniaType
}; };
export { AddressDataDefualt, FamilyDataDefualt }; export { AddressDataDefualt, FamilyDataDefualt };