From 532dc163d3b836cd4603a5c5968e2eb3d7d064de Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期三, 30 三月 2022 21:13:31 +0800 Subject: [PATCH] update: 調整 edit agent info (entryData) - 尚缺:初始化打 getAgentInfo 時,沒有 entryData 無法初始化該值 --- PAMapp/shared/models/agent-info.model.ts | 1 + PAMapp/pages/agentInfo/edit/_agentNo.vue | 33 ++++++++++++++------------------- PAMapp/shared/models/account.model.ts | 5 +++-- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/PAMapp/pages/agentInfo/edit/_agentNo.vue b/PAMapp/pages/agentInfo/edit/_agentNo.vue index 7d3ebe8..15311e0 100644 --- a/PAMapp/pages/agentInfo/edit/_agentNo.vue +++ b/PAMapp/pages/agentInfo/edit/_agentNo.vue @@ -125,18 +125,11 @@ <UiField :span="12" icon="time" label="��敺�����"> {{ agentInfo.latestLoginTime | formatDate }} </UiField> - <UiField :span="12" icon="calender" label="����風"> - <div class="mt-10" style="display: flex; align-items: center"> - <el-input v-model="editInfoValue.seniorityYear" class="seniority-input" ></el-input>撟� - <el-select style="width:60px" v-model="editInfoValue.seniorityMonth" class="seniority-input"> - <el-option - v-for="(month) in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]" - :value="month" - :key="month"> - {{ month }} - </el-option> - </el-select>��� - </div> + <UiField :span="12" icon="calender" label="������"> + <UiDatePicker + class="mt-10" + @changeDate="onChangeDate($event)" + ></UiDatePicker> </UiField> </el-row> @@ -308,8 +301,6 @@ title : '', serveArea : [] as string[], companyAddress : '', - seniorityYear : 1, - seniorityMonth : 0, concept : '', experiences : '', awards : '', @@ -317,6 +308,7 @@ photoBase64 : '', phoneNumber : '', email : '', + entryDate : ',' }; communicationStyleList: string[] = agentCommunicationStyleList; @@ -380,7 +372,7 @@ } private setAgentInfo(agentInfo: AgentInfo): void { - const [agentYear, _yearUnit , agentMonth, _monthUnit] = agentInfo.seniority.split(" "); + // const [agentYear, _yearUnit , agentMonth, _monthUnit] = agentInfo.seniority.split(" "); this.defaultAgentInfoSetting = { agentNo : agentInfo.agentNo||'', name : agentInfo.name || '', @@ -391,14 +383,13 @@ gender : agentInfo.gender||'', phoneNumber : agentInfo.phoneNumber||'', companyAddress : agentInfo.companyAddress || '', - seniorityYear : agentYear? +agentYear : 0, - seniorityMonth : agentMonth ? +agentMonth : 0, concept : agentInfo.concept || '', experiences : agentInfo.experiences || '', awards : agentInfo.awards || '', communicationStyle: agentInfo.communicationStyle || '', photoBase64 : '', - email : agentInfo.email || '' + email : agentInfo.email || '', + entryDate : agentInfo.entryDate || '', }; this.editInfoValue = { @@ -423,6 +414,10 @@ this.isInfoUpdate = true; this.updateConsultantDetail(editSettingInfo.agentNo); }); + } + + onChangeDate(date: any): void { + this.editInfoValue.entryDate = date; } backToInfo() { @@ -475,7 +470,7 @@ && this.editInfoValue.concept && this.editInfoValue.experiences && this.editInfoValue.phoneNumber.length - && this.editInfoValue.seniorityYear + && this.editInfoValue.entryDate && this.editInfoValue.expertise.length && this.editInfoValue.communicationStyle.length && this.editInfoValue.email.length; diff --git a/PAMapp/shared/models/account.model.ts b/PAMapp/shared/models/account.model.ts index f433c6c..9975a23 100644 --- a/PAMapp/shared/models/account.model.ts +++ b/PAMapp/shared/models/account.model.ts @@ -14,12 +14,13 @@ gender : string; phoneNumber : string; companyAddress : string; - seniorityYear : number; - seniorityMonth : number; + seniorityYear? : number; + seniorityMonth? : number; concept : string; experiences : string; awards : string; communicationStyle: string; photoBase64 : string; email : string; + entryDate : string; } diff --git a/PAMapp/shared/models/agent-info.model.ts b/PAMapp/shared/models/agent-info.model.ts index e6af754..a57e40b 100644 --- a/PAMapp/shared/models/agent-info.model.ts +++ b/PAMapp/shared/models/agent-info.model.ts @@ -19,4 +19,5 @@ serveArea : string; suitability : number; title : string; + entryDate? : string; } -- Gitblit v1.8.0