From 9cb6d5f92ad7aeda45ad1fe6482dcfc63d17be2b Mon Sep 17 00:00:00 2001
From: HelenHuang <LinHuang@pollex.com.tw>
Date: 星期一, 06 十二月 2021 12:35:26 +0800
Subject: [PATCH] Merge branch 'master' of https://192.168.0.10:8443/r/pcalife/PAM

---
 PAMapp/pages/myAppointmentList.vue |   46 +++++++++++++++++++++++++++++++++++-----------
 1 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/PAMapp/pages/myAppointmentList.vue b/PAMapp/pages/myAppointmentList.vue
index 5f9e103..85a57da 100644
--- a/PAMapp/pages/myAppointmentList.vue
+++ b/PAMapp/pages/myAppointmentList.vue
@@ -22,14 +22,25 @@
             <NuxtChild></NuxtChild>
         </div>
 
-
-
+        <PopUpFrame
+             :isOpen.sync="showNewAppointmentNumber"
+        >
+            <div class="text--center mdTxt">
+                <p class="mb-50">雿�� <span class="text--primary">{{newAppointmentNumber}}</span> �������</p>
+                <div class="text--center">
+                    <el-button
+                        type="primary"
+                        @click="showNewAppointmentNumber = false"
+                    >������</el-button>
+                </div>
+            </div>
+        </PopUpFrame>
     </div>
 </template>
 
 <script lang="ts">
 import { Vue, Component, State, Action, Watch } from 'nuxt-property-decorator';
-import { ClientInfo } from '~/assets/ts/api/appointment';
+import { allAppointmentsView, ClientInfo } from '~/assets/ts/api/appointment';
 import * as _ from 'lodash';
 
 @Component({
@@ -40,15 +51,22 @@
     appointmentList: ClientInfo[] = [];
     contactedList: ClientInfo[] = [];
     clients: ClientInfo[] = [];
+    newAppointmentNumber: number = 0;
+    showNewAppointmentNumber = false;
 
     @State('myAppointmentList') myAppointmentList!: ClientInfo[];
-    @Action storeMyAppointmentList!: any;
+    @Action storeMyAppointmentList!: () => Promise<number>;
 
     mounted() {
-     this.storeMyAppointmentList();
+     this.storeMyAppointmentList().then(newDataLength => {
+         this.newAppointmentNumber = newDataLength;
+         if (this.newAppointmentNumber > 0) {
+             this.showNewAppointmentNumber = true;
+             allAppointmentsView().then(res => res);
+         }
+    });
 
      if (this.$route.name) {
-         console.log('mounted route')
          this.activeTabName = this.$route.name.split('-')[1]
      }
     }
@@ -56,11 +74,10 @@
     @Watch('myAppointmentList')
     onMyAppointmentListChange() {
         this.contactedList = this.myAppointmentList
-            .filter(item => item.communicateStatus === 'contacted')
-            .sort((a, b) => a.appointmentDate > b.appointmentDate ? -1 : 1);
+            .filter(item => item.communicateStatus === 'contacted');
+
         this.appointmentList = this.myAppointmentList
-            .filter(item => item.communicateStatus !== 'contacted')
-            .sort((a, b) => a.appointmentDate > b.appointmentDate ? -1 : 1);;
+            .filter(item => item.communicateStatus !== 'contacted');
     }
 
     tabClick(path: string) {
@@ -104,6 +121,13 @@
     }
 
     .pam-container {
-        padding: 30px 20px;
+        margin: 30px 20px;
+    }
+
+    @include desktop {
+        .pam-container {
+            width: 700px;
+            margin: 30px auto;
+        }
     }
 </style>
\ No newline at end of file

--
Gitblit v1.8.0