From dc834c0bb42b788888212d5a58eeff0d98373bec Mon Sep 17 00:00:00 2001
From: HelenHuang <LinHuang@pollex.com.tw>
Date: 星期二, 15 二月 2022 17:04:13 +0800
Subject: [PATCH] Update#135214 [平台滿意度] 調整填寫滿意度 overall 頁面

---
 PAMapp/components/ReviewRecords/ReviewRecords.vue |    2 
 PAMapp/pages/questionnaire/_agentNo.vue           |    8 ++-
 PAMapp/pages/index.vue                            |    6 ++-
 PAMapp/shared/services/reviews.service.ts         |   10 ++--
 PAMapp/shared/models/appointment.model.ts         |   22 ++++++-----
 PAMapp/pages/satisfactionList.vue                 |   34 ++++++++++++++--
 PAMapp/shared/models/enum/satisfaction-type.ts    |    5 ++
 PAMapp/shared/models/reviews.model.ts             |   11 ++---
 8 files changed, 65 insertions(+), 33 deletions(-)

diff --git a/PAMapp/components/ReviewRecords/ReviewRecords.vue b/PAMapp/components/ReviewRecords/ReviewRecords.vue
index 5258e5e..e1c3fb0 100644
--- a/PAMapp/components/ReviewRecords/ReviewRecords.vue
+++ b/PAMapp/components/ReviewRecords/ReviewRecords.vue
@@ -18,7 +18,7 @@
                 v-for="(appointmentLog, index) in reviewLogList"
                 :key="index">
                 <div class="user-reviews-card-content" v-if="isUserLogin">
-                    �撠�<span class="mdTxt">{{ ` ${appointmentLog.agentName} ` }}</span>���� <UiReviewScore :score="appointmentLog.score" /> 閰嚗�
+                    �撠�<span class="mdTxt">{{ ` ${appointmentLog.type === 'APPOINTMENT' ? appointmentLog.agentName : '撟喳'} ` }}</span>���� <UiReviewScore :score="appointmentLog.score" /> 閰嚗�
                 </div>
                 <div class="user-reviews-card-content" v-else>
                     {{ `${appointmentLog.customerName} `}} 撠���� <UiReviewScore :score="appointmentLog.score" /> 閰嚗�
diff --git a/PAMapp/pages/index.vue b/PAMapp/pages/index.vue
index b859888..31d46cb 100644
--- a/PAMapp/pages/index.vue
+++ b/PAMapp/pages/index.vue
@@ -149,10 +149,11 @@
   import myConsultantService from '~/shared/services/my-consultant.service';
   import { Appointment, AppointmentClosedInfo } from '~/shared/models/appointment.model';
   import { Consultant } from '~/shared/models/consultant.model';
-  import { UserReviewsConsultantsParams } from '~/shared/models/reviews.model';
+  import { UserReviewParams } from '~/shared/models/reviews.model';
   import { StrictQueryParams } from '~/shared/models/strict-query.model';
   import { AgentInfo } from '~/shared/models/agent-info.model';
   import { ContactStatus } from '~/shared/models/enum/contact-status';
+import { SatisfactionType } from '~/shared/models/enum/satisfaction-type';
 
   const localStorage = namespace('localStorage');
   const roleStorage = namespace('localStorage');
@@ -378,9 +379,10 @@
     }
 
     userReviewsConsultants() {
-      const reviewParams: UserReviewsConsultantsParams = {
+      const reviewParams: UserReviewParams = {
             appointmentId: this.appointmentDetail.id,
             score: this.inputScore,
+            type: SatisfactionType.APPOINTMENT
         }
         this.appointmentDetail.satisfactionScore = this.inputScore;
 
diff --git a/PAMapp/pages/questionnaire/_agentNo.vue b/PAMapp/pages/questionnaire/_agentNo.vue
index 2631fea..213a636 100644
--- a/PAMapp/pages/questionnaire/_agentNo.vue
+++ b/PAMapp/pages/questionnaire/_agentNo.vue
@@ -166,8 +166,9 @@
 import { Gender } from '~/shared/models/enum/Gender';
 import { RegisterInfo } from '~/shared/models/registerInfo';
 import { AppointmentParams, AppointmentRequests } from '~/shared/models/appointment.model';
-import { UserReviewPlatformParams } from '~/shared/models/reviews.model';
 import { UserSetting } from '~/shared/models/account.model';
+import { SatisfactionType } from '~/shared/models/enum/satisfaction-type';
+import { UserReviewParams } from '~/shared/models/reviews.model';
 
   const roleStorage = namespace('localStorage');
   @Component
@@ -484,9 +485,10 @@
     }
 
     reviewPlatform(): void {
-      const reviewPlatformParams: UserReviewPlatformParams = {
+      const reviewPlatformParams: UserReviewParams = {
         appointmentId: this.appointmentId,
-        score: this.score
+        score: this.score,
+        type: SatisfactionType.SYSTEM
       };
       reviewsService.reviewPlatform(reviewPlatformParams).then((_) => {
         this.closeReservePopUp();
diff --git a/PAMapp/pages/satisfactionList.vue b/PAMapp/pages/satisfactionList.vue
index 99ef165..dbf2330 100644
--- a/PAMapp/pages/satisfactionList.vue
+++ b/PAMapp/pages/satisfactionList.vue
@@ -8,11 +8,20 @@
       </div>
       <template v-if="mapUnReviewLogList.length">
         <div class="satisfaction-card" v-for="(item, index) in mapUnReviewLogList" :key="index">
-          <div class="satisfaction-card-content">
+          <div class="satisfaction-card-content"  v-if="item.agentName">
             <UiAvatar :size="80" :agentNo="item.agentNo"></UiAvatar>
             <div class="satisfaction-card-text">撠憿批��
                 <span class="text--primary text--bold">{{item.agentName}}</span>
                 ��擃���蝯虫�嗾憿��嚗�
+            </div>
+          </div>
+           <div class="satisfaction-card-content"  v-else>
+            <div class="pam-satisfaction-avatar">
+              <span class="pam-satisfaction-avatar-txt">撟喳</span>
+              </div>
+            <div class="satisfaction-card-text" >撠
+                <span class="text--primary text--bold">������</span>
+                撟喳��擃���蝯虫�嗾憿��嚗�
             </div>
           </div>
           <el-rate
@@ -46,9 +55,10 @@
 
 <script lang="ts">
 import { Vue, Component, Action, State, Watch } from 'nuxt-property-decorator';
-import { AppointmentLog } from '~/shared/models/appointment.model';
-import { UserReviewsConsultantsParams } from '~/shared/models/reviews.model';
+
 import reviewsService from '~/shared/services/reviews.service';
+import { AppointmentLog } from '~/shared/models/appointment.model';
+import { UserReviewParams } from '~/shared/models/reviews.model';
 
 @Component({
   layout: 'home'
@@ -80,12 +90,13 @@
   ///////////////////////////////////////////////////////
 
   sent() {
-    const reviewParams: UserReviewsConsultantsParams[] = this.mapUnReviewLogList
+    const reviewParams: UserReviewParams[] = this.mapUnReviewLogList
                 .filter(item => item.satisfaction > 0)
                 .map(item => {
                   return {
                     appointmentId: item.appointmentId,
-                    score: item.satisfaction
+                    score: item.satisfaction,
+                    type: item.type
                   }
                 })
 
@@ -147,6 +158,19 @@
       font-size: 20px;
       padding-left: 10px;
     }
+    .pam-satisfaction-avatar{
+      height: 80px;
+      width: 80px;
+      border-radius: 50%;
+      background-color:#F09491;
+      justify-content: center;
+      align-items: center;
+      display: flex;
+      .pam-satisfaction-avatar-txt{
+        font-size: 18px;
+        color: #fff;
+      }
+    }
 
     @include desktop {
         justify-content: flex-start;
diff --git a/PAMapp/shared/models/appointment.model.ts b/PAMapp/shared/models/appointment.model.ts
index ca94a8f..9bb43ba 100644
--- a/PAMapp/shared/models/appointment.model.ts
+++ b/PAMapp/shared/models/appointment.model.ts
@@ -1,16 +1,18 @@
 import { ContactStatus } from "./enum/contact-status";
+import { SatisfactionType } from "./enum/satisfaction-type";
 
 export interface AppointmentLog {
-    agentName       : string;
-    agentNo         : string;
-    appointmentId   : number;
-    createdDate     : string;
-    customerId      : number;
-    customerName    : string;
-    id              : number;
-    lastModifiedDate: string;
-    score           : number;
-    status          : 'UNFILLED' | 'FILLED';
+  id              : number;
+  createdDate     : string;
+  lastModifiedDate: string;
+  customerId      : number;
+  agentNo         : string;
+  status          : 'UNFILLED' | 'FILLED';
+  score           : number;
+  appointmentId   : number;
+  customerName    : string;
+  agentName       : string;
+  type            : SatisfactionType;
 }
 
 export interface Appointment {
diff --git a/PAMapp/shared/models/enum/satisfaction-type.ts b/PAMapp/shared/models/enum/satisfaction-type.ts
new file mode 100644
index 0000000..56cd162
--- /dev/null
+++ b/PAMapp/shared/models/enum/satisfaction-type.ts
@@ -0,0 +1,5 @@
+export enum SatisfactionType {
+  SYSTEM = 'SYSTEM',
+  APPOINTMENT = 'APPOINTMENT',
+}
+
diff --git a/PAMapp/shared/models/reviews.model.ts b/PAMapp/shared/models/reviews.model.ts
index 67f168e..e8eba03 100644
--- a/PAMapp/shared/models/reviews.model.ts
+++ b/PAMapp/shared/models/reviews.model.ts
@@ -1,6 +1,8 @@
-export interface UserReviewsConsultantsParams{
+import { SatisfactionType } from './enum/satisfaction-type';
+export interface UserReviewParams{
   appointmentId: number,
   score        : number,
+  type         : SatisfactionType,
 }
 
 export interface NotificationList {
@@ -20,16 +22,11 @@
   readDate: string;
 }
 
-export interface UserReviewPlatformParams {
-  appointmentId: number;
-  score        : number;
-}
-
 export interface UserReviewPlatformRes {
   agentNo?     : string;
   appointmentId: number;
   customerId   : string;
   id           : number,
   score        : string;
-  type         : 'APPOINTMENT' | 'SYSTEM';
+  type         : SatisfactionType;
 }
diff --git a/PAMapp/shared/services/reviews.service.ts b/PAMapp/shared/services/reviews.service.ts
index 4a71e41..48a55a0 100644
--- a/PAMapp/shared/services/reviews.service.ts
+++ b/PAMapp/shared/services/reviews.service.ts
@@ -1,17 +1,17 @@
 import { http } from "./httpClient";
 
-import { NotificationList, UserReviewPlatformParams, UserReviewPlatformRes, UserReviewsConsultantsParams } from "../models/reviews.model";
+import { NotificationList, UserReviewPlatformRes, UserReviewParams } from "../models/reviews.model";
 import { AppointmentLog } from "../models/appointment.model";
 
 class ReviewsService {
 
   //摰X�脰�遛��漲閰��(�蝑�)
-  userReviewsConsultants(data: UserReviewsConsultantsParams) {
+  userReviewsConsultants(data: UserReviewParams) {
     return http.post('/satisfaction/score', data);
   }
 
   // 摰X�脰�遛��漲(憭��)
-  allUserReviewsConsultants(data: UserReviewsConsultantsParams[]) {
+  allUserReviewsConsultants(data: UserReviewParams[]) {
     return http.post('/satisfaction/score/all', data);
   }
 
@@ -37,8 +37,8 @@
   }
 
   // 摰X憛怠神撟喳皛踵�漲
-  reviewPlatform(params: UserReviewPlatformParams): Promise<UserReviewPlatformRes> {
-    return http.post('/satisfaction/system/score', params);
+  reviewPlatform(params: UserReviewParams): Promise<UserReviewPlatformRes> {
+    return http.post('/satisfaction/score', params);
   }
 }
 

--
Gitblit v1.8.0