Merge branch 'develop' into dev
* develop: fix(registry-officer):add btn delete btn edit fix:add btn delete development
This commit is contained in:
commit
4d65ed9991
7 changed files with 168 additions and 11 deletions
|
|
@ -69,6 +69,8 @@ export default {
|
||||||
`${registryNew}${type}/assessments/${dataId}`,
|
`${registryNew}${type}/assessments/${dataId}`,
|
||||||
profileNewAssessmentsHisById: (dataId: string, type: string) =>
|
profileNewAssessmentsHisById: (dataId: string, type: string) =>
|
||||||
`${registryNew}${type}/assessments/admin/history/${dataId}`,
|
`${registryNew}${type}/assessments/admin/history/${dataId}`,
|
||||||
|
profileDevelopmentUpdateDelete: `${registryNew}/development/update-delete/`,
|
||||||
|
|
||||||
|
|
||||||
// การฝึกอบรม
|
// การฝึกอบรม
|
||||||
profileNewTraining: (type: string) => `${registryNew}${type}/training`,
|
profileNewTraining: (type: string) => `${registryNew}${type}/training`,
|
||||||
|
|
@ -78,6 +80,7 @@ export default {
|
||||||
`${registryNew}${type}/training/${trainingId}`,
|
`${registryNew}${type}/training/${trainingId}`,
|
||||||
profileNewTrainingHisByTrainingId: (trainingId: string, type: string) =>
|
profileNewTrainingHisByTrainingId: (trainingId: string, type: string) =>
|
||||||
`${registryNew}${type}/training/admin/history/${trainingId}`,
|
`${registryNew}${type}/training/admin/history/${trainingId}`,
|
||||||
|
profileTrainingUpdate: `${registryNew}/training/update-delete/`,
|
||||||
|
|
||||||
// ประวัติการศึกษา
|
// ประวัติการศึกษา
|
||||||
profileNewEducation: (type: string) => `${registryNew}${type}/educations`,
|
profileNewEducation: (type: string) => `${registryNew}${type}/educations`,
|
||||||
|
|
@ -232,6 +235,7 @@ export default {
|
||||||
`${registryNew}${type}/actposition/${id}`,
|
`${registryNew}${type}/actposition/${id}`,
|
||||||
profileActpositionHistory: (id: string, type: string) =>
|
profileActpositionHistory: (id: string, type: string) =>
|
||||||
`${registryNew}${type}/actposition/history/${id}`,
|
`${registryNew}${type}/actposition/history/${id}`,
|
||||||
|
profileActpositionUpdateDelete: `${registryNew}/actposition/update-delete/`,
|
||||||
|
|
||||||
//ช่วยราชการ
|
//ช่วยราชการ
|
||||||
profileAssistance: (type: string, id: string) =>
|
profileAssistance: (type: string, id: string) =>
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,7 @@ onMounted(async () => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="toptitle text-dark col-12 row items-center">
|
<div class="toptitle text-dark col-12 row items-center">
|
||||||
รายการตัวชี้วัดตามตำแหน่งasdassd
|
รายการตัวชี้วัดตามตำแหน่ง
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Summary />
|
<Summary />
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ const {
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
onSearchDataTable,
|
onSearchDataTable,
|
||||||
convertDateToAPI,
|
convertDateToAPI,
|
||||||
|
dialogRemove,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const id = ref<string>(route.params.id.toString());
|
const id = ref<string>(route.params.id.toString());
|
||||||
|
|
@ -400,6 +401,21 @@ function serchDataTable() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onDelete(rowId: string) {
|
||||||
|
dialogRemove($q, async () => {
|
||||||
|
showLoader();
|
||||||
|
try {
|
||||||
|
await http.patch(config.API.profileTrainingUpdate + `${rowId}`);
|
||||||
|
await fetchData(id.value);
|
||||||
|
await success($q, "ลบข้อมูลสำเร็จ");
|
||||||
|
} catch (err) {
|
||||||
|
messageError($q, err);
|
||||||
|
} finally {
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchData(id.value);
|
fetchData(id.value);
|
||||||
|
|
@ -549,6 +565,22 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
|
<q-btn
|
||||||
|
v-if="isLeave == false && checkPermission($route)?.attrIsDelete"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
round
|
||||||
|
color="red"
|
||||||
|
icon="delete"
|
||||||
|
@click="
|
||||||
|
() => {
|
||||||
|
onDelete(props.row.id);
|
||||||
|
}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td v-for="col in props.cols" :key="col.id">
|
<q-td v-for="col in props.cols" :key="col.id">
|
||||||
<div :class="col.classes" :style="col.style">
|
<div :class="col.classes" :style="col.style">
|
||||||
|
|
@ -580,6 +612,17 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
|
<q-btn
|
||||||
|
v-if="isLeave == false && checkPermission($route)?.attrIsDelete"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
color="red"
|
||||||
|
icon="delete"
|
||||||
|
@click="() => onDelete(props.row.id)"
|
||||||
|
>
|
||||||
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-list>
|
<q-list>
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ const {
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
onSearchDataTable,
|
onSearchDataTable,
|
||||||
convertDateToAPI,
|
convertDateToAPI,
|
||||||
|
dialogRemove,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const profileId = ref<string>(
|
const profileId = ref<string>(
|
||||||
|
|
@ -516,6 +517,21 @@ function serchDataTable() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onDelete(rowId: string) {
|
||||||
|
dialogRemove($q, async () => {
|
||||||
|
showLoader();
|
||||||
|
try {
|
||||||
|
await http.patch(config.API.profileDevelopmentUpdateDelete + `${rowId}`);
|
||||||
|
empType.value !== "-temp" && (await getDevelop());
|
||||||
|
await success($q, "ลบข้อมูลสำเร็จ");
|
||||||
|
} catch (err) {
|
||||||
|
messageError($q, err);
|
||||||
|
} finally {
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchData();
|
await fetchData();
|
||||||
empType.value !== "-temp" && (await getDevelop());
|
empType.value !== "-temp" && (await getDevelop());
|
||||||
|
|
@ -824,8 +840,20 @@ onMounted(async () => {
|
||||||
@click="openDialogDevelop(props.row)"
|
@click="openDialogDevelop(props.row)"
|
||||||
>
|
>
|
||||||
<q-tooltip>รายละเอียด</q-tooltip>
|
<q-tooltip>รายละเอียด</q-tooltip>
|
||||||
</q-btn></q-td
|
</q-btn>
|
||||||
>
|
|
||||||
|
<q-btn
|
||||||
|
v-if="checkPermission($route)?.attrIsDelete"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
color="red"
|
||||||
|
icon="delete"
|
||||||
|
@click="onDelete(props.row.id)"
|
||||||
|
>
|
||||||
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
</q-td>
|
||||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<div v-if="col.name == 'no'">
|
<div v-if="col.name == 'no'">
|
||||||
{{ props.rowIndex + 1 }}
|
{{ props.rowIndex + 1 }}
|
||||||
|
|
@ -871,6 +899,18 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
<q-tooltip>รายละเอียด</q-tooltip>
|
<q-tooltip>รายละเอียด</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
|
<q-btn
|
||||||
|
v-if="checkPermission($route)?.attrIsDelete"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
color="red"
|
||||||
|
icon="delete"
|
||||||
|
@click="onDelete(props.row.id)"
|
||||||
|
>
|
||||||
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ const {
|
||||||
pathRegistryEmp,
|
pathRegistryEmp,
|
||||||
onSearchDataTable,
|
onSearchDataTable,
|
||||||
convertDateToAPI,
|
convertDateToAPI,
|
||||||
|
dialogRemove,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
const profileId = ref<string>(
|
const profileId = ref<string>(
|
||||||
|
|
@ -294,6 +295,21 @@ function serchDataTable() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onDelete(rowId: string) {
|
||||||
|
dialogRemove($q, async () => {
|
||||||
|
showLoader();
|
||||||
|
try {
|
||||||
|
await http.patch(config.API.profileActpositionUpdateDelete + `${rowId}`);
|
||||||
|
await fetchData();
|
||||||
|
await success($q, "ลบข้อมูลสำเร็จ");
|
||||||
|
} catch (err) {
|
||||||
|
messageError($q, err);
|
||||||
|
} finally {
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
});
|
});
|
||||||
|
|
@ -418,6 +434,18 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
|
<q-btn
|
||||||
|
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
round
|
||||||
|
color="red"
|
||||||
|
icon="delete"
|
||||||
|
@click.stop.prevent="onDelete(props.row.id)"
|
||||||
|
>
|
||||||
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td v-for="col in props.cols" :key="col.id">
|
<q-td v-for="col in props.cols" :key="col.id">
|
||||||
<div
|
<div
|
||||||
|
|
@ -463,6 +491,17 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
|
<q-btn
|
||||||
|
v-if="isLeave === false && checkPermission($route)?.attrIsDelete"
|
||||||
|
color="red"
|
||||||
|
icon="delete"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
@click.stop.prevent="onDelete(props.row.id)"
|
||||||
|
>
|
||||||
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -314,11 +314,21 @@ function onSubmit(type: string) {
|
||||||
motherLastNameOld: type === "mother" ? fromData.lastNameOld : undefined,
|
motherLastNameOld: type === "mother" ? fromData.lastNameOld : undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const editId =
|
||||||
|
type === "couple"
|
||||||
|
? profileId.value
|
||||||
|
: type === "children"
|
||||||
|
? childernId.value
|
||||||
|
: "";
|
||||||
|
|
||||||
const url =
|
const url =
|
||||||
isEdit.value && type === "children"
|
isEdit.value && (type === "children" || type === "couple")
|
||||||
? config.API.profileFamily(empType.value, type) + `/${childernId.value}`
|
? config.API.profileFamily(empType.value, type) + `/${editId}`
|
||||||
: config.API.profileFamily(empType.value, type);
|
: config.API.profileFamily(empType.value, type);
|
||||||
const method = isEdit.value && type === "children" ? "patch" : "post";
|
const method =
|
||||||
|
isEdit.value && (type === "children" || type === "couple")
|
||||||
|
? "patch"
|
||||||
|
: "post";
|
||||||
try {
|
try {
|
||||||
await http[method](url, formBody);
|
await http[method](url, formBody);
|
||||||
type === "father"
|
type === "father"
|
||||||
|
|
@ -365,6 +375,8 @@ function onOpenDialogForm(
|
||||||
isStatusEdit: boolean = false,
|
isStatusEdit: boolean = false,
|
||||||
data: any = undefined
|
data: any = undefined
|
||||||
) {
|
) {
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
modal.value = true;
|
modal.value = true;
|
||||||
typeForm.value = type;
|
typeForm.value = type;
|
||||||
isEdit.value = isStatusEdit;
|
isEdit.value = isStatusEdit;
|
||||||
|
|
@ -393,6 +405,17 @@ function onOpenDialogForm(
|
||||||
} else if (type === "couple") {
|
} else if (type === "couple") {
|
||||||
titleForm.value = "คู่สมรส";
|
titleForm.value = "คู่สมรส";
|
||||||
fromData.isLive = 1;
|
fromData.isLive = 1;
|
||||||
|
if (isStatusEdit) {
|
||||||
|
fromData.isLive =
|
||||||
|
coupleData.isLive === null ? 1 : coupleData.isLive ? 1 : 0;
|
||||||
|
fromData.citizenId = coupleData.citizenId;
|
||||||
|
fromData.prefix = coupleData.prefix;
|
||||||
|
fromData.firstName = coupleData.firstName;
|
||||||
|
fromData.lastName = coupleData.lastName;
|
||||||
|
fromData.job = coupleData.job;
|
||||||
|
fromData.lastNameOld = coupleData.lastNameOld as string;
|
||||||
|
fromData.statusMarital = coupleData.statusMarital as string;
|
||||||
|
}
|
||||||
} else if (type === "children") {
|
} else if (type === "children") {
|
||||||
titleForm.value = "บุตร";
|
titleForm.value = "บุตร";
|
||||||
|
|
||||||
|
|
@ -696,6 +719,18 @@ onMounted(async () => {
|
||||||
<q-card bordered class="bg-grey-1 q-pb-md" v-if="coupleData.isCouple">
|
<q-card bordered class="bg-grey-1 q-pb-md" v-if="coupleData.isCouple">
|
||||||
<div class="col-12 row q-py-sm q-px-md bg-grey-2 items-start">
|
<div class="col-12 row q-py-sm q-px-md bg-grey-2 items-start">
|
||||||
<div class="text-weight-medium q-pr-md">คู่สมรส</div>
|
<div class="text-weight-medium q-pr-md">คู่สมรส</div>
|
||||||
|
<q-space />
|
||||||
|
<q-btn
|
||||||
|
v-if="!isLeave && checkPermission($route)?.attrIsUpdate"
|
||||||
|
round
|
||||||
|
flat
|
||||||
|
color="edit"
|
||||||
|
icon="edit"
|
||||||
|
dense
|
||||||
|
@click="onOpenDialogForm('couple', true)"
|
||||||
|
>
|
||||||
|
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<div class="col-12 q-pa-md q-col-gutter-md">
|
<div class="col-12 q-pa-md q-col-gutter-md">
|
||||||
|
|
|
||||||
|
|
@ -531,11 +531,7 @@ onMounted(() => {
|
||||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip></q-btn
|
<q-tooltip>แก้ไขข้อมูล</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="
|
v-if="checkPermission($route)?.attrIsDelete"
|
||||||
formQuery.status === 'ONGOING' &&
|
|
||||||
checkPermission($route)?.attrIsUpdate &&
|
|
||||||
checkPermission($route)?.attrIsGet
|
|
||||||
"
|
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
dense
|
dense
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue