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

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

caoliqin пре 12 часа
родитељ
комит
9bdba2ebdc

+ 8 - 0
src/api/course/userCourseVideo.js

@@ -136,4 +136,12 @@ export function getChooseCourseVideoList(query) {
   })
 }
 
+// 下架课堂视频
+export function batchDownUserCourseVideo(videoId) {
+  return request({
+    url: '/course/userCourseVideo/batchDown/' + videoId,
+    method: 'post'
+  })
+}
+
 

+ 21 - 1
src/views/components/course/userCourseCatalogDetails.vue

@@ -49,6 +49,11 @@
                    v-hasPermi="['course:userCourseVideo:sync']">同步模板数据
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button type="primary" plain icon="el-icon-edit" size="mini" :disabled="multiple" @click="handleDown"
+                   v-hasPermi="['course:userCourseVideo:batchDown']">批量下架
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <el-table border v-loading="loading" :data="userCourseVideoList" @selection-change="handleSelectionChange">
@@ -483,7 +488,7 @@ import {
   sortCourseVideo,
   updates,
   updateUserCourseVideo,
-  syncTemplate
+  syncTemplate, batchDownUserCourseVideo
 } from '@/api/course/userCourseVideo'
 // import {syncTemplate} from '@/api/course/userCourse'
 import QuestionBank from "@/views/course/courseQuestionBank/QuestionBank.vue";
@@ -1295,6 +1300,21 @@ export default {
         }
       });
     },
+    /** 下架 **/
+    handleDown() {
+      const videoIds = this.ids;
+      this.$confirm('是否确认下架视频编号为"' + videoIds + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return batchDownUserCourseVideo(videoIds);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("下架成功");
+      }).catch(() => {
+      });
+    },
 
   }
 }

+ 35 - 35
src/views/components/his/integralOrderDetails.vue

@@ -106,7 +106,7 @@
 
       </el-table>
     </div>
-    
+
     <!-- 操作记录 -->
     <div class="contentx" v-if="item != null" style="padding-bottom: 70px;">
       <div class="desct">
@@ -124,7 +124,7 @@
         </el-table-column>
         <!-- <el-table-column prop="operator" label="操作员" align="center" width="120">
         </el-table-column> -->
-        
+
       </el-table>
     </div>
     <el-dialog width="35%" title="发货" :visible.sync="sendVisible" append-to-body @close="sendCancel">
@@ -173,7 +173,7 @@
 
             </el-table>
 
-            
+
             <el-pagination small layout="prev, pager, next" :total="total" :page-size="queryParams.pageSize"
               :current-page="queryParams.pageNum" @current-change="handlePageChange"
               style="margin-top: 10px; text-align: center;">
@@ -183,7 +183,7 @@
               提示:点击表格行选择代服账号
             </div>
 
-            
+
             <div v-if="selectedRow" style="margin-top: 10px; padding: 8px; background: #f5f7fa; border-radius: 4px;">
               <span style="color: #67C23A;">已选择:</span>
               <span>{{ selectedRow.loginAccount }} ({{ selectedRow.senderName }})</span>
@@ -232,9 +232,9 @@
         </el-form-item>
         <el-form-item label="收货地址" required v-if="item.status == 1">
           <div style="margin-bottom: 10px;">
-            <el-select 
-              v-model="selectedProvince" 
-              placeholder="请选择省" 
+            <el-select
+              v-model="selectedProvince"
+              placeholder="请选择省"
               style="width: 32%; margin-right: 1%"
               @change="onProvinceChange"
               clearable
@@ -246,10 +246,10 @@
                 :value="item"
               />
             </el-select>
-            
-            <el-select 
-              v-model="selectedCity" 
-              placeholder="请选择市" 
+
+            <el-select
+              v-model="selectedCity"
+              placeholder="请选择市"
               style="width: 32%; margin-right: 1%"
               @change="onCityChange"
               :disabled="!selectedProvince"
@@ -262,10 +262,10 @@
                 :value="item"
               />
             </el-select>
-            
-            <el-select 
-              v-model="selectedDistrict" 
-              placeholder="请选择区" 
+
+            <el-select
+              v-model="selectedDistrict"
+              placeholder="请选择区"
               style="width: 32%;"
               @change="onDistrictChange"
               :disabled="!selectedCity"
@@ -279,10 +279,10 @@
               />
             </el-select>
           </div>
-          
-          <el-input 
-            v-model="detailAddress" 
-            placeholder="请输入详细地址(街道、门牌号等)" 
+
+          <el-input
+            v-model="detailAddress"
+            placeholder="请输入详细地址(街道、门牌号等)"
             style="width: 100%"
             clearable
           />
@@ -290,9 +290,9 @@
 
         <!-- 其他状态显示只读的地址信息 -->
         <el-form-item label="收货地址" v-else>
-          <el-input 
-            v-model="editForm.userAddress" 
-            placeholder="请输入" 
+          <el-input
+            v-model="editForm.userAddress"
+            placeholder="请输入"
             disabled
           />
         </el-form-item>
