Merge branch 'develop' into working
This commit is contained in:
commit
6384d80488
26 changed files with 692 additions and 295 deletions
|
|
@ -10,6 +10,7 @@ const placemenRelocation = `${placement}/relocation`;
|
|||
const placemenOther = `${env.API_URI}/retirement/other`;
|
||||
const placemenAppointment = `${placement}/appointment`;
|
||||
|
||||
|
||||
export default {
|
||||
MainDetail: (year: number) => `${placement}/exam/${year}`,
|
||||
yearOptions: () => `${placement}/fiscal`,
|
||||
|
|
@ -59,6 +60,10 @@ export default {
|
|||
// clear Position
|
||||
clearPosition: (personalId: string) =>
|
||||
`${placement}/position/clear/${personalId}`,
|
||||
// Document
|
||||
documentByid: (personalId: string) => `${placement}/doc/${personalId}`,
|
||||
documentDelid: (personalId: string, docid: string) => `${placement}/doc/${personalId}/${docid}`,
|
||||
|
||||
|
||||
// order
|
||||
organizationsOrder: () => `${order}/order/organizations`,
|
||||
|
|
|
|||
|
|
@ -374,34 +374,34 @@ const menuList = readonly<any[]>([
|
|||
},
|
||||
],
|
||||
},
|
||||
// {
|
||||
// key: 9,
|
||||
// icon: "mdi-calendar",
|
||||
// activeIcon: "mdi-calendar",
|
||||
// label: "การลา",
|
||||
// path: "leave",
|
||||
// role: "coin",
|
||||
// children: [
|
||||
// {
|
||||
// key: 9.1,
|
||||
// label: "รายการลงเวลาปฏิบัติงาน",
|
||||
// path: "/work-list",
|
||||
// role: "coin",
|
||||
// },
|
||||
// {
|
||||
// key: 9.2,
|
||||
// label: "รายการลา",
|
||||
// path: "/leave-list",
|
||||
// role: "coin",
|
||||
// },
|
||||
// {
|
||||
// key: 9.3,
|
||||
// label: "รายงานสถิติ",
|
||||
// path: "/statistics-report",
|
||||
// role: "coin",
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
key: 9,
|
||||
icon: "mdi-calendar",
|
||||
activeIcon: "mdi-calendar",
|
||||
label: "การลา",
|
||||
path: "leave",
|
||||
role: "coin",
|
||||
children: [
|
||||
{
|
||||
key: 9.1,
|
||||
label: "รายการลงเวลาปฏิบัติงาน",
|
||||
path: "/work-list",
|
||||
role: "coin",
|
||||
},
|
||||
{
|
||||
key: 9.2,
|
||||
label: "รายการลา",
|
||||
path: "/leave-list",
|
||||
role: "coin",
|
||||
},
|
||||
{
|
||||
key: 9.3,
|
||||
label: "รายงานสถิติ",
|
||||
path: "/statistics-report",
|
||||
role: "coin",
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
||||
const tabList = readonly<tabType[]>([
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import { useQuasar } from "quasar";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import { usePersonalDataStore } from "@/modules/05_placement/storePersona";
|
||||
|
||||
import Informationvue from "@/modules/05_placement/components/PersonalDetail/Information/Information.vue";
|
||||
import Addressvue from "@/modules/05_placement/components/PersonalDetail/Information/Address.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 Qualification from "@/modules/05_placement/components/PersonalDetail/Qualification.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 {
|
||||
AddressDataDefualt,
|
||||
|
|
@ -38,6 +40,7 @@ const $q = useQuasar(); // show dialog
|
|||
const router = useRouter();
|
||||
const store = useDataStore();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const storePersonal = usePersonalDataStore();
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
const { changeTab } = store;
|
||||
const statusEdit = ref<boolean>(false);
|
||||
|
|
@ -115,7 +118,7 @@ const fetchData = async () => {
|
|||
.get(config.API.placementPersonalId(examId.value))
|
||||
.then((res: any) => {
|
||||
const data = res.data.result;
|
||||
|
||||
storePersonal.fecthDataInformation(data);
|
||||
personalData.value.fullName = data.fullName;
|
||||
personalData.value.id = data.personalId;
|
||||
|
||||
|
|
@ -253,7 +256,7 @@ const fetchData = async () => {
|
|||
รายละเอียดของ {{ personalData.fullName }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="q-pb-lg">
|
||||
<div class="q-pb-lg" v-if="storePersonal.loading">
|
||||
<q-card class="row q-pb-lg">
|
||||
<div id="information" name="1" class="col-12 q-pa-sm">
|
||||
<Informationvue
|
||||
|
|
@ -316,7 +319,11 @@ const fetchData = async () => {
|
|||
<q-separator size="4px" />
|
||||
</div>
|
||||
<!-- v-model:data="QualificationData" -->
|
||||
<Document v-model:statusEdit="statusEdit" :fetch="fetchData" />
|
||||
<Document
|
||||
v-model:statusEdit="statusEdit"
|
||||
:fetch="fetchData"
|
||||
:datainformation="storePersonal.dataMain"
|
||||
/>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ watch(visibleColumns, async (count: String[], prevCount: String[]) => {
|
|||
onMounted(async () => {
|
||||
await fetchLevel();
|
||||
await fetchPositionPath();
|
||||
await props.fetch();
|
||||
// await props.fetch();
|
||||
rows.value = props.data;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -67,17 +67,17 @@ const registAddress = reactive<AddressData>({
|
|||
zipCode: "",
|
||||
districtId: "",
|
||||
provinceId: "",
|
||||
})
|
||||
});
|
||||
|
||||
const currentAddress = reactive<AddressData>({
|
||||
subDistrictId: "",
|
||||
zipCode: "",
|
||||
districtId: "",
|
||||
provinceId: "",
|
||||
})
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
await getNewData();
|
||||
// await getNewData();
|
||||
emit("update:statusEdit", false);
|
||||
});
|
||||
|
||||
|
|
@ -126,7 +126,9 @@ const filterSelector = (val: any, update: Function, refData: string) => {
|
|||
|
||||
const refreshData = async () => {
|
||||
myform.value.reset();
|
||||
await getNewData();
|
||||
await props.fetch();
|
||||
await fetchProvince();
|
||||
// await getNewData();
|
||||
};
|
||||
|
||||
const getNewData = async () => {
|
||||
|
|
@ -179,7 +181,9 @@ const editData = async () => {
|
|||
.finally(async () => {
|
||||
edit.value = 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) => {
|
||||
if (e != null) {
|
||||
if (name == "1") {
|
||||
registAddress.subDistrictId = ""
|
||||
registAddress.zipCode = ""
|
||||
registAddress.districtId = ""
|
||||
registAddress.subDistrictId = "";
|
||||
registAddress.zipCode = "";
|
||||
registAddress.districtId = "";
|
||||
} else {
|
||||
currentAddress.subDistrictId = ""
|
||||
currentAddress.zipCode = ""
|
||||
currentAddress.districtId = ""
|
||||
currentAddress.subDistrictId = "";
|
||||
currentAddress.zipCode = "";
|
||||
currentAddress.districtId = "";
|
||||
}
|
||||
myform.value.resetValidation();
|
||||
await fetchDistrict(e, name);
|
||||
|
|
@ -253,36 +257,58 @@ const fetchProvince = async () => {
|
|||
Ops.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 จังหวัดว่างไม่ดึงค่าอำเภอ ตำบล และรหัสไปรษณีย์
|
||||
if (addressData.value.registProvinceId == '' || addressData.value.registProvinceId == '00000000-0000-0000-0000-000000000000' || !checkRegistProvinceId) {
|
||||
registAddress.subDistrictId = ""
|
||||
registAddress.zipCode = ""
|
||||
registAddress.districtId = ""
|
||||
if (
|
||||
addressData.value.registProvinceId == "" ||
|
||||
addressData.value.registProvinceId ==
|
||||
"00000000-0000-0000-0000-000000000000" ||
|
||||
!checkRegistProvinceId
|
||||
) {
|
||||
registAddress.subDistrictId = "";
|
||||
registAddress.zipCode = "";
|
||||
registAddress.districtId = "";
|
||||
} else {
|
||||
registAddress.provinceId = await addressData.value.registProvinceId
|
||||
registAddress.zipCode = await addressData.value.registZipCode
|
||||
registAddress.provinceId = await addressData.value.registProvinceId;
|
||||
registAddress.zipCode = await addressData.value.registZipCode;
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
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 จังหวัดว่างไม่ดึงค่าอำเภอ ตำบล และรหัสไปรษณีย์
|
||||
if (addressData.value.currentProvinceId == '' || addressData.value.currentProvinceId == '00000000-0000-0000-0000-000000000000' || !checkCurrentProvinceId) {
|
||||
currentAddress.subDistrictId = ""
|
||||
currentAddress.zipCode = ""
|
||||
currentAddress.districtId = ""
|
||||
if (
|
||||
addressData.value.currentProvinceId == "" ||
|
||||
addressData.value.currentProvinceId ==
|
||||
"00000000-0000-0000-0000-000000000000" ||
|
||||
!checkCurrentProvinceId
|
||||
) {
|
||||
currentAddress.subDistrictId = "";
|
||||
currentAddress.zipCode = "";
|
||||
currentAddress.districtId = "";
|
||||
} else {
|
||||
currentAddress.provinceId = addressData.value.currentProvinceId
|
||||
currentAddress.zipCode = addressData.value.currentZipCode
|
||||
currentAddress.provinceId = addressData.value.currentProvinceId;
|
||||
currentAddress.zipCode = addressData.value.currentZipCode;
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
|
@ -312,19 +338,23 @@ const fetchDistrict = async (id: string | null, position: string) => {
|
|||
OpsFilter.value.districtOps = option;
|
||||
|
||||
// ที่อยู่ เช็คอำเภอว่ามี 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) {
|
||||
registAddress.districtId = addressData.value.registDistrictId
|
||||
registAddress.districtId = addressData.value.registDistrictId;
|
||||
}
|
||||
} else {
|
||||
Ops.value.districtCOps = option;
|
||||
OpsFilter.value.districtCOps = option;
|
||||
|
||||
// ที่อยู่ปัจจุบัน เช็คอำเภอว่ามี 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) {
|
||||
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;
|
||||
|
||||
// ที่อยู่ เช็คตำบลว่ามี 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) {
|
||||
registAddress.subDistrictId = addressData.value.registSubDistrictId
|
||||
registAddress.subDistrictId = addressData.value.registSubDistrictId;
|
||||
}
|
||||
} else {
|
||||
Ops.value.subdistrictCOps = option;
|
||||
OpsFilter.value.subdistrictCOps = option;
|
||||
|
||||
// ที่อยู่ปัจจุบัน เช็คตำบลว่ามี 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) {
|
||||
currentAddress.subDistrictId = addressData.value.currentSubDistrictId
|
||||
currentAddress.subDistrictId =
|
||||
addressData.value.currentSubDistrictId;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -405,91 +440,268 @@ const getClass = (val: boolean) => {
|
|||
|
||||
<template>
|
||||
<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"
|
||||
:changeBtn="changeBtn" :disable="statusEdit" :cancel="refreshData" />
|
||||
<HeaderTop
|
||||
v-model:edit="edit"
|
||||
header="ข้อมูลที่อยู่"
|
||||
icon="mdi-map-marker"
|
||||
:save="saveData"
|
||||
:history="false"
|
||||
:changeBtn="changeBtn"
|
||||
:disable="statusEdit"
|
||||
:cancel="refreshData"
|
||||
/>
|
||||
<q-form ref="myform">
|
||||
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||
<div class="col-xs-12">
|
||||
<q-input :class="getClass(edit)" hide-bottom-space :outlined="edit" dense lazy-rules type="textarea" autogrow
|
||||
:readonly="!edit" :borderless="!edit" v-model="addressData.registAddress"
|
||||
<q-input
|
||||
: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 || `${'กรุณากรอก ที่อยู่ตามทะเบียนบ้าน'}`]"
|
||||
:label="`${'ที่อยู่ตามทะเบียนบ้าน'}`" />
|
||||
:label="`${'ที่อยู่ตามทะเบียนบ้าน'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<selector :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="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,
|
||||
<selector
|
||||
: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="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'
|
||||
)" />
|
||||
)"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<selector :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="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,
|
||||
<selector
|
||||
: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="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'
|
||||
)" />
|
||||
)"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<selector :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="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,
|
||||
<selector
|
||||
: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="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'
|
||||
)" />
|
||||
)"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||
<q-input :class="getClass(edit)" hide-bottom-space dense lazy-rules readonly borderless
|
||||
v-model="registAddress.zipCode" :style="!edit ? '' : 'padding:0 12px;'" :label="`${'รหัสไปรษณีย์'}`" />
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
hide-bottom-space
|
||||
dense
|
||||
lazy-rules
|
||||
readonly
|
||||
borderless
|
||||
v-model="registAddress.zipCode"
|
||||
:style="!edit ? '' : 'padding:0 12px;'"
|
||||
:label="`${'รหัสไปรษณีย์'}`"
|
||||
/>
|
||||
</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">
|
||||
<label class="text-bold">ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้าน</label>
|
||||
<q-radio 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" />
|
||||
<label class="text-bold"
|
||||
>ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้าน</label
|
||||
>
|
||||
<q-radio
|
||||
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 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
|
||||
:readonly="!edit" :borderless="!edit" v-model="addressData.currentAddress"
|
||||
:rules="[(val: string) => !!val || `${'กรุณากรอก ที่อยู่ปัจจุบัน'}`]" :label="`${'ที่อยู่ปัจจุบัน'}`" />
|
||||
<q-input
|
||||
:class="getClass(edit)"
|
||||
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 class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.registSame == '0'">
|
||||
<selector :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,
|
||||
<div
|
||||
class="col-xs-6 col-sm-3 col-md-3"
|
||||
v-if="addressData.registSame == '0'"
|
||||
>
|
||||
<selector
|
||||
: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'
|
||||
)" />
|
||||
)"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.registSame == '0'">
|
||||
<selector :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,
|
||||
<div
|
||||
class="col-xs-6 col-sm-3 col-md-3"
|
||||
v-if="addressData.registSame == '0'"
|
||||
>
|
||||
<selector
|
||||
: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'
|
||||
)" />
|
||||
)"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.registSame == '0'">
|
||||
<selector :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,
|
||||
<div
|
||||
class="col-xs-6 col-sm-3 col-md-3"
|
||||
v-if="addressData.registSame == '0'"
|
||||
>
|
||||
<selector
|
||||
: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'
|
||||
)" />
|
||||
)"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-3 col-md-3" 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
|
||||
class="col-xs-6 col-sm-3 col-md-3"
|
||||
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>
|
||||
</q-form>
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ onMounted(async () => {
|
|||
if (route.params.id) {
|
||||
profileId.value = route.params.personalId.toString();
|
||||
}
|
||||
await props.fetch();
|
||||
// await props.fetch();
|
||||
rows.value = props.data;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -159,6 +159,9 @@ const props = defineProps({
|
|||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
datainformation: {
|
||||
type: Array,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["update:statusEdit"]);
|
||||
|
||||
|
|
@ -167,49 +170,53 @@ const mixin = useCounterMixin();
|
|||
const route = useRoute();
|
||||
const { success, messageError, showLoader, hideLoader } = mixin;
|
||||
const profileId = ref<string>(
|
||||
route.params.id ? route.params.id.toString() : ""
|
||||
route.params.personalId ? route.params.personalId.toString() : ""
|
||||
);
|
||||
const edit = ref<boolean>(false);
|
||||
const uploader = ref<any>();
|
||||
const files = ref<any>([]);
|
||||
const file = ref<any>([]);
|
||||
const name = ref<string>("");
|
||||
const dataMain = ref<any>([]);
|
||||
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
// props.fetch()
|
||||
});
|
||||
|
||||
const getData = async () => {
|
||||
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();
|
||||
});
|
||||
if (props.datainformation) {
|
||||
dataMain.value = props.datainformation;
|
||||
files.value = dataMain.value.docs;
|
||||
}
|
||||
// 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) => {
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.profilePaperId(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
.delete(config.API.documentDelid(profileId.value, id))
|
||||
.then(() => {
|
||||
success($q, "ลบไฟล์เอกสารสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await getData();
|
||||
await props.fetch();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -221,13 +228,12 @@ const uploadData = async () => {
|
|||
type: file.value[0].type,
|
||||
});
|
||||
const formData = new FormData();
|
||||
formData.append("avatar", newFile);
|
||||
formData.append("moss", "newFile");
|
||||
formData.append("docs", newFile);
|
||||
// formData.append("moss", "newFile");
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.profilePaperId(profileId.value), formData)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
.put(config.API.documentByid(profileId.value), formData)
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -238,15 +244,15 @@ const uploadData = async () => {
|
|||
name.value = "";
|
||||
edit.value = false;
|
||||
emit("update:statusEdit", false);
|
||||
await getData();
|
||||
await props.fetch();
|
||||
});
|
||||
} else {
|
||||
// modalError(
|
||||
// $q,
|
||||
// "ไม่สามารถอัปโหลดไฟล์ได้",
|
||||
// "กรุณาเลือกไฟล์ที่ต้องการอัปโหลด"
|
||||
// );
|
||||
getData();
|
||||
// } else {
|
||||
// // modalError(
|
||||
// // $q,
|
||||
// // "ไม่สามารถอัปโหลดไฟล์ได้",
|
||||
// // "กรุณาเลือกไฟล์ที่ต้องการอัปโหลด"
|
||||
// // );
|
||||
// getData();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ const editData = async () => {
|
|||
};
|
||||
await http
|
||||
.put(config.API.placementFamilyId(route.params.personalId.toString()), body)
|
||||
.then((res) => {
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ const fetchPlacementData = async () => {
|
|||
class="q-mr-sm"
|
||||
@click="router.push(`/placement`)"
|
||||
/>
|
||||
รายชื่อผู้สอบในรอบs {{ title }} ครั้งที่ {{ round }} ปี {{ year }}
|
||||
รายชื่อผู้สอบในรอบ {{ title }} ครั้งที่ {{ round }} ปี {{ year }}
|
||||
</div>
|
||||
<q-card bordered class="q-py-sm row col-12">
|
||||
<div class="col-12 row bg-white">
|
||||
|
|
|
|||
22
src/modules/05_placement/storePersona.ts
Normal file
22
src/modules/05_placement/storePersona.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
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
|
||||
dataMain.value.length !== 0 ? loading.value = true : loading.value = false
|
||||
}
|
||||
|
||||
return {
|
||||
fecthDataInformation,
|
||||
dataMain,
|
||||
loading,
|
||||
|
||||
};
|
||||
})
|
||||
|
|
@ -56,7 +56,7 @@ const clickAdd = () => {
|
|||
props.actionOptio;
|
||||
let list = props.actionOptio.map((e: any) => ({
|
||||
id: e.id,
|
||||
round: `รอบ ${e.round} (ฉบับวันที่ ${e.signDate})`,
|
||||
round: `รอบ ${e.round} (ประกาศ ณ วันที่ ${e.signDate})`,
|
||||
}));
|
||||
actionOption.value = list;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -721,6 +721,13 @@ const clearInsigniaFilters = (name: string) => {
|
|||
)
|
||||
" class="cursor-pointer" />
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<div>
|
||||
<q-select class="col-2" v-model="DataStore.employeeClass" dense outlined lazy-rules hide-bottom-space
|
||||
|
|
@ -742,6 +749,13 @@ const clearInsigniaFilters = (name: string) => {
|
|||
)
|
||||
" class="cursor-pointer" />
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -314,6 +314,13 @@ const clearInsigniaFilters = (name: string) => {
|
|||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<div>
|
||||
<q-select
|
||||
|
|
@ -356,6 +363,13 @@ const clearInsigniaFilters = (name: string) => {
|
|||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<q-space />
|
||||
|
|
|
|||
|
|
@ -311,6 +311,13 @@ const clearInsigniaFilters = (name: string) => {
|
|||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<div>
|
||||
<q-select
|
||||
|
|
@ -353,6 +360,13 @@ const clearInsigniaFilters = (name: string) => {
|
|||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<q-space />
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ const props = defineProps({
|
|||
fecthlistInsignia: Function,
|
||||
dateCheckReceive: String,
|
||||
dateCheckReturn: String,
|
||||
|
||||
dataModal: Object,
|
||||
});
|
||||
// reset วันที่ประกาศราชกิจจานุเบกษา
|
||||
|
|
@ -126,6 +127,8 @@ watch(props, () => {
|
|||
Datereceive.value = props.dataModal.dateReceiveInsignia;
|
||||
Datereturn.value = props.dataModal.dateReturnInsignia;
|
||||
OrganazationId.value = props.dataModal.orgReceiveInsignia;
|
||||
files.value = props.dataModal.docReceiveInsignia
|
||||
filesReturn.value =props.dataModal.docReturnInsignia
|
||||
OrganazationId2.value =
|
||||
Datereturn.value != null
|
||||
? props.dataModal.orgReturnInsignia == null ||
|
||||
|
|
@ -211,7 +214,7 @@ onMounted(() => {
|
|||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<div class="col-xs-12 col-sm-4" v-if="files === null">
|
||||
<q-file
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -245,6 +248,14 @@ onMounted(() => {
|
|||
:disable="dateCheckReceive !== null"
|
||||
/>
|
||||
</div>
|
||||
<q-btn
|
||||
type="a"
|
||||
target="_blank"
|
||||
:href="files"
|
||||
size="md" icon="mdi-download" flat round color="primary"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดเอกสาร รับเครื่องราชฯ</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<div
|
||||
|
|
@ -300,7 +311,7 @@ onMounted(() => {
|
|||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<div class="col-xs-12 col-sm-4" v-if="filesReturn === null">
|
||||
<q-file
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -334,6 +345,14 @@ onMounted(() => {
|
|||
:disable="dateCheckReturn !== null"
|
||||
/>
|
||||
</div>
|
||||
<q-btn
|
||||
type="a"
|
||||
target="_blank"
|
||||
:href="filesReturn"
|
||||
size="md" icon="mdi-download" flat round color="primary"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลดเอกสาร คืนเครื่องราชฯ</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
|
|
|
|||
|
|
@ -316,6 +316,7 @@ const filterSelector = (val: any, update: Function, name: any) => {
|
|||
)
|
||||
}
|
||||
const clearInsigniaFilters = (name: string) => {
|
||||
console.log(insigniaOp.value)
|
||||
if (name === "filterInsigniaOp") {
|
||||
DataStore.insignia = '';
|
||||
filterInsigniaOp.value = insigniaOp.value;
|
||||
|
|
@ -352,6 +353,13 @@ const clearInsigniaFilters = (name: string) => {
|
|||
input-class="text-bold text-grey"
|
||||
@update:model-value="selectorRound(selectRound)"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<q-separator />
|
||||
|
|
@ -412,6 +420,13 @@ const clearInsigniaFilters = (name: string) => {
|
|||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ const roundYear = ref<any>();
|
|||
const insigniaList = ref<any>([]);
|
||||
const fileterInsigniaList = ref<any>([]);
|
||||
const loadView = ref<boolean>(false);
|
||||
const employeeClassOps = ref<any>(DataStore.employeeClassOps)
|
||||
const employeeClassOps = ref<any>(DataStore.employeeClassOps);
|
||||
onMounted(async () => {
|
||||
await fecthRound();
|
||||
});
|
||||
|
|
@ -61,10 +61,10 @@ const fecthRound = async () => {
|
|||
year: e.year,
|
||||
});
|
||||
});
|
||||
filterSelectRoundAllOption.value = selectRoundAllOption.value
|
||||
filterSelectRoundAllOption.value = selectRoundAllOption.value;
|
||||
selectRound.value = data[0].id;
|
||||
filterSelectRoundOption.value = selectRoundOption.value
|
||||
console.log(filterSelectRoundOption.value)
|
||||
filterSelectRoundOption.value = selectRoundOption.value;
|
||||
console.log(filterSelectRoundOption.value);
|
||||
yearRound.value = data[0].year;
|
||||
roundYear.value = data[0].year;
|
||||
if (roundYear.value) {
|
||||
|
|
@ -331,7 +331,7 @@ watch(tab, async () => {
|
|||
(x: any) => x.type == tab.value || x.type == ""
|
||||
);
|
||||
DataStore.insignia = "";
|
||||
fileterInsigniaList.value = insigniaList.value
|
||||
fileterInsigniaList.value = insigniaList.value;
|
||||
fecthlistInsignia();
|
||||
});
|
||||
|
||||
|
|
@ -401,34 +401,30 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
const filterSelector = (val: any, update: Function, name: any) => {
|
||||
update(() => {
|
||||
const needle = val.toLowerCase();
|
||||
if (name === 'employeeClassOps') {
|
||||
DataStore.employeeClass = ''
|
||||
employeeClassOps.value = DataStore.employeeClassOps.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
}
|
||||
else if (name === 'fileterInsigniaList') {
|
||||
DataStore.insignia = null as any
|
||||
if (name === "employeeClassOps") {
|
||||
DataStore.employeeClass = "";
|
||||
employeeClassOps.value = DataStore.employeeClassOps.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
} else if (name === "fileterInsigniaList") {
|
||||
DataStore.insignia = null as any;
|
||||
fileterInsigniaList.value = insigniaList.value.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
}
|
||||
else if (name === 'filterSelectRoundAllOption') {
|
||||
yearRound.value = null as any
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
} else if (name === "filterSelectRoundAllOption") {
|
||||
yearRound.value = null as any;
|
||||
filterSelectRoundAllOption.value = selectRoundAllOption.value.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const clearInsigniaFilters = (name: string) => {
|
||||
if (name === "employeeClassOps") {
|
||||
DataStore.employeeClass = "all";
|
||||
employeeClassOps.value = DataStore.employeeClassOps;
|
||||
}
|
||||
else if (name === "fileterInsigniaList") {
|
||||
} else if (name === "fileterInsigniaList") {
|
||||
DataStore.insignia = "";
|
||||
fileterInsigniaList.value = insigniaList.value;
|
||||
}
|
||||
|
|
@ -470,27 +466,34 @@ const clearInsigniaFilters = (name: string) => {
|
|||
>
|
||||
<div class="q-pa-md">
|
||||
<div class="row col-12 q-pb-sm q-col-gutter-x-xs">
|
||||
|
||||
<q-select
|
||||
v-model="yearRound"
|
||||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:label="`${'รอบการเสนอขอเครื่องราชฯ'}`"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
option-label="name"
|
||||
:options="filterSelectRoundAllOption"
|
||||
option-value="year"
|
||||
:borderless="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="selectorRound"
|
||||
@filter="(inputValue:any,
|
||||
<q-select
|
||||
v-model="yearRound"
|
||||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:label="`${'รอบการเสนอขอเครื่องราชฯ'}`"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
option-label="name"
|
||||
:options="filterSelectRoundAllOption"
|
||||
option-value="year"
|
||||
:borderless="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="selectorRound"
|
||||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'filterSelectRoundAllOption'
|
||||
) "
|
||||
/>
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<div>
|
||||
<q-select
|
||||
v-model="DataStore.insignia"
|
||||
|
|
@ -514,68 +517,84 @@ const clearInsigniaFilters = (name: string) => {
|
|||
DataStore.employeeClass
|
||||
)
|
||||
"
|
||||
@filter="(inputValue:any,
|
||||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'fileterInsigniaList'
|
||||
) "
|
||||
>
|
||||
<template v-if="DataStore.insignia !== ''" v-slot:append>
|
||||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="
|
||||
clearInsigniaFilters('fileterInsigniaList'),
|
||||
>
|
||||
<template v-if="DataStore.insignia !== ''" v-slot:append>
|
||||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="
|
||||
clearInsigniaFilters('fileterInsigniaList'),
|
||||
DataStore.searchDatatable(
|
||||
DataStore.insignia,
|
||||
DataStore.employeeClass
|
||||
)
|
||||
"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div>
|
||||
<q-select
|
||||
class="col-2"
|
||||
v-model="DataStore.employeeClass"
|
||||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:label="`${'สถานภาพ'}`"
|
||||
emit-value
|
||||
use-input
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="employeeClassOps"
|
||||
option-value="id"
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="
|
||||
DataStore.searchDatatable(
|
||||
DataStore.insignia,
|
||||
DataStore.employeeClass
|
||||
)
|
||||
"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
<q-select
|
||||
class="col-2"
|
||||
v-model="DataStore.employeeClass"
|
||||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
:label="`${'สถานภาพ'}`"
|
||||
emit-value
|
||||
use-input
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="employeeClassOps"
|
||||
option-value="id"
|
||||
:readonly="false"
|
||||
:borderless="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="
|
||||
DataStore.searchDatatable(
|
||||
DataStore.insignia,
|
||||
DataStore.employeeClass
|
||||
)
|
||||
"
|
||||
@filter="(inputValue:any,
|
||||
"
|
||||
@filter="(inputValue:any,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'employeeClassOps'
|
||||
) "
|
||||
>
|
||||
<template v-if="DataStore.employeeClass !== 'all'" v-slot:append>
|
||||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="
|
||||
clearInsigniaFilters('employeeClassOps'),
|
||||
DataStore.searchDatatable(
|
||||
DataStore.insignia,
|
||||
DataStore.employeeClass
|
||||
)
|
||||
"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
</q-select>
|
||||
>
|
||||
<template
|
||||
v-if="DataStore.employeeClass !== 'all'"
|
||||
v-slot:append
|
||||
>
|
||||
<q-icon
|
||||
name="cancel"
|
||||
@click.stop.prevent="
|
||||
clearInsigniaFilters('employeeClassOps'),
|
||||
DataStore.searchDatatable(
|
||||
DataStore.insignia,
|
||||
DataStore.employeeClass
|
||||
)
|
||||
"
|
||||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -185,7 +185,15 @@ const filterSelector = (val: any, update: Function, name: any) => {
|
|||
@update:model-value="updateSelect"
|
||||
@filter="(inputValue:any,doneFn:Function) =>
|
||||
filterSelector(inputValue, doneFn,'selectList') "
|
||||
/>
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</q-form>
|
||||
<q-space />
|
||||
<div class="q-pa-ms q-gutter-sm" style="padding: 0">
|
||||
|
|
|
|||
|
|
@ -637,6 +637,13 @@ const clearInsigniaFilters = (name: string) => {
|
|||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<q-select
|
||||
v-model="DataStore.invoiceType"
|
||||
|
|
@ -677,6 +684,13 @@ const clearInsigniaFilters = (name: string) => {
|
|||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<div>
|
||||
<q-select
|
||||
|
|
@ -721,6 +735,13 @@ const clearInsigniaFilters = (name: string) => {
|
|||
class="cursor-pointer"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ const props = defineProps({
|
|||
type: Function,
|
||||
},
|
||||
});
|
||||
//
|
||||
// รายละเอียดข้อมูง
|
||||
const titlename = ref<string>("");
|
||||
const timeIn = ref<string>("");
|
||||
const timeOut = ref<string>("");
|
||||
|
|
@ -32,6 +32,7 @@ watch(props, () => {
|
|||
}
|
||||
}
|
||||
});
|
||||
// ปิด popup
|
||||
function colsePopup() {
|
||||
props.colse ? props.colse() : false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
|
@ -13,10 +12,8 @@ const mixin = useCounterMixin();
|
|||
const workStore = useWorklistDataStore();
|
||||
|
||||
const { date2Thai } = mixin;
|
||||
const { optionStatus, searchDataFn } = workStore;
|
||||
onMounted(() => {
|
||||
optionStatusfn.value = optionStatus;
|
||||
});
|
||||
const { searchDataFn, filterFn } = workStore;
|
||||
onMounted(() => {});
|
||||
|
||||
//ข้อมูล Table
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -96,28 +93,15 @@ const visibleColumns = ref<string[]>([
|
|||
//DialogDetail
|
||||
const modal = ref<boolean>(false);
|
||||
const dataDetail = ref<any>([]);
|
||||
// เปิด popup ลายละเอียด
|
||||
function clickDetail(data: any) {
|
||||
modal.value = true;
|
||||
dataDetail.value = data;
|
||||
}
|
||||
} //ปิด popup ลายละเอียด
|
||||
function colseDeyail() {
|
||||
modal.value = false;
|
||||
}
|
||||
//filter Option
|
||||
const optionStatusfn = ref<any>([]);
|
||||
function filterFn(val: string, update: any) {
|
||||
if (val == "") {
|
||||
update(() => {
|
||||
optionStatusfn.value = optionStatus;
|
||||
});
|
||||
} else {
|
||||
update(() => {
|
||||
optionStatusfn.value = optionStatus.filter(
|
||||
(e: any) => e.name.search(val) !== -1
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//pagination
|
||||
const pagination = ref({
|
||||
|
|
@ -178,7 +162,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
outlined
|
||||
dense
|
||||
v-model="workStore.selectStatus"
|
||||
:options="optionStatusfn"
|
||||
:options="workStore.optionStatus"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
label="สถานะ"
|
||||
|
|
|
|||
|
|
@ -3,18 +3,19 @@ q
|
|||
import { ref } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
//import Stores
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const leaveStore = useLeavelistDataStore();
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const { date2Thai } = mixin;
|
||||
const { optionYear, searchDataFn, filterOption } = leaveStore;
|
||||
const { optionYear, searchDataFn, filterOption } = leaveStore; // เรียน funtion จาก stores
|
||||
|
||||
// ข้อมูล TABLE
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { DataOption } from "@/modules/09_leave/interface/index/Main"
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai } = mixin;
|
||||
export const useWorklistDataStore = defineStore("work", () => {
|
||||
|
|
@ -21,6 +22,7 @@ export const useWorklistDataStore = defineStore("work", () => {
|
|||
status: convertSatatus(e.status)
|
||||
}))
|
||||
dataMain.value = datalist
|
||||
fetchOption()
|
||||
searchDataFn(selectDate.value, selectStatus.value)
|
||||
}
|
||||
|
||||
|
|
@ -28,7 +30,8 @@ export const useWorklistDataStore = defineStore("work", () => {
|
|||
const filterTable = ref<string>('')
|
||||
const selectDate = ref<Date | null>(null);
|
||||
const selectStatus = ref<String>('all')
|
||||
const optionStatus = ref<any[]>([{ id: "all", name: 'ทั้งหมด' }, { id: "1", name: 'ลงเวลาเรียบร้อย' }, { id: "2", name: 'สายทำงานครบ' }])
|
||||
const optionStatusMain = ref<DataOption[]>([])
|
||||
const optionStatus = ref<DataOption[]>([])
|
||||
function searchDataFn(searchDate: any, srarchStatus: any) {
|
||||
srarchStatus = srarchStatus || "all";
|
||||
if (searchDate == null && srarchStatus == "all") {
|
||||
|
|
@ -37,6 +40,38 @@ export const useWorklistDataStore = defineStore("work", () => {
|
|||
rows.value = dataMain.value.filter((e: any) => e.status === convertSatatus(srarchStatus))
|
||||
}
|
||||
}
|
||||
//
|
||||
function fetchOption() {
|
||||
const double_status = [
|
||||
...new Set(dataMain.value.map((item: any) => item.status)),
|
||||
];
|
||||
optionStatusMain.value = [{ id: "all", name: "ทั้งหมด" }];
|
||||
for (let i = 1; i <= double_status.length; i++) {
|
||||
const status = double_status[i - 1];
|
||||
if (typeof status === 'string') {
|
||||
const listtype: DataOption = {
|
||||
id: status,
|
||||
name: status,
|
||||
};
|
||||
optionStatusMain.value.push(listtype)
|
||||
optionStatus.value = optionStatusMain.value
|
||||
}
|
||||
}
|
||||
}
|
||||
function filterFn(val: string, update: any) {
|
||||
if (val == "") {
|
||||
update(() => {
|
||||
optionStatus.value = optionStatusMain.value;
|
||||
});
|
||||
} else {
|
||||
update(() => {
|
||||
optionStatus.value = optionStatusMain.value.filter(
|
||||
(e: any) => e.name.search(val) !== -1
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// convertSatatus
|
||||
function convertSatatus(val: string) {
|
||||
switch (val) {
|
||||
|
|
@ -58,6 +93,7 @@ export const useWorklistDataStore = defineStore("work", () => {
|
|||
selectStatus,
|
||||
optionStatus,
|
||||
searchDataFn,
|
||||
filterFn,
|
||||
convertSatatus
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ const { fecthList, clearFilter } = leaveStore;
|
|||
onMounted(() => {
|
||||
fecthLeaveList();
|
||||
});
|
||||
// เรียกข้อมูลจาก API
|
||||
function fecthLeaveList() {
|
||||
const data = [
|
||||
{
|
||||
|
|
@ -38,7 +39,7 @@ function fecthLeaveList() {
|
|||
status: "2",
|
||||
},
|
||||
];
|
||||
fecthList(data);
|
||||
fecthList(data); // ส่งข้อมูลไป stores
|
||||
}
|
||||
//เปลี่ยน Tab
|
||||
function changTab() {
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ function fecthWorkList() {
|
|||
status: "1",
|
||||
},
|
||||
];
|
||||
fecthList(listData);
|
||||
fecthList(listData); // ส่งข้อมูลไปยัง stores
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ const dialogDeleteData = async (id: string) => {
|
|||
const deleteData = async (id: string) => {
|
||||
await http
|
||||
.delete(config.API.personsOrder(id))
|
||||
.then((res) => {
|
||||
.then(() => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -271,8 +271,6 @@ const fetchSalary = async (personalId: string) => {
|
|||
.get(config.API.salaryOrder(personalId))
|
||||
.then((res: any) => {
|
||||
const data = res.data.result;
|
||||
console.log(data);
|
||||
|
||||
modalData.value = {
|
||||
salaryAmount:
|
||||
data.salaryAmount === 0 &&
|
||||
|
|
@ -318,7 +316,7 @@ const putSalary = async (salary: any) => {
|
|||
}
|
||||
await http
|
||||
.put(config.API.salaryOrder(personalId.value), modalData.value)
|
||||
.then((any) => {
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue