ปรับเเก้
This commit is contained in:
parent
d395bcbab5
commit
763f73d872
12 changed files with 1464 additions and 368 deletions
|
|
@ -7,12 +7,15 @@ import type { ResponseTitle } from "@/modules/05_placement/interface/response/Re
|
|||
import type {
|
||||
appointmentData,
|
||||
ResponseData,
|
||||
DataProfile
|
||||
} from "@/modules/05_placement/interface/response/AppointMent";
|
||||
import type { QForm } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
|
||||
|
||||
import CardProfile from "@/components/CardProfile.vue";
|
||||
|
||||
const modalPersonal = ref<boolean>(false);
|
||||
const personId = ref<string>("");
|
||||
const $q = useQuasar();
|
||||
|
|
@ -20,6 +23,8 @@ const route = useRoute();
|
|||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
|
||||
const dataProfile = ref<DataProfile>();
|
||||
|
||||
const appointment = ref<appointmentData>({
|
||||
citizenId: "",
|
||||
prefixId: "",
|
||||
|
|
@ -63,6 +68,7 @@ const fecthappointmentByid = async () => {
|
|||
await http
|
||||
.get(config.API.appointEmployeeByid(paramsId.toString()))
|
||||
.then((res: ResponseData) => {
|
||||
dataProfile.value = res.data.result as unknown as DataProfile;
|
||||
const data = res.data.result;
|
||||
appointment.value = data;
|
||||
profileId.value = data.profileId;
|
||||
|
|
@ -175,56 +181,7 @@ onMounted(async () => {
|
|||
/>
|
||||
รายละเอียดการปรับระดับชั้นงานลูกจ้าง {{ title.fullname }}
|
||||
</div>
|
||||
<q-card bordered class="row col-12 text-dark">
|
||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||
<div class="q-pl-sm text-weight-bold text-subtitle2">
|
||||
{{ title.fullname }}
|
||||
</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
outline
|
||||
color="blue"
|
||||
dense
|
||||
icon-right="mdi-open-in-new"
|
||||
class="q-px-sm"
|
||||
label="ดูข้อมูลทะเบียนประวัติ"
|
||||
@click="onclickViewinfo(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="avatar" v-if="avatar !== ''" />
|
||||
<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">
|
||||
{{ title.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">
|
||||
{{ title.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">
|
||||
{{ title.organizationPositionOld }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
<CardProfile :data="dataProfile as DataProfile" />
|
||||
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -9,8 +9,13 @@ import DialogHeader from "@/modules/05_placement/components/AppointMent/DialogHe
|
|||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
const storeFn = useTransferDataStore();
|
||||
const { statusText } = storeFn;
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
|
||||
const { showLoader, success, messageError, dialogConfirm, hideLoader ,date2Thai} = mixin;
|
||||
|
||||
const $q = useQuasar();
|
||||
const selected = ref<[]>([]);
|
||||
|
|
@ -35,7 +40,7 @@ const visibleColumns2 = ref<string[]>([
|
|||
"citizenId",
|
||||
"fullname",
|
||||
"organizationName",
|
||||
"birthday",
|
||||
"dateOfBirth",
|
||||
]);
|
||||
const columns2 = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
@ -68,7 +73,7 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "organizationName",
|
||||
align: "left",
|
||||
label: "หน่วยงานที่รับการปรับระดับชั้นงาน",
|
||||
label: "หน่วยงานที่รับการแต่งตั้ง-เลื่อน-ย้าย",
|
||||
sortable: true,
|
||||
field: "organizationName",
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -77,11 +82,11 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "birthday",
|
||||
name: "dateOfBirth",
|
||||
align: "left",
|
||||
label: "วัน/เดือน/ปี เกิด",
|
||||
sortable: true,
|
||||
field: "birthday",
|
||||
field: "dateOfBirth",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -115,7 +120,7 @@ const createdAppoint = async () => {
|
|||
let pId: string[] = [];
|
||||
let Type = props.type as string;
|
||||
selected.value.forEach((e: UserData) => {
|
||||
pId.push(e.personalId);
|
||||
pId.push(e.id);
|
||||
});
|
||||
let data = {
|
||||
id: pId,
|
||||
|
|
@ -228,7 +233,7 @@ watchEffect(() => {
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-td auto-width>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
|
|
@ -236,59 +241,64 @@ watchEffect(() => {
|
|||
v-model="props.selected"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="citizenId" :props="props">
|
||||
{{ props.row.citizenId }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props">
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="organizationName" :props="props">
|
||||
{{ props.row.orgName !== null ? props.row.orgName : "-" }}
|
||||
{{
|
||||
props.row.organizationShortName !== null
|
||||
? `(${props.row.organizationShortName})`
|
||||
: ""
|
||||
}}
|
||||
<!-- <div
|
||||
v-if="
|
||||
props.row.orgName !== null ||
|
||||
props.row.positionPath !== null
|
||||
"
|
||||
>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
{{
|
||||
props.row.firstName
|
||||
? `${props.row.prefix ?? ""}${
|
||||
props.row.firstName ?? ""
|
||||
} ${props.row.lastName ?? ""}`
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
|
||||
<!-- <div v-else-if="col.name == 'status'">
|
||||
{{ props.row.status ? statusText(props.row.status) : "-" }}
|
||||
</div> -->
|
||||
<div v-else-if="col.name == 'dateOfBirth'">
|
||||
{{
|
||||
props.row.dateOfBirth
|
||||
? date2Thai(props.row.dateOfBirth)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'organizationName'">
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.orgName !== null ? props.row.orgName : "-" }}
|
||||
{{ props.row.root !== null ? props.row.root : "-" }}
|
||||
{{
|
||||
props.row.organizationShortName !== null
|
||||
? `(${props.row.organizationShortName})`
|
||||
props.row.rootShortName !== null
|
||||
? `(${props.row.rootShortName})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{
|
||||
props.row.positionPath !== null
|
||||
? props.row.positionPath
|
||||
: "-"
|
||||
props.row.nodeName !== null ? props.row.nodeName : ""
|
||||
}}
|
||||
{{
|
||||
props.row.positionNumber !== null
|
||||
? `(${props.row.positionNumber})`
|
||||
props.row.nodeShortName !== null
|
||||
? `(${props.row.nodeShortName}${props.row.posMasterNo})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'createdAt'">
|
||||
{{
|
||||
props.row.createdAt ? date2Thai(props.row.createdAt) : "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">-</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</q-td>
|
||||
<q-td key="birthday" :props="props">
|
||||
{{ props.row.birthday }}
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,13 @@ import type { OpType } from "@/modules/05_placement/interface/response/Main";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import DialogOrgSelectEmployee from "@/components/Dialogs/DialogOrgSelectEmployee.vue";
|
||||
|
||||
const posType = ref<string>("");
|
||||
const posLevel = ref<string>("");
|
||||
const position = ref<string>("");
|
||||
const dataRows = ref<any[]>([]);
|
||||
|
||||
const $q = useQuasar();
|
||||
const modal = ref<boolean>(false);
|
||||
const storeFn = useTransferDataStore();
|
||||
|
|
@ -205,7 +212,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "organizationName",
|
||||
align: "left",
|
||||
label: "หน่วยงานที่รับการปรับระดับชั้นงาน",
|
||||
label: "หน่วยงานที่รับการแต่งตั้ง-เลื่อน-ย้าย",
|
||||
sortable: true,
|
||||
field: "organizationName",
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -252,29 +259,31 @@ const fecthlistappointment = async () => {
|
|||
.then((res) => {
|
||||
let response = res.data.result;
|
||||
listRecevice.value = response;
|
||||
rows.value = response.map((e: resData) => ({
|
||||
personalId: e.id,
|
||||
citizenId: e.citizenId,
|
||||
fullname: e.prefix + e.firstname + " " + e.lastname,
|
||||
organizationName: e.organizationName + " " + e.organizationShortName,
|
||||
orgName: e.organizationName,
|
||||
organizationShortName: e.organizationShortName,
|
||||
status: statusText(e.status),
|
||||
createdAt: date2Thai(e.createdAt),
|
||||
birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth),
|
||||
educationOld: e.educationOld,
|
||||
organizationPositionOld: e.organizationPositionOld,
|
||||
positionTypeOld: e.positionTypeOld,
|
||||
positionLevelOld: e.positionLevelOld,
|
||||
positionNumberOld: e.positionNumberOld,
|
||||
salary: e.salary,
|
||||
positionDate: e.positionDate,
|
||||
}));
|
||||
rows.value = response
|
||||
// rows.value = response.map((e: resData) => ({
|
||||
// personalId: e.id,
|
||||
// citizenId: e.citizenId,
|
||||
// fullname: e.prefix + e.firstname + " " + e.lastname,
|
||||
// organizationName: e.organizationName + " " + e.organizationShortName,
|
||||
// orgName: e.organizationName,
|
||||
// organizationShortName: e.organizationShortName,
|
||||
// status: statusText(e.status),
|
||||
// createdAt: date2Thai(e.createdAt),
|
||||
// birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth),
|
||||
// educationOld: e.educationOld,
|
||||
// organizationPositionOld: e.organizationPositionOld,
|
||||
// positionTypeOld: e.positionTypeOld,
|
||||
// positionLevelOld: e.positionLevelOld,
|
||||
// positionNumberOld: e.positionNumberOld,
|
||||
// salary: e.salary,
|
||||
// positionDate: e.positionDate,
|
||||
// }));
|
||||
|
||||
rows2.value = rows.value.filter(
|
||||
(e: orgFilter) =>
|
||||
e.orgName !== null &&
|
||||
e.status !== "ส่งรายชื่อไปออกคำสั่ง" &&
|
||||
e.status !== "ออกคำสั่งเสร็จแล้ว" &&
|
||||
(e: any) =>
|
||||
e.root !== null &&
|
||||
e.status !== "REPORT" &&
|
||||
e.status !== "DONE" &&
|
||||
e.educationOld &&
|
||||
e.organizationPositionOld &&
|
||||
e.positionTypeOld &&
|
||||
|
|
@ -474,6 +483,54 @@ const savePosition = async () => {
|
|||
// id.value = "";
|
||||
// }
|
||||
// };
|
||||
|
||||
|
||||
|
||||
|
||||
function openModalTree(data:any){
|
||||
modalTree.value = true
|
||||
|
||||
personalId.value = data.id;
|
||||
dataRows.value = data;
|
||||
posType.value = data.posTypeId;
|
||||
posLevel.value = data.posLevelId;
|
||||
position.value = data.positionName;
|
||||
}
|
||||
|
||||
function onSave(data: any) {
|
||||
console.log("not save", data);
|
||||
const dataAppoint = {
|
||||
// personalId: data.personalId,
|
||||
node: data.node,
|
||||
nodeId: data.nodeId,
|
||||
orgRevisionId: data.orgRevisionId,
|
||||
positionId: data.positionId,
|
||||
posMasterNo: data.posMasterNo,
|
||||
positionName: data.positionName,
|
||||
posTypeId: data.posTypeId,
|
||||
posTypeName: data.posTypeName,
|
||||
posLevelId: data.posLevelId,
|
||||
posLevelName: data.posLevelName,
|
||||
reportingDate: data.reportingDate,
|
||||
posmasterId: data.posmasterId,
|
||||
};
|
||||
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.appointmentPosition(personalId.value), dataAppoint)
|
||||
.then((res) => {
|
||||
modalTree.value = false;
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
fecthlistappointment();
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
|
|
@ -554,76 +611,64 @@ const savePosition = async () => {
|
|||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
key="no"
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
@click="nextPage(props.row.id)"
|
||||
>
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="citizenId"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.citizenId }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="fullname"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="organizationName"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
<div
|
||||
v-if="
|
||||
props.row.orgName !== null ||
|
||||
props.row.positionPath !== null
|
||||
"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
{{
|
||||
props.row.firstName
|
||||
? `${props.row.prefix ?? ""}${
|
||||
props.row.firstName ?? ""
|
||||
} ${props.row.lastName ?? ""}`
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div v-else-if="col.name == 'status'">
|
||||
{{ props.row.status ? statusText(props.row.status) : "-" }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'dateOfBirth'">
|
||||
{{
|
||||
props.row.dateOfBirth
|
||||
? date2Thai(props.row.dateOfBirth)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'organizationName'">
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.root !== null ? props.row.root : "-" }}
|
||||
{{
|
||||
props.row.orgName !== null ? props.row.orgName : "-"
|
||||
props.row.rootShortName !== null
|
||||
? `(${props.row.rootShortName})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{
|
||||
props.row.nodeName !== null ? props.row.nodeName : ""
|
||||
}}
|
||||
{{
|
||||
props.row.organizationShortName !== null
|
||||
? `(${props.row.organizationShortName})`
|
||||
props.row.nodeShortName !== null
|
||||
? `(${props.row.nodeShortName}${props.row.posMasterNo})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">-</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'createdAt'">
|
||||
{{
|
||||
props.row.createdAt ? date2Thai(props.row.createdAt) : "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td
|
||||
key="birthday"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.birthday }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="createdAt"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.createdAt }}
|
||||
</q-td>
|
||||
<q-td
|
||||
key="status"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.status }}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
|
|
@ -643,7 +688,7 @@ const savePosition = async () => {
|
|||
transition-hide="jump-up"
|
||||
>
|
||||
<q-list dense style="min-width: 200px">
|
||||
<q-item
|
||||
<!-- <q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openModalEmployee(props.row.personalId)"
|
||||
|
|
@ -660,11 +705,29 @@ const savePosition = async () => {
|
|||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>กำหนดตำแหน่ง</q-item-section>
|
||||
</q-item> -->
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openModalTree(props.row)"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
color="primary"
|
||||
size="xs"
|
||||
name="mdi-bookmark-outline"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>หน่วยงานที่รับการปรับระดับชั้นงาน</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="clickDelete(props.row.personalId)"
|
||||
@click="clickDelete(props.row.id)"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
|
|
@ -783,5 +846,16 @@ const savePosition = async () => {
|
|||
:personal="personal"
|
||||
:personalId="personalId"
|
||||
/> -->
|
||||
|
||||
<DialogOrgSelectEmployee
|
||||
:title="`เลือกหน่วยงานที่รับการปรับระดับชั้นงาน`"
|
||||
v-model:modal="modalTree"
|
||||
:posType="posType"
|
||||
:posLevel="posLevel"
|
||||
:position="position"
|
||||
:dataRows="dataRows"
|
||||
:onSubmit="onSave"
|
||||
/>
|
||||
|
||||
</template>
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import Document from "@/modules/05_placement/components/PersonalDetail/Informati
|
|||
import {
|
||||
AddressDataDefualt,
|
||||
FamilyDataDefualt,
|
||||
|
||||
} from "@/modules/05_placement/interface/index/Main";
|
||||
|
||||
import type {
|
||||
|
|
@ -32,6 +33,8 @@ import type {
|
|||
Family,
|
||||
Address,
|
||||
Certificate,
|
||||
optionData,
|
||||
InformationOps
|
||||
} from "@/modules/05_placement/interface/index/Main";
|
||||
|
||||
import type { Information } from "@/modules/05_placement/components/PersonalDetail/profileType";
|
||||
|
|
@ -99,11 +102,7 @@ const FamilyData = ref<Family>(FamilyDataDefualt);
|
|||
const AddressData = ref<Address>(AddressDataDefualt);
|
||||
const CertificateData = ref<Certificate[]>([]);
|
||||
|
||||
onMounted(async () => {
|
||||
// await checkProfileData();
|
||||
await fetchData();
|
||||
await changeTab("information");
|
||||
});
|
||||
|
||||
|
||||
const guidCheck = (id: string) => {
|
||||
if (id == "00000000-0000-0000-0000-000000000000") {
|
||||
|
|
@ -112,9 +111,40 @@ const guidCheck = (id: string) => {
|
|||
return id;
|
||||
};
|
||||
|
||||
const Ops = ref<InformationOps>({
|
||||
prefixOps: [],
|
||||
genderOps: [],
|
||||
bloodOps: [],
|
||||
statusOps: [],
|
||||
religionOps: [],
|
||||
employeeClassOps: [
|
||||
{ id: "gov", name: "งบประมาณเงินอุดหนุนรัฐบาล" },
|
||||
{ id: "bkk", name: "งบประมาณกรุงเทพมหานคร" },
|
||||
],
|
||||
employeeTypeOps: [
|
||||
{ id: "gov", name: "งบประมาณเงินอุดหนุนรัฐบาล" },
|
||||
{ id: "bkk", name: "งบประมาณกรุงเทพมหานคร" },
|
||||
],
|
||||
});
|
||||
|
||||
const OpsFilter = ref<InformationOps>({
|
||||
prefixOps: [],
|
||||
genderOps: [],
|
||||
bloodOps: [],
|
||||
statusOps: [],
|
||||
religionOps: [],
|
||||
employeeClassOps: [
|
||||
{ id: "gov", name: "งบประมาณเงินอุดหนุนรัฐบาล" },
|
||||
{ id: "bkk", name: "งบประมาณกรุงเทพมหานคร" },
|
||||
],
|
||||
employeeTypeOps: [
|
||||
{ id: "gov", name: "งบประมาณเงินอุดหนุนรัฐบาล" },
|
||||
{ id: "bkk", name: "งบประมาณกรุงเทพมหานคร" },
|
||||
],
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
storePersonal.loading = false;
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.placementPersonalId(examId.value))
|
||||
.then((res: any) => {
|
||||
|
|
@ -235,10 +265,218 @@ const fetchData = async () => {
|
|||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
});
|
||||
};
|
||||
|
||||
const fetchDataByType = async (type: string) => {
|
||||
// storePersonal.loading = false;
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.placementPersonalId(examId.value))
|
||||
.then((res: any) => {
|
||||
const data = res.data.result;
|
||||
storePersonal.fecthDataInformation(data);
|
||||
personalData.value.fullName = data.fullName;
|
||||
personalData.value.id = data.personalId;
|
||||
|
||||
if (type == "Information") {
|
||||
InformationData.value.idCard = data.idCard;
|
||||
InformationData.value.fullName = data.fullName;
|
||||
InformationData.value.firstname = data.firstname;
|
||||
InformationData.value.lastname = data.lastname;
|
||||
InformationData.value.nationality = data.nationality;
|
||||
InformationData.value.race = data.race;
|
||||
InformationData.value.genderId = guidCheck(data.gender) ?? "";
|
||||
InformationData.value.prefixId = guidCheck(data.prefix) ?? "";
|
||||
InformationData.value.relationshipId =
|
||||
guidCheck(data.relationship) ?? "";
|
||||
InformationData.value.religionId = guidCheck(data.religion) ?? "";
|
||||
InformationData.value.bloodGroupId = guidCheck(data.bloodGroup) ?? "";
|
||||
InformationData.value.dateOfBirth = new Date(data.dateOfBirth);
|
||||
InformationData.value.age = data.age;
|
||||
InformationData.value.telephone = data.telephone;
|
||||
} else if (type == "Address") {
|
||||
AddressData.value.registAddress = data.registAddress ?? "";
|
||||
AddressData.value.currentAddress = data.currentAddress ?? "";
|
||||
AddressData.value.registSame = data.registSame ? "1" : "0";
|
||||
AddressData.value.registSubDistrict = data.registSubDistrict ?? "";
|
||||
AddressData.value.registSubDistrictId =
|
||||
guidCheck(data.registSubDistrictId) ?? "";
|
||||
AddressData.value.registZipCode = data.registZipCode ?? "";
|
||||
AddressData.value.registDistrict = data.registDistrict ?? "";
|
||||
AddressData.value.registDistrictId =
|
||||
guidCheck(data.registDistrictId) ?? "";
|
||||
AddressData.value.registProvince = data.registProvince ?? "";
|
||||
AddressData.value.registProvinceId =
|
||||
guidCheck(data.registProvinceId) ?? "";
|
||||
AddressData.value.currentSubDistrict = data.currentSubDistrict ?? "";
|
||||
AddressData.value.currentSubDistrictId =
|
||||
guidCheck(data.currentSubDistrictId) ?? "";
|
||||
AddressData.value.currentZipCode = data.currentZipCode ?? "";
|
||||
AddressData.value.currentDistrict = data.currentDistrict ?? "";
|
||||
AddressData.value.currentDistrictId =
|
||||
guidCheck(data.currentDistrictId) ?? "";
|
||||
AddressData.value.currentProvince = data.currentProvince ?? "";
|
||||
AddressData.value.currentProvinceId =
|
||||
guidCheck(data.currentProvinceId) ?? "";
|
||||
} else if (type == "Family") {
|
||||
FamilyData.value.couple = data.couple ? "1" : "0";
|
||||
FamilyData.value.marryPrefix = data.marryPrefix ?? "";
|
||||
FamilyData.value.marryPrefixId = guidCheck(data.marryPrefix) ?? "";
|
||||
FamilyData.value.marryFirstName = data.marryFirstName ?? "";
|
||||
FamilyData.value.marryLastName = data.marryLastName ?? "";
|
||||
FamilyData.value.marryOccupation = data.marryOccupation ?? "";
|
||||
FamilyData.value.fatherPrefix = data.fatherPrefix ?? "";
|
||||
FamilyData.value.fatherPrefixId = guidCheck(data.fatherPrefix) ?? "";
|
||||
FamilyData.value.fatherFirstName = data.fatherFirstName ?? "";
|
||||
FamilyData.value.fatherLastName = data.fatherLastName ?? "";
|
||||
FamilyData.value.fatherOccupation = data.fatherOccupation ?? "";
|
||||
FamilyData.value.motherPrefix = data.motherPrefix ?? "";
|
||||
FamilyData.value.motherPrefixId = guidCheck(data.motherPrefix) ?? "";
|
||||
FamilyData.value.motherFirstName = data.motherFirstName ?? "";
|
||||
FamilyData.value.motherLastName = data.motherLastName ?? "";
|
||||
FamilyData.value.motherOccupation = data.motherOccupation ?? "";
|
||||
} else if (type == "Exam") {
|
||||
ExamData.value.pointA = data.pointA;
|
||||
ExamData.value.pointB = data.pointB;
|
||||
ExamData.value.pointC = data.pointC;
|
||||
ExamData.value.point = data.point;
|
||||
ExamData.value.pointTotalA = data.pointTotalA;
|
||||
ExamData.value.pointTotalB = data.pointTotalB;
|
||||
ExamData.value.pointTotalC = data.pointTotalC;
|
||||
ExamData.value.pointTotal = data.pointTotal;
|
||||
ExamData.value.examNumber = data.examNumber;
|
||||
ExamData.value.examRound = data.examRound;
|
||||
ExamData.value.pass = data.pass;
|
||||
}
|
||||
|
||||
QualificationData.value = data.isProperty;
|
||||
|
||||
let listRow: Education[] = [];
|
||||
data.education.map((row: any) => {
|
||||
listRow.push({
|
||||
id: guidCheck(row.id) ?? "",
|
||||
educationLevel: row.educationLevel ?? "",
|
||||
educationLevelId: guidCheck(row.educationLevelId) ?? "",
|
||||
institute: row.institute ?? "",
|
||||
degree: row.degree ?? "",
|
||||
field: row.field ?? "",
|
||||
gpa: row.gpa ?? "",
|
||||
country: row.country ?? "",
|
||||
duration: row.duration ?? "",
|
||||
other: row.other ?? "",
|
||||
fundName: row.fundName ?? "",
|
||||
durationYear: row.durationYear ?? 0,
|
||||
finishDate: row.finishDate ?? new Date(),
|
||||
isDate: row.isDate ? "true" : "false",
|
||||
startDate: row.startDate ? new Date(row.startDate) : new Date(),
|
||||
endDate: row.endDate ? new Date(row.endDate) : new Date(),
|
||||
positionPath: row.positionPath ?? "",
|
||||
isEducation: row.isEducation ? true : false,
|
||||
});
|
||||
});
|
||||
EducationData.value = listRow;
|
||||
|
||||
let listCert: Certificate[] = [];
|
||||
|
||||
data.certificates.map((row: any) => {
|
||||
listCert.push({
|
||||
id: guidCheck(row.id) ?? "",
|
||||
certificateNo: guidCheck(row.certificateNo) ?? "",
|
||||
issuer: row.issuer ?? "",
|
||||
issueDate: new Date(row.issueDate) ?? new Date(),
|
||||
expireDate: new Date(row.expireDate) ?? new Date(),
|
||||
certificateType: row.certificateType ?? "",
|
||||
});
|
||||
});
|
||||
CertificateData.value = listCert;
|
||||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* get รายการ ข้อมูลเกี่ยวกับบุคคล
|
||||
*/
|
||||
const fetchPerson = async () => {
|
||||
await http
|
||||
.get(config.API.profileNewMetaMain)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
|
||||
//กรุ๊ปเลือด
|
||||
let optionbloodGroups: optionData[] = [];
|
||||
data.bloodGroups.map((r: any) => {
|
||||
optionbloodGroups.push({
|
||||
id: r.name ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.bloodOps = optionbloodGroups;
|
||||
OpsFilter.value.bloodOps = optionbloodGroups;
|
||||
|
||||
//เพศ
|
||||
let optiongenders: optionData[] = [];
|
||||
data.genders.map((r: any) => {
|
||||
optiongenders.push({
|
||||
id: r.name ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.genderOps = optiongenders;
|
||||
OpsFilter.value.genderOps = optiongenders;
|
||||
|
||||
//คำนำหน้าชื่อ
|
||||
let optionprefixs: optionData[] = [];
|
||||
data.prefixs.map((r: any) => {
|
||||
optionprefixs.push({
|
||||
id: r.name ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.prefixOps = optionprefixs;
|
||||
OpsFilter.value.prefixOps = optionprefixs;
|
||||
|
||||
//สถานภาพ
|
||||
let optionrelationships: optionData[] = [];
|
||||
data.relationships.map((r: any) => {
|
||||
optionrelationships.push({
|
||||
id: r.name ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.statusOps = optionrelationships;
|
||||
OpsFilter.value.statusOps = optionrelationships;
|
||||
|
||||
//ศาสนา
|
||||
let optionreligions: optionData[] = [];
|
||||
data.religions.map((r: any) => {
|
||||
optionreligions.push({
|
||||
id: r.name ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.religionOps = optionreligions;
|
||||
OpsFilter.value.religionOps = optionreligions;
|
||||
})
|
||||
.catch((e: any) => {})
|
||||
.finally(() => {
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
// await checkProfileData();
|
||||
|
||||
await fetchData();
|
||||
await changeTab("information");
|
||||
await fetchPerson()
|
||||
});
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8 row q-pb-sm">
|
||||
|
|
@ -262,13 +500,15 @@ const fetchData = async () => {
|
|||
<Informationvue
|
||||
v-model:statusEdit="statusEdit"
|
||||
v-model:data="InformationData"
|
||||
:fetch="fetchData"
|
||||
:fetch="fetchDataByType"
|
||||
:Ops="Ops"
|
||||
:OpsFilter="OpsFilter"
|
||||
/>
|
||||
<div class="col-12 q-px-md"><q-separator size="4px" /></div>
|
||||
<Addressvue
|
||||
v-model:statusEdit="statusEdit"
|
||||
v-model:data="AddressData"
|
||||
:fetch="fetchData"
|
||||
:fetch="fetchDataByType"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -277,7 +517,9 @@ const fetchData = async () => {
|
|||
<Familyvue
|
||||
v-model:statusEdit="statusEdit"
|
||||
v-model:data="FamilyData"
|
||||
:fetch="fetchData"
|
||||
:fetch="fetchDataByType"
|
||||
:Ops="Ops"
|
||||
:OpsFilter="OpsFilter"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ const {
|
|||
dialogConfirm,
|
||||
} = mixin;
|
||||
const edit = ref<boolean>(false);
|
||||
const onEdit = ref<boolean>(false);
|
||||
const addressData = ref<AddressType>(props.data);
|
||||
const myform = ref<any>();
|
||||
const Ops = ref<AddressOps>({
|
||||
|
|
@ -133,9 +134,21 @@ const filterSelector = (val: any, update: Function, refData: string) => {
|
|||
|
||||
const refreshData = async () => {
|
||||
myform.value.reset();
|
||||
// await props.fetch();
|
||||
await fetchProvince();
|
||||
await getNewData();
|
||||
if (onEdit.value) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
emit("update:statusEdit", false);
|
||||
await props.fetch("Address");
|
||||
edit.value = false;
|
||||
onEdit.value = false;
|
||||
},
|
||||
`ข้อมูลมีการแก้ไข`,
|
||||
`ยืนยันยกเลิกการแก้ไขใช่หรือไม่?`
|
||||
);
|
||||
} else {
|
||||
edit.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const getNewData = async () => {
|
||||
|
|
@ -145,7 +158,7 @@ const getNewData = async () => {
|
|||
|
||||
// บันทึกข้อมูล
|
||||
const editData = async () => {
|
||||
dialogConfirm($q, async() => {
|
||||
dialogConfirm($q, async () => {
|
||||
const body = {
|
||||
registrationSame: addressData.value.registSame == "1",
|
||||
registrationAddress: addressData.value.registAddress,
|
||||
|
|
@ -189,8 +202,7 @@ const editData = async () => {
|
|||
.finally(async () => {
|
||||
edit.value = false;
|
||||
emit("update:statusEdit", false);
|
||||
await getNewData();
|
||||
await props.fetch();
|
||||
await props.fetch("Address");
|
||||
// await fetchProvince();
|
||||
});
|
||||
});
|
||||
|
|
@ -326,7 +338,7 @@ const fetchDistrict = async (id: string | null, position: string) => {
|
|||
if (id != null && id != "") {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgProvince+`/${id}`)
|
||||
.get(config.API.orgProvince + `/${id}`)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result.districts;
|
||||
let option: optionData[] = [];
|
||||
|
|
@ -372,7 +384,7 @@ const fetchSubDistrict = async (id: string | null, position: string) => {
|
|||
if (id != null && id != "") {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.orgDistrict+`/${id}`)
|
||||
.get(config.API.orgDistrict + `/${id}`)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result.subDistricts;
|
||||
let option: zipCodeOption[] = [];
|
||||
|
|
@ -420,7 +432,6 @@ const fetchSubDistrict = async (id: string | null, position: string) => {
|
|||
const changeBtn = async () => {
|
||||
if (edit.value == true) {
|
||||
if (props.statusEdit === true) {
|
||||
edit.value = false;
|
||||
props.notiNoEdit();
|
||||
} else {
|
||||
emit("update:statusEdit", true);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,12 @@ const props = defineProps({
|
|||
type: Object as PropType<Family>,
|
||||
default: FamilyDataDefualt,
|
||||
},
|
||||
Ops: {
|
||||
type: Object as PropType<any>,
|
||||
},
|
||||
OpsFilter: {
|
||||
type: Object as PropType<any>,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["update:statusEdit"]);
|
||||
|
||||
|
|
@ -45,26 +51,18 @@ const {
|
|||
dialogConfirm,
|
||||
} = mixin;
|
||||
const edit = ref<boolean>(false);
|
||||
const onEdit = ref<boolean>(false);
|
||||
|
||||
const myform = ref<QForm | null>(null);
|
||||
const familyData = ref<Family>(props.data);
|
||||
|
||||
const Ops = ref<any>({
|
||||
prefixOps: [],
|
||||
});
|
||||
const OpsFilter = ref<any>({
|
||||
prefixOps: [],
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchPrefix();
|
||||
|
||||
emit("update:statusEdit", false);
|
||||
});
|
||||
|
||||
const filterSelector = (val: any, update: Function, refData: string) => {
|
||||
update(() => {
|
||||
Ops.value[`${refData}`] = OpsFilter.value[`${refData}`].filter(
|
||||
props.Ops[`${refData}`] = props.OpsFilter[`${refData}`].filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
|
|
@ -74,29 +72,21 @@ const refreshData = async () => {
|
|||
if (myform.value != null) {
|
||||
myform.value.reset();
|
||||
}
|
||||
emit("update:statusEdit", false);
|
||||
await props.fetch();
|
||||
};
|
||||
|
||||
const fetchPrefix = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileNewMetaMain)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
data.prefixs.map((r: any) => {
|
||||
option.push({ id: r.name.toString(), name: r.name.toString() });
|
||||
});
|
||||
Ops.value.prefixOps = option;
|
||||
OpsFilter.value.prefixOps = option;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
if (onEdit.value) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
emit("update:statusEdit", false);
|
||||
await props.fetch("Family");
|
||||
edit.value = false;
|
||||
onEdit.value = false;
|
||||
},
|
||||
`ข้อมูลมีการแก้ไข`,
|
||||
`ยืนยันยกเลิกการแก้ไขใช่หรือไม่?`
|
||||
);
|
||||
} else {
|
||||
edit.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const editData = async () => {
|
||||
|
|
@ -153,7 +143,7 @@ const editData = async () => {
|
|||
hideLoader();
|
||||
edit.value = false;
|
||||
emit("update:statusEdit", false);
|
||||
await props.fetch();
|
||||
await props.fetch("Family");
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,10 +9,6 @@ import type {
|
|||
} from "@/modules/05_placement/components/PersonalDetail/profileType";
|
||||
import { defaultInformation } from "@/modules/05_placement/components/PersonalDetail/profileType";
|
||||
|
||||
import type {
|
||||
InformationOps,
|
||||
optionData,
|
||||
} from "@/modules/05_placement/interface/index/Main";
|
||||
import HeaderTop from "@/modules/05_placement/components/PersonalDetail/Information/top.vue";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
|
|
@ -40,6 +36,12 @@ const props = defineProps({
|
|||
type: Object as PropType<Information>,
|
||||
default: defaultInformation,
|
||||
},
|
||||
Ops: {
|
||||
type: Object as PropType<any>,
|
||||
},
|
||||
OpsFilter: {
|
||||
type: Object as PropType<any>,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["update:statusEdit"]);
|
||||
|
||||
|
|
@ -63,39 +65,8 @@ const edit = ref<boolean>(false);
|
|||
const informaData = ref<Information>(props.data);
|
||||
const age = ref<boolean>(true);
|
||||
const myform = ref<QForm | null>(null);
|
||||
const Ops = ref<InformationOps>({
|
||||
prefixOps: [],
|
||||
genderOps: [],
|
||||
bloodOps: [],
|
||||
statusOps: [],
|
||||
religionOps: [],
|
||||
employeeClassOps: [
|
||||
{ id: "gov", name: "งบประมาณเงินอุดหนุนรัฐบาล" },
|
||||
{ id: "bkk", name: "งบประมาณกรุงเทพมหานคร" },
|
||||
],
|
||||
employeeTypeOps: [
|
||||
{ id: "gov", name: "งบประมาณเงินอุดหนุนรัฐบาล" },
|
||||
{ id: "bkk", name: "งบประมาณกรุงเทพมหานคร" },
|
||||
],
|
||||
});
|
||||
const OpsFilter = ref<InformationOps>({
|
||||
prefixOps: [],
|
||||
genderOps: [],
|
||||
bloodOps: [],
|
||||
statusOps: [],
|
||||
religionOps: [],
|
||||
employeeClassOps: [
|
||||
{ id: "gov", name: "งบประมาณเงินอุดหนุนรัฐบาล" },
|
||||
{ id: "bkk", name: "งบประมาณกรุงเทพมหานคร" },
|
||||
],
|
||||
employeeTypeOps: [
|
||||
{ id: "gov", name: "งบประมาณเงินอุดหนุนรัฐบาล" },
|
||||
{ id: "bkk", name: "งบประมาณกรุงเทพมหานคร" },
|
||||
],
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchPerson();
|
||||
emit("update:statusEdit", false);
|
||||
});
|
||||
|
||||
|
|
@ -103,127 +74,72 @@ const onCancel = async () => {
|
|||
if (myform.value != null) {
|
||||
myform.value.reset();
|
||||
}
|
||||
await props.fetch();
|
||||
};
|
||||
if (onEdit.value) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
emit("update:statusEdit", false);
|
||||
await props.fetch("Information");
|
||||
edit.value = false;
|
||||
onEdit.value = false;
|
||||
},
|
||||
`ข้อมูลมีการแก้ไข`,
|
||||
`ยืนยันยกเลิกการแก้ไขใช่หรือไม่?`
|
||||
);
|
||||
|
||||
/**
|
||||
* get รายการ ข้อมูลเกี่ยวกับบุคคล
|
||||
*/
|
||||
const fetchPerson = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.profileNewMetaMain)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
|
||||
//กรุ๊ปเลือด
|
||||
let optionbloodGroups: optionData[] = [];
|
||||
data.bloodGroups.map((r: any) => {
|
||||
optionbloodGroups.push({
|
||||
id: r.name ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.bloodOps = optionbloodGroups;
|
||||
OpsFilter.value.bloodOps = optionbloodGroups;
|
||||
|
||||
//เพศ
|
||||
let optiongenders: optionData[] = [];
|
||||
data.genders.map((r: any) => {
|
||||
optiongenders.push({
|
||||
id: r.name ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.genderOps = optiongenders;
|
||||
OpsFilter.value.genderOps = optiongenders;
|
||||
|
||||
//คำนำหน้าชื่อ
|
||||
let optionprefixs: optionData[] = [];
|
||||
data.prefixs.map((r: any) => {
|
||||
optionprefixs.push({
|
||||
id: r.name ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.prefixOps = optionprefixs;
|
||||
OpsFilter.value.prefixOps = optionprefixs;
|
||||
|
||||
//สถานภาพ
|
||||
let optionrelationships: optionData[] = [];
|
||||
data.relationships.map((r: any) => {
|
||||
optionrelationships.push({
|
||||
id: r.name ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.statusOps = optionrelationships;
|
||||
OpsFilter.value.statusOps = optionrelationships;
|
||||
|
||||
//ศาสนา
|
||||
let optionreligions: optionData[] = [];
|
||||
data.religions.map((r: any) => {
|
||||
optionreligions.push({
|
||||
id: r.name ?? "",
|
||||
name: r.name ?? "",
|
||||
});
|
||||
});
|
||||
Ops.value.religionOps = optionreligions;
|
||||
OpsFilter.value.religionOps = optionreligions;
|
||||
})
|
||||
.catch((e: any) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
|
||||
} else {
|
||||
edit.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const filterSelector = (val: any, update: Function, refData: string) => {
|
||||
switch (refData) {
|
||||
case "prefixOps":
|
||||
update(() => {
|
||||
Ops.value.prefixOps = OpsFilter.value.prefixOps.filter(
|
||||
props.Ops.prefixOps = props.OpsFilter.prefixOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "genderOps":
|
||||
update(() => {
|
||||
Ops.value.genderOps = OpsFilter.value.genderOps.filter(
|
||||
props.Ops.genderOps = props.OpsFilter.genderOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "bloodOps":
|
||||
update(() => {
|
||||
Ops.value.bloodOps = OpsFilter.value.bloodOps.filter(
|
||||
props.Ops.bloodOps = props.OpsFilter.bloodOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "statusOps":
|
||||
update(() => {
|
||||
Ops.value.statusOps = OpsFilter.value.statusOps.filter(
|
||||
props.Ops.statusOps = props.OpsFilter.statusOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "religionOps":
|
||||
update(() => {
|
||||
Ops.value.religionOps = OpsFilter.value.religionOps.filter(
|
||||
props.Ops.religionOps = props.OpsFilter.religionOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "employeeClassOps":
|
||||
update(() => {
|
||||
Ops.value.employeeClassOps = OpsFilter.value.employeeClassOps.filter(
|
||||
props.Ops.employeeClassOps = props.OpsFilter.employeeClassOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "employeeTypeOps":
|
||||
update(() => {
|
||||
Ops.value.employeeTypeOps = OpsFilter.value.employeeTypeOps.filter(
|
||||
props.Ops.employeeTypeOps = props.OpsFilter.employeeTypeOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
|
|
@ -237,6 +153,7 @@ const filterSelector = (val: any, update: Function, refData: string) => {
|
|||
const handleDate = async (modelData: Date) => {
|
||||
informaData.value.dateOfBirth = modelData;
|
||||
await calRetire(modelData);
|
||||
onEdit.value = true;
|
||||
};
|
||||
|
||||
const calRetire = async (birth: Date) => {
|
||||
|
|
@ -299,7 +216,7 @@ const editData = async () => {
|
|||
.finally(async () => {
|
||||
edit.value = false;
|
||||
emit("update:statusEdit", false);
|
||||
await props.fetch();
|
||||
await props.fetch("Information");
|
||||
await changeBirth(informaData.value.dateOfBirth ?? new Date());
|
||||
});
|
||||
});
|
||||
|
|
@ -318,7 +235,6 @@ const saveData = async () => {
|
|||
const changeBtn = async () => {
|
||||
if (edit.value == true) {
|
||||
if (props.statusEdit === true) {
|
||||
edit.value = false;
|
||||
props.notiNoEdit();
|
||||
} else {
|
||||
emit("update:statusEdit", true);
|
||||
|
|
@ -334,6 +250,11 @@ const getClass = (val: boolean) => {
|
|||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
|
||||
const onEdit = ref<boolean>(false);
|
||||
function checkEdit() {
|
||||
onEdit.value = true;
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<q-card flat bordered class="col-12 q-px-lg q-py-md no-border">
|
||||
|
|
@ -368,10 +289,12 @@ const getClass = (val: boolean) => {
|
|||
]"
|
||||
label="เลขประจำตัวประชาชน"
|
||||
mask="#############"
|
||||
@update:modelValue="checkEdit"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<selector
|
||||
@update:modelValue="checkEdit"
|
||||
:hide-dropdown-icon="!edit"
|
||||
hide-bottom-space
|
||||
:class="getClass(edit)"
|
||||
|
|
@ -408,6 +331,7 @@ const getClass = (val: boolean) => {
|
|||
v-model="informaData.firstname"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอก ชื่อ'}`]"
|
||||
:label="`${'ชื่อ'}`"
|
||||
@update:modelValue="checkEdit"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
|
|
@ -422,6 +346,7 @@ const getClass = (val: boolean) => {
|
|||
v-model="informaData.lastname"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอก นามสกุล'}`]"
|
||||
:label="`${'นามสกุล'}`"
|
||||
@update:modelValue="checkEdit"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
|
|
@ -486,6 +411,7 @@ const getClass = (val: boolean) => {
|
|||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<selector
|
||||
@update:modelValue="checkEdit"
|
||||
:hide-dropdown-icon="!edit"
|
||||
hide-bottom-space
|
||||
:class="getClass(edit)"
|
||||
|
|
@ -511,6 +437,7 @@ const getClass = (val: boolean) => {
|
|||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<selector
|
||||
@update:modelValue="checkEdit"
|
||||
:hide-dropdown-icon="!edit"
|
||||
hide-bottom-space
|
||||
:class="getClass(edit)"
|
||||
|
|
@ -536,6 +463,7 @@ const getClass = (val: boolean) => {
|
|||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<selector
|
||||
@update:modelValue="checkEdit"
|
||||
:hide-dropdown-icon="!edit"
|
||||
hide-bottom-space
|
||||
:class="getClass(edit)"
|
||||
|
|
@ -561,6 +489,7 @@ const getClass = (val: boolean) => {
|
|||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
@update:modelValue="checkEdit"
|
||||
:class="getClass(edit)"
|
||||
hide-bottom-space
|
||||
:outlined="edit"
|
||||
|
|
@ -575,6 +504,7 @@ const getClass = (val: boolean) => {
|
|||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
@update:modelValue="checkEdit"
|
||||
:class="getClass(edit)"
|
||||
hide-bottom-space
|
||||
:outlined="edit"
|
||||
|
|
@ -589,6 +519,7 @@ const getClass = (val: boolean) => {
|
|||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<selector
|
||||
@update:modelValue="checkEdit"
|
||||
:hide-dropdown-icon="!edit"
|
||||
hide-bottom-space
|
||||
:class="getClass(edit)"
|
||||
|
|
@ -614,6 +545,7 @@ const getClass = (val: boolean) => {
|
|||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
@update:modelValue="checkEdit"
|
||||
hide-bottom-space
|
||||
:outlined="edit"
|
||||
dense
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ const historyClick = async () => {
|
|||
};
|
||||
|
||||
const ClickCancel = () => {
|
||||
updateEdit(!props.edit);
|
||||
props.cancel();
|
||||
props.changeBtn();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -77,29 +77,30 @@ const onCancel = async () => {
|
|||
};
|
||||
</script>
|
||||
<template>
|
||||
<div class="row col-12 q-px-lg q-pt-lg q-pb-sm no-border">
|
||||
<HeaderTop
|
||||
v-model:edit="edit"
|
||||
header="การคัดกรองคุณสมบัติ"
|
||||
icon="mdi-account-search"
|
||||
:save="saveData"
|
||||
:history="false"
|
||||
:changeBtn="changeBtn"
|
||||
:disable="statusEdit"
|
||||
:cancel="onCancel"
|
||||
/>
|
||||
</div>
|
||||
<div class="row q-px-lg">
|
||||
<div v-for="item of props.data" :key="item.name" class="col-12 q-pt-sm">
|
||||
<q-checkbox
|
||||
size="xs"
|
||||
v-model="item.value"
|
||||
:label="item.name"
|
||||
keep-color
|
||||
color="gray-5"
|
||||
:disable="!statusEdit"
|
||||
<q-form ref="myform" greedy @submit.prevent @validation-success="saveData">
|
||||
<div class="row col-12 q-px-lg q-pt-lg q-pb-sm no-border">
|
||||
<HeaderTop
|
||||
v-model:edit="edit"
|
||||
header="การคัดกรองคุณสมบัติ"
|
||||
icon="mdi-account-search"
|
||||
:history="false"
|
||||
:changeBtn="changeBtn"
|
||||
:disable="statusEdit"
|
||||
:cancel="onCancel"
|
||||
/>
|
||||
<q-separator />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-px-lg">
|
||||
<div v-for="item of props.data" :key="item.name" class="col-12 q-pt-sm">
|
||||
<q-checkbox
|
||||
size="xs"
|
||||
v-model="item.value"
|
||||
:label="item.name"
|
||||
keep-color
|
||||
color="gray-5"
|
||||
:disable="!statusEdit"
|
||||
/>
|
||||
<q-separator />
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ interface appointmentData {
|
|||
}
|
||||
|
||||
interface UserData {
|
||||
personalId: string;
|
||||
id: string;
|
||||
citizenId: string;
|
||||
fullname: string;
|
||||
organizationName: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue