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