Compare commits
29 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ac7da9c363 | |||
| 5193720567 | |||
| f7412ca1a8 | |||
| 0ccda33b37 | |||
| cba8f4b703 | |||
|
|
926c47f273 | ||
|
|
d6e75d6966 | ||
|
|
170568384d | ||
|
|
7f25ed4ef1 | ||
|
|
8a0a6ea873 | ||
| 833718d276 | |||
| 73335d7dd5 | |||
|
|
07659ecc6c | ||
|
|
9d9cd92d6b | ||
|
|
40ebaa646f | ||
|
|
c700cf0abd | ||
|
|
b0b834cb9b | ||
|
|
0d5cb36fb2 | ||
|
|
cf468e14cb | ||
|
|
c21cfa838f | ||
|
|
376fba6059 | ||
|
|
3f5a4783c1 | ||
|
|
1de7a11721 | ||
|
|
b233b424d3 | ||
|
|
7da397a1fe | ||
|
|
c8a8321014 | ||
|
|
e11d9b18dc | ||
|
|
006c2bc0ba | ||
|
|
546942f8fb |
15 changed files with 498 additions and 75 deletions
|
|
@ -27,6 +27,7 @@ export default {
|
|||
placementDefermentInfo: (id: string) => `${placement}/pass/deferment/${id}`,
|
||||
placementDisclaimInfo: (id: string) => `${placement}/pass/disclaim/${id}`,
|
||||
placementUpdatePass: `${placement}/pass/update-status`,
|
||||
placementUpdateDraftStatus: `${placement}/update/draft-status`,
|
||||
|
||||
//personal
|
||||
placementPersonalId: (personalId: string) =>
|
||||
|
|
|
|||
|
|
@ -354,6 +354,11 @@ function onClose() {
|
|||
|
||||
<div class="col-12">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<div class="text-caption text-grey-8">
|
||||
ผู้ดูแลระบบจะติดต่อกลับผ่านทางอีเมลที่ท่านระบุ กรุณาตรวจสอบอีเมลของท่านเป็นระยะ
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 col-lg-6">
|
||||
<q-input
|
||||
dense
|
||||
|
|
@ -363,10 +368,11 @@ function onClose() {
|
|||
class="inputgreen"
|
||||
hide-bottom-space
|
||||
:rules="[
|
||||
() =>
|
||||
!!formData.email ||
|
||||
!!formData.phone ||
|
||||
'กรุณากรอกอีเมลหรือเบอร์โทรติดต่อกลับ',
|
||||
(val: string) => !!val || 'กรุณากรอกที่อยู่อีเมล',
|
||||
(val: string) => {
|
||||
const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
return emailPattern.test(val) || 'กรุณากรอกที่อยู่อีเมลในรูปแบบที่ถูกต้อง';
|
||||
}
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -378,12 +384,6 @@ function onClose() {
|
|||
v-model="formData.phone"
|
||||
class="inputgreen"
|
||||
hide-bottom-space
|
||||
:rules="[
|
||||
() =>
|
||||
!!formData.email ||
|
||||
!!formData.phone ||
|
||||
'กรุณากรอกอีเมลหรือเบอร์โทรติดต่อกลับ',
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -402,6 +402,7 @@ const modalDialogSalary = ref<boolean>(false); //แสดง popup ตำแห
|
|||
const isStatusEdit = ref<boolean>(false); //สถานะแก้ไขข้อมูลตำแหน่งเงินเดือน
|
||||
const salaryId = ref<string>(""); //id ที่ต้องการแก้ไข
|
||||
const dataLevel = ref<DataPosType[]>([]); //รายการ ตำแหน่งเงินเดือน
|
||||
const idCommandId = ref<boolean>(false); //เช็คว่ามี commandId หรือไม่
|
||||
|
||||
const commandCodeOptions = ref<DataOption[]>(store.commandCodeData); //รายการปรเภทคำสั่ง
|
||||
const posTypeOptions = ref<DataOption[]>(store.posTypeData); //รายการประเภทตำแหน่ง | กลุ่มงาน
|
||||
|
|
@ -658,6 +659,7 @@ async function onClickOpenDialog(
|
|||
} else {
|
||||
await fetchOptionGroup();
|
||||
}
|
||||
idCommandId.value = statusEdit ? (data.commandId ? true : false) : false;
|
||||
commandCodeOptions.value = store.commandCodeData;
|
||||
posTypeOptions.value = store.posTypeData;
|
||||
posLevelOptions.value = store.posLevelData;
|
||||
|
|
@ -978,6 +980,7 @@ onMounted(async () => {
|
|||
<q-tooltip>ประวัติแก้ไขตำแหน่ง/เงินเดือน</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<!-- :disable="(props.row.commandId !== null && props.row.commandId !== '') || props.row.commandType === 'C-PM-47'" -->
|
||||
<q-btn
|
||||
v-if="
|
||||
!isLeave &&
|
||||
|
|
@ -985,11 +988,7 @@ onMounted(async () => {
|
|||
checkPermission($route)?.attrOwnership === 'OWNER'
|
||||
"
|
||||
flat
|
||||
:disable="
|
||||
(props.row.commandId !== null && props.row.commandId !== '') ||
|
||||
props.row.commandType === 'C-PM-47'
|
||||
"
|
||||
:color="props.row.commandId ? 'grey' : 'edit'"
|
||||
color="edit"
|
||||
dense
|
||||
round
|
||||
icon="edit"
|
||||
|
|
@ -1154,7 +1153,8 @@ onMounted(async () => {
|
|||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
:class="classInput(true)"
|
||||
:class="classInput(!idCommandId)"
|
||||
:readonly="idCommandId"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
|
|
@ -1174,7 +1174,8 @@ onMounted(async () => {
|
|||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
class="inputgreen"
|
||||
:class="classInput(!idCommandId)"
|
||||
:disabled="idCommandId"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
|
|
@ -1191,6 +1192,8 @@ onMounted(async () => {
|
|||
: formData.commandYear + 543
|
||||
"
|
||||
label="ปี พ.ศ."
|
||||
:class="classInput(!idCommandId)"
|
||||
:readonly="idCommandId"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ const keyword = ref<string>(""); //คำค้นหา
|
|||
const modalCommand = ref<boolean>(false);
|
||||
const command = ref<string>("");
|
||||
const commandId = ref<string>("");
|
||||
const idCommandId = ref<boolean>(false); //สถานะการมีคำสั่ง
|
||||
const baseColumns = ref<QTableColumn[]>([
|
||||
{
|
||||
name: "commandDateAffect",
|
||||
|
|
@ -638,6 +639,7 @@ async function onClickOpenDialog(
|
|||
} else {
|
||||
await fetchOptionGroup();
|
||||
}
|
||||
idCommandId.value = statusEdit && data.commandId ? true : false;
|
||||
commandCodeOptions.value = store.commandCodeData;
|
||||
posTypeOptions.value = store.posTypeData;
|
||||
posLevelOptions.value = store.posLevelData;
|
||||
|
|
@ -939,6 +941,10 @@ onMounted(async () => {
|
|||
>
|
||||
<q-tooltip>ประวัติแก้ไขตำแหน่ง/เงินเดือน</q-tooltip>
|
||||
</q-btn>
|
||||
<!-- :disable="
|
||||
(props.row.commandId !== null && props.row.commandId !== '') ||
|
||||
props.row.commandType === 'C-PM-47'
|
||||
" -->
|
||||
<q-btn
|
||||
v-if="
|
||||
!isLeave &&
|
||||
|
|
@ -946,11 +952,7 @@ onMounted(async () => {
|
|||
checkPermission($route)?.attrOwnership === 'OWNER'
|
||||
"
|
||||
flat
|
||||
:disable="
|
||||
(props.row.commandId !== null && props.row.commandId !== '') ||
|
||||
props.row.commandType === 'C-PM-47'
|
||||
"
|
||||
:color="props.row.commandId ? 'grey' : 'edit'"
|
||||
color="edit"
|
||||
dense
|
||||
round
|
||||
icon="edit"
|
||||
|
|
@ -1119,7 +1121,8 @@ onMounted(async () => {
|
|||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
:class="classInput(true)"
|
||||
:class="classInput(!idCommandId)"
|
||||
:readonly="idCommandId"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
|
|
@ -1139,7 +1142,8 @@ onMounted(async () => {
|
|||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
class="inputgreen"
|
||||
:class="classInput(!idCommandId)"
|
||||
:disable="idCommandId"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
|
|
@ -1156,6 +1160,8 @@ onMounted(async () => {
|
|||
: formData.commandYear + 543
|
||||
"
|
||||
label="ปี พ.ศ."
|
||||
:class="classInput(!idCommandId)"
|
||||
:readonly="idCommandId"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
|
|||
|
|
@ -706,6 +706,7 @@ function classInput(val: boolean) {
|
|||
hide-bottom-space
|
||||
autocomplete="on"
|
||||
name="organization"
|
||||
:label="`${'หน่วยงาน'}`"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { ref, watch } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { calculateAge } from "@/utils/function";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
|
@ -38,6 +39,20 @@ const props = defineProps({
|
|||
|
||||
const rows = ref<DataEducation[]>([]);
|
||||
const personalForm = ref<DataPerson>();
|
||||
const age = ref<string | null>(""); //อายุ
|
||||
|
||||
// ข้อมูลแปลงจาก ID เป็นชื่อ
|
||||
const currentProvinceName = ref<string>("");
|
||||
const currentDistrictName = ref<string>("");
|
||||
const currentSubDistrictName = ref<string>("");
|
||||
const registProvinceName = ref<string>("");
|
||||
const registDistrictName = ref<string>("");
|
||||
const registSubDistrictName = ref<string>("");
|
||||
|
||||
// Cache ข้อมูล
|
||||
const provincesCache = ref<any[]>([]);
|
||||
const districtsCache = ref<Map<string, any[]>>(new Map()); // key: provinceId, value: districts[]
|
||||
const subDistrictsCache = ref<Map<string, any[]>>(new Map()); // key: districtId, value: subDistricts[]
|
||||
|
||||
/**หัวตาราง */
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -87,11 +102,20 @@ const columns = ref<QTableProps["columns"]>([
|
|||
* ฟังก์ชันดึงข้อมูลรายละเอียด
|
||||
*/
|
||||
async function fetchData() {
|
||||
// Reset ข้อมูลเก่าก่อนโหลดข้อมูลใหม่
|
||||
resetData();
|
||||
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.getDatapersonal(props.personalId))
|
||||
.then((res) => {
|
||||
personalForm.value = res.data.result;
|
||||
if (res.data.result.dateOfBirth) {
|
||||
// กำหนดอายุ ส่งวันเกิดไปคำนวน
|
||||
age.value = calculateAge(res.data.result.dateOfBirth);
|
||||
} else {
|
||||
age.value = null;
|
||||
}
|
||||
personalForm.value?.education.map((e: Education) => {
|
||||
rows.value.push({
|
||||
university: e.institute,
|
||||
|
|
@ -107,6 +131,159 @@ async function fetchData() {
|
|||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
|
||||
// แปลง ID เป็นชื่อ
|
||||
await convertAddressIds();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset ข้อมูลทุกครั้งที่เปิดคนใหม่
|
||||
*/
|
||||
function resetData() {
|
||||
// Reset ข้อมูลส่วนตัว
|
||||
personalForm.value = undefined;
|
||||
age.value = "";
|
||||
rows.value = [];
|
||||
|
||||
// Reset ข้อมูลที่อยู่
|
||||
currentProvinceName.value = "";
|
||||
currentDistrictName.value = "";
|
||||
currentSubDistrictName.value = "";
|
||||
registProvinceName.value = "";
|
||||
registDistrictName.value = "";
|
||||
registSubDistrictName.value = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันแปลง ID เป็นชื่อจริงของที่อยู่ (แบบ optimize)
|
||||
*/
|
||||
async function convertAddressIds() {
|
||||
if (!personalForm.value) return;
|
||||
|
||||
try {
|
||||
// โหลดข้อมูลจังหวัดครั้งเดียวถ้ายังไม่มี
|
||||
await loadProvinces();
|
||||
|
||||
// แปลงข้อมูลที่อยู่ปัจจุบัน
|
||||
if (personalForm.value.currentProvinceId && personalForm.value.currentProvinceId.trim() !== "") {
|
||||
currentProvinceName.value = getProvinceNameFromCache(
|
||||
personalForm.value.currentProvinceId
|
||||
);
|
||||
|
||||
if (personalForm.value.currentDistrictId && personalForm.value.currentDistrictId.trim() !== "") {
|
||||
currentDistrictName.value = await getDistrictNameOptimized(
|
||||
personalForm.value.currentProvinceId,
|
||||
personalForm.value.currentDistrictId
|
||||
);
|
||||
|
||||
if (personalForm.value.currentSubDistrictId && personalForm.value.currentSubDistrictId.trim() !== "") {
|
||||
currentSubDistrictName.value = await getSubDistrictNameOptimized(
|
||||
personalForm.value.currentDistrictId,
|
||||
personalForm.value.currentSubDistrictId
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// แปลงข้อมูลที่อยู่ตามทะเบียน
|
||||
if (personalForm.value.registProvinceId && personalForm.value.registProvinceId.trim() !== "") {
|
||||
registProvinceName.value = getProvinceNameFromCache(
|
||||
personalForm.value.registProvinceId
|
||||
);
|
||||
|
||||
if (personalForm.value.registDistrictId && personalForm.value.registDistrictId.trim() !== "") {
|
||||
registDistrictName.value = await getDistrictNameOptimized(
|
||||
personalForm.value.registProvinceId,
|
||||
personalForm.value.registDistrictId
|
||||
);
|
||||
|
||||
if (personalForm.value.registSubDistrictId && personalForm.value.registSubDistrictId.trim() !== "") {
|
||||
registSubDistrictName.value = await getSubDistrictNameOptimized(
|
||||
personalForm.value.registDistrictId,
|
||||
personalForm.value.registSubDistrictId
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error converting address IDs:", error);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* โหลดข้อมูลจังหวัดทั้งหมด (ครั้งเดียว)
|
||||
*/
|
||||
async function loadProvinces() {
|
||||
if (provincesCache.value.length === 0) {
|
||||
try {
|
||||
const res = await http.get(config.API.province);
|
||||
provincesCache.value = res.data.result;
|
||||
} catch (error) {
|
||||
console.error("Error loading provinces:", error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ดึงชื่อจังหวัดจาก cache
|
||||
*/
|
||||
function getProvinceNameFromCache(provinceId: string): string {
|
||||
const province = provincesCache.value.find(
|
||||
(p: any) => p.id.toString() === provinceId
|
||||
);
|
||||
return province ? province.name : "-";
|
||||
}
|
||||
|
||||
/**
|
||||
* ดึงชื่ออำเภอแบบ optimize (เรียก API เฉพาะจังหวัดที่ต้องการ)
|
||||
* @param provinceId ID ของจังหวัด
|
||||
* @param districtId ID ของอำเภอ
|
||||
*/
|
||||
async function getDistrictNameOptimized(
|
||||
provinceId: string,
|
||||
districtId: string
|
||||
): Promise<string> {
|
||||
try {
|
||||
// เช็ค cache ว่ามีข้อมูล districts ของ province นี้หรือไม่
|
||||
if (!districtsCache.value.has(provinceId)) {
|
||||
const res = await http.get(config.API.listDistrict(provinceId));
|
||||
districtsCache.value.set(provinceId, res.data.result.districts);
|
||||
}
|
||||
|
||||
const districts = districtsCache.value.get(provinceId) || [];
|
||||
const district = districts.find((d: any) => d.id.toString() === districtId);
|
||||
return district ? district.name : "-";
|
||||
} catch (error) {
|
||||
console.error("Error loading district:", error);
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ดึงชื่อตำบลแบบ optimize (เรียก API เฉพาะอำเภอที่ต้องการ)
|
||||
* @param districtId ID ของอำเภอ
|
||||
* @param subDistrictId ID ของตำบล
|
||||
*/
|
||||
async function getSubDistrictNameOptimized(
|
||||
districtId: string,
|
||||
subDistrictId: string
|
||||
): Promise<string> {
|
||||
try {
|
||||
// เช็ค cache ว่ามีข้อมูล subDistricts ของ district นี้หรือไม่
|
||||
if (!subDistrictsCache.value.has(districtId)) {
|
||||
const res = await http.get(config.API.listSubDistrict(districtId));
|
||||
subDistrictsCache.value.set(districtId, res.data.result.subDistricts);
|
||||
}
|
||||
|
||||
const subDistricts = subDistrictsCache.value.get(districtId) || [];
|
||||
const subDistrict = subDistricts.find(
|
||||
(sd: any) => sd.id.toString() === subDistrictId
|
||||
);
|
||||
return subDistrict ? subDistrict.name : "-";
|
||||
} catch (error) {
|
||||
console.error("Error loading subdistrict:", error);
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -131,7 +308,7 @@ function formBmaofficer(val: string) {
|
|||
*/
|
||||
async function close() {
|
||||
props.close();
|
||||
rows.value = [];
|
||||
resetData(); // Reset ข้อมูลเมื่อปิด dialog
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -170,30 +347,58 @@ watch(props, () => {
|
|||
|
||||
<div class="row q-pa-xs">
|
||||
<div class="col-3 header-sub-text">
|
||||
<div class="q-pb-md">เลขประจำตัวประชาชน</div>
|
||||
<div>วัน/เดือน/ปีเกิด</div>
|
||||
<div class="q-pb-sm">เลขประจำตัวประชาชน</div>
|
||||
<div class="q-pb-sm">วัน/เดือน/ปีเกิด</div>
|
||||
<div class="q-pb-sm">อายุ</div>
|
||||
<div class="q-pb-sm">สัญชาติ</div>
|
||||
<div>หมู่เลือด</div>
|
||||
</div>
|
||||
|
||||
<div class="col-4 sub-text">
|
||||
<div class="q-pb-md">
|
||||
<div class="q-pb-sm">
|
||||
{{ personalForm?.idCard }}
|
||||
</div>
|
||||
<div>
|
||||
<div class="q-pb-sm">
|
||||
{{ date2Thai(personalForm?.dateOfBirth) }}
|
||||
</div>
|
||||
<div class="q-pb-sm">
|
||||
{{ age ? age : "-" }}
|
||||
</div>
|
||||
<div class="q-pb-sm">
|
||||
{{
|
||||
personalForm?.nationality ? personalForm.nationality : "-"
|
||||
}}
|
||||
</div>
|
||||
<div>
|
||||
{{
|
||||
personalForm?.bloodGroup ? personalForm.bloodGroup : "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-2 header-sub-text">
|
||||
<div class="q-pb-md">ชื่อ-นามสกุล</div>
|
||||
<div>เพศ</div>
|
||||
<div class="q-pb-sm">ชื่อ-นามสกุล</div>
|
||||
<div class="q-pb-sm">เพศ</div>
|
||||
<div class="q-pb-sm">เชื้อชาติ</div>
|
||||
<div class="q-pb-sm">ศาสนา</div>
|
||||
<div>เบอร์โทรศัพท์</div>
|
||||
</div>
|
||||
<div class="col-3 sub-text">
|
||||
<div class="q-pb-md">
|
||||
<div class="q-pb-sm">
|
||||
{{ personalForm?.fullName }}
|
||||
</div>
|
||||
<div>
|
||||
<div class="q-pb-sm">
|
||||
{{ personalForm?.gender }}
|
||||
</div>
|
||||
<div class="q-pb-sm">
|
||||
{{ personalForm?.race ? personalForm.race : "-" }}
|
||||
</div>
|
||||
<div class="q-pb-sm">
|
||||
{{ personalForm?.religion ? personalForm.religion : "-" }}
|
||||
</div>
|
||||
<div class="q-mt-sm">
|
||||
{{ personalForm?.telephone ? personalForm.telephone : "-" }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
@ -203,9 +408,90 @@ watch(props, () => {
|
|||
<q-card bordered class="card-panding">
|
||||
<div class="row items-center q-pa-xs header-text">ภูมิลำเนา</div>
|
||||
<div class="row q-pa-xs">
|
||||
<div class="col-3 header-sub-text">ที่อยู่</div>
|
||||
<div class="col-9 sub-text">
|
||||
{{ personalForm?.registAddress }}
|
||||
<!-- ที่อยู่ปัจจุบัน -->
|
||||
<div class="col-6">
|
||||
<div class="q-pb-sm text-weight-medium text-primary">
|
||||
ที่อยู่ปัจจุบัน
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4 header-sub-text">
|
||||
<div class="q-pb-sm">ที่อยู่</div>
|
||||
<div class="q-pb-sm">จังหวัด</div>
|
||||
<div class="q-pb-sm">เขต/อำเภอ</div>
|
||||
<div class="q-pb-sm">แขวง/ตำบล</div>
|
||||
<div>รหัสไปรษณีย์</div>
|
||||
</div>
|
||||
<div class="col-8 sub-text">
|
||||
<div class="q-pb-sm">
|
||||
{{
|
||||
personalForm?.currentAddress
|
||||
? personalForm.currentAddress
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div class="q-pb-sm">
|
||||
{{ currentProvinceName ? currentProvinceName : "-" }}
|
||||
</div>
|
||||
<div class="q-pb-sm">
|
||||
{{ currentDistrictName ? currentDistrictName : "-" }}
|
||||
</div>
|
||||
<div class="q-pb-sm">
|
||||
{{
|
||||
currentSubDistrictName ? currentSubDistrictName : "-"
|
||||
}}
|
||||
</div>
|
||||
<div class="q-mt-sm">
|
||||
{{
|
||||
personalForm?.currentZipCode
|
||||
? personalForm.currentZipCode
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ที่อยู่ตามทะเบียนบ้าน -->
|
||||
<div class="col-6">
|
||||
<div class="q-pb-sm text-weight-medium text-primary">
|
||||
ที่อยู่ตามทะเบียนบ้าน
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-4 header-sub-text">
|
||||
<div class="q-pb-sm">ที่อยู่</div>
|
||||
<div class="q-pb-sm">จังหวัด</div>
|
||||
<div class="q-pb-sm">เขต/อำเภอ</div>
|
||||
<div class="q-pb-sm">แขวง/ตำบล</div>
|
||||
<div>รหัสไปรษณีย์</div>
|
||||
</div>
|
||||
<div class="col-8 sub-text">
|
||||
<div class="q-pb-sm">
|
||||
{{
|
||||
personalForm?.registAddress
|
||||
? personalForm.registAddress
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div class="q-pb-sm">
|
||||
{{ registProvinceName ? registProvinceName : "-" }}
|
||||
</div>
|
||||
<div class="q-pb-sm">
|
||||
{{ registDistrictName ? registDistrictName : "-" }}
|
||||
</div>
|
||||
<div class="q-pb-sm">
|
||||
{{
|
||||
registSubDistrictName ? registSubDistrictName : "-"
|
||||
}}
|
||||
</div>
|
||||
<div class="q-mt-sm">
|
||||
{{
|
||||
personalForm?.registZipCode
|
||||
? personalForm.registZipCode
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
|
|||
|
|
@ -967,6 +967,28 @@ function onUpdateStatus(id: string) {
|
|||
);
|
||||
}
|
||||
|
||||
function onUpdateDraftStatus(id: string) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.post(config.API.placementUpdateDraftStatus, {
|
||||
personalId: id,
|
||||
});
|
||||
await success($q, "บันทึกสำเร็จ");
|
||||
await getTable();
|
||||
} catch (error) {
|
||||
messageError($q, error);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
},
|
||||
"ยืนยันการยกเลิกการส่งตัว",
|
||||
"ต้องการยกเลิกการส่งตัวรายชื่อนี้ใช่หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await getWorkFlow();
|
||||
await getTable();
|
||||
|
|
@ -1029,6 +1051,30 @@ onMounted(async () => {
|
|||
</q-item-section>
|
||||
<q-item-section>รายละเอียด</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
props.row.isDraft &&
|
||||
props.row.statusId === 'PREPARE-CONTAIN' &&
|
||||
(DataStore.isOfficer || checkPermission($route)?.attrOwnership == 'OWNER')
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="onUpdateDraftStatus(props.row.personalId)"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
color="red"
|
||||
size="xs"
|
||||
name="mdi-account-arrow-left-outline"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>ยกเลิกการส่งตัว</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item
|
||||
v-if="
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ async function fetchDataRetirement() {
|
|||
firstNameTH: filter.value.firstNameTH.trim(),
|
||||
lastNameTH: filter.value.lastNameTH.trim(),
|
||||
});
|
||||
const data: RetirementOld = response.data.data;
|
||||
const data: RetirementOld = response.data.result;
|
||||
pagination.value.rowsNumber = data.totalRecords;
|
||||
rows.value = data.dataRecords;
|
||||
} catch (error) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import config from "@/app.config";
|
|||
|
||||
/** importType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { Director } from "@/modules/11_discipline/interface/request/Disciplinary";
|
||||
import type { Director } from "@/modules/11_discipline/interface/request/disciplinary";
|
||||
import type { Directors } from "@/modules/12_evaluatePersonal/interface/response/Main";
|
||||
|
||||
/** importComponents*/
|
||||
|
|
@ -20,7 +20,14 @@ import DialogDuty from "@/modules/12_evaluatePersonal/components/Detail/viewTab2
|
|||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, dialogConfirm, success } = mixin;
|
||||
const {
|
||||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
dialogConfirm,
|
||||
success,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
|
|
@ -201,6 +208,21 @@ function onEditDuty(data: Director) {
|
|||
modalDuty.value = true;
|
||||
}
|
||||
|
||||
function handleDelete(id: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.delete(config.API.evaluationMain() + `/del-director/${id}`);
|
||||
await props.fetchData();
|
||||
await success($q, "ลบสำเร็จ");
|
||||
} catch (error) {
|
||||
messageError($q, error);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ทำงานเมื่อ props.data มีการเปลี่ยนแปลง
|
||||
*/
|
||||
|
|
@ -268,17 +290,30 @@ watch(
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
flat
|
||||
round
|
||||
denes
|
||||
dense
|
||||
icon="edit"
|
||||
color="edit"
|
||||
@click.stop.prevent="onEditDuty(props.row)"
|
||||
>
|
||||
<q-tooltip>แก้ไขหน้าที่</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="delete"
|
||||
color="red"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'">
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ const {
|
|||
dialogConfirm,
|
||||
date2Thai,
|
||||
success,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
/** props*/
|
||||
|
|
@ -208,6 +209,23 @@ async function getList() {
|
|||
});
|
||||
}
|
||||
|
||||
function handleDelete(meetingId: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.delete(
|
||||
config.API.evaluationMain() + `/del-meeting/${id.value}/${meetingId}`
|
||||
);
|
||||
await props.fetchData();
|
||||
await success($q, "ลบสำเร็จ");
|
||||
} catch (error) {
|
||||
messageError($q, error);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.data,
|
||||
() => {
|
||||
|
|
@ -265,6 +283,7 @@ watch(
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width />
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
|
|
@ -272,6 +291,19 @@ watch(
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="delete"
|
||||
color="red"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ const {
|
|||
dialogConfirm,
|
||||
convertDateToAPI,
|
||||
dialogRemove,
|
||||
dialogMessageNotify,
|
||||
} = useCounterMixin();
|
||||
|
||||
/**
|
||||
|
|
@ -60,7 +61,6 @@ let formData = reactive<FormDataDetail>({
|
|||
});
|
||||
const commandVolume = ref<string>(""); //เล่มที่
|
||||
const commandChapter = ref<string>(""); //ตอนที่
|
||||
const isIdofficer = ref<boolean>(false); //เช็ค สกจ.
|
||||
|
||||
const rows = ref<Array<DataOperators>>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -113,23 +113,22 @@ const visibleColumns = ref<Array<string>>([
|
|||
|
||||
const modalAddOperator = ref<boolean>(false); // แสดงเพิ่มรายชื่อลงนามในแนบท้ายคำสั่ง
|
||||
|
||||
/** ฟังก์ชันเช็ค สกจ.*/
|
||||
async function fetchCheckIdofficer() {
|
||||
await http
|
||||
.get(config.API.checkIdofficer)
|
||||
.then((res) => {
|
||||
isIdofficer.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ฟังก์ชันบันทึกข้อมูลรายละเอียดคำสั่ง
|
||||
* และกำหนด isChangeData เป็น false
|
||||
*/
|
||||
async function onSubmit() {
|
||||
//ถ้าเป็น สกจ. ต้องเลือกประเภทคำสั่งด้วย
|
||||
if (
|
||||
store.isIdofficer &&
|
||||
formData.isBangkok !== "BANGKOK" &&
|
||||
formData.isBangkok !== "OFFICE"
|
||||
) {
|
||||
dialogMessageNotify($q, "กรุณาเลือกคำสั่ง");
|
||||
return;
|
||||
}
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -156,7 +155,7 @@ async function onSubmit() {
|
|||
});
|
||||
}
|
||||
|
||||
/** ฟังกชันดึงข้อมูลรายชื่อเจ้าหน้าที่ดำเนินการ */
|
||||
/** ฟังก์ชันดึงข้อมูลรายชื่อเจ้าหน้าที่ดำเนินการ */
|
||||
async function fetchDataOperatorList() {
|
||||
try {
|
||||
const res = await http.get(
|
||||
|
|
@ -215,7 +214,6 @@ function onDeleteData(id: string) {
|
|||
onMounted(async () => {
|
||||
try {
|
||||
showLoader();
|
||||
await fetchCheckIdofficer();
|
||||
await fetchDataOperatorList();
|
||||
formData.commandNo = props.formCommandList.commandNo;
|
||||
formData.commandYear = props.formCommandList.commandYear;
|
||||
|
|
@ -225,7 +223,7 @@ onMounted(async () => {
|
|||
formData.issue = props.formCommandList.issue;
|
||||
formData.commandAffectDate = props.formCommandList.commandAffectDate;
|
||||
formData.commandExcecuteDate = props.formCommandList.commandExcecuteDate;
|
||||
formData.isBangkok = !isIdofficer.value
|
||||
formData.isBangkok = !store.isIdofficer
|
||||
? null
|
||||
: props.formCommandList.isBangkok;
|
||||
commandCode.value = props.formCommandList.commandCode;
|
||||
|
|
@ -490,7 +488,7 @@ onMounted(async () => {
|
|||
|
||||
<div
|
||||
class="col-12 q-gutter-sm"
|
||||
v-if="isIdofficer && commandCode !== 'C-PM-47'"
|
||||
v-if="store.isIdofficer && commandCode !== 'C-PM-47'"
|
||||
>
|
||||
<q-radio
|
||||
:disable="store.readonly"
|
||||
|
|
|
|||
|
|
@ -292,7 +292,10 @@ function onConfirmOrder() {
|
|||
if (
|
||||
store?.dataCommand?.commandNo !== "" &&
|
||||
store?.dataCommand?.commandAffectDate !== null &&
|
||||
store?.dataCommand?.commandExcecuteDate !== null
|
||||
store?.dataCommand?.commandExcecuteDate !== null &&
|
||||
(!store.isIdofficer ||
|
||||
store?.dataCommand?.isBangkok === "BANGKOK" ||
|
||||
store?.dataCommand?.isBangkok === "OFFICE")
|
||||
) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -316,10 +319,10 @@ function onConfirmOrder() {
|
|||
"คุณต้องการยืนยันการส่งออกคำสั่งใช่หรือไม่?"
|
||||
);
|
||||
} else {
|
||||
dialogMessageNotify(
|
||||
$q,
|
||||
"ไม่สามารถดำเนินการต่อได้ กรุณากรอกเลขที่คำสั่ง วันที่ลงนาม และวันที่คำสั่งมีผลให้ครบ"
|
||||
);
|
||||
const messageWarning = !store.isIdofficer
|
||||
? "ไม่สามารถดำเนินการต่อได้ กรุณากรอกเลขที่คำสั่ง วันที่ลงนาม และวันที่คำสั่งมีผลให้ครบ"
|
||||
: "ไม่สามารถดำเนินการต่อได้ กรุณากรอกเลขที่คำสั่ง วันที่ลงนาม วันที่คำสั่งมีผล และเลือกคำสั่งให้ครบ";
|
||||
dialogMessageNotify($q, messageWarning);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ export const useCommandDetail = defineStore("commandDetailStore", () => {
|
|||
const readonly = ref<boolean>(false);
|
||||
const dataCommand = ref<FormDataDetail>();
|
||||
const status = ref<string>("");
|
||||
const isSalary = ref<boolean>(false)
|
||||
const isSalary = ref<boolean>(false);
|
||||
const isIdofficer = ref<boolean>(false);
|
||||
function checkStep(val: string) {
|
||||
status.value = val;
|
||||
switch (val) {
|
||||
|
|
@ -39,6 +40,7 @@ export const useCommandDetail = defineStore("commandDetailStore", () => {
|
|||
readonly,
|
||||
status,
|
||||
dataCommand,
|
||||
isSalary
|
||||
isSalary,
|
||||
isIdofficer,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -92,12 +92,25 @@ async function fetchDataCommandList() {
|
|||
});
|
||||
}
|
||||
|
||||
/** ฟังก์ชันเช็ค สกจ.*/
|
||||
async function fetchCheckIdofficer() {
|
||||
await http
|
||||
.get(config.API.checkIdofficer)
|
||||
.then((res) => {
|
||||
store.isIdofficer = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
||||
* กำหนดค่า `store.readonly` เมื่อ route.name เป็น "commandViewDetailPage" จะอ่านข้อมูลได้อย่างเดียว
|
||||
*/
|
||||
onMounted(async () => {
|
||||
await fetchDataCommandList();
|
||||
await fetchCheckIdofficer();
|
||||
store.readonly =
|
||||
route.name === "commandViewDetailPage" ||
|
||||
formCommandList.status === "REPORTED" ||
|
||||
|
|
|
|||
|
|
@ -111,17 +111,16 @@ async function fetchSummary() {
|
|||
* ฟังก์ชัน DownloadReport
|
||||
* @param list รายงานที่ต้องการดาวน์โหลด
|
||||
*/
|
||||
async function getReport(list: string) {
|
||||
const listFind = baseDocument.value.find(
|
||||
(item: DataDocument) => item.val == list
|
||||
)?.val;
|
||||
const newReport = listFind === "report2" ? "report2-history" : listFind;
|
||||
async function getReport(valReport: string) {
|
||||
pdfSrc.value = undefined;
|
||||
page.value = 1;
|
||||
isLoadPDF.value = true;
|
||||
if (newReport) {
|
||||
if (valReport) {
|
||||
await http
|
||||
.get(config.API.orgReport(newReport) + `/${organizationId.value}`)
|
||||
.post(config.API.orgReport(valReport), {
|
||||
node: 0,
|
||||
nodeId: organizationId.value,
|
||||
})
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
detailReport.value = data;
|
||||
|
|
@ -414,10 +413,8 @@ onMounted(async () => {
|
|||
color="primary"
|
||||
icon="download"
|
||||
>
|
||||
<q-tooltip>
|
||||
ดาวน์โหลดรายงาน
|
||||
</q-tooltip>
|
||||
|
||||
<q-tooltip> ดาวน์โหลดรายงาน </q-tooltip>
|
||||
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue