Merge branch 'develop' into dev-tee

# Conflicts:
#	src/modules/06_retirement/components/ExitInterview/exitRegistry.vue
This commit is contained in:
setthawutttty 2023-10-09 15:36:01 +07:00
commit a03c46e35a
17 changed files with 637 additions and 265 deletions

View file

@ -10,6 +10,7 @@ const placemenRelocation = `${placement}/relocation`;
const placemenOther = `${env.API_URI}/retirement/other`; const placemenOther = `${env.API_URI}/retirement/other`;
const placemenAppointment = `${placement}/appointment`; const placemenAppointment = `${placement}/appointment`;
export default { export default {
MainDetail: (year: number) => `${placement}/exam/${year}`, MainDetail: (year: number) => `${placement}/exam/${year}`,
yearOptions: () => `${placement}/fiscal`, yearOptions: () => `${placement}/fiscal`,
@ -59,6 +60,10 @@ export default {
// clear Position // clear Position
clearPosition: (personalId: string) => clearPosition: (personalId: string) =>
`${placement}/position/clear/${personalId}`, `${placement}/position/clear/${personalId}`,
// Document
documentByid: (personalId: string) => `${placement}/doc/${personalId}`,
documentDelid: (personalId: string, docid: string) => `${placement}/doc/${personalId}/${docid}`,
// order // order
organizationsOrder: () => `${order}/order/organizations`, organizationsOrder: () => `${order}/order/organizations`,

View file

@ -56,7 +56,10 @@ export default {
fileRetirement: (id: string) => `${retirement}/upload/${id}`, fileRetirement: (id: string) => `${retirement}/upload/${id}`,
checkfileupload: (id: string) => `${retirement}/upload/check/${id}`, checkfileupload: (id: string) => `${retirement}/upload/check/${id}`,
editDetail: (retireId: string) => `${retirement}/detail/${retireId}` editDetail: (retireId: string) => `${retirement}/detail/${retireId}`,
// ตำถาม Exit interview
questionnaireList: () => `${retirement}/resign/questionnaire/question`
}; };

View file

@ -12,6 +12,7 @@
:add="clickAdd" :add="clickAdd"
:edit="clickEdit" :edit="clickEdit"
:addData="false" :addData="false"
:bottom="true"
:editData="status == 'checkRegister' || status == 'payment'" :editData="status == 'checkRegister' || status == 'payment'"
name="ประวัติการทำงาน (ตั้งแต่เริ่มปฏิบัติงานกับกรุงเทพมหานคร - ปัจจุบัน)" name="ประวัติการทำงาน (ตั้งแต่เริ่มปฏิบัติงานกับกรุงเทพมหานคร - ปัจจุบัน)"
icon="mdi-briefcase" icon="mdi-briefcase"
@ -550,13 +551,13 @@ const fetchData = async () => {
yearDiff = yearDiff + d.yearDiff; yearDiff = yearDiff + d.yearDiff;
monthDiff = monthDiff + d.monthDiff; monthDiff = monthDiff + d.monthDiff;
dayDiff = dayDiff + d.dayDiff; dayDiff = dayDiff + d.dayDiff;
if (dayDiff > 30) { if (dayDiff >= 30) {
dayDiff = dayDiff % 30;
monthDiff = monthDiff + parseInt((dayDiff / 30).toString()); monthDiff = monthDiff + parseInt((dayDiff / 30).toString());
dayDiff = dayDiff % 30;
} }
if (monthDiff > 12) { if (monthDiff >= 12) {
monthDiff = monthDiff % 12;
yearDiff = yearDiff + parseInt((monthDiff / 12).toString()); yearDiff = yearDiff + parseInt((monthDiff / 12).toString());
monthDiff = monthDiff % 12;
} }
total.value = `${yearDiff > 0 ? yearDiff + " ปี " : ""}${ total.value = `${yearDiff > 0 ? yearDiff + " ปี " : ""}${
monthDiff > 0 ? monthDiff + " เดือน " : "" monthDiff > 0 ? monthDiff + " เดือน " : ""

View file

@ -77,6 +77,9 @@
<template #body="props"> <template #body="props">
<slot v-bind="props" name="columns"></slot> <slot v-bind="props" name="columns"></slot>
</template> </template>
<template v-slot:bottom v-if="bottom == true">
<slot v-bind="props" name="bottom"></slot>
</template>
</q-table> </q-table>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -99,6 +102,7 @@ const props = defineProps({
inputvisible: Array, inputvisible: Array,
editvisible: Boolean, editvisible: Boolean,
nameHeader: Boolean, nameHeader: Boolean,
bottom: Boolean,
addData: { addData: {
type: Boolean, type: Boolean,
defualt: true, defualt: true,

View file

@ -36,6 +36,20 @@
<q-icon name="attach_file" color="blue" /> <q-icon name="attach_file" color="blue" />
</template> </template>
</q-file> </q-file>
<div>
<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>
</div>
</div> </div>
</q-card> </q-card>
<div class="col-12 row q-py-sm items-center q-col-gutter-sm"> <div class="col-12 row q-py-sm items-center q-col-gutter-sm">
@ -70,20 +84,6 @@
<q-tooltip>ตรวจสอบขอม</q-tooltip> <q-tooltip>ตรวจสอบขอม</q-tooltip>
</q-btn> </q-btn>
</div> </div>
<div>
<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>
</div>
<div> <div>
<q-btn icon="mdi-download" round color="green-6" flat> <q-btn icon="mdi-download" round color="green-6" flat>
<q-tooltip>ดาวนโหลดไฟล</q-tooltip> <q-tooltip>ดาวนโหลดไฟล</q-tooltip>

View file

@ -380,13 +380,13 @@
v-model="props.row.code" v-model="props.row.code"
:rules="[ :rules="[
(val) => (val) =>
val.length >= 4 || val.length >= 3 ||
`${'กรุณากรอกรหัสประจำตำแหน่งที่สอบ'}`, `${'กรุณากรอกรหัสประจำตำแหน่งที่สอบ'}`,
]" ]"
:label="`${'รหัสประจำตำแหน่งที่สอบ'}`" :label="`${'รหัสประจำตำแหน่งที่สอบ'}`"
@update:modelValue="clickEditRow" @update:modelValue="clickEditRow"
hide-bottom-space hide-bottom-space
mask="####" mask="###"
/> />
</q-td> </q-td>
<q-td key="position" :props="props"> <q-td key="position" :props="props">

View file

@ -9,6 +9,8 @@ import { useQuasar } from "quasar";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { usePersonalDataStore } from "@/modules/05_placement/storePersona";
import Informationvue from "@/modules/05_placement/components/PersonalDetail/Information/Information.vue"; import Informationvue from "@/modules/05_placement/components/PersonalDetail/Information/Information.vue";
import Addressvue from "@/modules/05_placement/components/PersonalDetail/Information/Address.vue"; import Addressvue from "@/modules/05_placement/components/PersonalDetail/Information/Address.vue";
import EducationVue from "@/modules/05_placement/components/PersonalDetail/Education.vue"; import EducationVue from "@/modules/05_placement/components/PersonalDetail/Education.vue";
@ -16,7 +18,7 @@ import Certicate from "@/modules/05_placement/components/PersonalDetail/Informat
import ExamResult from "@/modules/05_placement/components/PersonalDetail/ExamResult.vue"; import ExamResult from "@/modules/05_placement/components/PersonalDetail/ExamResult.vue";
import Qualification from "@/modules/05_placement/components/PersonalDetail/Qualification.vue"; import Qualification from "@/modules/05_placement/components/PersonalDetail/Qualification.vue";
import Familyvue from "@/modules/05_placement/components/PersonalDetail/Information/Family.vue"; import Familyvue from "@/modules/05_placement/components/PersonalDetail/Information/Family.vue";
// import Document from "@/modules/05_placement/components/PersonalDetail/Information/Document.vue"; import Document from "@/modules/05_placement/components/PersonalDetail/Information/Document.vue";
import { import {
AddressDataDefualt, AddressDataDefualt,
@ -38,6 +40,7 @@ const $q = useQuasar(); // show dialog
const router = useRouter(); const router = useRouter();
const store = useDataStore(); const store = useDataStore();
const mixin = useCounterMixin(); // const mixin = useCounterMixin(); //
const storePersonal = usePersonalDataStore();
const { showLoader, hideLoader, messageError } = mixin; const { showLoader, hideLoader, messageError } = mixin;
const { changeTab } = store; const { changeTab } = store;
const statusEdit = ref<boolean>(false); const statusEdit = ref<boolean>(false);
@ -110,12 +113,13 @@ const guidCheck = (id: string) => {
}; };
const fetchData = async () => { const fetchData = async () => {
storePersonal.loading = false;
showLoader(); showLoader();
await http await http
.get(config.API.placementPersonalId(examId.value)) .get(config.API.placementPersonalId(examId.value))
.then((res: any) => { .then((res: any) => {
const data = res.data.result; const data = res.data.result;
storePersonal.fecthDataInformation(data);
personalData.value.fullName = data.fullName; personalData.value.fullName = data.fullName;
personalData.value.id = data.personalId; personalData.value.id = data.personalId;
@ -254,7 +258,7 @@ const fetchData = async () => {
</div> </div>
</div> </div>
<div class="q-pb-lg"> <div class="q-pb-lg">
<q-card class="row q-pb-lg"> <q-card class="row q-pb-lg" v-if="storePersonal.loading">
<div id="information" name="1" class="col-12 q-pa-sm"> <div id="information" name="1" class="col-12 q-pa-sm">
<Informationvue <Informationvue
v-model:statusEdit="statusEdit" v-model:statusEdit="statusEdit"
@ -316,7 +320,11 @@ const fetchData = async () => {
<q-separator size="4px" /> <q-separator size="4px" />
</div> </div>
<!-- v-model:data="QualificationData" --> <!-- v-model:data="QualificationData" -->
<Document v-model:statusEdit="statusEdit" :fetch="fetchData" /> <Document
v-model:statusEdit="statusEdit"
:fetch="fetchData"
:datainformation="storePersonal.dataMain"
/>
</div> </div>
</q-card> </q-card>
</div> </div>

View file

@ -284,7 +284,7 @@ watch(visibleColumns, async (count: String[], prevCount: String[]) => {
onMounted(async () => { onMounted(async () => {
await fetchLevel(); await fetchLevel();
await fetchPositionPath(); await fetchPositionPath();
await props.fetch(); // await props.fetch();
rows.value = props.data; rows.value = props.data;
}); });

View file

@ -67,17 +67,17 @@ const registAddress = reactive<AddressData>({
zipCode: "", zipCode: "",
districtId: "", districtId: "",
provinceId: "", provinceId: "",
}) });
const currentAddress = reactive<AddressData>({ const currentAddress = reactive<AddressData>({
subDistrictId: "", subDistrictId: "",
zipCode: "", zipCode: "",
districtId: "", districtId: "",
provinceId: "", provinceId: "",
}) });
onMounted(async () => { onMounted(async () => {
await getNewData(); // await getNewData();
emit("update:statusEdit", false); emit("update:statusEdit", false);
}); });
@ -126,7 +126,9 @@ const filterSelector = (val: any, update: Function, refData: string) => {
const refreshData = async () => { const refreshData = async () => {
myform.value.reset(); myform.value.reset();
await getNewData(); await props.fetch();
await fetchProvince();
// await getNewData();
}; };
const getNewData = async () => { const getNewData = async () => {
@ -179,7 +181,9 @@ const editData = async () => {
.finally(async () => { .finally(async () => {
edit.value = false; edit.value = false;
emit("update:statusEdit", false); emit("update:statusEdit", false);
await getNewData(); // await getNewData();
await props.fetch();
await fetchProvince();
}); });
}; };
@ -196,13 +200,13 @@ const saveData = async () => {
const selectProvince = async (e: string | null, name: string) => { const selectProvince = async (e: string | null, name: string) => {
if (e != null) { if (e != null) {
if (name == "1") { if (name == "1") {
registAddress.subDistrictId = "" registAddress.subDistrictId = "";
registAddress.zipCode = "" registAddress.zipCode = "";
registAddress.districtId = "" registAddress.districtId = "";
} else { } else {
currentAddress.subDistrictId = "" currentAddress.subDistrictId = "";
currentAddress.zipCode = "" currentAddress.zipCode = "";
currentAddress.districtId = "" currentAddress.districtId = "";
} }
myform.value.resetValidation(); myform.value.resetValidation();
await fetchDistrict(e, name); await fetchDistrict(e, name);
@ -253,36 +257,58 @@ const fetchProvince = async () => {
Ops.value.provinceOps = option; Ops.value.provinceOps = option;
OpsFilter.value.provinceOps = option; OpsFilter.value.provinceOps = option;
const checkRegistProvinceId = await option.find((e: any) => e.id === addressData.value.registProvinceId) const checkRegistProvinceId = await option.find(
(e: any) => e.id === addressData.value.registProvinceId
);
// id // id
if (addressData.value.registProvinceId == '' || addressData.value.registProvinceId == '00000000-0000-0000-0000-000000000000' || !checkRegistProvinceId) { if (
registAddress.subDistrictId = "" addressData.value.registProvinceId == "" ||
registAddress.zipCode = "" addressData.value.registProvinceId ==
registAddress.districtId = "" "00000000-0000-0000-0000-000000000000" ||
!checkRegistProvinceId
) {
registAddress.subDistrictId = "";
registAddress.zipCode = "";
registAddress.districtId = "";
} else { } else {
registAddress.provinceId = await addressData.value.registProvinceId registAddress.provinceId = await addressData.value.registProvinceId;
registAddress.zipCode = await addressData.value.registZipCode registAddress.zipCode = await addressData.value.registZipCode;
await fetchDistrict(addressData.value.registProvinceId, "1"); await fetchDistrict(addressData.value.registProvinceId, "1");
if (addressData.value.registDistrictId != null && addressData.value.registDistrictId != '00000000-0000-0000-0000-000000000000') { if (
addressData.value.registDistrictId != null &&
addressData.value.registDistrictId !=
"00000000-0000-0000-0000-000000000000"
) {
await fetchSubDistrict(addressData.value.registDistrictId, "1"); await fetchSubDistrict(addressData.value.registDistrictId, "1");
} }
} }
const checkCurrentProvinceId = await option.find((e: any) => e.id === addressData.value.currentProvinceId) const checkCurrentProvinceId = await option.find(
(e: any) => e.id === addressData.value.currentProvinceId
);
// id // id
if (addressData.value.currentProvinceId == '' || addressData.value.currentProvinceId == '00000000-0000-0000-0000-000000000000' || !checkCurrentProvinceId) { if (
currentAddress.subDistrictId = "" addressData.value.currentProvinceId == "" ||
currentAddress.zipCode = "" addressData.value.currentProvinceId ==
currentAddress.districtId = "" "00000000-0000-0000-0000-000000000000" ||
!checkCurrentProvinceId
) {
currentAddress.subDistrictId = "";
currentAddress.zipCode = "";
currentAddress.districtId = "";
} else { } else {
currentAddress.provinceId = addressData.value.currentProvinceId currentAddress.provinceId = addressData.value.currentProvinceId;
currentAddress.zipCode = addressData.value.currentZipCode currentAddress.zipCode = addressData.value.currentZipCode;
await fetchDistrict(addressData.value.currentProvinceId, "2"); await fetchDistrict(addressData.value.currentProvinceId, "2");
if (addressData.value.currentDistrictId != null && addressData.value.currentDistrictId != '00000000-0000-0000-0000-000000000000') { if (
addressData.value.currentDistrictId != null &&
addressData.value.currentDistrictId !=
"00000000-0000-0000-0000-000000000000"
) {
await fetchSubDistrict(addressData.value.currentDistrictId, "2"); await fetchSubDistrict(addressData.value.currentDistrictId, "2");
} }
} }
@ -312,19 +338,23 @@ const fetchDistrict = async (id: string | null, position: string) => {
OpsFilter.value.districtOps = option; OpsFilter.value.districtOps = option;
// id array // id array
const checkRegistDistrictId = option.find((e: any) => e.id === addressData.value.registDistrictId) const checkRegistDistrictId = option.find(
(e: any) => e.id === addressData.value.registDistrictId
);
if (checkRegistDistrictId) { if (checkRegistDistrictId) {
registAddress.districtId = addressData.value.registDistrictId registAddress.districtId = addressData.value.registDistrictId;
} }
} else { } else {
Ops.value.districtCOps = option; Ops.value.districtCOps = option;
OpsFilter.value.districtCOps = option; OpsFilter.value.districtCOps = option;
// id array // id array
const checkCurrentDistrictId = await option.find((e: any) => e.id === addressData.value.currentDistrictId) const checkCurrentDistrictId = await option.find(
(e: any) => e.id === addressData.value.currentDistrictId
);
if (checkCurrentDistrictId) { if (checkCurrentDistrictId) {
currentAddress.districtId = addressData.value.currentDistrictId currentAddress.districtId = addressData.value.currentDistrictId;
} }
} }
}) })
@ -358,18 +388,23 @@ const fetchSubDistrict = async (id: string | null, position: string) => {
OpsFilter.value.subdistrictOps = option; OpsFilter.value.subdistrictOps = option;
// id array // id array
const checkRegistSubDistrictId = await option.find((e: any) => e.id === addressData.value.registSubDistrictId) const checkRegistSubDistrictId = await option.find(
(e: any) => e.id === addressData.value.registSubDistrictId
);
if (checkRegistSubDistrictId) { if (checkRegistSubDistrictId) {
registAddress.subDistrictId = addressData.value.registSubDistrictId registAddress.subDistrictId = addressData.value.registSubDistrictId;
} }
} else { } else {
Ops.value.subdistrictCOps = option; Ops.value.subdistrictCOps = option;
OpsFilter.value.subdistrictCOps = option; OpsFilter.value.subdistrictCOps = option;
// id array // id array
const checkCurrentSubDistrictId = await option.find((e: any) => e.id === addressData.value.currentSubDistrictId) const checkCurrentSubDistrictId = await option.find(
(e: any) => e.id === addressData.value.currentSubDistrictId
);
if (checkCurrentSubDistrictId) { if (checkCurrentSubDistrictId) {
currentAddress.subDistrictId = addressData.value.currentSubDistrictId currentAddress.subDistrictId =
addressData.value.currentSubDistrictId;
} }
} }
}) })
@ -405,91 +440,268 @@ const getClass = (val: boolean) => {
<template> <template>
<q-card class="col-12 q-px-lg q-py-md q-mt-md no-border"> <q-card class="col-12 q-px-lg q-py-md q-mt-md no-border">
<HeaderTop v-model:edit="edit" header="ข้อมูลที่อยู่" icon="mdi-map-marker" :save="saveData" :history="false" <HeaderTop
:changeBtn="changeBtn" :disable="statusEdit" :cancel="refreshData" /> v-model:edit="edit"
header="ข้อมูลที่อยู่"
icon="mdi-map-marker"
:save="saveData"
:history="false"
:changeBtn="changeBtn"
:disable="statusEdit"
:cancel="refreshData"
/>
<q-form ref="myform"> <q-form ref="myform">
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"> <div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-12"> <div class="col-xs-12">
<q-input :class="getClass(edit)" hide-bottom-space :outlined="edit" dense lazy-rules type="textarea" autogrow <q-input
:readonly="!edit" :borderless="!edit" v-model="addressData.registAddress" :class="getClass(edit)"
hide-bottom-space
:outlined="edit"
dense
lazy-rules
type="textarea"
autogrow
:readonly="!edit"
:borderless="!edit"
v-model="addressData.registAddress"
:rules="[(val: string) => !!val || `${'กรุณากรอก ที่อยู่ตามทะเบียนบ้าน'}`]" :rules="[(val: string) => !!val || `${'กรุณากรอก ที่อยู่ตามทะเบียนบ้าน'}`]"
:label="`${'ที่อยู่ตามทะเบียนบ้าน'}`" /> :label="`${'ที่อยู่ตามทะเบียนบ้าน'}`"
/>
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3"> <div class="col-xs-6 col-sm-3 col-md-3">
<selector :hide-dropdown-icon="!edit" hide-bottom-space :class="getClass(edit)" :readonly="!edit" <selector
:borderless="!edit" :rules="[(val: string) => !!val || `${'กรุณาเลือก จังหวัด'}`]" :outlined="edit" dense :hide-dropdown-icon="!edit"
lazy-rules v-model="registAddress.provinceId" emit-value map-options option-label="name" hide-bottom-space
:options="Ops.provinceOps" option-value="id" :label="`${'จังหวัด'}`" :class="getClass(edit)"
@update:model-value="(value: string) => selectProvince(value, '1')" use-input input-debounce="0" @filter="(inputValue: string, :readonly="!edit"
:borderless="!edit"
:rules="[(val: string) => !!val || `${'กรุณาเลือก จังหวัด'}`]"
:outlined="edit"
dense
lazy-rules
v-model="registAddress.provinceId"
emit-value
map-options
option-label="name"
:options="Ops.provinceOps"
option-value="id"
:label="`${'จังหวัด'}`"
@update:model-value="(value: string) => selectProvince(value, '1')"
use-input
input-debounce="0"
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'provinceOps' doneFn: Function) => filterSelector(inputValue, doneFn, 'provinceOps'
)" /> )"
/>
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3"> <div class="col-xs-6 col-sm-3 col-md-3">
<selector :hide-dropdown-icon="!edit" hide-bottom-space :class="getClass(edit)" :readonly="!edit" <selector
:borderless="!edit" :rules="[(val: string) => !!val || `${'กรุณาเลือก เขต / อำเภอ'}`]" :outlined="edit" dense :hide-dropdown-icon="!edit"
lazy-rules v-model="registAddress.districtId" emit-value map-options option-label="name" hide-bottom-space
:options="Ops.districtOps" option-value="id" :label="`${'เขต / อำเภอ'}`" :class="getClass(edit)"
@update:model-value="(value: string) => selectDistrict(value, '1')" use-input input-debounce="0" @filter="(inputValue: string, :readonly="!edit"
:borderless="!edit"
:rules="[(val: string) => !!val || `${'กรุณาเลือก เขต / อำเภอ'}`]"
:outlined="edit"
dense
lazy-rules
v-model="registAddress.districtId"
emit-value
map-options
option-label="name"
:options="Ops.districtOps"
option-value="id"
:label="`${'เขต / อำเภอ'}`"
@update:model-value="(value: string) => selectDistrict(value, '1')"
use-input
input-debounce="0"
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'districtOps' doneFn: Function) => filterSelector(inputValue, doneFn, 'districtOps'
)" /> )"
/>
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3"> <div class="col-xs-6 col-sm-3 col-md-3">
<selector :hide-dropdown-icon="!edit" hide-bottom-space :class="getClass(edit)" :readonly="!edit" <selector
:borderless="!edit" :rules="[(val: string) => !!val || `${'กรุณาเลือก แขวง / ตำบล '}`]" :outlined="edit" dense :hide-dropdown-icon="!edit"
lazy-rules v-model="registAddress.subDistrictId" emit-value map-options option-label="name" hide-bottom-space
:options="Ops.subdistrictOps" option-value="id" :label="`${'แขวง / ตำบล '}`" :class="getClass(edit)"
@update:model-value="(value: string) => selectSubDistrict(value, '1')" use-input input-debounce="0" @filter="(inputValue: string, :readonly="!edit"
:borderless="!edit"
:rules="[(val: string) => !!val || `${'กรุณาเลือก แขวง / ตำบล '}`]"
:outlined="edit"
dense
lazy-rules
v-model="registAddress.subDistrictId"
emit-value
map-options
option-label="name"
:options="Ops.subdistrictOps"
option-value="id"
:label="`${'แขวง / ตำบล '}`"
@update:model-value="(value: string) => selectSubDistrict(value, '1')"
use-input
input-debounce="0"
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'subdistrictOps' doneFn: Function) => filterSelector(inputValue, doneFn, 'subdistrictOps'
)" /> )"
/>
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3"> <div class="col-xs-6 col-sm-3 col-md-3">
<q-input :class="getClass(edit)" hide-bottom-space dense lazy-rules readonly borderless <q-input
v-model="registAddress.zipCode" :style="!edit ? '' : 'padding:0 12px;'" :label="`${'รหัสไปรษณีย์'}`" /> :class="getClass(edit)"
hide-bottom-space
dense
lazy-rules
readonly
borderless
v-model="registAddress.zipCode"
:style="!edit ? '' : 'padding:0 12px;'"
:label="`${'รหัสไปรษณีย์'}`"
/>
</div> </div>
<div class="col-12 q-pt-lg"><q-separator /></div> <div class="col-12 q-pt-lg"><q-separator /></div>
<div class="col-xs-12 q-gutter-sm items-center flex q-my-sm"> <div class="col-xs-12 q-gutter-sm items-center flex q-my-sm">
<label class="text-bold">อยจจนตรงกบทอยตามทะเบยนบาน</label> <label class="text-bold"
<q-radio v-model="addressData.registSame" checked-icon="task_alt" unchecked-icon="panorama_fish_eye" val="1" >อยจจนตรงกบทอยตามทะเบยนบาน</label
label="ใช่" dense :disable="!edit" /> >
<q-radio v-model="addressData.registSame" checked-icon="task_alt" unchecked-icon="panorama_fish_eye" val="0" <q-radio
label="ไม่" dense :disable="!edit" /> v-model="addressData.registSame"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
val="1"
label="ใช่"
dense
:disable="!edit"
/>
<q-radio
v-model="addressData.registSame"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
val="0"
label="ไม่"
dense
:disable="!edit"
/>
</div> </div>
<div class="col-xs-12" v-if="addressData.registSame == '0'"> <div class="col-xs-12" v-if="addressData.registSame == '0'">
<q-input :class="getClass(edit)" hide-bottom-space :outlined="edit" dense lazy-rules type="textarea" autogrow <q-input
:readonly="!edit" :borderless="!edit" v-model="addressData.currentAddress" :class="getClass(edit)"
:rules="[(val: string) => !!val || `${'กรุณากรอก ที่อยู่ปัจจุบัน'}`]" :label="`${'ที่อยู่ปัจจุบัน'}`" /> hide-bottom-space
:outlined="edit"
dense
lazy-rules
type="textarea"
autogrow
:readonly="!edit"
:borderless="!edit"
v-model="addressData.currentAddress"
:rules="[(val: string) => !!val || `${'กรุณากรอก ที่อยู่ปัจจุบัน'}`]"
:label="`${'ที่อยู่ปัจจุบัน'}`"
/>
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.registSame == '0'"> <div
<selector :hide-dropdown-icon="!edit" hide-bottom-space :class="getClass(edit)" :readonly="!edit" class="col-xs-6 col-sm-3 col-md-3"
:borderless="!edit" :rules="[(val: string) => !!val || `${'กรุณาเลือก จังหวัด'}`]" :outlined="edit" dense v-if="addressData.registSame == '0'"
lazy-rules v-model="currentAddress.provinceId" emit-value map-options option-label="name" >
:options="Ops.provinceOps" option-value="id" :label="`${'จังหวัด'}`" <selector
@update:model-value="(value: string) => selectProvince(value, '2')" use-input input-debounce="0" @filter="(inputValue: string, :hide-dropdown-icon="!edit"
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
:rules="[(val: string) => !!val || `${'กรุณาเลือก จังหวัด'}`]"
:outlined="edit"
dense
lazy-rules
v-model="currentAddress.provinceId"
emit-value
map-options
option-label="name"
:options="Ops.provinceOps"
option-value="id"
:label="`${'จังหวัด'}`"
@update:model-value="(value: string) => selectProvince(value, '2')"
use-input
input-debounce="0"
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'provinceOps' doneFn: Function) => filterSelector(inputValue, doneFn, 'provinceOps'
)" /> )"
/>
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.registSame == '0'"> <div
<selector :hide-dropdown-icon="!edit" hide-bottom-space :class="getClass(edit)" :readonly="!edit" class="col-xs-6 col-sm-3 col-md-3"
:borderless="!edit" :rules="[(val: string) => !!val || `${'กรุณาเลือก เขต / อำเภอ'}`]" :outlined="edit" dense v-if="addressData.registSame == '0'"
lazy-rules v-model="currentAddress.districtId" emit-value map-options option-label="name" >
:options="Ops.districtCOps" option-value="id" :label="`${'เขต / อำเภอ'}`" <selector
@update:model-value="(value: string) => selectDistrict(value, '2')" use-input input-debounce="0" @filter="(inputValue: string, :hide-dropdown-icon="!edit"
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
:rules="[(val: string) => !!val || `${'กรุณาเลือก เขต / อำเภอ'}`]"
:outlined="edit"
dense
lazy-rules
v-model="currentAddress.districtId"
emit-value
map-options
option-label="name"
:options="Ops.districtCOps"
option-value="id"
:label="`${'เขต / อำเภอ'}`"
@update:model-value="(value: string) => selectDistrict(value, '2')"
use-input
input-debounce="0"
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'districtCOps' doneFn: Function) => filterSelector(inputValue, doneFn, 'districtCOps'
)" /> )"
/>
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.registSame == '0'"> <div
<selector :hide-dropdown-icon="!edit" hide-bottom-space :class="getClass(edit)" :readonly="!edit" class="col-xs-6 col-sm-3 col-md-3"
:borderless="!edit" :rules="[(val: string) => !!val || `${'กรุณาเลือก แขวง / ตำบล '}`]" :outlined="edit" dense v-if="addressData.registSame == '0'"
lazy-rules v-model="currentAddress.subDistrictId" emit-value map-options option-label="name" >
:options="Ops.subdistrictCOps" option-value="id" :label="`${'แขวง / ตำบล '}`" <selector
@update:model-value="(value: string) => selectSubDistrict(value, '2')" use-input input-debounce="0" @filter="(inputValue: string, :hide-dropdown-icon="!edit"
hide-bottom-space
:class="getClass(edit)"
:readonly="!edit"
:borderless="!edit"
:rules="[(val: string) => !!val || `${'กรุณาเลือก แขวง / ตำบล '}`]"
:outlined="edit"
dense
lazy-rules
v-model="currentAddress.subDistrictId"
emit-value
map-options
option-label="name"
:options="Ops.subdistrictCOps"
option-value="id"
:label="`${'แขวง / ตำบล '}`"
@update:model-value="(value: string) => selectSubDistrict(value, '2')"
use-input
input-debounce="0"
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'subdistrictCOps' doneFn: Function) => filterSelector(inputValue, doneFn, 'subdistrictCOps'
)" /> )"
/>
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.registSame == '0'"> <div
<q-input :class="getClass(edit)" hide-bottom-space dense lazy-rules readonly borderless class="col-xs-6 col-sm-3 col-md-3"
v-model="currentAddress.zipCode" :style="!edit ? '' : 'padding:0 12px;'" :label="`${'รหัสไปรษณีย์'}`" /> v-if="addressData.registSame == '0'"
>
<q-input
:class="getClass(edit)"
hide-bottom-space
dense
lazy-rules
readonly
borderless
v-model="currentAddress.zipCode"
:style="!edit ? '' : 'padding:0 12px;'"
:label="`${'รหัสไปรษณีย์'}`"
/>
</div> </div>
</div> </div>
</q-form> </q-form>

View file

@ -240,7 +240,7 @@ onMounted(async () => {
if (route.params.id) { if (route.params.id) {
profileId.value = route.params.personalId.toString(); profileId.value = route.params.personalId.toString();
} }
await props.fetch(); // await props.fetch();
rows.value = props.data; rows.value = props.data;
}); });

View file

@ -30,7 +30,7 @@
round round
color="blue" color="blue"
icon="mdi-download-outline" icon="mdi-download-outline"
@click="downloadData(file.file)" @click="downloadData(file.pathName)"
> >
<q-tooltip>ดาวนโหลดเอกสารหลกฐาน</q-tooltip> <q-tooltip>ดาวนโหลดเอกสารหลกฐาน</q-tooltip>
</q-btn> </q-btn>
@ -43,7 +43,7 @@
color="red" color="red"
icon="mdi-delete-outline" icon="mdi-delete-outline"
v-show="edit" v-show="edit"
@click="deleteData(file.id)" @click="deleteData(file.docId)"
> >
<q-tooltip>ลบเอกสารหลกฐาน</q-tooltip> <q-tooltip>ลบเอกสารหลกฐาน</q-tooltip>
</q-btn> </q-btn>
@ -159,58 +159,72 @@ const props = defineProps({
type: Function, type: Function,
default: () => console.log("not function"), default: () => console.log("not function"),
}, },
datainformation: {
type: Array,
},
}); });
const emit = defineEmits(["update:statusEdit"]); const emit = defineEmits(["update:statusEdit"]);
const $q = useQuasar(); // show dialog const $q = useQuasar(); // show dialog
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const route = useRoute(); const route = useRoute();
const { success, messageError, showLoader, hideLoader } = mixin; const { success, messageError, showLoader, dialogConfirm } = mixin;
const profileId = ref<string>( const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.personalId ? route.params.personalId.toString() : ""
); );
const edit = ref<boolean>(false); const edit = ref<boolean>(false);
const uploader = ref<any>(); const uploader = ref<any>();
const files = ref<any>([]); const files = ref<any>([]);
const file = ref<any>([]); const file = ref<any>([]);
const name = ref<string>(""); const name = ref<string>("");
const dataMain = ref<any>([]);
onMounted(async () => { onMounted(async () => {
await getData(); await getData();
// props.fetch()
}); });
const getData = async () => { const getData = async () => {
if (profileId.value) { if (props.datainformation) {
showLoader(); dataMain.value = props.datainformation;
await http files.value = dataMain.value.docs;
.get(config.API.profilePaperId(profileId.value))
.then((res) => {
const data = res.data.result;
files.value = data;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
} }
// if (profileId.value) {
// showLoader();
// await http
// .get(config.API.profilePaperId(profileId.value))
// .then((res) => {
// const data = res.data.result;
// files.value = data;
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
// }
}; };
const deleteData = async (id: string) => { const deleteData = async (id: string) => {
showLoader(); dialogConfirm(
await http $q,
.delete(config.API.profilePaperId(id)) async () => {
.then((res) => { showLoader();
const data = res.data.result; await http
}) .delete(config.API.documentDelid(profileId.value, id))
.catch((e) => { .then(() => {
messageError($q, e); success($q, "ลบไฟล์เอกสารสำเร็จ");
}) })
.finally(async () => { .catch((e) => {
await getData(); messageError($q, e);
}); })
.finally(async () => {
await props.fetch();
});
},
"ยืนยันการลบเอกสารหลักฐาน",
"ต้องการยืนยันการลบเอกสารหลักฐานนี้หรือไม่ ?"
);
}; };
const uploadData = async () => { const uploadData = async () => {
@ -221,32 +235,31 @@ const uploadData = async () => {
type: file.value[0].type, type: file.value[0].type,
}); });
const formData = new FormData(); const formData = new FormData();
formData.append("avatar", newFile); formData.append("file", newFile);
formData.append("moss", "newFile"); // formData.append("moss", "newFile");
showLoader(); showLoader();
await http await http
.post(config.API.profilePaperId(profileId.value), formData) .put(config.API.documentByid(profileId.value), formData)
.then((res) => { .then(() => {
const data = res.data.result;
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
.finally(async () => { .finally(async () => {
await props.fetch();
uploader.value.reset(); uploader.value.reset();
name.value = ""; name.value = "";
edit.value = false; edit.value = false;
emit("update:statusEdit", false); emit("update:statusEdit", false);
await getData();
}); });
} else { // } else {
// modalError( // // modalError(
// $q, // // $q,
// "", // // "",
// "" // // ""
// ); // // );
getData(); // getData();
} }
} }
}; };

View file

@ -132,7 +132,7 @@ const editData = async () => {
}; };
await http await http
.put(config.API.placementFamilyId(route.params.personalId.toString()), body) .put(config.API.placementFamilyId(route.params.personalId.toString()), body)
.then((res) => { .then(() => {
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
}) })
.catch((e) => { .catch((e) => {

View file

@ -102,7 +102,7 @@ const fetchPlacementData = async () => {
class="q-mr-sm" class="q-mr-sm"
@click="router.push(`/placement`)" @click="router.push(`/placement`)"
/> />
รายชอผสอบในรอบs {{ title }} ครงท {{ round }} {{ year }} รายชอผสอบในรอบ {{ title }} ครงท {{ round }} {{ year }}
</div> </div>
<q-card bordered class="q-py-sm row col-12"> <q-card bordered class="q-py-sm row col-12">
<div class="col-12 row bg-white"> <div class="col-12 row bg-white">

View file

@ -0,0 +1,24 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type { Information } from "@/modules/05_placement/components/PersonalDetail/profileType";
export const usePersonalDataStore = defineStore("personal-detail", () => {
const dataMain = ref<any>([])
const loading = ref<boolean>(false)
function fecthDataInformation(data: Information) {
dataMain.value = data
if (dataMain.value) {
loading.value = true
} else {
loading.value = false
}
}
return {
fecthDataInformation,
dataMain,
loading,
};
})

View file

@ -4,6 +4,11 @@ import { useQuasar } from "quasar";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import type {
OptionQuestions,
OptionQuestions2,
} from "@/modules/06_retirement/interface/request/Main";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import keycloak from "@/plugins/keycloak"; import keycloak from "@/plugins/keycloak";
@ -60,86 +65,87 @@ const score = reactive([
const scoreTotal = ref<number|string>(''); const scoreTotal = ref<number|string>('');
const reasonWorkOther = ref(""); const reasonWorkOther = ref("");
const reasonWork_option = ref<any>([ // const reasonWork_option = ref<any>([
{ label: "ความมั่นคงในการทำงาน ", value: 0 }, // { label: " ", value: 0 },
{ label: "สิทธิประโยชน์/สวัสดิการ", value: 1 }, // { label: "/", value: 1 },
{ label: "อัตราเงินเดือน ", value: 2 }, // { label: " ", value: 2 },
{ label: "ลักษณะงาน ", value: 3 }, // { label: " ", value: 3 },
{ label: "วัฒนธรรมการทำงานของข้าราชการ ", value: 4 }, // { label: " ", value: 4 },
{ label: "นโยบายของหน่วยงาน ", value: 5 }, // { label: " ", value: 5 },
{ label: "ระบบการทำงาน", value: 6 }, // { label: "", value: 6 },
{ label: "สมดุลชีวิตการทำงาน ", value: 7 }, // { label: " ", value: 7 },
{ label: "บรรยากาศในการทำงาน ", value: 8 }, // { label: " ", value: 8 },
{ label: "การพัฒนาในสายอาชีพ ", value: 9 }, // { label: " ", value: 9 },
{ label: "โอกาสความก้าวหน้า ", value: 10 }, // { label: " ", value: 10 },
{ label: "การได้รับการยอมรับจากสังคม ", value: 11 }, // { label: " ", value: 11 },
{ label: "อื่น ๆ (ระบุ) ", value: 12 }, // { label: " () ", value: 12 },
]); // ]);
const exitFactorOther = ref(""); const exitFactorOther = ref("");
const exitFactor_option = ref<any>([ // const exitFactor_option = ref<any>([
{ label: "อัตราเงินเดือน ", value: 0 }, // { label: " ", value: 0 },
{ label: "สวัสดิการ", value: 1 }, // { label: "", value: 1 },
{ label: "ลักษณะงาน ", value: 2 }, // { label: " ", value: 2 },
{ label: "ระบบการทำงาน ", value: 3 }, // { label: " ", value: 3 },
{ label: "ระบบสนับสนุนการปฏิบัติงาน ", value: 4 }, // { label: " ", value: 4 },
{ label: "การมอบหมายงานที่ชัดเจนและเหมาะสม ", value: 5 }, // { label: " ", value: 5 },
{ label: "การบริหารงานของผู้บังคับบัญชา", value: 6 }, // { label: "", value: 6 },
{ label: "การทำงานเป็นทีมกับเพื่อนร่วมงาน ", value: 7 }, // { label: " ", value: 7 },
{ label: "ระบบบริหารงานภายในหน่วยงาน ", value: 8 }, // { label: " ", value: 8 },
{ label: "บรรยากาศในการทำงาน ", value: 9 }, // { label: " ", value: 9 },
{ label: "การปฏิบัติอย่างเป็นธรรม ", value: 10 }, // { label: " ", value: 10 },
{ label: "การยอมรับความแตกต่างหลากหลาย ", value: 11 }, // { label: " ", value: 11 },
{ label: "การดูแลและให้ความช่วยเหลือในช่วงเริ่มต้นปฏิบัติงาน ", value: 12 }, // { label: " ", value: 12 },
{ label: "การพัฒนาอย่างเป็นระบบและต่อเนื่อง ", value: 13 }, // { label: " ", value: 13 },
{ label: "โอกาสความก้าวหน้า ", value: 14 }, // { label: " ", value: 14 },
{ label: "อื่น ๆ (ระบุ) ", value: 15 }, // { label: " () ", value: 15 },
]); // ]);
const suggestFriendsReason = ref(""); const suggestFriendsReason = ref("");
const suggestFriends_option = ref<any>([ // const suggestFriends_option = ref<any>([
{ label: "แนะนำ ", value: true }, // { label: " ", value: true },
{ label: "ไม่แนะนำ (ระบุ)", value: false }, // { label: " ()", value: false },
]); // ]);
const timeThink_option = ref<any>([ // const timeThink_option = ref<any>([
{ label: "น้อยกว่า 2 สัปดาห์ ", value: 0 }, // { label: " 2 ", value: 0 },
{ label: "1 เดือน - 3 เดือน", value: 1 }, // { label: "1 - 3 ", value: 1 },
{ label: "3 เดือน - 6 เดือน ", value: 2 }, // { label: "3 - 6 ", value: 2 },
{ label: "6 เดือนขึ้นไป ", value: 3 }, // { label: "6 ", value: 3 },
]); // ]);
const haveJobReason = ref<any>(""); const haveJobReason = ref<any>("");
const haveJob_option = ref<any>([ // const haveJob_option = ref<any>([
{ label: "มี (ระบุ) ", value: true }, // { label: " () ", value: true },
{ label: "ไม่มี", value: false }, // { label: "", value: false },
]); // ]);
const futureWorkReason = ref<any>(""); const futureWorkReason = ref<any>("");
const futureWork_option = ref<any>([ // const futureWork_option = ref<any>([
{ label: "อยาก ", value: true }, // { label: "", value: true },
{ label: "ไม่อยาก (ระบุ)", value: false }, // { label: " ()", value: false },
]); // ]);
const adjustOther = ref(""); const adjustOther = ref("");
const adjust_option = ref<any>([ // const adjust_option = ref<any>([
{ label: "อัตราเงินเดือน ", value: 0 }, // { label: " ", value: 0 },
{ label: "สวัสดิการ", value: 1 }, // { label: "", value: 1 },
{ label: "ลักษณะงาน ", value: 2 }, // { label: " ", value: 2 },
{ label: "ระบบการทำงาน ", value: 3 }, // { label: " ", value: 3 },
{ label: "ระบบสนับสนุนการปฏิบัติงาน ", value: 4 }, // { label: " ", value: 4 },
{ label: "การมอบหมายงานที่ชัดเจนและเหมาะสม ", value: 5 }, // { label: " ", value: 5 },
{ label: "การบริหารงานของผู้บังคับบัญชา", value: 6 }, // { label: "", value: 6 },
{ label: "การทำงานเป็นทีมกับเพื่อนร่วมงาน ", value: 7 }, // { label: " ", value: 7 },
{ label: "ระบบบริหารงานภายในหน่วยงาน ", value: 8 }, // { label: " ", value: 8 },
{ label: "บรรยากาศในการทำงาน ", value: 9 }, // { label: " ", value: 9 },
{ label: "การปฏิบัติอย่างเป็นธรรม ", value: 10 }, // { label: " ", value: 10 },
{ label: "การยอมรับความแตกต่างหลากหลาย ", value: 11 }, // { label: " ", value: 11 },
{ label: "การดูแลและให้ความช่วยเหลือในช่วงเริ่มต้นปฏิบัติงาน ", value: 12 }, // { label: " ", value: 12 },
{ label: "การพัฒนาอย่างเป็นระบบและต่อเนื่อง ", value: 13 }, // { label: " ", value: 13 },
{ label: "โอกาสความก้าวหน้า ", value: 14 }, // { label: " ", value: 14 },
{ label: "อื่น ๆ (ระบุ) ", value: 15 }, // { label: " () ", value: 15 },
]); // ]);
onMounted(async () => { onMounted(async () => {
if (keycloak.tokenParsed != null) { if (keycloak.tokenParsed != null) {
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1"); roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
} }
await getData(); await getData();
await fecthquestion();
}); });
// //
@ -185,6 +191,81 @@ const getData = async () => {
hideLoader(); hideLoader();
}); });
}; };
//
const questionDesc = reactive<any>([
{
question1Desc: "",
question2Desc: "",
question3Desc: "",
question4Desc: "",
question5Desc: "",
question6Desc: "",
question7Desc: "",
question8Desc: "",
question9Desc: "",
question10Desc: "",
},
]);
const question1Answer = ref<OptionQuestions[]>([]);
const question2Answer = ref<OptionQuestions[]>([]);
const question3Answer = ref<OptionQuestions[]>([]);
const question4Answer = ref<OptionQuestions[]>([]);
const question7Answer = ref<OptionQuestions2[]>([]);
const question8Answer = ref<OptionQuestions2[]>([]);
const question9Answer = ref<OptionQuestions2[]>([]);
async function fecthquestion() {
await http
.get(config.API.questionnaireList())
.then((result) => {
const data = result.data.result;
console.log(data);
//
for (let i = 1; i <= 10; i++) {
questionDesc[`question${i}Desc`] =
`${i}.` + " " + data[`question${i}Desc`];
}
//
question1Answer.value = data.question1Answer.map(
(e: any, index: number) => ({
label: e,
value: index,
})
);
question2Answer.value = data.question2Answer.map(
(e: any, index: number) => ({
label: e,
value: index,
})
);
question3Answer.value = data.question3Answer.map(
(e: any, index: number) => ({
label: e,
value: index,
})
);
question4Answer.value = data.question4Answer.map(
(e: any, index: number) => ({
label: e,
value: index,
})
);
question7Answer.value = data.question7Answer.map((e: any) => ({
label: e,
value: e == "ไม่มี" ? false : true,
}));
question8Answer.value = data.question8Answer.map((e: any) => ({
label: e,
value: e == "แนะนำ" ? true : false,
}));
question9Answer.value = data.question9Answer.map((e: any) => ({
label: e,
value: e == "อยาก" ? true : false,
}));
})
.catch((err) => {
messageError($q, err);
});
}
watch(score, () => { watch(score, () => {
scoreTotal.value = score.reduce((accumulator, object) => { scoreTotal.value = score.reduce((accumulator, object) => {
@ -311,11 +392,13 @@ const putData = () => {
> >
แบบสอบถาม แบบสอบถาม
</div> </div>
<q-separator /> <q-separator />
<div class="col-12 row q-pa-sm q-col-gutter-sm"> <div class="col-12 row q-pa-sm q-col-gutter-sm">
<div class="col-10 text-top0 items-center"> <div class="col-10 text-top0 items-center">
1. เหตใดทานจงตดสนใจรวมงานกบกรงเทพมหานคร (เลอกไดมากกว <!-- 1. เหตใดทานจงตดสนใจรวมงานกบกรงเทพมหานคร (เลอกไดมากกว
1 ) 1 ) -->
{{ questionDesc.question1Desc }}
</div> </div>
<div class="col-2 text-top0 items-center"> <div class="col-2 text-top0 items-center">
<q-input <q-input
@ -330,7 +413,7 @@ const putData = () => {
</div> </div>
<q-option-group <q-option-group
:options="reasonWork_option" :options="question1Answer"
type="checkbox" type="checkbox"
v-model="reasonWork" v-model="reasonWork"
disable disable
@ -356,8 +439,9 @@ const putData = () => {
</q-item-label> </q-item-label>
</div> </div>
<div class="col-10 text-top0 items-center"> <div class="col-10 text-top0 items-center">
2. สำหรบการลาออกในครงน <!-- 2. สำหรบการลาออกในครงน
านไดดทบทวนอยางจรงจงเปนระยะเวลานานเทาใด านไดดทบทวนอยางจรงจงเปนระยะเวลานานเทาใด -->
{{ questionDesc.question2Desc }}
</div> </div>
<div class="col-2 text-top0 items-center"> <div class="col-2 text-top0 items-center">
<q-input <q-input
@ -373,7 +457,7 @@ const putData = () => {
<div class="col-12"> <div class="col-12">
<q-option-group <q-option-group
:options="timeThink_option" :options="question2Answer"
type="radio" type="radio"
v-model="timeThink" v-model="timeThink"
disable disable
@ -381,8 +465,9 @@ const putData = () => {
</div> </div>
<div class="col-10 text-top0 items-center"> <div class="col-10 text-top0 items-center">
3. จจยใดททำใหานตดสนใจลาออกจากราชการ (เลอกไดมากกว 1 <!-- 3. จจยใดททำใหานตดสนใจลาออกจากราชการ (เลอกไดมากกว 1
) ) -->
{{ questionDesc.question3Desc }}
</div> </div>
<div class="col-2 text-top0 items-center"> <div class="col-2 text-top0 items-center">
@ -398,7 +483,7 @@ const putData = () => {
</div> </div>
<q-option-group <q-option-group
:options="exitFactor_option" :options="question3Answer"
type="checkbox" type="checkbox"
v-model="exitFactor" v-model="exitFactor"
disable disable
@ -426,7 +511,8 @@ const putData = () => {
</div> </div>
<div class="col-10 text-top0 items-center"> <div class="col-10 text-top0 items-center">
4. อะไรคอสงทานเหนวาควรปรบปร (เลอกไดมากกว 1 ) <!-- 4. อะไรคอสงทานเหนวาควรปรบปร (เลอกไดมากกว 1 ) -->
{{ questionDesc.question4Desc }}
</div> </div>
<div class="col-2 text-top0 items-center"> <div class="col-2 text-top0 items-center">
@ -443,7 +529,7 @@ const putData = () => {
<q-list> <q-list>
<q-option-group <q-option-group
:options="adjust_option" :options="question4Answer"
type="checkbox" type="checkbox"
v-model="adjust" v-model="adjust"
disable disable
@ -470,8 +556,9 @@ const putData = () => {
</q-item-label> </q-item-label>
</div> </div>
<div class="col-10 text-top0 items-center"> <div class="col-10 text-top0 items-center">
5. โปรดระบสาเหตแทจร <!-- 5. โปรดระบสาเหตแทจร
ทำใหานตดสนใจลาออกจากการปฏราชการกบกรงเทพมหานคร ? ทำใหานตดสนใจลาออกจากการปฏราชการกบกรงเทพมหานคร ? -->
{{ questionDesc.question5Desc }}
</div> </div>
<div class="col-2 text-top0 items-center"> <div class="col-2 text-top0 items-center">
<q-input <q-input
@ -496,8 +583,9 @@ const putData = () => {
/> />
<div class="col-10 text-top0 items-center"> <div class="col-10 text-top0 items-center">
6. จจยใดทจะชวยทำใหานเปลยนใจ <!-- 6. จจยใดทจะชวยทำใหานเปลยนใจ
ไมอยากลาออกจากการปฏราชการกบกรงเทพมหานคร ไมอยากลาออกจากการปฏราชการกบกรงเทพมหานคร -->
{{ questionDesc.question6Desc }}
</div> </div>
<div class="col-2 text-top0 items-center"> <div class="col-2 text-top0 items-center">
<q-input <q-input
@ -522,10 +610,11 @@ const putData = () => {
/> />
<div class="col-10 text-top0 items-center"> <div class="col-10 text-top0 items-center">
7. านมงานใหมหรอไม าม (โปรดระบ <!-- 7. านมงานใหมหรอไม าม (โปรดระบ
อบรทเอกชน/หนวยงานภาคร) อบรทเอกชน/หนวยงานภาคร)
และอะไรคอสงททำงานใหมใหบทาน และอะไรคอสงททำงานใหมใหบทาน
งทานรกวาเปนทาพอใจมากกวาการปฏราชการกบกรงเทพมหานคร งทานรกวาเปนทาพอใจมากกวาการปฏราชการกบกรงเทพมหานคร -->
{{ questionDesc.question7Desc }}
</div> </div>
<div class="col-2 text-top0 items-center"> <div class="col-2 text-top0 items-center">
@ -541,7 +630,7 @@ const putData = () => {
</div> </div>
<q-option-group <q-option-group
:options="haveJob_option" :options="question7Answer"
type="radio" type="radio"
v-model="haveJob" v-model="haveJob"
disable disable
@ -567,8 +656,9 @@ const putData = () => {
</q-item-label> </q-item-label>
</div> </div>
<div class="col-10 text-top0 items-center"> <div class="col-10 text-top0 items-center">
8. านจะแนะนำเพอนใหมารวมงานกบกรงเทพมหานครหรอไม (าไม <!-- 8. านจะแนะนำเพอนใหมารวมงานกบกรงเทพมหานครหรอไม (าไม
โปรดระบเหตผล) โปรดระบเหตผล) -->
{{ questionDesc.question8Desc }}
</div> </div>
<div class="col-2 text-top0 items-center"> <div class="col-2 text-top0 items-center">
@ -584,7 +674,7 @@ const putData = () => {
</div> </div>
<q-option-group <q-option-group
:options="suggestFriends_option" :options="question8Answer"
type="radio" type="radio"
v-model="suggestFriends" v-model="suggestFriends"
disable disable
@ -610,9 +700,10 @@ const putData = () => {
</q-item-label> </q-item-label>
</div> </div>
<div class="col-10 text-top0 items-center"> <div class="col-10 text-top0 items-center">
9. หากทานมโอกาสในอนาคต <!-- 9. หากทานมโอกาสในอนาคต
านอยากกลบมารวมงานกบกรงเทพมหานครหรอไม (าไม านอยากกลบมารวมงานกบกรงเทพมหานครหรอไม (าไม
โปรดระบเหตผล) โปรดระบเหตผล) -->
{{ questionDesc.question9Desc }}
</div> </div>
<div class="col-2 text-top0 items-center"> <div class="col-2 text-top0 items-center">
<q-input <q-input
@ -625,9 +716,8 @@ const putData = () => {
:rules="[(val) => val !== '' || 'กรุณากรอกคะเเนน']" :rules="[(val) => val !== '' || 'กรุณากรอกคะเเนน']"
/> />
</div> </div>
<q-option-group <q-option-group
:options="futureWork_option" :options="question9Answer"
type="radio" type="radio"
v-model="futureWork" v-model="futureWork"
disable disable
@ -654,7 +744,8 @@ const putData = () => {
</div> </div>
<div class="col-10 text-top0 items-center"> <div class="col-10 text-top0 items-center">
10. ความคดเหนและขอเสนอแนะอ <!-- 10. ความคดเหนและขอเสนอแนะอ -->
{{ questionDesc.question10Desc }}
</div> </div>
<div class="col-2 text-top0 items-center"> <div class="col-2 text-top0 items-center">
<q-input <q-input

View file

@ -1 +1,14 @@
export type {}; interface OptionQuestions {
label: string;
value: number;
}
interface OptionQuestions2 {
label: string;
value: boolean;
}
export type {
OptionQuestions,
OptionQuestions2
};

View file

@ -194,7 +194,7 @@ const dialogDeleteData = async (id: string) => {
const deleteData = async (id: string) => { const deleteData = async (id: string) => {
await http await http
.delete(config.API.personsOrder(id)) .delete(config.API.personsOrder(id))
.then((res) => { .then(() => {
success($q, "ลบข้อมูลสำเร็จ"); success($q, "ลบข้อมูลสำเร็จ");
}) })
.catch((e) => { .catch((e) => {
@ -271,8 +271,6 @@ const fetchSalary = async (personalId: string) => {
.get(config.API.salaryOrder(personalId)) .get(config.API.salaryOrder(personalId))
.then((res: any) => { .then((res: any) => {
const data = res.data.result; const data = res.data.result;
console.log(data);
modalData.value = { modalData.value = {
salaryAmount: salaryAmount:
data.salaryAmount === 0 && data.salaryAmount === 0 &&
@ -318,7 +316,7 @@ const putSalary = async (salary: any) => {
} }
await http await http
.put(config.API.salaryOrder(personalId.value), modalData.value) .put(config.API.salaryOrder(personalId.value), modalData.value)
.then((any) => { .then(() => {
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
}) })
.catch((e) => { .catch((e) => {