แก้เงื่อนไข redirect ต่างๆ
This commit is contained in:
parent
e8524c9782
commit
6ec6e7bd12
3 changed files with 155 additions and 162 deletions
|
|
@ -136,12 +136,16 @@ const fecthListTransfer = async () => {
|
||||||
const clickAdd = async () => {
|
const clickAdd = async () => {
|
||||||
router.push(`/transfer/add`)
|
router.push(`/transfer/add`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const clickBack = () => {
|
||||||
|
router.push(`/`)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="col-12 row justify-center">
|
<div class="col-12 row justify-center">
|
||||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||||
<div class="toptitle text-white col-12 row items-center">
|
<div class="toptitle text-white col-12 row items-center">
|
||||||
<q-btn icon="mdi-arrow-left" unelevated round dense flat color="primary" class="q-mr-sm" @click="router.go(-1)" />
|
<q-btn icon="mdi-arrow-left" unelevated round dense flat color="primary" class="q-mr-sm" @click="clickBack" />
|
||||||
เรื่องขอโอน
|
เรื่องขอโอน
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
<q-card bordered class="row col-12 text-dark q-mt-sm" v-if="routeName != 'AddLeave'">
|
||||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||||
<div class="q-pl-sm text-weight-bold text-dark">ผลการพิจารณาของผู้บังคับบัญชา</div>
|
<div class="q-pl-sm text-weight-bold text-dark">ผลการพิจารณาของผู้บังคับบัญชา</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -137,7 +137,7 @@
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
<q-card bordered class="row col-12 text-dark q-mt-sm" v-if="routeName != 'AddLeave'">
|
||||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||||
<div class="q-pl-sm text-weight-bold text-dark">ผลการพิจารณาของผู้มีอำนาจ</div>
|
<div class="q-pl-sm text-weight-bold text-dark">ผลการพิจารณาของผู้มีอำนาจ</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -232,6 +232,10 @@ const dataDetail = ref<any>({
|
||||||
fullname: "",
|
fullname: "",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const clickBack = () => {
|
||||||
|
router.push(`/leave`)
|
||||||
|
}
|
||||||
|
|
||||||
const statusOrder = (val: boolean) => {
|
const statusOrder = (val: boolean) => {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case true:
|
case true:
|
||||||
|
|
@ -312,6 +316,7 @@ const cancelResing = () => {
|
||||||
if (route.params.id !== undefined) {
|
if (route.params.id !== undefined) {
|
||||||
id.value = route.params.id.toString()
|
id.value = route.params.id.toString()
|
||||||
deleteResting(id.value)
|
deleteResting(id.value)
|
||||||
|
clickBack()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.onCancel(() => {})
|
.onCancel(() => {})
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,23 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar"
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted } from "vue"
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar"
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router"
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin"
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http"
|
||||||
import config from "@/app.config";
|
import config from "@/app.config"
|
||||||
import { useRestDataStore } from "@/modules/03_leave/store";
|
import { useRestDataStore } from "@/modules/03_leave/store"
|
||||||
import Table from "@/components/Table.vue";
|
import Table from "@/components/Table.vue"
|
||||||
|
|
||||||
const RestData = useRestDataStore();
|
const RestData = useRestDataStore()
|
||||||
const { statusText } = RestData;
|
const { statusText } = RestData
|
||||||
const router = useRouter();
|
const router = useRouter()
|
||||||
const $q = useQuasar();
|
const $q = useQuasar()
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin()
|
||||||
const { date2Thai, dateToISO, success, messageError, showLoader, hideLoader } =
|
const { date2Thai, dateToISO, success, messageError, showLoader, hideLoader } = mixin
|
||||||
mixin;
|
|
||||||
|
|
||||||
const filter = ref<string>("");
|
const filter = ref<string>("")
|
||||||
const visibleColumns = ref<String[]>([
|
const visibleColumns = ref<String[]>(["no", "placeLeave", "dateStartLeave", "dateLeave", "statustext"])
|
||||||
"no",
|
|
||||||
"placeLeave",
|
|
||||||
"dateStartLeave",
|
|
||||||
"dateLeave",
|
|
||||||
"statustext",
|
|
||||||
]);
|
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "no",
|
name: "no",
|
||||||
|
|
@ -71,60 +64,55 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px; width:10%;",
|
style: "font-size: 14px; width:10%;",
|
||||||
},
|
},
|
||||||
]);
|
])
|
||||||
const rows = ref<any>([]);
|
const rows = ref<any>([])
|
||||||
const initialPagination = ref({
|
const initialPagination = ref({
|
||||||
rowsPerPage: 0,
|
rowsPerPage: 0,
|
||||||
});
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fectListleave();
|
fectListleave()
|
||||||
});
|
})
|
||||||
|
|
||||||
const fectListleave = async () => {
|
const fectListleave = async () => {
|
||||||
showLoader();
|
showLoader()
|
||||||
await http
|
await http
|
||||||
.get(config.API.listUser())
|
.get(config.API.listUser())
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
// console.log(res);
|
// console.log(res);
|
||||||
let data = res.data.result;
|
let data = res.data.result
|
||||||
console.log(data);
|
console.log(data)
|
||||||
rows.value = data.map((e: any) => ({
|
rows.value = data.map((e: any) => ({
|
||||||
id: e.id,
|
id: e.id,
|
||||||
placeLeave: e.location,
|
placeLeave: e.location,
|
||||||
dateStartLeave: date2Thai(e.sendDate),
|
dateStartLeave: date2Thai(e.sendDate),
|
||||||
dateLeave: date2Thai(e.activeDate),
|
dateLeave: date2Thai(e.activeDate),
|
||||||
status:e.status,
|
status: e.status,
|
||||||
statustext:statusText(e.status),
|
statustext: statusText(e.status),
|
||||||
}));
|
}))
|
||||||
})
|
})
|
||||||
.catch((e: any) => {
|
.catch((e: any) => {
|
||||||
console.log(e);
|
console.log(e)
|
||||||
messageError($q, e);
|
messageError($q, e)
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader()
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
const clickAdd = async () => {
|
const clickAdd = async () => {
|
||||||
router.push(`/leave/add`);
|
router.push(`/leave/add`)
|
||||||
};
|
}
|
||||||
|
|
||||||
|
const clickBack = () => {
|
||||||
|
router.push(`/`)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="col-12 row justify-center">
|
<div class="col-12 row justify-center">
|
||||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||||
<div class="toptitle text-white col-12 row items-center">
|
<div class="toptitle text-white col-12 row items-center">
|
||||||
<q-btn
|
<q-btn icon="mdi-arrow-left" unelevated round dense flat color="primary" class="q-mr-sm" @click="clickBack" />
|
||||||
icon="mdi-arrow-left"
|
|
||||||
unelevated
|
|
||||||
round
|
|
||||||
dense
|
|
||||||
flat
|
|
||||||
color="primary"
|
|
||||||
class="q-mr-sm"
|
|
||||||
@click="router.go(-1)"
|
|
||||||
/>
|
|
||||||
ลาออก
|
ลาออก
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|
@ -143,22 +131,18 @@ const clickAdd = async () => {
|
||||||
:titleText="''"
|
:titleText="''"
|
||||||
>
|
>
|
||||||
<template #columns="props">
|
<template #columns="props">
|
||||||
<q-tr
|
<q-tr :props="props" class="cursor-pointer" @click="router.push(`/leave/` + props.row.id)">
|
||||||
:props="props"
|
|
||||||
class="cursor-pointer"
|
|
||||||
@click="router.push(`/leave/` + props.row.id)"
|
|
||||||
>
|
|
||||||
<q-td key="no" :props="props">
|
<q-td key="no" :props="props">
|
||||||
{{ props.rowIndex + 1 }}
|
{{ props.rowIndex + 1 }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="placeLeave" :props="props">
|
<q-td key="placeLeave" :props="props">
|
||||||
{{ props.row.placeLeave}}
|
{{ props.row.placeLeave }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="dateStartLeave" :props="props">
|
<q-td key="dateStartLeave" :props="props">
|
||||||
{{ props.row.dateStartLeave}}
|
{{ props.row.dateStartLeave }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="dateStartLeave" :props="props">
|
<q-td key="dateStartLeave" :props="props">
|
||||||
{{ props.row.dateStartLeave}}
|
{{ props.row.dateStartLeave }}
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="statustext" :props="props">
|
<q-td key="statustext" :props="props">
|
||||||
{{ props.row.statustext }}
|
{{ props.row.statustext }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue