หน้าแก้ไขข้อมูลส่วนตัว

แสดงวันจบการศึกษเป็นเลือก ปี หรือ วัน/เดือน/ปี
ซ่อนเป็นวุฒิการศึกษาในตำแหน่งไว้ก่อน
กรณีฟิลด์ isEducation เป็น true ให้ซ่อนปุ่มลบข้อมูล
เอาปุ่ม history หลังประวัติการศึกษากับใบอนุญาตประกอบอาชีพออก
ดักฟิลด์ "0000-0000-0000-0000" เป็นแสดงค่าว่าง

หน้าออกคำสั่ง step 4
This commit is contained in:
Thanit Konmek 2023-07-14 13:34:54 +07:00
parent b92c0d681c
commit 9d714b8716
8 changed files with 392 additions and 493 deletions

View file

@ -439,9 +439,7 @@ onMounted(async () => {
// myEventHandler(e);
// });
const pdfData = usePDF(
"https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf"
);
const pdfData = usePDF("/src/assets/05_modules.pdf");
setTimeout(() => {
pdfSrc.value = pdfData.pdf.value;

View file

@ -101,6 +101,13 @@ onMounted(async () => {
await changeTab("information");
});
const guidCheck = (id: string) => {
if (id == "0000-0000-0000-0000") {
return null;
}
return id;
};
const fetchData = async () => {
showLoader();
await http
@ -118,11 +125,12 @@ const fetchData = async () => {
InformationData.value.lastname = data.lastname;
InformationData.value.nationality = data.nationality;
InformationData.value.race = data.race;
InformationData.value.genderId = data.genderId;
InformationData.value.prefixId = data.prefixId;
InformationData.value.relationshipId = data.relationshipId;
InformationData.value.religionId = data.religionId;
InformationData.value.bloodGroupId = data.bloodGroupId;
InformationData.value.genderId = guidCheck(data.genderId) ?? "";
InformationData.value.prefixId = guidCheck(data.prefixId) ?? "";
InformationData.value.relationshipId =
guidCheck(data.relationshipId) ?? "";
InformationData.value.religionId = guidCheck(data.religionId) ?? "";
InformationData.value.bloodGroupId = guidCheck(data.bloodGroupId) ?? "";
InformationData.value.dateOfBirth = new Date(data.dateOfBirth);
InformationData.value.age = data.age;
InformationData.value.telephone = data.telephone;
@ -131,33 +139,39 @@ const fetchData = async () => {
AddressData.value.currentAddress = data.currentAddress ?? "";
AddressData.value.registSame = data.registSame ? "1" : "0";
AddressData.value.registSubDistrict = data.registSubDistrict ?? "";
AddressData.value.registSubDistrictId = data.registSubDistrictId ?? "";
AddressData.value.registSubDistrictId =
guidCheck(data.registSubDistrictId) ?? "";
AddressData.value.registZipCode = data.registZipCode ?? "";
AddressData.value.registDistrict = data.registDistrict ?? "";
AddressData.value.registDistrictId = data.registDistrictId ?? "";
AddressData.value.registDistrictId =
guidCheck(data.registDistrictId) ?? "";
AddressData.value.registProvince = data.registProvince ?? "";
AddressData.value.registProvinceId = data.registProvinceId ?? "";
AddressData.value.registProvinceId =
guidCheck(data.registProvinceId) ?? "";
AddressData.value.currentSubDistrict = data.currentSubDistrict ?? "";
AddressData.value.currentSubDistrictId = data.currentSubDistrictId ?? "";
AddressData.value.currentSubDistrictId =
guidCheck(data.currentSubDistrictId) ?? "";
AddressData.value.currentZipCode = data.currentZipCode ?? "";
AddressData.value.currentDistrict = data.currentDistrict ?? "";
AddressData.value.currentDistrictId = data.currentDistrictId ?? "";
AddressData.value.currentDistrictId =
guidCheck(data.currentDistrictId) ?? "";
AddressData.value.currentProvince = data.currentProvince ?? "";
AddressData.value.currentProvinceId = data.currentProvinceId ?? "";
AddressData.value.currentProvinceId =
guidCheck(data.currentProvinceId) ?? "";
FamilyData.value.couple = data.couple ? "1" : "0";
FamilyData.value.marryPrefix = data.marryPrefix ?? "";
FamilyData.value.marryPrefixId = data.marryPrefixId ?? "";
FamilyData.value.marryPrefixId = guidCheck(data.marryPrefixId) ?? "";
FamilyData.value.marryFirstName = data.marryFirstName ?? "";
FamilyData.value.marryLastName = data.marryLastName ?? "";
FamilyData.value.marryOccupation = data.marryOccupation ?? "";
FamilyData.value.fatherPrefix = data.fatherPrefix ?? "";
FamilyData.value.fatherPrefixId = data.fatherPrefixId ?? "";
FamilyData.value.fatherPrefixId = guidCheck(data.fatherPrefixId) ?? "";
FamilyData.value.fatherFirstName = data.fatherFirstName ?? "";
FamilyData.value.fatherLastName = data.fatherLastName ?? "";
FamilyData.value.fatherOccupation = data.fatherOccupation ?? "";
FamilyData.value.motherPrefix = data.motherPrefix ?? "";
FamilyData.value.motherPrefixId = data.motherPrefixId ?? "";
FamilyData.value.motherPrefixId = guidCheck(data.motherPrefixId) ?? "";
FamilyData.value.motherFirstName = data.motherFirstName ?? "";
FamilyData.value.motherLastName = data.motherLastName ?? "";
FamilyData.value.motherOccupation = data.motherOccupation ?? "";
@ -179,8 +193,9 @@ const fetchData = async () => {
let listRow: Education[] = [];
data.education.map((row: any) => {
listRow.push({
id: row.id ?? "",
id: guidCheck(row.id) ?? "",
educationLevel: row.educationLevel ?? "",
educationLevelId: guidCheck(row.educationLevelId) ?? "",
institute: row.institute ?? "",
degree: row.degree ?? "",
field: row.field ?? "",
@ -191,11 +206,11 @@ const fetchData = async () => {
fundName: row.fundName ?? "",
durationYear: row.durationYear ?? 0,
finishDate: row.finishDate ?? new Date(),
isDate: row.isDate ?? "",
startDate: row.startDate ? new Date(row.startDate).getFullYear() : 0,
endDate: row.endDate ? new Date(row.endDate).getFullYear() : 0,
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 ?? "",
isEducation: row.isEducation ? true : false,
});
});
EducationData.value = listRow;
@ -204,8 +219,8 @@ const fetchData = async () => {
data.certificates.map((row: any) => {
listCert.push({
id: row.id ?? "",
certificateNo: row.certificateNo ?? "",
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(),

View file

@ -4,6 +4,7 @@ const props = defineProps({
next: Boolean,
previous: Boolean,
modalEdit: Boolean,
delete: Boolean,
clickNext: {
type: Function,
default: () => console.log("not function"),
@ -67,57 +68,64 @@ const clickPrevious = async () => {
</script>
<template>
<q-card-actions class="text-primary q-py-sm">
<q-btn
flat round
icon="mdi-menu-left"
@click="clickPrevious"
v-if="modalEdit == true"
<q-btn
flat
round
icon="mdi-menu-left"
@click="clickPrevious"
v-if="modalEdit == true"
:disable="previous == false"
:color="!previous ? 'grey-7' : 'public'" />
<q-btn
flat round
icon="mdi-menu-right"
@click="clickNext"
v-if="modalEdit == true" :disable="next == false"
:color="!next ? 'grey-7' : 'public'" />
:color="!previous ? 'grey-7' : 'public'"
/>
<q-btn
flat
round
icon="mdi-menu-right"
@click="clickNext"
v-if="modalEdit == true"
:disable="next == false"
:color="!next ? 'grey-7' : 'public'"
/>
<q-space />
<q-btn
v-if="modalEdit == true"
<q-btn
v-if="modalEdit == true"
unelevated
label="ลบข้อมูล"
color="red"
@click="clickDelete"
color="red"
@click="clickDelete"
><!-- icon="mdi-delete"
<q-tooltip>ลบขอม</q-tooltip> -->
</q-btn>
<q-btn
<q-btn
v-show="editvisible"
flat
:disabled="!editvisible"
:outline="!editvisible"
flat
:disabled="!editvisible"
:outline="!editvisible"
:color="!editvisible ? 'grey-7' : 'red'"
@click="cancel()"
@click="cancel()"
label="ยกเลิกแก้ไข"
v-if="modalEdit == true">
v-if="modalEdit == true"
>
<!-- icon="mdi-undo"
<q-tooltip>ยกเล</q-tooltip> -->
</q-btn>
<q-btn
v-if="!editvisible"
<q-btn
v-if="!editvisible"
outline
label="แก้ไขข้อมูล"
:disabled="editvisible"
:disabled="editvisible"
:color="editvisible ? 'grey-7' : 'primary'"
@click="edit">
@click="edit"
>
<!-- icon="mdi-pencil-outline"
<q-tooltip></q-tooltip> -->
</q-btn>
<q-btn
<q-btn
v-if="editvisible"
unelevated
:disabled="!editvisible"
:color="!editvisible ? 'grey-7' : 'public'"
:disabled="!editvisible"
:color="!editvisible ? 'grey-7' : 'public'"
@click="checkSave"
label="บันทึก"
><!-- icon="mdi-content-save-outline"

View file

@ -57,6 +57,8 @@ const OpsFilter = ref<EduOps>({
levelOptions: [],
positionPathOptions: [],
});
const isDate = ref<string>("true");
const isEducation = ref<boolean>();
const positionPathId = ref<string>();
const institute = ref<string>();
const degree = ref<string>();
@ -69,7 +71,9 @@ const other = ref<string>();
const fundName = ref<string>();
const finishDate = ref<Date>(new Date());
const startDate = ref<number>(new Date().getFullYear());
const startDate2 = ref<Date>(new Date());
const endDate = ref<number>(new Date().getFullYear());
const endDate2 = ref<Date>(new Date());
const minDate = ref<Date>();
const myForm = ref<any>(); //form data input
const edit = ref<boolean>(false); // dialog
@ -80,13 +84,9 @@ const rowIndex = ref<number>(0); //indexข้อมูลเดิมที่
const previous = ref<boolean>(); //
const next = ref<boolean>(); //
const editRow = ref<boolean>(false); //
const rowsHistory = ref<RequestItemsObject[]>([]); //select data history
const tittleHistory = ref<string>("ประวัติแก้ไขประวัติการศึกษา"); //
const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal
const checkValidate = ref<boolean>(false); //validate data
const profileId = ref<string>("");
// const profileId = ref<string>(route.params.id.toString());
const rows = ref<Education[]>(props.data);
const filter = ref<string>(""); //search data table
const visibleColumns = ref<String[]>([]);
@ -102,7 +102,7 @@ profileData.education.columns.length == 0
"durationYear",
"other",
"fundName",
"positionPath",
// "positionPath",
"finishDate",
"startDate",
"endDate",
@ -164,17 +164,17 @@ const columns = ref<QTableProps["columns"]>([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionPath",
align: "left",
label: "เป็นวุฒิการศึกษาในตำแหน่ง",
sortable: true,
field: "positionPath",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
// {
// name: "positionPath",
// align: "left",
// label: "",
// sortable: true,
// field: "positionPath",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// sort: (a: string, b: string) =>
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
// },
{
name: "degree",
align: "left",
@ -264,202 +264,6 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const columnsHistory = ref<QTableProps["columns"]>([
{
name: "level",
align: "left",
label: "ระดับศึกษา",
sortable: true,
field: "level",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "institute",
align: "left",
label: "สถานศึกษา",
sortable: true,
field: "institute",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "startDate",
align: "left",
label: "ตั้งแต่",
sortable: true,
field: "startDate",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "endDate",
align: "left",
label: "ถึง",
sortable: true,
field: "endDate",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "finishDate",
align: "left",
label: "วันที่สำเร็จการศึกษา",
sortable: true,
field: "finishDate",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "positionPath",
align: "left",
label: "เป็นวุฒิการศึกษาในตำแหน่ง",
sortable: true,
field: "positionPath",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "degree",
align: "left",
label: "วุฒิการศึกษา",
sortable: true,
field: "degree",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "field",
align: "left",
label: "สาขาวิชา/ทาง",
sortable: true,
field: "field",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "fundName",
align: "left",
label: "ทุน",
sortable: true,
field: "fundName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "gpa",
align: "left",
label: "เกรดเฉลี่ย",
sortable: true,
field: "gpa",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "country",
align: "left",
label: "ประเทศ",
sortable: true,
field: "country",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "other",
align: "left",
label: "ข้อมูลการติดต่อ",
sortable: true,
field: "other",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "duration",
align: "left",
label: "ระยะเวลา",
sortable: true,
field: "duration",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "durationYear",
align: "left",
label: "ระยะเวลาหลักสูตร",
sortable: true,
field: "durationYear",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "createdFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "createdFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "createdAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const visibleColumnsHistory = ref<String[]>([
"level",
"institute",
"degree",
"field",
"gpa",
"country",
"duration",
"durationYear",
"other",
"positionPath",
"fundName",
"finishDate",
"startDate",
"endDate",
"createdFullName",
"createdAt",
]);
watch(startDate, (count, prevCount) => {
minDate.value = new Date(`${startDate.value}-01-01`);
@ -498,24 +302,30 @@ const fetchLevel = async () => {
};
const fetchPositionPath = async () => {
showLoader();
await http
.get(config.API.positionPath)
.then((res) => {
const data = res.data.result;
let option: optionData[] = [];
data.map((r: optionData) => {
option.push({ id: r.id.toString(), name: r.name.toString() });
});
Ops.value.positionPathOptions = option;
OpsFilter.value.positionPathOptions = option;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
let option: any = [];
option.push({ id: true, name: "ใช่" });
option.push({ id: false, name: "ไม่ใช่" });
Ops.value.positionPathOptions = option;
OpsFilter.value.positionPathOptions = option;
/////////////////////////////////
// showLoader();
// await http
// .get(config.API.positionPath)
// .then((res) => {
// const data = res.data.result;
// let option: optionData[] = [];
// data.map((r: optionData) => {
// option.push({ id: r.id.toString(), name: r.name.toString() });
// });
// Ops.value.positionPathOptions = option;
// OpsFilter.value.positionPathOptions = option;
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
};
const filterSelector = (val: any, update: Function, refData: string) => {
@ -565,18 +375,11 @@ const clickNext = async () => {
*/
const getData = () => {
const row = rows.value[rowIndex.value];
const filter = OpsFilter.value.levelOptions.filter(
(r: any) => r.name == row.educationLevel
);
const filterPositionPath = OpsFilter.value.positionPathOptions.filter(
(r: any) => r.name == row.positionPath
);
const result = filter.length > 0 ? filter[0].id : "";
const resultPath =
filterPositionPath.length > 0 ? filterPositionPath[0].id : "";
levelId.value = result;
positionPathId.value = resultPath;
levelId.value = row.educationLevelId;
isDate.value = row.isDate;
isEducation.value = row.isEducation;
// positionPathId.value = resultPath;
institute.value = row.institute;
degree.value = row.degree;
field.value = row.field;
@ -587,8 +390,17 @@ const getData = () => {
other.value = row.other;
fundName.value = row.fundName;
finishDate.value = row.finishDate;
startDate.value = row.startDate;
endDate.value = row.endDate;
startDate.value =
row.isDate == "false"
? new Date(row.startDate).getFullYear()
: new Date().getFullYear();
endDate.value =
row.isDate == "false"
? new Date(row.endDate).getFullYear()
: new Date().getFullYear();
startDate2.value =
row.isDate == "true" ? new Date(row.startDate) : new Date();
endDate2.value = row.isDate == "true" ? new Date(row.endDate) : new Date();
id.value = row.id;
};
@ -660,8 +472,15 @@ const saveData = async () => {
other: other.value,
fundName: fundName.value,
finishDate: dateToISO(finishDate.value),
startDate: new Date(`${startDate.value}-01-01`),
endDate: new Date(`${endDate.value}-01-01`),
startDate:
isDate.value == "true"
? new Date(startDate2.value)
: new Date(`${startDate.value}-01-01`),
endDate:
isDate.value == "true"
? new Date(endDate2.value)
: new Date(`${endDate.value}-01-01`),
isDate: isDate.value == "true",
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
@ -703,8 +522,15 @@ const editData = async () => {
other: other.value,
fundName: fundName.value,
finishDate: new Date(finishDate.value),
startDate: new Date(`${startDate.value}-01-01`),
endDate: new Date(`${endDate.value}-01-01`),
startDate:
isDate.value == "true"
? new Date(startDate2.value)
: new Date(`${startDate.value}-01-01`),
endDate:
isDate.value == "true"
? new Date(endDate2.value)
: new Date(`${endDate.value}-01-01`),
isDate: isDate.value == "true",
})
.then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ");
@ -780,24 +606,14 @@ const clickClose = async () => {
* @param _props props ใน row เลอก
*/
const selectData = async (_props: DataProps) => {
const filter = OpsFilter.value.levelOptions.filter(
(r: any) => r.name == _props.row.educationLevel
);
const filterPositionPath = OpsFilter.value.positionPathOptions.filter(
(r: any) => r.name == _props.row.positionPath
);
const result = filter.length > 0 ? filter[0].id : "";
const resultPath =
filterPositionPath.length > 0 ? filterPositionPath[0].id : "";
// console.log(_props.row);
modalEdit.value = true;
modal.value = true;
edit.value = false;
rawItem.value = _props.row;
rowIndex.value = _props.rowIndex;
levelId.value = result;
positionPathId.value = resultPath;
levelId.value = _props.row.educationLevelId;
// positionPathId.value = resultPath;
// levelId.value = _props.row.levelId;
// positionPathId.value = _props.row.positionPathId;
institute.value = _props.row.institute;
@ -810,9 +626,13 @@ const selectData = async (_props: DataProps) => {
other.value = _props.row.other;
fundName.value = _props.row.fundName;
finishDate.value = _props.row.finishDate;
startDate.value = _props.row.startDate;
endDate.value = _props.row.endDate;
startDate.value = new Date(_props.row.startDate).getFullYear();
endDate.value = new Date(_props.row.endDate).getFullYear();
startDate2.value = new Date(_props.row.startDate);
endDate2.value = new Date(_props.row.endDate);
id.value = _props.row.id;
isDate.value = _props.row.isDate;
isEducation.value = _props.row.isEducation;
await checkRowPage();
};
@ -837,6 +657,8 @@ const addData = () => {
finishDate.value = new Date();
startDate.value = new Date().getFullYear();
endDate.value = new Date().getFullYear();
startDate2.value = new Date();
endDate2.value = new Date();
};
/**
@ -868,50 +690,6 @@ const clickEditRow = () => {
editRow.value = true;
};
/**
* งชนดอมลประวแกไขขอมลทเลอก
* @param row อม row ประวการแกไข
*/
const clickHistory = async (row: RequestItemsObject) => {
modalHistory.value = true;
showLoader();
await http
.get(config.API.profileEduHisId(row.id))
.then((res) => {
let data = res.data.result;
rowsHistory.value = [];
data.map((e: ResponseObject) => {
rowsHistory.value.push({
id: e.id,
level: e.educationLevel,
levelId: e.educationLevelId,
positionPath: e.positionPath,
positionPathId: e.positionPathId,
institute: e.institute,
degree: e.degree,
field: e.field,
gpa: e.gpa,
country: e.country,
duration: e.duration,
durationYear: e.durationYear,
other: e.other,
fundName: e.fundName,
finishDate: new Date(e.finishDate),
startDate: new Date(e.startDate).getFullYear(),
endDate: new Date(e.endDate).getFullYear(),
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
});
});
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
/**
* validate input ใน dialog
*/
@ -956,14 +734,18 @@ const getClass = (val: boolean) => {
v-for="col in props.cols"
:key="col.name"
:props="props"
@click="selectData(props)"
class="cursor-pointer"
@click="selectData(props)"
>
<div
v-if="col.name == 'startDate' || col.name == 'endDate'"
class="table_ellipsis"
>
{{ col.value + 543 }}
{{
props.row.isDate == "true"
? date2Thai(col.value)
: new Date(col.value).getFullYear() + 543
}}
</div>
<div v-else-if="col.name == 'finishDate'" class="table_ellipsis">
{{ date2Thai(col.value) }}
@ -972,7 +754,7 @@ const getClass = (val: boolean) => {
{{ col.value }}
</div>
</q-td>
<q-td auto-width>
<!-- <q-td auto-width>
<q-btn
color="info"
flat
@ -982,13 +764,12 @@ const getClass = (val: boolean) => {
icon="mdi-history"
@click="clickHistory(props.row)"
/>
</q-td>
</q-td> -->
</q-tr>
</template>
</ProfileTable>
</q-form>
</q-card>
<!-- popup Edit window-->
<q-dialog v-model="modal" persistent>
<q-card style="width: 600px">
<q-form ref="myForm">
@ -1038,94 +819,219 @@ const getClass = (val: boolean) => {
@update:modelValue="clickEditRow"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<datepicker
menu-class-name="modalfix"
:readonly="!edit"
v-model="startDate"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
@update:modelValue="clickEditRow"
week-start="0"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
:class="getClass(edit)"
:outlined="edit"
<div class="col-12">
<q-card flat bordered class="q-px-sm q-pb-sm borderCard">
<div class="row col-12 q-gutter-md q-py-sm text-grey-7">
<q-radio
v-model="isDate"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
val="false"
label="ปี"
dense
lazy-rules
:borderless="!edit"
:model-value="startDate + 543"
:rules="[(val) => !!val || `${'กรุณาเลือกปีตั้งแต่'}`]"
hide-bottom-space
:label="`${'ตั้งแต่'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
:style="
edit
? 'color: var(--q-primary)'
: 'color: var(--q-grey)'
"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<datepicker
menu-class-name="modalfix"
v-model="endDate"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
:min-date="minDate"
:readonly="!edit"
@update:modelValue="clickEditRow"
week-start="0"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
:class="getClass(edit)"
:outlined="edit"
:disable="!edit"
/>
<q-radio
v-model="isDate"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
val="true"
label="วัน/เดือน/ปี"
dense
lazy-rules
:borderless="!edit"
:model-value="endDate + 543"
:rules="[(val) => !!val || `${'กรุณาเลือกปีถึง'}`]"
hide-bottom-space
:label="`${'ถึง'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
:style="
edit
? 'color: var(--q-primary)'
: 'color: var(--q-grey)'
"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
:disable="!edit"
/>
</div>
<div class="col-12 row q-col-gutter-sm">
<div class="col-xs-6 col-sm-6 col-md-6">
<datepicker
v-if="isDate === 'false'"
menu-class-name="modalfix"
:readonly="!edit"
v-model="startDate"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
@update:modelValue="clickEditRow"
week-start="0"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:borderless="!edit"
:model-value="startDate + 543"
:rules="[
(val) =>
!!val || `${'กรุณาเลือกปีที่เริ่มต้นศึกษา'}`,
]"
hide-bottom-space
:label="`${'ปีที่เริ่มต้นศึกษา'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
:style="
edit
? 'color: var(--q-primary)'
: 'color: var(--q-grey)'
"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<datepicker
v-else
menu-class-name="modalfix"
:readonly="!edit"
v-model="startDate2"
:locale="'th'"
autoApply
:enableTimePicker="false"
@update:modelValue="clickEditRow"
week-start="0"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:borderless="!edit"
:model-value="date2Thai(startDate2)"
:rules="[
(val) =>
!!val ||
`${'กรุณาเลือกวัน เดือน ปี ที่เริ่มต้นศึกษา'}`,
]"
hide-bottom-space
:label="`${'วัน เดือน ปี ที่เริ่มต้นศึกษา'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
:style="
edit
? 'color: var(--q-primary)'
: 'color: var(--q-grey)'
"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<datepicker
v-if="isDate === 'false'"
menu-class-name="modalfix"
v-model="endDate"
:locale="'th'"
autoApply
year-picker
:enableTimePicker="false"
:min-date="minDate"
:readonly="!edit"
@update:modelValue="clickEditRow"
week-start="0"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:borderless="!edit"
:model-value="endDate + 543"
:rules="[
(val) => !!val || `${'กรุณาเลือกปีที่จบการศึกษา'}`,
]"
hide-bottom-space
:label="`${'ปีที่จบการศึกษา'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
:style="
edit
? 'color: var(--q-primary)'
: 'color: var(--q-grey)'
"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
<datepicker
v-else
menu-class-name="modalfix"
:readonly="!edit"
v-model="endDate2"
:locale="'th'"
autoApply
:enableTimePicker="false"
@update:modelValue="clickEditRow"
week-start="0"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:borderless="!edit"
:model-value="date2Thai(endDate2)"
:rules="[
(val) =>
!!val ||
`${'กรุณาเลือกวัน เดือน ปี ที่จบการศึกษา'}`,
]"
hide-bottom-space
:label="`${'วัน เดือน ปี ที่จบการศึกษา'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
:style="
edit
? 'color: var(--q-primary)'
: 'color: var(--q-grey)'
"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
</div>
</q-card>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<datepicker
@ -1172,7 +1078,7 @@ const getClass = (val: boolean) => {
</template>
</datepicker>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<!-- <div class="col-xs-6 col-sm-6 col-md-6">
<selector
:class="getClass(edit)"
:outlined="edit"
@ -1180,8 +1086,7 @@ const getClass = (val: boolean) => {
lazy-rules
:readonly="!edit"
:borderless="!edit"
v-model="positionPathId"
:rules="[(val:string) => !!val || `${'กรุณาเลือกเป็นวุฒิการศึกษาในตำแหน่ง'}`]"
v-model="isEducation"
hide-bottom-space
:label="`${'เป็นวุฒิการศึกษาในตำแหน่ง'}`"
@update:modelValue="clickEditRow"
@ -1196,7 +1101,7 @@ const getClass = (val: boolean) => {
doneFn:Function) => filterSelector(inputValue, doneFn,'positionPathOptions'
) "
/>
</div>
</div> -->
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
:class="getClass(edit)"
@ -1326,6 +1231,7 @@ const getClass = (val: boolean) => {
:clickNext="clickNext"
:clickPrevious="clickPrevious"
:clickDelete="clickDelete"
:delete="isEducation"
v-model:editvisible="edit"
v-model:next="next"
v-model:previous="previous"
@ -1334,38 +1240,6 @@ const getClass = (val: boolean) => {
</q-form>
</q-card>
</q-dialog>
<HistoryTable
:rows="rowsHistory"
:columns="columnsHistory"
:filter="filterHistory"
:visible-columns="visibleColumnsHistory"
v-model:modal="modalHistory"
v-model:inputfilter="filterHistory"
v-model:inputvisible="visibleColumnsHistory"
v-model:tittle="tittleHistory"
>
<template #columns="props">
<q-tr :props="props">
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div
v-if="col.name == 'startDate' || col.name == 'endDate'"
class="table_ellipsis"
>
{{ col.value + 543 }}
</div>
<div
v-else-if="col.name == 'finishDate' || col.name == 'createdAt'"
class="table_ellipsis"
>
{{ date2Thai(col.value) }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
</div>
</q-td>
</q-tr>
</template>
</HistoryTable>
</template>
<style lang="scss">

View file

@ -601,7 +601,7 @@ const getClass = (val: boolean) => {
{{ col.value }}
</div>
</q-td>
<q-td auto-width>
<!-- <q-td auto-width>
<q-btn
color="info"
flat
@ -611,7 +611,7 @@ const getClass = (val: boolean) => {
icon="mdi-history"
@click="clickHistory(props.row)"
/>
</q-td>
</q-td> -->
</q-tr>
</template>
</ProfileTable>

View file

@ -84,6 +84,7 @@ interface PointExam {
interface Education {
id: string;
educationLevel: string;
educationLevelId: string;
institute: string;
degree: string;
field: string;
@ -95,10 +96,10 @@ interface Education {
durationYear: number;
finishDate: Date;
isDate: string;
startDate: number;
endDate: number;
startDate: Date;
endDate: Date;
positionPath: string;
isEducation: string;
isEducation: boolean;
}
interface Family {

View file

@ -7,6 +7,7 @@ interface DataProps {
interface RequestItemsObject {
id: string;
educationLevel: string;
educationLevelId: string;
level: string;
levelId: string;
positionPath: string;
@ -25,6 +26,8 @@ interface RequestItemsObject {
endDate: number;
createdFullName: string;
createdAt: Date;
isDate: string;
isEducation: boolean;
}
//columns