ปรับ interfeac
This commit is contained in:
parent
09b1b9f492
commit
cfc073e30c
16 changed files with 462 additions and 277 deletions
|
|
@ -16,7 +16,7 @@ export const useLeavelistDataStore = defineStore("leave", () => {
|
|||
const mainData = ref<any>([])
|
||||
const rows = ref<any>([])
|
||||
const loadTable = ref<boolean>(false)
|
||||
async function fecthList(data: any) {
|
||||
async function fetchList(data: any) {
|
||||
let datalist = data.map((e: any) => ({
|
||||
leaveType: e.leaveType,
|
||||
name: e.name,
|
||||
|
|
@ -161,7 +161,7 @@ export const useLeavelistDataStore = defineStore("leave", () => {
|
|||
amounttab2,
|
||||
//ข้อมูลในตาราง
|
||||
rows,
|
||||
fecthList,
|
||||
fetchList,
|
||||
loadTable,
|
||||
//filter table
|
||||
filterTable,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export const useWorklistDataStore = defineStore("work", () => {
|
|||
// ข้อมูลในตาราง
|
||||
const rows = ref<any>([])
|
||||
const dataMain = ref<any>([])
|
||||
function fecthList(data: any) {
|
||||
function fetchList(data: any) {
|
||||
let datalist = data.map((e: any) => ({
|
||||
fullName: e.fullName,
|
||||
timeIn: e.timeIn,
|
||||
|
|
@ -86,7 +86,7 @@ export const useWorklistDataStore = defineStore("work", () => {
|
|||
return {
|
||||
//ข้อมูลในตาราง
|
||||
rows,
|
||||
fecthList,
|
||||
fetchList,
|
||||
//ค้นหาข้อมูล
|
||||
filterTable,
|
||||
selectDate,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { useLeavelistDataStore } from "../stores/LeaveStore";
|
|||
import TableList from "../components/2_Leave/TableList.vue";
|
||||
|
||||
const leaveStore = useLeavelistDataStore();
|
||||
const { fecthList, clearFilter } = leaveStore;
|
||||
const { fetchList, clearFilter } = leaveStore;
|
||||
|
||||
onMounted(() => {
|
||||
fecthLeaveList();
|
||||
|
|
@ -39,7 +39,7 @@ function fecthLeaveList() {
|
|||
status: "2",
|
||||
},
|
||||
];
|
||||
fecthList(data); // ส่งข้อมูลไป stores
|
||||
fetchList(data); // ส่งข้อมูลไป stores
|
||||
}
|
||||
//เปลี่ยน Tab
|
||||
function changTab() {
|
||||
|
|
@ -51,7 +51,7 @@ function changTab() {
|
|||
<div class="toptitle text-dark col-12 row items-center">รายการลา</div>
|
||||
<div>
|
||||
<!-- <q-card flat bordered class="col-12 q-mt-sm"> -->
|
||||
<q-card bordered flat >
|
||||
<q-card bordered flat>
|
||||
<q-tabs
|
||||
v-model="leaveStore.tab"
|
||||
dense
|
||||
|
|
@ -66,7 +66,6 @@ function changTab() {
|
|||
@click="changTab"
|
||||
name="1"
|
||||
label="รายการลาที่อยู่ระหว่างดำเนิดการ"
|
||||
|
||||
>
|
||||
<q-badge
|
||||
color="grey-4"
|
||||
|
|
@ -79,12 +78,7 @@ function changTab() {
|
|||
rounded
|
||||
/>
|
||||
</q-tab>
|
||||
<q-tab
|
||||
@click="changTab"
|
||||
name="2"
|
||||
label="รายการลาทั้งหมด"
|
||||
|
||||
>
|
||||
<q-tab @click="changTab" name="2" label="รายการลาทั้งหมด">
|
||||
<q-badge
|
||||
color="grey-4"
|
||||
:class="
|
||||
|
|
@ -110,7 +104,7 @@ function changTab() {
|
|||
<TableList />
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
<!-- </q-card> -->
|
||||
<!-- </q-card> -->
|
||||
</q-card>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import TableList from "../components/1_Work/TableList.vue";
|
|||
const mixin = useCounterMixin();
|
||||
const workStore = useWorklistDataStore();
|
||||
const { date2Thai } = mixin;
|
||||
const { fecthList } = workStore;
|
||||
const { fetchList } = workStore;
|
||||
|
||||
onMounted(() => {
|
||||
fecthWorkList();
|
||||
|
|
@ -66,7 +66,7 @@ function fecthWorkList() {
|
|||
status: "1",
|
||||
},
|
||||
];
|
||||
fecthList(listData); // ส่งข้อมูลไปยัง stores
|
||||
fetchList(listData); // ส่งข้อมูลไปยัง stores
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import { ref, onMounted, reactive, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
// import Type
|
||||
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
|
||||
import type {
|
||||
DataOption,
|
||||
FormData,
|
||||
MyObjectComplaintsRef,
|
||||
} from "../../interface/index/Main";
|
||||
|
||||
} from "@/modules/11_discipline/interface/request/complaint";
|
||||
// importStroe
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useComplainstDataStore } from "../../store/ComplaintsStore";
|
||||
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||
|
||||
const $q = useQuasar();
|
||||
const router = useRouter();
|
||||
|
|
@ -19,7 +19,7 @@ const mixin = useCounterMixin();
|
|||
const { date2Thai, dialogConfirm } = mixin; //function จาก stores หลัก
|
||||
|
||||
const complainstStore = useComplainstDataStore();
|
||||
const { selectComplainantTpye, filterSelector, fectOptioin } = complainstStore; // function จาก store complainstStore
|
||||
const { selectComplainantTpye, filterSelector, fetchOptioin } = complainstStore; // function จาก store complainstStore
|
||||
|
||||
// options ทั้งหมด
|
||||
const complainantoptions = ref<DataOption[]>([
|
||||
|
|
@ -52,38 +52,40 @@ const receivecomplaintstoptions = ref<DataOption[]>([
|
|||
{ id: "6", name: "บอกกล่าว" },
|
||||
]);
|
||||
// ข้อมูล form
|
||||
const complainantType = ref<string>("");
|
||||
const complainant = ref<string>(""); // รายชื่อจากทะเบียน
|
||||
const office = ref<string>(""); // สำนักงาน
|
||||
const agency = ref<string>("");
|
||||
const topicComplaint = ref<string>("");
|
||||
const detail = ref<string>("");
|
||||
const datereceive = ref<Date>();
|
||||
const dateconsideration = ref<Date>();
|
||||
const offenseDescription = ref<string>("");
|
||||
const considerationLevel = ref<string>("");
|
||||
const datewarn = ref<Date>();
|
||||
const receivecomplaints = ref<string>("");
|
||||
const petitioner = ref<string>("");
|
||||
const files = ref<any>();
|
||||
const formData = reactive<FormData>({
|
||||
complainantType: "",
|
||||
complainant: "",
|
||||
office: "",
|
||||
agency: "",
|
||||
topicComplaint: "",
|
||||
detail: "",
|
||||
datereceive: null,
|
||||
dateconsideration: null,
|
||||
offenseDescription: "",
|
||||
considerationLevel: "",
|
||||
datewarn: null,
|
||||
receivecomplaints: "",
|
||||
petitioner: "",
|
||||
files: null,
|
||||
});
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
|
||||
onMounted(() => {
|
||||
fectOptioin(complainantoptions.value, agencytoptions.value);
|
||||
fetchOptioin(complainantoptions.value, agencytoptions.value);
|
||||
});
|
||||
// เลือกผู้ร้องเรียน
|
||||
async function selectComplainant(val: string) {
|
||||
complainant.value = "";
|
||||
office.value = "";
|
||||
agency.value = "";
|
||||
formData.complainant = "";
|
||||
formData.office = "";
|
||||
formData.agency = "";
|
||||
if (val === "0") {
|
||||
await fectListname(); // ถ้าเลือกบุกคลจะเรียก function fectListname เรียกรายชื่อจากทะเบียน
|
||||
await fetchListname(); // ถ้าเลือกบุกคลจะเรียก function fetchListname เรียกรายชื่อจากทะเบียน
|
||||
} else if (val === "1") {
|
||||
await fectOffice(); // ถ้าเลือกหน่วยงานจะเรียก function fectOffice เรียกโครงสร้างสำนักงาน
|
||||
await fetchOffice(); // ถ้าเลือกหน่วยงานจะเรียก function fetchOffice เรียกโครงสร้างสำนักงาน
|
||||
}
|
||||
}
|
||||
// เรียกรายชื่อ
|
||||
async function fectListname() {
|
||||
async function fetchListname() {
|
||||
const listName = [
|
||||
{
|
||||
id: "1",
|
||||
|
|
@ -101,7 +103,7 @@ async function fectListname() {
|
|||
selectComplainantTpye(listName);
|
||||
}
|
||||
// เรียกโครงสร้างสำนักงาน
|
||||
async function fectOffice() {
|
||||
async function fetchOffice() {
|
||||
// const listOffice = [
|
||||
// {
|
||||
// id: "1",
|
||||
|
|
@ -134,29 +136,35 @@ function selectLevel(val: string) {
|
|||
dayNum = 15; // ด่วนมาก
|
||||
}
|
||||
// วันแจ้งเตือนล่วงหน้า
|
||||
if (dateconsideration.value) {
|
||||
const currentDate = new Date(dateconsideration.value);
|
||||
if (formData.dateconsideration) {
|
||||
const currentDate = new Date(formData.dateconsideration);
|
||||
const newDate = new Date(
|
||||
currentDate.getTime() + dayNum * 24 * 60 * 60 * 1000
|
||||
);
|
||||
datewarn.value = newDate;
|
||||
formData.datewarn = newDate;
|
||||
}
|
||||
}
|
||||
watch(formData, () => {
|
||||
if (formData.considerationLevel !== "") {
|
||||
selectLevel(formData.considerationLevel);
|
||||
}
|
||||
});
|
||||
|
||||
// validateForm
|
||||
const complainantTypeRef = ref<any>(null);
|
||||
const complainantRef = ref<any>(null);
|
||||
const officeRef = ref<any>(null);
|
||||
const agencyRef = ref<any>(null);
|
||||
const topicComplaintRef = ref<any>(null);
|
||||
const detailRef = ref<any>(null);
|
||||
const datereceiveRef = ref<any>();
|
||||
const dateconsiderationRef = ref<any>(null);
|
||||
const offenseDescriptionRef = ref<any>(null);
|
||||
const considerationLevelRef = ref<any>(null);
|
||||
const datewarnRef = ref<any>(null);
|
||||
const receivecomplaintsRef = ref<any>(null);
|
||||
const petitionerRef = ref<any>(null);
|
||||
const filesRef = ref<any>(null);
|
||||
const complainantTypeRef = ref<Object | null>(null);
|
||||
const complainantRef = ref<Object | null>(null);
|
||||
const officeRef = ref<Object | null>(null);
|
||||
const agencyRef = ref<Object | null>(null);
|
||||
const topicComplaintRef = ref<Object | null>(null);
|
||||
const detailRef = ref<Object | null>(null);
|
||||
const datereceiveRef = ref<Object | null>();
|
||||
const dateconsiderationRef = ref<Object | null>(null);
|
||||
const offenseDescriptionRef = ref<Object | null>(null);
|
||||
const considerationLevelRef = ref<Object | null>(null);
|
||||
const datewarnRef = ref<Object | null>(null);
|
||||
const receivecomplaintsRef = ref<Object | null>(null);
|
||||
const petitionerRef = ref<Object | null>(null);
|
||||
const filesRef = ref<Object | null>(null);
|
||||
|
||||
const objectComplaintsRef: MyObjectComplaintsRef = {
|
||||
complainantType: complainantTypeRef,
|
||||
|
|
@ -195,7 +203,9 @@ function validateForm() {
|
|||
function onSubmit() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {},
|
||||
async () => {
|
||||
console.log(formData);
|
||||
},
|
||||
"ยืนยันการบันทึกข้อมูล",
|
||||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
|
|
@ -222,12 +232,13 @@ function onSubmit() {
|
|||
<div
|
||||
class="col-xs-12 col-sm-12 row q-col-gutter-x-md q-col-gutter-y-xs"
|
||||
>
|
||||
<div class="col-xs-12 col-sm-2">
|
||||
<div class="col-xs-12 col-sm-2" id="complainantType">
|
||||
<q-select
|
||||
for="complainantType"
|
||||
ref="complainantTypeRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="complainantType"
|
||||
v-model="formData.complainantType"
|
||||
:options="complainstStore.complainantoptions"
|
||||
label="ผู้ร้องเรียน"
|
||||
option-value="id"
|
||||
|
|
@ -236,7 +247,9 @@ function onSubmit() {
|
|||
map-options
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกผู้ร้องเรียน'}`]"
|
||||
lazy-rules
|
||||
@update:model-value="selectComplainant(complainantType)"
|
||||
@update:model-value="
|
||||
selectComplainant(formData.complainantType)
|
||||
"
|
||||
use-input
|
||||
@filter="(inputValue: any,
|
||||
doneFn: Function) => filterSelector(inputValue, doneFn, 'filtercomplainantType'
|
||||
|
|
@ -252,12 +265,17 @@ function onSubmit() {
|
|||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-2" v-if="complainantType === '0'">
|
||||
<div
|
||||
class="col-xs-12 col-sm-2"
|
||||
id="complainant"
|
||||
v-if="formData.complainantType === '0'"
|
||||
>
|
||||
<q-select
|
||||
for="complainant"
|
||||
ref="complainantRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="complainant"
|
||||
v-model="formData.complainant"
|
||||
:options="complainstStore.optionListName"
|
||||
label="รายชื่อจากทะเบียรประวัติ"
|
||||
option-value="id"
|
||||
|
|
@ -279,23 +297,30 @@ function onSubmit() {
|
|||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-2" v-if="complainantType === '1'">
|
||||
<div
|
||||
class="col-xs-12 col-sm-2"
|
||||
v-if="formData.complainantType === '1'"
|
||||
id="office"
|
||||
>
|
||||
<q-input
|
||||
for="office"
|
||||
name="office"
|
||||
ref="officeRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="office"
|
||||
v-model="formData.office"
|
||||
label="เลือกสำนักงาน"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกสำนักงาน'}`]"
|
||||
lazy-rules
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-2">
|
||||
<div class="col-xs-12 col-sm-2" id="agency">
|
||||
<q-select
|
||||
ref="agencyRef"
|
||||
for="agency"
|
||||
dense
|
||||
outlined
|
||||
v-model="agency"
|
||||
v-model="formData.agency"
|
||||
:options="complainstStore.agencytoptions"
|
||||
label="หน่วยงานที่พิจารณา"
|
||||
option-value="id"
|
||||
|
|
@ -318,12 +343,13 @@ function onSubmit() {
|
|||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12">
|
||||
<div class="col-xs-12 col-sm-12" id="topicComplaint">
|
||||
<q-input
|
||||
for="topicComplaint"
|
||||
ref="topicComplaintRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="topicComplaint"
|
||||
v-model="formData.topicComplaint"
|
||||
:rules="[(val) => !!val || 'กรุณาการข้อมูล']"
|
||||
lazy-rules
|
||||
label="เรื่องร้องเรียน"
|
||||
|
|
@ -331,12 +357,13 @@ function onSubmit() {
|
|||
rows="5"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12">
|
||||
<div class="col-xs-12 col-sm-12" id="detail">
|
||||
<q-input
|
||||
for="detail"
|
||||
ref="detailRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="detail"
|
||||
v-model="formData.detail"
|
||||
:rules="[(val) => !!val || 'กรุณาการข้อมูล']"
|
||||
lazy-rules
|
||||
label="รายละเอียดที่เกี่นวข้องกับเรื่องที่ต้องการจะข้อเรียน"
|
||||
|
|
@ -344,10 +371,10 @@ function onSubmit() {
|
|||
rows="5"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-2">
|
||||
<div class="col-xs-12 col-sm-2" id="datereceive">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="datereceive"
|
||||
v-model="formData.datereceive"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
|
|
@ -362,12 +389,15 @@ function onSubmit() {
|
|||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
for="datereceive"
|
||||
ref="datereceiveRef"
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
datereceive != null ? date2Thai(datereceive) : null
|
||||
formData.datereceive != null
|
||||
? date2Thai(formData.datereceive)
|
||||
: null
|
||||
"
|
||||
label="วันที่รับเรื่อง"
|
||||
:rules="[
|
||||
|
|
@ -387,10 +417,10 @@ function onSubmit() {
|
|||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-2">
|
||||
<div class="col-xs-12 col-sm-2" id="dateconsideration">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateconsideration"
|
||||
v-model="formData.dateconsideration"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
|
|
@ -405,13 +435,14 @@ function onSubmit() {
|
|||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
for="dateconsideration"
|
||||
ref="dateconsiderationRef"
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker"
|
||||
:model-value="
|
||||
dateconsideration != null
|
||||
? date2Thai(dateconsideration)
|
||||
formData.dateconsideration != null
|
||||
? date2Thai(formData.dateconsideration)
|
||||
: null
|
||||
"
|
||||
label="วันที่กำหนดวันพิจารณา"
|
||||
|
|
@ -432,12 +463,13 @@ function onSubmit() {
|
|||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-2">
|
||||
<div class="col-xs-12 col-sm-2" id="offenseDescription">
|
||||
<q-select
|
||||
for="offenseDescription"
|
||||
ref="offenseDescriptionRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="offenseDescription"
|
||||
v-model="formData.offenseDescription"
|
||||
:options="offenseDescriptiontoptions"
|
||||
label="ลักษณะความผิด"
|
||||
option-value="id"
|
||||
|
|
@ -448,12 +480,13 @@ function onSubmit() {
|
|||
lazy-rules
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-2">
|
||||
<div class="col-xs-12 col-sm-2" id="considerationLevel">
|
||||
<q-select
|
||||
for="considerationLevel"
|
||||
ref="considerationLevelRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="considerationLevel"
|
||||
v-model="formData.considerationLevel"
|
||||
:options="considerationLeveltoptions"
|
||||
label="ระดับการพิจารณา"
|
||||
option-value="id"
|
||||
|
|
@ -462,14 +495,14 @@ function onSubmit() {
|
|||
map-options
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกระดับการพิจารณา'}`]"
|
||||
lazy-rules
|
||||
@update:model-value="selectLevel(considerationLevel)"
|
||||
@update:model-value="selectLevel(formData.considerationLevel)"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3"></div>
|
||||
<div class="col-xs-12 col-sm-2">
|
||||
<div class="col-xs-12 col-sm-2" id="datewarn">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="datewarn"
|
||||
v-model="formData.datewarn"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
|
|
@ -484,11 +517,16 @@ function onSubmit() {
|
|||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
for="datewarn"
|
||||
ref="datewarnRef"
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker"
|
||||
:model-value="datewarn != null ? date2Thai(datewarn) : null"
|
||||
:model-value="
|
||||
formData.datewarn != null
|
||||
? date2Thai(formData.datewarn)
|
||||
: null
|
||||
"
|
||||
label="วันที่แจ้งเตือนล่วงหน้า"
|
||||
:rules="[
|
||||
(val) =>
|
||||
|
|
@ -508,12 +546,13 @@ function onSubmit() {
|
|||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-2">
|
||||
<div class="col-xs-12 col-sm-2" id="receivecomplaints">
|
||||
<q-select
|
||||
for="receivecomplaints"
|
||||
ref="receivecomplaintsRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="receivecomplaints"
|
||||
v-model="formData.receivecomplaints"
|
||||
:options="receivecomplaintstoptions"
|
||||
label="รับเรื่องร้องเรียน"
|
||||
option-value="id"
|
||||
|
|
@ -525,24 +564,26 @@ function onSubmit() {
|
|||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6"></div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<div class="col-xs-12 col-sm-4" id="petitioner">
|
||||
<q-input
|
||||
id="petitioner"
|
||||
ref="petitionerRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="petitioner"
|
||||
v-model="formData.petitioner"
|
||||
label="ผู้ร้องเรียน"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกข้อมูล'}`]"
|
||||
lazy-rules
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<div class="col-xs-12 col-sm-4" id="files">
|
||||
<q-file
|
||||
for="files"
|
||||
ref="filesRef"
|
||||
class="col-xs-12 col-sm-10"
|
||||
outlined
|
||||
dense
|
||||
v-model="files"
|
||||
v-model="formData.files"
|
||||
@added="fileUploadDoc"
|
||||
label="ไฟล์เอกสารหลักฐาน"
|
||||
hide-bottom-space
|
||||
|
|
@ -562,6 +603,7 @@ function onSubmit() {
|
|||
<div class="row col-12 q-pa-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
id="onSubmit"
|
||||
flat
|
||||
round
|
||||
color="secondary"
|
||||
|
|
|
|||
|
|
@ -2,12 +2,15 @@
|
|||
import { ref, onMounted } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
import type { DataList } from "@/modules/11_discipline/interface/response/complaint";
|
||||
// importStroe
|
||||
import { useComplainstDataStore } from "../../store/ComplaintsStore";
|
||||
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const complainstStore = useComplainstDataStore();
|
||||
const { fectComplainst } = complainstStore; // function จาก stores
|
||||
const { fetchComplainst } = complainstStore; // function จาก stores
|
||||
|
||||
//ข้อมูล Table
|
||||
const filterTable = ref<string>("");
|
||||
|
|
@ -96,12 +99,12 @@ const visibleColumns = ref<string[]>([
|
|||
"considerationDeadlineDate",
|
||||
]);
|
||||
onMounted(async () => {
|
||||
await fecthListComplaints();
|
||||
await fetchListComplaints();
|
||||
});
|
||||
|
||||
// เรีนกรายการเรื่องร้องเรียน
|
||||
async function fecthListComplaints() {
|
||||
const listData = [
|
||||
async function fetchListComplaints() {
|
||||
const listData: DataList[] = [
|
||||
{
|
||||
subject: "ทุจริตในหน้าที่",
|
||||
detail: "มีข้อร้องเรียนเรื่องการทุจริตทางการเงิน",
|
||||
|
|
@ -131,7 +134,7 @@ async function fecthListComplaints() {
|
|||
considerationDeadlineDate: "2023-11-01",
|
||||
},
|
||||
];
|
||||
await fectComplainst(listData);
|
||||
await fetchComplainst(listData);
|
||||
}
|
||||
function redirectToPageadd() {
|
||||
router.push(`/discipline/complaints/add`);
|
||||
|
|
@ -157,6 +160,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
<div class="q-pa-md">
|
||||
<q-toolbar style="padding: 0" class="q-gutter-sm q-mb-md">
|
||||
<q-btn
|
||||
id="addComplaints"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
|
|
@ -167,10 +171,19 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
>
|
||||
<q-space />
|
||||
<div class="col-2">
|
||||
<q-input dense outlined v-model="filterTable" label="ค้นหา" />
|
||||
<q-input
|
||||
id="filterTable"
|
||||
for="filterTable"
|
||||
dense
|
||||
outlined
|
||||
v-model="filterTable"
|
||||
label="ค้นหา"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<q-select
|
||||
id="visibleColumns"
|
||||
for="visibleColumns"
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
|
|
@ -186,6 +199,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
</div>
|
||||
</q-toolbar>
|
||||
<d-table
|
||||
id="table"
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="complainstStore.rows"
|
||||
|
|
@ -209,46 +223,21 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer" style="height: 40px">
|
||||
<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="detail" :props="props">
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.detail }}
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-if="col.name == 'detail'">
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.detail }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="complainant" :props="props">
|
||||
{{ props.row.complainant }}
|
||||
</q-td>
|
||||
<q-td key="offenseDescription" :props="props">
|
||||
{{ props.row.offenseDescription }}
|
||||
</q-td>
|
||||
<q-td key="creationDate" :props="props">
|
||||
{{ props.row.creationDate }}
|
||||
</q-td>
|
||||
<q-td key="considerationLevel" :props="props">
|
||||
{{ props.row.considerationLevel }}
|
||||
</q-td>
|
||||
<q-td key="considerationDeadlineDate" :props="props">
|
||||
{{ props.row.considerationDeadlineDate }}
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</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> -->
|
||||
</d-table>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
|
|||
|
|
@ -2,13 +2,14 @@
|
|||
import { ref, onMounted } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { DataList } from "../../interface/response/order";
|
||||
|
||||
// importStroe
|
||||
import { useOrderStore } from "../../store/OrderStore";
|
||||
import { useOrderStore } from "@/modules/11_discipline/store/OrderStore";
|
||||
|
||||
const router = useRouter();
|
||||
const OrderStore = useOrderStore();
|
||||
const { fecthOrder } = OrderStore; // function จาก stores
|
||||
const { fetchOrder } = OrderStore; // function จาก stores
|
||||
|
||||
// ข้อมูล table
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -78,12 +79,12 @@ const visibleColumns = ref<string[]>([
|
|||
const filterTable = ref<string>("");
|
||||
|
||||
onMounted(async () => {
|
||||
await fecthListOrder();
|
||||
await fetchListOrder();
|
||||
});
|
||||
|
||||
// เรียกรายการคำสั่ง จาก API
|
||||
async function fecthListOrder() {
|
||||
const listData = [
|
||||
async function fetchListOrder() {
|
||||
const listData: DataList[] = [
|
||||
{
|
||||
subject: "ทุจริตในหน้าที่",
|
||||
ordernumber: "1/2556",
|
||||
|
|
@ -109,7 +110,7 @@ async function fecthListOrder() {
|
|||
statusorder: "เสร็จสิ้นแล้ว",
|
||||
},
|
||||
];
|
||||
await fecthOrder(listData); // ส่งข้อมูลไปยัง stores
|
||||
await fetchOrder(listData); // ส่งข้อมูลไปยัง stores
|
||||
}
|
||||
|
||||
// redirect ไปยังการเพิ่มออกคำสั่งลงโทษทางวินัย
|
||||
|
|
@ -139,6 +140,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
<div class="q-pa-md">
|
||||
<q-toolbar style="padding: 0" class="q-gutter-sm q-mb-md">
|
||||
<q-btn
|
||||
id="addDisciplineOrder"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
|
|
@ -149,10 +151,17 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
>
|
||||
<q-space />
|
||||
<div class="col-2">
|
||||
<q-input dense outlined v-model="filterTable" label="ค้นหา" />
|
||||
<q-input
|
||||
for="filterTable"
|
||||
dense
|
||||
outlined
|
||||
v-model="filterTable"
|
||||
label="ค้นหา"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<q-select
|
||||
for="visibleColumns"
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
|
|
@ -168,6 +177,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
</div>
|
||||
</q-toolbar>
|
||||
<d-table
|
||||
for="table"
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:rows="OrderStore.rows"
|
||||
|
|
@ -191,40 +201,13 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer" style="height: 40px">
|
||||
<q-td key="subject" :props="props">
|
||||
{{ props.row.subject }}
|
||||
</q-td>
|
||||
<q-td key="ordernumber" :props="props">
|
||||
{{ props.row.ordernumber }}
|
||||
</q-td>
|
||||
<q-td key="dateOrder" :props="props">
|
||||
{{ props.row.dateOrder }}
|
||||
</q-td>
|
||||
<q-td key="orderby" :props="props">
|
||||
<div class="table_ellipsis">
|
||||
{{ props.row.orderby }}
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="signer" :props="props">
|
||||
{{ props.row.signer }}
|
||||
</q-td>
|
||||
<q-td key="statusorder" :props="props">
|
||||
{{ props.row.statusorder }}
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</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> -->
|
||||
</d-table>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ import { ref } from "vue";
|
|||
import { useRouter } from "vue-router";
|
||||
|
||||
// import step
|
||||
import step01 from "./Step01.vue";
|
||||
import step02 from "./Step02.vue";
|
||||
import step03 from "./Step03.vue";
|
||||
import step01 from "@/modules/11_discipline/components/4_Order/Step01.vue";
|
||||
import step02 from "@/modules/11_discipline/components/4_Order/Step02.vue";
|
||||
import step03 from "@/modules/11_discipline/components/4_Order/Step03.vue";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { ref, reactive } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import type { DataOption, MyObjectRef } from "../../interface/index/Main";
|
||||
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
|
||||
import type {
|
||||
FormData,
|
||||
MyObjectRef,
|
||||
} from "@/modules/11_discipline/interface/request/order";
|
||||
// importStroe
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
|
|
@ -38,28 +42,30 @@ const listInvestigationOptions = ref<DataOption[]>([
|
|||
{ id: "2", name: "รายการสอบสวนความผิดทางวินัย 3" },
|
||||
]);
|
||||
// ตัวแปรทั้งหมด
|
||||
const orderType = ref<string>("");
|
||||
const orderBy = ref<string>("");
|
||||
const listInvestigation = ref<string>("");
|
||||
const authority = ref<string>("");
|
||||
const orderNumber = ref<string>();
|
||||
const dateYear = ref<number>(2023);
|
||||
const date = ref<Date | null>(null);
|
||||
const authorityPosition = ref<string>("");
|
||||
const subject = ref<string>("");
|
||||
const mistakeDetail = ref<string>("");
|
||||
const formData = reactive<FormData>({
|
||||
orderType: "",
|
||||
orderBy: "",
|
||||
listInvestigation: "",
|
||||
authority: "",
|
||||
orderNumber: "",
|
||||
dateYear: 0,
|
||||
date: null,
|
||||
authorityPosition: "",
|
||||
subject: "",
|
||||
mistakeDetail: "",
|
||||
});
|
||||
|
||||
// validateForm
|
||||
const orderTypeRef = ref<any>(null);
|
||||
const orderByRef = ref<any>(null);
|
||||
const listInvestigationRef = ref<any>(null);
|
||||
const authorityRef = ref<any>(null);
|
||||
const orderNumberRef = ref<any>(null);
|
||||
const dateYearRef = ref<any>(null);
|
||||
const dateRef = ref<any>(null);
|
||||
const authorityPositionRef = ref<any>(null);
|
||||
const subjectRef = ref<any>(null);
|
||||
const mistakeDetailRef = ref<any>(null);
|
||||
const orderTypeRef = ref<Object | null>(null);
|
||||
const orderByRef = ref<Object | null>(null);
|
||||
const listInvestigationRef = ref<Object | null>(null);
|
||||
const authorityRef = ref<Object | null>(null);
|
||||
const orderNumberRef = ref<Object | null>(null);
|
||||
const dateYearRef = ref<Object | null>(null);
|
||||
const dateRef = ref<Object | null>(null);
|
||||
const authorityPositionRef = ref<Object | null>(null);
|
||||
const subjectRef = ref<Object | null>(null);
|
||||
const mistakeDetailRef = ref<Object | null>(null);
|
||||
const myObjectRef: MyObjectRef = {
|
||||
orderType: orderTypeRef,
|
||||
orderBy: orderByRef,
|
||||
|
|
@ -91,6 +97,7 @@ function validateForm() {
|
|||
}
|
||||
|
||||
function onSubmit() {
|
||||
console.log(formData);
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
|
|
@ -109,10 +116,11 @@ function onSubmit() {
|
|||
<div class="col-xs-12 col-sm-6">
|
||||
ประเภทคำสั่ง
|
||||
<q-select
|
||||
for="orderType"
|
||||
ref="orderTypeRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="orderType"
|
||||
v-model="formData.orderType"
|
||||
:options="orderTypeOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
|
|
@ -126,10 +134,11 @@ function onSubmit() {
|
|||
<div class="col-xs-12 col-sm-6">
|
||||
คำสั่งโดย
|
||||
<q-select
|
||||
for="orderBy"
|
||||
ref="orderByRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="orderBy"
|
||||
v-model="formData.orderBy"
|
||||
:options="orderByOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
|
|
@ -143,10 +152,11 @@ function onSubmit() {
|
|||
<div class="col-xs-12 col-sm-6">
|
||||
เลือกรายการสอบสวนความผิดทางวินัย
|
||||
<q-select
|
||||
for="listInvestigation"
|
||||
ref="listInvestigationRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="listInvestigation"
|
||||
v-model="formData.listInvestigation"
|
||||
:options="listInvestigationOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
|
|
@ -162,10 +172,11 @@ function onSubmit() {
|
|||
<div class="col-xs-12 col-sm-6">
|
||||
ผู้มีอำนาจลงนาม
|
||||
<q-input
|
||||
for="authority"
|
||||
ref="authorityRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="authority"
|
||||
v-model="formData.authority"
|
||||
placeholder="กรอกผู้มีอำนาจลงนาม"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกผู้มีอำนาจลงนาม'}`]"
|
||||
lazy-rules
|
||||
|
|
@ -175,10 +186,11 @@ function onSubmit() {
|
|||
<div class="col-6">
|
||||
คำสั่งที่
|
||||
<q-input
|
||||
for="orderNumber"
|
||||
ref="orderNumberRef"
|
||||
outlined
|
||||
dense
|
||||
v-model="orderNumber"
|
||||
v-model="formData.orderNumber"
|
||||
hide-bottom-space
|
||||
:rules="[(val) => !!val || `${'กรุณากรอรคำสั่งที่'}`]"
|
||||
lazy-rules
|
||||
|
|
@ -191,7 +203,7 @@ function onSubmit() {
|
|||
<div class="col-5">
|
||||
พศ
|
||||
<datepicker
|
||||
v-model="dateYear"
|
||||
v-model="formData.dateYear"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
|
|
@ -204,9 +216,10 @@ function onSubmit() {
|
|||
<template #trigger>
|
||||
<q-input
|
||||
ref="dateYearRef"
|
||||
:model-value="dateYear + 543"
|
||||
:model-value="
|
||||
formData.dateYear ? formData.dateYear + 543 : null
|
||||
"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก พ.ศ.'}`]"
|
||||
:label="`${'พ.ศ.'}`"
|
||||
dense
|
||||
outlined
|
||||
>
|
||||
|
|
@ -219,7 +232,7 @@ function onSubmit() {
|
|||
วันที่มีผลคำสั่ง
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="date"
|
||||
v-model="formData.date"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
|
|
@ -234,11 +247,14 @@ function onSubmit() {
|
|||
</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
for="date"
|
||||
ref="dateRef"
|
||||
outlined
|
||||
dense
|
||||
class="full-width datepicker"
|
||||
:model-value="date != null ? date2Thai(date) : null"
|
||||
:model-value="
|
||||
formData.date != null ? date2Thai(formData.date) : null
|
||||
"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่มีผลคำสั่ง'}`]"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
|
|
@ -256,10 +272,11 @@ function onSubmit() {
|
|||
<div class="col-xs-12 col-sm-6">
|
||||
ตำแหน่งผู้มีอำนาจลงนาม
|
||||
<q-input
|
||||
for="authorityPosition"
|
||||
ref="authorityPositionRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="authorityPosition"
|
||||
v-model="formData.authorityPosition"
|
||||
placeholder="กรอกตำแหน่งผู้มีอำนาจลงนาม"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งผู้มีอำนาจลงนาม'}`]"
|
||||
lazy-rules
|
||||
|
|
@ -268,10 +285,11 @@ function onSubmit() {
|
|||
<div class="col-xs-12 col-sm-6">
|
||||
คำสั่งเรื่อง
|
||||
<q-input
|
||||
for="subject"
|
||||
ref="subjectRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="subject"
|
||||
v-model="formData.subject"
|
||||
placeholder="กรอกคำสั่งเรื่อง"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่งเรื่อง'}`]"
|
||||
lazy-rules
|
||||
|
|
@ -280,10 +298,11 @@ function onSubmit() {
|
|||
<div class="col-xs-12 col-sm-12">
|
||||
รายละเอียดการกระทำความผิด
|
||||
<q-input
|
||||
for="mistakeDetail"
|
||||
ref="mistakeDetailRef"
|
||||
dense
|
||||
outlined
|
||||
v-model="mistakeDetail"
|
||||
v-model="formData.mistakeDetail"
|
||||
placeholder="กรอกรายละเอียดการกระทำความผิด"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่งเรื่อง'}`]"
|
||||
lazy-rules
|
||||
|
|
@ -295,6 +314,7 @@ function onSubmit() {
|
|||
</div>
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
for="submit"
|
||||
flat
|
||||
round
|
||||
unelevated
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, watch } from "vue";
|
||||
import type { FormData, FormRef } from "@/modules/11_discipline/interface/request/director";
|
||||
import type {
|
||||
FormData,
|
||||
FormRef,
|
||||
} from "@/modules/11_discipline/interface/request/director";
|
||||
|
||||
// รับ props มาจาก page หลัก
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
default: null
|
||||
default: null,
|
||||
},
|
||||
onSubmit: {
|
||||
type: Function,
|
||||
|
|
@ -16,7 +19,7 @@ const props = defineProps({
|
|||
|
||||
// ข้อมูลรหัสบัตรประชาชน
|
||||
const idCard = ref<string>("");
|
||||
const idCardRef = ref<any>(null)
|
||||
const idCardRef = ref<any>(null);
|
||||
|
||||
// ข้อมูลทั้งก้อน form
|
||||
const formData = reactive<FormData>({
|
||||
|
|
@ -30,31 +33,31 @@ const formData = reactive<FormData>({
|
|||
});
|
||||
|
||||
watch(props.data, async () => {
|
||||
console.log("data==>", props.data)
|
||||
formData.prefix = props.data.prefix
|
||||
formData.firstname = props.data.firstname
|
||||
formData.lastname = props.data.lastname
|
||||
formData.position = props.data.position
|
||||
formData.phone = props.data.phone
|
||||
formData.responsibilities = props.data.responsibilities
|
||||
formData.email = props.data.email
|
||||
console.log("data==>", props.data);
|
||||
formData.prefix = props.data.prefix;
|
||||
formData.firstname = props.data.firstname;
|
||||
formData.lastname = props.data.lastname;
|
||||
formData.position = props.data.position;
|
||||
formData.phone = props.data.phone;
|
||||
formData.responsibilities = props.data.responsibilities;
|
||||
formData.email = props.data.email;
|
||||
});
|
||||
|
||||
// เพิ่มบุคลากร
|
||||
function addEmployee() {
|
||||
if (idCardRef.value.validate()) {
|
||||
console.log("idCard===>", idCard.value)
|
||||
console.log("idCard===>", idCard.value);
|
||||
}
|
||||
}
|
||||
|
||||
// ตรวจสอบข้อมูลก่อนส่งไปยัง api
|
||||
const prefixRef = ref<object | null>(null)
|
||||
const firstnameRef = ref<object | null>(null)
|
||||
const lastnameRef = ref<object | null>(null)
|
||||
const positionRef = ref<object | null>(null)
|
||||
const phoneRef = ref<object | null>(null)
|
||||
const responsibilitiesRef = ref<object | null>(null)
|
||||
const emailRef = ref<object | null>(null)
|
||||
const prefixRef = ref<object | null>(null);
|
||||
const firstnameRef = ref<object | null>(null);
|
||||
const lastnameRef = ref<object | null>(null);
|
||||
const positionRef = ref<object | null>(null);
|
||||
const phoneRef = ref<object | null>(null);
|
||||
const responsibilitiesRef = ref<object | null>(null);
|
||||
const emailRef = ref<object | null>(null);
|
||||
const formRef: FormRef = {
|
||||
prefix: prefixRef,
|
||||
firstname: firstnameRef,
|
||||
|
|
@ -62,7 +65,7 @@ const formRef: FormRef = {
|
|||
position: positionRef,
|
||||
phone: phoneRef,
|
||||
responsibilities: responsibilitiesRef,
|
||||
email: emailRef
|
||||
email: emailRef,
|
||||
};
|
||||
|
||||
function onValidate() {
|
||||
|
|
@ -77,69 +80,127 @@ function onValidate() {
|
|||
}
|
||||
}
|
||||
if (hasError.every((result) => result === true)) {
|
||||
props.onSubmit()
|
||||
props.onSubmit();
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<form @submit.prevent.stop="onValidate" class="q-gutter-md">
|
||||
<div class="col-12">
|
||||
|
||||
<q-card bordered>
|
||||
|
||||
<div class="row q-pa-md q-col-gutter-sm">
|
||||
<div class="col-md-3 row q-pa-md text-bold">
|
||||
<label>ค้นหาบุคคลากรที่อยู่ในระบบ</label>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<q-input dense outlined v-model="idCard" label="รหัสบัตรประชาชน" ref="idCardRef"
|
||||
:rules="[(val: string) => !!val || `${'กรุณากรอกรหัสบัตรประชาชน'}`]" />
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="idCard"
|
||||
label="รหัสบัตรประชาชน"
|
||||
ref="idCardRef"
|
||||
:rules="[(val: string) => !!val || `${'กรุณากรอกรหัสบัตรประชาชน'}`]"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<q-btn unelevated dense color="primary" class="q-px-md q-py-sm" @click="addEmployee" label="เพิ่มบุคลากร" />
|
||||
<q-btn
|
||||
unelevated
|
||||
dense
|
||||
color="primary"
|
||||
class="q-px-md q-py-sm"
|
||||
@click="addEmployee"
|
||||
label="เพิ่มบุคลากร"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row q-px-md q-col-gutter-sm">
|
||||
<div class="col-md-3">
|
||||
<q-input dense outlined v-model="formData.prefix" label="คำนำหน้า" ref="prefixRef"
|
||||
:rules="[(val: string) => val !== null && val !== '' || `${'กรุณากรอกคำนำหน้า'}`]" />
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="formData.prefix"
|
||||
label="คำนำหน้า"
|
||||
ref="prefixRef"
|
||||
:rules="[(val: string) => val !== null && val !== '' || `${'กรุณากรอกคำนำหน้า'}`]"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<q-input dense outlined v-model="formData.firstname" label="ชื่อ" ref="firstnameRef"
|
||||
:rules="[(val: string) => val !== null && val !== '' || `${'กรุณากรอกชื่อ'}`]" />
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="formData.firstname"
|
||||
label="ชื่อ"
|
||||
ref="firstnameRef"
|
||||
:rules="[(val: string) => val !== null && val !== '' || `${'กรุณากรอกชื่อ'}`]"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<q-input dense outlined v-model="formData.lastname" label="นามสกุล" ref="lastnameRef"
|
||||
:rules="[(val: string) => !!val || `${'กรุณากรอกนามสกุล'}`]" />
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="formData.lastname"
|
||||
label="นามสกุล"
|
||||
ref="lastnameRef"
|
||||
:rules="[(val: string) => !!val || `${'กรุณากรอกนามสกุล'}`]"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<q-input dense outlined v-model="formData.position" label="ตำแหน่ง" ref="positionRef"
|
||||
:rules="[(val: string) => !!val || `${'กรุณากรอกตำแหน่ง'}`]" />
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="formData.position"
|
||||
label="ตำแหน่ง"
|
||||
ref="positionRef"
|
||||
:rules="[(val: string) => !!val || `${'กรุณากรอกตำแหน่ง'}`]"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<q-input dense outlined v-model="formData.phone" label="เบอร์โทร" ref="phoneRef"
|
||||
:rules="[(val: string) => !!val || `${'กรุณากรอกเบอร์โทร'}`]" />
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="formData.phone"
|
||||
label="เบอร์โทร"
|
||||
ref="phoneRef"
|
||||
:rules="[(val: string) => !!val || `${'กรุณากรอกเบอร์โทร'}`]"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<q-input dense outlined v-model="formData.responsibilities" label="หน้าที่" ref="responsibilitiesRef"
|
||||
:rules="[(val: string) => !!val || `${'กรุณากรอกหน้าที่'}`]" />
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="formData.responsibilities"
|
||||
label="หน้าที่"
|
||||
ref="responsibilitiesRef"
|
||||
:rules="[(val: string) => !!val || `${'กรุณากรอกหน้าที่'}`]"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<q-input dense outlined v-model="formData.email" label="อีเมล" ref="emailRef"
|
||||
:rules="[(val: string) => !!val || `${'กรุณากรอกอีเมล'}`]" />
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="formData.email"
|
||||
label="อีเมล"
|
||||
ref="emailRef"
|
||||
:rules="[(val: string) => !!val || `${'กรุณากรอกอีเมล'}`]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<q-separator />
|
||||
<div class="row col-12 q-pa-sm">
|
||||
<q-space />
|
||||
<q-btn type="submit" flat round color="public" icon="mdi-content-save-outline">
|
||||
<q-btn
|
||||
type="submit"
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
</q-card>
|
||||
</div>
|
||||
</form>
|
||||
</template>
|
||||
</template>
|
||||
|
|
|
|||
38
src/modules/11_discipline/interface/request/complaint.ts
Normal file
38
src/modules/11_discipline/interface/request/complaint.ts
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
interface FormData {
|
||||
complainantType: string
|
||||
complainant: string
|
||||
office: string
|
||||
agency: string
|
||||
topicComplaint: string
|
||||
detail: string
|
||||
datereceive: Date | null
|
||||
dateconsideration: Date | null
|
||||
offenseDescription: string
|
||||
considerationLevel: string
|
||||
datewarn: Date | null
|
||||
receivecomplaints: string
|
||||
petitioner: string
|
||||
files: any | null
|
||||
}
|
||||
|
||||
interface MyObjectComplaintsRef {
|
||||
complainantType: object | null;
|
||||
complainant: object | null;
|
||||
office: object | null;
|
||||
agency: object | null;
|
||||
topicComplaint: object | null;
|
||||
datereceive: object | null;
|
||||
dateconsideration: object | null;
|
||||
offenseDescription: object | null;
|
||||
considerationLevel: object | null;
|
||||
datewarn: object | null;
|
||||
receivecomplaints: object | null;
|
||||
petitioner: object | null;
|
||||
files: object | null;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type {
|
||||
FormData,
|
||||
MyObjectComplaintsRef
|
||||
}
|
||||
30
src/modules/11_discipline/interface/request/order.ts
Normal file
30
src/modules/11_discipline/interface/request/order.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
interface FormData {
|
||||
orderType: string;
|
||||
orderBy: string;
|
||||
listInvestigation: string;
|
||||
authority: string;
|
||||
orderNumber: string;
|
||||
dateYear: number;
|
||||
date: Date | null;
|
||||
authorityPosition: string
|
||||
subject: string;
|
||||
mistakeDetail: string
|
||||
}
|
||||
interface MyObjectRef {
|
||||
orderType: object | null;
|
||||
orderBy: object | null;
|
||||
listInvestigation: object | null;
|
||||
authority: object | null;
|
||||
orderNumber: object | null;
|
||||
dateYear: object | null;
|
||||
date: object | null;
|
||||
authorityPosition: object | null;
|
||||
subject: object | null;
|
||||
mistakeDetail: object | null;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export type {
|
||||
FormData,
|
||||
MyObjectRef
|
||||
}
|
||||
15
src/modules/11_discipline/interface/response/complaint.ts
Normal file
15
src/modules/11_discipline/interface/response/complaint.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
interface DataList {
|
||||
subject: string
|
||||
detail: string
|
||||
complainant: string
|
||||
offenseDescription: string
|
||||
creationDate: string
|
||||
considerationLevel: string
|
||||
considerationDeadlineDate: string
|
||||
}
|
||||
|
||||
|
||||
|
||||
export type {
|
||||
DataList
|
||||
}
|
||||
15
src/modules/11_discipline/interface/response/order.ts
Normal file
15
src/modules/11_discipline/interface/response/order.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
interface DataList {
|
||||
subject: string
|
||||
ordernumber: string
|
||||
dateOrder: string
|
||||
orderby: string
|
||||
signer: string
|
||||
statusorder: string
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export type {
|
||||
DataList
|
||||
}
|
||||
|
|
@ -1,15 +1,14 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
|
||||
import type { DataOption } from "../interface/index/Main";
|
||||
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
|
||||
import type { DataList } from "@/modules/11_discipline/interface/response/complaint"
|
||||
|
||||
|
||||
export const useComplainstDataStore = defineStore("DisciplineComplainst", () => {
|
||||
const rows = ref<any>([])
|
||||
|
||||
|
||||
|
||||
function fectComplainst(data: any) {
|
||||
let datalist = data.map((e: any) => ({
|
||||
const rows = ref<DataList[]>([])
|
||||
function fetchComplainst(data: DataList[]) {
|
||||
let datalist = data.map((e: DataList) => ({
|
||||
subject: e.subject,
|
||||
detail: e.detail,
|
||||
complainant: e.complainant,
|
||||
|
|
@ -20,16 +19,13 @@ export const useComplainstDataStore = defineStore("DisciplineComplainst", () =>
|
|||
}))
|
||||
rows.value = datalist
|
||||
}
|
||||
|
||||
|
||||
|
||||
const complainantoptionsMain = ref<DataOption[]>()
|
||||
const complainantoptions = ref<DataOption[]>()
|
||||
const agencytoptionsMain = ref<DataOption[]>()
|
||||
const agencytoptions = ref<DataOption[]>()
|
||||
const optionListNameMain = ref<DataOption[]>([])
|
||||
const optionListName = ref<DataOption[]>([])
|
||||
function fectOptioin(complainantoptions: any, agencytoptions: any) {
|
||||
function fetchOptioin(complainantoptions: any, agencytoptions: any) {
|
||||
complainantoptionsMain.value = complainantoptions
|
||||
agencytoptionsMain.value = agencytoptions
|
||||
}
|
||||
|
|
@ -37,7 +33,7 @@ export const useComplainstDataStore = defineStore("DisciplineComplainst", () =>
|
|||
optionListNameMain.value = list
|
||||
optionListName.value = list
|
||||
}
|
||||
function filterSelector(val: any, update: Function, type: string) {
|
||||
function filterSelector(val: string, update: Function, type: string) {
|
||||
update(() => {
|
||||
if (type === "filtercomplainantType" && complainantoptionsMain.value) {
|
||||
complainantoptions.value = complainantoptionsMain.value.filter(
|
||||
|
|
@ -58,10 +54,10 @@ export const useComplainstDataStore = defineStore("DisciplineComplainst", () =>
|
|||
return {
|
||||
rows,
|
||||
optionListName,
|
||||
fectComplainst,
|
||||
fetchComplainst,
|
||||
selectComplainantTpye,
|
||||
filterSelector,
|
||||
fectOptioin,
|
||||
fetchOptioin,
|
||||
complainantoptions,
|
||||
agencytoptions,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
|
||||
import type { DataList } from "@/modules/11_discipline/interface/response/order"
|
||||
|
||||
export const useOrderStore = defineStore("DisciplineOrder", () => {
|
||||
const rows = ref<any>([])
|
||||
async function fecthOrder(data: any) {
|
||||
let datalist = data.map((e: any) => ({
|
||||
const rows = ref<DataList[]>([])
|
||||
async function fetchOrder(data: DataList[]) {
|
||||
let datalist = data.map((e: DataList) => ({
|
||||
subject: e.subject,
|
||||
ordernumber: e.ordernumber,
|
||||
dateOrder: e.dateOrder,
|
||||
|
|
@ -19,6 +21,6 @@ export const useOrderStore = defineStore("DisciplineOrder", () => {
|
|||
|
||||
return {
|
||||
rows,
|
||||
fecthOrder
|
||||
fetchOrder
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue