| | |
| | | @State('myAppointmentList') |
| | | myAppointmentList!: ClientInfo[]; |
| | | |
| | | @Watch('myAppointmentList') |
| | | onMyAppointmentListChange() { |
| | | this.contactedList = this.myAppointmentList |
| | | .filter(item => item.communicateStatus === 'contacted'); |
| | | |
| | | this.appointmentList = this.myAppointmentList |
| | | .filter(item => item.communicateStatus !== 'contacted'); |
| | | } |
| | | |
| | | @State('myNewAppointmentSum') |
| | | newAppointmentSum!: number; |
| | | |
| | | @Watch('newAppointmentSum') |
| | | newAppointmentSumChange(): void { |
| | | this.showNewAppointmentHint = this.newAppointmentSum > 0; |
| | | } |
| | | @Action |
| | | storeMyAppointmentList!: () => Promise<number>; |
| | | |
| | | activeTabName = 'appointmentList'; |
| | | activeTabName : string = 'appointmentList'; |
| | | appointmentList: ClientInfo[] = []; |
| | | contactedList: ClientInfo[] = []; |
| | | clients: ClientInfo[] = []; |
| | | showNewAppointmentHint = false; |
| | | |
| | | get bannerClassName() { |
| | | const routeName = this.$route.name || ''; |
| | | return this.routeFormatBannerClass(routeName); |
| | | }; |
| | | contactedList : ClientInfo[] = []; |
| | | showNewAppointmentHint: boolean = false; |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | |
| | | this.storeMyAppointmentList(); |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | @Action |
| | | storeMyAppointmentList!: () => Promise<number>; |
| | | |
| | | |
| | | clickTab(path: string): void { |
| | | this.activeTabName = path; |
| | | this.$router.push(`/myAppointmentList/${this.activeTabName}`); |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | // format to {page}-banner or pam-no-banner tag |
| | | private routeFormatBannerClass(route: string): string { |
| | | const needBannerTags = ['myAppointmentList-appointmentList', 'myAppointmentList-contactedList']; |
| | | return _.includes(needBannerTags, route) ? route + '-banner' : 'pam-no-banner'; |
| | | }; |
| | | |
| | | private setActivatedTab(): void { |
| | | const routeFullName = this.$route.name; |
| | | if (routeFullName) { |
| | |
| | | } |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | @Watch('myAppointmentList') |
| | | onMyAppointmentListChange(): void { |
| | | this.contactedList = this.myAppointmentList |
| | | .filter(item => item.communicateStatus === 'contacted'); |
| | | |
| | | this.appointmentList = this.myAppointmentList |
| | | .filter(item => item.communicateStatus !== 'contacted'); |
| | | } |
| | | |
| | | @Watch('newAppointmentSum') |
| | | newAppointmentSumChange(): void { |
| | | this.showNewAppointmentHint = this.newAppointmentSum > 0; |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | clickTab(path: string): void { |
| | | this.activeTabName = path; |
| | | this.$router.push(`/myAppointmentList/${this.activeTabName}`); |
| | | } |
| | | |
| | | get bannerClassName() { |
| | | const routeName = this.$route.name || ''; |
| | | return this.routeFormatBannerClass(routeName); |
| | | }; |
| | | |
| | | // format to {page}-banner or pam-no-banner tag |
| | | private routeFormatBannerClass(route: string): string { |
| | | const needBannerTags = ['myAppointmentList-appointmentList', 'myAppointmentList-contactedList']; |
| | | return _.includes(needBannerTags, route) ? route + '-banner' : 'pam-no-banner'; |
| | | }; |
| | | } |
| | | </script> |
| | | |