保誠-保戶業務員媒合平台
Mila
2021-12-10 76c1ce3c2eb001560bfb785f7b2f62d4ec64dcb6
PAMapp/pages/questionnaire/_agentNo.vue
@@ -136,19 +136,21 @@
</template>
<script lang="ts">
import { Vue, Component, State, Action, Watch } from 'nuxt-property-decorator';
import { Vue, Component, State, Action, Watch, namespace } from 'nuxt-property-decorator';
import { addFavoriteConsultant, appointmentDemand, AppointmentParams, AppointmentRequests ,editAppointment,RegisterInfo } from '~/assets/ts/api/consultant';
import { getRequestQuestionFromStorage, getRequestsFromStorage, removeRequestQuestionFromStorage, setRequestsToStorage } from '~/assets/ts/storageRequests';
import _ from 'lodash';
import { isLogin } from '~/assets/ts/auth';
import { Consultant } from '~/assets/ts/models/consultant.model';
import { ContactType } from '~/assets/ts/models/enum/ContactType';
import { Gender } from '~/assets/ts/models/enum/Gender';
import { Role } from '~/assets/ts/models/enum/Role';
  const roleStorage = namespace('localStorage');
  @Component
  export default class Questionnaire extends Vue {
    @State('myConsultantList') myConsultantList!: Consultant[];
    @Action storeConsultantList!: () => Promise<number>;
    @roleStorage.Getter currentRole!:string;
    genderOptions=[
      {
@@ -270,19 +272,19 @@
    beforeRouteEnter(to: any, from: any, next: any) {
      next(vm => {
        if (from.name === 'login' && !isLogin()) {
        if (from.name === 'login' && !vm.isLogin) {
          vm.$router.go(-1);
          return;
        }
        if (!isLogin()) {
        if (!vm.isLogin) {
          vm.$router.push('/login');
        }
      })
    }
    async fetch() {
      if (isLogin()) {
      if (this.isLogin) {
        await this.storeConsultantList();
      };
    }
@@ -335,7 +337,7 @@
    }
    get isLogin() {
      return isLogin();
      return this.currentRole === Role.USER;
    }
    private isHopeContactTimeDone():boolean{