Browse Source

Revert "检测管理有效期字段计算代码更改"

This reverts commit 7c3ddce1ad99747441632e869fc8a1b39757e70f.
CHINAMI-P698360\Administrator 1 year ago
parent
commit
e8e23358e2

+ 4 - 12
src/views/system/jbdScan/js/manualConfirmationJS.js

@@ -627,12 +627,8 @@ export default {
                                 var maxAge
                                 repostCurd('sql', sql).then((res) => {
                                     const { data = [] } = res.variables || {}
-                                    maxAge = data.reduce((max, person) => {
-                                        // 将age从字符串转换为数字
-                                        const  maxNum = parseInt(person.bao_gao_zhou_qi_g)
-                                        // 使用三元表达式比较并更新最大值
-                                        return maxNum > max ? maxNum : max
-                                    }, 0)
+                                    maxAge = data.reduce((max, person) => person.bao_gao_zhou_qi_g > max ? person.bao_gao_zhou_qi_g : max, data[0].bao_gao_zhou_qi_g)
+
                                     const currentDate = new Date()
 
                                     //  创建一个新的日期对象,表示当前日期加上3天
@@ -898,12 +894,8 @@ export default {
                                         var maxAge
                                         repostCurd('sql', sql).then((res) => {
                                             const { data = [] } = res.variables || {}
-                                            maxAge = data.reduce((max, person) => {
-                                                // 将age从字符串转换为数字
-                                                const  maxNum = parseInt(person.bao_gao_zhou_qi_g)
-                                                // 使用三元表达式比较并更新最大值
-                                                return maxNum > max ? maxNum : max
-                                            }, 0)
+                                            maxAge = data.reduce((max, person) => person.bao_gao_zhou_qi_g > max ? person.bao_gao_zhou_qi_g : max, data[0].bao_gao_zhou_qi_g)
+
                                             const currentDate = new Date()
 
                                             //  创建一个新的日期对象,表示当前日期加上3天

+ 4 - 12
src/views/system/jbdScan/js/sampleConfirmationJS.js

@@ -569,12 +569,8 @@ export default {
                                 var maxAge
                                 repostCurd('sql', sql).then((res) => {
                                     const { data = [] } = res.variables || {}
-                                    maxAge = data.reduce((max, person) => {
-                                        // 将age从字符串转换为数字
-                                        const  maxNum = parseInt(person.bao_gao_zhou_qi_g)
-                                        // 使用三元表达式比较并更新最大值
-                                        return maxNum > max ? maxNum : max
-                                    }, 0)
+                                    maxAge = data.reduce((max, person) => person.bao_gao_zhou_qi_g > max ? person.bao_gao_zhou_qi_g : max, data[0].bao_gao_zhou_qi_g)
+
                                     const currentDate = new Date()
 
                                     //  创建一个新的日期对象,表示当前日期加上3天
@@ -840,12 +836,8 @@ export default {
                                         var maxAge
                                         repostCurd('sql', sql).then((res) => {
                                             const { data = [] } = res.variables || {}
-                                            maxAge = data.reduce((max, person) => {
-                                                // 将age从字符串转换为数字
-                                                const  maxNum = parseInt(person.bao_gao_zhou_qi_g)
-                                                // 使用三元表达式比较并更新最大值
-                                                return maxNum > max ? maxNum : max
-                                            }, 0)
+                                            maxAge = data.reduce((max, person) => person.bao_gao_zhou_qi_g > max ? person.bao_gao_zhou_qi_g : max, data[0].bao_gao_zhou_qi_g)
+
                                             const currentDate = new Date()
 
                                             //  创建一个新的日期对象,表示当前日期加上3天