แก้วินัย
This commit is contained in:
parent
015d2d9857
commit
3c2a010ab4
24 changed files with 286 additions and 93 deletions
|
|
@ -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}`);
|
||||
|
|
|
|||
|
|
@ -100,11 +100,11 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionNo",
|
||||
name: "posNo",
|
||||
align: "left",
|
||||
label: "ตำแหน่งเลขที่",
|
||||
sortable: true,
|
||||
field: "positionNo",
|
||||
field: "posNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -151,7 +151,7 @@ const visibleColumns = ref<string[]>([
|
|||
"no",
|
||||
"idcard",
|
||||
"name",
|
||||
"positionNo",
|
||||
"posNo",
|
||||
"position",
|
||||
"positionLevel",
|
||||
"salary",
|
||||
|
|
@ -193,12 +193,51 @@ async function getData() {
|
|||
|
||||
/**
|
||||
* บันทึกข้อมูลเมื่อแก้ไข
|
||||
* @param data ข้อมูลจากฟอร์ม
|
||||
* @param data ข้อมูลจากฟอร์ม
|
||||
*/
|
||||
async function onSubmit(data: any) {
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.complaintbyId(id.value), data)
|
||||
.put(config.API.complaintbyId(id.value), {
|
||||
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) => {
|
||||
getData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
|
|
|
|||
|
|
@ -160,8 +160,6 @@ function validateForm() {
|
|||
countNum.value = 1;
|
||||
onSubmit();
|
||||
} else {
|
||||
console.log("ไม่ผ่าน ");
|
||||
console.log(formData)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -896,7 +894,7 @@ onMounted(() => {
|
|||
color="secondary"
|
||||
label="บันทึก"
|
||||
type="submit"
|
||||
><q-tooltip>บับทึกข้อมูล</q-tooltip></q-btn
|
||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue