diff --git a/src/components/shared/AvatarGroup.vue b/src/components/shared/AvatarGroup.vue index a3f3d85e..ed8f63ef 100644 --- a/src/components/shared/AvatarGroup.vue +++ b/src/components/shared/AvatarGroup.vue @@ -25,7 +25,11 @@ withDefaults( alt="Image" /> -
+
{{ person.name }} diff --git a/src/pages/08_request-list/RequestListView.vue b/src/pages/08_request-list/RequestListView.vue index 4675b124..fc6e69c2 100644 --- a/src/pages/08_request-list/RequestListView.vue +++ b/src/pages/08_request-list/RequestListView.vue @@ -518,8 +518,8 @@ function toEmployee(employee: RequestData['employee']) { v-if="responsibleList[pageState.currentStep]?.user.length" > ({ name: $i18n.locale === 'eng' @@ -531,8 +531,12 @@ function toEmployee(employee: RequestData['employee']) { : `/no-img-female.png` : `${baseUrl}/user/${v.id}/profile-image/${v.selectedImage}`, }), - ) - " + ), + ...responsibleList[pageState.currentStep].group.map((g) => ({ + name: `${$t('general.group')} ${g}`, + imgUrl: '/img-group.png', + })), + ]" /> diff --git a/src/pages/08_request-list/TableRequestList.vue b/src/pages/08_request-list/TableRequestList.vue index 7b99bf78..fec64111 100644 --- a/src/pages/08_request-list/TableRequestList.vue +++ b/src/pages/08_request-list/TableRequestList.vue @@ -42,9 +42,14 @@ defineEmits<{ const selected = defineModel('selected'); -function responsiblePerson(quotation: QuotationFull): CreatedBy[] | undefined { +function responsiblePerson(quotation: QuotationFull) { const productServiceList = quotation.productServiceList; const tempPerson: CreatedBy[] = []; + const tempGroup: { + group: string; + id: string; + workflowTemplateStepId: string; + }[] = []; for (const v of productServiceList) { const tempStep = v.service?.workflow?.step; @@ -55,7 +60,18 @@ function responsiblePerson(quotation: QuotationFull): CreatedBy[] | undefined { tempPerson.push(rhs.user); } }); - return tempPerson; + tempStep.forEach((lhs) => { + const newGroup = lhs.responsibleGroup as unknown as { + group: string; + id: string; + workflowTemplateStepId: string; + }[]; + for (const rhs of newGroup) { + tempGroup.push(rhs); + } + }); + console.log({ user: tempPerson, group: tempGroup }); + return { user: tempPerson, group: tempGroup }; } } @@ -261,7 +277,7 @@ function handleCheckAll() { {{ props.row.quotation.code || '-' }} - + /> --> +
+ 0 || + (responsiblePerson(props.row.quotation).group ?? []).length > + 0 " + :data="[ + ...responsiblePerson(props.row.quotation).user.map((v) => ({ + name: + $i18n.locale === 'eng' + ? `${v.firstNameEN} ${v.lastNameEN}` + : `${v.firstName} ${v.lastName}`, + imgUrl: !v.selectedImage + ? v.gender === 'male' + ? `/no-img-man.png` + : `/no-img-female.png` + : `${baseUrl}/user/${v.id}/profile-image/${v.selectedImage}`, + })), + ...responsiblePerson(props.row.quotation).group.map((g) => ({ + name: `${$t('general.group')} ${g.group}`, + imgUrl: '/img-group.png', + })), + ]" /> -