Преглед на файлове

恒春来
-红包记录新增营期+档期
今正
-增加手动关闭发群功能

lk преди 3 дни
родител
ревизия
48eb219603
променени са 3 файла, в които са добавени 289 реда и са изтрити 30 реда
  1. 8 0
      src/api/qw/sop.js
  2. 272 30
      src/views/course/courseRedPacketLog/index.vue
  3. 9 0
      src/views/system/config/config.vue

+ 8 - 0
src/api/qw/sop.js

@@ -121,3 +121,11 @@ export function updateSopQwUser(data) {
     data: data
   })
 }
+// 查询看课sop列表全部
+export function sopList(query) {
+  return request({
+    url: '/qw/sop/allList',
+    method: 'post',
+    data: query
+  })
+}

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

@@ -71,28 +71,7 @@
 	      size="small"
 	      @keyup.enter.native="handleQuery"
 	    />
-	  </el-form-item>
-
-      <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>      
 
 		<el-form-item label="课程" prop="courseId">
 		     <el-select filterable  v-model="queryParams.courseId" placeholder="请选择课程"  clearable size="small" @change="courseChange(queryParams.courseId)">
@@ -118,10 +97,119 @@
 	           <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
                              range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="change"></el-date-picker>
 	 </el-form-item>
-
+   <el-form-item label="发课方式" prop="sendType">
+	           <el-select 
+    v-model="sendType" 
+    placeholder="请选择发课方式"
+    size="small"
+    style="width: 220px"
+    @change="sendTypeChange"
+  >
+    <el-option label="手动发课" value="manual"></el-option>
+    <el-option label="自动发课" value="auto"></el-option>
+  </el-select>
+	</el-form-item>
+  <!-- 之前的营期,hcl要求做成营期+档期的样式 -->
+  <!-- <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="trainingCampId" v-if="periodShow">
+        <el-select
+          v-model="queryParams.trainingCampId"
+          placeholder="请选择课程"
+          filterable
+          clearable
+          size="small"
+          remote
+          :remote-method="remoteMethod2"
+          :loading="loadingPeriod2"
+          @focus="handleFocus2"
+          @change="campChange"
+        >
+          <el-option
+            v-for="dict in campLists"
+            :key="dict.trainingCampId"
+            :label="dict.trainingCampName"
+            :value="parseInt(dict.trainingCampId)"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="档期" prop="periodId" v-if="periodShow">
+        <el-select
+          v-model="queryParams.periodId"
+          placeholder="请选择档期"
+          filterable
+          clearable
+          size="small"
+          remote
+          :remote-method="remoteMethod3"
+          :loading="loadingPeriod3"
+          @focus="handleFocus3"
+          :disabled="!queryParams.trainingCampId"
+        >
+          <el-option
+            v-for="dict in periodListsNew"
+            :key="dict.periodId"
+            :label="dict.periodName"
+            :value="parseInt(dict.periodId)"
+          />
+        </el-select>
+      </el-form-item>
+      
+      <el-form-item label="营期" prop="sopId" v-if="!periodShow">
+        <el-select
+          v-model="queryParams.sopId"
+          placeholder="请选择课程"
+          filterable
+          clearable
+          size="small"
+          remote
+          :remote-method="remoteMethod1"
+          :loading="loadingPeriod1"
+          @focus="handleFocus1"
+          @change="handleSopChange"
+        >
+          <el-option
+            v-for="dict in sopLists"
+            :key="dict.id"
+            :label="dict.name"
+            :value="dict.id"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="档期" prop="sopDate" v-if="!periodShow">
+         <el-date-picker
+    v-model="queryParams.sopDate"
+    type="date"
+    placeholder="选择日期"
+    format="yyyy-MM-dd"
+    value-format="yyyy-MM-dd"
+    size="small"
+    style="width: 100%;"
+    :disabled="!queryParams.sopId"
+  />
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <!-- <el-button @click="testSopSelection" size="mini" >测试SOP选择</el-button> -->
       </el-form-item>
     </el-form>
 
