保誠-保戶業務員媒合平台
HelenHuang
2022-01-19 3447156467d183d0b5060c174092720acd4ca9a4
PAMapp/components/Interview/InterviewMsg.vue
@@ -1,5 +1,5 @@
<template>
  <div>
  <div class="interview-msg-component">
    <el-dialog
      :visible.sync="dialogVisible"
      :width="dialogWidth"
@@ -14,10 +14,10 @@
      <el-input
        type="textarea"
        :rows="9"
        autosize="true"
        placeholder="約訪通知"
        resize="none"
        v-model="interviewTxt">
        v-model="isInterviewTxt">
        </el-input>
      <div class="mdTxt mt-30 mb-10">預計約訪時段</div>
@@ -41,29 +41,16 @@
  </div>
</template>
<script lang="ts">
import { Vue, Component, Prop, PropSync, Emit, namespace } from 'nuxt-property-decorator';
import { Vue, Component, Prop, PropSync, Emit, Action } from 'nuxt-property-decorator';
import appointmentService from '~/shared/services/appointment.service';
import { Appointment, ToInformAppointment } from '~/shared/models/appointment.model';
import { ContactStatus } from '~/shared/models/enum/contact-status';
const appointmentStore = namespace('appointment.store');
@Component
export default class InterviewMsg extends Vue {
    @appointmentStore.Action
    getMyAppointmentList!: () => Promise<Appointment[]>;
    @appointmentStore.Action
    updateMyAppointmentList!:(appointment: Appointment) => Appointment[];
    @appointmentStore.Action
    updateAppointmentDetail!: (appointmentId: number) => Promise<Appointment>;
    @appointmentStore.State
    appointmentDetail!: Appointment;
    @Action
    storeMyAppointmentList!: () => Promise<number>;
    @PropSync('isVisible')
    dialogVisible!: boolean;
@@ -79,12 +66,10 @@
        return;
    }
    interviewTime      = '';
    interviewTxt       = '';
    isShowSuccessAlert = false;
    contactStatus = ContactStatus;
    interviewTxt = "";
    interviewTime = '';
    //////////////////////////////////////////////////////////////////////
    addInterview() {
@@ -95,28 +80,27 @@
        message      : this.interviewTxt,
        phone        : this.client?.phone,
      };
      appointmentService.informAppointment(appointmentInformation).then((_) => {
        this.isShowSuccessAlert = true ;
        const updatedAppointment = {
          ...this.appointmentDetail,
          communicateStatus: this.contactStatus.CONTACTED,
        };
        this.updateMyAppointmentList(updatedAppointment);
        this.updateAppointmentDetail(updatedAppointment.id);
      });
    }
    closeAllDialog() {
      this.isShowSuccessAlert = false ;
      this.dialogVisible = false;
      this.getMyAppointmentList();
      this.storeMyAppointmentList();
    }
    get isInterviewTxt() : string{
      return this.interviewTxt = "您好!我是保誠媒合平台的保險顧問" + "agentName"+",感謝您的預約!我預計會在下述的時間與您聯繫"+"\n"+"以下是我的電話號碼/Email:"+"\n"+"agentPhone"+"\n"+"agentEmail"+"\n"+"若此時間不方便,請與我聯繫!謝謝!"
    }
}
</script>
<style lang="scss" scoped>
<style lang="scss" >
.interview-msg-component{
.msg-dialog-title{
  display: flex;
  justify-content: center;
@@ -136,7 +120,7 @@
  font-size: 20px;
  padding:10px;
  text-align: justify;
  font-weight: 500;
    font-weight: 600;
}
.msg-dialog-btn{
  margin-top: 30px;
@@ -148,4 +132,5 @@
    flex-direction: column;
    align-items: center;
  }
}
</style>