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 {
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<string>("");
const filterRef = ref<any>(null);
const filterRef = ref<HTMLInputElement | null>(null);
const resetFilter = () => {
filterKeyword.value = "";
filterRef.value.focus();
};
const attrs = ref<any>(useAttrs());
const attrs = ref<string | null>(useAttrs());
//
const searchFilterTable = async () => {
if (OrderType.value == "ทั้งหมด") {

View file

@ -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<QForm>();
const mixin = useCounterMixin();
@ -17,7 +22,7 @@ const props = defineProps({
OrderTypeOption: Object,
});
const OrderTypeOption = ref<any>([]);
const OrderTypeOption = ref<DataOptionInsigniaType[]>([]);
const modal = ref<boolean>(false);
const employeeClass = ref<string>("");
@ -25,7 +30,7 @@ const reportType = ref<string>("");
const reportYear = ref<number | null>();
const reportNo = ref<string>("");
const columns = ref<any["columns"]>([
const columns = ref<ColumnData[]>([
{
name: "no",
label: "ลำดับ",
@ -67,14 +72,14 @@ const columns = ref<any["columns"]>([
style: "font-size: 14px",
},
]);
const rows = ref<any>([]);
const rows = ref<history[]>([]);
// 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,

View file

@ -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 };