保誠-保戶業務員媒合平台
wayne
2022-01-26 6fa4bba623713c396432ba8b863846883d6a1906
PAMapp/pages/myConsultantList.vue
@@ -27,6 +27,8 @@
<script lang='ts'>
import { Vue, Component, Watch, State, Action } from 'nuxt-property-decorator';
import authService from '~/shared/services/auth.service';
import { Consultant, ConsultantWithAppointmentId } from '~/shared/models/consultant.model';
@Component
@@ -78,7 +80,7 @@
        .map((item) => ({ ...item, formatDate: new Date(item.updateTime || item.createTime)}))
        .sort((preItem, nextItem) => +nextItem.formatDate - +preItem.formatDate );
    // format contacted list
      if (authService.isUserLogin()) {
      this.myConsultantList.filter((consultant) => consultant.appointments!.length)
        .forEach((consultant) => {
          consultant.appointments!.forEach((appointment) => {
@@ -94,11 +96,13 @@
        });
      this.contactedList = this.contactedList
        .filter((appointment) => appointment['appointmentStatus'] === 'contacted')
          .filter((appointment) => appointment['appointmentStatus'] !== 'reserved')
        .map((appointment) => ({ ...appointment, sortTime: new Date(appointment.appointmentDate)}))
        .sort((preAppointment, nextAppointment) => +nextAppointment.sortTime - +preAppointment.sortTime);
    }
    }
    //////////////////////////////////////////////////////////////////////
    clickTab(path: string) {