ทะเบียนประวัติ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-05-14 16:05:58 +07:00
parent 2edda09818
commit a20426bdf8
20 changed files with 931 additions and 794 deletions

View file

@ -30,12 +30,13 @@ export default {
`${registryNew}${type}/address/history/${dataId}`, `${registryNew}${type}/address/history/${dataId}`,
// บันทึกวันที่ไม่ได้รับเงินเดือนฯ // บันทึกวันที่ไม่ได้รับเงินเดือนฯ
profileNewNoPaid: `${registryNew}/nopaid`, profileNewNoPaid: (type: string) => `${registryNew}${type}/nopaid`,
profileNewNoPaidByProfileId: (profileId: string) => profileNewNoPaidByProfileId: (profileId: string, type: string) =>
`${registryNew}/nopaid/${profileId}`, `${registryNew}${type}/nopaid/${profileId}`,
profileNewNoPaidById: (dataId: string) => `${registryNew}/nopaid/${dataId}`, profileNewNoPaidById: (dataId: string, type: string) =>
profileNewNoPaidHisById: (dataId: string) => `${registryNew}${type}/nopaid/${dataId}`,
`${registryNew}/nopaid/history/${dataId}`, profileNewNoPaidHisById: (dataId: string, type: string) =>
`${registryNew}${type}/nopaid/history/${dataId}`,
// เครื่องราชฯ // เครื่องราชฯ
profileNewInsign: `${registryNew}/insignia`, profileNewInsign: `${registryNew}/insignia`,
@ -72,22 +73,22 @@ export default {
`${registryNew}/training/history/${trainingId}`, `${registryNew}/training/history/${trainingId}`,
// ประวัติการศึกษา // ประวัติการศึกษา
profileNewEducation: `${registryNew}/educations`, profileNewEducation: (type: string) => `${registryNew}${type}/educations`,
profileNewEducationByProfileId: (profileId: string) => profileNewEducationByProfileId: (profileId: string, type: string) =>
`${registryNew}/educations/${profileId}`, `${registryNew}${type}/educations/${profileId}`,
profileNewEducationByEducationId: (educationId: string) => profileNewEducationByEducationId: (educationId: string, type: string) =>
`${registryNew}/educations/${educationId}`, `${registryNew}${type}/educations/${educationId}`,
profileNewEducationHisByEducationId: (educationsId: string) => profileNewEducationHisByEducationId: (educationsId: string, type: string) =>
`${registryNew}/educations/history/${educationsId}`, `${registryNew}${type}/educations/history/${educationsId}`,
// ความสามารถพิเศษ // ความสามารถพิเศษ
profileNewAbility: `${registryNew}/ability`, profileNewAbility: (type: string) => `${registryNew}${type}/ability`,
profileNewAbilityByProfileId: (profileId: string) => profileNewAbilityByProfileId: (profileId: string, type: string) =>
`${registryNew}/ability/${profileId}`, `${registryNew}${type}/ability/${profileId}`,
profileNewAbilityByAbilityId: (abilityId: string) => profileNewAbilityByAbilityId: (abilityId: string, type: string) =>
`${registryNew}/ability/${abilityId}`, `${registryNew}${type}/ability/${abilityId}`,
profileNewAbilityHisByAbilityId: (abilityId: string) => profileNewAbilityHisByAbilityId: (abilityId: string, type: string) =>
`${registryNew}/ability/history/${abilityId}`, `${registryNew}${type}/ability/history/${abilityId}`,
// ใบอนุญาตประกอบวิชาชีพ // ใบอนุญาตประกอบวิชาชีพ
profileNewCertificate: `${registryNew}/certificate`, profileNewCertificate: `${registryNew}/certificate`,
@ -107,51 +108,56 @@ export default {
`${registryNew}/other/history/${dataId}`, `${registryNew}/other/history/${dataId}`,
// ข้อมูลครอบครัว // ข้อมูลครอบครัว
profileNewFamily: `${registryNew}/family`, profileNewFamily: (type: string) => `${registryNew}${type}/family`,
profileNewFamilyByProfileId: (profileId: string) => profileNewFamilyByProfileId: (profileId: string, type: string) =>
`${registryNew}/family/${profileId}`, `${registryNew}${type}/family/${profileId}`,
profileNewFamilyByFamilyId: (familyId: string) => profileNewFamilyByFamilyId: (familyId: string, type: string) =>
`${registryNew}/family/${familyId}`, `${registryNew}${type}/family/${familyId}`,
profileNewFamilyHisByFamilyId: (familyId: string) => profileNewFamilyHisByFamilyId: (familyId: string, type: string) =>
`${registryNew}/family/history/${familyId}`, `${registryNew}${type}/family/history/${familyId}`,
// วินัย // วินัย
profileNewDiscipline: `${registryNew}/discipline`, profileNewDiscipline: (type: string) => `${registryNew}${type}/discipline`,
profileNewDisciplineByProfileId: (profileId: string) => profileNewDisciplineByProfileId: (profileId: string, type: string) =>
`${registryNew}/discipline/${profileId}`, `${registryNew}${type}/discipline/${profileId}`,
profileNewDisciplineByDisciplineId: (disciplineId: string) => profileNewDisciplineByDisciplineId: (disciplineId: string, type: string) =>
`${registryNew}/discipline/${disciplineId}`, `${registryNew}${type}/discipline/${disciplineId}`,
profileNewDisciplineHisByDisciplineId: (disciplineId: string) => profileNewDisciplineHisByDisciplineId: (disciplineId: string, type: string) =>
`${registryNew}/discipline/history/${disciplineId}`, `${registryNew}${type}/discipline/history/${disciplineId}`,
// ปฏิบัติราชการพิเศษ // ปฏิบัติราชการพิเศษ
profileNewDuty: `${registryNew}/duty`, profileNewDuty: (type: string) => `${registryNew}${type}/duty`,
profileNewDutyByProfileId: (profileId: string) => profileNewDutyByProfileId: (profileId: string, type: string) =>
`${registryNew}/duty/${profileId}`, `${registryNew}${type}/duty/${profileId}`,
profileNewDutyByDutyId: (dutyId: string) => `${registryNew}/duty/${dutyId}`, profileNewDutyByDutyId: (dutyId: string, type: string) =>
profileNewDutyHisByDutyId: (dutyId: string) => `${registryNew}${type}/duty/${dutyId}`,
`${registryNew}/duty/history/${dutyId}`, profileNewDutyHisByDutyId: (dutyId: string, type: string) =>
`${registryNew}${type}/duty/history/${dutyId}`,
//ข้อมูลราชการ //ข้อมูลราชการ
profileNewGovernment: () => `${registryNew}/government`, profileNewGovernment: (type: string) => `${registryNew}${type}/government`,
profileNewGovernmentById: (id: string) => `${registryNew}/government/${id}`, profileNewGovernmentById: (id: string, type: string) =>
profileNewGovernmentHistory: (id: string) => `${registryNew}${type}/government/${id}`,
`${registryNew}/government/history/${id}`, profileNewGovernmentHistory: (id: string, type: string) =>
`${registryNew}${type}/government/history/${id}`,
//การลา //การลา
profileNewLeave: () => `${registryNew}/leave`, profileNewLeave: (type: string) => `${registryNew}${type}/leave`,
profileNewLeaveById: (id: string) => `${registryNew}/leave/${id}`, profileNewLeaveById: (id: string, type: string) =>
profileNewLeaveHistory: (id: string) => `${registryNew}/leave/history/${id}`, `${registryNew}${type}/leave/${id}`,
profileNewLeaveHistory: (id: string, type: string) =>
`${registryNew}${type}/leave/history/${id}`,
profileCheckDate: () => `${env.API_URI}/leave/user/check`, profileCheckDate: () => `${env.API_URI}/leave/user/check`,
profileNewLeaveType: () => `${env.API_URI}/leave/type`, profileNewLeaveType: () => `${env.API_URI}/leave/type`,
/** ตำแหน่งเงินเดือน*/ /** ตำแหน่งเงินเดือน*/
profileSalaryNew: `${salaryNew}`, profileSalaryNew: (type: string) => `${registryNew}${type}/salary`,
profileListSalaryNew: (id: string) => `${salaryNew}/${id}`, profileListSalaryNew: (id: string, type: string) =>
profileListSalaryHistoryNew: (profileId: string) => `${registryNew}${type}/salary/${id}`,
`${salaryNew}/history/${profileId}`, profileListSalaryHistoryNew: (profileId: string, type: string) =>
profileSalarySwapNew: (type: string, id: string) => `${registryNew}${type}/salary/history/${profileId}`,
`${salaryNew}/swap/${type}/${id}`, profileSalarySwapNew: (type: string, id: string, type2: string) =>
`${registryNew}${type2}/salary/swap/${type}/${id}`,
// ประวัติการเปลี่ยนชื่อ-นามสกุล // ประวัติการเปลี่ยนชื่อ-นามสกุล
profileNewChangeName: (type: string) => `${registryNew}${type}/changeName`, profileNewChangeName: (type: string) => `${registryNew}${type}/changeName`,

View file

@ -68,9 +68,7 @@ const orgLevelOption = ref<DataOption[]>([]);
const orgNameRef = ref<Object | null>(null); const orgNameRef = ref<Object | null>(null);
const orgShortNameRef = ref<Object | null>(null); const orgShortNameRef = ref<Object | null>(null);
const orgCodeRef = ref<Object | null>(null); const orgCodeRef = ref<Object | null>(null);
// const orgPhoneExRef = ref<Object | null>(null);
// const orgPhoneInRef = ref<Object | null>(null);
// const orgFaxRef = ref<Object | null>(null);
const orgLevelRef = ref<Object | null>(null); const orgLevelRef = ref<Object | null>(null);
const orgLevelSubRef = ref<Object | null>(null); const orgLevelSubRef = ref<Object | null>(null);
@ -83,6 +81,7 @@ const formData = reactive<FormDataAgency>({
orgFax: "", orgFax: "",
orgLevel: "", orgLevel: "",
orgLevelSub: "", orgLevelSub: "",
responsibility: "",
}); });
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */ /** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
@ -90,9 +89,7 @@ const objectComplaintsRef: FormAgencyRef = {
orgName: orgNameRef, orgName: orgNameRef,
orgShortName: orgShortNameRef, orgShortName: orgShortNameRef,
orgCode: orgCodeRef, orgCode: orgCodeRef,
// orgPhoneEx: orgPhoneExRef,
// orgPhoneIn: orgPhoneInRef,
// orgFax: orgFaxRef,
orgLevel: orgLevelRef, orgLevel: orgLevelRef,
orgLevelSub: orgLevelSubRef, orgLevelSub: orgLevelSubRef,
}; };
@ -149,6 +146,7 @@ function onSubmit() {
["org" + type + "RankSub"]: ["org" + type + "RankSub"]:
level.value !== 0 ? formData.orgLevelSub : undefined, level.value !== 0 ? formData.orgLevelSub : undefined,
[nameId]: rootId, [nameId]: rootId,
responsibility: formData.responsibility,
}; };
if (actionType.value === "ADD") { if (actionType.value === "ADD") {
@ -194,7 +192,6 @@ function onSubmit() {
messageError($q, err); messageError($q, err);
}) })
.finally(async () => { .finally(async () => {
// await props.fetchDataTree?.();
hideLoader(); hideLoader();
})); }));
} }
@ -209,6 +206,7 @@ function closeClear() {
formData.orgPhoneIn = ""; formData.orgPhoneIn = "";
formData.orgFax = ""; formData.orgFax = "";
formData.orgLevel = ""; formData.orgLevel = "";
formData.responsibility = "";
props.close?.(); props.close?.();
} }
@ -468,6 +466,19 @@ function selectOrgLevele(val: string, status: boolean = true) {
hide-bottom-space hide-bottom-space
/> />
</div> </div>
<div class="col-12">
<q-input
v-model="formData.responsibility"
ref="responsibilityRef"
dense
outlined
for="#tel"
label="หน้าที่ความรับผิดชอบ"
hide-bottom-space
type="textarea"
rows="4"
/>
</div>
</div> </div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />

View file

@ -23,6 +23,7 @@ interface FormDataAgency {
orgFax: string; orgFax: string;
orgLevel: string; orgLevel: string;
orgLevelSub: string; orgLevelSub: string;
responsibility: string;
} }
interface FormDataPosition { interface FormDataPosition {

View file

@ -18,12 +18,13 @@ const router = useRouter();
const formFilter = defineModel<FormFilter>("formFilter", { required: true }); const formFilter = defineModel<FormFilter>("formFilter", { required: true });
const maxPage = defineModel<Number>("maxPage", { required: true }); const maxPage = defineModel<Number>("maxPage", { required: true });
const empType = defineModel<string>("empType", { required: true });
const props = defineProps({ const props = defineProps({
rows: { type: Array }, rows: { type: Array },
fetchData: { type: Function }, fetchData: { type: Function },
fetchType: { type: Function }, fetchType: { type: Function },
total: { type: Number }, total: { type: Number },
empType: { type: String }, // empType: { type: String },
}); });
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
@ -167,7 +168,7 @@ function onClickHistory() {
} }
function onClickViewDetail(id: string) { function onClickViewDetail(id: string) {
if (props.empType === "officer") { if (empType.value === "officer") {
router.push(`/registry-new/${id}`); router.push(`/registry-new/${id}`);
} else { } else {
router.push(`/registry-new-employee/${id}`); router.push(`/registry-new-employee/${id}`);
@ -299,8 +300,8 @@ watch(
<div class="row col-12 wrap items-center"> <div class="row col-12 wrap items-center">
<q-item> <q-item>
<q-item-section avatar> <q-item-section avatar>
<q-avatar> <q-avatar size="50px" class="bg-grey-2">
<img :src="props.row.avartar" class="col-4 img-info" /> <q-img :src="props.row.avatar" />
</q-avatar> </q-avatar>
</q-item-section> </q-item-section>
<q-item-section> <q-item-section>
@ -371,7 +372,11 @@ watch(
<q-item dense> <q-item dense>
<q-item-section> <q-item-section>
<q-item-label caption>ประเภทตำแหน</q-item-label> <q-item-label caption>
{{
empType === "officer" ? "ประเภทตำแหน่ง" : "กลุ่มงาน"
}}</q-item-label
>
</q-item-section> </q-item-section>
<q-item-section> <q-item-section>
<q-item-label caption class="text-black"> <q-item-label caption class="text-black">
@ -384,7 +389,11 @@ watch(
<q-item dense> <q-item dense>
<q-item-section> <q-item-section>
<q-item-label caption>ระดบตำแหน</q-item-label> <q-item-label caption>
{{
empType === "officer" ? "ระดับตำแหน่ง" : "ระดับชั้นงาน"
}}</q-item-label
>
</q-item-section> </q-item-section>
<q-item-section> <q-item-section>
<q-item-label caption class="text-black"> <q-item-label caption class="text-black">

View file

@ -28,6 +28,9 @@ const {
} = mixin; } = mixin;
const profileId = ref<string>(route.params.id.toString()); const profileId = ref<string>(route.params.id.toString());
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
/** ตัวแปรข้อมูลหลัก */ /** ตัวแปรข้อมูลหลัก */
const formMain = reactive<FormMain>({ const formMain = reactive<FormMain>({
ocId: "", // ocId: "", //
@ -324,6 +327,7 @@ function openDialogEdit() {
function openDialogHistory() { function openDialogHistory() {
modalHistory.value = true; modalHistory.value = true;
filterKeyword.value = "";
getDataHistory(); getDataHistory();
} }
/** ปิด dialog */ /** ปิด dialog */
@ -355,15 +359,18 @@ function onSubmit() {
dialogConfirm($q, () => { dialogConfirm($q, () => {
showLoader(); showLoader();
http http
.patch(config.API.profileNewGovernmentById(profileId.value), { .patch(
dateAppoint: containDate.value, config.API.profileNewGovernmentById(profileId.value, empType.value),
dateStart: workDate.value, {
reasonSameDate: dateAppoint: containDate.value,
dateToISO(containDate.value as Date) === dateStart: workDate.value,
dateToISO(workDate.value as Date) reasonSameDate:
? "" dateToISO(containDate.value as Date) ===
: reasonSameDate.value, dateToISO(workDate.value as Date)
}) ? ""
: reasonSameDate.value,
}
)
.then((res) => { .then((res) => {
closeDialog(); closeDialog();
getData(); getData();
@ -383,7 +390,7 @@ function onSubmit() {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.profileNewGovernmentById(profileId.value)) .get(config.API.profileNewGovernmentById(profileId.value, empType.value))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
formMain.ocId = data.org; // formMain.ocId = data.org; //
@ -416,7 +423,7 @@ function getData() {
function getDataHistory() { function getDataHistory() {
showLoader(); showLoader();
http http
.get(config.API.profileNewGovernmentHistory(profileId.value)) .get(config.API.profileNewGovernmentHistory(profileId.value, empType.value))
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
rowsHistory.value = []; rowsHistory.value = [];
@ -447,21 +454,22 @@ function getDataHistory() {
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
modalHistory.value = false
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
}); });
} }
watch( // watch(
() => modalHistory.value, // () => modalHistory.value,
(isOpen) => { // (isOpen) => {
if (isOpen === true) { // if (isOpen === true) {
filterKeyword.value = ""; // filterKeyword.value = "";
getDataHistory(); // getDataHistory();
} // }
} // }
); // );
onMounted(() => { onMounted(() => {
getData(); getData();
@ -709,9 +717,7 @@ onMounted(() => {
? date2Thai(workDate as Date) ? date2Thai(workDate as Date)
: null : null
" "
:rules="[ :rules="[(val) => !!val || 'กรุณาเลือกเริ่มปฎิบัติราชการ']"
(val) => !!val || 'กรุณาเลือกเริ่มปฎิบัติราชการ',
]"
label="วัน/เดือน/ปี เริ่มปฎิบัติราชการ" label="วัน/เดือน/ปี เริ่มปฎิบัติราชการ"
> >
<template v-slot:prepend> <template v-slot:prepend>
@ -746,18 +752,18 @@ onMounted(() => {
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right"> <q-card-actions align="right">
<q-btn <q-btn
dense dense
unelevated unelevated
label="บันทึก" label="บันทึก"
id="onSubmit" id="onSubmit"
type="submit" type="submit"
color="public" color="public"
class="q-px-md" class="q-px-md"
> >
<q-tooltip>นทกขอม</q-tooltip> <q-tooltip>นทกขอม</q-tooltip>
</q-btn> </q-btn>
</q-card-actions> </q-card-actions>
</form> </form>
</q-card> </q-card>
</q-dialog> </q-dialog>

View file

@ -19,6 +19,9 @@ const route = useRoute();
const profileId = ref<string>( const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
@ -32,7 +35,7 @@ const {
dialogRemove, dialogRemove,
} = mixin; } = mixin;
const disciplineData = reactive<RequestItemsObject>({ const disciplineData = reactive<RequestItemsObject>({
date: new Date(), date: null,
level: "", level: "",
detail: "", detail: "",
unStigma: "", unStigma: "",
@ -235,7 +238,7 @@ function openDialogAdd() {
async function fetchData(id: string) { async function fetchData(id: string) {
showLoader(); showLoader();
await http await http
.get(config.API.profileNewDisciplineByProfileId(id)) .get(config.API.profileNewDisciplineByProfileId(id, empType.value))
.then(async (res) => { .then(async (res) => {
rows.value = res.data.result; rows.value = res.data.result;
}) })
@ -248,8 +251,19 @@ async function fetchData(id: string) {
} }
async function addData() { async function addData() {
const body = {
date: disciplineData.date,
level: disciplineData.level,
detail: disciplineData.detail,
unStigma: disciplineData.unStigma,
refCommandNo: disciplineData.refCommandNo,
profileId: empType.value === "" ? disciplineData.profileId : undefined,
profileEmployeeId:
empType.value !== "" ? disciplineData.profileId : undefined,
refCommandDate: disciplineData.refCommandDate,
};
await http await http
.post(config.API.profileNewDiscipline, disciplineData) .post(config.API.profileNewDiscipline(empType.value), body)
.then(() => { .then(() => {
fetchData(profileId.value); fetchData(profileId.value);
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
@ -264,10 +278,13 @@ async function addData() {
async function editData(idData: string) { async function editData(idData: string) {
await http await http
.patch(config.API.profileNewDisciplineByDisciplineId(idData), { .patch(
...disciplineData, config.API.profileNewDisciplineByDisciplineId(idData, empType.value),
profileId: undefined, {
}) ...disciplineData,
profileId: undefined,
}
)
.then(() => { .then(() => {
fetchData(profileId.value); fetchData(profileId.value);
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");

View file

@ -3,6 +3,7 @@ import { ref, watch, reactive } from "vue";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useQuasar, type QTableProps } from "quasar"; import { useQuasar, type QTableProps } from "quasar";
import { useRoute } from "vue-router";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
@ -16,6 +17,7 @@ const modal = defineModel<boolean>("modal", { required: true });
const id = defineModel<string>("id", { required: true }); const id = defineModel<string>("id", { required: true });
const $q = useQuasar(); const $q = useQuasar();
const route = useRoute();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin; const { showLoader, hideLoader, messageError, date2Thai } = mixin;
@ -144,10 +146,16 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
]); ]);
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.profileNewDisciplineHisByDisciplineId(id.value)) .get(
config.API.profileNewDisciplineHisByDisciplineId(id.value, empType.value)
)
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
rows.value = []; rows.value = [];
@ -185,10 +193,7 @@ watch(modal, (status) => {
<template> <template>
<q-dialog v-model="modal" persistent> <q-dialog v-model="modal" persistent>
<q-card style="min-width: 80%"> <q-card style="min-width: 80%">
<DialogHeader <DialogHeader tittle="ประวัติแก้ไขวินัย" :close="() => (modal = false)" />
tittle="ประวัติแก้ไขวินัย"
:close="() => (modal = false)"
/>
<q-separator color="grey-4" /> <q-separator color="grey-4" />
<q-card-section style="max-height: 60vh" class="scroll"> <q-card-section style="max-height: 60vh" class="scroll">

View file

@ -25,6 +25,9 @@ const route = useRoute();
const profileId = ref<string>( const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
@ -368,9 +371,9 @@ function validateForm() {
*/ */
function saveData() { function saveData() {
showLoader(); showLoader();
http http
.post(config.API.profileNewLeave(), { .post(config.API.profileNewLeave(empType.value), {
profileId: profileId.value,
leaveTypeId: typeLeave.value.id, leaveTypeId: typeLeave.value.id,
dateLeaveStart: dateToISO(dateRange.value[0]), dateLeaveStart: dateToISO(dateRange.value[0]),
dateLeaveEnd: dateToISO(dateRange.value[1]), dateLeaveEnd: dateToISO(dateRange.value[1]),
@ -379,8 +382,10 @@ function saveData() {
totalLeave: 0, totalLeave: 0,
status: statLeave.value, status: statLeave.value,
reason: reason.value, reason: reason.value,
profileId: empType.value === "" ? profileId.value : undefined,
profileEmployeeId: empType.value !== "" ? profileId.value : undefined,
}) })
.then((res) => { .then(() => {
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
closeDialog(); closeDialog();
}) })
@ -398,7 +403,7 @@ function saveData() {
const editData = async () => { const editData = async () => {
showLoader(); showLoader();
http http
.patch(config.API.profileNewLeaveById(id.value), { .patch(config.API.profileNewLeaveById(id.value, empType.value), {
leaveTypeId: typeLeave.value.id, leaveTypeId: typeLeave.value.id,
dateLeaveStart: dateToISO(dateRange.value[0]), dateLeaveStart: dateToISO(dateRange.value[0]),
dateLeaveEnd: dateToISO(dateRange.value[1]), dateLeaveEnd: dateToISO(dateRange.value[1]),
@ -408,7 +413,7 @@ const editData = async () => {
status: statLeave.value, status: statLeave.value,
reason: reason.value, reason: reason.value,
}) })
.then((res) => { .then(() => {
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
closeDialog(); closeDialog();
}) })
@ -423,7 +428,7 @@ const editData = async () => {
function getData() { function getData() {
showLoader(); showLoader();
http http
.get(config.API.profileNewLeaveById(profileId.value)) .get(config.API.profileNewLeaveById(profileId.value, empType.value))
.then((res) => { .then((res) => {
console.log(res.data.result); console.log(res.data.result);
const data = res.data.result; const data = res.data.result;
@ -440,7 +445,7 @@ function getData() {
})); }));
}) })
.catch((e) => { .catch((e) => {
// messageError($q, e); messageError($q, e);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -679,121 +684,121 @@ onMounted(() => {
<q-separator color="grey-4" /> <q-separator color="grey-4" />
<q-card-section style="max-height: 50vh" class="scroll"> <q-card-section style="max-height: 50vh" class="scroll">
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs"> <div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<q-select <q-select
ref="typeLeaveRef" ref="typeLeaveRef"
class="full-width inputgreen cursor-pointer" class="full-width inputgreen cursor-pointer"
outlined outlined
dense dense
lazy-rules lazy-rules
v-model="typeLeave" v-model="typeLeave"
:rules="[(val:string) => !!val || `${'กรุณาเลือกประเภทการลา'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือกประเภทการลา'}`]"
hide-bottom-space hide-bottom-space
:label="`${'ประเภทการลา'}`" :label="`${'ประเภทการลา'}`"
@update:modelValue="clickEditRowType" @update:modelValue="clickEditRowType"
map-options map-options
option-label="name" option-label="name"
:options="typeLeaveOption" :options="typeLeaveOption"
option-value="id" option-value="id"
use-input use-input
input-debounce="0" input-debounce="0"
@filter="(inputValue:string, @filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn,'typeLeaveOption' doneFn:Function) => filterSelector(inputValue, doneFn,'typeLeaveOption'
) " ) "
/> />
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<datepicker <datepicker
:readonly="!typeLeave" :readonly="!typeLeave"
menu-class-name="modalfix" menu-class-name="modalfix"
v-model="dateRange" v-model="dateRange"
:locale="'th'" :locale="'th'"
autoApply autoApply
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
range range
> >
<template #year="{ year }">{{ year + 543 }}</template> <template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{ <template #year-overlay-value="{ value }">{{
parseInt(value + 543) parseInt(value + 543)
}}</template> }}</template>
<template #trigger> <template #trigger>
<q-input <q-input
:readonly="!typeLeave" :readonly="!typeLeave"
class="full-width inputgreen cursor-pointer" class="full-width inputgreen cursor-pointer"
outlined outlined
dense dense
ref="dateRangeRef" ref="dateRangeRef"
:model-value="dateThaiRange(dateRange)" :model-value="dateThaiRange(dateRange)"
:rules="[(val:string) => !!val || `${'กรุณาเลือกวัน เดือน ปีที่ลา'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือกวัน เดือน ปีที่ลา'}`]"
hide-bottom-space hide-bottom-space
:label="`${'วัน เดือน ปีที่ลา'}`" :label="`${'วัน เดือน ปีที่ลา'}`"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
name="event" name="event"
class="cursor-pointer" class="cursor-pointer"
color="primary" color="primary"
> >
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<q-input <q-input
ref="numLeaveRef" ref="numLeaveRef"
class="full-width inputgreen cursor-pointer" class="full-width inputgreen cursor-pointer"
outlined outlined
dense dense
lazy-rules lazy-rules
v-model="numLeave" v-model="numLeave"
type="number" type="number"
:rules="[(val:string) => !!val || `${'กรุณากรอกจำนวนวันที่ลา'}`]" :rules="[(val:string) => !!val || `${'กรุณากรอกจำนวนวันที่ลา'}`]"
hide-bottom-space hide-bottom-space
:label="`${'จำนวนวันที่ลา'}`" :label="`${'จำนวนวันที่ลา'}`"
/> />
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<q-select <q-select
ref="statLeaveRef" ref="statLeaveRef"
class="full-width inputgreen cursor-pointer" class="full-width inputgreen cursor-pointer"
outlined outlined
dense dense
lazy-rules lazy-rules
v-model="statLeave" v-model="statLeave"
:rules="[(val:string) => !!val || `${'กรุณาเลือกสถานะการลา'}`]" :rules="[(val:string) => !!val || `${'กรุณาเลือกสถานะการลา'}`]"
hide-bottom-space hide-bottom-space
:label="`${'สถานะการลา'}`" :label="`${'สถานะการลา'}`"
emit-value emit-value
map-options map-options
option-label="name" option-label="name"
:options="statLeaveOption" :options="statLeaveOption"
option-value="id" option-value="id"
use-input use-input
input-debounce="0" input-debounce="0"
@filter="(inputValue:string, @filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn,'statLeaveOption' doneFn:Function) => filterSelector(inputValue, doneFn,'statLeaveOption'
) " ) "
/> />
</div>
<div class="col-xs-12 col-sm-12 col-md-12">
<q-input
ref="reasonRef"
class="full-width inputgreen cursor-pointer"
outlined
dense
lazy-rules
v-model="reason"
type="textarea"
:rules="[(val:string) => !!val || `${'กรุณากรอกเหตุผล'}`]"
hide-bottom-space
:label="`${'เหตุผล'}`"
/>
</div>
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-12">
<q-input
ref="reasonRef"
class="full-width inputgreen cursor-pointer"
outlined
dense
lazy-rules
v-model="reason"
type="textarea"
:rules="[(val:string) => !!val || `${'กรุณากรอกเหตุผล'}`]"
hide-bottom-space
:label="`${'เหตุผล'}`"
/>
</div>
</div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right"> <q-card-actions align="right">

View file

@ -3,6 +3,7 @@ import { ref, watch, reactive } from "vue";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useQuasar, type QTableProps } from "quasar"; import { useQuasar, type QTableProps } from "quasar";
import { useRoute } from "vue-router";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
@ -16,9 +17,13 @@ const modal = defineModel<boolean>("modal", { required: true });
const id = defineModel<string>("id", { required: true }); const id = defineModel<string>("id", { required: true });
const $q = useQuasar(); const $q = useQuasar();
const route = useRoute();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin; const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");
const rows = ref<DetailData[]>([]); //select data history const rows = ref<DetailData[]>([]); //select data history
const formFilter = reactive<FormFilter>({ const formFilter = reactive<FormFilter>({
@ -144,7 +149,7 @@ const columns = ref<QTableProps["columns"]>([
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.profileNewLeaveHistory(id.value)) .get(config.API.profileNewLeaveHistory(id.value, empType.value))
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
rows.value = []; rows.value = [];
@ -215,10 +220,7 @@ watch(modal, (status) => {
<template> <template>
<q-dialog v-model="modal" persistent> <q-dialog v-model="modal" persistent>
<q-card style="min-width: 80%"> <q-card style="min-width: 80%">
<DialogHeader <DialogHeader tittle="ประวัติแก้ไขการลา" :close="() => (modal = false)" />
tittle="ประวัติแก้ไขการลา"
:close="() => (modal = false)"
/>
<q-separator color="grey-4" /> <q-separator color="grey-4" />
<q-card-section style="max-height: 60vh" class="scroll"> <q-card-section style="max-height: 60vh" class="scroll">
<div class="row q-gutter-sm q-mb-sm"> <div class="row q-gutter-sm q-mb-sm">

View file

@ -19,6 +19,9 @@ const route = useRoute();
const profileId = ref<string>( const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
@ -200,7 +203,7 @@ function closeDialog() {
async function fetchData(id: string) { async function fetchData(id: string) {
showLoader(); showLoader();
await http await http
.get(config.API.profileNewDutyByProfileId(id)) .get(config.API.profileNewDutyByProfileId(id, empType.value))
.then(async (res) => { .then(async (res) => {
rows.value = res.data.result; rows.value = res.data.result;
}) })
@ -215,8 +218,18 @@ async function fetchData(id: string) {
/** เพิ่มข้อมูล */ /** เพิ่มข้อมูล */
async function addData() { async function addData() {
const body = {
profileId: empType.value === "" ? profileId.value : undefined,
profileEmployeeId: empType.value !== "" ? profileId.value : undefined,
dateStart: dutyData.dateStart,
dateEnd: dutyData.dateEnd,
detail: dutyData.detail,
reference: dutyData.reference,
refCommandNo: dutyData.refCommandNo,
refCommandDate: dutyData.refCommandDate,
};
await http await http
.post(config.API.profileNewDuty, dutyData) .post(config.API.profileNewDuty(empType.value), body)
.then(() => { .then(() => {
fetchData(profileId.value); fetchData(profileId.value);
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
@ -233,7 +246,7 @@ async function addData() {
async function editData(idData: string) { async function editData(idData: string) {
await http await http
.patch(config.API.profileNewDutyByDutyId(idData), { .patch(config.API.profileNewDutyByDutyId(idData, empType.value), {
...dutyData, ...dutyData,
profileId: undefined, profileId: undefined,
}) })
@ -551,9 +564,7 @@ onMounted(async () => {
outlined outlined
dense dense
:model-value="date2Thai(dutyData.dateStart)" :model-value="date2Thai(dutyData.dateStart)"
:rules="[ :rules="[(val) => !!val || `${'กรุณาเลือกวันที่เริ่มต้น'}`]"
(val) => !!val || `${'กรุณาเลือกวันที่เริ่มต้น'}`,
]"
hide-bottom-space hide-bottom-space
:label="`${'วันที่เริ่มต้น'}`" :label="`${'วันที่เริ่มต้น'}`"
> >
@ -592,9 +603,7 @@ onMounted(async () => {
dense dense
outlined outlined
:model-value="date2Thai(dutyData.dateEnd)" :model-value="date2Thai(dutyData.dateEnd)"
:rules="[ :rules="[(val) => !!val || `${'กรุณาเลือกวันที่สิ้นสุด'}`]"
(val) => !!val || `${'กรุณาเลือกวันที่สิ้นสุด'}`,
]"
hide-bottom-space hide-bottom-space
:label="`${'วันที่สิ้นสุด'}`" :label="`${'วันที่สิ้นสุด'}`"
> >

View file

@ -11,14 +11,19 @@ import type {
FormFilter, FormFilter,
ResponseObject, ResponseObject,
} from "@/modules/04_registryNew/interface/index/performSpecialWork"; } from "@/modules/04_registryNew/interface/index/performSpecialWork";
import { useRoute } from "vue-router";
const modal = defineModel<boolean>("modal", { required: true }); const modal = defineModel<boolean>("modal", { required: true });
const id = defineModel<string>("id", { required: true }); const id = defineModel<string>("id", { required: true });
const route = useRoute();
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin; const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const currentPage = ref<number>(1); const currentPage = ref<number>(1);
const maxPage = ref<number>(1); const maxPage = ref<number>(1);
const filterKeyword = ref<string>(""); const filterKeyword = ref<string>("");
@ -147,7 +152,7 @@ const columns = ref<QTableProps["columns"]>([
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.profileNewDutyHisByDutyId(id.value)) .get(config.API.profileNewDutyHisByDutyId(id.value, empType.value))
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
rows.value = []; rows.value = [];

View file

@ -358,7 +358,14 @@ async function fetchProfile(id: string) {
async function addData() { async function addData() {
await http await http
.post(config.API.profileNewChangeName(empType.value), { .post(config.API.profileNewChangeName(empType.value), {
...changeNameData, profileId: empType.value === "" ? profileId.value : undefined,
profileEmployeeId: empType.value !== "" ? profileId.value : undefined,
prefixId: changeNameData.prefixId,
prefix: changeNameData.prefix,
firstName: changeNameData.firstName,
lastName: changeNameData.lastName,
status: changeNameData.status,
documentId: changeNameData.documentId,
}) })
.then((res) => { .then((res) => {
subId.value = res.data.result; subId.value = res.data.result;

View file

@ -23,6 +23,9 @@ const store = useProfileDataStore();
const { fetchPerson, filterSelector } = store; const { fetchPerson, filterSelector } = store;
const route = useRoute(); const route = useRoute();
const id = ref<string>(route.params.id.toString()); const id = ref<string>(route.params.id.toString());
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const dialog = ref<boolean>(false); const dialog = ref<boolean>(false);
const historyDialog = ref<boolean>(false); const historyDialog = ref<boolean>(false);
const fatherIsHaveInfo = ref<boolean>(false); const fatherIsHaveInfo = ref<boolean>(false);
@ -135,7 +138,7 @@ function editForm(rows: any) {
async function fetchData(id: string) { async function fetchData(id: string) {
showLoader(); showLoader();
await http await http
.get(config.API.profileNewFamilyByProfileId(id)) .get(config.API.profileNewFamilyByProfileId(id, empType.value))
.then(async (res) => { .then(async (res) => {
const data = res.data.result; const data = res.data.result;
rows.value = res.data.result; rows.value = res.data.result;
@ -176,7 +179,7 @@ async function fetchData(id: string) {
async function fetchHistoryData(id: string) { async function fetchHistoryData(id: string) {
showLoader(); showLoader();
await http await http
.get(config.API.profileNewFamilyHisByFamilyId(id)) .get(config.API.profileNewFamilyHisByFamilyId(id, empType.value))
.then(async (res) => { .then(async (res) => {
historyRows.value = res.data.result; historyRows.value = res.data.result;
}) })
@ -208,12 +211,13 @@ async function addData() {
})); }));
const url = const url =
rows.value === null rows.value === null
? config.API.profileNewFamily ? config.API.profileNewFamily(empType.value)
: config.API.profileNewFamilyByProfileId(id.value); : config.API.profileNewFamilyByProfileId(id.value, empType.value);
const method = rows.value === null ? "post" : "patch"; const method = rows.value === null ? "post" : "patch";
await http[method](url, { await http[method](url, {
profileId: rows.value === null ? id.value : undefined, profileId: rows.value === null && empType.value === "" ? id.value : undefined,
profileEmployeeId: empType.value !== "" ? id.value : undefined,
motherLive: motherIsHaveInfo.value ? motherIsLive.value : null, motherLive: motherIsHaveInfo.value ? motherIsLive.value : null,
motherCitizenId: motherIsHaveInfo.value ? motherDataEdit.citizenId : null, motherCitizenId: motherIsHaveInfo.value ? motherDataEdit.citizenId : null,
motherPrefix: motherIsHaveInfo.value ? motherDataEdit.prefix : null, motherPrefix: motherIsHaveInfo.value ? motherDataEdit.prefix : null,
@ -308,37 +312,37 @@ onMounted(async () => {
<template> <template>
<div> <div>
<div class="flex justify-end q-gutter-x-sm"> <div class="flex justify-end q-gutter-x-sm">
<q-btn <q-btn
round round
flat flat
color="primary" color="primary"
icon="mdi-pencil-outline" icon="mdi-pencil-outline"
size="14px" size="14px"
dense dense
@click=" @click="
() => { () => {
editForm(rows); editForm(rows);
dialog = true; dialog = true;
} }
" "
> >
<q-tooltip>แกไขขอม</q-tooltip></q-btn <q-tooltip>แกไขขอม</q-tooltip></q-btn
> >
<q-btn <q-btn
round round
flat flat
dense dense
color="info" color="info"
icon="mdi-history" icon="mdi-history"
size="14px" size="14px"
@click=" @click="
() => { () => {
fetchHistoryData(id); fetchHistoryData(id);
} }
" "
> >
<q-tooltip>ประวการแกไขขอมลครอบคร</q-tooltip></q-btn <q-tooltip>ประวการแกไขขอมลครอบคร</q-tooltip></q-btn
> >
</div> </div>
<div v-if="fatherData.firstName !== null"> <div v-if="fatherData.firstName !== null">
<div class="col-12 row q-pb-sm"> <div class="col-12 row q-pb-sm">
@ -373,7 +377,9 @@ onMounted(async () => {
</div> </div>
</div> </div>
<div class="row items-center"> <div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">สถานภาพการม</div> <div class="col-2 text-grey-6 text-weight-medium">
สถานภาพการม
</div>
<div class="col-10"> <div class="col-10">
<div v-if="fatherData.isLive">มีชีวิตอยู่</div> <div v-if="fatherData.isLive">มีชีวิตอยู่</div>
<div v-else>ถึงแก่กรรม</div> <div v-else>ถึงแก่กรรม</div>
@ -381,7 +387,7 @@ onMounted(async () => {
</div> </div>
</q-card> </q-card>
</div> </div>
<q-separator class="q-my-lg" /> <q-separator class="q-my-lg" />
<div v-if="motherData.firstName !== null"> <div v-if="motherData.firstName !== null">
<div class="col-12 row q-pb-sm"> <div class="col-12 row q-pb-sm">
<div class="q-mr-md text-weight-bold text-primary text-subtitle1"> <div class="q-mr-md text-weight-bold text-primary text-subtitle1">
@ -415,7 +421,9 @@ onMounted(async () => {
</div> </div>
</div> </div>
<div class="row items-center"> <div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">สถานภาพการม</div> <div class="col-2 text-grey-6 text-weight-medium">
สถานภาพการม
</div>
<div class="col"> <div class="col">
<div v-if="motherData.isLive">มีชีวิตอยู่</div> <div v-if="motherData.isLive">มีชีวิตอยู่</div>
<div v-else>ถึงแก่กรรม</div> <div v-else>ถึงแก่กรรม</div>
@ -423,7 +431,7 @@ onMounted(async () => {
</div> </div>
</q-card> </q-card>
</div> </div>
<q-separator class="q-my-lg" /> <q-separator class="q-my-lg" />
<div v-if="spouseData.firstName !== null"> <div v-if="spouseData.firstName !== null">
<div class="col-12 row q-pb-sm"> <div class="col-12 row q-pb-sm">
<div class="q-mr-md text-weight-bold text-primary text-subtitle1"> <div class="q-mr-md text-weight-bold text-primary text-subtitle1">
@ -457,7 +465,9 @@ onMounted(async () => {
</div> </div>
</div> </div>
<div class="row items-center"> <div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">สถานภาพการม</div> <div class="col-2 text-grey-6 text-weight-medium">
สถานภาพการม
</div>
<div class="col"> <div class="col">
<div v-if="spouseData.isLive">มีชีวิตอยู่</div> <div v-if="spouseData.isLive">มีชีวิตอยู่</div>
<div v-else>ถึงแก่กรรม</div> <div v-else>ถึงแก่กรรม</div>
@ -465,7 +475,7 @@ onMounted(async () => {
</div> </div>
</q-card> </q-card>
</div> </div>
<q-separator class="q-my-lg" /> <q-separator class="q-my-lg" />
<div v-if="childrenData.childrens[0] !== undefined"> <div v-if="childrenData.childrens[0] !== undefined">
<div class="col-12 row q-pb-sm"> <div class="col-12 row q-pb-sm">
<div class="q-mr-md text-weight-bold text-primary text-subtitle1"> <div class="q-mr-md text-weight-bold text-primary text-subtitle1">
@ -473,15 +483,15 @@ onMounted(async () => {
</div> </div>
</div> </div>
<div v-for="(children, index) in childrenData.childrens" :key="index"> <div v-for="(children, index) in childrenData.childrens" :key="index">
<q-card bordered class="bg-grey-1 q-pb-md"> <q-card bordered class="bg-grey-1 q-pb-md">
<div class="col-12 row q-py-sm q-px-md bg-grey-2 items-center "> <div class="col-12 row q-py-sm q-px-md bg-grey-2 items-center">
<div class=" text-weight-medium q-pr-md"> <div class="text-weight-medium q-pr-md">
ตรคนท : {{ index + 1 }} ตรคนท : {{ index + 1 }}
</div> </div>
</div> </div>
<q-separator/> <q-separator />
<div class="col-12 q-pa-md q-col-gutter-md"> <div class="col-12 q-pa-md q-col-gutter-md">
<div class="row items-center "> <div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium"> <div class="col-2 text-grey-6 text-weight-medium">
<div>เลขบตรประจำตวประชาชน</div> <div>เลขบตรประจำตวประชาชน</div>
</div> </div>
@ -490,7 +500,9 @@ onMounted(async () => {
</div> </div>
</div> </div>
<div class="row items-center"> <div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">-นามสก</div> <div class="col-2 text-grey-6 text-weight-medium">
-นามสก
</div>
<div class="col-6"> <div class="col-6">
{{ {{
children.childrenPrefix children.childrenPrefix
@ -507,7 +519,9 @@ onMounted(async () => {
</div> </div>
</div> </div>
<div class="row items-center"> <div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">สถานภาพการม</div> <div class="col-2 text-grey-6 text-weight-medium">
สถานภาพการม
</div>
<div class="col"> <div class="col">
<div v-if="children.childrenLive">มีชีวิตอยู่</div> <div v-if="children.childrenLive">มีชีวิตอยู่</div>
<div v-else>ถึงแก่กรรม</div> <div v-else>ถึงแก่กรรม</div>
@ -665,7 +679,7 @@ onMounted(async () => {
</div> </div>
</div> </div>
</q-card> </q-card>
<q-separator class="q-my-lg" /> <q-separator class="q-my-lg" />
<div class="col-12 row q-pb-sm"> <div class="col-12 row q-pb-sm">
<div <div
class="q-mr-md q-pl-md text-weight-bold text-primary text-subtitle1" class="q-mr-md q-pl-md text-weight-bold text-primary text-subtitle1"
@ -806,7 +820,7 @@ onMounted(async () => {
</div> </div>
</div> </div>
</q-card> </q-card>
<q-separator class="q-my-lg" /> <q-separator class="q-my-lg" />
<div class="col-12 row q-pb-sm"> <div class="col-12 row q-pb-sm">
<div <div
class="q-mr-md q-pl-md text-weight-bold text-primary text-subtitle1" class="q-mr-md q-pl-md text-weight-bold text-primary text-subtitle1"
@ -947,7 +961,7 @@ onMounted(async () => {
</div> </div>
</div> </div>
</q-card> </q-card>
<q-separator class="q-mt-lg q-mb-md" /> <q-separator class="q-mt-lg q-mb-md" />
<div class="col-12 row items-center q-pb-sm"> <div class="col-12 row items-center q-pb-sm">
<div <div
class="q-mr-md q-pl-md text-weight-bold text-primary text-subtitle1" class="q-mr-md q-pl-md text-weight-bold text-primary text-subtitle1"
@ -970,11 +984,10 @@ onMounted(async () => {
v-for="(items, index) in childrenDataEdit.childrens" v-for="(items, index) in childrenDataEdit.childrens"
:key="index" :key="index"
> >
<div class="row items-center"> <div class="row items-center">
<q-card bordered class="bg-grey-1 col-12 q-mb-lg"> <q-card bordered class="bg-grey-1 col-12 q-mb-lg">
<div class="col-12 row q-py-sm q-px-md bg-grey-2 items-center "> <div class="col-12 row q-py-sm q-px-md bg-grey-2 items-center">
<div class=" text-weight-medium q-pr-md"> <div class="text-weight-medium q-pr-md">
ตรคนท : {{ index + 1 }} ตรคนท : {{ index + 1 }}
</div> </div>
<q-btn <q-btn
@ -989,7 +1002,7 @@ onMounted(async () => {
<q-tooltip>ลบขอมลบตรคนท {{ index + 1 }}</q-tooltip> <q-tooltip>ลบขอมลบตรคนท {{ index + 1 }}</q-tooltip>
</q-btn> </q-btn>
</div> </div>
<q-separator/> <q-separator />
<div class="q-pa-md col-12"> <div class="q-pa-md col-12">
<div class="row q-col-gutter-md"> <div class="row q-col-gutter-md">
<div class="col"> <div class="col">
@ -1123,202 +1136,217 @@ onMounted(async () => {
<q-card-section style="max-height: 60vh" class="scroll q-pa-none"> <q-card-section style="max-height: 60vh" class="scroll q-pa-none">
<div v-if="historyRows.length === 0">ไม่พบข้อมูล</div> <div v-if="historyRows.length === 0">ไม่พบข้อมูล</div>
<div v-else class="scroll"> <div v-else class="scroll">
<div class="row col-12 bg-teal-1 q-py-sm q-px-md"> <div class="row col-12 bg-teal-1 q-py-sm q-px-md">
ลำดบท <strong class="q-pl-sm q-pr-md">{{ index }}</strong> <span class="q-pr-md">: </span> ลำดบท <strong class="q-pl-sm q-pr-md">{{ index }}</strong>
แกไขโดย <strong class="q-pl-sm q-pr-md">{{ historyRows[index - 1].lastUpdateFullName }}</strong> <span class="q-pr-md">: </span> แกไขโดย
นทแกไข <strong class="q-pl-sm q-pr-md">{{ date2Thai(historyRows[index - 1].lastUpdatedAt) }}</strong> <strong class="q-pl-sm q-pr-md">{{
</div> historyRows[index - 1].lastUpdateFullName
<div class="q-pa-md"> }}</strong>
<div class="col-12 row q-pb-sm"> นทแกไข
<div <strong class="q-pl-sm q-pr-md">{{
class="q-mr-md text-weight-bold text-primary text-subtitle1" date2Thai(historyRows[index - 1].lastUpdatedAt)
> }}</strong>
ดา </div>
</div> <div class="q-pa-md">
</div> <div class="col-12 row q-pb-sm">
<q-card bordered class="bg-grey-1 q-gutter-md q-ma-none q-pb-md" > <div class="q-mr-md text-weight-bold text-primary text-subtitle1">
<div class="row items-center"> ดา
<div class="col-2 text-grey-6 text-weight-medium">
<div>เลขบตรประจำตวประชาชน</div>
</div>
<div class="col">
{{ historyRows[index - 1].fatherCitizenId }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">-นามสก</div>
<div class="col-6">
{{
historyRows[index - 1].fatherPrefix +
historyRows[index - 1].fatherFirstName +
" " +
historyRows[index - 1].fatherLastName
}}
</div>
<div class="col-1 text-grey-6 text-weight-medium">อาช</div>
<div class="col">
{{ historyRows[index - 1].fatherCareer }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">สถานภาพการม</div>
<div class="col-10">
<div v-if="historyRows[index - 1].fatherLive">
ตอย
</div>
<div v-else>ถึงแก่กรรม</div>
</div>
</div>
</q-card>
<div class="col-12 row q-pb-sm q-mt-lg" >
<div
class="q-mr-md text-weight-bold text-primary text-subtitle1"
>
มารดา
</div>
</div>
<q-card bordered class="bg-grey-1 q-gutter-md q-ma-none q-pb-md">
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">
<div>เลขบตรประจำตวประชาชน</div>
</div>
<div class="col">
{{ historyRows[index - 1].motherCitizenId }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">-นามสก</div>
<div class="col-6">
{{
historyRows[index - 1].motherPrefix +
historyRows[index - 1].motherFirstName +
" " +
historyRows[index - 1].motherLastName
}}
</div>
<div class="col-1 text-grey-6 text-weight-medium">อาช</div>
<div class="col">
{{ historyRows[index - 1].motherCareer }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">สถานภาพการม</div>
<div class="col">
<div v-if="historyRows[index - 1].motherLive">
ตอย
</div>
<div v-else>ถึงแก่กรรม</div>
</div>
</div>
</q-card>
<div
v-if="historyRows[index - 1].couple"
class="col-12 row q-pb-sm q-mt-lg"
>
<div
class="q-mr-md text-weight-bold text-primary text-subtitle1"
>
สมรส
</div>
</div>
<q-card
v-if="historyRows[index - 1].couple"
bordered
class="bg-grey-1 q-gutter-md q-ma-none q-pb-md"
>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">
<div>เลขบตรประจำตวประชาชน</div>
</div>
<div class="col">
{{ historyRows[index - 1].coupleCitizenId }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">-นามสก</div>
<div class="col-6">
{{
historyRows[index - 1].couplePrefix +
historyRows[index - 1].coupleFirstName +
" " +
historyRows[index - 1].coupleLastName
}}
</div>
<div class="col-1 text-grey-6 text-weight-medium">อาช</div>
<div class="col">
{{ historyRows[index - 1].coupleCareer }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">สถานภาพการม</div>
<div class="col">
<div v-if="historyRows[index - 1].coupleLive">
ตอย
</div>
<div v-else>ถึงแก่กรรม</div>
</div>
</div>
</q-card>
<div
v-if="historyRows[index - 1].children[0] !== undefined"
class="col-12 row q-pb-sm q-mt-lg"
>
<div
class="q-mr-md text-weight-bold text-primary text-subtitle1"
>
ตร
</div>
</div>
<div
v-for="children in historyRows[index - 1].children"
:key="index"
>
<q-card bordered class="bg-grey-1 q-pb-md">
<div class="col-12 row q-py-sm q-px-md bg-grey-2 items-center ">
<div class=" text-weight-medium q-pr-md">
ตรคนท : {{ index + 1 }}
</div>
</div>
<q-separator/>
<div class="col-12 q-pa-md q-col-gutter-md">
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">
<div>เลขบตรประจำตวประชาชน</div>
</div>
<div class="col-10">
{{ children.childrenCitizenId }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">-นามสก</div>
<div class="col-6">
{{
children.childrenPrefix +
children.childrenFirstName +
" " +
children.childrenLastName
}}
</div>
<div class="col-1 text-grey-6 text-weight-medium">อาช</div>
<div class="col">
{{ children.childrenCareer }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">สถานภาพการม</div>
<div class="col">
<div v-if="children.childrenLive">มีชีวิตอยู่</div>
<div v-else>ถึงแก่กรรม</div>
</div>
</div>
</div>
</q-card>
</div> </div>
</div> </div>
<q-card bordered class="bg-grey-1 q-gutter-md q-ma-none q-pb-md">
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">
<div>เลขบตรประจำตวประชาชน</div>
</div>
<div class="col">
{{ historyRows[index - 1].fatherCitizenId }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">
-นามสก
</div>
<div class="col-6">
{{
historyRows[index - 1].fatherPrefix +
historyRows[index - 1].fatherFirstName +
" " +
historyRows[index - 1].fatherLastName
}}
</div>
<div class="col-1 text-grey-6 text-weight-medium">อาช</div>
<div class="col">
{{ historyRows[index - 1].fatherCareer }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">
สถานภาพการม
</div>
<div class="col-10">
<div v-if="historyRows[index - 1].fatherLive">
ตอย
</div>
<div v-else>ถึงแก่กรรม</div>
</div>
</div>
</q-card>
<div class="col-12 row q-pb-sm q-mt-lg">
<div class="q-mr-md text-weight-bold text-primary text-subtitle1">
มารดา
</div>
</div>
<q-card bordered class="bg-grey-1 q-gutter-md q-ma-none q-pb-md">
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">
<div>เลขบตรประจำตวประชาชน</div>
</div>
<div class="col">
{{ historyRows[index - 1].motherCitizenId }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">
-นามสก
</div>
<div class="col-6">
{{
historyRows[index - 1].motherPrefix +
historyRows[index - 1].motherFirstName +
" " +
historyRows[index - 1].motherLastName
}}
</div>
<div class="col-1 text-grey-6 text-weight-medium">อาช</div>
<div class="col">
{{ historyRows[index - 1].motherCareer }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">
สถานภาพการม
</div>
<div class="col">
<div v-if="historyRows[index - 1].motherLive">
ตอย
</div>
<div v-else>ถึงแก่กรรม</div>
</div>
</div>
</q-card>
<div
v-if="historyRows[index - 1].couple"
class="col-12 row q-pb-sm q-mt-lg"
>
<div class="q-mr-md text-weight-bold text-primary text-subtitle1">
สมรส
</div>
</div>
<q-card
v-if="historyRows[index - 1].couple"
bordered
class="bg-grey-1 q-gutter-md q-ma-none q-pb-md"
>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">
<div>เลขบตรประจำตวประชาชน</div>
</div>
<div class="col">
{{ historyRows[index - 1].coupleCitizenId }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">
-นามสก
</div>
<div class="col-6">
{{
historyRows[index - 1].couplePrefix +
historyRows[index - 1].coupleFirstName +
" " +
historyRows[index - 1].coupleLastName
}}
</div>
<div class="col-1 text-grey-6 text-weight-medium">อาช</div>
<div class="col">
{{ historyRows[index - 1].coupleCareer }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">
สถานภาพการม
</div>
<div class="col">
<div v-if="historyRows[index - 1].coupleLive">
ตอย
</div>
<div v-else>ถึงแก่กรรม</div>
</div>
</div>
</q-card>
<div
v-if="historyRows[index - 1].children[0] !== undefined"
class="col-12 row q-pb-sm q-mt-lg"
>
<div class="q-mr-md text-weight-bold text-primary text-subtitle1">
ตร
</div>
</div>
<div
v-for="children in historyRows[index - 1].children"
:key="index"
>
<q-card bordered class="bg-grey-1 q-pb-md">
<div class="col-12 row q-py-sm q-px-md bg-grey-2 items-center">
<div class="text-weight-medium q-pr-md">
ตรคนท : {{ index + 1 }}
</div>
</div>
<q-separator />
<div class="col-12 q-pa-md q-col-gutter-md">
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">
<div>เลขบตรประจำตวประชาชน</div>
</div>
<div class="col-10">
{{ children.childrenCitizenId }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">
-นามสก
</div>
<div class="col-6">
{{
children.childrenPrefix +
children.childrenFirstName +
" " +
children.childrenLastName
}}
</div>
<div class="col-1 text-grey-6 text-weight-medium">
อาช
</div>
<div class="col">
{{ children.childrenCareer }}
</div>
</div>
<div class="row items-center">
<div class="col-2 text-grey-6 text-weight-medium">
สถานภาพการม
</div>
<div class="col">
<div v-if="children.childrenLive">มีชีวิตอยู่</div>
<div v-else>ถึงแก่กรรม</div>
</div>
</div>
</div>
</q-card>
</div>
</div>
</div> </div>
</q-card-section> </q-card-section>
<q-separator color="grey-4" /> <q-separator color="grey-4" />

View file

@ -400,6 +400,9 @@ const historyRows = ref<ResponseObject[]>([]);
const editId = ref<string>(""); const editId = ref<string>("");
const route = useRoute(); const route = useRoute();
const id = ref<string>(route.params.id.toString()); const id = ref<string>(route.params.id.toString());
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const isDate = ref<string>("false"); const isDate = ref<string>("false");
const educationOption = ref([ const educationOption = ref([
{ label: "ใช่", value: true }, { label: "ใช่", value: true },
@ -579,7 +582,7 @@ function closeHistoryDialog() {
async function fetchData(id: string) { async function fetchData(id: string) {
showLoader(); showLoader();
await http await http
.get(config.API.profileNewEducationByProfileId(id)) .get(config.API.profileNewEducationByProfileId(id, empType.value))
.then(async (res) => { .then(async (res) => {
rows.value = res.data.result; rows.value = res.data.result;
}) })
@ -615,7 +618,7 @@ async function fetchEducationLevel() {
async function fetchHistoryData(id: string) { async function fetchHistoryData(id: string) {
showLoader(); showLoader();
await http await http
.get(config.API.profileNewEducationHisByEducationId(id)) .get(config.API.profileNewEducationHisByEducationId(id, empType.value))
.then(async (res) => { .then(async (res) => {
historyRows.value = res.data.result; historyRows.value = res.data.result;
}) })
@ -629,7 +632,7 @@ async function fetchHistoryData(id: string) {
async function addData() { async function addData() {
await http await http
.post(config.API.profileNewEducation, { .post(config.API.profileNewEducation(empType.value), {
...educationData, ...educationData,
startYear: undefined, startYear: undefined,
endYear: undefined, endYear: undefined,
@ -649,7 +652,7 @@ async function addData() {
function editData(idData: string) { function editData(idData: string) {
http http
.patch(config.API.profileNewEducationByEducationId(idData), { .patch(config.API.profileNewEducationByEducationId(idData, empType.value), {
...educationData, ...educationData,
profileId: undefined, profileId: undefined,
startYear: undefined, startYear: undefined,
@ -1257,10 +1260,6 @@ onMounted(async () => {
@filter="(inputValue:string, @filter="(inputValue:string,
doneFn:Function) => filterSelector(inputValue, doneFn,'educationOption' doneFn:Function) => filterSelector(inputValue, doneFn,'educationOption'
) " ) "
:rules="[
(val) =>
val !== null || `${'กรุณาเลือกวุฒิการศึกษาในตำแหน่ง'}`,
]"
label="เป็นวุฒิการศึกษาในตำแหน่ง" label="เป็นวุฒิการศึกษาในตำแหน่ง"
hide-bottom-space hide-bottom-space
/> />
@ -1274,7 +1273,6 @@ onMounted(async () => {
class="inputgreen" class="inputgreen"
bg-color="white" bg-color="white"
dense dense
:rules="[(val) => !!val || `${'กรุณากรอกวุฒิการศึกษา'}`]"
hide-bottom-space hide-bottom-space
/> />
</div> </div>
@ -1343,7 +1341,6 @@ onMounted(async () => {
class="inputgreen" class="inputgreen"
v-model="educationData.duration" v-model="educationData.duration"
label="ระยะเวลา" label="ระยะเวลา"
:rules="[(val) => !!val || `${'กรุณากรอกระยะเวลา'}`]"
bg-color="white" bg-color="white"
dense dense
hide-bottom-space hide-bottom-space
@ -1355,9 +1352,6 @@ onMounted(async () => {
class="inputgreen" class="inputgreen"
v-model="educationData.durationYear" v-model="educationData.durationYear"
label="ระยะเวลาหลักสูตร (ปี)" label="ระยะเวลาหลักสูตร (ปี)"
:rules="[
(val) => !!val || `${'กรุณากรอกระยะเวลาหลักสูตร (ปี)'}`,
]"
bg-color="white" bg-color="white"
type="number" type="number"
dense dense

View file

@ -146,6 +146,9 @@ const rows = ref<ResponseObject[]>([]);
const historyRows = ref<ResponseObject[]>([]); const historyRows = ref<ResponseObject[]>([]);
const route = useRoute(); const route = useRoute();
const id = ref<string>(route.params.id.toString()); const id = ref<string>(route.params.id.toString());
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const editId = ref<string>(""); const editId = ref<string>("");
const keyword = ref<string>(""); const keyword = ref<string>("");
const historyKeyword = ref<string>(""); const historyKeyword = ref<string>("");
@ -225,7 +228,7 @@ function editForm(row: any) {
async function fetchData(id: string) { async function fetchData(id: string) {
showLoader(); showLoader();
await http await http
.get(config.API.profileNewAbilityByProfileId(id)) .get(config.API.profileNewAbilityByProfileId(id,empType.value))
.then(async (res) => { .then(async (res) => {
rows.value = res.data.result; rows.value = res.data.result;
}) })
@ -240,7 +243,7 @@ async function fetchData(id: string) {
async function fetchHistoryData(id: string) { async function fetchHistoryData(id: string) {
showLoader(); showLoader();
await http await http
.get(config.API.profileNewAbilityHisByAbilityId(id)) .get(config.API.profileNewAbilityHisByAbilityId(id,empType.value))
.then(async (res) => { .then(async (res) => {
historyRows.value = res.data.result; historyRows.value = res.data.result;
}) })
@ -254,7 +257,7 @@ async function fetchHistoryData(id: string) {
async function addData() { async function addData() {
await http await http
.post(config.API.profileNewAbility, { .post(config.API.profileNewAbility(empType.value), {
...specialSkill, ...specialSkill,
dateStart: null, dateStart: null,
dateEnd: null, dateEnd: null,
@ -273,7 +276,7 @@ async function addData() {
async function editData(idData: string) { async function editData(idData: string) {
await http await http
.patch(config.API.profileNewAbilityByAbilityId(idData), { .patch(config.API.profileNewAbilityByAbilityId(idData,empType.value), {
...specialSkill, ...specialSkill,
dateStart: null, dateStart: null,
dateEnd: null, dateEnd: null,
@ -294,7 +297,7 @@ async function editData(idData: string) {
async function deleteData(idData: string) { async function deleteData(idData: string) {
dialogRemove($q, () => dialogRemove($q, () =>
http http
.delete(config.API.profileNewAbilityByAbilityId(idData)) .delete(config.API.profileNewAbilityByAbilityId(idData,empType.value))
.then(() => { .then(() => {
fetchData(id.value); fetchData(id.value);
success($q, "ลบข้อมูลสำเร็จ"); success($q, "ลบข้อมูลสำเร็จ");
@ -517,9 +520,7 @@ onMounted(async () => {
v-model="specialSkill.field" v-model="specialSkill.field"
label="ด้าน" label="ด้าน"
hide-bottom-space hide-bottom-space
:rules="[ :rules="[(val) => !!val || `${'กรุณากรอกด้านความสามารถพิเศษ'}`]"
(val) => !!val || `${'กรุณากรอกด้านความสามารถพิเศษ'}`,
]"
/> />
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
@ -571,7 +572,7 @@ onMounted(async () => {
> >
<q-tooltip>นทกขอม</q-tooltip> <q-tooltip>นทกขอม</q-tooltip>
</q-btn> </q-btn>
</q-card-actions> </q-card-actions>
</q-form> </q-form>
</q-card> </q-card>
</q-dialog> </q-dialog>

View file

@ -24,6 +24,9 @@ const route = useRoute();
const profileId = ref<string>( const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const store = useSalaryDataStore(); const store = useSalaryDataStore();
const { const {
date2Thai, date2Thai,
@ -184,7 +187,7 @@ const docOption = ref<DataOption2[]>(store.optionTemplateDoc);
function fetchListSalary() { function fetchListSalary() {
showLoader(); showLoader();
http http
.get(config.API.profileListSalaryNew(profileId.value)) .get(config.API.profileListSalaryNew(profileId.value, empType.value))
.then((res) => { .then((res) => {
rows.value = res.data.result; rows.value = res.data.result;
}) })
@ -315,7 +318,8 @@ function onSubmit() {
async function submit() { async function submit() {
const formData = { const formData = {
profileId: isStatusEdit.value ? undefined : profileId.value, profileId: isStatusEdit.value || empType.value !== ''? undefined : profileId.value,
profileEmployeeId: empType.value !== "" ? profileId.value : undefined,
date: formDataSalary.date, // date: formDataSalary.date, //
posNo: formDataSalary.posNo, // posNo: formDataSalary.posNo, //
position: formDataSalary.position, // position: formDataSalary.position, //
@ -342,8 +346,8 @@ async function submit() {
try { try {
const url = isStatusEdit.value const url = isStatusEdit.value
? config.API.profileListSalaryNew(salaryId.value) ? config.API.profileListSalaryNew(salaryId.value, empType.value)
: config.API.profileSalaryNew; : config.API.profileSalaryNew(empType.value);
const method = isStatusEdit.value ? "patch" : "post"; const method = isStatusEdit.value ? "patch" : "post";
await http[method](url, formData); await http[method](url, formData);
fetchListSalary(); fetchListSalary();
@ -359,7 +363,7 @@ async function submit() {
function onSwapUp(id: string) { function onSwapUp(id: string) {
showLoader(); showLoader();
http http
.get(config.API.profileSalarySwapNew("up", id)) .get(config.API.profileSalarySwapNew("up", id, empType.value))
.then(() => { .then(() => {
fetchListSalary(); fetchListSalary();
}) })
@ -373,7 +377,7 @@ function onSwapUp(id: string) {
function onSwapDown(id: string) { function onSwapDown(id: string) {
showLoader(); showLoader();
http http
.get(config.API.profileSalarySwapNew("down", id)) .get(config.API.profileSalarySwapNew("down", id, empType.value))
.then(() => { .then(() => {
fetchListSalary(); fetchListSalary();
}) })
@ -397,7 +401,14 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="row items-center q-gutter-x-sm q-pb-sm"> <div class="row items-center q-gutter-x-sm q-pb-sm">
<q-btn flat color="primary" round dense icon="add" @click="onClickOpenDialog()"> <q-btn
flat
color="primary"
round
dense
icon="add"
@click="onClickOpenDialog()"
>
<q-tooltip>เพมขอม</q-tooltip> <q-tooltip>เพมขอม</q-tooltip>
</q-btn> </q-btn>
<q-space /> <q-space />
@ -536,109 +547,109 @@ onMounted(() => {
<q-card-section style="max-height: 55vh" class="scroll"> <q-card-section style="max-height: 55vh" class="scroll">
<div class="row col-12 q-col-gutter-sm"> <div class="row col-12 q-col-gutter-sm">
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<datepicker <datepicker
v-model="formDataSalary.date" v-model="formDataSalary.date"
:locale="'th'" :locale="'th'"
autoApply autoApply
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
> >
<template #year="{ year }">{{ year + 543 }}</template> <template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{ <template #year-overlay-value="{ value }">{{
parseInt(value + 543) parseInt(value + 543)
}}</template> }}</template>
<template #trigger> <template #trigger>
<q-input <q-input
outlined outlined
dense dense
borderless borderless
:model-value="date2Thai(formDataSalary.date)" :model-value="date2Thai(formDataSalary.date)"
:rules="[ :rules="[
(val: string) => (val: string) =>
!!val || !!val ||
`${'กรุณาเลือก วัน/เดือน/ปี'}`, `${'กรุณาเลือก วัน/เดือน/ปี'}`,
]" ]"
:label="`${'วัน/เดือน/ปี'}`" :label="`${'วัน/เดือน/ปี'}`"
hide-bottom-space hide-bottom-space
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
name="event" name="event"
color="primary" color="primary"
class="cursor-pointer" class="cursor-pointer"
> >
</q-icon> </q-icon>
</template> </template>
</q-input> </q-input>
</template> </template>
</datepicker> </datepicker>
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
<q-input <q-input
ref="posNoRef" ref="posNoRef"
outlined outlined
dense dense
lazy-rules lazy-rules
borderless borderless
v-model="formDataSalary.posNo" v-model="formDataSalary.posNo"
hide-bottom-space hide-bottom-space
:label="`${'เลขที่ตำแหน่ง'}`" :label="`${'เลขที่ตำแหน่ง'}`"
:rules="[(val: string) => !!val || `${'กรุณากรอกเลขที่ตำแหน่ง'}`]" :rules="[(val: string) => !!val || `${'กรุณากรอกเลขที่ตำแหน่ง'}`]"
> >
</q-input> </q-input>
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<q-select <q-select
ref="templatePosRef" ref="templatePosRef"
outlined outlined
dense dense
lazy-rules lazy-rules
borderless borderless
clearable clearable
v-model="formDataSalary.templatePos" v-model="formDataSalary.templatePos"
:label="`${'ต้นแบบ (template) ตำแหน่ง'}`" :label="`${'ต้นแบบ (template) ตำแหน่ง'}`"
option-label="name" option-label="name"
:options="posNoOptions" :options="posNoOptions"
option-value="name" option-value="name"
hide-bottom-space hide-bottom-space
emit-value emit-value
use-input use-input
input-debounce="0" input-debounce="0"
@update:modelValue="updatePos" @update:modelValue="updatePos"
@filter="(inputValue: any, @filter="(inputValue: any,
doneFn: Function) => filterSelector(inputValue, doneFn, 'pos' doneFn: Function) => filterSelector(inputValue, doneFn, 'pos'
)" )"
/> />
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<q-input <q-input
ref="positionRef" ref="positionRef"
outlined outlined
dense dense
lazy-rules lazy-rules
borderless borderless
v-model="formDataSalary.position" v-model="formDataSalary.position"
:label="`${'ตำแหน่ง'}`" :label="`${'ตำแหน่ง'}`"
type="textarea" type="textarea"
hide-bottom-space hide-bottom-space
:rules="[(val: string) => !!val || `${'กรุณากรอกตำแหน่ง'}`]" :rules="[(val: string) => !!val || `${'กรุณากรอกตำแหน่ง'}`]"
/> />
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<q-input <q-input
outlined outlined
dense dense
lazy-rules lazy-rules
v-model="formDataSalary.positionLine" v-model="formDataSalary.positionLine"
hide-bottom-space hide-bottom-space
:label="`${'สายงาน'}`" :label="`${'สายงาน'}`"
/> />
<!-- <q-select <!-- <q-select
outlined outlined
dense dense
lazy-rules lazy-rules
@ -657,178 +668,176 @@ onMounted(() => {
doneFn: Function) => filterSelector(inputValue, doneFn, 'positionLine' doneFn: Function) => filterSelector(inputValue, doneFn, 'positionLine'
)" )"
/> --> /> -->
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<q-input <q-input
outlined outlined
dense dense
lazy-rules lazy-rules
v-model="formDataSalary.positionPathSide" v-model="formDataSalary.positionPathSide"
hide-bottom-space hide-bottom-space
:label="`${'ด้าน/สาขา'}`" :label="`${'ด้าน/สาขา'}`"
/> />
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<q-input <q-input
outlined outlined
dense dense
lazy-rules lazy-rules
borderless borderless
v-model="formDataSalary.positionExecutive" v-model="formDataSalary.positionExecutive"
hide-bottom-space hide-bottom-space
:label="`${'ตำแหน่งทางการบริหาร'}`" :label="`${'ตำแหน่งทางการบริหาร'}`"
> >
</q-input> </q-input>
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<q-select <q-select
ref="positionType Ref" ref="positionType Ref"
outlined outlined
dense dense
lazy-rules lazy-rules
borderless borderless
v-model="formDataSalary.positionType" v-model="formDataSalary.positionType"
:label="`${'ตำแหน่งประเภท'}`" :label="`${'ตำแหน่งประเภท'}`"
emit-value emit-value
map-options map-options
option-label="name" option-label="name"
:options="posTypeOptions" :options="posTypeOptions"
option-value="name" option-value="name"
hide-bottom-space hide-bottom-space
use-input use-input
input-debounce="0" input-debounce="0"
@update:model-value="updateSelectType" @update:model-value="updateSelectType"
:rules="[(val: string) => !!val || `${'กรุณาเลือกตำแหน่งประเภท'}`]" :rules="[(val: string) => !!val || `${'กรุณาเลือกตำแหน่งประเภท'}`]"
@filter="(inputValue: any, @filter="(inputValue: any,
doneFn: Function) => filterSelector(inputValue, doneFn, 'posType' doneFn: Function) => filterSelector(inputValue, doneFn, 'posType'
)" )"
/> />
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<q-select <q-select
ref="positionLevel Ref" ref="positionLevel Ref"
outlined outlined
dense dense
lazy-rules lazy-rules
borderless borderless
v-model="formDataSalary.positionLevel" v-model="formDataSalary.positionLevel"
:rules="[(val: string) => !!val || `${'กรุณาเลือกระดับตำแหน่ง'}`]" :rules="[(val: string) => !!val || `${'กรุณาเลือกระดับตำแหน่ง'}`]"
:label="`${'ระดับตำแหน่ง'}`" :label="`${'ระดับตำแหน่ง'}`"
emit-value emit-value
map-options map-options
option-label="name" option-label="name"
:options="posLevelOption" :options="posLevelOption"
option-value="name" option-value="name"
hide-bottom-space hide-bottom-space
use-input use-input
input-debounce="0" input-debounce="0"
@filter="(inputValue: any, @filter="(inputValue: any,
doneFn: Function) => filterSelector(inputValue, doneFn, 'posLevel' doneFn: Function) => filterSelector(inputValue, doneFn, 'posLevel'
)" )"
/> />
</div> </div>
<div class="col-md-4"></div> <div class="col-md-4"></div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<q-input <q-input
ref="salaryRef" ref="salaryRef"
dense dense
outlined outlined
v-model="formDataSalary.salary" v-model="formDataSalary.salary"
label="เงินเดือน" label="เงินเดือน"
mask="###,###,###,###" mask="###,###,###,###"
reverse-fill-mask reverse-fill-mask
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]" :rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
/> />
</div> </div>
<div class="col-xs-6 col-sm-6 col-md-4"> <div class="col-xs-6 col-sm-6 col-md-4">
<q-input <q-input
ref="amountRef" ref="amountRef"
dense dense
outlined outlined
v-model="formDataSalary.salaryPos" v-model="formDataSalary.salaryPos"
:rules="[ :rules="[(val) => !!val || `${'กรุณากรอกเงินประจำตำแหน่ง'}`]"
(val) => !!val || `${'กรุณากรอกเงินประจำตำแหน่ง'}`, label="เงินประจำตำแหน่ง"
]" mask="###,###,###,###"
label="เงินประจำตำแหน่ง" reverse-fill-mask
mask="###,###,###,###" lazy-rules
reverse-fill-mask hide-bottom-space
lazy-rules />
hide-bottom-space </div>
/> <div class="col-xs-6 col-sm-6 col-md-4">
</div> <q-input
<div class="col-xs-6 col-sm-6 col-md-4"> ref="amountRef"
<q-input dense
ref="amountRef" outlined
dense v-model="formDataSalary.salaryCompensation"
outlined label="เงินค่าตอบแทนรายเดือน"
v-model="formDataSalary.salaryCompensation" mask="###,###,###,###"
label="เงินค่าตอบแทนรายเดือน" reverse-fill-mask
mask="###,###,###,###" lazy-rules
reverse-fill-mask hide-bottom-space
lazy-rules />
hide-bottom-space </div>
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-12"> <div class="col-xs-6 col-sm-6 col-md-12">
<q-input <q-input
outlined outlined
dense dense
lazy-rules lazy-rules
borderless borderless
v-model="formDataSalary.refCommandNo" v-model="formDataSalary.refCommandNo"
hide-bottom-space hide-bottom-space
:label="`${'เลขที่คำสั่ง'}`" :label="`${'เลขที่คำสั่ง'}`"
mask="#####################" mask="#####################"
> >
<!-- :rules="[(val: string) => !!val || `${'กรุณากรอกเลขที่คำสั่ง'}`]" --> <!-- :rules="[(val: string) => !!val || `${'กรุณากรอกเลขที่คำสั่ง'}`]" -->
</q-input> </q-input>
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<q-select <q-select
ref="templateDocRef" ref="templateDocRef"
outlined outlined
dense dense
lazy-rules lazy-rules
borderless borderless
clearable clearable
v-model="formDataSalary.templateDoc" v-model="formDataSalary.templateDoc"
:label="`${'ต้นแบบ (template) เอกสารอ้างอิง'}`" :label="`${'ต้นแบบ (template) เอกสารอ้างอิง'}`"
option-label="name" option-label="name"
:options="docOption" :options="docOption"
option-value="name" option-value="name"
emit-value emit-value
hide-bottom-space hide-bottom-space
use-input use-input
input-debounce="0" input-debounce="0"
@update:modelValue="updateDoc" @update:modelValue="updateDoc"
@filter="(inputValue: any, @filter="(inputValue: any,
doneFn: Function) => filterSelector(inputValue, doneFn, 'doc' doneFn: Function) => filterSelector(inputValue, doneFn, 'doc'
)" )"
/> />
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<q-input <q-input
ref="docRef" ref="docRef"
outlined outlined
dense dense
lazy-rules lazy-rules
borderless borderless
v-model="formDataSalary.doc" v-model="formDataSalary.doc"
:label="`${'เอกสารอ้างอิง'}`" :label="`${'เอกสารอ้างอิง'}`"
type="textarea" type="textarea"
hide-bottom-space hide-bottom-space
:rules="[(val: number) => !!val || `${'กรุณากรอกเอกสารอ้างอิง'}`]" :rules="[(val: number) => !!val || `${'กรุณากรอกเอกสารอ้างอิง'}`]"
/> />
</div> </div>
</div> </div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />

View file

@ -3,6 +3,7 @@ import { ref, watch } from "vue";
import { useQuasar } from "quasar"; 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 { useRoute } from "vue-router";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
@ -11,6 +12,7 @@ import DialogHeader from "@/components/DialogHeader.vue";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
const $q = useQuasar(); const $q = useQuasar();
const route = useRoute();
const { const {
date2Thai, date2Thai,
dialogConfirm, dialogConfirm,
@ -20,6 +22,10 @@ const {
success, success,
} = useCounterMixin(); } = useCounterMixin();
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const modal = defineModel<boolean>("modal", { required: true }); const modal = defineModel<boolean>("modal", { required: true });
const salaryId = defineModel<string>("salaryId", { required: true }); const salaryId = defineModel<string>("salaryId", { required: true });
@ -227,7 +233,7 @@ function closeDialog() {
function fetchListHistory() { function fetchListHistory() {
showLoader(); showLoader();
http http
.get(config.API.profileListSalaryHistoryNew(salaryId.value)) .get(config.API.profileListSalaryHistoryNew(salaryId.value, empType.value))
.then((res) => { .then((res) => {
rows.value = res.data.result; rows.value = res.data.result;
}) })

View file

@ -28,6 +28,9 @@ const id = ref<string>("");
const profileId = ref<string>( const profileId = ref<string>(
route.params.id ? route.params.id.toString() : "" route.params.id ? route.params.id.toString() : ""
); );
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const modelView = ref<string>("table"); const modelView = ref<string>("table");
const modalDialog = ref<boolean>(false); const modalDialog = ref<boolean>(false);
@ -145,7 +148,7 @@ function onClickCloseDialog() {
async function getData() { async function getData() {
showLoader(); showLoader();
await http await http
.get(config.API.profileNewNoPaidByProfileId(profileId.value)) .get(config.API.profileNewNoPaidByProfileId(profileId.value, empType.value))
.then((res) => { .then((res) => {
rows.value = res.data.result; rows.value = res.data.result;
}) })
@ -160,9 +163,10 @@ async function getData() {
async function saveData() { async function saveData() {
showLoader(); showLoader();
await http await http
.post(config.API.profileNewNoPaid, { .post(config.API.profileNewNoPaid(empType.value), {
...formData, ...formData,
profileId: profileId.value, profileId: empType.value === "" ? profileId.value : undefined,
profileEmployeeId: empType.value !== "" ? profileId.value : undefined,
}) })
.then((res) => { .then((res) => {
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
@ -180,7 +184,7 @@ async function saveData() {
async function editData() { async function editData() {
showLoader(); showLoader();
await http await http
.patch(config.API.profileNewNoPaidById(id.value), { .patch(config.API.profileNewNoPaidById(id.value, empType.value), {
...formData, ...formData,
profileId: undefined, profileId: undefined,
}) })
@ -224,7 +228,13 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="row items-center q-gutter-x-sm q-pb-sm"> <div class="row items-center q-gutter-x-sm q-pb-sm">
<q-btn dense color="teal-5" icon="add" flat round @click="onClickOpenDialog()" <q-btn
dense
color="teal-5"
icon="add"
flat
round
@click="onClickOpenDialog()"
><q-tooltip>เพมขอม</q-tooltip></q-btn ><q-tooltip>เพมขอม</q-tooltip></q-btn
> >
@ -427,7 +437,7 @@ onMounted(() => {
:close="onClickCloseDialog" :close="onClickCloseDialog"
/> />
<q-separator color="grey-4" /> <q-separator color="grey-4" />
<q-card-section style="max-height: 55vh" class="scroll"> <q-card-section style="max-height: 55vh" class="scroll">
<div class="row col-12 q-col-gutter-sm"> <div class="row col-12 q-col-gutter-sm">
<div class="col-xs-6 col-sm-6 col-md-6"> <div class="col-xs-6 col-sm-6 col-md-6">
@ -451,9 +461,7 @@ onMounted(() => {
borderless borderless
class="inputgreen" class="inputgreen"
:model-value="date2Thai(formData.date)" :model-value="date2Thai(formData.date)"
:rules="[ :rules="[(val) => !!val || `${'กรุณาเลือก วัน/เดือน/ปี'}`]"
(val) => !!val || `${'กรุณาเลือก วัน/เดือน/ปี'}`,
]"
hide-bottom-space hide-bottom-space
:label="`${'วัน/เดือน/ปี'}`" :label="`${'วัน/เดือน/ปี'}`"
> >
@ -479,9 +487,7 @@ onMounted(() => {
borderless borderless
v-model="formData.reference" v-model="formData.reference"
class="inputgreen" class="inputgreen"
:rules="[ :rules="[(val) => !!val || `${'กรุณากรอกเอกสารอ้างอิง'}`]"
(val) => !!val || `${'กรุณากรอกเอกสารอ้างอิง'}`,
]"
hide-bottom-space hide-bottom-space
:label="`${'เอกสารอ้างอิง'}`" :label="`${'เอกสารอ้างอิง'}`"
/> />

View file

@ -2,6 +2,7 @@
import { ref, watch } from "vue"; import { ref, watch } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import { useRoute } from "vue-router";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
@ -10,10 +11,15 @@ import type { RowList } from "@/modules/04_registryNew/interface/index/salary";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
const route = useRoute();
const $q = useQuasar(); const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin; const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const modal = defineModel<boolean>("modal", { required: true }); const modal = defineModel<boolean>("modal", { required: true });
const id = defineModel<string>("id", { required: true }); const id = defineModel<string>("id", { required: true });
const filter = ref<string>(""); const filter = ref<string>("");
@ -117,7 +123,7 @@ const pagination = ref({
function getHistory() { function getHistory() {
showLoader(); showLoader();
http http
.get(config.API.profileNewNoPaidHisById(id.value)) .get(config.API.profileNewNoPaidHisById(id.value, empType.value))
.then((res) => { .then((res) => {
rows.value = res.data.result; rows.value = res.data.result;
}) })
@ -144,7 +150,7 @@ watch(modal, (status) => {
</script> </script>
<template> <template>
<q-dialog v-model="modal" persistent full-width> <q-dialog v-model="modal" persistent full-width>
<q-card style="min-width: 80%"> <q-card style="min-width: 80%">
<DialogHeader <DialogHeader
:tittle="'ประวัติแก้ไขบันทึกวันที่ไม่ได้รับเงินเดือนฯ'" :tittle="'ประวัติแก้ไขบันทึกวันที่ไม่ได้รับเงินเดือนฯ'"
:close="closeDialog" :close="closeDialog"

View file

@ -394,7 +394,9 @@ onMounted(async () => {
{{ {{
labelOption.posType !== "ทั้งหมด" labelOption.posType !== "ทั้งหมด"
? labelOption.posType ? labelOption.posType
: `ประเภทตำแหน่ง${labelOption.posType}` : empType === "officer"
? `ประเภทตำแหน่ง${labelOption.posType}`
: `กลุ่มงาน${labelOption.posType}`
}} }}
<q-btn <q-btn
size="10px" size="10px"
@ -435,7 +437,9 @@ onMounted(async () => {
{{ {{
labelOption.posLevel !== "ทั้งหมด" labelOption.posLevel !== "ทั้งหมด"
? labelOption.posLevel ? labelOption.posLevel
: `ระดับตำแหน่ง${labelOption.posLevel}` : empType === "officer"
? `ระดับตำแหน่ง${labelOption.posLevel}`
: `ระดับชั้นงาน${labelOption.posLevel}`
}} }}
<q-btn <q-btn
size="10px" size="10px"