| | |
| | | |
| | | <script lang='ts'> |
| | | import { Vue, Component, Watch, State, Action } from 'nuxt-property-decorator'; |
| | | import { Consultant, ConsultantWithAppointmentId } from '~/assets/ts/models/consultant.model'; |
| | | import { Consultant, ConsultantWithAppointmentId } from '~/shared/models/consultant.model'; |
| | | |
| | | @Component |
| | | export default class myConsultantList extends Vue { |
| | |
| | | |
| | | @Action |
| | | storeConsultantList!: any; |
| | | |
| | | @Watch('myConsultantList') |
| | | onMyConsultantListChange() { |
| | | this.setList(); |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | @Watch('myConsultantList') |
| | | onMyConsultantListChange() { |
| | | this.setList(); |
| | | } |
| | | |
| | | clickTab(path: string) { |
| | | this.activeTabName = path; |
| | |
| | | ...consultant, |
| | | appointmentId: appointment.id, |
| | | appointmentDate: appointment.appointmentDate, |
| | | appointmentScore: appointment.satisfactionScore |
| | | appointmentScore: appointment.satisfactionScore, |
| | | appointmentStatus: appointment.communicateStatus, |
| | | }; |
| | | this.contactedList.push(consultantWithAppointmentId); |
| | | }) |
| | | }); |
| | | |
| | | this.contactedList = this.contactedList |
| | | .filter((appointment) => appointment['contactStatus'] === 'contacted') |
| | | .filter((appointment) => appointment['appointmentStatus'] === 'contacted') |
| | | .map((appointment) => ({ ...appointment, sortTime: new Date(appointment.appointmentDate)})) |
| | | .sort((preAppointment, nextAppointment) => +nextAppointment.sortTime - +preAppointment.sortTime); |
| | | } |