Merge branch 'feat/registry' into develop
This commit is contained in:
commit
4e6571f099
21 changed files with 674 additions and 52 deletions
|
|
@ -39,11 +39,15 @@ export default {
|
|||
`${registryNew}${type}/nopaid/${dataId}`,
|
||||
profileNewNoPaidHisById: (dataId: string, type: string) =>
|
||||
`${registryNew}${type}/nopaid/history/${dataId}`,
|
||||
profileNewNoPaidUpdateDelete: (type: string) =>
|
||||
`${registryNew}${type}/nopaid/update-delete/`,
|
||||
|
||||
// เครื่องราชฯ
|
||||
profileNewInsign: (type: string) => `${registryNew}${type}/insignia`,
|
||||
profileNewInsignByProfileId: (profileId: string, type: string) =>
|
||||
`${registryNew}${type}/insignia/${profileId}`,
|
||||
profileNewInsignUpdateDelete: (type: string) =>
|
||||
`${registryNew}${type}/insignia/update-delete/`,
|
||||
|
||||
orgInsigniaActive: () => `${org}/insignia/insignia-type/active`,
|
||||
|
||||
|
|
@ -60,6 +64,8 @@ export default {
|
|||
`${registryNew}${type}/honor/${dataId}`,
|
||||
profileNewHonorHisById: (dataId: string, type: string) =>
|
||||
`${registryNew}${type}/honor/admin/history/${dataId}`,
|
||||
profileNewHonorUpdateDelete: (type: string) =>
|
||||
`${registryNew}${type}/honor/update-delete/`,
|
||||
|
||||
// ผลการประเมินการปฏิบัติราชการ
|
||||
profileNewAssessments: (type: string) => `${registryNew}${type}/assessments`,
|
||||
|
|
@ -69,9 +75,10 @@ export default {
|
|||
`${registryNew}${type}/assessments/${dataId}`,
|
||||
profileNewAssessmentsHisById: (dataId: string, type: string) =>
|
||||
`${registryNew}${type}/assessments/admin/history/${dataId}`,
|
||||
profileDevelopmentUpdateDelete: `${registryNew}/development/update-delete/`,
|
||||
|
||||
|
||||
profileDevelopmentUpdateDelete: (type: string) =>
|
||||
`${registryNew}${type}/development/update-delete/`,
|
||||
profileNewAssessmentsUpdateDelete: (type: string) =>
|
||||
`${registryNew}${type}/assessments/update-delete/`,
|
||||
// การฝึกอบรม
|
||||
profileNewTraining: (type: string) => `${registryNew}${type}/training`,
|
||||
profileNewTrainingByProfileId: (profileId: string, type: string) =>
|
||||
|
|
@ -80,7 +87,8 @@ export default {
|
|||
`${registryNew}${type}/training/${trainingId}`,
|
||||
profileNewTrainingHisByTrainingId: (trainingId: string, type: string) =>
|
||||
`${registryNew}${type}/training/admin/history/${trainingId}`,
|
||||
profileTrainingUpdate: `${registryNew}/training/update-delete/`,
|
||||
profileTrainingUpdate: (type: string) =>
|
||||
`${registryNew}${type}/training/update-delete/`,
|
||||
|
||||
// ประวัติการศึกษา
|
||||
profileNewEducation: (type: string) => `${registryNew}${type}/educations`,
|
||||
|
|
@ -93,6 +101,8 @@ export default {
|
|||
`${registryNew}${type}/educations/${educationId}`,
|
||||
profileNewEducationHisByEducationId: (educationsId: string, type: string) =>
|
||||
`${registryNew}${type}/educations/admin/history/${educationsId}`,
|
||||
profileEducationUpdateDelete: (type: string) =>
|
||||
`${registryNew}${type}/educations/update-delete/`,
|
||||
|
||||
// ความสามารถพิเศษ
|
||||
profileNewAbility: (type: string) => `${registryNew}${type}/ability`,
|
||||
|
|
@ -102,6 +112,8 @@ export default {
|
|||
`${registryNew}${type}/ability/${abilityId}`,
|
||||
profileNewAbilityHisByAbilityId: (abilityId: string, type: string) =>
|
||||
`${registryNew}${type}/ability/admin/history/${abilityId}`,
|
||||
profileAbilityUpdateDelete: (type: string) =>
|
||||
`${registryNew}${type}/ability/update-delete/`,
|
||||
|
||||
// ใบอนุญาตประกอบวิชาชีพ
|
||||
profileNewCertificate: (type: string) => `${registryNew}${type}/certificate`,
|
||||
|
|
@ -113,6 +125,8 @@ export default {
|
|||
certificateId: string,
|
||||
type: string
|
||||
) => `${registryNew}${type}/certificate/admin/history/${certificateId}`,
|
||||
profileCertificateUpdateDelete: (type: string) =>
|
||||
`${registryNew}${type}/certificate/update-delete/`,
|
||||
|
||||
// ข้อมูลอื่นๆ
|
||||
profileNewOther: (type: string) => `${registryNew}${type}/other`,
|
||||
|
|
@ -122,6 +136,8 @@ export default {
|
|||
`${registryNew}${type}/other/${dataId}`,
|
||||
profileNewOtherHisById: (dataId: string, type: string) =>
|
||||
`${registryNew}${type}/other/admin/history/${dataId}`,
|
||||
profileOtherUpdateDelete: (type: string) =>
|
||||
`${registryNew}${type}/other/update-delete/`,
|
||||
|
||||
// ข้อมูลครอบครัว
|
||||
profileNewFamily: (type: string) => `${registryNew}${type}/family`,
|
||||
|
|
@ -142,6 +158,8 @@ export default {
|
|||
`${registryNew}${type}/discipline/admin/history/${disciplineId}`,
|
||||
disciplineListCard: (profileId: string, type: string) =>
|
||||
`${registryNew}${type}/discipline/admin/${profileId}`, // noPermission
|
||||
profileNewDisciplineUpdateDelete: (type: string) =>
|
||||
`${registryNew}${type}/discipline/update-delete/`,
|
||||
|
||||
// ปฏิบัติราชการพิเศษ
|
||||
profileNewDuty: (type: string) => `${registryNew}${type}/duty`,
|
||||
|
|
@ -151,6 +169,8 @@ export default {
|
|||
`${registryNew}${type}/duty/${dutyId}`,
|
||||
profileNewDutyHisByDutyId: (dutyId: string, type: string) =>
|
||||
`${registryNew}${type}/duty/admin/history/${dutyId}`,
|
||||
profileDutyUpdateDelete: (type: string) =>
|
||||
`${registryNew}${type}/duty/update-delete/`,
|
||||
|
||||
//ข้อมูลราชการ
|
||||
profileNewGovernment: (type: string) => `${registryNew}${type}/government`,
|
||||
|
|
@ -171,6 +191,8 @@ export default {
|
|||
profileNewLeaveType: () => `${env.API_URI}/leave/type`,
|
||||
leaveListCard: (id: string, type: string) =>
|
||||
`${registryNew}${type}/leave/admin/${id}`, //noPermission
|
||||
profileNewLeaveUpdateDelete: (type: string) =>
|
||||
`${registryNew}${type}/leave/update-delete/`,
|
||||
|
||||
/** ตำแหน่ง*/
|
||||
profileSalaryPositionNew: (type: string) =>
|
||||
|
|
@ -205,12 +227,16 @@ export default {
|
|||
`${registryNew}${type}/changeName/${changeNameId}`,
|
||||
profileNewChangeNameHisByChangeNameId: (changeNameId: string, type: string) =>
|
||||
`${registryNew}${type}/changeName/history/${changeNameId}`,
|
||||
profileNewChangeNameUpdateDelete: (type: string) =>
|
||||
`${registryNew}${type}/changeName/update-delete/`,
|
||||
|
||||
//ข้อมูลครอบครับ
|
||||
profileFamily: (empType: string, type: string) =>
|
||||
`${registryNew}${empType}/family/${type}`,
|
||||
profileFamilyHistory: (id: string, empType: string, type: string) =>
|
||||
`${registryNew}${empType}/family/${type}/history/${id}`,
|
||||
profileFamilyUpdateDelete: (empType: string, type: string) =>
|
||||
`${registryNew}${empType}/family/${type}/update-delete/`,
|
||||
|
||||
//ลูกจ้างชั่วคราว
|
||||
positionEmployee: (id: string) => `${registryNew}-employee/position/${id}`,
|
||||
|
|
@ -235,7 +261,8 @@ export default {
|
|||
`${registryNew}${type}/actposition/${id}`,
|
||||
profileActpositionHistory: (id: string, type: string) =>
|
||||
`${registryNew}${type}/actposition/history/${id}`,
|
||||
profileActpositionUpdateDelete: `${registryNew}/actposition/update-delete/`,
|
||||
profileActpositionUpdateDelete: (type: string) =>
|
||||
`${registryNew}${type}/actposition/update-delete/`,
|
||||
|
||||
//ช่วยราชการ
|
||||
profileAssistance: (type: string, id: string) =>
|
||||
|
|
@ -243,4 +270,6 @@ export default {
|
|||
profileAssistanceHistory: (id: string, type: string) =>
|
||||
`${registryNew}${type}/assistance/history/${id}`,
|
||||
profileAssistanceReturn: `${env.API_URI}/placement/repatriation`,
|
||||
profileAssistanceUpdateDelete: (type: string) =>
|
||||
`${registryNew}${type}/assistance/update-delete/`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ const {
|
|||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
convertDateToAPI,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
const { createPathUploadFlie, getPathUploadFlie, uploadFile } =
|
||||
useRegistryNewDataStore();
|
||||
|
|
@ -360,6 +361,23 @@ function serchDataTable() {
|
|||
);
|
||||
}
|
||||
|
||||
function handleDelete(rowId: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(
|
||||
config.API.profileCertificateUpdateDelete(empType.value) + `${rowId}`
|
||||
);
|
||||
await fetchData(id.value);
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
||||
*/
|
||||
|
|
@ -495,6 +513,17 @@ onMounted(() => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
|
|
@ -552,6 +581,17 @@ onMounted(() => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
<q-separator />
|
||||
<q-list>
|
||||
|
|
|
|||
|
|
@ -356,8 +356,8 @@ async function fetchData(id: string) {
|
|||
await http
|
||||
.get(config.API.profileNewTrainingByProfileId(id, empType.value))
|
||||
.then(async (res) => {
|
||||
rows.value = await res.data.result;
|
||||
rowsMain.value = await res.data.result;
|
||||
serchDataTable();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -405,7 +405,7 @@ function onDelete(rowId: string) {
|
|||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(config.API.profileTrainingUpdate + `${rowId}`);
|
||||
await http.patch(config.API.profileTrainingUpdate(empType.value) + `${rowId}`);
|
||||
await fetchData(id.value);
|
||||
await success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
|
|
@ -567,7 +567,11 @@ onMounted(() => {
|
|||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsDelete"
|
||||
v-if="
|
||||
isLeave == false &&
|
||||
checkPermission($route)?.attrIsDelete &&
|
||||
!props.row.developmentId
|
||||
"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
|
|
@ -614,7 +618,11 @@ onMounted(() => {
|
|||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsDelete"
|
||||
v-if="
|
||||
isLeave == false &&
|
||||
checkPermission($route)?.attrIsDelete &&
|
||||
!props.row.developmentId
|
||||
"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ const {
|
|||
dialogConfirm,
|
||||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const isUpload = ref<boolean>(false);
|
||||
|
|
@ -317,8 +318,8 @@ async function fetchData() {
|
|||
const res = await http.get(
|
||||
config.API.profileNewInsignByProfileId(profileId.value, empType.value)
|
||||
);
|
||||
rows.value = res.data.result;
|
||||
rowsMain.value = res.data.result;
|
||||
serchDataTable();
|
||||
} catch (error) {
|
||||
messageError($q, error);
|
||||
} finally {
|
||||
|
|
@ -333,8 +334,6 @@ async function getInsigniaActive() {
|
|||
.get(config.API.orgInsigniaActive())
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
console.log(data);
|
||||
|
||||
mapInsigniaOption(data);
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -646,6 +645,23 @@ function serchDataTable() {
|
|||
);
|
||||
}
|
||||
|
||||
function handleDelete(rowId: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(
|
||||
config.API.profileNewInsignUpdateDelete(empType.value) + `${rowId}`
|
||||
);
|
||||
await fetchData();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
|
|
@ -773,6 +789,18 @@ onMounted(async () => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
|
|
@ -824,6 +852,7 @@ onMounted(async () => {
|
|||
>
|
||||
<q-tooltip>ประวัติแก้ไขเครื่องราชอิสริยาภรณ์</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
|
||||
flat
|
||||
|
|
@ -832,7 +861,18 @@ onMounted(async () => {
|
|||
icon="edit"
|
||||
@click="onClickOpenDialog(true, props.row)"
|
||||
>
|
||||
<q-tooltip>แก่ไขข้อมุล</q-tooltip>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
<q-separator />
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ const {
|
|||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
convertDateToAPI,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const profileId = ref<string>(
|
||||
|
|
@ -203,8 +204,8 @@ async function fetchData() {
|
|||
const res = await http.get(
|
||||
config.API.profileNewHonorByProfileId(profileId.value, empType.value)
|
||||
);
|
||||
rows.value = res.data.result;
|
||||
rowsMain.value = res.data.result;
|
||||
serchDataTable();
|
||||
} catch (error) {
|
||||
messageError($q, error);
|
||||
} finally {
|
||||
|
|
@ -214,7 +215,7 @@ async function fetchData() {
|
|||
|
||||
/**
|
||||
* บันทึกข้อมูลประกาศเกียรติคุณ
|
||||
* @param editStatus แก่ไข,เพิ่ม
|
||||
* @param editStatus แก้ไข,เพิ่ม
|
||||
*/
|
||||
async function addEditData(editStatus: boolean = false) {
|
||||
if (!profileId.value) return;
|
||||
|
|
@ -445,6 +446,23 @@ function serchDataTable() {
|
|||
);
|
||||
}
|
||||
|
||||
function handleDelete(rowId: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(
|
||||
config.API.profileNewHonorUpdateDelete(empType.value) + `${rowId}`
|
||||
);
|
||||
await fetchData();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
|
|
@ -567,6 +585,18 @@ onMounted(() => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
|
|
@ -626,7 +656,19 @@ onMounted(() => {
|
|||
icon="edit"
|
||||
@click="onClickOpenDialog(true, props.row)"
|
||||
>
|
||||
<q-tooltip>แก่ไขข้อมุล</q-tooltip>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
<q-separator />
|
||||
|
|
|
|||
|
|
@ -356,8 +356,9 @@ async function fetchData() {
|
|||
empType.value
|
||||
)
|
||||
);
|
||||
rows.value = res.data.result;
|
||||
|
||||
rowsMain.value = res.data.result;
|
||||
serchDataTable();
|
||||
} catch (error) {
|
||||
messageError($q, error);
|
||||
} finally {
|
||||
|
|
@ -517,11 +518,17 @@ function serchDataTable() {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ลบข้อมูลการพัฒนารายบุคคล (Individual Development Plan)
|
||||
* @param rowId ที่ต้องการลบข้อมูล
|
||||
*/
|
||||
function onDelete(rowId: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(config.API.profileDevelopmentUpdateDelete + `${rowId}`);
|
||||
await http.patch(
|
||||
config.API.profileDevelopmentUpdateDelete(empType.value) + `${rowId}`
|
||||
);
|
||||
empType.value !== "-temp" && (await getDevelop());
|
||||
await success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
|
|
@ -532,6 +539,27 @@ function onDelete(rowId: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ผลการประเมินการปฏิบัติราชการ
|
||||
* @param rowId ที่ต้องการลบข้อมูล
|
||||
*/
|
||||
function handleDelete(rowId: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(
|
||||
config.API.profileNewAssessmentsUpdateDelete(empType.value) + `${rowId}`
|
||||
);
|
||||
await fetchData();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
empType.value !== "-temp" && (await getDevelop());
|
||||
|
|
@ -668,6 +696,18 @@ onMounted(async () => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div class="table_ellipsis">
|
||||
|
|
@ -705,6 +745,18 @@ onMounted(async () => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมุล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
<q-separator />
|
||||
<q-list>
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ function fetchDataEmployment(id: string) {
|
|||
|
||||
/**
|
||||
* function เปิด dialog Form ข้อมูลการจ้าง
|
||||
* @param statusEdit สถานะการ สร้าง หรือ แก่ไข
|
||||
* @param statusEdit สถานะการ สร้าง หรือ แก้ไข
|
||||
* @param id รายการการจ้าง
|
||||
*/
|
||||
function onOpenDialog(statusEdit: boolean = false, id: string = "") {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import axios from "axios";
|
||||
|
||||
import { useRoute } from "vue-router";
|
||||
import { checkPermission } from "@/utils/permissions";
|
||||
|
|
@ -36,6 +35,7 @@ const {
|
|||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
convertDateToAPI,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const profileId = ref<string>(
|
||||
|
|
@ -290,8 +290,8 @@ async function fetchData(id: string) {
|
|||
http
|
||||
.get(config.API.profileNewDisciplineByProfileId(id, empType.value))
|
||||
.then((res) => {
|
||||
rows.value = res.data.result;
|
||||
rowsMain.value = res.data.result;
|
||||
serchDataTable();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -435,7 +435,7 @@ function openDialogHistory(idOrder: string) {
|
|||
id.value = idOrder;
|
||||
}
|
||||
|
||||
/** fetch ข้อมูลประวัติการแก่ไขข้อมูลวินัย*/
|
||||
/** fetch ข้อมูลประวัติการแก้ไขข้อมูลวินัย*/
|
||||
async function fetchDataHistory() {
|
||||
showLoader();
|
||||
|
||||
|
|
@ -461,6 +461,23 @@ function serchDataTable() {
|
|||
);
|
||||
}
|
||||
|
||||
function handleDelete(id: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(
|
||||
config.API.profileNewDisciplineUpdateDelete(empType.value) + `${id}`
|
||||
);
|
||||
await fetchData(profileId.value);
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||
onMounted(() => {
|
||||
fetchData(profileId.value);
|
||||
|
|
@ -587,6 +604,17 @@ onMounted(() => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
|
|
@ -633,8 +661,9 @@ onMounted(() => {
|
|||
flat
|
||||
round
|
||||
@click="openDialogHistory(props.row.id)"
|
||||
><q-tooltip>ประวิติแก้ไขวินัย</q-tooltip></q-btn
|
||||
>
|
||||
<q-tooltip>ประวิติแก้ไขวินัย</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
|
||||
color="edit"
|
||||
|
|
@ -642,8 +671,20 @@ onMounted(() => {
|
|||
flat
|
||||
round
|
||||
@click="openDialogEdit(props.row)"
|
||||
><q-tooltip>แก้ไข</q-tooltip></q-btn
|
||||
>
|
||||
<q-tooltip>แก้ไข</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
<q-separator />
|
||||
<q-list>
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ const {
|
|||
dateToISO,
|
||||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const profileId = ref<string>(
|
||||
|
|
@ -208,7 +209,7 @@ async function getData() {
|
|||
.get(config.API.profileNewLeaveById(profileId.value, empType.value))
|
||||
.then(async (res) => {
|
||||
const data = await res.data.result;
|
||||
rows.value = data.map((item: DataLeave) => ({
|
||||
const baseData = data.map((item: DataLeave) => ({
|
||||
...item,
|
||||
id: item.id,
|
||||
typeLeave: item.leaveType.name,
|
||||
|
|
@ -218,7 +219,9 @@ async function getData() {
|
|||
numLeave: item.leaveDays,
|
||||
typeLeaveId: item.leaveTypeId,
|
||||
}));
|
||||
rowsMain.value = rows.value;
|
||||
rowsMain.value = baseData;
|
||||
|
||||
serchDataTable();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -474,6 +477,23 @@ function clickEditRowType() {
|
|||
}
|
||||
}
|
||||
|
||||
function handleDelete(id: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(
|
||||
config.API.profileNewLeaveUpdateDelete(empType.value) + `${id}`
|
||||
);
|
||||
await getData();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||
onMounted(() => {
|
||||
getData();
|
||||
|
|
@ -597,6 +617,17 @@ onMounted(() => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
|
|
@ -623,8 +654,9 @@ onMounted(() => {
|
|||
flat
|
||||
round
|
||||
@click="openDialogHistory(props.row.id)"
|
||||
><q-tooltip>ประวิติแก้ไขการลา</q-tooltip></q-btn
|
||||
>
|
||||
<q-tooltip>ประวิติแก้ไขการลา</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
|
||||
color="edit"
|
||||
|
|
@ -632,8 +664,20 @@ onMounted(() => {
|
|||
flat
|
||||
round
|
||||
@click="openDialogEdit(props.row)"
|
||||
><q-tooltip>แก้ไขข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
<q-separator />
|
||||
<q-list>
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ const {
|
|||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
convertDateToAPI,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const profileId = ref<string>(
|
||||
|
|
@ -51,7 +52,7 @@ const isLeave = defineModel<boolean>("isLeave", {
|
|||
const id = ref<string>(""); //id ที่ต้องการแก้ไข
|
||||
const modal = ref<boolean>(false); //แสดง popup ข้อมูลปฏิบัติราชการพิเศษ
|
||||
const modalHistory = ref<boolean>(false); //แสดง popup ประวัติการแก้ไขข้อมูลปฏิบัติราชการพิเศษ
|
||||
const edit = ref<boolean>(false); //สถานะการแก่ไข
|
||||
const edit = ref<boolean>(false); //สถานะการแก้ไข
|
||||
//ฟอร์มข้อมูลปฏิบัติราชการพิเศษ
|
||||
const dutyData = reactive<RequestItemsObject>({
|
||||
profileId: profileId.value,
|
||||
|
|
@ -192,8 +193,8 @@ async function fetchData(id: string) {
|
|||
await http
|
||||
.get(config.API.profileNewDutyByProfileId(id, empType.value))
|
||||
.then(async (res) => {
|
||||
rows.value = await res.data.result;
|
||||
rowsMain.value = await res.data.result;
|
||||
serchDataTable();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -447,6 +448,24 @@ function serchDataTable() {
|
|||
);
|
||||
}
|
||||
|
||||
function handleDelete(id: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(
|
||||
config.API.profileDutyUpdateDelete(empType.value) + `${id}`
|
||||
);
|
||||
await fetchData(profileId.value);
|
||||
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** ทำงานเมื่อ Components ถูกเรียกใช้งา*/
|
||||
onMounted(() => {
|
||||
fetchData(profileId.value);
|
||||
|
|
@ -571,6 +590,17 @@ onMounted(() => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
|
|
@ -617,7 +647,8 @@ onMounted(() => {
|
|||
flat
|
||||
round
|
||||
@click="openDialogHistory(props.row.id)"
|
||||
><q-tooltip>ประวัติแก้ไขปฏิบัติราชการพิเศษ</q-tooltip>
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขปฏิบัติราชการพิเศษ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
|
||||
|
|
@ -626,7 +657,19 @@ onMounted(() => {
|
|||
flat
|
||||
round
|
||||
@click="openDialogEdit(props.row)"
|
||||
><q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
|
||||
|
|
|
|||
|
|
@ -299,7 +299,9 @@ function onDelete(rowId: string) {
|
|||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(config.API.profileActpositionUpdateDelete + `${rowId}`);
|
||||
await http.patch(
|
||||
config.API.profileActpositionUpdateDelete(empType.value) + `${rowId}`
|
||||
);
|
||||
await fetchData();
|
||||
await success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ const {
|
|||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
convertDateToAPI,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const profileId = ref<string>(
|
||||
|
|
@ -224,8 +225,8 @@ async function fetchData() {
|
|||
.get(config.API.profileAssistance(empType.value, profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rows.value = data;
|
||||
rowsMain.value = data;
|
||||
serchDataTable();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -438,6 +439,23 @@ async function onReturner(refId: string) {
|
|||
});
|
||||
}
|
||||
|
||||
function handleDelete(id: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(
|
||||
config.API.profileAssistanceUpdateDelete(empType.value) + `${id}`
|
||||
);
|
||||
await fetchData();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
|
|
@ -583,6 +601,22 @@ onMounted(() => {
|
|||
>
|
||||
<q-tooltip>ส่งตัวกลับ</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
!isLeave &&
|
||||
checkPermission($route)?.attrIsDelete &&
|
||||
!props.row.commandId
|
||||
"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div
|
||||
|
|
@ -667,6 +701,22 @@ onMounted(() => {
|
|||
>
|
||||
<q-tooltip>ส่งตัวกลับ</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
!isLeave &&
|
||||
checkPermission($route)?.attrIsDelete &&
|
||||
!props.row.commandId
|
||||
"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
|
||||
<q-separator />
|
||||
|
|
|
|||
|
|
@ -616,7 +616,7 @@ async function fetchDataTenure() {
|
|||
/**
|
||||
* function เลือกประเภทตำแหน่ง
|
||||
* @param val id ประเภทตำแหน่ง
|
||||
* @param status แก่ไข , เพิ่ม
|
||||
* @param status แก้ไข , เพิ่ม
|
||||
*/
|
||||
async function updateSelectType(val: string, status: boolean = false) {
|
||||
const listLevel = val
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ const {
|
|||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
convertDateToAPI,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const id = ref<string>("");
|
||||
|
|
@ -126,8 +127,8 @@ async function getData() {
|
|||
await http
|
||||
.get(config.API.profileNewOtherByProfileId(profileId.value, empType.value))
|
||||
.then((res) => {
|
||||
rows.value = res.data.result;
|
||||
rowsMain.value = res.data.result;
|
||||
serchDataTable();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -162,7 +163,7 @@ function openDialogHistory(idOrder: string) {
|
|||
modalHistory.value = true;
|
||||
}
|
||||
|
||||
/** ฟังก์ชันดึงข้อมูลประวัติการแก่ไขข้อมูล*/
|
||||
/** ฟังก์ชันดึงข้อมูลประวัติการแก้ไขข้อมูล*/
|
||||
async function fetchDataHistory() {
|
||||
showLoader();
|
||||
try {
|
||||
|
|
@ -242,6 +243,23 @@ function serchDataTable() {
|
|||
);
|
||||
}
|
||||
|
||||
function handleDelete(rowId: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(
|
||||
config.API.profileOtherUpdateDelete(empType.value) + `${rowId}`
|
||||
);
|
||||
await getData();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData();
|
||||
});
|
||||
|
|
@ -361,6 +379,18 @@ onMounted(() => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
|
|
@ -383,8 +413,9 @@ onMounted(() => {
|
|||
flat
|
||||
round
|
||||
@click="openDialogHistory(props.row.id)"
|
||||
><q-tooltip>ประวิติแก้ไขอื่นๆ</q-tooltip></q-btn
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขอื่นๆ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
|
||||
color="edit"
|
||||
|
|
@ -392,8 +423,20 @@ onMounted(() => {
|
|||
flat
|
||||
round
|
||||
@click="openDialogEdit(props.row)"
|
||||
><q-tooltip>แก้ไขข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
|
||||
<q-separator />
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ const modal = ref<boolean>(false); // แสดงฟอร์มแก้ไข
|
|||
const informaData = ref<ResponseObject>(); // ข้อมูลส่วนคัว
|
||||
const modalHistory = ref<boolean>(false); // แสดงช้อมูลรายการประวัติการแก้ไข
|
||||
const age = ref<string | null>(""); //อายุ
|
||||
const formData = reactive<RequestObject>(store.defaultProfile); //ฟอร์มข้อมูลการแก่้ไข
|
||||
const formData = reactive<RequestObject>(store.defaultProfile); //ฟอร์มข้อมูลการแก้ไข
|
||||
const emailVerify = ref<string | null>("");
|
||||
|
||||
/** ข้อมูล Label*/
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ const {
|
|||
hideLoader,
|
||||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
dialogRemove,
|
||||
} = useCounterMixin();
|
||||
|
||||
/** props*/
|
||||
|
|
@ -189,8 +190,8 @@ async function fetchData(id: string) {
|
|||
await http
|
||||
.get(config.API.profileNewChangeNameByProfileId(id, empType.value))
|
||||
.then(async (res) => {
|
||||
rows.value = await res.data.result;
|
||||
rowsMain.value = await res.data.result;
|
||||
searchDataTable();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -358,7 +359,7 @@ function closeDialog() {
|
|||
}
|
||||
|
||||
/** ฟังก์ค้นหาข้อมูลรายการประวัติการเปลีียนชื่อ-นามสกุล*/
|
||||
function serchDataTable() {
|
||||
function searchDataTable() {
|
||||
rows.value = onSearchDataTable(
|
||||
filterSearch.value,
|
||||
rowsMain.value,
|
||||
|
|
@ -366,6 +367,23 @@ function serchDataTable() {
|
|||
);
|
||||
}
|
||||
|
||||
function handleDelete(id: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(
|
||||
config.API.profileNewChangeNameUpdateDelete(empType.value) + `${id}`
|
||||
);
|
||||
await fetchData(profileId.value);
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** ดูการเปลี่ยนแปลงของข้อมูลฟอร์ท เปลี่ยนชื่อ-นามสกุล*/
|
||||
watch(
|
||||
() => [
|
||||
|
|
@ -450,7 +468,7 @@ onMounted(async () => {
|
|||
label="ค้นหา"
|
||||
class="q-mr-sm"
|
||||
v-model="filterSearch"
|
||||
@keydown.enter.prevent="serchDataTable"
|
||||
@keydown.enter.prevent="searchDataTable"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
|
|
@ -486,6 +504,7 @@ onMounted(async () => {
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width />
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
|
|
@ -495,6 +514,19 @@ onMounted(async () => {
|
|||
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="(col, index) in props.cols"
|
||||
:key="col.name"
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ const {
|
|||
messageError,
|
||||
success,
|
||||
pathRegistryEmp,
|
||||
dialogRemove,
|
||||
} = useCounterMixin();
|
||||
|
||||
/** props*/
|
||||
|
|
@ -367,7 +368,7 @@ function closeDialog() {
|
|||
/**
|
||||
* function แก้ไขข้อมูล
|
||||
* @param type ประเภทของบุคคล
|
||||
* @param isStatusEdit สถานะแก่้ไข
|
||||
* @param isStatusEdit สถานะแก้ไข
|
||||
* @param data ข้อมูลเดิม
|
||||
*/
|
||||
function onOpenDialogForm(
|
||||
|
|
@ -375,8 +376,6 @@ function onOpenDialogForm(
|
|||
isStatusEdit: boolean = false,
|
||||
data: any = undefined
|
||||
) {
|
||||
console.log(data);
|
||||
|
||||
modal.value = true;
|
||||
typeForm.value = type;
|
||||
isEdit.value = isStatusEdit;
|
||||
|
|
@ -509,6 +508,24 @@ async function fetchDataHistory() {
|
|||
}
|
||||
}
|
||||
|
||||
function handleDelete(id: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(
|
||||
config.API.profileFamilyUpdateDelete(empType.value, "children") +
|
||||
`${id}`
|
||||
);
|
||||
await fetchDataChildren();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||
onMounted(async () => {
|
||||
showLoader();
|
||||
|
|
@ -830,6 +847,19 @@ onMounted(async () => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(item.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
round
|
||||
flat
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ const {
|
|||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
convertDateToAPI,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const id = ref<string>(route.params.id.toString()); //id profile
|
||||
|
|
@ -576,6 +577,23 @@ async function fetchDataHistory() {
|
|||
}
|
||||
}
|
||||
|
||||
function handleDelete(rowId: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(
|
||||
config.API.profileEducationUpdateDelete(empType.value) + `${rowId}`
|
||||
);
|
||||
await fetchData(id.value);
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** ฟังก์ค้นหาข้อมูลรายการประวัติการศึกษา */
|
||||
function serchDataTable() {
|
||||
rows.value = onSearchDataTable(
|
||||
|
|
@ -736,6 +754,18 @@ onMounted(async () => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
|
|
@ -763,7 +793,7 @@ onMounted(async () => {
|
|||
<q-tooltip>ประวัติแก้ไขประวัติการศึกษา</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="isLeave == false"
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
|
|
@ -773,6 +803,18 @@ onMounted(async () => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
<q-separator />
|
||||
<q-list>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ const {
|
|||
date2Thai,
|
||||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
|
||||
const id = ref<string>(route.params.id.toString()); //id profile
|
||||
|
|
@ -252,8 +253,8 @@ async function fetchData(id: string) {
|
|||
await http
|
||||
.get(config.API.profileNewAbilityByProfileId(id, empType.value))
|
||||
.then(async (res) => {
|
||||
rows.value = await res.data.result;
|
||||
rowsMain.value = await res.data.result;
|
||||
serchDataTable();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -403,6 +404,23 @@ function serchDataTable() {
|
|||
);
|
||||
}
|
||||
|
||||
function handleDelete(rowId: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(
|
||||
config.API.profileAbilityUpdateDelete(empType.value) + `${rowId}`
|
||||
);
|
||||
await fetchData(id.value);
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
|
||||
onMounted(() => {
|
||||
fetchData(id.value);
|
||||
|
|
@ -529,6 +547,18 @@ onMounted(() => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
|
|
@ -578,7 +608,7 @@ onMounted(() => {
|
|||
<q-tooltip>ประวัติแก้ไขความสามารถพิเศษ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="isLeave == false"
|
||||
v-if="isLeave == false && checkPermission($route)?.attrIsUpdate"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
|
|
@ -593,6 +623,18 @@ onMounted(() => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
<q-separator />
|
||||
<q-list>
|
||||
|
|
|
|||
|
|
@ -596,7 +596,7 @@ async function fetchDataOptionExecutive() {
|
|||
/**
|
||||
* function เลือกประเภทตำแหน่ง
|
||||
* @param val id ประเภทตำแหน่ง
|
||||
* @param status แก่ไข , เพิ่ม
|
||||
* @param status แก้ไข , เพิ่ม
|
||||
*/
|
||||
async function updateSelectType(val: string, status: boolean = false) {
|
||||
const listLevel = val
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ const {
|
|||
pathRegistryEmp,
|
||||
onSearchDataTable,
|
||||
convertDateToAPI,
|
||||
dialogRemove,
|
||||
} = useCounterMixin();
|
||||
const { createPathUploadFlie, getPathUploadFlie, uploadFile } =
|
||||
useRegistryNewDataStore();
|
||||
|
|
@ -295,8 +296,8 @@ async function getData() {
|
|||
await http
|
||||
.get(config.API.profileNewNoPaidByProfileId(profileId.value, empType.value))
|
||||
.then(async (res) => {
|
||||
rows.value = await res.data.result;
|
||||
rowsMain.value = await res.data.result;
|
||||
serchDataTable();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -335,6 +336,23 @@ function serchDataTable() {
|
|||
);
|
||||
}
|
||||
|
||||
function handleDelete(id: string) {
|
||||
dialogRemove($q, async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.patch(
|
||||
config.API.profileNewNoPaidUpdateDelete(empType.value) + `${id}`
|
||||
);
|
||||
await getData();
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน */
|
||||
onMounted(() => {
|
||||
getData();
|
||||
|
|
@ -460,6 +478,18 @@ onMounted(() => {
|
|||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
|
|
@ -517,7 +547,19 @@ onMounted(() => {
|
|||
icon="edit"
|
||||
@click="onClickOpenDialog(true, props.row)"
|
||||
>
|
||||
<q-tooltip>แก่ไขข้อมุล</q-tooltip>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="!isLeave && checkPermission($route)?.attrIsDelete"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="delete"
|
||||
@click="handleDelete(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
<q-separator />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue