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

Merge branch 'master' into feature_bjws

luolinsong пре 2 месеци
родитељ
комит
4c0dc68e64

+ 14 - 0
src/api/course/userWatchCourseStatistics.js

@@ -69,3 +69,17 @@ export function exportUserWatchCourseStatisticsTotal(query) {
     params: query
   })
 }
+export function getCourseList() {
+  return request({
+    url: '/course/userCourse/selectCourseOptionsList',
+    method: 'get'
+  })
+}
+
+export function getVideosByCourse(id) {
+  return request({
+    url: '/course/userCourseVideo/getCourseVideoOptions',
+    method: 'get',
+    params: { courseId: id }
+  })
+}

+ 15 - 1
src/api/his/packageOrder.js

@@ -90,4 +90,18 @@ export function exportPackageOrder(query) {
     method: 'get',
     params: query
   })
-}
+}
+export function courseReport(query) {
+  return request({
+    url: '/company/statistics/courseReport',
+    method: 'get',
+    params: query
+  })
+}
+export function exportCourseReport(query) {
+  return request({
+    url: '/company/statistics/exportFsCourseReportVO',
+    method: 'get',
+    params: query
+  })
+}

+ 19 - 1
src/api/qw/user.js

@@ -12,7 +12,7 @@ export function staffListUser(query) {
 export function staffListPost(query) {
   return request({
     url: '/qw/user/staffListPost',
-    method: 'post',
+    method: 'get',
     data: query
   })
 }
@@ -59,6 +59,24 @@ export function getMyQwCompanyList(query) {
     method: 'get'
   })
 }
