huangbin 4 år sedan
förälder
incheckning
9438a1b311

+ 13 - 8
src/utils/time/index.ts

@@ -22,13 +22,18 @@ export function getRangeTime(val1: Time, val2: Time, type = 'YYYYMMDD'): string[
     // 处理开始时间和结束时间
     let startTime = fn(val1)
     let endTime = fn(val2)
-    if (moment(startTime).isAfter(moment(endTime))) {
-        [startTime, endTime] = [endTime, startTime]
+    const isSame = () => moment(startTime).isSame(moment(endTime))
+    if (isSame()) {
+        return [startTime, startTime]
+    } else {
+        if (moment(startTime).isAfter(moment(endTime))) {
+            [startTime, endTime] = [endTime, startTime]
+        }
+        while (!isSame()) {
+            result.push(startTime)
+            startTime = moment(startTime).add(1, 'd').format(type)
+        }
+        result.push(endTime)
+        return result
     }
-    while (!moment(startTime).isSame(moment(endTime))) {
-        result.push(startTime)
-        startTime = moment(startTime).add(1, 'd').format(type)
-    }
-    result.push(endTime)
-    return result
 }

+ 2 - 0
src/views/platinum/platinum_recharge_withdrawal_review/setup.ts

@@ -37,6 +37,8 @@ export function handleTableStatus(queryTable: Function) {
         return getApplyStatus(tableStatus.value)
     }
     function search(value: any) {
+        console.log(value);
+
         const { accountcode, applystatus, reqtime } = value;
         // 申请起始日期
         const begindate = reqtime.length > 1 ? reqtime[0] : '';