| | |
| | | :agentNo="agentInfo.agentNo"> |
| | | </UiAvatar> |
| | | </el-row> |
| | | |
| | | <el-row |
| | | type="flex" |
| | | class="pt-10" |
| | |
| | | v-for="(communicateStyle, index) in communicationStyleList"> |
| | | </el-checkbox> |
| | | </UiField> |
| | | |
| | | </el-row> |
| | | <el-row |
| | | type="flex" |
| | |
| | | </div> |
| | | </div> |
| | | </PopUpFrame> |
| | | |
| | | <PopUpFrame :isOpen.sync="isInfoUpdate"> |
| | | <div class="text--center mdTxt fs-18"> |
| | | <p class="mt-20 text--center ">帳號資訊更新成功</p> |
| | | <el-button |
| | | type="primary" |
| | | @click="backToInfo" |
| | | class="mt-20" |
| | | >我知道了</el-button> |
| | | </div> |
| | | </PopUpFrame> |
| | | <div class="pam-paragraph account-confirm"> |
| | | <el-button :disabled="isSubmitBtnDisabled" |
| | | @click.native="editAgentInfoSetting"> |
| | |
| | | fieldInfoTitle : string = ''; |
| | | hideReviews : boolean = hideReviews ; |
| | | isAlertFieldInfo: boolean = false; |
| | | isInfoUpdate : boolean = false; |
| | | |
| | | editInfoValue = { |
| | | agentNo : '', |
| | |
| | | experiences : '', |
| | | awards : '', |
| | | communicationStyle: [] as string[], |
| | | photoBase64 : '', |
| | | }; |
| | | |
| | | communicationStyleList: string[] = agentCommunicationStyleList; |
| | |
| | | this.setAgentInfo(this.agentInfo); |
| | | } |
| | | |
| | | ///////////////////////////////////////////////////////////////////////////// |
| | | private setAgentInfo(agentInfo: AgentInfo): void { |
| | | const [agentYear, _yearUnit , agentMonth, _monthUnit] = agentInfo.seniority.split(" "); |
| | | |
| | | this._agentInfoSetting = { |
| | | agentNo : agentInfo.agentNo||'', |
| | | name : agentInfo.name || '', |
| | |
| | | experiences : agentInfo.experiences || '', |
| | | awards : agentInfo.awards || '', |
| | | communicationStyle: agentInfo.communicationStyle || '', |
| | | photoBase64 : '', |
| | | photoBase64 : '' |
| | | }; |
| | | |
| | | this.editInfoValue = { |
| | | ...this._agentInfoSetting, |
| | | expertise : _.cloneDeep(this._agentInfoSetting.expertise), |
| | | // TODO: 確認後端此欄位後端應改為以" , "隔開 [Tomas, 2021/12/28] |
| | | communicationStyle : this._agentInfoSetting.communicationStyle.split('、') |
| | | communicationStyle : this._agentInfoSetting.communicationStyle.split('、'), |
| | | } |
| | | } |
| | | |
| | | ////////////////////////////////////////////////////////////////////// |
| | | editAgentInfoSetting(): void { |
| | | const editSettingInfo: any = { |
| | | ...this.editInfoValue, |
| | | communicationStyle: this.editInfoValue.communicationStyle.join('、'), |
| | | } |
| | | accountSettingService.editAgentInfoSetting(editSettingInfo).then((res: AgentInfoSetting) => { |
| | | console.log(editSettingInfo) |
| | | }); |
| | | this.isInfoUpdate = true; |
| | | } |
| | | |
| | | backToInfo() { |
| | | this.isInfoUpdate = false |
| | | this.$router.push(`/agentInfo/${this.agentInfo.agentNo}`); |
| | | } |
| | | alertFieldInfo(field: string): void { |
| | | this.isAlertFieldInfo = true; |
| | | switch(field) { |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | //////////////////////////////////////////////////////////// |
| | | |
| | | get isSubmitBtnDisabled(): boolean { |
| | | const isFormValid = this.editInfoValue.name |
| | | && this.editInfoValue.title |
| | |
| | | && this.editInfoValue.communicationStyle; |
| | | return !isFormValid |
| | | } |
| | | |
| | | |
| | | |
| | | editAgentInfoSetting(): void { |
| | | const editSettingInfo: any = { |
| | | ...this.editInfoValue, |
| | | communicationStyle: this.editInfoValue.communicationStyle.join('、'), |
| | | photoBase64 : '', |
| | | } |
| | | |
| | | accountSettingService.editAgentInfoSetting(editSettingInfo).then((res: AgentInfoSetting) => { |
| | | console.log(editSettingInfo) |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | </script> |
| | |
| | | width : 50px; |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | </style> |