refacter พ้นจากราชการ
This commit is contained in:
parent
0e5dc057b8
commit
9d0f0eaabf
12 changed files with 34 additions and 63 deletions
|
|
@ -5,12 +5,9 @@ import { useQuasar } from "quasar";
|
|||
import { useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
|
||||
|
||||
import type { ResponseData } from "@/modules/06_retirement/interface/response/out";
|
||||
|
||||
const selected = ref<ResponseData[]>([]);
|
||||
|
|
@ -185,6 +182,7 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
onMounted(async () => {
|
||||
await getData();
|
||||
});
|
||||
|
||||
const openModalOrder = () => {
|
||||
openModal();
|
||||
const row = filters.value.filter(
|
||||
|
|
@ -193,6 +191,7 @@ const openModalOrder = () => {
|
|||
);
|
||||
rows2.value = row;
|
||||
};
|
||||
|
||||
const getData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -234,6 +233,7 @@ const getData = async () => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const clickDelete = async (id: string) => {
|
||||
dialogMessage(
|
||||
$q,
|
||||
|
|
@ -246,12 +246,12 @@ const clickDelete = async (id: string) => {
|
|||
async () => await getData()
|
||||
);
|
||||
};
|
||||
|
||||
const deleteData = async (id: string) => {
|
||||
await http
|
||||
.delete(config.API.outByid(id))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -260,6 +260,8 @@ const deleteData = async (id: string) => {
|
|||
await getData();
|
||||
});
|
||||
};
|
||||
|
||||
//ส่งไปออกคำสั่ง
|
||||
const saveOrder = async () => {
|
||||
const id = selected.value.map((r) => r.id);
|
||||
const body = {
|
||||
|
|
@ -280,6 +282,7 @@ const saveOrder = async () => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const openModal = () => (modal.value = true);
|
||||
const closeModal = () => (modal.value = false);
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ const responseData = ref<ResponseDataDetail>({
|
|||
onMounted(async () => {
|
||||
if (keycloak.tokenParsed != null) {
|
||||
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
|
||||
console.log("roleAdmin===>", roleAdmin.value);
|
||||
}
|
||||
await getData();
|
||||
});
|
||||
|
|
@ -140,8 +139,6 @@ const saveData = async () => {
|
|||
await http
|
||||
.put(config.API.outByid(dataId), body)
|
||||
.then((res: any) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(data);
|
||||
success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
|
||||
edit.value = false;
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue