แก้ไขการส่งค่าไปยังหน้ารายละเอียดของ การลา

This commit is contained in:
Warunee Tamkoo 2023-11-03 16:01:59 +07:00
parent 36539b2274
commit 48eb9ebb6c
5 changed files with 21 additions and 5 deletions

View file

@ -18,7 +18,7 @@ const paramsId = route.params.id;
class="q-mr-sm"
@click="router.push(`/leave-list`)"
/>
รายละเอยดการลาของ {{ paramsId }}
รายละเอยดการลาของ นายปยรมย ธาราฟ
</div>
<div>
<q-btn
@ -56,7 +56,7 @@ const paramsId = route.params.id;
</div>
<div class="col-12 row">
<div class="col-xs-5 col-sm-3 text-grey-8"> - นามสก</div>
<div class="col text-weight-medium">{{ paramsId }}</div>
<div class="col text-weight-medium">นายปยรมย ธาราฟ</div>
</div>
</div>
<div class="col-xs-12 col-sm-7 row">

View file

@ -118,7 +118,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
v-for="col in props.cols"
:key="col.name"
:props="props"
@click.prevent="router.push(`/leave/detail/${props.row.name}`)"
@click.prevent="router.push(`/leave/detail/${props.row.id}`)"
>
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}

View file

@ -0,0 +1,10 @@
interface ListsData {
id: string;
leaveType: string
name: string
Date: string
status: string
}
export type {
ListsData
}

View file

@ -5,6 +5,7 @@ import { useCounterMixin } from "@/stores/mixin";
import type { DataOption } from "@/modules/09_leave/interface/index/Main";
import type { QTableProps } from "quasar";
import type { DataRows } from "@/modules/09_leave/interface/response/leave";
import type { ListsData } from "@/modules/09_leave/interface/request/leave";
const mixin = useCounterMixin();
const { date2Thai, showLoader, hideLoader } = mixin;
@ -18,8 +19,9 @@ export const useLeavelistDataStore = defineStore("leave", () => {
const columns = ref<QTableProps["columns"]>([]);
const visibleColumns = ref<string[]>([]);
const loadTable = ref<boolean>(false);
async function fetchList(data: DataRows[]) {
let datalist = data.map((e: DataRows) => ({
async function fetchList(data: ListsData[]) {
let datalist = data.map((e: ListsData) => ({
id: e.id,
leaveType: e.leaveType,
name: e.name,
Date: date2Thai(e.Date),

View file

@ -17,24 +17,28 @@ onMounted(() => {
function fecthLeaveList() {
const data = [
{
id: "00000000-0000-0000-0000-000000000000",
leaveType: "ลาป่วย",
name: "นายกัณฐิมา กาฬสินธ์ุ",
Date: "2023-11-03",
status: "NEW",
},
{
id: "00000000-0000-0000-0000-000000000000",
leaveType: "ลากิจส่วนตัว",
name: "นายนครชัย วันดี",
Date: "2023-11-01",
status: "APPROVE",
},
{
id: "00000000-0000-0000-0000-000000000000",
leaveType: "ลากิจส่วนตัว",
name: "นายกัณฐิมา กาฬสินธ์ุ",
Date: "2023-11-02",
status: "PENDING",
},
{
id: "00000000-0000-0000-0000-000000000000",
leaveType: "ลาป่วย",
name: "นายปิยรมย์ ศิริธาราฟ",
Date: "2023-11-01",