保誠-保戶業務員媒合平台
update: 顧問-登入後將顧問細節設定到 store, 供預約單的發送約訪通知時使用
修改4個檔案
新增1個檔案
81 ■■■■ 已變更過的檔案
PAMapp/components/Interview/InterviewMsg.vue 12 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/consultantLogin/index.vue 9 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/shared/models/agent-info.model.ts 31 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/store/localStorage.ts 1 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/store/login.store.ts 28 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/Interview/InterviewMsg.vue
@@ -14,7 +14,7 @@
      <el-input
        type="textarea"
        autosize="true"
        :autosize="true"
        placeholder="約訪通知"
        resize="none"
        v-model="isInterviewTxt">
@@ -41,10 +41,13 @@
  </div>
</template>
<script lang="ts">
import { Vue, Component, Prop, PropSync, Emit, Action } from 'nuxt-property-decorator';
import { Vue, Component, Prop, PropSync, Emit, Action, namespace } from 'nuxt-property-decorator';
import appointmentService from '~/shared/services/appointment.service';
import { Appointment, ToInformAppointment } from '~/shared/models/appointment.model';
import { AgentInfo } from '~/shared/models/agent-info.model';
const loginStore = namespace('login.store');
@Component
export default class InterviewMsg extends Vue {
@@ -65,6 +68,9 @@
    closeDialog() {
        return;
    }
    @loginStore.State
    loginConsultant!: AgentInfo;
    isShowSuccessAlert = false;
@@ -92,7 +98,7 @@
    }
    get isInterviewTxt() : string{
      return this.interviewTxt = "您好!我是保誠媒合平台的保險顧問" + "agentName"+",感謝您的預約!我預計會在下述的時間與您聯繫"+"\n"+"以下是我的電話號碼/Email:"+"\n"+"agentPhone"+"\n"+"agentEmail"+"\n"+"若此時間不方便,請與我聯繫!謝謝!"
      return this.interviewTxt = "您好!我是保誠媒合平台的保險顧問" + this.loginConsultant.name + ",感謝您的預約!我預計會在下述的時間與您聯繫"+"\n"+"以下是我的電話號碼/Email:"+"\n" + this.loginConsultant.phoneNumber + "\n" + this.loginConsultant.email + "\n"+"若此時間不方便,請與我聯繫!謝謝!"
    }
}
PAMapp/pages/consultantLogin/index.vue
@@ -61,8 +61,11 @@
  import { Role } from '~/shared/models/enum/Role';
  import messageBoxService from '~/shared/services/message-box.service';
  import loginService from '~/shared/services/login.service'
import { AgentInfo } from '~/shared/models/agent-info.model';
  const loginStore  = namespace('login.store');
  const roleStorage = namespace('localStorage');
  @Component({
    layout: 'home'
  })
@@ -75,6 +78,9 @@
    @roleStorage.Mutation
    storageConsultantId!:(id:string) => void;
    @loginStore.Action
    getLoginConsultantDetail!: (agentNo: string) => Promise<AgentInfo>;
    consultantDto = {
      password: '',
@@ -130,7 +136,7 @@
    private verify():void{
      loginService.getVerificationStatus(this.verificationCode).then( verifySuccess => {
        if(verifySuccess.data){
          this.loginWithConsultant()
          this.loginWithConsultant();
        }else{
          this.clearValue();
          this.regenerateImgOfVerification();
@@ -141,6 +147,7 @@
    private loginWithConsultant(): void {
      loginService.logInToConsultant(this.consultantDto).then(res => {
        this.getLoginConsultantDetail(this.consultantDto.username);
        this.storageIdToken(res.data.id_token);
        this.storageRole(Role.ADMIN);
        this.storageConsultantId(this.consultantDto.username)
PAMapp/shared/models/agent-info.model.ts
@@ -1,21 +1,22 @@
export interface AgentInfo {
  name            : string;
  agentNo         : string;
  role            : string;
  img             : string;
  avgScore        : number;
  title           : string;
  phoneNumber     : string;
  serveArea       : string;
  companyAddress  : string;
  latestLoginTime : Date  ;
  seniority       : string;
  suitability     : number;
  evaluation      : number;
  expertise       : string[];
  concept         : string;
  experiences     : string;
  awards          : string;
  gender            : string,
  communicationStyle: string;
  companyAddress    : string;
  concept           : string;
  email?            : string;
  evaluation        : number;
  experiences       : string;
  expertise         : string[];
  gender            : string,
  img               : string;
  latestLoginTime   : Date  ;
  name              : string;
  phoneNumber       : string;
  role              : string;
  seniority         : string;
  serveArea         : string;
  suitability       : number;
  title             : string;
}
PAMapp/store/localStorage.ts
@@ -75,6 +75,7 @@
    localStorage.removeItem('current_role');
    localStorage.removeItem('consultant_id');
    localStorage.removeItem('appointment');
    localStorage.removeItem('login_consultant');
    this.id_token = localStorage.getItem('id_token');
    this.current_role = localStorage.getItem('current_role');
    this.consultant_id = localStorage.getItem('consultant_id');
PAMapp/store/login.store.ts
¤ñ¹ï·sÀÉ®×
@@ -0,0 +1,28 @@
import { Module, VuexModule, Mutation, Action } from 'vuex-module-decorators'
import myConsultantService from '~/shared/services/my-consultant.service';
import { AgentInfo } from '~/shared/models/agent-info.model';
@Module
export default class AppointmentStore extends VuexModule {
  loginConsultant?: AgentInfo = JSON.parse(localStorage.getItem('login_consultant')!);
  //////////////////////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////////////////
  @Mutation
  SET_LOGIN_CONSULTANT(agentInfo: AgentInfo): void {
    this.loginConsultant = agentInfo;
    localStorage.setItem('login_consultant', JSON.stringify(agentInfo));
  }
  //////////////////////////////////////////////////////////////////////
  @Action({ commit: 'SET_LOGIN_CONSULTANT' })
  async getLoginConsultantDetail(agentNo: string): Promise<AgentInfo> {
    return await myConsultantService.getConsultantDetail(agentNo).then((res) => res);
  }
}