Explorar el Código

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

caoliqin hace 2 días
padre
commit
07355d6d2d

+ 9 - 0
src/api/live/liveMsg.js

@@ -59,3 +59,12 @@ export function exportLiveMsg(query) {
     params: query
   })
 }
+
+// 导出直播评论
+export function exportLiveMsgComments(liveId) {
+  return request({
+    url: '/live/liveMsg/exportComments/' + liveId,
+    method: 'get',
+    responseType: 'blob'
+  })
+}

+ 16 - 0
src/api/live/wxExpressTask.js

@@ -0,0 +1,16 @@
+import request from '@/utils/request'
+
+export function list(query) {
+  return request({
+    url: '/live/wxExpressTask/list',
+    method: 'get',
+    params: query
+  })
+}
+
+export function getFailedCount() {
+  return request({
+    url: '/live/wxExpressTask/getFailedCount',
+    method: 'get'
+  })
+}

+ 24 - 1
src/views/components/index/statisticsDashboard.vue

@@ -224,6 +224,18 @@
                 0
               </div>
             </div>
+            <div class="internetbox-messge">
+              <div class="internet-card">
+                <img src="@/assets/images/message.png" alt="">
+
+                <span class="internet-title">
+                  微信上传失败订单数量
+                </span>
+              </div>
+              <div class="internet-number">
+                {{ wxFailedCount }}
+              </div>
+            </div>
           </div>
         </el-col>
       </el-row>
@@ -575,6 +587,7 @@ import {
   smsBalance, thisMonthOrderCount, thisMonthRecvCount, trafficLog,
   watchCourseTopTen, watchEndPlayTrend,getWatchCourseStatisticsData
 } from "@/api/statistics/statistics";
+import { getFailedCount } from "@/api/live/wxExpressTask";
 import dayjs from 'dayjs';
 import { listDept } from '@/api/system/dept'
 import { listCompany } from '@/api/his/company'
@@ -1052,7 +1065,9 @@ export default {
       // 商品总数
       goodsTotalNum: 0,
       // 今日商品总数
-      todayGoodsNum: 0
+      todayGoodsNum: 0,
+      // 微信上传失败订单数量
+      wxFailedCount: 0
     }
   },
   mounted() {
@@ -1340,6 +1355,14 @@ export default {
           }
         }
       })
+      // 获取微信上传失败订单数量
+      getFailedCount().then(res => {
+        if (res.code === 200) {
+          this.wxFailedCount = res.data || 0;
+        }
+      }).catch(() => {
+        this.wxFailedCount = 0;
+      })
       authorizationInfo(this.staticParam).then(res => {
         if (res.code === 200 && res.data != null) {
           this.todayWatchUserCount = res.data.todayWatchUserCount;

+ 56 - 0
src/views/live/live/index.vue

@@ -349,6 +349,13 @@
               <el-dropdown-item @click.native="handleAudit(scope.row)">
                 <i class="el-icon-service"></i> 审核
               </el-dropdown-item>
+<!--              <el-dropdown-item -->
+<!--                @click.native="handleExportComments(scope.row)"-->
+<!--                :disabled="exportingComments[scope.row.liveId]"-->
+<!--                v-hasPermi="['live:liveMsg:export']"-->
+<!--              >-->
+<!--                <i class="el-icon-download"></i> 导出评论-->
+<!--              </el-dropdown-item>-->
             </el-dropdown-menu>
           </el-dropdown>
           <!--          <el-button-->
@@ -687,6 +694,7 @@ import {
   getTagsListByCorpId,
   clearLiveCache,
 } from "@/api/live/live";
+import { exportLiveMsgComments } from "@/api/live/liveMsg";
 import Editor from "@/components/Editor/wang";
 import user from "@/store/modules/user";
 import VideoUpload from "@/components/LiveVideoUpload/single.vue";
@@ -812,6 +820,8 @@ export default {
         name:null,
         corpId:null,
       },
+      // 导出评论状态:key为liveId,value为是否正在导出
+      exportingComments: {},
     };
   },
   created() {
@@ -1435,6 +1445,52 @@ export default {
       this.lastCheckTagRow = null;
       this.currentCheck = null;
       this.currentCheckTagIndex = null;
+    },
+    /** 导出评论按钮操作 */
+    handleExportComments(row) {
+      const liveId = row.liveId;
+      // 检查是否正在导出
+      if (this.exportingComments[liveId]) {
+        this.$message.warning("正在导出中,请勿重复操作");
+        return;
+      }
+
+      // 检查是否有其他直播间正在导出
+      const hasExporting = Object.values(this.exportingComments).some(status => status === true);
+      if (hasExporting) {
+        this.$message.warning("当前已有导出任务进行中,请等待完成后再试");
+        return;
+      }
+
+      this.$confirm('是否确认导出该直播间的评论数据?', "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "info"
+      }).then(() => {
+        // 设置导出状态
+        this.$set(this.exportingComments, liveId, true);
+
+        exportLiveMsgComments(liveId).then(response => {
+          // 创建blob对象
+          const blob = new Blob([response], { type: 'application/vnd.ms-excel' });
+          // 创建下载链接
+          const url = window.URL.createObjectURL(blob);
+          const link = document.createElement('a');
+          link.href = url;
+          link.setAttribute('download', `直播评论_${row.liveName || liveId}_${new Date().getTime()}.xlsx`);
+          document.body.appendChild(link);
+          link.click();
+          document.body.removeChild(link);
+          window.URL.revokeObjectURL(url);
+
+          this.$message.success("导出成功");
+        }).catch(error => {
+          this.$message.error(error.msg || "导出失败");
+        }).finally(() => {
+          // 清除导出状态
+          this.$set(this.exportingComments, liveId, false);
+        });
+      }).catch(() => {});
     }
 
   },

+ 148 - 0
src/views/live/upload2WX/index.vue

@@ -0,0 +1,148 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="小程序" prop="appid">
+        <el-select 
+          v-model="queryParams.appid" 
+          placeholder="请选择小程序" 
+          clearable 
+          filterable
+          size="small"
+          style="width: 200px"
+        >
+          <el-option
+            v-for="item in appOptions"
+            :key="item.appid"
+            :label="item.name"
+            :value="item.appid"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="上传状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择上传状态" clearable size="small">
+          <el-option label="待执行" value="0" />
+          <el-option label="执行中" value="1" />
+          <el-option label="执行成功" value="2" />
+          <el-option label="执行失败" value="3" />
+          <el-option label="已取消" value="4" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="订单号" prop="orderCode">
+        <el-input
+          v-model="queryParams.orderCode"
+          placeholder="请输入订单号"
+          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>
+      </el-form-item>
+    </el-form>
+
+    <el-table v-loading="loading" :data="wxExpressTaskList">
+      <el-table-column label="ID" align="center" prop="id" width="80" />
+      <el-table-column label="订单号" align="center" prop="orderCode" width="180" />
+      <el-table-column label="用户ID" align="center" prop="userId" width="100" />
+      <el-table-column label="数据" align="center" prop="data" width="200" show-overflow-tooltip />
+      <el-table-column label="任务状态" align="center" prop="status" width="120">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.status === 0" type="info">待执行</el-tag>
+          <el-tag v-else-if="scope.row.status === 1" type="warning">执行中</el-tag>
+          <el-tag v-else-if="scope.row.status === 2" type="success">执行成功</el-tag>
+          <el-tag v-else-if="scope.row.status === 3" type="danger">执行失败</el-tag>
+          <el-tag v-else-if="scope.row.status === 4" type="info">已取消</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="重试次数" align="center" prop="retryCount" width="100" />
+      <el-table-column label="请求体" align="center" prop="requestBody" width="200" show-overflow-tooltip />
+      <el-table-column label="响应体" align="center" prop="responseBody" width="200" show-overflow-tooltip />
+      <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-column label="快递公司" align="center" prop="expressCompany" width="120" />
+      <el-table-column label="快递单号" align="center" prop="expressNo" width="150" />
+      <el-table-column label="订单类型" align="center" prop="type" width="120">
+        <template slot-scope="scope">
+          <span v-if="scope.row.type === 0">商城订单</span>
+          <span v-else-if="scope.row.type === 1">直播订单</span>
+          <span v-else>-</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="小程序ID" align="center" prop="appid" width="180" />
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { list } from "@/api/live/wxExpressTask";
+import { list as listAppConfig } from "@/api/course/coursePlaySourceConfig";
+
+export default {
+  name: "WxExpressTask",
+  data() {
+    return {
+      loading: true,
+      showSearch: true,
+      wxExpressTaskList: [],
+      total: 0,
+      appOptions: [],
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        appid: null,
+        status: null,
+        orderCode: null
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getAppList();
+  },
+  methods: {
+    /** 查询微信快递任务列表 */
+    getList() {
+      this.loading = true;
+      list(this.queryParams).then(response => {
+        this.wxExpressTaskList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 获取小程序列表 */
+    getAppList() {
+      listAppConfig({ pageNum: 1, pageSize: 100 }).then(response => {
+        if (response.rows) {
+          this.appOptions = response.rows;
+        }
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    }
+  }
+};
+</script>
+
+<style scoped>
+</style>