From 31f6ff0ebbf3d374e6e0acdeda72bccdd86de2d5 Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期四, 10 二月 2022 14:16:15 +0800
Subject: [PATCH] update#134662: [ 顧問管理流程 ] 編輯顧問個人資料 : 所在地區,無產生選擇器

---
 PAMapp/components/AddAndReservedBtns.vue |   47 ++++++++++++++++++++++++++++++-----------------
 1 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/PAMapp/components/AddAndReservedBtns.vue b/PAMapp/components/AddAndReservedBtns.vue
index fe0f2e7..f2f3177 100644
--- a/PAMapp/components/AddAndReservedBtns.vue
+++ b/PAMapp/components/AddAndReservedBtns.vue
@@ -1,40 +1,53 @@
 <template>
     <el-row type="flex" justify="center" :class="cusClass">
         <el-button @click="addConsultant(agentInfo)" :disabled="isAdded">
-            <span> + 憿批��</span>
+            <span> {{ isAdded ? '撌脣�憿批��' : '+ 憿批��' }}</span>
         </el-button>
         <el-button
-            @click="reserveCommunication"
+            @click="navigateToReservationForm"
             type="primary"
         >�脰����</el-button>
     </el-row>
 </template>
 
 <script lang="ts">
-import { Vue, Component, Prop, Emit, Action, State } from 'nuxt-property-decorator';
-import { Consultants } from '~/assets/ts/api/consultant';
-import { isLogin } from '~/assets/ts/auth';
+import { Vue, Component, Prop, Emit, Action, State, namespace } from 'nuxt-property-decorator';
+import { Consultant } from '~/shared/models/consultant.model';
 
 @Component
 export default class AddAndReservedBtns extends Vue {
-    @Action addToMyConsultantList!: (consultantToAdd: Consultants) => Promise<boolean>
-    @State('myConsultantList') myConsultantList!: Consultants[];
 
-    @Prop() agentInfo!: Consultants;
-    @Prop() cusClass!: string;
+    @Action
+    addToMyConsultantList!: (consultantToAdd: Consultant) => Promise<boolean>
+
+    @State('myConsultantList')
+    myConsultantList!: Consultant[];
+
+    @Prop()
+    agentInfo!: Consultant;
+
+    @Prop()
+    cusClass!: string;
+
     isVisiblePopUp = false;
-    addConsultant(item: Consultants) {
+
+    //////////////////////////////////////////////////////////////////////
+
+    @Emit('openPopUp')
+    openPopUp(popUpTxt: string = '����憿批��'): string {
+        return popUpTxt;
+    }
+
+    //////////////////////////////////////////////////////////////////////
+
+    addConsultant(item: Consultant): void {
         this.addToMyConsultantList(item).then(addOk => {
             addOk && this.openPopUp();
         });
     }
 
-    reserveCommunication() {
-        isLogin() ? this.$router.push(`/questionnaire/${this.agentInfo.agentNo}`) : this.$router.push('/login');
-    }
-
-    @Emit('openPopUp') openPopUp(popUpTxt: string = '����憿批��') {
-        return popUpTxt
+    navigateToReservationForm(): void {
+        this.$router.push(`/questionnaire/${this.agentInfo.agentNo}`);
     }
 
     get isAdded() {
@@ -42,4 +55,4 @@
                 ? true : false
     }
 }
-</script>
\ No newline at end of file
+</script>

--
Gitblit v1.8.0