fixing show null
This commit is contained in:
parent
65647f79f0
commit
e4ef1e3cb3
1 changed files with 51 additions and 31 deletions
|
|
@ -165,20 +165,20 @@ interface CheckboxItem {
|
||||||
async function dataEdit(id: string) {
|
async function dataEdit(id: string) {
|
||||||
// await myForm.value.validate().then((result: boolean) => {
|
// await myForm.value.validate().then((result: boolean) => {
|
||||||
// if (result) {
|
// if (result) {
|
||||||
showLoader();
|
showLoader();
|
||||||
const data = putDataEdit(id);
|
const data = putDataEdit(id);
|
||||||
http
|
http
|
||||||
.put(config.API.saveEditAssign(id), data)
|
.put(config.API.saveEditAssign(id), data)
|
||||||
.then(() => {})
|
.then(() => {})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
isEdit.value = false;
|
isEdit.value = false;
|
||||||
getAssign();
|
getAssign();
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
// } else {
|
// } else {
|
||||||
// dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ");
|
// dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ");
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -308,16 +308,22 @@ async function getUser() {
|
||||||
|
|
||||||
OPcaretaker.value = data.caregiver.map((item: any) => ({
|
OPcaretaker.value = data.caregiver.map((item: any) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
name: item.prefix + item.firstName + " " + item.lastName,
|
name:
|
||||||
|
(item.prefix == null ? "" : item.prefix) +
|
||||||
|
item.firstName +
|
||||||
|
" " +
|
||||||
|
item.lastName,
|
||||||
label: item.position
|
label: item.position
|
||||||
? `${item.prefix} ${item.firstName} ${item.lastName} (${
|
? `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${
|
||||||
item.position
|
item.lastName
|
||||||
}${
|
} (${item.position}${
|
||||||
item.posLevel && item.posType
|
item.posLevel && item.posType
|
||||||
? ", " + item.posType + ": " + item.posLevel
|
? ", " + item.posType + ": " + item.posLevel
|
||||||
: ""
|
: ""
|
||||||
})`
|
})`
|
||||||
: `${item.prefix} ${item.firstName} ${item.lastName}`,
|
: `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${
|
||||||
|
item.lastName
|
||||||
|
}`,
|
||||||
citizenId: item.citizenId,
|
citizenId: item.citizenId,
|
||||||
isDirector: item.isDirector,
|
isDirector: item.isDirector,
|
||||||
posLevel: item.posLevel,
|
posLevel: item.posLevel,
|
||||||
|
|
@ -327,16 +333,22 @@ async function getUser() {
|
||||||
|
|
||||||
OPcommander.value = data.commander.map((item: any) => ({
|
OPcommander.value = data.commander.map((item: any) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
name: item.prefix + item.firstName + " " + item.lastName,
|
name:
|
||||||
|
(item.prefix == null ? "" : item.prefix) +
|
||||||
|
item.firstName +
|
||||||
|
" " +
|
||||||
|
item.lastName,
|
||||||
label: item.position
|
label: item.position
|
||||||
? `${item.prefix} ${item.firstName} ${item.lastName} (${
|
? `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${
|
||||||
item.position
|
item.lastName
|
||||||
}${
|
} (${item.position}${
|
||||||
item.posLevel && item.posType
|
item.posLevel && item.posType
|
||||||
? ", " + item.posType + ": " + item.posLevel
|
? ", " + item.posType + ": " + item.posLevel
|
||||||
: ""
|
: ""
|
||||||
})`
|
})`
|
||||||
: `${item.prefix} ${item.firstName} ${item.lastName}`,
|
: `${item.prefix == null ? "" : item.prefix} ${item.firstName} ${
|
||||||
|
item.lastName
|
||||||
|
}`,
|
||||||
citizenId: item.citizenId,
|
citizenId: item.citizenId,
|
||||||
posLevel: item.posLevel,
|
posLevel: item.posLevel,
|
||||||
posType: item.posType,
|
posType: item.posType,
|
||||||
|
|
@ -345,16 +357,22 @@ async function getUser() {
|
||||||
|
|
||||||
OPchairman.value = data.chairman.map((item: any) => ({
|
OPchairman.value = data.chairman.map((item: any) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
name: item.prefix + item.firstName + " " + item.lastName,
|
name:
|
||||||
|
(item.prefix == null ? "-" : item.prefix) +
|
||||||
|
item.firstName +
|
||||||
|
" " +
|
||||||
|
item.lastName,
|
||||||
label: item.position
|
label: item.position
|
||||||
? `${item.prefix} ${item.firstName} ${item.lastName} (${
|
? `${item.prefix == null ? "-" : item.prefix} ${item.firstName} ${
|
||||||
item.position
|
item.lastName
|
||||||
}${
|
} (${item.position}${
|
||||||
item.posLevel && item.posType
|
item.posLevel && item.posType
|
||||||
? ", " + item.posType + ": " + item.posLevel
|
? ", " + item.posType + ": " + item.posLevel
|
||||||
: ""
|
: ""
|
||||||
})`
|
})`
|
||||||
: `${item.prefix} ${item.firstName} ${item.lastName}`,
|
: `${item.prefix == null ? "-" : item.prefix} ${item.firstName} ${
|
||||||
|
item.lastName
|
||||||
|
}`,
|
||||||
citizenId: item.citizenId,
|
citizenId: item.citizenId,
|
||||||
posLevel: item.posLevel,
|
posLevel: item.posLevel,
|
||||||
posType: item.posType,
|
posType: item.posType,
|
||||||
|
|
@ -378,7 +396,7 @@ async function getAssignNew(id: string) {
|
||||||
monthOp.push(monthOption);
|
monthOp.push(monthOption);
|
||||||
monthSelect.value = `${data.assign_month} เดือน`;
|
monthSelect.value = `${data.assign_month} เดือน`;
|
||||||
fullname.value =
|
fullname.value =
|
||||||
data.person.prefixName +
|
(data.person.prefixName == null ? "" : data.person.prefixName) +
|
||||||
data.person.firstName +
|
data.person.firstName +
|
||||||
" " +
|
" " +
|
||||||
data.person.lastName;
|
data.person.lastName;
|
||||||
|
|
@ -1059,7 +1077,9 @@ onMounted(async () => {
|
||||||
<q-form
|
<q-form
|
||||||
greedy
|
greedy
|
||||||
@submit.prevent
|
@submit.prevent
|
||||||
@validation-success="assignId !== undefined ? saveEdit(assignId) : saveData(personalId)"
|
@validation-success="
|
||||||
|
assignId !== undefined ? saveEdit(assignId) : saveData(personalId)
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<div class="q-pa-sm">
|
<div class="q-pa-sm">
|
||||||
<div class="toptitle text-dark col-12 row items-center">
|
<div class="toptitle text-dark col-12 row items-center">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue