| | |
| | | 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'); |
| | |
| | | |
| | | @appointmentStore.Action |
| | | getAppointmentDetail!: (appointmentId: number) => Promise<Appointment>; |
| | | |
| | | @appointmentStore.Action |
| | | updateAppointmentDetail!: (id: number) => Appointment; |
| | | |
| | | @appointmentStore.Getter |
| | | appointmentProgress!: ContactStatus; |
| | |
| | | |
| | | viewAppointmentDetail(): void { |
| | | this.getAppointmentDetail(this.client.id).then((_) => { |
| | | const unread = !this.client.consultantReadTime; |
| | | if (unread) { |
| | | this.readAppointment(); |
| | | } |
| | | this.$router.push(`/appointment/${this.client.id}`); |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | 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() { |
| | |
| | | } |
| | | |
| | | 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() { |
| | | this.storageClearAppointmentIdFromMsg(); |
| | | this.$router.push({query: {}}); |