保誠-保戶業務員媒合平台
HelenHuang
2022-02-23 e77288ce022cc929c0a64764b9d9ed40fa533879
Update#135928 [顧問編輯個人帳戶資訊] 新增 email 欄位
修改3個檔案
54 ■■■■ 已變更過的檔案
PAMapp/pages/agentInfo/_agentNo.vue 9 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/agentInfo/edit/_agentNo.vue 40 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/shared/models/account.model.ts 5 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/agentInfo/_agentNo.vue
@@ -36,6 +36,15 @@
      </el-row>
      <el-row
        v-if="currentRole === role.ADMIN"
        type="flex"
        class="pam-paragraph">
        <UiField :span="12" icon="comment" label="信箱">
          {{ agentInfo.email }}
        </UiField>
      </el-row>
      <el-row
        type="flex"
        class="pam-paragraph">
        <UiField :span="12" icon="agent" label="頭銜">
PAMapp/pages/agentInfo/edit/_agentNo.vue
@@ -68,6 +68,27 @@
        </el-col>
      </el-row>
      <el-row
        type="flex"
        class="pam-paragraph">
        <el-col :span="24" class="pam-field">
          <div class="pam-field__label pam-progress__label">
            <div>
              <div class="pam-field__title mb-10">
                <i class="pam-icon icon-comment"
                  ></i>信箱
                  <span class="hint text--bold" v-show="!emailValid">信箱格式有誤</span>
                  <span class="hint text--bold" v-show="editInfoValue.email.length === 0">信箱為必填</span>
              </div>
            </div>
            <el-input
            v-model="editInfoValue.email"
            :class="{'is-invalid': !emailValid}"
            ></el-input>
          </div>
        </el-col>
      </el-row>
      <el-row
        type="flex"
@@ -294,7 +315,8 @@
    awards            : '',
    communicationStyle: [] as string[],
    photoBase64       : '',
    phoneNumber       : ''
    phoneNumber       : '',
    email             : '',
  };
  communicationStyleList: string[] = agentCommunicationStyleList;
@@ -375,7 +397,8 @@
      experiences       : agentInfo.experiences  || '',
      awards            : agentInfo.awards || '',
      communicationStyle: agentInfo.communicationStyle || '',
      photoBase64       : ''
      photoBase64       : '',
      email             : agentInfo.email || ''
    };
    this.editInfoValue = {
@@ -386,14 +409,17 @@
    }
  }
  //////////////////////////////////////////////////////////////////////
  editAgentInfoSetting(): void {
    console.log('???', this.editInfoValue)
    const editSettingInfo: any = {
      ...this.editInfoValue,
      communicationStyle: this.editInfoValue.communicationStyle.join('、'),
      serveArea: this.editInfoValue.serveArea.join('、'),
    }
    };
    console.log('!!!', editSettingInfo);
    accountSettingService.editAgentInfoSetting(editSettingInfo).then((res: AgentInfoSetting) => {
      this.isInfoUpdate = true;
      this.updateConsultantDetail(editSettingInfo.agentNo);
@@ -437,6 +463,11 @@
            : true;
        }
  get emailValid() {
      const rule = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
      return this.editInfoValue.email ? rule.test(this.editInfoValue.email) : true;
    }
  get isSubmitBtnDisabled(): boolean {
      const isFormValid =  this.editInfoValue.name
                        && this.editInfoValue.title
@@ -447,7 +478,8 @@
                        && this.editInfoValue.phoneNumber.length
                        && this.editInfoValue.seniorityYear
                        && this.editInfoValue.expertise.length
                        && this.editInfoValue.communicationStyle.length;
                        && this.editInfoValue.communicationStyle.length
                        && this.editInfoValue.email.length;
      return !isFormValid
  }
}
PAMapp/shared/models/account.model.ts
@@ -17,8 +17,9 @@
    seniorityYear     : number;
    seniorityMonth    : number;
    concept           : string;
    experiences        : string;
    awards           : string;
    experiences       : string;
    awards            : string;
    communicationStyle: string;
    photoBase64       : string;
    email             : string;
}