Merge branch 'develop' into devTee

This commit is contained in:
STW_TTTY\stwtt 2024-05-14 18:13:19 +07:00
commit 18791d4468
20 changed files with 931 additions and 794 deletions

View file

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

View file

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

View file

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

View file

@ -18,12 +18,13 @@ const router = useRouter();
const formFilter = defineModel<FormFilter>("formFilter", { required: true });
const maxPage = defineModel<Number>("maxPage", { required: true });
const empType = defineModel<string>("empType", { required: true });
const props = defineProps({
rows: { type: Array },
fetchData: { type: Function },
fetchType: { type: Function },
total: { type: Number },
empType: { type: String },
// empType: { type: String },
});
const columns = ref<QTableProps["columns"]>([
@ -167,7 +168,7 @@ function onClickHistory() {
}
function onClickViewDetail(id: string) {
if (props.empType === "officer") {
if (empType.value === "officer") {
router.push(`/registry-new/${id}`);
} else {
router.push(`/registry-new-employee/${id}`);
@ -299,8 +300,8 @@ watch(
<div class="row col-12 wrap items-center">
<q-item>
<q-item-section avatar>
<q-avatar>
<img :src="props.row.avartar" class="col-4 img-info" />
<q-avatar size="50px" class="bg-grey-2">
<q-img :src="props.row.avatar" />
</q-avatar>
</q-item-section>
<q-item-section>
@ -371,7 +372,11 @@ watch(
<q-item dense>
<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-label caption class="text-black">
@ -384,7 +389,11 @@ watch(
<q-item dense>
<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-label caption class="text-black">

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -358,7 +358,14 @@ async function fetchProfile(id: string) {
async function addData() {
await http
.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) => {
subId.value = res.data.result;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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