diff --git a/src/modules/05_placement/components/probation/FormAssign.vue b/src/modules/05_placement/components/probation/FormAssign.vue index 484e7cee3..c5e502228 100644 --- a/src/modules/05_placement/components/probation/FormAssign.vue +++ b/src/modules/05_placement/components/probation/FormAssign.vue @@ -165,20 +165,20 @@ interface CheckboxItem { async function dataEdit(id: string) { // await myForm.value.validate().then((result: boolean) => { // if (result) { - showLoader(); - const data = putDataEdit(id); - http - .put(config.API.saveEditAssign(id), data) - .then(() => {}) - .catch(() => {}) - .finally(async () => { - isEdit.value = false; - getAssign(); - hideLoader(); - }); - // } else { - // dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ"); - // } + showLoader(); + const data = putDataEdit(id); + http + .put(config.API.saveEditAssign(id), data) + .then(() => {}) + .catch(() => {}) + .finally(async () => { + isEdit.value = false; + getAssign(); + hideLoader(); + }); + // } else { + // dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ"); + // } // }); } @@ -308,16 +308,22 @@ async function getUser() { OPcaretaker.value = data.caregiver.map((item: any) => ({ id: item.id, - name: item.prefix + item.firstName + " " + item.lastName, + name: + (item.prefix == null ? "" : item.prefix) + + item.firstName + + " " + + item.lastName, label: item.position - ? `${item.prefix} ${item.firstName} ${item.lastName} (${ - item.position - }${ + ? `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${ + item.lastName + } (${item.position}${ item.posLevel && item.posType ? ", " + item.posType + ": " + item.posLevel : "" })` - : `${item.prefix} ${item.firstName} ${item.lastName}`, + : `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${ + item.lastName + }`, citizenId: item.citizenId, isDirector: item.isDirector, posLevel: item.posLevel, @@ -327,16 +333,22 @@ async function getUser() { OPcommander.value = data.commander.map((item: any) => ({ id: item.id, - name: item.prefix + item.firstName + " " + item.lastName, + name: + (item.prefix == null ? "" : item.prefix) + + item.firstName + + " " + + item.lastName, label: item.position - ? `${item.prefix} ${item.firstName} ${item.lastName} (${ - item.position - }${ + ? `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${ + item.lastName + } (${item.position}${ item.posLevel && item.posType ? ", " + item.posType + ": " + item.posLevel : "" })` - : `${item.prefix} ${item.firstName} ${item.lastName}`, + : `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${ + item.lastName + }`, citizenId: item.citizenId, posLevel: item.posLevel, posType: item.posType, @@ -345,16 +357,22 @@ async function getUser() { OPchairman.value = data.chairman.map((item: any) => ({ id: item.id, - name: item.prefix + item.firstName + " " + item.lastName, + name: + (item.prefix == null ? "-" : item.prefix) + + item.firstName + + " " + + item.lastName, label: item.position - ? `${item.prefix} ${item.firstName} ${item.lastName} (${ - item.position - }${ + ? `${item.prefix == null ? "-" : item.prefix} ${item.firstName} ${ + item.lastName + } (${item.position}${ item.posLevel && item.posType ? ", " + item.posType + ": " + item.posLevel : "" })` - : `${item.prefix} ${item.firstName} ${item.lastName}`, + : `${item.prefix == null ? "-" : item.prefix} ${item.firstName} ${ + item.lastName + }`, citizenId: item.citizenId, posLevel: item.posLevel, posType: item.posType, @@ -378,7 +396,7 @@ async function getAssignNew(id: string) { monthOp.push(monthOption); monthSelect.value = `${data.assign_month} เดือน`; fullname.value = - data.person.prefixName + + (data.person.prefixName == null ? "" : data.person.prefixName) + data.person.firstName + " " + data.person.lastName; @@ -1059,7 +1077,9 @@ onMounted(async () => {