แก้วินัย

This commit is contained in:
setthawutttty 2024-01-19 13:06:32 +07:00
parent 015d2d9857
commit 3c2a010ab4
24 changed files with 286 additions and 93 deletions

View file

@ -18,7 +18,46 @@ async function onSubmit(data: any) {
/** post */
showLoader();
http
.post(config.API.complaintAdd(), data)
.post(config.API.complaintAdd(), {
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) => {
success($q, "บันทึกข้อมูลสำเร็จ");
router.push(`/discipline/complaints/${res.data.result}`);