From f8c7e51fc52be25eb12fffd81eb6d1b4ce8075a1 Mon Sep 17 00:00:00 2001
From: Jack <jack.su@pollex.com.tw>
Date: 星期三, 29 十二月 2021 19:37:11 +0800
Subject: [PATCH] Merge branch 'Phase2' of ssh://dev.pollex.com.tw:29418/pcalife/PAM into Phase2

---
 PAMapp/pages/agentInfo/edit/_agentNo.vue |   65 +++++++++++++++++---------------
 1 files changed, 35 insertions(+), 30 deletions(-)

diff --git a/PAMapp/pages/agentInfo/edit/_agentNo.vue b/PAMapp/pages/agentInfo/edit/_agentNo.vue
index 35cbc1d..73029bf 100644
--- a/PAMapp/pages/agentInfo/edit/_agentNo.vue
+++ b/PAMapp/pages/agentInfo/edit/_agentNo.vue
@@ -8,7 +8,6 @@
           :agentNo="agentInfo.agentNo">
         </UiAvatar>
       </el-row>
-
       <el-row
         type="flex"
         class="pt-10"
@@ -101,7 +100,6 @@
             v-for="(communicateStyle, index) in communicationStyleList">
           </el-checkbox>
         </UiField>
-
       </el-row>
       <el-row
         type="flex"
@@ -154,7 +152,16 @@
             </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">
@@ -194,22 +201,24 @@
   fieldInfoTitle  : string = '';
   hideReviews     : boolean = hideReviews ;
   isAlertFieldInfo: boolean = false;
+  isInfoUpdate    : boolean = false;
 
   editInfoValue = {
     agentNo           : '',
     name              : '',
-    expertise            : [] as string[],
+    expertise         : [] as string[],
     title             : '',
     serveArea         : '',
     companyAddress    : '',
     seniorityYear     : 1,
     seniorityMonth    : 0,
     concept           : '',
-    experiences        : '',
+    experiences       : '',
     awards            : '',
     communicationStyle: [] as string[],
+    photoBase64       : '',
   };
-
+  
   communicationStyleList: string[] = agentCommunicationStyleList;
   expertList: string[] = agentExpertList;
   role           = Role;
@@ -226,10 +235,10 @@
   mounted(){
     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 || '',
@@ -240,25 +249,39 @@
       gender            : agentInfo.gender||'',
       phoneNumber       : agentInfo.phoneNumber||'',
       companyAddress    : agentInfo.companyAddress || '',
-      seniorityYear     : agentYear? +agentYear     : 0,
-      seniorityMonth    : agentMonth ? +agentMonth  : 0,
+      seniorityYear     : agentYear? +agentYear : 0,
+      seniorityMonth    : agentMonth ? +agentMonth : 0,
       concept           : agentInfo.concept || '',
       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) {
@@ -272,9 +295,7 @@
         break;
     }
   }
-
   ////////////////////////////////////////////////////////////
-
   get isSubmitBtnDisabled(): boolean {
       const isFormValid =  this.editInfoValue.name
                         && this.editInfoValue.title
@@ -289,21 +310,6 @@
                         && 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>
@@ -366,5 +372,4 @@
   width       : 50px;
   margin-right: 5px;
 }
-
 </style>

--
Gitblit v1.8.0