ทะเบียนประวัติ: ประวัติการศึกษา แก้การค้นหา
This commit is contained in:
parent
7ccc1a5808
commit
5722ced369
1 changed files with 27 additions and 32 deletions
|
|
@ -53,7 +53,10 @@ const columns = ref<QTableProps["columns"]>([
|
|||
align: "left",
|
||||
label: "ตั้งแต่",
|
||||
sortable: true,
|
||||
field: "startDate",
|
||||
field: (v) =>
|
||||
v.isDate
|
||||
? date2Thai(v.startDate)
|
||||
: new Date(v.startDate).getFullYear() + 543,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -64,7 +67,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
align: "left",
|
||||
label: "ถึง",
|
||||
sortable: true,
|
||||
field: "endDate",
|
||||
field: (v) =>
|
||||
v.isDate ? date2Thai(v.endDate) : new Date(v.endDate).getFullYear() + 543,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -76,6 +80,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
label: "วันที่สำเร็จการศึกษา",
|
||||
sortable: true,
|
||||
field: "finishDate",
|
||||
format: (v) => date2Thai(v),
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -89,6 +94,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "isEducation",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (v) => (v === true ? "ใช่" : "ไม่ใช่"),
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
|
|
@ -334,7 +340,6 @@ async function fetchData(id: string) {
|
|||
.get(config.API.profileNewEducationByProfileId(id))
|
||||
.then(async (res) => {
|
||||
rows.value = res.data.result;
|
||||
console.log(rows.value);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -350,7 +355,6 @@ async function fetchHistoryData(id: string) {
|
|||
.get(config.API.profileNewEducationHisByEducationId(id))
|
||||
.then(async (res) => {
|
||||
historyRows.value = res.data.result;
|
||||
console.log(historyRows.value);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -361,7 +365,6 @@ async function fetchHistoryData(id: string) {
|
|||
}
|
||||
|
||||
async function addData() {
|
||||
console.log(educationData.durationYear);
|
||||
await http
|
||||
.post(config.API.profileNewEducation, {
|
||||
profileId: id.value,
|
||||
|
|
@ -451,7 +454,6 @@ watch(
|
|||
() => isDate.value,
|
||||
() => {
|
||||
if (isDate.value === "false") {
|
||||
console.log(educationData.startDate);
|
||||
educationData.startYear = +educationData.startDate
|
||||
.toString()
|
||||
.slice(11, 15);
|
||||
|
|
@ -613,19 +615,7 @@ onMounted(async () => {
|
|||
<template v-slot:body="props" v-if="mode === 'table'">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div v-if="col.name === 'startDate' || col.name === 'endDate'">
|
||||
<div v-if="props.row.isDate">{{ date2Thai(col.value) }}</div>
|
||||
<div v-else>
|
||||
{{ +col.value.slice(0, 4) + 543 }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name === 'finishDate'">
|
||||
{{ col.value ? date2Thai(col.value) : "-" }}
|
||||
</div>
|
||||
<div v-else-if="col.name === 'isEducation'">
|
||||
{{ col.value === true ? "ใช่" : "ไม่ใช่" }}
|
||||
</div>
|
||||
<div v-else>
|
||||
<div>
|
||||
{{ col.value === "" ? "-" : col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
|
@ -749,6 +739,7 @@ onMounted(async () => {
|
|||
</q-card-actions>
|
||||
<q-separator />
|
||||
<div class="row">
|
||||
{{ console.log(props) }}
|
||||
<div class="col-3 q-pa-sm label-color">ระดับการศึกษา</div>
|
||||
<div class="col-4 q-pa-sm">{{ props.cols[0].value }}</div>
|
||||
<div class="col-2 q-pa-sm label-color">สถานศึกษา</div>
|
||||
|
|
@ -756,24 +747,19 @@ onMounted(async () => {
|
|||
<div class="col-12">
|
||||
<div :class="`row bg-color`">
|
||||
<div class="col-3 q-pa-sm label-color">ตั้งแต่</div>
|
||||
<div v-if="props.row.isDate" class="col-4 q-pa-sm">
|
||||
{{ date2Thai(props.cols[2].value) }}
|
||||
</div>
|
||||
<div v-else class="col-4 q-pa-sm">
|
||||
{{ +props.cols[2].value.slice(0, 4) + 543 }}
|
||||
<div class="col-4 q-pa-sm">
|
||||
{{ props.cols[2].value }}
|
||||
</div>
|
||||
|
||||
<div class="col-2 q-pa-sm label-color">ถึง</div>
|
||||
<div v-if="props.row.isDate" class="col-3 q-pa-sm">
|
||||
{{ date2Thai(props.cols[3].value) }}
|
||||
</div>
|
||||
<div v-else class="col-3 q-pa-sm">
|
||||
{{ +props.cols[3].value.slice(0, 4) + 543 }}
|
||||
<div class="col-3 q-pa-sm">
|
||||
{{ props.cols[3].value }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-3 q-pa-sm label-color">วันที่สำเร็จการศึกษา</div>
|
||||
<div class="col-9 q-pa-sm">
|
||||
{{ date2Thai(props.cols[4].value) }}
|
||||
{{ props.cols[4].value }}
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div :class="`row bg-color`">
|
||||
|
|
@ -1065,9 +1051,11 @@ onMounted(async () => {
|
|||
dense
|
||||
lazy-rules
|
||||
:model-value="date2Thai(educationData.finishDate)"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่ได้รับ'}`]"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกวันที่สำเร็จการศึกษา'}`,
|
||||
]"
|
||||
hide-bottom-space
|
||||
:label="`${'วันที่ได้รับ'}`"
|
||||
:label="`${'วันที่สำเร็จการศึกษา'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
@ -1092,6 +1080,9 @@ onMounted(async () => {
|
|||
:options="educationOption"
|
||||
option-value="value"
|
||||
option-label="label"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกวุฒิการศึกษาในตำแหน่ง'}`,
|
||||
]"
|
||||
label="เป็นวุฒิการศึกษาในตำแหน่ง"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -1165,6 +1156,7 @@ onMounted(async () => {
|
|||
outlined
|
||||
v-model="educationData.duration"
|
||||
label="ระยะเวลา"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกระยะเวลา'}`]"
|
||||
bg-color="white"
|
||||
dense
|
||||
/>
|
||||
|
|
@ -1174,6 +1166,9 @@ onMounted(async () => {
|
|||
outlined
|
||||
v-model="educationData.durationYear"
|
||||
label="ระยะเวลาหลักสูตร (ปี)"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณากรอกระยะเวลาหลักสูตร (ปี)'}`,
|
||||
]"
|
||||
bg-color="white"
|
||||
type="number"
|
||||
dense
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue