Merge branch 'develop' into nice_dev

# Conflicts:
#	src/modules/11_discipline/interface/index/Main.ts
This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-10-18 13:39:17 +07:00
commit dd89933261
13 changed files with 451 additions and 290 deletions

View file

@ -278,7 +278,7 @@ const openModalCalendar = (rows: any) => {
<div class="row col-12">
<div class="row col-12 q-col-gutter-sm">
<div>
<q-btn color="info" @click="$router.push('/exit-Interview/edit-question')">แก้ไขคำถาม</q-btn>
<q-btn color="blue-9" icon="mdi-square-edit-outline" outline @click="$router.push('/exit-Interview/edit-question')"><span class="q-pl-sm">แกไขคำถาม</span></q-btn>
</div>
<q-space />
<q-input class="col-xs-12 col-sm-3 col-md-2" standout dense v-model="filterKeyword" ref="filterRef" outlined

View file

@ -42,9 +42,8 @@ function colsePopup() {
<template>
<q-dialog v-model="props.modal">
<q-card style="width: 950px; max-width: 80vw">
<q-card-section>
<q-toolbar>
<q-toolbar-title>
<q-toolbar-title class="text-subtitle1 text-weight-bold">
<span style="margin-right: 0"> รายละเอยดการลงเวลาของ</span>
<span class="text-primary">{{ titlename }}</span>
</q-toolbar-title>
@ -57,22 +56,19 @@ function colsePopup() {
@click="colsePopup"
/>
</q-toolbar>
</q-card-section>
<q-separator />
<q-card-section class="q-pt-none">
<q-card-section class="q-pa-none">
<div class="q-pa-md">
<q-banner
inline-actions
rounded
class="bg-grey-2"
style="border: 2px solid rgb(239, 236, 236)"
<q-card
bordered
class="q-pa-sm bg-grey-1"
>
<div class="row">
<div class="col-4">
<q-list>
<q-item>
<q-item-section>
<q-item-label class="text-grey-5"
<q-item-label class="text-grey-8"
>-นามสก</q-item-label
>
<q-item-label>{{ titlename }}</q-item-label>
@ -83,7 +79,7 @@ function colsePopup() {
<div class="col-4">
<q-item>
<q-item-section>
<q-item-label class="text-grey-5">
<q-item-label class="text-grey-8">
นทเขางาน</q-item-label
>
<q-item-label>05 .. 56</q-item-label>
@ -93,12 +89,12 @@ function colsePopup() {
<div class="col-3">
<q-item>
<q-item-section>
<q-item-label class="text-grey-5">สถานะ</q-item-label>
<q-item-label class="text-grey-8">สถานะ</q-item-label>
<q-item-label>{{ status }}</q-item-label>
</q-item-section>
</q-item>
</div>
<div class="col">
<div class="col row items-center">
<q-btn
v-if="!statusEdit"
dense
@ -106,8 +102,7 @@ function colsePopup() {
round
color="primary"
icon="mdi-pencil"
size="sm"
class="q-mt-lg"
size="12px"
@click="statusEdit = true"
>
<q-tooltip>แกไข</q-tooltip>
@ -119,8 +114,7 @@ function colsePopup() {
round
color="red"
icon="mdi-undo"
size="sm"
class="q-mt-lg"
size="12px"
@click="statusEdit = false"
>
<q-tooltip>ยกเล</q-tooltip>
@ -131,30 +125,29 @@ function colsePopup() {
round
color="secondary"
icon="save"
size="sm"
class="q-mt-lg"
size="12px"
class="q-ml-sm"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</div>
</div>
</div>
</q-banner>
<div class="row q-gutter-md q-mt-md">
</q-card>
<div class="row q-gutter-md q-pt-md">
<div class="col">
<q-card flat bordered>
<q-card-section>
<div class="q-pa-md q-gutter-md">
<div class="row">
<div class="col text-grey-6">เวลาเขางาน</div>
<div class="col text-grey-8">เวลาเขางาน</div>
<div class="col">{{ timeIn }}</div>
</div>
<div class="row">
<div class="col text-grey-6"></div>
<div class="col text-grey-8"></div>
<div class="col">{{ coordinatesIn }}</div>
</div>
<div class="row">
<div class="col-6 text-grey-6">ปภาพ</div>
<div class="col-6 text-grey-8">ปภาพ</div>
<div class="col-5">
<q-img
style="
@ -167,27 +160,25 @@ function colsePopup() {
</div>
</div>
<div class="row">
<div class="col text-grey-6">หมายเหต</div>
<div class="col text-grey-8">หมายเหต</div>
<div class="col">-</div>
</div>
</div>
</q-card-section>
</q-card>
</div>
<div class="col">
<q-card flat bordered>
<q-card-section>
<div class="q-pa-md q-gutter-md">
<div class="row">
<div class="col text-grey-6">เวลาออกงาน</div>
<div class="col text-grey-8">เวลาออกงาน</div>
<div class="col">{{ timeOut }}</div>
</div>
<div class="row">
<div class="col text-grey-6"></div>
<div class="col text-grey-8"></div>
<div class="col">{{ coordinatesOut }}</div>
</div>
<div class="row">
<div class="col-6 text-grey-6">ปภาพ</div>
<div class="col-6 text-grey-8">ปภาพ</div>
<div class="col-5">
<q-img
style="
@ -200,11 +191,10 @@ function colsePopup() {
</div>
</div>
<div class="row">
<div class="col text-grey-6">หมายเหต</div>
<div class="col text-grey-8">หมายเหต</div>
<div class="col">-</div>
</div>
</div>
</q-card-section>
</q-card>
</div>
</div>

View file

@ -51,28 +51,28 @@ function changTab() {
<div class="toptitle text-dark col-12 row items-center">รายการลา</div>
<div>
<!-- <q-card flat bordered class="col-12 q-mt-sm"> -->
<div class="q-pa-md">
<q-card bordered flat >
<q-tabs
v-model="leaveStore.tab"
dense
align="left"
inline-label
class="bg-grey-4 rounded-borders"
indicator-color="white"
class="rounded-borders"
indicator-color="primary"
active-bg-color="teal-1"
active-class="text-primary"
>
<q-tab
@click="changTab"
name="1"
label="รายการลาที่อยู่ระหว่างดำเนิดการ"
:class="
leaveStore.tab == '1' ? 'bg-white text-primary rounded-borders ' : ''
"
>
<q-badge
color="grey-4"
:class="
leaveStore.tab == '1'
? 'q-px-sm text-weight-medium text-primary q-ml-xl'
? 'q-px-sm text-weight-medium text-primary q-ml-xl bg-teal-1'
: 'q-px-sm text-weight-medium text-black q-ml-xl'
"
:label="leaveStore.amounttab1"
@ -83,17 +83,13 @@ function changTab() {
@click="changTab"
name="2"
label="รายการลาทั้งหมด"
:class="
leaveStore.tab == '2'
? 'bg-white text-primary rounded rounded-borders '
: ''
"
>
<q-badge
color="grey-4"
:class="
leaveStore.tab == '2'
? 'q-px-sm text-weight-medium text-primary q-ml-xl'
? 'q-px-sm text-weight-medium text-primary q-ml-xl bg-teal-1'
: 'q-px-sm text-weight-medium text-black q-ml-xl'
"
:label="leaveStore.amounttab2"
@ -101,6 +97,7 @@ function changTab() {
/>
</q-tab>
</q-tabs>
<q-separator />
<q-tab-panels v-model="leaveStore.tab" animated>
<q-tab-panel name="1">
@ -113,8 +110,8 @@ function changTab() {
<TableList />
</q-tab-panel>
</q-tab-panels>
</div>
<!-- </q-card> -->
</q-card>
</div>
</template>

View file

@ -1,7 +1,10 @@
<script setup lang="ts">
import router from "@/router";
import { onMounted, ref } from "vue";
import { onMounted, ref, watch } from "vue";
import { useCounterMixin } from "@/stores/mixin";
import { useInvestigateFactStore } from "@/modules/11_discipline/stroes/InvestigateFactStore";
const investigateFactStore = useInvestigateFactStore();
const { filterFnOptionsType } = investigateFactStore;
const mixin = useCounterMixin();
const {
messageError,
@ -17,51 +20,15 @@ const detail = ref<string>("");
const fault = ref<string>("");
const results = ref<string>("");
const other = ref<string>("");
const evidenceFiles = ref<any>(null);
const fileComplaint = ref<any>(null);
const evidenceFiles = ref<File | null>(null);
const fileComplaint = ref<File | null>(null);
const clickTime = ref<boolean>(false);
const date = ref<Date | null>(null);
const dateEnd = ref<Date | null>(null);
const date = ref<Date>();
const dateEnd = ref<Date>();
const investigation = ref<string>("");
const faultOps = ref<any>([
{ id: "001", value: "ยังไม่ระบุ" },
{ id: "002", value: "ไม่ร้ายเเรง" },
{ id: "003", value: "ร้ายเเรง" },
]);
const faultOp = ref<any>();
const investigationOps = ref<any>([
{ id: "001", value: "เเต่งตั้งการสืบสวน" },
{ id: "002", value: "สืบสวนทางลับ" },
{ id: "003", value: "อื่นๆ" },
]);
const daysExtend = ref<string>("");
const daysExtendOp = ref<any>();
const daysExtendOps = ref<any>([
{ id: "000", value: "15 วัน" },
{ id: "001", value: "30 วัน" },
{ id: "002", value: "45 วัน" },
{ id: "003", value: "60 วัน" },
]);
const investigationOp = ref<any>();
function filterFnOptionsType(val: string, update: any, type: string) {
update(() => {
const needle = val.toLowerCase();
if (type === "faultOp") {
faultOp.value = faultOps.value.filter(
(v: any) => v.value.toLowerCase().indexOf(needle) > -1
);
} else if (type === "investigationOp") {
investigationOp.value = investigationOps.value.filter(
(v: any) => v.value.toLowerCase().indexOf(needle) > -1
);
} else if (type === "daysExtendOp") {
daysExtendOp.value = daysExtendOps.value.filter(
(v: any) => v.value.toLowerCase().indexOf(needle) > -1
);
}
});
}
const daysExtend = ref<string>("");
</script>
<template>
<div class="toptitle text-dark col-12 row items-center">
@ -103,11 +70,11 @@ function filterFnOptionsType(val: string, update: any, type: string) {
outlined
dense
v-model="fault"
:options="faultOp"
:options="investigateFactStore.faultOp"
label="ลักษณะความผิด"
emit-value
map-options
option-label="value"
option-label="name"
option-value="id"
use-input
@filter="(inputValue: any,
@ -127,11 +94,11 @@ function filterFnOptionsType(val: string, update: any, type: string) {
outlined
dense
v-model="investigation"
:options="investigationOp"
:options="investigateFactStore.investigationOp"
label="ลักษณะการสืบสวน"
emit-value
map-options
option-label="value"
option-label="name"
option-value="id"
use-input
@filter="(inputValue: any,
@ -195,7 +162,7 @@ function filterFnOptionsType(val: string, update: any, type: string) {
dense
lazy-rules
borderless
:model-value="date !== null ? date2Thai(date) : null"
:model-value="date ? date2Thai(date) : null"
:rules="[
(val) =>
!!val || `${'กรุณาเลือกวันที่เริ่มการสอบสวน'}`,
@ -234,9 +201,7 @@ function filterFnOptionsType(val: string, update: any, type: string) {
dense
lazy-rules
borderless
:model-value="
dateEnd !== null ? date2Thai(dateEnd) : null
"
:model-value="dateEnd ? date2Thai(dateEnd) : null"
:rules="[
(val) =>
!!val || `${'กรุณาเลือกวันที่สิ้นสุดการสอบสวน'}`,
@ -262,14 +227,17 @@ function filterFnOptionsType(val: string, update: any, type: string) {
dense
lazy-rules
v-model="daysExtend"
:options="daysExtendOp"
:options="investigateFactStore.daysExtendOp"
label="จำนวนวันที่ต้องการขยาย"
emit-value
map-options
:rules="[
(val) => !!val || `${'กรุณาเลือกจำนวนวันที่ต้องการขยาย'}`,
(val) =>
clickTime === true
? !!val || 'กรุณาเลือกจำนวนวันที่ต้องการขยาย'
: true,
]"
option-label="value"
option-label="name"
option-value="id"
use-input
@filter="(inputValue: any,

View file

@ -2,26 +2,26 @@
import { ref, useAttrs, onMounted } from "vue";
import type { QTableProps } from "quasar";
import router from "@/router";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
// import { useCounterMixin } from "@/stores/mixin";
import config from "@/app.config";
import http from "@/plugins/http";
// import config from "@/app.config";
// import http from "@/plugins/http";
import { useInvestigateFactStore } from '../../stroes/InvestigateFactStore'
const dataInvestigate = useInvestigateFactStore()
const { fecthList } = dataInvestigate
const mixin = useCounterMixin();
const {
date2Thai,
success,
messageError,
showLoader,
hideLoader,
dialogConfirm,
dialogRemove,
} = mixin;
// const mixin = useCounterMixin();
// const {
// date2Thai,
// success,
// messageError,
// showLoader,
// hideLoader,
// dialogConfirm,
// dialogRemove,
// } = mixin;
const $q = useQuasar(); // noti quasar
const visibleColumns = ref<string[]>([
@ -116,7 +116,7 @@ function fecthInvestigateFact() {
{
subject: "ทุจริตในหน้าที่",
interrogated: "ศิรินภา คงน้อยี่",
fault: "0",
fault: "1",
status: "0",
active:'1'
},
@ -130,15 +130,15 @@ function fecthInvestigateFact() {
{
subject: "กระทำทุจริตเงินกองทุน",
interrogated: "นายกัณฐิมา กาฬสินธ์ุ",
fault: "1",
status: "2",
fault: "0",
status: "1",
active:'1'
},
{
subject: "พูดจาไม่สุภาพ",
interrogated: "นายปิยรมย์ ศิริธาราฟ",
fault: "2",
status: "3",
fault: "0",
status: "1",
active:'1'
},
];
@ -210,7 +210,7 @@ onMounted(()=>{
/>
</div>
<div class="col-12">
<q-table
<d-table
ref="table"
:columns="columns"
:rows="dataInvestigate.rows"
@ -228,7 +228,7 @@ onMounted(()=>{
>
<template v-slot:header="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" style="padding: 10px;color:#35373C;font-weight: 500;">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
@ -267,8 +267,8 @@ onMounted(()=>{
<q-td style="font-size: 14px;width: 10rem">
{{ props.row.active }}
</q-td>
<q-td auto-width style="width: 10rem">
<q-btn v-if="props.row.status === 'ยุติเรื่อง'" color="primary" class="q-px-xl q-py-xs">ยกเลิกยุติเรื่อง</q-btn>
<q-td auto-width >
<q-btn v-if="props.row.status === 'ยุติเรื่อง'" class="q-px-xl q-py-xs text-white no-shadow" style="background-color:#00AA86 ; border-radius: 6px;">ยกเลิกยุติเรื่อง</q-btn>
</q-td>
</q-tr>
</template>
@ -284,57 +284,10 @@ onMounted(()=>{
direction-links
></q-pagination>
</template>
</q-table>
</d-table>
</div>
</div>
</q-card>
</template>
<style lang="scss" scope>
.filter-card {
background-color: #f1f1f1b0;
}
.toggle-expired-account {
font-size: 12px;
font-weight: 400;
font-size: 15px;
line-height: 150%;
color: #35373c;
}
.icon-color {
color: #4154b3;
}
.custom-header-table {
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;
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>

View file

@ -4,52 +4,31 @@ import { VuePDF, usePDF } from "@tato30/vue-pdf";
import { useCounterMixin } from "@/stores/mixin";
import { useRoute } from "vue-router";
import { useQuasar } from "quasar";
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
import { useReportDataStore } from "@/modules/11_discipline/stroes/ReportStore";
import http from "@/plugins/http";
import config from "@/app.config";
const date = ref<Date | null>(null);
const dateEnd = ref<Date | null>(null);
const date = ref<Date>();
const dateEnd = ref<Date>();
const route = useRoute();
const typeReport = route.params.type.toString();
const store = useReportDataStore();
const mixin = useCounterMixin();
const { messageError, showLoader, hideLoader, date2Thai } = mixin;
const { optionReport } = store;
const { filterFnOptionsType } = store;
const $q = useQuasar();
const ocSelect = ref<string>("");
const ocSelectOp = ref<any>();
const ocSelectOps = ref<any>([
{ id: "001", value: "กทม" },
{ id: "002", value: "กรุงเทพ" },
]);
const government = ref<string>("");
const governmentOp = ref<any>();
const governmentOps = ref<any>([
{ id: "001", value: "กทม" },
{ id: "002", value: "กรุงเทพ" },
{ id: "003", value: "bankok" },
]);
const fault = ref<any>();
const faultOp = ref<any>();
const faultOps = ref<any>([
{ id: "001", value: "ยังไม่ระบุ" },
{ id: "002", value: "ไม่ร้ายเเรง" },
{ id: "003", value: "ร้ายเเรง" },
]);
const fault = ref<string>();
const pdfSrc = ref<any>();
const numOfPages = ref<number>(0);
const page = ref<number>(1);
const titleReport = ref<string>("");
interface OptionReport {
id: string;
title: string;
}
onMounted(async () => {
let report = optionReport.find((e: OptionReport) => e.id == typeReport);
report && (titleReport.value = report.title);
let report = store.optionReport.find((e: DataOption) => e.id == typeReport);
report && (titleReport.value = report.name);
});
const splitterModel = ref(14);
@ -75,25 +54,6 @@ const backPage = () => {
page.value--;
}
};
function filterFnOptionsType(val: string, update: any, type: string) {
update(() => {
const needle = val.toLowerCase();
if (type === "ocSelectOp") {
ocSelectOp.value = ocSelectOps.value.filter(
(v: any) => v.value.toLowerCase().indexOf(needle) > -1
);
} else if (type === "governmentOp") {
governmentOp.value = governmentOps.value.filter(
(v: any) => v.value.toLowerCase().indexOf(needle) > -1
);
} else if (type === "faultOp") {
faultOp.value = faultOps.value.filter(
(v: any) => v.value.toLowerCase().indexOf(needle) > -1
);
}
});
}
</script>
<template>
<div class="toptitle">
@ -133,7 +93,7 @@ function filterFnOptionsType(val: string, update: any, type: string) {
dense
lazy-rules
borderless
:model-value="date !== null ? date2Thai(date) : null"
:model-value="date ? date2Thai(date) : null"
:label="`${'ตั้งเเต่วันที่'}`"
>
<template v-slot:prepend>
@ -164,7 +124,7 @@ function filterFnOptionsType(val: string, update: any, type: string) {
dense
lazy-rules
borderless
:model-value="dateEnd !== null ? date2Thai(dateEnd) : null"
:model-value="dateEnd ? date2Thai(dateEnd) : null"
:label="`${'ถึงวันที่'}`"
>
<template v-slot:prepend>
@ -194,11 +154,11 @@ function filterFnOptionsType(val: string, update: any, type: string) {
outlined
dense
v-model="ocSelect"
:options="ocSelectOp"
:options="store.ocSelectOp"
label="เลือกหน่วยงาน/สำนักงานเขต"
emit-value
map-options
option-label="value"
option-label="name"
option-value="id"
use-input
@filter="(inputValue: any,
@ -219,11 +179,11 @@ function filterFnOptionsType(val: string, update: any, type: string) {
outlined
dense
v-model="government"
:options="governmentOp"
:options="store.governmentOp"
label="เลือกหน่วยงาน/สำนักงานเขต"
emit-value
map-options
option-label="value"
option-label="name"
option-value="id"
use-input
@filter="(inputValue: any,
@ -240,15 +200,15 @@ function filterFnOptionsType(val: string, update: any, type: string) {
</div>
<div v-if="typeReport > '2'" class="q-pl-xs">
<q-select
class="bg-white"
class="bg-white"
outlined
dense
v-model="fault"
:options="faultOp"
:options="store.faultOp"
label="เลือกลักษณะความผิด"
emit-value
map-options
option-label="value"
option-label="name"
option-value="id"
use-input
@filter="(inputValue: any,

View file

@ -93,20 +93,15 @@ const clickAdd = () => {
};
const clickDelete = (id: string) => {
$q.dialog({
title: "ยืนยันการลบช่องทาง",
message: "ต้องการลบช่องทางนี้ใช่หรือไม่?",
cancel: {
flat: true,
color: "negative",
dialogRemove(
$q,
async () => {
// await deleteData(id);
// await getData();
},
persistent: true,
})
.onOk(async () => {
console.log("delete");
})
.onCancel(() => {})
.onDismiss(() => {});
`ลบข้อมูล`
// ` ${name}`
);
};
onMounted(() => {});
@ -170,18 +165,11 @@ onMounted(() => {});
/>
</div>
<div class="col-12">
<q-table
ref="table"
<d-table
:columns="columns"
:rows="rows"
row-key="id"
:filter="filterKeyword"
row-key="interrogated"
flat
bordered
:paging="true"
dense
class="custom-header-table"
v-bind="attrs"
:visible-columns="visibleColumns"
:pagination-label="paginationLabel"
v-model:pagination="pagination"
@ -229,7 +217,7 @@ onMounted(() => {});
direction-links
></q-pagination>
</template>
</q-table>
</d-table>
</div>
</div>
</q-card>

View file

@ -0,0 +1,214 @@
<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";
const mixin = useCounterMixin();
const {
date2Thai,
dateToISO,
messageError,
showLoader,
hideLoader,
dialogConfirm,
success,
dialogMessageNotify,
} = mixin;
const router = useRouter();
const route = useRoute();
const myForm = ref<QForm | null>(null); //form data input
const edit = ref<boolean>(false);
const channel = ref<string>("");
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 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/channel`);
};
</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="channel"
label="กรอกชื่อช่องทาง"
:rules="[(val:string) => !!val || `${'กรุณากรอกชื่อช่องทาง'}`]"
/>
</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>
</template>

View file

@ -2,6 +2,13 @@ interface DataOption {
id: string;
name: string;
}
interface investigatefactsDataRowType {
subject: string;
interrogated: string;
fault: string;
status: string;
active: string;
}
interface MyObjectRef {
orderType: any;
orderBy: any;
@ -15,7 +22,12 @@ interface MyObjectRef {
mistakeDetail: any,
[key: string]: any;
}
export type {
DataOption,
MyObjectRef
investigatefactsDataRowType,
MyObjectRef,
};

View file

@ -4,7 +4,7 @@ const factsMain = () =>
import("@/modules/11_discipline/components/2_InvestigateFacts/MainPage.vue");
const investigatefactsAdd = () =>
import(
"@/modules/11_discipline/components/2_InvestigateFacts/investigatefactsAdd.vue"
"@/modules/11_discipline/components/2_InvestigateFacts/AddPage.vue"
);
const disciplinaryMain = () =>
import(
@ -22,20 +22,21 @@ const channelMain = () =>
import(
"@/modules/11_discipline/components/6_BasicInformation/Channel/MainPage.vue"
);
const channelAdd = () =>
const channelAdd = () =>
import(
"@/modules/11_discipline/components/6_BasicInformation/Channel/addChannel.vue"
);
"@/modules/11_discipline/components/6_BasicInformation/Channel/AddPage.vue"
);
const complaintAdd = () =>
import("@/modules/11_discipline/components/1_Complaint/AddComplaintPage.vue");
const reportType = () =>
import("@/modules/11_discipline/components/5_Report/reportDetail.vue");
import("@/modules/11_discipline/components/5_Report/DetailPage.vue");
const InvestigateDisciplinaryAdd = () =>
import(
"@/modules/11_discipline/components/3_InvestigateDisciplinary/addInvestigate.vue"
);
const orderPage = () => import("@/modules/11_discipline/components/4_Order/OrderPage.vue")
const orderPage = () =>
import("@/modules/11_discipline/components/4_Order/OrderPage.vue");
export default [
{
path: "/discipline/complaints",

View file

@ -1,41 +1,74 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type { investigatefactsDataRowType, DataOption } from '@/modules/11_discipline/interface/index/Main'
export const useInvestigateFactStore = defineStore("DisciplineInvestigateFact", () => {
const rows = ref<any>([])
const rows = ref<investigatefactsDataRowType[]>([])
const faultOp = ref<DataOption[]>();
const daysExtendOp = ref<DataOption[]>();
const investigationOp = ref<DataOption[]>();
const daysExtendOps = ref<DataOption[]>([
{ id: "000", name: "15 วัน" },
{ id: "001", name: "30 วัน" },
{ id: "002", name: "45 วัน" },
{ id: "003", name: "60 วัน" },
]);
const investigationOps = ref<DataOption[]>([
{ id: "001", name: "เเต่งตั้งการสืบสวน" },
{ id: "002", name: "สืบสวนทางลับ" },
{ id: "003", name: "อื่นๆ" },
]);
const faultOps = ref<DataOption[]>([
{ id: "001", name: "ยังไม่ระบุ" },
{ id: "002", name: "ไม่ร้ายเเรง" },
{ id: "003", name: "ร้ายเเรง" },
]);
function filterFnOptionsType(val: string, update: any, type: string) {
update(() => {
const needle = val.toLowerCase();
async function fecthList(data: any) {
let datalist = data.map((e: any) => ({
if (type === "faultOp") {
faultOp.value = faultOps.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
} else if (type === "investigationOp") {
investigationOp.value = investigationOps.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
} else if (type === "daysExtendOp") {
daysExtendOp.value = daysExtendOps.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
}
});
}
async function fecthList(data: investigatefactsDataRowType[]) {
let datalist: investigatefactsDataRowType[] = data.map((e: any) => ({
subject: e.subject,
interrogated: e.interrogated,
fault: convertFault(e.fault),
status: convertSatatus(e.status),
active: activeStatus(e.active)
fault: e.fault ?? convertFault(e.fault),
status: e.status ?? convertSatatus(e.status),
active: e.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":
case "1":
return "ความผิดวินัยร้ายแรง"
}
}
function convertSatatus(val: string) {
switch (val) {
case "0":
return "ยังไม่ระบุ"
case "1":
return "ร้ายแรง"
case "2":
return "ไม่ร้ายแรง"
case "3":
return "ยุติเรื่อง"
case "1":
return "เสร็จสิ้นเเล้ว"
}
}
function activeStatus(val: string) {
@ -49,5 +82,12 @@ export const useInvestigateFactStore = defineStore("DisciplineInvestigateFact",
return {
fecthList,
rows,
daysExtendOps,
investigationOps,
faultOps,
filterFnOptionsType,
faultOp,
daysExtendOp,
investigationOp,
};
})

View file

@ -1,24 +1,62 @@
import { defineStore } from "pinia";
import { ref } from "vue";
import type { DataOption } from '@/modules/11_discipline/interface/index/Main'
export const useReportDataStore = defineStore("DisciplineReport11", () => {
interface OptionReport {
id: string;
title: string;
}
const optionReport = ref<OptionReport[]>([
{ id: "1", title: "รายงานเรื่องร้องเรียนแยกรายวัน รายเดือน รายปี" },
{ id: "2", title: "รายงานเรื่องร้องเรียนข้าราชการสามัญฯ ในสังกัดกรุงเทพมหานคร แยกตามหน่วยงาน" },
{ id: "3", title: "รายงานจำนวนข้าราชการสามัญฯ ที่กระทำความผิดทางวินัย แยกตามลักษณะความผิด" },
{ id: "4", title: "รายงานรายชื่อข้าราชการสามัญฯ ที่กระทำความผิดทางวินัยแยกตามลักษณะความผิด" },
{ id: "5", title: "รายงานจำนวนข้าราชการสามัญฯ ที่กระทำความผิดแยกตามระดับความผิด" },
{ id: "6", title: "รายงานรายชื่อข้าราชการสามัญฯ ที่กระทำความผิดทางวินัยแยกตามลักษณะความผิด" },
{ id: "7", title: "รายงานจำนวนข้าราชการสามัญฯ ที่กระทำความผิดทางวินัยแต่ยุติเรื่อง แยกลักษณะความผิด" },
{ id: "8", title: "รายงานจำนวนข้าราชการสามัญฯ ที่กระทำความผิดทางวินัยแต่ยุติเรื่อง แยกตามตำแหน่ง" },
const faultOp = ref<DataOption[]>();
const ocSelectOp = ref<DataOption[]>();
const governmentOp = ref<DataOption[]>();
const faultOps = ref<DataOption[]>([
{ id: "001", name: "ยังไม่ระบุ" },
{ id: "002", name: "ไม่ร้ายเเรง" },
{ id: "003", name: "ร้ายเเรง" },
]);
const ocSelectOps = ref<DataOption[]>([
{ id: "001", name: "กทม" },
{ id: "002", name: "กรุงเทพ" },
]);
const governmentOps = ref<DataOption[]>([
{ id: "001", name: "กทม" },
{ id: "002", name: "กรุงเทพ" },
{ id: "003", name: "bankok" },
]);
const optionReport = ref<DataOption[]>([
{ id: "1", name: "รายงานเรื่องร้องเรียนแยกรายวัน รายเดือน รายปี" },
{ id: "2", name: "รายงานเรื่องร้องเรียนข้าราชการสามัญฯ ในสังกัดกรุงเทพมหานคร แยกตามหน่วยงาน" },
{ id: "3", name: "รายงานจำนวนข้าราชการสามัญฯ ที่กระทำความผิดทางวินัย แยกตามลักษณะความผิด" },
{ id: "4", name: "รายงานรายชื่อข้าราชการสามัญฯ ที่กระทำความผิดทางวินัยแยกตามลักษณะความผิด" },
{ id: "5", name: "รายงานจำนวนข้าราชการสามัญฯ ที่กระทำความผิดแยกตามระดับความผิด" },
{ id: "6", name: "รายงานรายชื่อข้าราชการสามัญฯ ที่กระทำความผิดทางวินัยแยกตามลักษณะความผิด" },
{ id: "7", name: "รายงานจำนวนข้าราชการสามัญฯ ที่กระทำความผิดทางวินัยแต่ยุติเรื่อง แยกลักษณะความผิด" },
{ id: "8", name: "รายงานจำนวนข้าราชการสามัญฯ ที่กระทำความผิดทางวินัยแต่ยุติเรื่อง แยกตามตำแหน่ง" },
]);
function filterFnOptionsType(val: string, update: any, type: string) {
update(() => {
const needle = val.toLowerCase();
if (type === "ocSelectOp") {
ocSelectOp.value = ocSelectOps.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
} else if (type === "governmentOp") {
governmentOp.value = governmentOps.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
} else if (type === "faultOp") {
faultOp.value = faultOps.value.filter(
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
);
}
});
}
return {
optionReport,
filterFnOptionsType,
faultOp,
ocSelectOp,
governmentOp,
faultOps,
ocSelectOps,
governmentOps,
};
});