แก้วินัย
This commit is contained in:
parent
015d2d9857
commit
3c2a010ab4
24 changed files with 286 additions and 93 deletions
|
|
@ -59,7 +59,7 @@ const data = reactive<FormData>({
|
|||
organizationId: "",
|
||||
persons: [],
|
||||
investigationExtendHistory: [],
|
||||
isDisciplinary:false
|
||||
isDisciplinary: false,
|
||||
});
|
||||
|
||||
/** ข้อมูล v-model ของฟอร์มเรื่องร้องเรียน */
|
||||
|
|
@ -180,10 +180,54 @@ function getData() {
|
|||
* @param id ระบุ บุคคล
|
||||
*/
|
||||
async function onSubmit(data: any) {
|
||||
console.log(data);
|
||||
// put
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.investigateById(id.value), data)
|
||||
.put(config.API.investigateById(id.value), {
|
||||
id: data.id,
|
||||
idComplaint: data.idComplaint,
|
||||
complaint: data.complaint,
|
||||
complaintdetail: data.complaintdetail,
|
||||
investigationDescription: data.investigationDescription,
|
||||
fault: data.fault,
|
||||
investigationDetailOther: data.investigationDetailOther,
|
||||
evidenceFiles: data.evidenceFiles,
|
||||
fileComplaint: data.fileComplaint,
|
||||
investigationExtendStatus: data.investigationExtendStatus,
|
||||
investigationDateStart: data.investigationDateStart,
|
||||
investigationDateEnd: data.investigationDateEnd,
|
||||
investigationDetail: data.investigationDetail,
|
||||
investigationDaysExtend: data.investigationDaysExtend,
|
||||
investigationStatusResult: data.investigationStatusResult,
|
||||
investigationCauseText: data.investigationCauseText,
|
||||
complaintStatus: data.complaintStatus,
|
||||
result: data.result,
|
||||
directors: data.directors,
|
||||
disciplineInvestigateDocs: data.disciplineInvestigateDocs,
|
||||
disciplineInvestigateRelevantDocs: data.disciplineInvestigateRelevantDocs,
|
||||
status: data.status,
|
||||
documentFile: data.documentFile,
|
||||
respondentType: data.respondentType,
|
||||
organizationId: data.organizationId,
|
||||
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,
|
||||
})),
|
||||
investigationExtendHistory: data.investigationExtendHistory,
|
||||
isDisciplinary: data.isDisciplinary,
|
||||
})
|
||||
.then((res) => {
|
||||
getData();
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
|
|
@ -359,7 +403,7 @@ watch(
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<q-card flat class="col-12">
|
||||
<q-tabs
|
||||
v-model="store.tabMenu"
|
||||
|
|
|
|||
|
|
@ -168,33 +168,28 @@ function validateForm() {
|
|||
* หากยกเลิกจะกลับไปหน้าฟอร์ม
|
||||
*/
|
||||
function onSubmit() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
if (
|
||||
formData.investigationDateStart !== null &&
|
||||
formData.investigationDateEnd !== null
|
||||
) {
|
||||
const investigationDateStart = new Date(
|
||||
formData.investigationDateStart
|
||||
);
|
||||
const investigationDateEnd = new Date(formData.investigationDateEnd);
|
||||
dialogConfirm($q, async () => {
|
||||
if (
|
||||
formData.investigationDateStart !== null &&
|
||||
formData.investigationDateEnd !== null
|
||||
) {
|
||||
const investigationDateStart = new Date(formData.investigationDateStart);
|
||||
const investigationDateEnd = new Date(formData.investigationDateEnd);
|
||||
|
||||
formData.investigationDateStart = moment(investigationDateStart).format(
|
||||
"YYYY-MM-DD"
|
||||
);
|
||||
formData.investigationDateEnd =
|
||||
moment(investigationDateEnd).format("YYYY-MM-DD");
|
||||
}
|
||||
|
||||
if (mainStore.rowsAdd) {
|
||||
formData.persons = mainStore.rowsAdd;
|
||||
}
|
||||
props.onSubmit(formData);
|
||||
isSave.value = false;
|
||||
investigationExtendStatus.value = false;
|
||||
formData.investigationDateStart = moment(investigationDateStart).format(
|
||||
"YYYY-MM-DD"
|
||||
);
|
||||
formData.investigationDateEnd =
|
||||
moment(investigationDateEnd).format("YYYY-MM-DD");
|
||||
}
|
||||
);
|
||||
|
||||
if (mainStore.rowsAdd) {
|
||||
formData.persons = mainStore.rowsAdd;
|
||||
}
|
||||
props.onSubmit(formData);
|
||||
isSave.value = false;
|
||||
investigationExtendStatus.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -260,7 +255,22 @@ watch(props.data, async () => {
|
|||
formData.investigationExtendHistory =
|
||||
props.data.investigationExtendHistory;
|
||||
|
||||
mainStore.rowsAdd = props.data.persons;
|
||||
mainStore.rowsAdd = props.data.persons.map((person: any) => ({
|
||||
id: person.id,
|
||||
idcard: person.idcard,
|
||||
name: person.name,
|
||||
prefix: person.prefix,
|
||||
firstName: person.firstName,
|
||||
lastName: person.lastName,
|
||||
position: person.position,
|
||||
positionLevel: person.positionLevel,
|
||||
salary: person.salary === null ? "-" : person.salary,
|
||||
personId: person.personId,
|
||||
posNo: person.posNo === null ? "-" : person.posNo,
|
||||
organization: person.organization,
|
||||
isSend: person.isSend,
|
||||
isDisciplinary: person.isDisciplinary,
|
||||
}));
|
||||
mainStore.rowsCheck = mainStore.rowsAdd.filter(
|
||||
(item: any) => item.isDisciplinary === false && item.isSend === "NEW"
|
||||
);
|
||||
|
|
@ -404,7 +414,6 @@ function confirmDelete(id: string) {
|
|||
}
|
||||
async function addPerson(data: any) {
|
||||
await mainStore.fetchData(data);
|
||||
toggleModal();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1568,7 +1577,6 @@ onMounted(async () => {
|
|||
:modal="modalPerson"
|
||||
btn-title="เพิ่มรายชื่อผู้ถูกร้องเรียน"
|
||||
:close="toggleModal"
|
||||
:save="addPerson"
|
||||
:selected-data="mainStore.rowsAdd"
|
||||
@returnData="handleSave"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue