Просмотр исходного кода

恒春来,企微进线统计增加重粉数、企微看课统计导出增加消耗红包金额

cgp 9 часов назад
Родитель
Сommit
343f84930c

+ 42 - 1
src/views/course/courseUserStatistics/qw/index.vue

@@ -49,6 +49,18 @@
         />
       </el-form-item>
 
+      <!--企微主体选择框 -->
+      <el-form-item label="企微主体" prop="corpId">
+        <el-select v-model="queryParams.corpId" placeholder="企微主体" size="small" @change="updateCorpId()" clearable>
+          <el-option
+            v-for="dict in myQwCompanyList"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+
       <el-form-item label="添加时间" prop="createTime">
         <el-date-picker
           v-model="createTime"
@@ -346,6 +358,22 @@
           </span>
         </template>
       </el-table-column>
+
+      <!-- 重粉数 -->
+      <el-table-column label="重粉数" align="center" prop="repeatCount">
+        <template slot-scope="scope">
+          <span>{{ scope.row.repeatCount }}</span>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor((scope.row.repeatCount / scope.row.line) * 100),
+            }"
+          >
+            ({{ ((scope.row.repeatCount / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
     </el-table>
 
     <pagination-more
@@ -375,10 +403,12 @@ import { treeselect } from "@/api/company/companyDept";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import { getCompanyUserListLikeName } from "@/api/company/companyUser";
+import { getMyQwCompanyList } from '@/api/qw/user';
 import { getTask } from "@/api/common";
+import PaginationMore from "@/components/PaginationMore/index.vue";
 export default {
   name: "CourseWatchLog",
-  components: { Treeselect },
+  components: {PaginationMore, Treeselect },
   data() {
     return {
       activeName: "00",
@@ -433,12 +463,14 @@ export default {
         eTime: null,
         scheduleStartTime: null,
         scheduleEndTime: null,
+        corpId: null, // 企微主体ID
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {},
       scheduleTime: null,
+      myQwCompanyList: [], // 存储企微主体选项列表
     };
   },
   created() {
@@ -451,8 +483,16 @@ export default {
     });
     this.getTreeselect();
     this.getList();
+    // --- 获取企微主体列表 ---
+    getMyQwCompanyList().then(response => {
+      this.myQwCompanyList = response.data;
+    });
   },
   methods: {
+    updateCorpId() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
     getSummaries(param) {
       let totalNum = 0;
       const { columns, data } = param;
@@ -639,6 +679,7 @@ export default {
       this.queryParams.eTime = null;
       this.queryParams.scheduleStartTime = null;
       this.queryParams.scheduleEndTime = null;
+      this.queryParams.corpId = null; // 重置企微主体选择
       this.handleQuery();
     },
     // 多选框选中数据

+ 2 - 2
src/views/course/courseWatchLog/qw/statistics.vue

@@ -196,7 +196,7 @@ export default {
             column.property === "noUserWaitNumber" ||
             column.property === "onLineRate" ||
             column.property === "finishedRate" ||
-            column.property === "redAmount" 
+            column.property === "redAmount"
           ) {
           }
         } else {
@@ -213,7 +213,7 @@ export default {
             } else if(index === 13 && !!sums[9]){
               sums[index] =  (sums[7] * 100 / sums[9]).toFixed(2) + '%';
             }
-          } 
+          }
         }
       });
       console.log(sums);

+ 60 - 1
src/views/course/courseWatchLog/watchLog.vue

@@ -302,6 +302,21 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="会员状态" prop="externalStatus">
+        <el-select
+          v-model="queryParams.externalStatus"
+          placeholder="请选择会员状态"
+          clearable
+          size="small"
+          filterable>
+          <el-option
+            v-for="dict in externalStatusOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </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>
@@ -377,7 +392,19 @@
       :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"/>
+      <el-table-column label="客户昵称" align="center" prop="externalUserName" v-if="queryParams.sendType == 2">
+        <template slot-scope="scope">
+          <span>{{ scope.row.externalUserName }}</span>
+          <i
+            ref="copyIcon"
+            class="el-icon-document-copy"
+            style="margin-left: 5px; cursor: pointer; color: #409EFF;"
+            @click="copyText(scope.row.externalUserName, $event)"
+            title="点击复制"
+          ></i>
+        </template>
+
+      </el-table-column>
 
       &lt;!&ndash;
       <el-table-column label="会员ID" align="center" prop="userId" v-if="queryParams.sendType == 1"/>
@@ -458,6 +485,11 @@
           </el-tag>
         </template>
       </el-table-column>
+      <el-table-column label="会员状态" align="center" prop="externalStatus">
+        <template slot-scope="scope">
+          <dict-tag :options="externalStatusOptions" :value="scope.row.externalStatus"/>
+        </template>
+      </el-table-column>
       <el-table-column
         fixed="right"
         label="操作"
@@ -739,6 +771,7 @@
 </template>
 
 <script>
+import ClipboardJS from 'clipboard';
 import {
   addCourseWatchLog,
   delCourseWatchLog,
@@ -823,6 +856,7 @@ export default {
       videoList: [],
       myQwUserList: [],
       logTypeOptions: [],
+      externalStatusOptions:[],
       // 遮罩层
       loading: true,
       // 导出遮罩层
@@ -914,6 +948,7 @@ export default {
         videoId: null,
         nickName: null,
         logType: 2,
+        externalStatus:null,
         qwExternalContactId: null,
         externalUserName:null,
         duration: null,
@@ -965,6 +1000,9 @@ export default {
     });
     this.getDicts("sys_course_project").then(response => {
       this.projectOptions = response.data;
+    });
+    this.getDicts("sys_qw_external_contact_status").then(response => {
+      this.externalStatusOptions = response.data;
     });
        // 查询营期名称
     listPeriodLabel().then(response => {
@@ -980,6 +1018,21 @@ export default {
 
   },
   methods: {
+    copyText(text, event) {
+      const clipboard = new ClipboardJS(event.currentTarget, {
+        text: () => text,
+      });
+
+      clipboard.on('success', (e) => {
+        this.$message.success('复制成功');
+        clipboard.destroy();
+      });
+
+      clipboard.on('error', (e) => {
+        this.$message.error('复制失败,请手动复制');
+        clipboard.destroy();
+      });
+    },
     setToday(){
       const today = new Date();
       const todayStart = new Date(today - 60*60*24*7*1000) ;
@@ -1296,6 +1349,7 @@ export default {
         userId: null,
         videoId: null,
         logType: null,
+        externalStatus:null,
         createTime: null,
         updateTime: null,
         qwExternalContactId: null,
@@ -1854,3 +1908,8 @@ export default {
   color: #606266;
 }
 </style>
+<style scoped>
+.el-icon-document-copy:hover {
+  color: #66b1ff; /* 悬停时的颜色 */
+}
+</style>