From 38d54008aea81576fe80c1777a802f4506657437 Mon Sep 17 00:00:00 2001
From: HelenHuang <LinHuang@pollex.com.tw>
Date: 星期二, 25 一月 2022 11:55:53 +0800
Subject: [PATCH] Fixed#134793 預約資訊按鈕文字改「通知約訪」

---
 PAMapp/components/Client/ClientCard.vue |   41 ++++++++++++++++++++++++++++++-----------
 1 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/PAMapp/components/Client/ClientCard.vue b/PAMapp/components/Client/ClientCard.vue
index f203dd0..70510bf 100644
--- a/PAMapp/components/Client/ClientCard.vue
+++ b/PAMapp/components/Client/ClientCard.vue
@@ -179,6 +179,7 @@
 import { ElRow } from 'element-ui/types/row';
 import { Appointment, AppointmentMemoInfo } from '~/shared/models/appointment.model';
 import { ContactStatus } from '~/shared/models/enum/contact-status';
+import reviewsService from '~/shared/services/reviews.service';
 
 const appointmentStore = namespace('appointment.store');
 const localStorage     = namespace('localStorage');
@@ -211,6 +212,9 @@
 
     @appointmentStore.Action
     getAppointmentDetail!: (appointmentId: number) => Promise<Appointment>;
+
+    @appointmentStore.Action
+    updateAppointmentDetail!: (id: number) => Appointment;
 
     @appointmentStore.Getter
     appointmentProgress!: ContactStatus;
@@ -257,6 +261,10 @@
 
     viewAppointmentDetail(): void {
       this.getAppointmentDetail(this.client.id).then((_) => {
+        const unread = !this.client.consultantReadTime;
+        if (unread) {
+          this.readAppointment();
+        }
         this.$router.push(`/appointment/${this.client.id}`);
       });
     }
@@ -266,11 +274,15 @@
     }
 
     navigateToCloseAppointment(): void {
-      this.$router.push(`/appointment/${this.client.id}/close`);
+      this.getAppointmentDetail(this.client.id).then((_) => {
+        this.$router.push(`/appointment/${this.client.id}/close`);
+      });
     }
 
     inviteReview(): void {
-      this.isShowInviteReviewDialog = true ;
+        reviewsService.sendSatisfactionToClient(this.client.id).then(res => {
+            this.isShowInviteReviewDialog = true ;
+        })
     }
 
     openDetail() {
@@ -289,16 +301,18 @@
     }
 
     closeInformDialog(): void {
-      const unread = !this.client.consultantReadTime;
-        if (unread) {
-            appointmentService.recordRead(this.client.id).then((_) => {
-                const updatedClient = {...this.client};
-                updatedClient.consultantReadTime = new Date().toString();
-                this.updateMyAppointmentList(updatedClient);
-            });
-        };
+        this.readAppointment();
         this.isEdit = false;
         this.clearAppointmentIdFromMsg();
+    }
+
+    private readAppointment(): void {
+      appointmentService.recordRead(this.client.id).then((_) => {
+          const updatedClient = {...this.client};
+          updatedClient.consultantReadTime = new Date().toString();
+          this.updateMyAppointmentList(updatedClient);
+          this.updateAppointmentDetail(this.client.id);
+      });
     }
 
     private clearAppointmentIdFromMsg() {
@@ -451,10 +465,14 @@
         .professionals {
             overflow     : hidden;
             text-overflow: ellipsis;
-            white-space  : nowrap;
+            display: -webkit-box;
+            -webkit-box-orient: vertical;
+            -webkit-line-clamp: 1;
             .professionalsTxt {
                 font-size   : 12px;
                 margin-right: 5px;
+
+
             }
             .noProfessionalsTxt {
                 color      : $PRUDENTIAL_GREY;
@@ -502,6 +520,7 @@
         display: flex;
     }
     .invite-msg{
+      width: 96px;
       color: $PRIMARY_RED;
       @extend .text--underline;
     }

--
Gitblit v1.8.0