duanshenglang 1 週間 前
コミット
f596b2994e

+ 16 - 4
lottery/complaint.html

@@ -125,10 +125,17 @@
         this.httpUrl = 'http://test.wefanbot.com:18993'
       }
       if (this.getQueryParam('memberId')) {
-        // 已授权
-        this.memberId = this.getQueryParam('memberId')
-        this.corpId = this.getQueryParam('corpId')
-        this.executeDetail()
+        if (this.isUnknownType(this.getQueryParam('memberId'))) {
+          this.$message({
+            message: '员工未激活',
+            type: 'warning'
+          })
+        } else {
+          // 已授权
+          this.memberId = this.getQueryParam('memberId')
+          this.corpId = this.getQueryParam('corpId')
+          this.executeDetail()
+        }
       } else {
         // 授权
         this.getAuth()
@@ -203,6 +210,11 @@
         // 返回指定参数的值,如果不存在则返回null  
         return urlParams.get(paramName);
       },
+      isUnknownType(value) {
+        // 1. 先检查是否为字符串类型
+        // 2. 再检查是否以"unknown"开头(区分大小写)
+        return typeof value === 'string' && value.startsWith('unknown');
+      }
     }
   })   
 </script>

+ 3 - 0
lottery/groupSop.html

@@ -364,6 +364,9 @@
       },
       //获取执行中的sop计划
       executeSopList (status) {
+        if (!this.externalUserId) {
+          return
+        }
         fetch(this.httpUrl + `/scrm/v1/wxcp-group-sop/p/executeSopList?chatId=${this.externalUserId}&memberId=${this.memberId}&bId=${this.bId}&status=${status || 0}`)
           .then(res => {
             return res.json()

+ 16 - 4
lottery/intentionClient.html

@@ -144,10 +144,17 @@
         this.httpUrl = 'http://test.wefanbot.com:18993'
       }
       if (this.getQueryParam('memberId')) {
-        // 已授权
-        this.memberId = this.getQueryParam('memberId')
-        this.corpId = this.getQueryParam('corpId')
-        this.executeDetail()
+        if (this.isUnknownType(this.getQueryParam('memberId'))) {
+          this.$message({
+            message: '员工未激活',
+            type: 'warning'
+          })
+        } else {
+          // 已授权
+          this.memberId = this.getQueryParam('memberId')
+          this.corpId = this.getQueryParam('corpId')
+          this.executeDetail()
+        }
       } else {
         // 授权
         this.getAuth()
@@ -279,6 +286,11 @@
         // 返回指定参数的值,如果不存在则返回null  
         return urlParams.get(paramName);
       },
+      isUnknownType(value) {
+        // 1. 先检查是否为字符串类型
+        // 2. 再检查是否以"unknown"开头(区分大小写)
+        return typeof value === 'string' && value.startsWith('unknown');
+      }
     }
   })   
 </script>

+ 20 - 11
lottery/jxs.html

@@ -3790,20 +3790,29 @@
         this.handleLoginOut()
       },
       formatTime(seconds) {
-        if (seconds === undefined || seconds === '' || seconds === null) {
-          return '--'
+        // 处理无效输入(空值/非数字)
+        if (seconds == null || seconds === '' || typeof seconds !== 'number') {
+          return '--';
         }
-        if (seconds >= 3600) {
-          // 转换为小时并保留整数部分
-          const hour = this.formatNumber(seconds / 3600);
-          return `${hour}小时`;
-        } else if (seconds >= 60) {
-          // 转换为分钟并保留整数部分
-          const minutes = this.formatNumber(seconds / 60);
-          return `${minutes}分钟`;
+        // 确定时间符号和绝对值
+        const isNegative = seconds < 0;
+        const absSeconds = Math.abs(seconds);
+        // 内部格式化函数(处理绝对值)
+        const format = (val, unit) => {
+          const num = Math.round(val);
+          return `${num}${unit}${num > 1 ? '们' : ''}`;
+        };
+        // 根据绝对值大小转换单位
+        let formatted;
+        if (absSeconds >= 3600) {
+          formatted = format(absSeconds / 3600, '小时');
+        } else if (absSeconds >= 60) {
+          formatted = format(absSeconds / 60, '分钟');
         } else {
-          return `${seconds}秒`;
+          formatted = format(absSeconds, '秒');
         }
+        // 添加负号(当原始值为负时)
+        return isNegative ? `-${formatted}` : formatted;
       },
       formatNumber(num) {
         const number = Number(num);

+ 36 - 15
lottery/timeOut.html

@@ -118,10 +118,17 @@
         this.httpUrl = 'http://test.wefanbot.com:18993'
       }
       if (this.getQueryParam('memberId')) {
-        // 已授权
-        this.memberId = this.getQueryParam('memberId')
-        this.getQyWxSign()
-        this.executeDetail()
+        if (this.isUnknownType(this.getQueryParam('memberId'))) {
+          this.$message({
+            message: '员工未激活',
+            type: 'warning'
+          })
+        } else {
+          // 已授权
+          this.memberId = this.getQueryParam('memberId')
+          this.getQyWxSign()
+          this.executeDetail()
+        }
       } else {
         // 授权
         this.getAuth()
@@ -270,20 +277,29 @@
         })
       },
       formatTime(seconds) {
-        if (seconds === undefined || seconds === '' || seconds === null) {
-          return '--'
+        // 处理无效输入(空值/非数字)
+        if (seconds == null || seconds === '' || typeof seconds !== 'number') {
+          return '--';
         }
-        if (seconds >= 3600) {
-          // 转换为小时并保留整数部分
-          const hour = this.formatNumber(seconds / 3600);
-          return `${hour}小时`;
-        } else if (seconds >= 60) {
-          // 转换为分钟并保留整数部分
-          const minutes = this.formatNumber(seconds / 60);
-          return `${minutes}分钟`;
+        // 确定时间符号和绝对值
+        const isNegative = seconds < 0;
+        const absSeconds = Math.abs(seconds);
+        // 内部格式化函数(处理绝对值)
+        const format = (val, unit) => {
+          const num = Math.round(val);
+          return `${num}${unit}${num > 1 ? '们' : ''}`;
+        };
+        // 根据绝对值大小转换单位
+        let formatted;
+        if (absSeconds >= 3600) {
+          formatted = format(absSeconds / 3600, '小时');
+        } else if (absSeconds >= 60) {
+          formatted = format(absSeconds / 60, '分钟');
         } else {
-          return `${seconds}秒`;
+          formatted = format(absSeconds, '秒');
         }
+        // 添加负号(当原始值为负时)
+        return isNegative ? `-${formatted}` : formatted;
       },
       formatNumber(num) {
         const number = Number(num);
@@ -311,6 +327,11 @@
         // 返回指定参数的值,如果不存在则返回null  
         return urlParams.get(paramName);
       },
+      isUnknownType(value) {
+        // 1. 先检查是否为字符串类型
+        // 2. 再检查是否以"unknown"开头(区分大小写)
+        return typeof value === 'string' && value.startsWith('unknown');
+      }
     }
   })   
 </script>

+ 16 - 4
lottery/toFollowUpClient.html

@@ -124,10 +124,17 @@
         this.httpUrl = 'http://test.wefanbot.com:18993'
       }
       if (this.getQueryParam('memberId')) {
-        // 已授权
-        this.memberId = this.getQueryParam('memberId')
-        this.getQyWxSign()
-        this.executeDetail()
+        if (this.isUnknownType(this.getQueryParam('memberId'))) {
+          this.$message({
+            message: '员工未激活',
+            type: 'warning'
+          })
+        } else {
+          // 已授权
+          this.memberId = this.getQueryParam('memberId')
+          this.getQyWxSign()
+          this.executeDetail()
+        }
       } else {
         // 授权
         this.getAuth()
@@ -280,6 +287,11 @@
         // 返回指定参数的值,如果不存在则返回null  
         return urlParams.get(paramName);
       },
+      isUnknownType(value) {
+        // 1. 先检查是否为字符串类型
+        // 2. 再检查是否以"unknown"开头(区分大小写)
+        return typeof value === 'string' && value.startsWith('unknown');
+      }
     }
   })   
 </script>