fix === > แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย ทุกระบบ
This commit is contained in:
parent
bcd5d1d56c
commit
d9bb320b16
17 changed files with 514 additions and 348 deletions
|
|
@ -9,6 +9,7 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
|
||||
import type { QTableProps, QForm } from "quasar";
|
||||
import type { MainData } from "@/modules/05_placement/interface/index/Main";
|
||||
import type {
|
||||
ResponseTitle,
|
||||
DataProfile,
|
||||
|
|
@ -93,6 +94,7 @@ const posNo = ref<string>(""); //เลขที่
|
|||
const salary = ref<number>(0); //เงินเดือน
|
||||
const reason = ref<string>(""); //หมายเหตุ
|
||||
const defaultCitizenData = ref<string>(""); //เลขประจำตัวประชาชน
|
||||
const mianData = ref<MainData>();
|
||||
|
||||
//รายการตัวเลือก
|
||||
const Ops = ref<InformationOps>({
|
||||
|
|
@ -128,9 +130,7 @@ const OpsFilter = ref<InformationOps>({
|
|||
],
|
||||
});
|
||||
|
||||
/**
|
||||
* ฟังก์ชันดึงข้อมูลรายการข้อมูลเกี่ยวกับบุคคล (dropdown list)
|
||||
*/
|
||||
/** ฟังก์ชันดึงข้อมูลรายการข้อมูลเกี่ยวกับบุคคล (dropdown list)*/
|
||||
async function fetchPerson() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -194,15 +194,14 @@ async function fetchPerson() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันดึงข้อมูลรายละเอียดการรับโอน
|
||||
*/
|
||||
/** ฟังก์ชันดึงข้อมูลรายละเอียดการรับโอน*/
|
||||
async function getData() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.receiveDataId(paramsId.toString()))
|
||||
.then(async (res: any) => {
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
mianData.value = data;
|
||||
dataProfile.value = res.data.result as unknown as DataProfile;
|
||||
let list: DocList[] = [];
|
||||
if (data.docs.length > 0) {
|
||||
|
|
@ -275,19 +274,64 @@ async function getData() {
|
|||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันยกเลิกการแก้ไขข้อมูล
|
||||
*/
|
||||
/** ฟังก์ชันยกเลิกการแก้ไขข้อมูล*/
|
||||
async function oncanceledit() {
|
||||
edit.value = !edit.value;
|
||||
if (myForm.value !== null) {
|
||||
await getData();
|
||||
fetchData(mianData.value);
|
||||
myForm.value?.resetValidation();
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันรีเช็ตข้อมูลแนบท้ายเป็น ข้อมูล Default
|
||||
* @param data ข้อมูล Default
|
||||
*/
|
||||
async function fetchData(data: any) {
|
||||
informaData.value = {
|
||||
cardid: data.citizenId ?? "",
|
||||
age: calculateAge(data.dateOfBirth),
|
||||
prefix: "",
|
||||
prefixId:
|
||||
(data.prefix == "00000000-0000-0000-0000-000000000000"
|
||||
? null
|
||||
: data.prefix) ?? "",
|
||||
firstname: data.firstName ?? "",
|
||||
lastname: data.lastName ?? "",
|
||||
birthDate: data.dateOfBirth !== null ? new Date(data.dateOfBirth) : null,
|
||||
genderId:
|
||||
(data.gender == "00000000-0000-0000-0000-000000000000"
|
||||
? null
|
||||
: data.gender) ?? "",
|
||||
bloodId:
|
||||
(data.bloodGroup == "00000000-0000-0000-0000-000000000000"
|
||||
? null
|
||||
: data.bloodGroup) ?? "",
|
||||
nationality: data.nationality ?? "",
|
||||
ethnicity: data.race ?? "",
|
||||
statusId:
|
||||
(data.relationship == "00000000-0000-0000-0000-000000000000"
|
||||
? null
|
||||
: data.relationship) ?? "",
|
||||
religionId:
|
||||
(data.religion == "00000000-0000-0000-0000-000000000000"
|
||||
? null
|
||||
: data.religion) ?? "",
|
||||
tel: data.telephoneNumber ?? "",
|
||||
employeeType: "",
|
||||
employeeClass: "",
|
||||
profileType: "",
|
||||
};
|
||||
educationOld.value = data.educationOld ?? "";
|
||||
organizationPositionOld.value = data.organizationPositionOld ?? "";
|
||||
positionTypeOld.value = data.positionTypeOld ?? "";
|
||||
positionLevelOld.value = data.positionLevelOld ?? "";
|
||||
posNo.value = data.positionNumberOld ?? "";
|
||||
salary.value = data.amountOld ?? 0;
|
||||
reason.value = data.reason ?? "";
|
||||
status.value = data.status ?? "";
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันตรวจสอบเลขบัตรประจำตัวประชาชน
|
||||
* @param value เลขบัตรประจำตัวประชาชน
|
||||
|
|
@ -341,53 +385,54 @@ async function checkCitizen(id: string) {
|
|||
* @param refData ประเภทของตัวเลือก
|
||||
*/
|
||||
function filterSelector(val: string, update: Function, refData: string) {
|
||||
let newVal = val.toLowerCase();
|
||||
switch (refData) {
|
||||
case "prefixOps":
|
||||
update(() => {
|
||||
Ops.value.prefixOps = OpsFilter.value.prefixOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "genderOps":
|
||||
update(() => {
|
||||
Ops.value.genderOps = OpsFilter.value.genderOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "bloodOps":
|
||||
update(() => {
|
||||
Ops.value.bloodOps = OpsFilter.value.bloodOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "statusOps":
|
||||
update(() => {
|
||||
Ops.value.statusOps = OpsFilter.value.statusOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "religionOps":
|
||||
update(() => {
|
||||
Ops.value.religionOps = OpsFilter.value.religionOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "employeeClassOps":
|
||||
update(() => {
|
||||
Ops.value.employeeClassOps = OpsFilter.value.employeeClassOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "employeeTypeOps":
|
||||
update(() => {
|
||||
Ops.value.employeeTypeOps = OpsFilter.value.employeeTypeOps.filter(
|
||||
(v: DataOption) => v.name.indexOf(val) > -1
|
||||
(v: DataOption) => v.name.toLowerCase().indexOf(newVal) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
|
|
@ -397,9 +442,7 @@ function filterSelector(val: string, update: Function, refData: string) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันบันทึกข้อมูลการแก้ไขบัญชีแนบท้าย
|
||||
*/
|
||||
/** ฟังก์ชันบันทึกข้อมูลการแก้ไขบัญชีแนบท้าย*/
|
||||
function saveData() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -460,9 +503,7 @@ function getClass(val: boolean) {
|
|||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* function เช็คอายุไม่เกิน 18 ปี
|
||||
*/
|
||||
/** function เช็คอายุไม่เกิน 18 ปี */
|
||||
function calculateMaxDate() {
|
||||
const today = new Date();
|
||||
today.setFullYear(today.getFullYear() - 18);
|
||||
|
|
@ -502,9 +543,7 @@ function updateBirthDate(v: Date) {
|
|||
informaData.value.age = calculateAge(v);
|
||||
}
|
||||
|
||||
/**
|
||||
* ทำงานเมื่อมีการเรียกใช้ Components
|
||||
*/
|
||||
/** ทำงานเมื่อมีการเรียกใช้ Components*/
|
||||
onMounted(async () => {
|
||||
await fetchPerson();
|
||||
await getData();
|
||||
|
|
@ -524,7 +563,7 @@ onMounted(async () => {
|
|||
class="q-mr-sm"
|
||||
@click="router.push(`/placement/receive`)"
|
||||
/>
|
||||
รายละเอียดการรับโอนของ{{ title.fullname }}
|
||||
รายละเอียดการรับโอน {{ title.fullname }}
|
||||
</div>
|
||||
<CardProfile :data="dataProfile as DataProfile" />
|
||||
|
||||
|
|
@ -614,6 +653,8 @@ onMounted(async () => {
|
|||
v-model="informaData.prefixId"
|
||||
emit-value
|
||||
map-options
|
||||
hide-selected
|
||||
fill-input
|
||||
option-label="name"
|
||||
:options="Ops.prefixOps"
|
||||
option-value="name"
|
||||
|
|
@ -723,6 +764,8 @@ onMounted(async () => {
|
|||
v-model="informaData.genderId"
|
||||
emit-value
|
||||
map-options
|
||||
hide-selected
|
||||
fill-input
|
||||
option-label="name"
|
||||
:options="Ops.genderOps"
|
||||
option-value="name"
|
||||
|
|
@ -745,6 +788,8 @@ onMounted(async () => {
|
|||
v-model="informaData.statusId"
|
||||
emit-value
|
||||
map-options
|
||||
hide-selected
|
||||
fill-input
|
||||
option-label="name"
|
||||
:options="Ops.statusOps"
|
||||
option-value="name"
|
||||
|
|
@ -792,6 +837,8 @@ onMounted(async () => {
|
|||
lazy-rules
|
||||
v-model="informaData.religionId"
|
||||
emit-value
|
||||
hide-selected
|
||||
fill-input
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="Ops.religionOps"
|
||||
|
|
@ -817,6 +864,8 @@ onMounted(async () => {
|
|||
v-model="informaData.bloodId"
|
||||
emit-value
|
||||
map-options
|
||||
hide-selected
|
||||
fill-input
|
||||
option-label="name"
|
||||
:options="Ops.bloodOps"
|
||||
option-value="name"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue