保誠-保戶業務員媒合平台
劉鈞霖
2021-12-01 5e2aa2805d3f8698adaacaba469e0363a120156b
PAMapp/pages/recommendConsultant/index.vue
@@ -86,22 +86,27 @@
  import {
    Vue,
    Component,
    Mutation
    Mutation,
    namespace
  } from 'nuxt-property-decorator';
  import {strictQuery} from '~/assets/ts/api/consultant';
  import * as _ from 'lodash';
  import { strictQuery } from '~/assets/ts/api/consultant';
  import { Seniority } from '~/assets/ts/models/enum/seniority';
  const localStorage = namespace('localStorage');
  @Component
  export default class RecommendConsultant extends Vue {
    isVisiblePopUp = false;
    strictQueryDto={
    strictQueryDto: StrictQueryDto ={
      gender:'',
      area:'',
      status:'',
      requirements:[],
      requirements: [],
      otherRequirement:'',
      seniority:'',
      avgScore:0,
      popularTags:[],
      popularTags: [],
      otherPopularTags:'',
    };
    genderOptions=[
@@ -144,17 +149,17 @@
      {
        title:'不限',
        subTitle:'年齡不是問題',
        label:'不限',
        label:Seniority.UNLIMITED,
      },
      {
        title:'年輕',
        subTitle:'給年輕人一個機會',
        label:'年輕',
        label:Seniority.YOUNG,
      },
      {
        title:'資深',
        subTitle:'薑是老的辣',
        label:'資深',
        label:Seniority.SENIOR,
      }
    ];
    popularOptions=[
@@ -221,10 +226,18 @@
    showAddress = false;
    @Mutation updateStrictQueryList!: (data: any) => void;
    @localStorage.Mutation storageRecommendConsultant!: (data: any) => void;
    @localStorage.State recommendConsultantItem!: string;
    mounted() {
      if (!!this.recommendConsultantItem) {
        this.strictQueryDto = JSON.parse(this.recommendConsultantItem);
      }
    }
    makePair():void{
      strictQuery(this.strictQueryDto).then(res=>{
        console.log('resultData',res.data);
        this.storageRecommendConsultant(JSON.stringify(this.strictQueryDto));
        this.updateStrictQueryList(res.data);
        if (res.data.length === 0) {
          this.isVisiblePopUp = true;
@@ -235,7 +248,9 @@
    }
    get notFinishByRequireRules():boolean{
      const area = this.strictQueryDto.area;
      const requirementLength = this.strictQueryDto.requirements.length;
      const requirementLength = this.strictQueryDto.requirements
        ? this.strictQueryDto.requirements.length
        : 0;
      return !(area && requirementLength >0)
    }
@@ -249,6 +264,18 @@
    MALE="male",
    FEMALE="female",
  }
  export interface StrictQueryDto {
    gender: string,
    area: string,
    status: string,
    requirements: string[],
    otherRequirement: string,
    seniority: string,
    avgScore: number,
    popularTags: string[],
    otherPopularTags: string
  }
</script>
<style lang="scss">