UI สอบสวนความผิดทางวินัย
This commit is contained in:
parent
430f6a1074
commit
4be8f4f8fd
7 changed files with 1769 additions and 97 deletions
|
|
@ -0,0 +1,268 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed, watchEffect } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { ResponseData } from "@/modules/05_placement/interface/response/Transfer";
|
||||
|
||||
import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const $q = useQuasar();
|
||||
const selected = ref<ResponseData[]>([]);
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
|
||||
|
||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
"no",
|
||||
"fullname",
|
||||
"position",
|
||||
"duty",
|
||||
"email",
|
||||
"telephone",
|
||||
]);
|
||||
const columns2 = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "fullname",
|
||||
align: "left",
|
||||
label: "ชื่อ-นามสกุล",
|
||||
sortable: true,
|
||||
field: "fullname",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "position",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "duty",
|
||||
align: "left",
|
||||
label: "หน้าที่",
|
||||
sortable: true,
|
||||
field: "duty",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "email",
|
||||
align: "left",
|
||||
label: "อีเมล",
|
||||
sortable: true,
|
||||
field: "email",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "telephone",
|
||||
align: "left",
|
||||
label: "เบอร์โทรศัพท์",
|
||||
sortable: true,
|
||||
field: "telephone",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
const props = defineProps({
|
||||
Modal: Boolean,
|
||||
clickClose: Function,
|
||||
getData: Function,
|
||||
rows2: Array,
|
||||
filterKeyword2: String,
|
||||
});
|
||||
|
||||
const checkSelected = computed(() => {
|
||||
if (selected.value.length === 0) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
//popup ยืนยันส่งัว
|
||||
const saveDirector = () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => Ordersave(),
|
||||
"ยืนยันเพิ่มรายชื่อกรรมการ",
|
||||
"ต้องการยืนยันเพิ่มรายชื่อกรรมการ?"
|
||||
);
|
||||
};
|
||||
//ส่งไปออกคำสั่ง
|
||||
const Ordersave = async () => {
|
||||
// const id = selected.value.map((r) => r.id);
|
||||
// const body = {
|
||||
// id,
|
||||
// };
|
||||
// showLoader();
|
||||
// await http
|
||||
// .post(config.API.transferReport, 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 updateInput = (value: any) => {
|
||||
emit("update:filterKeyword2", value);
|
||||
};
|
||||
//รีเซ็ตค่าในช่องค้นหา
|
||||
const Reset = () => {
|
||||
emit("update:filterKeyword2", "");
|
||||
};
|
||||
watchEffect(() => {
|
||||
if (props.Modal === true) {
|
||||
selected.value = [];
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="props.Modal">
|
||||
<q-card style="width: 1200px; max-width: 80vw">
|
||||
<DialogHeader title="เลือกรายชื่อกรรมการ" :close="clickClose" />
|
||||
<q-separator />
|
||||
<q-card-section class="q-pt-none">
|
||||
<div class="row justify-end">
|
||||
<div>
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-input
|
||||
borderless
|
||||
outlined
|
||||
dense
|
||||
class="col-12"
|
||||
debounce="300"
|
||||
:model-value="filterKeyword2"
|
||||
@update:model-value="updateInput"
|
||||
placeholder="ค้นหารายชื่อ"
|
||||
style="width: 850px; max-width: auto"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword2 == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword2 !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="Reset"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<!-- <q-select
|
||||
v-model="visibleColumns2"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns2"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/> -->
|
||||
</q-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<d-table
|
||||
:columns="columns2"
|
||||
:rows="rows2"
|
||||
:filter="filterKeyword2"
|
||||
row-key="id"
|
||||
:visible-columns="visibleColumns2"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
>
|
||||
<template v-slot:header-selection="scope">
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="scope.selected"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<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="duty" :props="props">
|
||||
{{ props.row.duty }}
|
||||
</q-td>
|
||||
<q-td key="email" :props="props">
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.email }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="telephone" :props="props">
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.telephone }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right" class="bg-white text-teal">
|
||||
<q-btn
|
||||
label="เพิ่มรายชื่อกรรมการ"
|
||||
@click="saveDirector"
|
||||
:disable="checkSelected"
|
||||
color="public"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
|
@ -1,9 +1,259 @@
|
|||
<script setup lang="ts"></script>
|
||||
<script setup lang="ts">
|
||||
import type { QTableProps } from "quasar";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import Table from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Table.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useInvestigateDisStore } from "../../stroes/InvestigateDisStore";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
const dataInvestigateDis = useInvestigateDisStore();
|
||||
const { fecthList } = dataInvestigateDis;
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
const router = useRouter();
|
||||
const {
|
||||
date2Thai,
|
||||
success,
|
||||
typeCategoryExam,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
} = mixin;
|
||||
const filter = ref<string>(""); //search data table
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"subject",
|
||||
"interrogated",
|
||||
"fault",
|
||||
"penaltyLevel",
|
||||
"caseFault",
|
||||
"dateInvestigate",
|
||||
"status",
|
||||
]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "center",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "subject",
|
||||
align: "left",
|
||||
label: "เรื่อง",
|
||||
sortable: true,
|
||||
field: "subject",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "interrogated",
|
||||
align: "left",
|
||||
label: "ผู้ถูกสืบสวน",
|
||||
sortable: true,
|
||||
field: "interrogated",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "fault",
|
||||
align: "left",
|
||||
label: "ลักษณะความผิด",
|
||||
sortable: true,
|
||||
field: "fault",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "penaltyLevel",
|
||||
align: "left",
|
||||
label: "ระดับโทษความผิด",
|
||||
sortable: true,
|
||||
field: "penaltyLevel",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "caseFault",
|
||||
align: "left",
|
||||
label: "กรณีความผิด",
|
||||
sortable: true,
|
||||
field: "caseFault",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "dateInvestigate",
|
||||
align: "left",
|
||||
label: "วันที่สอบสวน",
|
||||
sortable: true,
|
||||
field: "dateInvestigate",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
align: "left",
|
||||
label: "สถานะ",
|
||||
sortable: true,
|
||||
field: "status",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
await fecthInvestigateDis();
|
||||
await hideLoader();
|
||||
});
|
||||
|
||||
const clickDelete = (id: string) => {
|
||||
$q.dialog({
|
||||
title: "ยืนยันการลบข้อมูล",
|
||||
message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?",
|
||||
cancel: {
|
||||
flat: true,
|
||||
color: "negative",
|
||||
},
|
||||
persistent: true,
|
||||
})
|
||||
.onOk(async () => {
|
||||
await deleteData(id);
|
||||
})
|
||||
.onCancel(() => {})
|
||||
.onDismiss(() => {});
|
||||
};
|
||||
|
||||
function fecthInvestigateDis() {
|
||||
const data = [
|
||||
{
|
||||
subject: "ทุจริตในหน้าที่",
|
||||
interrogated: "ศิรินภา คงน้อยี่",
|
||||
fault: "0",
|
||||
penaltyLevel: "0",
|
||||
caseFault: "test",
|
||||
dateInvestigate: "test",
|
||||
status: "0",
|
||||
active: "1",
|
||||
},
|
||||
{
|
||||
subject: "ทุจริตในหน้าที่",
|
||||
interrogated: "นายนครชัย วันดี",
|
||||
fault: "1",
|
||||
penaltyLevel: "0",
|
||||
caseFault: "test",
|
||||
dateInvestigate: "test",
|
||||
status: "1",
|
||||
active: "1",
|
||||
},
|
||||
{
|
||||
subject: "กระทำทุจริตเงินกองทุน",
|
||||
interrogated: "นายกัณฐิมา กาฬสินธ์ุ",
|
||||
fault: "1",
|
||||
penaltyLevel: "0",
|
||||
caseFault: "test",
|
||||
dateInvestigate: "test",
|
||||
status: "0",
|
||||
active: "1",
|
||||
},
|
||||
{
|
||||
subject: "พูดจาไม่สุภาพ",
|
||||
interrogated: "นายปิยรมย์ ศิริธาราฟ",
|
||||
fault: "2",
|
||||
penaltyLevel: "0",
|
||||
caseFault: "test",
|
||||
dateInvestigate: "test",
|
||||
status: "0",
|
||||
active: "1",
|
||||
},
|
||||
];
|
||||
fecthList(data); // ส่งข้อมูลไป stores
|
||||
}
|
||||
|
||||
const clickAdd = () => {
|
||||
router.push(`/discipline/InvestigateDisciplinary/add`);
|
||||
};
|
||||
|
||||
const deleteData = async (id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.delete(config.API.periodExamId(id))
|
||||
.then((res) => {
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<h1>สอบสวนความผิดวินัย</h1>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายการการสอบสวนความผิดทางวินัย
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
|
||||
<div>
|
||||
<Table
|
||||
style="max-height: 80vh"
|
||||
:rows="dataInvestigateDis.rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:pagination="initialPagination"
|
||||
:nornmalData="true"
|
||||
:add="clickAdd"
|
||||
:paging="true"
|
||||
:titleText="''"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td key="no" :props="props">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="subject" :props="props">
|
||||
{{ props.row.subject }}
|
||||
</q-td>
|
||||
<q-td key="interrogated" :props="props">
|
||||
{{ props.row.interrogated }}
|
||||
</q-td>
|
||||
<q-td key="fault" :props="props">
|
||||
{{ props.row.fault }}
|
||||
</q-td>
|
||||
<q-td key="penaltyLevel" :props="props">
|
||||
{{ props.row.penaltyLevel }}
|
||||
</q-td>
|
||||
<q-td key="caseFault" :props="props">
|
||||
{{ props.row.caseFault }}
|
||||
</q-td>
|
||||
<q-td key="dateInvestigate" :props="props">
|
||||
{{ props.row.dateInvestigate }}
|
||||
</q-td>
|
||||
<q-td key="status" :props="props">
|
||||
{{ props.row.status }}
|
||||
</q-td>
|
||||
<q-td auto-width style="width: 10rem">
|
||||
<q-btn color="primary" class="q-px-xl q-py-xs">ยื่นยันผล</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</q-card>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<style></style>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,196 @@
|
|||
<template>
|
||||
<div class="q-pb-sm row q-col-gutter-sm">
|
||||
<!-- -->
|
||||
<div class="q-gutter-sm" v-if="nornmalData == true">
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
@click="checkAdd"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-space />
|
||||
<div class="items-center q-gutter-sm" style="display: flex">
|
||||
<!-- ค้นหาข้อความใน table -->
|
||||
<q-input
|
||||
standout
|
||||
dense
|
||||
:model-value="inputfilter"
|
||||
ref="filterRef"
|
||||
@update:model-value="updateInput"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="inputfilter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="inputfilter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<!-- แสดงคอลัมน์ใน table -->
|
||||
<q-select
|
||||
:model-value="inputvisible"
|
||||
@update:model-value="updateVisible"
|
||||
:display-value="$q.lang.table.columns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
:options="attrs.columns"
|
||||
options-dense
|
||||
option-value="name"
|
||||
map-options
|
||||
emit-value
|
||||
style="min-width: 150px"
|
||||
class="gt-xs"
|
||||
>
|
||||
<template> </template>
|
||||
</q-select>
|
||||
</div>
|
||||
</div>
|
||||
<q-table
|
||||
ref="table"
|
||||
flat
|
||||
bordered
|
||||
class="custom-header-table"
|
||||
v-bind="attrs"
|
||||
virtual-scroll
|
||||
:virtual-scroll-sticky-size-start="48"
|
||||
dense
|
||||
:pagination-label="paginationLabel"
|
||||
:pagination="initialPagination"
|
||||
:rows-per-page-options="[0]"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium" v-html="col.label" />
|
||||
</q-th>
|
||||
<q-th auto-width v-if="nornmalData == true" />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template #body="props">
|
||||
<slot v-bind="props" name="columns"></slot>
|
||||
</template>
|
||||
</q-table>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, useAttrs } from "vue";
|
||||
import type { Pagination } from "@/modules/04_registry/interface/index/Main";
|
||||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const table = ref<any>(null);
|
||||
const filterRef = ref<any>(null);
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
|
||||
const props = defineProps({
|
||||
count: Number,
|
||||
pass: Number,
|
||||
notpass: Number,
|
||||
|
||||
inputfilter: String,
|
||||
name: String,
|
||||
icon: String,
|
||||
inputvisible: Array,
|
||||
editvisible: Boolean,
|
||||
add: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
validate: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
nornmalData: {
|
||||
type: Boolean,
|
||||
defualt: true,
|
||||
},
|
||||
conclude: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits([
|
||||
"update:inputfilter",
|
||||
"update:inputvisible",
|
||||
"update:editvisible",
|
||||
]);
|
||||
const updateInput = (value: string | number | null) => {
|
||||
emit("update:inputfilter", value);
|
||||
};
|
||||
const updateVisible = (value: []) => {
|
||||
emit("update:inputvisible", value);
|
||||
};
|
||||
|
||||
const paginationLabel = (start: string, end: string, total: string) => {
|
||||
return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
|
||||
const checkAdd = () => {
|
||||
props.add();
|
||||
};
|
||||
|
||||
const resetFilter = () => {
|
||||
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
|
||||
emit("update:inputfilter", "");
|
||||
filterRef.value.focus();
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.icon-color {
|
||||
color: #4154b3;
|
||||
}
|
||||
|
||||
.custom-table2 {
|
||||
max-height: 64vh;
|
||||
|
||||
.q-table tr:nth-child(odd) td {
|
||||
background: white;
|
||||
}
|
||||
|
||||
.q-table tr:nth-child(even) td {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.q-table thead tr {
|
||||
background: #ecebeb;
|
||||
}
|
||||
|
||||
.q-table thead tr th {
|
||||
position: sticky;
|
||||
}
|
||||
|
||||
.q-table td:nth-of-type(2) {
|
||||
z-index: 3 !important;
|
||||
}
|
||||
|
||||
.q-table th:nth-of-type(2),
|
||||
.q-table td:nth-of-type(2) {
|
||||
position: sticky;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* this will be the loading indicator */
|
||||
.q-table thead tr:last-child th {
|
||||
/* height of all previous header rows */
|
||||
top: 48px;
|
||||
}
|
||||
|
||||
.q-table thead tr:first-child th {
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,694 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useQuasar, QForm } from "quasar";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QTableProps } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import Dialogbody from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Dialogbody.vue";
|
||||
import Table from "@/modules/11_discipline/components/3_InvestigateDisciplinary/director.vue";
|
||||
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"subject",
|
||||
"beingInvestigated",
|
||||
"fault",
|
||||
"penaltyLevel",
|
||||
"caseFault",
|
||||
]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: false,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "subject",
|
||||
align: "left",
|
||||
label: "ชื่อ - นามสกุล",
|
||||
sortable: true,
|
||||
field: "subject",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "beingInvestigated",
|
||||
align: "left",
|
||||
label: "ตำแหน่ง",
|
||||
sortable: true,
|
||||
field: "beingInvestigated",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "fault",
|
||||
align: "left",
|
||||
label: "หน้าที่",
|
||||
sortable: true,
|
||||
field: "fault",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "penaltyLevel",
|
||||
align: "left",
|
||||
label: "อีเมล",
|
||||
sortable: true,
|
||||
field: "penaltyLevel",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "caseFault",
|
||||
align: "left",
|
||||
label: "เบอร์โทรศัพท์",
|
||||
sortable: true,
|
||||
field: "caseFault",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
const clickAdd = () => {
|
||||
console.log("clickadd");
|
||||
};
|
||||
|
||||
const popup = () => {
|
||||
modal.value = true;
|
||||
filterKeyword2.value = "";
|
||||
};
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
date2Thai,
|
||||
dateToISO,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
success,
|
||||
dialogMessageNotify,
|
||||
} = mixin;
|
||||
|
||||
const initialPagination = ref<any>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const rows = ref<any[]>([]);
|
||||
const modal = ref<boolean>(false);
|
||||
const $q = useQuasar();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const myForm = ref<QForm | null>(null); //form data input
|
||||
const edit = ref<boolean>(false);
|
||||
const dateStart = ref<Date>(new Date());
|
||||
const dateEnd = ref<Date>(new Date());
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const typefault = ref<string>("");
|
||||
const faultLevel = ref<string>("");
|
||||
const type = ref<string>("");
|
||||
const rows2 = ref<any[]>([]);
|
||||
const Complaint = ref<string>("");
|
||||
const trueDetail = ref<string>("");
|
||||
const evidence = ref<string>("");
|
||||
const recordAccuser = ref<string>("");
|
||||
const witnesses = ref<string>("");
|
||||
const InvestResults = ref<string>("");
|
||||
const files = ref<any>();
|
||||
const filesEvidence = ref<any>();
|
||||
const filesRecordAccuser = ref<any>();
|
||||
const filesWitnesses = ref<any>();
|
||||
const filesEtc = ref<any>();
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
const refRaw = ref<string>("");
|
||||
const casefault = ref<string>("");
|
||||
const whereInvestigate = ref<string>("");
|
||||
const optionsTypefault = ref([
|
||||
{ label: "ไม่ระบุ", value: 1 },
|
||||
{ label: "ร้ายแรง ", value: 2 },
|
||||
{ label: "ไม่ร้ายแรง", value: 3 },
|
||||
]);
|
||||
const optionsfaultLevel = ref([
|
||||
{ label: "ไม่ร้ายแรง", value: 1 },
|
||||
{ label: "ภาคทัณฑ์ ", value: 2 },
|
||||
{ label: "ตัดเงินเดือน", value: 3 },
|
||||
{ label: "ลดขั้นเงินเดือน", value: 4 },
|
||||
{ label: "ร้ายแรง", value: 5 },
|
||||
{ label: "ปลดออก", value: 6 },
|
||||
{ label: "ไล่ออก", value: 7 },
|
||||
]);
|
||||
|
||||
const routeName = router.currentRoute.value.name;
|
||||
|
||||
const clickClose = () => {
|
||||
modal.value = false;
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
// if (route.params.id) {
|
||||
// // มี params id ให้ เรียกข้อมูลของรอบการเสนอขอ
|
||||
// await fetchData();
|
||||
// }
|
||||
});
|
||||
// เรียกข้อมูลของรอบการเสนอขอ
|
||||
const fetchData = async () => {
|
||||
// edit.value = true;
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.getRoundInsignia(id.value))
|
||||
// .then((res) => {
|
||||
// const data = res.data.result;
|
||||
// id.value = data.period_id;
|
||||
// roundInsig.value =
|
||||
// options.value.filter((r: any) => r.value == data.period_round).length >
|
||||
// 0
|
||||
// ? options.value.filter((r: any) => r.value == data.period_round)[0]
|
||||
// : null;
|
||||
// yearly.value = data.period_year;
|
||||
// datelast.value = data.period_amount;
|
||||
// dateStart.value = new Date(data.period_start);
|
||||
// dateEnd.value = new Date(data.period_end);
|
||||
// files.value = data.period_doc;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
};
|
||||
|
||||
const deleteData = async (id: string) => {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .delete(config.API.periodExamId(id))
|
||||
// .then((res) => {
|
||||
// success($q, "ลบข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// hideLoader();
|
||||
// });
|
||||
};
|
||||
|
||||
const filter = ref<string>(""); //search data table
|
||||
|
||||
const fileUploadDoc = async (files: any) => {
|
||||
files.forEach((file: any) => {
|
||||
fileDocDataUpload.value.push(file);
|
||||
});
|
||||
};
|
||||
|
||||
// แก้ไขข้อมูล
|
||||
|
||||
// คลิกบันทึก
|
||||
const checkSave = () => {
|
||||
// if (myForm.value !== null) {
|
||||
// myForm.value.validate().then(async (success) => {
|
||||
// if (success) {
|
||||
// dialogConfirm($q, () => SaveData());
|
||||
// } else if (Number(datelast.value) !== 0) {
|
||||
// dialogMessageNotify($q, "กรุณาเลือกรอบการเสนอขอพระราชทานเครื่องราชฯ");
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
};
|
||||
// บันทึกข้อมูล
|
||||
const SaveData = async () => {
|
||||
// if (edit.value) {
|
||||
// await editData(id.value);
|
||||
// } else {
|
||||
// await addData();
|
||||
// clickBack();
|
||||
// }
|
||||
};
|
||||
// เพิ่มข้อมูลรอบการเสนอขอพระราชทานเครื่องราชฯ
|
||||
const addData = async () => {
|
||||
// const formData = new FormData();
|
||||
// const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${
|
||||
// roundInsig.value.value
|
||||
// } ปี ${yearly.value + 543} `;
|
||||
// formData.append("name", name);
|
||||
// formData.append("year", yearly.value.toString());
|
||||
// formData.append("amount", datelast.value.toString());
|
||||
// formData.append("round", roundInsig.value.value);
|
||||
// if (dateStart.value !== null) {
|
||||
// formData.append("startDate", dateToISO(dateStart.value));
|
||||
// }
|
||||
// if (dateEnd.value !== null) {
|
||||
// formData.append("endDate", dateToISO(dateEnd.value));
|
||||
// }
|
||||
// formData.append("file", files.value);
|
||||
// showLoader();
|
||||
// await http
|
||||
// .post(config.API.listRoundInsignia(), formData)
|
||||
// .then(() => {
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// hideLoader();
|
||||
// });
|
||||
};
|
||||
// แก้ไขข้อมูล
|
||||
const editData = async (id: string) => {
|
||||
// const formData = new FormData();
|
||||
// const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${
|
||||
// roundInsig.value.value
|
||||
// } ปี ${yearly.value + 543}`;
|
||||
// formData.append("name", name);
|
||||
// formData.append("year", yearly.value.toString());
|
||||
// formData.append("amount", datelast.value.toString());
|
||||
// formData.append("round", roundInsig.value.value);
|
||||
// if (dateStart.value !== null) {
|
||||
// formData.append("startDate", dateToISO(dateStart.value));
|
||||
// }
|
||||
// if (dateEnd.value !== null) {
|
||||
// formData.append("endDate", dateToISO(dateEnd.value));
|
||||
// }
|
||||
// formData.append("file", files.value);
|
||||
// showLoader();
|
||||
// await http
|
||||
// .put(config.API.editRoundInsignia(id), formData)
|
||||
// .then(() => {
|
||||
// success($q, "แก้ไขข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// hideLoader();
|
||||
// clickBack();
|
||||
// });
|
||||
};
|
||||
|
||||
const clickBack = () => {
|
||||
router.push(`/discipline/disciplinary`);
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
<div class="toptitle col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="clickBack"
|
||||
/>
|
||||
{{ edit ? "การสอบสวนความผิดทางวินัย" : "เพิ่มการสอบสวนความผิดทางวินัย" }}
|
||||
</div>
|
||||
<q-form ref="myForm">
|
||||
<div class="col-12">
|
||||
<q-card bordered>
|
||||
<div class="col-12 row q-col-gutter-md q-pa-md">
|
||||
<div class="col-xs-12 col-sm-12 row">
|
||||
<q-separator />
|
||||
<div class="col-12 row q-pa-sm q-col-gutter-sm">
|
||||
<q-input
|
||||
class="col-12"
|
||||
dense
|
||||
outlined
|
||||
v-model="Complaint"
|
||||
label="เรื่องร้องเรียน"
|
||||
type="textarea"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกเรื่องร้องเรียน'}`]"
|
||||
/>
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateStart"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
class="col-xs-12 col-sm-4"
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
dateStart != null ? date2Thai(dateStart) : null
|
||||
"
|
||||
:label="`${'วันที่สอบสวน'}`"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่สอบสวน'}`]"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateEnd"
|
||||
class="col-xs-12 col-sm-4"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="col-xs-12 col-sm-4"
|
||||
:model-value="dateEnd != null ? date2Thai(dateEnd) : null"
|
||||
:label="`${'วันที่รับทราบข้อกล่าวหา'}`"
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val || `${'กรุณาเลือกวันที่รับทราบข้อกล่าวหา'}`,
|
||||
]"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateStart"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
class="col-xs-12 col-sm-4"
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
>
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
<template #year-overlay-value="{ value }">
|
||||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
dateStart != null ? date2Thai(dateStart) : null
|
||||
"
|
||||
:label="`${'วันที่สรุปพยานหลักฐาน'}`"
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val || `${'กรุณาเลือกวันที่สรุปพยานหลักฐาน'}`,
|
||||
]"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
<div class="col-xs-12 col-sm-12 text-bold">
|
||||
กรรมการ
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
@click="popup()"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่มกรรมการ</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 q-pb-md">
|
||||
<Table
|
||||
style="max-height: 80vh"
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:filter="filter"
|
||||
:visible-columns="visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="visibleColumns"
|
||||
:pagination="initialPagination"
|
||||
:nornmalData="true"
|
||||
:paging="true"
|
||||
:titleText="''"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
>
|
||||
<div v-if="col.name == 'no'" class="table_ellipsis2">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else class="table_ellipsis2">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td>
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="red"
|
||||
@click="deleteData(props.row.id)"
|
||||
icon="mdi-delete"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-6"
|
||||
dense
|
||||
outlined
|
||||
v-model="casefault"
|
||||
label="กรณีมีความผิด"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกกรณีมีความผิด'}`]"
|
||||
lazy-rules
|
||||
/>
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-6"
|
||||
dense
|
||||
outlined
|
||||
v-model="whereInvestigate"
|
||||
label="สอบสวนที่"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกสอบสวนที่'}`]"
|
||||
lazy-rules
|
||||
/>
|
||||
<q-select
|
||||
dense
|
||||
class="col-xs-12 col-sm-3"
|
||||
outlined
|
||||
v-model="typefault"
|
||||
:options="optionsTypefault"
|
||||
label="ลักษณะความผิด"
|
||||
/>
|
||||
<q-select
|
||||
dense
|
||||
class="col-xs-12 col-sm-3"
|
||||
outlined
|
||||
v-model="faultLevel"
|
||||
:options="optionsfaultLevel"
|
||||
label="ระดับโทษความผิด"
|
||||
/>
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-6 q-pb-md"
|
||||
dense
|
||||
outlined
|
||||
v-model="refRaw"
|
||||
label="อ้างอิงมาตราตามกฎหมาย"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณากรอกอ้างอิงมาตราตามกฎหมาย'}`,
|
||||
]"
|
||||
lazy-rules
|
||||
/>
|
||||
<q-input
|
||||
class="col-12"
|
||||
dense
|
||||
outlined
|
||||
v-model="Complaint"
|
||||
label="รายละเอียดเรื่องร้องเรียน"
|
||||
type="textarea"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกรายละเอียดเรื่องร้องเรียน'}`]"
|
||||
/>
|
||||
<q-input
|
||||
class="col-12"
|
||||
dense
|
||||
outlined
|
||||
v-model="trueDetail"
|
||||
label="รายละเอียดสืบสวนข้อเท็จจริง"
|
||||
type="textarea"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกรายละเอียดสืบสวนข้อเท็จจริง'}`]"
|
||||
/>
|
||||
<q-input
|
||||
class="col-12"
|
||||
dense
|
||||
outlined
|
||||
v-model="evidence"
|
||||
label="สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา"
|
||||
type="textarea"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกสรุปพยานหลักฐานสนับสนุนข้อกล่าวหา'}`]"
|
||||
/>
|
||||
<q-file
|
||||
class="col-12 q-pb-md"
|
||||
outlined
|
||||
dense
|
||||
v-model="filesEvidence"
|
||||
@added="fileUploadDoc"
|
||||
label="ไฟล์เอกสารหลักฐานสรุปพยานหลักฐานสนับสนุนข้อกล่าวหา"
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
accept=".pdf,.xlsx,.doc"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
<q-input
|
||||
class="col-12"
|
||||
dense
|
||||
outlined
|
||||
v-model="recordAccuser"
|
||||
label="บันทึกถ้อยคำของผู้กล่าวหา"
|
||||
type="textarea"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกบันทึกถ้อยคำของผู้กล่าวหา'}`]"
|
||||
/>
|
||||
<q-file
|
||||
class="col-12 q-pb-md"
|
||||
outlined
|
||||
dense
|
||||
v-model="filesRecordAccuser"
|
||||
@added="fileUploadDoc"
|
||||
label="ไฟล์เอกสารบันทึกถ้อยคำของผู้กล่าวหา"
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
accept=".pdf,.xlsx,.doc"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
<q-input
|
||||
class="col-12"
|
||||
dense
|
||||
outlined
|
||||
v-model="witnesses"
|
||||
label="พยานและการบันทึกถ้อยคำ"
|
||||
type="textarea"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกพยานและการบันทึกถ้อยคำ'}`]"
|
||||
/>
|
||||
<q-file
|
||||
class="col-12 q-pb-md"
|
||||
outlined
|
||||
dense
|
||||
v-model="filesWitnesses"
|
||||
@added="fileUploadDoc"
|
||||
label="ไฟล์เอกสารพยานและการบันทึกถ้อยคำ"
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
accept=".pdf,.xlsx,.doc"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
<q-input
|
||||
class="col-12"
|
||||
dense
|
||||
outlined
|
||||
v-model="InvestResults"
|
||||
label="ผลการสอบสวน"
|
||||
type="textarea"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกผลการสอบสวน'}`]"
|
||||
/>
|
||||
<q-file
|
||||
class="col-12"
|
||||
outlined
|
||||
dense
|
||||
v-model="filesEtc"
|
||||
@added="fileUploadDoc"
|
||||
label="ไฟล์เอกสารหลักฐานอื่น ๆ"
|
||||
hide-bottom-space
|
||||
lazy-rules
|
||||
accept=".pdf,.xlsx,.doc"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<q-separator />
|
||||
<div class="row col-12 q-pa-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="checkSave"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>{{ edit ? "แก้ไขข้อมูล" : "บันทึกข้อมูล" }}</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-form>
|
||||
</div>
|
||||
<Dialogbody
|
||||
v-model:Modal="modal"
|
||||
:clickClose="clickClose"
|
||||
:rows2="rows2"
|
||||
v-model:filterKeyword2="filterKeyword2"
|
||||
v-model:type="type"
|
||||
/>
|
||||
<!-- :fecthlistappointment="fecthlistappointment" -->
|
||||
</template>
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
<template>
|
||||
<div class="q-pb-sm row q-col-gutter-sm">
|
||||
<!-- -->
|
||||
<q-space />
|
||||
</div>
|
||||
<q-table
|
||||
ref="table"
|
||||
flat
|
||||
bordered
|
||||
class="custom-header-table"
|
||||
v-bind="attrs"
|
||||
virtual-scroll
|
||||
:virtual-scroll-sticky-size-start="48"
|
||||
dense
|
||||
:pagination-label="paginationLabel"
|
||||
v-model:pagination="pagination"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium" v-html="col.label" />
|
||||
</q-th>
|
||||
<q-th auto-width v-if="nornmalData == true" />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template #body="props">
|
||||
<slot v-bind="props" name="columns"></slot>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template>
|
||||
</q-table>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, useAttrs } from "vue";
|
||||
import type { Pagination } from "@/modules/04_registry/interface/index/Main";
|
||||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const table = ref<any>(null);
|
||||
const filterRef = ref<any>(null);
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
|
||||
const props = defineProps({
|
||||
count: Number,
|
||||
pass: Number,
|
||||
notpass: Number,
|
||||
|
||||
inputfilter: String,
|
||||
name: String,
|
||||
icon: String,
|
||||
inputvisible: Array,
|
||||
editvisible: Boolean,
|
||||
add: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
validate: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
nornmalData: {
|
||||
type: Boolean,
|
||||
defualt: true,
|
||||
},
|
||||
conclude: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
paging: {
|
||||
type: Boolean,
|
||||
defualt: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits([
|
||||
"update:inputfilter",
|
||||
"update:inputvisible",
|
||||
"update:editvisible",
|
||||
]);
|
||||
const updateInput = (value: string | number | null) => {
|
||||
emit("update:inputfilter", value);
|
||||
};
|
||||
const updateVisible = (value: []) => {
|
||||
emit("update:inputvisible", value);
|
||||
};
|
||||
|
||||
const pagination = ref({
|
||||
sortBy: "desc",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
const paginationLabel = (start: string, end: string, total: string) => {
|
||||
if (props.paging == true)
|
||||
return " " + start + " ใน " + end + " จากจำนวน " + total + " รายการ";
|
||||
else return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
|
||||
const checkAdd = () => {
|
||||
props.add();
|
||||
};
|
||||
|
||||
const resetFilter = () => {
|
||||
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
|
||||
emit("update:inputfilter", "");
|
||||
filterRef.value.focus();
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.icon-color {
|
||||
color: #4154b3;
|
||||
}
|
||||
|
||||
.custom-table2 {
|
||||
max-height: 64vh;
|
||||
|
||||
.q-table tr:nth-child(odd) td {
|
||||
background: white;
|
||||
}
|
||||
|
||||
.q-table tr:nth-child(even) td {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.q-table thead tr {
|
||||
background: #ecebeb;
|
||||
}
|
||||
|
||||
.q-table thead tr th {
|
||||
position: sticky;
|
||||
}
|
||||
|
||||
.q-table td:nth-of-type(2) {
|
||||
z-index: 3 !important;
|
||||
}
|
||||
|
||||
.q-table th:nth-of-type(2),
|
||||
.q-table td:nth-of-type(2) {
|
||||
position: sticky;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* this will be the loading indicator */
|
||||
.q-table thead tr:last-child th {
|
||||
/* height of all previous header rows */
|
||||
top: 48px;
|
||||
}
|
||||
|
||||
.q-table thead tr:first-child th {
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,104 +1,133 @@
|
|||
const complaintMain = () =>
|
||||
import("@/modules/11_discipline/components/1_Complaint/MainPage.vue");
|
||||
const factsMain = () =>
|
||||
import("@/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue");
|
||||
const investigatefactsAdd = () =>
|
||||
import(
|
||||
"@/modules/11_discipline/components/2_InvestigateFacts/investigatefactsAdd.vue"
|
||||
);
|
||||
const disciplinaryMain = () =>
|
||||
import(
|
||||
"@/modules/11_discipline/components/3_InvestigateDisciplinary/MainPage.vue"
|
||||
);
|
||||
const oredrMain = () =>
|
||||
import("@/modules/11_discipline/components/4_Order/MainPage.vue");
|
||||
const report = () =>
|
||||
import("@/modules/11_discipline/components/5_Report/MainPage.vue");
|
||||
const directorMain = () =>
|
||||
import(
|
||||
"@/modules/11_discipline/components/ุ6_Information/Director/MainPage.vue"
|
||||
);
|
||||
const channelMain = () =>
|
||||
import(
|
||||
"@/modules/11_discipline/components/ุ6_Information/Channel/MainPage.vue"
|
||||
);
|
||||
const complaintAdd = () =>
|
||||
import("@/modules/11_discipline/components/1_Complaint/AddComplaintPage.vue");
|
||||
|
||||
const complaintMain = () => import("@/modules/11_discipline/components/1_Complaint/MainPage.vue")
|
||||
const factsMain = () => import("@/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue")
|
||||
const investigatefactsAdd = () => import("@/modules/11_discipline/components/2_InvestigateFacts/investigatefactsAdd.vue")
|
||||
const disciplinaryMain = () => import("@/modules/11_discipline/components/3_InvestigateDisciplinary/MainPage.vue")
|
||||
const oredrMain = () => import("@/modules/11_discipline/components/4_Order/MainPage.vue")
|
||||
const report = () => import("@/modules/11_discipline/components/5_Report/MainPage.vue")
|
||||
const directorMain = () => import("@/modules/11_discipline/components/ุ6_Information/Director/MainPage.vue")
|
||||
const channelMain = () => import("@/modules/11_discipline/components/ุ6_Information/Channel/MainPage.vue")
|
||||
const complaintAdd = () => import("@/modules/11_discipline/components/1_Complaint/AddComplaintPage.vue")
|
||||
|
||||
|
||||
const InvestigateDisciplinaryAdd = () =>
|
||||
import(
|
||||
"@/modules/11_discipline/components/3_InvestigateDisciplinary/addInvestigate.vue"
|
||||
);
|
||||
export default [
|
||||
{
|
||||
path: "/discipline/complaints",
|
||||
name: "/discipline-complaints",
|
||||
component: complaintMain,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.1],
|
||||
Role: "coin",
|
||||
},
|
||||
{
|
||||
path: "/discipline/complaints",
|
||||
name: "/discipline-complaints",
|
||||
component: complaintMain,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.1],
|
||||
Role: "coin",
|
||||
},
|
||||
{
|
||||
path: "/discipline/complaints/add",
|
||||
name: "/discipline-complaints-add",
|
||||
component: complaintAdd,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.1],
|
||||
Role: "coin",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/discipline/complaints/add",
|
||||
name: "/discipline-complaints-add",
|
||||
component: complaintAdd,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.1],
|
||||
Role: "coin",
|
||||
},
|
||||
{
|
||||
path: "/discipline/investigatefacts",
|
||||
name: "/discipline-investigatefacts",
|
||||
component: factsMain,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.2],
|
||||
Role: "coin",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/discipline/investigatefacts",
|
||||
name: "/discipline-investigatefacts",
|
||||
component: factsMain,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.2],
|
||||
Role: "coin",
|
||||
},
|
||||
{
|
||||
path: "/discipline/disciplinary",
|
||||
name: "/discipline-disciplinary",
|
||||
component: disciplinaryMain,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.3],
|
||||
Role: "coin",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/discipline/disciplinary",
|
||||
name: "/discipline-disciplinary",
|
||||
component: disciplinaryMain,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.3],
|
||||
Role: "coin",
|
||||
},
|
||||
{
|
||||
path: "/discipline/order",
|
||||
name: "/discipline-order",
|
||||
component: oredrMain,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.4],
|
||||
Role: "coin",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/discipline/order",
|
||||
name: "/discipline-order",
|
||||
component: oredrMain,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.4],
|
||||
Role: "coin",
|
||||
},
|
||||
{
|
||||
path: "/discipline/report",
|
||||
name: "/discipline-report",
|
||||
component: report,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.5],
|
||||
Role: "coin",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/discipline/report",
|
||||
name: "/discipline-report",
|
||||
component: report,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.5],
|
||||
Role: "coin",
|
||||
},
|
||||
{
|
||||
path: "/discipline/director",
|
||||
name: "/discipline-director",
|
||||
component: directorMain,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.6],
|
||||
Role: "coin",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/discipline/director",
|
||||
name: "/discipline-director",
|
||||
component: directorMain,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.6],
|
||||
Role: "coin",
|
||||
},
|
||||
{
|
||||
path: "/discipline/channel",
|
||||
name: "/discipline-channel",
|
||||
component: channelMain,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.6],
|
||||
Role: "coin",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/discipline/channel",
|
||||
name: "/discipline-channel",
|
||||
component: channelMain,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.6],
|
||||
Role: "coin",
|
||||
},
|
||||
{
|
||||
path: "/discipline/investigatefacts/add",
|
||||
name: "/discipline-investigatefactsAdd",
|
||||
component: investigatefactsAdd,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.2],
|
||||
Role: "coin",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/discipline/investigatefacts/add",
|
||||
name: "/discipline-investigatefactsAdd",
|
||||
component: investigatefactsAdd,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.2],
|
||||
Role: "coin",
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
path: "/discipline/InvestigateDisciplinary/add",
|
||||
name: "/discipline-InvestigateDisciplinaryAdd",
|
||||
component: InvestigateDisciplinaryAdd,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [11.3],
|
||||
Role: "coin",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
|||
69
src/modules/11_discipline/stroes/InvestigateDisStore.ts
Normal file
69
src/modules/11_discipline/stroes/InvestigateDisStore.ts
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
|
||||
export const useInvestigateDisStore = defineStore("InvestigateDis", () => {
|
||||
const rows = ref<any>([]);
|
||||
|
||||
async function fecthList(data: any) {
|
||||
let datalist = data.map((e: any) => ({
|
||||
subject: e.subject,
|
||||
interrogated: e.interrogated,
|
||||
fault: convertFault(e.fault),
|
||||
penaltyLevel: convertPenaltyLevel(e.penaltyLevel),
|
||||
caseFault: e.caseFault,
|
||||
dateInvestigate: e.dateInvestigate,
|
||||
status: convertSatatus(e.status),
|
||||
active: activeStatus(e.active),
|
||||
}));
|
||||
rows.value = datalist;
|
||||
console.log(rows.value);
|
||||
}
|
||||
function convertFault(val: string) {
|
||||
switch (val) {
|
||||
case "0":
|
||||
return "ความผิดวินัยยังไม่ระบุ";
|
||||
case "1":
|
||||
return "ความผิดวินัยไม่ร้ายแรง";
|
||||
case "2":
|
||||
return "ความผิดวินัยร้ายแรง";
|
||||
}
|
||||
}
|
||||
function convertSatatus(val: string) {
|
||||
switch (val) {
|
||||
case "0":
|
||||
return "เสร็จสิ้นแล้ว";
|
||||
case "1":
|
||||
return "ยุติเรื่อง";
|
||||
}
|
||||
}
|
||||
function activeStatus(val: string) {
|
||||
switch (val) {
|
||||
case "0":
|
||||
return "ยังไม่ได้ยืนยันผล";
|
||||
case "1":
|
||||
return "ยืนยันผลเเล้ว";
|
||||
}
|
||||
}
|
||||
function convertPenaltyLevel(val: string) {
|
||||
switch (val) {
|
||||
case "0":
|
||||
return "ไม่ร้ายแรง";
|
||||
case "1":
|
||||
return "ภาคทัณฑ์";
|
||||
case "3":
|
||||
return "ตัดเงินเดือน";
|
||||
case "4":
|
||||
return "ลดขั้นเงินเดือน";
|
||||
case "5":
|
||||
return "ร้ายแรง";
|
||||
case "6":
|
||||
return "ปลดออก";
|
||||
case "7":
|
||||
return "ไล่ออก";
|
||||
}
|
||||
}
|
||||
return {
|
||||
fecthList,
|
||||
rows,
|
||||
};
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue