保誠-保戶業務員媒合平台
Tomas
2021-11-26 9209e46a91f6a255ddfb1dc1db3a02dd2b349663
fixed: npm run generate fail
修改3個檔案
189 ■■■■ 已變更過的檔案
PAMapp/assets/ts/api/consultant.ts 73 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/careerSelect.vue 24 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/questionnaire/_agentNo.vue 92 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/assets/ts/api/consultant.ts
@@ -104,50 +104,53 @@
    return service.get('/appointment/getDetail/'+apointmentId, {headers})
}
export interface Consultants {
    agentNo: string,
    name: string,
    img: string,
    new: boolean,
    avgScore: number,
    expertise: string[],
    updateTime: Date,
    seniority: string,
    contactStatus?: string;
    agentNo            : string,
    name               : string,
    img                : string,
    new                : boolean,
    avgScore           : number,
    expertise          : string[],
    updateTime         : Date,
    seniority          : string,
    contactStatus?     : string;
    latestAppointmentId: number;
    role: string;
    image?: string;
    expertises?: string;
    role               : string;
    image?             : string;
    expertises?        : string;
}
export interface FastQueryParams {
    gender: string,
    gender             : string,
    communicationStyles: string[],
    avgScore: number,
    status: string
    avgScore           : number,
    status             : string
}
export interface AppointmentRequests {
    phone:string,
    email:string,
    contactType:string,
    gender:string,
    age:string,
    job:string,
    requirement:string,
    hopeContactTime:string[],
    otherRequirement:string,
    agentNo:string,
    phone          : string,
    email          : string,
    contactType    : string,
    gender         : string,
    age            : string,
    job            : string,
    requirement    : string[],
    hopeContactTime: ContactTime[],
    agentNo        : string,
}
export interface ContactTime {
  selectWeekOptions : string[],
  selectTimesOptions: string[]
}
export interface AppointmentParams {
    phone?: string,
    email?: string,
    contactType: string,
    gender?: string,
    age?: string,
    job?: string,
    requirement: string,
    hopeContactTime?: string,
    agentNo: string
    phone          : string,
    email          : string,
    contactType    : string,
    gender         : string,
    age            : string,
    job            : string,
    requirement    : string,
    hopeContactTime: string,
    agentNo        : string
}
export interface StrictQueryParams{
    gender:           string;
@@ -208,4 +211,4 @@
    name: string,
    /** "SMS":Otp發送手機,"EMAIL":Otp發email */
    contactType: string
}
}
PAMapp/components/careerSelect.vue
@@ -14,28 +14,28 @@
        <div class="pam-career">
          <div class="subTitle">職業</div>
          <el-radio-group class="pam-single__select--col" v-model="career" @change="handleChange">
            <el-radio-button v-for="(career,index) in options"
              :key="index"
            <el-radio-button v-for="(career,index) in options"
              :key="index"
              :label="career.label">
              {{career.title}}
            </el-radio-button>
          </el-radio-group>
          <div class="mt-10" v-if="career === '其他'">
            <input class="pam-career__other-input"
            <input class="pam-career__other-input"
              :class="{'warning':!career_Other}"
              v-model="career_Other" >
              v-model="career_Other" >
          </div>
          <el-button type="primary"
          <el-button type="primary"
            class="pam-career__confirm"
            :disabled="isCareerVerifyFailed"
            :disabled="isCareerVerifyFailed"
            @click="patchCareer">
              確定
          </el-button>
        </div>
      </PopUpFrame>
  </div>
</template>
<script lang="ts">
@@ -43,7 +43,7 @@
  import * as _ from 'lodash';
  @Component
  export default class CareerSelect extends Vue {
    @PropSync('careerSelect',{ type: String, default :''}) syncCareerSelect :string;
    @PropSync('careerSelect',{ type: String, default :''}) syncCareerSelect! :string;
    showJobDrawer = false;
    career='';
    career_Other='';
@@ -62,7 +62,7 @@
      }
    ];
    get isCareerVerifyFailed():boolean{
      return !this.career || (_.isEqual(this.career,'其他')&&!this.career_Other) ;
      return !this.career || (_.isEqual(this.career,'其他')&&!this.career_Other) ;
    }
    handleChange(event:any):void{
      if(event !== '其他'){
@@ -83,7 +83,7 @@
          this.career = '其他';
          this.career_Other = this.syncCareerSelect;
        }
      }
      }
    }
    patchCareer():boolean {
@@ -146,4 +146,4 @@
    margin-top: 30px;
  }
</style>
</style>
PAMapp/pages/questionnaire/_agentNo.vue
@@ -2,7 +2,9 @@
  <div class="ques-page--reset">
    <div class="ques-header">
        <div class="ques-header__mob-banner"></div>
        <div class="ques-header__info" v-if="myRequest.contactType==='phone'">
        <div
          class="ques-header__info"
          v-if="myRequest.contactType==='phone'">
          <div class="text--middle">
              <div class="mdTxt">你指定的聯繫方式</div>
              <div class="mt-10">
@@ -21,7 +23,7 @@
              <div class="mdTxt">其他備用聯繫方式</div>
              <div class="ques-header__input-block">
                  <span>Email:</span>
                  <input class="ques-header__input"
                  <input class="ques-header__input"
                    placeholder="請輸入"
                    v-model="myRequest.email">
              </div>
@@ -49,7 +51,7 @@
                <span v-show="!phoneValid">手機號碼格式有誤</span>
              </div>
          </div>
          <div class="mt-30" v-if="checkPhoneLength&&phoneValid">
          <div class="mt-30" v-if="phoneValid">
              <div class="datepicker">
                  <span class="mdTxt">手機連絡的方便時間</span>
                  <PhoneContactTimePicker
@@ -88,7 +90,7 @@
      </div>
      <div class="pam-paragraph ques-footer">
        <el-button type="primary"
          :disabled="isRequiredByInit || !phoneValid"
          :disabled="isDisabledSubmitBtn"
          @click.native="sentDemand">
          送出
        </el-button>
