จัดโค้ดวินัย
This commit is contained in:
parent
71d3b54ef0
commit
7262000680
37 changed files with 492 additions and 697 deletions
|
|
@ -1,12 +1,13 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive, watch, watchEffect } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
/** import Type */
|
||||
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
|
||||
import type { FormData, MyObjectComplaintsRef, ArrayFileList } from "@/modules/11_discipline/interface/request/complaint";
|
||||
import type {
|
||||
FormData,
|
||||
MyObjectComplaintsRef,
|
||||
ArrayFileList,
|
||||
} from "@/modules/11_discipline/interface/request/complaint";
|
||||
|
||||
/** importStroe*/
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||
import { useDisciplineMainStore } from "@/modules/11_discipline/store/main";
|
||||
|
|
@ -18,12 +19,15 @@ import DialogAddPersonal from "@/components/Dialogs/AddPersonal.vue";
|
|||
|
||||
const $q = useQuasar();
|
||||
const fileDocDataUpload = ref<File[]>([]);
|
||||
|
||||
const channelOptions = ref<DataOption[]>([]);
|
||||
/** เรียกใช้ store */
|
||||
const mixin = useCounterMixin();
|
||||
const complainstStore = useComplainstDataStore();
|
||||
const mainStore = useDisciplineMainStore();
|
||||
const complainstStore = useComplainstDataStore();
|
||||
|
||||
/**ชั่งฟังเพิ่มข้อมูล ลง ตาราง */
|
||||
const modal = ref<boolean>(false);
|
||||
const toggleModal = () => (modal.value = !modal.value);
|
||||
const {
|
||||
date2Thai,
|
||||
dialogConfirm,
|
||||
|
|
@ -108,22 +112,6 @@ const objectComplaintsRef: MyObjectComplaintsRef = {
|
|||
result: resultRef,
|
||||
};
|
||||
|
||||
// /**
|
||||
// * รับค่าผู้ถูกร้องเรียน
|
||||
// * @param val บุคคล หน่วยงาน กทม
|
||||
// */
|
||||
// async function selectComplainant(val: string) {
|
||||
// formData.organizationId = "";
|
||||
// formData.consideredAgency = "";
|
||||
|
||||
// if (val === "1") {
|
||||
// await fetchOffice(); // ถ้าเลือกหน่วยงานจะเรียก function fetchOffice เรียกโครงสร้างสำนักงาน
|
||||
// }
|
||||
// }
|
||||
|
||||
// /** เรียกโครงสร้างสำนักงาน */
|
||||
// async function fetchOffice() {}
|
||||
|
||||
/**
|
||||
* ฟังชั่นอัปโหลดไฟล์
|
||||
* @param documentFile ไฟล์ที่รับมา
|
||||
|
|
@ -192,10 +180,6 @@ function onSubmit() {
|
|||
);
|
||||
}
|
||||
|
||||
/**ชั่งฟังเพิ่มข้อมูล ลง ตาราง */
|
||||
const modal = ref<boolean>(false);
|
||||
const toggleModal = () => (modal.value = !modal.value);
|
||||
|
||||
/**
|
||||
* เปิดลิงค์ไฟล์
|
||||
* @param link รับมาเป็น https ลิงค์
|
||||
|
|
@ -326,7 +310,7 @@ function deletePerson(id: string) {
|
|||
}
|
||||
|
||||
/** ช่องทางการร้องเรียน และฟังก์ชั่นการดึงข้อมูลช่องทางการร้องเรียนมาจาก api*/
|
||||
const channelOptions = ref<DataOption[]>([]);
|
||||
|
||||
function getListChannel() {
|
||||
http.get(config.API.complaintListOp()).then((res) => {
|
||||
channelOptions.value = res.data.result.data;
|
||||
|
|
@ -900,7 +884,7 @@ onMounted(() => {
|
|||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- อัพโหลดไฟล์ -->
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<q-card flat class="q-pa-md" bordered>
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ function redirectToPageadd() {
|
|||
|
||||
function filterFn() {
|
||||
getList();
|
||||
console.log("enter", filterKeyword.value);
|
||||
}
|
||||
|
||||
/** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
// import type
|
||||
import type { QTableProps } from "quasar";
|
||||
// importStroe
|
||||
import { useComplainstDataStore } from "@/modules/11_discipline/store/ComplaintsStore";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
const currentPage = ref<number>(1);
|
||||
const router = useRouter();
|
||||
const complainstStore = useComplainstDataStore();
|
||||
|
||||
const emit = defineEmits(["update:pagination"]);
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
filterTable: {
|
||||
|
|
@ -29,7 +29,18 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(["update:pagination"]);
|
||||
/** หัวข้อที่เเสดงในตาราง */
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"title",
|
||||
"dateReceived",
|
||||
"respondentType",
|
||||
"offenseDetails",
|
||||
"createdAt",
|
||||
"levelConsideration",
|
||||
"dateConsideration",
|
||||
"status",
|
||||
]);
|
||||
|
||||
/** หัวตาราง */
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -107,34 +118,22 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
/** หัวข้อที่เเสดงในตาราง */
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"title",
|
||||
"dateReceived",
|
||||
"respondentType",
|
||||
"offenseDetails",
|
||||
"createdAt",
|
||||
"levelConsideration",
|
||||
"dateConsideration",
|
||||
"status",
|
||||
]);
|
||||
|
||||
/** แสดงจำนวนในตาราง */
|
||||
const pagination = ref({
|
||||
descending: true,
|
||||
page: Number(props.page),
|
||||
rowsPerPage: props.rowsPerPage,
|
||||
});
|
||||
|
||||
/**
|
||||
* ฟังชั่นสำหรับ เปลี่ยน route ตาม id ที่รับมา
|
||||
* @param id ไอดีระบุ
|
||||
*/
|
||||
function OpenEdit(id: string) {
|
||||
console.log(id);
|
||||
router.push(`/discipline/complaints/${id}`);
|
||||
}
|
||||
|
||||
/** ส่งค่ากลับไปหน้าหลัก */
|
||||
function updateProp(newPagination: any, page: number){
|
||||
// ส่ง event ไปยัง parent component เพื่ออัพเดทค่า props
|
||||
emit("update:pagination", newPagination, page);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ const router = useRouter();
|
|||
|
||||
/** บันทึกข้อมูลเเละ route กลับหน้าหลัก */
|
||||
async function onSubmit(){
|
||||
console.log("add");
|
||||
router.push(`/discipline/investigatefacts`);
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -153,14 +153,12 @@ async function view(text: string) {
|
|||
function gotoPrevMonth() {
|
||||
const calen = fullCalendar.value.getApi();
|
||||
calen.prev();
|
||||
console.log("b", calen.getDate());
|
||||
updateDateMonth(calen.getDate());
|
||||
}
|
||||
|
||||
function gotoNextMonth() {
|
||||
const calen = fullCalendar.value.getApi();
|
||||
calen.next();
|
||||
console.log("n", calen.getDate());
|
||||
updateDateMonth(calen.getDate());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,6 @@ async function fetchCalendar() {
|
|||
mounth: dateMonth.value.month,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
const data = [
|
||||
{
|
||||
groupId: "2",
|
||||
|
|
|
|||
|
|
@ -142,7 +142,6 @@ function getData() {
|
|||
.get(config.API.investigateById(id.value))
|
||||
.then((res) => {
|
||||
const dataList = res.data.result;
|
||||
// console.log(dataList);
|
||||
data.id = dataList.id;
|
||||
data.idComplaint = dataList.idComplaint;
|
||||
data.respondentType = dataList.respondentType;
|
||||
|
|
@ -165,7 +164,6 @@ function getData() {
|
|||
data.investigationDaysExtend = dataList.investigationDaysExtend;
|
||||
data.investigationExtendHistory =
|
||||
dataList.investigationExtendHistory ?? [];
|
||||
// console.log(dataList);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -253,11 +251,6 @@ function cancelInvestigate() {
|
|||
);
|
||||
}
|
||||
|
||||
/** ฟังชั่น ส่งไปสอบสวน*/
|
||||
function confirmSentInvestigate() {
|
||||
console.log("sent");
|
||||
}
|
||||
|
||||
/** ฟังชั่น ยุติเรื่อง*/
|
||||
function confirmEndInvestigate() {
|
||||
showLoader();
|
||||
|
|
@ -293,7 +286,6 @@ function confirmCancelInvestigate() {
|
|||
|
||||
function emitPerson(data: FormData[]) {
|
||||
const dataMapId = data.map((item: FormData) => item.id);
|
||||
console.log(dataMapId);
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.investigateApprove(id.value), {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ const router = useRouter();
|
|||
const id = ref<string>(route.params.id as string);
|
||||
const modalPerson = ref<boolean>(false);
|
||||
const toggleModal = () => (modalPerson.value = !modalPerson.value);
|
||||
|
||||
/**เรียกใช้ store */
|
||||
const investigateFactStore = useInvestigateFactStore();
|
||||
const mainStore = useDisciplineMainStore();
|
||||
|
|
@ -47,13 +48,21 @@ const {
|
|||
} = mixin;
|
||||
const investigateDis = useInvestigateDisStore();
|
||||
|
||||
// const complaintsOptions = ref<any>([]);
|
||||
const modal = ref<boolean>(false);
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const type = ref<string>("");
|
||||
const modalEditDirector = ref<boolean>(false);
|
||||
const editDirectorId = ref<string>();
|
||||
const dutyVal = ref<string>();
|
||||
|
||||
const filter = ref<string>("");
|
||||
const isUpdate = ref<boolean>(false);
|
||||
const filterTable = ref<string>("");
|
||||
const filterKeyword = ref<string>("");
|
||||
const maxPage = ref<number>(1);
|
||||
const page = ref<number>(1);
|
||||
const rowsPerPage = ref<number>(10);
|
||||
|
||||
/** ตัวแปร ref สำหรับแสดง validate */
|
||||
const complaintRef = ref<Object | null>(null);
|
||||
const complaintdetailRef = ref<Object | null>(null);
|
||||
|
|
@ -90,8 +99,6 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const filter = ref<string>("");
|
||||
|
||||
/** ข้อมูล v-model ของฟอร์ม */
|
||||
const formData = reactive<FormData>({
|
||||
id: "",
|
||||
|
|
@ -168,7 +175,6 @@ function validateForm() {
|
|||
onSubmit();
|
||||
} else {
|
||||
console.log("ไม่ผ่าน ");
|
||||
// console.log(hasError);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -226,9 +232,6 @@ function resetExtend() {
|
|||
formData.investigationDaysExtend = 0;
|
||||
}
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const type = ref<string>("");
|
||||
/** เปิด dialog */
|
||||
function onClickOpenPopup() {
|
||||
modal.value = true;
|
||||
|
|
@ -305,7 +308,6 @@ function uploadFileRelevant() {
|
|||
http
|
||||
.put(config.API.investigateRelevantUploadFile(formData.id), Data)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||
props.getData();
|
||||
// router.push(`/discipline/complaints`);
|
||||
|
|
@ -319,6 +321,7 @@ function uploadFileRelevant() {
|
|||
});
|
||||
}
|
||||
|
||||
/** อัปโหลดไฟล์ */
|
||||
function uploadFile() {
|
||||
const Data = new FormData();
|
||||
Data.append("file", formData.documentFile);
|
||||
|
|
@ -326,7 +329,6 @@ function uploadFile() {
|
|||
http
|
||||
.put(config.API.investigateUploadFile(formData.id), Data)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||
props.getData();
|
||||
// router.push(`/discipline/complaints`);
|
||||
|
|
@ -553,9 +555,6 @@ function emitPerson(data: FormData[]) {
|
|||
});
|
||||
}
|
||||
|
||||
const modalEditDirector = ref<boolean>(false);
|
||||
const editDirectorId = ref<string>();
|
||||
const dutyVal = ref<string>();
|
||||
function openEditDirector(id: string, duty: string) {
|
||||
editDirectorId.value = id;
|
||||
modalEditDirector.value = true;
|
||||
|
|
@ -566,7 +565,7 @@ function closeEditDirector() {
|
|||
modalEditDirector.value = false;
|
||||
}
|
||||
|
||||
const saveDuty = async (id: string, duty: string) => {
|
||||
async function saveDuty(id: string, duty: string){
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.investigateEditDuty(formData.id, id), { duty: duty })
|
||||
|
|
|
|||
|
|
@ -81,11 +81,6 @@ async function getList() {
|
|||
|
||||
const attrs = ref<any>(useAttrs());
|
||||
|
||||
/**ไปยังหน้าเพิ่มข้อมูล */
|
||||
const clickAdd = () => {
|
||||
router.push(`/discipline/investigatefacts/add`);
|
||||
};
|
||||
|
||||
/**
|
||||
* ไปหน้าแก้ไข
|
||||
* @param id ไอดีเฉพาะ รายบุคคล
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import Form from "@/modules/11_discipline/components/3_InvestigateDisciplinary/Form.vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useRouter } from "vue-router";
|
||||
const router = useRouter();
|
||||
|
||||
/** บันทึกข้อมูลเเละ route กลับหน้าหลัก */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch, type PropType } from "vue";
|
||||
// import config from "@/app.config";
|
||||
// import http from "@/plugins/http";
|
||||
|
||||
import { useQuasar } from "quasar";
|
||||
import FullCalendar from "@fullcalendar/vue3";
|
||||
import dayGridPlugin from "@fullcalendar/daygrid";
|
||||
|
|
|
|||
|
|
@ -136,7 +136,6 @@ async function fetchCalendar() {
|
|||
mouth: dateMonth.value.month,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import type {
|
|||
responseType,
|
||||
directorType,
|
||||
} from "@/modules/11_discipline/interface/index/Main";
|
||||
import type { FormDataList } from "@/modules/11_discipline/interface/request/investigate";
|
||||
import type { DataOptionRes } from "@/modules/11_discipline/interface/response/Main";
|
||||
|
||||
/** import components*/
|
||||
|
|
@ -58,6 +57,17 @@ const route = useRoute();
|
|||
const router = useRouter();
|
||||
const $q = useQuasar();
|
||||
|
||||
const organizationOption = ref<DataOption[]>([]);
|
||||
/** query string*/
|
||||
const page = ref<number>(1);
|
||||
const rowsPerPage = ref<number>(10);
|
||||
const maxPage = ref<number>(1);
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const listDirector = ref<any>([]);
|
||||
const modalEditDirector = ref<boolean>(false);
|
||||
const editDirectorId = ref<string>();
|
||||
const dutyVal = ref<string>();
|
||||
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const isUpdate = ref<boolean>(false);
|
||||
const type = ref<string>("");
|
||||
|
|
@ -71,10 +81,6 @@ const isSave = ref<boolean>(false); // มีการแก้ไขรอบ
|
|||
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||
const extendStatus = ref<boolean>(false);
|
||||
|
||||
function toggleModal() {
|
||||
modalPerson.value = !modalPerson.value;
|
||||
}
|
||||
|
||||
/** formData*/
|
||||
const formData = reactive<FormData>({
|
||||
respondentType: "",
|
||||
|
|
@ -136,16 +142,7 @@ const objectdisciplinary: DisciplinaryRef = {
|
|||
respondentType: respondentTypeRef,
|
||||
organizationId: organizationIdRef,
|
||||
consideredAgency: consideredAgencyRef,
|
||||
// disciplinaryDateAllegation: disciplinaryDateAllegationRef,
|
||||
// disciplinaryDateEvident: disciplinaryDateEvidentRef,
|
||||
// disciplinaryCaseFault: disciplinaryCaseFaultRef,
|
||||
// disciplinaryInvestigateAt: disciplinaryInvestigateAtRef,
|
||||
disciplinaryFaultLevel: disciplinaryFaultLevelRef,
|
||||
// disciplinaryRefLaw: disciplinaryRefLawRef,
|
||||
// disciplinarySummaryEvidence: disciplinarySummaryEvidenceRef,
|
||||
// disciplinaryRecordAccuser: disciplinaryRecordAccuserRef,
|
||||
// disciplinaryWitnesses: disciplinaryWitnessesRef,
|
||||
// result: resultRef,
|
||||
date: dateRef,
|
||||
dateEnd: dateEndRef,
|
||||
daysExtend: daysExtendRef,
|
||||
|
|
@ -186,6 +183,10 @@ function clickClose() {
|
|||
modal.value = false;
|
||||
}
|
||||
|
||||
function toggleModal() {
|
||||
modalPerson.value = !modalPerson.value;
|
||||
}
|
||||
|
||||
/** ฟังชั่นตรวจสอบความถูกต้องก่อน บันทึก */
|
||||
function validateForm() {
|
||||
const hasError = [];
|
||||
|
|
@ -347,13 +348,6 @@ function handleSave(returnData: any) {
|
|||
toggleModal();
|
||||
}
|
||||
|
||||
function deletePerson(id: string) {
|
||||
changeFormData();
|
||||
const dataRow = mainStore.rowsAdd;
|
||||
const updatedRows = dataRow.filter((item: any) => item.personId !== id);
|
||||
mainStore.rowsAdd = updatedRows;
|
||||
}
|
||||
|
||||
/**
|
||||
* เช็คข้อมูลจาก props
|
||||
* เมื่อมีข้อมูล
|
||||
|
|
@ -366,7 +360,7 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
const organizationOption = ref<DataOption[]>([]);
|
||||
|
||||
/** function เรียกรายชื่อหน่วยงาน*/
|
||||
async function fetchOrganization() {
|
||||
await http
|
||||
|
|
@ -383,12 +377,7 @@ async function fetchOrganization() {
|
|||
});
|
||||
}
|
||||
|
||||
/** query string*/
|
||||
const page = ref<number>(1);
|
||||
const rowsPerPage = ref<number>(10);
|
||||
const maxPage = ref<number>(1);
|
||||
const filterKeyword2 = ref<string>("");
|
||||
const listDirector = ref<any>([]);
|
||||
|
||||
/** function เรียกรายชื่อกรรมการ*/
|
||||
async function fetchDListDirector() {
|
||||
showLoader();
|
||||
|
|
@ -534,9 +523,7 @@ function emitPerson(data: PersonsArray[]) {
|
|||
});
|
||||
}
|
||||
|
||||
const modalEditDirector = ref<boolean>(false);
|
||||
const editDirectorId = ref<string>();
|
||||
const dutyVal = ref<string>();
|
||||
|
||||
function openEditDirector(idVal: string, duty: string) {
|
||||
editDirectorId.value = idVal;
|
||||
modalEditDirector.value = true;
|
||||
|
|
@ -547,7 +534,7 @@ function closeEditDirector() {
|
|||
modalEditDirector.value = false;
|
||||
}
|
||||
|
||||
const saveDuty = async (id: string, duty: string) => {
|
||||
async function saveDuty(id: string, duty: string){
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.disciplinaryEditDuty(props.data.id, id), { duty: duty })
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ async function fetchListDisciplinary() {
|
|||
fetchList(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -52,7 +51,6 @@ async function fetchListDisciplinary() {
|
|||
* @param id ไอดีเฉพาะ รายบุคคล
|
||||
*/
|
||||
function openEdit(id: string) {
|
||||
console.log(id);
|
||||
router.push(`/discipline/disciplinary/${id}`);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,27 +1,17 @@
|
|||
<script setup lang="ts">
|
||||
import {
|
||||
ref,
|
||||
computed,
|
||||
watchEffect,
|
||||
onMounted,
|
||||
watch,
|
||||
type PropType,
|
||||
} from "vue";
|
||||
import { ref, computed, watchEffect, watch, type PropType } 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 type { OpType } from "@/modules/05_placement/interface/response/Main";
|
||||
import type {
|
||||
DataListRow,
|
||||
PersonType,
|
||||
} from "@/modules/11_discipline/interface/request/result";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import type { DataListRow } from "@/modules/11_discipline/interface/request/result";
|
||||
import { useRoute } from "vue-router";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
const route = useRoute();
|
||||
|
||||
const optionsType = ref<[]>([]);
|
||||
const idPath = ref<string>(route.params.id as string);
|
||||
const type = ref<string>("");
|
||||
const rows = ref<DataListRow[]>([]);
|
||||
|
|
@ -79,8 +69,7 @@ const saveOrder = () => {
|
|||
}
|
||||
};
|
||||
//ส่งไปออกคำสั่ง
|
||||
const Ordersave = async () => {
|
||||
// const id = selected.value.map((r) => r.id);
|
||||
async function Ordersave(){
|
||||
const persons = selected.value.map((r) => r.id);
|
||||
|
||||
if (props.title == "ส่งไปออกคำสั่งลงโทษทางวินัย") {
|
||||
|
|
@ -127,21 +116,18 @@ const emit = defineEmits([
|
|||
"update:selected",
|
||||
"update:type",
|
||||
]);
|
||||
|
||||
const updateInput = (value: any) => {
|
||||
emit("update:filterKeyword2", value);
|
||||
};
|
||||
|
||||
//รีเซ็ตค่าในช่องค้นหา
|
||||
const Reset = () => {
|
||||
function Reset(){
|
||||
emit("update:filterKeyword2", "");
|
||||
};
|
||||
|
||||
const updateInputType = (value: any) => {
|
||||
emit("update:type", value);
|
||||
};
|
||||
|
||||
//----(ดึงข้อมูลประเภทคำสั่ง)------//
|
||||
const optionsType = ref<[]>([]);
|
||||
const fecthTypeOption = async () => {
|
||||
async function fecthTypeOption(){
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.typeOrder())
|
||||
|
|
@ -174,14 +160,13 @@ watchEffect(() => {
|
|||
if (props.Modal === true) {
|
||||
selected.value = [];
|
||||
type.value = "";
|
||||
// console.log(props.data.status)
|
||||
if (props.title == "ส่งไปออกคำสั่งลงโทษทางวินัย") {
|
||||
rows.value = props.data.persons.filter(
|
||||
(item: any) => item.status !== "REPORT"
|
||||
);
|
||||
} else if (props.title == "ส่งไปออกคำสั่งงดโทษ/เพิ่มโทษ") {
|
||||
rows.value = props.data.persons.filter(
|
||||
(item: any) => item.status == "REPORT" && item.statusDiscard == 'NEW'
|
||||
(item: any) => item.status == "REPORT" && item.statusDiscard == "NEW"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,71 +28,14 @@ const { showLoader, hideLoader, messageError } = mixin;
|
|||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const titlePopup = ref<string>('')
|
||||
|
||||
/**
|
||||
* บันทึกข้อมูลที่เเก้ไข
|
||||
* @param id ระบุ บุคคล
|
||||
*/
|
||||
const onSubmit = async (id: string) => {
|
||||
console.log("edit");
|
||||
router.push(`/discipline-result`);
|
||||
};
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const filterKeyword = ref<string>("");
|
||||
/** ฟังชั่นปิด dialog */
|
||||
function closeModal() {
|
||||
modal.value = false;
|
||||
}
|
||||
|
||||
|
||||
/** ยืนยัน ส่งไปออกคำสั่ง */
|
||||
function sentIssue(title:string) {
|
||||
modal.value = true;
|
||||
titlePopup.value = title
|
||||
}
|
||||
|
||||
const titlePopup = ref<string>("");
|
||||
const idInvestigate = ref<string>("");
|
||||
const idComplaint = ref<string>("");
|
||||
const status = ref<string>("");
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const dataResult = ref<DataListRow[]>([]);
|
||||
/** function เรียกรายละเอียดผลการพิจารณาทางวินัย*/
|
||||
async function fetchDetailResult() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.listResultById(id.value))
|
||||
.then((res) => {
|
||||
dataResult.value = res.data.result;
|
||||
status.value = res.data.result.status;
|
||||
idComplaint.value = res.data.result.idComplaint;
|
||||
idInvestigate.value = res.data.result.idInvestigate;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
const filterKeyword = ref<string>("");
|
||||
const dataDisciplinary = ref<object>([]);
|
||||
/** function เรียกรายละเอียดสอบสวนความผิดทางวินัย*/
|
||||
async function fetchDetailDisciplinary() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.disciplineDisciplinaryById(id.value))
|
||||
.then((res) => {
|
||||
dataDisciplinary.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
const dataInvestigatefacts = reactive<FormInvestigateFact>({
|
||||
id: "",
|
||||
|
|
@ -121,8 +64,103 @@ const dataInvestigatefacts = reactive<FormInvestigateFact>({
|
|||
respondentType: "",
|
||||
organizationId: "",
|
||||
persons: [],
|
||||
investigationExtendHistory:[]
|
||||
investigationExtendHistory: [],
|
||||
});
|
||||
|
||||
const personObjComplaint = reactive<ArrayPerson>({
|
||||
id: "",
|
||||
personId: "",
|
||||
idcard: "",
|
||||
name: "",
|
||||
prefix: "",
|
||||
firstName: "",
|
||||
lastName: "",
|
||||
posNo: "",
|
||||
position: "",
|
||||
positionLevel: "",
|
||||
salary: null,
|
||||
organization: "",
|
||||
});
|
||||
const fileListObjComplaint = reactive<ArrayFileList>({
|
||||
id: "",
|
||||
pathName: "",
|
||||
fileName: "",
|
||||
});
|
||||
const dataComplaints = reactive<FormDataComplaint>({
|
||||
id: "",
|
||||
respondentType: "",
|
||||
organizationId: "",
|
||||
consideredAgency: "",
|
||||
title: "",
|
||||
description: "",
|
||||
dateReceived: null,
|
||||
dateConsideration: null,
|
||||
offenseDetails: "",
|
||||
levelConsideration: "",
|
||||
dateNotification: null,
|
||||
complaintFrom: "",
|
||||
appellant: "",
|
||||
documentFile: null,
|
||||
status: "",
|
||||
persons: [personObjComplaint],
|
||||
result: "",
|
||||
disciplineComplaintDocs: [fileListObjComplaint],
|
||||
});
|
||||
|
||||
/** ฟังชั่นปิด dialog */
|
||||
function closeModal() {
|
||||
modal.value = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* บันทึกข้อมูลที่เเก้ไข
|
||||
* @param id ระบุ บุคคล
|
||||
*/
|
||||
async function onSubmit() {
|
||||
router.push(`/discipline-result`);
|
||||
}
|
||||
|
||||
/** ยืนยัน ส่งไปออกคำสั่ง */
|
||||
function sentIssue(title: string) {
|
||||
modal.value = true;
|
||||
titlePopup.value = title;
|
||||
}
|
||||
|
||||
/** function เรียกรายละเอียดผลการพิจารณาทางวินัย*/
|
||||
async function fetchDetailResult() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.listResultById(id.value))
|
||||
.then((res) => {
|
||||
dataResult.value = res.data.result;
|
||||
status.value = res.data.result.status;
|
||||
idComplaint.value = res.data.result.idComplaint;
|
||||
idInvestigate.value = res.data.result.idInvestigate;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** function เรียกรายละเอียดสอบสวนความผิดทางวินัย*/
|
||||
async function fetchDetailDisciplinary() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.disciplineDisciplinaryById(id.value))
|
||||
.then((res) => {
|
||||
dataDisciplinary.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/** function เรียกรายละเอียดสืบสวนข้อเท็จจริง*/
|
||||
async function fetchDetailInvestigate() {
|
||||
showLoader();
|
||||
|
|
@ -166,45 +204,6 @@ async function fetchDetailInvestigate() {
|
|||
});
|
||||
}
|
||||
|
||||
const personObjComplaint = reactive<ArrayPerson>({
|
||||
id: "",
|
||||
personId: "",
|
||||
idcard: "",
|
||||
name: "",
|
||||
prefix: "",
|
||||
firstName: "",
|
||||
lastName: "",
|
||||
posNo: "",
|
||||
position: "",
|
||||
positionLevel: "",
|
||||
salary: null,
|
||||
organization: "",
|
||||
});
|
||||
const fileListObjComplaint = reactive<ArrayFileList>({
|
||||
id: "",
|
||||
pathName: "",
|
||||
fileName: "",
|
||||
});
|
||||
const dataComplaints = reactive<FormDataComplaint>({
|
||||
id: "",
|
||||
respondentType: "",
|
||||
organizationId: "",
|
||||
consideredAgency: "",
|
||||
title: "",
|
||||
description: "",
|
||||
dateReceived: null,
|
||||
dateConsideration: null,
|
||||
offenseDetails: "",
|
||||
levelConsideration: "",
|
||||
dateNotification: null,
|
||||
complaintFrom: "",
|
||||
appellant: "",
|
||||
documentFile: null,
|
||||
status: "",
|
||||
persons: [personObjComplaint],
|
||||
result: "",
|
||||
disciplineComplaintDocs: [fileListObjComplaint],
|
||||
});
|
||||
/** function เรียกรายละเอียดเรื่องร้องเรียน*/
|
||||
async function fetchDetailComplaints() {
|
||||
showLoader();
|
||||
|
|
@ -238,12 +237,6 @@ async function fetchDetailComplaints() {
|
|||
});
|
||||
}
|
||||
|
||||
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
|
||||
onMounted(async () => {
|
||||
store.tabMenu = "result";
|
||||
await fetchDetailResult();
|
||||
});
|
||||
|
||||
watch(
|
||||
() => store.tabMenu,
|
||||
async () => {
|
||||
|
|
@ -261,6 +254,12 @@ watch(
|
|||
fetchFunction && (await fetchFunction());
|
||||
}
|
||||
);
|
||||
|
||||
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
|
||||
onMounted(async () => {
|
||||
store.tabMenu = "result";
|
||||
await fetchDetailResult();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
|
|
@ -331,7 +330,6 @@ watch(
|
|||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</q-card>
|
||||
<!-- <Form :on-submit="onSubmit" :data="data" /> -->
|
||||
</div>
|
||||
|
||||
<DialogSendToCommand
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
div
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive, watch } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
|
||||
// import DialogAddPersonal from "@/components/Dialogs/AddPersonal.vue";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useInvestigateDisStore } from "@/modules/11_discipline/store/InvestigateDisStore";
|
||||
import { useDisciplineResultStore } from "@/modules/11_discipline/store/ResultStore";
|
||||
|
|
@ -23,12 +20,17 @@ import type {
|
|||
const mainStore = useDisciplineMainStore();
|
||||
const modalPerson = ref<boolean>(false);
|
||||
const toggleModal = () => (modalPerson.value = !modalPerson.value);
|
||||
const investigateDis = useInvestigateDisStore();
|
||||
// const { fecthDirector } = investigateDis;
|
||||
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||
const dataStore = useDisciplineResultStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, hideLoader, dialogConfirm, success, messageError,showLoader,dialogRemove } = mixin;
|
||||
const {
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
success,
|
||||
messageError,
|
||||
showLoader,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
|
|
@ -38,6 +40,7 @@ const isSave = ref<boolean>(false); // มีการแก้ไขรอบ
|
|||
const respondentType = ref<string>("");
|
||||
const organizationId = ref<string>("");
|
||||
const consideredAgency = ref<string>("");
|
||||
const organizationOption = ref<DataOption[]>([]);
|
||||
/** ตัวแปร ref สำหรับแสดง validate */
|
||||
const detailRef = ref<Object | null>(null);
|
||||
|
||||
|
|
@ -57,11 +60,6 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
const ArrayFile = reactive<FileArray>({
|
||||
id: "",
|
||||
fileName: "",
|
||||
pathName: "",
|
||||
});
|
||||
/** ข้อมูล v-model ของฟอร์ม */
|
||||
const formData = reactive<FormData>({
|
||||
resultDescription: "",
|
||||
|
|
@ -78,19 +76,6 @@ const objectdisciplinary: FormRef = {
|
|||
resultDescription: detailRef,
|
||||
};
|
||||
|
||||
const organizationOption = ref<DataOption[]>([]);
|
||||
|
||||
async function addPerson(data: any) {
|
||||
await mainStore.fetchData(data);
|
||||
console.log(mainStore.rowsAdd);
|
||||
toggleModal();
|
||||
}
|
||||
|
||||
function handleSave(returnData: any) {
|
||||
addPerson(returnData);
|
||||
toggleModal();
|
||||
}
|
||||
|
||||
/** function เรียกรายชื่อหน่วยงาน*/
|
||||
async function fetchOrganization() {
|
||||
await http
|
||||
|
|
@ -171,7 +156,8 @@ watch(
|
|||
formData.oc = props.data.resultOc;
|
||||
formData.disciplineType = props.data.resultDisciplineType;
|
||||
formData.titleType = props.data.resultTitleType;
|
||||
formData.disciplineDisciplinary_DocResults = props.data.disciplineDisciplinary_DocResults;
|
||||
formData.disciplineDisciplinary_DocResults =
|
||||
props.data.disciplineDisciplinary_DocResults;
|
||||
formData.year = props.data.resultYear ?? 0;
|
||||
mainStore.rowsAdd = props.data.persons;
|
||||
await fetchDatadetail();
|
||||
|
|
@ -191,13 +177,6 @@ function changeFormData() {
|
|||
isSave.value = true;
|
||||
}
|
||||
|
||||
// function deletePerson(id: string) {
|
||||
// changeFormData();
|
||||
// const dataRow = mainStore.rowsAdd;
|
||||
// const updatedRows = dataRow.filter((item: any) => item.id !== id);
|
||||
// mainStore.rowsAdd = updatedRows;
|
||||
// }
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
|
|
@ -210,7 +189,6 @@ function uploadFile() {
|
|||
http
|
||||
.put(config.API.upLoadFileResult(id.value), Data)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||
props.fetchData();
|
||||
// router.push(`/discipline/complaints`);
|
||||
|
|
@ -250,8 +228,6 @@ function confirmDelete(docid: string) {
|
|||
props.fetchData();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {});
|
||||
</script>
|
||||
<template>
|
||||
<div class="row q-col-gutter-sm">
|
||||
|
|
@ -335,19 +311,6 @@ onMounted(async () => {});
|
|||
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-xs q-px-md"
|
||||
>
|
||||
ผู้ถูกร้องเรียน
|
||||
<!-- <q-btn
|
||||
v-if="!isReadonly"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="add"
|
||||
class="q-ml-sm"
|
||||
@click="toggleModal"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่มผู้ถูกร้องเรียน</q-tooltip>
|
||||
</q-btn> -->
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="col-xs-12 q-pa-sm">
|
||||
|
|
@ -375,7 +338,6 @@ onMounted(async () => {});
|
|||
col.label
|
||||
}}</span>
|
||||
</q-th>
|
||||
<!-- <q-th auto-width></q-th> -->
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
|
|
@ -414,20 +376,6 @@ onMounted(async () => {});
|
|||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<!-- <q-td auto-width>
|
||||
<q-btn
|
||||
v-if="!isReadonly"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="red"
|
||||
class="q-ml-sm"
|
||||
icon="mdi-delete-outline"
|
||||
@click="deletePerson(props.row.id)"
|
||||
><q-tooltip>ลบผู้ถูกร้องเรียน</q-tooltip></q-btn
|
||||
>
|
||||
</q-td> -->
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
|
|
@ -535,15 +483,6 @@ onMounted(async () => {});
|
|||
>
|
||||
</div>
|
||||
</q-card>
|
||||
<!-- <DialogAddPersonal
|
||||
title="ผู้ถูกร้องเรียน"
|
||||
:mainData="mainStore.rowsAdd"
|
||||
:modal="modalPerson"
|
||||
btn-title="เพิ่มรายชื่อผู้ถูกร้องเรียน"
|
||||
:close="toggleModal"
|
||||
:save="addPerson"
|
||||
@returnData="handleSave"
|
||||
/> -->
|
||||
</form>
|
||||
</div>
|
||||
<!-- อัพโหลดไฟล์ -->
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
|||
|
||||
const $q = useQuasar(); // show dialog
|
||||
const router = useRouter();
|
||||
//search data table
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const store = useDisciplineResultStore();
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, useAttrs, watch } from "vue";
|
||||
import type { Pagination } from "@/modules/04_registry/interface/index/Main";
|
||||
|
||||
const table = ref<any>(null);
|
||||
const filterRef = ref<any>(null);
|
||||
|
|
@ -59,10 +58,6 @@ const emit = defineEmits([
|
|||
"update:queryString",
|
||||
]);
|
||||
|
||||
function updateInput(value: string | number | null) {
|
||||
emit("update:inputfilter", value);
|
||||
}
|
||||
|
||||
function updateVisible(value: []) {
|
||||
emit("update:inputvisible", value);
|
||||
}
|
||||
|
|
@ -99,19 +94,8 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
|
|||
<template>
|
||||
<div class="q-pb-sm row q-col-gutter-sm">
|
||||
<div class="q-gutter-sm" v-if="nornmalData == true">
|
||||
<!-- <q-btn
|
||||
to="/discipline-result/add"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-plus"
|
||||
>
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn> -->
|
||||
</div>
|
||||
<q-space />
|
||||
<!-- ค้นหาข้อความใน table -->
|
||||
<q-input
|
||||
standout
|
||||
dense
|
||||
|
|
@ -133,7 +117,6 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
|
|||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<!-- แสดงคอลัมน์ใน table -->
|
||||
<q-select
|
||||
:model-value="inputvisible"
|
||||
@update:model-value="updateVisible"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { useRouter } from "vue-router";
|
||||
// import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||
|
||||
const router = useRouter();
|
||||
// const store = useInsigniaDataStore();
|
||||
|
||||
/**
|
||||
* เข้าสู้หน้าของรายการ เเต่ละ ประเภท
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import { ref, onMounted } from "vue";
|
|||
import { useQuasar } 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 Form from '@/modules/11_discipline/components/6_BasicInformation/Channel/Form.vue'
|
||||
|
|
@ -23,24 +22,11 @@ const {
|
|||
success,
|
||||
dialogMessageNotify,
|
||||
} = mixin;
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
//form data input
|
||||
const edit = ref<boolean>(false);
|
||||
|
||||
|
||||
/**
|
||||
* เรียกข้อมูลจากรายการ
|
||||
*/
|
||||
onMounted(async () => {});
|
||||
const fetchData = async () => {};
|
||||
|
||||
/**
|
||||
* ลบข้อมูล
|
||||
* @param id ไอดีของข้อมูลที่ต้องการลบ
|
||||
*/
|
||||
const deleteData = async (id: string) => {};
|
||||
|
||||
/* บันทึกข้อมูล**/
|
||||
function onSubmit(channelReturn:string){
|
||||
dialogConfirm($q,()=>saveData(channelReturn))
|
||||
|
|
@ -67,7 +53,7 @@ function saveData(channelReturn:string){
|
|||
/**
|
||||
* ย้อนกลับหน้ารายการ
|
||||
*/
|
||||
const clickBack = () => {
|
||||
function clickBack(){
|
||||
router.push(`/discipline/channel`);
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -15,13 +15,6 @@ const $q = useQuasar();
|
|||
const mixin = useCounterMixin();
|
||||
const { messageError, showLoader, hideLoader, dialogConfirm, success } = mixin;
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* เรียกใช้งาน fetchData เพื่อดึงข้อมูล
|
||||
*/
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
|
||||
/**
|
||||
* get ข้อมูลเก่ากรณีแก้ไขข้อมูล
|
||||
*/
|
||||
|
|
@ -71,6 +64,13 @@ function putData(type: string) {
|
|||
router.push(`/discipline/channel`);
|
||||
});
|
||||
}
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* เรียกใช้งาน fetchData เพื่อดึงข้อมูล
|
||||
*/
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, useAttrs, onMounted } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import router from "@/router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
|
@ -39,7 +38,7 @@ const pagination = ref({
|
|||
/**
|
||||
* clickไปหน้าเพิ่มchanel
|
||||
*/
|
||||
const clickAdd = () => {
|
||||
function clickAdd(){
|
||||
dataStore.getType('')
|
||||
router.push(`/discipline/channel/add`);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -15,13 +15,6 @@ const $q = useQuasar();
|
|||
const mixin = useCounterMixin();
|
||||
const { messageError, showLoader, hideLoader, dialogConfirm, success } = mixin;
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* เรียกใช้งาน fetchData เพื่อดึงข้อมูล
|
||||
*/
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
|
||||
/**
|
||||
* get ข้อมูลเก่ากรณีแก้ไขข้อมูล
|
||||
*/
|
||||
|
|
@ -38,7 +31,7 @@ const data = reactive<FormData>({
|
|||
/**
|
||||
* ดึงค่าจาก api
|
||||
*/
|
||||
const fetchData = async () => {
|
||||
async function fetchData(){
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.directorbyId(personalId.value))
|
||||
|
|
@ -89,6 +82,13 @@ function putData(formData: FormData) {
|
|||
router.push(`/discipline/director`);
|
||||
});
|
||||
}
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* เรียกใช้งาน fetchData เพื่อดึงข้อมูล
|
||||
*/
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||
|
|
|
|||
|
|
@ -70,10 +70,28 @@ watch(props.data, async () => {
|
|||
|
||||
});
|
||||
|
||||
/**
|
||||
* ตรวจสอบข้อมูลก่อนส่งไปยัง 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 emailRef = ref<object | null>(null);
|
||||
const formRef: FormRef = {
|
||||
prefix: prefixRef,
|
||||
firstname: firstnameRef,
|
||||
lastname: lastnameRef,
|
||||
position: positionRef,
|
||||
phone: phoneRef,
|
||||
email: emailRef,
|
||||
};
|
||||
|
||||
/**
|
||||
* เพิ่มบุคลากร
|
||||
*/
|
||||
function addEmployee() {
|
||||
function addEmployee() {
|
||||
if (idCard.value.length === 13) {
|
||||
console.log("idCard===>", idCard.value);
|
||||
showLoader();
|
||||
|
|
@ -111,24 +129,6 @@ function addEmployee() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ตรวจสอบข้อมูลก่อนส่งไปยัง 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 emailRef = ref<object | null>(null);
|
||||
const formRef: FormRef = {
|
||||
prefix: prefixRef,
|
||||
firstname: firstnameRef,
|
||||
lastname: lastnameRef,
|
||||
position: positionRef,
|
||||
phone: phoneRef,
|
||||
email: emailRef,
|
||||
};
|
||||
|
||||
/** ฟังชั่นตรวจสอบความถูกต้องก่อน บันทึก */
|
||||
function onValidate() {
|
||||
const hasError = [];
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, useAttrs, onMounted, watch } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import router from "@/router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useDisciplineDirectorDataStore } from "@/modules/11_discipline/store/DirectorStore";
|
||||
|
|
@ -11,20 +9,19 @@ import http from "@/plugins/http";
|
|||
const $q = useQuasar();
|
||||
const dataStore = useDisciplineDirectorDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
dialogRemove,
|
||||
success,
|
||||
} = mixin;
|
||||
const { messageError, showLoader, hideLoader, dialogRemove, success } = mixin;
|
||||
|
||||
const currentPage = ref<number>(1);
|
||||
const maxPage = ref<number>(1);
|
||||
const page = ref<number>(1);
|
||||
const rowsPerPage = ref<number>(10);
|
||||
|
||||
/**
|
||||
* ค้นหาในตาราง
|
||||
*/
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<HTMLInputElement | null>(null);
|
||||
|
||||
/**
|
||||
*pagination ของตาราง
|
||||
*/
|
||||
|
|
@ -34,16 +31,22 @@ const pagination = ref({
|
|||
rowsPerPage: rowsPerPage.value,
|
||||
});
|
||||
|
||||
watch(() => currentPage.value,() => {
|
||||
rowsPerPage.value = pagination.value.rowsPerPage;
|
||||
getList();
|
||||
});
|
||||
watch(
|
||||
() => currentPage.value,
|
||||
() => {
|
||||
rowsPerPage.value = pagination.value.rowsPerPage;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
watch(()=>pagination.value.rowsPerPage,()=>{
|
||||
rowsPerPage.value = pagination.value.rowsPerPage;
|
||||
currentPage.value = 1
|
||||
getList();
|
||||
})
|
||||
watch(
|
||||
() => pagination.value.rowsPerPage,
|
||||
() => {
|
||||
rowsPerPage.value = pagination.value.rowsPerPage;
|
||||
currentPage.value = 1;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
async function getList() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -56,7 +59,7 @@ async function getList() {
|
|||
)
|
||||
.then((res) => {
|
||||
maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
|
||||
const data = res.data.result.data
|
||||
const data = res.data.result.data;
|
||||
dataStore.fetchData(data);
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -94,19 +97,6 @@ async function deleteData(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
onMounted(() => {
|
||||
getList();
|
||||
// get ข้อมูลแล้วโยนใส่ store
|
||||
});
|
||||
|
||||
/**
|
||||
* ค้นหาในตาราง
|
||||
*/
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<HTMLInputElement | null>(null);
|
||||
function resetFilter() {
|
||||
filterKeyword.value = "";
|
||||
if (filterRef.value) {
|
||||
|
|
@ -114,10 +104,18 @@ function resetFilter() {
|
|||
}
|
||||
}
|
||||
|
||||
function filterFn(){
|
||||
getList()
|
||||
console.log('enter',filterKeyword.value)
|
||||
function filterFn() {
|
||||
getList();
|
||||
console.log("enter", filterKeyword.value);
|
||||
}
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
onMounted(() => {
|
||||
getList();
|
||||
// get ข้อมูลแล้วโยนใส่ store
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
|
|
|
|||
|
|
@ -105,6 +105,10 @@ const checkSelected = computed(() => {
|
|||
}
|
||||
});
|
||||
|
||||
const type = ref<string>("");
|
||||
//----(ดึงข้อมูลประเภทคำสั่ง)------//
|
||||
const optionsType = ref<[]>([]);
|
||||
|
||||
//popup ยืนยันส่งัว
|
||||
function saveOrder() {
|
||||
dialogConfirm(
|
||||
|
|
@ -132,10 +136,7 @@ function Reset() {
|
|||
emit("update:filterKeyword2", "");
|
||||
}
|
||||
|
||||
const type = ref<string>("");
|
||||
//----(ดึงข้อมูลประเภทคำสั่ง)------//
|
||||
const optionsType = ref<[]>([]);
|
||||
const fecthTypeOption = async () => {
|
||||
async function fecthTypeOption(){
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.typeOrder())
|
||||
|
|
@ -153,12 +154,6 @@ const fecthTypeOption = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
// watch([()=>props.modal],() => {
|
||||
// selected.value = props.modal ? [] : [];
|
||||
// if (props.modal === true) {
|
||||
// selected.value = props.rows2;
|
||||
// }
|
||||
// });
|
||||
onMounted(() => {
|
||||
fecthTypeOption();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -175,30 +175,6 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
// async function getList() {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(
|
||||
// config.API.complaintList(
|
||||
// page.value,
|
||||
// rowsPerPage.value,
|
||||
// filterKeyword.value
|
||||
// )
|
||||
// )
|
||||
// //
|
||||
// .then((res) => {
|
||||
// maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
|
||||
// const data = res.data.result.data;
|
||||
// fetchAppealComplain(data);
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// }
|
||||
|
||||
/** ไปยังหน้าเพิ่มข้อมูล */
|
||||
function redirectToPageadd() {
|
||||
dataStore.rowsAdd = [];
|
||||
|
|
@ -213,11 +189,6 @@ function filterFn() {
|
|||
console.log("enter", filterKeyword.value);
|
||||
}
|
||||
|
||||
function openEditStatus(data: RowList[]) {
|
||||
modalStatusEdit.value = true;
|
||||
dataRow.value = data;
|
||||
}
|
||||
|
||||
function close() {
|
||||
modalStatusEdit.value = false;
|
||||
}
|
||||
|
|
@ -229,6 +200,7 @@ function editStatusReturn(data: any) {
|
|||
});
|
||||
}
|
||||
|
||||
/** ดึงข้อมูลเริ่มต้น */
|
||||
function getData() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -254,10 +226,12 @@ function getData() {
|
|||
});
|
||||
}
|
||||
|
||||
/** update status */
|
||||
function dataUpdate() {
|
||||
getData();
|
||||
}
|
||||
|
||||
/** set ปี ทั้งหมด */
|
||||
function yearAll() {
|
||||
formData.year = 0;
|
||||
getData();
|
||||
|
|
@ -265,7 +239,6 @@ function yearAll() {
|
|||
/** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */
|
||||
onMounted(async () => {
|
||||
getData();
|
||||
// await getList();
|
||||
dataStore.visibleColumns = visibleColumns.value;
|
||||
dataStore.columns = columns.value;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ const myForm = ref<QForm | null>(null);
|
|||
/**
|
||||
* ฟังก์ชั่น Save
|
||||
*/
|
||||
const submit = async () => {
|
||||
async function submit(){
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then((success) => {
|
||||
if (success) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { ref } from "vue";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { DataOption } from '@/modules/11_discipline/interface/index/Main'
|
||||
import type { MainList, RowList,RowAddList } from '@/modules/11_discipline/interface/response/appealComplain'
|
||||
import type { MainList, RowList, RowAddList } from '@/modules/11_discipline/interface/response/appealComplain'
|
||||
|
||||
export const useAppealComplainStore = defineStore(
|
||||
"AppealComplainStore",
|
||||
|
|
@ -15,48 +15,6 @@ export const useAppealComplainStore = defineStore(
|
|||
|
||||
const mixin = useCounterMixin()
|
||||
const { date2Thai } = mixin
|
||||
function fetchAppealComplain(data: MainList[]) {
|
||||
let dataList: RowList[] = data.map((e: MainList) => ({
|
||||
id: e.id,
|
||||
profileId: e.profileId,
|
||||
type: typeConvert(e.type),
|
||||
title: e.title,
|
||||
description: e.description,
|
||||
year: e.year,
|
||||
fullname: e.fullname,
|
||||
citizenId: e.citizenId,
|
||||
caseType: e.caseType,
|
||||
caseNumber: e.caseNumber,
|
||||
lastUpdatedAt: date2Thai(e.lastUpdatedAt),
|
||||
status: statusTothai(e.status)
|
||||
}));
|
||||
rows.value = dataList;
|
||||
}
|
||||
function getRow(data:RowAddList[]){
|
||||
if(data){
|
||||
rowsAdd.value = data
|
||||
}
|
||||
}
|
||||
function statusTothai(val: string){
|
||||
switch (val) {
|
||||
case "NEW":
|
||||
return "ใหม่";
|
||||
case "RECEIVE_DOC":
|
||||
return "ได้รับเอกสารแล้ว";
|
||||
case "RECEIVE_APPEAL":
|
||||
return "รับอุทธรณ์/ร้องทุกข์";
|
||||
case "NO_RECEIVE_APPEAL":
|
||||
return "ไม่รับอุทธรณ์/ร้องทุกข์";
|
||||
case "DIAGNOSTIC":
|
||||
return "ตั้งองค์คณะวินิจฉัย";
|
||||
case "SUMMARY":
|
||||
return "สรุปผลการพิจารณา";
|
||||
case "DONE":
|
||||
return "ปิดคำร้อง";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
};
|
||||
const typeConvert = (val: string) => {
|
||||
switch (val) {
|
||||
case "APPEAL":
|
||||
|
|
@ -96,6 +54,50 @@ export const useAppealComplainStore = defineStore(
|
|||
{ id: "DONE", name: "ปิดคำร้อง" },
|
||||
]);
|
||||
|
||||
function fetchAppealComplain(data: MainList[]) {
|
||||
let dataList: RowList[] = data.map((e: MainList) => ({
|
||||
id: e.id,
|
||||
profileId: e.profileId,
|
||||
type: typeConvert(e.type),
|
||||
title: e.title,
|
||||
description: e.description,
|
||||
year: e.year,
|
||||
fullname: e.fullname,
|
||||
citizenId: e.citizenId,
|
||||
caseType: e.caseType,
|
||||
caseNumber: e.caseNumber,
|
||||
lastUpdatedAt: date2Thai(e.lastUpdatedAt),
|
||||
status: statusTothai(e.status)
|
||||
}));
|
||||
rows.value = dataList;
|
||||
}
|
||||
function getRow(data: RowAddList[]) {
|
||||
if (data) {
|
||||
rowsAdd.value = data
|
||||
}
|
||||
}
|
||||
function statusTothai(val: string) {
|
||||
switch (val) {
|
||||
case "NEW":
|
||||
return "ใหม่";
|
||||
case "RECEIVE_DOC":
|
||||
return "ได้รับเอกสารแล้ว";
|
||||
case "RECEIVE_APPEAL":
|
||||
return "รับอุทธรณ์/ร้องทุกข์";
|
||||
case "NO_RECEIVE_APPEAL":
|
||||
return "ไม่รับอุทธรณ์/ร้องทุกข์";
|
||||
case "DIAGNOSTIC":
|
||||
return "ตั้งองค์คณะวินิจฉัย";
|
||||
case "SUMMARY":
|
||||
return "สรุปผลการพิจารณา";
|
||||
case "DONE":
|
||||
return "ปิดคำร้อง";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
return {
|
||||
rows,
|
||||
|
|
|
|||
|
|
@ -65,7 +65,11 @@ export const useComplainstDataStore = defineStore(
|
|||
{ id: "URGENT", name: "ด่วน" },
|
||||
{ id: "VERY_URGENT", name: "ด่วนมาก" },
|
||||
]);
|
||||
|
||||
|
||||
const agencytoptions = ref<DataOption[]>(consideredAgencytoptions.value);
|
||||
const optionListNameMain = ref<DataOption[]>([]);
|
||||
const optionListName = ref<DataOption[]>([]);
|
||||
|
||||
function levelConsiderationTran(val: string) {
|
||||
return (
|
||||
levelConsiderationtOptions.value.find((v: any) => v.id === val)?.name ??
|
||||
|
|
@ -73,10 +77,6 @@ export const useComplainstDataStore = defineStore(
|
|||
);
|
||||
}
|
||||
|
||||
const agencytoptions = ref<DataOption[]>(consideredAgencytoptions.value);
|
||||
const optionListNameMain = ref<DataOption[]>([]);
|
||||
const optionListName = ref<DataOption[]>([]);
|
||||
|
||||
function selectComplainantTpye(list: any) {
|
||||
optionListNameMain.value = list;
|
||||
optionListName.value = list;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ export const useDisciplineDirectorDataStore = defineStore(
|
|||
"disciplineDirector",
|
||||
() => {
|
||||
//ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
const rows = ref<DirectorRowsResponse[]>([]);
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
"fullName",
|
||||
|
|
@ -89,7 +90,6 @@ export const useDisciplineDirectorDataStore = defineStore(
|
|||
]);
|
||||
|
||||
// ข้อมูลในตาราง
|
||||
const rows = ref<DirectorRowsResponse[]>([]);
|
||||
function fetchData(data: DirectorRows[]) {
|
||||
const dataList: DirectorRowsResponse[] = data.map(
|
||||
(item: DirectorRows) => ({
|
||||
|
|
|
|||
|
|
@ -67,66 +67,6 @@ export const useInvestigateDisStore = defineStore(
|
|||
{ id: "ไม่ร้ายแรง", name: "ไม่ร้ายแรง" },
|
||||
]);
|
||||
|
||||
function convertStatus(val: string) {
|
||||
const result = statusOps.value.find((x: any) => x.id == val)?.name;
|
||||
return result ? result : "-";
|
||||
}
|
||||
|
||||
async function fetchList(data: investigateDisDataRowType[]) {
|
||||
let datalist: any[] = data.map((e: any) => ({
|
||||
id: e.id,
|
||||
title: e.title,
|
||||
respondentType: convertRespondentType(e.respondentType),
|
||||
offenseDetails: convertFault(e.offenseDetails),
|
||||
disciplinaryFaultLevel: e.disciplinaryFaultLevel ?? "-",
|
||||
disciplinaryCaseFault: e.disciplinaryCaseFault ?? "-",
|
||||
status: convertStatus(e.status) ?? "-",
|
||||
createdAt: e.createdAt ? date2Thai(e.createdAt) : "-",
|
||||
}));
|
||||
|
||||
rows.value = datalist;
|
||||
}
|
||||
|
||||
async function fecthDirector(data: directorType[]) {
|
||||
let datalistDirector: responseType[] = data.map((e: directorType) => ({
|
||||
id: e.id,
|
||||
name: `${e.prefix}${e.firstName} ${e.lastName}`,
|
||||
prefix: e.prefix,
|
||||
firstName: e.firstName,
|
||||
lastName: e.lastName,
|
||||
position: e.position,
|
||||
email: e.email,
|
||||
phone: e.phone,
|
||||
}));
|
||||
rows2.value = datalistDirector;
|
||||
selected.value = rows2.value;
|
||||
// console.log(rows2.value);
|
||||
}
|
||||
|
||||
function convertRespondentType(val: string) {
|
||||
switch (val) {
|
||||
case "PERSON":
|
||||
return "บุคคล";
|
||||
case "ORGANIZATION":
|
||||
return "หน่วยงาน";
|
||||
case "BANGKOK":
|
||||
return "กรุงเทพมหานคร";
|
||||
}
|
||||
}
|
||||
|
||||
function convertFault(val: string) {
|
||||
switch (val) {
|
||||
case "NOT_SPECIFIED":
|
||||
return "ความผิดวินัยยังไม่ระบุ";
|
||||
case "NOT_DEADLY":
|
||||
return "ความผิดวินัยไม่ร้ายแรง";
|
||||
case "DEADLY":
|
||||
return "ความผิดวินัยร้ายแรง";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"title",
|
||||
|
|
@ -284,18 +224,69 @@ export const useInvestigateDisStore = defineStore(
|
|||
field: "phone",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
// {
|
||||
// name: "total",
|
||||
// align: "left",
|
||||
// label: "จำนวนเรื่องสืบสวน",
|
||||
// sortable: true,
|
||||
// field: "total",
|
||||
// headerStyle: "font-size: 14px",
|
||||
// style: "font-size: 14px",
|
||||
// },
|
||||
}
|
||||
]);
|
||||
|
||||
function convertStatus(val: string) {
|
||||
const result = statusOps.value.find((x: any) => x.id == val)?.name;
|
||||
return result ? result : "-";
|
||||
}
|
||||
|
||||
async function fetchList(data: investigateDisDataRowType[]) {
|
||||
let datalist: any[] = data.map((e: any) => ({
|
||||
id: e.id,
|
||||
title: e.title,
|
||||
respondentType: convertRespondentType(e.respondentType),
|
||||
offenseDetails: convertFault(e.offenseDetails),
|
||||
disciplinaryFaultLevel: e.disciplinaryFaultLevel ?? "-",
|
||||
disciplinaryCaseFault: e.disciplinaryCaseFault ?? "-",
|
||||
status: convertStatus(e.status) ?? "-",
|
||||
createdAt: e.createdAt ? date2Thai(e.createdAt) : "-",
|
||||
}));
|
||||
|
||||
rows.value = datalist;
|
||||
}
|
||||
|
||||
async function fecthDirector(data: directorType[]) {
|
||||
let datalistDirector: responseType[] = data.map((e: directorType) => ({
|
||||
id: e.id,
|
||||
name: `${e.prefix}${e.firstName} ${e.lastName}`,
|
||||
prefix: e.prefix,
|
||||
firstName: e.firstName,
|
||||
lastName: e.lastName,
|
||||
position: e.position,
|
||||
email: e.email,
|
||||
phone: e.phone,
|
||||
}));
|
||||
rows2.value = datalistDirector;
|
||||
selected.value = rows2.value;
|
||||
// console.log(rows2.value);
|
||||
}
|
||||
|
||||
function convertRespondentType(val: string) {
|
||||
switch (val) {
|
||||
case "PERSON":
|
||||
return "บุคคล";
|
||||
case "ORGANIZATION":
|
||||
return "หน่วยงาน";
|
||||
case "BANGKOK":
|
||||
return "กรุงเทพมหานคร";
|
||||
}
|
||||
}
|
||||
|
||||
function convertFault(val: string) {
|
||||
switch (val) {
|
||||
case "NOT_SPECIFIED":
|
||||
return "ความผิดวินัยยังไม่ระบุ";
|
||||
case "NOT_DEADLY":
|
||||
return "ความผิดวินัยไม่ร้ายแรง";
|
||||
case "DEADLY":
|
||||
return "ความผิดวินัยร้ายแรง";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
|
||||
function filterFnOptionsType(
|
||||
val: string | number,
|
||||
update: any,
|
||||
|
|
|
|||
|
|
@ -33,6 +33,10 @@ export const useInvestigateFactStore = defineStore(
|
|||
"DisciplineInvestigateFact",
|
||||
() => {
|
||||
const tabMenu = ref<string>("investigatefacts");
|
||||
const rows = ref<InvestigatefactsDataRowType[]>();
|
||||
const respondentTypeOps = ref<DataOption[]>(
|
||||
mainStore.complainantoptionsMain
|
||||
);
|
||||
|
||||
const daysExtendOps = ref<DataNumberOption[]>([
|
||||
{ id: 15, name: "15 วัน" },
|
||||
|
|
@ -189,11 +193,7 @@ export const useInvestigateFactStore = defineStore(
|
|||
});
|
||||
}
|
||||
|
||||
const rows = ref<InvestigatefactsDataRowType[]>();
|
||||
|
||||
const respondentTypeOps = ref<DataOption[]>(
|
||||
mainStore.complainantoptionsMain
|
||||
);
|
||||
function filterSelector(val: string, update: Function, type: string) {
|
||||
console.log(val);
|
||||
update(() => {
|
||||
|
|
@ -206,6 +206,7 @@ export const useInvestigateFactStore = defineStore(
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function fecthList(data: ListData[]) {
|
||||
rows.value = await data.map((e: ListData) => {
|
||||
return {
|
||||
|
|
@ -219,8 +220,8 @@ export const useInvestigateFactStore = defineStore(
|
|||
dateInvestigate:
|
||||
e.investigationDateStart && e.investigationDateEnd
|
||||
? `${date2Thai(e.investigationDateStart)} - ${date2Thai(
|
||||
e.investigationDateEnd
|
||||
)}`
|
||||
e.investigationDateEnd
|
||||
)}`
|
||||
: "-",
|
||||
investigationStatusResult: mainStore.convertStatusResult(
|
||||
e.investigationStatusResult
|
||||
|
|
|
|||
|
|
@ -28,56 +28,6 @@ export const useDisciplineResultStore = defineStore(
|
|||
storeMain.complainantoptionsMain
|
||||
);
|
||||
|
||||
function filterSelector(val: string, update: Function, type: string) {
|
||||
update(() => {
|
||||
const needle = val.toLowerCase();
|
||||
if (type === "filterrespondentType") {
|
||||
complainantoptions.value = storeMain.complainantoptionsMain.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function fetchList(data: DataResult[]) {
|
||||
const datalist: DataResultList[] = data.map((e: DataResult) => ({
|
||||
id: e.id,
|
||||
title: e.title,
|
||||
respondentType: e.respondentType
|
||||
? storeMain.convertComplaintType(e.respondentType)
|
||||
: "-",
|
||||
offenseDetails: e.offenseDetails
|
||||
? storeMain.convertFault(e.offenseDetails)
|
||||
: "-",
|
||||
disciplinaryFaultLevel: e.disciplinaryFaultLevel
|
||||
? e.disciplinaryFaultLevel
|
||||
: "-",
|
||||
disciplinaryCaseFault: e.disciplinaryCaseFault
|
||||
? e.disciplinaryCaseFault
|
||||
: "-",
|
||||
status: e.status && convertStatus(e.status),
|
||||
createdAt: e.createdAt && date2Thai(e.createdAt),
|
||||
disciplineType: e.disciplineType ? e.disciplineType:'-' ,
|
||||
titleType: e.titleType ? e.titleType:'-' ,
|
||||
oc: e.oc ? e.oc:'-'
|
||||
}));
|
||||
rows.value = datalist;
|
||||
}
|
||||
|
||||
/** function สถานะ*/
|
||||
function convertStatus(val: string) {
|
||||
switch (val) {
|
||||
// case "NEW":
|
||||
// return "กำลังสรุปผลการพิจารณา";
|
||||
// case "STOP":
|
||||
// return "ยุติเรื่อง";
|
||||
case "DONE":
|
||||
return "กำลังสรุปผลการพิจารณา";
|
||||
case "REPORT":
|
||||
return "ส่งไปออกคำสั่ง";
|
||||
}
|
||||
}
|
||||
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"title",
|
||||
|
|
@ -211,6 +161,7 @@ export const useDisciplineResultStore = defineStore(
|
|||
"telephone",
|
||||
"role",
|
||||
]);
|
||||
|
||||
const columnsDirector = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
|
|
@ -276,6 +227,53 @@ export const useDisciplineResultStore = defineStore(
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
|
||||
function filterSelector(val: string, update: Function, type: string) {
|
||||
update(() => {
|
||||
const needle = val.toLowerCase();
|
||||
if (type === "filterrespondentType") {
|
||||
complainantoptions.value = storeMain.complainantoptionsMain.filter(
|
||||
(v: any) => v.name.toLowerCase().indexOf(needle) > -1
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function fetchList(data: DataResult[]) {
|
||||
const datalist: DataResultList[] = data.map((e: DataResult) => ({
|
||||
id: e.id,
|
||||
title: e.title,
|
||||
respondentType: e.respondentType
|
||||
? storeMain.convertComplaintType(e.respondentType)
|
||||
: "-",
|
||||
offenseDetails: e.offenseDetails
|
||||
? storeMain.convertFault(e.offenseDetails)
|
||||
: "-",
|
||||
disciplinaryFaultLevel: e.disciplinaryFaultLevel
|
||||
? e.disciplinaryFaultLevel
|
||||
: "-",
|
||||
disciplinaryCaseFault: e.disciplinaryCaseFault
|
||||
? e.disciplinaryCaseFault
|
||||
: "-",
|
||||
status: e.status && convertStatus(e.status),
|
||||
createdAt: e.createdAt && date2Thai(e.createdAt),
|
||||
disciplineType: e.disciplineType ? e.disciplineType:'-' ,
|
||||
titleType: e.titleType ? e.titleType:'-' ,
|
||||
oc: e.oc ? e.oc:'-'
|
||||
}));
|
||||
rows.value = datalist;
|
||||
}
|
||||
|
||||
/** function สถานะ*/
|
||||
function convertStatus(val: string) {
|
||||
switch (val) {
|
||||
case "DONE":
|
||||
return "กำลังสรุปผลการพิจารณา";
|
||||
case "REPORT":
|
||||
return "ส่งไปออกคำสั่ง";
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
tabMenu,
|
||||
fetchList,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from 'vue'
|
||||
import type { listData, dataType ,DataOption} from '@/modules/11_discipline/interface/response/suspend'
|
||||
import type { listData, dataType, DataOption } from '@/modules/11_discipline/interface/response/suspend'
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ export const useDisciplineSuspendStore = defineStore(
|
|||
|
||||
const mixin = useCounterMixin()
|
||||
const { date2Thai } = mixin
|
||||
|
||||
|
||||
const offenseDetailsOps = ref<DataOption[]>([
|
||||
{ id: "NOT_SPECIFIED", name: "ยังไม่ระบุ" },
|
||||
{ id: "NOT_DEADLY", name: "ไม่ร้ายแรง" },
|
||||
|
|
@ -22,7 +22,7 @@ export const useDisciplineSuspendStore = defineStore(
|
|||
|
||||
function getData(data: listData[]) {
|
||||
console.log(data)
|
||||
const dataList: dataType[] = data.map((item: listData) => ({
|
||||
const dataList: dataType[] = data.map((item: listData) => ({
|
||||
id: item.id,
|
||||
citizenId: item.citizenId,
|
||||
name: `${item.prefix}${item.firstName} ${item.lastName}`,
|
||||
|
|
@ -37,7 +37,7 @@ export const useDisciplineSuspendStore = defineStore(
|
|||
status: statusTothai(item.status),
|
||||
statusEn: item.status,
|
||||
descriptionSuspend: item.descriptionSuspend,
|
||||
dateTotal:item.startDateSuspend && item.endDateSuspend ? `${date2Thai(item.startDateSuspend)} - ${date2Thai(item.endDateSuspend)}`:'-',
|
||||
dateTotal: item.startDateSuspend && item.endDateSuspend ? `${date2Thai(item.startDateSuspend)} - ${date2Thai(item.endDateSuspend)}` : '-',
|
||||
startDateSuspend: item.startDateSuspend,
|
||||
endDateSuspend: item.endDateSuspend,
|
||||
title: item.title,
|
||||
|
|
@ -63,7 +63,7 @@ export const useDisciplineSuspendStore = defineStore(
|
|||
return "ส่งรายชื่อไปออกคำสั่ง";
|
||||
case "DONE":
|
||||
return "ออกคำสั่งเสร็จแล้ว";
|
||||
|
||||
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,41 +12,6 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
|
|||
{ id: "BANGKOK", name: "กรุงเทพมหานคร" },
|
||||
]);
|
||||
|
||||
function convertComplaintType(val: string) {
|
||||
const result = complainantoptionsMain.value.find(
|
||||
(x: any) => x.id == val
|
||||
)?.name;
|
||||
return result ? result : "-";
|
||||
}
|
||||
|
||||
/** function ลักษณะความผิด*/
|
||||
function convertFault(val: string) {
|
||||
switch (val) {
|
||||
case "NOT_SPECIFIED":
|
||||
return "ความผิดวินัยยังไม่ระบุ";
|
||||
case "NOT_DEADLY":
|
||||
return "ความผิดวินัยไม่ร้ายแรง";
|
||||
case "DEADLY":
|
||||
return "ความผิดวินัยร้ายแรง";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
|
||||
/** function สถานะ*/
|
||||
function convertStatus(val: string) {
|
||||
switch (val) {
|
||||
case "NEW":
|
||||
return "กำลังสอบสวน";
|
||||
case "STOP":
|
||||
return "ยุติเรื่อง";
|
||||
case "SEND_DISCIPLINARY":
|
||||
return "ส่งไปสอบสวน";
|
||||
case "DONE":
|
||||
return "ส่งไปสรุปผลการพิจารณาความผิดทางวินัย";
|
||||
}
|
||||
}
|
||||
|
||||
/** option ลักษณะความผิด */
|
||||
const offenseDetailstOptions = ref<DataOption[]>([
|
||||
{ id: "NOT_SPECIFIED", name: "ยังไม่ระบุ" },
|
||||
|
|
@ -54,29 +19,18 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
|
|||
{ id: "DEADLY", name: "ร้ายแรง" },
|
||||
]);
|
||||
|
||||
function convertOffenseDetailst(val: string) {
|
||||
return (
|
||||
offenseDetailstOptions.value.find((x: any) => x.id == val)?.name ?? "-"
|
||||
);
|
||||
}
|
||||
|
||||
const statusResultOptions = ref<DataOption[]>([
|
||||
{ id: "NOT_SPECIFIED", name: "ยังไม่ระบุ" },
|
||||
{ id: "HAVE_CAUSE", name: "มีมูล" },
|
||||
{ id: "NO_CAUSE", name: "ไม่มีมูล" },
|
||||
]);
|
||||
function convertStatusResult(val: string) {
|
||||
const result = statusResultOptions.value.find(
|
||||
(x: any) => x.id == val
|
||||
)?.name;
|
||||
return result ? result : "-";
|
||||
}
|
||||
|
||||
const causeTextOptions = ref<DataOption[]>([
|
||||
{ id: "ร้ายแรง", name: "ร้ายแรง" },
|
||||
{ id: "ไม่ร้ายแรง", name: "ไม่ร้ายแรง" },
|
||||
]);
|
||||
|
||||
const rowsAdd = ref<ArrayPersonAdd[]>([]);
|
||||
const rowsCheck = ref<ArrayPersonAdd[]>([]);
|
||||
/** หัวตารางผู้ถูกร้องเรียน */
|
||||
const columnsRespondent = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
@ -273,8 +227,55 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
|
|||
"organization",
|
||||
]);
|
||||
|
||||
const rowsAdd = ref<ArrayPersonAdd[]>([]);
|
||||
const rowsCheck = ref<ArrayPersonAdd[]>([]);
|
||||
function convertComplaintType(val: string) {
|
||||
const result = complainantoptionsMain.value.find(
|
||||
(x: any) => x.id == val
|
||||
)?.name;
|
||||
return result ? result : "-";
|
||||
}
|
||||
|
||||
/** function ลักษณะความผิด*/
|
||||
function convertFault(val: string) {
|
||||
switch (val) {
|
||||
case "NOT_SPECIFIED":
|
||||
return "ความผิดวินัยยังไม่ระบุ";
|
||||
case "NOT_DEADLY":
|
||||
return "ความผิดวินัยไม่ร้ายแรง";
|
||||
case "DEADLY":
|
||||
return "ความผิดวินัยร้ายแรง";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
}
|
||||
|
||||
/** function สถานะ*/
|
||||
function convertStatus(val: string) {
|
||||
switch (val) {
|
||||
case "NEW":
|
||||
return "กำลังสอบสวน";
|
||||
case "STOP":
|
||||
return "ยุติเรื่อง";
|
||||
case "SEND_DISCIPLINARY":
|
||||
return "ส่งไปสอบสวน";
|
||||
case "DONE":
|
||||
return "ส่งไปสรุปผลการพิจารณาความผิดทางวินัย";
|
||||
}
|
||||
}
|
||||
|
||||
function convertOffenseDetailst(val: string) {
|
||||
return (
|
||||
offenseDetailstOptions.value.find((x: any) => x.id == val)?.name ?? "-"
|
||||
);
|
||||
}
|
||||
|
||||
function convertStatusResult(val: string) {
|
||||
const result = statusResultOptions.value.find(
|
||||
(x: any) => x.id == val
|
||||
)?.name;
|
||||
return result ? result : "-";
|
||||
}
|
||||
|
||||
|
||||
function fetchData(data: ArrayPersonAdd[]) {
|
||||
rowsAdd.value = data;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue