ทะเบียนประวัติ => ข้อมูลส่วนตัว
This commit is contained in:
parent
722794a27e
commit
ddf4c8b9d4
9 changed files with 228 additions and 168 deletions
|
|
@ -345,10 +345,10 @@ function onSubmit() {
|
|||
route.name === "registry-employeeId" ? "TEMP" : undefined,
|
||||
})
|
||||
.then(async () => {
|
||||
await getData();
|
||||
await props.fetchDataPersonal?.();
|
||||
await getData();
|
||||
modal.value = false;
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ async function uploadProfile(id: string) {
|
|||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
hideLoader();
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
async function uploadFileURL(uploadUrl: string, file: any) {
|
||||
|
|
@ -576,16 +576,7 @@ watch(
|
|||
>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
<!-- <q-btn
|
||||
flat
|
||||
dense
|
||||
round
|
||||
icon="mdi-history"
|
||||
color="deep-purple"
|
||||
@click="() => (fetchHistoryData(props.row.id), (historyDialog = true))"
|
||||
>
|
||||
<q-tooltip>ดูประวัติการเปลี่ยนชื่อ-นามสกุล</q-tooltip>
|
||||
</q-btn> -->
|
||||
|
||||
<q-space />
|
||||
<q-input
|
||||
dense
|
||||
|
|
@ -632,15 +623,21 @@ watch(
|
|||
>
|
||||
<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>
|
||||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td v-for="(col, index) in props.cols" :key="col.name">
|
||||
<div class="table_ellipsis">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
color="green"
|
||||
|
|
@ -652,27 +649,6 @@ watch(
|
|||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<!-- <q-btn
|
||||
v-if="checkPermission($route)?.attrIsUpdate"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
color="edit"
|
||||
icon="edit"
|
||||
clickable
|
||||
@click="
|
||||
() => {
|
||||
editForm(props.row);
|
||||
}
|
||||
"
|
||||
>
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||
</q-btn> -->
|
||||
</q-td>
|
||||
<q-td v-for="(col, index) in props.cols" :key="col.name">
|
||||
<div class="table_ellipsis">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
|
|
@ -706,24 +682,6 @@ watch(
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <q-select
|
||||
class="inputgreen"
|
||||
outlined
|
||||
v-model="changeNameData.status"
|
||||
:options="statusOption"
|
||||
label="สถานะการเปลี่ยนชื่อ"
|
||||
use-input
|
||||
hide-bottom-space
|
||||
input-debounce="0"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณาเลือกสถานะการเปลี่ยนชื่อ'}`,
|
||||
]"
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'statusOptions'
|
||||
) "
|
||||
dense
|
||||
/> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="row q-gutter-sm q-mb-md">
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ const profileId = ref<string>(
|
|||
);
|
||||
const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
|
||||
|
||||
const currentPage = ref<number>(1);
|
||||
const maxPage = ref<number>(1);
|
||||
const modal = ref<boolean>(false);
|
||||
const modalHistory = ref<boolean>(false);
|
||||
const rowsHistory = ref<ResponseObject[]>([]);
|
||||
|
|
@ -375,9 +373,9 @@ async function editData() {
|
|||
...formData,
|
||||
id: undefined,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
fetchAll();
|
||||
.then(async (res) => {
|
||||
await fetchAll();
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
|
|||
|
|
@ -169,6 +169,9 @@ const fromData = reactive({
|
|||
statusMarital: "",
|
||||
});
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลบิดา
|
||||
*/
|
||||
function fetchDataFather() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -194,6 +197,10 @@ function fetchDataFather() {
|
|||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลมารดา
|
||||
*/
|
||||
function fetchDataMother() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -218,6 +225,10 @@ function fetchDataMother() {
|
|||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลคู่สมรส
|
||||
*/
|
||||
function fetchDataCouple() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -244,6 +255,10 @@ function fetchDataCouple() {
|
|||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลบุตร
|
||||
*/
|
||||
function fetchDataChildren() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -263,6 +278,10 @@ function fetchDataChildren() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function บันทึกข้อมูล
|
||||
* @param type ประเภทของข้อมูล
|
||||
*/
|
||||
function onSubmit(type: string) {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
|
|
@ -288,14 +307,14 @@ function onSubmit(type: string) {
|
|||
const method = isEdit.value && type === "children" ? "patch" : "post";
|
||||
try {
|
||||
await http[method](url, formBody);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
type === "father"
|
||||
? fetchDataFather()
|
||||
? await fetchDataFather()
|
||||
: type === "mother"
|
||||
? fetchDataMother()
|
||||
? await fetchDataMother()
|
||||
: type === "couple"
|
||||
? fetchDataCouple()
|
||||
: fetchDataChildren();
|
||||
? await fetchDataCouple()
|
||||
: await fetchDataChildren();
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
} catch (e) {
|
||||
messageError($q, e);
|
||||
|
|
@ -305,9 +324,13 @@ function onSubmit(type: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function ปิด popup
|
||||
*/
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
modalHistory.value = false;
|
||||
// เคลียร์ formData
|
||||
fromData.isLive = 1;
|
||||
fromData.citizenId = "";
|
||||
fromData.prefix = "";
|
||||
|
|
@ -318,6 +341,12 @@ function closeDialog() {
|
|||
fromData.statusMarital = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* function แก้ไขข้อมูล
|
||||
* @param type ประเภทของบุคคล
|
||||
* @param isStatusEdit สถานะแก่้ไข
|
||||
* @param data ข้อมูลเดิม
|
||||
*/
|
||||
function onOpenDialogForm(
|
||||
type: string,
|
||||
isStatusEdit: boolean = false,
|
||||
|
|
@ -326,11 +355,9 @@ function onOpenDialogForm(
|
|||
modal.value = true;
|
||||
typeForm.value = type;
|
||||
isEdit.value = isStatusEdit;
|
||||
console.log(data);
|
||||
|
||||
if (type === "father") {
|
||||
titleForm.value = "บิดา";
|
||||
console.log(fatherData);
|
||||
|
||||
fromData.isLive =
|
||||
fatherData.isLive === null ? 1 : fatherData.isLive ? 1 : 0;
|
||||
|
|
@ -351,9 +378,11 @@ function onOpenDialogForm(
|
|||
fromData.job = motherData.job;
|
||||
} else if (type === "couple") {
|
||||
titleForm.value = "คู่สมรส";
|
||||
|
||||
fromData.isLive = 1;
|
||||
} else if (type === "children") {
|
||||
titleForm.value = "บุตร";
|
||||
|
||||
if (isStatusEdit) {
|
||||
childernId.value = data.id;
|
||||
fromData.isLive =
|
||||
|
|
@ -367,6 +396,11 @@ function onOpenDialogForm(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function ดูประวัติการแก้ไขข้อมูล
|
||||
* @param type ประเภทของบุคคล
|
||||
* @param id
|
||||
*/
|
||||
function onOpenDialogHistory(type: string, id: string = "") {
|
||||
modalHistory.value = true;
|
||||
typeForm.value = type;
|
||||
|
|
@ -374,6 +408,9 @@ function onOpenDialogHistory(type: string, id: string = "") {
|
|||
fetchHistory(historyId, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลความสัมพันธ์
|
||||
*/
|
||||
function fetchDataRelationship() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -393,14 +430,24 @@ function fetchDataRelationship() {
|
|||
});
|
||||
}
|
||||
|
||||
const filterSelectorRelation = (val: any, update: Function) => {
|
||||
/**
|
||||
* function ค้นหาข้อมูลใน select
|
||||
* @param val คำค้นหา
|
||||
* @param update function
|
||||
*/
|
||||
function filterSelectorRelation(val: any, update: Function) {
|
||||
update(() => {
|
||||
optionRelationship.value = optionRelationshipMain.value.filter(
|
||||
(v: any) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลประวัติการแก้ไขข้อมูล
|
||||
* @param id
|
||||
* @param type
|
||||
*/
|
||||
function fetchHistory(id: string, type: string) {
|
||||
hideLoader();
|
||||
http
|
||||
|
|
@ -426,11 +473,13 @@ function fetchHistory(id: string, type: string) {
|
|||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchDataFather();
|
||||
fetchDataMother();
|
||||
fetchDataCouple();
|
||||
fetchDataChildren();
|
||||
fetchDataRelationship();
|
||||
Promise.all([
|
||||
fetchDataFather(),
|
||||
fetchDataMother(),
|
||||
fetchDataCouple(),
|
||||
fetchDataChildren(),
|
||||
fetchDataRelationship(),
|
||||
]);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -495,18 +495,26 @@ const historyVisibleColumns = ref<string[]>([
|
|||
"lastUpdatedAt",
|
||||
]);
|
||||
|
||||
async function onSubmit() {
|
||||
/**
|
||||
* function ยืนยันการบันทึกข้อมูล
|
||||
*/
|
||||
function onSubmit() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
() => {
|
||||
dialogStatus.value === "create" ? addData() : editData(editId.value);
|
||||
closeDialog();
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* function ค้นหา คำใน option
|
||||
* @param val คำค้นหา
|
||||
* @param update function
|
||||
* @param refData type select
|
||||
*/
|
||||
function filterSelector(val: string, update: Function, refData: string) {
|
||||
switch (refData) {
|
||||
case "educationOption":
|
||||
|
|
@ -528,6 +536,9 @@ function filterSelector(val: string, update: Function, refData: string) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* function เคลียร์ formData
|
||||
*/
|
||||
function clearForm() {
|
||||
isDate.value = "false";
|
||||
educationData.educationLevel = "";
|
||||
|
|
@ -549,6 +560,10 @@ function clearForm() {
|
|||
educationData.note = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* function แก้ไขข้อมูลประวัติการศึกษา
|
||||
* @param row ข้อมูลประวัติการศึกษา
|
||||
*/
|
||||
function editForm(row: any) {
|
||||
dialogStatus.value = "edit";
|
||||
editId.value = row.id;
|
||||
|
|
@ -579,19 +594,30 @@ function editForm(row: any) {
|
|||
dialog.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* function ปิด popup มูลประวัติการศึกษา
|
||||
*/
|
||||
function closeDialog() {
|
||||
clearForm();
|
||||
dialog.value = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* funcitob ปิด popup ประวัติการศึกษา
|
||||
*/
|
||||
function closeHistoryDialog() {
|
||||
historyDialog.value = false;
|
||||
}
|
||||
|
||||
async function fetchData(id: string) {
|
||||
/**
|
||||
* function fetch ข้อมูลประวัตืการศึกษา
|
||||
* @param id บุคคล
|
||||
*/
|
||||
function fetchData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
http
|
||||
.get(config.API.profileNewEducationByProfileId(id, empType.value))
|
||||
.then(async (res) => {
|
||||
.then((res) => {
|
||||
rows.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -602,9 +628,11 @@ async function fetchData(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
async function fetchEducationLevel() {
|
||||
showLoader();
|
||||
await http
|
||||
/**
|
||||
* function fetch ข้อมูลระดับการศึกษา
|
||||
*/
|
||||
function fetchEducationLevel() {
|
||||
http
|
||||
.get(config.API.orgEducationLevel)
|
||||
.then(async (res) => {
|
||||
res.data.result.map((r: any) => {
|
||||
|
|
@ -617,15 +645,16 @@ async function fetchEducationLevel() {
|
|||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
async function fetchHistoryData(id: string) {
|
||||
/**
|
||||
* function fetch ประวัติการแก้ไขประวัติการศึกษา
|
||||
* @param id ประวัติการศึกษา
|
||||
*/
|
||||
function fetchHistoryData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
http
|
||||
.get(config.API.profileNewEducationHisByEducationId(id, empType.value))
|
||||
.then(async (res) => {
|
||||
historyRows.value = res.data.result;
|
||||
|
|
@ -638,8 +667,12 @@ async function fetchHistoryData(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
async function addData() {
|
||||
await http
|
||||
/**
|
||||
* function เพิ่มข้อมูลประวัติการศึกษา
|
||||
*/
|
||||
function addData() {
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.profileNewEducation(empType.value), {
|
||||
...educationData,
|
||||
startYear: undefined,
|
||||
|
|
@ -648,9 +681,10 @@ async function addData() {
|
|||
profileId: empType.value === "" ? id.value : undefined,
|
||||
profileEmployeeId: empType.value !== "" ? id.value : undefined,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -660,9 +694,12 @@ async function addData() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function บันทึกการแก้ไขข้อมูล
|
||||
* @param idData ประวัติการศึกษา
|
||||
*/
|
||||
function editData(idData: string) {
|
||||
console.log(educationData);
|
||||
|
||||
showLoader();
|
||||
http
|
||||
.patch(config.API.profileNewEducationByEducationId(idData, empType.value), {
|
||||
...educationData,
|
||||
|
|
@ -673,9 +710,10 @@ function editData(idData: string) {
|
|||
durationYear:
|
||||
educationData.durationYear === "" ? null : educationData.durationYear,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -685,23 +723,6 @@ function editData(idData: string) {
|
|||
});
|
||||
}
|
||||
|
||||
// function deleteData(idData: string) {
|
||||
// dialogRemove($q, () =>
|
||||
// http
|
||||
// .delete(config.API.profileNewEducationByEducationId(idData))
|
||||
// .then(() => {
|
||||
// fetchData(id.value);
|
||||
// success($q, "ลบข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// messageError($q, err);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// })
|
||||
// );
|
||||
// }
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData(id.value);
|
||||
fetchEducationLevel();
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ const mixin = useCounterMixin();
|
|||
const $q = useQuasar();
|
||||
const mode = ref<string>("table");
|
||||
const {
|
||||
dialogRemove,
|
||||
dialogConfirm,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
|
|
@ -189,6 +188,7 @@ const historyVisibleColumns = ref<string[]>([
|
|||
"lastUpdateFullName",
|
||||
"lastUpdatedAt",
|
||||
]);
|
||||
|
||||
function closeDialog() {
|
||||
dialog.value = false;
|
||||
}
|
||||
|
|
@ -197,18 +197,23 @@ function closeHistoryDialog() {
|
|||
historyDialog.value = false;
|
||||
}
|
||||
|
||||
async function onSubmit() {
|
||||
/**
|
||||
* function ยืนยันการบันทึกข้อมูล
|
||||
*/
|
||||
function onSubmit() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
() => {
|
||||
dialogStatus.value === "create" ? addData() : editData(editId.value);
|
||||
closeDialog();
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* function เคลียร์ formData
|
||||
*/
|
||||
function clearForm() {
|
||||
specialSkill.detail = "";
|
||||
specialSkill.field = "";
|
||||
|
|
@ -216,6 +221,10 @@ function clearForm() {
|
|||
specialSkill.remark = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* function
|
||||
* @param row ข้อมูลความสามารถพิเศษ
|
||||
*/
|
||||
function editForm(row: any) {
|
||||
dialogStatus.value = "edit";
|
||||
editId.value = row.id;
|
||||
|
|
@ -226,11 +235,14 @@ function editForm(row: any) {
|
|||
dialog.value = true;
|
||||
}
|
||||
|
||||
async function fetchData(id: string) {
|
||||
/**
|
||||
* function fetch ข้อมูลความสามรรถพิเศษ
|
||||
*/
|
||||
function fetchData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
http
|
||||
.get(config.API.profileNewAbilityByProfileId(id, empType.value))
|
||||
.then(async (res) => {
|
||||
.then((res) => {
|
||||
rows.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -241,11 +253,15 @@ async function fetchData(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
async function fetchHistoryData(id: string) {
|
||||
/**
|
||||
* function fetch ประวัติการแก้ไขความสามรรถพิเศษ
|
||||
* @param id ความสามรรถพิเศษ
|
||||
*/
|
||||
function fetchHistoryData(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
http
|
||||
.get(config.API.profileNewAbilityHisByAbilityId(id, empType.value))
|
||||
.then(async (res) => {
|
||||
.then((res) => {
|
||||
historyRows.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -256,8 +272,12 @@ async function fetchHistoryData(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
async function addData() {
|
||||
await http
|
||||
/**
|
||||
* function เพิ่มข้อมูลความสามรรถพิเศษ
|
||||
*/
|
||||
function addData() {
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.profileNewAbility(empType.value), {
|
||||
...specialSkill,
|
||||
dateStart: null,
|
||||
|
|
@ -265,9 +285,10 @@ async function addData() {
|
|||
profileId: empType.value === "" ? id.value : undefined,
|
||||
profileEmployeeId: empType.value !== "" ? id.value : undefined,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -277,17 +298,23 @@ async function addData() {
|
|||
});
|
||||
}
|
||||
|
||||
async function editData(idData: string) {
|
||||
await http
|
||||
/**
|
||||
* function บันทึกการแก้ไขข้อมูล
|
||||
* @param idData ความสามรรถพิเศษ
|
||||
*/
|
||||
function editData(idData: string) {
|
||||
showLoader();
|
||||
http
|
||||
.patch(config.API.profileNewAbilityByAbilityId(idData, empType.value), {
|
||||
...specialSkill,
|
||||
dateStart: null,
|
||||
dateEnd: null,
|
||||
profileId: undefined,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
.then(async () => {
|
||||
await fetchData(id.value);
|
||||
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
closeDialog();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -297,25 +324,8 @@ async function editData(idData: string) {
|
|||
});
|
||||
}
|
||||
|
||||
async function deleteData(idData: string) {
|
||||
dialogRemove($q, () =>
|
||||
http
|
||||
.delete(config.API.profileNewAbilityByAbilityId(idData, empType.value))
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData(id.value);
|
||||
onMounted(() => {
|
||||
fetchData(id.value);
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -44,6 +44,9 @@ const statusOptionMain = ref<DataOption[]>(
|
|||
);
|
||||
const statusOption = ref<DataOption[]>(statusOptionMain.value);
|
||||
|
||||
/**
|
||||
* function บันทึกรายการคำร้อง
|
||||
*/
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
showLoader();
|
||||
|
|
@ -64,6 +67,9 @@ function onSubmit() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function ปิด popup
|
||||
*/
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
formData.status = "";
|
||||
|
|
@ -77,6 +83,11 @@ function classInput(val: boolean) {
|
|||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* function ค้นหาคำใน select สถานะคำร้อง
|
||||
* @param val คำค้น
|
||||
* @param update Function
|
||||
*/
|
||||
function filterOption(val: string, update: Function) {
|
||||
update(() => {
|
||||
statusOption.value = statusOptionMain.value.filter(
|
||||
|
|
@ -85,6 +96,9 @@ function filterOption(val: string, update: Function) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function fetch ข้อมูลคำร้องแก้ไข
|
||||
*/
|
||||
function fetchDataRequest() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
|
|||
|
|
@ -573,9 +573,9 @@ function selectAvatarHistory() {
|
|||
http
|
||||
.get(config.API.orgProfileAvatar + `/select/${profileId.value}/${data.id}`)
|
||||
.then(async () => {
|
||||
closeImage();
|
||||
await fetchDataPersonal();
|
||||
await fetchProfile(profileId.value);
|
||||
closeImage();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -942,19 +942,6 @@ onMounted(async () => {
|
|||
:src="n.downloadUrl"
|
||||
:class="imageClass(n)"
|
||||
>
|
||||
<!-- <div
|
||||
class="absolute-top bg-transparent cursor-pointer text-right"
|
||||
style="padding: 5px"
|
||||
>
|
||||
<q-btn
|
||||
icon="delete"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="deletePhoto"
|
||||
style="color: #ff8080"
|
||||
/>
|
||||
</div> -->
|
||||
<div
|
||||
class="absolute-bottom col-12 cursor-pointer flex justify-between items-center"
|
||||
style="padding: 5px"
|
||||
|
|
|
|||
|
|
@ -132,6 +132,9 @@ const statusOption = ref<DataOption[]>(store.optionStatus);
|
|||
const modalStatus = ref<boolean>(false);
|
||||
const requestId = ref<string>("");
|
||||
|
||||
/**
|
||||
* function fetch รายการคำร้องขอแก้ไขทะเบียนประวัติ
|
||||
*/
|
||||
function fetchListRequset() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -157,16 +160,28 @@ function fetchListRequset() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* function เลือกสถานะคำร้อง
|
||||
*/
|
||||
function updateStatusValue() {
|
||||
page.value = 1;
|
||||
// fetch รายการคำร้องขอแก้ไขทะเบียนประวัติ
|
||||
fetchListRequset();
|
||||
}
|
||||
|
||||
/**
|
||||
* function เคลียร์ สถานะคำร้อง
|
||||
*/
|
||||
function clearStatus() {
|
||||
status.value = "";
|
||||
statusOption.value = store.optionStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* function ค้นหาคำใน select สถานะคำร้อง
|
||||
* @param val คำค้น
|
||||
* @param update Function
|
||||
*/
|
||||
function filterOption(val: string, update: Function) {
|
||||
update(() => {
|
||||
status.value = val ? "" : status.value;
|
||||
|
|
@ -176,11 +191,19 @@ function filterOption(val: string, update: Function) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* funciton แก่ไขคำร้อง
|
||||
* @param id รายการคำร้อง
|
||||
*/
|
||||
function onclickEdit(id: string) {
|
||||
modalStatus.value = true;
|
||||
requestId.value = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* function เลือกแถวต่อหน้า
|
||||
* @param newPagination
|
||||
*/
|
||||
function updatePageSizePagination(newPagination: Pagination) {
|
||||
page.value = 1;
|
||||
pageSize.value = newPagination.rowsPerPage;
|
||||
|
|
@ -200,9 +223,9 @@ function onDownloadFile(id: string) {
|
|||
id
|
||||
)
|
||||
)
|
||||
.then((res) => {
|
||||
.then(async (res) => {
|
||||
if (res.data.length !== 0) {
|
||||
downloadUrl(id, res.data[0].fileName);
|
||||
await downloadUrl(id, res.data[0].fileName);
|
||||
} else {
|
||||
hideLoader();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue