Przeglądaj źródła

今正-积分统计

三七 4 dni temu
rodzic
commit
e263c9b7df
1 zmienionych plików z 22 dodań i 7 usunięć
  1. 22 7
      src/views/statistics/integralCount/index.vue

+ 22 - 7
src/views/statistics/integralCount/index.vue

@@ -1,12 +1,14 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
-      <el-form-item label="时间" prop="consumptionDate">
+      <el-form-item label="时间" prop="dateRange">
         <el-date-picker clearable size="small"
-          v-model="queryParams.consumptionDate"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="时间">
+            v-model="dateRange"
+            type="daterange"
+            value-format="yyyy-MM-dd"
+            range-separator="-"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期">
         </el-date-picker>
       </el-form-item>
       <el-form-item label="类型" prop="logType">
@@ -125,8 +127,12 @@ export default {
         consumptionDate: null,
         integralConsume: null,
         integralRefund: null,
-        logType: null
+        logType: null,
+        beginDate: null,
+        endDate: null
       },
+      // 时间范围
+      dateRange: [],
       // 表单参数
       form: {},
       // 表单校验
@@ -144,7 +150,15 @@ export default {
     /** 查询通用积分消耗退还统计(不含看课领的积分)列表 */
     getList() {
       this.loading = true;
-      listIntegralCount(this.queryParams).then(response => {
+      const params = { ...this.queryParams };
+      if (this.dateRange && this.dateRange.length === 2) {
+        params.beginDate = this.dateRange[0];
+        params.endDate = this.dateRange[1];
+      } else {
+        params.beginDate = null;
+        params.endDate = null;
+      }
+      listIntegralCount(params).then(response => {
         this.integralCountList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -174,6 +188,7 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.dateRange = [];
       this.resetForm("queryForm");
       this.handleQuery();
     },