@@ -216,7 +304,9 @@
 <script>
 import { courseList,videoList,getCourseRedPacketLog, delCourseRedPacketLog, addCourseRedPacketLog, updateCourseRedPacketLog, exportCourseRedPacketLog,listCourseRedPacketLogPage } from "@/api/course/courseRedPacketLog";
 import { getCompanyList } from "@/api/company/company";
-import { periodList } from "@/api/course/userCoursePeriod";
+import { periodList,pagePeriod } from "@/api/course/userCoursePeriod";
+import { sopList } from "@/api/qw/sop";
+import { listCamp } from "@/api/course/userCourseCamp"
 import {treeselect} from "../../../api/company/companyDept";
 import SelectTree from '@/components/TreeSelect/index.vue'
 import { getDeptData } from '@/api/system/employeeStats'
@@ -232,6 +322,9 @@ export default {
       // 遮罩层
       loading: true,
       loadingPeriod: false,
+      loadingPeriod1: false,
+      loadingPeriod2: false,
+      loadingPeriod3: false,
       // 导出遮罩层
       exportLoading: false,
       // 选中数组
@@ -258,6 +351,7 @@ export default {
         pageNum: 1,
         pageSize: 20
       },
+      querySop:{},
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -274,14 +368,29 @@ export default {
         phoneMk: null,
         sTime:null,
         eTime:null,
-        userIds: null
+        userIds: null,
+        sopId:null,
+        sopDate: null,
       },
 	   createTime:null,
       // 表单参数
       form: {},
       // 表单校验
       rules: {
-      }
+      },
+      //发课方式-手动,自动
+      sendType:"",
+      periodShow:"", 
+      sopLists:[],
+      campLists:[],
+      queryCamp:
+      {
+        pageNum:1,
+        pageSize:10,
+        hasNextPage:false,
+        scs:"order_number(desc),training_camp_id(desc)",
+      },
+      periodListsNew:[],
     };
   },
   created() {
@@ -298,6 +407,12 @@ export default {
     periodList(this.queryPeriod).then(response => {
 	    this.periodLists = response.data;
 	  });
+    // sopList(this.querySop).then(response => {
+	  //   this.sopLists = response.data;
+	  // });
+    // listCamp(this.queryCamp).then(response => {
+	  //   this.campLists = response.data.list;
+	  // })
 
     // this.getList();
   },
@@ -314,7 +429,51 @@ export default {
         this.periodLists = []
       }
     },
