| | |
| | | </div> |
| | | <div |
| | | class="cus-tab-item" |
| | | :class="{'is-active': activeTabName === 'onProgressList'}" |
| | | @click="clickTab('onProgressList')" |
| | | :class="{'is-active': activeTabName === 'contactedList'}" |
| | | @click="clickTab('contactedList')" |
| | | > |
| | | <span class="smTxt">約訪中({{ appointmentList.length }})</span> |
| | | </div> |
| | | <div |
| | | class="cus-tab-item" |
| | | :class="{'is-active': activeTabName === 'contactedList'}" |
| | | @click="clickTab('contactedList')" |
| | | :class="{'is-active': activeTabName === 'closedList'}" |
| | | @click="clickTab('closedList')" |
| | | > |
| | | <span class="smTxt">結案({{ contactedList.length }})</span> |
| | | <span class="smTxt">結案({{ closedList.length }})</span> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | import * as _ from 'lodash'; |
| | | |
| | | import { Appointment } from '~/shared/models/appointment.model'; |
| | | import { ContactStatus } from '~/shared/models/enum/contact-status'; |
| | | |
| | | const localStorage = namespace('localStorage'); |
| | | |
| | |
| | | @localStorage.Getter |
| | | currentAppointmentIdFromMsg!: string; |
| | | |
| | | activeTabName : string = 'appointmentList'; |
| | | appointmentList : Appointment[] = []; |
| | | clients : Appointment[] = []; |
| | | contactedList : Appointment[] = []; |
| | | showNewAppointmentHint: boolean = false; |
| | | activeTabName : string = 'appointmentList'; |
| | | appointmentList : Appointment[] = []; |
| | | contactedList : Appointment[] = []; |
| | | closedList : Appointment[] = []; |
| | | contactStatus = ContactStatus; |
| | | showNewAppointmentHint: boolean = false; |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | |
| | | |
| | | @Watch('myAppointmentList') |
| | | onMyAppointmentListChange(): void { |
| | | this.contactedList = this.myAppointmentList |
| | | .filter(item => item.communicateStatus === 'contacted'); |
| | | |
| | | this.appointmentList = this.myAppointmentList |
| | | .filter(item => item.communicateStatus !== 'contacted'); |
| | | |
| | | .filter(item => item.communicateStatus === this.contactStatus.RESERVED); |
| | | this.contactedList = this.myAppointmentList |
| | | .filter((item) => item.communicateStatus === this.contactStatus.CONTACTED); |
| | | this.closedList = this.myAppointmentList |
| | | .filter(item => item.communicateStatus === this.contactStatus.DONE || item.communicateStatus === this.contactStatus.CLOSE ); |
| | | if (this.currentAppointmentIdFromMsg) { |
| | | this.redirectAppointmentStatus(); |
| | | } |
| | | } |
| | | |
| | | // TODO: 調整程式碼 [Tomas, 2022/1/14 12:02] |
| | | private redirectAppointmentStatus() { |
| | | const currentAppointmentIndex = this.myAppointmentList |
| | | .findIndex(item => item.id === +this.currentAppointmentIdFromMsg); |
| | | if (currentAppointmentIndex > -1) { |
| | | const communicateStatus = this.myAppointmentList[currentAppointmentIndex].communicateStatus; |
| | | const pathName = communicateStatus === 'reserved' ? 'appointmentList' : 'contactedList'; |
| | | const pathName = communicateStatus === 'reserved' ? 'appointmentList' : 'closedList'; |
| | | this.$router.push( |
| | | { |
| | | path: '/myAppointmentList/' + pathName, |
| | |
| | | |
| | | // format to {page}-banner or pam-no-banner tag |
| | | private routeFormatBannerClass(route: string): string { |
| | | const needBannerTags = ['myAppointmentList-appointmentList', 'myAppointmentList-contactedList']; |
| | | const needBannerTags = ['myAppointmentList-appointmentList', 'myAppointmentList-closedList']; |
| | | return _.includes(needBannerTags, route) ? route + '-banner' : 'pam-no-banner'; |
| | | }; |
| | | } |