ทะเบียนการศึกษา
This commit is contained in:
parent
e5b9299ee9
commit
7ba90f5708
2 changed files with 53 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
div
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted } from "vue";
|
import { ref, reactive, onMounted } from "vue";
|
||||||
import { QForm, useQuasar } from "quasar";
|
import { QForm, useQuasar } from "quasar";
|
||||||
|
|
@ -34,6 +35,7 @@ const {
|
||||||
date2Thai,
|
date2Thai,
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
onSearchDataTable,
|
onSearchDataTable,
|
||||||
|
convertDateToAPI,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const id = ref<string>(route.params.id.toString()); //id profile
|
const id = ref<string>(route.params.id.toString()); //id profile
|
||||||
|
|
@ -132,6 +134,20 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
.toString()
|
.toString()
|
||||||
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "isHigh",
|
||||||
|
align: "left",
|
||||||
|
label: "วุฒิการศึกษาสูงสุด",
|
||||||
|
sortable: true,
|
||||||
|
field: "isHigh",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
format: (v) => (v === true ? "ใช่" : v === false ? "ไม่ใช่" : "-"),
|
||||||
|
sort: (a: string, b: string) =>
|
||||||
|
a
|
||||||
|
.toString()
|
||||||
|
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "degree",
|
name: "degree",
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|
@ -258,6 +274,7 @@ const visibleColumns = ref<string[]>([
|
||||||
"other",
|
"other",
|
||||||
"fundName",
|
"fundName",
|
||||||
"isEducation",
|
"isEducation",
|
||||||
|
"isHigh",
|
||||||
"endDate",
|
"endDate",
|
||||||
"startDate",
|
"startDate",
|
||||||
"finishDate",
|
"finishDate",
|
||||||
|
|
@ -265,7 +282,7 @@ const visibleColumns = ref<string[]>([
|
||||||
"lastUpdatedAt",
|
"lastUpdatedAt",
|
||||||
]);
|
]);
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
sortBy: "lastUpdatedAt",
|
sortBy: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
/** Table ประวัติแก้ไขประวัติการศึกษา*/
|
/** Table ประวัติแก้ไขประวัติการศึกษา*/
|
||||||
|
|
@ -351,6 +368,20 @@ const historyColumns = ref<QTableProps["columns"]>([
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "isHigh",
|
||||||
|
align: "left",
|
||||||
|
label: "วุฒิการศึกษาสูงสุด",
|
||||||
|
sortable: true,
|
||||||
|
field: "isHigh",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
format: (v) => (v === true ? "ใช่" : v === false ? "ไม่ใช่" : "-"),
|
||||||
|
sort: (a: string, b: string) =>
|
||||||
|
a
|
||||||
|
.toString()
|
||||||
|
.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "degree",
|
name: "degree",
|
||||||
align: "left",
|
align: "left",
|
||||||
|
|
@ -486,6 +517,7 @@ const historyVisibleColumns = ref<string[]>([
|
||||||
"other",
|
"other",
|
||||||
"fundName",
|
"fundName",
|
||||||
"isEducation",
|
"isEducation",
|
||||||
|
"isHigh",
|
||||||
"endDate",
|
"endDate",
|
||||||
"startDate",
|
"startDate",
|
||||||
"finishDate",
|
"finishDate",
|
||||||
|
|
@ -524,6 +556,7 @@ const educationData = reactive<RequestItemsObject>({
|
||||||
startDate: new Date(),
|
startDate: new Date(),
|
||||||
endDate: new Date(),
|
endDate: new Date(),
|
||||||
isEducation: null,
|
isEducation: null,
|
||||||
|
isHigh: null,
|
||||||
degree: "",
|
degree: "",
|
||||||
field: "",
|
field: "",
|
||||||
fundName: "",
|
fundName: "",
|
||||||
|
|
@ -591,6 +624,7 @@ function clearForm() {
|
||||||
educationData.startDate = new Date();
|
educationData.startDate = new Date();
|
||||||
educationData.endDate = new Date();
|
educationData.endDate = new Date();
|
||||||
educationData.isEducation = null;
|
educationData.isEducation = null;
|
||||||
|
educationData.isHigh = false;
|
||||||
educationData.degree = "";
|
educationData.degree = "";
|
||||||
educationData.field = "";
|
educationData.field = "";
|
||||||
educationData.fundName = "";
|
educationData.fundName = "";
|
||||||
|
|
@ -610,12 +644,14 @@ function editForm(row: any) {
|
||||||
dialogStatus.value = "edit";
|
dialogStatus.value = "edit";
|
||||||
editId.value = row?.id;
|
editId.value = row?.id;
|
||||||
isDate.value = row.isDate ? "true" : "false";
|
isDate.value = row.isDate ? "true" : "false";
|
||||||
|
|
||||||
educationData.educationLevel = row.educationLevel;
|
educationData.educationLevel = row.educationLevel;
|
||||||
educationData.institute = row.institute;
|
educationData.institute = row.institute;
|
||||||
educationData.finishDate = row.finishDate;
|
educationData.finishDate = row.finishDate;
|
||||||
educationData.startDate = row.startDate;
|
educationData.startDate = row.startDate;
|
||||||
educationData.endDate = row.endDate;
|
educationData.endDate = row.endDate;
|
||||||
educationData.isEducation = row.isEducation;
|
educationData.isEducation = row.isEducation;
|
||||||
|
educationData.isHigh = row.isHigh ? true : false;
|
||||||
educationData.degree = row.degree;
|
educationData.degree = row.degree;
|
||||||
educationData.field = row.field;
|
educationData.field = row.field;
|
||||||
educationData.fundName = row.fundName;
|
educationData.fundName = row.fundName;
|
||||||
|
|
@ -719,6 +755,9 @@ function addData() {
|
||||||
isDate: isDate.value === "false" ? false : true,
|
isDate: isDate.value === "false" ? false : true,
|
||||||
profileId: empType.value === "" ? id.value : undefined,
|
profileId: empType.value === "" ? id.value : undefined,
|
||||||
profileEmployeeId: empType.value !== "" ? id.value : undefined,
|
profileEmployeeId: empType.value !== "" ? id.value : undefined,
|
||||||
|
finishDate: convertDateToAPI(educationData.finishDate),
|
||||||
|
startDate: convertDateToAPI(educationData.startDate),
|
||||||
|
endDate: convertDateToAPI(educationData.endDate),
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await fetchData(id.value);
|
await fetchData(id.value);
|
||||||
|
|
@ -748,6 +787,9 @@ function editData(idData: string) {
|
||||||
isDate: isDate.value === "false" ? false : true,
|
isDate: isDate.value === "false" ? false : true,
|
||||||
durationYear:
|
durationYear:
|
||||||
educationData.durationYear === "" ? null : educationData.durationYear,
|
educationData.durationYear === "" ? null : educationData.durationYear,
|
||||||
|
finishDate: convertDateToAPI(educationData.finishDate),
|
||||||
|
startDate: convertDateToAPI(educationData.startDate),
|
||||||
|
endDate: convertDateToAPI(educationData.endDate),
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await fetchData(id.value);
|
await fetchData(id.value);
|
||||||
|
|
@ -1467,6 +1509,15 @@ onMounted(async () => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12">
|
||||||
|
<q-checkbox
|
||||||
|
keep-color
|
||||||
|
color="primary"
|
||||||
|
v-model="educationData.isHigh"
|
||||||
|
label="วุฒิการศึกษาสูงสุด"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-input
|
<q-input
|
||||||
outlined
|
outlined
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ interface RequestItemsObject {
|
||||||
startDate: Date;
|
startDate: Date;
|
||||||
endDate: Date;
|
endDate: Date;
|
||||||
isEducation: boolean | null;
|
isEducation: boolean | null;
|
||||||
|
isHigh: boolean | null;
|
||||||
degree: string;
|
degree: string;
|
||||||
field: string;
|
field: string;
|
||||||
fundName: string;
|
fundName: string;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue