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

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

@ -69,7 +69,7 @@ const data = reactive<FormData>({
documentFile: null,
status: "",
persons: [personOj],
reason: '',
result: '',
disciplineComplaintDocs: [fileListOj],
});
@ -155,7 +155,7 @@ async function getData() {
data.appellant = dataList.appellant;
data.status = dataList.status;
data.persons = dataList.persons;
data.reason = dataList.reason;
data.result = dataList.result;
data.disciplineComplaintDocs = dataList.disciplineComplaintDocs;
console.log("list", data.id);
@ -261,10 +261,17 @@ function confirmCancelInvestigate() {
console.log("sent");
}
function sentApprove() {
showLoader();
function emitPerson(data:ArrayPerson[]){
console.log('person',data)
const dataMapId = data.map((item:ArrayPerson) =>
item.personId
)
console.log('id',dataMapId)
showLoader();
http
.get(config.API.complaintApprove(id.value))
.put(config.API.complaintApprove(id.value),{
persons:dataMapId
})
.then((res) => {
router.push(`/discipline/complaints`);
})
@ -274,8 +281,22 @@ function sentApprove() {
.finally(() => {
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(() => {
console.log(data);
@ -325,6 +346,6 @@ onMounted(() => {
:data="data"
:get-data="getData"
/>
<Popup :modal="modalPopup" :close="closePopup" :sentApprove="sentApprove" />
<Popup :modal="modalPopup" :close="closePopup" @return-person="emitPerson"/>
</div>
</template>

View file

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

View file

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

View file

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