API รายละเอียด สอบสวนความผิดทางวินัย

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-11-24 14:49:51 +07:00
parent e18386db65
commit 7b56868c1f
7 changed files with 462 additions and 182 deletions

View file

@ -2,23 +2,54 @@
import { onMounted, ref } from "vue";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import Table from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue";
import { useCounterMixin } from "@/stores/mixin";
import { useInvestigateDisStore } from "@/modules/11_discipline/store/InvestigateDisStore";
import http from "@/plugins/http";
import config from "@/app.config";
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
const $q = useQuasar(); // show dialog
const router = useRouter();
const filter = ref<string>(""); //search data table
import Table from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue";
import { useCounterMixin } from "@/stores/mixin";
import { useInvestigateDisStore } from "@/modules/11_discipline/store/InvestigateDisStore";
const mixin = useCounterMixin();
const dataInvestigateDis = useInvestigateDisStore();
const { showLoader, hideLoader } = mixin;
const { fecthList } = dataInvestigateDis;
const { fetchList } = dataInvestigateDis;
const $q = useQuasar(); // show dialog
const router = useRouter();
const filter = ref<string>(""); //search data table
const page = ref<number>(1);
const maxPage = ref<number>(1);
const initialPagination = ref<Pagination>({
rowsPerPage: 0,
rowsPerPage: 10,
});
async function fetchListDisciplinary() {
showLoader();
await http
.get(
config.API.disciplineDisciplinary() +
`?page=${page.value}&pageSize=${initialPagination.value.rowsPerPage}`
)
.then((res) => {
const data = res.data.result.data;
maxPage.value = Math.ceil(
res.data.result.total / initialPagination.value.rowsPerPage
);
fetchList(data);
console.log(data);
})
.catch((err) => {
console.log(err);
})
.finally(() => {
hideLoader();
});
}
/**
* ไปหนาแกไข
* @param id ไอดเฉพาะ รายบคคล
@ -32,54 +63,7 @@ function openEdit(id: string) {
* งขอมลจำลองไปย store
*/
onMounted(async () => {
showLoader();
fecthList([
{
id: "001",
subject: "ทุจริตในหน้าที่",
interrogated: "ศิรินภา คงน้อยี่",
fault: "1",
penaltyLevel: "7",
caseFault: "ทุจริตในหน้าที่",
dateInvestigate: "2023-12-01",
status: "0",
active: "2",
},
{
id: "002",
subject: "ทุจริตในหน้าที่",
interrogated: "ภัทรานุช คงน้อย",
fault: "1",
penaltyLevel: "7",
caseFault: "ทุจริตในหน้าที่",
dateInvestigate: "2023-11-30",
status: "0",
active: "0",
},
{
id: "003",
subject: "กระทำทุจริตเงินกองทุน",
interrogated: "ปรมาพร ศรีมี",
fault: "2",
penaltyLevel: "1",
caseFault: "พบการทุจริต",
dateInvestigate: "2023-09-14",
status: "1",
active: "1",
},
{
id: "004",
subject: "พูดจาไม่สุภาพ",
interrogated: "สมรัก ใจอารีย์",
fault: "2",
penaltyLevel: "1",
caseFault: "พูดจาไม่สุภาพกับผู้บังคับบัญชา",
dateInvestigate: "2023-08-11",
status: "0",
active: "1",
},
]);
await hideLoader();
await fetchListDisciplinary();
});
</script>