@@ -599,7 +599,7 @@ export default {
         try {
           const response = await getCitys(); // 假设getCitys是您导入的方法
           this.provinceOptions = response.data || [];
-          
+
           // 如果现有地址不为空,尝试解析并设置初始值
           if (this.item.userAddress) {
             this.parseExistingAddress(this.item.userAddress);
@@ -613,7 +613,7 @@ export default {
     // 解析现有地址
     parseExistingAddress(address) {
       if (!address || this.item.status != 1) return;
-      
+
       // 假设地址格式为 "省 市 区 详细地址"
       const parts = address.split(' ');
       if (parts.length >= 4) {
@@ -621,19 +621,19 @@ export default {
         const cityName = parts[1];
         const districtName = parts[2];
         this.detailAddress = parts.slice(3).join(' '); // 剩余部分作为详细地址
-        
+
         // 设置省份
         const province = this.provinceOptions.find(p => p.label === provinceName);
         if (province) {
           this.selectedProvince = province;
           this.onProvinceChange(province);
-          
+
           // 设置城市
           const city = province.children?.find(c => c.label === cityName);
           if (city) {
             this.selectedCity = city;
             this.onCityChange(city);
-            
+
             // 设置区域
             const district = city.children?.find(d => d.label === districtName);
             if (district) {
@@ -696,14 +696,14 @@ export default {
         const city = this.selectedCity ? this.selectedCity.label : '';
         const district = this.selectedDistrict ? this.selectedDistrict.label : '';
         const detail = this.detailAddress || '';
-        
+
         // 使用空格拼接四个字段
         this.editForm.userAddress = `${province} ${city} ${district} ${detail}`.trim();
       } else {
         // 其他状态保持原地址不变
         this.editForm.userAddress = this.item.userAddress;
       }
-      
+
       this.$refs["editForm"].validate(valid => {
         if (valid) {
           updateIntegralOrder(this.editForm).then(response => {
@@ -782,10 +782,10 @@ export default {
     },
     sendGoods() {
       // 手动验证所有必填字段
-      if (!this.selectedRow) {
-        this.msgError('请选择代服账号');
-        return;
-      }
+      // if (!this.selectedRow) {
+      //   this.msgError('请选择代服账号');
+      //   return;
+      // }
 
       if (!this.form.deliveryName || !this.form.deliveryCode) {
         this.msgError('请选择快递公司');
@@ -912,7 +912,7 @@ export default {
         });
       });
     },
-    
+
     // 执行完成订单请求
     executeFinishOrder() {
       const orderCode = this.item.orderCode;
@@ -939,7 +939,7 @@ export default {
       if (!this.item || !this.item.orderId) {
         return;
       }
-      
+
       this.logsLoading = true;
       getOrderLogs(this.item.orderId).then(response => {
         if (response.code === 200) {

+ 56 - 3
src/views/course/videoResource/index.vue

@@ -20,9 +20,16 @@
         />
       </el-form-item>
       <el-form-item label="分类" prop="typeId">
-        <el-select v-model="queryParams.typeId" clearable placeholder="请选择分类" @change="val => changeCateType(val, 1)">
+        <el-select
+          v-model="queryParams.typeId"
+          clearable
+          placeholder="请选择或输入分类"
+          @change="val => changeCateType(val, 1)"
+          filterable
+          :filter-method="filterTypeOptions"
+          @visible-change="handleSelectVisibleChange">
           <el-option
-            v-for="item in rootTypeList"
+            v-for="item in filteredRootTypeList"
             :key="item.dictValue"
             :label="item.dictLabel"
             :value="item.dictValue">
@@ -785,6 +792,8 @@ export default {
   },
   data() {
     return {
+      filteredRootTypeList: [], // 过滤后的分类列表
+      originalRootTypeList: [], // 原始分类列表
       // 遮罩层
       loading: true,
       // 选中数组
@@ -1156,9 +1165,53 @@ export default {
     },
     getRootTypeList() {
       getCatePidList().then(response => {
-        this.rootTypeList = response.data
+        this.rootTypeList = response.data;
+        this.originalRootTypeList = [...response.data]; // 保存原始数据
+        this.filteredRootTypeList = [...response.data]; // 初始化过滤列表
+      });
+    },
+    /** 过滤分类选项 */
+    filterTypeOptions(query) {
+      if (!query) {
+        this.filteredRootTypeList = [...this.originalRootTypeList];
+        return;
+      }
+
+      this.filteredRootTypeList = this.originalRootTypeList.filter(item => {
+        return item.dictLabel.toLowerCase().includes(query.toLowerCase()) ||
+          item.dictValue.toString().includes(query);
+      });
+    },
+    /** 选择后重置过滤 */
+    onTypeSelect(value) {
+      // 确保选中后恢复完整列表
+      this.filteredRootTypeList = [...this.originalRootTypeList];
+      // 触发 change 事件
+      this.changeCateType(value, 1);
+    },
+    /** 重置过滤 */
+    resetFilter() {
+      this.filteredRootTypeList = [...this.originalRootTypeList];
+    },
+
+    /** 清除过滤 */
+    clearFilter() {
+      this.$nextTick(() => {
+        if (!this.queryParams.typeId) {
+          this.filteredRootTypeList = [...this.originalRootTypeList];
+        }
       });
     },
+    /** 处理下拉框显示状态变化 */
+    handleSelectVisibleChange(visible) {
+      if (!visible) {
+        // 下拉框关闭时恢复完整列表
+        this.filteredRootTypeList = [...this.originalRootTypeList];
+      } else {
+        // 下拉框打开时也确保列表完整
+        this.filteredRootTypeList = [...this.originalRootTypeList];
+      }
+    },
     async changeCateType(val, type) {
       if (type === 1) {
         this.queryParams.typeSubId = null