From 31f6ff0ebbf3d374e6e0acdeda72bccdd86de2d5 Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期四, 10 二月 2022 14:16:15 +0800
Subject: [PATCH] update#134662: [ 顧問管理流程 ] 編輯顧問個人資料 : 所在地區,無產生選擇器

---
 PAMapp/components/Consultant/ConsultantCard.vue |   64 ++++++++++++++++++++++----------
 1 files changed, 44 insertions(+), 20 deletions(-)

diff --git a/PAMapp/components/Consultant/ConsultantCard.vue b/PAMapp/components/Consultant/ConsultantCard.vue
index f7198f6..d318031 100644
--- a/PAMapp/components/Consultant/ConsultantCard.vue
+++ b/PAMapp/components/Consultant/ConsultantCard.vue
@@ -7,16 +7,21 @@
                     :agentNo="agentInfo.agentNo"
                     @click.native="showAgentDetail(agentInfo.agentNo)"
                 ></UiAvatar>
-                <!-- TODO:���遛��漲 -->
-                <div v-if="!hideReviews">
-                    <i class="icon-star pam-icon icon--yellow satisfaction"  v-if="notScoreAppointmentYet"></i>
-                    <span v-if="notScoreAppointmentYet">
-                        {{ agentInfo.satisfactionScore }}
-                    </span>
-                    <div class="unfilled text--center "
-                        style="display:flex"
-                        v-if="notScoreAppointmentYet">�憛�<br />皛踵�漲</div>
-                    <span v-if="agentInfo.contactStatus !== 'contacted'">{{ agentInfo.avgScore }}</span>
+                <div v-if="!hideReviews" style="display: flex; justify-content: flex-start; align-items: center; margin-top: 6px; font-size: 12px">
+                    <i class="icon-star pam-icon icon--yellow satisfaction" style="margin-top: 0"></i>
+                      <template v-if="isAppointment">
+                      <span v-if="notScoreAppointmentYet">
+                          {{ agentInfo.satisfactionScore }}
+                      </span>
+                      <div class="unfilled text--center "
+                          style="display:flex"
+                          v-if="notScoreAppointmentYet">�憛�<br />皛踵�漲</div>
+                    </template>
+                    <template v-else>
+                      <span v-if="agentInfo.avgScore">{{ agentInfo.avgScore }}</span>
+                      <span v-else>撠<br />皛踵�漲</span>
+                    </template>
+
                 </div>
             </el-col>
             <el-col :xs="10" :sm="15">
@@ -31,7 +36,7 @@
                 <div
                     class="delete"
                     v-if="showRemoveBtn"
-                    @click="removeAgent"
+                    @click="isRemoveAgentPopup = true"
                 >蝘駁</div>
                 <div
                     v-if="notScoreAppointmentYet"
@@ -45,7 +50,7 @@
                     :class="actionBtnStyle"
                 >{{ actionBtnLabel }}</el-button>
                 <div class="updateTime mt-10">
-                    {{ agentInfo.updateTime | formatDate }}
+                    {{ (isAppointment ? agentInfo.appointmentLastModifiedDate : agentInfo.updateTime)  | formatDate }}
                 </div>
             </el-col>
         </el-row>
@@ -57,7 +62,7 @@
         >
             <div v-if="appointmentDetail">
                 <h5 class="subTitle text--center mb-30">������</h5>
-                <p class="smTxt">{{appointmentDetail.appointmentDate | formatDate}}</p>
+                <p class="smTxt">{{appointmentDetail.appointmentDate | formatDate}} 撱箇��</p>
                 <div class="reserved-info">
                     <p>憪��{appointmentDetail.name}}</p>
                     <p>�閰梧�{appointmentDetail.phone}}</p>
@@ -125,10 +130,18 @@
             </div>
         </PopUpFrame>
 
-        <PopUpFrame :isOpen.sync="isConfirmPopup">
-            <div class="text--center mdTxt">撌脫����迨蝑���</div>
+        <PopUpFrame  :isOpen.sync="isConfirmPopup">
+            <div class="text--center mdTxt">撌脫��{confirmTxt}}</div>
             <div class="text--center mt-30">
                 <el-button @click="isConfirmPopup = false" type="primary">蝣箏��</el-button>
+            </div>
+        </PopUpFrame>
+
+        <PopUpFrame :isOpen.sync="isRemoveAgentPopup">
+            <div class="text--center mdTxt">��蝘駁憿批�� <span class="text--primary">{{agentInfo.name}}</span>嚗�</div>
+            <div class="text--center mt-30">
+                <el-button @click="isRemoveAgentPopup = false">�</el-button>
+                <el-button @click="removeAgent" type="primary">�</el-button>
             </div>
         </PopUpFrame>
     </div>
@@ -181,6 +194,8 @@
     isCancelPopup = false;
     hideReviews = hideReviews;
     isConfirmPopup = false;
+    isRemoveAgentPopup = false;
+    confirmTxt = '';
 
     appointmentDetail: any = {
         age               : '',
@@ -215,9 +230,9 @@
       return !!this.agentInfo['appointmentStatus'];
     }
 
-    get latestReservedAppointment(): Appointment {
+    get latestNotClosedAppointment(): Appointment {
         return this.agentInfo.appointments!
-                .filter((appointment) => appointment.communicateStatus === 'reserved')
+                .filter((appointment) => appointment.communicateStatus === 'reserved' || appointment.communicateStatus === 'contacted')
                 .map((reversedAppointment) => {
                     return {
                     ...reversedAppointment,
@@ -325,7 +340,7 @@
       const isAppointment = !!this.agentInfo['appointmentStatus'];
       const appointmentId = isAppointment
                           ? this.agentInfo['appointmentId']
-                          : this.latestReservedAppointment.id;
+                          : this.latestNotClosedAppointment.id;
 
         appointmentService.getAppointmentDetail(appointmentId!).then(res => {
             this.appointmentDetail = {
@@ -339,6 +354,12 @@
 
     removeAgent() {
         this.removeFromMyConsultantList(this.agentInfo.agentNo).then((removeOk) => {
+            this.isRemoveAgentPopup = false;
+            setTimeout(() => {
+                this.confirmTxt = '蝘駁憿批��';
+                this.isConfirmPopup = true;
+            }, 300);
+
         });
     }
 
@@ -350,7 +371,7 @@
       const isAppointment = !!this.agentInfo['appointmentStatus'];
       const appointmentId = isAppointment
                           ? this.agentInfo['appointmentId']
-                          : this.latestReservedAppointment.id;
+                          : this.latestNotClosedAppointment.id;
 
         const reviewParams: UserReviewsConsultantsParams = {
             appointmentId: appointmentId,
@@ -365,12 +386,14 @@
     }
 
     cancel() {
-        appointmentService.cancelAppointment(this.latestReservedAppointment.id).then(res => {
+        appointmentService.cancelAppointment(this.latestNotClosedAppointment.id).then(res => {
             this.storeConsultantList();
             this.isVisibleDialog = false;
             this.isCancelPopup = false;
             setTimeout(() => {
+                this.confirmTxt = '���迨蝑���';
                 this.isConfirmPopup = true;
+
             }, 300);
         });
     }
@@ -422,6 +445,7 @@
         }
 
         .delete {
+            display: inline-block;
             color: $PRIMARY_RED;
             font-size: 14px;
             font-weight: bold;

--
Gitblit v1.8.0