refacter พ้นจากราชการ
This commit is contained in:
parent
0e5dc057b8
commit
9d0f0eaabf
12 changed files with 34 additions and 63 deletions
|
|
@ -1,5 +1,4 @@
|
|||
<script setup lang="ts">
|
||||
|
||||
const props = defineProps({
|
||||
editvisible: Boolean,
|
||||
modalEdit: Boolean,
|
||||
|
|
@ -29,9 +28,6 @@ const emit = defineEmits([
|
|||
const updateEdit = (value: Boolean) => {
|
||||
emit("update:editvisible", value);
|
||||
};
|
||||
// const cancel = async () => {
|
||||
// props.cancel();
|
||||
// };
|
||||
const edit = async () => {
|
||||
updateEdit(!props.editvisible);
|
||||
props.edit();
|
||||
|
|
@ -39,30 +35,30 @@ const edit = async () => {
|
|||
const checkSave = () => {
|
||||
props.validate();
|
||||
props.save();
|
||||
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<q-card-actions class="text-primary">
|
||||
<q-space />
|
||||
<q-btn
|
||||
v-if="!editvisible"
|
||||
<q-btn
|
||||
v-if="!editvisible"
|
||||
outline
|
||||
:disabled="editvisible"
|
||||
:disabled="editvisible"
|
||||
:color="editvisible ? 'grey-7' : 'primary'"
|
||||
@click="edit"
|
||||
@click="edit"
|
||||
><!-- icon="mdi-pencil-outline"
|
||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip> -->
|
||||
</q-btn>
|
||||
<div v-else>
|
||||
<q-btn
|
||||
<q-btn
|
||||
unelevated
|
||||
label="บันทึก"
|
||||
:disabled="!editvisible"
|
||||
:color="!editvisible ? 'grey-7' : 'public'"
|
||||
:disabled="!editvisible"
|
||||
:color="!editvisible ? 'grey-7' : 'public'"
|
||||
@click="checkSave"
|
||||
>
|
||||
</q-btn><!-- icon="mdi-content-save-outline">
|
||||
</q-btn
|
||||
><!-- icon="mdi-content-save-outline">
|
||||
<q-tooltip>บันทึก</q-tooltip> -->
|
||||
</div>
|
||||
</q-card-actions>
|
||||
|
|
|
|||
|
|
@ -13,17 +13,22 @@ const close = async () => {
|
|||
<template>
|
||||
<q-toolbar class="q-py-md">
|
||||
<q-toolbar-title class="header-text">{{ title }}</q-toolbar-title>
|
||||
<q-btn icon="close" unelevated round dense @click="close" style="color: #ff8080; background-color: #ffdede" />
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="close"
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
</q-toolbar>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
|
||||
.header-text {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
line-height: 26px;
|
||||
color: #35373C;
|
||||
color: #35373c;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -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/discharged";
|
||||
|
||||
const selected = ref<ResponseData[]>([]);
|
||||
|
|
@ -52,7 +49,9 @@ const visibleColumns2 = ref<string[]>([
|
|||
"positionLevel",
|
||||
"organizationPositionOld",
|
||||
"statustext",
|
||||
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
]);
|
||||
|
||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const filterRef = ref<any>(null);
|
||||
|
|
@ -263,7 +262,6 @@ const deleteData = async (id: string) => {
|
|||
.delete(config.API.dischargeByid(id))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -273,6 +271,7 @@ const deleteData = async (id: string) => {
|
|||
});
|
||||
};
|
||||
|
||||
//ส่งไปออกคำสั่ง
|
||||
const saveOrder = async () => {
|
||||
const id = selected.value.map((r) => r.id);
|
||||
const body = {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ const mixin = useCounterMixin();
|
|||
const dataId = route.params.id.toString();
|
||||
const {
|
||||
date2Thai,
|
||||
dialogMessage,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
|
|
@ -61,7 +60,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();
|
||||
});
|
||||
|
|
@ -124,6 +122,7 @@ const conditionSave = async () => {
|
|||
}
|
||||
};
|
||||
|
||||
//บันทึกข้อมูล
|
||||
const saveData = async () => {
|
||||
const body = {
|
||||
organization: organization.value,
|
||||
|
|
@ -139,8 +138,6 @@ const saveData = async () => {
|
|||
await http
|
||||
.put(config.API.dischargeByid(dataId), body)
|
||||
.then((res: any) => {
|
||||
// const data = res.data.result;
|
||||
// console.log(data);
|
||||
success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
|
||||
edit.value = false;
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
})
|
||||
|
|
|
|||
|
|
@ -117,7 +117,6 @@ const adjust_option = ref<any>([
|
|||
onMounted(async () => {
|
||||
if (keycloak.tokenParsed != null) {
|
||||
roleAdmin.value = await keycloak.tokenParsed.role.includes("placement1");
|
||||
console.log("roleAdmin===>", roleAdmin.value);
|
||||
}
|
||||
await getData();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
dialogMessage,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
const { statusText } = transferStore;
|
||||
|
|
@ -258,7 +257,6 @@ const deleteData = async (id: string) => {
|
|||
.delete(config.API.expulsionByid(id))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
console.log(res);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -269,6 +267,7 @@ const deleteData = async (id: string) => {
|
|||
});
|
||||
};
|
||||
|
||||
//ส่งไปออกคำสั่ง
|
||||
const saveOrder = async () => {
|
||||
const id = selected.value.map((r) => r.id);
|
||||
const body = {
|
||||
|
|
|
|||
|
|
@ -9,11 +9,8 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
|
||||
import type { QTableProps, QForm } from "quasar";
|
||||
import type {
|
||||
TypeFile,
|
||||
ResponseDataDetail,
|
||||
} from "@/modules/06_retirement/interface/response/expulsion";
|
||||
import type { QForm } from "quasar";
|
||||
import type { ResponseDataDetail } from "@/modules/06_retirement/interface/response/expulsion";
|
||||
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
|
|
@ -23,7 +20,6 @@ const mixin = useCounterMixin();
|
|||
const dataId = route.params.id.toString();
|
||||
const {
|
||||
date2Thai,
|
||||
dialogMessage,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
|
|
@ -64,7 +60,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();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -84,7 +84,6 @@ const fecthlistRetire = async () => {
|
|||
await http
|
||||
.get(config.API.profileOrganizRoot)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
const id = res.data.result[0].id;
|
||||
if (id !== "") {
|
||||
findlist(id);
|
||||
|
|
@ -117,9 +116,7 @@ const findlist = async (id: string) => {
|
|||
organizationOrganization: e.oc,
|
||||
}));
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
})
|
||||
.catch((e) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -160,20 +160,6 @@ onMounted(async () => {
|
|||
await getData();
|
||||
});
|
||||
|
||||
const getList = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.detailByidDeceased(profileId.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
const listModal = async (id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
|
|||
|
|
@ -326,7 +326,6 @@ const addedOrderTypeValues: string[] = [];
|
|||
const OrderTypeFilter = async () => {
|
||||
for (let data of OriginalData.value) {
|
||||
const OrderTypeValue = data.OrderType;
|
||||
console.log(OrderTypeValue);
|
||||
if (!addedOrderTypeValues.includes(OrderTypeValue)) {
|
||||
OrderTypeOption.push({
|
||||
id: OrderTypeOption.length,
|
||||
|
|
@ -342,7 +341,6 @@ const addedOrderStatusValues: string[] = [];
|
|||
const OrderStatusFilter = async () => {
|
||||
for (let data of OriginalData.value) {
|
||||
const OrderStatusValue = data.OrderStatus;
|
||||
console.log(OrderStatusValue);
|
||||
|
||||
if (
|
||||
OrderStatusValue === null ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue