소스 검색

王子文 月报趋势分析日期范围用户提示

wangggziwen 2 년 전
부모
커밋
679df8a013
2개의 변경된 파일19개의 추가작업 그리고 10개의 파일을 삭제
  1. 1 1
      ui/src/views/production/daily/index.vue
  2. 18 9
      ui/src/views/production/monthly/index.vue

+ 1 - 1
ui/src/views/production/daily/index.vue

@@ -4288,7 +4288,7 @@ export default {
         if (response.code == 200) {
           this.$message.success("修改成功");
         } else {
-          this.$message.error("未知错误,请联系管理员");
+          this.$message.error("未知错误,请联系管理员");
         }
         this.getReport();
       });

+ 18 - 9
ui/src/views/production/monthly/index.vue

@@ -1001,7 +1001,7 @@ export default {
         if (response.code == 200) {
           this.$message.success("修改成功");
         } else {
-          this.$message.error("未知错误,请联系管理员");
+          this.$message.error("未知错误,请联系管理员");
         }
         getEligibleProductRate(year).then(response => {
           this.tableEligibleProductRate = response.data;
@@ -1042,14 +1042,23 @@ export default {
     },
     /** 处理趋势分析时间区间change事件 */
     handleAnalysisTimeIntervalChange() {
-      this.disposeChart();
-      let startDate = this.analysisDialogElement.startDate;
-      let endDate = this.analysisDialogElement.endDate;
-      this.analysisQueryParams.fromYear = startDate.getFullYear();
-      this.analysisQueryParams.fromMonth = startDate.getMonth() + 1;
-      this.analysisQueryParams.toYear = endDate.getFullYear();
-      this.analysisQueryParams.toMonth = endDate.getMonth() + 1;
-      this.draw();
+      if (this.analysisDialogElement.startDate.getTime() >= this.analysisDialogElement.endDate.getTime()) {
+        let startDate = new Date();
+        let endDate = new Date();
+        startDate.setFullYear(startDate.getFullYear() - 1);
+        this.analysisDialogElement.startDate = startDate;
+        this.analysisDialogElement.endDate = endDate;
+        this.$message.info("开始日期不能大于等于结束日期,请重新选择日期范围。");
+      } else {
+        this.disposeChart();
+        let startDate = this.analysisDialogElement.startDate;
+        let endDate = this.analysisDialogElement.endDate;
+        this.analysisQueryParams.fromYear = startDate.getFullYear();
+        this.analysisQueryParams.fromMonth = startDate.getMonth() + 1;
+        this.analysisQueryParams.toYear = endDate.getFullYear();
+        this.analysisQueryParams.toMonth = endDate.getMonth() + 1;
+        this.draw();
+      }
     },
     /** 绘制趋势图 */
     draw() {