From 9f843e9978cc4bff79e515a6ab929154d904fa46 Mon Sep 17 00:00:00 2001 From: HelenHuang <LinHuang@pollex.com.tw> Date: 星期五, 14 一月 2022 13:06:40 +0800 Subject: [PATCH] Merge branch 'Phase3' of https://dev.pollex.com.tw:8443/r/pcalife/PAM into Phase3 --- PAMapp/pages/myAppointmentList.vue | 37 ++++++++++++++++++++----------------- 1 files changed, 20 insertions(+), 17 deletions(-) diff --git a/PAMapp/pages/myAppointmentList.vue b/PAMapp/pages/myAppointmentList.vue index 286ea92..0ced7e5 100644 --- a/PAMapp/pages/myAppointmentList.vue +++ b/PAMapp/pages/myAppointmentList.vue @@ -12,17 +12,17 @@ </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> @@ -53,6 +53,7 @@ import * as _ from 'lodash'; import { Appointment } from '~/shared/models/appointment.model'; +import { ContactStatus } from '~/shared/models/enum/contact-status'; const localStorage = namespace('localStorage'); @@ -77,11 +78,12 @@ @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; ////////////////////////////////////////////////////////////////////// @@ -97,23 +99,24 @@ @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, @@ -150,7 +153,7 @@ // 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'; }; } -- Gitblit v1.8.0