From f3e662798b3b83a83c2d60dc7b4e6cf1ee4f1331 Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期六, 05 八月 2023 16:35:00 +0800
Subject: [PATCH] Fixed: [弱掃] p8.2 Bad use of null-like value

---
 PAMapp/components/AddAndReservedBtns.vue |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/PAMapp/components/AddAndReservedBtns.vue b/PAMapp/components/AddAndReservedBtns.vue
index b42bee8..f2d5c2e 100644
--- a/PAMapp/components/AddAndReservedBtns.vue
+++ b/PAMapp/components/AddAndReservedBtns.vue
@@ -4,9 +4,10 @@
             <span> {{ isAdded ? '撌脣�憿批��' : '+ 憿批��' }}</span>
         </el-button>
         <el-button
+            :disabled="isDisableReserve"
             @click="navigateToReservationForm"
             type="primary"
-        >�脰����</el-button>
+        >{{ isDisableReserve ? '撌脰蝯�' : '�脰����'}}</el-button>
     </el-row>
 </template>
 
@@ -49,7 +50,7 @@
         if (!this.isUserLogin) {
           item = {
             ...item,
-            updateTime: new Date().toString()
+            updateTime: new Date().toISOString()
           };
         }
         this.addToMyConsultantList(item).then(addOk => {
@@ -65,5 +66,12 @@
         return this.myConsultantList.find(item => item.agentNo === this.agentInfo.agentNo)
                 ? true : false
     }
+
+    get isDisableReserve(): boolean {
+      return this.myConsultantList.some((agent) => {
+        return agent.agentNo === this.agentInfo.agentNo
+            && agent.contactStatus === 'contacted';
+        });
+    }
 }
 </script>

--
Gitblit v1.8.0