Ver Fonte

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

lmx há 4 dias atrás
pai
commit
11b103d004

+ 7 - 0
src/api/course/qw/courseWatchLog.js

@@ -23,6 +23,13 @@ export function statisticsList(query) {
     params: query
   })
 }
+export function statisticsExport(query) {
+  return request({
+    url: '/qw/course/courseWatchLog/statisticsExport',
+    method: 'get',
+    params: query
+  })
+}
 export function qwWatchLogStatisticsList(query) {
   return request({
     url: '/qw/course/courseWatchLog/qwWatchLogStatisticsList',

+ 23 - 3
src/views/course/courseWatchLog/qw/statistics.vue

@@ -39,6 +39,21 @@
       </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"
+          v-hasPermi="['qw:user:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
     <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange"  show-summary>
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="企微员工名称" align="center" prop="qwUserName" />
@@ -65,7 +80,7 @@
 </template>
 
 <script>
-import { listCourseWatchLog, getCourseWatchLog, delCourseWatchLog, addCourseWatchLog, updateCourseWatchLog, exportCourseWatchLog,statisticsList } from "@/api/course/qw/courseWatchLog";
+import { listCourseWatchLog, getCourseWatchLog, delCourseWatchLog, addCourseWatchLog, updateCourseWatchLog, exportCourseWatchLog,statisticsList,statisticsExport } from "@/api/course/qw/courseWatchLog";
 import { courseList,videoList } from '@/api/course/courseRedPacketLog'
 import { getDateRange } from '@/utils/common'
 export default {
@@ -278,14 +293,19 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
+      // 检查是否选择了时间范围
+      if (!this.queryParams.sTime || !this.queryParams.eTime) {
+        this.$message.warning("请选择创建时间后才能导出");
+        return;
+      }
       const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
+      this.$confirm('是否确认导出所有企微看课记录数据项?', "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"
         }).then(() => {
           this.exportLoading = true;
-          return exportCourseWatchLog(queryParams);
+          return statisticsExport(queryParams);
         }).then(response => {
           this.download(response.msg);
           this.exportLoading = false;

+ 64 - 16
src/views/course/courseWatchLog/watchLog.vue

@@ -281,7 +281,13 @@
       <el-tab-pane label="全部" name="00"></el-tab-pane>
       <el-tab-pane v-for="(item,index) in logTypeOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
     </el-tabs>
-    <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange">
+<!--    <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange">-->
+    <el-table
+      border
+      v-loading="loading"
+      :data="courseWatchLogList"
+      @selection-change="handleSelectionChange"
+      :key="tableKey">
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="记录编号" align="center" prop="logId"/>
      <el-table-column label="客户昵称" align="center" prop="externalUserName" v-if="queryParams.sendType == 2"/>
@@ -289,17 +295,31 @@
       &lt;!&ndash;
       <el-table-column label="会员ID" align="center" prop="userId" v-if="queryParams.sendType == 1"/>
       &ndash;&gt;
-     <el-table-column label="客户头像" align="center" prop="externalUserAvatar" v-if="queryParams.sendType == 2">
-       <template slot-scope="scope">
-         <el-popover
-           placement="right"
-           title=""
-           trigger="hover">
-           <img slot="reference" :src="scope.row.externalUserAvatar" style="width: 50px;height: 50px">
-           <img :src="scope.row.externalUserAvatar" style="max-width: 200px;max-height: 200px">
-         </el-popover>
-       </template>
-     </el-table-column>
+<!--     <el-table-column label="客户头像" align="center" prop="externalUserAvatar" v-if="queryParams.sendType == 2">-->
+<!--       <template slot-scope="scope">-->
+<!--         <el-popover-->
+<!--           placement="right"-->
+<!--           title=""-->
+<!--           trigger="hover">-->
+<!--           <img slot="reference" :src="scope.row.externalUserAvatar" style="width: 50px;height: 50px">-->
+<!--           <img :src="scope.row.externalUserAvatar" style="max-width: 200px;max-height: 200px">-->
+<!--         </el-popover>-->
+<!--       </template>-->
+<!--     </el-table-column>-->
+      <el-table-column label="头像" align="center">
+        <template slot-scope="scope">
+          <img
+            v-if="queryParams.sendType == 1"
+            :src="scope.row.fsAvatar"
+            style="width:50px;height:50px"
+          />
+          <img
+            v-else-if="queryParams.sendType == 2"
+            :src="scope.row.externalUserAvatar"
+            style="width:50px;height:50px"
+          />
+        </template>
+      </el-table-column>
       <el-table-column label="用户昵称" align="center" v-if="queryParams.sendType == 1">
         <template slot-scope="scope">
           {{ queryParams.sendType=='1' ? scope.row.fsNickName : scope.row.externalUserName }}
@@ -322,7 +342,13 @@
 <!--      <el-table-column label="所属销售" align="center" prop="companyUserName"/>-->
 <!--      <el-table-column label="所属公司" align="center" prop="companyName"/>-->
 <!--      <el-table-column label="企微员工名称" align="center" prop="qwUserName"/>-->
-      <el-table-column label="所属企微" align="center" prop="qwUserName" v-if="queryParams.sendType==2" />
+      <!-- 所属企微列 -->
+      <el-table-column
+        label="所属企微"
+        align="center"
+        prop="qwUserName"
+        v-if="queryParams.sendType == 2"
+      />
       <!--      <el-table-column label="所属发送方式" align="center" prop="sendType"/>-->
       <el-table-column label="创建时间" align="center" prop="createTime" width="100px"/>
       <el-table-column label="更新时间" align="center" prop="updateTime" width="100px" />
@@ -563,6 +589,7 @@ export default {
   name: "CourseWatchLog",
   data() {
     return {
+      tableKey: 0,
       // 日历 key 控制刷新
       scheduleCalendarKey: 0,
       createCalendarKey: 0,
@@ -638,10 +665,10 @@ export default {
       },
       projectOptions:[],
       sendTypeOptions:[{
-        dictLabel:"会员",dictValue:'1'
+        dictLabel:'会员',dictValue:'1'
       },
         {
-          dictLabel:"企微",dictValue:'2'
+          dictLabel:'企微',dictValue:'2'
         }
       ],
 
@@ -747,7 +774,28 @@ export default {
   methods: {
 
     handleSendTypeChange() {
-      this.handleQuery(); // 重新查询列表
+      // 重置相关参数
+      this.queryParams.qwUserId = null;
+      this.queryParams.qwExternalContactId = null;
+      this.queryParams.userId = null;
+      this.queryParams.nickName = null;
+      this.queryParams.externalUserName = null;
+      this.queryParams.corpId = null;
+      this.queryParams.project = null;
+      this.queryParams.courseId = null;
+      this.queryParams.videoId = null;
+
+      // 重置选择
+      this.ids = [];
+      this.courseWatchLogList = []; // 清空表格数据
+
+      // 重置分页
+      this.queryParams.pageNum = 1;
+
+      // 强制重新渲染表格
+      this.tableKey += 1;
+
+      this.getList();
     },
 
     // 重置日历组件

+ 1 - 1
src/views/qw/sopTemp/updateSopTemp.vue

@@ -734,7 +734,7 @@ export default {
       ruleList: [],
       ids: [],
       startTimeRange: [],
-      courseTypeList: ['1','3', '4', '9','10'],
+      courseTypeList: ['1','2', '4','5','6', '7','8','9','10'],
       sysFsSopWatchStatus: [],
       //消息内容类型 企微版
       sysQwSopContentType: [],