+
+export function getMyQwCompanyListAll() {
+  return request({
+    url: '/qw/user/getMyQwCompanyListAll',
+    method: 'get'
+  })
+}
+
+
+
+export function getQwCompanyList() {
+  return request({
+    url: '/qw/user/getQwCompanyList',
+    method: 'get'
+  })
+}
+
+
 // 查询企微用户详细
 export function getQwUser(id) {
   return request({

+ 29 - 0
src/api/user/integral.js

@@ -0,0 +1,29 @@
+import request from '@/utils/request'
+
+// 查询用户列表
+export function listUser(query) {
+  return request({
+    url: '/user/integral/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询用户积分明细
+export function getIntegralLogs(userId, params = {}) {
+  return request({
+    url: '/user/integral/logs/' + userId,
+    method: 'get',
+    params: params
+  })
+}
+
+// 添加积分
+export function addIntegral(data) {
+  return request({
+    url: '/user/integral/add',
+    method: 'post',
+    data: data
+  })
+}
+

+ 10 - 7
src/views/company/companyUser/indexAll.vue

@@ -304,7 +304,7 @@
         <el-form-item label="企微公司" prop="corpId">
           <el-select v-model="synform.corpId" placeholder="企微公司"  >
             <el-option
-              v-for="dict in myQwCompanyList"
+              v-for="dict in qwCompanyList"
               :key="dict.dictValue"
               :label="dict.dictLabel"
               :value="dict.dictValue"
@@ -323,7 +323,7 @@
         <el-form-item label="企微公司" prop="corpId">
           <el-select v-model="synNameform.corpId" placeholder="企微公司"  >
             <el-option
-              v-for="dict in myQwCompanyList"
+              v-for="dict in qwCompanyList"
               :key="dict.dictValue"
               :label="dict.dictLabel"
               :value="dict.dictValue"
@@ -476,7 +476,7 @@
             <el-form-item label="企微主体" prop="corpId">
               <el-select v-model="formBindCompany.corpId" placeholder="企微主体" size="small">
                 <el-option
-                  v-for="dict in myQwCompanyList"
+                  v-for="dict in qwCompanyList"
                   :key="dict.dictValue"
                   :label="dict.dictLabel"
                   :value="dict.dictValue"
@@ -678,12 +678,12 @@ import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import {bindQwUser, addQwUser, getQwUserByIds,addQwUserName} from '@/api/qw/user';
 import { syncDept } from '@/api/qw/qwDept';
-import {getMyQwCompanyList } from "@/api/qw/user";
 import  selectUser  from "@/views/company/components/selectQwUser.vue";
 import { getConfigByKey } from "@/api/company/companyConfig";
 import axios from "axios";
 import selectDoctor from "@/views/qw/user/selectDoctor.vue";
 import { getCompanyList } from '@/api/company/company'
+import { getQwCompanyList } from '../../../api/qw/user'
 export default {
   name: "User",
   components: {selectDoctor, Treeselect ,selectUser},
@@ -707,7 +707,7 @@ export default {
       loading: false,
       qwUserList:[],
       qwUserId:[],
-      myQwCompanyList:[],
+      qwCompanyList:[],
       qwUser:[],
       user:{
         open:false,
@@ -921,8 +921,8 @@ export default {
     getCitysAreaList().then(res=>{
       this.citysAreaList=res.data;
     })
-    getMyQwCompanyList().then(response => {
-      this.myQwCompanyList = response.data;
+    getQwCompanyList().then(response => {
+      this.qwCompanyList = response.data;
     });
   },
   methods: {
@@ -1168,6 +1168,7 @@ export default {
         this.open = true;
         this.title = "添加员工";
         this.form.password = this.form1.loginPassword;
+        this.form.companyId = this.companyIdOpen.companyId;
       });
     },
 
@@ -1276,6 +1277,7 @@ export default {
               if (response.code === 200) {
                 this.msgSuccess("修改成功");
                 this.open = false;
+                this.companyIdOpen.open=false;
                 this.getList();
               }
             });
@@ -1284,6 +1286,7 @@ export default {
               if (response.code === 200) {
                 this.msgSuccess("新增成功");
                 this.open = false;
+                this.companyIdOpen.open=false;
                 this.getList();
               }
             });

+ 5 - 0
src/views/components/course/userCourseCatalogDetails.vue

@@ -8,6 +8,10 @@
         <el-input v-model="queryParams.title" placeholder="请输入小节名称" clearable size="small"
                   @keyup.enter.native="handleQuery"/>
       </el-form-item>
+      <el-form-item label="小节id" prop="videoId">
+        <el-input v-model="queryParams.videoId" placeholder="请输入小节id" clearable size="small"
+                  @keyup.enter.native="handleQuery"/>
+      </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>
@@ -603,6 +607,7 @@ export default {
         pageNum: 1,
         pageSize: 10,
         courseId: null,
+        videoId: null,
         title: null
       },
       addBatchData: {

+ 10 - 0
src/views/course/userCourse/index.vue

@@ -22,6 +22,15 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="课堂id" prop="courseId">
+        <el-input
+          v-model="queryParams.courseId"
+          placeholder="请输入课堂id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item label="课堂名称" prop="courseName">
         <el-input
           v-model="queryParams.courseName"
@@ -558,6 +567,7 @@ export default {
         hotRanking: null,
         integral: null,
         price: null,
+        courseId: null,
         isPrivate: 1,
         companyIdsList:[],
       },

+ 6 - 6
src/views/course/videoResource/index.vue

@@ -198,7 +198,7 @@
     />
 
     <!-- 添加或修改视频素材库对话框 -->
-    <minimizable-dialog :title="title" :visible.sync="open" width="700px" append-to-body :before-close="cancel"
+    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body :before-close="cancel"
                         @minimize="hasMinimizableDialog = true" @restore="hasMinimizableDialog = false">
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="素材名称" prop="resourceName" style="margin-top: 20px">
@@ -343,7 +343,7 @@
           {{ isUploading ? '上传中...' : '保存' }}
         </el-button>
       </div>
-    </minimizable-dialog>
+    </el-dialog>
 
     <el-dialog
       title="视频预览"
@@ -358,7 +358,7 @@
     </el-dialog>
 
     <!--批量修改弹框-->
-    <minimizable-dialog :title="'批量修改'" :visible.sync="batchUpdateVisible" width="700px" append-to-body :before-close="cancel"
+    <el-dialog :title="'批量修改'" :visible.sync="batchUpdateVisible" width="700px" append-to-body :before-close="cancel"
                         @minimize="hasMinimizableDialog = true" @restore="hasMinimizableDialog = false">
       <el-form ref="form" :model="batchUpdateForm" :rules="rules" label-width="80px">
       <el-form-item label="分类" prop="typeId">
@@ -387,9 +387,9 @@
         <el-button @click="cancelBatch">取 消</el-button>
         <el-button type="primary" @click="submitBatchUpdate">保 存</el-button>
       </div>
-    </minimizable-dialog>
+    </el-dialog>
     <!-- 批量选择视频弹窗 -->
-    <minimizable-dialog :title="'选择视频'" :visible.sync="batchAddVisible" width="1200px" append-to-body class="batch-dialog"
+    <el-dialog :title="'选择视频'" :visible.sync="batchAddVisible" width="1200px" append-to-body class="batch-dialog"
       :close-on-click-modal="false" :before-close="cancelBeforeBatch" @minimize="hasMinimizableDialog = true"
       @restore="hasMinimizableDialog = false">
       <div class="filter-container">
@@ -636,7 +636,7 @@
         </div>
       </el-dialog>
 
-    </minimizable-dialog>
+    </el-dialog>
 
     <!-- 项目选择弹窗 -->
     <el-dialog

+ 6 - 11
src/views/crm/externalContact/index.vue

@@ -787,18 +787,13 @@ import {
   setCustomerCourseSopList,
   unBindUserId, updateExternalContactCall
 } from '@/api/qw/externalContact'
-/*import {getMyQwUserList, getMyQwCompanyList, updateUser,getQwUserListLikeName} from "@/api/qw/user";*/
-import {getMyQwUserList, getMyQwCompanyList, updateUser} from "@/api/qw/user";
-import {listTag, getTag, searchTags,} from "@/api/qw/tag";
+
+import { getMyQwCompanyListAll } from '@/api/qw/user'
+import {listTag, searchTags,} from "@/api/qw/tag";
 import { allListTagGroup} from "@/api/qw/tagGroup";
-/*import mycustomer from '@/views/qw/externalContact/mycustomer'
-import customerDetails from '@/views/qw/externalContact/customerDetails'
-import SopDialog from '@/views/course/sop/SopDialog.vue'
-import  selectUser  from "@/views/qw/externalContact/selectUser.vue";
-import info from "@/views/qw/externalContact/info.vue";
-import { editTalk } from "@/api/qw/externalContactInfo";*/
+
 import PaginationMore from "../../../components/PaginationMore/index.vue";
-/*import userDetails from '@/views/store/components/userDetails.vue';*/
+
 export default {
   name: "ExternalContact",
   /*components:{PaginationMore, mycustomer,customerDetails,SopDialog,selectUser,info,userDetails},*/
@@ -1004,7 +999,7 @@ export default {
     });
 
 
-    getMyQwCompanyList().then(response => {
+    getMyQwCompanyListAll().then(response => {
             this.myQwCompanyList = response.data;
             if(this.myQwCompanyList!=null){
               // this.queryParams.corpId=this.myQwCompanyList[0].dictValue

+ 527 - 0
src/views/his/statistics/courseReport.vue

@@ -0,0 +1,527 @@
+<template>
+  <div class="app-container">
+    <!-- 添加维度切换Tab -->
+    <el-tabs v-model="activeDimension" @tab-click="handleDimensionChange">
+      <el-tab-pane label="公司维度" name="company"></el-tab-pane>
+      <el-tab-pane label="课程维度" name="course"></el-tab-pane>
+      <el-tab-pane label="小节维度" name="video"></el-tab-pane>
+    </el-tabs>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="85px">
+      <el-form-item label="公司名" prop="companyId" v-if="activeDimension === 'company'">
+        <el-select filterable v-model="queryParams.companyId" placeholder="请选择公司名"
+                   clearable size="small">
+          <el-option
+            v-for="item in companys"
+            :key="item.companyId"
+            :label="item.companyName"
+            :value="item.companyId"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="课程" prop="courseId" v-if="activeDimension === 'course'||activeDimension === 'video'">
+        <el-select filterable v-model="queryParams.courseId" placeholder="请选择课程"
+                   clearable size="small" @change="handleCourseChange">
+          <el-option
+            v-for="item in courses"
+            :key="item.courseId"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="小节" prop="videoId" v-if="activeDimension === 'video' && queryParams.courseId">
+        <el-select filterable v-model="queryParams.videoId" placeholder="请选择小节"
+                   clearable size="small">
+          <el-option
+            v-for="item in videos"
+            :key="item.videoId"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-form-item label="看课时间" prop="createTime">
+          <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd"
+                          type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
+                          @change="xdChange"></el-date-picker>
+        </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-form-item>
+    </el-form>
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+    <el-table height="500" v-loading="loading" border :data="packageOrderList">
+      <el-table-column label="销售公司" align="center" prop="companyName" width="120px"
+                       v-if="activeDimension === 'company'"/>
+      <el-table-column label="课程名称" align="center" prop="courseName"
+                       v-if="activeDimension === 'course'"/>
+      <el-table-column label="小节名称" align="center" prop="videoName"
+                       v-if="activeDimension === 'video'"/>
+      <el-table-column label="进线人数" align="center" prop="accessCount"/>
+      <el-table-column label="完课人数" align="center" prop="finishedCount"/>
+      <el-table-column label="完播数" align="center" prop="courseCompleteTimes"/>
+      <el-table-column label="完课率" align="center" prop="finishRate"/>
+    </el-table>
+    <div class="total-summary">
+      <span class="total-title">总计:</span>
+      <span class="total-item">进线人数: {{ calculatedTotalData.accessCount }}</span>
+      <span class="total-item">完课人数: {{ calculatedTotalData.finishedCount }}</span>
+      <span class="total-item">完课率: {{ calculatedTotalData.finishRate}}</span>
+      <span class="total-item">完播数: {{ calculatedTotalData.courseCompleteTimes }}</span>
+    </div>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import {
+  listPackageOrder, getPackageOrder, delPackageOrder, addPackageOrder, updatePackageOrder, exportPackageOrder,
+  PackageOrderReport, orderReport, courseReport, exportOrderReport, exportCourseReport
+} from "@/api/his/packageOrder";
+import {getCompanyList} from "@/api/company/company";
+import packageOrderDetails from '../../components/his/packageOrderDetails.vue';
+import {treeselect} from "@/api/company/companyDept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {getTask} from "@/api/common";
+import {getCourseList, getVideosByCourse} from "@/api/course/userWatchCourseStatistics";
+
+export default {
+  name: "PackageOrder",
+  components: {packageOrderDetails, Treeselect},
+  data() {
+    return {
+      normalizer: function(node) {
+        return {
+          id: node.id || node.dictValue,
+          label: node.label || node.dictLabel,
+          children: node.children
+        }
+      },
+      // 添加用于存储计算总和的数据
+      calculatedTotalData: {
+        accessCount: 0,
+        finishedCount: 0,
+        finishRate: '0%',
+        courseCompleteTimes: 0,
+      },
+      totalData: {},
+      companys: [],
+      courses: [],  // 课程列表
+      videos: [],   // 小节列表
+      activeDimension: 'company', // 当前激活的维度
+      companyId: undefined,
+      show: {
+        open: false,
+      },
+      sourceOptions: [],
+      actName: "2",
+      // 遮罩层
+      loading: true,
+      startTime: null,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      createTime: null,
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      endTime: null,
+      // 总条数
+      total: 0,
+      // 套餐订单表格数据
+      packageOrderList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 是否支付字典
+      isPayOptions: [],
+      // 状态字典
+      statusOptions: [],
+      refundStatusOptions: [],
+      packageSubTypeOptions: [],
+      payTypeOptions: [],
+      deliveryPayStatusOptions: [],
+      deliveryStatusOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orderSn: null,
+        userId: null,
+        doctorId: null,
+        doctorName: null,
+        phone: null,
+        phoneMk: null,
+        packageId: null,
+        packageName: null,
+        payMoney: null,
+        isPay: null,
+        days: null,
+        status: null,
+        startTime: null,
+        startDate: null,
+        endDate:null,
+        finishTime: null,
+        sTime: null,
+        eTime: null,
+        stTime: null,
+        endTime: null,
+        endStartTime: null,
+        endEndTime: null,
+        companyUserName: null,
+        companyName: null,
+        deptId: null,
+        source: null,
+        dimension: 'company',  // 添加维度参数
+        courseId: null,    // 课程ID
+        videoId: null     // 小节ID
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {}
+    };
+  },
+  created() {
+    // 设置默认时间为前一天
+    const yesterday = new Date();
+    yesterday.setDate(yesterday.getDate() - 1);
+    const formatDate = (date) => {
+      const year = date.getFullYear();
+      const month = String(date.getMonth() + 1).padStart(2, '0');
+      const day = String(date.getDate()).padStart(2, '0');
+      return `${year}-${month}-${day}`;
+    };
+    this.createTime = [formatDate(yesterday), formatDate(yesterday)];
+    this.queryParams.sTime = this.createTime[0];
+    this.queryParams.eTime = this.createTime[1];
+    // 获取课程列表
+    getCourseList().then(response => {
+      this.courses = response.data;
+    })
+    getCompanyList().then(response => {
+      this.companys = response.data;
+      if (this.companys != null && this.companys.length > 0) {
+        this.companyId = this.companys[0].companyId;
+      }
+      this.companys.push({companyId: "-1", companyName: "无"})
+    });
+    this.getList();
+  },
+  methods: {
+    /** 查询套餐订单列表 */
+    getList() {
+      this.loading = true;
+      this.queryParams.dimension = this.activeDimension;
+      let requestParams = { ...this.queryParams };
+      if (this.activeDimension === 'video') {
+        // 在小节维度下,如果已选择小节,只保留videoId,不传递courseId
+        if (requestParams.videoId) {
+          delete requestParams.courseId;
+        }
+      }
+      courseReport(requestParams).then(response => {
+        const rows = response.rows || [];
+        // 标准化数据,为缺失字段提供默认值
+        this.packageOrderList = rows.map(item => ({
+          ...item,
+          // 确保必需字段存在,如果缺失则提供默认值
+          companyName: item.companyName || '-',
+          courseName: item.courseName || '-',
+          videoName: item.videoName || '-',
+          accessCount: item.accessCount || 0,
+          finishedCount: item.finishedCount || 0,
+          courseCompleteTimes: item.courseCompleteTimes || 0,
+          finishRate: item.finishRate || '0%',
+        }));
+        console.log("列表数据:", this.packageOrderList);
+        this.total = response.total;
+        this.calculateTotals();
+      }).catch(error => {
+        // 即使接口返回错误,也要重置加载状态
+        console.error('获取数据失败:', error);
+        this.packageOrderList = [];
+        this.total = 0;
+      }).finally(() => {
+        // 无论成功或失败,都重置加载状态
+        this.loading = false;
+        // 延迟强制更新以确保DOM完全渲染
+        setTimeout(() => {
+          this.$forceUpdate();
+        }, 100);
+      });
+    },
+    calculateTotals() {
+      // 重置总计数据
+      this.calculatedTotalData = {
+        accessCount: 0,
+        finishedCount: 0,
+        courseCompleteTimes: 0,
+        finishRate: '0%',
+      };
+
+      // 遍历当前页数据计算总和
+      this.packageOrderList.forEach(item => {
+        this.calculatedTotalData.accessCount += Number(item.accessCount) || 0;
+        this.calculatedTotalData.finishedCount += Number(item.finishedCount) || 0;
+        this.calculatedTotalData.courseCompleteTimes += Number(item.courseCompleteTimes) || 0;
+      });
+
+      if (this.calculatedTotalData.accessCount > 0) {
+        // 完课率 = 完课人数 / 进线人数
+        this.calculatedTotalData.finishRate = ((this.calculatedTotalData.finishedCount / this.calculatedTotalData.accessCount) * 100).toFixed(2) + '%';
+      } else {
+        this.calculatedTotalData.finishRate = '0.00%';
+      }
+    },
+    /** 维度切换处理 */
+    handleDimensionChange(tab) {
+      this.activeDimension = tab.name;
+      // 更新查询参数中的维度
+      this.queryParams.dimension = tab.name;
+
+      // 重置相关查询参数
+      if (this.activeDimension === 'company') {
+        // 公司维度,清空课程和小节参数
+        this.queryParams.courseId = null;
+        this.queryParams.videoId = null;
+      } else if (this.activeDimension === 'course') {
+        // 课程维度,清空公司和小节参数
+        this.queryParams.companyId = null;
+        this.queryParams.videoId = null;
+      } else if (this.activeDimension === 'video') {
+        // 保留 courseId 的选择状态,但清空 videoId
+        this.queryParams.videoId = null;
+      }
+
+      // 清空小节列表
+      this.videos = [];
+      // 重新获取数据
+      this.getList();
+    },
+    /** 课程变更处理 */
+    handleCourseChange(val) {
+      // 在课程维度和小节维度都需要处理课程变更
+      if (this.activeDimension === 'course' || this.activeDimension === 'video') {
+        this.queryParams.courseId = val;
+        this.queryParams.videoId = null; // 清空已选择的小节
+
+        if (val) {
+          // 根据课程ID获取对应的小节列表
+          this.getVideosByCourseId(val);
+        } else {
+          // 如果清空课程,也清空小节选项
+          this.videos = [];
+        }
+      }
+    },
+
+    /** 根据训练营获取营期数据 */
+    getVideosByCourseId(courseId) {
+      getVideosByCourse(courseId).then((response) => {
+        this.videos = response.data || [];
+      }).catch(error => {
+        console.error('获取小节数据失败:', error);
+        this.videos = [];
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        orderId: null,
+        orderSn: null,
+        userId: null,
+        doctorId: null,
+        packageId: null,
+        packageName: null,
+        payMoney: null,
+        isPay: null,
+        days: null,
+        status: 0,
+        startTime: null,
+        finishTime: null,
+        createTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      // 清空所有时间相关变量
+      this.createTime = null;
+      this.startTime = null;
+      this.endTime = null;
+
+      // 重置所有查询参数
+      this.queryParams = {
+        pageNum: null,
+        pageSize: null,
+        orderSn: null,
+        userId: null,
+        doctorId: null,
+        doctorName: null,
+        phone: null,
+        phoneMk: null,
+        packageId: null,
+        packageName: null,
+        payMoney: null,
+        isPay: null,
+        days: null,
+        status: null,
+        startTime: null,
+        finishTime: null,
+        sTime: null,
+        eTime: null,
+        stTime: null,
+        endTime: null,
+        endStartTime: null,
+        endEndTime: null,
+        companyUserName: null,
+        companyName: null,
+        deptId: null,
+        source: null,
+        dimension: this.activeDimension,  // 维持当前维度
+        companyId: null,  // 重置所有维度ID
+        courseId: null,
+        videoId: null,
+      };
+      // 重新获取课程列表
+      getCourseList().then(response => {
+        this.courses = response.data;
+      });
+      this.videos = [];
+      // 立即执行查询
+      this.handleQuery();
+    },
+    xdChange() {
+      if (this.createTime != null) {
+        this.queryParams.sTime = this.createTime[0];
+        this.queryParams.eTime = this.createTime[1];
+      } else {
+        this.queryParams.sTime = null;
+        this.queryParams.eTime = null;
+      }
+    },
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出完课统计报表', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportCourseReport(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {
+      });
+    },
+    endChange() {
+      if (this.endTime != null) {
+        this.queryParams.endStartTime = this.endTime[0];
+        this.queryParams.endEndTime = this.endTime[1];
+      } else {
+        this.queryParams.endStartTime = null;
+        this.queryParams.endEndTime = null;
+      }
+    }
+  }
+};
+</script>
+
+<style scoped>
+.total-summary {
+  margin-top: 15px;
+  padding: 15px 20px;
+  background: linear-gradient(135deg, #f5f7fa 0%, #e4e7f4 100%);
+  border: 1px solid #dcdfe6;
+  border-radius: 4px;
+  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
+  display: flex;
+  flex-wrap: wrap;
+  align-items: center;
+}
+
+.total-title {
+  font-weight: bold;
+  font-size: 16px;
+  color: #303133;
+  margin-right: 20px;
+  flex-shrink: 0;
+}
+
+.total-item {
+  margin-right: 25px;
+  padding: 5px 10px;
+  background: white;
+  border-radius: 3px;
+  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
+  display: inline-block;
+  margin-bottom: 5px;
+  font-size: 13px;
+  color: #606266;
+}
+
+.total-item::before {
+  content: "";
+  display: inline-block;
+  width: 3px;
+  height: 3px;
+  background: #409eff;
+  border-radius: 50%;
+  margin-right: 5px;
+  vertical-align: middle;
+}
+
+/* 响应式处理 */
+@media (max-width: 768px) {
+  .total-summary {
+    flex-direction: column;
+    align-items: flex-start;
+  }
+
+  .total-title {
+    margin-bottom: 10px;
+  }
+
+  .total-item {
+    margin-right: 10px;
+    margin-bottom: 8px;
+  }
+}
+</style>

+ 2 - 2
src/views/hisStore/storeAfterSales/index.vue

@@ -373,10 +373,10 @@ export default {
         ...this.queryParams,
         deliverySn: this.queryParams.returnDeliverySn || this.queryParams.deliverySn
       };
-      if(!!params.hfOrderCode && params.hfOrderCode.indexOf("-") > -1){
+/*       if(!!params.hfOrderCode && params.hfOrderCode.indexOf("-") > -1){
         let ss = params.hfOrderCode.split("-");
         params.hfOrderCode = ss[1];
-      }
+      } */
       listStoreAfterSales(this.addDateRange(params, this.dateRange)).then(response => {
         this.storeAfterSalesList = response.rows;
         this.total = response.total;

+ 28 - 1
src/views/hisStore/storeProduct/index.vue

@@ -827,6 +827,17 @@
               <el-input-number :min="0"  v-model="form.sales" placeholder="请输入销量" />
             </el-form-item>
           </el-col>
+          <el-col :span="8">
+            <el-form-item label="限购数量" prop="purchaseLimit">
+              <el-input-number
+                :min="0"
+                v-model="form.purchaseLimit"
+                placeholder="请输入限购数量"
+                :controls="true"
+                @input="handlePurchaseLimitInput"
+              />
+            </el-form-item>
+          </el-col>
 
         </el-row>
         <el-form-item label="推广分类" prop="tuiCateId">
@@ -1386,6 +1397,21 @@ export default {
       this.formDynamic.attrsName = '';
       this.formDynamic.attrsVal = '';
     },
+    // 处理限购数量输入
+    handlePurchaseLimitInput(value) {
+      // 只允许输入纯数字
+      if (value !== null && value !== undefined && value !== '') {
+        // 如果不是数字,设置为null
+        if (isNaN(value) || value < 0) {
+          this.$nextTick(() => {
+            this.form.purchaseLimit = null;
+          });
+        } else {
+          // 确保是整数
+          this.form.purchaseLimit = Math.floor(Number(value));
+        }
+      }
+    },
     // 删除规格
     handleRemoveRole (index) {
       this.attrs.splice(index, 1);
@@ -1550,7 +1576,8 @@ export default {
         dosage: null, // 用法用量
         adverseReactions: null, // 不良反应
         contraindications: null, // 禁忌
-        precautions: null // 注意事项
+        precautions: null, // 注意事项
+        purchaseLimit: null // 限购数量
       };
       // 重置药品展示图
       this.drugImageArr = [];

+ 28 - 1
src/views/hisStore/storeProduct/indexZm.vue

@@ -900,6 +900,17 @@
               <el-input-number :min="0"  v-model="form.sales" placeholder="请输入销量" />
             </el-form-item>
           </el-col>
+          <el-col :span="8">
+            <el-form-item label="限购数量" prop="purchaseLimit">
+              <el-input-number
+                :min="0"
+                v-model="form.purchaseLimit"
+                placeholder="请输入限购数量"
+                :controls="true"
+                @input="handlePurchaseLimitInput"
+              />
+            </el-form-item>
+          </el-col>
 
         </el-row>
         <el-form-item label="推广分类" prop="tuiCateId">
@@ -1447,6 +1458,21 @@ export default {
       this.formDynamic.attrsName = '';
       this.formDynamic.attrsVal = '';
     },
+    // 处理限购数量输入
+    handlePurchaseLimitInput(value) {
+      // 只允许输入纯数字
+      if (value !== null && value !== undefined && value !== '') {
+        // 如果不是数字,设置为null
+        if (isNaN(value) || value < 0) {
+          this.$nextTick(() => {
+            this.form.purchaseLimit = null;
+          });
+        } else {
+          // 确保是整数
+          this.form.purchaseLimit = Math.floor(Number(value));
+        }
+      }
+    },
     // 删除规格
     handleRemoveRole (index) {
       this.attrs.splice(index, 1);
@@ -1616,7 +1642,8 @@ export default {
         dosage: null, // 用法用量
         adverseReactions: null, // 不良反应
         contraindications: null, // 禁忌
-        precautions: null // 注意事项
+        precautions: null ,// 注意事项
+        purchaseLimit: null // 限购数量
       };
       // 重置药品展示图
       this.drugImageArr = [];

+ 1 - 1
src/views/live/order/liveDetail.vue

@@ -75,7 +75,7 @@
           <el-descriptions-item label=" 企微主体" ><span v-if="item!=null"><dict-tag :options="qwSubjectOptions" :value="item.qwSubject"/></span></el-descriptions-item>
           <el-descriptions-item label="物流公司编码" ><span v-if="item!=null">{{item.deliveryCode}}</span></el-descriptions-item>
           <el-descriptions-item label="物流公司名称" ><span v-if="item!=null">{{item.deliveryName}}</span></el-descriptions-item>
-          <el-descriptions-item label="物流单号" ><span v-if="item!=null">{{item.deliverySn}}</span></el-descriptions-item>
+          <el-descriptions-item label="物流单号" ><span v-if="item!=null">{{item.deliveryId}}</span></el-descriptions-item>
           <el-descriptions-item label="发货时间" ><span v-if="item!=null">{{item.deliverySendTime}}</span></el-descriptions-item>
         </el-descriptions>
       </el-card>

+ 1 - 1
src/views/live/order/storeDetail.vue

@@ -93,7 +93,7 @@
             </el-descriptions-item>
             <el-descriptions-item label="物流单号"  >
                 <span v-if="order!=null">
-                  {{order.deliverySn || order.deliveryId}}
+                  {{order.deliveryId}}
                 </span>
             </el-descriptions-item>
             <el-descriptions-item label="发货时间"  >

+ 1 - 1
src/views/live/order/userDetail.vue

@@ -93,7 +93,7 @@
             </el-descriptions-item>
             <el-descriptions-item label="物流单号"  >
                 <span v-if="order!=null">
-                  {{order.deliverySn || order.deliveryId}}
+                  {{order.deliveryId}}
                 </span>
             </el-descriptions-item>
             <el-descriptions-item label="发货时间"  >

+ 1 - 1
src/views/qw/externalContact/index.vue

@@ -12,7 +12,7 @@
         </el-select>
       </el-form-item>
       <el-form-item label="销售账号" prop="companyUserName">
-        <el-select v-model="queryParams.companyUserName" placeholder="销售账号"  size="small" clearable>
+        <el-select v-model="queryParams.companyUserName" placeholder="销售账号"  size="small" filterable clearable  >
           <el-option
               v-for="dict in companyUserNameList"
               :key="dict.userId"

+ 61 - 61
src/views/qw/user/index.vue

@@ -176,11 +176,11 @@
 <!--        </template>-->
 <!--      </el-table-column>-->
 
-      <el-table-column label="自动发课" align="center" prop="isAuto">
-        <template slot-scope="scope">
-          <dict-tag :options="isAutoOptions" :value="scope.row.isAuto"/>
-        </template>
-      </el-table-column>
+<!--      <el-table-column label="自动发课" align="center" prop="isAuto">-->
+<!--        <template slot-scope="scope">-->
+<!--          <dict-tag :options="isAutoOptions" :value="scope.row.isAuto"/>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
         <template slot-scope="scope">
           <el-button
@@ -234,50 +234,50 @@
             v-hasPermi="['qw:user:login']">
             二次验证
           </el-button>
-          <el-button
-            v-if="scope.row.serverStatus!=1"
-            size="mini"
-            type="text"
-            icon="el-icon-moon"
-            plain
-            @click="handleGetQwIpad(scope.row)"
-            v-hasPermi="['qw:user:login']"
-          >
-            获取Ai主机
-          </el-button>
-          <el-button
-            v-if="scope.row.serverStatus==1 && scope.row.ipadStatus!=1"
-            size="mini"
-            type="text"
-            icon="el-icon-moon"
-            plain
-            @click="handleDelQwIpad(scope.row)"
-            v-hasPermi="['qw:user:login']"
-          >
-            解绑Ai主机
-          </el-button>
-          <el-button
-            v-if="scope.row.isAuto=='00'"
-            size="mini"
-            type="text"
-            icon="el-icon-moon"
-            plain
-            @click="handleUpdateIsAuto(scope.row,'01')"
-            v-hasPermi="['qw:user:isauto']"
-          >
-            启用插件
-          </el-button>
-          <el-button
-            v-if="scope.row.isAuto=='01'"
-            size="mini"
-            type="text"
-            icon="el-icon-moon"
-            plain
-            @click="handleUpdateIsAuto(scope.row,'00')"
-            v-hasPermi="['qw:user:isauto']"
-          >
-            禁用插件
-          </el-button>
+<!--          <el-button-->
+<!--            v-if="scope.row.serverStatus!=1"-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-moon"-->
+<!--            plain-->
+<!--            @click="handleGetQwIpad(scope.row)"-->
+<!--            v-hasPermi="['qw:user:login']"-->
+<!--          >-->
+<!--            获取Ai主机-->
+<!--          </el-button>-->
+<!--          <el-button-->
+<!--            v-if="scope.row.serverStatus==1 && scope.row.ipadStatus!=1"-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-moon"-->
+<!--            plain-->
+<!--            @click="handleDelQwIpad(scope.row)"-->
+<!--            v-hasPermi="['qw:user:login']"-->
+<!--          >-->
+<!--            解绑Ai主机-->
+<!--          </el-button>-->
+<!--          <el-button-->
+<!--            v-if="scope.row.isAuto=='00'"-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-moon"-->
+<!--            plain-->
+<!--            @click="handleUpdateIsAuto(scope.row,'01')"-->
+<!--            v-hasPermi="['qw:user:isauto']"-->
+<!--          >-->
+<!--            启用插件-->
+<!--          </el-button>-->
+<!--          <el-button-->
+<!--            v-if="scope.row.isAuto=='01'"-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-moon"-->
+<!--            plain-->
+<!--            @click="handleUpdateIsAuto(scope.row,'00')"-->
+<!--            v-hasPermi="['qw:user:isauto']"-->
+<!--          >-->
+<!--            禁用插件-->
+<!--          </el-button>-->
         </template>
       </el-table-column>
       <el-table-column label="主机" align="center" class-name="small-padding fixed-width" width="110px" fixed="right">
@@ -316,17 +316,17 @@
           <!--          >-->
           <!--            获取主机帐密-->
           <!--          </el-button>-->
-          <el-button
-            v-if="scope.row.loginCodeUrl!=null"
-            size="mini"
-            type="text"
-            icon="el-icon-moon"
-            plain
-            @click="handleUnbindCloudHost(scope.row)"
-            v-hasPermi="['qw:user:loginIpOut']"
-          >
-            解除主机
-          </el-button>
+<!--          <el-button-->
+<!--            v-if="scope.row.loginCodeUrl!=null"-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-moon"-->
+<!--            plain-->
+<!--            @click="handleUnbindCloudHost(scope.row)"-->
+<!--            v-hasPermi="['qw:user:loginIpOut']"-->
+<!--          >-->
+<!--            解除主机-->
+<!--          </el-button>-->
           <el-button
             size="mini"
             type="text"
@@ -903,7 +903,7 @@ export default {
     },
     getList() {
       this.loading = true;
-      staffListPost(this.queryParams).then(response => {
+      staffListUser(this.queryParams).then(response => {
         this.userList = response.rows;
         this.total = response.total;
         this.loading = false;

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

@@ -2451,6 +2451,19 @@
           </div>
         </el-form>
       </el-tab-pane>
+      <el-tab-pane label="声纹复刻配置" name="vc.config">
+        <el-form :model="form31" label-width="200px">
+          <el-form-item label="类型" prop="type">
+            <el-radio-group v-model="form31.type">
+              <el-radio :label="1">本地服务器</el-radio>
+              <el-radio :label="2">豆包</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          <div class="footer">
+            <el-button type="primary" @click="submitForm31">提 交</el-button>
+          </div>
+        </el-form>
+      </el-tab-pane>
 
     </el-tabs>
 
@@ -2643,6 +2656,7 @@ export default {
         ],
 
       },
+      form31:{},
       storeProductScrmColumns:[],
       storeScrmColumns: [],
       photoArr: [],
@@ -3044,6 +3058,13 @@ export default {
           this.form30 = {...this.form30, ...JSON.parse(response.data.configValue)}
           }
         }
+        if(key == 'vc.config'){
+           if(!!response.data){
+          this.configId = response.data.configId
+          this.configKey = response.data.configKey
+          this.form31 = {...this.form31, ...JSON.parse(response.data.configValue)}
+          }
+        }
       })
     },
     /** 提交按钮 */
@@ -3328,6 +3349,16 @@ export default {
         }
       })
     },
+    submitForm31(){
+      const param = { configId: this.configId, configName : "声纹复刻配置", configKey: this.configKey, configValue: JSON.stringify(this.form31) }
+      console.log(param)
+      updateConfigByKey(param).then(response => {
+        if (response.code === 200) {
+          this.msgSuccess('修改成功')
+        }
+      })
+    },
+    
     formatColumns(){
       console.log(this.form27.pass_columns)
 

+ 354 - 0
src/views/user/integral/index.vue

@@ -0,0 +1,354 @@
+<template>
+  <div class="app-container">
+    <!-- 查询条件 -->
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="用户手机号码" prop="phone">
+        <el-input
+          v-model="queryParams.phone"
+          placeholder="请输入用户手机号码"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="用户昵称" prop="nickName">
+        <el-input
+          v-model="queryParams.nickName"
+          placeholder="请输入用户昵称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </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-form-item>
+    </el-form>
+
+    <!-- 操作按钮 -->
+    <el-row :gutter="10" class="mb8">
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <!-- 用户列表 -->
+    <el-table v-loading="loading" :data="userList">
+      <el-table-column label="用户ID" align="center" prop="userId" width="100" />
+      <el-table-column label="用户名称" align="center" prop="nickName" />
+      <el-table-column label="手机号码" align="center" prop="phone" width="150" />
+      <el-table-column label="积分" align="center" prop="integral" width="120" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-view"
+            @click="handleViewLogs(scope.row)"
+          >查看积分明细</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-plus"
+            @click="handleAddIntegral(scope.row)"
+          >添加积分</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页 -->
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 积分明细对话框 -->
+    <el-dialog title="积分明细" :visible.sync="logsOpen" width="900px" append-to-body @close="handleLogsDialogClose">
+      <!-- 查询条件 -->
+      <el-form :model="logsQueryParams" ref="logsQueryForm" size="small" :inline="true" style="margin-bottom: 15px;">
+        <el-form-item label="积分类型" prop="logType">
+          <el-select v-model="logsQueryParams.logType" placeholder="请选择积分类型" clearable style="width: 200px;">
+            <el-option v-for="item in logTypeOptions" :key="item.dictCode" :label="item.dictLabel" :value="item.dictValue" />
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleLogsQuery">搜索</el-button>
+          <el-button icon="el-icon-refresh" size="mini" @click="resetLogsQuery">重置</el-button>
+        </el-form-item>
+      </el-form>
+
+      <!-- 积分明细表格 -->
+      <el-table v-loading="logsLoading" :data="logsList" border style="width: 100%">
+        <el-table-column label="ID" align="center" prop="id" width="80" />
+        <el-table-column label="积分类型" align="center" prop="logType" width="120">
+          <template slot-scope="scope">
+            <span>{{ getLogTypeName(scope.row.logType) }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="积分变化" align="center" prop="integral" width="120">
+          <template slot-scope="scope">
+            <span :style="{ color: scope.row.integral >= 0 ? '#67C23A' : '#F56C6C' }">
+              {{ scope.row.integral >= 0 ? '+' : '' }}{{ scope.row.integral }}
+            </span>
+          </template>
+        </el-table-column>
+        <el-table-column label="积分余额" align="center" prop="balance" width="120" />
+        <el-table-column label="创建时间" align="center" prop="createTime" width="180">
+          <template slot-scope="scope">
+            <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <!-- 分页 -->
+      <pagination
+        v-show="logsTotal > 0"
+        :total="logsTotal"
+        :page.sync="logsParams.pageNum"
+        :limit.sync="logsParams.pageSize"
+        @pagination="loadLogsList"
+        style="margin-top: 15px;"
+      />
+    </el-dialog>
+
+    <!-- 添加积分对话框 -->
+    <el-dialog title="添加积分" :visible.sync="addOpen" width="500px" append-to-body>
+      <el-form ref="addForm" :model="addForm" :rules="addRules" label-width="100px">
+        <el-form-item label="用户ID" prop="userId">
+          <el-input v-model="addForm.userId" disabled />
+        </el-form-item>
+        <el-form-item label="用户名称" prop="nickName">
+          <el-input v-model="addForm.nickName" disabled />
+        </el-form-item>
+        <el-form-item label="当前积分" prop="currentIntegral">
+          <el-input v-model="addForm.currentIntegral" disabled />
+        </el-form-item>
+        <el-form-item label="积分类型" prop="logType">
+          <el-select v-model="addForm.logType" placeholder="请选择积分类型" style="width: 100%">
+            <el-option v-for="item in logTypeOptions" :key="item.dictCode" :label="item.dictLabel" :value="item.dictValue" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="积分数量" prop="integral">
+          <el-input-number
+            v-model="addForm.integral"
+            :min="1"
+            :precision="0"
+            placeholder="请输入积分数量"
+            style="width: 100%"
+          />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitAdd">确 定</el-button>
+        <el-button @click="cancelAdd">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listUser, getIntegralLogs, addIntegral } from "@/api/user/integral";
+import { parseTime, resetForm, selectDictLabel } from "@/utils/common";
+
+export default {
+  name: "Integral",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      logsLoading: false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 用户列表
+      userList: [],
+      // 积分明细列表
+      logsList: [],
+      // 积分明细分页参数
+      logsParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userId: null
+      },
+      // 积分明细查询条件
+      logsQueryParams: {
+        logType: null
+      },
+      // 积分明细总数
+      logsTotal: 0,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        phone: null,
+        nickName: null
+      },
+      // 字典:积分类型
+      logTypeOptions: [],
+      // 积分明细对话框
+      logsOpen: false,
+      // 添加积分对话框
+      addOpen: false,
+      // 添加积分表单
+      addForm: {},
+      // 添加积分表单校验
+      addRules: {
+        logType: [
+          { required: true, message: "积分类型不能为空", trigger: "change" }
+        ],
+        integral: [
+          { required: true, message: "积分数量不能为空", trigger: "blur" }
+        ]
+      }
+    };
+  },
+  created() {
+    // 仅加载字典,不默认拉取数据
+    this.getDicts("sys_integral_log_type").then(res => {
+      this.logTypeOptions = res.data || [];
+    });
+    this.loading = false;
+  },
+  methods: {
+    /** 查询用户列表 */
+    getList() {
+      // 必须输入手机号或昵称才允许查询
+      if (!this.queryParams.phone && !this.queryParams.nickName) {
+        this.$message.warning("请先输入用户手机号或昵称再查询");
+        this.userList = [];
+        this.total = 0;
+        return;
+      }
+      this.loading = true;
+      listUser(this.queryParams).then(response => {
+        this.userList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    // resetQuery() {
+    //   this.resetForm("queryForm");
+    //   this.handleQuery();
+    // },
+    /** 查看积分明细 */
+    handleViewLogs(row) {
+      this.logsOpen = true;
+      // 重置分页参数和查询条件
+      this.logsParams = {
+        pageNum: 1,
+        pageSize: 10,
+        userId: row.userId
+      };
+      this.logsQueryParams = {
+        logType: null
+      };
+      this.logsList = [];
+      this.logsTotal = 0;
+      this.loadLogsList();
+    },
+    /** 加载积分明细列表 */
+    loadLogsList() {
+      this.logsLoading = true;
+      const params = {
+        pageNum: this.logsParams.pageNum,
+        pageSize: this.logsParams.pageSize
+      };
+      // 添加查询条件
+      if (this.logsQueryParams.logType) {
+        params.logType = this.logsQueryParams.logType;
+      }
+      getIntegralLogs(this.logsParams.userId, params).then(response => {
+        this.logsList = response.data || [];
+        this.logsTotal = response.total || 0;
+        this.logsLoading = false;
+      }).catch(() => {
+        this.logsLoading = false;
+      });
+    },
+    /** 积分明细搜索 */
+    handleLogsQuery() {
+      this.logsParams.pageNum = 1;
+      this.loadLogsList();
+    },
+    /** 重置积分明细查询条件 */
+    resetLogsQuery() {
+      this.logsQueryParams = {
+        logType: null
+      };
+      this.logsParams.pageNum = 1;
+      this.loadLogsList();
+    },
+    /** 积分明细对话框关闭 */
+    handleLogsDialogClose() {
+      this.logsList = [];
+      this.logsParams = {
+        pageNum: 1,
+        pageSize: 10,
+        userId: null
+      };
+      this.logsQueryParams = {
+        logType: null
+      };
+      this.logsTotal = 0;
+    },
+    /** 添加积分 */
+    handleAddIntegral(row) {
+      this.reset();
+      this.addForm = {
+        userId: row.userId,
+        nickName: row.nickName,
+        currentIntegral: row.integral || 0,
+        logType: null,
+        integral: null
+      };
+      this.addOpen = true;
+    },
+    /** 提交添加积分 */
+    submitAdd() {
+      this.$refs["addForm"].validate(valid => {
+        if (valid) {
+          addIntegral({
+            userId: this.addForm.userId,
+            logType: this.addForm.logType,
+            integral: this.addForm.integral
+          }).then(response => {
+            this.$message.success("添加积分成功");
+            this.addOpen = false;
+            this.getList();
+          });
+        }
+      });
+    },
+    /** 取消添加积分 */
+    cancelAdd() {
+      this.addOpen = false;
+      this.reset();
+    },
+    /** 表单重置 */
+    reset() {
+      this.addForm = {
+        userId: null,
+        nickName: null,
+        currentIntegral: null,
+        logType: null,
+        integral: null
+      };
+      this.resetForm("addForm");
+    },
+    /** 获取积分类型名称 */
+    getLogTypeName(logType) {
+      return selectDictLabel(this.logTypeOptions, String(logType)) || "未知类型";
+    },
+    parseTime,
+    resetForm
+  }
+};
+</script>
+