保誠-保戶業務員媒合平台
wayne
2022-02-17 4394e4248455637ab7836756058ac872fdf4af10
PAMapp/components/Client/ClientCard.vue
@@ -54,7 +54,6 @@
                ></el-avatar>
                <div class="satisfaction" v-if="!hideReviews">
                    <template v-if="client.satisfactionScore">
                        TODO:隱藏滿意度
                        <i class="icon-star pam-icon icon--yellow satisfaction"></i>
                        <span>{{client.satisfactionScore}}</span>
                    </template>
@@ -179,6 +178,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');
@@ -210,7 +210,10 @@
    updateMyAppointmentList!: (data: Appointment) => void;
    @appointmentStore.Action
    setAppointmentDetail!: (appointmentId: number) => Promise<Appointment>;
    getAppointmentDetail!: (appointmentId: number) => Promise<Appointment>;
    @appointmentStore.Action
    updateAppointmentDetail!: (id: number) => Appointment;
    @appointmentStore.Getter
    appointmentProgress!: ContactStatus;
@@ -256,7 +259,11 @@
    //////////////////////////////////////////////////////////////////////
    viewAppointmentDetail(): void {
      this.setAppointmentDetail(this.client.id).then((_) => {
      this.getAppointmentDetail(this.client.id).then((_) => {
        const unread = !this.client.consultantReadTime;
        if (unread) {
          this.readAppointment();
        }
        this.$router.push(`/appointment/${this.client.id}`);
      });
    }
@@ -266,11 +273,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 +300,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 +464,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 +519,7 @@
        display: flex;
    }
    .invite-msg{
      width: 96px;
      color: $PRIMARY_RED;
      @extend .text--underline;
    }