@@ -132,6 +134,7 @@
  import { Gender } from '~/assets/ts/models/enum/Gender';
  import { ContactType } from '~/assets/ts/models/enum/ContactType';
  import _ from 'lodash';
  @Component
  export default class Questionnaire extends Vue {
    genderOptions=[
@@ -144,6 +147,7 @@
        label:Gender.FEMALE,
      }
    ];
    requirementOptions=[
      {
        title:'健康與保障',
@@ -170,6 +174,7 @@
        label:'分紅保單相關',
      },
    ];
    ageRangeOptions=[
      {
        title:'20歲以下',
@@ -204,6 +209,7 @@
        label:'over_71',
      }
    ];
    quesAboutList = [
      {
        title:'健康與保障',
@@ -230,19 +236,20 @@
        content:'匹配度是透過嚴選配對或快速篩選後,將每一位保險顧問資料進行比對後排序推薦給您的媒合數值,您可以作為選擇適合顧問的參考值。'
      }
    ];
    myRequest= {
      phone:this.userInfo?.phone ? this.userInfo.phone :'',
      email:this.userInfo?.email ? this.userInfo.email :'',
      contactType:_.includes(this.userInfo.contactType,ContactType.SMS) ? ContactType.PHONE : ContactType.EMAIL  ,
    myRequest: AppointmentRequests = {
      phone: this.userInfo?.phone ? this.userInfo.phone :'',
      email: this.userInfo?.email ? this.userInfo.email :'',
      contactType: _.isEqual(this.userInfo.contactType,ContactType.SMS) ? ContactType.PHONE : ContactType.EMAIL  ,
      gender: '',
      age: '',
      job: '',
      requirement: [],
      hopeContactTime: [{
        selectWeekOptions:[],
        selectTimesOptions:[],
        selectWeekOptions: [],
        selectTimesOptions: [],
      }],
      agentNo:this.$route.params.agentNo,
      agentNo: this.$route.params.agentNo,
    };
    showDrawer= false;
@@ -254,42 +261,36 @@
        this.myRequest = storageMyRequest;
      }
    }
    get phoneValid():boolean{
    get phoneValid(): boolean {
      const rule = /^09[0-9]{8}$/;
      return this.myRequest.phone ? rule.test(this.myRequest.phone) : true;
      return this.myRequest.phone ? rule.test(this.myRequest.phone) && _.isEqual(this.myRequest.phone.length,10) : true;
    }
    get userInfo():RegisterInfo{
      const initUserInfo = JSON.parse(localStorage.getItem('userInfo'));
    get userInfo(): RegisterInfo {
      const initUserInfo = JSON.parse(localStorage.getItem('userInfo')!);
      return initUserInfo;
    }
    get isMainContractPhoneByLocalStorage():boolean{
      return true;
    get isDisabledSubmitBtn(): boolean {
           return _.includes(this.myRequest.contactType,ContactType.PHONE)
      ? !this.isHopeContactTimeDone()
      : !this.phoneValid;
    }
    get isRequiredByInit():boolean{
     return _.includes(this.myRequest.contactType,ContactType.PHONE)
      ? !this.isHopeContactTimeDone()
      :false;
    }
    get checkPhoneLength():boolean{
      return _.isEqual(this.myRequest.phone.length,10);
    }
    private isHopeContactTimeDone():boolean{
      return this.myRequest.hopeContactTime[0].selectWeekOptions.length >0 && this.myRequest.hopeContactTime[0].selectTimesOptions.length >0;
    }
    sentDemand() {
      addFavoriteConsultant([this.myRequest.agentNo]).then(res => this.sentAppointmentDemand());
    }
    private sentAppointmentDemand() {
        const data: AppointmentParams = {
          ...this.myRequest,
          requirement: _.map(this.myRequest.requirement,o=>o).toString(),
          hopeContactTime:this.phoneValid&&this.checkPhoneLength ? this.getHopeContactTime() :'',
          hopeContactTime:this.phoneValid ? this.getHopeContactTime() :'',
        };
        appointmentDemand(data).then(res => {
@@ -310,11 +311,6 @@
    }
  }
  export interface SelectedQuestion {
      name: string;
      selected: boolean;
  }
</script>
<style lang="scss" scoped>
@@ -325,14 +321,16 @@
    margin-bottom: 26px;
}
//drawer最底下文字樣式
.qa-dialog-footer{
    display: flex;
    justify-content: center;
    margin-bottom: 81px;
    color: #ED1B2E;
    cursor: pointer;
}//drawer最底下文字樣式
}
//送出按鈕樣式與排版
.ques-footer{
    justify-content: center;
    margin: 30px 0;
@@ -362,20 +360,22 @@
    border-style: solid;
    pointer-events: none;
    }
    }
}//送出按鈕樣式與排版
  }
}
//詳細問題drawer中間內容空間大小設置
.qa-dialog{
    overflow-y:auto;
    height: 500px;
    margin-top: 20px;
}//詳細問題drawer中間內容空間大小設置
}
//詳細問題drawer主要標題
.qaTextTitle{
    margin-top:30px;
    display: flex;
    justify-content: center;
}//詳細問題drawer主要標題
}
.el-button+.el-button{
    margin-left: 0;
@@ -396,13 +396,15 @@
    }
}
.ques-page--reset.pam-page-container{
.ques-page--reset.pam-page-container {
    margin: 0px auto;
}
.ques-header{
.ques-header {
    position: relative;
}
.ques-header__mob-banner{
.ques-header__mob-banner {
  width: 100%;
  min-height: 80px;
  background-color: #F8F9FA;
@@ -411,14 +413,16 @@
  background-size: cover;
  background-position: center;
}
.ques-header__info{
.ques-header__info {
  position: relative;
  padding:30px 20px;
  margin: 0px 20px;
  background-color: #B3E7E3;
  border-radius: 10px;
}
.ques-header__input-block{
.ques-header__input-block {
  display: flex;
  align-items: center;
  @extend .text--middle,.mt-10 ;
@@ -438,7 +442,7 @@
  }
}
.ques-container{
.ques-container {
  position: relative;
  margin: 0px 20px;
}