-
+    async remoteMethod3(query) {
+      if (query !== '') {
+        this.loadingPeriod3 = true
+        await this.getPeriodListNew(query)
+        this.loadingPeriod3 = false
+      } else {
+        // 如果输入为空,可以清空列表或加载默认数据
+        this.periodLists = []
+      }
+    },
+    async remoteMethod2(query) {
+      if (query !== '') {
+        this.loadingPeriod2 = true
+        await this.getCampList(query)
+        this.loadingPeriod2 = false
+      } else {
+        // 如果输入为空,可以清空列表或加载默认数据
+        this.campLists = []
+      }
+    },
+    async remoteMethod1(query) {
+      if (query !== '') {
+        this.loadingPeriod1 = true
+        await this.getSopList(query)
+        this.loadingPeriod1 = false
+      } else {
+        // 如果输入为空,可以清空列表或加载默认数据
+        this.sopLists = []
+        await this.getSopList();
+      }
+    },
+handleSopChange(value) {
+    console.log('选择的SOP ID:', value);
+  
+  // 清除可能的表单验证错误
+  this.$nextTick(() => {
+    if (this.$refs.queryForm) {
+      this.$refs.queryForm.clearValidate(['sopId']); // 如果有这个字段验证
+    }
+  });
+  // 如果选择了SOP,清空日期
+  if (!value) {
+    this.queryParams.sopDate = null;
+  }
+},
     // 获取营期列表
     async getPeriodList(keyword = '') {
       try {
@@ -331,14 +490,73 @@ export default {
         this.periodLists = []
       }
     },
+    async getPeriodListNew(keyword = '') {
+      try {
+        const params = {
+          periodName: keyword, // 搜索关键词
+          pageNum: 1,
+          pageSize: 50, // 根据需求调整
+          trainingCampId: this.queryParams.trainingCampId
+        }
+
+        const response = await pagePeriod(params)
+        this.periodListsNew = response.raw || response.data || []
+      } catch (error) {
+        console.error('获取营期列表失败:', error)
+        this.periodListsNew = []
+      }
+    }, 
+    async getSopList(keyword = '') {
+      try {
+        const params = {
+          name: keyword, // 搜索关键词
+        }
+        const response = await sopList(params)
+        this.sopLists = response.data.list || response.data || []
+      } catch (error) {
+        console.error('获取营期列表失败:', error)
+        this.sopLists = []
+      }
+    },
+    async getCampList(keyword = '') {
+      try {
+        const params = {
+          trainingCampName: keyword, // 搜索关键词
+          scs:"order_number(desc),training_camp_id(desc)",
+        }
+
+        const response = await listCamp(params)
+        this.campLists = response.data.list || response.data || []
+      } catch (error) {
+        console.error('获取营期列表失败:', error)
+        this.campLists = []
+      }
+    },
+    
     // 下拉框获取焦点时加载数据
     async handleFocus() {
       if (this.periodLists.length === 0) {
         this.getPeriodList();
       }
     },
-
-
+    async handleFocus1() {
+      if (this.sopLists.length === 0) {
+        this.getSopList();
+      }
+    },
+    async handleFocus2() {
+      if (this.campLists.length === 0) {
+        this.getCampList(this.queryCamp);
+      }
+    },
+    async handleFocus3() {
+      if (this.periodListsNew.length === 0) {
+        this.getPeriodListNew(this.queryParams.trainingCampId);
+      }
+    },
+    campChange(){
+      this.getPeriodListNew()
+    },
     handleClick(tab, event) {
 	    this.activeName=tab.name;
       if(tab.name == "00") {
@@ -419,6 +637,12 @@ export default {
       this.queryParams.pageNum = 1;    // Reset to first page
       this.queryParams.pageSize = 10;  // Reset to default page size
 	  this.queryParams.periodId=null;
+    this.queryParams.sopId = null;
+    this.queryParams.trainingCampId = null;
+    this.queryParams.sopDate = null;
+    this.sopLists = [];
+  this.campLists = [];
+  this.periodListsNew = [];
       this.handleQuery();
     },
     // 多选框选中数据
@@ -507,7 +731,25 @@ export default {
         }).catch(() => {}).finally(res=>{
 
       });
-    }
+    },
+    sendTypeChange(){
+      // 清空所有相关字段
+  this.queryParams.trainingCampId = null;
+  this.queryParams.periodId = null;
+  this.queryParams.sopId = null;
+  this.queryParams.sopDate = null;
+  // 清空选择器数据
+  this.sopLists = [];
+  this.campLists = [];
+  this.periodListsNew = [];
+      if(this.sendType === 'manual'){
+        this.periodShow = true;
+        this.getCampList();
+      }else if(this.sendType === 'auto'){
+        this.periodShow = false;
+        this.getSopList();
+      }
+    },
   }
 };
 </script>

+ 9 - 0
src/views/system/config/config.vue

@@ -1570,6 +1570,13 @@
               inactive-color="#ff4949">
             </el-switch>
           </el-form-item>
+          <el-form-item label="发课发群" prop="roomLinkAllow">
+            <el-switch
+              v-model="form18.roomLinkAllow"
+              active-color="#ff4949"
+              inactive-color="#13ce66">
+            </el-switch>
+          </el-form-item>
           <div class="line"></div>
           <div style="float:right;margin-right:20px">
             <el-button type="primary" @click="submitForm18">提交</el-button>
@@ -2601,6 +2608,7 @@ export default {
       activeName: 'sys.oss.cloudStorage',
       configId: null,
       storeOPtions: [],
+      roomLinkAllow:"",
       // 表单参数
       form1: {},
       form2: {},
@@ -2622,6 +2630,7 @@ export default {
       form17: {},
       form18: {
         viewCommentNum: 200,
+        roomLinkAllow:true,
       },
       form19: {},
       form20: {