From 387523be22e05114d850d2e0fe73c368f471e3d7 Mon Sep 17 00:00:00 2001 From: Jack <jack.su@pollex.com.tw> Date: 星期四, 20 一月 2022 09:26:38 +0800 Subject: [PATCH] [BUG] 沒有結案資訊會導致出錯的問題修復 --- PAMapp/components/Client/ClientCard.vue | 34 ++++++++++++++++++++-------------- 1 files changed, 20 insertions(+), 14 deletions(-) diff --git a/PAMapp/components/Client/ClientCard.vue b/PAMapp/components/Client/ClientCard.vue index 2f04309..f203dd0 100644 --- a/PAMapp/components/Client/ClientCard.vue +++ b/PAMapp/components/Client/ClientCard.vue @@ -170,17 +170,19 @@ </template> <script lang="ts"> -import { Vue, Component, Prop, Action, namespace, Watch } from 'nuxt-property-decorator'; +import { Vue, Component, Prop, namespace, Watch } from 'nuxt-property-decorator'; import appointmentService from '~/shared/services/appointment.service'; import myConsultantService from '~/shared/services/my-consultant.service'; import UtilsService from '~/shared/services/utils.service'; import { hideReviews } from '~/shared/const/hide-reviews'; import { ElRow } from 'element-ui/types/row'; -import { Appointment, AppointmentMemoInfo, ToInformAppointment } from '~/shared/models/appointment.model'; +import { Appointment, AppointmentMemoInfo } from '~/shared/models/appointment.model'; import { ContactStatus } from '~/shared/models/enum/contact-status'; -const localStorage = namespace('localStorage'); +const appointmentStore = namespace('appointment.store'); +const localStorage = namespace('localStorage'); + @Component({ filters: { formatNumber(index: number) { @@ -201,11 +203,17 @@ } }) export default class ClientList extends Vue { - @Action - updateMyAppointment!: (data: Appointment) => void; - @Prop() client!: Appointment; + + @appointmentStore.Action + updateMyAppointmentList!: (data: Appointment) => void; + + @appointmentStore.Action + getAppointmentDetail!: (appointmentId: number) => Promise<Appointment>; + + @appointmentStore.Getter + appointmentProgress!: ContactStatus; @localStorage.Mutation storageClearAppointmentIdFromMsg!: () => void; @@ -248,7 +256,9 @@ ////////////////////////////////////////////////////////////////////// viewAppointmentDetail(): void { - this.$router.push(`/appointment/${this.client.id}`); + this.getAppointmentDetail(this.client.id).then((_) => { + this.$router.push(`/appointment/${this.client.id}`); + }); } showAddInterviewDialog(): void { @@ -257,10 +267,6 @@ navigateToCloseAppointment(): void { this.$router.push(`/appointment/${this.client.id}/close`); - } - - makeAppointment(): void { - alert('MAKE AN APPOINTMENT!'); } inviteReview(): void { @@ -277,7 +283,7 @@ markAppointment() { myConsultantService.markAsContact(this.client.id).then(data => { - this.updateMyAppointment(data); + this.updateMyAppointmentList(data); this.isShowInformDialog = false; }) } @@ -288,7 +294,7 @@ appointmentService.recordRead(this.client.id).then((_) => { const updatedClient = {...this.client}; updatedClient.consultantReadTime = new Date().toString(); - this.updateMyAppointment(updatedClient); + this.updateMyAppointmentList(updatedClient); }); }; this.isEdit = false; @@ -349,7 +355,7 @@ this.memo = this.memoInfo.content; } - get newAppointment(): boolean { + get newAppointment(): boolean { return !this.client.consultantViewTime && this.client.communicateStatus === 'reserved'; } -- Gitblit v1.9.3