保誠-保戶業務員媒合平台
Mila
2021-12-13 544f91e63a01f37e7b79db99609eec99b1afafd9
PAMapp/components/Consultant/ConsultantCard.vue
@@ -11,7 +11,8 @@
                            :fileName="avatarFileName"
                            @click.native="showAgentDetail(agentInfo.agentNo)"
                        ></UiAvatar>
                        <div>
                            <!-- TODO:隱藏滿意度 -->
                        <div v-if="!hideReviews">
                            <i class="icon-star pam-icon icon--yellow satisfaction"  v-if="!(latestContactedAppointment && !latestContactedAppointment.satisfactionScore)"></i>
                            <span v-if="agentInfo.contactStatus === 'contacted' && latestContactedAppointment && latestContactedAppointment.satisfactionScore">
                                {{ latestContactedAppointment && latestContactedAppointment.satisfactionScore}}
@@ -45,7 +46,7 @@
                            @click="reserveCommunication"
                            :class="agentInfo.contactStatus + 'Btn'"
                        >{{ contactTxt }}</el-button>
                        <div class="updateTime">
                        <div class="updateTime mt-10">
                            {{ displayTime | formatDate }}
                        </div>
                    </el-col>
@@ -74,14 +75,14 @@
                        :key="index"
                    >連絡時段{{index + 1 | formatNumber}}:{{ item | formatHopeContactTime }}</p>
                    <div v-if="appointmentDetail.satisfactionScore">
                        <div class="mdTxt mt-10 mb-10">滿意度</div>
                            <el-rate
                            :value="appointmentDetail.satisfactionScore"
                            class="pam-myDemand-dialog__rate"
                            disabled>
                            </el-rate>
                        </div>
                      <div class="mdTxt mt-10 mb-10">滿意度</div>
                      <el-rate
                      :value="appointmentDetail.satisfactionScore"
                      class="pam-myDemand-dialog__rate"
                      disabled>
                      </el-rate>
                    </div>
                  </div>
                <div v-if="agentInfo.contactStatus === 'contacted'
                        && !appointmentDetail.satisfactionScore" class="dialogInfo-btn">
@@ -127,6 +128,7 @@
import { Consultant, Appointment } from '~/assets/ts/models/consultant.model';
import { isMobileDevice } from '~/assets/ts/device';
import { Role } from '~/assets/ts/models/enum/Role';
import { hideReviews } from '~/assets/ts/const/hide-reviews';
const roleStorage = namespace('localStorage');
@Component({
@@ -160,6 +162,7 @@
    width: string = '';
    inputScore = 0;
    isCancelPopup = false;
    hideReviews = hideReviews;
    get latestContactedAppointment(): Appointment | null {
        if (!(this.agentInfo && this.agentInfo.appointments && this.agentInfo.appointments.length)) return null;
@@ -173,27 +176,30 @@
        return this.agentInfo.appointments!
                .filter((appointment) => appointment.communicateStatus !== 'contacted')
                .map((reversedAppointment) => {
                  return {
                    return {
                    ...reversedAppointment,
                    sortDate: new Date(reversedAppointment.appointmentDate)
                  }
                    }
                })
                .sort((preAppointment, nextAppointment) => +nextAppointment.sortDate - +preAppointment.sortDate)[0];
    }
    get displayTime(): string {
        let time = '';
        let time: Date | string = '';
        switch(this.agentInfo.contactStatus) {
            case 'reserved':
                time = this.agentInfo.updateTime
                time = this.agentInfo.updateTime
                break;
            case 'contacted':
                time = this.agentInfo.updateTime
                time = this.agentInfo.updateTime
                break;
            case 'picked':
                time = this.agentInfo.createTime
                time = this.agentInfo.createTime
                break;
        }
        return time;
        if (typeof time !== 'string') {
          time.toString();
        }
        return time as string;
    }
    appointmentDetail: any = {