API อัตราเงินเดือน
This commit is contained in:
parent
bbb14c060f
commit
65341e199b
3 changed files with 79 additions and 31 deletions
|
|
@ -107,7 +107,7 @@ const itemMenu = ref<ItemsMenu[]>([
|
|||
/** queryString*/
|
||||
const formQuery = reactive<FormQuerySalary>({
|
||||
page: 1, //*หน้า
|
||||
pageSize: 100, //*จำนวนแถวต่อหน้า
|
||||
pageSize: 10, //*จำนวนแถวต่อหน้า
|
||||
keyword: "", //keyword ค้นหา
|
||||
});
|
||||
const totalRow = ref<number>(1);
|
||||
|
|
@ -124,6 +124,7 @@ async function fetchListSalalyRate() {
|
|||
)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
rows.value = res.data.result.data;
|
||||
})
|
||||
.catch((err) => {
|
||||
// messageError($q, err);
|
||||
|
|
@ -175,8 +176,8 @@ async function fetchListSalalyRate() {
|
|||
* @param newPagination ข้อมูล Pagination ใหม่
|
||||
*/
|
||||
function updatePagination(newPagination: NewPagination) {
|
||||
// formQuery.page = 1;
|
||||
// formQuery.pageSize = newPagination.rowsPerPage;
|
||||
formQuery.page = 1;
|
||||
formQuery.pageSize = newPagination.rowsPerPage;
|
||||
}
|
||||
|
||||
const typeAction = ref<string>("");
|
||||
|
|
@ -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 () => {
|
|||
<div v-else-if="col.name === 'salaryHalf'">
|
||||
{{
|
||||
props.row.salaryHalfSpecial
|
||||
? col.value + " " + `(${props.row.salaryHalfSpecial})`
|
||||
: col.value
|
||||
? col.value.toLocaleString() +
|
||||
" " +
|
||||
`(${props.row.salaryHalfSpecial.toLocaleString()})`
|
||||
: col.value.toLocaleString()
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div v-else-if="col.name === 'salaryFull'">
|
||||
{{
|
||||
props.row.salaryFullSpecial
|
||||
? col.value + " " + `(${props.row.salaryFullSpecial})`
|
||||
: col.value
|
||||
? col.value.toLocaleString() +
|
||||
" " +
|
||||
`(${props.row.salaryFullSpecial.toLocaleString()})`
|
||||
: col.value.toLocaleString()
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div v-else-if="col.name === 'salaryFullHalf'">
|
||||
{{
|
||||
props.row.salaryFullHalfSpecial
|
||||
? col.value + " " + `(${props.row.salaryFullHalfSpecial})`
|
||||
: col.value
|
||||
? col.value.toLocaleString() +
|
||||
" " +
|
||||
`(${props.row.salaryFullHalfSpecial.toLocaleString()})`
|
||||
: col.value.toLocaleString()
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
{{ col.value ? col.value.toLocaleString() : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td>
|
||||
|
|
@ -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"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue