From f5c3e5e9254b7af10ddbc8b5cb81cd78f531e8d1 Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期五, 10 六月 2022 14:01:00 +0800
Subject: [PATCH] Merge branch 'Phase3' of ssh://192.168.0.10:29418/pcalife/PAM into Phase3

---
 PAMapp/pages/questionnaire/_agentNo.vue |   47 ++++++++++++++++++++++++++---------------------
 1 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/PAMapp/pages/questionnaire/_agentNo.vue b/PAMapp/pages/questionnaire/_agentNo.vue
index 2631fea..4e55158 100644
--- a/PAMapp/pages/questionnaire/_agentNo.vue
+++ b/PAMapp/pages/questionnaire/_agentNo.vue
@@ -67,7 +67,7 @@
     <div class="ques-container">
       <div class="pam-paragraph">
         <div class="mdTxt">
-            �閬岷������
+            �鈭圾�����
             <span class="hint text--bold">
                 (�銴)
             </span>
@@ -103,7 +103,7 @@
 
     <PopUpFrame :isOpen.sync="showDrawer">
       <div class="qaTextTitle mdTxt">
-        <strong>�閬岷������</strong>
+        <strong>�鈭圾�����</strong>
       </div>
       <div class="qa-dialog">
           <div v-for="(qaText,index) in quesAboutList" :key="index" >
@@ -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
@@ -335,7 +336,6 @@
     private setMyRequest(): void {
       const storageMyRequest = getRequestsFromStorage();
       const storageMyRequirement = this.recommendConsultantItem ? JSON.parse(this.recommendConsultantItem).requirements:[];
-      const contactTypePromise = accountSettingService.getUserAccountSetting();
 
       if (storageMyRequest) {
         this.myRequest = {
@@ -357,12 +357,15 @@
         removeRequestQuestionFromStorage();
       }
 
-      contactTypePromise.then((contactTypeDetail) => {
-            this.myRequest = {
-              ...this.myRequest,
-              ...contactTypeDetail
-            }
-      })
+      if (authService.isUserLogin()) {
+        accountSettingService.getUserAccountSetting().then((contactTypeDetail) => {
+              this.myRequest = {
+                ...this.myRequest,
+                ...contactTypeDetail
+              }
+        })
+      }
+
 
     }
 
@@ -399,19 +402,20 @@
 
     private getReservedData(appointmentInfo) {
       if (appointmentInfo) {
-        const hopeContactTime = appointmentInfo!.hopeContactTime.split("'")
-              .filter(item => item && item !== ',');
-        this.getAppointmentId(appointmentInfo);
-
-        return {
-            ...appointmentInfo,
-            hopeContactTime: hopeContactTime.map(item => {
+        const hopeContactTime = appointmentInfo!.hopeContactTime
+          ?  appointmentInfo!.hopeContactTime.split("'").filter(item => item && item !== ',').map(item => {
                 const info = item.split('��');
                 return {
                     selectWeekOptions: info[0].split(','),
                     selectTimesOptions: info[1].split(',')
                 }
-            }),
+            })
+          :[{selectWeekOptions : [],selectTimesOptions: []}];
+        this.getAppointmentId(appointmentInfo);
+
+        return {
+            ...appointmentInfo,
+            hopeContactTime: hopeContactTime,
             requirement: appointmentInfo.requirement.split(',')
           }
       } else {
@@ -432,7 +436,7 @@
       if (this.isEditBtn) {
         this.editAppointmentDemand();
       } else {
-        queryConsultantService.addFavoriteConsultant([this.$route.params.agentNo]).then(res => this.sentAppointmentDemand());
+        queryConsultantService.addFavoriteConsultant([{ agentNo: this.$route.params.agentNo, createdTime: new Date().toISOString()}]).then(res => this.sentAppointmentDemand());
       }
        const editSettingInfo: UserSetting = {
           name: this.myRequest.name,
@@ -484,9 +488,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();

--
Gitblit v1.8.0