| | |
| | | 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, |
| | |
| | | const isAppointment = !!this.agentInfo['appointmentStatus']; |
| | | const appointmentId = isAppointment |
| | | ? this.agentInfo['appointmentId'] |
| | | : this.latestReservedAppointment.id; |
| | | : this.latestNotClosedAppointment.id; |
| | | |
| | | appointmentService.getAppointmentDetail(appointmentId!).then(res => { |
| | | this.appointmentDetail = { |
| | |
| | | const isAppointment = !!this.agentInfo['appointmentStatus']; |
| | | const appointmentId = isAppointment |
| | | ? this.agentInfo['appointmentId'] |
| | | : this.latestReservedAppointment.id; |
| | | : this.latestNotClosedAppointment.id; |
| | | |
| | | const reviewParams: UserReviewsConsultantsParams = { |
| | | appointmentId: appointmentId, |
| | |
| | | } |
| | | |
| | | cancel() { |
| | | appointmentService.cancelAppointment(this.latestReservedAppointment.id).then(res => { |
| | | appointmentService.cancelAppointment(this.latestNotClosedAppointment.id).then(res => { |
| | | this.storeConsultantList(); |
| | | this.isVisibleDialog = false; |
| | | this.isCancelPopup = false; |