| | |
| | | const loginStore = namespace('login.store'); |
| | | |
| | | @Component |
| | | export default class AgentInfoComponent extends Vue { |
| | | export default class AgentInfoEditComponent extends Vue { |
| | | |
| | | @localStorageTest.State('current_role') |
| | | @localStorageTest.State |
| | | current_role: any; |
| | | |
| | | @loginStore.Action |
| | | updateConsultantDetail!: (agentInfo: AgentInfo) => AgentInfo; |
| | | updateConsultantDetail!: (agentNo: string) => Promise<AgentInfo>; |
| | | |
| | | _agentInfoSetting!: AgentInfoSetting; |
| | | defaultAgentInfoSetting!: AgentInfoSetting; |
| | | agentInfo! : AgentInfo |
| | | fieldInfoDesc : string = ''; |
| | | fieldInfoTitle : string = ''; |
| | |
| | | |
| | | private setAgentInfo(agentInfo: AgentInfo): void { |
| | | const [agentYear, _yearUnit , agentMonth, _monthUnit] = agentInfo.seniority.split(" "); |
| | | this._agentInfoSetting = { |
| | | this.defaultAgentInfoSetting = { |
| | | agentNo : agentInfo.agentNo||'', |
| | | name : agentInfo.name || '', |
| | | expertise : agentInfo.expertise || [], |
| | |
| | | }; |
| | | |
| | | this.editInfoValue = { |
| | | ...this._agentInfoSetting, |
| | | expertise : _.cloneDeep(this._agentInfoSetting.expertise), |
| | | ...this.defaultAgentInfoSetting, |
| | | expertise : _.cloneDeep(this.defaultAgentInfoSetting.expertise), |
| | | // TODO: 確認後端此欄位後端應改為以" , "隔開 [Tomas, 2021/12/28] |
| | | communicationStyle : this._agentInfoSetting.communicationStyle.split('、'), |
| | | communicationStyle : this.defaultAgentInfoSetting.communicationStyle.split('、'), |
| | | } |
| | | } |
| | | |
| | |
| | | serveArea: this.editInfoValue.serveArea.join('、'), |
| | | } |
| | | accountSettingService.editAgentInfoSetting(editSettingInfo).then((res: AgentInfoSetting) => { |
| | | this.updateConsultantDetail(editSettingInfo.agentNo); |
| | | this.isInfoUpdate = true; |
| | | this.updateConsultantDetail(editSettingInfo.agentNo); |
| | | }); |
| | | } |
| | | |
| | |
| | | |
| | | //////////////////////////////////////////////////////////// |
| | | get nameValid(): boolean { |
| | | return !!this.editAgentInfoSetting.name; |
| | | return !!this.defaultAgentInfoSetting?.name; |
| | | } |
| | | |
| | | get phoneValid(): boolean { |