fix: error undefined

This commit is contained in:
Methapon2001 2024-12-25 16:31:32 +07:00
parent 5a5a0581de
commit cc8ef8c97b

View file

@ -262,11 +262,13 @@ const responsiblePersonList = computed(() => {
curr.productService.service?.workflow?.step.forEach((v) => {
const key = v.order.toString();
if (!acc[key]) acc[key] = [];
if (!acc[key]) acc[key] = v.responsiblePerson.map((v) => v.user);
const current = acc[key];
v.responsiblePerson.forEach((lhs) => {
if (acc[v.order].find((rhs) => rhs.id === lhs.userId)) return;
acc[v.order].push(lhs.user);
if (current.find((rhs) => rhs.id === lhs.userId)) return;
current.push(lhs.user);
});
});
@ -275,7 +277,7 @@ const responsiblePersonList = computed(() => {
{},
);
return temp;
return temp || {};
});
const successAll = computed(() => {
@ -372,15 +374,12 @@ function isInstallmentPaySuccess(installmentNo: number) {
<span class="app-text-muted">{{ $t('flow.responsiblePerson') }}</span>
<span>
<template
v-if="
responsiblePersonList &&
responsiblePersonList[pageState.currentStep].length >= 1
"
v-if="responsiblePersonList[pageState.currentStep]?.length"
>
<AvatarGroup
:data="
responsiblePersonList[pageState.currentStep].map((v) => {
return {
(responsiblePersonList[pageState.currentStep] || []).map(
(v) => ({
name:
$i18n.locale === 'eng'
? `${v.firstNameEN} ${v.lastNameEN}`
@ -390,8 +389,8 @@ function isInstallmentPaySuccess(installmentNo: number) {
? `/no-img-man.png`
: `/no-img-female.png`
: `${baseUrl}/user/${v.id}/profile-image/${v.selectedImage}`,
};
})
}),
)
"
/>
</template>