Pārlūkot izejas kodu

北京存在:新增会员营期课程选择课程选择自动生成对营期课程

liupeng 1 mēnesi atpakaļ
vecāks
revīzija
e4b57b9983
3 mainītis faili ar 102 papildinājumiem un 42 dzēšanām
  1. 40 0
      .env.prod-czt
  2. BIN
      src/assets/logo/czt.png
  3. 62 42
      src/views/course/userCoursePeriod/index.vue

+ 40 - 0
.env.prod-czt

@@ -0,0 +1,40 @@
+# 页面标题
+VUE_APP_TITLE =内蒙古纯正堂互联网医院管理系统
+# 首页菜单标题
+VUE_APP_TITLE_INDEX =内蒙古纯正堂互联网医院
+# 公司名称
+VUE_APP_COMPANY_NAME =内蒙古纯正堂大药房有限公司
+# ICP备案号
+VUE_APP_ICP_RECORD =京ICP备2024053040号-5
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/czt.png
+# 存储桶配置
+VUE_APP_OBS_ACCESS_KEY_ID = K2UTJGIN7UTZJR2XMXYG
+# 存储桶配置
+VUE_APP_OBS_SECRET_ACCESS_KEY = sbyeNJLbcYmH6copxeFP9pAoksM4NIT9Zw4x0SRX
+# 存储桶配置
+VUE_APP_OBS_SERVER = https://obs.cn-north-4.myhuaweicloud.com
+# 存储桶配置
+VUE_APP_OBS_BUCKET = czt-hw079058881
+# 存储桶配置
+VUE_APP_COS_BUCKET = czt-1323137866
+# 存储桶配置
+VUE_APP_COS_REGION = ap-chongqing
+# 线路一地址
+VUE_APP_VIDEO_LINE_1 = https://czttcpv.ylrzcloud.com
+# 线路二地址
+VUE_APP_VIDEO_LINE_2 = https://cztobs.ylrztop.com
+
+# 开发环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 1
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

BIN
src/assets/logo/czt.png


+ 62 - 42
src/views/course/userCoursePeriod/index.vue

@@ -307,6 +307,16 @@
             :clearable="true">
           </el-date-picker>
         </el-form-item>
+        <el-form-item label="课程选择" prop="courseId" v-if="courseSelectionIsAdd">
+          <el-select v-model="form.courseId" placeholder="请选课程" filterable clearable size="small" >
+            <el-option
+              v-for="dict in courseSelection"
+              :key="dict.courseId"
+              :label="dict.courseName"
+              :value="dict.courseId"
+            />
+          </el-select>
+        </el-form-item>
       </el-form>
       <div class="drawer-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -368,15 +378,15 @@
         </el-form-item>
         <el-form-item label="小节" prop="videoIds">
           <div style="display: flex; align-items: center; gap: 10px; width: 100%;">
-            <el-select 
-              filterable 
-              v-model="course.form.videoIds" 
-              placeholder="请选择小节" 
-              :multiple-limit="getDiff(periodSettingsData.periodStartingTime, periodSettingsData.periodEndTime) - course.total" 
-              multiple 
-              clearable 
-              size="small" 
-              style="flex: 1" 
+            <el-select
+              filterable
+              v-model="course.form.videoIds"
+              placeholder="请选择小节"
+              :multiple-limit="getDiff(periodSettingsData.periodStartingTime, periodSettingsData.periodEndTime) - course.total"
+              multiple
+              clearable
+              size="small"
+              style="flex: 1"
               :value-key="'dictValue'"
             >
               <el-option
@@ -386,9 +396,9 @@
                 :value="parseInt(dict.dictValue)"
               />
             </el-select>
-            <el-button 
-              type="primary" 
-              size="small" 
+            <el-button
+              type="primary"
+              size="small"
               @click="handleBatchSelectSections"
               :disabled="!course.form.courseId || !videoList || videoList.length === 0"
               title="一键选择所有可用小节"
@@ -644,6 +654,7 @@ import BatchRedPacket from './batchRedPacket.vue'
 import CourseStatistics from './statistics.vue'
 import Da from "element-ui/src/locale/lang/da";
 import { getConfigByKey } from '@/api/system/config'
