From cce1eccf8c22d59800a4d1f352478faaa4e39acb Mon Sep 17 00:00:00 2001 From: puriphatt Date: Fri, 27 Dec 2024 12:00:25 +0700 Subject: [PATCH] fix: order => taskStatusCount function to filter by responsible user ID --- .../09_task-order/order_view/MainPage.vue | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/pages/09_task-order/order_view/MainPage.vue b/src/pages/09_task-order/order_view/MainPage.vue index 30925126..53af6ad0 100644 --- a/src/pages/09_task-order/order_view/MainPage.vue +++ b/src/pages/09_task-order/order_view/MainPage.vue @@ -576,9 +576,11 @@ function openFailedDialog( pageState.failedDialog = true; } -function taskStatusCount(index: number, id: string) { +function taskStatusCount(index: number, id: string, responsibleUserId: string) { const task = fullTaskOrder.value?.taskList.filter( - (t) => t.requestWorkStep.requestWork.productService.productId === id, + (t) => + t.requestWorkStep.requestWork.productService.productId === id && + t.requestWorkStep.responsibleUserId === responsibleUserId, ); if (index === 1) { return task?.filter( @@ -920,14 +922,14 @@ watch([currentFormData.value.taskStatus], () => {
{ size="xs" class="q-pr-sm" /> - - {{ taskStatusCount(v, product.id) }} + {{ + taskStatusCount( + taskStatus, + product.id, + v.responsibleUser.id, + ) + }}