("");
@@ -189,9 +190,20 @@ function onClickSalaryRate(type: string, data: SalaryRate | null) {
}
}
-function onClickDelete() {
- dialogRemove($q, () => {
- success($q, "ลบข้อมูลสำเร็จ");
+function onClickDelete(id: string) {
+ dialogRemove($q, async () => {
+ await http
+ .delete(config.API.salaryRateListByid(id))
+ .then(() => {
+ success($q, "ลบข้อมูลสำเร็จ");
+ })
+ .catch((err) => {
+ messageError($q, err);
+ })
+ .finally(() => {
+ fetchListSalalyRate();
+ hideLoader();
+ });
});
}
@@ -275,29 +287,35 @@ watch([() => formQuery.page, () => formQuery.pageSize], async () => {
{{
props.row.salaryHalfSpecial
- ? col.value + " " + `(${props.row.salaryHalfSpecial})`
- : col.value
+ ? col.value.toLocaleString() +
+ " " +
+ `(${props.row.salaryHalfSpecial.toLocaleString()})`
+ : col.value.toLocaleString()
}}
{{
props.row.salaryFullSpecial
- ? col.value + " " + `(${props.row.salaryFullSpecial})`
- : col.value
+ ? col.value.toLocaleString() +
+ " " +
+ `(${props.row.salaryFullSpecial.toLocaleString()})`
+ : col.value.toLocaleString()
}}
{{
props.row.salaryFullHalfSpecial
- ? col.value + " " + `(${props.row.salaryFullHalfSpecial})`
- : col.value
+ ? col.value.toLocaleString() +
+ " " +
+ `(${props.row.salaryFullHalfSpecial.toLocaleString()})`
+ : col.value.toLocaleString()
}}
- {{ col.value ? col.value : "-" }}
+ {{ col.value ? col.value.toLocaleString() : "-" }}
@@ -320,7 +338,7 @@ watch([() => formQuery.page, () => formQuery.pageSize], async () => {
item.type === 'edit'
? onClickSalaryRate('edit', props.row)
: item.type === 'delete'
- ? onClickDelete()
+ ? onClickDelete(props.row.id)
: null
"
>
@@ -361,6 +379,7 @@ watch([() => formQuery.page, () => formQuery.pageSize], async () => {
v-model:modal="modalDialogFormRate"
:typeAction="typeAction"
:data="dataRow"
+ :fetchData="fetchListSalalyRate"
/>