+ import {listUserCourse} from "@/api/course/userCourse";
 export default {
   name: "Period",
   components: {
@@ -863,6 +874,9 @@ export default {
       batchSetRedPacketDisabled: true,
       // 批量设置红包弹出框
       batchRedPacketVisible: false,
+      //课程选择
+      courseSelection: [],
+      courseSelectionIsAdd: true, // 默认新增状态,编辑时会设为false
     };
   },
   created() {
@@ -873,7 +887,10 @@ export default {
     // this.getList();
     this.getLeftList();
     this.getCompanyList();
-
+    /** 获取课程下拉框*/
+    listUserCourse().then(response => {
+      this.courseSelection = response.rows;
+    });
   },
   methods: {
     /** 删除按钮操作 */
@@ -975,6 +992,7 @@ export default {
     },
     /** 新增按钮操作 */
     handleAdd() {
+      this.courseSelectionIsAdd = true;
       this.reset();
       this.open = true;
       this.title = "添加会员营期";
@@ -982,6 +1000,7 @@ export default {
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
+      this.courseSelectionIsAdd = false;
       this.reset();
       const periodId = row.periodId || this.ids
       getPeriod(periodId).then(response => {
@@ -1008,31 +1027,32 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
+          // 显示加载提示(全屏遮罩+转圈)
+          const loading = this.$loading({
+            lock: true, // 锁定屏幕滚动
+            text: '提交中,请稍候...', // 提示文本
+            spinner: 'el-icon-loading', // 加载图标
+            background: 'rgba(0, 0, 0, 0.7)' // 背景遮罩
+          });
           let data = JSON.parse(JSON.stringify(this.form));
           // 处理看课时间范围
           if (data.timeRange && data.timeRange.length === 2) {
             data.viewStartTime = data.timeRange[0];
             data.viewEndTime = data.timeRange[1];
           }
-          data.companyId = data.companyId.join()
-          data.trainingCampId = this.queryParams.trainingCampId
-          if (data.periodId != null) {
-            updatePeriod(data).then(response => {
-              if (response.code === 200) {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
-              }
-            });
-          } else {
-            addPeriod(data).then(response => {
-              if (response.code === 200) {
-                this.msgSuccess("新增成功");
-                this.open = false;
-                this.getList();
-              }
-            });
-          }
+          data.companyId = data.companyId.join();
+          data.trainingCampId = this.queryParams.trainingCampId;
+          const request = data.periodId != null ? updatePeriod(data) : addPeriod(data);
+          request.then(response => {
+            if (response.code === 200) {
+              this.msgSuccess(data.periodId != null ? "修改成功" : "新增成功");
+              this.open = false;
+              this.getList();
+            }
+          }).finally(() => {
+            // 无论成功失败,都关闭加载提示
+            loading.close();
+          });
         }
       });
     },
@@ -1540,13 +1560,13 @@ export default {
             this.course.form.startTime = this.course.form.timeRange[0];
             this.course.form.endTime1 = this.course.form.timeRange[1];
           }
-          
+
           // 检查是否有选择的小节
           if (!this.course.form.videoIds || this.course.form.videoIds.length === 0) {
             this.$message.warning('请选择至少一个小节');
             return;
           }
-          
+
           // 如果选择了多个小节,使用批量添加接口
           if (this.course.form.videoIds.length > 1) {
             const batchData = {
@@ -1558,7 +1578,7 @@ export default {
               endDateTime: this.course.form.endTime1, // 添加endDateTime参数
               joinTime: this.course.form.joinTime
             };
-            
+
             // 调用批量添加小节接口
             batchAddCourseSections(batchData).then(response => {
               if (response.code === 200) {
@@ -1590,12 +1610,12 @@ export default {
         this.$message.warning('请先选择课程');
         return;
       }
-      
+
       if (!this.videoList || this.videoList.length === 0) {
         this.$message.warning('该课程下暂无可选择的小节');
         return;
       }
-      
+
       this.$confirm('确认要批量选择所有小节吗?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -1603,10 +1623,10 @@ export default {
       }).then(() => {
         // 获取所有可用的小节ID
         const allVideoIds = this.videoList.map(video => parseInt(video.dictValue));
-        
+
         // 获取剩余可选择数量
         const remainingLimit = this.getDiff(this.periodSettingsData.periodStartingTime, this.periodSettingsData.periodEndTime) - this.course.total;
-        
+
         // 调试信息
         console.log('批量选择调试信息:', {
           营期开始时间: this.periodSettingsData.periodStartingTime,
@@ -1616,15 +1636,15 @@ export default {
           剩余可选择数量: remainingLimit,
           可用小节总数: allVideoIds.length
         });
-        
+
         // 只选择剩余数量内的小节
         const selectedVideoIds = allVideoIds.slice(0, remainingLimit);
-        
+
         if (selectedVideoIds.length === 0) {
           this.$message.warning('已达到营期天数限制,无法添加更多小节');
           return;
         }
-        
+
         // 将选中的小节ID设置到表单中(只是选择,不调用API)
         this.course.form.videoIds = selectedVideoIds;
         this.$message.success(`批量选择成功,已选择 ${selectedVideoIds.length} 个小节`);