保誠-保戶業務員媒合平台
Tomas
2021-12-08 dd843d7db8b7a3c713e82a828f687b1ade144bbb
fixed: cousultant-card 預約單 id 判斷錯誤
修改1個檔案
16 ■■■■ 已變更過的檔案
PAMapp/components/Consultant/ConsultantCard.vue 16 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/Consultant/ConsultantCard.vue
@@ -168,7 +168,13 @@
    get latestReservedAppointment(): Appointment {
        return this.agentInfo.appointments!
                .filter((appointment) => appointment.communicateStatus !== 'contacted')
                .sort((preAppointment, nextAppointment) => +nextAppointment.appointmentDate - +preAppointment.appointmentDate)[0];
                .map((reversedAppointment) => {
                  return {
                    ...reversedAppointment,
                    sortDate: new Date(reversedAppointment.appointmentDate)
                  }
                })
                .sort((preAppointment, nextAppointment) => +nextAppointment.sortDate - +preAppointment.sortDate)[0];
    }
    appointmentDetail: any = {
@@ -236,9 +242,11 @@
    }
    openPopUp() {
        getAppointmentDetail(this.latestContactedAppointment
                            ? this.latestContactedAppointment.id
                            : this.latestReservedAppointment.id).then(res => {
      const appointmentId = this.agentInfo.contactStatus === 'contacted'
                          ? this.latestContactedAppointment?.id
                          : this.latestReservedAppointment.id;
        getAppointmentDetail(appointmentId!).then(res => {
            this.appointmentDetail = {
                ...this.appointmentDetail,
                ...res.data