Explorar el Código

判断结束时间不能大于开始时间

yangyd hace 3 años
padre
commit
a50a927e6f
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      src/pages/main/antiSpoofing/standingBook.vue

+ 6 - 0
src/pages/main/antiSpoofing/standingBook.vue

@@ -104,6 +104,12 @@
             },
             //搜索数据
             searchInfo(v) {
+                if (v[1].getTime() < v[0].getTime()){
+                    this.$message.warning(
+                        "开始时间不能大于结束时间!!"
+                    );
+                    return
+                }
                 this.params = new FormData();
                 this.params.append("startDate", v[0] ?  this.$formatDate(v[0], "YYYY-MM") + '-01'  : '');
                 this.params.append("endDate", v[1] ? this.$formatDate(v[1], "YYYY-MM") + '-01'  : '');