| | |
| | | <template> |
| | | <div> |
| | | <div class="interview-msg-component"> |
| | | <el-dialog |
| | | :visible.sync="dialogVisible" |
| | | :width="dialogWidth" |
| | |
| | | |
| | | <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> |
| | |
| | | </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; |
| | |
| | | return; |
| | | } |
| | | |
| | | interviewTime = ''; |
| | | interviewTxt = ''; |
| | | isShowSuccessAlert = false; |
| | | |
| | | contactStatus = ContactStatus; |
| | | |
| | | interviewTxt = ""; |
| | | interviewTime = ''; |
| | | ////////////////////////////////////////////////////////////////////// |
| | | |
| | | addInterview() { |
| | |
| | | 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; |
| | |
| | | font-size: 20px; |
| | | padding:10px; |
| | | text-align: justify; |
| | | font-weight: 500; |
| | | font-weight: 600; |
| | | } |
| | | .msg-dialog-btn{ |
| | | margin-top: 30px; |
| | |
| | | flex-direction: column; |
| | | align-items: center; |
| | | } |
| | | } |
| | | </style> |