"Refactoring code module 05_placement 01_Main,02_transferMain,03_receiveMain
This commit is contained in:
parent
131f8ff499
commit
24a4dac091
21 changed files with 534 additions and 1368 deletions
|
|
@ -58,7 +58,7 @@ const visibleColumns = ref<string[]>([
|
|||
"citizenId",
|
||||
"fullname",
|
||||
"organizationName",
|
||||
"birthday",
|
||||
"dateOfBirth",
|
||||
"createdAt",
|
||||
"status",
|
||||
]);
|
||||
|
|
@ -106,11 +106,11 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "birthday",
|
||||
name: "dateOfBirth",
|
||||
align: "left",
|
||||
label: "วัน/เดือน/ปี เกิด",
|
||||
sortable: true,
|
||||
field: "birthday",
|
||||
field: "dateOfBirth",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
<script setup lang="ts">
|
||||
/** รับค่ามาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
title: String,
|
||||
close: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
});
|
||||
|
||||
/** ปิด dialog*/
|
||||
const close = async () => {
|
||||
props.close();
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<q-toolbar class="q-py-md">
|
||||
<q-toolbar-title class="header-text">{{ title }}</q-toolbar-title>
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="close"
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
</q-toolbar>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.header-text {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
line-height: 26px;
|
||||
color: #35373c;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,756 +0,0 @@
|
|||
<script setup lang="ts">
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import { onMounted, reactive, ref, watch } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const {
|
||||
date2Thai,
|
||||
hideLoader,
|
||||
messageError,
|
||||
showLoader,
|
||||
success,
|
||||
dialogConfirm,
|
||||
} = mixin; //ฟังก์ชันกลางที่เรียกใช้
|
||||
|
||||
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
||||
const noData = ref<string>("ไม่พบข้อมูลผังโครงสร้าง");
|
||||
|
||||
const checkValidate = ref<boolean>(false);
|
||||
const myFormPosition = ref<any>();
|
||||
const selected = ref<string>("");
|
||||
const selectedFile = ref<string>("");
|
||||
const dataRespone = ref<any>();
|
||||
const search = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
const personal = ref<any>();
|
||||
const expanded = ref<string[]>([]);
|
||||
const editDataStatus = ref<boolean>(false);
|
||||
const placementPosition = ref<any>([]);
|
||||
const treeData = ref<Array<any>>([]);
|
||||
|
||||
// ตำแหน่งเลขที่
|
||||
const posNoOptions = ref<Object[]>([{ label: "", value: "" }]);
|
||||
// ตำแหน่ง
|
||||
const positionOptions = ref<Object[]>([{ label: "", value: "" }]);
|
||||
// ด้าน/สาขา
|
||||
const positionPathSideOptions = ref<Object[]>([{ label: "", value: "" }]);
|
||||
// ประเภทตำแหน่ง
|
||||
const positionTypeOptions = ref<Object[]>([{ label: "", value: "" }]);
|
||||
// สายงาน
|
||||
const positionLineOptions = ref<Object[]>([{ label: "", value: "" }]);
|
||||
// ระดับ
|
||||
const positionLevelOptions = ref<Object[]>([{ label: "", value: "" }]);
|
||||
|
||||
/** กำหนดตัวแปร เเบบ ออปเจ็ค */
|
||||
let dataForm = reactive({
|
||||
personalId: "",
|
||||
containDate: new Date(),
|
||||
posNoId: "",
|
||||
positionId: "",
|
||||
positionLevelId: "",
|
||||
positionLineId: "",
|
||||
positionPathSideId: "",
|
||||
positionTypeId: "",
|
||||
});
|
||||
|
||||
/** ฟังชั่น get file*/
|
||||
// async function fetchPublishFile() {
|
||||
// await http
|
||||
// .get(config.API.getPublishFileHistory)
|
||||
// .then((res) => {
|
||||
// let data = res.data.result;
|
||||
// selectedFile.value = data[0].fileName;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// }
|
||||
|
||||
/** โหลดข้อมูลโครงสร้างจาก json */
|
||||
// const loadTreeData = async () => {
|
||||
// expanded.value = [];
|
||||
// await http
|
||||
// .get(`${config.s3ClusterUrl}${selectedFile.value}`)
|
||||
// .then((res: any) => {
|
||||
// treeData.value = res.data;
|
||||
// dataRespone.value = res.data;
|
||||
|
||||
// // Filter objects with "name" null
|
||||
// const filteredData = res.data.filter(filterByPersonIdNull);
|
||||
// treeData.value = filteredData;
|
||||
// })
|
||||
// .catch((e: any) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// };
|
||||
|
||||
/**
|
||||
* ฟังก์ชันกรองข้อมูลที่ personId เป็น null
|
||||
* @param obj ข้อมูลที่จะถูกกรอง
|
||||
* @returns {boolean} ผลลัพธ์ของการกรองข้อมูล
|
||||
*/
|
||||
function filterByPersonIdNull(obj: any) {
|
||||
if (obj.name === null && obj.isCondition != true) {
|
||||
return true;
|
||||
}
|
||||
if (obj.children && obj.children.length > 0) {
|
||||
obj.children = obj.children.filter(filterByPersonIdNull);
|
||||
return obj.children.length > 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**get data ตำแหน่งงาน */
|
||||
// async function fetchplacementPosition() {
|
||||
// await http
|
||||
// .get(config.API.placementPosition())
|
||||
// .then((res: any) => {
|
||||
// placementPosition.value = res.data.result;
|
||||
// })
|
||||
// .catch((e: any) => {
|
||||
// messageError($q, e);
|
||||
// });
|
||||
// }
|
||||
|
||||
/** รับค่ามาจาก หน้าหลัก*/
|
||||
const props = defineProps({
|
||||
personalId: String,
|
||||
modal: Boolean,
|
||||
close: {
|
||||
type: Function,
|
||||
default: () => console.log("close modal"),
|
||||
},
|
||||
personal: Object,
|
||||
});
|
||||
|
||||
/**
|
||||
* ฟังก์ชันกรองข้อมูลหน่วยงาน
|
||||
* @param node ข้อมูลที่จะถูกกรอง
|
||||
* @param filter ข้อความที่ใช้ในการกรองข้อมูล
|
||||
* @returns {boolean} ผลลัพธ์ของการกรองข้อมูล
|
||||
*/
|
||||
function myFilterMethod(node: any, filter: string) {
|
||||
const filt = filter;
|
||||
return (
|
||||
// ((node.name && node.name == null) || !node.name) &&
|
||||
(node.name && node.name.indexOf(filt) > -1) ||
|
||||
(node.organizationName && node.organizationName.indexOf(filt) > -1) ||
|
||||
(node.positionNum && node.positionNum.indexOf(filt) > -1) ||
|
||||
(node.positionName && node.positionName.indexOf(filt) > -1) ||
|
||||
(node.governmentCode &&
|
||||
node.governmentCode.toString().indexOf(filt) > -1) ||
|
||||
(node.agency && node.agency.indexOf(filt) > -1) ||
|
||||
(node.government && node.government.indexOf(filt) > -1) ||
|
||||
(node.department && node.department.indexOf(filt) > -1) ||
|
||||
(node.pile && node.pile.indexOf(filt) > -1) ||
|
||||
(node.organizationShortName &&
|
||||
node.organizationShortName.indexOf(filt) > -1) ||
|
||||
(node.positionSideName && node.positionSideName.indexOf(filt) > -1) ||
|
||||
(node.executivePosition && node.executivePosition.indexOf(filt) > -1) ||
|
||||
(node.executivePositionSide &&
|
||||
node.executivePositionSide.indexOf(filt) > -1) ||
|
||||
(node.positionLevel && node.positionLevel.indexOf(filt) > -1)
|
||||
);
|
||||
}
|
||||
|
||||
/** validate */
|
||||
async function validateData() {
|
||||
checkValidate.value = true;
|
||||
await myFormPosition.value.validate().then((result: boolean) => {
|
||||
if (result == false) {
|
||||
checkValidate.value = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** ยืนยันการเลือกหน่วยงาน */
|
||||
async function saveAppoint() {
|
||||
myFormPosition.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
const dataAppoint = await {
|
||||
personalId: props.personalId,
|
||||
containDate: dataForm.containDate,
|
||||
posNoId: dataForm.posNoId,
|
||||
positionId: dataForm.positionId,
|
||||
positionLevelId: dataForm.positionLevelId,
|
||||
positionLineId: dataForm.positionLineId,
|
||||
positionPathSideId: dataForm.positionPathSideId,
|
||||
positionTypeId: dataForm.positionTypeId,
|
||||
};
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.placementPass(), dataAppoint)
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await closeAndClear();
|
||||
// await fetchPublishFile();
|
||||
// await loadTreeData();
|
||||
// await fetchplacementPosition();
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** ปิด dialog */
|
||||
function closeModal() {
|
||||
if (editDataStatus.value == true) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => closeAndClear(),
|
||||
"ข้อมูลมีการแก้ไข",
|
||||
"ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่"
|
||||
);
|
||||
} else {
|
||||
closeAndClear();
|
||||
}
|
||||
}
|
||||
/** clean ข้อมูล */
|
||||
async function closeAndClear() {
|
||||
await props.close();
|
||||
editDataStatus.value = false;
|
||||
selected.value = "";
|
||||
dataForm.personalId = "";
|
||||
dataForm.containDate = new Date();
|
||||
dataForm.posNoId = "";
|
||||
dataForm.positionId = "";
|
||||
dataForm.positionLevelId = "";
|
||||
dataForm.positionLineId = "";
|
||||
dataForm.positionPathSideId = "";
|
||||
dataForm.positionTypeId = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* เลือกหน่วยงาน
|
||||
* @param data ข้อมูลตำเเหน่งงาน
|
||||
*/
|
||||
async function selectedPosition(data: any) {
|
||||
if (data.name == null && selected.value != data.keyId) {
|
||||
editDataStatus.value = true;
|
||||
selected.value = data.keyId;
|
||||
|
||||
// posNo Options
|
||||
posNoOptions.value = [
|
||||
{
|
||||
label: data.positionNum,
|
||||
value: data.positionNumId,
|
||||
},
|
||||
];
|
||||
dataForm.posNoId = data.positionNumId;
|
||||
|
||||
// position Options
|
||||
positionOptions.value = [
|
||||
{
|
||||
label: data.positionName,
|
||||
value: data.positionNameId,
|
||||
},
|
||||
];
|
||||
dataForm.positionId = data.positionNameId;
|
||||
|
||||
// positionPathSide Options
|
||||
let positionPathSideArr: any = [];
|
||||
if (data.positionSideNameObj && data.positionSideNameObj != null) {
|
||||
data.positionSideNameObj.map((x: any) => {
|
||||
positionPathSideArr.push({
|
||||
label: x.Name,
|
||||
value: x.Id,
|
||||
});
|
||||
});
|
||||
positionPathSideOptions.value = positionPathSideArr;
|
||||
dataForm.positionPathSideId =
|
||||
positionPathSideArr.length > 1 || positionPathSideArr.length == 0
|
||||
? ""
|
||||
: positionPathSideArr[0].value;
|
||||
}
|
||||
|
||||
// positionType Options
|
||||
positionTypeOptions.value = [
|
||||
{
|
||||
label: data.positionType,
|
||||
value: data.positionTypeId,
|
||||
},
|
||||
];
|
||||
dataForm.positionTypeId = data.positionTypeId;
|
||||
|
||||
// positionLine Options
|
||||
positionLineOptions.value = [
|
||||
{
|
||||
label: data.positionLine,
|
||||
value: data.positionLineId,
|
||||
},
|
||||
];
|
||||
dataForm.positionLineId = data.positionLineId;
|
||||
|
||||
// positionLevel Options
|
||||
let positionLevelsArr: any = [];
|
||||
if (data.positionLevelObj != null) {
|
||||
data.positionLevelObj.map((x: any) => {
|
||||
positionLevelsArr.push({
|
||||
label: x.Name,
|
||||
value: x.Id,
|
||||
});
|
||||
});
|
||||
positionLevelOptions.value = positionLevelsArr;
|
||||
dataForm.positionLevelId =
|
||||
positionLevelsArr.length > 1 || positionLevelsArr.length == 0
|
||||
? ""
|
||||
: positionLevelsArr[0].value;
|
||||
dataForm.positionLevelId = data.positionLevelObj[0].Id;
|
||||
}
|
||||
} else if (selected.value == data.keyId) {
|
||||
selected.value = "";
|
||||
dataForm.posNoId = "";
|
||||
dataForm.positionId = "";
|
||||
dataForm.positionLevelId = "";
|
||||
dataForm.positionLineId = "";
|
||||
dataForm.positionPathSideId = "";
|
||||
dataForm.positionTypeId = "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* เช็คตำแหน่ง งาน
|
||||
* @param val id ตำแหน่ง
|
||||
*/
|
||||
function checkPosition(val: string) {
|
||||
const num = placementPosition.value.findIndex((e: string) => e === val);
|
||||
return num;
|
||||
}
|
||||
|
||||
/**
|
||||
* หาหน่วยงานที่เลือก
|
||||
* @param element
|
||||
*/
|
||||
function findByPerson(element: any): any {
|
||||
if (
|
||||
element.positionNumId &&
|
||||
element.positionLineId === personal.value.positionLineId &&
|
||||
element.positionTypeId === personal.value.positionTypeId &&
|
||||
element.positionNumId === personal.value.posNoId &&
|
||||
(element.positionLevelObj === null ||
|
||||
element.positionLevelObj[0].Id === personal.value.positionLevelId)
|
||||
) {
|
||||
return element;
|
||||
} else if (element.children) {
|
||||
var i;
|
||||
var result = null;
|
||||
for (i = 0; result == null && i < element.children.length; i++) {
|
||||
result = findByPerson(element.children[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/** ยืนยันการคืนตำแหน่ง */
|
||||
function clearPosition() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => postClearPosition(),
|
||||
"ยืนยันการคืนตำแหน่ง",
|
||||
"ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
|
||||
/** คืนตำแหน่ง */
|
||||
async function postClearPosition() {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.clearPosition(personal.value.personalId), {})
|
||||
.then(() => {
|
||||
success($q, "คืนตำแหน่งสำเร็จ");
|
||||
})
|
||||
.catch((e: Object) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await closeAndClear();
|
||||
});
|
||||
}
|
||||
|
||||
/** เมื่อ props เปลี่ยนแปลงจะโหลดหน่วยงาน */
|
||||
watch(props, () => {
|
||||
expanded.value = [];
|
||||
const dataPersonal = props.personal;
|
||||
// fetchplacementPosition();
|
||||
if (dataPersonal) {
|
||||
dataPersonal.map((data: any) => {
|
||||
personal.value = data;
|
||||
});
|
||||
}
|
||||
if (
|
||||
personal.value &&
|
||||
personal.value.draft === false &&
|
||||
personal.value.positionNumber !== null
|
||||
) {
|
||||
let findData: any = null;
|
||||
dataRespone.value.map((x: any) => {
|
||||
findData = findByPerson(x);
|
||||
// ถ้ามีตำแต่งจะทำการ expandedTree
|
||||
if (findData != null) {
|
||||
selectedPosition(findData);
|
||||
for (let i = 3; i <= findData.keyId.length; i += 2) {
|
||||
expanded.value.push(findData.keyId.slice(0, i));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
// await fetchPublishFile();
|
||||
// await loadTreeData();
|
||||
// await fetchplacementPosition();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-dialog v-model="props.modal" persistent>
|
||||
<q-card style="width: 900px; max-width: 80vw">
|
||||
<q-form ref="myFormPosition">
|
||||
<DialogHeader tittle="เลือกหน่วยงานที่รับบรรจุ" :close="closeModal" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-pa-sm bg-grey-1">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div class="col-xs-12 col-sm-7 row">
|
||||
<q-card flat bordered class="fit q-pa-sm">
|
||||
<q-scroll-area visible style="height: 70vh">
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
ref="filterRef"
|
||||
v-model="search"
|
||||
placeholder="ค้นหา"
|
||||
class="q-mb-sm"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="mdi-magnify" />
|
||||
</template>
|
||||
</q-input>
|
||||
<div class="q-pa-sm q-gutter-sm">
|
||||
<q-tree
|
||||
no-transition
|
||||
dense
|
||||
:nodes="treeData"
|
||||
node-key="keyId"
|
||||
:filter="search"
|
||||
:no-results-label="notFound"
|
||||
:no-nodes-label="noData"
|
||||
:filter-method="myFilterMethod"
|
||||
v-model:expanded="expanded"
|
||||
>
|
||||
<template v-slot:header-organization="prop">
|
||||
<div class="col">
|
||||
<div
|
||||
class="row items-center q-px-xs q-pt-xs q-gutter-sm"
|
||||
>
|
||||
<!--แสดงชื่อแผนก พิมพ์ตัวหนา คลิกแล้วกาง/หุบ Tree-->
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.organizationName }}
|
||||
</div>
|
||||
|
||||
<!--แสดง Total Count PositionNum-->
|
||||
<q-badge
|
||||
v-if="prop.node.totalPositionVacant > 0"
|
||||
rounded
|
||||
color="red"
|
||||
outline
|
||||
:label="prop.node.totalPositionVacant"
|
||||
/>
|
||||
|
||||
<q-space />
|
||||
</div>
|
||||
<div class="col items-center q-px-xs q-pt-xs">
|
||||
<div class="text-weight-medium text-grey-7">
|
||||
{{ prop.node.governmentCode }}
|
||||
{{ prop.node.organizationShortName }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-slot:header-person="prop">
|
||||
<q-item
|
||||
clickable
|
||||
:active="selected == prop.node.keyId"
|
||||
@click="selectedPosition(prop.node)"
|
||||
:disable="
|
||||
prop.node.name != null ||
|
||||
checkPosition(prop.node.positionNumId) != -1
|
||||
"
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
class="row items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
>
|
||||
<img
|
||||
v-if="
|
||||
prop.node.avatar == '' ||
|
||||
prop.node.avatar ==
|
||||
'https://cdn.quasar.dev/img/boy-avatar.png'
|
||||
"
|
||||
src="@/assets/avatar_user.jpg"
|
||||
class="col-xs-1 col-sm-2"
|
||||
style="
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
"
|
||||
/>
|
||||
<img
|
||||
v-else
|
||||
:src="prop.node.avatar"
|
||||
class="col-xs-1 col-sm-2"
|
||||
style="
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
"
|
||||
/>
|
||||
<!--=====ตำแหน่งว่าง สีแดง=====-->
|
||||
<div
|
||||
v-if="prop.node.name == null"
|
||||
class="q-px-sm text-weight-medium text-red"
|
||||
>
|
||||
ว่าง
|
||||
</div>
|
||||
<!--=====หัวหน้า สีเขียว=====-->
|
||||
<div v-else-if="prop.node.positionLeaderFlag">
|
||||
<div
|
||||
class="q-px-sm text-weight-medium text-primary"
|
||||
>
|
||||
{{ prop.node.name }}
|
||||
</div>
|
||||
</div>
|
||||
<!--=====ลูกน้อง สีปกติ=====-->
|
||||
<div v-else>
|
||||
<div class="q-px-sm text-weight-medium">
|
||||
{{ prop.node.name }}
|
||||
</div>
|
||||
</div>
|
||||
<!--ต่อท้ายชื่อคน แสดงสีปกติ-->
|
||||
<div class="q-pr-sm">
|
||||
{{ prop.node.positionName }}
|
||||
</div>
|
||||
<div class="q-pr-sm">
|
||||
{{ prop.node.positionNum }}
|
||||
</div>
|
||||
<div class="q-pr-sm">
|
||||
{{ prop.node.positionLevel }}
|
||||
</div>
|
||||
<q-icon
|
||||
v-if="prop.node.positionLeaderFlag"
|
||||
class="q-mr-sm"
|
||||
size="15px"
|
||||
color="primary"
|
||||
name="mdi-bookmark"
|
||||
></q-icon>
|
||||
|
||||
<q-space />
|
||||
</q-item>
|
||||
</template>
|
||||
</q-tree>
|
||||
</div>
|
||||
</q-scroll-area>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-5">
|
||||
<q-card flat bordered class="fit q-pa-sm">
|
||||
<q-scroll-area visible style="height: 70vh">
|
||||
<div class="row col-12 q-col-gutter-xs">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12"></div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dataForm.containDate"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="full-width inputgreen cursor-pointer"
|
||||
outlined
|
||||
dense
|
||||
:model-value="
|
||||
date2Thai(new Date(dataForm.containDate))
|
||||
"
|
||||
:rules="[ (val: string) =>!!val ||`${'วันที่รายงานตัว'}`,
|
||||
]"
|
||||
:label="`${'วันที่รายงานตัว'}`"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<q-space />
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
outlined
|
||||
standout
|
||||
dense
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
:options="posNoOptions"
|
||||
v-model="dataForm.posNoId"
|
||||
:label="`${'ตำแหน่งเลขที่'}`"
|
||||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
outlined
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
standout
|
||||
dense
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
:options="positionOptions"
|
||||
v-model="dataForm.positionId"
|
||||
:label="`${'ตำแหน่ง'}`"
|
||||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
outlined
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
standout
|
||||
dense
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
:options="positionPathSideOptions"
|
||||
v-model="dataForm.positionPathSideId"
|
||||
:label="`${'ด้าน/สาขา'}`"
|
||||
map-options
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
outlined
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
standout
|
||||
dense
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
:options="positionTypeOptions"
|
||||
v-model="dataForm.positionTypeId"
|
||||
:label="`${'ประเภทตำแหน่ง'}`"
|
||||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
outlined
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
standout
|
||||
dense
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
:options="positionLineOptions"
|
||||
v-model="dataForm.positionLineId"
|
||||
:label="`${'สายงาน'}`"
|
||||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-select
|
||||
outlined
|
||||
class="full-width inputgreen cursor-pointer custom-input"
|
||||
standout
|
||||
dense
|
||||
lazy-rules
|
||||
:options="positionLevelOptions"
|
||||
v-model="dataForm.positionLevelId"
|
||||
:label="`${'ระดับ'}`"
|
||||
hide-bottom-space
|
||||
:rules="[(val: string) => !!val || `${'กรุณาเลือกระดับ'}`]"
|
||||
emit-value
|
||||
map-options
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="col-xs-12 col-sm-12 col-md-12 q-pa-lg"
|
||||
v-if="personal.positionNumber"
|
||||
>
|
||||
<div class="row">
|
||||
<div class="col-md-4 offset-md-4">
|
||||
<q-btn
|
||||
color="grey"
|
||||
label="คืนตำแหน่ง"
|
||||
@click="clearPosition"
|
||||
></q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-scroll-area>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-separator />
|
||||
<DialogFooter
|
||||
:editvisible="true"
|
||||
:validate="validateData"
|
||||
:save="saveAppoint"
|
||||
v-model:modalEdit="editDataStatus"
|
||||
/>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.q-tree__node-header {
|
||||
padding: 0px;
|
||||
margin-top: 0px;
|
||||
border-radius: 4px;
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.my-list-link {
|
||||
color: rgb(118, 168, 222);
|
||||
border-radius: 5px;
|
||||
background: #a3d3fb48 !important;
|
||||
font-weight: 600;
|
||||
border: 1px solid rgba(175, 185, 196, 0.217);
|
||||
/* box-shadow: 1px 1px 7px 1px rgba(41, 95, 255, 0.15) !important; */
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { defineAsyncComponent } from "@vue/runtime-core";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import cardTop from "@/modules/05_placement/components/PersonalList/StatCard.vue";
|
||||
import { tokenParsed } from "@/plugins/auth";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -12,6 +10,9 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import { useQuasar } from "quasar";
|
||||
import { usePlacementDataStore } from "@/modules/05_placement/store";
|
||||
|
||||
import CardTop from "@/modules/05_placement/components/PersonalList/StatCard.vue";
|
||||
import AddTablePosition from "@/modules/05_placement/components/PersonalList/Table.vue";
|
||||
|
||||
const DataStore = usePlacementDataStore();
|
||||
|
||||
let roleAdmin = ref<boolean>(false);
|
||||
|
|
@ -25,9 +26,7 @@ const year = ref<string>("");
|
|||
const round = ref<string>("");
|
||||
const title = ref<string>("");
|
||||
const examData = ref<any>();
|
||||
const AddTablePosition = defineAsyncComponent(
|
||||
() => import("@/modules/05_placement/components/PersonalList/Table.vue")
|
||||
);
|
||||
|
||||
const stat = ref<any>({
|
||||
total: 0,
|
||||
unContain: 0,
|
||||
|
|
@ -116,28 +115,28 @@ onMounted(async () => {
|
|||
<div class="col-12 row bg-white">
|
||||
<div class="fit q-px-md q-py-sm">
|
||||
<div class="row col-12 q-col-gutter-md fit">
|
||||
<cardTop
|
||||
<CardTop
|
||||
:amount="stat.total"
|
||||
label="จำนวนทั้งหมด"
|
||||
color="#016987"
|
||||
/>
|
||||
<cardTop
|
||||
<CardTop
|
||||
v-if="roleAdmin"
|
||||
:amount="stat.unContain"
|
||||
label="จำนวนที่ยังไม่บรรจุ"
|
||||
color="#02A998"
|
||||
/>
|
||||
<cardTop
|
||||
<CardTop
|
||||
:amount="stat.prepareContain"
|
||||
label="จำนวนที่เตรียมบรรจุ"
|
||||
color="#2EA0FF"
|
||||
/>
|
||||
<cardTop
|
||||
<CardTop
|
||||
:amount="stat.contain"
|
||||
label="จำนวนที่บรรจุแล้ว"
|
||||
color="#4154B3"
|
||||
/>
|
||||
<cardTop
|
||||
<CardTop
|
||||
:amount="stat.disclaim"
|
||||
label="จำนวนที่สละสิทธิ์"
|
||||
color="#FF5C5F"
|
||||
|
|
@ -1,26 +1,26 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch, reactive, computed } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import { useRoute } from "vue-router";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { tokenParsed } from "@/plugins/auth";
|
||||
import router from "@/router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import avatar from "@/assets/avatar_user.jpg";
|
||||
|
||||
import type { PartialTableName } from "@/modules/05_placement/interface/request/placement";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { DataList } from "@/modules/05_placement/interface/response/SelectOrg";
|
||||
|
||||
import DialogSelectOrg from "@/modules/05_placement/components/PersonalList/DialogSelectOrg.vue";
|
||||
|
||||
import Table from "@/modules/05_placement/components/PersonalList/TableView.vue";
|
||||
import DialogCard from "@/modules/05_placement/components/PersonalList/TableDetail.vue";
|
||||
import DialogCard from "@/modules/05_placement/components/PersonalList/DialogDetail.vue";
|
||||
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import type { PartialTableName } from "@/modules/05_placement/interface/request/placement";
|
||||
import DialogOrgTree from "@/modules/05_placement/components/PersonalList/OrgTree.vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import router from "@/router";
|
||||
import avatar from "@/assets/avatar_user.jpg";
|
||||
import { tokenParsed } from "@/plugins/auth";
|
||||
|
||||
let roleAdmin = ref<boolean>(false);
|
||||
|
||||
|
|
@ -1169,7 +1169,6 @@ onMounted(async () => {
|
|||
</Table>
|
||||
</q-form>
|
||||
|
||||
<!-- เลือกหน่วยงานที่บรรจุ -->
|
||||
<DialogOrgTree
|
||||
v-model:modal="appointModal"
|
||||
:personalId="personalId"
|
||||
|
|
@ -1511,6 +1510,7 @@ onMounted(async () => {
|
|||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<!-- เลือกหน่วยงานที่บรรจุ -->
|
||||
<DialogSelectOrg
|
||||
v-model:modal="modalDialogSelectOrg"
|
||||
:dataRow="dataRow"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import { onMounted, reactive, ref, watch } from "vue";
|
||||
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -426,7 +427,7 @@ function findByPerson(element: any): any {
|
|||
<q-dialog v-model="props.modal" persistent>
|
||||
<q-card style="width: 900px; max-width: 80vw">
|
||||
<q-form ref="myFormPosition">
|
||||
<DialogHeader title="เลือกหน่วยงานที่รับย้าย" :close="closeModal" />
|
||||
<DialogHeader tittle="เลือกหน่วยงานที่รับย้าย" :close="closeModal" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-pa-sm bg-grey-1">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
|
|
|
|||
|
|
@ -1,21 +1,20 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed, watchEffect } from "vue";
|
||||
import { ref, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { ResponseData } from "@/modules/05_placement/interface/response/Transfer";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const transferStore = useTransferDataStore();
|
||||
const { statusText } = transferStore;
|
||||
|
||||
const $q = useQuasar();
|
||||
const selected = ref<ResponseData[]>([]);
|
||||
const mixin = useCounterMixin();
|
||||
const { statusText } = useTransferDataStore();
|
||||
const {
|
||||
showLoader,
|
||||
success,
|
||||
|
|
@ -25,7 +24,19 @@ const {
|
|||
date2Thai,
|
||||
} = mixin;
|
||||
|
||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
/**
|
||||
* props
|
||||
*/
|
||||
const props = defineProps({
|
||||
modal: Boolean,
|
||||
closeModal: Function,
|
||||
fetchData: Function,
|
||||
rows: Array,
|
||||
});
|
||||
|
||||
//Table
|
||||
const selected = ref<ResponseData[]>([]); //รายชื่อที่เลือก
|
||||
const filter = ref<string>(""); //คำค้นหา
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
"no",
|
||||
"fullname",
|
||||
|
|
@ -53,8 +64,6 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
field: "fullname",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format(val, row) {
|
||||
return `${row.prefix}${row.firstName} ${row.lastName}`;
|
||||
},
|
||||
|
|
@ -79,8 +88,6 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
field: "organizationPositionOld",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "organization",
|
||||
|
|
@ -90,8 +97,6 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
field: "organization",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "createdAt",
|
||||
|
|
@ -101,8 +106,6 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
field: "createdAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format(val) {
|
||||
return date2Thai(val);
|
||||
},
|
||||
|
|
@ -119,68 +122,53 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
const props = defineProps({
|
||||
Modal: Boolean,
|
||||
closeModal: Function,
|
||||
getData: Function,
|
||||
rows2: Array,
|
||||
filterKeyword2: String,
|
||||
});
|
||||
|
||||
const checkSelected = computed(() => {
|
||||
if (selected.value.length === 0) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
//popup ยืนยันส่งัว
|
||||
const saveOrder = () => {
|
||||
/**
|
||||
* ฟังก์ชันยืนยันการออกคำสั่ง
|
||||
*/
|
||||
function saveOrder() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => Ordersave(),
|
||||
async () => {
|
||||
const id = selected.value.map((r) => r.id);
|
||||
const body = {
|
||||
id,
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.transferReport, body)
|
||||
.then(async () => {
|
||||
await props.fetchData?.();
|
||||
await success($q, "ส่งไปออกคำสั่งสำเร็จ");
|
||||
props.closeModal?.();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ยืนยันส่งไปออกคำสั่ง",
|
||||
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
|
||||
);
|
||||
};
|
||||
//ส่งไปออกคำสั่ง
|
||||
const Ordersave = async () => {
|
||||
const id = selected.value.map((r) => r.id);
|
||||
const body = {
|
||||
id,
|
||||
};
|
||||
}
|
||||
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.transferReport, body)
|
||||
.then(async () => {
|
||||
await props.getData?.();
|
||||
await success($q, "ส่งไปออกคำสั่งสำเร็จ");
|
||||
props.closeModal?.();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
|
||||
const updateInput = (value: any) => {
|
||||
emit("update:filterKeyword2", value);
|
||||
};
|
||||
//รีเซ็ตค่าในช่องค้นหา
|
||||
const Reset = () => {
|
||||
emit("update:filterKeyword2", "");
|
||||
};
|
||||
watchEffect(() => {
|
||||
if (props.Modal === true) {
|
||||
selected.value = [];
|
||||
/**
|
||||
* เมื่อ props.modal เป็น true
|
||||
*
|
||||
* กำหนดให้ selected เป็นค่าว่าง
|
||||
*/
|
||||
watch(
|
||||
() => props.modal,
|
||||
() => {
|
||||
if (props.modal === true) {
|
||||
selected.value = [];
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="props.Modal">
|
||||
<q-dialog v-model="props.modal">
|
||||
<q-card style="width: 1200px; max-width: 80vw">
|
||||
<DialogHeader :tittle="'ส่งไปออกคำสั่ง'" :close="closeModal" />
|
||||
<q-separator />
|
||||
|
|
@ -193,18 +181,17 @@ watchEffect(() => {
|
|||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
:model-value="filterKeyword2"
|
||||
@update:model-value="updateInput"
|
||||
v-model="filter"
|
||||
placeholder="ค้นหา"
|
||||
style="width: 850px; max-width: auto"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword2 == ''" name="search" />
|
||||
<q-icon v-if="filter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword2 !== ''"
|
||||
v-if="filter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="Reset"
|
||||
@click="filter = ''"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
|
|
@ -229,8 +216,8 @@ watchEffect(() => {
|
|||
|
||||
<d-table
|
||||
:columns="columns2"
|
||||
:rows="rows2"
|
||||
:filter="filterKeyword2"
|
||||
:rows="rows"
|
||||
:filter="filter"
|
||||
row-key="id"
|
||||
:visible-columns="visibleColumns2"
|
||||
selection="multiple"
|
||||
|
|
@ -281,7 +268,7 @@ watchEffect(() => {
|
|||
<q-btn
|
||||
label="ส่งไปออกคำสั่ง"
|
||||
@click="saveOrder"
|
||||
:disable="checkSelected"
|
||||
:disable="selected.length === 0"
|
||||
color="public"
|
||||
><q-tooltip>ส่งไปออกคำสั่ง</q-tooltip></q-btn
|
||||
>
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
||||
// import CurrencyInput from "@/components/CurruncyInput.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
|
@ -18,32 +17,13 @@ import type {
|
|||
rowFile,
|
||||
} from "@/modules/05_placement/interface/response/Transfer";
|
||||
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
|
||||
import CardProfile from "@/components/CardProfile.vue";
|
||||
import { tokenParsed } from "@/plugins/auth";
|
||||
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
const personId = ref<string>("");
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const id = ref<string>("");
|
||||
const dataId = route.params.id as string;
|
||||
const myForm = ref<QForm | null>(null);
|
||||
const roleAdmin = ref<boolean>(false);
|
||||
const edit = ref<boolean>(false);
|
||||
const dataProfile = ref<DataProfile>();
|
||||
|
||||
const organizationPositionOld = ref<string>("");
|
||||
const positionTypeOld = ref<string>("");
|
||||
const positionLevelOld = ref<string>("");
|
||||
const posNo = ref<string>("");
|
||||
const salary = ref<number>(0);
|
||||
const organization = ref<string>("");
|
||||
const date = ref<Date | null>(null);
|
||||
const reason = ref<string>("");
|
||||
const rows = ref<TypeFile[]>([]);
|
||||
const {
|
||||
date2Thai,
|
||||
messageError,
|
||||
|
|
@ -53,6 +33,21 @@ const {
|
|||
dialogConfirm,
|
||||
} = mixin;
|
||||
|
||||
const transferId = ref<string>(route.params.id as string); //Id รายการขอโอน
|
||||
const roleAdmin = ref<boolean>(false); //admin
|
||||
const edit = ref<boolean>(false); //การแก่ไข
|
||||
const dataProfile = ref<DataProfile>(); //ข้อมูลส่วนตัว
|
||||
|
||||
const organizationPositionOld = ref<string>("");
|
||||
const positionTypeOld = ref<string>("");
|
||||
const positionLevelOld = ref<string>("");
|
||||
const posNo = ref<string>("");
|
||||
const salary = ref<number>(0);
|
||||
const organization = ref<string>("");
|
||||
const date = ref<Date | null>(null);
|
||||
const reason = ref<string>("");
|
||||
const rows = ref<TypeFile[]>([]); //รายการเอกสารเพิ่มเติม
|
||||
//ข้อมูลการขอโอน
|
||||
const responseData = ref<ResponseDataDetail>({
|
||||
profileId: "",
|
||||
avataPath: "",
|
||||
|
|
@ -70,22 +65,6 @@ const responseData = ref<ResponseDataDetail>({
|
|||
fullname: "",
|
||||
});
|
||||
|
||||
async function fileDownload(no: number, type: string, fileName: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.reportTransferFile(no, type, id.value))
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
await genReport(data, fileName, type);
|
||||
hideLoader();
|
||||
})
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
hideLoader();
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -115,7 +94,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
//รายากรเอกสารดาวน์โหลด
|
||||
const rowsFileDownload = ref<rowFile[]>([
|
||||
{
|
||||
no: 21,
|
||||
|
|
@ -155,14 +134,17 @@ const rowsFileDownload = ref<rowFile[]>([
|
|||
},
|
||||
]);
|
||||
|
||||
const getData = async () => {
|
||||
/**
|
||||
* ฟังก์ชันดึงข้อมูลรายละเอียดการขอโอนตาม ID ของรายการโอน(transferId)
|
||||
*
|
||||
*/
|
||||
async function getData() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.transferId(dataId.toString()))
|
||||
.then((res: any) => {
|
||||
const data = res.data.result;
|
||||
.get(config.API.transferId(transferId.value))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
dataProfile.value = res.data.result as unknown as DataProfile;
|
||||
id.value = data.id;
|
||||
let list: TypeFile[] = [];
|
||||
if (data.docs.length > 0) {
|
||||
data.docs.map((doc: TypeFile) => {
|
||||
|
|
@ -207,95 +189,118 @@ const getData = async () => {
|
|||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
const confirmMessage = async () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => await sendConfirm(),
|
||||
"ต้องการยืนยันส่งคำร้องไปยัง สกจ หรือไม่?",
|
||||
"ข้อมูลจะถูกนำส่งคำร้องไปยัง สกจ ทันที"
|
||||
);
|
||||
};
|
||||
|
||||
const sendConfirm = async () => {
|
||||
/**
|
||||
* ฟังก์ชันดาวน์โหลดเอกสาร
|
||||
* @param no ลำดับรายการ
|
||||
* @param type นามสกุลไฟล์ที่ต้องการโหลด
|
||||
* @param fileName ชื่อไฟล์ที่ต้องการโหลด
|
||||
*/
|
||||
async function fileDownload(no: number, type: string, fileName: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.transferConfirmId(dataId.toString()))
|
||||
.then((res: any) => {
|
||||
success($q, "ส่งคำร้องข้อมูลสำเร็จ");
|
||||
.get(config.API.reportTransferFile(no, type, transferId.value))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
await genReport(data, fileName, type);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getData();
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const conditionSave = async () => {
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then((success) => {
|
||||
if (success) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => await saveData(),
|
||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const saveData = async () => {
|
||||
showLoader();
|
||||
const body = {
|
||||
organization: organization.value,
|
||||
reason: reason.value,
|
||||
organizationPositionOld: organizationPositionOld.value,
|
||||
date: date.value,
|
||||
positionTypeOld: positionTypeOld.value,
|
||||
positionLevelOld: positionLevelOld.value,
|
||||
positionNumberOld: posNo.value,
|
||||
amountOld: salary.value,
|
||||
};
|
||||
await http
|
||||
.put(config.API.transferId(dataId.toString()), body)
|
||||
.then(async () => {
|
||||
await getData();
|
||||
await success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
|
||||
edit.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const cancel = () => {
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันยืนยันการส่งคำร้องไปยัง สกจ.
|
||||
*/
|
||||
function confirmMessage() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.transferConfirmId(transferId.value))
|
||||
.then(async () => {
|
||||
await getData();
|
||||
success($q, "ส่งคำร้องข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ต้องการยืนยันส่งคำร้องไปยัง สกจ หรือไม่?",
|
||||
"ข้อมูลจะถูกนำส่งคำร้องไปยัง สกจ ทันที"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันยืนยันการบันทึกการแก้ไขข้อมูล
|
||||
*/
|
||||
function onSubmit() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
showLoader();
|
||||
const body = {
|
||||
organization: organization.value,
|
||||
reason: reason.value,
|
||||
organizationPositionOld: organizationPositionOld.value,
|
||||
date: date.value,
|
||||
positionTypeOld: positionTypeOld.value,
|
||||
positionLevelOld: positionLevelOld.value,
|
||||
positionNumberOld: posNo.value,
|
||||
amountOld: salary.value,
|
||||
};
|
||||
await http
|
||||
.put(config.API.transferId(transferId.value), body)
|
||||
.then(async () => {
|
||||
await getData();
|
||||
await success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
|
||||
edit.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
},
|
||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันปิดการแก้ไขข้อมูล
|
||||
*/
|
||||
async function cancel() {
|
||||
await getData();
|
||||
edit.value = false;
|
||||
getData();
|
||||
myForm.value?.resetValidation();
|
||||
};
|
||||
const getClass = (val: boolean) => {
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชัน
|
||||
* @param val ค่าการแก้ไข
|
||||
*/
|
||||
function getClass(val: boolean) {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
|
||||
function onclickViewinfo(id: string) {
|
||||
modalPersonal.value = true;
|
||||
personId.value = id;
|
||||
}
|
||||
|
||||
function updatemodalPersonal(modal: boolean) {
|
||||
modalPersonal.value = modal;
|
||||
}
|
||||
|
||||
/**
|
||||
* เมื่อ Componets ถูกเรียกใช้งาน
|
||||
*
|
||||
* เช็ต role ผู้ใช่งาน
|
||||
* เรียก getData ดึงข้อมูลรายละเอียดการขอโอน
|
||||
*/
|
||||
onMounted(async () => {
|
||||
const user = await tokenParsed();
|
||||
if (user) {
|
||||
|
|
@ -321,60 +326,6 @@ onMounted(async () => {
|
|||
|
||||
<CardProfile :data="dataProfile as DataProfile" />
|
||||
|
||||
<!-- <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">
|
||||
{{ responseData.fullname }}
|
||||
</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
outline
|
||||
color="blue"
|
||||
dense
|
||||
icon-right="mdi-open-in-new"
|
||||
class="q-px-sm"
|
||||
label="ดูข้อมูลทะเบียนประวัติ"
|
||||
@click="onclickViewinfo(responseData.profileId)"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row col-12 q-pa-md">
|
||||
<div class="col-12 row bg-white q-col-gutter-md">
|
||||
<div class="col-xs-3 col-sm-2 col-md-1 row">
|
||||
<q-img
|
||||
:src="responseData.avataPath"
|
||||
v-if="responseData.avataPath !== ''"
|
||||
/>
|
||||
<q-img src="@/assets/avatar_user.jpg" v-else />
|
||||
</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>
|
||||
<div class="col-12 text-detail">
|
||||
{{ responseData.positionTypeOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">ระดับตำแหน่ง</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ responseData.positionLevelOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 row items-center">
|
||||
<div class="col-12">
|
||||
<div class="col-12 text-top">สังกัด</div>
|
||||
<div class="col-12 text-detail">
|
||||
{{ responseData.organizationPositionOld }}
|
||||
</div>
|
||||
</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>
|
||||
|
|
@ -504,51 +455,56 @@ onMounted(async () => {
|
|||
</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">
|
||||
แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย
|
||||
<q-form
|
||||
class="col-12"
|
||||
greedy
|
||||
@submit.prevent
|
||||
@validation-success="onSubmit"
|
||||
>
|
||||
<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 />
|
||||
<div class="q-gutter-sm" v-if="!edit">
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="mdi-file-edit-outline"
|
||||
class="q-px-sm"
|
||||
label="แก้ไข"
|
||||
style="width: 80px"
|
||||
@click="edit = !edit"
|
||||
v-if="
|
||||
!(
|
||||
responseData.status == 'REPORT' || responseData.status == 'DONE'
|
||||
) && checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div class="q-gutter-sm" v-else>
|
||||
<q-btn
|
||||
outline
|
||||
color="public"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="บันทึก"
|
||||
style="width: 80px"
|
||||
type="submit"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="ยกเลิก"
|
||||
style="width: 80px"
|
||||
@click="cancel()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<q-space />
|
||||
<div class="q-gutter-sm" v-if="!edit">
|
||||
<q-btn
|
||||
outline
|
||||
color="primary"
|
||||
dense
|
||||
icon-right="mdi-file-edit-outline"
|
||||
class="q-px-sm"
|
||||
label="แก้ไข"
|
||||
style="width: 80px"
|
||||
@click="edit = !edit"
|
||||
v-if="
|
||||
!(
|
||||
responseData.status == 'REPORT' || responseData.status == 'DONE'
|
||||
) && checkPermission($route)?.attrIsUpdate
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div class="q-gutter-sm" v-else>
|
||||
<q-btn
|
||||
outline
|
||||
color="public"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="บันทึก"
|
||||
style="width: 80px"
|
||||
@click="conditionSave"
|
||||
/>
|
||||
<q-btn
|
||||
outline
|
||||
color="red"
|
||||
dense
|
||||
class="q-px-sm"
|
||||
label="ยกเลิก"
|
||||
style="width: 80px"
|
||||
@click="cancel()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<q-form ref="myForm">
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="row q-pa-md">
|
||||
<div class="col-12">
|
||||
<div class="row bg-white q-col-gutter-y-md">
|
||||
|
|
@ -618,8 +574,9 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div class="col-xs-6 col-sm-3">
|
||||
<q-input
|
||||
v-model="salary"
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
v-model="salary"
|
||||
dense
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
|
|
@ -627,7 +584,6 @@ onMounted(async () => {
|
|||
:label="`${'เงินเดือน'}`"
|
||||
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
lazy-rules
|
||||
class="inputgreen"
|
||||
mask="###,###,###,###"
|
||||
reverse-fill-mask
|
||||
/>
|
||||
|
|
@ -717,12 +673,6 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-form>
|
||||
</q-card>
|
||||
|
||||
<PopupPersonal
|
||||
:modal="modalPersonal"
|
||||
:id="personId"
|
||||
@update:modal="updatemodalPersonal"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
|
|
@ -2,13 +2,27 @@
|
|||
* Router บรรจุ แต่งตั้ง ย้าย โอน (Placement)
|
||||
*/
|
||||
|
||||
const PlacementMain = () =>
|
||||
import("@/modules/05_placement/components/Main.vue");
|
||||
//รายการสอบแข่งขัน / คัดเลือก
|
||||
const PlacementMain = () => import("@/modules/05_placement/views/01_Main.vue");
|
||||
const PlacementDetail = () =>
|
||||
import("@/modules/05_placement/components/PersonalList/Detail.vue");
|
||||
import("@/modules/05_placement/components/PersonalList/PersonalListPage.vue");
|
||||
const PlacementPersonalDetail = () =>
|
||||
import("@/modules/05_placement/components/PersonalDetail/Detail.vue");
|
||||
|
||||
// รายการขอโอน
|
||||
const transfer = () =>
|
||||
import("@/modules/05_placement/views/02_transferMain.vue");
|
||||
const transferbyId = () =>
|
||||
import("@/modules/05_placement/components/Transfer/TransferDetail.vue");
|
||||
|
||||
//รายการรับโอน
|
||||
const receiveMain = () =>
|
||||
import("@/modules/05_placement/views/03_receiveMain.vue");
|
||||
const ReceiveAdd = () =>
|
||||
import("@/modules/05_placement/components/Receive/FormAdd.vue");
|
||||
const receiveDetail2 = () =>
|
||||
import("@/modules/05_placement/components/Receive/receiveDetail2.vue");
|
||||
|
||||
// ระบบทดลองงาน
|
||||
const mainProbation = () =>
|
||||
import("@/modules/05_placement/components/probation/MainProbation.vue");
|
||||
|
|
@ -25,10 +39,7 @@ const probationWorkAdd = () =>
|
|||
import("@/modules/05_placement/components/probation/MainDetail.vue");
|
||||
const probationFormAssign = () =>
|
||||
import("@/modules/05_placement/components/probation/FormAssign.vue");
|
||||
const transfer = () =>
|
||||
import("@/modules/05_placement/components/Transfer/transferMain.vue");
|
||||
const transferbyId = () =>
|
||||
import("@/modules/05_placement/components/Transfer/transferRegistry.vue");
|
||||
|
||||
const FormSaveResultAdd = () =>
|
||||
import(
|
||||
"@/modules/05_placement/components/probation/FormEvaluation/FormSaveResultAdd.vue"
|
||||
|
|
@ -61,15 +72,9 @@ const relocation = () =>
|
|||
const relocationbyId = () =>
|
||||
import("@/modules/05_placement/components/Relocation/RelocationbyId.vue");
|
||||
//รับโอน
|
||||
const receiveMain = () =>
|
||||
import("@/modules/05_placement/components/Receive/receiveMain.vue");
|
||||
|
||||
// const receiveDetail = () =>
|
||||
// import("@/modules/05_placement/components/Receive/receiveDetail.vue");
|
||||
const receiveDetail2 = () =>
|
||||
import("@/modules/05_placement/components/Receive/receiveDetail2.vue");
|
||||
const ReceiveAdd = () =>
|
||||
import("@/modules/05_placement/components/Receive/FormAdd.vue");
|
||||
|
||||
//แต่งตั้ง-เลื่อน
|
||||
const AppointmentMain = () =>
|
||||
|
|
@ -87,13 +92,6 @@ const OtherMain = () =>
|
|||
const OthertDetail = () =>
|
||||
import("@/modules/05_placement/components/Other/Detail.vue");
|
||||
|
||||
const ChangePositionMain = () =>
|
||||
import("@/modules/05_placement/components/ChangePosition/Main.vue");
|
||||
const ChangePersonalList = () =>
|
||||
import("@/modules/05_placement/components/ChangePosition/PersonalList.vue");
|
||||
const ChangePersonalDetail = () =>
|
||||
import("@/modules/05_placement/components/ChangePosition/PersonalDetail.vue");
|
||||
|
||||
export default [
|
||||
{
|
||||
path: "/placement",
|
||||
|
|
@ -235,6 +233,8 @@ export default [
|
|||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
|
||||
// รายการขอโอน
|
||||
{
|
||||
path: "/placement/transfer",
|
||||
name: "transfer",
|
||||
|
|
@ -255,6 +255,7 @@ export default [
|
|||
Role: "STAFF",
|
||||
},
|
||||
},
|
||||
//รายการรับโอน
|
||||
{
|
||||
path: "/placement/receive",
|
||||
name: "receive",
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
]);
|
||||
|
||||
/**
|
||||
* ฟังชั่น get ข้อมูลตามปี
|
||||
* ฟังชั่นดึงข้อมูรายการสอบแข่งขัน / คัดเลือกตามปี
|
||||
* @param val ปี ค.ส. โดยที่ทั้งหมดเป็น เลข 0
|
||||
*/
|
||||
async function fetchPlacementData(val: number) {
|
||||
|
|
@ -162,7 +162,7 @@ async function fetchPlacementData(val: number) {
|
|||
.get(config.API.MainDetail(val))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
dataPlacement.value = data.data;
|
||||
dataPlacement.value = data;
|
||||
DataStore.DataMainOrig = dataPlacement.value;
|
||||
rows.value = DataStore.DataMainOrig.map((e: any) => ({
|
||||
id: e.id,
|
||||
|
|
@ -176,6 +176,10 @@ async function fetchPlacementData(val: number) {
|
|||
fiscalYear: e.fiscalYear,
|
||||
numberOfCandidates: e.numberOfCandidates,
|
||||
}));
|
||||
filterKeyword.value = "";
|
||||
examTime.value = "ทั้งหมด";
|
||||
examType.value = "ทั้งหมด";
|
||||
expiredAccount.value = false;
|
||||
|
||||
await Promise.all([
|
||||
examTypeFilter(),
|
||||
|
|
@ -187,19 +191,18 @@ async function fetchPlacementData(val: number) {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
filterKeyword.value = "";
|
||||
examTime.value = "ทั้งหมด";
|
||||
examType.value = "ทั้งหมด";
|
||||
expiredAccount.value = false;
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** ฟังชั่น get ปี ค.ส. */
|
||||
/**
|
||||
* ฟังชั่นดึงข้อมูล ปี ค.ส.
|
||||
*/
|
||||
async function fetchYearOptions() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.yearOptions())
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
const response = res.data.result;
|
||||
yearOptions.push(...response);
|
||||
const maxNumber = yearOptions.reduce((max: any, e: any) => {
|
||||
|
|
@ -208,14 +211,18 @@ async function fetchYearOptions() {
|
|||
searchYear.value = maxNumber;
|
||||
DataStore.DataMainYearSet(searchYear.value);
|
||||
yearOptionsFn.value = yearOptions;
|
||||
searchYear.value && fetchPlacementData(searchYear.value);
|
||||
searchYear.value && (await fetchPlacementData(searchYear.value));
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** ฟังชั่นเช็ค ค่า Null
|
||||
/**
|
||||
* ฟังชั่นเช็ค ค่า Null
|
||||
* เมื่อ != null เอาค่าส่งไปฟังชั่น get data
|
||||
*/
|
||||
function filterYear() {
|
||||
|
|
@ -232,7 +239,9 @@ function redirectToPage(examId?: number) {
|
|||
router.push(`/placement/personal-list/${examId}`);
|
||||
}
|
||||
|
||||
/** ฟิลเตอร์หาครั้งที่สอบ ตาม ปี */
|
||||
/**
|
||||
* ฟิลเตอร์หาครั้งที่สอบ ตาม ปี
|
||||
*/
|
||||
async function examTimeFilter() {
|
||||
for (const data of dataPlacement.value) {
|
||||
const examOrder = data.examOrder;
|
||||
|
|
@ -262,7 +271,9 @@ function examTypeFilter() {
|
|||
});
|
||||
}
|
||||
|
||||
/** ฟิลเตอร์ */
|
||||
/**
|
||||
* ฟังก์ชันค้นหาข้อมูล ายการสอบแข่งขัน / คัดเลือก
|
||||
*/
|
||||
async function searchFilterTable() {
|
||||
rows.value = [];
|
||||
if (examType.value !== undefined && examType.value !== null) {
|
||||
|
|
@ -290,7 +301,9 @@ async function searchFilterTable() {
|
|||
}
|
||||
}
|
||||
|
||||
/** บัญชีหมดอายุ */
|
||||
/**
|
||||
* บัญชีหมดอายุ
|
||||
*/
|
||||
async function expiredAccountFilter() {
|
||||
const updatedRows = dataPlacement.value.map((data: any) => {
|
||||
let isExpired = data.isExpired == expiredAccount;
|
||||
|
|
@ -299,11 +312,6 @@ async function expiredAccountFilter() {
|
|||
await DataStore.DataMain(updatedRows);
|
||||
}
|
||||
|
||||
function paginationLabel(start: number, end: number, total: number) {
|
||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
}
|
||||
|
||||
/** filter ใน dropdown ครั้งที่ */
|
||||
|
||||
/**
|
||||
|
|
@ -363,6 +371,11 @@ function filterFnYear(val: string, update: any) {
|
|||
}
|
||||
}
|
||||
|
||||
function paginationLabel(start: number, end: number, total: number) {
|
||||
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
}
|
||||
|
||||
/** เรียกใช้ฟังชั่น เมื่อเริ่มหน้านี้ */
|
||||
onMounted(async () => {
|
||||
await fetchYearOptions();
|
||||
|
|
@ -1,51 +1,34 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import Dialogbody from "@/modules/05_placement/components/Transfer/Dialogbody.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { ResponseData } from "@/modules/05_placement/interface/response/Transfer";
|
||||
|
||||
import DialogOrders from "@/modules/05_placement/components/Transfer/DialogOrders.vue"; //ส่งไปออกคำสั่งขอโอน
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const transferStore = useTransferDataStore();
|
||||
|
||||
const { statusText } = transferStore;
|
||||
|
||||
const { statusText } = useTransferDataStore();
|
||||
const { date2Thai, messageError, showLoader, hideLoader } = mixin;
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
const modal = ref<boolean>(false); //ส่งไปออกคำสั่ง
|
||||
const rowsOrder = ref<ResponseData[]>([]);
|
||||
const filterOrder = ref<string>("");
|
||||
|
||||
const filterMain = ref<string>(""); //คำค้นหารายการข้อโอน
|
||||
const rows = ref<ResponseData[]>([]);
|
||||
const rows2 = ref<ResponseData[]>([]);
|
||||
const filters = ref<ResponseData[]>([]);
|
||||
const dataTransfer = ref<ResponseData[]>([]);
|
||||
|
||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"fullname",
|
||||
"posType",
|
||||
"organizationPositionOld",
|
||||
"organization",
|
||||
"status",
|
||||
"createdAt",
|
||||
]);
|
||||
|
||||
const resetFilter = () => {
|
||||
filterKeyword.value = "";
|
||||
filterKeyword2.value = "";
|
||||
filterRef.value.focus();
|
||||
};
|
||||
|
||||
// หัวตาราง
|
||||
//Table
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -64,8 +47,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "fullname",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format(val, row) {
|
||||
return `${row.prefix ?? ""}${row.firstName ?? ""} ${row.lastName ?? ""}`;
|
||||
},
|
||||
|
|
@ -94,8 +75,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "organizationPositionOld",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "organization",
|
||||
|
|
@ -105,8 +84,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "organization",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "createdAt",
|
||||
|
|
@ -116,8 +93,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "createdAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
format(val) {
|
||||
return date2Thai(val);
|
||||
},
|
||||
|
|
@ -133,17 +108,43 @@ const columns = ref<QTableProps["columns"]>([
|
|||
format: (val) => statusText(val),
|
||||
},
|
||||
]);
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"fullname",
|
||||
"posType",
|
||||
"organizationPositionOld",
|
||||
"organization",
|
||||
"status",
|
||||
"createdAt",
|
||||
]);
|
||||
|
||||
const openModal = () => (modal.value = true);
|
||||
const closeModal = () => {
|
||||
modal.value = false;
|
||||
filterKeyword2.value = "";
|
||||
};
|
||||
/**
|
||||
* ฟังก์ชันดึงข้อมูรายการขอโอน
|
||||
*/
|
||||
async function fetchData() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.transfer)
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
rows.value = data;
|
||||
dataTransfer.value = data;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
// เปิดโมเดล
|
||||
const openModalOrder = () => {
|
||||
openModal();
|
||||
const row = filters.value.filter(
|
||||
/**
|
||||
* ฟังก์ชันส่งไปออกคำสั่ง
|
||||
*
|
||||
* ค้นหารายชื่อออกคำสั่งตามสถานะ อนุมัติ (APPROVE)
|
||||
*/
|
||||
function openModalOrder() {
|
||||
const row = dataTransfer.value.filter(
|
||||
(r: ResponseData) =>
|
||||
r.status == "APPROVE" &&
|
||||
r.organizationPositionOld &&
|
||||
|
|
@ -154,27 +155,36 @@ const openModalOrder = () => {
|
|||
r.organization &&
|
||||
r.date
|
||||
);
|
||||
rows2.value = row;
|
||||
};
|
||||
// เรียกข้อมูล api
|
||||
const getData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.transfer)
|
||||
.then((res: any) => {
|
||||
rows.value = res.data.result;
|
||||
filters.value = rows.value;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
rowsOrder.value = row;
|
||||
modal.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันปิด popup ส่งไปออกคำสั่ง
|
||||
*
|
||||
*/
|
||||
function closeModal() {
|
||||
modal.value = false;
|
||||
filterOrder.value = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันคืนค่าตัวแปรค้นหา
|
||||
*
|
||||
* กำหนด filterMain และ filterOrder เป็นค่าว่าง
|
||||
*/
|
||||
function resetFilter() {
|
||||
filterMain.value = "";
|
||||
filterOrder.value = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
||||
*
|
||||
* จะเรียกใช้ fetchData เพื่อดึงข้อมูลรายการขอโอน
|
||||
*/
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
await fetchData();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
|
@ -200,16 +210,16 @@ onMounted(async () => {
|
|||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
v-model="filterMain"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
<q-icon v-if="filterMain == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword !== ''"
|
||||
v-if="filterMain !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
|
|
@ -238,7 +248,7 @@ onMounted(async () => {
|
|||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
:filter="filterMain"
|
||||
row-key="id"
|
||||
:visible-columns="visibleColumns"
|
||||
>
|
||||
|
|
@ -287,12 +297,12 @@ onMounted(async () => {
|
|||
</div>
|
||||
</q-card>
|
||||
|
||||
<Dialogbody
|
||||
v-model:Modal="modal"
|
||||
:closeModal="closeModal"
|
||||
:rows2="rows2"
|
||||
v-model:filterKeyword2="filterKeyword2"
|
||||
:getData="getData"
|
||||
<DialogOrders
|
||||
v-bind:modal="modal"
|
||||
v-model:filter-order="filterOrder"
|
||||
:fetch-data="fetchData"
|
||||
:close-modal="closeModal"
|
||||
:rows="rowsOrder"
|
||||
/>
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
@ -1,16 +1,13 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import Dialogbody from "@/modules/05_placement/components/Receive/Dialogbody.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import DialogHeader from "@/modules/05_placement/components/Receive/DialogHeader.vue";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import type {
|
||||
|
|
@ -18,11 +15,27 @@ import type {
|
|||
ResponseRow,
|
||||
} from "@/modules/05_placement/interface/response/Receive";
|
||||
|
||||
import Dialogbody from "@/modules/05_placement/components/Receive/Dialogbody.vue";
|
||||
import DialogHeader from "@/modules/05_placement/components/Receive/DialogHeader.vue";
|
||||
import DialogOrgSelect from "@/components/Dialogs/DialogOrgSelect.vue";
|
||||
|
||||
const dataRows = ref<any[]>([]);
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const transferStore = useTransferDataStore();
|
||||
const { statusText } = transferStore;
|
||||
const {
|
||||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
messageError,
|
||||
date2Thai,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const dataRecevice = ref<ResponseData[]>([]); //ข้อมูลรายการรับโอน
|
||||
|
||||
const dataRows = ref<any[]>([]);
|
||||
const rows2 = ref<ResponseRow[]>([]);
|
||||
const modal = ref<boolean>(false);
|
||||
const modalupload = ref<boolean>(false);
|
||||
|
|
@ -34,45 +47,14 @@ const filterKeyword = ref<string>("");
|
|||
const filterKeyword2 = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
const files = ref<any>();
|
||||
const listRecevice = ref<ResponseData[]>([]);
|
||||
const filters = ref<ResponseRow[]>([]);
|
||||
const rows = ref<ResponseRow[]>([]);
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const transferStore = useTransferDataStore();
|
||||
const posType = ref<string>("");
|
||||
const posLevel = ref<string>("");
|
||||
const position = ref<string>("");
|
||||
const type = ref<string | null>(null);
|
||||
|
||||
const { statusText } = transferStore;
|
||||
const {
|
||||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
messageError,
|
||||
date2Thai,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const popup = () => {
|
||||
const row = filters.value.filter(
|
||||
(r: any) =>
|
||||
(r.status == "WAITTING" ||
|
||||
r.status == "PENDING" ||
|
||||
r.status == "APPROVE") &&
|
||||
r.posMasterNo != null &&
|
||||
r.educationOld &&
|
||||
r.organizationPositionOld &&
|
||||
r.positionTypeOld &&
|
||||
r.positionLevelOld &&
|
||||
r.positionNumberOld &&
|
||||
r.amountOld !== null
|
||||
);
|
||||
|
||||
rows2.value = row;
|
||||
modal.value = true;
|
||||
};
|
||||
//คอลัม
|
||||
//Table
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"citizenId",
|
||||
|
|
@ -82,7 +64,6 @@ const visibleColumns = ref<string[]>([
|
|||
"createdAt",
|
||||
"status",
|
||||
]);
|
||||
// หัวตาราง
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -162,39 +143,15 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
//save file
|
||||
const SaveData = async () => {
|
||||
myForm.value.validate().then((result: boolean) => {
|
||||
if (result) {
|
||||
const formData = new FormData();
|
||||
formData.append("File", files.value);
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.receiveFile(personalId.value), formData)
|
||||
.then(async () => {
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
await clickCloseUpload();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const fecthlistRecevice = async () => {
|
||||
async function fecthlistRecevice() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.receiveData() + `?keyword=`)
|
||||
.then((res: any) => {
|
||||
const response = res.data.result;
|
||||
|
||||
listRecevice.value = response;
|
||||
rows.value = response;
|
||||
filters.value = response;
|
||||
.get(config.API.receiveData())
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
dataRecevice.value = data;
|
||||
rows.value = data;
|
||||
filters.value = data;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -202,7 +159,35 @@ const fecthlistRecevice = async () => {
|
|||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* ไปหน้าเพิ่มข้อมูลรายการรับโอน
|
||||
*/
|
||||
function onAddReceive() {
|
||||
router.push(`/placement/receive/add`);
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันบันทึกการอัปโหลดเอกสาร
|
||||
*/
|
||||
function onSubmitDoc() {
|
||||
const formData = new FormData();
|
||||
formData.append("File", files.value);
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.receiveFile(personalId.value), formData)
|
||||
.then(async () => {
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
clickCloseUpload();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
// รีเซ็ตค่าในฟิลเตอร์
|
||||
const resetFilter = () => {
|
||||
|
|
@ -210,10 +195,7 @@ const resetFilter = () => {
|
|||
filterKeyword2.value = "";
|
||||
filterRef.value.focus();
|
||||
};
|
||||
// ไปหน้าเพิ่มข้อมูล
|
||||
const add = () => {
|
||||
router.push(`/placement/receive/add`);
|
||||
};
|
||||
|
||||
// ปิดโมเดล
|
||||
const clickClose = () => {
|
||||
modal.value = false;
|
||||
|
|
@ -227,7 +209,7 @@ const clickCloseUpload = () => {
|
|||
// ปิดโมเดลโครงสร้าง
|
||||
const openModalTree = (id: string, data: any) => {
|
||||
personalId.value = id;
|
||||
personal.value = listRecevice.value.filter((e: ResponseData) => e.id === id);
|
||||
personal.value = dataRecevice.value.filter((e: ResponseData) => e.id === id);
|
||||
dataRows.value = data;
|
||||
|
||||
modalTree.value = true;
|
||||
|
|
@ -268,6 +250,25 @@ const nextPage = (id: string) => {
|
|||
});
|
||||
};
|
||||
|
||||
const popup = () => {
|
||||
const row = filters.value.filter(
|
||||
(r: any) =>
|
||||
(r.status == "WAITTING" ||
|
||||
r.status == "PENDING" ||
|
||||
r.status == "APPROVE") &&
|
||||
r.posMasterNo != null &&
|
||||
r.educationOld &&
|
||||
r.organizationPositionOld &&
|
||||
r.positionTypeOld &&
|
||||
r.positionLevelOld &&
|
||||
r.positionNumberOld &&
|
||||
r.amountOld !== null
|
||||
);
|
||||
|
||||
rows2.value = row;
|
||||
modal.value = true;
|
||||
};
|
||||
|
||||
function onSave(data: any) {
|
||||
console.log("not save", data);
|
||||
const dataAppoint = {
|
||||
|
|
@ -318,7 +319,7 @@ onMounted(() => {
|
|||
flat
|
||||
round
|
||||
color="primary"
|
||||
@click="add"
|
||||
@click="onAddReceive"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
|
|
@ -562,37 +563,39 @@ onMounted(() => {
|
|||
<!-- อัปโหลดเอกสาร -->
|
||||
<q-dialog v-model="modalupload">
|
||||
<q-card style="width: 600px">
|
||||
<DialogHeader title="อัปโหลดเอกสาร" :close="clickCloseUpload" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-py-sm">
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
ref="myForm"
|
||||
outlined
|
||||
dense
|
||||
v-model="files"
|
||||
label="อัปโหลดเอกสาร"
|
||||
lazy-rules
|
||||
:rules="[
|
||||
(val) => val || 'กรุณาเลือกไฟล์หนังสือถึงหน่วยงานที่รับโอน',
|
||||
]"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
<q-form greedy @submit.prevent @validation-success="onSubmitDoc">
|
||||
<DialogHeader title="อัปโหลดเอกสาร" :close="clickCloseUpload" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-py-sm">
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
ref="myForm"
|
||||
outlined
|
||||
dense
|
||||
v-model="files"
|
||||
label="อัปโหลดเอกสาร"
|
||||
lazy-rules
|
||||
:rules="[
|
||||
(val) => val || 'กรุณาเลือกไฟล์หนังสือถึงหน่วยงานที่รับโอน',
|
||||
]"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<div class="row q-pa-sm">
|
||||
<q-space />
|
||||
<q-btn label="บันทึก" color="secondary" type="submit">
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<div class="row q-pa-sm">
|
||||
<q-space />
|
||||
<q-btn label="บันทึก" color="secondary" @click="SaveData()">
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
|
|
@ -601,10 +604,10 @@ onMounted(() => {
|
|||
:title="`เลือกหน่วยงานที่รับโอน`"
|
||||
v-model:modal="modalTree"
|
||||
v-model:type="type"
|
||||
:posType="posType"
|
||||
:posLevel="posLevel"
|
||||
:pos-type="posType"
|
||||
:pos-level="posLevel"
|
||||
:position="position"
|
||||
:dataRows="dataRows"
|
||||
:data-rows="dataRows"
|
||||
:onSubmit="onSave"
|
||||
/>
|
||||
</template>
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<script setup lang="ts"></script>
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายการสอบแข่งขัน / คัดเลือก
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -6,7 +6,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import { useQuasar } from "quasar";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import DialogHeader from "../DialogHeader.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
/** Use */
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
|
|
@ -264,7 +264,7 @@ function closeDialog() {
|
|||
|
||||
<q-dialog v-model="modal" Persistent>
|
||||
<q-card style="width: 900px; max-width: 80vw">
|
||||
<DialogHeader :title="'เพิ่มรายชื่อ'" :close="closeDialog" />
|
||||
<DialogHeader :tittle="'เพิ่มรายชื่อ'" :close="closeDialog" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="row q-col-gutter-sm">
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ import { useQuasar } from "quasar";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
|
||||
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
|
@ -204,7 +205,7 @@ watchEffect(() => {
|
|||
<template>
|
||||
<q-dialog v-model="props.modal">
|
||||
<q-card style="width: 1200px; max-width: 80vw">
|
||||
<DialogHeader title="ส่งไปออกคำสั่งลาออก" :close="closeModal" />
|
||||
<DialogHeader tittle="ส่งไปออกคำสั่งลาออก" :close="closeModal" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-pt-none">
|
||||
<div class="row justify-end">
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { useRouter, useRoute } from "vue-router";
|
|||
import { useQuasar, QForm } from "quasar";
|
||||
import { ref, onMounted } from "vue";
|
||||
import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue";
|
||||
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRetirementDataStore } from "@/modules/06_retirement/store";
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -1295,7 +1295,7 @@ function removeFile(fileName: string) {
|
|||
<q-card style="width: 800px">
|
||||
<q-form ref="myFormConfirm">
|
||||
<DialogHeader
|
||||
:title="`${actionPass ? 'อนุญาตการลาออก' : 'ยับยั้งการลาออก'}`"
|
||||
:tittle="`${actionPass ? 'อนุญาตการลาออก' : 'ยับยั้งการลาออก'}`"
|
||||
:close="closeModal"
|
||||
/>
|
||||
<q-separator />
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { ref, watch } from "vue";
|
|||
import { QForm, useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QTableProps } from "quasar";
|
||||
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ watch(
|
|||
<q-dialog v-model="props.modal" persistent>
|
||||
<q-card style="min-width: 40vw">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader :title="`ประวัติการออกคำสั่ง`" :close="props.close" />
|
||||
<DialogHeader :tittle="`ประวัติการออกคำสั่ง`" :close="props.close" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<d-table
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import {
|
|||
import { QForm, useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { DirectorRowsResponse } from "@/modules/11_discipline/interface/response/director";
|
||||
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ watch(props, () => {
|
|||
<q-dialog v-model="props.modal" persistent>
|
||||
<q-card style="min-width: 50vw">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader :title="props.title" :close="props.close" />
|
||||
<DialogHeader :tittle="props.title" :close="props.close" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="row q-col-gutter-sm">
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import type { QTableProps } from "quasar";
|
||||
import type { directorType } from "@/modules/11_discipline/interface/index/Main";
|
||||
|
||||
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
const $q = useQuasar();
|
||||
const selected = ref<directorType[]>([]);
|
||||
|
|
@ -191,7 +191,7 @@ watch(
|
|||
<template>
|
||||
<q-dialog v-model="props.Modal" persistent>
|
||||
<q-card style="width: 1200px; max-width: 80vw">
|
||||
<DialogHeader title="เลือกรายชื่อกรรมการ" :close="clickClose" />
|
||||
<DialogHeader tittle="เลือกรายชื่อกรรมการ" :close="clickClose" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<q-input
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import {
|
|||
import { QForm, useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -69,7 +69,7 @@ watch(props, () => {
|
|||
<q-dialog v-model="props.modal" persistent>
|
||||
<q-card style="width: 30vw">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader title="แก้ไขข้อมูลกรรมการ" :close="props.closePopup" />
|
||||
<DialogHeader tittle="แก้ไขข้อมูลกรรมการ" :close="props.closePopup" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<q-input
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue