diff --git a/src/modules/13_salary/components/SalaryLists/TableTypePending.vue b/src/modules/13_salary/components/SalaryLists/TableTypePending.vue index 34832561c..fc4a24453 100644 --- a/src/modules/13_salary/components/SalaryLists/TableTypePending.vue +++ b/src/modules/13_salary/components/SalaryLists/TableTypePending.vue @@ -16,6 +16,8 @@ import DialogMoveLevel from "@/modules/13_salary/components/SalaryLists/DialogMo /** importStore*/ import { useCounterMixin } from "@/stores/mixin"; import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore"; +import http from "@/plugins/http"; +import config from "@/app.config"; const store = useSalaryListSDataStore(); @@ -42,7 +44,7 @@ const columns = ref([ { name: "fullName", align: "left", - label: "ชื้อ-นามสกุล", + label: "ชื่อ-นามสกุล", sortable: true, field: "fullName", headerStyle: "font-size: 14px", @@ -67,47 +69,47 @@ const columns = ref([ style: "font-size: 14px", }, { - name: "isResult", + name: "result", align: "center", label: "ผลการประเมิน", sortable: false, - field: "isResult", + field: "result", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "isDuration", + name: "duration", align: "center", label: "ระยะเวลา", sortable: false, - field: "isDuration", + field: "duration", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "isPunish", + name: "punish", align: "center", label: "การลงโทษ", sortable: false, - field: "isPunish", + field: "punish", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "isRetired", + name: "retired", align: "center", label: "พ้นราชการ", sortable: false, - field: "isRetired", + field: "retired", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "isRetired2", + name: "retired2", align: "center", label: "ขาดราชการ", sortable: false, - field: "isRetired", + field: "retired2", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -117,11 +119,11 @@ const visibleColumns = ref([ "fullName", "position", "organization", - "isResult", - "isDuration", - "isPunish", - "isRetired", - "isRetired2", + "result", + "duration", + "punish", + "retired", + "retired2", ]); const formFilter = defineModel("formFilter", { required: true }); @@ -145,9 +147,21 @@ const modalDialogMoveLeve = ref(false); const profileId = ref(""); const amount = ref(0); -function onClickDelete() { - dialogRemove($q, () => { - success($q, "ลบข้อมูลสำเร็จ"); +function onClickDelete(id: string) { + dialogRemove($q, async () => { + showLoader(); + await http + .delete(config.API.salaryListPeriodProfileById(id)) + .then(() => { + success($q, "ลบข้อมูลสำเร็จ"); + props.fetchDataTable?.(); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); }); } function onClickAddPerson() { @@ -190,6 +204,7 @@ watch( } ); +