แก้วินัย
This commit is contained in:
parent
015d2d9857
commit
3c2a010ab4
24 changed files with 286 additions and 93 deletions
|
|
@ -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