保誠-保戶業務員媒合平台
Tomas
2023-12-25 f065760fa7df1f88747395ab4b55349ce8b2faf0
PAMapp/pages/accountSetting/index.vue
@@ -164,8 +164,6 @@
import { Vue,Component } from 'vue-property-decorator'
import { namespace } from 'vuex-class';
import _ from 'lodash';
import accountSettingService from '~/shared/services/account-setting.service';
import { UserSetting } from '~/shared/models/account.model';
@@ -202,28 +200,29 @@
////////////////////////////////////////////////////////////
  mounted(){
            accountSettingService.getUserAccountSetting().then((userInfo: UserSetting)=>{
                this.defaultUserSetting = _.cloneDeep({
                    name : userInfo.name || '',
                    phone: userInfo.phone || '',
                    email: userInfo.email || '',
                });
                this.phoneValue    = this.defaultUserSetting.phone!;
                this.userNameValue = this.defaultUserSetting.name!;
                this.emailValue    = this.defaultUserSetting.email!;
            })
        }
    accountSettingService.getUserAccountSetting().then((userInfo: UserSetting)=>{
      this.defaultUserSetting = {
        name : userInfo.name || '',
        phone: userInfo.phone || '',
        email: userInfo.email || '',
      };
      this.phoneValue    = this.defaultUserSetting.phone!;
      this.userNameValue = this.defaultUserSetting.name!;
      this.emailValue    = this.defaultUserSetting.email!;
    })
  }
////////////////////////////////////////////////////////////
  editField(fieldName: string): void {
            const enablePromise = new Promise((resolve, reject) => { // 此為promise語法
                resolve((this as any)[`${fieldName}Disabled`] = false);
            });
            const targetInput = this.$refs[fieldName] as any;
            enablePromise.then((_) => {
                targetInput.focus();
            });
        }
      const enablePromise = new Promise((resolve, reject) => { // 此為promise語法
          resolve((this as any)[`${fieldName}Disabled`] = false);
      });
      const targetInput = this.$refs[fieldName] as any;
      enablePromise.then((_) => {
          targetInput.focus();
      });
  }
  updateAccountSetting(): void {
      const editSettingInfo: UserSetting = {
          name: this.userNameValue,
@@ -238,10 +237,10 @@
  }
  private resetSettingForm(): void {
            this.userNameDisabled = true;
            this.userPhoneDisabled = true;
            this.userEmailDisabled = true ;
        }
      this.userNameDisabled = true;
      this.userPhoneDisabled = true;
      this.userEmailDisabled = true ;
  }
  editOtherContactType(){
    this.otherContactType = true;