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