ทะเบียนประวัติ => ข้อมูลครอบครัว
This commit is contained in:
parent
f89c9e02c1
commit
acee32e3cf
12 changed files with 240 additions and 110 deletions
|
|
@ -39,38 +39,40 @@ export default {
|
||||||
`${registryNew}${type}/nopaid/history/${dataId}`,
|
`${registryNew}${type}/nopaid/history/${dataId}`,
|
||||||
|
|
||||||
// เครื่องราชฯ
|
// เครื่องราชฯ
|
||||||
profileNewInsign: `${registryNew}/insignia`,
|
profileNewInsign: (type: string) => `${registryNew}${type}/insignia`,
|
||||||
profileNewInsignByProfileId: (profileId: string) =>
|
profileNewInsignByProfileId: (profileId: string, type: string) =>
|
||||||
`${registryNew}/insignia/${profileId}`,
|
`${registryNew}${type}/insignia/${profileId}`,
|
||||||
profileNewInsignById: (dataId: string) => `${registryNew}/insignia/${dataId}`,
|
profileNewInsignById: (dataId: string, type: string) =>
|
||||||
profileNewInsignHisById: (dataId: string) =>
|
`${registryNew}${type}/insignia/${dataId}`,
|
||||||
`${registryNew}/insignia/history/${dataId}`,
|
profileNewInsignHisById: (dataId: string, type: string) =>
|
||||||
|
`${registryNew}${type}/insignia/history/${dataId}`,
|
||||||
|
|
||||||
// ประกาศเกียรติคุณ
|
// ประกาศเกียรติคุณ
|
||||||
profileNewHonor: `${registryNew}/honor`,
|
profileNewHonor: (type: string) => `${registryNew}${type}/honor`,
|
||||||
profileNewHonorByProfileId: (profileId: string) =>
|
profileNewHonorByProfileId: (profileId: string, type: string) =>
|
||||||
`${registryNew}/honor/${profileId}`,
|
`${registryNew}${type}/honor/${profileId}`,
|
||||||
profileNewHonorById: (dataId: string) => `${registryNew}/honor/${dataId}`,
|
profileNewHonorById: (dataId: string, type: string) =>
|
||||||
profileNewHonorHisById: (dataId: string) =>
|
`${registryNew}${type}/honor/${dataId}`,
|
||||||
`${registryNew}/honor/history/${dataId}`,
|
profileNewHonorHisById: (dataId: string, type: string) =>
|
||||||
|
`${registryNew}${type}/honor/history/${dataId}`,
|
||||||
|
|
||||||
// ผลการประเมินการปฏิบัติราชการ
|
// ผลการประเมินการปฏิบัติราชการ
|
||||||
profileNewAssessments: `${registryNew}/assessments`,
|
profileNewAssessments: (type: string) => `${registryNew}${type}/assessments`,
|
||||||
profileNewAssessmentsByProfileId: (profileId: string) =>
|
profileNewAssessmentsByProfileId: (profileId: string, type: string) =>
|
||||||
`${registryNew}/assessments/${profileId}`,
|
`${registryNew}${type}/assessments/${profileId}`,
|
||||||
profileNewAssessmentsById: (dataId: string) =>
|
profileNewAssessmentsById: (dataId: string, type: string) =>
|
||||||
`${registryNew}/assessments/${dataId}`,
|
`${registryNew}${type}/assessments/${dataId}`,
|
||||||
profileNewAssessmentsHisById: (dataId: string) =>
|
profileNewAssessmentsHisById: (dataId: string, type: string) =>
|
||||||
`${registryNew}/assessments/history/${dataId}`,
|
`${registryNew}${type}/assessments/history/${dataId}`,
|
||||||
|
|
||||||
// การฝึกอบรม
|
// การฝึกอบรม
|
||||||
profileNewTraining: `${registryNew}/training`,
|
profileNewTraining: (type: string) => `${registryNew}${type}/training`,
|
||||||
profileNewTrainingByProfileId: (profileId: string) =>
|
profileNewTrainingByProfileId: (profileId: string, type: string) =>
|
||||||
`${registryNew}/training/${profileId}`,
|
`${registryNew}${type}/training/${profileId}`,
|
||||||
profileNewTrainingByTrainingId: (trainingId: string) =>
|
profileNewTrainingByTrainingId: (trainingId: string, type: string) =>
|
||||||
`${registryNew}/training/${trainingId}`,
|
`${registryNew}${type}/training/${trainingId}`,
|
||||||
profileNewTrainingHisByTrainingId: (trainingId: string) =>
|
profileNewTrainingHisByTrainingId: (trainingId: string, type: string) =>
|
||||||
`${registryNew}/training/history/${trainingId}`,
|
`${registryNew}${type}/training/history/${trainingId}`,
|
||||||
|
|
||||||
// ประวัติการศึกษา
|
// ประวัติการศึกษา
|
||||||
profileNewEducation: (type: string) => `${registryNew}${type}/educations`,
|
profileNewEducation: (type: string) => `${registryNew}${type}/educations`,
|
||||||
|
|
@ -91,21 +93,24 @@ export default {
|
||||||
`${registryNew}${type}/ability/history/${abilityId}`,
|
`${registryNew}${type}/ability/history/${abilityId}`,
|
||||||
|
|
||||||
// ใบอนุญาตประกอบวิชาชีพ
|
// ใบอนุญาตประกอบวิชาชีพ
|
||||||
profileNewCertificate: `${registryNew}/certificate`,
|
profileNewCertificate: (type: string) => `${registryNew}${type}/certificate`,
|
||||||
profileNewCertificateByProfileId: (profileId: string) =>
|
profileNewCertificateByProfileId: (profileId: string, type: string) =>
|
||||||
`${registryNew}/certificate/${profileId}`,
|
`${registryNew}${type}/certificate/${profileId}`,
|
||||||
profileNewCertificateByCertificateId: (certificateId: string) =>
|
profileNewCertificateByCertificateId: (certificateId: string, type: string) =>
|
||||||
`${registryNew}/certificate/${certificateId}`,
|
`${registryNew}${type}/certificate/${certificateId}`,
|
||||||
profileNewCertificateHisByCertificateId: (certificateId: string) =>
|
profileNewCertificateHisByCertificateId: (
|
||||||
`${registryNew}/certificate/history/${certificateId}`,
|
certificateId: string,
|
||||||
|
type: string
|
||||||
|
) => `${registryNew}${type}/certificate/history/${certificateId}`,
|
||||||
|
|
||||||
// ข้อมูลอื่นๆ
|
// ข้อมูลอื่นๆ
|
||||||
profileNewOther: `${registryNew}/other`,
|
profileNewOther: (type: string) => `${registryNew}${type}/other`,
|
||||||
profileNewOtherByProfileId: (profileId: string) =>
|
profileNewOtherByProfileId: (profileId: string, type: string) =>
|
||||||
`${registryNew}/other/${profileId}`,
|
`${registryNew}${type}/other/${profileId}`,
|
||||||
profileNewOtherById: (dataId: string) => `${registryNew}/other/${dataId}`,
|
profileNewOtherById: (dataId: string, type: string) =>
|
||||||
profileNewOtherHisById: (dataId: string) =>
|
`${registryNew}${type}/other/${dataId}`,
|
||||||
`${registryNew}/other/history/${dataId}`,
|
profileNewOtherHisById: (dataId: string, type: string) =>
|
||||||
|
`${registryNew}${type}/other/history/${dataId}`,
|
||||||
|
|
||||||
// ข้อมูลครอบครัว
|
// ข้อมูลครอบครัว
|
||||||
profileNewFamily: (type: string) => `${registryNew}${type}/family`,
|
profileNewFamily: (type: string) => `${registryNew}${type}/family`,
|
||||||
|
|
@ -167,4 +172,8 @@ export default {
|
||||||
`${registryNew}${type}/changeName/${changeNameId}`,
|
`${registryNew}${type}/changeName/${changeNameId}`,
|
||||||
profileNewChangeNameHisByChangeNameId: (changeNameId: string, type: string) =>
|
profileNewChangeNameHisByChangeNameId: (changeNameId: string, type: string) =>
|
||||||
`${registryNew}${type}/changeName/history/${changeNameId}`,
|
`${registryNew}${type}/changeName/history/${changeNameId}`,
|
||||||
|
|
||||||
|
//ข้อมูลครอบครับ
|
||||||
|
profileFamily: (empType: string, type: string) =>
|
||||||
|
`${registryNew}${empType}/${type}`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,9 @@ const mode = ref<string>("table");
|
||||||
const dialog = ref<boolean>(false);
|
const dialog = ref<boolean>(false);
|
||||||
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 dialogStatus = ref<string>("create");
|
const dialogStatus = ref<string>("create");
|
||||||
const editId = ref<string>("");
|
const editId = ref<string>("");
|
||||||
const keyword = ref<string>("");
|
const keyword = ref<string>("");
|
||||||
|
|
@ -235,7 +238,7 @@ function closeHistoryDialog() {
|
||||||
async function fetchData(id: string) {
|
async function fetchData(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.profileNewCertificateByProfileId(id))
|
.get(config.API.profileNewCertificateByProfileId(id,empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
rows.value = res.data.result;
|
rows.value = res.data.result;
|
||||||
})
|
})
|
||||||
|
|
@ -268,8 +271,10 @@ function editForm(row: any) {
|
||||||
|
|
||||||
async function addData() {
|
async function addData() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.profileNewCertificate, {
|
.post(config.API.profileNewCertificate(empType.value), {
|
||||||
...profesLicenseData,
|
...profesLicenseData,
|
||||||
|
profileId: empType.value === "" ? id.value : undefined,
|
||||||
|
profileEmployeeId: empType.value !== "" ? id.value : undefined,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData(id.value);
|
fetchData(id.value);
|
||||||
|
|
@ -285,7 +290,7 @@ async function addData() {
|
||||||
|
|
||||||
async function editData(idData: string) {
|
async function editData(idData: string) {
|
||||||
await http
|
await http
|
||||||
.patch(config.API.profileNewCertificateByCertificateId(idData), {
|
.patch(config.API.profileNewCertificateByCertificateId(idData,empType.value), {
|
||||||
...profesLicenseData,
|
...profesLicenseData,
|
||||||
profileId: undefined,
|
profileId: undefined,
|
||||||
})
|
})
|
||||||
|
|
@ -320,7 +325,7 @@ async function editData(idData: string) {
|
||||||
async function fetchHistoryData(id: string) {
|
async function fetchHistoryData(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.profileNewCertificateHisByCertificateId(id))
|
.get(config.API.profileNewCertificateHisByCertificateId(id,empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
historyRows.value = res.data.result;
|
historyRows.value = res.data.result;
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,9 @@ const {
|
||||||
|
|
||||||
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 mode = ref<string>("table");
|
const mode = ref<string>("table");
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
|
@ -396,11 +399,13 @@ function editForm(row: any) {
|
||||||
|
|
||||||
async function addData() {
|
async function addData() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.profileNewTraining, {
|
.post(config.API.profileNewTraining(empType.value), {
|
||||||
...trainData,
|
...trainData,
|
||||||
startYear: undefined,
|
startYear: undefined,
|
||||||
finishYear: undefined,
|
finishYear: undefined,
|
||||||
isDate: isDate.value === "false" ? false : true,
|
isDate: isDate.value === "false" ? false : true,
|
||||||
|
profileId: empType.value === "" ? id.value : undefined,
|
||||||
|
profileEmployeeId: empType.value !== "" ? id.value : undefined,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData(id.value);
|
fetchData(id.value);
|
||||||
|
|
@ -416,7 +421,7 @@ async function addData() {
|
||||||
|
|
||||||
async function editData(idData: string) {
|
async function editData(idData: string) {
|
||||||
await http
|
await http
|
||||||
.patch(config.API.profileNewTrainingByTrainingId(idData), {
|
.patch(config.API.profileNewTrainingByTrainingId(idData, empType.value), {
|
||||||
...trainData,
|
...trainData,
|
||||||
profileId: undefined,
|
profileId: undefined,
|
||||||
startYear: undefined,
|
startYear: undefined,
|
||||||
|
|
@ -438,7 +443,7 @@ async function editData(idData: string) {
|
||||||
function deleteData(idData: string) {
|
function deleteData(idData: string) {
|
||||||
dialogRemove($q, () =>
|
dialogRemove($q, () =>
|
||||||
http
|
http
|
||||||
.delete(config.API.profileNewTrainingByTrainingId(idData))
|
.delete(config.API.profileNewTrainingByTrainingId(idData, empType.value))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
fetchData(id.value);
|
fetchData(id.value);
|
||||||
success($q, "ลบข้อมูลสำเร็จ");
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
|
|
@ -463,7 +468,7 @@ function closeHistoryDialog() {
|
||||||
async function fetchData(id: string) {
|
async function fetchData(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.profileNewTrainingByProfileId(id))
|
.get(config.API.profileNewTrainingByProfileId(id, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
rows.value = res.data.result;
|
rows.value = res.data.result;
|
||||||
})
|
})
|
||||||
|
|
@ -478,7 +483,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.profileNewTrainingHisByTrainingId(id))
|
.get(config.API.profileNewTrainingHisByTrainingId(id, empType.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
historyRows.value = res.data.result;
|
historyRows.value = res.data.result;
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@ const {
|
||||||
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 id = ref<string>("");
|
const id = ref<string>("");
|
||||||
const insigniaType = ref<string>("");
|
const insigniaType = ref<string>("");
|
||||||
|
|
@ -447,7 +450,7 @@ async function fetchData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
try {
|
try {
|
||||||
const res = await http.get(
|
const res = await http.get(
|
||||||
config.API.profileNewInsignByProfileId(profileId.value)
|
config.API.profileNewInsignByProfileId(profileId.value, empType.value)
|
||||||
);
|
);
|
||||||
rows.value = res.data.result;
|
rows.value = res.data.result;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -474,12 +477,15 @@ async function addEditData(editStatus: boolean = false) {
|
||||||
if (!profileId.value) return;
|
if (!profileId.value) return;
|
||||||
|
|
||||||
const url = editStatus
|
const url = editStatus
|
||||||
? config.API.profileNewInsignById(id.value)
|
? config.API.profileNewInsignById(id.value, empType.value)
|
||||||
: config.API.profileNewInsign;
|
: config.API.profileNewInsign(empType.value);
|
||||||
const method = editStatus ? "patch" : "post";
|
const method = editStatus ? "patch" : "post";
|
||||||
const reqBody: RequestItemsObject = {
|
const reqBody: RequestItemsObject = {
|
||||||
...insigniaForm,
|
...insigniaForm,
|
||||||
profileId: editStatus ? undefined : profileId.value,
|
profileEmployeeId:
|
||||||
|
!editStatus && empType.value !== "" ? profileId.value : undefined,
|
||||||
|
profileId:
|
||||||
|
!editStatus && empType.value === "" ? profileId.value : undefined,
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
await http[method](url, reqBody);
|
await http[method](url, reqBody);
|
||||||
|
|
@ -528,7 +534,9 @@ async function clickHistory(row: ResponseObject) {
|
||||||
|
|
||||||
showLoader();
|
showLoader();
|
||||||
try {
|
try {
|
||||||
const res = await http.get(config.API.profileNewInsignHisById(row.id));
|
const res = await http.get(
|
||||||
|
config.API.profileNewInsignHisById(row.id, empType.value)
|
||||||
|
);
|
||||||
rowsHistory.value = res.data.result;
|
rowsHistory.value = res.data.result;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -599,7 +607,13 @@ onMounted(async () => {
|
||||||
|
|
||||||
<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="primary" icon="add" flat round @click="onClickOpenDialog()"
|
<q-btn
|
||||||
|
dense
|
||||||
|
color="primary"
|
||||||
|
icon="add"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
@click="onClickOpenDialog()"
|
||||||
><q-tooltip>เพิ่มข้อมูล</q-tooltip></q-btn
|
><q-tooltip>เพิ่มข้อมูล</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
@ -799,7 +813,7 @@ onMounted(async () => {
|
||||||
/>
|
/>
|
||||||
<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">
|
||||||
<datepicker
|
<datepicker
|
||||||
autoApply
|
autoApply
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,9 @@ const {
|
||||||
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 id = ref<string>("");
|
const id = ref<string>("");
|
||||||
const issueDateYear = ref<number>(0);
|
const issueDateYear = ref<number>(0);
|
||||||
|
|
@ -223,7 +226,7 @@ async function fetchData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
try {
|
try {
|
||||||
const res = await http.get(
|
const res = await http.get(
|
||||||
config.API.profileNewHonorByProfileId(profileId.value)
|
config.API.profileNewHonorByProfileId(profileId.value, empType.value)
|
||||||
);
|
);
|
||||||
rows.value = res.data.result;
|
rows.value = res.data.result;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -237,12 +240,15 @@ async function addEditData(editStatus: boolean = false) {
|
||||||
if (!profileId.value) return;
|
if (!profileId.value) return;
|
||||||
|
|
||||||
const url = editStatus
|
const url = editStatus
|
||||||
? config.API.profileNewHonorById(id.value)
|
? config.API.profileNewHonorById(id.value, empType.value)
|
||||||
: config.API.profileNewHonor;
|
: config.API.profileNewHonor(empType.value);
|
||||||
const method = editStatus ? "patch" : "post";
|
const method = editStatus ? "patch" : "post";
|
||||||
const reqBody: RequestItemsObject = {
|
const reqBody: RequestItemsObject = {
|
||||||
...declHonorForm,
|
...declHonorForm,
|
||||||
profileId: editStatus ? undefined : profileId.value,
|
profileEmployeeId:
|
||||||
|
!editStatus && empType.value !== "" ? profileId.value : undefined,
|
||||||
|
profileId:
|
||||||
|
!editStatus && empType.value === "" ? profileId.value : undefined,
|
||||||
isDate: declHonorForm.isDate === "true" ? true : false,
|
isDate: declHonorForm.isDate === "true" ? true : false,
|
||||||
issueDate:
|
issueDate:
|
||||||
declHonorForm.isDate === "true"
|
declHonorForm.isDate === "true"
|
||||||
|
|
@ -291,7 +297,9 @@ async function clickHistory(row: ResponseObject) {
|
||||||
|
|
||||||
showLoader();
|
showLoader();
|
||||||
try {
|
try {
|
||||||
const res = await http.get(config.API.profileNewHonorHisById(row.id));
|
const res = await http.get(
|
||||||
|
config.API.profileNewHonorHisById(row.id, empType.value)
|
||||||
|
);
|
||||||
rowsHistory.value = res.data.result;
|
rowsHistory.value = res.data.result;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -329,7 +337,13 @@ onMounted(async () => {
|
||||||
</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="primary" icon="add" flat round @click="onClickOpenDialog()"
|
<q-btn
|
||||||
|
dense
|
||||||
|
color="primary"
|
||||||
|
icon="add"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
@click="onClickOpenDialog()"
|
||||||
><q-tooltip>เพิ่มข้อมูล</q-tooltip></q-btn
|
><q-tooltip>เพิ่มข้อมูล</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
@ -722,18 +736,18 @@ onMounted(async () => {
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-separator color="grey-4" />
|
<q-separator color="grey-4" />
|
||||||
<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>
|
||||||
</q-form>
|
</q-form>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,9 @@ const {
|
||||||
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 id = ref<string>("");
|
const id = ref<string>("");
|
||||||
const resPerformForm = reactive<RequestItemsObject>({
|
const resPerformForm = reactive<RequestItemsObject>({
|
||||||
|
|
@ -295,7 +298,10 @@ async function fetchData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
try {
|
try {
|
||||||
const res = await http.get(
|
const res = await http.get(
|
||||||
config.API.profileNewAssessmentsByProfileId(profileId.value)
|
config.API.profileNewAssessmentsByProfileId(
|
||||||
|
profileId.value,
|
||||||
|
empType.value
|
||||||
|
)
|
||||||
);
|
);
|
||||||
rows.value = res.data.result;
|
rows.value = res.data.result;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -309,12 +315,15 @@ async function addEditData(editStatus: boolean = false) {
|
||||||
if (!profileId.value) return;
|
if (!profileId.value) return;
|
||||||
|
|
||||||
const url = editStatus
|
const url = editStatus
|
||||||
? config.API.profileNewAssessmentsById(id.value)
|
? config.API.profileNewAssessmentsById(id.value, empType.value)
|
||||||
: config.API.profileNewAssessments;
|
: config.API.profileNewAssessments(empType.value);
|
||||||
const method = editStatus ? "patch" : "post";
|
const method = editStatus ? "patch" : "post";
|
||||||
const reqBody: RequestItemsObject = {
|
const reqBody: RequestItemsObject = {
|
||||||
...resPerformForm,
|
...resPerformForm,
|
||||||
profileId: editStatus ? undefined : profileId.value,
|
profileEmployeeId:
|
||||||
|
!editStatus && empType.value !== "" ? profileId.value : undefined,
|
||||||
|
profileId:
|
||||||
|
!editStatus && empType.value === "" ? profileId.value : undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -358,7 +367,7 @@ async function clickHistory(row: ResponseObject) {
|
||||||
|
|
||||||
showLoader();
|
showLoader();
|
||||||
try {
|
try {
|
||||||
const res = await http.get(config.API.profileNewAssessmentsHisById(row.id));
|
const res = await http.get(config.API.profileNewAssessmentsHisById(row.id,empType.value));
|
||||||
|
|
||||||
rowsHistory.value = res.data.result;
|
rowsHistory.value = res.data.result;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
@ -398,7 +407,13 @@ onMounted(async () => {
|
||||||
</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="primary" icon="add" flat round @click="onClickOpenDialog()"
|
<q-btn
|
||||||
|
dense
|
||||||
|
color="primary"
|
||||||
|
icon="add"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
@click="onClickOpenDialog()"
|
||||||
><q-tooltip>เพิ่มข้อมูล</q-tooltip></q-btn
|
><q-tooltip>เพิ่มข้อมูล</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,9 @@ const pagination = ref({
|
||||||
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 mode = ref<string>("table");
|
const mode = ref<string>("table");
|
||||||
const filterKeyword = ref<string>("");
|
const filterKeyword = ref<string>("");
|
||||||
const rows = ref<RowList[]>([]);
|
const rows = ref<RowList[]>([]);
|
||||||
|
|
@ -148,12 +151,13 @@ function validateForm() {
|
||||||
async function saveData() {
|
async function saveData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.post(config.API.profileNewOther, {
|
.post(config.API.profileNewOther(empType.value), {
|
||||||
profileId: profileId.value,
|
profileId: empType.value === "" ? profileId.value : undefined,
|
||||||
|
profileEmployeeId: empType.value !== "" ? profileId.value : undefined,
|
||||||
date: date.value,
|
date: date.value,
|
||||||
detail: detail.value,
|
detail: detail.value,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then(() => {
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
getData();
|
getData();
|
||||||
closeDialog();
|
closeDialog();
|
||||||
|
|
@ -172,7 +176,7 @@ async function saveData() {
|
||||||
async function editData() {
|
async function editData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.patch(config.API.profileNewOtherById(id.value), {
|
.patch(config.API.profileNewOtherById(id.value, empType.value), {
|
||||||
date: date.value,
|
date: date.value,
|
||||||
detail: detail.value,
|
detail: detail.value,
|
||||||
})
|
})
|
||||||
|
|
@ -192,7 +196,7 @@ async function editData() {
|
||||||
async function getData() {
|
async function getData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.profileNewOtherByProfileId(profileId.value))
|
.get(config.API.profileNewOtherByProfileId(profileId.value, empType.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
rows.value = res.data.result;
|
rows.value = res.data.result;
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ 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 type { RowList } from "@/modules/04_registryNew/interface/index/other";
|
import type { RowList } from "@/modules/04_registryNew/interface/index/other";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -17,6 +19,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;
|
||||||
const historyPagination = ref({
|
const historyPagination = ref({
|
||||||
|
|
@ -39,6 +42,9 @@ const formFilter = reactive<FormFilter>({
|
||||||
isShowRetire: false,
|
isShowRetire: false,
|
||||||
isProbation: false,
|
isProbation: false,
|
||||||
});
|
});
|
||||||
|
const empType = ref<string>(
|
||||||
|
route.name === "registryNewByid" ? "" : "-employee"
|
||||||
|
);
|
||||||
|
|
||||||
const visibleColumns = ref<String[]>([
|
const visibleColumns = ref<String[]>([
|
||||||
"date",
|
"date",
|
||||||
|
|
@ -95,7 +101,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
function getHistory() {
|
function getHistory() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.profileNewOtherHisById(id.value))
|
.get(config.API.profileNewOtherHisById(id.value, empType.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
|
|
@ -130,10 +136,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">
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref, onMounted } from "vue";
|
import { reactive, ref, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } 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";
|
||||||
|
|
||||||
|
|
@ -12,6 +14,8 @@ import { useProfileDataStore } from "@/modules/04_registryNew/stores/profile";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
const store = useProfileDataStore();
|
const store = useProfileDataStore();
|
||||||
const { fetchPerson, filterSelector } = store;
|
const { fetchPerson, filterSelector } = store;
|
||||||
const {
|
const {
|
||||||
|
|
@ -24,6 +28,12 @@ const {
|
||||||
date2Thai,
|
date2Thai,
|
||||||
} = useCounterMixin();
|
} = useCounterMixin();
|
||||||
|
|
||||||
|
const profileId = ref<string>(
|
||||||
|
route.params.id ? route.params.id.toString() : ""
|
||||||
|
);
|
||||||
|
const empType = ref<string>(
|
||||||
|
route.name === "registryNewByid" ? "" : "-employee"
|
||||||
|
);
|
||||||
const visibleColumns = ref<String[]>([
|
const visibleColumns = ref<String[]>([
|
||||||
"citizenId",
|
"citizenId",
|
||||||
"prefix",
|
"prefix",
|
||||||
|
|
@ -133,10 +143,31 @@ const fromData = reactive({
|
||||||
statusMarital: "",
|
statusMarital: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function fetchDataChildren() {
|
||||||
|
showLoader();
|
||||||
|
http
|
||||||
|
.get(config.API.profileFamily(empType.value, "children"))
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function onSubmit(type: string) {
|
function onSubmit(type: string) {
|
||||||
console.log(type);
|
console.log(type);
|
||||||
|
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
|
if (type === "father") {
|
||||||
|
} else if (type === "mom") {
|
||||||
|
} else if (type === "spouse") {
|
||||||
|
} else if (type === "child") {
|
||||||
|
submitChildren();
|
||||||
|
}
|
||||||
closeDialog();
|
closeDialog();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -164,7 +195,7 @@ function onOpenDialogForm(
|
||||||
isEdit.value = isStatusEdit;
|
isEdit.value = isStatusEdit;
|
||||||
|
|
||||||
if (type === "father") {
|
if (type === "father") {
|
||||||
titleForm.value = " • บิดา";
|
titleForm.value = "บิดา";
|
||||||
if (isStatusEdit) {
|
if (isStatusEdit) {
|
||||||
fromData.isLive = fatherData.value.isLive;
|
fromData.isLive = fatherData.value.isLive;
|
||||||
fromData.citizenId = fatherData.value.citizenId;
|
fromData.citizenId = fatherData.value.citizenId;
|
||||||
|
|
@ -174,7 +205,7 @@ function onOpenDialogForm(
|
||||||
fromData.job = fatherData.value.job;
|
fromData.job = fatherData.value.job;
|
||||||
}
|
}
|
||||||
} else if (type === "mom") {
|
} else if (type === "mom") {
|
||||||
titleForm.value = " • มารดา";
|
titleForm.value = "มารดา";
|
||||||
if (isStatusEdit) {
|
if (isStatusEdit) {
|
||||||
fromData.isLive = momData.value.isLive;
|
fromData.isLive = momData.value.isLive;
|
||||||
fromData.citizenId = momData.value.citizenId;
|
fromData.citizenId = momData.value.citizenId;
|
||||||
|
|
@ -184,9 +215,9 @@ function onOpenDialogForm(
|
||||||
fromData.job = momData.value.job;
|
fromData.job = momData.value.job;
|
||||||
}
|
}
|
||||||
} else if (type === "spouse") {
|
} else if (type === "spouse") {
|
||||||
titleForm.value = " • คู่สมรส";
|
titleForm.value = "คู่สมรส";
|
||||||
} else if (type === "child") {
|
} else if (type === "child") {
|
||||||
titleForm.value = " • บุตร";
|
titleForm.value = "บุตร";
|
||||||
fromData.isLive = data.isLive;
|
fromData.isLive = data.isLive;
|
||||||
fromData.citizenId = data.citizenId;
|
fromData.citizenId = data.citizenId;
|
||||||
fromData.prefix = data.prefix;
|
fromData.prefix = data.prefix;
|
||||||
|
|
@ -269,8 +300,31 @@ function convertisLive(status: number) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function submitChildren() {
|
||||||
|
const body = {
|
||||||
|
profileId: empType.value === "" ? profileId.value : undefined,
|
||||||
|
profileEmployeeId: empType.value !== "" ? profileId.value : undefined,
|
||||||
|
childrenCareer: fromData.job,
|
||||||
|
childrenFirstName: fromData.firstName,
|
||||||
|
childrenLastName: fromData.lastName,
|
||||||
|
childrenPrefix: fromData.prefix,
|
||||||
|
childrenLive: fromData.isLive === 1 ? true : false,
|
||||||
|
childrenCitizenId: fromData.citizenId,
|
||||||
|
};
|
||||||
|
|
||||||
|
http
|
||||||
|
.post(config.API.profileFamily(empType.value, "children"), body)
|
||||||
|
.then(() => {
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
|
fetchDataChildren();
|
||||||
fetchDataRelationship();
|
fetchDataRelationship();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -601,20 +655,22 @@ onMounted(() => {
|
||||||
<q-card style="min-width: 80%">
|
<q-card style="min-width: 80%">
|
||||||
<q-form @submit.prevent greedy @validation-success="onSubmit(typeForm)">
|
<q-form @submit.prevent greedy @validation-success="onSubmit(typeForm)">
|
||||||
<DialogHeader
|
<DialogHeader
|
||||||
:tittle="isEdit ? 'แก้ไขข้อมูลครอบครัว' : 'เพิ้มข้อมูลครอบครัว'"
|
:tittle="
|
||||||
|
isEdit ? `แก้ไขข้อมูล${titleForm}` : `เพิ้มข้อมูลค${titleForm}`
|
||||||
|
"
|
||||||
:close="closeDialog"
|
:close="closeDialog"
|
||||||
/>
|
/>
|
||||||
<q-separator color="grey-4" />
|
<q-separator color="grey-4" />
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
<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"
|
||||||
>
|
>
|
||||||
{{ titleForm }}
|
{{ titleForm }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
<q-card bordered class="bg-grey-1 q-pa-md q-col-gutter-sm">
|
<div class="q-col-gutter-sm">
|
||||||
<div class="col" v-if="typeForm === 'spouse'">
|
<div class="row col" v-if="typeForm === 'spouse'">
|
||||||
<q-select
|
<q-select
|
||||||
outlined
|
outlined
|
||||||
bg-color="white"
|
bg-color="white"
|
||||||
|
|
@ -741,7 +797,7 @@ onMounted(() => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row q-mt-md">
|
||||||
<div class="q-mr-sm">สถานภาพการมีชีวิต</div>
|
<div class="q-mr-sm">สถานภาพการมีชีวิต</div>
|
||||||
<div>
|
<div>
|
||||||
<q-radio
|
<q-radio
|
||||||
|
|
@ -765,19 +821,21 @@ onMounted(() => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-actions align="right">
|
<q-card-actions align="right">
|
||||||
<q-btn
|
<div class="q-pa-sm">
|
||||||
unelevated
|
<q-btn
|
||||||
label="บันทึก"
|
unelevated
|
||||||
id="onSubmit"
|
label="บันทึก"
|
||||||
type="submit"
|
id="onSubmit"
|
||||||
color="public"
|
type="submit"
|
||||||
>
|
color="public"
|
||||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
>
|
||||||
</q-btn>
|
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
</div>
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
</q-form>
|
</q-form>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
interface RequestItemsObject {
|
interface RequestItemsObject {
|
||||||
profileId?: string;
|
profileId?: string;
|
||||||
|
profileEmployeeId?: string;
|
||||||
detail: string;
|
detail: string;
|
||||||
issueDate: Date | null;
|
issueDate: Date | null;
|
||||||
issuer: string;
|
issuer: string;
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ interface RequestItemsObject {
|
||||||
refCommandDate: Date | null;
|
refCommandDate: Date | null;
|
||||||
refCommandNo: string;
|
refCommandNo: string;
|
||||||
note: string;
|
note: string;
|
||||||
|
profileEmployeeId?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type { RequestItemsObject };
|
export type { RequestItemsObject };
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
interface RequestItemsObject {
|
interface RequestItemsObject {
|
||||||
profileId?: string;
|
profileId?: string;
|
||||||
|
profileEmployeeId?: string;
|
||||||
name: string;
|
name: string;
|
||||||
date: Date | null;
|
date: Date | null;
|
||||||
point1: number;
|
point1: number;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue