ประวัติถือครองตำแหน่ง
This commit is contained in:
parent
c8b24028a1
commit
0b5779c79d
3 changed files with 50 additions and 32 deletions
|
|
@ -6,11 +6,13 @@ import config from "@/app.config";
|
||||||
import type { QForm } from "quasar";
|
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";
|
||||||
|
|
||||||
const myForm = ref<QForm>();
|
const myForm = ref<QForm>();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError, date2Thai, notifyError } = mixin;
|
const { showLoader, hideLoader, messageError, date2Thai, dialogMessageNotify } = mixin;
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
const employeeClass = ref<string>("");
|
const employeeClass = ref<string>("");
|
||||||
|
|
@ -154,7 +156,7 @@ const clickSearch = async (type: string) => {
|
||||||
date: date2Thai(e.date),
|
date: date2Thai(e.date),
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
notifyError($q, "ไม่มีข้อมูลที่ต้องการค้นหา");
|
dialogMessageNotify($q, "ไม่มีข้อมูลที่ต้องการค้นหา");
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -183,6 +185,9 @@ const filterFn = (val: string, update: any) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const clickRedirect = (id: string) => {
|
||||||
|
router.push(`/registry/${id}`);
|
||||||
|
};
|
||||||
|
|
||||||
const paging = ref<boolean>(true);
|
const paging = ref<boolean>(true);
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
|
|
@ -353,10 +358,20 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td key="no" :props="props"> {{ props.rowIndex + 1 }}</q-td>
|
<q-td key="no" :props="props"> {{ props.rowIndex + 1 }}</q-td>
|
||||||
<q-td key="order" :props="props">{{ props.row.order }} </q-td>
|
<q-td key="order" :props="props">{{ props.row.order }} </q-td>
|
||||||
<q-td key="citizenId" :props="props">{{
|
<q-td
|
||||||
props.row.citizenId
|
key="citizenId"
|
||||||
}}</q-td>
|
class="text-primary"
|
||||||
<q-td key="name" :props="props">{{ props.row.name }}</q-td>
|
@click="clickRedirect(props.row.id)"
|
||||||
|
:props="props"
|
||||||
|
>{{ props.row.citizenId }}</q-td
|
||||||
|
>
|
||||||
|
<q-td
|
||||||
|
key="name"
|
||||||
|
class="text-primary"
|
||||||
|
@click="clickRedirect(props.row.id)"
|
||||||
|
:props="props"
|
||||||
|
>{{ props.row.name }}</q-td
|
||||||
|
>
|
||||||
|
|
||||||
<q-td key="posNo" :props="props">{{ props.row.posNo }}</q-td>
|
<q-td key="posNo" :props="props">{{ props.row.posNo }}</q-td>
|
||||||
<q-td key="position" :props="props">{{
|
<q-td key="position" :props="props">{{
|
||||||
|
|
|
||||||
|
|
@ -15,29 +15,16 @@ import config from "@/app.config";
|
||||||
import PopupHistory from "./PopupHistory.vue";
|
import PopupHistory from "./PopupHistory.vue";
|
||||||
const $q = useQuasar(); //ใช้ noti quasar
|
const $q = useQuasar(); //ใช้ noti quasar
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const {
|
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||||
showLoader,
|
|
||||||
hideLoader,
|
|
||||||
messageError,
|
|
||||||
date2Thai,
|
|
||||||
dateText,
|
|
||||||
success,
|
|
||||||
dialogRemove,
|
|
||||||
} = mixin;
|
|
||||||
const DataStore = useOrderPlacementDataStore();
|
const DataStore = useOrderPlacementDataStore();
|
||||||
|
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
sortBy: "desc",
|
sortBy: "OrderDate",
|
||||||
descending: false,
|
descending: true,
|
||||||
page: 1,
|
page: 1,
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
// แปลงเวลา ค.ศ ให้เป็น พ.ศ
|
|
||||||
const textDate = (value: Date) => {
|
|
||||||
return dateText(value);
|
|
||||||
};
|
|
||||||
|
|
||||||
const visibleColumns = ref<string[]>([
|
const visibleColumns = ref<string[]>([
|
||||||
"Order",
|
"Order",
|
||||||
"OrderType",
|
"OrderType",
|
||||||
|
|
@ -46,7 +33,7 @@ const visibleColumns = ref<string[]>([
|
||||||
"OrderBy",
|
"OrderBy",
|
||||||
"Signer",
|
"Signer",
|
||||||
"OrderStatus",
|
"OrderStatus",
|
||||||
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
]);
|
||||||
|
|
||||||
// หัวตาราง
|
// หัวตาราง
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
|
@ -89,8 +76,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
field: "OrderDate",
|
field: "OrderDate",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a, b) => parseInt(a) - parseInt(b),
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "OrderBy",
|
name: "OrderBy",
|
||||||
|
|
@ -151,10 +137,11 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const OriginalDataFetch = async () => {
|
const OriginalDataFetch = async () => {
|
||||||
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.listOrder())
|
.get(config.API.listOrder())
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
console.log("list", res);
|
// console.log("list", res);
|
||||||
rows.value = res.data.result.map((e: any) => ({
|
rows.value = res.data.result.map((e: any) => ({
|
||||||
orderId: e.orderId,
|
orderId: e.orderId,
|
||||||
Order: e.orderName,
|
Order: e.orderName,
|
||||||
|
|
@ -172,9 +159,10 @@ const OriginalDataFetch = async () => {
|
||||||
})
|
})
|
||||||
.catch((e: any) => {
|
.catch((e: any) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(async () => {
|
||||||
|
hideLoader();
|
||||||
});
|
});
|
||||||
// .finally(async () => {
|
|
||||||
// });
|
|
||||||
await DataStore.DataMainOrder(rows.value);
|
await DataStore.DataMainOrder(rows.value);
|
||||||
OriginalData.value = await DataStore.DataMainOrigOrder;
|
OriginalData.value = await DataStore.DataMainOrigOrder;
|
||||||
UpdataData.value = OriginalData.value;
|
UpdataData.value = OriginalData.value;
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,13 @@ import config from "@/app.config";
|
||||||
import type { QForm } from "quasar";
|
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";
|
||||||
|
|
||||||
const myForm = ref<QForm>();
|
const myForm = ref<QForm>();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError, date2Thai, notifyError } = mixin;
|
const { showLoader, hideLoader, messageError, date2Thai, notifyError } = mixin;
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
OrderTypeOption: Object,
|
OrderTypeOption: Object,
|
||||||
|
|
@ -169,6 +171,9 @@ const filterFn = (val: string, update: any) => {
|
||||||
}
|
}
|
||||||
console.log(options.value);
|
console.log(options.value);
|
||||||
};
|
};
|
||||||
|
const clickRedirect = (id: string) => {
|
||||||
|
router.push(`/registry/${id}`);
|
||||||
|
};
|
||||||
|
|
||||||
const paging = ref<boolean>(true);
|
const paging = ref<boolean>(true);
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
|
|
@ -332,10 +337,20 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td key="no" :props="props"> {{ props.rowIndex + 1 }}</q-td>
|
<q-td key="no" :props="props"> {{ props.rowIndex + 1 }}</q-td>
|
||||||
<q-td key="order" :props="props">{{ props.row.order }} </q-td>
|
<q-td key="order" :props="props">{{ props.row.order }} </q-td>
|
||||||
<q-td key="citizenId" :props="props">{{
|
<q-td
|
||||||
props.row.citizenId
|
key="citizenId"
|
||||||
}}</q-td>
|
class="text-primary"
|
||||||
<q-td key="name" :props="props">{{ props.row.name }}</q-td>
|
:props="props"
|
||||||
|
@click="clickRedirect(props.row.id)"
|
||||||
|
>{{ props.row.citizenId }}</q-td
|
||||||
|
>
|
||||||
|
<q-td
|
||||||
|
key="name"
|
||||||
|
class="text-primary"
|
||||||
|
:props="props"
|
||||||
|
@click="clickRedirect(props.row.id)"
|
||||||
|
>{{ props.row.name }}</q-td
|
||||||
|
>
|
||||||
|
|
||||||
<q-td key="posNo" :props="props">{{ props.row.posNo }}</q-td>
|
<q-td key="posNo" :props="props">{{ props.row.posNo }}</q-td>
|
||||||
<q-td key="position" :props="props">{{
|
<q-td key="position" :props="props">{{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue