Explorar el Código

红包记录后台端默认增加时间条件查询

yys hace 1 semana
padre
commit
5fbe5458c0
Se han modificado 1 ficheros con 30 adiciones y 13 borrados
  1. 30 13
      src/views/course/courseRedPacketLog/index.vue

+ 30 - 13
src/views/course/courseRedPacketLog/index.vue

@@ -149,12 +149,13 @@
 <!--      <el-table-column label="记录编号" align="center" prop="logId" />-->
       <el-table-column label="批次单号" align="center" prop="outBatchNo" />
       <el-table-column label="营期名称" align="center" prop="periodName" />
-      <el-table-column label="课程名称" align="center" prop="courseId" >
-        <template slot-scope="scope">
-          <span prop="status" v-for="(item, index) in courseLists"    v-if="scope.row.courseId==item.dictValue">{{item.dictLabel}}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="小节名称" align="center" prop="title" />
+<!--      <el-table-column label="课程名称" align="center" prop="courseName" />-->
+<!--        <template slot-scope="scope">-->
+<!--          <span prop="status" v-for="(item, index) in courseLists"    v-if="scope.row.courseId==item.dictValue">{{item.dictLabel}}</span>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
+      <el-table-column label="课程名称" align="center" prop="courseName" />
+      <el-table-column label="小节名称" align="center" prop="videoName" />
       <el-table-column label="会员id" align="center" prop="userId" />
       <el-table-column label="会员名称" align="center" prop="fsNickName" />
       <el-table-column label="会员电话" align="center" prop="phone" />
@@ -285,6 +286,18 @@ export default {
     };
   },
   created() {
+    // 默认查询最近30天的数据
+    const now = new Date();
+    const thirtyDaysAgo = new Date();
+    thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30);
+    const pad = (n) => String(n).padStart(2, '0');
+    this.createTime = [
+      `${thirtyDaysAgo.getFullYear()}-${pad(thirtyDaysAgo.getMonth() + 1)}-${pad(thirtyDaysAgo.getDate())} 00:00:00`,
+      `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())} 23:59:59`
+    ];
+    this.queryParams.sTime = this.createTime[0];
+    this.queryParams.eTime = this.createTime[1];
+
     this.getList();
 	    getCompanyList().then(response => {
 	    this.companys = response.data;
@@ -295,11 +308,7 @@ export default {
     getDeptData().then(response => {
       this.deptList = response.data;
     })
-    periodList(this.queryPeriod).then(response => {
-	    this.periodLists = response.data;
-	  });
 
-    // this.getList();
   },
   methods: {
     // 远程搜索方法
@@ -412,9 +421,17 @@ export default {
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
-	   this.createTime=null;
-	  this.queryParams.sTime=null;
-	  this.queryParams.eTime=null;
+      // 重置后默认查询最近30天
+      const now = new Date();
+      const thirtyDaysAgo = new Date();
+      thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30);
+      const pad = (n) => String(n).padStart(2, '0');
+      this.createTime = [
+        `${thirtyDaysAgo.getFullYear()}-${pad(thirtyDaysAgo.getMonth() + 1)}-${pad(thirtyDaysAgo.getDate())} 00:00:00`,
+        `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())} 23:59:59`
+      ];
+      this.queryParams.sTime = this.createTime[0];
+      this.queryParams.eTime = this.createTime[1];
       this.selectedCompanyList = [];
       this.queryParams.pageNum = 1;    // Reset to first page
       this.queryParams.pageSize = 10;  // Reset to default page size