รายการออกคำสั่งย้ายสับเปลี่ยนตำแหน่ง (รอ API)

This commit is contained in:
STW_TTTY\stwtt 2024-06-12 14:37:02 +07:00
parent 49bb827226
commit aad0d88867
5 changed files with 69 additions and 94 deletions

View file

@ -111,37 +111,19 @@ const sendToCommand = () => {
// API
const fecthLists = async () => {
// showLoader();
// rows.value = [];
// await http
// .get(config.API.appointmentMain())
// .then((res) => {
// let response = res.data.result;
// listRecevice.value = response;
// rows.value = response;
// rows2.value = rows.value.filter(
// (e: any) => e.status !== "REPORT" && e.status !== "DONE"
// );
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
rows.value = [
{
id: "08dc86c2-98a5-45f0-8e37-3502a4eb78c0",
name: "ย้ายสับเปลี่ยนตำแหน่งทุกเขต",
status: "WAITTING",
createdAt: "2024-06-07T14:22:31.985829",
},
];
rows2.value = rows.value.filter(
(e: any) => e.status !== "REPORT" && e.status !== "DONE"
);
showLoader();
rows.value = [];
await http
.get(config.API.changePosition)
.then((res) => {
rows.value = res.data.result;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
// dialog
@ -160,19 +142,19 @@ function addRound() {
//
const clickDelete = (id: string) => {
dialogRemove($q, () => {
// showLoader();
// http
// .delete(config.API.appointmentDelete(id))
// .then(() => {
// success($q, "");
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// fecthLists();
// hideLoader();
// });
showLoader();
http
.delete(config.API.changePosition+`/${id}`)
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
fecthLists();
hideLoader();
});
});
};
@ -183,23 +165,6 @@ const personalListPage = (id: string) => {
});
};
function onSave(data: any) {
// showLoader();
// http
// .put(config.API.appointmentPosition(personalId.value), dataAppoint)
// .then((res) => {
// modalTree.value = false;
// success($q, "");
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(async () => {
// fecthLists();
// hideLoader();
// });
}
onMounted(() => {
fecthLists();
});