From ffcf1c449974fffad5e827ab0dd2d3bb21327d5f Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期六, 05 八月 2023 17:46:45 +0800
Subject: [PATCH] Fixed: [弱掃] p13.2 Bad use of null-like value

---
 PAMapp/components/Interview/InterviewMsg.vue |   46 ++++++++++++++++++++++++++++++----------------
 1 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/PAMapp/components/Interview/InterviewMsg.vue b/PAMapp/components/Interview/InterviewMsg.vue
index bb25cf7..ac9f657 100644
--- a/PAMapp/components/Interview/InterviewMsg.vue
+++ b/PAMapp/components/Interview/InterviewMsg.vue
@@ -44,7 +44,7 @@
         <div class="interviewContent">
           <div style="padding:10px;line-height:25px">
             <i class="content">�憟踝��靽���像����憿批�{loginConsultant.name}}嚗��������</i><br/>
-            <el-input type="textarea" :placeholder="'\{{ 憒����������ㄐ憿舐內 }}'" resize="none" v-model="interviewContent.customContent" readonly autosize="true" ></el-input><br/>
+            <el-input type="textarea" :placeholder="'\{{ 憒����������ㄐ憿舐內 }}'" resize="none" v-model="interviewContent.customContent" readonly :autosize="true" ></el-input><br/>
             <i class="content">{{client.phone ||defaultValue ? ("�����銝膩������蝜�"+ "\n" + (this.interviewContent.formattedInterviewTime || "(撠����赤��挾)")): ""}}</i><br/>
               <i class="content">隞乩����閰梯�Ⅳ/Email嚗{loginConsultant.phoneNumber || '撠���閰梯�Ⅳ'}} / {{loginConsultant.email || '撠���� Email'}}</i><br/>
               <i class="content">�甇斗���靘選����蝜恬�����</i>
@@ -117,15 +117,28 @@
     interviewTxt = '';
 
     @Watch('interviewContent', { immediate: true, deep: true })
-    onInterviewContentChange(): void {
+    onInterviewContentChange() {
       if (this.interviewContent.addContactInfo) {
         if (this.interviewContent.interviewTime) {
           const targetDate = new Date(this.interviewContent.interviewTime);
           this.interviewContent.formattedInterviewTime = `${targetDate.getFullYear()}撟�${targetDate.getMonth() + 1}���${targetDate.getDate()}� ${targetDate.getHours()}���${targetDate.getMinutes()}��;
         }
-        this.interviewTxt = "�憟踝��靽���像����憿批��"+this.loginConsultant.name+"嚗��������"+"\n"+this.interviewContent.customContent+ "\n" ��+ ( this.client.phone || this.defaultValue ? ("�����銝膩������蝜�"+ "\n" + (this.interviewContent.formattedInterviewTime || "(撠����赤��挾)")): "") + "\n" +"隞乩����閰梯�Ⅳ/Email嚗�"+"\n" + (this.loginConsultant.phoneNumber || '(撠���閰梯�Ⅳ)') + "\n" + (this.loginConsultant.email|| '撠���� Email') + "\n"  +"�甇斗���靘選����蝜恬�����";
+        if(this.loginConsultant.phoneNumber){
+          let temp = '';
+          for (var i=0;i<this.loginConsultant.phoneNumber.length;i++) {
+            let charCode = this.loginConsultant.phoneNumber.charCodeAt(i);
+            if(charCode <=126 && charCode>= 33) {
+              charCode += 65248;
+            } else if (charCode ===32) {
+              charCode =12288;
+            }
+            temp = temp + String.fromCharCode(charCode);
+          }
+          this.interviewTxt = "�憟踝��靽���像����憿批��"+this.loginConsultant.name+"嚗��������"+"\n"+this.interviewContent.customContent+ "\n" ��+ ( this.client.phone || this.defaultValue ? ("�����銝膩������蝜�"+ "\n" + (this.interviewContent.formattedInterviewTime || "(撠����赤��挾)")): "") + "\n" +"隞乩����閰梯�Ⅳ/Email嚗�"+"\n" + ( temp || '(撠���閰梯�Ⅳ)') + "\n" + (this.loginConsultant.email|| '撠���� Email') + "\n"  +"�甇斗���靘選����蝜恬�����";
+        }
       } else {
-        this.interviewTxt = this.interviewContent.customContent;
+        // this.interviewTxt = this.interviewContent.customContent;
+        this.interviewTxt = "�憟踝��靽���像����憿批��"+this.loginConsultant.name+"嚗��������"+"\n"+this.interviewContent.customContent+ "\n" ��+ ( this.client.phone || this.defaultValue ? ("�����銝膩������蝜�"+ "\n" + (this.interviewContent.formattedInterviewTime || "(撠����赤��挾)")): "") + "\n" +"隞乩����mail嚗�"+"\n" + (this.loginConsultant.email|| '撠���� Email') + "\n"  +"�甇斗���靘選����蝜恬�����";
       }
     }
 
@@ -142,18 +155,19 @@
       this.interviewContent.customContent ='';
     }
 
-    addInterview() {
-      const appointmentInformation: ToInformAppointment = {
-        appointmentId: this.client.id,
-        email        : this.client?.email,
-        interviewDate: this.interviewContent.interviewTime,
-        message      : this.interviewTxt,
-        phone        : this.client?.phone,
-      };
-      appointmentService.informAppointment(appointmentInformation).then((_) => {
-        this.isShowSuccessAlert = true ;
-      });
-    }
+  addInterview() {
+    const appointmentInformation: ToInformAppointment = {
+      appointmentId: this.client?.id || 0,
+      email: this.client?.email || '',
+      interviewDate: this.interviewContent.interviewTime,
+      message: this.interviewTxt,
+      phone: this.client?.phone || '',
+    };
+    appointmentService.informAppointment(appointmentInformation).then((_) => {
+      this.isShowSuccessAlert = true;
+    });
+  }
+
 
     closeAllDialog() {
       this.isShowSuccessAlert = false ;

--
Gitblit v1.8.0