Răsfoiți Sursa

Enhancement report
https://dev.wormwood.com.sg/zentao/task-view-266.html

vbea 2 ani în urmă
părinte
comite
21f63b93bd
1 a modificat fișierele cu 24 adăugiri și 5 ștergeri
  1. 24 5
      Strides-Admin/src/views/report/ReportV2.vue

+ 24 - 5
Strides-Admin/src/views/report/ReportV2.vue

@@ -30,18 +30,19 @@
           :picker-options="pickerOptions"
           clearable
           @change="changeDateRange"
+          @clear="changeDateRange"
           class="filter-input"
           v-if="filter.pageVo.reportType === 'APENDIXF'"/>
         <el-date-picker
-          v-model="dateRange"
-          type="daterange"
+          v-model="monthRange"
+          type="monthrange"
           value-format="yyyy-MM"
           format="yyyy-MM"
           start-placeholder="Start Month"
           end-placeholder="End Month"
-          :picker-options="pickerOptions"
           clearable
-          @change="changeDateRange"
+          @change="changeMonthRange"
+          @clear="changeMonthRange"
           class="filter-input"
           v-if="filter.pageVo.reportType == 'MNTHADHOC'"/>
         <el-date-picker
@@ -245,6 +246,7 @@ export default {
         generate: false
       },
       dateRange: [],
+      monthRange: [],
       filter: {
         pageNo: 1,
         pageSize: 10,
@@ -253,6 +255,8 @@ export default {
           month: '',
           startDate: "",
           endDate: "",
+          startMonth: "",
+          endMonth: "",
           reportType: '',
           sitePks: [],
           groupPks: [],
@@ -328,13 +332,28 @@ export default {
       this.filter.pageVo.startDate = "";
       this.filter.pageVo.endDate = "";
       this.filter.pageVo.month = "";
+      this.filter.pageVo.startMonth = "";
+      this.filter.pageVo.endMonth = "";
       this.dateRange = [];
+      this.monthRange = [];
       this.$forceUpdate();
     },
     changeDateRange(range) {
-      if (this.dateRange.length == 2) {
+      if (this.dateRange && this.dateRange.length == 2) {
         this.filter.pageVo.startDate = this.dateRange[0]
         this.filter.pageVo.endDate = this.dateRange[1]
+      } else {
+        this.filter.pageVo.startDate = "";
+        this.filter.pageVo.endDate = "";
+      }
+    },
+    changeMonthRange(range) {
+      if (this.monthRange && this.monthRange.length == 2) {
+        this.filter.pageVo.startMonth = this.monthRange[0]
+        this.filter.pageVo.endMonth = this.monthRange[1]
+      } else {
+        this.filter.pageVo.startMonth = "";
+        this.filter.pageVo.endMonth = "";
       }
     },
     onSearch() {