Преглед изворни кода

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_companyUI

lmx пре 3 дана
родитељ
комит
4b72b37fc8
1 измењених фајлова са 75 додато и 3 уклоњено
  1. 75 3
      src/views/course/courseRedPacketLog/index.vue

+ 75 - 3
src/views/course/courseRedPacketLog/index.vue

@@ -48,7 +48,28 @@
 	      @keyup.enter.native="handleQuery"
 	    />
 	  </el-form-item>
-		<el-form-item label="课程" prop="courseId">
+      <el-form-item label="营期" prop="courseId">
+        <el-select
+          v-model="queryParams.periodId"
+          placeholder="请选择课程"
+          filterable
+          clearable
+          size="small"
+          remote
+          :remote-method="remoteMethod"
+          :loading="loadingPeriod"
+          @focus="handleFocus"
+        >
+          <el-option
+            v-for="dict in periodLists"
+            :key="dict.periodId"
+            :label="dict.periodName"
+            :value="parseInt(dict.periodId)"
+          />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="课程" prop="courseId">
 		     <el-select filterable  v-model="queryParams.courseId" placeholder="请选择课程"  clearable size="small" @change="courseChange(queryParams.courseId)">
 		         <el-option
 		           v-for="dict in courseLists"
@@ -113,6 +134,7 @@
       <el-table-column type="selection" width="55" align="center" />
       <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="courseName" />
       <el-table-column label="小节名称" align="center" prop="title" />
       <el-table-column label="会员id" align="center" prop="userId" />
@@ -199,7 +221,7 @@
 <script>
 import { courseList,videoList,listCourseRedPacketLog,retryCourseRedPacketLog, myListCourseRedPacketLogNew, getCourseRedPacketLog, delCourseRedPacketLog, addCourseRedPacketLog, updateCourseRedPacketLog, exportCourseRedPacketLog } from "@/api/course/courseRedPacketLog";
 import { getCompanyList } from "@/api/company/company";
-
+import { periodList } from "@/api/course/userCoursePeriod";
 export default {
   name: "CourseRedPacketLog",
   data() {
@@ -208,6 +230,7 @@ export default {
 	  deptOptions:[],
       // 遮罩层
       loading: true,
+      loadingPeriod: false,
       // 导出遮罩层
       exportLoading: false,
       // 选中数组
@@ -220,6 +243,7 @@ export default {
       showSearch: true,
       activeName:"00",
       courseLists:[],
+      periodLists:[],
       videoList:[],
       // 总条数
       total: 0,
@@ -234,6 +258,7 @@ export default {
         pageNum: 1,
         pageSize: 10,
         courseId: null,
+        periodId: null,
         userId: null,
         nickName:null,
         videoId: null,
@@ -246,6 +271,10 @@ export default {
         phoneMk: null,
         sTime:null,
         eTime:null,
+      },
+      queryPeriod: {
+        pageNum: 1,
+        pageSize: 20
       },
 	   createTime:null,
       // 表单参数
@@ -263,9 +292,50 @@ export default {
 	  courseList().then(response => {
 	    this.courseLists = response.list;
 	  });
+    periodList(this.queryPeriod).then(response => {
+      this.periodLists = response.data;
+    });
   },
   methods: {
-	  handleClick(tab, event) {
+
+    // 远程搜索方法
+    async remoteMethod(query) {
+      this.searchKeyword = query
+      if (query !== '') {
+        this.loadingPeriod = true
+        await this.getPeriodList(query)
+        this.loadingPeriod = false
+      } else {
+        // 如果输入为空,可以清空列表或加载默认数据
+        this.periodLists = []
+      }
+    },
+
+    // 获取营期列表
+    async getPeriodList(keyword = '') {
+      try {
+        const params = {
+          periodName: keyword, // 搜索关键词
+          pageNum: 1,
+          pageSize: 50 // 根据需求调整
+        }
+
+        const response = await periodList(params)
+        this.periodLists = response.data.list || response.data || []
+      } catch (error) {
+        console.error('获取营期列表失败:', error)
+        this.periodLists = []
+      }
+    },
+    // 下拉框获取焦点时加载数据
+    async handleFocus() {
+      if (this.periodLists.length === 0) {
+        this.getPeriodList();
+      }
+    },
+
+
+    handleClick(tab, event) {
 	    this.activeName=tab.name;
 	    this.queryParams.status=tab.name
 	    console.log(this.queryParams.status)
@@ -313,6 +383,7 @@ export default {
       this.form = {
         logId: null,
         courseId: null,
+        periodId: null,
         userId: null,
         videoId: null,
         companyUserId: null,
@@ -334,6 +405,7 @@ export default {
 	   this.createTime=null;
 	  this.queryParams.sTime=null;
 	  this.queryParams.eTime=null;
+	  this.queryParams.periodId=null;
       this.handleQuery();
     },
     // 多选框选中数据