Merge branch 'develop' into warunee-dev
# Conflicts: # src/modules/11_discipline/store/ComplaintsStore.ts
This commit is contained in:
commit
a6dfc53ef5
17 changed files with 745 additions and 442 deletions
|
|
@ -20,5 +20,6 @@ export default {
|
||||||
/** รายการลา*/
|
/** รายการลา*/
|
||||||
leaveType: () => `${leave}/type`,
|
leaveType: () => `${leave}/type`,
|
||||||
leaveList: () => `${leave}/admin`,
|
leaveList: () => `${leave}/admin`,
|
||||||
|
leaveListDelete: () => `${leave}/admin/delete`,
|
||||||
leaveListById: (id: string) => `${leave}/admin/${id}`,
|
leaveListById: (id: string) => `${leave}/admin/${id}`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import env from "../index";
|
||||||
const disciplineMain = `${env.API_URI}/discipline`;
|
const disciplineMain = `${env.API_URI}/discipline`;
|
||||||
const discipline = `${env.API_URI}/discipline/disciplinary`;
|
const discipline = `${env.API_URI}/discipline/disciplinary`;
|
||||||
const investigate = `${env.API_URI}/discipline/investigate`;
|
const investigate = `${env.API_URI}/discipline/investigate`;
|
||||||
|
const suspend = `${env.API_URI}/discipline/suspend`;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
directorList: (page: number, pageSize: number, keyword: string) =>
|
directorList: (page: number, pageSize: number, keyword: string) =>
|
||||||
|
|
@ -65,4 +66,10 @@ export default {
|
||||||
/** รายการผลการพิจารณาทางวินัย*/
|
/** รายการผลการพิจารณาทางวินัย*/
|
||||||
listResult: () => `${disciplineMain}/result`,
|
listResult: () => `${disciplineMain}/result`,
|
||||||
listResultById: (id: string) => `${disciplineMain}/result/${id}`,
|
listResultById: (id: string) => `${disciplineMain}/result/${id}`,
|
||||||
|
|
||||||
|
/** ผู้ถูกพักราชการ */
|
||||||
|
suspendMain:(page: number, pageSize: number, keyword: string) => `${suspend}?page=${page}&pageSize=${pageSize}&keyword=${keyword}`,
|
||||||
|
suspendById: (id: string) => `${suspend}/${id}`,
|
||||||
|
|
||||||
|
suspendReport: () => `${suspend}/report`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,13 @@ function updateRowsPerPagen(newPagination: any) {
|
||||||
@click.prevent="clickDetail(props.row)"
|
@click.prevent="clickDetail(props.row)"
|
||||||
>
|
>
|
||||||
<div v-if="col.name == 'no'">
|
<div v-if="col.name == 'no'">
|
||||||
{{ props.rowIndex + 1 }}
|
<!-- {{ props.rowIndex + 1 }} -->
|
||||||
|
|
||||||
|
{{
|
||||||
|
(currentPage - 1) * Number(pagination.rowsPerPage) +
|
||||||
|
props.rowIndex +
|
||||||
|
1
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.name == 'checkInLocation'">
|
<div v-else-if="col.name == 'checkInLocation'">
|
||||||
<q-item style="padding: 0">
|
<q-item style="padding: 0">
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted } from "vue";
|
import { ref, reactive, onMounted } from "vue";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
|
||||||
/**importType*/
|
/**importType*/
|
||||||
import type {
|
import type {
|
||||||
|
|
@ -12,19 +15,17 @@ import ToolBar from "@/modules/09_leave/components/2_Leave/ToolBarLeave.vue";
|
||||||
import CalendarView from "@/modules/09_leave/components/2_Leave/Calendar.vue";
|
import CalendarView from "@/modules/09_leave/components/2_Leave/Calendar.vue";
|
||||||
|
|
||||||
/**importStroe*/
|
/**importStroe*/
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
|
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
|
||||||
import { useLeavelistDataStoreTest } from "@/modules/09_leave/stores/ListLeave";
|
import { useLeavelistDataStoreTest } from "@/modules/09_leave/stores/ListLeave";
|
||||||
|
|
||||||
|
const mixin = useCounterMixin();
|
||||||
const leaveStore = useLeavelistDataStore();
|
const leaveStore = useLeavelistDataStore();
|
||||||
const APIDATA = useLeavelistDataStoreTest();
|
const APIDATA = useLeavelistDataStoreTest();
|
||||||
|
const { date2Thai, dateToISO, showLoader, hideLoader, messageError } = mixin;
|
||||||
const { fetchListLeave } = leaveStore;
|
const { fetchListLeave } = leaveStore;
|
||||||
|
|
||||||
//** เรียกข้อมูลจาก API*/
|
const $q = useQuasar(); //ใช้ noti quasar
|
||||||
function fecthLeaveList() {
|
|
||||||
const data = APIDATA.data;
|
|
||||||
maxPage.value = Math.ceil(data.length / querySting.pageSize);
|
|
||||||
fetchListLeave(data); /** ส่งข้อมูลไป stores*/
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
const querySting = reactive<QuerySting>({
|
const querySting = reactive<QuerySting>({
|
||||||
|
|
@ -37,13 +38,34 @@ const querySting = reactive<QuerySting>({
|
||||||
});
|
});
|
||||||
const maxPage = ref<number>(1);
|
const maxPage = ref<number>(1);
|
||||||
|
|
||||||
|
//** เรียกข้อมูลจาก API*/
|
||||||
|
async function fecthLeaveList() {
|
||||||
|
// showLoader();
|
||||||
|
// await http
|
||||||
|
// .post(config.API.leaveList(), querySting)
|
||||||
|
// .then((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
|
||||||
|
// maxPage.value = Math.ceil(data.length / querySting.pageSize);
|
||||||
|
// })
|
||||||
|
// .catch((err) => {
|
||||||
|
// messageError($q, err);
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// hideLoader();
|
||||||
|
// });
|
||||||
|
const data = APIDATA.data;
|
||||||
|
maxPage.value = Math.ceil(data.length / querySting.pageSize);
|
||||||
|
fetchListLeave(data); /** ส่งข้อมูลไป stores*/
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param newPage หน้า
|
* @param newPage หน้า
|
||||||
* @param pageSize จำนวนต่อแถว
|
* @param pageSize จำนวนต่อแถว
|
||||||
* @param dateFilter ข้อมูลค้นหา
|
* @param dateFilter ข้อมูลค้นหา
|
||||||
*/
|
*/
|
||||||
function updatePaging(
|
async function updatePaging(
|
||||||
newPage: number,
|
newPage: number,
|
||||||
pageSize: number,
|
pageSize: number,
|
||||||
dateFilter: DateFilter
|
dateFilter: DateFilter
|
||||||
|
|
@ -52,9 +74,10 @@ function updatePaging(
|
||||||
querySting.type = dateFilter ? dateFilter.type : querySting.type;
|
querySting.type = dateFilter ? dateFilter.type : querySting.type;
|
||||||
querySting.status = dateFilter ? dateFilter.status : querySting.status;
|
querySting.status = dateFilter ? dateFilter.status : querySting.status;
|
||||||
querySting.page = newPage;
|
querySting.page = newPage;
|
||||||
querySting.pageSize = pageSize;
|
querySting.pageSize = pageSize ? pageSize : querySting.pageSize;
|
||||||
querySting.keyword = dateFilter ? dateFilter.keyword : querySting.keyword;
|
querySting.keyword = dateFilter ? dateFilter.keyword : querySting.keyword;
|
||||||
console.log(querySting);
|
console.log(querySting);
|
||||||
|
await fecthLeaveList();
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted } from "vue";
|
import { ref, reactive, onMounted } from "vue";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
|
||||||
/**importType*/
|
/**importType*/
|
||||||
import type {
|
import type {
|
||||||
|
|
@ -11,15 +14,20 @@ import TableList from "@/modules/09_leave/components/2_Leave/TableList.vue";
|
||||||
import ToolBar from "@/modules/09_leave/components/2_Leave/ToolBarLeave.vue";
|
import ToolBar from "@/modules/09_leave/components/2_Leave/ToolBarLeave.vue";
|
||||||
|
|
||||||
/**importStroe*/
|
/**importStroe*/
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
|
import { useLeavelistDataStore } from "@/modules/09_leave/stores/LeaveStore";
|
||||||
import { useLeavelistDataStoreTest } from "@/modules/09_leave/stores/ListLeave";
|
import { useLeavelistDataStoreTest } from "@/modules/09_leave/stores/ListLeave";
|
||||||
|
|
||||||
|
const mixin = useCounterMixin();
|
||||||
const leaveStore = useLeavelistDataStore();
|
const leaveStore = useLeavelistDataStore();
|
||||||
const APIDATA = useLeavelistDataStoreTest();
|
const APIDATA = useLeavelistDataStoreTest();
|
||||||
|
const { date2Thai, dateToISO, showLoader, hideLoader, messageError } = mixin;
|
||||||
const { fetchListLeaveReject } = leaveStore;
|
const { fetchListLeaveReject } = leaveStore;
|
||||||
|
|
||||||
|
const $q = useQuasar(); //ใช้ noti quasar
|
||||||
|
|
||||||
const querySting = reactive<QuerySting>({
|
const querySting = reactive<QuerySting>({
|
||||||
year: 0, //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.)
|
year: new Date().getFullYear(), //*ปีในการยื่นขอใบลา(ใช้เป็น คศ.)
|
||||||
type: "00000000-0000-0000-0000-000000000000", //*Id ประเภทการลา
|
type: "00000000-0000-0000-0000-000000000000", //*Id ประเภทการลา
|
||||||
status: "ALL", //*สถานะการของลา
|
status: "ALL", //*สถานะการของลา
|
||||||
page: 1, //*หน้า
|
page: 1, //*หน้า
|
||||||
|
|
@ -29,9 +37,23 @@ const querySting = reactive<QuerySting>({
|
||||||
const maxPage = ref<number>(1);
|
const maxPage = ref<number>(1);
|
||||||
|
|
||||||
//** เรียกข้อมูลจาก API*/
|
//** เรียกข้อมูลจาก API*/
|
||||||
function fecthLeaveList() {
|
async function fecthLeaveList() {
|
||||||
|
// showLoader();
|
||||||
|
// await http
|
||||||
|
// .post(config.API.leaveListDelete(), querySting)
|
||||||
|
// .then((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
|
||||||
|
// maxPage.value = Math.ceil(data.length / querySting.pageSize);
|
||||||
|
// })
|
||||||
|
// .catch((err) => {
|
||||||
|
// messageError($q, err);
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// hideLoader();
|
||||||
|
// });
|
||||||
const data = APIDATA.data;
|
const data = APIDATA.data;
|
||||||
maxPage.value = Math.ceil(data.length / querySting.pageSize);
|
|
||||||
fetchListLeaveReject(data); /** ส่งข้อมูลไป stores*/
|
fetchListLeaveReject(data); /** ส่งข้อมูลไป stores*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -41,7 +63,7 @@ function fecthLeaveList() {
|
||||||
* @param pageSize จำนวนต่อแถว
|
* @param pageSize จำนวนต่อแถว
|
||||||
* @param dateFilter ข้อมูลค้นหา
|
* @param dateFilter ข้อมูลค้นหา
|
||||||
*/
|
*/
|
||||||
function updatePaging(
|
async function updatePaging(
|
||||||
newPage: number,
|
newPage: number,
|
||||||
pageSize: number,
|
pageSize: number,
|
||||||
dateFilter: DateFilter
|
dateFilter: DateFilter
|
||||||
|
|
@ -54,6 +76,7 @@ function updatePaging(
|
||||||
querySting.keyword = dateFilter ? dateFilter.keyword : querySting.keyword;
|
querySting.keyword = dateFilter ? dateFilter.keyword : querySting.keyword;
|
||||||
|
|
||||||
console.log(querySting);
|
console.log(querySting);
|
||||||
|
await fecthLeaveList();
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
|
||||||
|
|
@ -163,8 +163,12 @@ function redirectToDetail(id: string) {
|
||||||
router.push(`${routePrefix}/detail/${id}`);
|
router.push(`${routePrefix}/detail/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updatedPagination(newPageZize: any) {
|
||||||
|
currentPage.value = 1;
|
||||||
|
pagination.value.rowsPerPage = newPageZize.rowsPerPage;
|
||||||
|
}
|
||||||
|
|
||||||
watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
|
watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
|
||||||
// updateProp(pagination.value, currentPage.value);
|
|
||||||
currentPage.value &&
|
currentPage.value &&
|
||||||
pagination.value.rowsPerPage &&
|
pagination.value.rowsPerPage &&
|
||||||
updateQuerySting(currentPage.value, pagination.value.rowsPerPage);
|
updateQuerySting(currentPage.value, pagination.value.rowsPerPage);
|
||||||
|
|
@ -172,7 +176,6 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
|
||||||
|
|
||||||
/** Hook*/
|
/** Hook*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log(leaveStore.tabMenu);
|
|
||||||
if (leaveStore.tabMenu === "1") {
|
if (leaveStore.tabMenu === "1") {
|
||||||
leaveStore.visibleColumns = visibleColumnsLeave.value;
|
leaveStore.visibleColumns = visibleColumnsLeave.value;
|
||||||
leaveStore.columns = columnsLeave.value;
|
leaveStore.columns = columnsLeave.value;
|
||||||
|
|
@ -194,8 +197,10 @@ onMounted(() => {
|
||||||
:paging="true"
|
:paging="true"
|
||||||
dense
|
dense
|
||||||
class="custom-header-table"
|
class="custom-header-table"
|
||||||
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
:visible-columns="leaveStore.visibleColumns"
|
:visible-columns="leaveStore.visibleColumns"
|
||||||
v-model:pagination="pagination"
|
:pagination="pagination"
|
||||||
|
@update:pagination="updatedPagination"
|
||||||
>
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
|
|
@ -213,7 +218,11 @@ onMounted(() => {
|
||||||
@click.prevent="redirectToDetail(props.row.id)"
|
@click.prevent="redirectToDetail(props.row.id)"
|
||||||
>
|
>
|
||||||
<div v-if="col.name == 'no'">
|
<div v-if="col.name == 'no'">
|
||||||
{{ props.rowIndex + 1 }}
|
{{
|
||||||
|
(currentPage - 1) * Number(pagination.rowsPerPage) +
|
||||||
|
props.rowIndex +
|
||||||
|
1
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
|
|
||||||
|
|
@ -47,20 +47,12 @@ function updateQuerySting(
|
||||||
|
|
||||||
/** function ค้นหาข้อมูลใน Table*/
|
/** function ค้นหาข้อมูลใน Table*/
|
||||||
async function filterListLeave() {
|
async function filterListLeave() {
|
||||||
console.log("test");
|
updateQuerySting(1, 0, filter);
|
||||||
|
|
||||||
// filter.status &&
|
|
||||||
// filter.type &&
|
|
||||||
// (await updateQuerySting(1, Number(props.rowsPerPage), filter));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Option*/
|
/** Option*/
|
||||||
const optionType = ref<DataOption[]>([
|
const optionTypeMain = ref<DataOption[]>([]);
|
||||||
{
|
const optionType = ref<DataOption[]>([]);
|
||||||
id: "00000000-0000-0000-0000-000000000000",
|
|
||||||
name: "ทั้งหมด",
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const optionStatus = ref<DataOption[]>([
|
const optionStatus = ref<DataOption[]>([
|
||||||
{
|
{
|
||||||
id: "ALL",
|
id: "ALL",
|
||||||
|
|
@ -93,29 +85,37 @@ const optionStatus2 = ref<DataOption[]>([
|
||||||
name: "ขอยกเลิก",
|
name: "ขอยกเลิก",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "PENDING ",
|
id: "APPROVE ",
|
||||||
name: "อนุมัติ",
|
name: "อนุมัติ",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "APPROVE ",
|
id: "REJECT ",
|
||||||
name: "ไม่อนุมัติ",
|
name: "ไม่อนุมัติ",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const optionTypeMain = ref<DataOption[]>(optionType.value);
|
|
||||||
const optionStatusMain = ref<DataOption[]>(
|
const optionStatusMain = ref<DataOption[]>(
|
||||||
leaveStore.tabMenu == "1" ? optionStatus.value : optionStatus2.value
|
leaveStore.tabMenu == "1" ? optionStatus.value : optionStatus2.value
|
||||||
);
|
);
|
||||||
|
|
||||||
async function fetchOption() {
|
async function fetchOption() {
|
||||||
console.log("loadOption รอ API");
|
await http
|
||||||
// await http
|
.get(config.API.leaveType())
|
||||||
// .get(config.API.leaveType())
|
.then((res) => {
|
||||||
// .then((res) => {
|
const data = res.data.result;
|
||||||
// console.log(res);
|
optionTypeMain.value = [
|
||||||
// })
|
{ id: "00000000-0000-0000-0000-000000000000", name: "ทั้งหมด" },
|
||||||
// .catch((err) => {
|
];
|
||||||
// console.log(err);
|
const option = data.map((e: DataOption) => ({
|
||||||
// });
|
id: e.id,
|
||||||
|
name: e.name,
|
||||||
|
}));
|
||||||
|
optionTypeMain.value.push(...option);
|
||||||
|
optionType.value = optionTypeMain.value;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -141,8 +141,6 @@ function filterOption(val: string, update: any, name: string) {
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fetchOption();
|
await fetchOption();
|
||||||
// optionTypeMain.value =
|
|
||||||
// leaveStore.tabMenu == "1" ? optionStatus.value : optionStatus2.value;
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -182,19 +180,6 @@ onMounted(async () => {
|
||||||
</q-input>
|
</q-input>
|
||||||
</template>
|
</template>
|
||||||
</datepicker>
|
</datepicker>
|
||||||
<!-- <q-select
|
|
||||||
for="selectYear"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
outlined
|
|
||||||
dense
|
|
||||||
v-model="filter.year"
|
|
||||||
:options="optionStatus"
|
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
label="ปีงบประมาณ"
|
|
||||||
@update:model-value="filterListLeave"
|
|
||||||
/> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-12 col-sm-3 col-md-2">
|
<div class="col-xs-12 col-sm-3 col-md-2">
|
||||||
<q-select
|
<q-select
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,7 @@ const approveData = async () => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
|
SpecialTimeStore.fetchData();
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,9 @@ interface ListData {
|
||||||
checkOut: string;
|
checkOut: string;
|
||||||
checkIn: string;
|
checkIn: string;
|
||||||
}
|
}
|
||||||
export type { ListData };
|
|
||||||
|
interface DataDateMonthObject {
|
||||||
|
month: number;
|
||||||
|
year: number;
|
||||||
|
}
|
||||||
|
export type { ListData, DataDateMonthObject };
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,14 @@ import { defineStore } from "pinia";
|
||||||
import { ref, watch, defineEmits } from "vue";
|
import { ref, watch, defineEmits } from "vue";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import type { DataRows } from "@/modules/09_leave/interface/response/specialTime";
|
import type { DataRows } from "@/modules/09_leave/interface/response/specialTime";
|
||||||
import type { ListData } from "@/modules/09_leave/interface/request/specialTime";
|
import type { DataDateMonthObject } from "@/modules/09_leave/interface/request/specialTime";
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import type { DataOption } from "@/modules/09_leave/interface/index/Main";
|
import type { DataOption } from "@/modules/09_leave/interface/index/Main";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import { mount } from "@vue/test-utils";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
|
@ -45,32 +47,6 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
|
||||||
const pageSize = ref<number>(10);
|
const pageSize = ref<number>(10);
|
||||||
const filter = ref<string>(""); //search data table
|
const filter = ref<string>(""); //search data table
|
||||||
const maxPage = ref<number>(0);
|
const maxPage = ref<number>(0);
|
||||||
// Pagination - update rowsPerPage
|
|
||||||
// async function updatePagination(newPagination: any) {
|
|
||||||
// initialPagination.value = newPagination;
|
|
||||||
// // currentPage.value = 1;
|
|
||||||
// console.log("updatePagination");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Pagination - initial pagination
|
|
||||||
const initialPagination = ref<any>({
|
|
||||||
sortBy: null,
|
|
||||||
descending: false,
|
|
||||||
page: 1,
|
|
||||||
// rowsPerPage: pageSize,
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ฟังก์ชั่น api เปลี่ยนหน้า
|
|
||||||
* @param pageVal page
|
|
||||||
* @param pageSizeVal pagesize
|
|
||||||
*/
|
|
||||||
async function changePage(pageVal: number, pageSizeVal: number) {
|
|
||||||
page.value = await pageVal;
|
|
||||||
pageSize.value = await pageSizeVal;
|
|
||||||
console.log("changePage");
|
|
||||||
fetchData();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ฟังชั้นเรียกดูข้อมูล
|
* ฟังชั้นเรียกดูข้อมูล
|
||||||
|
|
@ -126,6 +102,19 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ฟังก์ชั่น api เปลี่ยนหน้า
|
||||||
|
* @param pageVal page
|
||||||
|
* @param pageSizeVal pagesize
|
||||||
|
*/
|
||||||
|
async function changePage(pageVal: number, pageSizeVal: number) {
|
||||||
|
page.value = await pageVal;
|
||||||
|
pageSize.value = await pageSizeVal;
|
||||||
|
console.log(pageSize.value);
|
||||||
|
|
||||||
|
fetchData();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------|ฟิลเตอร์|--------------------------------------//
|
//--------------|ฟิลเตอร์|--------------------------------------//
|
||||||
const searchFilterTable = async (searchDate: any) => {
|
const searchFilterTable = async (searchDate: any) => {
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
|
|
@ -268,5 +257,7 @@ export const useSpecialTimeStore = defineStore("LeaveSpecialTime", () => {
|
||||||
page,
|
page,
|
||||||
pageSize,
|
pageSize,
|
||||||
month,
|
month,
|
||||||
|
filter,
|
||||||
|
// changeMonth,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import DialogReason from "@/components/Dialogs/PopupReason.vue";
|
||||||
import DialogApprove from "@/modules/09_leave/components/4_specialTime/DialogApprove.vue";
|
import DialogApprove from "@/modules/09_leave/components/4_specialTime/DialogApprove.vue";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
import type { DataDateMonthObject } from "@/modules/09_leave/interface/request/specialTime";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { identity } from "@fullcalendar/core/internal";
|
import { identity } from "@fullcalendar/core/internal";
|
||||||
|
|
||||||
|
|
@ -28,6 +28,7 @@ const name = ref<string>("");
|
||||||
const id = ref<string>("");
|
const id = ref<string>("");
|
||||||
const dateDialog = ref<string>("");
|
const dateDialog = ref<string>("");
|
||||||
const dateFixDialog = ref<string>("");
|
const dateFixDialog = ref<string>("");
|
||||||
|
const dateYear = ref<number>(new Date().getFullYear());
|
||||||
|
|
||||||
/**ฟังก์ชั่นไม่อนุมัติ */
|
/**ฟังก์ชั่นไม่อนุมัติ */
|
||||||
const unapprove = async (fullname: string, personId: string) => {
|
const unapprove = async (fullname: string, personId: string) => {
|
||||||
|
|
@ -35,6 +36,7 @@ const unapprove = async (fullname: string, personId: string) => {
|
||||||
dialogTitle.value = " ไม่อนุมัติการลงเวลาพิเศษของ" + fullname;
|
dialogTitle.value = " ไม่อนุมัติการลงเวลาพิเศษของ" + fullname;
|
||||||
name.value = fullname;
|
name.value = fullname;
|
||||||
modalUnapprove.value = true;
|
modalUnapprove.value = true;
|
||||||
|
|
||||||
// rejectData();
|
// rejectData();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -79,35 +81,20 @@ const clickSave = async (reason: string) => {
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(async () => {});
|
.finally(async () => {
|
||||||
|
dataSpecialTime.fetchData();
|
||||||
|
});
|
||||||
|
|
||||||
console.log(reason);
|
console.log(reason);
|
||||||
};
|
};
|
||||||
|
|
||||||
// ค้นหาในตาราง
|
|
||||||
const filterKeyword = ref<string>("");
|
|
||||||
const filterRef = ref<HTMLInputElement | null>(null);
|
|
||||||
const resetFilter = () => {
|
|
||||||
filterKeyword.value = "";
|
|
||||||
if (filterRef.value) {
|
|
||||||
filterRef.value.focus();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// paging
|
// paging
|
||||||
const page = ref<number>(1);
|
|
||||||
const pageSize = ref<number>(10);
|
const pageSize = ref<number>(10);
|
||||||
const filter = ref<string>(""); //search data table
|
|
||||||
/**
|
/**
|
||||||
* ฟังก์ชั่น api เปลี่ยนหน้า
|
* ฟังก์ชั่น api เปลี่ยนหน้า
|
||||||
* @param pageVal page
|
* @param pageVal page
|
||||||
* @param pageSizeVal pagesize
|
* @param pageSizeVal pagesize
|
||||||
*/
|
*/
|
||||||
async function changePage(pageVal: number, pageSizeVal: number) {
|
|
||||||
// page.value = await pageVal;
|
|
||||||
// pageSize.value = await pageSizeVal;
|
|
||||||
// dataSpecialTime.fetchData();
|
|
||||||
console.log("test");
|
|
||||||
}
|
|
||||||
// Pagination - initial pagination
|
// Pagination - initial pagination
|
||||||
const initialPagination = ref<any>({
|
const initialPagination = ref<any>({
|
||||||
sortBy: null,
|
sortBy: null,
|
||||||
|
|
@ -123,21 +110,36 @@ watch(
|
||||||
async () => {
|
async () => {
|
||||||
dataSpecialTime.page = currentPage.value;
|
dataSpecialTime.page = currentPage.value;
|
||||||
await dataSpecialTime.fetchData();
|
await dataSpecialTime.fetchData();
|
||||||
// emit(
|
|
||||||
// "update:change-page",
|
|
||||||
// currentPage.value,
|
|
||||||
// initialPagination.value.rowsPerPage,
|
|
||||||
// true
|
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
// Pagination - update rowsPerPage
|
// Pagination - update rowsPerPage
|
||||||
async function updatePagination(newPagination: any) {
|
async function updatePagination(initialPagination: any) {
|
||||||
currentPage.value = 1;
|
currentPage.value = 1;
|
||||||
dataSpecialTime.pageSize = initialPagination.value.rowsPerPage;
|
dataSpecialTime.pageSize = initialPagination.rowsPerPage;
|
||||||
dataSpecialTime.page = 1; // set current page เป็น 1 เสมอเมื่อเปลี่ยน per row
|
dataSpecialTime.page = 1; // set current page เป็น 1 เสมอเมื่อเปลี่ยน per row
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ค้นหาในตาราง
|
||||||
|
const filterKeyword = ref<string>("");
|
||||||
|
const filterRef = ref<HTMLInputElement | null>(null);
|
||||||
|
const resetFilter = () => {
|
||||||
|
filterKeyword.value = "";
|
||||||
|
dataSpecialTime.filter = filterKeyword.value;
|
||||||
|
dataSpecialTime.fetchData();
|
||||||
|
if (filterRef.value) {
|
||||||
|
filterRef.value.focus();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
/** function ค้นหาข้อมูลแล้วอัปเดท*/
|
||||||
|
function filterFn() {
|
||||||
|
updatePagination(filterKeyword.value);
|
||||||
|
console.log(filterKeyword.value);
|
||||||
|
dataSpecialTime.filter = filterKeyword.value;
|
||||||
|
dataSpecialTime.pageSize = pageSize.value;
|
||||||
|
dataSpecialTime.fetchData();
|
||||||
|
}
|
||||||
|
|
||||||
/**Hook */
|
/**Hook */
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
console.log("test");
|
console.log("test");
|
||||||
|
|
@ -145,11 +147,23 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
/** Function Date */
|
/** Function Date */
|
||||||
const selectedDate = ref<string>("");
|
|
||||||
const dateMonth = ref<any>({
|
const dateMonth = ref<any>({
|
||||||
month: new Date().getMonth(),
|
month: new Date().getMonth(),
|
||||||
year: new Date().getFullYear(),
|
year: new Date().getFullYear(),
|
||||||
});
|
});
|
||||||
|
const updateMonth = async (e: DataDateMonthObject) => {
|
||||||
|
// console.log(dateMonth.value);
|
||||||
|
if (e != null) {
|
||||||
|
dateYear.value = e.year;
|
||||||
|
dateYear.value = dataSpecialTime.year;
|
||||||
|
dataSpecialTime.month = dateMonth.value.month + 1;
|
||||||
|
dataSpecialTime.year = dateMonth.value.year;
|
||||||
|
// filterKeyword.value = "";
|
||||||
|
}
|
||||||
|
await dataSpecialTime.fetchData();
|
||||||
|
};
|
||||||
|
|
||||||
|
//แปลงเดือนเป็นไทย
|
||||||
const monthYearThai = (val: any) => {
|
const monthYearThai = (val: any) => {
|
||||||
if (val == null) return "";
|
if (val == null) return "";
|
||||||
else return monthYear2Thai(val.month, val.year);
|
else return monthYear2Thai(val.month, val.year);
|
||||||
|
|
@ -164,11 +178,12 @@ const monthYearThai = (val: any) => {
|
||||||
<div class="row col-12 q-col-gutter-sm q-mb-sm">
|
<div class="row col-12 q-col-gutter-sm q-mb-sm">
|
||||||
<div class="q-gutter-sm">
|
<div class="q-gutter-sm">
|
||||||
<datepicker
|
<datepicker
|
||||||
v-model="selectedDate"
|
v-model="dateMonth"
|
||||||
:locale="'th'"
|
:locale="'th'"
|
||||||
autoApply
|
autoApply
|
||||||
month-picker
|
month-picker
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
|
@update:modelValue="updateMonth"
|
||||||
>
|
>
|
||||||
<template #year="{ year }">{{ year + 543 }}</template>
|
<template #year="{ year }">{{ year + 543 }}</template>
|
||||||
<template #year-overlay-value="{ value }">{{
|
<template #year-overlay-value="{ value }">{{
|
||||||
|
|
@ -205,7 +220,8 @@ const monthYearThai = (val: any) => {
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
debounce="300"
|
debounce="300"
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหาชื่อ-นามสกุล"
|
||||||
|
@keydown.enter.prevent="filterFn"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||||
|
|
@ -246,7 +262,7 @@ const monthYearThai = (val: any) => {
|
||||||
:paging="false"
|
:paging="false"
|
||||||
dense
|
dense
|
||||||
:visible-columns="dataSpecialTime.visibleColumns"
|
:visible-columns="dataSpecialTime.visibleColumns"
|
||||||
:rows-per-page-options="[5, 10, 25, 50, 100]"
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
v-model:pagination="initialPagination"
|
v-model:pagination="initialPagination"
|
||||||
@update:pagination="updatePagination"
|
@update:pagination="updatePagination"
|
||||||
>
|
>
|
||||||
|
|
@ -275,7 +291,11 @@ const monthYearThai = (val: any) => {
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<div v-if="col.name == 'no'">
|
<div v-if="col.name == 'no'">
|
||||||
{{ props.rowIndex + 1 }}
|
{{
|
||||||
|
(dataSpecialTime.page - 1) * dataSpecialTime.pageSize +
|
||||||
|
props.rowIndex +
|
||||||
|
1
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
{{ col.value }}
|
{{ col.value }}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, watchEffect } from "vue";
|
import { ref, computed, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
|
|
@ -10,7 +10,7 @@ import config from "@/app.config";
|
||||||
|
|
||||||
/** use */
|
/** use */
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const selected = ref<ResponseItems[]>([]);
|
const selected = ref<any>([]);
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
|
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
|
||||||
|
|
||||||
|
|
@ -26,11 +26,11 @@ const columns2 = ref<QTableProps["columns"]>([
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "fullname",
|
name: "name",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ชื่อ-นามสกุล",
|
label: "ชื่อ-นามสกุล",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "fullname",
|
field: "name",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
|
@ -53,20 +53,20 @@ const columns2 = ref<QTableProps["columns"]>([
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "organizationPositionOld",
|
name: "organization",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "สังกัด",
|
label: "สังกัด",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "organizationPositionOld",
|
field: "organization",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "statustext",
|
name: "status",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "สถานะ",
|
label: "สถานะ",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "statustext",
|
field: "status",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
|
@ -75,12 +75,12 @@ const columns2 = ref<QTableProps["columns"]>([
|
||||||
/** คอลัมน์ที่แสดง */
|
/** คอลัมน์ที่แสดง */
|
||||||
const visibleColumns2 = ref<string[]>([
|
const visibleColumns2 = ref<string[]>([
|
||||||
"no",
|
"no",
|
||||||
"fullname",
|
"name",
|
||||||
"position",
|
"position",
|
||||||
"positionLevel",
|
"positionLevel",
|
||||||
"positionNumberOld",
|
"posNo",
|
||||||
"organizationPositionOld",
|
"organization",
|
||||||
"statustext",
|
"status",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** props*/
|
/** props*/
|
||||||
|
|
@ -104,36 +104,19 @@ const checkSelected = computed(() => {
|
||||||
//popup ยืนยันส่งัว
|
//popup ยืนยันส่งัว
|
||||||
const saveOrder = () => {
|
const saveOrder = () => {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
() => Ordersave(),
|
async () => {
|
||||||
"ยืนยันส่งไปออกคำสั่ง",
|
success($q, `ส่งข้อมูลไปออกคำสั่งสำเร็จ`);
|
||||||
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
|
emit("returnPerson", selected.value);
|
||||||
);
|
props.closeModal?.();
|
||||||
|
},
|
||||||
|
`ยืนยันการส่งไปออกคำสั่ง`,
|
||||||
|
`ต้องการยืนยันการส่งไปออกคำสั่งหรือไม่`
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
//ส่งไปออกคำสั่ง
|
|
||||||
const Ordersave = async () => {
|
|
||||||
const id = selected.value.map((r) => r.id);
|
|
||||||
const body = {
|
|
||||||
id,
|
|
||||||
};
|
|
||||||
showLoader();
|
|
||||||
await http
|
|
||||||
.post(config.API.outReport, body)
|
|
||||||
.then((res: any) => {
|
|
||||||
success($q, "ส่งไปออกคำสั่งสำเร็จ");
|
|
||||||
props.closeModal?.();
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(async () => {
|
|
||||||
props.getData?.();
|
|
||||||
hideLoader();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
|
const emit = defineEmits(["update:filterKeyword2", "update:selected",'returnPerson']);
|
||||||
const updateInput = (value: any) => {
|
const updateInput = (value: any) => {
|
||||||
emit("update:filterKeyword2", value);
|
emit("update:filterKeyword2", value);
|
||||||
};
|
};
|
||||||
|
|
@ -142,9 +125,10 @@ const updateInput = (value: any) => {
|
||||||
const Reset = () => {
|
const Reset = () => {
|
||||||
emit("update:filterKeyword2", "");
|
emit("update:filterKeyword2", "");
|
||||||
};
|
};
|
||||||
watchEffect(() => {
|
watch([()=>props.modal],() => {
|
||||||
|
selected.value = props.modal ? [] : [];
|
||||||
if (props.modal === true) {
|
if (props.modal === true) {
|
||||||
selected.value = [];
|
selected.value = props.rows2;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -205,15 +189,26 @@ watchEffect(() => {
|
||||||
selection="multiple"
|
selection="multiple"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
>
|
>
|
||||||
<template v-slot:header-selection="scope">
|
<template v-slot:header="props">
|
||||||
<q-checkbox
|
<q-tr :props="props">
|
||||||
keep-color
|
<q-th auto-width>
|
||||||
color="primary"
|
<!-- <q-checkbox
|
||||||
dense
|
keep-color
|
||||||
v-model="scope.selected"
|
color="primary"
|
||||||
/>
|
dense
|
||||||
|
v-model="props.selected"
|
||||||
|
/> -->
|
||||||
|
</q-th>
|
||||||
|
<q-th
|
||||||
|
v-for="col in props.cols"
|
||||||
|
:key="col.name"
|
||||||
|
:props="props"
|
||||||
|
style="color: #000000; font-weight: 500"
|
||||||
|
>
|
||||||
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
|
</q-th>
|
||||||
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td>
|
<q-td>
|
||||||
|
|
@ -224,31 +219,14 @@ watchEffect(() => {
|
||||||
v-model="props.selected"
|
v-model="props.selected"
|
||||||
/>
|
/>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="no" :props="props">
|
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
{{ props.rowIndex + 1 }}
|
<div v-if="col.name == 'no'">
|
||||||
</q-td>
|
{{ props.rowIndex + 1 }}
|
||||||
<q-td key="fullname" :props="props">
|
|
||||||
{{ props.row.fullname }}
|
|
||||||
</q-td>
|
|
||||||
<q-td key="position" :props="props">
|
|
||||||
{{ props.row.position }}
|
|
||||||
</q-td>
|
|
||||||
<q-td key="positionLevel" :props="props">
|
|
||||||
{{ props.row.positionLevel }}
|
|
||||||
</q-td>
|
|
||||||
<q-td key="organizationPositionOld" :props="props">
|
|
||||||
<div class="table_ellipsis">
|
|
||||||
{{ props.row.organizationPositionOld }}
|
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
<div>
|
||||||
<q-td key="organization" :props="props">
|
{{ col.value }}
|
||||||
<div class="table_ellipsis">
|
|
||||||
{{ props.row.organization }}
|
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td key="statustext" :props="props">
|
|
||||||
{{ props.row.statustext }}
|
|
||||||
</q-td>
|
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
</d-table>
|
</d-table>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted, watch } from "vue";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
@ -8,9 +8,12 @@ import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import DialogSendToCommand from "@/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue";
|
import DialogSendToCommand from "@/modules/11_discipline/components/7_ListSuspend/DialogSendToCommand.vue";
|
||||||
|
import type { dataType } from '@/modules/11_discipline/interface/response/suspend'
|
||||||
import type { ResponseData } from "@/modules/06_retirement/interface/response/out";
|
import type { ResponseData } from "@/modules/06_retirement/interface/response/out";
|
||||||
|
import { useDisciplineSuspendStore } from "@/modules/11_discipline/store/SuspendStore";
|
||||||
|
|
||||||
/** use */
|
/** use */
|
||||||
|
const dataStore = useDisciplineSuspendStore();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
|
@ -29,12 +32,12 @@ const modal = ref<boolean>(false);
|
||||||
/** คอลัมน์ที่แสดง */
|
/** คอลัมน์ที่แสดง */
|
||||||
const visibleColumns = ref<string[]>([
|
const visibleColumns = ref<string[]>([
|
||||||
"no",
|
"no",
|
||||||
"fullname",
|
"name",
|
||||||
"position",
|
"position",
|
||||||
"positionLevel",
|
"positionLevel",
|
||||||
"organizationPositionOld",
|
"organization",
|
||||||
"createdAt",
|
"dateTotal",
|
||||||
"statustext",
|
"status",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||||
|
|
@ -43,9 +46,7 @@ const filterKeyword2 = ref<string>("");
|
||||||
const filterRef = ref<any>(null);
|
const filterRef = ref<any>(null);
|
||||||
|
|
||||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||||
const rows = ref<ResponseData[]>([]);
|
const rows2 = ref<dataType[]>([]);
|
||||||
const rows2 = ref<ResponseData[]>([]);
|
|
||||||
const filters = ref<ResponseData[]>([]);
|
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "no",
|
name: "no",
|
||||||
|
|
@ -57,11 +58,11 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "fullname",
|
name: "name",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ชื่อ-นามสกุล",
|
label: "ชื่อ-นามสกุล",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "fullname",
|
field: "name",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
|
@ -84,123 +85,49 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "organizationPositionOld",
|
name: "organization",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "สังกัด",
|
label: "สังกัด",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "organizationPositionOld",
|
field: "organization",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "createdAt",
|
name: "dateTotal",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "วันที่ดำเนินการ",
|
label: "วันที่ดำเนินการ",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "createdAt",
|
field: "dateTotal",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "statustext",
|
name: "status",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "สถานะ",
|
label: "สถานะ",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "statustext",
|
field: "status",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getData();
|
await getList();
|
||||||
});
|
});
|
||||||
|
|
||||||
const openModalOrder = () => {
|
function openModalOrder(){
|
||||||
openModal();
|
openModal();
|
||||||
const row = filters.value.filter(
|
const dataMap = dataStore.rows.filter((r: dataType) =>
|
||||||
(r: ResponseData) =>
|
r.statusEn == "PENDING" &&
|
||||||
(r.status == "WAITTING" ||
|
r.name &&
|
||||||
r.status == "PENDING" ||
|
|
||||||
r.status == "APPROVE") &&
|
|
||||||
r.organizationPositionOld &&
|
|
||||||
r.positionTypeOld &&
|
|
||||||
r.positionLevelOld &&
|
|
||||||
r.positionNumberOld &&
|
|
||||||
r.salary &&
|
|
||||||
r.organization &&
|
r.organization &&
|
||||||
r.date
|
r.position &&
|
||||||
);
|
r.positionLevel &&
|
||||||
rows2.value = row;
|
r.posNo &&
|
||||||
};
|
r.organization
|
||||||
|
)
|
||||||
//นำข้อมูลมาแสดง
|
rows2.value = dataMap;
|
||||||
const getData = async () => {
|
|
||||||
showLoader();
|
|
||||||
await http
|
|
||||||
.get(config.API.retirementOut)
|
|
||||||
.then((res: any) => {
|
|
||||||
const data = res.data.result;
|
|
||||||
let list: ResponseData[] = [];
|
|
||||||
data.map((r: ResponseData) => {
|
|
||||||
list.push({
|
|
||||||
createdAt: date2Thai(r.createdAt),
|
|
||||||
date: r.date,
|
|
||||||
firstName: r.firstName ?? "",
|
|
||||||
id: r.id ?? "",
|
|
||||||
isActive: r.isActive ? r.isActive : false,
|
|
||||||
lastName: r.lastName ?? "",
|
|
||||||
organization: r.organization ?? "",
|
|
||||||
organizationPositionOld: r.organizationPositionOld ?? "",
|
|
||||||
posNo: r.posNo ?? "",
|
|
||||||
position: r.position ?? "",
|
|
||||||
positionLevel: r.positionLevel ?? "",
|
|
||||||
positionLevelOld: r.positionLevelOld ?? "",
|
|
||||||
positionNumberOld: r.positionNumberOld ?? "",
|
|
||||||
positionTypeOld: r.positionTypeOld ?? "",
|
|
||||||
prefix: r.prefix ?? "",
|
|
||||||
reason: r.reason ?? "",
|
|
||||||
salary: r.salary ? r.salary : 0,
|
|
||||||
status: r.status ?? "",
|
|
||||||
statustext: statusText(r.status ?? ""),
|
|
||||||
fullname: `${r.prefix ?? ""}${r.firstName ?? ""} ${r.lastName ?? ""}`,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
rows.value = list;
|
|
||||||
filters.value = list;
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const clickDelete = async (id: string) => {
|
|
||||||
dialogMessage(
|
|
||||||
$q,
|
|
||||||
`ลบข้อมูล`,
|
|
||||||
`ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`,
|
|
||||||
"delete",
|
|
||||||
"ยืนยัน",
|
|
||||||
"red",
|
|
||||||
async () => await deleteData(id),
|
|
||||||
async () => await getData()
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const deleteData = async (id: string) => {
|
|
||||||
await http
|
|
||||||
.delete(config.API.outByid(id))
|
|
||||||
.then((res) => {
|
|
||||||
success($q, "ลบข้อมูลสำเร็จ");
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
messageError($q, e);
|
|
||||||
})
|
|
||||||
.finally(async () => {
|
|
||||||
await getData();
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const openModal = () => (modal.value = true);
|
const openModal = () => (modal.value = true);
|
||||||
|
|
@ -211,15 +138,90 @@ const resetFilter = () => {
|
||||||
filterKeyword2.value = "";
|
filterKeyword2.value = "";
|
||||||
filterRef.value.focus();
|
filterRef.value.focus();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const currentPage = ref<number>(1);
|
||||||
|
const maxPage = ref<number>(1);
|
||||||
|
const page = ref<number>(1);
|
||||||
|
const rowsPerPage = ref<number>(10);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*pagination ของตาราง
|
||||||
|
*/
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
sortBy: "createdAt",
|
descending: false,
|
||||||
descending: true,
|
page: page.value,
|
||||||
page: 1,
|
rowsPerPage: rowsPerPage.value,
|
||||||
rowsPerPage: 10,
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => currentPage.value,
|
||||||
|
() => {
|
||||||
|
rowsPerPage.value = pagination.value.rowsPerPage;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => pagination.value.rowsPerPage,
|
||||||
|
() => {
|
||||||
|
rowsPerPage.value = pagination.value.rowsPerPage;
|
||||||
|
currentPage.value = 1;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
/** ดึงข้อมูลหน้าหลัก */
|
||||||
|
async function getList() {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(
|
||||||
|
config.API.suspendMain(
|
||||||
|
currentPage.value,
|
||||||
|
rowsPerPage.value,
|
||||||
|
filterKeyword.value
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.then((res) => {
|
||||||
|
maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
|
||||||
|
const data = res.data.result.data;
|
||||||
|
dataStore.getData(data);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function onSubmit(data:dataType[]){
|
||||||
|
console.log(data)
|
||||||
|
const dataMapId = data.map((item: dataType) => item.id);
|
||||||
|
showLoader();
|
||||||
|
http
|
||||||
|
.post(config.API.suspendReport(), {
|
||||||
|
id: dataMapId,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
getList()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
dataStore.columns = columns.value;
|
||||||
|
dataStore.visibleColumns = visibleColumns.value;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div class="toptitle text-dark col-12 row items-center">รายชื่อผู้ถูกพักราชการ</div>
|
<div class="toptitle text-dark col-12 row items-center">
|
||||||
|
รายชื่อผู้ถูกพักราชการ
|
||||||
|
</div>
|
||||||
<q-card flat bordered class="col-12 q-mt-sm">
|
<q-card flat bordered class="col-12 q-mt-sm">
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<div class="row q-pa-md">
|
<div class="row q-pa-md">
|
||||||
|
|
@ -259,7 +261,7 @@ const pagination = ref({
|
||||||
</q-input>
|
</q-input>
|
||||||
|
|
||||||
<q-select
|
<q-select
|
||||||
v-model="visibleColumns"
|
v-model="dataStore.visibleColumns"
|
||||||
multiple
|
multiple
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
|
|
@ -277,91 +279,53 @@ const pagination = ref({
|
||||||
|
|
||||||
<div class="col-12 q-pt-sm">
|
<div class="col-12 q-pt-sm">
|
||||||
<d-table
|
<d-table
|
||||||
:columns="columns"
|
:columns="dataStore.columns"
|
||||||
:rows="rows"
|
:rows="dataStore.rows"
|
||||||
:filter="filterKeyword"
|
:filter="filterKeyword"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="dataStore.visibleColumns"
|
||||||
v-model:pagination="pagination"
|
v-model:pagination="pagination"
|
||||||
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
>
|
>
|
||||||
|
<template v-slot:pagination="scope">
|
||||||
|
<q-pagination
|
||||||
|
v-model="currentPage"
|
||||||
|
active-color="primary"
|
||||||
|
color="dark"
|
||||||
|
:max="Number(maxPage)"
|
||||||
|
size="sm"
|
||||||
|
boundary-links
|
||||||
|
direction-links
|
||||||
|
></q-pagination>
|
||||||
|
</template>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
<span class="text-weight-medium">{{ col.label }}</span>
|
<span class="text-weight-medium">{{ col.label }}</span>
|
||||||
</q-th>
|
</q-th>
|
||||||
<q-th auto-width />
|
<!-- <q-th auto-width /> -->
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td
|
<q-td
|
||||||
key="no"
|
v-for="col in props.cols"
|
||||||
|
:key="col.name"
|
||||||
:props="props"
|
:props="props"
|
||||||
@click="router.push(`/retirement/out/${props.row.id}`)"
|
@click="router.push(`/discipline-suspend/${props.row.id}`)"
|
||||||
>
|
>
|
||||||
{{ props.rowIndex + 1 }}
|
<div v-if="col.name === 'no'">
|
||||||
</q-td>
|
{{ props.rowIndex + 1 }}
|
||||||
<q-td
|
|
||||||
key="fullname"
|
|
||||||
:props="props"
|
|
||||||
@click="router.push(`/retirement/out/${props.row.id}`)"
|
|
||||||
>
|
|
||||||
{{ props.row.fullname }}
|
|
||||||
</q-td>
|
|
||||||
<q-td
|
|
||||||
key="position"
|
|
||||||
:props="props"
|
|
||||||
@click="router.push(`/retirement/out/${props.row.id}`)"
|
|
||||||
>
|
|
||||||
{{ props.row.position }}
|
|
||||||
</q-td>
|
|
||||||
<q-td
|
|
||||||
key="positionLevel"
|
|
||||||
:props="props"
|
|
||||||
@click="router.push(`/retirement/out/${props.row.id}`)"
|
|
||||||
>
|
|
||||||
{{ props.row.positionLevel }}
|
|
||||||
</q-td>
|
|
||||||
<q-td
|
|
||||||
key="organizationPositionOld"
|
|
||||||
:props="props"
|
|
||||||
@click="router.push(`/retirement/out/${props.row.id}`)"
|
|
||||||
>
|
|
||||||
<div class="table_ellipsis">
|
|
||||||
{{ props.row.organizationPositionOld }}
|
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
<div
|
||||||
<q-td
|
v-else-if="col.name === 'organization'"
|
||||||
key="organization"
|
class="table_ellipsis"
|
||||||
:props="props"
|
>
|
||||||
@click="router.push(`/retirement/out/${props.row.id}`)"
|
|
||||||
>
|
|
||||||
<div class="table_ellipsis">
|
|
||||||
{{ props.row.organization }}
|
{{ props.row.organization }}
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
<div v-else>
|
||||||
<q-td key="createdAt" :props="props">
|
{{ col.value }}
|
||||||
{{ props.row.createdAt }}
|
</div>
|
||||||
</q-td>
|
|
||||||
<q-td key="statustext" :props="props">
|
|
||||||
{{ props.row.statustext }}
|
|
||||||
</q-td>
|
|
||||||
<q-td auto-width>
|
|
||||||
<q-btn
|
|
||||||
v-if="
|
|
||||||
props.row.status !== 'DONE' &&
|
|
||||||
props.row.status !== 'REPORT'
|
|
||||||
"
|
|
||||||
dense
|
|
||||||
size="12px"
|
|
||||||
flat
|
|
||||||
round
|
|
||||||
color="red"
|
|
||||||
@click="clickDelete(props.row.id)"
|
|
||||||
icon="mdi-delete"
|
|
||||||
>
|
|
||||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
|
||||||
</q-btn>
|
|
||||||
</q-td>
|
</q-td>
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -376,7 +340,7 @@ const pagination = ref({
|
||||||
:closeModal="closeModal"
|
:closeModal="closeModal"
|
||||||
:rows2="rows2"
|
:rows2="rows2"
|
||||||
v-model:filterKeyword2="filterKeyword2"
|
v-model:filterKeyword2="filterKeyword2"
|
||||||
:fecthlistRecevice="getData"
|
@returnPerson="onSubmit"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<style scoped lang="scss"></style>
|
<style scoped lang="scss"></style>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from "vue";
|
import { onMounted, ref, reactive } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
@ -7,12 +7,14 @@ import CurrencyInput from "@/components/CurruncyInput.vue";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import keycloak from "@/plugins/keycloak";
|
import keycloak from "@/plugins/keycloak";
|
||||||
|
import { useDisciplineSuspendStore } from "@/modules/11_discipline/store/SuspendStore";
|
||||||
|
|
||||||
/**Import type */
|
/**Import type */
|
||||||
import type { QForm } from "quasar";
|
import type { QForm } from "quasar";
|
||||||
import type { ResponseDataDetail } from "@/modules/06_retirement/interface/response/expulsion";
|
import type { dataDetail } from "@/modules/11_discipline/interface/response/suspend";
|
||||||
|
|
||||||
/** use */
|
/** use */
|
||||||
|
const dataStore = useDisciplineSuspendStore();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
@ -37,25 +39,31 @@ const organizationPositionOld = ref<string>("");
|
||||||
const positionTypeOld = ref<string>("");
|
const positionTypeOld = ref<string>("");
|
||||||
const positionLevelOld = ref<string>("");
|
const positionLevelOld = ref<string>("");
|
||||||
const posNo = ref<string>("");
|
const posNo = ref<string>("");
|
||||||
const salary = ref<number>(0);
|
|
||||||
const organization = ref<string>("");
|
const organization = ref<string>("");
|
||||||
const date = ref<Date | null>(null);
|
const date = ref<Date | null>(null);
|
||||||
const reason = ref<string>("");
|
const reason = ref<string>("");
|
||||||
const responseData = ref<ResponseDataDetail>({
|
|
||||||
personId: "",
|
const data = reactive<dataDetail>({
|
||||||
avataPath: "",
|
|
||||||
createdAt: new Date(),
|
|
||||||
date: new Date(),
|
|
||||||
id: "",
|
id: "",
|
||||||
|
citizenId: "",
|
||||||
|
avataPath: "",
|
||||||
|
name: "",
|
||||||
|
prefix: "",
|
||||||
|
firstName: "",
|
||||||
|
lastName: "",
|
||||||
organization: "",
|
organization: "",
|
||||||
organizationPositionOld: "",
|
position: "",
|
||||||
positionLevelOld: "",
|
posNo: "",
|
||||||
positionNumberOld: "",
|
positionLevel: "",
|
||||||
positionTypeOld: "",
|
|
||||||
reason: "",
|
|
||||||
salary: 0,
|
salary: 0,
|
||||||
status: "",
|
status: "",
|
||||||
fullname: "",
|
descriptionSuspend: "",
|
||||||
|
startDateSuspend: null,
|
||||||
|
endDateSuspend: null,
|
||||||
|
title: "",
|
||||||
|
offenseDetails: "",
|
||||||
|
disciplinaryFaultLevel: "",
|
||||||
|
disciplinaryCaseFault: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
/** Hook */
|
/** Hook */
|
||||||
|
|
@ -70,36 +78,31 @@ onMounted(async () => {
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.outByid(dataId))
|
.get(config.API.suspendById(dataId))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
console.log(res.data.result);
|
||||||
responseData.value.personId = data.profileId;
|
const dataGet = res.data.result;
|
||||||
responseData.value.createdAt = data.createdAt;
|
data.id = dataGet.id;
|
||||||
responseData.value.date =
|
data.citizenId = dataGet.citizenId;
|
||||||
data.date !== null ? new Date(data.date) : new Date();
|
data.name = `${dataGet.prefix}${dataGet.firstName} ${dataGet.lastName}`;
|
||||||
responseData.value.id = data.id ?? "";
|
data.prefix = dataGet.prefix;
|
||||||
responseData.value.organization = data.organization ?? "";
|
data.firstName = dataGet.firstName;
|
||||||
responseData.value.organizationPositionOld =
|
data.lastName = dataGet.lastName;
|
||||||
data.organizationPositionOld ?? "";
|
data.organization = dataGet.organization;
|
||||||
responseData.value.positionLevelOld = data.positionLevelOld ?? "";
|
data.position = dataGet.position;
|
||||||
responseData.value.positionNumberOld = data.positionNumberOld ?? "";
|
data.posNo = dataGet.posNo;
|
||||||
responseData.value.positionTypeOld = data.positionTypeOld ?? "";
|
data.positionLevel = dataGet.positionLevel;
|
||||||
responseData.value.reason = data.reason ?? "";
|
data.salary = dataGet.salary;
|
||||||
responseData.value.salary = data.salary !== null ? data.salary : 0;
|
data.status = dataGet.status;
|
||||||
responseData.value.status = data.status ?? "";
|
data.descriptionSuspend = dataGet.descriptionSuspend
|
||||||
responseData.value.avataPath = data.avatar ?? "";
|
? dataGet.descriptionSuspend
|
||||||
responseData.value.fullname = `${data.firstName ?? "-"} ${
|
: "ออกจากราชการ";
|
||||||
data.lastName ?? "-"
|
data.startDateSuspend = dataGet.startDateSuspend;
|
||||||
}`;
|
data.endDateSuspend = dataGet.endDateSuspend;
|
||||||
|
data.title = dataGet.title;
|
||||||
organizationPositionOld.value = data.organizationPositionOld ?? "";
|
data.offenseDetails = dataGet.offenseDetails;
|
||||||
positionTypeOld.value = data.positionTypeOld ?? "";
|
data.disciplinaryFaultLevel = dataGet.disciplinaryFaultLevel;
|
||||||
positionLevelOld.value = data.positionLevelOld ?? "";
|
data.disciplinaryCaseFault = dataGet.disciplinaryCaseFault;
|
||||||
posNo.value = data.positionNumberOld ?? "";
|
|
||||||
salary.value = data.salary ?? "";
|
|
||||||
organization.value = data.organization ?? "";
|
|
||||||
date.value = data.date !== null ? new Date(data.date) : null;
|
|
||||||
reason.value = data.reason ?? "";
|
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -144,18 +147,18 @@ const conditionSave = async () => {
|
||||||
*/
|
*/
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
const body = {
|
const body = {
|
||||||
organization: organization.value,
|
organization: data.organization,
|
||||||
reason: reason.value,
|
position: data.position,
|
||||||
organizationPositionOld: organizationPositionOld.value,
|
posNo: data.posNo,
|
||||||
date: date.value,
|
positionLevel: data.positionLevel,
|
||||||
positionTypeOld: positionTypeOld.value,
|
salary: data.salary,
|
||||||
positionLevelOld: positionLevelOld.value,
|
descriptionSuspend: data.descriptionSuspend,
|
||||||
positionNumberOld: posNo.value,
|
startDateSuspend: data.startDateSuspend,
|
||||||
amountOld: salary.value,
|
endDateSuspend: data.endDateSuspend,
|
||||||
};
|
};
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.put(config.API.outByid(dataId), body)
|
.put(config.API.suspendById(dataId), body)
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
|
success($q, "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายสำเร็จ");
|
||||||
edit.value = false;
|
edit.value = false;
|
||||||
|
|
@ -192,12 +195,12 @@ const getClass = (val: boolean) => {
|
||||||
class="q-mr-sm"
|
class="q-mr-sm"
|
||||||
@click="router.go(-1)"
|
@click="router.go(-1)"
|
||||||
/>
|
/>
|
||||||
รายละเอียดการของ {{ responseData.fullname }}
|
รายละเอียดการของ {{ data.name }}
|
||||||
</div>
|
</div>
|
||||||
<q-card bordered class="row col-12 text-dark">
|
<q-card bordered class="row col-12 text-dark">
|
||||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||||
<div class="q-pl-sm text-weight-bold text-subtitle2">
|
<div class="q-pl-sm text-weight-bold text-subtitle2">
|
||||||
{{ responseData.fullname }}
|
{{ data.name }}
|
||||||
</div>
|
</div>
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
@ -207,24 +210,21 @@ const getClass = (val: boolean) => {
|
||||||
icon-right="mdi-open-in-new"
|
icon-right="mdi-open-in-new"
|
||||||
class="q-px-sm"
|
class="q-px-sm"
|
||||||
label="ดูข้อมูลทะเบียนประวัติ"
|
label="ดูข้อมูลทะเบียนประวัติ"
|
||||||
@click="router.push(`/registry/${responseData.personId}`)"
|
@click="router.push(`/registry/${data.id}`)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12"><q-separator /></div>
|
<div class="col-12"><q-separator /></div>
|
||||||
<div class="row col-12 q-pa-md">
|
<div class="row col-12 q-pa-md">
|
||||||
<div class="col-12 row bg-white q-col-gutter-md">
|
<div class="col-12 row bg-white q-col-gutter-md">
|
||||||
<div class="col-xs-3 col-sm-2 col-md-1 row">
|
<div class="col-xs-3 col-sm-2 col-md-1 row">
|
||||||
<q-img
|
<q-img :src="data.avataPath" v-if="data.avataPath !== ''" />
|
||||||
:src="responseData.avataPath"
|
|
||||||
v-if="responseData.avataPath !== ''"
|
|
||||||
/>
|
|
||||||
<q-img src="@/assets/avatar_user.jpg" v-else />
|
<q-img src="@/assets/avatar_user.jpg" v-else />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-3 row items-center">
|
<div class="col-xs-6 col-sm-3 row items-center">
|
||||||
<div class="col-12 q-pl-md">
|
<div class="col-12 q-pl-md">
|
||||||
<div class="col-12 text-top">ตำแหน่งในสายงาน</div>
|
<div class="col-12 text-top">ตำแหน่งในสายงาน</div>
|
||||||
<div class="col-12 text-detail">
|
<div class="col-12 text-detail">
|
||||||
{{ responseData.positionTypeOld }}
|
{{ data.position }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -232,7 +232,7 @@ const getClass = (val: boolean) => {
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="col-12 text-top">ระดับ</div>
|
<div class="col-12 text-top">ระดับ</div>
|
||||||
<div class="col-12 text-detail">
|
<div class="col-12 text-detail">
|
||||||
{{ responseData.positionLevelOld }}
|
{{ data.positionLevel }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -240,7 +240,7 @@ const getClass = (val: boolean) => {
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="col-12 text-top">สังกัด</div>
|
<div class="col-12 text-top">สังกัด</div>
|
||||||
<div class="col-12 text-detail">
|
<div class="col-12 text-detail">
|
||||||
{{ responseData.organizationPositionOld }}
|
{{ data.organization }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -254,11 +254,7 @@ const getClass = (val: boolean) => {
|
||||||
แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย
|
แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย
|
||||||
</div>
|
</div>
|
||||||
<q-space />
|
<q-space />
|
||||||
<div
|
<div v-if="data.status !== 'DONE' && data.status !== 'REPORT'">
|
||||||
v-if="
|
|
||||||
responseData.status !== 'DONE' && responseData.status !== 'REPORT'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<div class="q-gutter-sm" v-if="!edit">
|
<div class="q-gutter-sm" v-if="!edit">
|
||||||
<q-btn
|
<q-btn
|
||||||
outline
|
outline
|
||||||
|
|
@ -297,7 +293,7 @@ const getClass = (val: boolean) => {
|
||||||
<q-form ref="myForm">
|
<q-form ref="myForm">
|
||||||
<div class="row col-12 q-pa-md">
|
<div class="row col-12 q-pa-md">
|
||||||
<div class="col-12 row bg-white q-col-gutter-md">
|
<div class="col-12 row bg-white q-col-gutter-md">
|
||||||
<div class="col-xs-12 row items-center">
|
<!-- <div class="col-xs-12 row items-center">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="text-weight-bold">ตำแหน่งและหน่วยงานเดิม</div>
|
<div class="text-weight-bold">ตำแหน่งและหน่วยงานเดิม</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -316,7 +312,7 @@ const getClass = (val: boolean) => {
|
||||||
type="textarea"
|
type="textarea"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="col-xs-6 col-sm-3 row">
|
<div class="col-xs-6 col-sm-3 row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-input
|
<q-input
|
||||||
|
|
@ -326,7 +322,7 @@ const getClass = (val: boolean) => {
|
||||||
lazy-rules
|
lazy-rules
|
||||||
:readonly="!edit"
|
:readonly="!edit"
|
||||||
:borderless="!edit"
|
:borderless="!edit"
|
||||||
v-model="positionTypeOld"
|
v-model="data.position"
|
||||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
|
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:label="`${'ตำแหน่งประเภท'}`"
|
:label="`${'ตำแหน่งประเภท'}`"
|
||||||
|
|
@ -342,7 +338,7 @@ const getClass = (val: boolean) => {
|
||||||
lazy-rules
|
lazy-rules
|
||||||
:readonly="!edit"
|
:readonly="!edit"
|
||||||
:borderless="!edit"
|
:borderless="!edit"
|
||||||
v-model="positionLevelOld"
|
v-model="data.positionLevel"
|
||||||
:rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]"
|
:rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:label="`${'ระดับ'}`"
|
:label="`${'ระดับ'}`"
|
||||||
|
|
@ -358,17 +354,17 @@ const getClass = (val: boolean) => {
|
||||||
lazy-rules
|
lazy-rules
|
||||||
:readonly="!edit"
|
:readonly="!edit"
|
||||||
:borderless="!edit"
|
:borderless="!edit"
|
||||||
v-model="posNo"
|
v-model="data.posNo"
|
||||||
:rules="[(val) => !!val || `${'กรุณากรอกเลขที่'}`]"
|
:rules="[(val) => !!val || `${'กรุณากรอกเลขที่ตำแหน่ง'}`]"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:label="`${'เลขที่'}`"
|
:label="`${'เลขที่ตำแหน่ง'}`"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-3 row">
|
<div class="col-xs-6 col-sm-3 row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<CurrencyInput
|
<CurrencyInput
|
||||||
v-model="salary"
|
v-model="data.salary"
|
||||||
:edit="edit"
|
:edit="edit"
|
||||||
:options="{
|
:options="{
|
||||||
currency: 'THB',
|
currency: 'THB',
|
||||||
|
|
@ -387,19 +383,19 @@ const getClass = (val: boolean) => {
|
||||||
lazy-rules
|
lazy-rules
|
||||||
:readonly="!edit"
|
:readonly="!edit"
|
||||||
:borderless="!edit"
|
:borderless="!edit"
|
||||||
v-model="organization"
|
v-model="data.organization"
|
||||||
:rules="[(val) => !!val || `${'กรุณากรอก'}`]"
|
:rules="[(val) => !!val || `${'กรุณากรอก'}`]"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:label="`${'สังกัด'}`"
|
:label="`${'สังกัด'}`"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-6 row">
|
<div class="col-xs-3 col-sm-3 row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<datepicker
|
<datepicker
|
||||||
menu-class-name="modalfix"
|
menu-class-name="modalfix"
|
||||||
:readonly="!edit"
|
:readonly="!edit"
|
||||||
v-model="date"
|
v-model="data.startDateSuspend"
|
||||||
:locale="'th'"
|
:locale="'th'"
|
||||||
autoApply
|
autoApply
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
|
|
@ -417,7 +413,11 @@ const getClass = (val: boolean) => {
|
||||||
lazy-rules
|
lazy-rules
|
||||||
:readonly="!edit"
|
:readonly="!edit"
|
||||||
:borderless="!edit"
|
:borderless="!edit"
|
||||||
:model-value="date !== null ? date2Thai(date) : null"
|
:model-value="
|
||||||
|
data.startDateSuspend !== null
|
||||||
|
? date2Thai(data.startDateSuspend)
|
||||||
|
: null
|
||||||
|
"
|
||||||
:rules="[(val) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
|
:rules="[(val) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:label="`${'ตั้งแต่วัน'}`"
|
:label="`${'ตั้งแต่วัน'}`"
|
||||||
|
|
@ -439,7 +439,134 @@ const getClass = (val: boolean) => {
|
||||||
</datepicker>
|
</datepicker>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-xs-3 col-sm-3 row">
|
||||||
|
<div class="col-12">
|
||||||
|
<datepicker
|
||||||
|
menu-class-name="modalfix"
|
||||||
|
:readonly="!edit"
|
||||||
|
v-model="data.endDateSuspend"
|
||||||
|
:locale="'th'"
|
||||||
|
autoApply
|
||||||
|
:enableTimePicker="false"
|
||||||
|
week-start="0"
|
||||||
|
>
|
||||||
|
<template #year="{ year }">{{ year + 543 }}</template>
|
||||||
|
<template #year-overlay-value="{ value }">{{
|
||||||
|
parseInt(value + 543)
|
||||||
|
}}</template>
|
||||||
|
<template #trigger>
|
||||||
|
<q-input
|
||||||
|
:class="getClass(edit)"
|
||||||
|
:outlined="edit"
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
:readonly="!edit"
|
||||||
|
:borderless="!edit"
|
||||||
|
:model-value="
|
||||||
|
data.endDateSuspend !== null
|
||||||
|
? date2Thai(data.endDateSuspend)
|
||||||
|
: null
|
||||||
|
"
|
||||||
|
:rules="[(val) => !!val || `${'กรุณาเลือกถึงวันที่'}`]"
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'ถึงวันที่'}`"
|
||||||
|
>
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<q-icon
|
||||||
|
name="event"
|
||||||
|
class="cursor-pointer"
|
||||||
|
:style="
|
||||||
|
edit
|
||||||
|
? 'color: var(--q-primary)'
|
||||||
|
: 'color: var(--q-grey)'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
</q-icon>
|
||||||
|
</template>
|
||||||
|
</q-input>
|
||||||
|
</template>
|
||||||
|
</datepicker>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
<q-input
|
||||||
|
:class="getClass(edit)"
|
||||||
|
:outlined="edit"
|
||||||
|
dense
|
||||||
|
readonly
|
||||||
|
:borderless="!edit"
|
||||||
|
v-model="data.title"
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'เรื่องร้องเรียน '}`"
|
||||||
|
type="textarea"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col-3">
|
||||||
|
<q-select
|
||||||
|
for="#fault"
|
||||||
|
:outlined="edit"
|
||||||
|
dense
|
||||||
|
readonly
|
||||||
|
v-model="data.offenseDetails"
|
||||||
|
:options="
|
||||||
|
dataStore.offenseDetailsOps
|
||||||
|
"
|
||||||
|
label="ผลการสืบสวน"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
use-input
|
||||||
|
><template v-slot:no-option>
|
||||||
|
<q-item>
|
||||||
|
<q-item-section class="text-grey">
|
||||||
|
ไม่มีข้อมูล
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</template>
|
||||||
|
</q-select>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<q-input
|
||||||
|
:class="getClass(edit)"
|
||||||
|
:outlined="edit"
|
||||||
|
dense
|
||||||
|
readonly
|
||||||
|
:borderless="!edit"
|
||||||
|
v-model="data.disciplinaryFaultLevel"
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'ระดับโทษความผิด'}`"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<q-input
|
||||||
|
:class="getClass(edit)"
|
||||||
|
:outlined="edit"
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
readonly
|
||||||
|
:borderless="!edit"
|
||||||
|
v-model="data.disciplinaryCaseFault"
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'กรณีความผิด '}`"
|
||||||
|
type="textarea"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<q-input
|
||||||
|
:class="getClass(edit)"
|
||||||
|
:outlined="edit"
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
:readonly="!edit"
|
||||||
|
:borderless="!edit"
|
||||||
|
v-model="data.descriptionSuspend"
|
||||||
|
hide-bottom-space
|
||||||
|
:label="`${'เหตุที่ถูกสั่งพักราชการ '}`"
|
||||||
|
type="textarea"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="col-12">
|
||||||
<q-input
|
<q-input
|
||||||
:class="getClass(edit)"
|
:class="getClass(edit)"
|
||||||
:outlined="edit"
|
:outlined="edit"
|
||||||
|
|
@ -452,7 +579,7 @@ const getClass = (val: boolean) => {
|
||||||
:label="`${'หมายเหตุ '}`"
|
:label="`${'หมายเหตุ '}`"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-form>
|
</q-form>
|
||||||
|
|
|
||||||
78
src/modules/11_discipline/interface/response/suspend.ts
Normal file
78
src/modules/11_discipline/interface/response/suspend.ts
Normal file
|
|
@ -0,0 +1,78 @@
|
||||||
|
interface listData{
|
||||||
|
id: string
|
||||||
|
citizenId: string
|
||||||
|
prefix: string
|
||||||
|
firstName: string
|
||||||
|
lastName: string
|
||||||
|
organization: string
|
||||||
|
position: string
|
||||||
|
posNo: string
|
||||||
|
positionLevel: string
|
||||||
|
salary: number
|
||||||
|
status: string
|
||||||
|
descriptionSuspend: string
|
||||||
|
startDateSuspend: Date,
|
||||||
|
endDateSuspend: Date,
|
||||||
|
title: string
|
||||||
|
offenseDetails: string
|
||||||
|
disciplinaryFaultLevel: string
|
||||||
|
disciplinaryCaseFault: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface dataType{
|
||||||
|
id: string
|
||||||
|
citizenId: string
|
||||||
|
name:string
|
||||||
|
prefix: string
|
||||||
|
firstName: string
|
||||||
|
lastName: string
|
||||||
|
organization: string
|
||||||
|
position: string
|
||||||
|
posNo: string
|
||||||
|
positionLevel: string
|
||||||
|
salary: number
|
||||||
|
status: string
|
||||||
|
statusEn: string
|
||||||
|
descriptionSuspend: string
|
||||||
|
dateTotal:string
|
||||||
|
startDateSuspend: Date,
|
||||||
|
endDateSuspend: Date,
|
||||||
|
title: string
|
||||||
|
offenseDetails: string
|
||||||
|
disciplinaryFaultLevel: string
|
||||||
|
disciplinaryCaseFault: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface dataDetail{
|
||||||
|
id: string
|
||||||
|
citizenId: string
|
||||||
|
avataPath:string
|
||||||
|
name:string
|
||||||
|
prefix: string
|
||||||
|
firstName: string
|
||||||
|
lastName: string
|
||||||
|
organization: string
|
||||||
|
position: string
|
||||||
|
posNo: string
|
||||||
|
positionLevel: string
|
||||||
|
salary: number
|
||||||
|
status: string
|
||||||
|
descriptionSuspend: string
|
||||||
|
startDateSuspend: Date|null
|
||||||
|
endDateSuspend: Date|null
|
||||||
|
title: string
|
||||||
|
offenseDetails: string
|
||||||
|
disciplinaryFaultLevel: string
|
||||||
|
disciplinaryCaseFault: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DataOption {
|
||||||
|
id:string
|
||||||
|
name:string
|
||||||
|
}
|
||||||
|
export type {
|
||||||
|
listData,
|
||||||
|
dataType,
|
||||||
|
dataDetail,
|
||||||
|
DataOption
|
||||||
|
}
|
||||||
|
|
@ -65,7 +65,7 @@ export const useComplainstDataStore = defineStore(
|
||||||
{ id: "URGENT", name: "ด่วน" },
|
{ id: "URGENT", name: "ด่วน" },
|
||||||
{ id: "VERY_URGENT", name: "ด่วนมาก" },
|
{ id: "VERY_URGENT", name: "ด่วนมาก" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
function levelConsiderationTran(val: string) {
|
function levelConsiderationTran(val: string) {
|
||||||
return (
|
return (
|
||||||
levelConsiderationtOptions.value.find((v: any) => v.id === val)?.name ??
|
levelConsiderationtOptions.value.find((v: any) => v.id === val)?.name ??
|
||||||
|
|
|
||||||
85
src/modules/11_discipline/store/SuspendStore.ts
Normal file
85
src/modules/11_discipline/store/SuspendStore.ts
Normal file
|
|
@ -0,0 +1,85 @@
|
||||||
|
import { defineStore } from "pinia";
|
||||||
|
import { ref } from 'vue'
|
||||||
|
import type { listData, dataType ,DataOption} from '@/modules/11_discipline/interface/response/suspend'
|
||||||
|
import type { QTableProps } from "quasar";
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
export const useDisciplineSuspendStore = defineStore(
|
||||||
|
"disciplineSuspendStore",
|
||||||
|
() => {
|
||||||
|
const rows = ref<dataType[]>([])
|
||||||
|
const columns = ref<QTableProps["columns"]>([])
|
||||||
|
const visibleColumns = ref<string[]>([])
|
||||||
|
|
||||||
|
const mixin = useCounterMixin()
|
||||||
|
const { date2Thai } = mixin
|
||||||
|
|
||||||
|
const offenseDetailsOps = ref<DataOption[]>([
|
||||||
|
{ id: "NOT_SPECIFIED", name: "ยังไม่ระบุ" },
|
||||||
|
{ id: "NOT_DEADLY", name: "ไม่ร้ายแรง" },
|
||||||
|
{ id: "DEADLY", name: "ร้ายแรง" },
|
||||||
|
]);
|
||||||
|
|
||||||
|
function getData(data: listData[]) {
|
||||||
|
console.log(data)
|
||||||
|
const dataList: dataType[] = data.map((item: listData) => ({
|
||||||
|
id: item.id,
|
||||||
|
citizenId: item.citizenId,
|
||||||
|
name: `${item.prefix}${item.firstName} ${item.lastName}`,
|
||||||
|
prefix: item.prefix,
|
||||||
|
firstName: item.firstName,
|
||||||
|
lastName: item.lastName,
|
||||||
|
organization: item.organization,
|
||||||
|
position: item.position,
|
||||||
|
posNo: item.posNo,
|
||||||
|
positionLevel: item.positionLevel,
|
||||||
|
salary: item.salary,
|
||||||
|
status: statusTothai(item.status),
|
||||||
|
statusEn: item.status,
|
||||||
|
descriptionSuspend: item.descriptionSuspend,
|
||||||
|
dateTotal:item.startDateSuspend && item.endDateSuspend ? `${date2Thai(item.startDateSuspend)} - ${date2Thai(item.endDateSuspend)}`:'-',
|
||||||
|
startDateSuspend: item.startDateSuspend,
|
||||||
|
endDateSuspend: item.endDateSuspend,
|
||||||
|
title: item.title,
|
||||||
|
offenseDetails: item.offenseDetails,
|
||||||
|
disciplinaryFaultLevel: item.disciplinaryFaultLevel,
|
||||||
|
disciplinaryCaseFault: item.disciplinaryCaseFault,
|
||||||
|
}))
|
||||||
|
|
||||||
|
console.log('dataList ===',dataList)
|
||||||
|
rows.value = dataList
|
||||||
|
}
|
||||||
|
|
||||||
|
const statusTothai = (val: string) => {
|
||||||
|
switch (val) {
|
||||||
|
case "WAITTING":
|
||||||
|
return "รอดำเนินการ";
|
||||||
|
case "PENDING":
|
||||||
|
return "รอออกคำสั่ง";
|
||||||
|
case "APPROVE":
|
||||||
|
return "อนุมัติ";
|
||||||
|
case "REJECT":
|
||||||
|
return "ไม่อนุมัติ";
|
||||||
|
case "REPORT":
|
||||||
|
return "ส่งรายชื่อไปออกคำสั่ง";
|
||||||
|
case "DONE":
|
||||||
|
return "ออกคำสั่งเสร็จแล้ว";
|
||||||
|
|
||||||
|
default:
|
||||||
|
return "-";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
function convertOffenseDetails(val: string) {
|
||||||
|
const result = offenseDetailsOps.value.find((x: any) => x.id == val)?.name;
|
||||||
|
return result ? result : "-";
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
rows,
|
||||||
|
columns,
|
||||||
|
visibleColumns,
|
||||||
|
getData,
|
||||||
|
offenseDetailsOps
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
Loading…
Add table
Add a link
Reference in a new issue