fixing ระบบวินัย
This commit is contained in:
parent
e9ee7e7f40
commit
ba728ea000
16 changed files with 391 additions and 442 deletions
|
|
@ -135,6 +135,26 @@ async function searchInput() {
|
||||||
organization: e.organization ?? "-",
|
organization: e.organization ?? "-",
|
||||||
phone: e.phone ?? "-",
|
phone: e.phone ?? "-",
|
||||||
email: e.email ?? "-",
|
email: e.email ?? "-",
|
||||||
|
root: e.root,
|
||||||
|
rootId: e.rootId,
|
||||||
|
rootShortName: e.rootShortName,
|
||||||
|
child1: e.child1,
|
||||||
|
child1Id: e.child1Id,
|
||||||
|
child1ShortName: e.child1ShortName,
|
||||||
|
child2: e.child2,
|
||||||
|
child2Id: e.child2Id,
|
||||||
|
child2ShortName: e.child2ShortName,
|
||||||
|
child3: e.child3,
|
||||||
|
child3Id: e.child3Id,
|
||||||
|
child3ShortName: e.child3ShortName,
|
||||||
|
child4: e.child4,
|
||||||
|
child4Id: e.child4Id,
|
||||||
|
child4ShortName: e.child4ShortName,
|
||||||
|
posMasterNo: e.posMasterNo,
|
||||||
|
posTypeId: e.posTypeId,
|
||||||
|
posTypeName: e.posTypeName,
|
||||||
|
posLevelId: e.posLevelId,
|
||||||
|
posLevelName: e.posLevelName,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
rows.value = list;
|
rows.value = list;
|
||||||
|
|
|
||||||
|
|
@ -255,6 +255,8 @@ interface DataProfile {
|
||||||
rootOld?: string;
|
rootOld?: string;
|
||||||
rootShortNameOld?: string | null;
|
rootShortNameOld?: string | null;
|
||||||
status: string;
|
status: string;
|
||||||
|
positionType?: string;
|
||||||
|
positionLevel?: string;
|
||||||
}
|
}
|
||||||
export type {
|
export type {
|
||||||
DataOption,
|
DataOption,
|
||||||
|
|
|
||||||
|
|
@ -18,46 +18,7 @@ async function onSubmit(data: any) {
|
||||||
/** post */
|
/** post */
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.post(config.API.complaintAdd(), {
|
.post(config.API.complaintAdd(), data)
|
||||||
id: data.id,
|
|
||||||
respondentType: data.respondentType,
|
|
||||||
organizationId: data.organizationId,
|
|
||||||
consideredAgency: data.consideredAgency,
|
|
||||||
title: data.title,
|
|
||||||
description: data.description,
|
|
||||||
dateReceived: data.dateReceived,
|
|
||||||
dateConsideration: data.dateConsideration,
|
|
||||||
offenseDetails: data.offenseDetails,
|
|
||||||
levelConsideration: data.levelConsideration,
|
|
||||||
dateNotification: data.dateNotification,
|
|
||||||
complaintFrom: data.complaintFrom,
|
|
||||||
appellant: data.appellant,
|
|
||||||
documentFile: data.documentFile,
|
|
||||||
status: data.status,
|
|
||||||
result: data.result,
|
|
||||||
persons: data.persons.map((item: any) => ({
|
|
||||||
personId: item.personId,
|
|
||||||
idcard: item.idcard,
|
|
||||||
prefix: item.prefix,
|
|
||||||
firstName: item.firstName,
|
|
||||||
lastName: item.lastName,
|
|
||||||
name: item.name,
|
|
||||||
posNo: item.posNo === "-" ? null : item.posNo,
|
|
||||||
position: item.position,
|
|
||||||
positionLevel: item.positionLevel,
|
|
||||||
salary: item.salary === "-" ? null : item.salary,
|
|
||||||
organization: item.organization,
|
|
||||||
phone: item.phone === "-" ? null : item.phone,
|
|
||||||
email: item.email,
|
|
||||||
})),
|
|
||||||
disciplineComplaintDocs: data.disciplineComplaintDocs.map(
|
|
||||||
(file: any) => ({
|
|
||||||
id: file.id,
|
|
||||||
fileName: file.fileName,
|
|
||||||
pathName: file.pathName,
|
|
||||||
})
|
|
||||||
),
|
|
||||||
})
|
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
router.push(`/discipline/complaints/${res.data.result}`);
|
router.push(`/discipline/complaints/${res.data.result}`);
|
||||||
|
|
@ -70,6 +31,7 @@ async function onSubmit(data: any) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="col-xs-12 col-sm-12 col-md-11">
|
<div class="col-xs-12 col-sm-12 col-md-11">
|
||||||
<div class="toptitle text-dark col-12 row items-center">
|
<div class="toptitle text-dark col-12 row items-center">
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,9 @@ async function getData() {
|
||||||
data.id = dataList.id;
|
data.id = dataList.id;
|
||||||
data.respondentType = dataList.respondentType;
|
data.respondentType = dataList.respondentType;
|
||||||
data.organizationId = dataList.organizationId;
|
data.organizationId = dataList.organizationId;
|
||||||
|
data.organization = dataList.organization;
|
||||||
data.consideredAgency = dataList.consideredAgency;
|
data.consideredAgency = dataList.consideredAgency;
|
||||||
|
data.consideredAgencyId = dataList.consideredAgencyId;
|
||||||
data.title = dataList.title;
|
data.title = dataList.title;
|
||||||
data.description = dataList.description;
|
data.description = dataList.description;
|
||||||
data.dateReceived = dataList.dateReceived;
|
data.dateReceived = dataList.dateReceived;
|
||||||
|
|
@ -182,6 +184,7 @@ async function getData() {
|
||||||
data.persons = dataList.persons;
|
data.persons = dataList.persons;
|
||||||
data.result = dataList.result;
|
data.result = dataList.result;
|
||||||
data.disciplineComplaintDocs = dataList.disciplineComplaintDocs;
|
data.disciplineComplaintDocs = dataList.disciplineComplaintDocs;
|
||||||
|
data.activeId = dataList.activeId;
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -197,47 +200,9 @@ async function getData() {
|
||||||
*/
|
*/
|
||||||
async function onSubmit(data: any) {
|
async function onSubmit(data: any) {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
||||||
http
|
http
|
||||||
.put(config.API.complaintbyId(id.value), {
|
.put(config.API.complaintbyId(id.value), data)
|
||||||
id: data.id,
|
|
||||||
respondentType: data.respondentType,
|
|
||||||
organizationId: data.organizationId,
|
|
||||||
consideredAgency: data.consideredAgency,
|
|
||||||
title: data.title,
|
|
||||||
description: data.description,
|
|
||||||
dateReceived: data.dateReceived,
|
|
||||||
dateConsideration: data.dateConsideration,
|
|
||||||
offenseDetails: data.offenseDetails,
|
|
||||||
levelConsideration: data.levelConsideration,
|
|
||||||
dateNotification: data.dateNotification,
|
|
||||||
complaintFrom: data.complaintFrom,
|
|
||||||
appellant: data.appellant,
|
|
||||||
documentFile: data.documentFile,
|
|
||||||
status: data.status,
|
|
||||||
result: data.result,
|
|
||||||
persons: data.persons.map((item: any) => ({
|
|
||||||
personId: item.personId,
|
|
||||||
idcard: item.idcard,
|
|
||||||
prefix: item.prefix,
|
|
||||||
firstName: item.firstName,
|
|
||||||
lastName: item.lastName,
|
|
||||||
name: item.name,
|
|
||||||
posNo: item.posNo === "-" ? null : item.posNo,
|
|
||||||
position: item.position,
|
|
||||||
positionLevel: item.positionLevel,
|
|
||||||
salary: item.salary === "-" ? null : item.salary,
|
|
||||||
organization: item.organization,
|
|
||||||
phone: item.phone === "-" ? null : item.phone,
|
|
||||||
email: item.email,
|
|
||||||
})),
|
|
||||||
disciplineComplaintDocs: data.disciplineComplaintDocs.map(
|
|
||||||
(file: any) => ({
|
|
||||||
id: file.id,
|
|
||||||
fileName: file.fileName,
|
|
||||||
pathName: file.pathName,
|
|
||||||
})
|
|
||||||
),
|
|
||||||
})
|
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
getData();
|
getData();
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
|
@ -406,7 +371,9 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-card bordered><Form :on-submit="onSubmit" :data="data" :get-data="getData" /></q-card>
|
<q-card bordered
|
||||||
|
><Form :on-submit="onSubmit" :data="data" :get-data="getData"
|
||||||
|
/></q-card>
|
||||||
<PopupSendToNext
|
<PopupSendToNext
|
||||||
:modal="modalPopup"
|
:modal="modalPopup"
|
||||||
:close="closePopup"
|
:close="closePopup"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import { useQuasar } from "quasar";
|
||||||
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
|
import type { DataOption } from "@/modules/11_discipline/interface/index/Main";
|
||||||
import type {
|
import type {
|
||||||
FormData,
|
FormData,
|
||||||
MyObjectComplaintsRef,
|
|
||||||
ArrayFileList,
|
ArrayFileList,
|
||||||
} from "@/modules/11_discipline/interface/request/complaint";
|
} from "@/modules/11_discipline/interface/request/complaint";
|
||||||
|
|
||||||
|
|
@ -17,6 +16,7 @@ import http from "@/plugins/http";
|
||||||
|
|
||||||
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
||||||
import DialogAddPersonal from "@/components/Dialogs/AddPersonal.vue";
|
import DialogAddPersonal from "@/components/Dialogs/AddPersonal.vue";
|
||||||
|
import type { OptionData } from "@/modules/07_insignia/interface/index/Main";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const fileDocDataUpload = ref<File[]>([]);
|
const fileDocDataUpload = ref<File[]>([]);
|
||||||
|
|
@ -28,6 +28,8 @@ const mainStore = useDisciplineMainStore();
|
||||||
const complainstStore = useComplainstDataStore();
|
const complainstStore = useComplainstDataStore();
|
||||||
const modalPersonal = ref<boolean>(false);
|
const modalPersonal = ref<boolean>(false);
|
||||||
const personId = ref<string>("");
|
const personId = ref<string>("");
|
||||||
|
const organization = ref<OptionData>();
|
||||||
|
const consideredAgency = ref<OptionData>();
|
||||||
|
|
||||||
/**ชั่งฟังเพิ่มข้อมูล ลง ตาราง */
|
/**ชั่งฟังเพิ่มข้อมูล ลง ตาราง */
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
|
|
@ -43,21 +45,6 @@ const {
|
||||||
} = mixin;
|
} = mixin;
|
||||||
const { filterSelector } = complainstStore; // function จาก store complainstStore
|
const { filterSelector } = complainstStore; // function จาก store complainstStore
|
||||||
|
|
||||||
/** validateForm */
|
|
||||||
const respondentTypeRef = ref<Object | null>(null);
|
|
||||||
const organizationIdRef = ref<Object | null>(null);
|
|
||||||
const consideredAgencyRef = ref<Object | null>(null);
|
|
||||||
const titleRef = ref<Object | null>(null);
|
|
||||||
const descriptionRef = ref<Object | null>(null);
|
|
||||||
const dateReceivedRef = ref<Object | null>();
|
|
||||||
const dateConsiderationRef = ref<Object | null>(null);
|
|
||||||
const offenseDetailsRef = ref<Object | null>(null);
|
|
||||||
const levelConsiderationRef = ref<Object | null>(null);
|
|
||||||
const dateNotificationRef = ref<Object | null>(null);
|
|
||||||
const complaintFromRef = ref<Object | null>(null);
|
|
||||||
const appellantRef = ref<Object | null>(null);
|
|
||||||
const resultRef = ref<Object | null>(null);
|
|
||||||
|
|
||||||
const isSave = ref<boolean>(false); // มีการแก้ไขรอบันทึก
|
const isSave = ref<boolean>(false); // มีการแก้ไขรอบันทึก
|
||||||
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||||
const fileList = ref<ArrayFileList[]>([]);
|
const fileList = ref<ArrayFileList[]>([]);
|
||||||
|
|
@ -98,18 +85,11 @@ const formData = reactive<FormData>({
|
||||||
result: "",
|
result: "",
|
||||||
persons: [],
|
persons: [],
|
||||||
disciplineComplaintDocs: fileList.value ?? null,
|
disciplineComplaintDocs: fileList.value ?? null,
|
||||||
|
activeId: null,
|
||||||
|
organization: "",
|
||||||
|
consideredAgencyId: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
|
|
||||||
const objectComplaintsRef: MyObjectComplaintsRef = {
|
|
||||||
respondentType: respondentTypeRef,
|
|
||||||
organizationId: organizationIdRef,
|
|
||||||
consideredAgency: consideredAgencyRef,
|
|
||||||
title: titleRef,
|
|
||||||
dateReceived: dateReceivedRef,
|
|
||||||
offenseDetails: offenseDetailsRef,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ฟังชั่นอัปโหลดไฟล์
|
* ฟังชั่นอัปโหลดไฟล์
|
||||||
* @param documentFile ไฟล์ที่รับมา
|
* @param documentFile ไฟล์ที่รับมา
|
||||||
|
|
@ -143,31 +123,14 @@ function selectLevel(val: string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ฟังก์ชั่นตรวจสอบความถูกต้องของข้อมูลในฟอร์ม */
|
|
||||||
function validateForm() {
|
|
||||||
const hasError = [];
|
|
||||||
for (const key in objectComplaintsRef) {
|
|
||||||
if (Object.prototype.hasOwnProperty.call(objectComplaintsRef, key)) {
|
|
||||||
const property = objectComplaintsRef[key];
|
|
||||||
if (property.value && typeof property.value.validate === "function") {
|
|
||||||
const isValid = property.value.validate();
|
|
||||||
hasError.push(isValid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (hasError.every((result) => result === true)) {
|
|
||||||
countNum.value = 1;
|
|
||||||
onSubmit();
|
|
||||||
} else {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** ฟังชั่น บันทึก */
|
/** ฟังชั่น บันทึก */
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
if (mainStore.rowsAdd) {
|
if (mainStore.rowsAdd) {
|
||||||
formData.persons = await mainStore.rowsAdd;
|
formData.persons = await mainStore.rowsAdd;
|
||||||
}
|
}
|
||||||
|
console.log("formData===>", formData);
|
||||||
|
|
||||||
await props.onSubmit(formData);
|
await props.onSubmit(formData);
|
||||||
isSave.value = false;
|
isSave.value = false;
|
||||||
});
|
});
|
||||||
|
|
@ -224,7 +187,17 @@ watch(props.data, async () => {
|
||||||
formData.id = props.data.id;
|
formData.id = props.data.id;
|
||||||
formData.respondentType = props.data.respondentType;
|
formData.respondentType = props.data.respondentType;
|
||||||
formData.organizationId = props.data.organizationId;
|
formData.organizationId = props.data.organizationId;
|
||||||
|
formData.organization = props.data.organization;
|
||||||
|
organization.value = {
|
||||||
|
id: props.data.organizationId,
|
||||||
|
name: props.data.organization,
|
||||||
|
};
|
||||||
formData.consideredAgency = props.data.consideredAgency;
|
formData.consideredAgency = props.data.consideredAgency;
|
||||||
|
formData.consideredAgencyId = props.data.consideredAgencyId;
|
||||||
|
consideredAgency.value = {
|
||||||
|
id: props.data.consideredAgencyId,
|
||||||
|
name: props.data.consideredAgency,
|
||||||
|
};
|
||||||
formData.title = props.data.title;
|
formData.title = props.data.title;
|
||||||
formData.description = props.data.description;
|
formData.description = props.data.description;
|
||||||
formData.dateReceived = props.data.dateReceived;
|
formData.dateReceived = props.data.dateReceived;
|
||||||
|
|
@ -237,6 +210,7 @@ watch(props.data, async () => {
|
||||||
formData.status = props.data.status;
|
formData.status = props.data.status;
|
||||||
formData.result = props.data.result;
|
formData.result = props.data.result;
|
||||||
formData.persons = mainStore.rowsAdd;
|
formData.persons = mainStore.rowsAdd;
|
||||||
|
formData.activeId = props.data.activeId ? props.data.activeId : null;
|
||||||
} else if (countNum.value === 2) {
|
} else if (countNum.value === 2) {
|
||||||
fileList.value = props.data.disciplineComplaintDocs;
|
fileList.value = props.data.disciplineComplaintDocs;
|
||||||
}
|
}
|
||||||
|
|
@ -285,12 +259,52 @@ async function addPerson(data: any) {
|
||||||
await mainStore.fetchData(data);
|
await mainStore.fetchData(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ดึงข้อมูล active */
|
||||||
|
async function getActive() {
|
||||||
|
if (!formData.activeId) {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.activeOrganization)
|
||||||
|
.then(async (res) => {
|
||||||
|
const data = await res.data.result;
|
||||||
|
formData.activeId = data.activeId;
|
||||||
|
getOc(data.activeId);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
getOc(formData.activeId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** ดึงข้อมูลหน่วยงานจาก api */
|
/** ดึงข้อมูลหน่วยงานจาก api */
|
||||||
function getOc() {
|
async function getOc(activeId: string) {
|
||||||
http.get(config.API.typeOc()).then((res) => {
|
showLoader();
|
||||||
const data = res.data.result;
|
await http
|
||||||
complainstStore.ocListFn(data);
|
.get(config.API.orgByid(activeId))
|
||||||
});
|
.then(async (res) => {
|
||||||
|
const data = await res.data.result.map((item: any) => ({
|
||||||
|
organizationId: item.orgTreeId,
|
||||||
|
organizationName: item.orgName,
|
||||||
|
}));
|
||||||
|
complainstStore.ocListFn(data);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
|
||||||
|
// http.get(config.API.typeOc()).then((res) => {
|
||||||
|
// const data = res.data.result;
|
||||||
|
// complainstStore.ocListFn(data);
|
||||||
|
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -317,6 +331,14 @@ function getListChannel() {
|
||||||
/** ฟังก์ชั่นเช็คการแก้ไขฟอร์มแล้วไม่ได้กดบันทึก */
|
/** ฟังก์ชั่นเช็คการแก้ไขฟอร์มแล้วไม่ได้กดบันทึก */
|
||||||
function changeFormData() {
|
function changeFormData() {
|
||||||
isSave.value = props.data != null ?? true;
|
isSave.value = props.data != null ?? true;
|
||||||
|
if (organization.value) {
|
||||||
|
formData.organizationId = organization.value.id;
|
||||||
|
formData.organization = organization.value.name;
|
||||||
|
}
|
||||||
|
if (consideredAgency.value) {
|
||||||
|
formData.consideredAgencyId = consideredAgency.value.id;
|
||||||
|
formData.consideredAgency = consideredAgency.value.name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** เปลี่ยนสี เมื่อ readonly
|
/** เปลี่ยนสี เมื่อ readonly
|
||||||
|
|
@ -350,7 +372,8 @@ function updatemodalPersonal(modal: boolean) {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
mainStore.rowsAdd = [];
|
mainStore.rowsAdd = [];
|
||||||
getListChannel();
|
getListChannel();
|
||||||
getOc();
|
|
||||||
|
getActive();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -369,7 +392,12 @@ onMounted(() => {
|
||||||
<q-separator />
|
<q-separator />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form @submit.prevent="validateForm" class="col-12 row">
|
<q-form
|
||||||
|
greedy
|
||||||
|
@submit.prevent
|
||||||
|
@validation-success="onSubmit"
|
||||||
|
class="col-12 row"
|
||||||
|
>
|
||||||
<div class="col-12 row">
|
<div class="col-12 row">
|
||||||
<div class="col-sm-12 col-md-9 row no-wrap">
|
<div class="col-sm-12 col-md-9 row no-wrap">
|
||||||
<div class="col-12 row q-pl-md q-py-md">
|
<div class="col-12 row q-pl-md q-py-md">
|
||||||
|
|
@ -423,12 +451,13 @@ onMounted(() => {
|
||||||
outlined
|
outlined
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
emit-value
|
|
||||||
map-options
|
map-options
|
||||||
v-model="formData.organizationId"
|
v-model="organization"
|
||||||
:options="complainstStore.organizationIdOp"
|
:options="complainstStore.organizationIdOp"
|
||||||
label="เลือกสำนักงาน"
|
label="หน่วยงานที่ถูกร้องเรียน"
|
||||||
:rules="[(val) => !!val || `${'กรุณาเลือกสำนักงาน'}`]"
|
:rules="[
|
||||||
|
(val) => !!val || `${'กรุณาเลือกหน่วยงานที่ถูกร้องเรียน'}`,
|
||||||
|
]"
|
||||||
@update:model-value="changeFormData()"
|
@update:model-value="changeFormData()"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -440,14 +469,13 @@ onMounted(() => {
|
||||||
for="selectAgency"
|
for="selectAgency"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
v-model="formData.consideredAgency"
|
v-model="consideredAgency"
|
||||||
:options="complainstStore.consideredAgencytoptions"
|
:options="complainstStore.consideredAgencytoptions"
|
||||||
label="หน่วยงานที่พิจารณา"
|
label="หน่วยงานที่พิจารณา"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="name"
|
option-label="name"
|
||||||
:readonly="isReadonly"
|
:readonly="isReadonly"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
emit-value
|
|
||||||
map-options
|
map-options
|
||||||
:rules="[(val) => !!val || `${'กรุณาเลือกหน่วยงาน'}`]"
|
:rules="[(val) => !!val || `${'กรุณาเลือกหน่วยงาน'}`]"
|
||||||
use-input
|
use-input
|
||||||
|
|
@ -456,13 +484,6 @@ onMounted(() => {
|
||||||
)"
|
)"
|
||||||
@update:model-value="changeFormData()"
|
@update:model-value="changeFormData()"
|
||||||
>
|
>
|
||||||
<template v-slot:no-option>
|
|
||||||
<q-item>
|
|
||||||
<q-item-section class="text-grey">
|
|
||||||
ไม่มีข้อมูล
|
|
||||||
</q-item-section>
|
|
||||||
</q-item>
|
|
||||||
</template>
|
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -1010,7 +1031,7 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</q-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Popup ผู้ถูกร้องเรียน -->
|
<!-- Popup ผู้ถูกร้องเรียน -->
|
||||||
|
|
|
||||||
|
|
@ -185,50 +185,7 @@ async function onSubmit(data: any) {
|
||||||
// put
|
// put
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.put(config.API.investigateById(id.value), {
|
.put(config.API.investigateById(id.value), data)
|
||||||
id: data.id,
|
|
||||||
idComplaint: data.idComplaint,
|
|
||||||
complaint: data.complaint,
|
|
||||||
complaintdetail: data.complaintdetail,
|
|
||||||
investigationDescription: data.investigationDescription,
|
|
||||||
fault: data.fault,
|
|
||||||
investigationDetailOther: data.investigationDetailOther,
|
|
||||||
evidenceFiles: data.evidenceFiles,
|
|
||||||
fileComplaint: data.fileComplaint,
|
|
||||||
investigationExtendStatus: data.investigationExtendStatus,
|
|
||||||
investigationDateStart: data.investigationDateStart,
|
|
||||||
investigationDateEnd: data.investigationDateEnd,
|
|
||||||
investigationDetail: data.investigationDetail,
|
|
||||||
investigationDaysExtend: data.investigationDaysExtend,
|
|
||||||
investigationStatusResult: data.investigationStatusResult,
|
|
||||||
investigationCauseText: data.investigationCauseText,
|
|
||||||
complaintStatus: data.complaintStatus,
|
|
||||||
result: data.result,
|
|
||||||
directors: data.directors,
|
|
||||||
disciplineInvestigateDocs: data.disciplineInvestigateDocs,
|
|
||||||
disciplineInvestigateRelevantDocs: data.disciplineInvestigateRelevantDocs,
|
|
||||||
status: data.status,
|
|
||||||
documentFile: data.documentFile,
|
|
||||||
respondentType: data.respondentType,
|
|
||||||
organizationId: data.organizationId,
|
|
||||||
persons: data.persons.map((item: any) => ({
|
|
||||||
personId: item.personId,
|
|
||||||
idcard: item.idcard,
|
|
||||||
prefix: item.prefix,
|
|
||||||
firstName: item.firstName,
|
|
||||||
lastName: item.lastName,
|
|
||||||
name: item.name,
|
|
||||||
posNo: item.posNo === "-" ? null : item.posNo,
|
|
||||||
position: item.position,
|
|
||||||
positionLevel: item.positionLevel,
|
|
||||||
salary: item.salary === "-" ? null : item.salary,
|
|
||||||
organization: item.organization,
|
|
||||||
phone: item.phone === "-" ? null : item.phone,
|
|
||||||
email: item.email,
|
|
||||||
})),
|
|
||||||
investigationExtendHistory: data.investigationExtendHistory,
|
|
||||||
isDisciplinary: data.isDisciplinary,
|
|
||||||
})
|
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
getData();
|
getData();
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,7 @@ import CalandarDialog from "@/modules/11_discipline/components/2_InvestigateFact
|
||||||
import DialogDuty from "@/modules/11_discipline/components/DialogDuty.vue";
|
import DialogDuty from "@/modules/11_discipline/components/DialogDuty.vue";
|
||||||
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
|
||||||
|
|
||||||
import type {
|
import type { FormData } from "@/modules/11_discipline/interface/request/investigateFact";
|
||||||
FormData,
|
|
||||||
MyObjectInvestigateRef,
|
|
||||||
} from "@/modules/11_discipline/interface/request/investigateFact";
|
|
||||||
|
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -68,21 +65,6 @@ const maxPage = ref<number>(1);
|
||||||
const page = ref<number>(1);
|
const page = ref<number>(1);
|
||||||
const rowsPerPage = ref<number>(10);
|
const rowsPerPage = ref<number>(10);
|
||||||
|
|
||||||
/** ตัวแปร ref สำหรับแสดง validate */
|
|
||||||
const complaintRef = ref<Object | null>(null);
|
|
||||||
const complaintdetailRef = ref<Object | null>(null);
|
|
||||||
const investigationDescriptionRef = ref<Object | null>(null);
|
|
||||||
const faultRef = ref<Object | null>(null);
|
|
||||||
const investigationDetailOtherRef = ref<Object | null>(null);
|
|
||||||
const fileComplaintRef = ref<Object | null>(null);
|
|
||||||
const extendStatusRef = ref<Object | null>(null);
|
|
||||||
const dateRef = ref<Object | null>(null);
|
|
||||||
const dateEndRef = ref<Object | null>(null);
|
|
||||||
const investigationDetailRef = ref<Object | null>(null);
|
|
||||||
const daysExtendRef = ref<Object | null>(null);
|
|
||||||
const investigationStatusResultRef = ref<Object | null>(null);
|
|
||||||
const investigationCauseTextRef = ref<Object | null>(null);
|
|
||||||
const resultRef = ref<Object | null>(null);
|
|
||||||
const investigationExtendStatus = ref<boolean>(false);
|
const investigationExtendStatus = ref<boolean>(false);
|
||||||
|
|
||||||
const isSave = ref<boolean>(false); // มีการแก้ไขรอบันทึก
|
const isSave = ref<boolean>(false); // มีการแก้ไขรอบันทึก
|
||||||
|
|
@ -161,18 +143,13 @@ const initialPagination = ref<any>({
|
||||||
const calendarModal = ref<boolean>(false);
|
const calendarModal = ref<boolean>(false);
|
||||||
const calendarModalclose = () => (calendarModal.value = !calendarModal.value);
|
const calendarModalclose = () => (calendarModal.value = !calendarModal.value);
|
||||||
|
|
||||||
/*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */
|
|
||||||
function validateForm() {
|
|
||||||
countNum.value = 1;
|
|
||||||
onSubmit();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ฟังก์ชั่นสำหรับบันทึกข้อมูล ระบบจะแสดง dialog ให้ยืนยันการบันทึก
|
* ฟังก์ชั่นสำหรับบันทึกข้อมูล ระบบจะแสดง dialog ให้ยืนยันการบันทึก
|
||||||
* หากยืนยันจะส่งข้อมูลไปบันทึกที่ api
|
* หากยืนยันจะส่งข้อมูลไปบันทึกที่ api
|
||||||
* หากยกเลิกจะกลับไปหน้าฟอร์ม
|
* หากยกเลิกจะกลับไปหน้าฟอร์ม
|
||||||
*/
|
*/
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
|
countNum.value = 1;
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
if (
|
if (
|
||||||
formData.investigationDateStart !== null &&
|
formData.investigationDateStart !== null &&
|
||||||
|
|
@ -269,13 +246,33 @@ watch(props.data, async () => {
|
||||||
lastName: person.lastName,
|
lastName: person.lastName,
|
||||||
position: person.position,
|
position: person.position,
|
||||||
positionLevel: person.positionLevel,
|
positionLevel: person.positionLevel,
|
||||||
salary: person.salary === null ? "-" : person.salary,
|
salary: person.salary === null ? "" : person.salary,
|
||||||
personId: person.personId,
|
personId: person.personId,
|
||||||
posNo: person.posNo === null ? "-" : person.posNo,
|
posNo: person.posNo === null ? "-" : person.posNo,
|
||||||
organization: person.organization,
|
organization: person.organization,
|
||||||
isSend: person.isSend,
|
isSend: person.isSend,
|
||||||
isDisciplinary: person.isDisciplinary,
|
isDisciplinary: person.isDisciplinary,
|
||||||
isAncestorDNA: person.isAncestorDNA,
|
isAncestorDNA: person.isAncestorDNA,
|
||||||
|
root: person.root,
|
||||||
|
rootId: person.rootId,
|
||||||
|
rootShortName: person.rootShortName,
|
||||||
|
child1: person.child1,
|
||||||
|
child1Id: person.child1Id,
|
||||||
|
child1ShortName: person.child1ShortName,
|
||||||
|
child2: person.child2,
|
||||||
|
child2Id: person.child2Id,
|
||||||
|
child2ShortName: person.child2ShortName,
|
||||||
|
child3: person.child3,
|
||||||
|
child3Id: person.child3Id,
|
||||||
|
child3ShortName: person.child3ShortName,
|
||||||
|
child4: person.child4,
|
||||||
|
child4Id: person.child4Id,
|
||||||
|
child4ShortName: person.child4ShortName,
|
||||||
|
posMasterNo: person.posMasterNo,
|
||||||
|
posTypeId: person.posTypeId,
|
||||||
|
posTypeName: person.posTypeName,
|
||||||
|
posLevelId: person.posLevelId,
|
||||||
|
posLevelName: person.posLevelName,
|
||||||
}));
|
}));
|
||||||
mainStore.rowsCheck = mainStore.rowsAdd.filter(
|
mainStore.rowsCheck = mainStore.rowsAdd.filter(
|
||||||
(item: any) => item.isDisciplinary === false && item.isSend === "NEW"
|
(item: any) => item.isDisciplinary === false && item.isSend === "NEW"
|
||||||
|
|
@ -657,7 +654,12 @@ onMounted(async () => {
|
||||||
</q-banner>
|
</q-banner>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
</div>
|
</div>
|
||||||
<form @submit.prevent="validateForm" class="col-12 row">
|
<q-form
|
||||||
|
greedy
|
||||||
|
@submit.prevent
|
||||||
|
@validation-success="onSubmit"
|
||||||
|
class="col-12 row"
|
||||||
|
>
|
||||||
<div class="col-12 row">
|
<div class="col-12 row">
|
||||||
<div class="col-xs-12 col-sm-12 col-md-9 row no-wrap">
|
<div class="col-xs-12 col-sm-12 col-md-9 row no-wrap">
|
||||||
<div class="col-12 row q-pl-md q-py-md">
|
<div class="col-12 row q-pl-md q-py-md">
|
||||||
|
|
@ -1595,7 +1597,7 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</q-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- อัพโหลดไฟล์ -->
|
<!-- อัพโหลดไฟล์ -->
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ const dataInvestigatefacts = reactive<FormInvestigateFact>({
|
||||||
persons: [],
|
persons: [],
|
||||||
investigationExtendHistory: [],
|
investigationExtendHistory: [],
|
||||||
isDisciplinary: false,
|
isDisciplinary: false,
|
||||||
isAncestorDNA:false
|
isAncestorDNA: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** function fetchData สอบสวนความผิดทางวินัย*/
|
/** function fetchData สอบสวนความผิดทางวินัย*/
|
||||||
|
|
@ -223,47 +223,7 @@ async function fetchDetailComplaints() {
|
||||||
async function onSubmitDisciplinary(data: any) {
|
async function onSubmitDisciplinary(data: any) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.put(config.API.disciplineDisciplinaryById(id.value), {
|
.put(config.API.disciplineDisciplinaryById(id.value), data)
|
||||||
respondentType:data.respondentType ,
|
|
||||||
organizationId:data.organizationId ,
|
|
||||||
disciplinaryDateAllegation:data.disciplinaryDateAllegation ,
|
|
||||||
disciplinaryDateEvident:data.disciplinaryDateEvident ,
|
|
||||||
disciplinaryCaseFault:data.disciplinaryCaseFault ,
|
|
||||||
disciplinaryInvestigateAt:data.disciplinaryInvestigateAt ,
|
|
||||||
disciplinaryFaultLevel:data.disciplinaryFaultLevel ,
|
|
||||||
disciplinaryRefLaw:data.disciplinaryRefLaw ,
|
|
||||||
disciplinarySummaryEvidence:data.disciplinarySummaryEvidence ,
|
|
||||||
disciplinaryRecordAccuser:data.disciplinaryRecordAccuser ,
|
|
||||||
disciplinaryWitnesses:data.disciplinaryWitnesses ,
|
|
||||||
result:data.result ,
|
|
||||||
directors: data.directors,
|
|
||||||
persons: data.persons.map((item: any) => (
|
|
||||||
{
|
|
||||||
id:item.id ,
|
|
||||||
idcard:item.idcard ,
|
|
||||||
name:item.name ,
|
|
||||||
prefix:item.prefix ,
|
|
||||||
firstName:item.firstName ,
|
|
||||||
lastName:item.lastName ,
|
|
||||||
position:item.position === "-" ? null:item.position,
|
|
||||||
positionLevel:item.positionLevel === "-" ? null:item.positionLevel,
|
|
||||||
salary:item.salary === "-" ? null:item.salary,
|
|
||||||
personId:item.personId ,
|
|
||||||
posNo:item.posNo === "-" ? null:item.posNo,
|
|
||||||
organization:item.organization ,
|
|
||||||
})),
|
|
||||||
extendStatus:data.extendStatus ,
|
|
||||||
disciplinaryDateStart:data.disciplinaryDateStart ,
|
|
||||||
disciplinaryDateEnd:data.disciplinaryDateEnd ,
|
|
||||||
daysExtend:data.daysExtend ,
|
|
||||||
disciplinaryDateInvestigation:data.disciplinaryDateInvestigation ,
|
|
||||||
disciplinaryDateResult:data.disciplinaryDateResult ,
|
|
||||||
disciplinaryStatusResult:data.disciplinaryStatusResult ,
|
|
||||||
disciplinaryCauseText:data.disciplinaryCauseText ,
|
|
||||||
disciplinaryResult:data.disciplinaryResult ,
|
|
||||||
disciplinaryExtendHistory:data.disciplinaryExtendHistory ,
|
|
||||||
disciplinaryFaultLevelOther:data.disciplinaryFaultLevelOther ,
|
|
||||||
})
|
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await fetchDetailDisciplinary();
|
await fetchDetailDisciplinary();
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
|
|
||||||
|
|
@ -121,42 +121,6 @@ const disciplineDisciplinary_DocRecordAccusers = ref<FileLists[]>([]);
|
||||||
const disciplineDisciplinary_DocWitnessess = ref<FileLists[]>([]);
|
const disciplineDisciplinary_DocWitnessess = ref<FileLists[]>([]);
|
||||||
const disciplineDisciplinary_DocOthers = ref<FileLists[]>([]);
|
const disciplineDisciplinary_DocOthers = ref<FileLists[]>([]);
|
||||||
|
|
||||||
/** ตัวแปร ref สำหรับแสดง validate */
|
|
||||||
const respondentTypeRef = ref<Object | null>(null);
|
|
||||||
const organizationIdRef = ref<Object | null>(null);
|
|
||||||
const consideredAgencyRef = ref<Object | null>(null);
|
|
||||||
const disciplinaryDateAllegationRef = ref<Object | null>(null);
|
|
||||||
const disciplinaryDateEvidentRef = ref<Object | null>(null);
|
|
||||||
const disciplinaryCaseFaultRef = ref<Object | null>(null);
|
|
||||||
const disciplinaryInvestigateAtRef = ref<Object | null>(null);
|
|
||||||
const disciplinaryFaultLevelRef = ref<Object | null>(null);
|
|
||||||
const disciplinaryRefLawRef = ref<Object | null>(null);
|
|
||||||
const disciplinarySummaryEvidenceRef = ref<Object | null>(null);
|
|
||||||
const disciplinaryRecordAccuserRef = ref<Object | null>(null);
|
|
||||||
const disciplinaryWitnessesRef = ref<Object | null>(null);
|
|
||||||
const resultRef = ref<Object | null>(null);
|
|
||||||
const dateRef = ref<Object | null>(null);
|
|
||||||
const dateEndRef = ref<Object | null>(null);
|
|
||||||
const daysExtendRef = ref<Object | null>(null);
|
|
||||||
const disciplinaryDateResultRef = ref<Object | null>(null);
|
|
||||||
const disciplinaryStatusResultRef = ref<Object | null>(null);
|
|
||||||
const disciplinaryCauseTextRef = ref<Object | null>(null);
|
|
||||||
const disciplinaryResultRef = ref<Object | null>(null);
|
|
||||||
|
|
||||||
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
|
|
||||||
const objectdisciplinary: DisciplinaryRef = {
|
|
||||||
// respondentType: respondentTypeRef,
|
|
||||||
// organizationId: organizationIdRef,
|
|
||||||
// consideredAgency: consideredAgencyRef,
|
|
||||||
// disciplinaryFaultLevel: disciplinaryFaultLevelRef,
|
|
||||||
// date: dateRef,
|
|
||||||
// dateEnd: dateEndRef,
|
|
||||||
// daysExtend: daysExtendRef,
|
|
||||||
// disciplinaryDateResult: disciplinaryDateResultRef,
|
|
||||||
// disciplinaryStatusResult: disciplinaryStatusResultRef,
|
|
||||||
// disciplinaryResult: disciplinaryResultRef,
|
|
||||||
};
|
|
||||||
|
|
||||||
const initialPagination = ref<any>({
|
const initialPagination = ref<any>({
|
||||||
rowsPerPage: 0,
|
rowsPerPage: 0,
|
||||||
});
|
});
|
||||||
|
|
@ -206,24 +170,6 @@ function toggleModal() {
|
||||||
modalPerson.value = !modalPerson.value;
|
modalPerson.value = !modalPerson.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ฟังชั่นตรวจสอบความถูกต้องก่อน บันทึก */
|
|
||||||
function validateForm() {
|
|
||||||
const hasError = [];
|
|
||||||
for (const key in objectdisciplinary) {
|
|
||||||
if (Object.prototype.hasOwnProperty.call(objectdisciplinary, key)) {
|
|
||||||
const property = objectdisciplinary[key];
|
|
||||||
if (property.value && typeof property.value.validate === "function") {
|
|
||||||
const isValid = property.value.validate();
|
|
||||||
hasError.push(isValid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (hasError.every((result) => result === true)) {
|
|
||||||
countNum.value = 1;
|
|
||||||
onSubmit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ฟังชั้นคำนวณเวลาวันที่สิ้นสุดจาก วันที่สิ้นสุดการสอบสวน
|
* ฟังชั้นคำนวณเวลาวันที่สิ้นสุดจาก วันที่สิ้นสุดการสอบสวน
|
||||||
* @param val จำนวนวันที่ต้องการขยาย
|
* @param val จำนวนวันที่ต้องการขยาย
|
||||||
|
|
@ -338,6 +284,26 @@ async function fetchDatadetail() {
|
||||||
isSuspend: person.isSuspend,
|
isSuspend: person.isSuspend,
|
||||||
status: person.status,
|
status: person.status,
|
||||||
statusDiscard: person.statusDiscard,
|
statusDiscard: person.statusDiscard,
|
||||||
|
root: person.root,
|
||||||
|
rootId: person.rootId,
|
||||||
|
rootShortName: person.rootShortName,
|
||||||
|
child1: person.child1,
|
||||||
|
child1Id: person.child1Id,
|
||||||
|
child1ShortName: person.child1ShortName,
|
||||||
|
child2: person.child2,
|
||||||
|
child2Id: person.child2Id,
|
||||||
|
child2ShortName: person.child2ShortName,
|
||||||
|
child3: person.child3,
|
||||||
|
child3Id: person.child3Id,
|
||||||
|
child3ShortName: person.child3ShortName,
|
||||||
|
child4: person.child4,
|
||||||
|
child4Id: person.child4Id,
|
||||||
|
child4ShortName: person.child4ShortName,
|
||||||
|
posMasterNo: person.posMasterNo,
|
||||||
|
posTypeId: person.posTypeId,
|
||||||
|
posTypeName: person.posTypeName,
|
||||||
|
posLevelId: person.posLevelId,
|
||||||
|
posLevelName: person.posLevelName,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
formData.disciplinaryStatusResult = props.data.disciplinaryStatusResult
|
formData.disciplinaryStatusResult = props.data.disciplinaryStatusResult
|
||||||
|
|
@ -357,7 +323,7 @@ async function fetchDatadetail() {
|
||||||
position: person.position === null ? "-" : person.position,
|
position: person.position === null ? "-" : person.position,
|
||||||
positionLevel:
|
positionLevel:
|
||||||
person.positionLevel === null ? "-" : person.positionLevel,
|
person.positionLevel === null ? "-" : person.positionLevel,
|
||||||
salary: person.salary === null ? "-" : person.salary,
|
salary: person.salary === null ? "" : person.salary,
|
||||||
personId: person.personId,
|
personId: person.personId,
|
||||||
posNo: person.posNo === null ? "-" : person.posNo,
|
posNo: person.posNo === null ? "-" : person.posNo,
|
||||||
organization: person.organization,
|
organization: person.organization,
|
||||||
|
|
@ -691,7 +657,12 @@ onMounted(async () => {
|
||||||
</q-banner>
|
</q-banner>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form @submit.prevent="validateForm" class="col-12 row">
|
<q-form
|
||||||
|
greedy
|
||||||
|
@submit.prevent
|
||||||
|
@validation-success="onSubmit"
|
||||||
|
class="col-12 row"
|
||||||
|
>
|
||||||
<div class="row col-12">
|
<div class="row col-12">
|
||||||
<div class="col-xs-12 col-sm-12 col-md-9 row no-wrap">
|
<div class="col-xs-12 col-sm-12 col-md-9 row no-wrap">
|
||||||
<div class="col-12 row q-pl-md q-py-md">
|
<div class="col-12 row q-pl-md q-py-md">
|
||||||
|
|
@ -1822,7 +1793,7 @@ onMounted(async () => {
|
||||||
><q-tooltip>บับทึกข้อมูล</q-tooltip></q-btn
|
><q-tooltip>บับทึกข้อมูล</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</q-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<DialogDuty
|
<DialogDuty
|
||||||
|
|
|
||||||
|
|
@ -397,7 +397,11 @@ function updatemodalPersonal(modal: boolean) {
|
||||||
{{ props.row.organization }}
|
{{ props.row.organization }}
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="col.name === 'salary'">
|
<div v-else-if="col.name === 'salary'">
|
||||||
{{ props.row.salary.toLocaleString() }}
|
{{
|
||||||
|
props.row.salary
|
||||||
|
? props.row.salary.toLocaleString()
|
||||||
|
: ""
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
{{ col.value }}
|
{{ col.value }}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import { onMounted, ref, reactive } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import CurrencyInput from "@/components/CurruncyInput.vue";
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import keycloak from "@/plugins/keycloak";
|
import keycloak from "@/plugins/keycloak";
|
||||||
|
|
@ -55,6 +54,7 @@ const data = reactive<dataDetail>({
|
||||||
organization: "",
|
organization: "",
|
||||||
position: "",
|
position: "",
|
||||||
posNo: "",
|
posNo: "",
|
||||||
|
posTypeName: "",
|
||||||
positionLevel: "",
|
positionLevel: "",
|
||||||
salary: 0,
|
salary: 0,
|
||||||
status: "",
|
status: "",
|
||||||
|
|
@ -65,6 +65,22 @@ const data = reactive<dataDetail>({
|
||||||
offenseDetails: "",
|
offenseDetails: "",
|
||||||
disciplinaryFaultLevel: "",
|
disciplinaryFaultLevel: "",
|
||||||
disciplinaryCaseFault: "",
|
disciplinaryCaseFault: "",
|
||||||
|
child1: "",
|
||||||
|
child1Id: null,
|
||||||
|
child1ShortName: "",
|
||||||
|
child2: "",
|
||||||
|
child2Id: null,
|
||||||
|
child2ShortName: "",
|
||||||
|
child3: "",
|
||||||
|
child3Id: null,
|
||||||
|
child3ShortName: "",
|
||||||
|
child4: "",
|
||||||
|
child4Id: null,
|
||||||
|
child4ShortName: "",
|
||||||
|
root: "",
|
||||||
|
rootId: null,
|
||||||
|
rootShortName: "",
|
||||||
|
positionType: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
/**นำข้อมูลจาก API มาแสดง */
|
/**นำข้อมูลจาก API มาแสดง */
|
||||||
|
|
@ -87,6 +103,7 @@ async function getData() {
|
||||||
data.position = dataGet.position;
|
data.position = dataGet.position;
|
||||||
data.posNo = dataGet.posNo;
|
data.posNo = dataGet.posNo;
|
||||||
data.positionLevel = dataGet.positionLevel;
|
data.positionLevel = dataGet.positionLevel;
|
||||||
|
data.positionType = dataGet.positionType;
|
||||||
data.salary = dataGet.salary;
|
data.salary = dataGet.salary;
|
||||||
data.status = dataGet.status;
|
data.status = dataGet.status;
|
||||||
data.descriptionSuspend = dataGet.descriptionSuspend
|
data.descriptionSuspend = dataGet.descriptionSuspend
|
||||||
|
|
@ -98,7 +115,22 @@ async function getData() {
|
||||||
data.offenseDetails = dataGet.offenseDetails;
|
data.offenseDetails = dataGet.offenseDetails;
|
||||||
data.disciplinaryFaultLevel = dataGet.disciplinaryFaultLevel;
|
data.disciplinaryFaultLevel = dataGet.disciplinaryFaultLevel;
|
||||||
data.disciplinaryCaseFault = dataGet.disciplinaryCaseFault;
|
data.disciplinaryCaseFault = dataGet.disciplinaryCaseFault;
|
||||||
getAvatar(dataGet.personId);
|
data.child1 = dataGet.child1;
|
||||||
|
data.child1Id = dataGet.child1Id;
|
||||||
|
data.child1ShortName = dataGet.child1ShortName;
|
||||||
|
data.child2 = dataGet.child2;
|
||||||
|
data.child2Id = dataGet.child2Id;
|
||||||
|
data.child2ShortName = dataGet.child2ShortName;
|
||||||
|
data.child3 = dataGet.child3;
|
||||||
|
data.child3Id = dataGet.child3Id;
|
||||||
|
data.child3ShortName = dataGet.child3ShortName;
|
||||||
|
data.child4 = dataGet.child4;
|
||||||
|
data.child4Id = dataGet.child4Id;
|
||||||
|
data.child4ShortName = dataGet.child4ShortName;
|
||||||
|
data.root = dataGet.root;
|
||||||
|
data.rootId = dataGet.rootId;
|
||||||
|
data.rootShortName = dataGet.rootShortName;
|
||||||
|
// getAvatar(dataGet.personId);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -136,24 +168,24 @@ async function clickCancel() {
|
||||||
/**
|
/**
|
||||||
* ฟังก์ชั่น Save
|
* ฟังก์ชั่น Save
|
||||||
*/
|
*/
|
||||||
async function conditionSave() {
|
// async function conditionSave() {
|
||||||
if (myForm.value !== null) {
|
// if (myForm.value !== null) {
|
||||||
myForm.value.validate().then((success) => {
|
// myForm.value.validate().then((success) => {
|
||||||
if (success) {
|
// if (success) {
|
||||||
dialogMessage(
|
// dialogMessage(
|
||||||
$q,
|
// $q,
|
||||||
"ต้องการแก้ไขข้อมูลหรือไม่?",
|
// "ต้องการแก้ไขข้อมูลหรือไม่?",
|
||||||
"แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย",
|
// "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย",
|
||||||
"mdi-help-circle-outline",
|
// "mdi-help-circle-outline",
|
||||||
"ตกลง",
|
// "ตกลง",
|
||||||
"public",
|
// "public",
|
||||||
async () => await saveData(),
|
// async () => await saveData(),
|
||||||
undefined
|
// undefined
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ฟังก์ชั่น Saveจาก API
|
* ฟังก์ชั่น Saveจาก API
|
||||||
|
|
@ -161,7 +193,7 @@ async function conditionSave() {
|
||||||
async function saveData() {
|
async function saveData() {
|
||||||
const body = {
|
const body = {
|
||||||
organization: data.organization,
|
organization: data.organization,
|
||||||
position: data.position,
|
positionType: data.positionType,
|
||||||
posNo: data.posNo,
|
posNo: data.posNo,
|
||||||
positionLevel: data.positionLevel,
|
positionLevel: data.positionLevel,
|
||||||
salary: data.salary,
|
salary: data.salary,
|
||||||
|
|
@ -295,48 +327,49 @@ onMounted(async () => {
|
||||||
<CardProfile :data="dataProfile as DataProfile" />
|
<CardProfile :data="dataProfile as DataProfile" />
|
||||||
|
|
||||||
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
<q-card bordered class="row col-12 text-dark q-mt-sm">
|
||||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
<q-form greedy @submit.prevent @validation-success="saveData">
|
||||||
<div class="q-pl-sm text-weight-bold text-dark">
|
<div class="bg-grey-1 q-pa-sm col-12 row items-center text-primary">
|
||||||
แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย
|
<div class="q-pl-sm text-weight-bold text-dark">
|
||||||
</div>
|
แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย
|
||||||
<q-space />
|
|
||||||
<div v-if="data.status !== 'DONE' && data.status !== 'REPORT'">
|
|
||||||
<div class="q-gutter-sm" v-if="!edit">
|
|
||||||
<q-btn
|
|
||||||
outline
|
|
||||||
color="primary"
|
|
||||||
dense
|
|
||||||
icon-right="mdi-file-edit-outline"
|
|
||||||
class="q-px-sm"
|
|
||||||
label="แก้ไข"
|
|
||||||
style="width: 80px"
|
|
||||||
@click="edit = !edit"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="q-gutter-sm" v-else>
|
<q-space />
|
||||||
<q-btn
|
<div v-if="data.status !== 'DONE' && data.status !== 'REPORT'">
|
||||||
outline
|
<div class="q-gutter-sm" v-if="!edit">
|
||||||
color="public"
|
<q-btn
|
||||||
dense
|
outline
|
||||||
class="q-px-sm"
|
color="primary"
|
||||||
label="บันทึก"
|
dense
|
||||||
style="width: 80px"
|
icon-right="mdi-file-edit-outline"
|
||||||
@click="conditionSave"
|
class="q-px-sm"
|
||||||
/>
|
label="แก้ไข"
|
||||||
<q-btn
|
style="width: 80px"
|
||||||
outline
|
@click="edit = !edit"
|
||||||
color="red"
|
/>
|
||||||
dense
|
</div>
|
||||||
class="q-px-sm"
|
<div class="q-gutter-sm" v-else>
|
||||||
label="ยกเลิก"
|
<q-btn
|
||||||
style="width: 80px"
|
outline
|
||||||
@click="clickCancel"
|
color="public"
|
||||||
/>
|
dense
|
||||||
|
class="q-px-sm"
|
||||||
|
label="บันทึก"
|
||||||
|
style="width: 80px"
|
||||||
|
type="submit"
|
||||||
|
/>
|
||||||
|
<q-btn
|
||||||
|
outline
|
||||||
|
color="red"
|
||||||
|
dense
|
||||||
|
class="q-px-sm"
|
||||||
|
label="ยกเลิก"
|
||||||
|
style="width: 80px"
|
||||||
|
@click="clickCancel"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col-12"><q-separator /></div>
|
||||||
<div class="col-12"><q-separator /></div>
|
|
||||||
<q-form ref="myForm">
|
|
||||||
<div class="row col-12 q-pa-md">
|
<div class="row col-12 q-pa-md">
|
||||||
<div class="col-12 row bg-white q-col-gutter-md">
|
<div class="col-12 row bg-white q-col-gutter-md">
|
||||||
<div class="col-xs-6 col-sm-3 row">
|
<div class="col-xs-6 col-sm-3 row">
|
||||||
|
|
@ -348,7 +381,7 @@ onMounted(async () => {
|
||||||
lazy-rules
|
lazy-rules
|
||||||
:readonly="!edit"
|
:readonly="!edit"
|
||||||
:borderless="!edit"
|
:borderless="!edit"
|
||||||
v-model="data.position"
|
v-model="data.positionType"
|
||||||
:rules="[(val) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
|
:rules="[(val) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:label="`${'ประเภทตำแหน่ง'}`"
|
:label="`${'ประเภทตำแหน่ง'}`"
|
||||||
|
|
@ -365,9 +398,9 @@ onMounted(async () => {
|
||||||
:readonly="!edit"
|
:readonly="!edit"
|
||||||
:borderless="!edit"
|
:borderless="!edit"
|
||||||
v-model="data.positionLevel"
|
v-model="data.positionLevel"
|
||||||
:rules="[(val) => !!val || `${'กรุณากรอกระดับ'}`]"
|
:rules="[(val) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:label="`${'ระดับ'}`"
|
:label="`${'ระดับตำแหน่ง'}`"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -389,13 +422,19 @@ onMounted(async () => {
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-3 row">
|
<div class="col-xs-6 col-sm-3 row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<CurrencyInput
|
<q-input
|
||||||
v-model="data.salary"
|
v-model="data.salary"
|
||||||
:edit="edit"
|
:outlined="edit"
|
||||||
:options="{
|
dense
|
||||||
currency: 'THB',
|
:readonly="!edit"
|
||||||
}"
|
hide-bottom-space
|
||||||
|
:borderless="!edit"
|
||||||
:label="`${'เงินเดือน'}`"
|
:label="`${'เงินเดือน'}`"
|
||||||
|
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||||
|
lazy-rules
|
||||||
|
mask="###,###,###,###"
|
||||||
|
reverse-fill-mask
|
||||||
|
class="inputgreen"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,68 +1,71 @@
|
||||||
interface FormData {
|
interface FormData {
|
||||||
id:string
|
id: string;
|
||||||
respondentType: string
|
respondentType: string;
|
||||||
consideredAgency: string
|
consideredAgency: string;
|
||||||
title: string
|
title: string;
|
||||||
description: string
|
description: string;
|
||||||
dateReceived: Date | null
|
dateReceived: Date | null;
|
||||||
dateConsideration: Date | null
|
dateConsideration: Date | null;
|
||||||
offenseDetails: string
|
offenseDetails: string;
|
||||||
levelConsideration: string
|
levelConsideration: string;
|
||||||
dateNotification: Date | null
|
dateNotification: Date | null;
|
||||||
complaintFrom: string
|
complaintFrom: string;
|
||||||
appellant: string
|
appellant: string;
|
||||||
documentFile: any | null
|
documentFile: any | null;
|
||||||
status: string
|
status: string;
|
||||||
result: string
|
result: string;
|
||||||
persons: object|null
|
persons: object | null;
|
||||||
organizationId:string|null
|
organizationId: string | null;
|
||||||
disciplineComplaintDocs:object|null
|
disciplineComplaintDocs: object | null;
|
||||||
|
activeId?: string | null;
|
||||||
|
organization?: string;
|
||||||
|
consideredAgencyId?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ArrayPerson {
|
interface ArrayPerson {
|
||||||
id: string
|
id: string;
|
||||||
personId:string
|
personId: string;
|
||||||
idcard:string
|
idcard: string;
|
||||||
name:string
|
name: string;
|
||||||
prefix:string
|
prefix: string;
|
||||||
firstName:string
|
firstName: string;
|
||||||
lastName:string
|
lastName: string;
|
||||||
posNo:string
|
posNo: string;
|
||||||
position:string
|
position: string;
|
||||||
positionLevel:string
|
positionLevel: string;
|
||||||
salary:number|null
|
salary: number | null;
|
||||||
organization:string
|
organization: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ArrayFileList {
|
interface ArrayFileList {
|
||||||
id:string
|
id: string;
|
||||||
pathName:string
|
pathName: string;
|
||||||
fileName:string
|
fileName: string;
|
||||||
}
|
}
|
||||||
interface MyObjectComplaintsRef {
|
interface MyObjectComplaintsRef {
|
||||||
respondentType: object | null;
|
respondentType: object | null;
|
||||||
organizationId: object | null;
|
organizationId: object | null;
|
||||||
consideredAgency: object | null;
|
consideredAgency: object | null;
|
||||||
title: object | null;
|
title: object | null;
|
||||||
dateReceived: object | null;
|
dateReceived: object | null;
|
||||||
offenseDetails: object | null;
|
offenseDetails: object | null;
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DataAddRequest {
|
interface DataAddRequest {
|
||||||
id: string
|
id: string;
|
||||||
idcard: string
|
idcard: string;
|
||||||
name: string
|
name: string;
|
||||||
positionNo: string
|
positionNo: string;
|
||||||
position: string
|
position: string;
|
||||||
positionLevel: string
|
positionLevel: string;
|
||||||
salary: string
|
salary: string;
|
||||||
organization: string
|
organization: string;
|
||||||
}
|
}
|
||||||
export type {
|
export type {
|
||||||
FormData,
|
FormData,
|
||||||
MyObjectComplaintsRef,
|
MyObjectComplaintsRef,
|
||||||
DataAddRequest,
|
DataAddRequest,
|
||||||
ArrayPerson,
|
ArrayPerson,
|
||||||
ArrayFileList
|
ArrayFileList,
|
||||||
}
|
};
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,23 @@ interface dataDetail {
|
||||||
offenseDetails: string;
|
offenseDetails: string;
|
||||||
disciplinaryFaultLevel: string;
|
disciplinaryFaultLevel: string;
|
||||||
disciplinaryCaseFault: string;
|
disciplinaryCaseFault: string;
|
||||||
|
posTypeName: string;
|
||||||
|
child1: string;
|
||||||
|
child1Id: string | null;
|
||||||
|
child1ShortName: string;
|
||||||
|
child2: string;
|
||||||
|
child2Id: string | null;
|
||||||
|
child2ShortName: string;
|
||||||
|
child3: string;
|
||||||
|
child3Id: string | null;
|
||||||
|
child3ShortName: string;
|
||||||
|
child4: string;
|
||||||
|
child4Id: string | null;
|
||||||
|
child4ShortName: string;
|
||||||
|
root: string;
|
||||||
|
rootId: string | null;
|
||||||
|
rootShortName: string;
|
||||||
|
positionType?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DataOption {
|
interface DataOption {
|
||||||
|
|
|
||||||
|
|
@ -302,10 +302,30 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
|
||||||
lastName: item.lastName,
|
lastName: item.lastName,
|
||||||
position: item.position,
|
position: item.position,
|
||||||
positionLevel: item.positionLevel,
|
positionLevel: item.positionLevel,
|
||||||
salary: item.salary === null ? "-" : item.salary,
|
salary: item.salary === null ? "" : item.salary,
|
||||||
personId: item.personId,
|
personId: item.personId,
|
||||||
posNo: item.posNo === null ? "-" : item.posNo,
|
posNo: item.posNo === null ? "-" : item.posNo,
|
||||||
organization: item.organization,
|
organization: item.organization,
|
||||||
|
root: item.root,
|
||||||
|
rootId: item.rootId,
|
||||||
|
rootShortName: item.rootShortName,
|
||||||
|
child1: item.child1,
|
||||||
|
child1Id: item.child1Id,
|
||||||
|
child1ShortName: item.child1ShortName,
|
||||||
|
child2: item.child2,
|
||||||
|
child2Id: item.child2Id,
|
||||||
|
child2ShortName: item.child2ShortName,
|
||||||
|
child3: item.child3,
|
||||||
|
child3Id: item.child3Id,
|
||||||
|
child3ShortName: item.child3ShortName,
|
||||||
|
child4: item.child4,
|
||||||
|
child4Id: item.child4Id,
|
||||||
|
child4ShortName: item.child4ShortName,
|
||||||
|
posMasterNo: item.posMasterNo,
|
||||||
|
posTypeId: item.posTypeId,
|
||||||
|
posTypeName: item.posTypeName,
|
||||||
|
posLevelId: item.posLevelId,
|
||||||
|
posLevelName: item.posLevelName,
|
||||||
}));
|
}));
|
||||||
rowsAdd.value = dataList;
|
rowsAdd.value = dataList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
interface DataPersonReq {
|
interface DataPersonReq {
|
||||||
id: string;
|
id: string;
|
||||||
|
profileId?: string;
|
||||||
type: string;
|
type: string;
|
||||||
amount: number;
|
amount: number;
|
||||||
child1: string;
|
child1: string;
|
||||||
|
|
@ -29,5 +30,7 @@ interface DataPersonReq {
|
||||||
prefix: string;
|
prefix: string;
|
||||||
root: string;
|
root: string;
|
||||||
rootId: string;
|
rootId: string;
|
||||||
|
isSpecial?: boolean;
|
||||||
|
rank?: string | null;
|
||||||
}
|
}
|
||||||
export type { DataPersonReq };
|
export type { DataPersonReq };
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ interface DataAgency {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface DataPerson {
|
interface DataPerson {
|
||||||
|
id?: string;
|
||||||
amount: number;
|
amount: number;
|
||||||
child1: string;
|
child1: string;
|
||||||
child1Id: string;
|
child1Id: string;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue