clone code
This commit is contained in:
parent
c9597d1e38
commit
d57bcd1719
362 changed files with 104804 additions and 0 deletions
422
src/modules/03_recruiting/components/Address.vue
Normal file
422
src/modules/03_recruiting/components/Address.vue
Normal file
|
|
@ -0,0 +1,422 @@
|
|||
<!-- card ข้อมูลที่อยู่ -->
|
||||
<template>
|
||||
<HeaderTop
|
||||
v-model:edit="edit"
|
||||
header="ข้อมูลที่อยู่"
|
||||
icon="mdi-map-marker"
|
||||
:addData="true"
|
||||
:editOnly="false"
|
||||
:editData="false"
|
||||
/>
|
||||
<q-form ref="myform">
|
||||
<div class="row col-12 items-center q-col-gutter-x-sm q-col-gutter-y-xs">
|
||||
<div class="col-xs-12">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
type="textarea"
|
||||
autogrow
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultAddress.address"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก ที่อยู่ตามทะเบียนบ้าน'}`]"
|
||||
:label="`${'ที่อยู่ตามทะเบียนบ้าน'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-select
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก จังหวัด'}`]"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultAddress.provinceId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="provinceOptions"
|
||||
option-value="id"
|
||||
:label="`${'จังหวัด'}`"
|
||||
@update:model-value="(value) => selectProvince(value, '1')"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-select
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก เขต / อำเภอ'}`]"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultAddress.districtId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="districtOptions"
|
||||
option-value="id"
|
||||
:label="`${'เขต / อำเภอ'}`"
|
||||
@update:model-value="(value) => selectDistrict(value, '1')"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-select
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก ตำบล / แขวง'}`]"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultAddress.subdistrictId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="subdistrictOptions"
|
||||
option-value="id"
|
||||
:label="`${'ตำบล / แขวง'}`"
|
||||
@update:model-value="(value) => selectSubDistrict(value, '1')"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
dense
|
||||
lazy-rules
|
||||
readonly
|
||||
borderless
|
||||
v-model="defaultAddress.code"
|
||||
:style="
|
||||
!(status == 'checkRegister' || status == 'payment')
|
||||
? ''
|
||||
: 'padding:0 12px;'
|
||||
"
|
||||
:label="`${'รหัสไปรษณีย์'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 q-gutter-sm items-center flex q-mb-sm row">
|
||||
<div class="text-bold" v-if="$q.screen.gt.xs">
|
||||
ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้าน
|
||||
</div>
|
||||
<div class="text-bold col-12 q-pt-sm" v-else>
|
||||
ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้าน
|
||||
</div>
|
||||
<q-radio
|
||||
v-model="defaultAddress.same"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="1"
|
||||
label="ใช่"
|
||||
dense
|
||||
:disable="!(status == 'checkRegister' || status == 'payment')"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="defaultAddress.same"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="0"
|
||||
label="ไม่"
|
||||
dense
|
||||
:disable="!(status == 'checkRegister' || status == 'payment')"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12" v-if="defaultAddress.same == '0'">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
type="textarea"
|
||||
autogrow
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultAddress.addressC"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก ที่อยู่ปัจจุบัน'}`]"
|
||||
:label="`${'ที่อยู่ปัจจุบัน'}`"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="col-xs-12 col-sm-3 col-md-3"
|
||||
v-if="defaultAddress.same == '0'"
|
||||
>
|
||||
<q-select
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก จังหวัด'}`]"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultAddress.provinceIdC"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="provinceOptions"
|
||||
option-value="id"
|
||||
:label="`${'จังหวัด'}`"
|
||||
@update:model-value="(value) => selectProvince(value, '2')"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="col-xs-12 col-sm-3 col-md-3"
|
||||
v-if="defaultAddress.same == '0'"
|
||||
>
|
||||
<q-select
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก เขต / อำเภอ'}`]"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultAddress.districtIdC"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="districtCOptions"
|
||||
option-value="id"
|
||||
:label="`${'เขต / อำเภอ'}`"
|
||||
@update:model-value="(value) => selectDistrict(value, '2')"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="col-xs-12 col-sm-3 col-md-3"
|
||||
v-if="defaultAddress.same == '0'"
|
||||
>
|
||||
<q-select
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก ตำบล / แขวง'}`]"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultAddress.subdistrictIdC"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="subdistrictCOptions"
|
||||
option-value="id"
|
||||
:label="`${'ตำบล / แขวง'}`"
|
||||
@update:model-value="(value) => selectSubDistrict(value, '2')"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="col-xs-12 col-sm-3 col-md-3"
|
||||
v-if="defaultAddress.same == '0'"
|
||||
>
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
dense
|
||||
lazy-rules
|
||||
readonly
|
||||
borderless
|
||||
v-model="defaultAddress.codeC"
|
||||
:style="
|
||||
!(status == 'checkRegister' || status == 'payment')
|
||||
? ''
|
||||
: 'padding:0 12px;'
|
||||
"
|
||||
:label="`${'รหัสไปรษณีย์'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import type { PropType } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import type {
|
||||
Address,
|
||||
DataOption,
|
||||
} from "@/modules/03_recruiting/interface/index/Main";
|
||||
import {
|
||||
defaultAddress,
|
||||
changeData,
|
||||
} from "@/modules/03_recruiting/interface/index/Main";
|
||||
import HeaderTop from "@/modules/03_recruiting/components/top.vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
|
||||
const props = defineProps({
|
||||
provinceOptions: {
|
||||
type: Array as PropType<DataOption[]>,
|
||||
required: true,
|
||||
},
|
||||
status: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
form: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const candidateId = ref<string>(route.params.candidateId.toString());
|
||||
const edit = ref<boolean>(true);
|
||||
const myform = ref<any>({});
|
||||
const loader = ref<boolean>(false);
|
||||
const districtOptions = ref<DataOption[]>([]);
|
||||
const districtCOptions = ref<DataOption[]>([]);
|
||||
const subdistrictOptions = ref<DataOption[]>([]);
|
||||
const subdistrictCOptions = ref<DataOption[]>([]);
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError } = mixin;
|
||||
const emit = defineEmits(["update:form"]);
|
||||
|
||||
watch(myform, async (count: any, prevCount: any) => {
|
||||
emit("update:form", count);
|
||||
});
|
||||
|
||||
watch(defaultAddress, async (count: Address, prevCount: Address) => {
|
||||
await changeData("address", count);
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
if (defaultAddress.value.provinceId != null)
|
||||
await fetchDistrict(defaultAddress.value.provinceId, "1");
|
||||
if (defaultAddress.value.provinceIdC != null)
|
||||
await fetchDistrict(defaultAddress.value.provinceIdC, "2");
|
||||
if (defaultAddress.value.districtId != null)
|
||||
await fetchSubDistrict(defaultAddress.value.districtId, "1");
|
||||
if (defaultAddress.value.districtIdC != null)
|
||||
await fetchSubDistrict(defaultAddress.value.districtIdC, "2");
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
await http
|
||||
.get(config.API.candidateAddress(candidateId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
defaultAddress.value.address = data.registAddress;
|
||||
defaultAddress.value.addressC = data.currentAddress;
|
||||
defaultAddress.value.provinceId = data.registProvinceId;
|
||||
defaultAddress.value.provinceIdC = data.currentProvinceId;
|
||||
defaultAddress.value.districtId = data.registDistrictId;
|
||||
defaultAddress.value.districtIdC = data.currentDistrictId;
|
||||
defaultAddress.value.subdistrictId = data.registSubDistrictId;
|
||||
defaultAddress.value.subdistrictIdC = data.currentSubDistrictId;
|
||||
defaultAddress.value.code = data.registZipCode;
|
||||
defaultAddress.value.codeC = data.currentZipCode;
|
||||
defaultAddress.value.same =
|
||||
data.registSame == true ? "1" : data.registSame == false ? "0" : null;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const selectProvince = (e: string, name: string) => {
|
||||
if (name == "1") {
|
||||
defaultAddress.value.districtId = "";
|
||||
defaultAddress.value.subdistrictId = "";
|
||||
defaultAddress.value.code = null;
|
||||
} else {
|
||||
defaultAddress.value.districtIdC = "";
|
||||
defaultAddress.value.subdistrictIdC = "";
|
||||
defaultAddress.value.codeC = null;
|
||||
}
|
||||
myform.value.resetValidation();
|
||||
fetchDistrict(e, name);
|
||||
};
|
||||
|
||||
const selectDistrict = (e: string, name: string) => {
|
||||
if (name == "1") {
|
||||
defaultAddress.value.subdistrictId = "";
|
||||
defaultAddress.value.code = null;
|
||||
} else {
|
||||
defaultAddress.value.subdistrictIdC = "";
|
||||
defaultAddress.value.codeC = null;
|
||||
}
|
||||
myform.value.resetValidation();
|
||||
fetchSubDistrict(e, name);
|
||||
};
|
||||
|
||||
const selectSubDistrict = (e: string, name: string) => {
|
||||
if (name == "1") {
|
||||
const findcode = subdistrictOptions.value.filter((r) => r.id == e);
|
||||
const namecode = findcode.length > 0 ? findcode[0].zipCode : null;
|
||||
defaultAddress.value.code = namecode;
|
||||
} else {
|
||||
const findcode = subdistrictCOptions.value.filter((r) => r.id == e);
|
||||
const namecode = findcode.length > 0 ? findcode[0].zipCode : null;
|
||||
defaultAddress.value.codeC = namecode;
|
||||
}
|
||||
};
|
||||
|
||||
const fetchDistrict = async (id: string, position: string) => {
|
||||
loader.value = true;
|
||||
await http
|
||||
.get(config.API.listDistrict(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: DataOption) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
});
|
||||
if (position == "1") {
|
||||
districtOptions.value = option;
|
||||
} else {
|
||||
districtCOptions.value = option;
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchSubDistrict = async (id: string, position: string) => {
|
||||
loader.value = true;
|
||||
await http
|
||||
.get(config.API.listSubDistrict(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: DataOption) => {
|
||||
option.push({
|
||||
id: r.id.toString(),
|
||||
name: r.name.toString(),
|
||||
zipCode: r.zipCode != null ? r.zipCode : null,
|
||||
});
|
||||
});
|
||||
if (position == "1") {
|
||||
subdistrictOptions.value = option;
|
||||
} else {
|
||||
subdistrictCOptions.value = option;
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
</script>
|
||||
591
src/modules/03_recruiting/components/Career.vue
Normal file
591
src/modules/03_recruiting/components/Career.vue
Normal file
|
|
@ -0,0 +1,591 @@
|
|||
<!-- tab ประวัติการทำงาน/ฝึกงาน -->
|
||||
<template>
|
||||
<q-form ref="myForm">
|
||||
<Table
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
v-model:editvisible="edit"
|
||||
:add="clickAdd"
|
||||
:edit="clickEdit"
|
||||
:addData="false"
|
||||
:editData="status == 'checkRegister' || status == 'payment'"
|
||||
name="ประวัติการทำงาน/ฝึกงาน"
|
||||
icon="mdi-briefcase"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="selectData(props)"
|
||||
class="cursor-pointer"
|
||||
>
|
||||
<div v-if="col.name == 'salary'" class="">
|
||||
{{ col.value.toLocaleString("en-US") }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'duration'" class="">
|
||||
{{ dateThaiRange(col.value) }}
|
||||
</div>
|
||||
<div v-else class="">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td
|
||||
auto-width
|
||||
v-if="status == 'checkRegister' || status == 'payment'"
|
||||
>
|
||||
<q-btn
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
icon="mdi-trash-can-outline"
|
||||
@click="checkDelete(props.row)"
|
||||
/>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</q-form>
|
||||
<!-- popup Edit window-->
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader tittle="ประวัติการทำงาน/ฝึกงาน" :close="checkClose" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-p-sm">
|
||||
<div
|
||||
class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"
|
||||
>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="location"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกสถานที่ทำงาน/ฝึกงาน'}`]"
|
||||
:label="`${'สถานที่ทำงาน/ฝึกงาน'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="position"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง/ลักษณะงาน'}`]"
|
||||
:label="`${'ตำแหน่ง/ลักษณะงาน'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="salary"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณากรอกเงินเดือนสุดท้ายก่อนออก'}`,
|
||||
]"
|
||||
:label="`${'เงินเดือนสุดท้ายก่อนออก'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
type="number"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6 col-md-6">
|
||||
<datepicker
|
||||
:readonly="!edit"
|
||||
v-model="duration"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
range
|
||||
:enableTimePicker="false"
|
||||
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)"
|
||||
class="datepicker"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:borderless="!edit"
|
||||
:model-value="dateThaiRange(duration)"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="mdi-calendar-outline"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="reason"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเหตุผลที่ออก'}`]"
|
||||
:label="`${'เหตุผลที่ออก'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
type="textarea"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<DialogFooter
|
||||
:edit="clickEdit"
|
||||
:save="clickSave"
|
||||
:validate="validateData"
|
||||
:clickNext="clickNext"
|
||||
:clickPrevious="clickPrevious"
|
||||
:editData="status == 'checkRegister' || status == 'payment'"
|
||||
v-model:editvisible="edit"
|
||||
v-model:next="next"
|
||||
v-model:previous="previous"
|
||||
v-model:modalEdit="modalEdit"
|
||||
/>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useExamDataStore } from "@/modules/03_recruiting/store";
|
||||
import type {
|
||||
RequestItemsObject,
|
||||
DataProps,
|
||||
} from "@/modules/03_recruiting/interface/request/Career";
|
||||
import type { ResponseObject } from "@/modules/03_recruiting/interface/response/Career";
|
||||
import Table from "@/modules/03_recruiting/components/TableCan.vue";
|
||||
import DialogHeader from "@/modules/03_recruiting/components/DialogHeader.vue";
|
||||
import DialogFooter from "@/modules/03_recruiting/components/DialogFooter.vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
|
||||
const props = defineProps({
|
||||
status: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { dateThaiRange, modalDelete, modalConfirm, dateToISO, success } = mixin;
|
||||
const store = useExamDataStore();
|
||||
const { examData, changeExamColumns } = store;
|
||||
const id = ref<string>("");
|
||||
const location = ref<string>();
|
||||
const position = ref<string>();
|
||||
const salary = ref<number | null>();
|
||||
const duration = ref<[Date, Date]>([new Date(), new Date()]);
|
||||
const reason = ref<string>();
|
||||
const myForm = ref<any>(); //form data input
|
||||
const edit = ref<boolean>(true); //เช็คการกดปุ่มแก้ไขใน dialog
|
||||
const modal = ref<boolean>(false); //modal add detail
|
||||
const modalEdit = ref<boolean>(false); //modal ที่แสดงใช้สำหรับแก้ไขหรือไม่
|
||||
const rawItem = ref<RequestItemsObject>(); //ข้อมูลเดิมที่เลือกใน row นั้น
|
||||
const rowIndex = ref<number>(0); //indexข้อมูลเดิมที่เลือกใน row นั้น
|
||||
const previous = ref<boolean>(); //แสดงปุ่มดูข้อมูลก่อนหน้า
|
||||
const dataStore = useDataStore();
|
||||
const next = ref<boolean>(); //แสดงปุ่มดูข้อมูลต่อไป
|
||||
const editRow = ref<boolean>(false); //เช็คมีการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const route = useRoute();
|
||||
const candidateId = ref<string>(route.params.candidateId.toString());
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const { messageError } = mixin;
|
||||
const { loaderPage } = dataStore;
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
||||
examData.career.columns.length == 0
|
||||
? (visibleColumns.value = [
|
||||
"location",
|
||||
"position",
|
||||
"salary",
|
||||
"duration",
|
||||
"reason",
|
||||
])
|
||||
: (visibleColumns.value = examData.career.columns);
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "location",
|
||||
align: "left",
|
||||
label: "สถานที่ทำงาน/ฝึกงาน",
|
||||
sortable: true,
|
||||
field: "location",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง/ลักษณะงาน",
|
||||
sortable: true,
|
||||
field: "position",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "salary",
|
||||
align: "left",
|
||||
label: "เงินเดือนสุดท้ายก่อนออก",
|
||||
sortable: true,
|
||||
field: "salary",
|
||||
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: "reason",
|
||||
align: "left",
|
||||
label: "เหตุผลที่ออก",
|
||||
sortable: true,
|
||||
field: "reason",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
watch(visibleColumns, async (count: String[], prevCount: String[]) => {
|
||||
await changeExamColumns("career", count);
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.candidateCareer(candidateId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((r: ResponseObject) => {
|
||||
rows.value.push({
|
||||
...r,
|
||||
location: r.name,
|
||||
duration: [r.durationStart, r.durationEnd],
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* กดดูข้อมูลก่อนหน้า
|
||||
*/
|
||||
const clickPrevious = async () => {
|
||||
rowIndex.value -= 1;
|
||||
const row = rows.value[rowIndex.value];
|
||||
location.value = row.location;
|
||||
position.value = row.position;
|
||||
salary.value = row.salary;
|
||||
duration.value = row.duration;
|
||||
reason.value = row.reason;
|
||||
id.value = row.id;
|
||||
await checkRowPage();
|
||||
};
|
||||
|
||||
/**
|
||||
* กดดูข้อมูลต่อไป
|
||||
*/
|
||||
const clickNext = () => {
|
||||
rowIndex.value += 1;
|
||||
const row = rows.value[rowIndex.value];
|
||||
location.value = row.location;
|
||||
position.value = row.position;
|
||||
salary.value = row.salary;
|
||||
duration.value = row.duration;
|
||||
reason.value = row.reason;
|
||||
id.value = row.id;
|
||||
checkRowPage();
|
||||
};
|
||||
|
||||
/**
|
||||
* เช็คปุ่มดูข้อมูล ย้อน กับ ต่อไป ว่าต้องแสดงไหม
|
||||
*/
|
||||
const checkRowPage = () => {
|
||||
editRow.value = false;
|
||||
next.value = true;
|
||||
previous.value = true;
|
||||
if (rowIndex.value + 1 >= rows.value.length) {
|
||||
next.value = false;
|
||||
}
|
||||
if (rowIndex.value - 1 < 0) {
|
||||
previous.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* กดปุ่มแก้ไขใน dialog
|
||||
*/
|
||||
const clickEdit = () => {
|
||||
next.value = false;
|
||||
previous.value = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* กดปุ่มเพิ่มด้านบน table
|
||||
*/
|
||||
const clickAdd = () => {
|
||||
addRow();
|
||||
};
|
||||
|
||||
const checkDelete = (row: RequestItemsObject) => {
|
||||
rawItem.value = row;
|
||||
modalDelete(
|
||||
$q,
|
||||
"ยืนยันการลบข้อมูล",
|
||||
"หากต้องการลบกดให้กดตกลง",
|
||||
clickDeleteRow
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* ลบข้อมูลใน table
|
||||
*/
|
||||
const clickDeleteRow = async () => {
|
||||
if (rawItem.value != null) {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.candidateAdminCareer(rawItem.value.id))
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
} else {
|
||||
await fetchData();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* กดบันทึกใน dialog
|
||||
*/
|
||||
const clickSave = async () => {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
if (modalEdit.value) {
|
||||
await editData();
|
||||
} else {
|
||||
await saveData();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.candidateAdminCareer(candidateId.value), {
|
||||
name: location.value,
|
||||
position: position.value,
|
||||
salary: salary.value,
|
||||
durationStart: dateToISO(new Date(duration.value[0])),
|
||||
durationEnd: dateToISO(new Date(duration.value[1])),
|
||||
reason: reason.value,
|
||||
})
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* บันทึกแก้ไขข้อมูล
|
||||
*/
|
||||
const editData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.candidateAdminCareer(id.value), {
|
||||
name: location.value,
|
||||
position: position.value,
|
||||
salary: salary.value,
|
||||
durationStart: dateToISO(new Date(duration.value[0])),
|
||||
durationEnd: dateToISO(new Date(duration.value[1])),
|
||||
reason: reason.value,
|
||||
})
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
};
|
||||
|
||||
const checkClose = async () => {
|
||||
if (editRow.value == true) {
|
||||
modalConfirm(
|
||||
$q,
|
||||
"ข้อมูลมีการแก้ไข",
|
||||
"ยืนยันการดำเนินต่อใช่หรือไม่",
|
||||
clickClose
|
||||
);
|
||||
} else {
|
||||
await clickClose();
|
||||
}
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
/**
|
||||
* กดปิด dialog
|
||||
*/
|
||||
const clickClose = async () => {
|
||||
modal.value = false;
|
||||
editRow.value = false;
|
||||
next.value = false;
|
||||
previous.value = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* กดเลือกข้อมูลที่จะแก้ไข
|
||||
* @param props ค่า props ใน row ที่เลือก
|
||||
*/
|
||||
const selectData = (props: DataProps) => {
|
||||
modalEdit.value = true;
|
||||
modal.value = true;
|
||||
editRow.value = false;
|
||||
rawItem.value = props.row;
|
||||
rowIndex.value = props.rowIndex;
|
||||
location.value = props.row.location;
|
||||
position.value = props.row.position;
|
||||
salary.value = props.row.salary;
|
||||
duration.value = props.row.duration;
|
||||
reason.value = props.row.reason;
|
||||
id.value = props.row.id;
|
||||
next.value = false;
|
||||
previous.value = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* กดปุ่มเพิ่มบน table
|
||||
*/
|
||||
const addRow = () => {
|
||||
modalEdit.value = false;
|
||||
modal.value = true;
|
||||
location.value = "";
|
||||
position.value = "";
|
||||
salary.value = null;
|
||||
duration.value = [new Date(), new Date()];
|
||||
reason.value = "";
|
||||
};
|
||||
|
||||
/**
|
||||
* เช็คว่ามีการแก้ไขข้อมูล
|
||||
*/
|
||||
const clickEditRow = () => {
|
||||
editRow.value = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* validate input ใน dialog
|
||||
*/
|
||||
const validateData = async () => {
|
||||
checkValidate.value = true;
|
||||
await myForm.value.validate().then((result: boolean) => {
|
||||
if (result == false) {
|
||||
checkValidate.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
* @param val ข้อมูล input สำหรับแก้ไขหรือไม่
|
||||
*/
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.modalfix {
|
||||
position: fixed !important;
|
||||
}
|
||||
</style>
|
||||
105
src/modules/03_recruiting/components/DialogFooter.vue
Normal file
105
src/modules/03_recruiting/components/DialogFooter.vue
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
<template>
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<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'"
|
||||
/>
|
||||
<q-space />
|
||||
<div v-if="editData">
|
||||
<q-btn
|
||||
v-if="!editvisible"
|
||||
flat
|
||||
round
|
||||
:disabled="editvisible"
|
||||
:color="editvisible ? 'grey-7' : 'primary'"
|
||||
@click="edit"
|
||||
icon="mdi-pencil-outline"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<div v-else>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
:disabled="!editvisible"
|
||||
:color="!editvisible ? 'grey-7' : 'public'"
|
||||
@click="checkSave"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-actions>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
const props = defineProps({
|
||||
editvisible: Boolean,
|
||||
next: Boolean,
|
||||
previous: Boolean,
|
||||
modalEdit: Boolean,
|
||||
editData: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
clickNext: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
clickPrevious: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
edit: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
save: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
validate: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
});
|
||||
const emit = defineEmits([
|
||||
"update:editvisible",
|
||||
"update:next",
|
||||
"update:previous",
|
||||
]);
|
||||
|
||||
const updateEdit = (value: Boolean) => {
|
||||
emit("update:editvisible", value);
|
||||
};
|
||||
const edit = async () => {
|
||||
updateEdit(!props.editvisible);
|
||||
props.edit();
|
||||
};
|
||||
const checkSave = () => {
|
||||
props.validate();
|
||||
props.save();
|
||||
};
|
||||
|
||||
const clickNext = async () => {
|
||||
await props.clickNext();
|
||||
};
|
||||
|
||||
const clickPrevious = async () => {
|
||||
await props.clickPrevious();
|
||||
};
|
||||
</script>
|
||||
25
src/modules/03_recruiting/components/DialogHeader.vue
Normal file
25
src/modules/03_recruiting/components/DialogHeader.vue
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<template>
|
||||
<q-toolbar>
|
||||
<q-toolbar-title class="text-subtitle2 text-bold">{{ tittle }}</q-toolbar-title>
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="close"
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
</q-toolbar>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
const props = defineProps({
|
||||
tittle: String,
|
||||
close: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
});
|
||||
const close = async () => {
|
||||
props.close();
|
||||
};
|
||||
</script>
|
||||
246
src/modules/03_recruiting/components/Document.vue
Normal file
246
src/modules/03_recruiting/components/Document.vue
Normal file
|
|
@ -0,0 +1,246 @@
|
|||
<!-- card อัปโหลดเอกสาร -->
|
||||
<template>
|
||||
<HeaderTop
|
||||
v-model:edit="edit"
|
||||
:header="
|
||||
$q.screen.gt.xs
|
||||
? 'อัปโหลดเอกสาร(เช่น สำเนาบัตรประชาชน ทะเบียนบ้าน วุฒิการศึกษา)'
|
||||
: 'อัปโหลดเอกสาร'
|
||||
"
|
||||
icon="mdi-file-document"
|
||||
:addData="true"
|
||||
:editOnly="false"
|
||||
:editData="status == 'checkRegister' || status == 'payment'"
|
||||
:save="uploadData"
|
||||
/>
|
||||
|
||||
<div v-if="edit" class="row justify-center row col-12">
|
||||
<q-input
|
||||
class="q-mt-sm col-12 q-pb-xs"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="name"
|
||||
hide-bottom-space
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกชื่อเอกสาร'}`]"
|
||||
:label="`${'ชื่อเอกสาร'}`"
|
||||
/>
|
||||
<q-uploader
|
||||
color="gray"
|
||||
type="file"
|
||||
flat
|
||||
@factory="uploadData"
|
||||
ref="uploader"
|
||||
class="full-width"
|
||||
text-color="dark"
|
||||
:max-size="10000000"
|
||||
bordered
|
||||
label="[ไฟล์ขนาดไม่เกิน 10MB]"
|
||||
@added="fileAdd"
|
||||
>
|
||||
<template v-slot:header="scope">
|
||||
<div class="row no-wrap items-center q-pa-sm q-gutter-xs">
|
||||
<q-btn
|
||||
v-if="scope.queuedFiles.length > 0"
|
||||
icon="clear_all"
|
||||
@click="scope.removeQueuedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบทั้งหมด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.uploadedFiles.length > 0"
|
||||
icon="done_all"
|
||||
@click="scope.removeUploadedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบไฟล์ที่อัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-spinner v-if="scope.isUploading" class="q-uploader__spinner" />
|
||||
<div class="col">
|
||||
<div class="q-uploader__title">
|
||||
{{ "[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]" }}
|
||||
</div>
|
||||
<div class="q-uploader__subtitle">
|
||||
{{ scope.uploadSizeLabel }} / {{ scope.uploadProgressLabel }}
|
||||
</div>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="scope.canAddFiles"
|
||||
type="a"
|
||||
icon="add_box"
|
||||
@click="scope.pickFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-uploader-add-trigger />
|
||||
<q-tooltip>เลือกไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.isUploading"
|
||||
icon="clear"
|
||||
@click="scope.abort"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ยกเลิกการอัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</template>
|
||||
</q-uploader>
|
||||
</div>
|
||||
<q-card bordered flat class="full-width">
|
||||
<q-list separator>
|
||||
<q-item v-for="file in files" :key="file.id" class="q-my-xs">
|
||||
<q-item-section>
|
||||
<q-item-label class="full-width ellipsis">
|
||||
{{ file.fileName }}
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption>
|
||||
สถานะ: {{ file.fileType }} / {{ file.fileSize }}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section top side>
|
||||
<div class="q-gutter-sm">
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadData(file.detail)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="red"
|
||||
icon="mdi-delete-outline"
|
||||
v-if="edit"
|
||||
@click="deleteData(file.id)"
|
||||
>
|
||||
<q-tooltip>ลบไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import HeaderTop from "@/modules/03_recruiting/components/top.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import type { UploadType } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const props = defineProps({
|
||||
status: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const candidateId = ref<string>(route.params.candidateId.toString());
|
||||
const uploader = ref<any>();
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const edit = ref<boolean>(props.status == "checkRegister");
|
||||
const name = ref<string>("");
|
||||
const files = ref<UploadType[]>([]);
|
||||
const file = ref<File[]>([]);
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError } = mixin;
|
||||
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
});
|
||||
|
||||
const fileAdd = async (val: any) => {
|
||||
name.value = val[0].name;
|
||||
file.value = val;
|
||||
};
|
||||
|
||||
const getData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.candidateUpload(candidateId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
files.value = data;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const deleteData = async (id: string) => {
|
||||
const params = {
|
||||
documentId: id,
|
||||
};
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.candidateUpload(candidateId.value), {
|
||||
params,
|
||||
})
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
await getData();
|
||||
});
|
||||
};
|
||||
|
||||
const uploadData = async () => {
|
||||
const blob = file.value.slice(0, file.value[0].size);
|
||||
const newFile = new File(blob, name.value, {
|
||||
type: file.value[0].type,
|
||||
});
|
||||
const formData = new FormData();
|
||||
formData.append("", newFile);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.candidateUpload(candidateId.value), formData)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
name.value = "";
|
||||
uploader.value.reset();
|
||||
await getData();
|
||||
});
|
||||
};
|
||||
|
||||
const downloadData = async (path: string) => {
|
||||
window.open(path);
|
||||
};
|
||||
</script>
|
||||
622
src/modules/03_recruiting/components/Education.vue
Normal file
622
src/modules/03_recruiting/components/Education.vue
Normal file
|
|
@ -0,0 +1,622 @@
|
|||
<!-- tab ประวัติการศึกษา -->
|
||||
<template>
|
||||
<q-form ref="myForm">
|
||||
<Table
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
v-model:editvisible="edit"
|
||||
:add="clickAdd"
|
||||
:edit="clickEdit"
|
||||
:addData="false"
|
||||
:editData="status == 'checkRegister' || status == 'payment'"
|
||||
name="ประวัติการศีกษา"
|
||||
icon="mdi-school"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="selectData(props)"
|
||||
class="cursor-pointer"
|
||||
>
|
||||
<div v-if="col.name == 'duration'" class="">
|
||||
{{ dateThaiRange(col.value) }}
|
||||
</div>
|
||||
<div v-else class="">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td
|
||||
auto-width
|
||||
v-if="status == 'checkRegister' || status == 'payment'"
|
||||
>
|
||||
<q-btn
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
icon="mdi-trash-can-outline"
|
||||
@click="checkDelete(props.row)"
|
||||
/>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</q-form>
|
||||
<!-- popup Edit window-->
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader tittle="ประวัติการศึกษา" :close="checkClose" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-p-sm">
|
||||
<div
|
||||
class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"
|
||||
>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-select
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="educationLevelId"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกวุฒิที่ได้รับ'}`]"
|
||||
:label="`${'วุฒิที่ได้รับ'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="educationLevelOptions"
|
||||
option-value="id"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="major"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกสาขาวิชา/วิชาเอก'}`]"
|
||||
:label="`${'สาขาวิชา/วิชาเอก'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
type="number"
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="scores"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณากรอกคะแนนเฉลี่ยตลอดหลักสูตร'}`,
|
||||
]"
|
||||
:label="`${'คะแนนเฉลี่ยตลอดหลักสูตร'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="name"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกชื่อสถานศึกษา'}`]"
|
||||
:label="`${'ชื่อสถานศึกษา'}`"
|
||||
@update:modelValue="clickEditRow"
|
||||
hide-bottom-space
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<datepicker
|
||||
:readonly="!edit"
|
||||
v-model="duration"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
range
|
||||
:enableTimePicker="false"
|
||||
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)"
|
||||
class="datepicker"
|
||||
:outlined="edit"
|
||||
dense
|
||||
lazy-rules
|
||||
:borderless="!edit"
|
||||
:model-value="dateThaiRange(duration)"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="mdi-calendar-outline"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<DialogFooter
|
||||
:edit="clickEdit"
|
||||
:save="clickSave"
|
||||
:validate="validateData"
|
||||
:clickNext="clickNext"
|
||||
:clickPrevious="clickPrevious"
|
||||
:editData="status == 'checkRegister' || status == 'payment'"
|
||||
v-model:editvisible="edit"
|
||||
v-model:next="next"
|
||||
v-model:previous="previous"
|
||||
v-model:modalEdit="modalEdit"
|
||||
/>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import { useExamDataStore } from "@/modules/03_recruiting/store";
|
||||
import type {
|
||||
RequestItemsObject,
|
||||
DataProps,
|
||||
} from "@/modules/03_recruiting/interface/request/Education";
|
||||
import type { DataOption } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import type { ResponseObject } from "@/modules/03_recruiting/interface/response/Education";
|
||||
import Table from "@/modules/03_recruiting/components/TableCan.vue";
|
||||
import DialogHeader from "@/modules/03_recruiting/components/DialogHeader.vue";
|
||||
import DialogFooter from "@/modules/03_recruiting/components/DialogFooter.vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
const props = defineProps({
|
||||
status: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { dateThaiRange, modalDelete, modalConfirm, dateToISO, success } = mixin;
|
||||
const store = useExamDataStore();
|
||||
const { examData, changeExamColumns } = store;
|
||||
const id = ref<string>("");
|
||||
const educationLevel = ref<string>();
|
||||
const educationLevelId = ref<string>();
|
||||
const educationLevelOptions = ref<DataOption[]>([]);
|
||||
const major = ref<string>();
|
||||
const scores = ref<number | null>();
|
||||
const name = ref<string>();
|
||||
const duration = ref<[Date, Date]>([new Date(), new Date()]);
|
||||
const myForm = ref<any>(); //form data input
|
||||
const edit = ref<boolean>(true); //เช็คการกดปุ่มแก้ไขใน dialog
|
||||
const modal = ref<boolean>(false); //modal add detail
|
||||
const modalEdit = ref<boolean>(false); //modal ที่แสดงใช้สำหรับแก้ไขหรือไม่
|
||||
const rawItem = ref<RequestItemsObject>(); //ข้อมูลเดิมที่เลือกใน row นั้น
|
||||
const rowIndex = ref<number>(0); //indexข้อมูลเดิมที่เลือกใน row นั้น
|
||||
const previous = ref<boolean>(); //แสดงปุ่มดูข้อมูลก่อนหน้า
|
||||
const next = ref<boolean>(); //แสดงปุ่มดูข้อมูลต่อไป
|
||||
const editRow = ref<boolean>(false); //เช็คมีการแก้ไขข้อมูล
|
||||
const checkValidate = ref<boolean>(false); //validate data ผ่านหรือไม่
|
||||
const rows = ref<RequestItemsObject[]>([]);
|
||||
const route = useRoute();
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const { messageError } = mixin;
|
||||
const candidateId = ref<string>(route.params.candidateId.toString());
|
||||
const filter = ref<string>(""); //search data table
|
||||
|
||||
const visibleColumns = ref<String[]>([]);
|
||||
|
||||
examData.education.columns.length == 0
|
||||
? (visibleColumns.value = [
|
||||
"educationLevel",
|
||||
"major",
|
||||
"scores",
|
||||
"name",
|
||||
"duration",
|
||||
])
|
||||
: (visibleColumns.value = examData.education.columns);
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "educationLevel",
|
||||
align: "left",
|
||||
label: "วุฒิที่ได้รับ",
|
||||
sortable: true,
|
||||
field: "educationLevel",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "major",
|
||||
align: "left",
|
||||
label: "สาขาวิชา/วิชาเอก",
|
||||
sortable: true,
|
||||
field: "major",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "scores",
|
||||
align: "left",
|
||||
label: "คะแนนเฉลี่ยตลอดหลักสูตร",
|
||||
sortable: true,
|
||||
field: "scores",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อสถานศึกษา",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
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" }),
|
||||
},
|
||||
]);
|
||||
|
||||
watch(visibleColumns, async (count: String[], prevCount: String[]) => {
|
||||
await changeExamColumns("education", count);
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
await fetcheducationLevel();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.candidateEducation(candidateId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((r: ResponseObject) => {
|
||||
rows.value.push({
|
||||
...r,
|
||||
educationLevelId: r.educationLevelId,
|
||||
educationLevel: r.educationLevelName,
|
||||
duration: [r.durationStart, r.durationEnd],
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fetcheducationLevel = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.educationLevel)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: DataOption) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
});
|
||||
educationLevelOptions.value = option;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* กดดูข้อมูลก่อนหน้า
|
||||
*/
|
||||
const clickPrevious = () => {
|
||||
rowIndex.value -= 1;
|
||||
const row = rows.value[rowIndex.value];
|
||||
educationLevel.value = row.educationLevel;
|
||||
educationLevelId.value = row.educationLevelId;
|
||||
major.value = row.major;
|
||||
scores.value = row.scores;
|
||||
name.value = row.name;
|
||||
duration.value = row.duration;
|
||||
id.value = row.id;
|
||||
checkRowPage();
|
||||
};
|
||||
|
||||
/**
|
||||
* กดดูข้อมูลต่อไป
|
||||
*/
|
||||
const clickNext = () => {
|
||||
rowIndex.value += 1;
|
||||
const row = rows.value[rowIndex.value];
|
||||
educationLevel.value = row.educationLevel;
|
||||
educationLevelId.value = row.educationLevelId;
|
||||
major.value = row.major;
|
||||
scores.value = row.scores;
|
||||
name.value = row.name;
|
||||
duration.value = row.duration;
|
||||
id.value = row.id;
|
||||
checkRowPage();
|
||||
};
|
||||
|
||||
/**
|
||||
* เช็คปุ่มดูข้อมูล ย้อน กับ ต่อไป ว่าต้องแสดงไหม
|
||||
*/
|
||||
const checkRowPage = () => {
|
||||
editRow.value = false;
|
||||
next.value = true;
|
||||
previous.value = true;
|
||||
if (rowIndex.value + 1 >= rows.value.length) {
|
||||
next.value = false;
|
||||
}
|
||||
if (rowIndex.value - 1 < 0) {
|
||||
previous.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* กดปุ่มแก้ไขใน dialog
|
||||
*/
|
||||
const clickEdit = () => {
|
||||
next.value = false;
|
||||
previous.value = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* กดปุ่มเพิ่มด้านบน table
|
||||
*/
|
||||
const clickAdd = () => {
|
||||
addRow();
|
||||
};
|
||||
|
||||
const checkDelete = (row: RequestItemsObject) => {
|
||||
rawItem.value = row;
|
||||
modalDelete(
|
||||
$q,
|
||||
"ยืนยันการลบข้อมูล",
|
||||
"หากต้องการลบกดให้กดตกลง",
|
||||
clickDeleteRow
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* ลบข้อมูลใน table
|
||||
*/
|
||||
const clickDeleteRow = async () => {
|
||||
if (rawItem.value != null) {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.candidateAdminEducation(rawItem.value.id))
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
} else {
|
||||
await fetchData();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* กดบันทึกใน dialog
|
||||
*/
|
||||
const clickSave = async () => {
|
||||
myForm.value.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
if (modalEdit.value) {
|
||||
await editData();
|
||||
} else {
|
||||
await saveData();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* บันทึกเพิ่มข้อมูล
|
||||
*/
|
||||
const saveData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.candidateAdminEducation(candidateId.value), {
|
||||
educationLevelId: educationLevelId.value,
|
||||
major: major.value,
|
||||
scores: scores.value,
|
||||
name: name.value,
|
||||
durationStart: dateToISO(new Date(duration.value[0])),
|
||||
durationEnd: dateToISO(new Date(duration.value[1])),
|
||||
})
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* บันทึกแก้ไขข้อมูล
|
||||
*/
|
||||
const editData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.candidateAdminEducation(id.value), {
|
||||
educationLevelId: educationLevelId.value,
|
||||
major: major.value,
|
||||
scores: scores.value,
|
||||
name: name.value,
|
||||
durationStart: dateToISO(new Date(duration.value[0])),
|
||||
durationEnd: dateToISO(new Date(duration.value[1])),
|
||||
})
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
modal.value = false;
|
||||
await fetchData();
|
||||
});
|
||||
};
|
||||
|
||||
const checkClose = async () => {
|
||||
if (editRow.value == true) {
|
||||
modalConfirm(
|
||||
$q,
|
||||
"ข้อมูลมีการแก้ไข",
|
||||
"ยืนยันการดำเนินต่อใช่หรือไม่",
|
||||
clickClose
|
||||
);
|
||||
} else {
|
||||
await clickClose();
|
||||
}
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
/**
|
||||
* กดปิด dialog
|
||||
*/
|
||||
const clickClose = async () => {
|
||||
modal.value = false;
|
||||
editRow.value = false;
|
||||
next.value = false;
|
||||
previous.value = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* กดเลือกข้อมูลที่จะแก้ไข
|
||||
* @param props ค่า props ใน row ที่เลือก
|
||||
*/
|
||||
const selectData = (props: DataProps) => {
|
||||
modalEdit.value = true;
|
||||
modal.value = true;
|
||||
editRow.value = false;
|
||||
rawItem.value = props.row;
|
||||
rowIndex.value = props.rowIndex;
|
||||
educationLevel.value = props.row.educationLevel;
|
||||
educationLevelId.value = props.row.educationLevelId;
|
||||
major.value = props.row.major;
|
||||
scores.value = props.row.scores;
|
||||
name.value = props.row.name;
|
||||
duration.value = props.row.duration;
|
||||
id.value = props.row.id;
|
||||
next.value = false;
|
||||
previous.value = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* กดปุ่มเพิ่มบน table
|
||||
*/
|
||||
const addRow = () => {
|
||||
modalEdit.value = false;
|
||||
modal.value = true;
|
||||
educationLevel.value = "";
|
||||
educationLevelId.value = "";
|
||||
major.value = "";
|
||||
scores.value = null;
|
||||
name.value = "";
|
||||
duration.value = [new Date(), new Date()];
|
||||
};
|
||||
/**
|
||||
* เช็คว่ามีการแก้ไขข้อมูล
|
||||
*/
|
||||
const clickEditRow = () => {
|
||||
editRow.value = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* validate input ใน dialog
|
||||
*/
|
||||
const validateData = async () => {
|
||||
checkValidate.value = true;
|
||||
await myForm.value.validate().then((result: boolean) => {
|
||||
if (result == false) {
|
||||
checkValidate.value = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
||||
* @param val ข้อมูล input สำหรับแก้ไขหรือไม่
|
||||
*/
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.modalfix {
|
||||
position: fixed !important;
|
||||
}
|
||||
</style>
|
||||
186
src/modules/03_recruiting/components/ExamFinished.vue
Normal file
186
src/modules/03_recruiting/components/ExamFinished.vue
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
<template>
|
||||
<q-card bordered flat class="col-12 row">
|
||||
<div class="col-9 q-pa-md q-col-gutter-sm">
|
||||
<div class="row">
|
||||
<div class="">ชื่อ :</div>
|
||||
<div class="text-black text-bold q-pl-sm">{{ fullName }}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="">เลขประจำตัวประชาชน :</div>
|
||||
<div class="text-black text-bold q-pl-sm">{{ citizenId }}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="">เลขประจำตัวสอบ :</div>
|
||||
<div class="text-black text-bold q-pl-sm">{{ examNumber }}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="">เลขที่นั่งสอบ :</div>
|
||||
<div class="text-black text-bold q-pl-sm">{{ examSeat }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<q-card-section class="col-3">
|
||||
<q-img
|
||||
v-if="avatar == ''"
|
||||
class="rounded-borders"
|
||||
src="@/assets/avatar_user.jpg"
|
||||
:ratio="1"
|
||||
/>
|
||||
<q-img v-else class="rounded-borders" :src="avatar" :ratio="1" />
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
<q-card bordered flat class="col-12 row q-mt-md">
|
||||
<div class="q-pa-md row">
|
||||
<div class="row items-center q-gutter-y-sm col-12">
|
||||
<div class="col-xs-4 col-sm-5 text-weight-bold text-grey-7">ประเภท</div>
|
||||
<div class="col-xs-3 col-sm-2 text-primary text-weight-bold">
|
||||
คะแนนเต็ม
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 text-primary text-weight-bold">
|
||||
คะแนนที่ได้
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 text-primary text-weight-bold"></div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">ภาค ข</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreBFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreB }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">ภาค ค</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreCFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreC }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7 text-weight-bold">
|
||||
รวมทั้งหมด
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreSumFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreSum }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-weight-bold q-pt-sm">ผลการสอบ</div>
|
||||
<div class="col-xs-8 col-sm-6 q-pr-xs text-weight-bold text-subtitle1">
|
||||
<span
|
||||
:class="examResultinscore != 'ผ่าน' ? 'text-red' : 'text-positive'"
|
||||
>{{ examResultinscore }}</span
|
||||
>
|
||||
</div>
|
||||
<div class="col-xs-4 col-sm-5 q-pr-sm text-grey-7">ลำดับที่สอบได้</div>
|
||||
<div class="col-xs-8 col-sm-6 q-pr-xs">
|
||||
{{ number }}
|
||||
</div>
|
||||
<div class="col-xs-4 col-sm-5 q-pr-sm text-grey-7">
|
||||
วันหมดอายุบัญชีคัดเลือก
|
||||
</div>
|
||||
<div class="col-xs-8 col-sm-6 q-pr-xs">
|
||||
{{ score_expired == null ? "" : date2Thai(score_expired) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const props = defineProps({
|
||||
status: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
candidateId: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { messageError, date2Thai } = mixin;
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const fullName = ref<string>("");
|
||||
const examNumber = ref<string>("");
|
||||
const citizenId = ref<string>("");
|
||||
const examSeat = ref<string>("");
|
||||
const number = ref<string>("");
|
||||
const scoreBFull = ref<number | null>(null);
|
||||
const scoreB = ref<number | null>(null);
|
||||
const scoreCFull = ref<number | null>(null);
|
||||
const scoreC = ref<number | null>(null);
|
||||
const scoreSumFull = ref<number | null>(null);
|
||||
const scoreSum = ref<number | null>(null);
|
||||
const examResultinscore = ref<string>("");
|
||||
const avatar = ref<string>("");
|
||||
const score_expired = ref<Date>(new Date());
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchCard();
|
||||
});
|
||||
|
||||
const fetchCard = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.candidateCard(props.candidateId))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
fullName.value = data.prefix + data.firstName + " " + data.lastName;
|
||||
examNumber.value = data.examIdenNumber;
|
||||
citizenId.value = data.citizenId;
|
||||
examSeat.value = data.seatNumber;
|
||||
scoreBFull.value = data.pointTotalB;
|
||||
scoreB.value = data.pointB;
|
||||
scoreCFull.value = data.pointTotalC;
|
||||
scoreC.value = data.pointC;
|
||||
if (data.pointB != null && data.pointC != null) {
|
||||
scoreSum.value = parseInt(data.pointB) + parseInt(data.pointC);
|
||||
} else if (data.pointC != null) {
|
||||
scoreSum.value = parseInt(data.pointC);
|
||||
} else if (data.pointB != null) {
|
||||
scoreSum.value = parseInt(data.pointB);
|
||||
} else {
|
||||
scoreSum.value = null;
|
||||
}
|
||||
if (data.pointTotalB != null && data.pointTotalC != null) {
|
||||
scoreSumFull.value =
|
||||
parseInt(data.pointTotalB) + parseInt(data.pointTotalC);
|
||||
} else if (data.pointTotalC != null) {
|
||||
scoreSumFull.value = parseInt(data.pointTotalC);
|
||||
} else if (data.pointTotalB != null) {
|
||||
scoreSumFull.value = parseInt(data.pointTotalB);
|
||||
} else {
|
||||
scoreSumFull.value = null;
|
||||
}
|
||||
scoreC.value = data.pointC;
|
||||
examResultinscore.value = data.pass;
|
||||
avatar.value = data.avatar;
|
||||
score_expired.value = new Date(data.announcementDate);
|
||||
number.value = data.number;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
363
src/modules/03_recruiting/components/Family.vue
Normal file
363
src/modules/03_recruiting/components/Family.vue
Normal file
|
|
@ -0,0 +1,363 @@
|
|||
<!-- card ข้อมูลครอบครัว -->
|
||||
<template>
|
||||
<HeaderTop
|
||||
v-model:edit="edit"
|
||||
header="ข้อมูลครอบครัว"
|
||||
icon="mdi-account-group"
|
||||
:addData="true"
|
||||
:editOnly="false"
|
||||
:editData="false"
|
||||
/>
|
||||
<q-form ref="myform" class="col-12">
|
||||
<div class="row col-12 items-center q-col-gutter-xs">
|
||||
<div class="col-xs-12 q-gutter-sm items-center flex q-my-sm">
|
||||
<label class="text-weight-bold">• คู่สมรส</label>
|
||||
<q-radio
|
||||
v-model="defaultFamily.same"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="1"
|
||||
label="มี"
|
||||
dense
|
||||
:disable="!(status == 'checkRegister' || status == 'payment')"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="defaultFamily.same"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="0"
|
||||
label="ไม่มี"
|
||||
dense
|
||||
:disable="!(status == 'checkRegister' || status == 'payment')"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-2 col-md-2" v-if="defaultFamily.same == '1'">
|
||||
<q-select
|
||||
hide-bottom-space
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก คำนำหน้า'}`]"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultFamily.prefixIdC"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="prefixOptions"
|
||||
option-value="id"
|
||||
:label="`${'คำนำหน้า'}`"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-3 col-md-3" v-if="defaultFamily.same == '1'">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultFamily.firstnameC"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก ชื่อ'}`]"
|
||||
:label="`${'ชื่อ'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3" v-if="defaultFamily.same == '1'">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultFamily.lastnameC"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก นามสกุล'}`]"
|
||||
:label="`${'นามสกุล'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-2 col-md-2" v-if="defaultFamily.same == '1'">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultFamily.occupationC"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก อาชีพ'}`]"
|
||||
:label="`${'อาชีพ'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-2 col-md-2" v-if="defaultFamily.same == '1'">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultFamily.nationalityC"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก สัญชาติ'}`]"
|
||||
:label="`${'สัญชาติ'}`"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 text-weight-bold">• บิดา</div>
|
||||
<div class="col-xs-12 col-sm-2 col-md-2">
|
||||
<q-select
|
||||
hide-bottom-space
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก คำนำหน้า'}`]"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultFamily.prefixIdM"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="prefixOptions"
|
||||
option-value="id"
|
||||
:label="`${'คำนำหน้า'}`"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultFamily.firstnameM"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก ชื่อ'}`]"
|
||||
:label="`${'ชื่อ'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultFamily.lastnameM"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก นามสกุล'}`]"
|
||||
:label="`${'นามสกุล'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-2 col-md-2">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultFamily.occupationM"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก อาชีพ'}`]"
|
||||
:label="`${'อาชีพ'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-2 col-md-2">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultFamily.nationalityM"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก สัญชาติ'}`]"
|
||||
:label="`${'สัญชาติ'}`"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 text-weight-bold">• มารดา</div>
|
||||
<div class="col-xs-12 col-sm-2 col-md-2">
|
||||
<q-select
|
||||
hide-bottom-space
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก คำนำหน้า'}`]"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultFamily.prefixIdF"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="prefixOptions"
|
||||
option-value="id"
|
||||
:label="`${'คำนำหน้า'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultFamily.firstnameF"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก ชื่อ'}`]"
|
||||
:label="`${'ชื่อ'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultFamily.lastnameF"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก นามสกุล'}`]"
|
||||
:label="`${'นามสกุล'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-2 col-md-2">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultFamily.occupationF"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก อาชีพ'}`]"
|
||||
:label="`${'อาชีพ'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-2 col-md-2">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultFamily.nationalityF"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก สัญชาติ'}`]"
|
||||
:label="`${'สัญชาติ'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import type { PropType } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import type {
|
||||
Family,
|
||||
DataOption,
|
||||
} from "@/modules/03_recruiting/interface/index/Main";
|
||||
import {
|
||||
defaultFamily,
|
||||
changeData,
|
||||
} from "@/modules/03_recruiting/interface/index/Main";
|
||||
import HeaderTop from "@/modules/03_recruiting/components/top.vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const props = defineProps({
|
||||
prefixOptions: {
|
||||
type: Array as PropType<DataOption[]>,
|
||||
required: true,
|
||||
},
|
||||
status: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
form: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
const $q = useQuasar();
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError } = mixin;
|
||||
const edit = ref<boolean>(true);
|
||||
const myform = ref<any>({});
|
||||
const route = useRoute();
|
||||
const candidateId = ref<string>(route.params.candidateId.toString());
|
||||
|
||||
const emit = defineEmits(["update:form"]);
|
||||
|
||||
watch(myform, async (count: any, prevCount: any) => {
|
||||
emit("update:form", count);
|
||||
});
|
||||
|
||||
watch(defaultFamily, async (count: Family, prevCount: Family) => {
|
||||
await changeData("family", count);
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.candidateFamily(candidateId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
defaultFamily.value.prefixIdC = data.marryPrefixId;
|
||||
defaultFamily.value.firstnameC = data.marryFirstName;
|
||||
defaultFamily.value.lastnameC = data.marryLastName;
|
||||
defaultFamily.value.occupationC = data.marryOccupation;
|
||||
defaultFamily.value.nationalityC = data.marryNationality;
|
||||
defaultFamily.value.prefixIdM = data.fatherPrefixId;
|
||||
defaultFamily.value.firstnameM = data.fatherFirstName;
|
||||
defaultFamily.value.lastnameM = data.fatherLastName;
|
||||
defaultFamily.value.occupationM = data.fatherOccupation;
|
||||
defaultFamily.value.nationalityM = data.fatherNationality;
|
||||
defaultFamily.value.prefixIdF = data.motherPrefixId;
|
||||
defaultFamily.value.firstnameF = data.motherFirstName;
|
||||
defaultFamily.value.lastnameF = data.motherLastName;
|
||||
defaultFamily.value.occupationF = data.motherOccupation;
|
||||
defaultFamily.value.nationalityF = data.motherNationality;
|
||||
defaultFamily.value.same =
|
||||
data.marry == true ? "1" : data.marry == false ? "0" : null;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
</script>
|
||||
621
src/modules/03_recruiting/components/Information.vue
Normal file
621
src/modules/03_recruiting/components/Information.vue
Normal file
|
|
@ -0,0 +1,621 @@
|
|||
<!-- card ข้อมูลส่วนตัว -->
|
||||
<template>
|
||||
<HeaderTop
|
||||
v-model:edit="edit"
|
||||
header="ข้อมูลส่วนตัว"
|
||||
icon="mdi-account"
|
||||
:addData="true"
|
||||
:editOnly="false"
|
||||
:editData="false"
|
||||
/>
|
||||
<!-- :changeBtn="changeBtn" -->
|
||||
<q-form
|
||||
ref="myform"
|
||||
class="col-12 row q-col-gutter-x-sm justify-center q-col-gutter-sm"
|
||||
>
|
||||
<div
|
||||
class="row col-xs-12 col-sm-12 col-md-10 items-center q-col-gutter-x-sm q-col-gutter-y-xs"
|
||||
>
|
||||
<div class="col-xs-12 col-sm-2 col-md-2">
|
||||
<q-select
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก คำนำหน้า'}`]"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultInformation.prefixId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="prefixOptions"
|
||||
option-value="id"
|
||||
:label="`${'คำนำหน้า'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-5 col-md-5">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultInformation.firstname"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก ชื่อ'}`]"
|
||||
:label="`${'ชื่อ'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-5 col-md-5">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultInformation.lastname"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก นามสกุล'}`]"
|
||||
:label="`${'นามสกุล'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultInformation.nationality"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก สัญชาติ'}`]"
|
||||
:label="`${'สัญชาติ'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<datepicker
|
||||
v-model="defaultInformation.birthDate"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:max-date="new Date()"
|
||||
:disabled="!(status == 'checkRegister' || status == 'payment')"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
:class="
|
||||
getClass(status == 'checkRegister' || status == 'payment')
|
||||
"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:model-value="
|
||||
defaultInformation.birthDate == null
|
||||
? null
|
||||
: date2Thai(defaultInformation.birthDate)
|
||||
"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก วัน/เดือน/ปี เกิด'}`]"
|
||||
:label="`${'วัน/เดือน/ปี เกิด'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="mdi-calendar-outline"
|
||||
class="cursor-pointer"
|
||||
size="22px"
|
||||
:style="
|
||||
status == 'checkRegister' || status == 'payment'
|
||||
? 'color: var(--q-primary)'
|
||||
: 'color: var(--q-grey)'
|
||||
"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3 q-pb-md">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
dense
|
||||
lazy-rules
|
||||
readonly
|
||||
borderless
|
||||
:style="
|
||||
!(status == 'checkRegister' || status == 'payment')
|
||||
? ''
|
||||
: 'padding:0 12px;'
|
||||
"
|
||||
:model-value="
|
||||
defaultInformation.birthDate == null
|
||||
? null
|
||||
: calAge(defaultInformation.birthDate)
|
||||
"
|
||||
:label="`${'อายุ'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-select
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก สถานภาพ'}`]"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultInformation.relationshipId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="relationshipOptions"
|
||||
option-value="id"
|
||||
:label="`${'สถานภาพ'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
type="tel"
|
||||
mask="#############"
|
||||
:counter="
|
||||
status == 'checkRegister' || status == 'payment' ? true : false
|
||||
"
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultInformation.cardid"
|
||||
maxlength="13"
|
||||
:rules="[
|
||||
(val) =>
|
||||
val.length == 13 || `${'กรุณากรอก เลขบัตรประจำตัวประชาชน'}`,
|
||||
(val) =>
|
||||
/^[0-9]*$/.test(val) ||
|
||||
`${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ถูกต้อง'}`,
|
||||
]"
|
||||
label="เลขบัตรประจำตัวประชาชน"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-select
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก จังหวัด'}`]"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultInformation.provinceId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="provinceOptions"
|
||||
option-value="id"
|
||||
:label="`${'ออกให้ ณ จังหวัด'}`"
|
||||
@update:model-value="(value) => selectProvince(value)"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-select
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกอำเภอ'}`]"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultInformation.districtId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="districtOptions"
|
||||
option-value="id"
|
||||
:label="`${'ออกให้ ณ อำเภอ'}`"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<datepicker
|
||||
v-model="defaultInformation.cardIdDate"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:max-date="new Date()"
|
||||
:disabled="!(status == 'checkRegister' || status == 'payment')"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
:class="
|
||||
getClass(status == 'checkRegister' || status == 'payment')
|
||||
"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:model-value="
|
||||
defaultInformation.cardIdDate == null
|
||||
? null
|
||||
: date2Thai(defaultInformation.cardIdDate)
|
||||
"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณาเลือก วัน/เดือน/ปี ที่ออกบัตร'}`,
|
||||
]"
|
||||
:label="`${'วัน/เดือน/ปี ที่ออกบัตร'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="mdi-calendar-outline"
|
||||
class="cursor-pointer"
|
||||
:style="
|
||||
status == 'checkRegister' || status == 'payment'
|
||||
? 'color: var(--q-primary)'
|
||||
: 'color: var(--q-grey)'
|
||||
"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
:counter="
|
||||
status == 'checkRegister' || status == 'payment' ? true : false
|
||||
"
|
||||
lazy-rules
|
||||
type="tel"
|
||||
mask="##########"
|
||||
maxlength="10"
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultInformation.tel"
|
||||
:rules="[
|
||||
(val) => val.length == 10 || `${'กรุณากรอก โทรศัพท์'}`,
|
||||
(val) =>
|
||||
/^[0-9]*$/.test(val) || `${'กรุณากรอกข้อมูลโทรศัพท์ให้ถูกต้อง'}`,
|
||||
]"
|
||||
:label="`${'โทรศัพท์'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
:counter="
|
||||
status == 'checkRegister' || status == 'payment' ? true : false
|
||||
"
|
||||
lazy-rules
|
||||
type="tel"
|
||||
mask="##########"
|
||||
maxlength="10"
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultInformation.phone"
|
||||
:rules="[
|
||||
(val) => val.length == 10 || `${'กรุณากรอก โทรศัพท์มือถือ'}`,
|
||||
(val) =>
|
||||
/^[0-9]*$/.test(val) ||
|
||||
`${'กรุณากรอกข้อมูลโทรศัพท์มือถือให้ถูกต้อง'}`,
|
||||
]"
|
||||
:label="`${'โทรศัพท์มือถือ'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3 q-pb-md">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
dense
|
||||
lazy-rules
|
||||
readonly
|
||||
borderless
|
||||
style="padding: 0 12px"
|
||||
v-model="defaultInformation.email"
|
||||
label="E-mail address"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row col-xs-12 col-sm-3 col-md-2 justify-center">
|
||||
<div
|
||||
class="containerimage row justify-center col-xs-6 col-sm-10 col-md-12"
|
||||
>
|
||||
<label for="file-upload" class="col-12 row">
|
||||
<q-img v-if="img == ''" src="@/assets/avatar_user.jpg" class="col-12">
|
||||
<div
|
||||
class="overlay"
|
||||
v-if="status == 'checkRegister' || status == 'payment'"
|
||||
>
|
||||
<q-icon name="mdi-camera" />
|
||||
<br />อัปเดต
|
||||
</div>
|
||||
</q-img>
|
||||
<q-img v-else :src="img" class="col-12">
|
||||
<div
|
||||
class="overlay"
|
||||
v-if="status == 'checkRegister' || status == 'payment'"
|
||||
>
|
||||
<q-icon name="mdi-camera" />
|
||||
<br />อัปเดต
|
||||
</div>
|
||||
</q-img>
|
||||
</label>
|
||||
<input
|
||||
id="file-upload"
|
||||
type="file"
|
||||
accept="image/*"
|
||||
@change="uploadImage"
|
||||
v-if="status == 'checkRegister' || status == 'payment'"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-9 col-md-12">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultInformation.knowledge"
|
||||
label="ความรู้ความสามารถพิเศษ"
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
</q-form>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import type { PropType } from "vue";
|
||||
import type {
|
||||
Information,
|
||||
DataOption,
|
||||
} from "@/modules/03_recruiting/interface/index/Main";
|
||||
import {
|
||||
defaultInformation,
|
||||
changeData,
|
||||
} from "@/modules/03_recruiting/interface/index/Main";
|
||||
import HeaderTop from "@/modules/03_recruiting/components/top.vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
|
||||
const props = defineProps({
|
||||
prefixOptions: {
|
||||
type: Array as PropType<DataOption[]>,
|
||||
required: true,
|
||||
},
|
||||
relationshipOptions: {
|
||||
type: Array as PropType<DataOption[]>,
|
||||
required: true,
|
||||
},
|
||||
provinceOptions: {
|
||||
type: Array as PropType<DataOption[]>,
|
||||
required: true,
|
||||
},
|
||||
status: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
form: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, calAge, modalError, success } = mixin;
|
||||
const districtOptions = ref<DataOption[]>([]);
|
||||
const route = useRoute();
|
||||
const candidateId = ref<string>(route.params.candidateId.toString());
|
||||
const edit = ref<boolean>(true);
|
||||
const myform = ref<any>({});
|
||||
const img = ref<string>("");
|
||||
const fileProfile = ref<File[]>([]);
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const { messageError } = mixin;
|
||||
|
||||
const emit = defineEmits(["update:form"]);
|
||||
|
||||
watch(myform, async (count: any, prevCount: any) => {
|
||||
emit("update:form", count);
|
||||
});
|
||||
|
||||
watch(
|
||||
defaultInformation,
|
||||
async (count: Information, prevCount: Information) => {
|
||||
await changeData("information", count);
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
await fetchImgData();
|
||||
if (defaultInformation.value.provinceId != null)
|
||||
await fetchDistrict(defaultInformation.value.provinceId);
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.candidateInformation(candidateId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
defaultInformation.value.prefixId = data.prefixId;
|
||||
defaultInformation.value.lastname = data.lastName;
|
||||
defaultInformation.value.provinceId = data.citizenProvinceId;
|
||||
defaultInformation.value.districtId = data.citizenDistrictId;
|
||||
defaultInformation.value.birthDate =
|
||||
data.dateOfBirth == null ? null : new Date(data.dateOfBirth);
|
||||
defaultInformation.value.cardIdDate =
|
||||
data.citizenDate == null ? null : new Date(data.citizenDate);
|
||||
defaultInformation.value.cardid = data.citizenId;
|
||||
defaultInformation.value.firstname = data.firstName;
|
||||
defaultInformation.value.relationshipId = data.relationshipId;
|
||||
defaultInformation.value.nationality = data.nationality;
|
||||
defaultInformation.value.email = data.email;
|
||||
defaultInformation.value.phone = data.mobilePhone;
|
||||
defaultInformation.value.tel = data.telephone;
|
||||
defaultInformation.value.knowledge = data.knowledge;
|
||||
})
|
||||
.catch(() => {
|
||||
defaultInformation.value.email =
|
||||
keycloak.tokenParsed == null ? "" : keycloak.tokenParsed.email;
|
||||
defaultInformation.value.firstname =
|
||||
keycloak.tokenParsed == null ? "" : keycloak.tokenParsed.given_name;
|
||||
defaultInformation.value.lastname =
|
||||
keycloak.tokenParsed == null ? "" : keycloak.tokenParsed.family_name;
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchImgData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.candidateProfile(candidateId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
img.value = data;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const uploadImage = async (e: any) => {
|
||||
let input = e.target.files;
|
||||
if (input.length > 0) {
|
||||
const formData = new FormData();
|
||||
formData.append("", input[0]);
|
||||
await http
|
||||
.put(config.API.candidateProfile(candidateId.value), formData)
|
||||
.then((res) => {
|
||||
success($q, "อัปโหลดรูปสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchImgData();
|
||||
fileProfile.value = [];
|
||||
});
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
const selectProvince = (val: string) => {
|
||||
defaultInformation.value.districtId = "";
|
||||
myform.value.resetValidation();
|
||||
fetchDistrict(val);
|
||||
};
|
||||
|
||||
const fetchDistrict = async (id: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.listDistrict(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: DataOption) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
});
|
||||
districtOptions.value = option;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.containerimage {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.q-img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-height: 170px;
|
||||
padding: 1%;
|
||||
border-radius: 8px;
|
||||
border: solid 2px rgba(168, 168, 168, 0.055) !important;
|
||||
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.048), 0 3px 6px 0 rgba(0, 0, 0, 0.097);
|
||||
}
|
||||
|
||||
.overlay {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
background: rgb(0, 0, 0);
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
color: #f1f1f1;
|
||||
transition: 0.5s ease;
|
||||
width: 100%;
|
||||
height: 70px;
|
||||
opacity: 0;
|
||||
color: white;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
padding: 5% 0 5% 0;
|
||||
}
|
||||
|
||||
.containerimage:hover .overlay {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.q-field__bottom {
|
||||
padding: 5px 10px 0px 0px;
|
||||
}
|
||||
|
||||
input[type="file"] {
|
||||
display: none;
|
||||
}
|
||||
.custom-file-upload {
|
||||
border: 1px solid #ccc;
|
||||
display: inline-block;
|
||||
padding: 6px 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
340
src/modules/03_recruiting/components/Occupation.vue
Normal file
340
src/modules/03_recruiting/components/Occupation.vue
Normal file
|
|
@ -0,0 +1,340 @@
|
|||
<!-- card อาชีพ -->
|
||||
<template>
|
||||
<HeaderTop
|
||||
v-model:edit="edit"
|
||||
header="อาชีพ"
|
||||
icon="mdi-briefcase"
|
||||
:addData="true"
|
||||
:editOnly="false"
|
||||
:editData="false"
|
||||
/>
|
||||
<q-form ref="myform">
|
||||
<div class="row col-12 items-center q-col-gutter-x-sm q-col-gutter-y-xs">
|
||||
<div class="col-12 row q-pb-lg">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
dense
|
||||
lazy-rules
|
||||
type="textarea"
|
||||
autogrow
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultOccupation.official"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก สำนัก/บริษัท'}`]"
|
||||
:disable="
|
||||
defaultOccupation.status !== 'official' ||
|
||||
!(status == 'checkRegister' || status == 'payment')
|
||||
"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<q-radio
|
||||
v-model="defaultOccupation.status"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="official"
|
||||
label="ข้าราชการกรุงเทพมหานคร ตำแหน่ง"
|
||||
dense
|
||||
:disable="!(status == 'checkRegister' || status == 'payment')"
|
||||
size="md"
|
||||
style="font-size: 14px; color: black"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
dense
|
||||
lazy-rules
|
||||
type="textarea"
|
||||
autogrow
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultOccupation.personnel"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก สำนัก/บริษัท'}`]"
|
||||
:disable="
|
||||
defaultOccupation.status !== 'personnel' ||
|
||||
!(status == 'checkRegister' || status == 'payment')
|
||||
"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<q-radio
|
||||
v-model="defaultOccupation.status"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="personnel"
|
||||
label="บุคลากรกรุงเทพมหานคร ตำแหน่ง"
|
||||
dense
|
||||
:disable="!(status == 'checkRegister' || status == 'payment')"
|
||||
size="md"
|
||||
style="font-size: 14px; color: black"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
dense
|
||||
lazy-rules
|
||||
type="textarea"
|
||||
autogrow
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultOccupation.officialsOther"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก สำนัก/บริษัท'}`]"
|
||||
:disable="
|
||||
defaultOccupation.status !== 'officialsOther' ||
|
||||
!(status == 'checkRegister' || status == 'payment')
|
||||
"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<q-radio
|
||||
v-model="defaultOccupation.status"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="officialsOther"
|
||||
label="ข้าราชการประเภทอื่น ตำแหน่ง"
|
||||
dense
|
||||
:disable="!(status == 'checkRegister' || status == 'payment')"
|
||||
size="md"
|
||||
style="font-size: 14px; color: black"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
dense
|
||||
lazy-rules
|
||||
type="textarea"
|
||||
autogrow
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultOccupation.employee"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก สำนัก/บริษัท'}`]"
|
||||
:disable="
|
||||
defaultOccupation.status !== 'employee' ||
|
||||
!(status == 'checkRegister' || status == 'payment')
|
||||
"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<q-radio
|
||||
v-model="defaultOccupation.status"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="employee"
|
||||
label="ลูกจ้าง/พนักงานราชการของส่วนราชการอื่น ตำแหน่ง"
|
||||
dense
|
||||
:disable="!(status == 'checkRegister' || status == 'payment')"
|
||||
size="md"
|
||||
style="font-size: 14px; color: black"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-radio
|
||||
v-model="defaultOccupation.status"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="studying"
|
||||
label="กำลังศึกษาต่อ"
|
||||
dense
|
||||
:disable="!(status == 'checkRegister' || status == 'payment')"
|
||||
size="md"
|
||||
style="font-size: 14px; color: black"
|
||||
/>
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
hide-bottom-space
|
||||
dense
|
||||
lazy-rules
|
||||
type="textarea"
|
||||
autogrow
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultOccupation.other"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก สำนัก/บริษัท'}`]"
|
||||
:disable="
|
||||
defaultOccupation.status !== 'other' ||
|
||||
!(status == 'checkRegister' || status == 'payment')
|
||||
"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<q-radio
|
||||
v-model="defaultOccupation.status"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="other"
|
||||
label="อื่นๆ"
|
||||
dense
|
||||
:disable="!(status == 'checkRegister' || status == 'payment')"
|
||||
size="md"
|
||||
style="font-size: 14px; color: black"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
type="textarea"
|
||||
autogrow
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultOccupation.company"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก สำนัก/บริษัท'}`]"
|
||||
:label="`${'สำนัก/บริษัท'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
type="textarea"
|
||||
autogrow
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultOccupation.department"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก กอง/ฝ่าย'}`]"
|
||||
:label="`${'กอง/ฝ่าย'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
type="textarea"
|
||||
autogrow
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultOccupation.email"
|
||||
:rules="[
|
||||
(val) => !!val || 'กรุณากรอก E-mail address',
|
||||
(val) =>
|
||||
/^([a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})$/.test(val) ||
|
||||
'E-mail address ไม่ถูกต้อง',
|
||||
]"
|
||||
:label="`${'E-mail address'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
:counter="
|
||||
status == 'checkRegister' || status == 'payment' ? true : false
|
||||
"
|
||||
maxlength="10"
|
||||
lazy-rules
|
||||
type="tel"
|
||||
mask="##########"
|
||||
autogrow
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
v-model="defaultOccupation.tel"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณากรอก โทรศัพท์'}`,
|
||||
(val) => /^[0-9]*$/.test(val) || 'กรุณากรอก โทรศัพท์ให้ถูกต้อง',
|
||||
]"
|
||||
:label="`${'โทรศัพท์'}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import type { Occupation } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import {
|
||||
defaultOccupation,
|
||||
changeData,
|
||||
} from "@/modules/03_recruiting/interface/index/Main";
|
||||
import HeaderTop from "@/modules/03_recruiting/components/top.vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const props = defineProps({
|
||||
status: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
form: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const $q = useQuasar();
|
||||
const edit = ref<boolean>(true);
|
||||
const myform = ref<any>({});
|
||||
const route = useRoute();
|
||||
const candidateId = ref<string>(route.params.candidateId.toString());
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError } = mixin;
|
||||
|
||||
const emit = defineEmits(["update:form"]);
|
||||
|
||||
watch(myform, async (count: any, prevCount: any) => {
|
||||
emit("update:form", count);
|
||||
});
|
||||
|
||||
watch(defaultOccupation, async (count: Occupation, prevCount: Occupation) => {
|
||||
await changeData("occupation", count);
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.candidateOccupation(candidateId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
defaultOccupation.value.status = data.occupationType;
|
||||
defaultOccupation.value.company = data.occupationCompany;
|
||||
defaultOccupation.value.department = data.occupationDepartment;
|
||||
defaultOccupation.value.email = data.occupationEmail;
|
||||
defaultOccupation.value.tel = data.occupationTelephone;
|
||||
defaultOccupation.value.official =
|
||||
data.occupationType == "official" ? data.occupationPosition : null;
|
||||
defaultOccupation.value.personnel =
|
||||
data.occupationType == "personnel" ? data.occupationPosition : null;
|
||||
defaultOccupation.value.officialsOther =
|
||||
data.occupationType == "officialsOther"
|
||||
? data.occupationPosition
|
||||
: null;
|
||||
defaultOccupation.value.employee =
|
||||
data.occupationType == "employee" ? data.occupationPosition : null;
|
||||
defaultOccupation.value.other =
|
||||
data.occupationType == "other" ? data.occupationPosition : null;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const getClass = (val: boolean) => {
|
||||
return {
|
||||
"full-width inputgreen cursor-pointer": val,
|
||||
"full-width cursor-pointer": !val,
|
||||
};
|
||||
};
|
||||
</script>
|
||||
188
src/modules/03_recruiting/components/Profile.vue
Normal file
188
src/modules/03_recruiting/components/Profile.vue
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
<!-- tab ข้อมูลส่วนบุคคล -->
|
||||
<template>
|
||||
<div class="q-px-sm">
|
||||
<Information
|
||||
:prefixOptions="prefixOptions"
|
||||
:relationshipOptions="relationshipOptions"
|
||||
:provinceOptions="provinceOptions"
|
||||
:status="status"
|
||||
v-model:form="formInformation"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<q-separator class="q-my-lg bg-gray" size="5px" />
|
||||
<div class="q-px-sm">
|
||||
<Address
|
||||
:provinceOptions="provinceOptions"
|
||||
:status="status"
|
||||
v-model:form="formAddress"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<q-separator class="q-my-lg bg-gray" size="5px" />
|
||||
<div class="q-px-sm">
|
||||
<Family :prefixOptions="prefixOptions" :status="status" v-model:form="formFamily" />
|
||||
</div>
|
||||
|
||||
<q-separator class="q-my-lg bg-gray" size="5px" />
|
||||
<div class="q-px-sm">
|
||||
<Occupation :status="status" v-model:form="formOccupation" />
|
||||
</div>
|
||||
|
||||
<q-separator class="q-my-lg bg-gray" size="5px" />
|
||||
<div class="q-px-sm">
|
||||
<Education :status="status" />
|
||||
</div>
|
||||
|
||||
<q-separator class="q-my-lg bg-gray" size="5px" />
|
||||
<div class="q-px-sm">
|
||||
<Career :status="status" />
|
||||
</div>
|
||||
|
||||
<q-separator class="q-my-lg bg-gray" size="5px" />
|
||||
<div class="q-px-sm">
|
||||
<Document :status="status" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import type { DataOption } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import Information from "@/modules/03_recruiting/components/Information.vue";
|
||||
import Address from "@/modules/03_recruiting/components/Address.vue";
|
||||
import Family from "@/modules/03_recruiting/components/Family.vue";
|
||||
import Occupation from "@/modules/03_recruiting/components/Occupation.vue";
|
||||
import Education from "@/modules/03_recruiting/components/Education.vue";
|
||||
import Career from "@/modules/03_recruiting/components/Career.vue";
|
||||
import Document from "@/modules/03_recruiting/components/Document.vue";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const props = defineProps({
|
||||
status: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
formInformation: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
formAddress: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
formFamily: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
formOccupation: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const $q = useQuasar();
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const prefixOptions = ref<DataOption[]>([]);
|
||||
const relationshipOptions = ref<DataOption[]>([]);
|
||||
const provinceOptions = ref<DataOption[]>([]);
|
||||
const formInformation = ref<any>({});
|
||||
const formAddress = ref<any>({});
|
||||
const formFamily = ref<any>({});
|
||||
const formOccupation = ref<any>({});
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError } = mixin;
|
||||
|
||||
const emit = defineEmits([
|
||||
"update:formInformation",
|
||||
"update:formAddress",
|
||||
"update:formFamily",
|
||||
"update:formOccupation",
|
||||
]);
|
||||
|
||||
watch(formInformation, async (count: Object, prevCount: Object) => {
|
||||
emit("update:formInformation", count);
|
||||
});
|
||||
|
||||
watch(formAddress, async (count: Object, prevCount: Object) => {
|
||||
emit("update:formAddress", count);
|
||||
});
|
||||
|
||||
watch(formFamily, async (count: Object, prevCount: Object) => {
|
||||
emit("update:formFamily", count);
|
||||
});
|
||||
|
||||
watch(formOccupation, async (count: Object, prevCount: Object) => {
|
||||
emit("update:formOccupation", count);
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
loaderPage(false);
|
||||
fetchPrefix();
|
||||
fetchRelationship();
|
||||
fetchProvince();
|
||||
});
|
||||
|
||||
const fetchPrefix = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.prefix)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: any) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
});
|
||||
prefixOptions.value = option;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchRelationship = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.relationship)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: any) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
});
|
||||
relationshipOptions.value = option;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchProvince = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.province)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: any) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
});
|
||||
provinceOptions.value = option;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
235
src/modules/03_recruiting/components/Table.vue
Normal file
235
src/modules/03_recruiting/components/Table.vue
Normal file
|
|
@ -0,0 +1,235 @@
|
|||
<template>
|
||||
<div class="q-pb-sm row q-col-gutter-sm">
|
||||
<!-- -->
|
||||
<div class="q-gutter-sm" v-if="nornmalData == true">
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
@click="checkAdd"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="row q-gutter-sm q-pb-sm" v-if="conclude == true">
|
||||
<q-card bordered flat class="q-px-md no-wrap row">
|
||||
<div class="col-12 text-subtitle2 row items-center">
|
||||
<span class="text-weight-medium text-dark">ผู้สมัครสอบ</span>
|
||||
<q-space />
|
||||
<q-badge
|
||||
color="white"
|
||||
class="text-weight-bold text-subtitle1 text-primary"
|
||||
:label="`${count}`"
|
||||
rounded
|
||||
/>
|
||||
</div>
|
||||
</q-card>
|
||||
<q-card bordered flat class="q-px-md no-wrap row">
|
||||
<div class="col-12 text-subtitle2 row items-center">
|
||||
<span class="text-weight-medium text-dark">สอบผ่าน</span>
|
||||
<q-space />
|
||||
<q-badge
|
||||
color="white"
|
||||
class="text-weight-bold text-subtitle1 text-blue"
|
||||
:label="`${pass}`"
|
||||
rounded
|
||||
/>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<q-card bordered flat class="q-px-md no-wrap row">
|
||||
<div class="col-12 text-subtitle2 row items-center">
|
||||
<span class="text-weight-medium text-dark">สอบไม่ผ่าน</span>
|
||||
<q-space />
|
||||
<q-badge
|
||||
color="white"
|
||||
class="text-weight-bold text-subtitle1 text-pink"
|
||||
:label="`${notpass}`"
|
||||
rounded
|
||||
/>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<q-space />
|
||||
<div class="items-center q-gutter-sm" style="display: flex">
|
||||
<!-- ค้นหาข้อความใน table -->
|
||||
<q-input
|
||||
standout
|
||||
dense
|
||||
:model-value="inputfilter"
|
||||
ref="filterRef"
|
||||
@update:model-value="updateInput"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="inputfilter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="inputfilter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<!-- แสดงคอลัมน์ใน table -->
|
||||
<q-select
|
||||
:model-value="inputvisible"
|
||||
@update:model-value="updateVisible"
|
||||
:display-value="$q.lang.table.columns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
:options="attrs.columns"
|
||||
options-dense
|
||||
option-value="name"
|
||||
map-options
|
||||
emit-value
|
||||
style="min-width: 150px"
|
||||
class="gt-xs"
|
||||
>
|
||||
<template> </template>
|
||||
</q-select>
|
||||
</div>
|
||||
</div>
|
||||
<q-table
|
||||
ref="table"
|
||||
flat
|
||||
bordered
|
||||
class="custom-table2"
|
||||
v-bind="attrs"
|
||||
virtual-scroll
|
||||
:virtual-scroll-sticky-size-start="48"
|
||||
dense
|
||||
:pagination-label="paginationLabel"
|
||||
:pagination="initialPagination"
|
||||
:rows-per-page-options="[0]"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium" v-html="col.label" />
|
||||
</q-th>
|
||||
<q-th auto-width v-if="nornmalData == true" />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template #body="props">
|
||||
<slot v-bind="props" name="columns"></slot>
|
||||
</template>
|
||||
</q-table>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, useAttrs } from "vue";
|
||||
import type { Pagination } from "@/modules/04_registry/interface/index/Main";
|
||||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const table = ref<any>(null);
|
||||
const filterRef = ref<any>(null);
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
|
||||
const props = defineProps({
|
||||
count: Number,
|
||||
pass: Number,
|
||||
notpass: Number,
|
||||
|
||||
inputfilter: String,
|
||||
name: String,
|
||||
icon: String,
|
||||
inputvisible: Array,
|
||||
editvisible: Boolean,
|
||||
add: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
validate: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
nornmalData: {
|
||||
type: Boolean,
|
||||
defualt: true,
|
||||
},
|
||||
conclude: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits([
|
||||
"update:inputfilter",
|
||||
"update:inputvisible",
|
||||
"update:editvisible",
|
||||
]);
|
||||
const updateInput = (value: string | number | null) => {
|
||||
emit("update:inputfilter", value);
|
||||
};
|
||||
const updateVisible = (value: []) => {
|
||||
emit("update:inputvisible", value);
|
||||
};
|
||||
|
||||
const paginationLabel = (start: string, end: string, total: string) => {
|
||||
return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
|
||||
const checkAdd = () => {
|
||||
props.add();
|
||||
};
|
||||
|
||||
const resetFilter = () => {
|
||||
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
|
||||
emit("update:inputfilter", "");
|
||||
filterRef.value.focus();
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.icon-color {
|
||||
color: #4154b3;
|
||||
}
|
||||
|
||||
.custom-table2 {
|
||||
max-height: 64vh;
|
||||
|
||||
.q-table tr:nth-child(odd) td {
|
||||
background: white;
|
||||
}
|
||||
|
||||
.q-table tr:nth-child(even) td {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.q-table thead tr {
|
||||
background: #ecebeb;
|
||||
}
|
||||
|
||||
.q-table thead tr th {
|
||||
position: sticky;
|
||||
}
|
||||
|
||||
.q-table td:nth-of-type(2) {
|
||||
z-index: 3 !important;
|
||||
}
|
||||
|
||||
.q-table th:nth-of-type(2),
|
||||
.q-table td:nth-of-type(2) {
|
||||
position: sticky;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* this will be the loading indicator */
|
||||
.q-table thead tr:last-child th {
|
||||
/* height of all previous header rows */
|
||||
top: 48px;
|
||||
}
|
||||
|
||||
.q-table thead tr:first-child th {
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
220
src/modules/03_recruiting/components/TableCan.vue
Normal file
220
src/modules/03_recruiting/components/TableCan.vue
Normal file
|
|
@ -0,0 +1,220 @@
|
|||
<template>
|
||||
<div class="q-pb-sm row items-center">
|
||||
<!-- -->
|
||||
<HeaderTop
|
||||
v-model:edit="editBtn"
|
||||
:header="name"
|
||||
:icon="icon"
|
||||
:add="clickAdd"
|
||||
:editBtn="clickEdit"
|
||||
:cancel="clickCancel"
|
||||
:addData="false"
|
||||
:editOnly="false"
|
||||
:editData="editData"
|
||||
/>
|
||||
<q-space />
|
||||
<div class="items-center q-col-gutter-x-sm" style="display: flex">
|
||||
<!-- ค้นหาข้อความใน table -->
|
||||
<q-input
|
||||
standout
|
||||
dense
|
||||
:model-value="inputfilter"
|
||||
ref="filterRef"
|
||||
@update:model-value="updateInput"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="inputfilter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="inputfilter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<!-- แสดงคอลัมน์ใน table -->
|
||||
<q-select
|
||||
:model-value="inputvisible"
|
||||
@update:model-value="updateVisible"
|
||||
:display-value="$q.lang.table.columns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
:options="attrs.columns"
|
||||
options-dense
|
||||
option-value="name"
|
||||
map-options
|
||||
emit-value
|
||||
style="min-width: 150px"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<q-table
|
||||
ref="table"
|
||||
flat
|
||||
bordered
|
||||
class="custom-header-table"
|
||||
v-bind="attrs"
|
||||
virtual-scroll
|
||||
:virtual-scroll-sticky-size-start="48"
|
||||
dense
|
||||
:pagination-label="paginationLabel"
|
||||
:pagination="initialPagination"
|
||||
:rows-per-page-options="[0]"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th auto-width v-if="editBtn == true" />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template #body="props">
|
||||
<slot v-bind="props" name="columns"></slot>
|
||||
</template>
|
||||
</q-table>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, useAttrs, watch } from "vue";
|
||||
import HeaderTop from "@/modules/03_recruiting/components/top.vue";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const table = ref<any>(null);
|
||||
const filterRef = ref<any>(null);
|
||||
const editBtn = ref<boolean>(true);
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
|
||||
const props = defineProps({
|
||||
inputfilter: String,
|
||||
name: String,
|
||||
icon: String,
|
||||
inputvisible: Array,
|
||||
editvisible: Boolean,
|
||||
nameHeader: Boolean,
|
||||
addData: {
|
||||
type: Boolean,
|
||||
defualt: true,
|
||||
},
|
||||
edit: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
add: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
cancel: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
validate: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
editData: {
|
||||
type: Boolean,
|
||||
defualt: true,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits([
|
||||
"update:inputfilter",
|
||||
"update:inputvisible",
|
||||
"update:editvisible",
|
||||
]);
|
||||
|
||||
watch(props, (count: any, prevCount: any) => {
|
||||
editBtn.value = props.editvisible;
|
||||
});
|
||||
|
||||
const updateEdit = (value: Boolean) => {
|
||||
emit("update:editvisible", value);
|
||||
};
|
||||
const updateInput = (value: string | number | null) => {
|
||||
emit("update:inputfilter", value);
|
||||
};
|
||||
const updateVisible = (value: []) => {
|
||||
emit("update:inputvisible", value);
|
||||
};
|
||||
|
||||
const paginationLabel = (start: string, end: string, total: string) => {
|
||||
return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
|
||||
const clickAdd = () => {
|
||||
props.add();
|
||||
};
|
||||
|
||||
const clickEdit = () => {
|
||||
props.edit();
|
||||
};
|
||||
|
||||
const clickCancel = () => {
|
||||
props.cancel();
|
||||
};
|
||||
|
||||
const edit = async () => {
|
||||
updateEdit(!props.editvisible);
|
||||
props.edit();
|
||||
};
|
||||
|
||||
const cancel = async () => {
|
||||
updateEdit(!props.editvisible);
|
||||
props.cancel();
|
||||
};
|
||||
|
||||
const resetFilter = () => {
|
||||
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
|
||||
emit("update:inputfilter", "");
|
||||
filterRef.value.focus();
|
||||
};
|
||||
|
||||
const add = () => {
|
||||
props.add();
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.icon-color {
|
||||
color: #4154b3;
|
||||
}
|
||||
|
||||
.custom-header-table {
|
||||
max-height: 64vh;
|
||||
|
||||
.q-table tr:nth-child(odd) td {
|
||||
background: white;
|
||||
}
|
||||
|
||||
.q-table tr:nth-child(even) td {
|
||||
background: #f6f6f6ae;
|
||||
}
|
||||
|
||||
.q-table thead tr {
|
||||
background: #a6b8c313;
|
||||
}
|
||||
|
||||
.q-table thead tr th {
|
||||
position: sticky;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* this will be the loading indicator */
|
||||
.q-table thead tr:last-child th {
|
||||
/* height of all previous header rows */
|
||||
top: 48px;
|
||||
}
|
||||
|
||||
.q-table thead tr:first-child th {
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
426
src/modules/03_recruiting/components/TableCandidate.vue
Normal file
426
src/modules/03_recruiting/components/TableCandidate.vue
Normal file
|
|
@ -0,0 +1,426 @@
|
|||
<template>
|
||||
<div class="q-px-md q-pb-md">
|
||||
<div class="col-12 row q-py-sm items-center">
|
||||
<span class="text-subtitle1">{{ titleText }}</span>
|
||||
<q-select
|
||||
dense
|
||||
outlined
|
||||
:model-value="inputvisibleFilter"
|
||||
:options="optionsFilter"
|
||||
class="col-xs-12 col-sm-4 col-md-3"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
map-options
|
||||
emit-value
|
||||
@update:model-value="updateVisibleFilter"
|
||||
v-if="optionsFilter != undefined && optionsFilter.length > 0"
|
||||
/>
|
||||
<q-file
|
||||
v-model="files"
|
||||
dense
|
||||
:label="setSeat == false ? 'อัปโหลดที่นั่งสอบ' : 'อัปโหลดคะแนนสอบ'"
|
||||
outlined
|
||||
use-chips
|
||||
multiple
|
||||
v-if="statusPayment"
|
||||
class="q-pl-sm"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" color="blue" />
|
||||
</template>
|
||||
</q-file>
|
||||
<q-btn
|
||||
size="md"
|
||||
icon="mdi-upload"
|
||||
round
|
||||
flat
|
||||
color="blue"
|
||||
v-if="statusPayment"
|
||||
@click="uploadFile"
|
||||
>
|
||||
<q-tooltip v-if="setSeat == false">อัปโหลดที่นั่งสอบ</q-tooltip>
|
||||
<q-tooltip v-if="setSeat == true">อัปโหลดคะแนนสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn icon="mdi-download" round color="primary" flat>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item clickable v-close-popup @click="downloadFile()">
|
||||
<q-item-section class="text-blue"
|
||||
>ดาวน์โหลดข้อมูลผู้สมัคร(แบบย่อ)</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadFileDetail()">
|
||||
<q-item-section class="text-primary"
|
||||
>ดาวน์โหลดข้อมูลผู้สมัคร</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
<div class="items-center" style="display: flex">
|
||||
<!-- ค้นหาข้อความใน table -->
|
||||
<q-input
|
||||
standout
|
||||
dense
|
||||
:model-value="inputfilter"
|
||||
ref="filterRef"
|
||||
@update:model-value="updateInput"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="q-ml-sm"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="inputfilter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="inputfilter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<!-- แสดงคอลัมน์ใน table -->
|
||||
<q-select
|
||||
:model-value="inputvisible"
|
||||
@update:model-value="updateVisible"
|
||||
:display-value="$q.lang.table.columns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
:options="attrs.columns"
|
||||
options-dense
|
||||
option-value="name"
|
||||
map-options
|
||||
emit-value
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<q-table
|
||||
ref="table"
|
||||
flat
|
||||
bordered
|
||||
class="custom-header-table"
|
||||
v-bind="attrs"
|
||||
virtual-scroll
|
||||
:virtual-scroll-sticky-size-start="48"
|
||||
dense
|
||||
:pagination-label="paginationLabel"
|
||||
:pagination="initialPagination"
|
||||
:rows-per-page-options="paging == true ? [25, 50, 100, 500] : []"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width v-if="boss == true" />
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th
|
||||
auto-width
|
||||
v-if="
|
||||
editvisible == true || nextPageVisible == true || history == true
|
||||
"
|
||||
/>
|
||||
</q-tr>
|
||||
</template>
|
||||
<!-- สำหรับเรียกใช้ template ตัวข้างนอก -->
|
||||
<template #body="props">
|
||||
<slot v-bind="props" name="columns"></slot>
|
||||
</template>
|
||||
</q-table>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, useAttrs } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const route = useRoute();
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const mixin = useCounterMixin();
|
||||
const { dateToISO, success, modalError, dialogMessage } = mixin;
|
||||
const $q = useQuasar(); // show dialog
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const table = ref<any>(null);
|
||||
const files = ref<File[]>([]);
|
||||
const filterRef = ref<any>(null);
|
||||
const examId = ref<string>(route.params.examId.toString());
|
||||
const { messageError } = mixin;
|
||||
const props = defineProps({
|
||||
inputfilter: String,
|
||||
inputvisible: Array,
|
||||
inputvisibleFilter: String,
|
||||
editvisible: Boolean,
|
||||
titleText: String,
|
||||
optionsFilter: {
|
||||
type: Array,
|
||||
defualt: [],
|
||||
},
|
||||
boss: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
saveNoDraft: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
history: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
paging: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
nornmalData: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
nextPageVisible: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
publicData: {
|
||||
type: Boolean,
|
||||
defualt: true,
|
||||
required: false,
|
||||
},
|
||||
updateData: {
|
||||
type: Boolean,
|
||||
defualt: true,
|
||||
required: false,
|
||||
},
|
||||
statusPayment: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
},
|
||||
setSeat: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
},
|
||||
publicNoBtn: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
save: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
cancel: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
publish: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
validate: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
fetchData: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
});
|
||||
const initialPagination = ref<any>({
|
||||
rowsPerPage: props.paging == true ? 25 : 0,
|
||||
});
|
||||
|
||||
const emit = defineEmits([
|
||||
"update:inputfilter",
|
||||
"update:inputvisible",
|
||||
"update:editvisible",
|
||||
"update:titleText",
|
||||
"update:inputvisibleFilter",
|
||||
]);
|
||||
|
||||
const updateInput = (value: any) => {
|
||||
emit("update:inputfilter", value);
|
||||
};
|
||||
const updateVisible = (value: any) => {
|
||||
emit("update:inputvisible", value);
|
||||
};
|
||||
const updateVisibleFilter = (value: any) => {
|
||||
emit("update:inputvisibleFilter", value);
|
||||
};
|
||||
|
||||
const paginationLabel = (start: string, end: string, total: string) => {
|
||||
if (props.paging == true)
|
||||
return " " + start + " ใน " + end + " จากจำนวน " + total + " ณายการ";
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
|
||||
const uploadFile = async () => {
|
||||
if (files.value.length > 0) {
|
||||
if (props.setSeat == false) {
|
||||
uploadDataSeat();
|
||||
} else {
|
||||
uploadDataPoint();
|
||||
}
|
||||
} else {
|
||||
modalError(
|
||||
$q,
|
||||
"ไม่สามารถอัปโหลดไฟล์ได้",
|
||||
"กรุณาเลือกไฟล์ที่ต้องการอัปโหลด"
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const uploadDataSeat = async () => {
|
||||
loaderPage(true);
|
||||
const formData = new FormData();
|
||||
formData.append("", files.value[0]);
|
||||
await http
|
||||
.put(config.API.periodExamUploadSeat(examId.value), formData)
|
||||
.then((res) => {
|
||||
success($q, "อัพเดทที่นั่งสอบสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
files.value = [];
|
||||
props.fetchData();
|
||||
});
|
||||
};
|
||||
|
||||
const uploadDataPoint = async () => {
|
||||
loaderPage(true);
|
||||
const formData = new FormData();
|
||||
formData.append("", files.value[0]);
|
||||
await http
|
||||
.put(config.API.periodExamUploadPoint(examId.value), formData)
|
||||
.then((res) => {
|
||||
success($q, "อัพเดทคะแนนสอบสำเร็จ");
|
||||
files.value = [];
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
files.value = [];
|
||||
props.fetchData();
|
||||
});
|
||||
};
|
||||
|
||||
const downloadFile = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.periodExamDownload(examId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
const data = res.data;
|
||||
downloadFilePDF(data, `Candidate__${dateToISO(new Date())}.xlsx`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadFileDetail = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.periodExamDownloadDetail(examId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
const data = res.data;
|
||||
downloadFilePDF(data, `Candidate_Detail_${dateToISO(new Date())}.xlsx`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadFilePDF = async (res: string, fileName: string) => {
|
||||
const link = document.createElement("a");
|
||||
link.href = window.URL.createObjectURL(
|
||||
new Blob([res], {
|
||||
type: "application/vnd.ms-excel",
|
||||
})
|
||||
);
|
||||
link.setAttribute("download", fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
};
|
||||
|
||||
const checkSave = () => {
|
||||
props.validate();
|
||||
props.save();
|
||||
};
|
||||
|
||||
const publishModal = () => {
|
||||
props.validate();
|
||||
const filter = attrs.value.rows.filter((r: any) => r.name == "");
|
||||
|
||||
if (filter.length == 0 || attrs.value.rows.length == 0) {
|
||||
dialogMessage(
|
||||
$q,
|
||||
"ต้องการเผยแพร่ข้อมูลนี้หรือไม่?",
|
||||
"ข้อมูลที่กำลังถูกเผยแพร่นี้จะมีผลใช้งานทันที",
|
||||
"public",
|
||||
"เผยแพร่",
|
||||
"public",
|
||||
props.publish,
|
||||
undefined
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const resetFilter = () => {
|
||||
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
|
||||
emit("update:inputfilter", "");
|
||||
filterRef.value.focus();
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.icon-color {
|
||||
color: #4154b3;
|
||||
}
|
||||
.custom-header-table {
|
||||
max-height: 64vh;
|
||||
.q-table tr:nth-child(odd) td {
|
||||
background: white;
|
||||
}
|
||||
.q-table tr:nth-child(even) td {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.q-table thead tr {
|
||||
background: #ecebeb;
|
||||
}
|
||||
|
||||
.q-table thead tr th {
|
||||
position: sticky;
|
||||
z-index: 1;
|
||||
}
|
||||
/* this will be the loading indicator */
|
||||
.q-table thead tr:last-child th {
|
||||
/* height of all previous header rows */
|
||||
top: 48px;
|
||||
}
|
||||
.q-table thead tr:first-child th {
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
106
src/modules/03_recruiting/components/top.vue
Normal file
106
src/modules/03_recruiting/components/top.vue
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
<template>
|
||||
<div class="flex items-center q-pb-md">
|
||||
<div class="flex items-center" v-if="header != ''">
|
||||
<q-icon :name="icon" size="1.5em" color="grey-5" class="q-mr-md" />
|
||||
<div class="text-weight-medium text-dark col-12 row items-center text-subtitle1">
|
||||
{{ header }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="editData == true">
|
||||
<div class="q-gutter-sm q-mx-sm" v-if="addData == true">
|
||||
<q-btn
|
||||
size="15px"
|
||||
flat
|
||||
dense
|
||||
v-if="edit && !editOnly"
|
||||
:color="!edit ? 'grey-7' : 'public'"
|
||||
@click="save"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="q-pl-sm" v-else>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
v-if="edit && !editOnly"
|
||||
:color="!edit ? 'grey-7' : 'add'"
|
||||
@click="add"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<q-space />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
const props = defineProps({
|
||||
header: {
|
||||
type: String,
|
||||
default: "",
|
||||
required: true,
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
default: "",
|
||||
required: true,
|
||||
},
|
||||
edit: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
required: true,
|
||||
},
|
||||
addData: {
|
||||
type: Boolean,
|
||||
defualt: true,
|
||||
required: true,
|
||||
},
|
||||
editData: {
|
||||
type: Boolean,
|
||||
defualt: true,
|
||||
required: true,
|
||||
},
|
||||
editOnly: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
required: true,
|
||||
},
|
||||
add: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
save: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
deleted: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
cancel: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
editBtn: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
changeBtn: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
});
|
||||
|
||||
const save = () => {
|
||||
props.save();
|
||||
};
|
||||
|
||||
const add = () => {
|
||||
props.add();
|
||||
};
|
||||
</script>
|
||||
<style scoped></style>
|
||||
349
src/modules/03_recruiting/interface/index/Main.ts
Normal file
349
src/modules/03_recruiting/interface/index/Main.ts
Normal file
|
|
@ -0,0 +1,349 @@
|
|||
import { ref } from "vue";
|
||||
interface Pagination {
|
||||
rowsPerPage: number;
|
||||
}
|
||||
|
||||
interface DataDateMonthObject {
|
||||
month: number;
|
||||
year: number;
|
||||
}
|
||||
|
||||
interface ChangeActive {
|
||||
name: string;
|
||||
id: number;
|
||||
}
|
||||
|
||||
//ข้อมูลส่วนตัว
|
||||
interface Information {
|
||||
cardid: string | null;
|
||||
prefix: string | null;
|
||||
prefixId: string | null;
|
||||
firstname: string | null;
|
||||
lastname: string | null;
|
||||
birthDate: Date | null;
|
||||
genderId: string | null;
|
||||
bloodId: string | null;
|
||||
nationality: string | null;
|
||||
ethnicity: string | null;
|
||||
religionId: string | null;
|
||||
tel: string | null;
|
||||
phone: string | null;
|
||||
email: string | null;
|
||||
province: string | null;
|
||||
provinceId: string | null;
|
||||
districtId: string | null;
|
||||
cardIdDate: Date | null;
|
||||
relationshipId: string | null;
|
||||
statusId: string | null;
|
||||
knowledge: string | null;
|
||||
profileImg: string | null;
|
||||
}
|
||||
|
||||
interface Family {
|
||||
prefixC: string | null; // couple
|
||||
prefixIdC: string | null;
|
||||
firstnameC: string | null;
|
||||
lastnameC: string | null;
|
||||
occupationC: string | null;
|
||||
nationalityC: string | null;
|
||||
prefixM: string | null; // male
|
||||
prefixIdM: string | null;
|
||||
firstnameM: string | null;
|
||||
lastnameM: string | null;
|
||||
occupationM: string | null;
|
||||
nationalityM: string | null;
|
||||
prefixF: string | null; // female
|
||||
prefixIdF: string | null;
|
||||
firstnameF: string | null;
|
||||
lastnameF: string | null;
|
||||
occupationF: string | null;
|
||||
nationalityF: string | null;
|
||||
same: string | null;
|
||||
}
|
||||
|
||||
interface Occupation {
|
||||
status: string | null;
|
||||
company: string | null;
|
||||
department: string | null;
|
||||
email: string | null;
|
||||
tel: string | null;
|
||||
official: string | null;
|
||||
personnel: string | null;
|
||||
officialsOther: string | null;
|
||||
employee: string | null;
|
||||
other: string | null;
|
||||
}
|
||||
|
||||
interface Address {
|
||||
address: string | null;
|
||||
provinceId: string | null;
|
||||
districtId: string | null;
|
||||
subdistrictId: string | null;
|
||||
code?: number | null;
|
||||
addressC: string | null;
|
||||
provinceIdC: string | null;
|
||||
districtIdC: string | null;
|
||||
subdistrictIdC: string | null;
|
||||
codeC?: number | null;
|
||||
same: string | null;
|
||||
}
|
||||
|
||||
interface DataOption {
|
||||
id: string;
|
||||
name: string;
|
||||
zipCode?: number | null;
|
||||
}
|
||||
|
||||
interface zipCodeOption {
|
||||
id: string;
|
||||
name: string;
|
||||
zipCode: string | null;
|
||||
}
|
||||
|
||||
interface UploadType {
|
||||
id: string;
|
||||
fileName: string;
|
||||
fileSize: number;
|
||||
fileType: string;
|
||||
detail: string;
|
||||
}
|
||||
|
||||
interface WebType {
|
||||
by: string;
|
||||
thai: string;
|
||||
eng: string;
|
||||
descripstion: string;
|
||||
}
|
||||
|
||||
interface AddressWeb {
|
||||
address: string | null;
|
||||
provinceId: string | null;
|
||||
districtId: string | null;
|
||||
subdistrictId: string | null;
|
||||
tel: string | null;
|
||||
code: string | null;
|
||||
}
|
||||
|
||||
interface EnableType {
|
||||
photo: boolean;
|
||||
web: boolean;
|
||||
about: boolean;
|
||||
}
|
||||
|
||||
interface CmsTable {
|
||||
id: string;
|
||||
name: string;
|
||||
link: string;
|
||||
createdAt: Date;
|
||||
lastUpdatedAt: Date;
|
||||
}
|
||||
|
||||
interface ExamCard {
|
||||
id: string;
|
||||
title: string;
|
||||
announcementDate: Date;
|
||||
registerRound: Number;
|
||||
registerDateStart: Date;
|
||||
registerDateEnd: Date;
|
||||
yearly: Date;
|
||||
}
|
||||
|
||||
const defaultCard: ExamCard[] = [
|
||||
{
|
||||
id: "1",
|
||||
title: "การสอบภาค ข. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว",
|
||||
registerRound: 2,
|
||||
announcementDate: new Date("2022-11-23"),
|
||||
registerDateStart: new Date("2022-11-09"),
|
||||
registerDateEnd: new Date("2022-11-10"),
|
||||
yearly: new Date("2022-01-01"),
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
title: "การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว",
|
||||
registerRound: 1,
|
||||
announcementDate: new Date("2022-10-14"),
|
||||
registerDateStart: new Date("2022-10-09"),
|
||||
registerDateEnd: new Date("2022-11-30"),
|
||||
yearly: new Date("2022-01-01"),
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
title: "การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว",
|
||||
registerRound: 1,
|
||||
announcementDate: new Date("2022-10-14"),
|
||||
registerDateStart: new Date("2022-10-09"),
|
||||
registerDateEnd: new Date("2022-11-30"),
|
||||
yearly: new Date("2022-01-01"),
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
title: "การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว",
|
||||
registerRound: 1,
|
||||
announcementDate: new Date("2022-10-14"),
|
||||
registerDateStart: new Date("2022-10-09"),
|
||||
registerDateEnd: new Date("2022-11-30"),
|
||||
yearly: new Date("2022-01-01"),
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
title: "การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว",
|
||||
registerRound: 1,
|
||||
announcementDate: new Date("2022-10-14"),
|
||||
registerDateStart: new Date("2022-10-09"),
|
||||
registerDateEnd: new Date("2022-11-30"),
|
||||
yearly: new Date("2022-01-01"),
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
title: "การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว",
|
||||
registerRound: 1,
|
||||
announcementDate: new Date("2022-10-14"),
|
||||
registerDateStart: new Date("2022-10-09"),
|
||||
registerDateEnd: new Date("2022-11-30"),
|
||||
yearly: new Date("2022-01-01"),
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
title: "การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว",
|
||||
registerRound: 1,
|
||||
announcementDate: new Date("2022-10-14"),
|
||||
registerDateStart: new Date("2022-10-09"),
|
||||
registerDateEnd: new Date("2022-11-30"),
|
||||
yearly: new Date("2022-01-01"),
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
title: "การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว",
|
||||
registerRound: 1,
|
||||
announcementDate: new Date("2022-10-14"),
|
||||
registerDateStart: new Date("2022-10-09"),
|
||||
registerDateEnd: new Date("2022-11-30"),
|
||||
yearly: new Date("2022-01-01"),
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
title: "การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว",
|
||||
registerRound: 1,
|
||||
announcementDate: new Date("2022-10-14"),
|
||||
registerDateStart: new Date("2022-10-09"),
|
||||
registerDateEnd: new Date("2022-11-30"),
|
||||
yearly: new Date("2022-01-01"),
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
title: "การสอบภาค ก. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว",
|
||||
registerRound: 1,
|
||||
announcementDate: new Date("2022-10-14"),
|
||||
registerDateStart: new Date("2022-10-09"),
|
||||
registerDateEnd: new Date("2022-11-30"),
|
||||
yearly: new Date("2022-01-01"),
|
||||
},
|
||||
];
|
||||
|
||||
const defaultAddress = ref<Address>({
|
||||
address: null,
|
||||
provinceId: null,
|
||||
districtId: null,
|
||||
subdistrictId: null,
|
||||
// code: ,
|
||||
addressC: null,
|
||||
provinceIdC: null,
|
||||
districtIdC: null,
|
||||
subdistrictIdC: null,
|
||||
// codeC: ,
|
||||
same: "1",
|
||||
});
|
||||
|
||||
const defaultInformation = ref<Information>({
|
||||
cardid: null,
|
||||
prefix: null,
|
||||
prefixId: null,
|
||||
firstname: null,
|
||||
lastname: null,
|
||||
birthDate: new Date(),
|
||||
genderId: null,
|
||||
bloodId: null,
|
||||
nationality: null,
|
||||
ethnicity: null,
|
||||
religionId: null,
|
||||
tel: null,
|
||||
phone: null,
|
||||
email: null,
|
||||
province: null,
|
||||
cardIdDate: new Date(),
|
||||
relationshipId: null,
|
||||
knowledge: null,
|
||||
districtId: null,
|
||||
provinceId: null,
|
||||
statusId: null,
|
||||
profileImg: null,
|
||||
});
|
||||
|
||||
const defaultFamily = ref<Family>({
|
||||
prefixC: null,
|
||||
prefixIdC: null,
|
||||
firstnameC: null,
|
||||
lastnameC: null,
|
||||
occupationC: null,
|
||||
nationalityC: null,
|
||||
prefixM: null,
|
||||
prefixIdM: null,
|
||||
firstnameM: null,
|
||||
lastnameM: null,
|
||||
occupationM: null,
|
||||
nationalityM: null,
|
||||
prefixF: null,
|
||||
prefixIdF: null,
|
||||
firstnameF: null,
|
||||
lastnameF: null,
|
||||
occupationF: null,
|
||||
nationalityF: null,
|
||||
same: "0",
|
||||
});
|
||||
|
||||
const defaultOccupation = ref<Occupation>({
|
||||
status: null,
|
||||
company: null,
|
||||
department: null,
|
||||
email: null,
|
||||
tel: null,
|
||||
official: null,
|
||||
personnel: null,
|
||||
officialsOther: null,
|
||||
employee: null,
|
||||
other: null,
|
||||
});
|
||||
|
||||
const changeData = (system: String, val: any) => {
|
||||
if (system == "information") defaultInformation.value = val;
|
||||
if (system == "address") defaultAddress.value = val;
|
||||
if (system == "famliy") defaultFamily.value = val;
|
||||
if (system == "occupation") defaultOccupation.value = val;
|
||||
};
|
||||
|
||||
export {
|
||||
defaultInformation,
|
||||
defaultFamily,
|
||||
defaultAddress,
|
||||
defaultOccupation,
|
||||
defaultCard,
|
||||
changeData,
|
||||
};
|
||||
export type {
|
||||
Pagination,
|
||||
DataOption,
|
||||
DataDateMonthObject,
|
||||
ChangeActive,
|
||||
Information,
|
||||
Family,
|
||||
Address,
|
||||
zipCodeOption,
|
||||
Occupation,
|
||||
ExamCard,
|
||||
UploadType,
|
||||
WebType,
|
||||
AddressWeb,
|
||||
EnableType,
|
||||
CmsTable,
|
||||
};
|
||||
29
src/modules/03_recruiting/interface/request/Career.ts
Normal file
29
src/modules/03_recruiting/interface/request/Career.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
interface DataProps {
|
||||
row: RequestItemsObject
|
||||
rowIndex: number
|
||||
}
|
||||
|
||||
//ข้อมูล
|
||||
interface RequestItemsObject {
|
||||
id: string
|
||||
location: string
|
||||
position: string
|
||||
salary: number | null
|
||||
duration: [Date, Date]
|
||||
reason: string
|
||||
}
|
||||
|
||||
//columns
|
||||
interface Columns {
|
||||
[index: number]: {
|
||||
name: String
|
||||
align: String
|
||||
label: String
|
||||
sortable: Boolean
|
||||
field: String
|
||||
headerStyle: String
|
||||
style: String
|
||||
}
|
||||
}
|
||||
|
||||
export type { RequestItemsObject, Columns, DataProps }
|
||||
6
src/modules/03_recruiting/interface/request/Editor.ts
Normal file
6
src/modules/03_recruiting/interface/request/Editor.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
interface DataLink {
|
||||
name: string | null;
|
||||
link: string | null;
|
||||
}
|
||||
|
||||
export type { DataLink };
|
||||
30
src/modules/03_recruiting/interface/request/Education.ts
Normal file
30
src/modules/03_recruiting/interface/request/Education.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
interface DataProps {
|
||||
row: RequestItemsObject;
|
||||
rowIndex: number;
|
||||
}
|
||||
|
||||
//ข้อมูล
|
||||
interface RequestItemsObject {
|
||||
id: string;
|
||||
educationLevelId: string;
|
||||
educationLevel: string;
|
||||
major: string;
|
||||
scores: number | null;
|
||||
name: string;
|
||||
duration: [Date, Date];
|
||||
}
|
||||
|
||||
//columns
|
||||
interface Columns {
|
||||
[index: number]: {
|
||||
name: String;
|
||||
align: String;
|
||||
label: String;
|
||||
sortable: Boolean;
|
||||
field: String;
|
||||
headerStyle: String;
|
||||
style: String;
|
||||
};
|
||||
}
|
||||
|
||||
export type { RequestItemsObject, Columns, DataProps };
|
||||
30
src/modules/03_recruiting/interface/request/Main.ts
Normal file
30
src/modules/03_recruiting/interface/request/Main.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//ข้อมูล
|
||||
interface RequestItemsObject {
|
||||
id: number;
|
||||
fullname: String;
|
||||
avatar: String;
|
||||
citizenId: String;
|
||||
position: String;
|
||||
line: String;
|
||||
linePosition: String;
|
||||
level: String;
|
||||
positionFormalManage: String;
|
||||
positionManage: String;
|
||||
numberPosition: String;
|
||||
government: String;
|
||||
}
|
||||
|
||||
//columns
|
||||
interface Columns {
|
||||
[index: number]: {
|
||||
name: String;
|
||||
align: String;
|
||||
label: String;
|
||||
sortable: Boolean;
|
||||
field: String;
|
||||
headerStyle: String;
|
||||
style: String;
|
||||
};
|
||||
}
|
||||
|
||||
export type { RequestItemsObject, Columns };
|
||||
89
src/modules/03_recruiting/interface/request/Period.ts
Normal file
89
src/modules/03_recruiting/interface/request/Period.ts
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
//ข้อมูล
|
||||
interface RequestPeriodExam {
|
||||
announcementDate: string;
|
||||
announcementEndDate: string;
|
||||
announcementStartDate: string;
|
||||
examDate: string;
|
||||
announcementExam: boolean;
|
||||
bankExam: RequestPayment[];
|
||||
checkDisability: boolean;
|
||||
checkDocument: boolean;
|
||||
detail: string;
|
||||
fee: number;
|
||||
id: string;
|
||||
isActive: boolean;
|
||||
name: string;
|
||||
note: string;
|
||||
organizationCodeId: string;
|
||||
organizationCodeName: string;
|
||||
organizationId: string;
|
||||
organizationName: string;
|
||||
paymentEndDate: string;
|
||||
paymentKrungThai: string;
|
||||
paymentStartDate: string;
|
||||
positionExam: RequestPosition[];
|
||||
registerEndDate: string;
|
||||
registerStartDate: string;
|
||||
round: number;
|
||||
year: number;
|
||||
category: string;
|
||||
}
|
||||
|
||||
interface RequestPeriodCompete {
|
||||
announcementEndDate: string;
|
||||
announcementStartDate: string;
|
||||
examDate: string;
|
||||
detail: string;
|
||||
fee: number;
|
||||
id: string;
|
||||
name: string;
|
||||
note: string;
|
||||
paymentEndDate: string;
|
||||
paymentStartDate: string;
|
||||
registerEndDate: string;
|
||||
registerStartDate: string;
|
||||
order: number;
|
||||
year: number;
|
||||
announcementDate: string;
|
||||
}
|
||||
|
||||
interface RequestPeriodDisable {
|
||||
announcementEndDate: string;
|
||||
announcementStartDate: string;
|
||||
examDate: string;
|
||||
detail: string;
|
||||
fee: number;
|
||||
id: string;
|
||||
name: string;
|
||||
note: string;
|
||||
paymentEndDate: string;
|
||||
paymentStartDate: string;
|
||||
registerEndDate: string;
|
||||
registerStartDate: string;
|
||||
round: number;
|
||||
year: number;
|
||||
announcementDate: string;
|
||||
}
|
||||
|
||||
interface RequestPosition {
|
||||
id: string;
|
||||
positionId: string;
|
||||
positionName: string;
|
||||
typeId: string;
|
||||
typeName: string;
|
||||
}
|
||||
|
||||
interface RequestPayment {
|
||||
id: string;
|
||||
accountNumber: string;
|
||||
bankName: string;
|
||||
accountName: string;
|
||||
}
|
||||
|
||||
export type {
|
||||
RequestPeriodExam,
|
||||
RequestPosition,
|
||||
RequestPayment,
|
||||
RequestPeriodCompete,
|
||||
RequestPeriodDisable,
|
||||
};
|
||||
12
src/modules/03_recruiting/interface/response/Career.ts
Normal file
12
src/modules/03_recruiting/interface/response/Career.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
//ข้อมูล
|
||||
interface ResponseObject {
|
||||
id: string;
|
||||
name: string;
|
||||
position: string;
|
||||
salary: number | null;
|
||||
durationStart: Date;
|
||||
durationEnd: Date;
|
||||
reason: string;
|
||||
}
|
||||
|
||||
export type { ResponseObject };
|
||||
13
src/modules/03_recruiting/interface/response/Education.ts
Normal file
13
src/modules/03_recruiting/interface/response/Education.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
//ข้อมูล
|
||||
interface ResponseObject {
|
||||
id: string;
|
||||
educationLevelId: string;
|
||||
educationLevelName: string;
|
||||
major: string;
|
||||
scores: number | null;
|
||||
name: string;
|
||||
durationStart: Date;
|
||||
durationEnd: Date;
|
||||
}
|
||||
|
||||
export type { ResponseObject };
|
||||
17
src/modules/03_recruiting/interface/response/Main.ts
Normal file
17
src/modules/03_recruiting/interface/response/Main.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
//ข้อมูล
|
||||
interface ResponseObject {
|
||||
id: number;
|
||||
fullname: String;
|
||||
avatar: String;
|
||||
citizenId: String;
|
||||
position: String;
|
||||
line: String;
|
||||
linePosition: String;
|
||||
level: String;
|
||||
positionFormalManage: String;
|
||||
positionManage: String;
|
||||
numberPosition: String;
|
||||
government: String;
|
||||
}
|
||||
|
||||
export type { ResponseObject };
|
||||
113
src/modules/03_recruiting/interface/response/Period.ts
Normal file
113
src/modules/03_recruiting/interface/response/Period.ts
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
//ข้อมูล
|
||||
interface ResponseHistoryObject {
|
||||
createdAt?: Date;
|
||||
createdFullName: String;
|
||||
createdUserId: String;
|
||||
id: String;
|
||||
isActive: Boolean;
|
||||
lastUpdateFullName: String;
|
||||
lastUpdateUserId: String;
|
||||
lastUpdatedAt?: Date;
|
||||
description: String;
|
||||
}
|
||||
|
||||
interface ResponsePeriodExam {
|
||||
id: string;
|
||||
category: string;
|
||||
announcementExam: boolean;
|
||||
name: string;
|
||||
checkDocument: boolean;
|
||||
checkDisability: boolean;
|
||||
round: number;
|
||||
yearly: number;
|
||||
fee: number;
|
||||
dateAnnounce: Date;
|
||||
dateAnnouncement: [Date, Date];
|
||||
dateExam: Date;
|
||||
dateRegister: [Date, Date];
|
||||
datePayment: [Date, Date];
|
||||
organizationName: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
organizationShortName: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
positionExam: ResponsePosition[];
|
||||
pay: string;
|
||||
bankExam: ResponsePayment[];
|
||||
editor: string;
|
||||
note: string;
|
||||
}
|
||||
interface ResponsePosition {
|
||||
id: string;
|
||||
position: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
type: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
}
|
||||
interface ResponsePayment {
|
||||
id: string;
|
||||
accountNumber: string;
|
||||
bankName: string;
|
||||
accountName: string;
|
||||
}
|
||||
|
||||
interface ResponseRecruitPeriod {
|
||||
id: string;
|
||||
name: string;
|
||||
year: number;
|
||||
order: number;
|
||||
importDate: string;
|
||||
examCount: number;
|
||||
scoreImportDate: string;
|
||||
scoreCount: number;
|
||||
score: {
|
||||
ID: string;
|
||||
importYear: number;
|
||||
importDate: string;
|
||||
scoreCount: number;
|
||||
};
|
||||
}
|
||||
|
||||
interface RecruitDetailResponseHeader {
|
||||
count: number;
|
||||
pass: number;
|
||||
notpass: number;
|
||||
}
|
||||
|
||||
interface RecruitDetailResponse {
|
||||
examID: string;
|
||||
profileID: string;
|
||||
prefix: string;
|
||||
fullName: string;
|
||||
dateOfBirth: string;
|
||||
gender: string;
|
||||
major: string;
|
||||
degree: string;
|
||||
applyDate: string;
|
||||
certificateIssueDate: string;
|
||||
certificateNo: string;
|
||||
examAttribute: string;
|
||||
examScore: string;
|
||||
examResult: string;
|
||||
personName: string;
|
||||
exam_name: string;
|
||||
exam_order: string;
|
||||
score_year: string;
|
||||
}
|
||||
|
||||
export type {
|
||||
ResponsePeriodExam,
|
||||
ResponsePosition,
|
||||
ResponsePayment,
|
||||
ResponseRecruitPeriod,
|
||||
RecruitDetailResponseHeader,
|
||||
RecruitDetailResponse,
|
||||
ResponseHistoryObject,
|
||||
};
|
||||
265
src/modules/03_recruiting/router.ts
Normal file
265
src/modules/03_recruiting/router.ts
Normal file
|
|
@ -0,0 +1,265 @@
|
|||
/**
|
||||
* Router ระบบการสรรหา (Recruiting)
|
||||
*/
|
||||
|
||||
const ImportData = () =>
|
||||
import("@/modules/03_recruiting/views/01_compete/ImportData.vue");
|
||||
const MainDetail = () =>
|
||||
import("@/modules/03_recruiting/views/01_compete/Detail.vue");
|
||||
const MainEx = () =>
|
||||
import("@/modules/03_recruiting/views/01_compete/DetailEx.vue");
|
||||
const Period = () =>
|
||||
import("@/modules/03_recruiting/views/01_compete/Period.vue");
|
||||
const PeriodStat = () =>
|
||||
import("@/modules/03_recruiting/views/01_compete/PeriodStat.vue");
|
||||
const PeriodAdd = () =>
|
||||
import("@/modules/03_recruiting/views/01_compete/PeriodAdd.vue");
|
||||
const QualifyPeriod = () =>
|
||||
import("@/modules/03_recruiting/views/02_qualify/Period.vue");
|
||||
const QualifyPeriodAdd = () =>
|
||||
import("@/modules/03_recruiting/views/02_qualify/PeriodAdd.vue");
|
||||
const QualifyPeriodStat = () =>
|
||||
import("@/modules/03_recruiting/views/02_qualify/PeriodStat.vue");
|
||||
const QualifyPeriodStatDisable = () =>
|
||||
import("@/modules/03_recruiting/views/02_qualify/PeriodStatDisable.vue");
|
||||
const MainDisableDetail = () =>
|
||||
import("@/modules/03_recruiting/views/02_qualify/DisableDetail.vue");
|
||||
const MainDisableEx = () =>
|
||||
import("@/modules/03_recruiting/views/02_qualify/DisableDetailEx.vue");
|
||||
const PeriodDisable = () =>
|
||||
import("@/modules/03_recruiting/views/02_qualify/DisablePeriod.vue");
|
||||
const PeriodDisableAdd = () =>
|
||||
import("@/modules/03_recruiting/views/02_qualify/DisablePeriodAdd.vue");
|
||||
const Manage = () =>
|
||||
import("@/modules/03_recruiting/views/02_qualify/Manage.vue");
|
||||
const ManageDetail = () =>
|
||||
import("@/modules/03_recruiting/views/02_qualify/manageDetail.vue");
|
||||
const ExamForm = () =>
|
||||
import("@/modules/03_recruiting/views/02_qualify/ExamForm.vue");
|
||||
const Payment = () =>
|
||||
import("@/modules/03_recruiting/views/02_qualify/Payment.vue");
|
||||
const EditorWeb = () =>
|
||||
import("@/modules/03_recruiting/views/03_editor/index.vue");
|
||||
|
||||
export default [
|
||||
{
|
||||
path: "/compete/period",
|
||||
name: "competePeriod",
|
||||
component: Period,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [8],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/compete/period/stat",
|
||||
name: "competePeriodStat",
|
||||
component: PeriodStat,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [8],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/compete/period/add",
|
||||
name: "competePeriodAdd",
|
||||
component: PeriodAdd,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [8],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/compete/period/:id",
|
||||
name: "competePeriodEdit",
|
||||
component: PeriodAdd,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [8],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/compete/import",
|
||||
name: "recruiting",
|
||||
component: ImportData,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [7],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/compete/import/:id",
|
||||
name: "recruitingDetail",
|
||||
component: MainDetail,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [7],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/compete/import/:id/:examId",
|
||||
name: "recruitingDetailEx",
|
||||
component: MainEx,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [7],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/qualify/period",
|
||||
name: "qualifyPeriod",
|
||||
component: QualifyPeriod,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [10],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/qualify/period/:id",
|
||||
name: "qualifyPeriodEdit",
|
||||
component: QualifyPeriodAdd,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [7],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/qualify/period/add",
|
||||
name: "qualifyPeriodAdd",
|
||||
component: QualifyPeriodAdd,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [10],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/qualify/period/stat",
|
||||
name: "qualifyPeriodStat",
|
||||
component: QualifyPeriodStat,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [8],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/qualify/disable/stat",
|
||||
name: "qualifyPeriodStatDisable",
|
||||
component: QualifyPeriodStatDisable,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [8],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/qualify/manage",
|
||||
name: "manage",
|
||||
component: Manage,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [9],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/qualify/manage/:examId",
|
||||
name: "manageDetaill",
|
||||
component: ManageDetail,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [9],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/qualify/manage/:examId/profile/:candidateId",
|
||||
name: "ExamForm",
|
||||
component: ExamForm,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [9],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/qualify/manage/:examId/payment/:candidateId",
|
||||
name: "Payment",
|
||||
component: Payment,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [9],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/disable/period",
|
||||
name: "disablePeriod",
|
||||
component: PeriodDisable,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [8],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/disable/period/add",
|
||||
name: "disablePeriodAdd",
|
||||
component: PeriodDisableAdd,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [8],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/disable/period/:id",
|
||||
name: "disablePeriodEdit",
|
||||
component: PeriodDisableAdd,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [8],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/disable/import/:id",
|
||||
name: "disableDetail",
|
||||
component: MainDisableDetail,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [7],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/disable/import/:id/:examId",
|
||||
name: "disableDetailEx",
|
||||
component: MainDisableEx,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [7],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/editor",
|
||||
name: "editorweb",
|
||||
component: EditorWeb,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11],
|
||||
Role: "recruit",
|
||||
},
|
||||
},
|
||||
];
|
||||
42
src/modules/03_recruiting/store.ts
Normal file
42
src/modules/03_recruiting/store.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { ref, computed } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useExamDataStore = defineStore('exam', () => {
|
||||
interface exam {
|
||||
main: { columns: String[] }
|
||||
education: { columns: String[] }
|
||||
career: { columns: String[] }
|
||||
}
|
||||
|
||||
const examData = ref<exam>({
|
||||
main: { columns: [] },
|
||||
education: { columns: [] },
|
||||
career: { columns: [] }
|
||||
})
|
||||
|
||||
const consend = ref<boolean>(false)
|
||||
const status = ref<string>('')
|
||||
|
||||
const changeExamColumns = (system: String, val: String[]) => {
|
||||
if (system == 'main') examData.value.main.columns = val
|
||||
if (system == 'education') examData.value.education.columns = val
|
||||
if (system == 'career') examData.value.career.columns = val
|
||||
localStorage.setItem('exam', JSON.stringify(examData.value))
|
||||
}
|
||||
|
||||
if (localStorage.getItem('exam') !== null) {
|
||||
examData.value = JSON.parse(localStorage.getItem('exam') || '{}')
|
||||
}
|
||||
|
||||
const changeStatus = (val: string) => {
|
||||
status.value = val
|
||||
}
|
||||
|
||||
return {
|
||||
examData,
|
||||
changeExamColumns,
|
||||
consend,
|
||||
status,
|
||||
changeStatus
|
||||
}
|
||||
})
|
||||
421
src/modules/03_recruiting/views/01_compete/Detail.vue
Normal file
421
src/modules/03_recruiting/views/01_compete/Detail.vue
Normal file
|
|
@ -0,0 +1,421 @@
|
|||
<!-- page:detail page สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
รายชื่อผู้สมัครสอบรอบ {{ name }} ครั้งที่ {{ round }}/{{ year }}
|
||||
<q-space />
|
||||
<q-btn class="bg-teal-1" icon="mdi-download" round color="primary" flat>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item clickable v-close-popup @click="downloadExam()">
|
||||
<q-item-section class="text-blue">ส่งออกข้อมูลผู้มีสิทธิ์สอบ</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadPassExam()">
|
||||
<q-item-section class="text-primary"
|
||||
>ส่งออกข้อมูลผู้สอบผ่านภาค ก.</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadPassResultExam()">
|
||||
<q-item-section class="text-amber-9"
|
||||
>ส่งออกข้อมูลผู้สอบแข่งขันได้</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 row q-mt-sm q-pt-sm q-pa-md">
|
||||
<div class="col-12">
|
||||
<Table
|
||||
:count="count"
|
||||
:pass="pass"
|
||||
:notpass="notpass"
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:nornmalData="false"
|
||||
:conclude="true"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="clickDetail(props.row.examID)"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
<div class="row col-12 items-center">
|
||||
<img
|
||||
:src="props.row.avatar"
|
||||
class="q-mr-sm col-4"
|
||||
style="width: 28px; height: 28px; border-radius: 50%"
|
||||
/>
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.fullname }}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.citizenId }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c1'">
|
||||
<q-checkbox disable v-model="props.row.c1" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c2'">
|
||||
<q-checkbox disable v-model="props.row.c2" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c3'">
|
||||
<q-checkbox disable v-model="props.row.c3" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c4'">
|
||||
<q-checkbox disable v-model="props.row.c4" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c5'">
|
||||
<q-checkbox disable v-model="props.row.c5" />
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import type { RecruitDetailResponse } from "@/modules/03_recruiting/interface/response/Period";
|
||||
import Table from "@/modules/03_recruiting/components/Table.vue";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
const dataStore = useDataStore();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { loaderPage } = dataStore;
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError } = mixin;
|
||||
const year = ref<string>("");
|
||||
const round = ref<string>("");
|
||||
const name = ref<string>("");
|
||||
const count = ref<number>(0);
|
||||
const pass = ref<number>(0);
|
||||
const notpass = ref<number>(0);
|
||||
const rows = ref<any>([]);
|
||||
const importId = ref<string>(route.params.id as string); // Period Import Id
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([
|
||||
"examID",
|
||||
"profileID",
|
||||
"fullName",
|
||||
"dateOfBirth",
|
||||
"gender",
|
||||
"position_name",
|
||||
"university",
|
||||
"degree",
|
||||
"major",
|
||||
"certificateIssueDate",
|
||||
"certificateNo",
|
||||
"examAttribute",
|
||||
"examScore",
|
||||
"examResult",
|
||||
"applyDate",
|
||||
]);
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "examID",
|
||||
align: "left",
|
||||
label: "เลขประจำตัวสอบ",
|
||||
sortable: true,
|
||||
field: "examID",
|
||||
headerStyle: "font-size: 14px; min-width: 20px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "profileID",
|
||||
align: "left",
|
||||
label: "เลขประจำตัวประชาชน",
|
||||
sortable: true,
|
||||
field: "profileID",
|
||||
headerStyle: "font-size: 14px; min-width: 20px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "fullName",
|
||||
align: "left",
|
||||
label: "ชื่อ-สกุล",
|
||||
sortable: true,
|
||||
field: "personName",
|
||||
headerStyle: "font-size: 14px; min-width: 250px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "dateOfBirth",
|
||||
align: "left",
|
||||
label: "วัน เดือน ปีเกิด",
|
||||
sortable: true,
|
||||
field: "dateOfBirth",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "gender",
|
||||
align: "left",
|
||||
label: "เพศ",
|
||||
sortable: true,
|
||||
field: "gender",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "position_name",
|
||||
align: "left",
|
||||
label: "ตำแหน่งที่สมัคร",
|
||||
sortable: true,
|
||||
field: "position_name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "university",
|
||||
align: "left",
|
||||
label: "สถานศึกษา",
|
||||
sortable: true,
|
||||
field: "university",
|
||||
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: "major",
|
||||
align: "left",
|
||||
label: "สาขาวิชาเอก",
|
||||
sortable: true,
|
||||
field: "major",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "certificateNo",
|
||||
align: "left",
|
||||
label: "เลขที่ใบประกอบวิชาชีพ",
|
||||
sortable: true,
|
||||
field: "certificateNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "certificateIssueDate",
|
||||
align: "left",
|
||||
label: "วันที่ได้รับใบประกอบวิชาชีพฯ",
|
||||
sortable: true,
|
||||
field: "certificateIssueDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "examAttribute",
|
||||
align: "left",
|
||||
label: "สถานะการคัดกรองคุณสมบัติ",
|
||||
sortable: true,
|
||||
field: "examAttribute",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "examScore",
|
||||
align: "right",
|
||||
label: "คะแนนรวม",
|
||||
sortable: true,
|
||||
field: "examScore",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "examResult",
|
||||
align: "left",
|
||||
label: "ผลการสอบ",
|
||||
sortable: true,
|
||||
field: "examResult",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "applyDate",
|
||||
align: "left",
|
||||
label: "วันที่สมัครสอบ",
|
||||
sortable: true,
|
||||
field: "applyDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const clickDetail = (examID: string) => {
|
||||
router.push(`/compete/import/${importId.value}/${examID}`);
|
||||
};
|
||||
|
||||
const downloadExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.exportExam(importId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `รายชื่อผู้มีสิทธิ์สอบ.xlsx`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadPassExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.exportPassExam(importId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `รายชื่อสอบผ่านภาค_ก.xlsx`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadPassResultExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.exportPassResultExam(importId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `รายชื่อสอบแข่งขันได้.xlsx`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.getExamResultById(importId.value), {
|
||||
examAttribute: "",
|
||||
examResult: "",
|
||||
})
|
||||
.then((res) => {
|
||||
var header = res.data.result.header;
|
||||
count.value = header.count;
|
||||
pass.value = header.pass;
|
||||
notpass.value = header.notpass;
|
||||
const data = res.data.result.data;
|
||||
let result: RecruitDetailResponse[] = [];
|
||||
if (data.length > 0) {
|
||||
data.map((r: RecruitDetailResponse) => {
|
||||
r.personName = `${r.prefix}${r.fullName}`;
|
||||
result.push(r);
|
||||
});
|
||||
}
|
||||
rows.value = result;
|
||||
name.value = result[0].exam_name as string;
|
||||
round.value = result[0].exam_order as string;
|
||||
year.value = result[0].score_year as string;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
340
src/modules/03_recruiting/views/01_compete/DetailEx.vue
Normal file
340
src/modules/03_recruiting/views/01_compete/DetailEx.vue
Normal file
|
|
@ -0,0 +1,340 @@
|
|||
<!-- page:detail page สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
รายละเอียดของผู้สมัครสอบ {{ examID }} : {{ prefix }}{{ fullname }}
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 row q-mt-sm q-pa-md">
|
||||
<div class="row q-col-gutter-md col-12">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6">
|
||||
<q-card bordered flat class="col-12 q-pa-md">
|
||||
<div class="col-12 q-col-gutter-sm row items-center">
|
||||
<div class="col-12 text-weight-bold">ข้อมูลทั่วไป</div>
|
||||
<div class="col-6 text-grey-7" v-if="profile_id !== null">
|
||||
เลขประจำตัวประชาชน
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="profile_id !== null">
|
||||
{{ profile_id }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="prefix !== null">คำนำหน้านาม</div>
|
||||
<div class="col-6 text-black" v-if="prefix !== null">
|
||||
{{ prefix }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="fullname !== null">ชื่อ-นามสกุล</div>
|
||||
<div class="col-6 text-black" v-if="fullname !== null">
|
||||
{{ fullname }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="birthdate !== null">
|
||||
วัน/เดือน/ปี เกิด
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="birthdate !== null">
|
||||
{{ birthdate }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="gender !== null">เพศ</div>
|
||||
<div class="col-6 text-black" v-if="gender !== null">
|
||||
{{ gender }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="position_name !== null">
|
||||
ตำแหน่งที่สมัคร
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="position_name !== null">
|
||||
{{ position_name }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="university !== null">สถานศึกษา</div>
|
||||
<div class="col-6 text-black" v-if="university !== null">
|
||||
{{ university }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="degree !== null">วุฒิการศึกษา</div>
|
||||
<div class="col-6 text-black" v-if="degree !== null">
|
||||
{{ degree }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="major !== null">สาขาวิชาเอก</div>
|
||||
<div class="col-6 text-black" v-if="major !== null">
|
||||
{{ major }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="major !== null">
|
||||
จำนวนครั้งที่สมัครสอบ
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="major !== null">
|
||||
{{ examCount }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="cert_issuedate !== null">
|
||||
ใบอนุญาตประกอบวิชาชีพ วัน เดือน ปีที่ได้รับ
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="cert_issuedate !== null">
|
||||
{{ cert_issuedate }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="examAttribute !== null">
|
||||
สถานะการคัดกรองคุณสมบัติ
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="examAttribute !== null">
|
||||
{{ examAttribute }}
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6">
|
||||
<q-card
|
||||
bordered
|
||||
flat
|
||||
class="col-xs-12 col-sm-12 col-md-6 q-px-md q-py-sm full-height"
|
||||
>
|
||||
<div class="col-12 row q-col-gutter-sm">
|
||||
<div class="col-12 text-weight-bold row items-center">
|
||||
ผลการสอบ
|
||||
<q-space />
|
||||
<q-btn
|
||||
color="primary"
|
||||
flat
|
||||
round
|
||||
icon="mdi-download"
|
||||
v-if="examResultinscore === 'ผ่าน'"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item clickable v-close-popup @click="downloadScore()">
|
||||
<q-item-section class="text-primary"
|
||||
>ดาวน์โหลดผลคะแนน</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadCertificate()">
|
||||
<q-item-section class="text-blue"
|
||||
>ดาวน์โหลดเอกสารรับรอง</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-else
|
||||
color="blue"
|
||||
flat
|
||||
round
|
||||
icon="mdi-download"
|
||||
@click="downloadScore()"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดผลคะแนน</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="row items-center q-gutter-y-sm col-12">
|
||||
<div class="col-xs-4 col-sm-5 text-weight-medium text-grey-7">ประเภท</div>
|
||||
<div class="col-xs-3 col-sm-2 text-primary text-weight-bold">คะแนนเต็ม</div>
|
||||
<div class="col-xs-3 col-sm-2 text-primary text-weight-bold">
|
||||
คะแนนที่ได้
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 text-primary text-weight-bold"></div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">ภาค ก</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreAFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreA }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">ภาค ข</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreBFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreB }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">ภาค ค</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreCFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreC }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">รวมทั้งหมด</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreSumFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreSum }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-weight-bold q-pt-sm">ผลการสอบ</div>
|
||||
<div class="col-xs-8 col-sm-6 q-pr-xs text-weight-bold text-subtitle1">
|
||||
<span
|
||||
:class="examResultinscore != 'ผ่าน' ? 'text-red' : 'text-positive'"
|
||||
>{{ examResultinscore }}</span
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-5 text-grey-7">ลำดับที่สอบได้</div>
|
||||
<div class="col-xs-6 col-sm-7 q-pr-xs">
|
||||
{{ number }}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-5 text-grey-7">วันหมดอายุบัญชีสอบแข่งขัน</div>
|
||||
<div class="col-xs-6 col-sm-7 q-pr-xs">
|
||||
{{ score_expired }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
const dataStore = useDataStore();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { loaderPage } = dataStore;
|
||||
const profile_id = ref<string>("");
|
||||
const birthdate = ref<string>("");
|
||||
const gender = ref<string>("");
|
||||
const university = ref<string>("");
|
||||
const position_name = ref<string>("");
|
||||
const degree = ref<string>("");
|
||||
const major = ref<string>("");
|
||||
const cert_issuedate = ref<string>("");
|
||||
const examAttribute = ref<string>("");
|
||||
const examResultinscore = ref<string>("");
|
||||
const scoreAFull = ref<string>("");
|
||||
const scoreA = ref<string>("");
|
||||
const scoreBFull = ref<string>("");
|
||||
const scoreB = ref<string>("");
|
||||
const scoreCFull = ref<string>("");
|
||||
const scoreC = ref<string>("");
|
||||
const scoreSumFull = ref<string>("");
|
||||
const scoreSum = ref<string>("");
|
||||
const examCount = ref<string>("");
|
||||
const number = ref<string>("");
|
||||
const score_expired = ref<string>("");
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError } = mixin;
|
||||
const examID = ref<string>("62150001");
|
||||
const prefix = ref<string>("นาย");
|
||||
const fullname = ref<string>("เกียรติศักดิ์ บัณฑิต");
|
||||
const importId = ref<string>(route.params.id as string); // Period Import Id
|
||||
const examId = ref<string>(route.params.examId as string); // เลขประจำตัวสอบ
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getExamDetail(importId.value, examId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
|
||||
profile_id.value = data.profileID;
|
||||
examID.value = data.examID;
|
||||
prefix.value = data.prefix;
|
||||
fullname.value = data.fullName;
|
||||
birthdate.value = data.dateOfBirth;
|
||||
gender.value = data.gender;
|
||||
degree.value = data.degree;
|
||||
major.value = data.major;
|
||||
university.value = data.university;
|
||||
position_name.value = data.positionName;
|
||||
cert_issuedate.value = data.certificateIssueDate;
|
||||
examAttribute.value = data.examAttribute;
|
||||
number.value = data.number;
|
||||
examCount.value = data.examCount;
|
||||
score_expired.value = data.scoreExpire;
|
||||
if (data.scoreResult != null) {
|
||||
scoreAFull.value = data.scoreResult.scoreAFull;
|
||||
scoreA.value = data.scoreResult.scoreA;
|
||||
scoreBFull.value = data.scoreResult.scoreBFull;
|
||||
scoreB.value = data.scoreResult.scoreB;
|
||||
scoreCFull.value = data.scoreResult.scoreCFull;
|
||||
scoreC.value = data.scoreResult.scoreC;
|
||||
scoreSumFull.value = data.scoreResult.scoreSumFull;
|
||||
scoreSum.value = data.scoreResult.scoreSum;
|
||||
examResultinscore.value = data.scoreResult.examResult;
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadScore = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.downloadScoreReport(importId.value, examId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `ผลคะแนน_${examId.value}.pdf`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadCertificate = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.downloadExamReport(importId.value, examId.value, 2), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `เอกสารรับรอง_${examId.value}.pdf`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
213
src/modules/03_recruiting/views/01_compete/ImportData.vue
Normal file
213
src/modules/03_recruiting/views/01_compete/ImportData.vue
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
<!-- page:main page สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายการนำเข้าข้อมูลผู้สมัครสอบแข่งขัน
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
|
||||
<div>
|
||||
<Table
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:nornmalData="false"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'" @click="clickEdit(props.row.year)">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div
|
||||
v-else-if="col.name == 'name'"
|
||||
class="table_ellipsis2"
|
||||
@click="clickEdit(props.row.year)"
|
||||
>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'file'">
|
||||
<q-btn
|
||||
size="13px"
|
||||
flat
|
||||
class="bg-blue-1 q-ml-xs"
|
||||
color="blue"
|
||||
v-if="col.value == null || file == false"
|
||||
>
|
||||
<q-icon
|
||||
name="mdi-file-excel-outline"
|
||||
size="20px"
|
||||
class="q-mr-sm"
|
||||
/>
|
||||
นำเข้าไฟล์
|
||||
<q-tooltip>นำเข้าไฟล์ excel</q-tooltip>
|
||||
</q-btn>
|
||||
<div v-else>
|
||||
<q-chip
|
||||
removable
|
||||
color="grey-2"
|
||||
text-color="grey-9"
|
||||
:label="col.value"
|
||||
size="14px"
|
||||
square
|
||||
icon-remove="mdi-close"
|
||||
v-model="file"
|
||||
@remove="remove"
|
||||
>
|
||||
<q-tooltip>{{ col.value }}</q-tooltip>
|
||||
</q-chip>
|
||||
<q-btn
|
||||
size="14px"
|
||||
flat
|
||||
dense
|
||||
color="positive"
|
||||
icon="mdi-content-save-settings-outline"
|
||||
>
|
||||
<q-tooltip>บันทึกคะแนนสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else @click="clickEdit(props.row.year)">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import Table from "@/modules/03_recruiting/components/Table.vue";
|
||||
|
||||
const $q = useQuasar(); // show dialog
|
||||
const router = useRouter();
|
||||
const file = ref<boolean>(true);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"year",
|
||||
"name",
|
||||
"startDate",
|
||||
"endDate",
|
||||
"file",
|
||||
]);
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "year",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "year",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อระยะเวลาการสอบแข่งขัน",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "doc",
|
||||
align: "left",
|
||||
label: "เอกสารประกอบ",
|
||||
sortable: true,
|
||||
field: "doc",
|
||||
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: "file",
|
||||
align: "left",
|
||||
label: "เอกสารข้อมูลผู้สอบ",
|
||||
sortable: true,
|
||||
field: "file",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
const rows = ref<any>([]);
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const fetchData = () => {};
|
||||
|
||||
const clickEdit = (id: string) => {
|
||||
router.push(`/compete/import/${id}`);
|
||||
};
|
||||
|
||||
const remove = () => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการลบเอกสารข้อมูล",
|
||||
message: "ต้องการลบเอกสารนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(() => {
|
||||
file.value = false;
|
||||
})
|
||||
.onCancel(() => {
|
||||
file.value = true;
|
||||
})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
767
src/modules/03_recruiting/views/01_compete/Period.vue
Normal file
767
src/modules/03_recruiting/views/01_compete/Period.vue
Normal file
|
|
@ -0,0 +1,767 @@
|
|||
<!-- page:จัดการรอบการสอบ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
จัดการข้อมูลผู้สมัครสอบแข่งขัน
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
|
||||
<div>
|
||||
<Table
|
||||
style="max-height: 80vh"
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:pagination="initialPagination"
|
||||
:nornmalData="true"
|
||||
:add="clickAdd"
|
||||
:paging="true"
|
||||
:titleText="''"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="clickDetail(props.row.id)"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'name'" class="table_ellipsis2">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'year'" class="table_ellipsis2">
|
||||
{{ col.value + 543 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'scoreCount'" class="table_ellipsis2">
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
size="12px"
|
||||
round
|
||||
color="green"
|
||||
@click.stop.prevent="clickEdit(props.row.id)"
|
||||
v-if="col.value == null"
|
||||
>
|
||||
<q-icon name="mdi-file-excel-outline" size="20px" />
|
||||
<!-- นำเข้าไฟล์ผลการสอบ -->
|
||||
<q-tooltip>นำเข้าไฟล์ผลการสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="green"
|
||||
@click.stop.prevent="clickEdit(props.row.id)"
|
||||
icon="mdi-file-excel-outline"
|
||||
>
|
||||
<q-tooltip>นำเข้าไฟล์ผลการสอบอีกครั้ง</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="indigo"
|
||||
@click.stop.prevent="clickPassExam(props.row.id)"
|
||||
icon="mdi-clipboard-arrow-down"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดรายชื่อผู้สอบแข่งขันได้</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'examCount'" class="table_ellipsis2">
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
size="12px"
|
||||
color="green"
|
||||
round
|
||||
@click.stop.prevent="clickUpload(props.row.id)"
|
||||
v-if="col.value == null || col.value == '0'"
|
||||
>
|
||||
<q-icon name="mdi-file-excel-outline" size="20px" />
|
||||
<q-tooltip>นำเข้าไฟล์ผู้สมัครสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="green"
|
||||
@click.stop.prevent="clickUpload(props.row.id)"
|
||||
icon="mdi-file-excel-outline"
|
||||
>
|
||||
<q-tooltip>นำเข้าไฟล์ผู้สมัครสอบอีกครั้ง</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="indigo"
|
||||
@click.stop.prevent="clickCandidateList(props.row.id)"
|
||||
icon="mdi-clipboard-arrow-down"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
@click="clickEditPeriod(props.row.id)"
|
||||
icon="mdi-pencil-outline"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="clickDelete(props.row.id)"
|
||||
icon="mdi-delete"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
color="info"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="12px"
|
||||
icon="mdi-history"
|
||||
@click="clickHistory(props.row.id)"
|
||||
>
|
||||
<q-tooltip>แสดงประวัติการทำงาน</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<HistoryTable
|
||||
:rows="rowsHistory"
|
||||
:columns="columnsHistory"
|
||||
:visible-columns="visibleColumnsHistory"
|
||||
v-model:modal="modalHistory"
|
||||
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 == 'isActive'" class="">
|
||||
<q-icon
|
||||
v-if="col.value == false"
|
||||
name="mdi-close"
|
||||
color="red"
|
||||
class="text-h5"
|
||||
/>
|
||||
<q-icon v-else name="mdi-check" color="positive" class="text-h5" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'createdAt'" class="">
|
||||
{{ textDate(col.value) }}
|
||||
</div>
|
||||
|
||||
<div v-else class="">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</HistoryTable>
|
||||
|
||||
<!-- popup Edit window-->
|
||||
<q-dialog v-model="modalAdd" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader :tittle="textTittle" :close="clickClose" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="name"
|
||||
label="ชื่อการสอบแข่งขัน"
|
||||
dense
|
||||
autogrow
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="order"
|
||||
label="ครั้งที่"
|
||||
dense
|
||||
autogrow
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="year"
|
||||
label="ปีงบประมาณ"
|
||||
dense
|
||||
autogrow
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
v-model="files"
|
||||
dense
|
||||
label="เลือกไฟล์รายชื่อผู้สมัครสอบแข่งขัน"
|
||||
outlined
|
||||
use-chips
|
||||
multiple
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSave"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<q-dialog v-model="modalScore" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myFormScore">
|
||||
<DialogHeader :tittle="textTittleScore" :close="clickCloseScore" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
v-model="files_score"
|
||||
dense
|
||||
label="เลือกไฟล์ผลการสอบแข่งขัน"
|
||||
outlined
|
||||
use-chips
|
||||
multiple
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSaveScore"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<q-dialog v-model="modalCandidate" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myFormScore">
|
||||
<DialogHeader :tittle="textTittleCandidate" :close="clickCloseCandidate" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
v-model="files_candidate"
|
||||
dense
|
||||
label="เลือกไฟล์ผู้สมัครสอบแข่งขัน"
|
||||
outlined
|
||||
use-chips
|
||||
multiple
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSaveCandidate"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type {
|
||||
ResponseRecruitPeriod,
|
||||
ResponseHistoryObject,
|
||||
} from "@/modules/03_recruiting/interface/response/Period";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import Table from "@/modules/03_recruiting/components/Table.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import HistoryTable from "@/components/TableHistory.vue";
|
||||
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const $q = useQuasar(); // show dialog
|
||||
const router = useRouter();
|
||||
const name = ref<string>("");
|
||||
const year = ref<number>(new Date().getFullYear() + 543);
|
||||
const order = ref<number>(1);
|
||||
const mixin = useCounterMixin();
|
||||
const { success, dateToISO, dateText } = mixin;
|
||||
const files = ref<any>(null);
|
||||
const files_score = ref<any>(null);
|
||||
const files_candidate = ref<any>(null);
|
||||
const modalAdd = ref<boolean>(false);
|
||||
const modalScore = ref<boolean>(false);
|
||||
const modalCandidate = ref<boolean>(false);
|
||||
const selected_row_id = ref<string>("");
|
||||
const rowsHistory = ref<ResponseHistoryObject[]>([]); //select data history
|
||||
const tittleHistory = ref<string>("ประวัติการนำเข้าข้อมูล"); //
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const modalError = ref<boolean>(false); // modal สำหรับแจ้งเตือนerror
|
||||
const modalErrorTittle = ref<string>(""); // tittle modal error
|
||||
const modalErrorDetail = ref<string>(""); // detail modal error
|
||||
const statusCode = ref<number>();
|
||||
const filter = ref<string>(""); //search data table
|
||||
const textTittle = ref<string>("");
|
||||
const { messageError } = mixin;
|
||||
const textTittleScore = ref<string>("");
|
||||
const textTittleCandidate = ref<string>("");
|
||||
const rows = ref<any>([]);
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"name",
|
||||
"order",
|
||||
"year",
|
||||
"examCount",
|
||||
"scoreCount",
|
||||
]);
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "รอบการสอบแข่งขัน",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "order",
|
||||
align: "left",
|
||||
label: "ครั้งที่",
|
||||
sortable: true,
|
||||
field: "order",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "year",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "year",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "examCount",
|
||||
label: "จำนวนผู้สอบทั้งหมด",
|
||||
align: "right",
|
||||
field: "examCount",
|
||||
sortable: true,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "scoreCount",
|
||||
label: "จำนวนที่บันทึกผลสอบ",
|
||||
align: "right",
|
||||
field: "scoreCount",
|
||||
sortable: true,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
]);
|
||||
|
||||
const columnsHistory = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "description",
|
||||
align: "left",
|
||||
label: "รายละเอียด",
|
||||
sortable: true,
|
||||
field: "description",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "createdAt",
|
||||
align: "center",
|
||||
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",
|
||||
}),
|
||||
},
|
||||
{
|
||||
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",
|
||||
}),
|
||||
},
|
||||
]);
|
||||
|
||||
const visibleColumnsHistory = ref<String[]>([
|
||||
"description",
|
||||
"createdAt",
|
||||
"createdFullName",
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
/**
|
||||
* ฟังก์ชันแปลง date เป็นภาษาไทย
|
||||
* @param value วันที่ type datetime ที่จะแปลงเป็นไทย
|
||||
*/
|
||||
const textDate = (value: Date) => {
|
||||
return dateText(value);
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getCandidates)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let result: ResponseRecruitPeriod[] = [];
|
||||
if (data.length > 0) {
|
||||
data.map((r: ResponseRecruitPeriod) => {
|
||||
if (r.score != null) {
|
||||
r.scoreCount = r.score.scoreCount;
|
||||
r.scoreImportDate = r.score.importDate;
|
||||
}
|
||||
result.push(r);
|
||||
});
|
||||
}
|
||||
|
||||
rows.value = result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const clickPassExam = (id: string) => {
|
||||
window.open(config.API.exportPassExamList(id));
|
||||
};
|
||||
|
||||
const clickCandidateList = (id: string) => {
|
||||
window.open(config.API.exportCandidateList(id));
|
||||
};
|
||||
|
||||
const clickDetail = (id: string) => {
|
||||
router.push(`/compete/import/${id}`);
|
||||
};
|
||||
|
||||
const clickEdit = async (id: string) => {
|
||||
modalScore.value = true;
|
||||
textTittleScore.value = "นำเข้าผลการสอบแข่งขัน";
|
||||
selected_row_id.value = id;
|
||||
};
|
||||
|
||||
const clickUpload = async (id: string) => {
|
||||
modalCandidate.value = true;
|
||||
textTittleCandidate.value = "นำเข้าผู้สมัครสอบแข่งขัน";
|
||||
selected_row_id.value = id;
|
||||
};
|
||||
|
||||
const clickEditPeriod = (id: string) => {
|
||||
router.push(`/compete/period/${id}`);
|
||||
};
|
||||
|
||||
const clickHistory = async (id: string) => {
|
||||
modalHistory.value = true;
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getImportHistory(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rowsHistory.value = [];
|
||||
if (data.length > 0) {
|
||||
data.map((i: ResponseHistoryObject) => {
|
||||
rowsHistory.value.push({
|
||||
createdAt: i.createdAt,
|
||||
createdFullName: i.createdFullName,
|
||||
createdUserId: i.createdUserId,
|
||||
id: i.id,
|
||||
isActive: i.isActive,
|
||||
lastUpdateFullName: i.lastUpdateFullName,
|
||||
lastUpdateUserId: i.lastUpdateUserId,
|
||||
lastUpdatedAt: i.lastUpdatedAt,
|
||||
description: i.description,
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
modalError.value = true;
|
||||
modalErrorTittle.value = "ไม่พบประวัติการเผยแพร่";
|
||||
modalErrorDetail.value = e.response.data.message;
|
||||
statusCode.value = e.response.data.status;
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการลบข้อมูล",
|
||||
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.deleteCandidates(id))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลการสอบสำเร็จ");
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
|
||||
const clickAdd = () => {
|
||||
router.push({ name: "competePeriodAdd" });
|
||||
};
|
||||
|
||||
const clickClose = async () => {
|
||||
modalAdd.value = false;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const clickCloseScore = async () => {
|
||||
modalScore.value = false;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const clickCloseCandidate = async () => {
|
||||
modalCandidate.value = false;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const checkSaveCandidate = async () => {
|
||||
const fd = new FormData();
|
||||
fd.append("attachment", files_candidate.value[0]);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.uploadCandidates(selected_row_id.value), fd)
|
||||
.then((res) => {
|
||||
success($q, "นำเข้าข้อมูลผู้สมัครสอบสำเร็จ");
|
||||
modalCandidate.value = false;
|
||||
selected_row_id.value = "";
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const checkSaveScore = async () => {
|
||||
const fd = new FormData();
|
||||
fd.append("attachment", files_score.value[0]);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.saveScores(selected_row_id.value), fd)
|
||||
.then((res) => {
|
||||
success($q, "นำเข้าข้อมูลผลการสอบสำเร็จ");
|
||||
modalScore.value = false;
|
||||
selected_row_id.value = "";
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const checkSave = async () => {
|
||||
const fd = new FormData();
|
||||
fd.append("attachment", files.value[0]);
|
||||
fd.append("year", year.value.toString());
|
||||
fd.append("order", order.value.toString());
|
||||
fd.append("name", name.value);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.saveCandidates, fd)
|
||||
.then((res) => {
|
||||
success($q, "นำเข้าข้อมูลผู้สมัครสอบแข่งขันสำเร็จ");
|
||||
modalAdd.value = false;
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
987
src/modules/03_recruiting/views/01_compete/PeriodAdd.vue
Normal file
987
src/modules/03_recruiting/views/01_compete/PeriodAdd.vue
Normal file
|
|
@ -0,0 +1,987 @@
|
|||
<!-- page:จัดการรอบการสอบแข่งขัน สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="clickBack"
|
||||
/>
|
||||
{{ edit ? "แก้ไขข้อมูลการสอบแข่งขัน" : "เพิ่มข้อมูลการสอบแข่งขัน" }}
|
||||
</div>
|
||||
<q-card flat bordered class="col-12">
|
||||
<q-form ref="myForm">
|
||||
<q-card-section class="q-pa-md">
|
||||
<div class="col-xs-12 col-sm-8"></div>
|
||||
<div class="col-12 row items-center q-col-gutter-x-sm">
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="name"
|
||||
label="ชื่อรอบการสอบแข่งขัน/ชื่อประกาศ"
|
||||
dense
|
||||
lazy-rules
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกชื่อรอบการสอบแข่งขัน/ชื่อประกาศ'}`]"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4 col-md-1" v-if="announcementExam">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="round"
|
||||
type="number"
|
||||
label="รอบการสอบ(ครั้ง)"
|
||||
dense
|
||||
lazy-rules
|
||||
:rules="[(val) => val > 0 || `${'กรุณากรอกรอบการสอบให้ถูกต้อง'}`]"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4 col-md-1" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="yearly"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:modelValue="updateYear"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
dense
|
||||
lazy-rules
|
||||
outlined
|
||||
:model-value="yearly + 543"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกปีงบประมาณ'}`]"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4 col-md-2" v-if="announcementExam">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="fee"
|
||||
type="number"
|
||||
label="ค่าธรรมเนียม"
|
||||
dense
|
||||
lazy-rules
|
||||
input-class="text-right"
|
||||
:rules="[(val) => val >= 0 || `${'กรุณากรอกค่าธรรมเนียมให้ถูกต้อง'}`]"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateExam"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="date2Thai(dateExam)"
|
||||
:label="`${'วันที่สอบ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateAnnouncement"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
range
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="dateThaiRange(dateAnnouncement)"
|
||||
:label="`${'วันที่ประกาศ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateRegister"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
range
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="dateThaiRange(dateRegister)"
|
||||
:label="`${'วันที่สมัคร'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="datePayment"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
range
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="dateThaiRange(datePayment)"
|
||||
:label="`${'วันที่ชำระเงิน'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateAnnounce"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="date2Thai(dateAnnounce)"
|
||||
:label="`${'วันประกาศผลสอบ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<q-separator size="5px" color="grey-2" />
|
||||
</div>
|
||||
|
||||
<div class="row col-12 items-top q-col-gutter-x-sm">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="text-bold text-subtitle2 q-pb-sm">รูปภาพประกอบ</div>
|
||||
<div class="row justify-center row col-12">
|
||||
<q-uploader
|
||||
color="gray"
|
||||
type="file"
|
||||
flat
|
||||
ref="uploader"
|
||||
class="full-width"
|
||||
text-color="dark"
|
||||
:max-size="10000000"
|
||||
accept=".jpg,.png,.pdf,.csv,.doc"
|
||||
bordered
|
||||
label="[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]"
|
||||
multiple
|
||||
@added="fileUploadImg"
|
||||
@removed="fileRemoveImg"
|
||||
>
|
||||
<template v-slot:header="scope">
|
||||
<div class="row no-wrap items-center q-pa-sm q-gutter-xs text-white">
|
||||
<q-btn
|
||||
v-if="scope.queuedFiles.length > 0"
|
||||
icon="clear_all"
|
||||
@click="scope.removeQueuedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบทั้งหมด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.uploadedFiles.length > 0"
|
||||
icon="done_all"
|
||||
@click="scope.removeUploadedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบไฟล์ที่อัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-spinner v-if="scope.isUploading" class="q-uploader__spinner" />
|
||||
<div class="col">
|
||||
<div class="q-uploader__title">
|
||||
{{ "[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]" }}
|
||||
</div>
|
||||
<div class="q-uploader__subtitle">
|
||||
{{ scope.uploadSizeLabel }}
|
||||
/
|
||||
{{ scope.uploadProgressLabel }}
|
||||
</div>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="scope.canAddFiles"
|
||||
type="a"
|
||||
icon="add_box"
|
||||
@click="scope.pickFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-uploader-add-trigger />
|
||||
<q-tooltip>เลือกไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.isUploading"
|
||||
icon="clear"
|
||||
@click="scope.abort"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ยกเลิกการอัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</template>
|
||||
</q-uploader>
|
||||
</div>
|
||||
<q-card
|
||||
bordered
|
||||
flat
|
||||
class="full-width q-my-md"
|
||||
v-if="fileImgs.length != 0"
|
||||
>
|
||||
<q-list separator>
|
||||
<q-item v-for="file in fileImgs" :key="file.id" class="q-my-xs">
|
||||
<q-item-section>
|
||||
<q-item-label class="full-width ellipsis">
|
||||
{{ file.fileName }}
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption>
|
||||
สถานะ: {{ file.fileType }} /
|
||||
{{ file.fileSize }}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section top side>
|
||||
<div class="q-gutter-sm">
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadData(file.detail)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="red"
|
||||
icon="mdi-delete-outline"
|
||||
v-if="edit"
|
||||
@click="deleteImgData(file.id)"
|
||||
>
|
||||
<q-tooltip>ลบไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="text-bold text-subtitle2 q-pb-sm">เอกสารประกอบ</div>
|
||||
<div class="row justify-center row col-12">
|
||||
<q-uploader
|
||||
color="gray"
|
||||
type="file"
|
||||
flat
|
||||
ref="uploader"
|
||||
class="full-width"
|
||||
text-color="dark"
|
||||
:max-size="10000000"
|
||||
accept=".jpg,.png,.pdf,.csv,.doc"
|
||||
bordered
|
||||
label="[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]"
|
||||
multiple
|
||||
@added="fileUploadDoc"
|
||||
@removed="fileRemoveDoc"
|
||||
>
|
||||
<template v-slot:header="scope">
|
||||
<div class="row no-wrap items-center q-pa-sm q-gutter-xs text-white">
|
||||
<q-btn
|
||||
v-if="scope.queuedFiles.length > 0"
|
||||
icon="clear_all"
|
||||
@click="scope.removeQueuedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบทั้งหมด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.uploadedFiles.length > 0"
|
||||
icon="done_all"
|
||||
@click="scope.removeUploadedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบไฟล์ที่อัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-spinner v-if="scope.isUploading" class="q-uploader__spinner" />
|
||||
<div class="col">
|
||||
<div class="q-uploader__title">
|
||||
{{ "[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]" }}
|
||||
</div>
|
||||
<div class="q-uploader__subtitle">
|
||||
{{ scope.uploadSizeLabel }}
|
||||
/
|
||||
{{ scope.uploadProgressLabel }}
|
||||
</div>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="scope.canAddFiles"
|
||||
type="a"
|
||||
icon="add_box"
|
||||
@click="scope.pickFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-uploader-add-trigger />
|
||||
<q-tooltip>เลือกไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.isUploading"
|
||||
icon="clear"
|
||||
@click="scope.abort"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ยกเลิกการอัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</template>
|
||||
</q-uploader>
|
||||
</div>
|
||||
<q-card
|
||||
bordered
|
||||
flat
|
||||
class="full-width q-my-md"
|
||||
v-if="fileDocs.length != 0"
|
||||
>
|
||||
<q-list separator>
|
||||
<q-item v-for="file in fileDocs" :key="file.id" class="q-my-xs">
|
||||
<q-item-section>
|
||||
<q-item-label class="full-width ellipsis">
|
||||
{{ file.fileName }}
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption>
|
||||
สถานะ: {{ file.fileType }} /
|
||||
{{ file.fileSize }}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section top side>
|
||||
<div class="q-gutter-sm">
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadData(file.detail)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="red"
|
||||
icon="mdi-delete-outline"
|
||||
v-if="edit"
|
||||
@click="deleteDocData(file.id)"
|
||||
>
|
||||
<q-tooltip>ลบไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-separator size="5px" color="grey-2" class="q-my-lg" />
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="text-bold text-subtitle2 q-pb-sm q-pt-md">รายละเอียด</div>
|
||||
<q-editor
|
||||
v-model="editor"
|
||||
:dense="$q.screen.lt.md"
|
||||
toolbar-text-color="blue-grey-10"
|
||||
toolbar-bg="blue-grey-2"
|
||||
toolbar-toggle-color="blue-grey-8"
|
||||
class="editor"
|
||||
:toolbar="[
|
||||
['left', 'center', 'right', 'justify'],
|
||||
['bold', 'italic', 'strike', 'underline', 'subscript', 'superscript'],
|
||||
['token', 'hr', 'link', 'custom_btn'],
|
||||
['print', 'fullscreen'],
|
||||
[
|
||||
{
|
||||
label: $q.lang.editor.formatting,
|
||||
icon: $q.iconSet.editor.formatting,
|
||||
list: 'no-icons',
|
||||
options: ['p', 'h1', 'h2', 'h3'],
|
||||
},
|
||||
{
|
||||
label: $q.lang.editor.defaultFont,
|
||||
icon: $q.iconSet.editor.font,
|
||||
fixedIcon: true,
|
||||
list: 'no-icons',
|
||||
options: [
|
||||
'default_font',
|
||||
'arial',
|
||||
'arial_black',
|
||||
'comic_sans',
|
||||
'courier_new',
|
||||
'impact',
|
||||
'lucida_grande',
|
||||
'times_new_roman',
|
||||
'verdana',
|
||||
],
|
||||
},
|
||||
'removeFormat',
|
||||
],
|
||||
['undo', 'redo'],
|
||||
['viewsource'],
|
||||
]"
|
||||
:fonts="{
|
||||
arial: 'Arial',
|
||||
arial_black: 'Arial Black',
|
||||
comic_sans: 'Comic Sans MS',
|
||||
courier_new: 'Courier New',
|
||||
impact: 'Impact',
|
||||
lucida_grande: 'Lucida Grande',
|
||||
times_new_roman: 'Times New Roman',
|
||||
verdana: 'Verdana',
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 q-mt-md">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="note"
|
||||
label="หมายเหตุ"
|
||||
dense
|
||||
lazy-rules
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSave"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>{{ edit ? "แก้ไขข้อมูล" : "บันทึกข้อมูล" }}</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import type { RequestPeriodCompete } from "@/modules/03_recruiting/interface/request/Period";
|
||||
import type {
|
||||
DataOption,
|
||||
UploadType,
|
||||
} from "@/modules/02_organizational/interface/index/Main";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { date2Thai, success, dateToISO, notifyError } = mixin;
|
||||
const myForm = ref<QForm | null>(null); //form data input
|
||||
const name = ref<string>("");
|
||||
const note = ref<string>("");
|
||||
const editor = ref<string>("");
|
||||
const announcementExam = ref<boolean>(true);
|
||||
const fee = ref<number>(0);
|
||||
const round = ref<number>(1);
|
||||
const yearly = ref<number>(new Date().getFullYear());
|
||||
const dateRegister = ref<[Date, Date]>([new Date(), new Date()]); //วันที่สมัคร
|
||||
const datePayment = ref<[Date, Date]>([new Date(), new Date()]); //วันที่จ่ายเงิน
|
||||
const dateAnnouncement = ref<[Date, Date]>([new Date(), new Date()]); //วันที่ประกาศ
|
||||
const dateExam = ref<Date>(new Date()); //วันที่สอบ
|
||||
const dateAnnounce = ref<Date>(new Date()); //วันที่ประกาศผล
|
||||
const positionPathOptions = ref<DataOption[]>([]);
|
||||
const organizationShortName = ref<DataOption>({ id: "", name: "" });
|
||||
const organizationName = ref<DataOption>({ id: "", name: "" });
|
||||
const organizationNameOptions = ref<DataOption[]>([]);
|
||||
const { messageError } = mixin;
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
const fileDocs = ref<UploadType[]>([]);
|
||||
const fileImgDataUpload = ref<File[]>([]);
|
||||
const fileImgs = ref<UploadType[]>([]);
|
||||
const id = ref<string>("");
|
||||
const pay = ref<string>("");
|
||||
const edit = ref<boolean>(false);
|
||||
const columnsPayment = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "accountNumber",
|
||||
align: "left",
|
||||
label: "เลขบัญชี",
|
||||
sortable: true,
|
||||
field: "accountNumber",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "bankName",
|
||||
align: "left",
|
||||
label: "ธนาคาร",
|
||||
sortable: true,
|
||||
field: "bankName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "accountName",
|
||||
align: "left",
|
||||
label: "ชื่อบัญชี",
|
||||
sortable: true,
|
||||
field: "accountName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
const visibleColumnsPosition = ref<String[]>(["position", "type"]);
|
||||
const columnsPosition = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "position",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "type",
|
||||
align: "left",
|
||||
label: "ประเภทแบบฟอร์ม",
|
||||
sortable: true,
|
||||
field: "type",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
watch(organizationShortName, (count: DataOption, prevCount: DataOption) => {
|
||||
organizationNameOptions.value = [];
|
||||
});
|
||||
|
||||
watch(organizationName, (count: DataOption, prevCount: DataOption) => {
|
||||
positionPathOptions.value = [];
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
if (route.params.id != undefined) {
|
||||
edit.value = true;
|
||||
id.value = route.params.id.toString();
|
||||
await fetchData();
|
||||
} else {
|
||||
edit.value = false;
|
||||
}
|
||||
});
|
||||
|
||||
const clickBack = () => {
|
||||
router.push({ name: "competePeriod" });
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getPeriodById(id.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result.periods;
|
||||
const images = res.data.result.images;
|
||||
const files = res.data.result.files;
|
||||
|
||||
id.value = data.id;
|
||||
name.value = data.name;
|
||||
round.value = data.order;
|
||||
yearly.value = data.year;
|
||||
fee.value = data.fee;
|
||||
dateAnnouncement.value = [
|
||||
new Date(data.announcementStartDate),
|
||||
new Date(data.announcementEndDate),
|
||||
];
|
||||
dateExam.value = new Date(data.examDate);
|
||||
dateRegister.value = [
|
||||
new Date(data.registerStartDate),
|
||||
new Date(data.registerEndDate),
|
||||
];
|
||||
datePayment.value = [
|
||||
new Date(data.paymentStartDate),
|
||||
new Date(data.paymentEndDate),
|
||||
];
|
||||
editor.value = data.detail;
|
||||
note.value = data.note;
|
||||
dateAnnounce.value = new Date(data.announcementDate);
|
||||
|
||||
fileDocs.value = files;
|
||||
fileImgs.value = images;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fileUploadDoc = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
fileDocDataUpload.value.push(file);
|
||||
});
|
||||
};
|
||||
|
||||
const fileRemoveDoc = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
const index = fileDocDataUpload.value.findIndex((x: any) => x.__key == file.__key);
|
||||
if (index > -1) {
|
||||
fileDocDataUpload.value.splice(index, 1);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const uploadDocData = async () => {
|
||||
const formData = new FormData();
|
||||
if (fileDocDataUpload.value.length > 0) {
|
||||
fileDocDataUpload.value.forEach((file: any) => {
|
||||
formData.append("", file);
|
||||
});
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.periodRecruitDoc(id.value), formData)
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
clickBack();
|
||||
});
|
||||
} else {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
clickBack();
|
||||
}
|
||||
};
|
||||
|
||||
const uploadImgData = async () => {
|
||||
if (fileImgDataUpload.value.length > 0) {
|
||||
const formData = new FormData();
|
||||
fileImgDataUpload.value.forEach((file: any) => {
|
||||
formData.append("", file);
|
||||
});
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.periodRecruitImg(id.value), formData)
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const fileUploadImg = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
fileImgDataUpload.value.push(file);
|
||||
});
|
||||
};
|
||||
|
||||
const fileRemoveImg = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
const index = fileImgDataUpload.value.findIndex((x: any) => x.__key == file.__key);
|
||||
if (index > -1) {
|
||||
fileImgDataUpload.value.splice(index, 1);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const downloadData = async (path: string) => {
|
||||
window.open(path);
|
||||
};
|
||||
|
||||
const updateYear = async (e: number) => {
|
||||
yearly.value = e;
|
||||
};
|
||||
|
||||
const checkSave = async () => {
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then(async (success) => {
|
||||
if (success) {
|
||||
if (edit.value) {
|
||||
await editData(id.value);
|
||||
} else {
|
||||
await addData();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const sendData = () => {
|
||||
const valueData: RequestPeriodCompete = {
|
||||
announcementEndDate: dateToISO(dateAnnouncement.value[1]),
|
||||
announcementStartDate: dateToISO(dateAnnouncement.value[0]),
|
||||
examDate: dateToISO(dateExam.value),
|
||||
detail: editor.value,
|
||||
fee: fee.value,
|
||||
id: "",
|
||||
name: name.value,
|
||||
note: note.value,
|
||||
paymentEndDate: dateToISO(datePayment.value[1]),
|
||||
paymentStartDate: dateToISO(datePayment.value[0]),
|
||||
registerEndDate: dateToISO(dateRegister.value[1]),
|
||||
registerStartDate: dateToISO(dateRegister.value[0]),
|
||||
order: round.value,
|
||||
year: yearly.value,
|
||||
announcementDate: dateToISO(dateAnnounce.value),
|
||||
};
|
||||
return valueData;
|
||||
};
|
||||
|
||||
const deleteDocData = async (docId: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.periodDeleteDoc(docId))
|
||||
.then(async () => {
|
||||
await fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const deleteImgData = async (docId: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.periodDeleteImg(docId))
|
||||
.then(async () => {
|
||||
await fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const addData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.savePeriod, sendData())
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
id.value = data.id;
|
||||
await uploadImgData();
|
||||
await uploadDocData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const editData = async (id: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.editPeriod(id), sendData())
|
||||
.then(async () => {
|
||||
await uploadImgData();
|
||||
await uploadDocData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* แปลงช่วงวันที่ถ้า2ค่าเป็นวันเดียวกันจะโชววันเดียวแต่ถ้าไม่เท่ากันจะแสดงเป็นช่วง
|
||||
* @param val ช่วงวันที่
|
||||
*/
|
||||
const dateThaiRange = (val: [Date, Date]) => {
|
||||
if (val === null) {
|
||||
return "";
|
||||
} else if (date2Thai(val[0], true) === date2Thai(val[1], true)) {
|
||||
return `${date2Thai(val[0], true)}`;
|
||||
} else {
|
||||
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
24
src/modules/03_recruiting/views/01_compete/PeriodStat.vue
Normal file
24
src/modules/03_recruiting/views/01_compete/PeriodStat.vue
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<!-- page:จัดการรอบการสอบ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
ข้อมูลสถิติการสมัครสอบแข่งขัน
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-px-md q-py-sm">
|
||||
<iframe
|
||||
:src="panelUrl"
|
||||
style="height: 80vh; width: 100%; border: none; overflow: hidden"
|
||||
></iframe>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import config from "@/app.config";
|
||||
import { ref, onBeforeMount } from "vue";
|
||||
|
||||
const panelUrl = ref<string>("");
|
||||
|
||||
onBeforeMount(async () => {
|
||||
panelUrl.value = config.compettitivePanel;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
424
src/modules/03_recruiting/views/02_qualify/DisableDetail.vue
Normal file
424
src/modules/03_recruiting/views/02_qualify/DisableDetail.vue
Normal file
|
|
@ -0,0 +1,424 @@
|
|||
<!-- page:detail page สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
รายชื่อผู้สมัครสอบรอบ {{ name }} ครั้งที่ {{ round }}/{{ year }}
|
||||
<q-space />
|
||||
<q-btn class="bg-teal-1" icon="mdi-download" round color="primary" flat>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item clickable v-close-popup @click="downloadExam()">
|
||||
<q-item-section class="text-blue"
|
||||
>ส่งออกข้อมูลผู้มีสิทธิ์สอบ</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadPassExam()">
|
||||
<q-item-section class="text-primary"
|
||||
>ส่งออกข้อมูลผู้สอบผ่านภาค ก.</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadPassResultExam()">
|
||||
<q-item-section class="text-amber-9"
|
||||
>ส่งออกข้อมูลผู้คัดเลือกผู้พิการได้</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 row q-mt-sm q-pt-sm q-pa-md">
|
||||
<div class="col-12">
|
||||
<Table
|
||||
:count="count"
|
||||
:pass="pass"
|
||||
:notpass="notpass"
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:nornmalData="false"
|
||||
:conclude="true"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="clickDetail(props.row.examID)"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
<div class="row col-12 items-center">
|
||||
<img
|
||||
:src="props.row.avatar"
|
||||
class="q-mr-sm col-4"
|
||||
style="width: 28px; height: 28px; border-radius: 50%"
|
||||
/>
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.fullname }}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.citizenId }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c1'">
|
||||
<q-checkbox disable v-model="props.row.c1" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c2'">
|
||||
<q-checkbox disable v-model="props.row.c2" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c3'">
|
||||
<q-checkbox disable v-model="props.row.c3" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c4'">
|
||||
<q-checkbox disable v-model="props.row.c4" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'c5'">
|
||||
<q-checkbox disable v-model="props.row.c5" />
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import type { RecruitDetailResponse } from "@/modules/03_recruiting/interface/response/Period";
|
||||
import Table from "@/modules/03_recruiting/components/Table.vue";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const year = ref<string>("2566");
|
||||
const round = ref<string>("1");
|
||||
const name = ref<string>("");
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const count = ref<number>(0);
|
||||
const pass = ref<number>(0);
|
||||
const notpass = ref<number>(0);
|
||||
const importId = ref<string>(route.params.id as string); // Period Import Id
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError } = mixin;
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([
|
||||
"examID",
|
||||
"profileID",
|
||||
"fullName",
|
||||
"dateOfBirth",
|
||||
"gender",
|
||||
"position_name",
|
||||
"university",
|
||||
"degree",
|
||||
"major",
|
||||
"certificateIssueDate",
|
||||
"certificateNo",
|
||||
"examAttribute",
|
||||
"examScore",
|
||||
"examResult",
|
||||
"applyDate",
|
||||
]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "examID",
|
||||
align: "left",
|
||||
label: "เลขประจำตัวสอบ",
|
||||
sortable: true,
|
||||
field: "examID",
|
||||
headerStyle: "font-size: 14px; min-width: 20px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "profileID",
|
||||
align: "left",
|
||||
label: "เลขประจำตัวประชาชน",
|
||||
sortable: true,
|
||||
field: "profileID",
|
||||
headerStyle: "font-size: 14px; min-width: 20px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "fullName",
|
||||
align: "left",
|
||||
label: "ชื่อ-สกุล",
|
||||
sortable: true,
|
||||
field: "personName",
|
||||
headerStyle: "font-size: 14px; min-width: 250px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "dateOfBirth",
|
||||
align: "left",
|
||||
label: "วัน เดือน ปีเกิด",
|
||||
sortable: true,
|
||||
field: "dateOfBirth",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "gender",
|
||||
align: "left",
|
||||
label: "เพศ",
|
||||
sortable: true,
|
||||
field: "gender",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "position_name",
|
||||
align: "left",
|
||||
label: "ตำแหน่งที่สมัคร",
|
||||
sortable: true,
|
||||
field: "position_name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "university",
|
||||
align: "left",
|
||||
label: "สถานศึกษา",
|
||||
sortable: true,
|
||||
field: "university",
|
||||
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: "major",
|
||||
align: "left",
|
||||
label: "สาขาวิชาเอก",
|
||||
sortable: true,
|
||||
field: "major",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "certificateNo",
|
||||
align: "left",
|
||||
label: "เลขที่ใบประกอบวิชาชีพ",
|
||||
sortable: true,
|
||||
field: "certificateNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "certificateIssueDate",
|
||||
align: "left",
|
||||
label: "วันที่ได้รับใบประกอบวิชาชีพฯ",
|
||||
sortable: true,
|
||||
field: "certificateIssueDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "examAttribute",
|
||||
align: "left",
|
||||
label: "สถานะการคัดกรองคุณสมบัติ",
|
||||
sortable: true,
|
||||
field: "examAttribute",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "examScore",
|
||||
align: "right",
|
||||
label: "คะแนนรวม",
|
||||
sortable: true,
|
||||
field: "examScore",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "examResult",
|
||||
align: "left",
|
||||
label: "ผลการสอบ",
|
||||
sortable: true,
|
||||
field: "examResult",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "applyDate",
|
||||
align: "left",
|
||||
label: "วันที่สมัครสอบ",
|
||||
sortable: true,
|
||||
field: "applyDate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
const rows = ref<any>([]);
|
||||
const clickDetail = (examID: string) => {
|
||||
router.push(`/disable/import/${importId.value}/${examID}`);
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const downloadExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.exportDisableExam(importId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `รายชื่อผู้มีสิทธิ์สอบ.xlsx`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadPassExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.exportDisablePassExam(importId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `รายชื่อสอบผ่านภาค_ก.xlsx`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadPassResultExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.exportDisablePassResultExam(importId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `รายชื่อคัดเลือกผู้พิการได้.xlsx`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.getDisableExamResultById(importId.value), {
|
||||
examAttribute: "",
|
||||
examResult: "",
|
||||
})
|
||||
.then((res) => {
|
||||
var _data = res.data.result;
|
||||
var header = res.data.result.header;
|
||||
count.value = header.count;
|
||||
pass.value = header.pass;
|
||||
notpass.value = header.notpass;
|
||||
|
||||
const data = res.data.result.data;
|
||||
let result: RecruitDetailResponse[] = [];
|
||||
if (data.length > 0) {
|
||||
data.map((r: RecruitDetailResponse) => {
|
||||
r.personName = `${r.prefix}${r.fullName}`;
|
||||
result.push(r);
|
||||
});
|
||||
}
|
||||
|
||||
rows.value = result;
|
||||
if (result.length > 0) name.value = result[0].exam_name as string;
|
||||
round.value = _data.round;
|
||||
year.value = _data.year;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
353
src/modules/03_recruiting/views/02_qualify/DisableDetailEx.vue
Normal file
353
src/modules/03_recruiting/views/02_qualify/DisableDetailEx.vue
Normal file
|
|
@ -0,0 +1,353 @@
|
|||
<!-- page:detail page สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
รายละเอียดของผู้สมัครสอบ {{ examID }} : {{ prefix }}{{ fullname }}
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 row q-mt-sm q-pa-md">
|
||||
<div class="row q-col-gutter-md col-12">
|
||||
<div class="col-xs-12 col-sm-12 col-md-6">
|
||||
<q-card bordered flat class="col-12 q-pa-md">
|
||||
<div class="col-12 q-col-gutter-sm row items-center">
|
||||
<div class="col-12 text-weight-bold">ข้อมูลทั่วไป</div>
|
||||
<div class="col-6 text-grey-7" v-if="profile_id !== null">
|
||||
เลขประจำตัวประชาชน
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="profile_id !== null">
|
||||
{{ profile_id }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="prefix !== null">คำนำหน้านาม</div>
|
||||
<div class="col-6 text-black" v-if="prefix !== null">
|
||||
{{ prefix }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="fullname !== null">ชื่อ-นามสกุล</div>
|
||||
<div class="col-6 text-black" v-if="fullname !== null">
|
||||
{{ fullname }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="birthdate !== null">
|
||||
วัน/เดือน/ปี เกิด
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="birthdate !== null">
|
||||
{{ birthdate }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="gender !== null">เพศ</div>
|
||||
<div class="col-6 text-black" v-if="gender !== null">
|
||||
{{ gender }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="position_name !== null">
|
||||
ตำแหน่งที่สมัคร
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="position_name !== null">
|
||||
{{ position_name }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="university !== null">สถานศึกษา</div>
|
||||
<div class="col-6 text-black" v-if="university !== null">
|
||||
{{ university }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="degree !== null">วุฒิการศึกษา</div>
|
||||
<div class="col-6 text-black" v-if="degree !== null">
|
||||
{{ degree }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="major !== null">สาขาวิชาเอก</div>
|
||||
<div class="col-6 text-black" v-if="major !== null">
|
||||
{{ major }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="major !== null">
|
||||
จำนวนครั้งที่สมัครสอบ
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="major !== null">
|
||||
{{ examCount }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="cert_issuedate !== null">
|
||||
ใบอนุญาตประกอบวิชาชีพ วัน เดือน ปีที่ได้รับ
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="cert_issuedate !== null">
|
||||
{{ cert_issuedate }}
|
||||
</div>
|
||||
|
||||
<div class="col-6 text-grey-7" v-if="examAttribute !== null">
|
||||
สถานะการคัดกรองคุณสมบัติ
|
||||
</div>
|
||||
<div class="col-6 text-black" v-if="examAttribute !== null">
|
||||
{{ examAttribute }}
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-6">
|
||||
<q-card
|
||||
bordered
|
||||
flat
|
||||
class="col-xs-12 col-sm-12 col-md-6 q-px-md q-py-sm full-height"
|
||||
>
|
||||
<div class="col-12 row q-col-gutter-sm">
|
||||
<div class="col-12 text-weight-bold row items-center">
|
||||
ผลการสอบ
|
||||
<q-space />
|
||||
<q-btn
|
||||
color="primary"
|
||||
flat
|
||||
round
|
||||
icon="mdi-download"
|
||||
v-if="examResultinscore === 'ผ่าน'"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item clickable v-close-popup @click="downloadScore()">
|
||||
<q-item-section class="text-primary"
|
||||
>ดาวน์โหลดผลคะแนน</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadCertificate()">
|
||||
<q-item-section class="text-blue"
|
||||
>ดาวน์โหลดเอกสารรับรอง</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-else
|
||||
color="blue"
|
||||
flat
|
||||
round
|
||||
icon="mdi-download"
|
||||
@click="downloadScore()"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดผลคะแนน</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="row items-center q-gutter-y-sm col-12">
|
||||
<div class="col-xs-4 col-sm-5 text-weight-medium text-grey-7">ประเภท</div>
|
||||
<div class="col-xs-3 col-sm-2 text-primary text-weight-bold">คะแนนเต็ม</div>
|
||||
<div class="col-xs-3 col-sm-2 text-primary text-weight-bold">
|
||||
คะแนนที่ได้
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 text-primary text-weight-bold"></div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">ภาค ก</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreAFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreA }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">ภาค ข</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreBFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreB }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">ภาค ค</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreCFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreC }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-grey-7">รวมทั้งหมด</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreSumFull }}
|
||||
</div>
|
||||
<div class="col-xs-3 col-sm-2 q-pr-xs">
|
||||
{{ scoreSum }}
|
||||
</div>
|
||||
<div class="col-xs-2 col-sm-2 q-pr-xs text-grey-7">คะแนน</div>
|
||||
|
||||
<div class="col-xs-4 col-sm-5 text-weight-bold q-pt-sm">ผลการสอบ</div>
|
||||
<div class="col-xs-8 col-sm-6 q-pr-xs text-weight-bold text-subtitle1">
|
||||
<span
|
||||
:class="examResultinscore != 'ผ่าน' ? 'text-red' : 'text-positive'"
|
||||
>{{ examResultinscore }}</span
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-5 text-grey-7">ลำดับที่สอบได้</div>
|
||||
<div class="col-xs-6 col-sm-7 q-pr-xs">
|
||||
{{ number }}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-5 text-grey-7">
|
||||
วันหมดอายุบัญชีคัดเลือกผู้พิการ
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-7 q-pr-xs">
|
||||
{{ score_expired }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
const dataStore = useDataStore();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError } = mixin;
|
||||
const { loaderPage } = dataStore;
|
||||
const date = ref<any>();
|
||||
const profile_id = ref<string>("");
|
||||
const birthdate = ref<string>("");
|
||||
const gender = ref<string>("");
|
||||
const university = ref<string>("");
|
||||
const position_name = ref<string>("");
|
||||
const degree = ref<string>("");
|
||||
const major = ref<string>("");
|
||||
const cert_issuedate = ref<string>("");
|
||||
const examAttribute = ref<string>("");
|
||||
const checkbox = false;
|
||||
const remarkText = ref<string>("");
|
||||
const examResultinscore = ref<string>("");
|
||||
const scoreAFull = ref<string>("");
|
||||
const scoreA = ref<string>("");
|
||||
const scoreBFull = ref<string>("");
|
||||
const scoreB = ref<string>("");
|
||||
const scoreCFull = ref<string>("");
|
||||
const scoreC = ref<string>("");
|
||||
const scoreSumFull = ref<string>("");
|
||||
const scoreSum = ref<string>("");
|
||||
const examCount = ref<string>("");
|
||||
const number = ref<string>("");
|
||||
const score_expired = ref<string>("");
|
||||
const attachments = ref<any>([
|
||||
{ fileName: "เอกสารประกอบ 1" },
|
||||
{ fileName: "เอกสารประกอบ 2" },
|
||||
]);
|
||||
const examID = ref<string>("62150001");
|
||||
const prefix = ref<string>("นาย");
|
||||
const fullname = ref<string>("เกียรติศักดิ์ บัณฑิต");
|
||||
const importId = ref<string>(route.params.id as string); // Period Import Id
|
||||
const examId = ref<string>(route.params.examId as string); // เลขประจำตัวสอบ
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getDisableExamDetail(importId.value, examId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result.data;
|
||||
if (res.data.result != null) {
|
||||
examCount.value = res.data.result.examCount;
|
||||
profile_id.value = data.profileID;
|
||||
examID.value = data.examID;
|
||||
prefix.value = data.prefix;
|
||||
fullname.value = data.fullName;
|
||||
birthdate.value = data.dateOfBirth;
|
||||
gender.value = data.gender;
|
||||
degree.value = data.degree;
|
||||
major.value = data.major;
|
||||
university.value = data.university;
|
||||
position_name.value = data.positionName;
|
||||
cert_issuedate.value = data.certificateIssueDate;
|
||||
examAttribute.value = data.examAttribute;
|
||||
number.value = data.number;
|
||||
console.log(data);
|
||||
examCount.value = data.examCount;
|
||||
score_expired.value = data.scoreExpire;
|
||||
if (data.scoreResult != null) {
|
||||
scoreAFull.value = data.scoreResult.scoreAFull;
|
||||
scoreA.value = data.scoreResult.scoreA;
|
||||
scoreBFull.value = data.scoreResult.scoreBFull;
|
||||
scoreB.value = data.scoreResult.scoreB;
|
||||
scoreCFull.value = data.scoreResult.scoreCFull;
|
||||
scoreC.value = data.scoreResult.scoreC;
|
||||
scoreSumFull.value = data.scoreResult.scoreSumFull;
|
||||
scoreSum.value = data.scoreResult.scoreSum;
|
||||
examResultinscore.value = data.scoreResult.examResult;
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadScore = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.downloadDisableScoreReport(importId.value, examId.value), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `ผลคะแนน_${examId.value}.pdf`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadCertificate = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.downloadDisableExamReport(importId.value, examId.value, 2), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.then((res) => {
|
||||
var a = document.createElement("a");
|
||||
a.href = URL.createObjectURL(res.data);
|
||||
a.download = `เอกสารรับรอง_${examId.value}.pdf`;
|
||||
// start download
|
||||
a.click();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
762
src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue
Normal file
762
src/modules/03_recruiting/views/02_qualify/DisablePeriod.vue
Normal file
|
|
@ -0,0 +1,762 @@
|
|||
<!-- page:จัดการรอบการสอบ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
จัดการรอบคัดเลือกคนพิการ
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
|
||||
<div>
|
||||
<Table
|
||||
style="max-height: 80vh"
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:pagination="initialPagination"
|
||||
:nornmalData="true"
|
||||
:add="clickAdd"
|
||||
:paging="true"
|
||||
:titleText="''"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="clickDetail(props.row.id)"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'name'" class="table_ellipsis2">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'year'" class="table_ellipsis2">
|
||||
{{ col.value + 543 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'scoreCount'" class="table_ellipsis2">
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
size="12px"
|
||||
round
|
||||
color="green"
|
||||
@click.stop.prevent="clickEdit(props.row.id)"
|
||||
v-if="col.value == null"
|
||||
>
|
||||
<q-icon name="mdi-file-excel-outline" size="20px" />
|
||||
<!-- นำเข้าไฟล์ผลการสอบ -->
|
||||
<q-tooltip>นำเข้าไฟล์ผลการสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="green"
|
||||
@click.stop.prevent="clickEdit(props.row.id)"
|
||||
icon="mdi-file-excel-outline"
|
||||
>
|
||||
<q-tooltip>นำเข้าไฟล์ผลการสอบอีกครั้ง</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="indigo"
|
||||
@click.stop.prevent="clickPassExam(props.row.id)"
|
||||
icon="mdi-clipboard-arrow-down"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดรายชื่อผู้สอบแข่งขันได้</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'examCount'" class="table_ellipsis2">
|
||||
<q-btn
|
||||
flat
|
||||
dense
|
||||
size="12px"
|
||||
color="green"
|
||||
round
|
||||
@click.stop.prevent="clickUpload(props.row.id)"
|
||||
v-if="col.value == null || col.value == '0'"
|
||||
>
|
||||
<q-icon name="mdi-file-excel-outline" size="20px" />
|
||||
<q-tooltip>นำเข้าไฟล์ผู้สมัครสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="green"
|
||||
@click.stop.prevent="clickUpload(props.row.id)"
|
||||
icon="mdi-file-excel-outline"
|
||||
>
|
||||
<q-tooltip>นำเข้าไฟล์ผู้สมัครสอบอีกครั้ง</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="indigo"
|
||||
@click.stop.prevent="clickCandidateList(props.row.id)"
|
||||
icon="mdi-clipboard-arrow-down"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
@click="clickEditPeriod(props.row.id)"
|
||||
icon="mdi-pencil-outline"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="clickDelete(props.row.id)"
|
||||
icon="mdi-delete"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
color="info"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="12px"
|
||||
icon="mdi-history"
|
||||
@click="clickHistory(props.row.id)"
|
||||
>
|
||||
<q-tooltip>แสดงประวัติการทำงาน</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<HistoryTable
|
||||
:rows="rowsHistory"
|
||||
:columns="columnsHistory"
|
||||
:visible-columns="visibleColumnsHistory"
|
||||
v-model:modal="modalHistory"
|
||||
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 == 'isActive'" class="">
|
||||
<q-icon
|
||||
v-if="col.value == false"
|
||||
name="mdi-close"
|
||||
color="red"
|
||||
class="text-h5"
|
||||
/>
|
||||
<q-icon v-else name="mdi-check" color="positive" class="text-h5" />
|
||||
</div>
|
||||
<div v-else-if="col.name == 'createdAt'" class="">
|
||||
{{ textDate(col.value) }}
|
||||
</div>
|
||||
|
||||
<div v-else class="">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</HistoryTable>
|
||||
|
||||
<!-- popup Edit window-->
|
||||
<q-dialog v-model="modalAdd" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myForm">
|
||||
<DialogHeader :tittle="textTittle" :close="clickClose" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="name"
|
||||
label="ชื่อการคัดเลือกผู้พิการ"
|
||||
dense
|
||||
autogrow
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="round"
|
||||
label="ครั้งที่"
|
||||
dense
|
||||
autogrow
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="year"
|
||||
label="ปีงบประมาณ"
|
||||
dense
|
||||
autogrow
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
v-model="files"
|
||||
dense
|
||||
label="เลือกไฟล์รายชื่อผู้สมัครคัดเลือกผู้พิการ"
|
||||
outlined
|
||||
use-chips
|
||||
multiple
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSave"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<q-dialog v-model="modalScore" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myFormScore">
|
||||
<DialogHeader :tittle="textTittleScore" :close="clickCloseScore" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
v-model="files_score"
|
||||
dense
|
||||
label="เลือกไฟล์ผลการคัดเลือกผู้พิการ"
|
||||
outlined
|
||||
use-chips
|
||||
multiple
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSaveScore"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<q-dialog v-model="modalCandidate" persistent>
|
||||
<q-card style="width: 600px">
|
||||
<q-form ref="myFormScore">
|
||||
<DialogHeader
|
||||
:tittle="textTittleCandidate"
|
||||
:close="clickCloseCandidate"
|
||||
/>
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-file
|
||||
v-model="files_candidate"
|
||||
dense
|
||||
label="เลือกไฟล์ผู้สมัครคัดเลือกผู้พิการ"
|
||||
outlined
|
||||
use-chips
|
||||
multiple
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSaveCandidate"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type {
|
||||
ResponseRecruitPeriod,
|
||||
ResponseHistoryObject,
|
||||
} from "@/modules/03_recruiting/interface/response/Period";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import Table from "@/modules/03_recruiting/components/Table.vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import HistoryTable from "@/components/TableHistory.vue";
|
||||
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const $q = useQuasar(); // show dialog
|
||||
const router = useRouter();
|
||||
const name = ref<string>("");
|
||||
const year = ref<number>(new Date().getFullYear() + 543);
|
||||
const round = ref<number>(1);
|
||||
const mixin = useCounterMixin();
|
||||
const { success, dateText, messageError } = mixin;
|
||||
const files = ref<any>(null);
|
||||
const files_score = ref<any>(null);
|
||||
const files_candidate = ref<any>(null);
|
||||
const modalAdd = ref<boolean>(false);
|
||||
const modalScore = ref<boolean>(false);
|
||||
const modalCandidate = ref<boolean>(false);
|
||||
const selected_row_id = ref<string>("");
|
||||
const rowsHistory = ref<ResponseHistoryObject[]>([]); //select data history
|
||||
const tittleHistory = ref<string>("ประวัติการนำเข้าข้อมูล"); //
|
||||
const modalHistory = ref<boolean>(false); //modal ประวัติการแก้ไขข้อมูล
|
||||
const rows = ref<any>([]);
|
||||
const filter = ref<string>(""); //search data table
|
||||
const textTittle = ref<string>("");
|
||||
const textTittleScore = ref<string>("");
|
||||
const textTittleCandidate = ref<string>("");
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"name",
|
||||
"round",
|
||||
"year",
|
||||
"examCount",
|
||||
"scoreCount",
|
||||
]);
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "รอบการคัดเลือกผู้พิการ",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "round",
|
||||
align: "left",
|
||||
label: "ครั้งที่",
|
||||
sortable: true,
|
||||
field: "round",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "year",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "year",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "examCount",
|
||||
label: "จำนวนผู้สอบทั้งหมด",
|
||||
align: "right",
|
||||
field: "examCount",
|
||||
sortable: true,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "scoreCount",
|
||||
label: "จำนวนที่บันทึกผลสอบ",
|
||||
align: "right",
|
||||
field: "scoreCount",
|
||||
sortable: true,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
]);
|
||||
|
||||
const columnsHistory = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "description",
|
||||
align: "left",
|
||||
label: "รายละเอียด",
|
||||
sortable: true,
|
||||
field: "description",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "createdAt",
|
||||
align: "center",
|
||||
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",
|
||||
}),
|
||||
},
|
||||
{
|
||||
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",
|
||||
}),
|
||||
},
|
||||
]);
|
||||
|
||||
const visibleColumnsHistory = ref<String[]>([
|
||||
"description",
|
||||
"createdAt",
|
||||
"createdFullName",
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const clickPassExam = (id: string) => {
|
||||
window.open(config.API.exportDisablePassExamList(id));
|
||||
};
|
||||
|
||||
const clickCandidateList = (id: string) => {
|
||||
window.open(config.API.exportDisableCandidateList(id));
|
||||
};
|
||||
|
||||
/**
|
||||
* ฟังก์ชันแปลง date เป็นภาษาไทย
|
||||
* @param value วันที่ type datetime ที่จะแปลงเป็นไทย
|
||||
*/
|
||||
const textDate = (value: Date) => {
|
||||
return dateText(value);
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getDisableCandidates)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let result: ResponseRecruitPeriod[] = [];
|
||||
if (data.length > 0) {
|
||||
data.map((r: ResponseRecruitPeriod) => {
|
||||
if (r.score != null) {
|
||||
r.scoreCount = r.score.scoreCount;
|
||||
r.scoreImportDate = r.score.importDate;
|
||||
}
|
||||
result.push(r);
|
||||
});
|
||||
}
|
||||
|
||||
rows.value = result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const clickDetail = (id: string) => {
|
||||
router.push(`/disable/import/${id}`);
|
||||
};
|
||||
|
||||
const clickEdit = async (id: string) => {
|
||||
modalScore.value = true;
|
||||
textTittleScore.value = "นำเข้าผลการคัดเลือกผู้พิการ";
|
||||
selected_row_id.value = id;
|
||||
};
|
||||
|
||||
const clickUpload = async (id: string) => {
|
||||
modalCandidate.value = true;
|
||||
textTittleCandidate.value = "นำเข้าผู้สมัครคัดเลือกผู้พิการ";
|
||||
selected_row_id.value = id;
|
||||
};
|
||||
|
||||
const clickEditPeriod = (id: string) => {
|
||||
router.push(`/disable/period/${id}`);
|
||||
};
|
||||
|
||||
const clickHistory = async (id: string) => {
|
||||
modalHistory.value = true;
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getDisableImportHistory(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rowsHistory.value = [];
|
||||
if (data.length > 0) {
|
||||
data.map((i: ResponseHistoryObject) => {
|
||||
rowsHistory.value.push({
|
||||
createdAt: i.createdAt,
|
||||
createdFullName: i.createdFullName,
|
||||
createdUserId: i.createdUserId,
|
||||
id: i.id,
|
||||
isActive: i.isActive,
|
||||
lastUpdateFullName: i.lastUpdateFullName,
|
||||
lastUpdateUserId: i.lastUpdateUserId,
|
||||
lastUpdatedAt: i.lastUpdatedAt,
|
||||
description: i.description,
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการลบข้อมูล",
|
||||
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.deleteDisableCandidates(id))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลการสอบสำเร็จ");
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
|
||||
const clickAdd = () => {
|
||||
router.push({ name: "disablePeriodAdd" });
|
||||
};
|
||||
|
||||
const clickClose = async () => {
|
||||
modalAdd.value = false;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const clickCloseScore = async () => {
|
||||
modalScore.value = false;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const clickCloseCandidate = async () => {
|
||||
modalCandidate.value = false;
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const checkSaveCandidate = async () => {
|
||||
const fd = new FormData();
|
||||
fd.append("attachment", files_candidate.value[0]);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.uploadDisableCandidates(selected_row_id.value), fd)
|
||||
.then((res) => {
|
||||
success($q, "นำเข้าข้อมูลผู้สมัครสอบสำเร็จ");
|
||||
modalCandidate.value = false;
|
||||
selected_row_id.value = "";
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const checkSaveScore = async () => {
|
||||
const fd = new FormData();
|
||||
fd.append("attachment", files_score.value[0]);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.saveDisableScores(selected_row_id.value), fd)
|
||||
.then((res) => {
|
||||
success($q, "นำเข้าข้อมูลผลการสอบสำเร็จ");
|
||||
modalScore.value = false;
|
||||
selected_row_id.value = "";
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const checkSave = async () => {
|
||||
const fd = new FormData();
|
||||
fd.append("attachment", files.value[0]);
|
||||
fd.append("year", year.value.toString());
|
||||
fd.append("round", round.value.toString());
|
||||
fd.append("name", name.value);
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.saveDisableCandidates, fd)
|
||||
.then((res) => {
|
||||
success($q, "นำเข้าข้อมูลผู้สมัครคัดเลือกผู้พิการสำเร็จ");
|
||||
modalAdd.value = false;
|
||||
fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
962
src/modules/03_recruiting/views/02_qualify/DisablePeriodAdd.vue
Normal file
962
src/modules/03_recruiting/views/02_qualify/DisablePeriodAdd.vue
Normal file
|
|
@ -0,0 +1,962 @@
|
|||
<!-- page:จัดการรอบการคัดเลือกผู้พิการ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="clickBack"
|
||||
/>
|
||||
{{
|
||||
edit ? "แก้ไขข้อมูลการคัดเลือกผู้พิการ" : "เพิ่มข้อมูลการคัดเลือกผู้พิการ"
|
||||
}}
|
||||
</div>
|
||||
<q-card flat bordered class="col-12">
|
||||
<q-form ref="myForm">
|
||||
<q-card-section class="q-pa-md">
|
||||
<div class="col-xs-12 col-sm-8"></div>
|
||||
<div class="col-12 row items-center q-col-gutter-x-sm">
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="name"
|
||||
label="ชื่อรอบการคัดเลือกผู้พิการ/ชื่อประกาศ"
|
||||
dense
|
||||
lazy-rules
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val ||
|
||||
`${'กรุณากรอกชื่อรอบการคัดเลือกผู้พิการ/ชื่อประกาศ'}`,
|
||||
]"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4 col-md-1" v-if="announcementExam">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="round"
|
||||
type="number"
|
||||
label="รอบการสอบ(ครั้ง)"
|
||||
dense
|
||||
lazy-rules
|
||||
:rules="[(val) => val > 0 || `${'กรุณากรอกรอบการสอบให้ถูกต้อง'}`]"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4 col-md-1" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="yearly"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:modelValue="updateYear"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
dense
|
||||
lazy-rules
|
||||
outlined
|
||||
:model-value="yearly + 543"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกปีงบประมาณ'}`]"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4 col-md-2" v-if="announcementExam">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="fee"
|
||||
type="number"
|
||||
label="ค่าธรรมเนียม"
|
||||
dense
|
||||
lazy-rules
|
||||
input-class="text-right"
|
||||
:rules="[
|
||||
(val) => val >= 0 || `${'กรุณากรอกค่าธรรมเนียมให้ถูกต้อง'}`,
|
||||
]"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateExam"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="date2Thai(dateExam)"
|
||||
:label="`${'วันที่สอบ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateAnnouncement"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
range
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="dateThaiRange(dateAnnouncement)"
|
||||
:label="`${'วันที่ประกาศ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateRegister"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
range
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="dateThaiRange(dateRegister)"
|
||||
:label="`${'วันที่สมัคร'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="datePayment"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
range
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="dateThaiRange(datePayment)"
|
||||
:label="`${'วันที่ชำระเงิน'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-3 col-md-3" v-if="announcementExam">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateAnnounce"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker q-mb-md"
|
||||
:model-value="date2Thai(dateAnnounce)"
|
||||
:label="`${'วันประกาศผลสอบ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<q-separator size="5px" color="grey-2" class="q-mb-md" />
|
||||
</div>
|
||||
|
||||
<div class="row col-12 items-top q-col-gutter-x-sm">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="text-bold text-subtitle2 q-pb-sm">รูปภาพประกอบ</div>
|
||||
<div class="row justify-center row col-12">
|
||||
<q-uploader
|
||||
color="gray"
|
||||
type="file"
|
||||
flat
|
||||
ref="uploader"
|
||||
class="full-width"
|
||||
text-color="dark"
|
||||
:max-size="10000000"
|
||||
accept=".jpg,.png,.pdf,.csv,.doc"
|
||||
bordered
|
||||
label="[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]"
|
||||
multiple
|
||||
@added="fileUploadImg"
|
||||
@removed="fileRemoveImg"
|
||||
>
|
||||
<template v-slot:header="scope">
|
||||
<div
|
||||
class="row no-wrap items-center q-pa-sm q-gutter-xs text-white"
|
||||
>
|
||||
<q-btn
|
||||
v-if="scope.queuedFiles.length > 0"
|
||||
icon="clear_all"
|
||||
@click="scope.removeQueuedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบทั้งหมด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.uploadedFiles.length > 0"
|
||||
icon="done_all"
|
||||
@click="scope.removeUploadedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบไฟล์ที่อัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-spinner
|
||||
v-if="scope.isUploading"
|
||||
class="q-uploader__spinner"
|
||||
/>
|
||||
<div class="col">
|
||||
<div class="q-uploader__title">
|
||||
{{ "[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]" }}
|
||||
</div>
|
||||
<div class="q-uploader__subtitle">
|
||||
{{ scope.uploadSizeLabel }}
|
||||
/
|
||||
{{ scope.uploadProgressLabel }}
|
||||
</div>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="scope.canAddFiles"
|
||||
type="a"
|
||||
icon="add_box"
|
||||
@click="scope.pickFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-uploader-add-trigger />
|
||||
<q-tooltip>เลือกไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.isUploading"
|
||||
icon="clear"
|
||||
@click="scope.abort"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ยกเลิกการอัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</template>
|
||||
</q-uploader>
|
||||
</div>
|
||||
<q-card
|
||||
bordered
|
||||
flat
|
||||
class="full-width q-my-md"
|
||||
v-if="fileImgs.length != 0"
|
||||
>
|
||||
<q-list separator>
|
||||
<q-item
|
||||
v-for="file in fileImgs"
|
||||
:key="file.id"
|
||||
class="q-my-xs"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-item-label class="full-width ellipsis">
|
||||
{{ file.fileName }}
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption>
|
||||
สถานะ: {{ file.fileType }} /
|
||||
{{ file.fileSize }}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section top side>
|
||||
<div class="q-gutter-sm">
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadData(file.detail)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="red"
|
||||
icon="mdi-delete-outline"
|
||||
v-if="edit"
|
||||
@click="deleteDocData(file.id)"
|
||||
>
|
||||
<q-tooltip>ลบไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="text-bold text-subtitle2 q-pb-sm">เอกสารประกอบ</div>
|
||||
<div class="row justify-center row col-12">
|
||||
<q-uploader
|
||||
color="gray"
|
||||
type="file"
|
||||
flat
|
||||
ref="uploader"
|
||||
class="full-width"
|
||||
text-color="dark"
|
||||
:max-size="10000000"
|
||||
bordered
|
||||
label="[ไฟล์ขนาดไม่เกิน 10MB]"
|
||||
multiple
|
||||
@added="fileUploadDoc"
|
||||
@removed="fileRemoveDoc"
|
||||
>
|
||||
<template v-slot:header="scope">
|
||||
<div
|
||||
class="row no-wrap items-center q-pa-sm q-gutter-xs text-white"
|
||||
>
|
||||
<q-btn
|
||||
v-if="scope.queuedFiles.length > 0"
|
||||
icon="clear_all"
|
||||
@click="scope.removeQueuedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบทั้งหมด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.uploadedFiles.length > 0"
|
||||
icon="done_all"
|
||||
@click="scope.removeUploadedFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ลบไฟล์ที่อัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-spinner
|
||||
v-if="scope.isUploading"
|
||||
class="q-uploader__spinner"
|
||||
/>
|
||||
<div class="col">
|
||||
<div class="q-uploader__title">
|
||||
{{ "[ไฟล์ jpg,png,pdf,csv,doc ขนาดไม่เกิน 10MB]" }}
|
||||
</div>
|
||||
<div class="q-uploader__subtitle">
|
||||
{{ scope.uploadSizeLabel }}
|
||||
/
|
||||
{{ scope.uploadProgressLabel }}
|
||||
</div>
|
||||
</div>
|
||||
<q-btn
|
||||
v-if="scope.canAddFiles"
|
||||
type="a"
|
||||
icon="add_box"
|
||||
@click="scope.pickFiles"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-uploader-add-trigger />
|
||||
<q-tooltip>เลือกไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="scope.isUploading"
|
||||
icon="clear"
|
||||
@click="scope.abort"
|
||||
round
|
||||
dense
|
||||
flat
|
||||
>
|
||||
<q-tooltip>ยกเลิกการอัปโหลด</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</template>
|
||||
</q-uploader>
|
||||
</div>
|
||||
<q-card
|
||||
bordered
|
||||
flat
|
||||
class="full-width q-my-md"
|
||||
v-if="fileDocs.length != 0"
|
||||
>
|
||||
<q-list separator>
|
||||
<q-item
|
||||
v-for="file in fileDocs"
|
||||
:key="file.id"
|
||||
class="q-my-xs"
|
||||
>
|
||||
<q-item-section>
|
||||
<q-item-label class="full-width ellipsis">
|
||||
{{ file.fileName }}
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption>
|
||||
สถานะ: {{ file.fileType }} /
|
||||
{{ file.fileSize }}
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section top side>
|
||||
<div class="q-gutter-sm">
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="blue"
|
||||
icon="mdi-download-outline"
|
||||
@click="downloadData(file.detail)"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="red"
|
||||
icon="mdi-delete-outline"
|
||||
v-if="edit"
|
||||
@click="deleteDocData(file.id)"
|
||||
>
|
||||
<q-tooltip>ลบไฟล์</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-separator size="5px" color="grey-2" class="q-mt-md" />
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<div class="text-bold text-subtitle2 q-pb-sm q-pt-md">
|
||||
รายละเอียด
|
||||
</div>
|
||||
<q-editor
|
||||
v-model="editor"
|
||||
:dense="$q.screen.lt.md"
|
||||
toolbar-text-color="blue-grey-10"
|
||||
toolbar-bg="blue-grey-2"
|
||||
toolbar-toggle-color="blue-grey-8"
|
||||
class="editor"
|
||||
:toolbar="[
|
||||
['left', 'center', 'right', 'justify'],
|
||||
[
|
||||
'bold',
|
||||
'italic',
|
||||
'strike',
|
||||
'underline',
|
||||
'subscript',
|
||||
'superscript',
|
||||
],
|
||||
['token', 'hr', 'link', 'custom_btn'],
|
||||
['print', 'fullscreen'],
|
||||
[
|
||||
{
|
||||
label: $q.lang.editor.formatting,
|
||||
icon: $q.iconSet.editor.formatting,
|
||||
list: 'no-icons',
|
||||
options: ['p', 'h1', 'h2', 'h3'],
|
||||
},
|
||||
{
|
||||
label: $q.lang.editor.defaultFont,
|
||||
icon: $q.iconSet.editor.font,
|
||||
fixedIcon: true,
|
||||
list: 'no-icons',
|
||||
options: [
|
||||
'default_font',
|
||||
'arial',
|
||||
'arial_black',
|
||||
'comic_sans',
|
||||
'courier_new',
|
||||
'impact',
|
||||
'lucida_grande',
|
||||
'times_new_roman',
|
||||
'verdana',
|
||||
],
|
||||
},
|
||||
'removeFormat',
|
||||
],
|
||||
['undo', 'redo'],
|
||||
['viewsource'],
|
||||
]"
|
||||
:fonts="{
|
||||
arial: 'Arial',
|
||||
arial_black: 'Arial Black',
|
||||
comic_sans: 'Comic Sans MS',
|
||||
courier_new: 'Courier New',
|
||||
impact: 'Impact',
|
||||
lucida_grande: 'Lucida Grande',
|
||||
times_new_roman: 'Times New Roman',
|
||||
verdana: 'Verdana',
|
||||
}"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 q-mt-md">
|
||||
<q-input
|
||||
outlined
|
||||
v-model="note"
|
||||
label="หมายเหตุ"
|
||||
dense
|
||||
lazy-rules
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions class="text-primary q-py-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSave"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>{{ edit ? "แก้ไขข้อมูล" : "บันทึกข้อมูล" }}</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import type { RequestPeriodDisable } from "@/modules/03_recruiting/interface/request/Period";
|
||||
import type {
|
||||
DataOption,
|
||||
UploadType,
|
||||
} from "@/modules/02_organizational/interface/index/Main";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { date2Thai, success, dateToISO, notifyError, messageError } = mixin;
|
||||
const myForm = ref<QForm | null>(null); //form data input
|
||||
const name = ref<string>("");
|
||||
const note = ref<string>("");
|
||||
const editor = ref<string>("");
|
||||
const announcementExam = ref<boolean>(true);
|
||||
const fee = ref<number>(0);
|
||||
const round = ref<number>(1);
|
||||
const yearly = ref<number>(new Date().getFullYear());
|
||||
const dateRegister = ref<[Date, Date]>([new Date(), new Date()]); //วันที่สมัคร
|
||||
const datePayment = ref<[Date, Date]>([new Date(), new Date()]); //วันที่จ่ายเงิน
|
||||
const dateAnnouncement = ref<[Date, Date]>([new Date(), new Date()]); //วันที่ประกาศ
|
||||
const dateExam = ref<Date>(new Date()); //วันที่สอบ
|
||||
const dateAnnounce = ref<Date>(new Date()); //วันที่ประกาศผล
|
||||
const positionPathOptions = ref<DataOption[]>([]);
|
||||
const organizationShortName = ref<DataOption>({ id: "", name: "" });
|
||||
const organizationName = ref<DataOption>({ id: "", name: "" });
|
||||
const organizationNameOptions = ref<DataOption[]>([]);
|
||||
const examTypeOptions = [
|
||||
{ name: "ทั่วไป", id: "normol" },
|
||||
{ name: "แพทย์", id: "docter" },
|
||||
];
|
||||
const category = ref<string>("");
|
||||
const categoryOptions = [
|
||||
{ name: "สำนักอนามัย", id: "hygiene" },
|
||||
{ name: "สำนักการแพทย์", id: "physician" },
|
||||
{ name: "สำนักผังเมือง", id: "city" },
|
||||
{ name: "สำนักวัฒนธรรม กีฬา และการท่องเที่ยว", id: "culture" },
|
||||
];
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
const fileDocs = ref<UploadType[]>([]);
|
||||
const fileImgDataUpload = ref<File[]>([]);
|
||||
const fileImgs = ref<UploadType[]>([]);
|
||||
const id = ref<string>("");
|
||||
const edit = ref<boolean>(false);
|
||||
|
||||
watch(organizationShortName, (count: DataOption, prevCount: DataOption) => {
|
||||
organizationNameOptions.value = [];
|
||||
});
|
||||
|
||||
watch(organizationName, (count: DataOption, prevCount: DataOption) => {
|
||||
positionPathOptions.value = [];
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
if (route.params.id != undefined) {
|
||||
edit.value = true;
|
||||
id.value = route.params.id.toString();
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
} else {
|
||||
edit.value = false;
|
||||
}
|
||||
});
|
||||
|
||||
const clickBack = () => {
|
||||
router.push({ name: "disablePeriod" });
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.getDisablePeriodById(id.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
id.value = data.id;
|
||||
name.value = data.name;
|
||||
round.value = data.round;
|
||||
yearly.value = data.year;
|
||||
fee.value = data.fee;
|
||||
dateAnnouncement.value = [
|
||||
new Date(data.announcementStartDate),
|
||||
new Date(data.announcementEndDate),
|
||||
];
|
||||
dateExam.value = new Date(data.examDate);
|
||||
dateRegister.value = [
|
||||
new Date(data.registerStartDate),
|
||||
new Date(data.registerEndDate),
|
||||
];
|
||||
datePayment.value = [
|
||||
new Date(data.paymentStartDate),
|
||||
new Date(data.paymentEndDate),
|
||||
];
|
||||
editor.value = data.detail;
|
||||
note.value = data.note;
|
||||
dateAnnounce.value = new Date(data.announcementDate);
|
||||
fileDocs.value = data.documents;
|
||||
fileImgs.value = data.images;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const updateYear = async (e: number) => {
|
||||
yearly.value = e;
|
||||
};
|
||||
|
||||
const checkSave = async () => {
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then(async (success) => {
|
||||
if (success) {
|
||||
if (edit.value) {
|
||||
await editData(id.value);
|
||||
} else {
|
||||
await addData();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const sendData = () => {
|
||||
const valueData: RequestPeriodDisable = {
|
||||
announcementEndDate: dateToISO(dateAnnouncement.value[1]),
|
||||
announcementStartDate: dateToISO(dateAnnouncement.value[0]),
|
||||
examDate: dateToISO(dateExam.value),
|
||||
detail: editor.value,
|
||||
fee: fee.value,
|
||||
id: "",
|
||||
name: name.value,
|
||||
note: note.value,
|
||||
paymentEndDate: dateToISO(datePayment.value[1]),
|
||||
paymentStartDate: dateToISO(datePayment.value[0]),
|
||||
registerEndDate: dateToISO(dateRegister.value[1]),
|
||||
registerStartDate: dateToISO(dateRegister.value[0]),
|
||||
round: round.value,
|
||||
year: yearly.value,
|
||||
announcementDate: dateToISO(dateAnnounce.value),
|
||||
};
|
||||
return valueData;
|
||||
};
|
||||
|
||||
const addData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.saveDisablePeriod, sendData())
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
id.value = data;
|
||||
success($q, "บันทึกรอบการสอบผู้พิการสำเร็จ");
|
||||
await uploadImgData();
|
||||
await uploadDocData();
|
||||
clickBack();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const editData = async (id: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.editDisablePeriod(id), sendData())
|
||||
.then(async () => {
|
||||
success($q, "แก้ไขรอบการสอบผู้พิการสำเร็จ");
|
||||
await uploadImgData();
|
||||
await uploadDocData();
|
||||
clickBack();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fileUploadImg = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
fileImgDataUpload.value.push(file);
|
||||
});
|
||||
};
|
||||
|
||||
const fileRemoveImg = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
const index = fileImgDataUpload.value.findIndex(
|
||||
(x: any) => x.__key == file.__key
|
||||
);
|
||||
if (index > -1) {
|
||||
fileImgDataUpload.value.splice(index, 1);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const uploadImgData = async () => {
|
||||
if (fileImgDataUpload.value.length > 0) {
|
||||
const formData = new FormData();
|
||||
fileImgDataUpload.value.forEach((file: any) => {
|
||||
formData.append("", file);
|
||||
});
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.periodExamImg(id.value), formData)
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const deleteDocData = async (docId: string) => {
|
||||
const params = {
|
||||
documentId: docId,
|
||||
};
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.periodExamDoc(id.value.toString()), {
|
||||
params,
|
||||
})
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await fetchData();
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadData = async (path: string) => {
|
||||
window.open(path);
|
||||
};
|
||||
|
||||
const fileUploadDoc = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
fileDocDataUpload.value.push(file);
|
||||
});
|
||||
};
|
||||
|
||||
const fileRemoveDoc = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
const index = fileDocDataUpload.value.findIndex(
|
||||
(x: any) => x.__key == file.__key
|
||||
);
|
||||
if (index > -1) {
|
||||
fileDocDataUpload.value.splice(index, 1);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const uploadDocData = async () => {
|
||||
const formData = new FormData();
|
||||
if (fileDocDataUpload.value.length > 0) {
|
||||
fileDocDataUpload.value.forEach((file: any) => {
|
||||
formData.append("", file);
|
||||
});
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.periodExamDoc(id.value), formData)
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
} else {
|
||||
clickBack();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* แปลงช่วงวันที่ถ้า2ค่าเป็นวันเดียวกันจะโชววันเดียวแต่ถ้าไม่เท่ากันจะแสดงเป็นช่วง
|
||||
* @param val ช่วงวันที่
|
||||
*/
|
||||
const dateThaiRange = (val: [Date, Date]) => {
|
||||
if (val === null) {
|
||||
return "";
|
||||
} else if (date2Thai(val[0], true) === date2Thai(val[1], true)) {
|
||||
return `${date2Thai(val[0], true)}`;
|
||||
} else {
|
||||
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
345
src/modules/03_recruiting/views/02_qualify/ExamForm.vue
Normal file
345
src/modules/03_recruiting/views/02_qualify/ExamForm.vue
Normal file
|
|
@ -0,0 +1,345 @@
|
|||
<!-- step กรอกข้อมูล -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
ตรวจสอบคุณสมบัติผู้สมัครสอบรอบคัดเลือก
|
||||
<q-space />
|
||||
<q-btn
|
||||
color="blue"
|
||||
flat
|
||||
round
|
||||
icon="mdi-content-save-outline"
|
||||
@click="clickSave"
|
||||
v-if="status == 'checkRegister' || status == 'payment'"
|
||||
class="q-mr-sm bg-blue-1"
|
||||
outline
|
||||
>
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
color="primary"
|
||||
flat
|
||||
round
|
||||
icon="check"
|
||||
class="bg-teal-1"
|
||||
@click="modalCheck"
|
||||
v-if="status == 'checkRegister'"
|
||||
>
|
||||
<q-tooltip>ตรวจสอบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-card class="q-pa-md">
|
||||
<div>
|
||||
<Profile
|
||||
:status="status"
|
||||
v-model:formInformation="formInformation"
|
||||
v-model:formAddress="formAddress"
|
||||
v-model:formFamily="formFamily"
|
||||
v-model:formOccupation="formOccupation"
|
||||
/>
|
||||
</div>
|
||||
</q-card>
|
||||
<q-dialog :model-value="modal" persistent>
|
||||
<q-card style="min-width: 700px">
|
||||
<q-form ref="myForm">
|
||||
<div class="row items-center q-pa-sm">
|
||||
<div class="row">
|
||||
<div class="text-bold">ตรวจสอบคุณสมบัติ</div>
|
||||
</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
size="12px"
|
||||
@click="close"
|
||||
/>
|
||||
</div>
|
||||
<q-separator />
|
||||
<!-- header บน table มี ค้นหา แสดงคอลัมน์ (status nornmalData true) -->
|
||||
<div class="col-12 row q-pa-md">
|
||||
<q-radio
|
||||
v-model="approve"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="1"
|
||||
label="ผ่านการตรวจสอบคุณสมบัติ"
|
||||
class="col-12"
|
||||
@update:modelValue="reason = ''"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="approve"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="2"
|
||||
label="ไม่ผ่านการตรวจสอบคุณสมบัติ(ผู้สมัครแก้ข้อมูลสมัคร)"
|
||||
class="col-12"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="approve"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="3"
|
||||
label="ไม่ผ่านการตรวจสอบคุณสมบัติ"
|
||||
class="col-12"
|
||||
/>
|
||||
<q-input
|
||||
class="col-12 q-px-sm q-pt-sm"
|
||||
outlined
|
||||
stack-label
|
||||
v-model="reason"
|
||||
label="หมายเหตุ"
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
v-if="approve == '2' || approve == '3'"
|
||||
type="textarea"
|
||||
></q-input>
|
||||
</div>
|
||||
<q-separator />
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSave"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึกตรวจสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import Profile from "@/modules/03_recruiting/components/Profile.vue";
|
||||
import {
|
||||
defaultInformation,
|
||||
defaultOccupation,
|
||||
defaultAddress,
|
||||
defaultFamily,
|
||||
} from "@/modules/03_recruiting/interface/index/Main";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useQuasar } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const router = useRouter();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { success, dateToISO, messageError } = mixin;
|
||||
const route = useRoute();
|
||||
const examId = ref<string>(route.params.examId.toString());
|
||||
const candidateId = ref<string>(route.params.candidateId.toString());
|
||||
const modal = ref<boolean>(false);
|
||||
const approve = ref<string>("1");
|
||||
const reason = ref<string>("");
|
||||
const formInformation = ref<any>({});
|
||||
const formAddress = ref<any>({});
|
||||
const formFamily = ref<any>({});
|
||||
const formOccupation = ref<any>({});
|
||||
const status = ref<string>("");
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchStatus();
|
||||
});
|
||||
|
||||
const fetchStatus = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.candidateId(candidateId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
status.value = data.status;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const confirm = async (status: boolean, reason: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.candidateCheckRegister(candidateId.value), {
|
||||
status: status,
|
||||
reason: reason,
|
||||
})
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
success($q, "ตรวจสอบข้อมูลสำเร็จ");
|
||||
router.push(`/qualify/manage/${examId.value}`);
|
||||
});
|
||||
};
|
||||
|
||||
const reject = async (reason: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.candidateRejectRegister(candidateId.value), {
|
||||
reason: reason,
|
||||
})
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
success($q, "ตรวจสอบข้อมูลสำเร็จ");
|
||||
router.push(`/qualify/manage/${examId.value}`);
|
||||
});
|
||||
};
|
||||
|
||||
const checkSave = () => {
|
||||
if (approve.value == "1") {
|
||||
confirm(true, "");
|
||||
} else if (approve.value == "2") {
|
||||
confirm(false, reason.value);
|
||||
} else {
|
||||
reject(reason.value);
|
||||
}
|
||||
};
|
||||
|
||||
const modalCheck = () => {
|
||||
modal.value = true;
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
modal.value = false;
|
||||
};
|
||||
|
||||
const clickSave = async () => {
|
||||
await formInformation.value.validate().then(async (suc: boolean) => {
|
||||
if (suc) {
|
||||
await formAddress.value.validate().then(async (suc: boolean) => {
|
||||
if (suc) {
|
||||
await formFamily.value.validate().then(async (suc: boolean) => {
|
||||
if (suc) {
|
||||
await formOccupation.value
|
||||
.validate()
|
||||
.then(async (suc: boolean) => {
|
||||
if (suc) {
|
||||
const type = ref<string | null>("");
|
||||
if (defaultOccupation.value.status == "official")
|
||||
type.value = defaultOccupation.value.official;
|
||||
if (defaultOccupation.value.status == "personnel")
|
||||
type.value = defaultOccupation.value.personnel;
|
||||
if (defaultOccupation.value.status == "officialsOther")
|
||||
type.value = defaultOccupation.value.officialsOther;
|
||||
if (defaultOccupation.value.status == "employee")
|
||||
type.value = defaultOccupation.value.employee;
|
||||
if (defaultOccupation.value.status == "other")
|
||||
type.value = defaultOccupation.value.other;
|
||||
loaderPage(true);
|
||||
await http
|
||||
.post(config.API.candidateId(candidateId.value), {
|
||||
prefixId: defaultInformation.value.prefixId,
|
||||
lastName: defaultInformation.value.lastname,
|
||||
citizenProvinceId: defaultInformation.value.provinceId,
|
||||
citizenDistrictId: defaultInformation.value.districtId,
|
||||
dateOfBirth:
|
||||
defaultInformation.value.birthDate == null
|
||||
? null
|
||||
: dateToISO(defaultInformation.value.birthDate),
|
||||
citizenDate:
|
||||
defaultInformation.value.cardIdDate == null
|
||||
? null
|
||||
: dateToISO(defaultInformation.value.cardIdDate),
|
||||
citizenId: defaultInformation.value.cardid,
|
||||
firstName: defaultInformation.value.firstname,
|
||||
relationshipId: defaultInformation.value.relationshipId,
|
||||
nationality: defaultInformation.value.nationality,
|
||||
email: defaultInformation.value.email,
|
||||
mobilePhone: defaultInformation.value.phone,
|
||||
telephone: defaultInformation.value.tel,
|
||||
knowledge: defaultInformation.value.knowledge,
|
||||
occupationType: defaultOccupation.value.status,
|
||||
occupationCompany: defaultOccupation.value.company,
|
||||
occupationDepartment:
|
||||
defaultOccupation.value.department,
|
||||
occupationEmail: defaultOccupation.value.email,
|
||||
occupationTelephone: defaultOccupation.value.tel,
|
||||
occupationPosition: type.value,
|
||||
registAddress: defaultAddress.value.address,
|
||||
currentAddress: defaultAddress.value.addressC,
|
||||
registProvinceId: defaultAddress.value.provinceId,
|
||||
currentProvinceId: defaultAddress.value.provinceIdC,
|
||||
registDistrictId: defaultAddress.value.districtId,
|
||||
currentDistrictId: defaultAddress.value.districtIdC,
|
||||
registSubDistrictId: defaultAddress.value.subdistrictId,
|
||||
currentSubDistrictId:
|
||||
defaultAddress.value.subdistrictIdC,
|
||||
registZipCode: defaultAddress.value.code,
|
||||
currentZipCode: defaultAddress.value.codeC,
|
||||
registSame:
|
||||
defaultAddress.value.same == "1"
|
||||
? true
|
||||
: defaultAddress.value.same == "0"
|
||||
? false
|
||||
: null,
|
||||
marryPrefixId: defaultFamily.value.prefixIdC,
|
||||
marryFirstName: defaultFamily.value.firstnameC,
|
||||
marryLastName: defaultFamily.value.lastnameC,
|
||||
marryOccupation: defaultFamily.value.occupationC,
|
||||
marryNationality: defaultFamily.value.nationalityC,
|
||||
fatherPrefixId: defaultFamily.value.prefixIdM,
|
||||
fatherFirstName: defaultFamily.value.firstnameM,
|
||||
fatherLastName: defaultFamily.value.lastnameM,
|
||||
fatherOccupation: defaultFamily.value.occupationM,
|
||||
fatherNationality: defaultFamily.value.nationalityM,
|
||||
motherPrefixId: defaultFamily.value.prefixIdF,
|
||||
motherFirstName: defaultFamily.value.firstnameF,
|
||||
motherLastName: defaultFamily.value.lastnameF,
|
||||
motherOccupation: defaultFamily.value.occupationF,
|
||||
motherNationality: defaultFamily.value.nationalityF,
|
||||
marry:
|
||||
defaultFamily.value.same == "1"
|
||||
? true
|
||||
: defaultFamily.value.same == "0"
|
||||
? false
|
||||
: null,
|
||||
})
|
||||
.then(async () => {
|
||||
success($q, "บันทึกข้อมูลส่วนตัวสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
245
src/modules/03_recruiting/views/02_qualify/Manage.vue
Normal file
245
src/modules/03_recruiting/views/02_qualify/Manage.vue
Normal file
|
|
@ -0,0 +1,245 @@
|
|||
<!-- page:จัดการรอบการสอบ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
จัดการรายชื่อคัดเลือก
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm">
|
||||
<data-table
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:pagination="initialPagination"
|
||||
:nornmalData="true"
|
||||
:paging="true"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="viewDetail(props.row)"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'yearly'">
|
||||
{{ col.value + 543 }}
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.name == 'dateRegister' ||
|
||||
col.name == 'datePayment' ||
|
||||
col.name == 'dateAnnouncement'
|
||||
"
|
||||
>
|
||||
{{ dateThaiRange(col.value) }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</data-table>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import type { RequestPeriodExam } from "@/modules/03_recruiting/interface/request/Period";
|
||||
import type { ResponsePeriodExam } from "@/modules/03_recruiting/interface/response/Period";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, messageError } = mixin;
|
||||
const rows = ref<ResponsePeriodExam[]>([]);
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
const filter = ref<string>(""); //search data table
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"yearly",
|
||||
"name",
|
||||
"document",
|
||||
"dateAnnouncement",
|
||||
"dateRegister",
|
||||
"datePayment",
|
||||
"fee",
|
||||
]);
|
||||
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "yearly",
|
||||
align: "left",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "yearly",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อรอบการคัดเลือก",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fee",
|
||||
align: "left",
|
||||
label: "ค่าธรรมเนียม",
|
||||
sortable: true,
|
||||
field: "fee",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "dateAnnouncement",
|
||||
align: "left",
|
||||
label: "วันที่สมัคร",
|
||||
sortable: true,
|
||||
field: "dateAnnouncement",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "dateRegister",
|
||||
align: "left",
|
||||
label: "วันที่ชำระเงิน",
|
||||
sortable: true,
|
||||
field: "dateRegister",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "datePayment",
|
||||
align: "left",
|
||||
label: "วันที่ประกาศ",
|
||||
sortable: true,
|
||||
field: "datePayment",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.periodExamType("exam"))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((r: RequestPeriodExam) => {
|
||||
rows.value.push({
|
||||
id: r.id,
|
||||
name: r.name,
|
||||
checkDocument: r.checkDocument,
|
||||
checkDisability: r.checkDisability,
|
||||
round: r.round,
|
||||
yearly: r.year,
|
||||
fee: r.fee,
|
||||
announcementExam: r.announcementExam,
|
||||
dateAnnounce: new Date(r.announcementDate),
|
||||
dateAnnouncement: [
|
||||
new Date(r.announcementStartDate),
|
||||
new Date(r.announcementEndDate),
|
||||
],
|
||||
dateRegister: [
|
||||
new Date(r.registerStartDate),
|
||||
new Date(r.registerEndDate),
|
||||
],
|
||||
dateExam: new Date(r.examDate),
|
||||
datePayment: [
|
||||
new Date(r.paymentStartDate),
|
||||
new Date(r.paymentEndDate),
|
||||
],
|
||||
organizationName: {
|
||||
id: r.organizationId,
|
||||
name: r.organizationName,
|
||||
},
|
||||
organizationShortName: {
|
||||
id: r.organizationCodeId,
|
||||
name: r.organizationCodeName,
|
||||
},
|
||||
positionExam: [],
|
||||
pay: r.bankExam.length > 0 ? "payment2" : "payment1",
|
||||
bankExam: [],
|
||||
editor: r.detail,
|
||||
note: r.note,
|
||||
category: r.category,
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const viewDetail = (row: any) => {
|
||||
router.push(`/qualify/manage/${row.id}`);
|
||||
};
|
||||
|
||||
/**
|
||||
* แปลงช่วงวันที่ถ้า2ค่าเป็นวันเดียวกันจะโชววันเดียวแต่ถ้าไม่เท่ากันจะแสดงเป็นช่วง
|
||||
* @param val ช่วงวันที่
|
||||
*/
|
||||
const dateThaiRange = (val: [Date, Date]) => {
|
||||
if (val === null) {
|
||||
return "";
|
||||
} else if (date2Thai(val[0], true) === date2Thai(val[1], true)) {
|
||||
return `${date2Thai(val[0], true)}`;
|
||||
} else {
|
||||
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
386
src/modules/03_recruiting/views/02_qualify/Payment.vue
Normal file
386
src/modules/03_recruiting/views/02_qualify/Payment.vue
Normal file
|
|
@ -0,0 +1,386 @@
|
|||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
ตรวจสอบการชำระเงิน
|
||||
</div>
|
||||
<q-list bordered class="col-12 rounded-borders" v-if="bank.length > 0">
|
||||
<q-item class="q-pa-md">
|
||||
<q-item-section avatar>
|
||||
<q-icon name="mdi-cash" color="positive" size="30px" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<div class="row">
|
||||
<q-item-label class="text-weight-medium text-subtitle1 q-pl-sm"
|
||||
>ชำระเงินค่าสมัครสอบผ่านสำนัก/หน่วยงาน</q-item-label
|
||||
>
|
||||
<q-space />
|
||||
<q-btn color="primary" icon="check" @click="modalCheck"
|
||||
>ตรวจสอบข้อมูล
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-slide-transition :duration="100" class="">
|
||||
<div class="q-pa-md bg-grey-1">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-xs-12 col-sm-7">
|
||||
<q-card
|
||||
bordered
|
||||
class="items-start q-pa-md row q-mb-sm"
|
||||
style="height: 300px"
|
||||
>
|
||||
<div class="row col-12">
|
||||
<div class="col-12" v-for="item in bank" :key="item.id">
|
||||
<div class="row q-pl-md col-12">
|
||||
<div class="q-pb-xs col-4">
|
||||
<span class="text-weight-medium">ธนาคาร :</span>
|
||||
<span class="text-blue q-pl-xs">{{ item.bankName }}</span>
|
||||
</div>
|
||||
<div class="q-pb-xs col-4">
|
||||
<span class="text-weight-medium">ชื่อบัญชี :</span>
|
||||
<span class="text-blue q-pl-xs">{{
|
||||
item.accountName
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="q-pb-xs col-4">
|
||||
<span class="text-weight-medium">เลขบัญชี :</span>
|
||||
<span class="text-blue q-pl-xs">
|
||||
{{ item.accountNumber }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator class="q-my-md" />
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div>
|
||||
<q-card bordered class="q-pa-md">
|
||||
<div class="q-pb-sm">
|
||||
<span class="text-weight-medium">รหัสใบสั่งซื้อ :</span>
|
||||
<span class="text-blue q-pl-sm">12837495985900</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-weight-medium">ยอดสุทธิ (บาท) :</span>
|
||||
<span class="text-blue q-pl-sm text-bold">{{
|
||||
fee
|
||||
}}</span>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-5">
|
||||
<label class="col-12 row">
|
||||
<q-img
|
||||
src="@/assets/ex_slip.jpeg"
|
||||
fit="contain"
|
||||
style="min-height: 300px; max-height: 300px"
|
||||
class="col-12 bg-white"
|
||||
v-if="img == ''"
|
||||
>
|
||||
</q-img>
|
||||
<q-img
|
||||
:src="img"
|
||||
fit="contain"
|
||||
style="min-height: 300px; max-height: 300px"
|
||||
class="col-12 bg-white"
|
||||
@click="openImg"
|
||||
v-else
|
||||
>
|
||||
</q-img>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-slide-transition>
|
||||
</q-list>
|
||||
<q-list bordered class="col-12 rounded-borders" v-else>
|
||||
<q-item class="q-pa-md">
|
||||
<q-avatar size="32px">
|
||||
<q-img src="@/assets/krungthai.png" class="col-12" />
|
||||
</q-avatar>
|
||||
<q-item-section>
|
||||
<div class="row">
|
||||
<q-item-label class="text-weight-medium text-subtitle1 q-pl-sm">
|
||||
ชำระเงินค่าสมัครสอบผ่านธนาคารกรุงไทย</q-item-label
|
||||
>
|
||||
<q-space />
|
||||
<q-btn color="primary" icon="check" @click="modalCheck"
|
||||
>ตรวจสอบข้อมูล
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-slide-transition :duration="100">
|
||||
<div class="q-pa-md bg-grey-1">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-xs-12 col-sm-7">
|
||||
<q-card bordered class="q-pa-md">
|
||||
<div class="q-pb-sm">
|
||||
<span class="text-weight-medium">รหัสใบสั่งซื้อ :</span>
|
||||
<span class="text-blue q-pl-sm">12837495985900</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="text-weight-medium">ยอดสุทธิ (บาท) :</span>
|
||||
<span class="text-blue q-pl-sm text-bold">{{ fee }}</span>
|
||||
</div>
|
||||
</q-card>
|
||||
<div class="q-pt-md q-pb-xs text-bold">ธนาคารกรุงไทย</div>
|
||||
<div class="q-pb-md">สอดบัตร ATM กดรหัสและเลือกรายการ</div>
|
||||
<ul class="q-gutter-y-sm">
|
||||
<li>ขั้นที่ 1 บริการอื่นๆ</li>
|
||||
<li>ขั้นที่ 2 ชำระค่าบริการ</li>
|
||||
<li>ขั้นที่ 3 ระบุรหัสบริษัท</li>
|
||||
<li>
|
||||
ขั้นที่ 4 เลือกบัญชีผู้ชำระเงิน คือ
|
||||
บัญชีของตัวท่านว่าเป็นบัญชีออมทรัพย์ หรือ กระแสรายวัน
|
||||
</li>
|
||||
<li>
|
||||
ขั้นที่ 5 ใส่รหัสบริษัทฯ คือ
|
||||
<span class="text-blue text-bold">2111</span> และ ใส่ Ref No.1
|
||||
ขั้นด้วยเครื่องหมายจุด ( . ) แล้วตามด้วย Ref No.2 (ดูใน
|
||||
"ใบแจ้งการชำระเงิน")
|
||||
</li>
|
||||
<li>
|
||||
ยกตัวอย่างเช่น ถ้า Ref No.1 คือ 012345 และ Ref No.2 คือ
|
||||
308833ต้องใส่ เป็น 012345.308833
|
||||
</li>
|
||||
<li>ขั้นที่ 6 ใส่จำนวนเงินที่ชำระรวมหน่วยสตางค์</li>
|
||||
<li>ขั้นที่ 7 ตรวจสอบรายการ</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-5">
|
||||
<label for="file-upload" class="col-12 row">
|
||||
<q-img
|
||||
src="@/assets/ex_slip.jpeg"
|
||||
fit="contain"
|
||||
style="min-height: 300px; max-height: 300px"
|
||||
class="col-12 bg-white"
|
||||
v-if="img == ''"
|
||||
>
|
||||
</q-img>
|
||||
<q-img
|
||||
:src="img"
|
||||
fit="contain"
|
||||
style="min-height: 300px; max-height: 300px"
|
||||
class="col-12 bg-white"
|
||||
v-else
|
||||
@click="openImg"
|
||||
>
|
||||
</q-img>
|
||||
</label>
|
||||
<q-file
|
||||
id="file-upload"
|
||||
v-model="filePayment"
|
||||
dense
|
||||
label="อัปโหลดหลักฐานชำระเงิน"
|
||||
outlined
|
||||
use-chips
|
||||
multiple
|
||||
class="q-pl-sm"
|
||||
v-if="status == 'payment' || status == 'rejectPayment'"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-slide-transition>
|
||||
</q-list>
|
||||
|
||||
<q-dialog :model-value="modal" persistent>
|
||||
<q-card style="min-width: 700px">
|
||||
<q-form ref="myForm">
|
||||
<div class="row items-center q-pa-sm">
|
||||
<div class="row">
|
||||
<div class="text-bold">ตรวจสอบการชำระเงิน</div>
|
||||
</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
size="12px"
|
||||
@click="close"
|
||||
/>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="q-pa-sm">
|
||||
<div class="col-12 row q-pa-md">
|
||||
<q-radio
|
||||
v-model="approve"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="1"
|
||||
label="ผ่านการตรวจสอบคุณสมบัติ"
|
||||
dense
|
||||
class="col-12"
|
||||
@update:modelValue="reason = ''"
|
||||
/>
|
||||
<q-radio
|
||||
v-model="approve"
|
||||
checked-icon="task_alt"
|
||||
unchecked-icon="panorama_fish_eye"
|
||||
val="2"
|
||||
label="ไม่ผ่านการตรวจสอบคุณสมบัติ(ผู้สมัครแก้ข้อมูลสมัคร)"
|
||||
dense
|
||||
class="col-12"
|
||||
/>
|
||||
<q-input
|
||||
class="col-12"
|
||||
outlined
|
||||
v-model="reason"
|
||||
dense
|
||||
lazy-rules
|
||||
autofocus
|
||||
hide-bottom-space
|
||||
v-if="approve == '2'"
|
||||
type="textarea"
|
||||
></q-input>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSave"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึกตรวจสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const filePayment = ref<File[]>([]);
|
||||
const bank = ref<any>([]);
|
||||
const fee = ref<number>();
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { success, messageError } = mixin;
|
||||
const route = useRoute();
|
||||
const examId = ref<string>(route.params.examId.toString());
|
||||
const candidateId = ref<string>(route.params.candidateId.toString());
|
||||
const modal = ref<boolean>(false);
|
||||
const approve = ref<string>("1");
|
||||
const reason = ref<string>("");
|
||||
const img = ref<string>("");
|
||||
const props = defineProps({
|
||||
fetchStep: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
status: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchPaymentExam();
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.candidatePayment(candidateId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
img.value = data;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchPaymentExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.periodExamPayment(examId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
bank.value = data.bankExam;
|
||||
fee.value = data.fee;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const confirm = async (status: boolean, reason: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(config.API.candidateCheckPayment(candidateId.value), {
|
||||
status: status,
|
||||
reason: reason,
|
||||
})
|
||||
.then((res) => {})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
success($q, "ตรวจสอบข้อมูลชำระเงินสำเร็จ");
|
||||
router.push(`/qualify/manage/${examId.value}`);
|
||||
});
|
||||
};
|
||||
|
||||
const checkSave = () => {
|
||||
if (approve.value == "1") {
|
||||
confirm(true, "");
|
||||
} else {
|
||||
confirm(false, reason.value);
|
||||
}
|
||||
};
|
||||
|
||||
const openImg = () => {
|
||||
window.open(img.value);
|
||||
};
|
||||
|
||||
const modalCheck = () => {
|
||||
modal.value = true;
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
modal.value = false;
|
||||
};
|
||||
</script>
|
||||
368
src/modules/03_recruiting/views/02_qualify/Period.vue
Normal file
368
src/modules/03_recruiting/views/02_qualify/Period.vue
Normal file
|
|
@ -0,0 +1,368 @@
|
|||
<!-- page:จัดการรอบการสอบ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
จัดการรอบคัดเลือก
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
|
||||
<div>
|
||||
<Table
|
||||
style="max-height: 80vh"
|
||||
:rows="examData"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:pagination="initialPagination"
|
||||
:nornmalData="true"
|
||||
:add="clickAdd"
|
||||
:paging="true"
|
||||
:titleText="''"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="clickEdit(props.row)"
|
||||
>
|
||||
<div v-if="col.name == 'no'" class="table_ellipsis2">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'yearly'" class="table_ellipsis2">
|
||||
{{ col.value + 543 }}
|
||||
</div>
|
||||
<div
|
||||
v-else-if="
|
||||
col.name == 'dateRegister' ||
|
||||
col.name == 'datePayment' ||
|
||||
col.name == 'dateAnnouncement'
|
||||
"
|
||||
class="table_ellipsis2"
|
||||
>
|
||||
{{ dateThaiRange(col.value) }}
|
||||
</div>
|
||||
<div
|
||||
v-else-if="col.name == 'announcementExam'"
|
||||
class="table_ellipsis2"
|
||||
>
|
||||
{{ col.value ? "ข่าวการสอบ" : "ข่าวทั่วไป" }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'category'" class="table_ellipsis2">
|
||||
{{ typeCategoryExam(col.value) }}
|
||||
</div>
|
||||
<div v-else class="table_ellipsis2">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="clickDelete(props.row.id)"
|
||||
icon="mdi-delete"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type {
|
||||
RequestPeriodExam,
|
||||
RequestPosition,
|
||||
RequestPayment,
|
||||
} from "@/modules/03_recruiting/interface/request/Period";
|
||||
import type {
|
||||
ResponsePeriodExam,
|
||||
ResponsePosition,
|
||||
ResponsePayment,
|
||||
} from "@/modules/03_recruiting/interface/response/Period";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import Table from "@/modules/03_recruiting/components/Table.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
const router = useRouter();
|
||||
const { date2Thai, success, typeCategoryExam, messageError } = mixin;
|
||||
const filter = ref<string>(""); //search data table
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
const examData = ref<ResponsePeriodExam[]>([]);
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"announcementExam",
|
||||
"yearly",
|
||||
"category",
|
||||
"name",
|
||||
"document",
|
||||
"dateAnnouncement",
|
||||
"dateRegister",
|
||||
"datePayment",
|
||||
"fee",
|
||||
]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "center",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "announcementExam",
|
||||
align: "left",
|
||||
label: "ประเภทการประกาศ",
|
||||
sortable: true,
|
||||
field: "announcementExam",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "yearly",
|
||||
align: "center",
|
||||
label: "ปีงบประมาณ",
|
||||
sortable: true,
|
||||
field: "yearly",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "category",
|
||||
align: "left",
|
||||
label: "สังกัด",
|
||||
sortable: true,
|
||||
field: "category",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "รายการประกาศ",
|
||||
sortable: true,
|
||||
field: "name",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fee",
|
||||
align: "right",
|
||||
label: "ค่าธรรมเนียม",
|
||||
sortable: true,
|
||||
field: "fee",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "dateAnnouncement",
|
||||
align: "left",
|
||||
label: "วันที่สมัคร",
|
||||
sortable: true,
|
||||
field: "dateAnnouncement",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "dateRegister",
|
||||
align: "left",
|
||||
label: "วันที่ชำระเงิน",
|
||||
sortable: true,
|
||||
field: "dateRegister",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "datePayment",
|
||||
align: "left",
|
||||
label: "วันที่ประกาศ",
|
||||
sortable: true,
|
||||
field: "datePayment",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.periodExamType("all"))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let result: ResponsePeriodExam[] = [];
|
||||
if (data.length > 0) {
|
||||
data.map((r: RequestPeriodExam) => {
|
||||
const positionData: ResponsePosition[] = [];
|
||||
r.positionExam.map((r: RequestPosition) => {
|
||||
positionData.push({
|
||||
id: r.id,
|
||||
position: {
|
||||
id: r.positionId,
|
||||
name: r.positionName,
|
||||
},
|
||||
type: {
|
||||
id: r.typeId,
|
||||
name: r.typeName,
|
||||
},
|
||||
});
|
||||
});
|
||||
const bankData: ResponsePayment[] = [];
|
||||
r.bankExam.map((r: RequestPayment) => {
|
||||
bankData.push({
|
||||
id: r.id,
|
||||
accountNumber: r.accountNumber,
|
||||
bankName: r.bankName,
|
||||
accountName: r.accountName,
|
||||
});
|
||||
});
|
||||
result.push({
|
||||
id: r.id,
|
||||
dateAnnounce: new Date(r.announcementDate),
|
||||
announcementExam: r.announcementExam,
|
||||
name: r.name,
|
||||
checkDocument: r.checkDocument,
|
||||
checkDisability: r.checkDisability,
|
||||
round: r.round,
|
||||
yearly: r.year,
|
||||
fee: r.fee,
|
||||
dateAnnouncement: [
|
||||
new Date(r.announcementStartDate),
|
||||
new Date(r.announcementEndDate),
|
||||
],
|
||||
dateExam: new Date(r.examDate),
|
||||
dateRegister: [
|
||||
new Date(r.registerStartDate),
|
||||
new Date(r.registerEndDate),
|
||||
],
|
||||
datePayment: [
|
||||
new Date(r.paymentStartDate),
|
||||
new Date(r.paymentEndDate),
|
||||
],
|
||||
organizationName: {
|
||||
id: r.organizationId,
|
||||
name: r.organizationName,
|
||||
},
|
||||
organizationShortName: {
|
||||
id: r.organizationCodeId,
|
||||
name: r.organizationCodeName,
|
||||
},
|
||||
positionExam: positionData,
|
||||
pay: r.bankExam.length > 0 ? "payment2" : "payment1",
|
||||
bankExam: bankData,
|
||||
editor: r.detail,
|
||||
note: r.note,
|
||||
category: r.category,
|
||||
});
|
||||
});
|
||||
}
|
||||
examData.value = result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const clickEdit = (col: ResponsePeriodExam) => {
|
||||
router.push(`/qualify/period/${col.id}`);
|
||||
};
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการลบข้อมูล",
|
||||
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
await deleteData(id);
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
|
||||
const clickAdd = () => {
|
||||
router.push({ name: "qualifyPeriodAdd" });
|
||||
};
|
||||
|
||||
const deleteData = async (id: string) => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.delete(config.API.periodExamId(id))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
loaderPage(false);
|
||||
await fetchData();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* แปลงช่วงวันที่ถ้า2ค่าเป็นวันเดียวกันจะโชววันเดียวแต่ถ้าไม่เท่ากันจะแสดงเป็นช่วง
|
||||
* @param val ช่วงวันที่
|
||||
*/
|
||||
const dateThaiRange = (val: [Date, Date]) => {
|
||||
if (val === null) {
|
||||
return "";
|
||||
} else if (date2Thai(val[0], true) === date2Thai(val[1], true)) {
|
||||
return `${date2Thai(val[0], true)}`;
|
||||
} else {
|
||||
return `${date2Thai(val[0], true)} - ${date2Thai(val[1], true)}`;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
1539
src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue
Normal file
1539
src/modules/03_recruiting/views/02_qualify/PeriodAdd.vue
Normal file
File diff suppressed because it is too large
Load diff
24
src/modules/03_recruiting/views/02_qualify/PeriodStat.vue
Normal file
24
src/modules/03_recruiting/views/02_qualify/PeriodStat.vue
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<!-- page:จัดการรอบการสอบ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
สถิติสมัครคัดเลือก
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-px-md q-py-sm">
|
||||
<iframe
|
||||
:src="panelUrl"
|
||||
style="height: 80vh; width: 100%; border: none; overflow: hidden"
|
||||
></iframe>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import config from "@/app.config";
|
||||
import { ref, onBeforeMount } from "vue";
|
||||
|
||||
const panelUrl = ref<string>("");
|
||||
|
||||
onBeforeMount(async () => {
|
||||
panelUrl.value = config.qualifyExamPanel;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<!-- page:จัดการรอบการสอบ สรรหา -->
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
สถิติสมัครคัดเลือกคนพิการ
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-px-md q-py-sm">
|
||||
<iframe
|
||||
:src="panelUrl"
|
||||
style="height: 80vh; width: 100%; border: none; overflow: hidden"
|
||||
></iframe>
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import config from "@/app.config";
|
||||
import { ref, onBeforeMount } from "vue";
|
||||
|
||||
const panelUrl = ref<string>("");
|
||||
|
||||
onBeforeMount(async () => {
|
||||
panelUrl.value = config.qualifyDisableExamPanel;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
661
src/modules/03_recruiting/views/02_qualify/manageDetail.vue
Normal file
661
src/modules/03_recruiting/views/02_qualify/manageDetail.vue
Normal file
|
|
@ -0,0 +1,661 @@
|
|||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
{{ name }}
|
||||
{{ `ครั้งที่${round}/${yearly == null ? "" : yearly + 543}` }}
|
||||
<q-space />
|
||||
<q-btn
|
||||
@click="visible = !visible"
|
||||
dense
|
||||
round
|
||||
size="13px"
|
||||
:style="
|
||||
visible == false
|
||||
? 'transform: rotate(90deg);transition-duration: 0.8s;'
|
||||
: 'transform: rotate(0);transition-duration: 0.8s;'
|
||||
"
|
||||
icon="mdi-pin"
|
||||
flat
|
||||
></q-btn>
|
||||
</div>
|
||||
<q-slide-transition>
|
||||
<q-card class="row col-12 q-mb-sm" v-show="visible">
|
||||
<div class="col-12 row">
|
||||
<div class="q-py-md row col-12 no-wrap">
|
||||
<!-- การ์ดแสดงจำนวนข้อมูล -->
|
||||
<div class="col-12 row">
|
||||
<div class="text-grey-7 row text-weight-medium col-12 q-pl-md">
|
||||
สรุปจำนวนผู้สมัครคัดเลือก
|
||||
<datepicker
|
||||
class="q-pl-sm"
|
||||
v-model="dateFilter"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
range
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="full-width inputgreen cursor-pointer"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
dense
|
||||
label="วันที่"
|
||||
lazy-rules
|
||||
:model-value="dateThaiRange(dateFilter)"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
<q-btn
|
||||
size="md"
|
||||
icon="mdi-download"
|
||||
round
|
||||
flat
|
||||
color="primary"
|
||||
@click="downloadFileDashboard"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดสรุปข้อมูลสมัครสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="green"
|
||||
@click.stop.prevent="clickCandidateList()"
|
||||
icon="mdi-clipboard-arrow-down"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดรายชื่อผู้มีสิทธิ์สอบ</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="indigo"
|
||||
@click.stop.prevent="clickPassExam()"
|
||||
icon="mdi-clipboard-arrow-down"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดรายชื่อผู้สอบแข่งขันได้</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="row col-12 q-col-gutter-md fit q-pa-md">
|
||||
<div
|
||||
style="width: 25%"
|
||||
v-for="(num, index) in dataNum"
|
||||
:key="index"
|
||||
>
|
||||
<q-card bordered flat class="row fit cardNum items-center">
|
||||
<div class="col-12 row items-center q-pa-sm">
|
||||
<div
|
||||
:class="
|
||||
'col-12 text-h5 text-weight-bold text-' + `${num.color}`
|
||||
"
|
||||
>
|
||||
{{
|
||||
num.count != null
|
||||
? num.count.toLocaleString("en-US")
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="col-12 text-dark ellipsis">
|
||||
{{ num.name }}
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</q-slide-transition>
|
||||
<q-card flat bordered class="col-12 q-pt-sm">
|
||||
<TableCandidate
|
||||
style="max-height: 80vh"
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
v-model:inputvisibleFilter="status"
|
||||
v-model:optionsFilter="optionsStatus"
|
||||
:pagination="initialPagination"
|
||||
:nornmalData="true"
|
||||
:paging="true"
|
||||
:titleText="''"
|
||||
:statusPayment="statusPayment"
|
||||
:setSeat="setSeat"
|
||||
:fetchData="fetchDataCom"
|
||||
:history="true"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="viewDetail(props.row.id, props.row.status)"
|
||||
>
|
||||
<div v-if="col.name == 'no'" class="table_ellipsis">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
<div class="row col-12 items-center">
|
||||
<img
|
||||
v-if="props.row.avatar == ''"
|
||||
src="@/assets/avatar_user.jpg"
|
||||
class="q-mr-sm col-4"
|
||||
style="width: 28px; height: 28px; border-radius: 50%"
|
||||
/>
|
||||
<img
|
||||
v-else
|
||||
:src="props.row.avatar"
|
||||
class="q-mr-sm col-4"
|
||||
style="width: 28px; height: 28px; border-radius: 50%"
|
||||
/>
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.fullname }}
|
||||
</div>
|
||||
<!-- <div class="text-weight-light">
|
||||
{{ props.row.citizenId }}
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'career'">
|
||||
<div class="col-4">
|
||||
{{ props.row.career }}
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.position }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'edu'">
|
||||
<div class="col-4">
|
||||
{{ props.row.edu }}
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.university }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="col.name == 'status'"
|
||||
:class="
|
||||
props.row.status == 'checkRegister' ||
|
||||
props.row.status == 'checkPayment' ||
|
||||
props.row.status == 'checkSeat' ||
|
||||
props.row.status == 'checkPoint'
|
||||
? 'text-blue'
|
||||
: ''
|
||||
"
|
||||
>
|
||||
{{ statusCandidate(props.row.status) }}
|
||||
</div>
|
||||
<div v-else class="table_ellipsis">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
color="primary"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
icon="mdi-file-chart-outline"
|
||||
v-if="props.row.status == 'done'"
|
||||
@click="clickPointRow(props.row)"
|
||||
>
|
||||
<q-tooltip>ผลสอบ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</TableCandidate>
|
||||
</q-card>
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card style="min-width: 550px">
|
||||
<q-card-section class="row items-center q-py-sm">
|
||||
<div class="text-bold">บัตรประจำตัวผู้สอบ</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
v-close-popup
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-section class="row items-center">
|
||||
<div class="col text-dark">
|
||||
<ExamFinished :status="status" :candidateId="candidateId" />
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import TableCandidate from "@/modules/03_recruiting/components/TableCandidate.vue";
|
||||
import ExamFinished from "@/modules/03_recruiting/components/ExamFinished.vue";
|
||||
import type { DataNumObject } from "@/modules/01_metadata/interface/request/Calendar";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { genColor15, dateToISO, date2Thai, messageError } = mixin;
|
||||
const dataStore = useDataStore();
|
||||
const { loaderPage } = dataStore;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const status = ref<string>("all");
|
||||
const filter = ref<string>(""); //search data table
|
||||
const name = ref<string>("");
|
||||
const candidateId = ref<string>("");
|
||||
const dateFilter = ref<[Date, Date]>([new Date(), new Date()]); //วันที่เลือกค้นหา
|
||||
const statusPayment = ref<boolean>(false);
|
||||
const setSeat = ref<boolean>(false);
|
||||
const modal = ref<boolean>(false);
|
||||
const round = ref<number | null>(null);
|
||||
const yearly = ref<number | null>(null);
|
||||
const examId = ref<string>(route.params.examId.toString());
|
||||
const visible = ref(true); //เปิดปิด card สรุปข้อมูล
|
||||
const dataNum = ref<DataNumObject[]>([]); //จำนวนสรุปจำนวนข้อมูลหลัก
|
||||
const rows = ref<any>([]);
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"number",
|
||||
"examIdenNumber",
|
||||
"seatNumber",
|
||||
"resultB",
|
||||
"resultC",
|
||||
"pass",
|
||||
"citizenId",
|
||||
"fullname",
|
||||
"career",
|
||||
"office",
|
||||
"edu",
|
||||
"status",
|
||||
]);
|
||||
const optionsStatus = ref<any>([
|
||||
{
|
||||
id: "all",
|
||||
name: "ทั้งหมด",
|
||||
},
|
||||
{
|
||||
id: "checkRegister",
|
||||
name: "ตรวจสอบข้อมูลสมัครสอบ",
|
||||
},
|
||||
{
|
||||
id: "payment",
|
||||
name: "รอชำระค่าสมัครสอบ",
|
||||
},
|
||||
{
|
||||
id: "checkPayment",
|
||||
name: "ตรวจสอบหลักฐานชำระเงิน",
|
||||
},
|
||||
{
|
||||
id: "rejectPayment",
|
||||
name: "หลักฐานชำระเงินไม่ถูกต้อง",
|
||||
},
|
||||
{
|
||||
id: "checkSeat",
|
||||
name: "จัดที่นั่งสอบ",
|
||||
},
|
||||
{
|
||||
id: "checkPoint",
|
||||
name: "สรุปคะแนนสอบ",
|
||||
},
|
||||
{
|
||||
id: "done",
|
||||
name: "คัดเลือกสำเร็จ",
|
||||
},
|
||||
{
|
||||
id: "waiver",
|
||||
name: "สละสิทธิ์สอบ",
|
||||
},
|
||||
]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "citizenId",
|
||||
align: "left",
|
||||
label: "เลขบัตรประชาชน",
|
||||
sortable: true,
|
||||
field: "citizenId",
|
||||
headerStyle: "font-size: 14px; min-width: 200px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "fullname",
|
||||
align: "left",
|
||||
label: "ชื่อ-สกุล",
|
||||
sortable: true,
|
||||
field: "fullname",
|
||||
headerStyle: "font-size: 14px; min-width: 200px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "number",
|
||||
align: "left",
|
||||
label: "ลำดับที่สอบได้",
|
||||
sortable: true,
|
||||
field: "number",
|
||||
headerStyle: "font-size: 14px;",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "examIdenNumber",
|
||||
align: "left",
|
||||
label: "เลขประจำตัวสอบ",
|
||||
sortable: true,
|
||||
field: "examIdenNumber",
|
||||
headerStyle: "font-size: 14px;",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "seatNumber",
|
||||
align: "left",
|
||||
label: "เลขที่นั่งสอบ",
|
||||
sortable: true,
|
||||
field: "seatNumber",
|
||||
headerStyle: "font-size: 14px;",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "resultB",
|
||||
align: "left",
|
||||
label: "ผลสอบภาค ข",
|
||||
sortable: true,
|
||||
field: "resultB",
|
||||
headerStyle: "font-size: 14px;",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "resultC",
|
||||
align: "left",
|
||||
label: "ผลสอบภาค ค",
|
||||
sortable: true,
|
||||
field: "resultC",
|
||||
headerStyle: "font-size: 14px;",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "pass",
|
||||
align: "left",
|
||||
label: "ผลสอบ",
|
||||
sortable: true,
|
||||
field: "pass",
|
||||
headerStyle: "font-size: 14px;",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
align: "left",
|
||||
label: "สถานะ",
|
||||
sortable: false,
|
||||
field: "status",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, {
|
||||
numeric: true,
|
||||
sensitivity: "base",
|
||||
}),
|
||||
},
|
||||
]);
|
||||
|
||||
watch(status, (count: String, prevCount: String) => {
|
||||
fetchData();
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
loaderPage(false);
|
||||
await fetchDataCom();
|
||||
});
|
||||
|
||||
const clickPassExam = () => {
|
||||
window.open(config.API.exportExamPassExamList(examId.value));
|
||||
};
|
||||
|
||||
const clickCandidateList = () => {
|
||||
window.open(config.API.exportExamCandidateList(examId.value));
|
||||
};
|
||||
|
||||
const fetchDataCom = async () => {
|
||||
await fetchDataSummary();
|
||||
await fetchPeriodExam();
|
||||
await fetchData();
|
||||
};
|
||||
|
||||
const fetchData = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.candidateOfPeriodExam(status.value, examId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rows.value = [];
|
||||
data.map((r: any) => {
|
||||
rows.value.push({
|
||||
id: r.id,
|
||||
fullname: `${r.firstName} ${r.lastName}`,
|
||||
avatar: r.profileImg != null ? r.profileImg.detail : "",
|
||||
citizenId: r.citizenId,
|
||||
number: r.number,
|
||||
examIdenNumber: r.examIdenNumber,
|
||||
seatNumber: r.seatNumber,
|
||||
resultC: r.resultC,
|
||||
resultB: r.resultB,
|
||||
pass: r.pass,
|
||||
email: r.email,
|
||||
status: r.status,
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const fetchPeriodExam = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.periodExamStatus(examId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
name.value = data.name;
|
||||
round.value = data.round;
|
||||
yearly.value = data.year;
|
||||
statusPayment.value = data.status;
|
||||
setSeat.value = data.setSeat;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* สรุปจำนวน
|
||||
*/
|
||||
const fetchDataSummary = async () => {
|
||||
dataNum.value = [];
|
||||
loaderPage(true);
|
||||
await http
|
||||
.get(config.API.countDashbordPeriodExam(examId.value))
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
data.map((e: DataNumObject) => {
|
||||
dataNum.value.push({
|
||||
id: e.id,
|
||||
count: e.count,
|
||||
name: e.name,
|
||||
color: genColor15(e.id),
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
dataNum.value = [];
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadFileDashboard = async () => {
|
||||
loaderPage(true);
|
||||
await http
|
||||
.put(
|
||||
config.API.periodExamDownloadDashboard(examId.value),
|
||||
{
|
||||
dateStart: dateToISO(dateFilter.value[0]),
|
||||
dateEnd: dateToISO(dateFilter.value[1]),
|
||||
responseType: "blob",
|
||||
},
|
||||
{
|
||||
responseType: "blob",
|
||||
}
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data;
|
||||
downloadFilePDF(
|
||||
data,
|
||||
`Candidate_Dashboard_${dateToISO(new Date())}.xlsx`
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
loaderPage(false);
|
||||
});
|
||||
};
|
||||
|
||||
const downloadFilePDF = async (res: string, fileName: string) => {
|
||||
const link = document.createElement("a");
|
||||
link.href = window.URL.createObjectURL(
|
||||
new Blob([res], {
|
||||
type: "application/vnd.ms-excel",
|
||||
})
|
||||
);
|
||||
link.setAttribute("download", fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
};
|
||||
|
||||
/**
|
||||
* สรุปคะแนนสอบ
|
||||
*/
|
||||
const clickPointRow = async (row: any) => {
|
||||
candidateId.value = row.id;
|
||||
modal.value = true;
|
||||
};
|
||||
|
||||
const viewDetail = (id: string, status: string) => {
|
||||
if (status == "checkPayment") {
|
||||
router.push(`${route.fullPath}/payment/${id}`);
|
||||
} else {
|
||||
router.push(`${route.fullPath}/profile/${id}`);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* แปลงช่วงวันที่ถ้า2ค่าเป็นวันเดียวกันจะโชววันเดียวแต่ถ้าไม่เท่ากันจะแสดงเป็นช่วง
|
||||
* @param val ช่วงวันที่
|
||||
*/
|
||||
const dateThaiRange = (val: [Date, Date]) => {
|
||||
if (val === null) {
|
||||
} else if (date2Thai(val[0]) === date2Thai(val[1])) {
|
||||
return `${date2Thai(val[0])}`;
|
||||
} else {
|
||||
return `${date2Thai(val[0])} - ${date2Thai(val[1])} `;
|
||||
}
|
||||
};
|
||||
|
||||
const statusCandidate = (status: string) => {
|
||||
switch (status) {
|
||||
case "register":
|
||||
return "ยังไม่สมัครสอบ";
|
||||
case "checkRegister":
|
||||
return "ตรวจสอบข้อมูลสมัครสอบ";
|
||||
case "payment":
|
||||
return "รอชำระค่าสมัครสอบ";
|
||||
case "rejectRegister":
|
||||
return "คุณสมบัติสมัครสอบไม่ผ่าน";
|
||||
case "checkPayment":
|
||||
return "ตรวจสอบหลักฐานชำระเงิน";
|
||||
case "rejectPayment":
|
||||
return "หลักฐานชำระเงินไม่ถูกต้อง";
|
||||
case "checkSeat":
|
||||
return "จัดที่นั่งสอบ";
|
||||
case "checkPoint":
|
||||
return "สรุปคะแนนสอบ";
|
||||
case "done":
|
||||
return "คัดเลือกสำเร็จ";
|
||||
case "waiver":
|
||||
return "สละสิทธิ์สอบ";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
};
|
||||
</script>
|
||||
1188
src/modules/03_recruiting/views/03_editor/index.vue
Normal file
1188
src/modules/03_recruiting/views/03_editor/index.vue
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue