ส่งเรื่องร้องเรียนไปยังขั้นตอนการสืบสวน

This commit is contained in:
setthawutttty 2023-11-24 10:47:44 +07:00
parent b876c951b0
commit d47140e0ec
5 changed files with 62 additions and 36 deletions

View file

@ -219,7 +219,7 @@ async function close() {
/** เปิด dialog ยืนยัน */ /** เปิด dialog ยืนยัน */
function savePost() { function savePost() {
if (selected.value.length != 0) { if (selected.value.length != 0) {
dialogConfirm($q, () => console.log(selected.value)); dialogConfirm($q, () => saveData());
} else { } else {
dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 รายการ"); dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 รายการ");
} }

View file

@ -69,7 +69,7 @@ const data = reactive<FormData>({
documentFile: null, documentFile: null,
status: "", status: "",
persons: [personOj], persons: [personOj],
reason: '', result: '',
disciplineComplaintDocs: [fileListOj], disciplineComplaintDocs: [fileListOj],
}); });
@ -155,7 +155,7 @@ async function getData() {
data.appellant = dataList.appellant; data.appellant = dataList.appellant;
data.status = dataList.status; data.status = dataList.status;
data.persons = dataList.persons; data.persons = dataList.persons;
data.reason = dataList.reason; data.result = dataList.result;
data.disciplineComplaintDocs = dataList.disciplineComplaintDocs; data.disciplineComplaintDocs = dataList.disciplineComplaintDocs;
console.log("list", data.id); console.log("list", data.id);
@ -261,10 +261,17 @@ function confirmCancelInvestigate() {
console.log("sent"); console.log("sent");
} }
function sentApprove() { function emitPerson(data:ArrayPerson[]){
showLoader(); console.log('person',data)
const dataMapId = data.map((item:ArrayPerson) =>
item.personId
)
console.log('id',dataMapId)
showLoader();
http http
.get(config.API.complaintApprove(id.value)) .put(config.API.complaintApprove(id.value),{
persons:dataMapId
})
.then((res) => { .then((res) => {
router.push(`/discipline/complaints`); router.push(`/discipline/complaints`);
}) })
@ -274,8 +281,22 @@ function sentApprove() {
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
}); });
console.log("sent");
} }
// function sentApprove() {
// // showLoader();
// // http
// // .put(config.API.complaintApprove(id.value))
// // .then((res) => {
// // router.push(`/discipline/complaints`);
// // })
// // .catch((e) => {
// // messageError($q, e);
// // })
// // .finally(() => {
// // hideLoader();
// // });
// console.log("sent");
// }
/** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */ /** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */
onMounted(() => { onMounted(() => {
console.log(data); console.log(data);
@ -325,6 +346,6 @@ onMounted(() => {
:data="data" :data="data"
:get-data="getData" :get-data="getData"
/> />
<Popup :modal="modalPopup" :close="closePopup" :sentApprove="sentApprove" /> <Popup :modal="modalPopup" :close="closePopup" @return-person="emitPerson"/>
</div> </div>
</template> </template>

View file

@ -53,7 +53,7 @@ const levelConsiderationRef = ref<Object | null>(null);
const dateNotificationRef = ref<Object | null>(null); const dateNotificationRef = ref<Object | null>(null);
const complaintFromRef = ref<Object | null>(null); const complaintFromRef = ref<Object | null>(null);
const appellantRef = ref<Object | null>(null); const appellantRef = ref<Object | null>(null);
const reasonRef = ref<Object | null>(null); const resultRef = ref<Object | null>(null);
const fileList = ref<ArrayFileList[]>([]); const fileList = ref<ArrayFileList[]>([]);
/** รับ props มาจากหน้าหลัก */ /** รับ props มาจากหน้าหลัก */
@ -96,7 +96,7 @@ const formData = reactive<FormData>({
appellant: "", appellant: "",
documentFile: null, documentFile: null,
status: "", status: "",
reason: '', result: '',
persons: [], persons: [],
disciplineComplaintDocs: fileList.value ?? null, disciplineComplaintDocs: fileList.value ?? null,
}); });
@ -116,7 +116,7 @@ const objectComplaintsRef: MyObjectComplaintsRef = {
dateNotification: dateNotificationRef, dateNotification: dateNotificationRef,
complaintFrom: complaintFromRef, complaintFrom: complaintFromRef,
appellant: appellantRef, appellant: appellantRef,
reason: reasonRef, result: resultRef,
}; };
/** options ทั้งหมด*/ /** options ทั้งหมด*/
@ -393,7 +393,7 @@ watch(props.data, async () => {
formData.complaintFrom = props.data.complaintFrom; formData.complaintFrom = props.data.complaintFrom;
formData.appellant = props.data.appellant; formData.appellant = props.data.appellant;
formData.status = props.data.status; formData.status = props.data.status;
formData.reason = props.data.reason; formData.result = props.data.result;
formData.persons = complainstStore.rowsAdd; formData.persons = complainstStore.rowsAdd;
}); });
@ -881,12 +881,12 @@ onMounted(() => {
</div> </div>
<div class="col-xs-12 col-sm-12"> <div class="col-xs-12 col-sm-12">
<q-input <q-input
for="reason" for="result"
ref="reasonRef" ref="resultRef"
dense dense
outlined outlined
hide-bottom-space hide-bottom-space
v-model="formData.reason" v-model="formData.result"
:rules="[ :rules="[
(val) => !!val || 'กรุณากรอกผลการตรวจสอบเรื่องร้องเรียน', (val) => !!val || 'กรุณากรอกผลการตรวจสอบเรื่องร้องเรียน',
]" ]"

View file

@ -33,6 +33,9 @@ const props = defineProps({
}, },
}); });
const emit = defineEmits([
"returnPerson"
])
/** หัวตาราง */ /** หัวตาราง */
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{ {
@ -132,23 +135,23 @@ const initialPagination = ref<any>({
function onclickSend() { function onclickSend() {
// inputRef.value.validate(); // inputRef.value.validate();
dialogConfirm($q, () => props.sentApprove()); // dialogConfirm($q, () => props.sentApprove());
// if (selected.value.length > 0) { if (selected.value.length > 0) {
// dialogConfirm( dialogConfirm(
// $q, $q,
// async () => { async () => {
// success($q, `${props.title}`); success($q, `ส่งข้อมูล${props.title}สำเร็จ`);
// console.log(selected.value); console.log(selected.value);
emit('returnPerson',selected.value)
// props.close?.(); props.close?.();
// }, },
// `${props.title}`, `ยืนยันการส่ง${props.title}`,
// `${props.title}` `ต้องการยืนยันการส่ง${props.title}หรือไม่`
// ); );
// } else { } else {
// dialogMessageNotify($q, ""); dialogMessageNotify($q, "กรุณาเลือกรายชื่อ");
// } }
} }
function onClickClose() { function onClickClose() {
@ -158,8 +161,10 @@ function onClickClose() {
watch([() => props.modal], () => { watch([() => props.modal], () => {
inspectionResults.value = props.modal ? "" : ""; inspectionResults.value = props.modal ? "" : "";
selected.value = props.modal ? [] : []; selected.value = props.modal ? [] : [];
if(props.modal === true){
selected.value.push(complainstStore.rowsAdd); selected.value = complainstStore.rowsAdd;
}
}); });
</script> </script>
<template> <template>
@ -217,7 +222,7 @@ watch([() => props.modal], () => {
:columns="columns" :columns="columns"
:rows="complainstStore.rowsAdd" :rows="complainstStore.rowsAdd"
:filter="filter" :filter="filter"
row-key="id" row-key="personId"
flat flat
bordered bordered
:paging="false" :paging="false"

View file

@ -13,7 +13,7 @@ interface FormData {
appellant: string appellant: string
documentFile: any | null documentFile: any | null
status: string status: string
reason: string result: string
persons: object|null persons: object|null
organizationId:string|null organizationId:string|null
disciplineComplaintDocs:object|null disciplineComplaintDocs:object|null
@ -50,7 +50,7 @@ interface MyObjectComplaintsRef {
dateNotification: object | null; dateNotification: object | null;
complaintFrom: object | null; complaintFrom: object | null;
appellant: object | null; appellant: object | null;
reason: object | null; result: object | null;
[key: string]: any; [key: string]: any;
} }