API เมนูรายชื่อผู้ถูกพักราชการ
This commit is contained in:
parent
8664a904eb
commit
aa95b38857
7 changed files with 564 additions and 325 deletions
|
|
@ -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`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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,52 @@ 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"
|
||||||
>
|
>
|
||||||
|
<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 +339,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
|
||||||
|
}
|
||||||
|
|
@ -93,6 +93,7 @@ export const useComplainstDataStore = defineStore(
|
||||||
return "-";
|
return "-";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function levelConsiderationTran(val: string) {
|
function levelConsiderationTran(val: string) {
|
||||||
switch (val) {
|
switch (val) {
|
||||||
case "NORMAL":
|
case "NORMAL":
|
||||||
|
|
|
||||||
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