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

This commit is contained in:
setthawutttty 2023-11-23 17:48:24 +07:00
parent 418437486d
commit b876c951b0
4 changed files with 56 additions and 31 deletions

View file

@ -20,5 +20,8 @@ export default {
complaintResume:(id:string) => `${discipline}/complaint/resume/${id}`,
complaintList:(page:number,pageSize:number,keyword:string) => `${discipline}/complaint?page=${page}&pageSize=${pageSize}&keyword=${keyword}`,
complaintFileUpload:(id:string) => `${discipline}/complaint/file/${id}`,
complaintFileDelete:(id:string,docId:string) => `${discipline}/complaint/file/${id}/${docId}`
complaintFileDelete:(id:string,docId:string) => `${discipline}/complaint/file/${id}/${docId}`,
complaintApprove:(id:string) => `${discipline}/complaint/approve/${id}`
};

View file

@ -17,20 +17,20 @@ const router = useRouter();
async function onSubmit(data: any) {
/** post */
console.log(data)
// showLoader();
// http
// .post(config.API.complaintAdd(), data)
// .then((res) => {
// console.log(res)
// success($q, "");
// router.push(`/discipline/complaints/${res.data.result}`);
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(async () => {
// hideLoader();
// });
showLoader();
http
.post(config.API.complaintAdd(), data)
.then((res) => {
console.log(res)
success($q, "บันทึกข้อมูลสำเร็จ");
router.push(`/discipline/complaints/${res.data.result}`);
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
});
}
</script>
<template>

View file

@ -260,6 +260,22 @@ function confirmCancelInvestigate() {
});
console.log("sent");
}
function sentApprove() {
showLoader();
http
.get(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);
@ -309,6 +325,6 @@ onMounted(() => {
:data="data"
:get-data="getData"
/>
<Popup :modal="modalPopup" :close="closePopup" />
<Popup :modal="modalPopup" :close="closePopup" :sentApprove="sentApprove" />
</div>
</template>

View file

@ -17,7 +17,7 @@ const { dialogConfirm, dialogMessageNotify, success } = mixin;
const props = defineProps({
title: {
type: String,
default: 'ส่งไปสืบสวน',
default: "ส่งไปสืบสวน",
},
modal: {
type: Boolean,
@ -27,6 +27,10 @@ const props = defineProps({
type: Function,
require: true,
},
sentApprove: {
type: Function,
default: () => "",
},
});
/** หัวตาราง */
@ -128,21 +132,23 @@ const initialPagination = ref<any>({
function onclickSend() {
// inputRef.value.validate();
if (selected.value.length > 0) {
dialogConfirm(
$q,
async () => {
success($q, `ส่งข้อมูล${props.title}สำเร็จ`);
console.log(selected.value);
dialogConfirm($q, () => props.sentApprove());
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);
// props.close?.();
// },
// `${props.title}`,
// `${props.title}`
// );
// } else {
// dialogMessageNotify($q, "");
// }
}
function onClickClose() {