ต้นแบบ สำหรับลงในตำแหน่ง/เงินเดือน fix ค้นหาข้อมูล
This commit is contained in:
parent
2597b4b344
commit
b30cc6d657
2 changed files with 27 additions and 22 deletions
|
|
@ -10,8 +10,9 @@ export default {
|
||||||
page: number,
|
page: number,
|
||||||
pageSize: number,
|
pageSize: number,
|
||||||
isActive: boolean,
|
isActive: boolean,
|
||||||
commandSysId: string
|
commandSysId: string,
|
||||||
|
search: string
|
||||||
) =>
|
) =>
|
||||||
`${commandSalary}/admin?page=${page}&pageSize=${pageSize}&isActive=${isActive}&commandSysId=${commandSysId}`,
|
`${commandSalary}/admin?page=${page}&pageSize=${pageSize}&isActive=${isActive}&commandSysId=${commandSysId}&search=${search}`,
|
||||||
commandSalaryById:(id:string)=>`${commandSalary}/${id}`
|
commandSalaryById: (id: string) => `${commandSalary}/${id}`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -116,21 +116,21 @@ function onDialogEdit(data: ListTemplateSalary) {
|
||||||
* ลบ คำสั่ง
|
* ลบ คำสั่ง
|
||||||
* @param id id คำสั่ง
|
* @param id id คำสั่ง
|
||||||
*/
|
*/
|
||||||
function onDelete(id: string) {
|
async function onDelete(id: string) {
|
||||||
dialogRemove($q, () => {
|
dialogRemove($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
await http
|
||||||
.delete(config.API.commandSalaryById(id))
|
.delete(config.API.commandSalaryById(id))
|
||||||
.then(async (res) => {
|
.then(async () => {
|
||||||
success($q, "ลบข้อมูลเสร็จสิ้น");
|
|
||||||
await fetchSalaryList();
|
await fetchSalaryList();
|
||||||
hideLoader();
|
success($q, "ลบข้อมูลเสร็จสิ้น");
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
hideLoader();
|
|
||||||
})
|
})
|
||||||
.finally(() => {});
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -146,33 +146,34 @@ function closeDialog() {
|
||||||
|
|
||||||
/** บันทึกข้อมูล dialog */
|
/** บันทึกข้อมูล dialog */
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, async () => {
|
||||||
const url = isEdit.value
|
const url = isEdit.value
|
||||||
? config.API.commandSalaryById(dataForm.id)
|
? config.API.commandSalaryById(dataForm.id)
|
||||||
: config.API.commandSalary;
|
: config.API.commandSalary;
|
||||||
showLoader();
|
showLoader();
|
||||||
http[isEdit.value ? "put" : "post"](url, {
|
await http[isEdit.value ? "put" : "post"](url, {
|
||||||
name: dataForm.name,
|
name: dataForm.name,
|
||||||
commandSysId: activeOrderId.value,
|
commandSysId: activeOrderId.value,
|
||||||
isActive: dataForm.isActive,
|
isActive: dataForm.isActive,
|
||||||
})
|
})
|
||||||
.then(async (res) => {
|
.then(async () => {
|
||||||
closeDialog();
|
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
|
||||||
await fetchSalaryList();
|
await fetchSalaryList();
|
||||||
hideLoader();
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
closeDialog();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
hideLoader();
|
|
||||||
})
|
})
|
||||||
.finally(() => {});
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** เก็บ id list คำสั่งที่เลือก เพื่อใช้ class */
|
/** เก็บ id list คำสั่งที่เลือก เพื่อใช้ class */
|
||||||
function selectInbox(data: CommandSysType) {
|
function selectInbox(data: CommandSysType) {
|
||||||
activeOrderId.value = data.id;
|
activeOrderId.value = data.id;
|
||||||
|
pagination.value.page = 1;
|
||||||
fetchSalaryList();
|
fetchSalaryList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -181,13 +182,15 @@ function selectInbox(data: CommandSysType) {
|
||||||
*/
|
*/
|
||||||
async function fetchSalaryList() {
|
async function fetchSalaryList() {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
rows.value = [];
|
||||||
await http
|
await http
|
||||||
.get(
|
.get(
|
||||||
config.API.commandSalaryDetail(
|
config.API.commandSalaryDetail(
|
||||||
pagination.value.page,
|
pagination.value.page,
|
||||||
pagination.value.rowsPerPage,
|
pagination.value.rowsPerPage,
|
||||||
isActive.value,
|
isActive.value,
|
||||||
activeOrderId.value
|
activeOrderId.value,
|
||||||
|
filter.value
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
|
|
@ -239,6 +242,7 @@ watch(
|
||||||
watch(
|
watch(
|
||||||
() => isActive.value,
|
() => isActive.value,
|
||||||
async () => {
|
async () => {
|
||||||
|
pagination.value.page = 1;
|
||||||
await fetchSalaryList();
|
await fetchSalaryList();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -321,6 +325,7 @@ onMounted(() => {
|
||||||
outlined
|
outlined
|
||||||
v-model="filter"
|
v-model="filter"
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
|
@keydown.enter="(pagination.page = 1), fetchSalaryList()"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" v-if="filter == ''" />
|
<q-icon name="search" v-if="filter == ''" />
|
||||||
|
|
@ -352,13 +357,12 @@ onMounted(() => {
|
||||||
ref="table"
|
ref="table"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:filter="filter"
|
|
||||||
row-key="id"
|
row-key="id"
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
:paging="true"
|
:paging="true"
|
||||||
dense
|
dense
|
||||||
:rows-per-page-options="[1, 25, 50, 100]"
|
:rows-per-page-options="[25, 50, 100]"
|
||||||
@update:pagination="updatePagination"
|
@update:pagination="updatePagination"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue