2023-07-25 16:35:08 +07:00
|
|
|
<template>
|
|
|
|
|
<div class="toptitle text-dark col-12 row items-center">
|
2023-07-25 17:24:35 +07:00
|
|
|
<q-btn
|
|
|
|
|
icon="mdi-arrow-left"
|
|
|
|
|
unelevated
|
|
|
|
|
round
|
|
|
|
|
dense
|
|
|
|
|
flat
|
|
|
|
|
color="primary"
|
|
|
|
|
class="q-mr-sm"
|
|
|
|
|
@click="router.go(-1)"
|
|
|
|
|
/>
|
|
|
|
|
รายละเอียดการขอโอนของ {{ name }}
|
2023-07-25 16:35:08 +07:00
|
|
|
</div>
|
|
|
|
|
<q-card bordered class="row col-12 text-dark">
|
|
|
|
|
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
|
|
|
|
<div class="q-pl-sm text-weight-bold text-subtitle2">{{ name }}</div>
|
|
|
|
|
<q-space />
|
2023-07-25 17:24:35 +07:00
|
|
|
<q-btn
|
|
|
|
|
outline
|
|
|
|
|
color="blue"
|
|
|
|
|
dense
|
|
|
|
|
icon-right="mdi-open-in-new"
|
|
|
|
|
class="q-px-sm"
|
|
|
|
|
label="ดูข้อมูลทะเบียนประวัติ"
|
|
|
|
|
@click="router.push(`/registry/${personId}`)"
|
|
|
|
|
/>
|
2023-07-25 16:35:08 +07:00
|
|
|
</div>
|
2023-07-25 17:24:35 +07:00
|
|
|
<div class="col-12"><q-separator /></div>
|
2023-07-25 16:35:08 +07:00
|
|
|
<div class="row col-12 q-pa-md">
|
|
|
|
|
<div class="col-12 row bg-white q-col-gutter-md">
|
2023-07-25 17:24:35 +07:00
|
|
|
<div class="col-xs-3 col-sm-2 col-md-1 row">
|
2023-07-25 16:35:08 +07:00
|
|
|
<q-img src="@/assets/avatar_user.jpg" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-6 col-sm-3 row items-center">
|
|
|
|
|
<div class="col-12 q-pl-md">
|
|
|
|
|
<div class="col-12 text-top">ตำแหน่งในสายงาน</div>
|
2023-08-10 17:02:08 +07:00
|
|
|
<div class="col-12 text-detail">
|
|
|
|
|
{{ responseData.positionTypeOld }}
|
|
|
|
|
</div>
|
2023-07-25 16:35:08 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2023-07-26 09:16:19 +07:00
|
|
|
<div class="col-xs-6 col-sm-3 row items-center">
|
2023-07-25 16:35:08 +07:00
|
|
|
<div class="col-12">
|
|
|
|
|
<div class="col-12 text-top">ระดับ</div>
|
2023-08-10 17:02:08 +07:00
|
|
|
<div class="col-12 text-detail">
|
|
|
|
|
{{ responseData.positionLevelOld }}
|
|
|
|
|
</div>
|
2023-07-25 16:35:08 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-6 col-sm-3 row items-center">
|
|
|
|
|
<div class="col-12">
|
|
|
|
|
<div class="col-12 text-top">สังกัด</div>
|
2023-08-10 17:02:08 +07:00
|
|
|
<div class="col-12 text-detail">
|
|
|
|
|
{{ responseData.organizationPositionOld }}
|
|
|
|
|
</div>
|
2023-07-25 16:35:08 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card>
|
|
|
|
|
|
2023-07-25 17:24:35 +07:00
|
|
|
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
2023-07-25 16:35:08 +07:00
|
|
|
<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>
|
|
|
|
|
<q-space />
|
2023-07-25 17:24:35 +07:00
|
|
|
<q-btn
|
2023-08-10 17:02:08 +07:00
|
|
|
v-if="!roleAdmin"
|
2023-07-25 17:24:35 +07:00
|
|
|
outline
|
|
|
|
|
color="primary"
|
|
|
|
|
dense
|
|
|
|
|
icon-right="arrow_forward"
|
|
|
|
|
class="q-px-sm"
|
|
|
|
|
label="ส่งคำร้องไปยัง สกจ."
|
2023-08-10 17:02:08 +07:00
|
|
|
@click="confirmMessage"
|
2023-07-25 17:24:35 +07:00
|
|
|
/>
|
2023-08-04 22:15:59 +07:00
|
|
|
<q-btn
|
2023-08-10 17:02:08 +07:00
|
|
|
v-else
|
2023-08-04 22:15:59 +07:00
|
|
|
outline
|
|
|
|
|
color="primary"
|
|
|
|
|
dense
|
|
|
|
|
icon-right="download"
|
|
|
|
|
class="q-px-sm"
|
|
|
|
|
label="ดาวน์โหลด"
|
|
|
|
|
/>
|
2023-07-25 16:35:08 +07:00
|
|
|
</div>
|
2023-07-25 17:24:35 +07:00
|
|
|
<div class="col-12"><q-separator /></div>
|
2023-07-25 16:35:08 +07:00
|
|
|
<div class="row col-12 q-pa-md">
|
|
|
|
|
<div class="col-12 row bg-white q-col-gutter-md">
|
|
|
|
|
<div class="col-xs-6 col-sm-3 row items-center">
|
2023-07-25 17:24:35 +07:00
|
|
|
<div class="col-12">
|
2023-07-25 16:35:08 +07:00
|
|
|
<div class="col-12 text-top">หน่วยงานที่ขอโอนไป</div>
|
2023-08-10 17:02:08 +07:00
|
|
|
<div class="col-12 text-detail">
|
|
|
|
|
{{ responseData.organization }}
|
|
|
|
|
</div>
|
2023-07-25 16:35:08 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-6 col-sm-3 row items-center">
|
|
|
|
|
<div class="col-12">
|
2023-08-04 22:15:59 +07:00
|
|
|
<div class="col-12 text-top">เหตุผลที่ขอโอน</div>
|
2023-08-10 17:02:08 +07:00
|
|
|
<div class="col-12 text-detail">
|
|
|
|
|
{{ responseData.reason }}
|
|
|
|
|
</div>
|
2023-07-25 16:35:08 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</q-card>
|
|
|
|
|
|
|
|
|
|
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
|
|
|
|
<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>
|
2023-07-25 17:24:35 +07:00
|
|
|
<div class="col-12"><q-separator /></div>
|
|
|
|
|
<div class="col-12">
|
2023-08-10 17:02:08 +07:00
|
|
|
<d-table
|
2023-07-25 17:24:35 +07:00
|
|
|
:rows="rows"
|
|
|
|
|
:columns="columns"
|
2023-08-10 17:02:08 +07:00
|
|
|
row-key="fileName"
|
2023-07-25 17:24:35 +07:00
|
|
|
hide-header
|
|
|
|
|
hide-bottom
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:body="props">
|
|
|
|
|
<q-tr :props="props" class="cursor-pointer">
|
|
|
|
|
<q-td key="no" :props="props">
|
|
|
|
|
{{ props.rowIndex + 1 }}
|
|
|
|
|
</q-td>
|
2023-08-10 17:02:08 +07:00
|
|
|
<q-td key="fileName" :props="props">
|
|
|
|
|
{{ props.row.fileName }}
|
2023-07-25 17:24:35 +07:00
|
|
|
</q-td>
|
|
|
|
|
<q-td key="btnMicrosoft" :props="props">
|
2023-08-10 17:02:08 +07:00
|
|
|
<q-btn flat dense round color="red" icon="picture_as_pdf">
|
2023-07-25 17:24:35 +07:00
|
|
|
<q-tooltip>ไฟล์ PDF</q-tooltip>
|
|
|
|
|
</q-btn>
|
2023-08-10 17:02:08 +07:00
|
|
|
<q-btn flat dense round color="blue" icon="mdi-file-word">
|
2023-07-25 17:24:35 +07:00
|
|
|
<q-tooltip>ไฟล์ WORD</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
2023-08-10 17:02:08 +07:00
|
|
|
</d-table>
|
2023-07-25 16:35:08 +07:00
|
|
|
</div>
|
|
|
|
|
</q-card>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
2023-08-04 22:15:59 +07:00
|
|
|
import { onMounted, ref } from "vue";
|
2023-08-10 17:02:08 +07:00
|
|
|
import { useQuasar } from "quasar";
|
|
|
|
|
import { useRoute, useRouter } from "vue-router";
|
|
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
|
|
|
|
|
|
|
|
|
import http from "@/plugins/http";
|
|
|
|
|
import config from "@/app.config";
|
2023-08-04 22:15:59 +07:00
|
|
|
import keycloak from "@/plugins/keycloak";
|
|
|
|
|
|
2023-08-10 17:02:08 +07:00
|
|
|
import type { QTableProps } from "quasar";
|
|
|
|
|
import type {
|
|
|
|
|
TypeFile,
|
|
|
|
|
ResponseDataDetail,
|
|
|
|
|
} from "@/modules/05_placement/interface/response/Transfer";
|
2023-07-25 16:35:08 +07:00
|
|
|
|
2023-08-10 17:02:08 +07:00
|
|
|
const $q = useQuasar();
|
|
|
|
|
const route = useRoute();
|
2023-07-25 16:35:08 +07:00
|
|
|
const router = useRouter();
|
2023-08-10 17:02:08 +07:00
|
|
|
const mixin = useCounterMixin();
|
|
|
|
|
|
|
|
|
|
const personId = route.params.id;
|
|
|
|
|
const {
|
|
|
|
|
date2Thai,
|
|
|
|
|
dialogMessage,
|
|
|
|
|
messageError,
|
|
|
|
|
showLoader,
|
|
|
|
|
hideLoader,
|
|
|
|
|
success,
|
|
|
|
|
} = mixin;
|
|
|
|
|
|
|
|
|
|
const roleAdmin = ref<boolean>(false);
|
|
|
|
|
|
2023-07-25 17:24:35 +07:00
|
|
|
const name = ref<string>("นายสมคิด ยอดใจ");
|
|
|
|
|
const position = ref<string>("นักจัดการงานทั่วไป");
|
|
|
|
|
const level = ref<string>("ชำนาญการพิเศษ");
|
|
|
|
|
const institution = ref<string>("ฝ่ายบริหารงานทั่วไป");
|
|
|
|
|
const status = ref<string>("อยู่ระหว่างการทดลองงาน");
|
|
|
|
|
const organization = ref<string>("ก.ก.");
|
|
|
|
|
const reason = ref<string>("เพราะxxx");
|
2023-08-10 17:02:08 +07:00
|
|
|
|
|
|
|
|
const responseData = ref<ResponseDataDetail>({
|
|
|
|
|
createdAt: new Date(),
|
|
|
|
|
date: new Date(),
|
|
|
|
|
id: "",
|
|
|
|
|
organization: "",
|
|
|
|
|
organizationPositionOld: "",
|
|
|
|
|
positionLevelOld: "",
|
|
|
|
|
positionNumberOld: "",
|
|
|
|
|
positionTypeOld: "",
|
|
|
|
|
reason: "",
|
|
|
|
|
salary: 0,
|
|
|
|
|
status: "",
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const rows = ref<TypeFile[]>([]);
|
|
|
|
|
const columns = ref<QTableProps["columns"]>([
|
2023-07-25 17:24:35 +07:00
|
|
|
{
|
|
|
|
|
name: "no",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ลำดับ",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "no",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-08-10 17:02:08 +07:00
|
|
|
name: "fileName",
|
2023-07-25 17:24:35 +07:00
|
|
|
align: "left",
|
2023-08-10 17:02:08 +07:00
|
|
|
label: "ชื่อไฟล์",
|
2023-07-25 17:24:35 +07:00
|
|
|
sortable: true,
|
2023-08-10 17:02:08 +07:00
|
|
|
field: "fileName",
|
2023-07-25 17:24:35 +07:00
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "btnMicrosoft",
|
|
|
|
|
align: "right",
|
|
|
|
|
label: "ปุ่ม",
|
|
|
|
|
sortable: true,
|
|
|
|
|
field: "btnMicrosoft",
|
|
|
|
|
headerStyle: "font-size: 14px",
|
|
|
|
|
style: "font-size: 14px",
|
|
|
|
|
},
|
2023-08-10 17:02:08 +07:00
|
|
|
]);
|
2023-08-04 22:15:59 +07:00
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
if (keycloak.tokenParsed != null) {
|
2023-08-10 17:02:08 +07:00
|
|
|
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
|
|
|
|
|
console.log("roleAdmin===>", roleAdmin.value);
|
|
|
|
|
}
|
|
|
|
|
await getData();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const getData = async () => {
|
|
|
|
|
showLoader();
|
|
|
|
|
await http
|
|
|
|
|
.get(config.API.transferUserId(personId.toString()))
|
|
|
|
|
.then((res: any) => {
|
|
|
|
|
const data = res.data.result;
|
|
|
|
|
// console.log(data);
|
|
|
|
|
let list: TypeFile[] = [];
|
|
|
|
|
if (data.docs.length > 0) {
|
|
|
|
|
data.docs.map((doc: TypeFile) => {
|
|
|
|
|
list.push({
|
|
|
|
|
pathName: doc.pathName ?? "",
|
|
|
|
|
fileName: doc.fileName ?? "",
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
rows.value = list;
|
|
|
|
|
responseData.value.createdAt = data.createdAt;
|
|
|
|
|
responseData.value.date = new Date();
|
|
|
|
|
responseData.value.id = data.id ?? "";
|
|
|
|
|
responseData.value.organization = data.organization ?? "";
|
|
|
|
|
responseData.value.organizationPositionOld =
|
|
|
|
|
data.organizationPositionOld ?? "";
|
|
|
|
|
responseData.value.positionLevelOld = data.positionLevelOld ?? "";
|
|
|
|
|
responseData.value.positionNumberOld = data.positionNumberOld ?? "";
|
|
|
|
|
responseData.value.positionTypeOld = data.positionTypeOld ?? "";
|
|
|
|
|
responseData.value.reason = data.reason ?? "";
|
|
|
|
|
responseData.value.salary = data.salary !== null ? data.salary : 0;
|
|
|
|
|
responseData.value.status = data.status ?? "";
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const confirmMessage = async () => {
|
|
|
|
|
dialogMessage(
|
|
|
|
|
$q,
|
|
|
|
|
"ต้องการยืนยันส่งคำร้องไปยัง สกจ หรือไม่?",
|
|
|
|
|
"ข้อมูลจะถูกนำส่งคำร้องไปยัง สกจ ทันที",
|
|
|
|
|
"mdi-help-circle-outline",
|
|
|
|
|
"ยืนยัน",
|
|
|
|
|
"primary",
|
|
|
|
|
() => sendConfirm(),
|
|
|
|
|
undefined
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const sendConfirm = async () => {
|
|
|
|
|
showLoader();
|
|
|
|
|
await http
|
|
|
|
|
.get(config.API.transferConfirmId(personId.toString()))
|
|
|
|
|
.then((res: any) => {
|
|
|
|
|
// const data = res.data.result;
|
|
|
|
|
// console.log(data);
|
|
|
|
|
success($q, "ส่งคำร้องข้อมูลสำเร็จ");
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(async () => {
|
|
|
|
|
await getData();
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
};
|
2023-07-25 16:35:08 +07:00
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scope>
|
|
|
|
|
.q-img {
|
2023-07-25 17:24:35 +07:00
|
|
|
border-radius: 5px;
|
|
|
|
|
height: 70px;
|
2023-07-25 16:35:08 +07:00
|
|
|
}
|
2023-07-25 17:24:35 +07:00
|
|
|
.text-top {
|
|
|
|
|
color: gray;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
padding-bottom: 3px;
|
2023-07-25 16:35:08 +07:00
|
|
|
}
|
2023-07-25 17:24:35 +07:00
|
|
|
.text-detail {
|
|
|
|
|
font-weight: 500;
|
2023-07-25 16:35:08 +07:00
|
|
|
}
|
2023-07-25 17:24:35 +07:00
|
|
|
</style>
|