瀏覽代碼

直播代码提交

yuhongqi 2 周之前
父節點
當前提交
099a588ab9

+ 53 - 0
src/api/live/liveAfterSales.js

@@ -90,3 +90,56 @@ export function audit2(data) {
     data: data
   })
 }
+
+// 查询售后记录列表
+export function listStoreAfterSales(query) {
+  return request({
+    url: '/live/liveAfterSales/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询售后记录详细
+export function getStoreAfterSales(id) {
+  return request({
+    url: '/live/liveAfterSales/' + id,
+    method: 'get'
+  })
+}
+
+// 删除售后记录
+export function delStoreAfterSales(id) {
+  return request({
+    url: '/live/liveAfterSales/' + id,
+    method: 'delete'
+  })
+}
+
+
+// 新增售后记录
+export function addStoreAfterSales(data) {
+  return request({
+    url: '/live/liveAfterSales',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改售后记录
+export function updateStoreAfterSales(data) {
+  return request({
+    url: '/live/liveAfterSales',
+    method: 'put',
+    data: data
+  })
+}
+
+// 导出售后记录
+export function exportStoreAfterSales(query) {
+  return request({
+    url: '/live/liveAfterSales/export',
+    method: 'get',
+    params: query
+  })
+}

+ 123 - 0
src/api/live/liveOrder.js

@@ -275,3 +275,126 @@ export function updateErp(data) {
     data: data
   })
 }
+
+export function importDeliveryNoteExpressTemplate() {
+  return request({
+    url: '/live/liveOrder/importDeliveryNoteExpressTemplate',
+    method: 'get'
+  })
+}
+
+export function importTemplate() {
+  return request({
+    url: '/live/liveOrder/importTemplate',
+    method: 'get'
+  })
+}
+
+
+// 导出订单
+export function exportHealthStoreOrderItems(query) {
+  return request({
+    url: '/live/liveOrder/healthExportItems',
+    method: 'get',
+    params: query
+  })
+}
+export function createUserOrder(data) {
+  return request({
+    url: '/live/liveOrder/createUserOrder',
+    method: 'post',
+    data: data
+  })
+}
+// 查询健康商城订单列表
+export function listHealthStoreOrder(data) {
+  return request({
+    url: '/live/liveOrder/healthList',
+    method: 'post',
+    data: data
+  })
+}
+// 查询订单详细
+export function getStoreOrder(id) {
+  return request({
+    url: '/live/liveOrder/' + id,
+    method: 'get'
+  })
+}
+// 删除订单
+export function delStoreOrder(id) {
+  return request({
+    url: '/live/liveOrder/' + id,
+    method: 'delete'
+  })
+}
+// 导出订单
+export function exportHealthStoreOrder(data) {
+  return request({
+    url: '/live/liveOrder/healthExport',
+    method: 'post',
+    data: data
+  })
+}
+// 导出订单
+export function exportHealthStoreOrderDetails(data) {
+  return request({
+    url: '/live/liveOrder/healthExportDetails',
+    method: 'post',
+    data: data
+  })
+}
+// 导出订单
+export function exportHealthStoreOrderItemsDetails(query) {
+  return request({
+    url: '/live/liveOrder/healthExportItemsDetails',
+    method: 'get',
+    params: query
+  })
+}
+export function getErpAccount() {
+  return request({
+    url: '/live/liveOrder/getErpAccount',
+    method: 'get'
+  })
+}
+export function queryErpPhone(query) {
+  return request({
+    url: '/live/liveOrder/queryErpPhone',
+    method: 'get',
+    params: query
+  })
+}
+
+
+export function saveErpPhone(data) {
+  return request({
+    url: '/live/liveOrder/saveErpPhone',
+    method: 'post',
+    data: data
+  })
+}
+
+export function editErpPhone(data) {
+  return request({
+    url: '/live/liveOrder/editErpPhone',
+    method: 'post',
+    data: data
+  })
+}
+
+export function batchCreateErpOrder(data) {
+  return request({
+    url: '/live/liveOrder/batchCreateErpOrder',
+    method: 'post',
+    data: data
+  })
+}
+
+export function batchSetErpOrder(data) {
+  return request({
+    url: '/live/liveOrder/batchSetErpOrder',
+    method: 'post',
+    data: data
+  })
+}

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

@@ -0,0 +1,963 @@
+<template>
+  <div class="app-container">
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['live:live:add']"
+        >新增</el-button>
+      </el-col>
+      <!--      <el-col :span="1.5">-->
+      <!--        <el-button-->
+      <!--          type="success"-->
+      <!--          plain-->
+      <!--          icon="el-icon-edit"-->
+      <!--          size="mini"-->
+      <!--          :disabled="single"-->
+      <!--          @click="handleUpdate"-->
+      <!--          v-hasPermi="['live:live:edit']"-->
+      <!--        >修改</el-button>-->
+      <!--      </el-col>-->
+      <!--      <el-col :span="1.5">-->
+      <!--        <el-button-->
+      <!--          type="warning"-->
+      <!--          plain-->
+      <!--          icon="el-icon-download"-->
+      <!--          size="mini"-->
+      <!--          :loading="exportLoading"-->
+      <!--          @click="handleExport"-->
+      <!--          v-hasPermi="['live:live:export']"-->
+      <!--        >导出</el-button>-->
+      <!--      </el-col>-->
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="直播名称" prop="liveName">
+        <el-input
+          v-model="queryParams.liveName"
+          placeholder="请输入直播名称"
+          clearable
+          size="small"
+        />
+      </el-form-item>
+      <el-form-item label="直播状态" prop="liveStatus">
+        <el-select
+          v-model="queryParams.status"
+          placeholder="请选择直播状态"
+          clearable
+          size="small"
+        >
+          <el-option label="待直播" value="1"></el-option>
+          <el-option label="直播中" value="2"></el-option>
+          <el-option label="已结束" value="3"></el-option>
+          <el-option label="直播回放中" value="4"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="公司名称" prop="companyName">
+        <el-input
+          v-model="queryParams.companyName"
+          placeholder="请输入公司名称"
+          clearable
+          size="small"
+        />
+      </el-form-item>
+      <el-form-item label="直播类型" prop="liveType">
+        <el-select
+          v-model="queryParams.liveType"
+          placeholder="请选择直播类型"
+          clearable
+          size="small"
+        >
+          <el-option label="直播" value="1"></el-option>
+          <el-option label="录播" value="2"></el-option>
+          <el-option label="直播回放" value="3"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="开始时间" prop="startTimeS">
+        <el-date-picker
+          v-model="queryParams.startTimeS"
+          type="datetime"
+          placeholder="选择起始时间"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          size="small"
+        ></el-date-picker>
+      </el-form-item>
+      <!-- 开始时间-范围结束 -->
+      <el-form-item label="结束时间" prop="endTimeE">
+        <el-date-picker
+          v-model="queryParams.endTimeE"
+          type="datetime"
+          placeholder="选择结束时间"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          size="small"
+          :disabled="!queryParams.startTimeS"
+        ></el-date-picker>
+      </el-form-item>
+      <el-form-item label="上下架" prop="isShow">
+        <el-select
+          v-model="queryParams.isShow"
+          placeholder="请选择上下架状态"
+          clearable
+          size="small"
+        >
+          <el-option label="上架" value="1"></el-option>
+          <el-option label="下架" value="2"></el-option>
+        </el-select>
+      </el-form-item>
+      <!-- 审核状态 -->
+      <el-form-item label="审核状态" prop="isAudit">
+        <el-select
+          v-model="queryParams.isAudit"
+          placeholder="请选择审核状态"
+          clearable
+          size="small"
+        >
+          <el-option label="审核未通过" value="0"></el-option>
+          <el-option label="审核通过" value="1"></el-option>
+        </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>
+        <el-button icon="el-icon-download" size="mini" v-hasPermi="['live:live:export']" @click="handleExport">导出</el-button>
+      </el-form-item>
+    </el-form>
+    <div class="selection-toolbar">
+      <el-checkbox :indeterminate="isIndeterminate" v-model="allChecked" @change="toggleSelectAll">
+        {{ multipleSelection.length > 0 ? `已选 ${multipleSelection.length} 条` : '选中本页' }}
+      </el-checkbox>
+      <el-button  plain size="mini" @click="handleShelf">上架</el-button>
+      <el-button  plain size="mini" @click="handleUnshelf">下架</el-button>
+      <el-button  plain size="mini" @click="handleDeleteSelected">删除</el-button>
+      <!--      <el-dropdown>-->
+      <!--        <el-button plain size="mini">-->
+      <!--          更多操作<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
+      <!--        </el-button>-->
+      <!--        <el-dropdown-menu slot="dropdown">-->
+      <!--          <el-dropdown-item>操作一</el-dropdown-item>-->
+      <!--          <el-dropdown-item>操作二</el-dropdown-item>-->
+      <!--        </el-dropdown-menu>-->
+      <!--      </el-dropdown>-->
+    </div>
+    <el-table ref="liveTable" v-loading="loading" :data="liveList"  @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55"></el-table-column>
+      <el-table-column label="直播封面" align="center" prop="liveImgUrl" width="180">
+        <template slot-scope="scope">
+          <el-image style="width: 90px;height: 90px;" :src="scope.row.liveImgUrl" mode="aspectFill" :preview-src-list="[scope.row.liveImgUrl]" />
+        </template>
+      </el-table-column>
+      <el-table-column label="直播名称" align="center" prop="liveName" />
+      <el-table-column label="显示类型" align="center" prop="showType">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.showType == 1">横屏</el-tag>
+          <el-tag v-if="scope.row.showType == 2">竖屏</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="直播状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.status == 1">待直播</el-tag>
+          <el-tag v-if="scope.row.status == 2">直播中</el-tag>
+          <el-tag v-if="scope.row.status == 3">已结束</el-tag>
+          <el-tag v-if="scope.row.status == 4">直播回放中</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="公司名称" align="center" prop="companyName" >
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.companyName">{{ scope.row.companyName }}</el-tag>
+          <el-tag v-else>总台</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="直播类型" align="center" prop="liveType">
+        <template slot-scope="scope">
+          <el-tag type="danger" v-if="scope.row.liveType == 1">直播</el-tag>
+          <el-tag type="success" v-if="scope.row.liveType == 2">录播</el-tag>
+          <el-tag v-if="scope.row.liveType == 3">直播回放</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="开始时间" align="center" prop="startTime" width="180" />
+      <el-table-column label="结束时间" align="center" prop="finishTime" width="180" />
+      <el-table-column label="上下架" align="center" prop="isShow">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.isShow == 1">上架</el-tag>
+          <el-tag type="danger" v-if="scope.row.isShow == 2">下架</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="审核状态" align="center" prop="isAudit">
+        <template slot-scope="scope">
+          <el-tag type="danger" v-if="scope.row.isAudit == 0">审核未通过</el-tag>
+          <el-tag v-if="scope.row.isAudit == 1">审核通过</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['live:live:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-setting"
+            @click="handleConfig(scope.row)"
+            v-hasPermi="['live:config:list']"
+          >配置</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-service"
+            @click="handleManage(scope.row)"
+            v-hasPermi="['live:console:list']"
+          >进入直播间</el-button>
+          <el-dropdown trigger="hover">
+            <el-button size="mini" type="text" icon="el-icon-more">
+              更多
+            </el-button>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item
+                v-if="scope.row.status == 2 && scope.row.liveType == 1"
+                @click.native="showLivingUrl(scope.row)"
+              >
+                <i class="el-icon-switch-button"></i> 推流码
+              </el-dropdown-item>
+              <!-- 去直播按钮 -->
+              <el-dropdown-item
+                v-if="scope.row.status != 2"
+                @click.native="handleStart(scope.row)"
+              >
+                <i class="el-icon-monitor"></i> 去直播
+              </el-dropdown-item>
+              <el-dropdown-item
+                v-if="scope.row.status == 2"
+                @click.native="handleEnded(scope.row)"
+              >
+                <i class="el-icon-service"></i> 结束
+              </el-dropdown-item>
+              <el-dropdown-item
+                @click.native="handleCopy(scope.row)"
+              >
+                <i class="el-icon-service"></i> 复制直播间
+              </el-dropdown-item>
+              <el-dropdown-item
+                @click.native="handleAudit(scope.row)"
+              >
+                <i class="el-icon-service"></i> 审核
+              </el-dropdown-item>
+
+            </el-dropdown-menu>
+          </el-dropdown>
+<!--          <el-button-->
+<!--            v-if="scope.row.status == 2"-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-switch-button"-->
+<!--            @click="handleEnded(scope.row)"-->
+<!--            v-hasPermi="['live:config:edit']"-->
+<!--          >结束</el-button>-->
+
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-dialog
+      title="直播二维码"
+      :visible.sync="qrcodeDialogVisible"
+      width="500px"
+      :close-on-click-modal="true"
+      :show-close="true"
+      top="10vh"
+    >
+      <div class="qrcode-img-container">
+
+        <img
+          :src="currentQrcodeUrl"
+          alt="直播二维码"
+          class="qrcode-img"
+          @error="handleImgError"
+        >
+      </div>
+    </el-dialog>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改直播对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="直播名称" prop="liveName">
+          <el-input v-model="form.liveName" placeholder="请输入直播名称" />
+        </el-form-item>
+        <el-form-item label="显示类型" prop="showType">
+          <el-radio-group v-model="form.showType">
+            <el-radio :label="1">横屏</el-radio>
+            <el-radio :label="2">竖屏</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="直播类型" prop="liveType">
+          <el-radio-group v-model="form.liveType">
+            <el-radio :label="1">直播</el-radio>
+            <el-radio :label="2">录播</el-radio>
+          </el-radio-group>
+        </el-form-item>
+<!--        <el-form-item label="直播达人" prop="talentId">-->
+<!--          <el-select filterable v-model="form.talentId" placeholder="请选择达人">-->
+<!--            <el-option-->
+<!--              v-for="item in talentList"-->
+<!--              :key="item.talentId"-->
+<!--              :label="item.nickName"-->
+<!--              :value="item.talentId">-->
+<!--            </el-option>-->
+<!--          </el-select>-->
+<!--        </el-form-item>-->
+        <el-form-item label="直播描述" prop="liveDesc">
+          <Editor ref="myeditor" :height="300" @on-text-change="updateText"/>
+          <!--          <Editor v-model="form.liveDesc" :height="300" placeholder="直播描述" />-->
+        </el-form-item>
+<!--        <el-form-item label="录播视屏" prop="videoUrl" v-if="form.liveType == 2">-->
+<!--          <file-upload v-model="form.videoUrl" :limit="1" :file-size="3" :file-type="['mp4']" />-->
+<!--          <el-button @click="getVideoDuration" v-loading="timeLoading">读取视屏时长</el-button>-->
+<!--          <p style="margin: 0;padding: 0;" v-loading="timeLoading">视屏时长:<span style="color: #ff4949;">{{form.durationTime}}</span></p>-->
+<!--        </el-form-item>-->
+        <el-form-item label="录播视屏" prop="videoUrl" v-if="form.liveType == 2">
+          <video-upload :fileKey.sync="form.fileKey" :fileSize.sync="form.fileSize"
+                        :videoUrl.sync="form.videoUrl" :fileName.sync="form.fileName" :line_1.sync="form.lineOne"
+                        :uploadType.sync="form.uploadType" :isTranscode.sync="form.isTranscode"
+                        ref="videoUpload"
+                        :transcodeFileKey.sync="form.transcodeFileKey" @video-duration="handleVideoDuration"
+                        @change="handleVideoChange"></video-upload>
+        </el-form-item>
+<!--        <video-upload-->
+<!--          v-if="form.liveType == 2"-->
+<!--          :type = "1"-->
+<!--          :isPrivate = "isPrivate"-->
+<!--          :fileKey.sync = "form.fileKey"-->
+<!--          :fileSize.sync = "form.fileSize"-->
+<!--          :videoUrl.sync="videoUrl"-->
+<!--          :fileName.sync="form.fileName"-->
+<!--          :line_2.sync="form.lineTwo"-->
+<!--          :line_1.sync="form.lineOne"-->
+<!--          :thumbnail.sync="form.thumbnail"-->
+<!--          :uploadType.sync="form.uploadType"-->
+<!--          :isTranscode.sync="form.isTranscode"-->
+<!--          :transcodeFileKey.sync="form.transcodeFileKey"-->
+<!--          @video-duration="handleVideoDuration"-->
+<!--          @change="handleVideoChange"-->
+<!--          ref="videoUpload"-->
+<!--          append-to-body-->
+<!--        />-->
+        <el-form-item label="开始时间" prop="startTime">
+          <el-date-picker size="small"
+                          v-model="form.startTime"
+                          @change="timeChange"
+                          type="datetime"
+                          format="yyyy-MM-dd HH:mm:ss"
+                          value-format="yyyy-MM-dd HH:mm:ss"
+                          :picker-options="{
+                            timePickerOptions: {
+                              selectableRange: '00:00:00 - 23:59:59',
+                              format: 'HH:mm:ss'
+                            }
+                          }"
+                          placeholder="选择开始时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="结束时间" prop="finishTime" v-loading="timeLoading">
+          <el-date-picker size="small"
+                          v-model="form.finishTime"
+                          type="datetime"
+                          format="yyyy-MM-dd HH:mm:ss"
+                          value-format="yyyy-MM-dd HH:mm:ss"
+                          :picker-options="{
+                            timePickerOptions: {
+                              selectableRange: '00:00:00 - 23:59:59',
+                              format: 'HH:mm:ss'
+                            }
+                          }"
+                          placeholder="视屏播放结束">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="直播封面" prop="liveImgUrl">
+          <image-upload v-model="form.liveImgUrl" :limit="1" />
+        </el-form-item>
+        <el-form-item label="上下架" prop="isShow">
+          <el-radio-group v-model="form.isShow">
+            <el-radio :label="1">上架</el-radio>
+            <el-radio :label="2">下架</el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog
+      title="提示"
+      :visible.sync="rtmpUrlVisible"
+      width="30%"
+    >
+      <div>服务器地址:{{serverName}}</div>
+      <div>推流码:{{livingCode}}</div>
+      <span slot="footer" class="dialog-footer">
+    <el-button type="primary" @click="rtmpUrlVisible = false">确 定</el-button>
+  </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  listLive,
+  getLive,
+  delLive,
+  addLive,
+  updateLive,
+  exportLive,
+  selectCompanyTalent,
+  updateLiveIsAudit,
+  handleShelfOrUn,
+  handleDeleteSelected,
+  finishLive, startLive,
+  copyLive,
+} from "@/api/live/live";
+import Editor from '@/components/Editor/wang';
+import user from '@/store/modules/user';
+import VideoUpload from "@/components/LiveVideoUpload/single.vue";
+
+export default {
+  name: "Live",
+  components: { Editor,VideoUpload },
+  data() {
+    return {
+      baseUrl: process.env.VUE_APP_BASE_API,
+      uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
+      isPrivate:null,
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      timeLoading: false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 直播表格数据
+      liveList: [],
+      // 达人列表
+      talentList: [{talentId:111,nickName:"测试达人"},{talentId:222,nickName:"测试达人2"}],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveName: null,
+        liveDesc: null,
+        showType: null,
+        status: null,
+        anchorId: null,
+        liveType: null,
+        startTime: null,
+        startTimeS: null,
+        endTimeE: null,
+        finishTime: null,
+        liveImgUrl: null,
+        liveConfig: null,
+        isShow: null,
+        isDel: null,
+        qwQrCode: null,
+        rtmpUrl: null,
+      },
+      // 表单参数
+      form: {
+        uploadType: 1,
+        isTranscode:0,
+        transcodeFileKey:null,
+        videoUrl: null,
+        fileKey: null,
+        fileName: null,
+        fileSize: null,
+        lineOne: null,
+      },
+      // 表单校验
+      rules: {
+        liveName: [
+          { required: true, message: "不能为空", trigger: "burl" }
+        ],
+        showType: [
+          { required: true, message: "不能为空", trigger: "burl" }
+        ],
+        liveType: [
+          { required: true, message: "不能为空", trigger: "burl" }
+        ],
+        startTime: [
+          { required: true, message: "不能为空", trigger: "burl" }
+        ],
+        liveImgUrl: [
+          { required: true, message: "不能为空", trigger: "burl" }
+        ],
+        isShow: [
+          { required: true, message: "不能为空", trigger: "change" }
+        ],
+        talentId: [
+          { required: true, message: "不能为空", trigger: "change" }
+        ]
+      },
+      multipleSelection: [],
+      allChecked: false,
+      isIndeterminate: false,
+      rtmpUrlVisible:false,
+      serverName: '',
+      livingCode:'',
+      videoUrl: "",
+      qrcodeDialogVisible: false,  // 弹窗显示状态:默认隐藏
+      currentQrcodeUrl: "",        // 当前要展示的二维码地址
+      defaultImg: "https://via.placeholder.com/400x400?text=二维码加载失败"  // 占位图
+
+    };
+  },
+  created() {
+    this.getList();
+  },
+  watch: {
+    'form.startTime': {
+      handler(newVal) {
+        // 1. 若 startTime 为空,直接返回(避免无效处理)
+        if (!newVal) return;
+
+        // 2. 将字符串时间转为 Date 对象(处理 "yyyy-MM-dd HH:mm:ss" 格式)
+        const timeObj = new Date(newVal);
+        // 兼容时间解析失败的情况(如格式错误)
+        if (isNaN(timeObj.getTime())) return;
+
+        // 3. 强制将秒数设为 1 并补零(即 01 秒)
+        timeObj.setSeconds(1); // 固定秒数为 1
+        const formattedSeconds = this.pad(timeObj.getSeconds()); // 补零为 "01"
+
+        // 4. 重新拼接完整的时间字符串(保持原格式:yyyy-MM-dd HH:mm:ss)
+        const year = timeObj.getFullYear();
+        const month = this.pad(timeObj.getMonth() + 1); // 月份从 0 开始,需 +1
+        const day = this.pad(timeObj.getDate());
+        const hours = this.pad(timeObj.getHours());
+        const minutes = this.pad(timeObj.getMinutes());
+
+        // 5. 更新 form.startTime,完成格式强制修正
+        this.form.startTime = `${year}-${month}-${day} ${hours}:${minutes}:${formattedSeconds}`;
+      },
+      immediate: true, // 初始化时立即执行一次(确保初始值也符合格式)
+      deep: false // startTime 是字符串,无需深度监听
+    }
+  },
+  methods: {
+    beforeAvatarUpload(file) {
+      const isLt1M = file.size / 1024 / 1024 < 1;
+      if (!isLt1M) {
+        this.$message.error('上传图片大小不能超过 1MB!');
+      }
+      return   isLt1M;
+    },
+    handleAvatarSuccess(res, file) {
+      if(res.code==200){
+        this.form.thumbnail=res.url;
+        this.$forceUpdate()
+      }
+      else{
+        this.msgError(res.msg);
+      }
+    },
+    handleVideoDuration(duration) {
+      this.form.duration = duration;
+    },
+    handleVideoChange(videoUrl,lineOne){
+      this.videoUrl = videoUrl;
+      this.form.videoUrl = videoUrl;
+    },
+
+    showLivingUrl(row){
+      this.serverName=''
+      this.livingCode=''
+      this.rtmpUrlVisible = true
+      this.serverName = row.rtmpUrl.slice(0,row.rtmpUrl.lastIndexOf('/') + 1)
+      this.livingCode = row.rtmpUrl.slice(row.rtmpUrl.lastIndexOf('/') + 1)
+    },
+    handleShelf(){
+      if (this.multipleSelection.length > 0) {
+        var liveList = []
+        this.multipleSelection.forEach(item => {
+          liveList.push(item.liveId);
+        })
+        handleShelfOrUn({"liveIds":liveList,"isShow":1}).then(res=>{
+          if (res.code == 200) {
+            this.getList();
+            this.$refs.liveTable.clearSelection();
+          } else {
+            this.$message.error(res.msg);
+          }
+        })
+      } else {
+        this.$message.info("请选择上架直播!")
+      }
+
+    },
+    handleUnshelf(){
+      if (this.multipleSelection.length > 0) {
+        var liveList = []
+        this.multipleSelection.forEach(item => {
+          console.log(typeof(item.liveId))
+          console.log(item.liveId)
+          liveList.push(item.liveId);
+        })
+        handleShelfOrUn({"liveIds":liveList,"isShow":2}).then(res=>{
+          if (res.code == 200) {
+            this.getList();
+            this.$refs.liveTable.clearSelection();
+          } else {
+            this.$message.error(res.msg);
+          }
+        })
+      } else {
+        this.$message.info("请选择下架直播!")
+      }
+    },
+    handleDeleteSelected(){
+      if (this.multipleSelection.length > 0) {
+        var liveList = []
+        this.multipleSelection.forEach(item => {
+          liveList.push(item.liveId);
+        })
+        handleDeleteSelected({"liveIds":liveList}).then(res=>{
+          if (res.code == 200) {
+            this.getList();
+            this.$refs.liveTable.clearSelection();
+          } else {
+            this.$message.error(res.msg);
+          }
+        })
+      } else {
+        this.$message.info("请选择被删除的直播!")
+      }
+    },
+    // 全选或取消全选
+    toggleSelectAll(val) {
+      this.checked = val; // 更新 checkbox 的状态
+      if (val) {
+        // 如果 checkbox 被选中,则全选
+        this.toggleSelection(this.liveList);
+      } else {
+        // 如果 checkbox 被取消选中,则取消全选
+        this.toggleSelection();
+      }
+    },
+    toggleSelection(rows) {
+      if (rows && !this.isIndeterminate) {
+        rows.forEach(row => {
+          this.$refs.liveTable.toggleRowSelection(row);
+        });
+      } else {
+        this.$refs.liveTable.clearSelection();
+      }
+    },
+    // 多选框选中数据
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+      // 根据选择项的数量更新 checkbox 的状态
+      this.allChecked = val.length === this.liveList.length;
+      this.isIndeterminate = val.length > 0 && val.length < this.liveList.length;
+    },
+    /** 查询直播列表 */
+    getList() {
+      this.loading = true;
+      listLive(this.queryParams).then(response => {
+        this.liveList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    urlChange(url) {
+      this.form.videoUrl = url;
+      this.getVideoDuration();
+    },
+    getVideoDuration() {
+      this.timeLoading = true;
+      const videoElement = document.createElement('video');
+      videoElement.src = this.form.videoUrl;
+      videoElement.onloadedmetadata = () => {
+        this.form.duration = Math.floor(videoElement.duration);  // 秒
+        this.form.durationTime = this.secondsToTime(this.form.duration);
+        this.timeChange();
+        this.timeLoading = false;
+      };
+    },
+    changeDuration(e){
+      this.form.duration = e.duration;
+      this.form.durationTime = e.time;
+      this.$forceUpdate();
+      this.timeChange();
+    },
+    timeChange(){
+      if(!this.form.startTime) return;
+      if(!this.form.duration) return;
+      const startDateTime = new Date(this.form.startTime);
+      // 将视频时长(秒)加到开始时间
+      const endDateTime = new Date(startDateTime.getTime() + this.form.duration * 1000); // 毫秒为单位
+      // 格式化为年月日 时分秒
+      this.form.finishTime = this.formatDate(endDateTime);
+      this.$forceUpdate();
+    },
+    // 将秒数转换为时分秒
+    secondsToTime(seconds) {
+      const hours = Math.floor(seconds / 3600);
+      const minutes = Math.floor((seconds % 3600) / 60);
+      const secs = Math.floor(seconds % 60);
+      return `${this.pad(hours)}:${this.pad(minutes)}:${this.pad(secs)}`;
+    },
+    // 补零处理
+    pad(number) {
+      return number < 10 ? `0${number}` : number;
+    },
+    // 格式化日期为 年月日 时分秒
+    formatDate(date) {
+      const year = date.getFullYear();
+      const month = (date.getMonth() + 1).toString().padStart(2, '0');
+      const day = date.getDate().toString().padStart(2, '0');
+      const hours = date.getHours().toString().padStart(2, '0');
+      const minutes = date.getMinutes().toString().padStart(2, '0');
+      const seconds = date.getSeconds().toString().padStart(2, '0');
+
+      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        showType: 1,
+        liveType: 2,
+        isShow: 1,
+        uploadType:1,
+        isTranscode:0,
+        transcodeFileKey:null
+      };
+      this.videoUrl = "";
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.queryParams.status = null;
+      this.handleQuery();
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      setTimeout(() => {
+        this.$refs.myeditor.setText("");
+        this.$refs.videoUpload.reset();
+      }, 100);
+      this.title = "添加直播间";
+    },
+    updateText(text){
+      this.form.liveDesc=text
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const liveId = row.liveId || this.ids
+      getLive(liveId).then(response => {
+        this.form = response.data;
+        this.videoUrl = this.form.videoUrl;
+        if(this.form.duration){
+          this.form.durationTime = this.secondsToTime(this.form.duration)
+        }
+        setTimeout(() => {
+          if(this.form.liveDesc==null){
+            this.$refs.myeditor.setText("");
+          }else{
+            this.$refs.myeditor.setText(this.form.liveDesc);
+          }
+          this.form.videoUrl = row.videoUrl
+        }, 1);
+        this.open = true;
+        this.title = "修改直播间";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      if(this.form.liveId != null) { this.videoUrl = this.form.videoUrl; }
+      if(this.form.liveType==2 && this.videoUrl.length == 0) {return this.$message.error("请上传视频");}
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.form.videoUrl = this.videoUrl;
+          if (this.form.liveId != null) {
+            updateLive(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLive(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const liveIds = row.liveId || this.ids;
+      this.$confirm('是否确认删除直播编号为"' + liveIds + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return delLive(liveIds);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    handleConfig(row) {
+      console.info(row)
+      this.$router.push('/live/liveConfig/' + row.liveId)
+    },
+    handleManage(row) {
+      this.$router.push('/live/liveConsole/' + row.liveId)
+    },
+    // 查看二维码图片
+    handleCheckCode(row) {
+      // 先校验图片地址是否存在
+      if (!row.liveCodeUrl) {
+        this.$message.warning("二维码图片地址不存在,请稍后重试");
+        return;
+      }
+      // 赋值当前图片地址 + 打开弹窗
+      this.currentQrcodeUrl = row.liveCodeUrl;
+      this.qrcodeDialogVisible = true;
+    },
+    // 2. 图片加载失败:替换为占位图
+    handleImgError(e) {
+      e.target.src = this.defaultImg;
+    },
+    handleAudit( row){
+      this.$alert('是否审核通过?', '审核', {
+        confirmButtonText: '同意',
+        cancelButtonText: '不同意',
+        showCancelButton: true, // 显示取消按钮(即“不同意”)
+        distinguishCancelAndClose: true,
+        type: 'warning',
+        callback: action => {
+          let isAudit;
+          if(action === 'cancel') isAudit = 0;
+          if(action === 'confirm') isAudit = 1;
+          if("confirm" === action || "cancel" === action){
+            updateLiveIsAudit( {"liveId" : row.liveId, "isAudit" : isAudit}).then(res => {
+              console.log(res)
+              console.log(res>0)
+              if (res > 0) {
+                this.getList()
+                this.$message.success("审核成功")
+              }else {
+                this.$message.error(res.msg)
+              }
+            })
+          }
+        }
+      });
+    },
+    handleStart(row){
+      if(row.isShow == 2){
+        this.$message.error("直播间已下架")
+        return
+      }
+      this.$confirm('是否确认开启直播间?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        startLive({"liveId":row.liveId}).then(response=>{this.getList()})
+      }).catch(() => {});
+    },
+    handleEnded(row){
+      this.$confirm('是否确认关闭直播间?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        finishLive({"liveId":row.liveId}).then(response=>{this.getList()})
+      }).catch(() => {});
+    },
+    handleCopy(row){
+      this.$confirm('是否确认复制直播间?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.loading = true;
+        copyLive({"liveId":row.liveId}).then(response=>{this.getList();this.loading = false;})
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有直播数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportLive(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {});
+    }
+  }
+};
+</script>
+
+<style scoped>
+.selection-toolbar {
+  display: flex;
+  align-items: center;
+  margin-bottom: 10px;
+  padding-left: 10px;
+}
+
+.selection-toolbar .el-checkbox {
+  margin-right: 10px;
+}
+
+/* 调整 checkbox 内部输入框的对齐 */
+.selection-toolbar .el-checkbox .el-checkbox__inner {
+  top: 8px; /* 根据实际需求调整 */
+}
+</style>

+ 331 - 0
src/views/live/liveAfterSalesItem/index.vue

@@ -0,0 +1,331 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="售后id" prop="afterSalesId">
+        <el-input
+          v-model="queryParams.afterSalesId"
+          placeholder="请输入售后id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="直播商品ID" prop="goodsId">
+        <el-input
+          v-model="queryParams.goodsId"
+          placeholder="请输入直播商品ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="商品id" prop="productId">
+        <el-input
+          v-model="queryParams.productId"
+          placeholder="请输入商品id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="逻辑删除" prop="isDel">
+        <el-input
+          v-model="queryParams.isDel"
+          placeholder="请输入逻辑删除"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="逻辑删除" prop="productAttrValueId">
+        <el-input
+          v-model="queryParams.productAttrValueId"
+          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-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['live:liveAfterSalesItem:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['live:liveAfterSalesItem:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['live:liveAfterSalesItem:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['live:liveAfterSalesItem:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveAfterSalesItemList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="主键id" align="center" prop="id" />
+      <el-table-column label="售后id" align="center" prop="afterSalesId" />
+      <el-table-column label="直播商品ID" align="center" prop="goodsId" />
+      <el-table-column label="商品id" align="center" prop="productId" />
+      <el-table-column label="退货东西的详情信息" align="center" prop="jsonInfo" />
+      <el-table-column label="逻辑删除" align="center" prop="isDel" />
+      <el-table-column label="逻辑删除" align="center" prop="productAttrValueId" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['live:liveAfterSalesItem:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['live:liveAfterSalesItem:remove']"
+          >删除</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="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="售后id" prop="afterSalesId">
+          <el-input v-model="form.afterSalesId" placeholder="请输入售后id" />
+        </el-form-item>
+        <el-form-item label="直播商品ID" prop="goodsId">
+          <el-input v-model="form.goodsId" placeholder="请输入直播商品ID" />
+        </el-form-item>
+        <el-form-item label="商品id" prop="productId">
+          <el-input v-model="form.productId" placeholder="请输入商品id" />
+        </el-form-item>
+        <el-form-item label="退货东西的详情信息" prop="jsonInfo">
+          <el-input v-model="form.jsonInfo" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="逻辑删除" prop="isDel">
+          <el-input v-model="form.isDel" placeholder="请输入逻辑删除" />
+        </el-form-item>
+        <el-form-item label="逻辑删除" prop="productAttrValueId">
+          <el-input v-model="form.productAttrValueId" placeholder="请输入逻辑删除" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listLiveAfterSalesItem, getLiveAfterSalesItem, delLiveAfterSalesItem, addLiveAfterSalesItem, updateLiveAfterSalesItem, exportLiveAfterSalesItem } from "@/api/live/liveAfterSalesItem";
+
+export default {
+  name: "LiveAfterSalesItem",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 售后子表格数据
+      liveAfterSalesItemList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        afterSalesId: null,
+        goodsId: null,
+        productId: null,
+        jsonInfo: null,
+        isDel: null,
+        productAttrValueId: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        jsonInfo: [
+          { required: true, message: "退货东西的详情信息不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询售后子列表 */
+    getList() {
+      this.loading = true;
+      listLiveAfterSalesItem(this.queryParams).then(response => {
+        this.liveAfterSalesItemList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        afterSalesId: null,
+        goodsId: null,
+        productId: null,
+        jsonInfo: null,
+        isDel: null,
+        productAttrValueId: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加售后子";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getLiveAfterSalesItem(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改售后子";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateLiveAfterSalesItem(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLiveAfterSalesItem(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除售后子编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveAfterSalesItem(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有售后子数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveAfterSalesItem(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 358 - 0
src/views/live/liveAfterSalesLogs/index.vue

@@ -0,0 +1,358 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="售后id" prop="storeAfterSalesId">
+        <el-input
+          v-model="queryParams.storeAfterSalesId"
+          placeholder="请输入售后id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="操作类型" prop="changeType">
+        <el-select v-model="queryParams.changeType" placeholder="请选择操作类型" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="操作备注" prop="changeMessage">
+        <el-input
+          v-model="queryParams.changeMessage"
+          placeholder="请输入操作备注"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="操作时间" prop="changeTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.changeTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择操作时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="操作人" prop="operator">
+        <el-input
+          v-model="queryParams.operator"
+          placeholder="请输入操作人"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="公司id" prop="companyId">
+        <el-input
+          v-model="queryParams.companyId"
+          placeholder="请输入公司id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="店铺id" prop="storeId">
+        <el-input
+          v-model="queryParams.storeId"
+          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>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['live:liveAfterSalesLogs:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['live:liveAfterSalesLogs:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['live:liveAfterSalesLogs:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['live:liveAfterSalesLogs:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveAfterSalesLogsList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="店铺id" align="center" prop="logsId" />
+      <el-table-column label="售后id" align="center" prop="storeAfterSalesId" />
+      <el-table-column label="操作类型" align="center" prop="changeType" />
+      <el-table-column label="操作备注" align="center" prop="changeMessage" />
+      <el-table-column label="操作时间" align="center" prop="changeTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.changeTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作人" align="center" prop="operator" />
+      <el-table-column label="公司id" align="center" prop="companyId" />
+      <el-table-column label="店铺id" align="center" prop="storeId" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['live:liveAfterSalesLogs:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['live:liveAfterSalesLogs:remove']"
+          >删除</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="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="售后id" prop="storeAfterSalesId">
+          <el-input v-model="form.storeAfterSalesId" placeholder="请输入售后id" />
+        </el-form-item>
+        <el-form-item label="操作类型" prop="changeType">
+          <el-select v-model="form.changeType" placeholder="请选择操作类型">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="操作备注" prop="changeMessage">
+          <el-input v-model="form.changeMessage" placeholder="请输入操作备注" />
+        </el-form-item>
+        <el-form-item label="操作时间" prop="changeTime">
+          <el-date-picker clearable size="small"
+            v-model="form.changeTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择操作时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="操作人" prop="operator">
+          <el-input v-model="form.operator" placeholder="请输入操作人" />
+        </el-form-item>
+        <el-form-item label="公司id" prop="companyId">
+          <el-input v-model="form.companyId" placeholder="请输入公司id" />
+        </el-form-item>
+        <el-form-item label="店铺id" prop="storeId">
+          <el-input v-model="form.storeId" placeholder="请输入店铺id" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listLiveAfterSalesLogs, getLiveAfterSalesLogs, delLiveAfterSalesLogs, addLiveAfterSalesLogs, updateLiveAfterSalesLogs, exportLiveAfterSalesLogs } from "@/api/live/liveAfterSalesLogs";
+
+export default {
+  name: "LiveAfterSalesLogs",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 售后订单操作表格数据
+      liveAfterSalesLogsList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        storeAfterSalesId: null,
+        changeType: null,
+        changeMessage: null,
+        changeTime: null,
+        operator: null,
+        companyId: null,
+        storeId: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询售后订单操作列表 */
+    getList() {
+      this.loading = true;
+      listLiveAfterSalesLogs(this.queryParams).then(response => {
+        this.liveAfterSalesLogsList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        logsId: null,
+        storeAfterSalesId: null,
+        changeType: null,
+        changeMessage: null,
+        changeTime: null,
+        operator: null,
+        companyId: null,
+        storeId: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.logsId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加售后订单操作";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const logsId = row.logsId || this.ids
+      getLiveAfterSalesLogs(logsId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改售后订单操作";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.logsId != null) {
+            updateLiveAfterSalesLogs(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLiveAfterSalesLogs(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const logsIds = row.logsId || this.ids;
+      this.$confirm('是否确认删除售后订单操作编号为"' + logsIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveAfterSalesLogs(logsIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有售后订单操作数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveAfterSalesLogs(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 473 - 0
src/views/live/liveAfteraSales/index.vue

@@ -0,0 +1,473 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="公司名" prop="companyId">
+        <el-select filterable  v-model="queryParams.companyId" placeholder="请选择公司名"  @change="companyChange" 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 >
+        <treeselect style="width: 220px" :clearable="false"  v-model="queryParams.deptId"  :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
+      </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 label="员工姓名" prop="companyUserNickName">
+        <el-input
+          v-model="queryParams.companyUserNickName"
+          placeholder="请输入员工姓名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="手机号" prop="consigneePhone">
+        <el-input
+          v-model="queryParams.consigneePhone"
+          placeholder="请输入手机号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+
+
+      <el-form-item label="退款类型" prop="serviceType">
+        <el-select  v-model="queryParams.serviceType" placeholder="请选择退款类型" clearable size="small" >
+          <el-option
+            v-for="item in serviceTypeOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+
+
+      <el-form-item label="状态" prop="status">
+        <el-select  v-model="queryParams.status" placeholder="请选择状态" clearable size="small" >
+          <el-option
+            v-for="item in statusOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="售后状态" prop="salesStatus">
+        <el-select   v-model="queryParams.salesStatus" placeholder="请选择状态" clearable size="small" >
+          <el-option
+            v-for="item in salesStatusOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="订单状态" prop="orderStatus">
+        <el-select   v-model="queryParams.orderStatus" placeholder="请选择订单状态" clearable size="small" >
+          <el-option
+            v-for="item in orderStatusOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="物流状态" prop="deliveryStatus">
+        <el-select   v-model="queryParams.deliveryStatus" placeholder="请选择物流状态" clearable size="small" >
+          <el-option
+            v-for="item in deliveryStatusOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="物流单号" prop="deliverySn">
+        <el-input
+          v-model="queryParams.deliverySn"
+          placeholder="物流/退回物流单号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"/>
+      </el-form-item>
+
+
+      <el-form-item label="提交时间" prop="createTime">
+        <el-date-picker
+          style="width:205.4px"
+          clearable size="small"
+          v-model="dateRange"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" 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"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['store:storeAfterSales:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+    <el-table  height="500" border v-loading="loading" :data="storeAfterSalesList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="ID" align="center" prop="id" />
+      <el-table-column label="所属公司" align="center" prop="companyName" />
+      <el-table-column label="所属员工" align="center" prop="companyUserNickName" />
+      <el-table-column label="订单单号" align="center" prop="orderCode" />
+      <el-table-column label="会员手机号" align="center" prop="userPhone" />
+      <el-table-column label="退款金额" align="center" prop="refundAmount" />
+      <el-table-column label="退款类型" align="center" prop="serviceType" >
+        <template slot-scope="scope">
+          <div prop="serviceType" v-for="(item, index) in serviceTypeOptions"    v-if="scope.row.serviceType==item.dictValue">{{item.dictLabel}}</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="申请原因" align="center" prop="reasons" />
+      <el-table-column label="说明" align="center" prop="explains" />
+      <el-table-column label="状态" align="center" prop="status" >
+        <template slot-scope="scope">
+          <div prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="售后状态" align="center" prop="salesStatus" >
+        <template slot-scope="scope">
+          <div prop="status" v-for="(item, index) in salesStatusOptions"    v-if="scope.row.salesStatus==item.dictValue">{{item.dictLabel}}</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="订单状态" align="center" prop="orderStatus" >
+        <template slot-scope="scope">
+          <div prop="status" v-for="(item, index) in orderStatusOptions"    v-if="scope.row.orderStatus==item.dictValue">{{item.dictLabel}}</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="物流状态" align="center" prop="deliveryStatus" >
+        <template slot-scope="scope">
+          <el-tag prop="status" v-for="(item, index) in deliveryStatusOptions"    v-if="scope.row.deliveryStatus==item.dictValue">{{item.dictLabel}}</el-tag>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="物流单号" align="center" prop="deliveryId" />
+
+      <el-table-column label="客户退回物流单号" align="center" prop="deliverySn" />
+
+      <el-table-column label="提交时间" align="center" prop="createTime" />
+
+      <el-table-column label="操作" align="center" fixed="right" width="100px" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleShow(scope.row)"
+            v-hasPermi="['store:storeAfterSales:query']"
+          >查看</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-drawer
+      size="75%"
+      :title="title" :visible.sync="open"
+    >
+      <product-after-sales-order  ref="afterSalesOrder" />
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import { listStoreAfterSales, getStoreAfterSales, delStoreAfterSales, addStoreAfterSales, updateStoreAfterSales, exportStoreAfterSales } from "@/api/live/liveAfterSales";
+import productAfterSalesOrder from "../components/productAfterSalesOrder";
+import { getCompanyList } from "@/api/company/company";
+import { treeselect } from "@/api/company/companyDept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  watch: {
+    // 监听deptId
+    'deptId': 'currDeptChange'
+  },
+  components: { productAfterSalesOrder,Treeselect },
+  name: "HisStoreAfterSales",
+  data() {
+    return {
+      companyId:undefined,
+      deptId:undefined,
+      orderStatusOptions:[],
+      companys:[],
+      deliveryStatusOptions:[],
+      serviceTypeOptions:[],
+      salesStatusOptions:[],
+      statusOptions:[],
+      deptOptions:[],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      dateRange:[],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 售后记录表格数据
+      storeAfterSalesList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orderCode: null,
+        refundAmount: null,
+        serviceType: null,
+        reasons: null,
+        explains: null,
+        explainImg: null,
+        shipperCode: null,
+        deliverySn: null,
+        deliveryName: null,
+        status: null,
+        salesStatus: null,
+        isDel: null,
+        userId: null,
+        consignee: null,
+        phoneNumber: null,
+        address: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    getCompanyList().then(response => {
+      this.companys = response.data;
+      if(this.companys!=null&&this.companys.length>0){
+        this.companyId=this.companys[0].companyId;
+        this.getTreeselect();
+      }
+    });
+    this.getDicts("store_after_sales_sales_status").then((response) => {
+      this.salesStatusOptions = response.data;
+    });
+    this.getDicts("store_after_sales_status").then((response) => {
+      this.statusOptions = response.data;
+    });
+    this.getDicts("store_after_sales_service_type").then((response) => {
+      this.serviceTypeOptions = response.data;
+    });
+    this.getDicts("store_order_delivery_status").then((response) => {
+      this.deliveryStatusOptions = response.data;
+    });
+    this.getDicts("store_order_status").then((response) => {
+      this.orderStatusOptions = response.data;
+    });
+
+    this.getList();
+  },
+  methods: {
+    handleDetails(row){
+      this.show.open=true;
+      const orderId = row.id ;
+      setTimeout(() => {
+        this.$refs.order.getOrder(orderId);
+      }, 500);
+    },
+    handleShow(row){
+      this.title="售后订单"
+      this.open=true;
+      setTimeout(() => {
+        this.$refs.afterSalesOrder.getStoreAfterSales(row.id);
+      }, 200);
+
+    },
+
+    /** 查询售后记录列表 */
+    getList() {
+      this.loading = true;
+      listStoreAfterSales(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+        this.storeAfterSalesList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        orderCode: null,
+        refundAmount: null,
+        serviceType: null,
+        reasons: null,
+        explains: null,
+        explainImg: null,
+        shipperCode: null,
+        deliverySn: null,
+        deliveryName: null,
+        status: 0,
+        salesStatus: 0,
+        createTime: null,
+        isDel: null,
+        userId: null,
+        consignee: null,
+        phoneNumber: null,
+        address: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加售后记录";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getStoreAfterSales(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改售后记录";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateStoreAfterSales(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          } else {
+            addStoreAfterSales(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除售后记录编号为"' + ids + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return delStoreAfterSales(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(function() {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有售后记录数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return exportStoreAfterSales(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      }).catch(function() {});
+    },
+    getTreeselect() {
+      var that=this;
+      var param={companyId:this.companyId}
+      treeselect(param).then((response) => {
+        this.deptOptions = response.data;
+        console.log(this.deptOptions)
+        if(response.data!=null&&response.data.length>0){
+          //this.queryParams.deptId=response.data[0].id;
+        }
+      });
+    },
+    companyChange(val){
+      console.log(val);
+      this.companyId=val;
+      this.getTreeselect();
+    },
+    currDeptChange(val){
+      console.log(val)
+      this.queryParams.deptId=val;
+      this.getList();
+    },
+  }
+};
+</script>

+ 367 - 0
src/views/live/liveAnchor/index.vue

@@ -0,0 +1,367 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-row :gutter="10">
+        <el-col :span="6">
+          <el-form-item label="昵称" prop="nickName">
+            <el-input
+              v-model="queryParams.nickName"
+              placeholder="请输入昵称"
+              clearable
+              size="small"
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="手机号" prop="mobile">
+            <el-input
+              v-model="queryParams.mobile"
+              placeholder="请输入手机号"
+              clearable
+              size="small"
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="微信OPENID" prop="openId">
+            <el-input
+              v-model="queryParams.openId"
+              placeholder="请输入微信OPENID"
+              clearable
+              size="small"
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="状态" prop="status">
+            <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
+              <el-option
+                v-for="dict in statusOptions"
+                :key="dict.dictValue"
+                :label="dict.dictLabel"
+                :value="dict.dictValue"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
+        <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="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['live:liveAnchor:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['live:liveAnchor:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['live:liveAnchor:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['live:liveAnchor:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveAnchorList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="ID" align="center" prop="anchorId" />
+      <el-table-column label="昵称" align="center" prop="nickName" />
+      <el-table-column label="密码" align="center" prop="password" />
+      <el-table-column label="手机号" align="center" prop="mobile" />
+      <el-table-column label="微信OPENID" align="center" prop="openId" />
+      <el-table-column label="身份证反面" align="center" prop="idCardBackUrl" />
+      <el-table-column label="身份证正面" align="center" prop="idCardFrontUrl" />
+      <el-table-column label="状态" align="center" prop="status" :formatter="anchorStatusFormatter"/>
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['live:liveAnchor:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['live:liveAnchor:remove']"
+          >删除</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="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="昵称" prop="nickName">
+          <el-input v-model="form.nickName" placeholder="请输入昵称" />
+        </el-form-item>
+        <el-form-item label="密码" prop="password">
+          <el-input v-model="form.password" placeholder="请输入密码" />
+        </el-form-item>
+        <el-form-item label="手机号" prop="mobile">
+          <el-input v-model="form.mobile" placeholder="请输入手机号" />
+        </el-form-item>
+        <el-form-item label="微信OPENID" prop="openId">
+          <el-input v-model="form.openId" placeholder="请输入微信OPENID" />
+        </el-form-item>
+        <el-form-item label="身份证反面" prop="idCardBackUrl">
+          <ImageUpload  v-model="form.idCardBackUrl" type="image" :limit=2 :width="150"
+                        :height="150"/>
+        </el-form-item>
+        <el-form-item label="身份证正面" prop="idCardFrontUrl">
+          <ImageUpload  v-model="form.idCardFrontUrl" type="image" :limit=1 :width="150"
+                       :height="150"/>
+<!--          示例图片-->
+        </el-form-item>
+        <el-form-item label="状态">
+          <el-radio-group v-model="form.status">
+            <el-radio :label="item.dictValue" v-for="item in statusOptions" >{{item.dictLabel}}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listLiveAnchor, getLiveAnchor, delLiveAnchor, addLiveAnchor, updateLiveAnchor, exportLiveAnchor } from "@/api/live/liveAnchor";
+
+export default {
+  name: "LiveAnchor",
+  data() {
+    return {
+      //字典
+      statusOptions: [],
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 主播表格数据
+      liveAnchorList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        nickName: null,
+        password: null,
+        mobile: null,
+        openId: null,
+        idCardBackUrl: null,
+        idCardFrontUrl: null,
+        status: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getDicts("sys_live_anchor_status").then(response => {
+      this.statusOptions = response.data;
+    });
+  },
+  methods: {
+    /** 查询主播列表 */
+    getList() {
+      this.loading = true;
+      listLiveAnchor(this.queryParams).then(response => {
+        this.liveAnchorList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    anchorStatusFormatter(row, column) {
+      return this.selectDictLabel(this.statusOptions, row.status);
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        anchorId: null,
+        nickName: null,
+        password: null,
+        mobile: null,
+        openId: null,
+        idCardBackUrl: null,
+        idCardFrontUrl: null,
+        status: 0,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.anchorId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加主播";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const anchorId = row.anchorId || this.ids
+      getLiveAnchor(anchorId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改主播";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.anchorId != null) {
+            updateLiveAnchor(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLiveAnchor(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const anchorIds = row.anchorId || this.ids;
+      this.$confirm('是否确认删除主播编号为"' + anchorIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveAnchor(anchorIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有主播数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveAnchor(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>
+<style >
+.el-form-item__label {
+  width: 120px !important;
+}
+.el-input {
+  width: 80% !important;
+}
+
+</style>

+ 935 - 0
src/views/live/liveConsole/index.vue

@@ -0,0 +1,935 @@
+<template>
+  <!-- 直播中控台 start -->
+  <el-row type="flex" justify="center" class="live-console" :gutter="10" v-loading="loading">>
+    <!-- 聊天 start -->
+    <el-col class="live-console-col" :span="6">
+      <el-tabs class="live-console-tab-left" v-model="tabRight.activeName" @tab-click="handleClick" :stretch="true">
+        <el-tab-pane label="讨论" name="talk">
+          <el-scrollbar style="height: 500px; width: 100%;" ref="manageRightRef">
+            <el-row v-for="m in msgList" >
+              <el-row v-if="m.userId !== userId" style="margin-top: 5px" type="flex" align="top" >
+                <el-col :span="3" style="margin-left: 10px"><el-avatar :src="m.avatar"/></el-col>
+                <el-col :span="15">
+                  <el-row style="margin-left: 10px">
+                    <el-col><div style="font-size: 12px; color: #999; margin-bottom: 3px;">{{ m.nickName }}</div></el-col>
+                    <el-col :span="24" style="max-width: 200px;">
+                      <div style="white-space: normal; word-wrap: break-word;background-color: #f0f2f5; padding: 8px; border-radius: 5px;font-size: 14px;width: 100%;">
+                        {{ m.msg }}
+                      </div>
+                    </el-col>
+                    <el-col>
+                      <a style="cursor: pointer;color: #ff0000;padding: 8px 8px 0 0;font-size: 12px;" @click="changeUserState(m)">{{ m.msgStatus === 1 ? '解禁' : '禁言' }}</a>
+                      <a style="cursor: pointer;color: #ff0000;padding: 8px 8px 0 0;font-size: 12px;" @click="blockUser(m)">拉黑</a>
+                    </el-col>
+                  </el-row>
+                </el-col>
+              </el-row>
+              <el-row v-if="m.userId === userId" style="padding: 8px 0" type="flex" align="top" justify="end">
+                <div style="display: flex;justify-content: flex-end">
+                  <div style="display: flex;justify-content: flex-end;flex-direction: column;max-width: 200px;align-items: flex-end">
+                    <div style="font-size: 12px; color: #999; margin-bottom: 3px;">{{ m.nickName }}</div>
+                    <div style="white-space: normal; word-wrap: break-word;width: 100%; background-color: #e6f7ff; padding: 8px; border-radius: 5px;font-size: 14px;">{{ m.msg }}</div>
+                  </div>
+                  <el-avatar :src="m.avatar" style="margin-left: 10px; margin-right: 10px;"/>
+                </div>
+              </el-row>
+            </el-row>
+            <!-- 底部留白 -->
+            <div style="height: 20px;"></div>
+          </el-scrollbar>
+
+          <!-- 消息输入区域 -->
+          <div style="padding: 10px; border-top: 1px solid #ebeef5; background-color: #fff; min-height: 120px;">
+            <el-input
+              type="textarea"
+              v-model="newMsg"
+              placeholder="请输入消息..."
+              :rows="8"
+              @keyup.enter.native="sendMessage"
+              clearable
+              resize="none"
+              style="flex: 1; margin-right: 10px;"
+            >
+            </el-input>
+            <div style="display: flex; justify-content: flex-end; margin-top: 10px;">
+              <el-button plain @click="sendMessage">发送</el-button>
+            </div>
+          </div>
+        </el-tab-pane>
+      </el-tabs>
+    </el-col>
+    <!-- 聊天 end -->
+
+
+    <!-- 直播/视频 start -->
+    <el-col class="live-console-col" :span="12">
+      <div style="background: #000; border-radius: 5px; overflow: hidden; margin: 10px 5px;">
+        <div style="border-radius: 5px; overflow: hidden;" v-if="!isAudit">
+          <img :src="require('@/assets/images/videoIsAudit.png')" style="width: 100%; height: 45vh;">
+        </div>
+        <div style="border-radius: 5px; overflow: hidden;" v-else-if="status != 2 && status != 4">
+          <img :src="require('@/assets/images/videoNotStart.png')" style="width: 100%; height: 45vh;">
+        </div>
+        <div style="border-radius: 5px; overflow: hidden;" v-else-if="liveType == 1">
+          <video
+            controls
+            ref="livingPlayer"
+            autoplay
+            width="100%"
+            @click.prevent
+            @contextmenu.prevent
+            class="custom-video"
+            style="display: block; background: #000; height: 45vh;"
+          ></video>
+          <!-- 时间显示(可选) -->
+          <div ref="liveElapsedTime" class="time-display">
+            已播放:<span id="liveElapsedTime">00:00:00</span>
+          </div>
+        </div>
+        <div style="border-radius: 5px; overflow: hidden;" v-else-if="liveType == 2">
+          <video
+            controls
+            ref="videoPlayer"
+            loop
+            autoplay
+            width="100%"
+            muted
+            playsinline
+            @click.prevent
+            @contextmenu.prevent
+            class="custom-video"
+            style="display: block; background: #000; height: 40vh;"
+          >
+            <source :src="videoUrl" type="application/x-mpegURL">
+          </video>
+          <!-- 自定义进度条容器 -->
+          <div ref="progressBar" class="progress-container">
+            <div id="progressBar" class="progress-bar"></div>
+          </div>
+
+          <!-- 时间显示(可选) -->
+          <div ref="elapsedTime" class="time-display">
+            已播放:<span id="elapsedTime">00:00:00</span>
+          </div>
+        </div>
+        <div style="border-radius: 5px; overflow: hidden;" v-else-if="liveType == 3">
+          <video
+            controls
+            ref="liveReplay"
+            loop
+            autoplay
+            width="100%"
+            playsinline
+            style="display: block; background: #000; height: 40vh;"
+          >
+            <source :src="videoUrl" type="application/x-mpegURL">
+          </video>
+        </div>
+        <div style="border-radius: 5px; overflow: hidden;" v-else>
+          <img :src="require('@/assets/images/videoNotStart.png')" style="width: 100%; height: 45vh;">
+        </div>
+      </div>
+      <!-- 底部导航栏 -->
+      <div style="display: flex; justify-content: space-around; padding: 15px 0; background: #fff; border-top: 1px solid #f0f0f0;">
+        <div style="display: flex; flex-direction: column; align-items: center; cursor: pointer;" @click="handleClickRed">
+          <i class="el-icon-money" style="font-size: 20px;"></i>
+          <span style="font-size: 12px; margin-top: 4px;">红包配置</span>
+        </div>
+        <div style="display: flex; flex-direction: column; align-items: center; cursor: pointer;" @click="handleClickLottery">
+          <i class="el-icon-present" style="font-size: 20px;"></i>
+          <span style="font-size: 12px; margin-top: 4px;">抽奖配置</span>
+        </div>
+        <div style="display: flex; flex-direction: column; align-items: center; cursor: pointer;" @click="handleClickGoods">
+          <i class="el-icon-goods" style="font-size: 20px;"></i>
+          <span style="font-size: 12px; margin-top: 4px;">商品</span>
+        </div>
+        <div style="display: flex; flex-direction: column; align-items: center; cursor: pointer;" @click="handleClickOrder">
+          <i class="el-icon-goods" style="font-size: 20px;"></i>
+          <span style="font-size: 12px; margin-top: 4px;">直播订单</span>
+        </div>
+        <div style="display: flex; flex-direction: column; align-items: center; cursor: pointer;" @click="handleClickCoupon">
+          <i class="el-icon-goods" style="font-size: 20px;"></i>
+          <span style="font-size: 12px; margin-top: 4px;">直播优惠券</span>
+        </div>
+      </div>
+      <el-radio-group v-model="tableRadio" >
+        <el-radio-button label="订单数">订单数</el-radio-button>
+      </el-radio-group>
+      <div  style="position: relative;width: 100%; height: 300px;">
+        <div ref="chartContainer" style="width: 100%; height: 100%;"></div>
+        <div style="position: absolute; top: 10px; right: 10px; background: #fff; padding: 5px; z-index: 1;">
+          <el-select v-model="searchQuery.timeOptions" placeholder="请选择" style="width: 150px"  @change="timeChange">
+            <el-option
+              v-for="item in timeOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+          <el-select v-model="searchQuery.timeGranularity" placeholder="请选择" style="width: 150px"  @change="timeGranularityChange">
+            <el-option
+              v-for="item in timeGranularity"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+          <!--          <el-button type="primary" @click="applyFilter">搜索</el-button>-->
+        </div>
+      </div>
+    </el-col>
+    <!-- 直播/视频 end -->
+
+    <!-- 用户列表 start -->
+    <el-col class="live-console-col" :span="6">
+      <el-tabs class="live-console-tab-right" v-model="tabLeft.activeName" @tab-click="handleClick" :stretch="true">
+        <el-tab-pane :label="onlineLabel" name="online">
+          <el-scrollbar ref="manageLeftRef_online" style="height: 800px; width: 100%;">
+            <el-row style="margin-top: 10px" type="flex" align="middle" v-for="u in onlineUserList">
+              <el-col :span="20">
+                <el-row type="flex" align="middle">
+                  <el-col :span="4" style="padding-left: 10px;"><el-avatar :src="u.avatar"></el-avatar></el-col>
+                  <el-col :span="19" :offset="1">{{ u.nickName }}</el-col>
+                  <el-col :span="19" :offset="1">{{ u.userId }}</el-col>
+                </el-row>
+              </el-col>
+              <el-col :span="4" >
+                <el-popover
+                  width="100"
+                  trigger="click">
+                  <a style="cursor: pointer;color: #ff0000;" @click="changeUserState(u)">{{ u.msgStatus === 1 ? '解禁' : '禁言' }}</a>
+                  <a style="cursor: pointer;color: #ff0000;margin-left:10px" @click="blockUser(u)">拉黑</a>
+                  <i class="el-icon-more" slot="reference"></i>
+                </el-popover>
+              </el-col>
+            </el-row>
+          </el-scrollbar>
+        </el-tab-pane>
+        <el-tab-pane :label="offlineLabel" name="offline">
+          <el-scrollbar ref="manageLeftRef_offline" style="height: 800px; width: 100%;">
+            <el-row style="margin-top: 10px" type="flex" align="middle" v-for="u in offlineUserList">
+              <el-col :span="20">
+                <el-row type="flex" align="middle">
+                  <el-col :span="4" style="padding-left: 10px;"><el-avatar :src="u.avatar"></el-avatar></el-col>
+                  <el-col :span="19" :offset="1">{{ u.nickName }}</el-col>
+                  <el-col :span="19" :offset="1">{{ u.userId }}</el-col>
+                </el-row>
+              </el-col>
+              <el-col :span="4" >
+                <el-popover
+                  width="100"
+                  trigger="click">
+                  <a style="cursor: pointer;color: #ff0000;" @click="changeUserState(u)">{{ u.msgStatus === 1 ? '解禁' : '禁言' }}</a>
+                  <a style="cursor: pointer;color: #ff0000;margin-left:10px" @click="blockUser(u)">拉黑</a>
+                  <i class="el-icon-more" slot="reference"></i>
+                </el-popover>
+              </el-col>
+            </el-row>
+          </el-scrollbar>
+        </el-tab-pane>
+        <el-tab-pane :label="silencedUserLabel" name="silenced">
+          <el-scrollbar ref="manageLeftRef_silenced" style="height: 800px; width: 100%;">
+            <el-row style="margin-top: 10px" type="flex" align="middle" v-for="u in silencedUserList">
+              <el-col :span="20">
+                <el-row type="flex" align="middle">
+                  <el-col :span="4" style="padding-left: 10px;"><el-avatar :src="u.avatar"></el-avatar></el-col>
+                  <el-col :span="19" :offset="1">{{ u.nickName }}</el-col>
+                  <el-col :span="19" :offset="1">{{ u.userId }}</el-col>
+                </el-row>
+              </el-col>
+              <el-col :span="4" >
+                <el-popover
+                  width="100"
+                  trigger="click">
+                  <a style="cursor: pointer;color: #ff0000;" @click="changeUserState(u)">{{ u.msgStatus === 1 ? '解禁' : '禁言' }}</a>
+                  <a style="cursor: pointer;color: #ff0000;margin-left:10px" @click="blockUser(u)">拉黑</a>
+                  <i class="el-icon-more" slot="reference"></i>
+                </el-popover>
+              </el-col>
+            </el-row>
+          </el-scrollbar>
+        </el-tab-pane>
+      </el-tabs>
+    </el-col>
+    <!-- 用户列表 end -->
+  </el-row>
+  <!-- 直播中控台  end -->
+</template>
+
+<script>
+import { blockUser,changeUserStatus, watchUserList } from '@/api/live/liveWatchUser'
+import { getLiveVideoByLiveId } from '@/api/live/liveVideo'
+import {getLive, getLivingUrl} from '@/api/live/live'
+import { getLiveOrderTimeGranularity } from '@/api/live/liveOrder'
+import { listLiveMsg } from '@/api/live/liveMsg'
+import Hls from 'hls.js';
+import LiveLotteryConf from '@/views/live/liveConfig/liveLotteryConf.vue'
+import LiveRedConf from '@/views/live/liveConfig/liveRedConf.vue'
+import LiveGoods from '@/views/live/liveConfig/goods.vue'
+import LiveLiveCoupon from '@/views/live/liveConfig/liveCoupon.vue'
+import echarts from 'echarts'
+
+export default {
+  name: "LiveConsole",
+  components: { LiveLotteryConf,LiveRedConf },
+  data() {
+    return {
+      loading:true,
+      tabLeft: {
+        activeName: "online",
+      },
+      tabRight: {
+        activeName: "talk",
+      },
+      livingUrl:"",
+      videoUrl: "",
+      status: 0,
+      loadMsgMaxPage: 2,
+      liveVideo: {},
+      liveWsUrl: process.env.VUE_APP_LIVE_WS_URL + '/app/webSocket',
+      userParams:{
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null
+      },
+      msgParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null
+      },
+      userList: [],
+      msgList: [],
+      newMsg: '',
+      isAudit: false,
+      myChart: null, // 用于存储 ECharts 实例
+      liveType: 1,
+      tableRadio: '订单数',
+      searchQuery: {timeOptions:'2',timeGranularity:'10',liveId: null},
+      timeOptions: [
+        {value:'2',label:'最近2小时',key:'2'},
+        {value:'4',label:'最近4小时',key:'4'},
+        {value:'all',label:'全场',key:'all'},
+      ],
+      timeGranularity: [
+        {value:'10',label:'10分钟',key:'10'},
+        {value:'30',label:'30分钟',key:'30'},
+        {value:'60',label:'1小时',key:'60'},
+      ],
+      videoDuration: 0,
+      startTime: null,
+      processInterval: null,
+      // ... 其他数据
+      chatScrollTop: 0, // 保存聊天滚动位置
+      socket: null,
+    }
+  },
+  created() {
+    // this.getLiveVideo()
+    this.getList()
+    this.connectWebSocket()
+    this.getLive()
+    this.searchQuery.liveId = this.liveId
+  },
+  computed: {
+    liveId() {
+      return this.$route.params.liveId;
+    },
+    userId() {
+      return this.$store.state.user.user.userId
+    },
+    companyId() {
+      return this.$store.state.user.user.companyId
+    },
+    onlineUserList() {
+      return this.userList.filter(u => u.online === 0)
+    },
+    onlineLabel() {
+      if (this.onlineUserList.length > 0) {
+        return '在线(' + this.onlineUserList.length + ')'
+      }
+      return '在线'
+    },
+    offlineUserList() {
+      return this.userList.filter(u => u.online === 1)
+    },
+    offlineLabel() {
+      if (this.offlineUserList.length > 0) {
+        return '离线(' + this.offlineUserList.length + ')'
+      }
+      return '离线'
+    },
+    silencedUserList() {
+      return this.userList.filter(u => u.msgStatus === 1)
+    },
+    silencedUserLabel() {
+      if (this.silencedUserList.length > 0) {
+        return '禁言(' + this.silencedUserList.length + ')'
+      }
+      return '禁言'
+    }
+  },
+  mounted() {
+
+    this.$nextTick(() => {
+      this.restoreChatScrollPosition();
+    });
+    this.getEchartsTables();
+    // 添加滚动事件监听器
+    this.$nextTick(() => {
+      if (this.$refs.manageRightRef && this.$refs.manageRightRef.wrap) {
+        this.$refs.manageRightRef.wrap.addEventListener('scroll', this.saveChatScrollPosition);
+      }
+    });
+  },
+  // 使用 deactivated 和 activated 钩子替代 beforeDestroy 和 destroyed
+  deactivated() {
+    this.saveChatScrollPosition();
+  },
+
+  activated() {
+    this.$nextTick(() => {
+      this.restoreChatScrollPosition();
+    });
+    this.$nextTick(() => {
+      const video = this.$refs.videoPlayer;
+      if (video != null) {
+        this.initVideoPlayer(this.liveInfo.startTime)
+      }
+    })
+  },
+  methods: {
+    updateVideoPosition(video){
+      const currentTime = new Date().getTime(); // 当前时间戳(毫秒)
+      const elapsedTime = currentTime - this.startTime; // 已流逝时间(毫秒)
+
+      if (elapsedTime < 0) {
+        // 未开播:视频停在初始位置
+        video.currentTime = 0;
+        return;
+      }
+
+      // 已开播:计算视频循环后的位置(流逝时间 % 视频时长)
+      const elapsedSeconds = elapsedTime / 1000; // 转换为秒
+      const videoPosition = elapsedSeconds % this.videoDuration; // 视频内的播放位置(秒)
+
+      // 设置视频播放位置
+      video.currentTime = videoPosition;
+    },
+    updateProgress() {
+      const progressBar = this.$refs.progressBar;
+      const elapsedTimeEl = this.$refs.elapsedTime;
+      if (!this.videoDuration) return; // 视频时长未加载时不更新
+
+      const currentTime = new Date().getTime();
+      const elapsedTime = currentTime - this.startTime; // 总流逝时间(毫秒)
+
+      if (elapsedTime < 0) {
+        // 未开播状态
+        progressBar.style.width = '0%';
+        elapsedTimeEl.textContent = '00:00:00';
+        return;
+      }
+
+      // 计算进度百分比(基于视频循环)
+      const elapsedSeconds = elapsedTime / 1000;
+      const videoPosition = elapsedSeconds % this.videoDuration; // 当前在视频中的位置
+      const progressPercent = (videoPosition / this.videoDuration) * 100; // 进度百分比
+
+      // 更新进度条宽度
+      progressBar.style.width = `${progressPercent}%`;
+
+      // 格式化总流逝时间为“时:分:秒”并显示
+      elapsedTimeEl.textContent = this.formatTime(elapsedTime);
+    },
+    formatTime(ms) {
+      const totalSeconds = Math.floor(ms / 1000);
+      const hours = Math.floor(totalSeconds / 3600);
+      const minutes = Math.floor((totalSeconds % 3600) / 60);
+      const seconds = totalSeconds % 60;
+
+      // 补零处理(确保两位数)
+      return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
+    },
+    initVideoPlayer: function (startTime) {
+      const video = this.$refs.videoPlayer;
+      this.hls = new Hls();
+      this.hls.attachMedia(video);
+      this.hls.on(Hls.Events.MEDIA_ATTACHED, () => {
+        this.hls.loadSource(this.videoUrl);
+        this.hls.on(Hls.Events.STREAM_LOADED, (event, data) => {
+          video.play();
+        });
+      });
+      this.hls.on(Hls.Events.ERROR, (event, data) => {
+        console.error('HLS 错误:', data);
+      });
+
+      // 1. 初始化开播时间
+      startTime = new Date(startTime).getTime();
+      this.startTime = startTime;
+      // 2. 监听视频元数据加载完成(获取视频时长)
+      video.addEventListener('loadedmetadata', () => {
+        this.videoDuration = video.duration; // 获取视频时长(秒)
+
+        // 初始化视频播放位置
+        this.updateVideoPosition(video);
+
+        // 启动实时进度更新(每秒刷新一次)
+        this.processInterval = setInterval(this.updateProgress, 1000);
+      });
+
+    },
+    // 保存聊天滚动位置
+    saveChatScrollPosition() {
+      if (this.$refs.manageRightRef && this.$refs.manageRightRef.wrap) {
+        this.chatScrollTop = this.$refs.manageRightRef.wrap.scrollHeight - this.$refs.manageRightRef.wrap.clientHeight;
+      }
+    },
+
+    // 恢复聊天滚动位置
+    restoreChatScrollPosition() {
+      if (this.$refs.manageRightRef && this.$refs.manageRightRef.wrap) {
+        this.$refs.manageRightRef.wrap.scrollTop = this.chatScrollTop;
+      }
+    },
+    // ... 其他方法 ...
+    timeChange(val) {
+      this.searchQuery.timeOptions = val
+      this.getEchartsTables(this.searchQuery)
+      this.initChart()
+    },
+    timeGranularityChange(val) {
+      this.searchQuery.timeGranularity =  val
+      this.getEchartsTables()
+      this.initChart()
+    },
+    getEchartsTables() {
+      getLiveOrderTimeGranularity(this.searchQuery).then(res => {
+        if (res.code == 200) {
+          this.echartsXLine = res.hourlySlots
+          this.echartsXValue = res.hourlySlotsValue
+          this.initChart()
+        }
+      })
+    },
+    initChart() {
+      const chartDom = this.$refs.chartContainer;
+      this.myChart = echarts.init(chartDom);
+      const option = {
+        tooltip: {trigger: 'axis'},
+        legend: {data: ['订单数']},
+        xAxis: {type: 'category', boundaryGap: false, data: this.echartsXLine},
+        yAxis: {type: 'value'},
+        series: [
+          {name: '订单数', type: 'line', data: this.echartsXValue}
+        ],
+      };
+      this.myChart.setOption(option);
+    },
+    handleClickGoods(){
+      this.$router.push({
+        name: 'LiveGoods',
+        query: {
+          liveId: this.liveId
+        }
+      })
+    },
+    updateLiveProgress() {
+      const elapsedTimeEl = this.$refs.liveElapsedTime;
+
+      const currentTime = new Date().getTime();
+      const elapsedTime = currentTime - this.startTime; // 总流逝时间(毫秒)
+      console.log(this.startTime)
+
+      if (elapsedTime < 0) {
+        elapsedTimeEl.textContent = '00:00:00';
+        return;
+      }
+
+
+      // 格式化总流逝时间为“时:分:秒”并显示
+      elapsedTimeEl.textContent = this.formatTime(elapsedTime);
+    },
+    handleClickOrder(){
+      this.$router.push({
+        name: 'LiveOrder',
+        query: {
+          liveId: this.liveId
+        }
+      })
+    },
+    handleClickCoupon(){
+      this.$router.push({
+        name: 'LiveLiveCoupon',
+        query: {
+          liveId: this.liveId
+        }
+      })
+    },
+    getLive(){
+      getLive(this.liveId).then(res => {
+        if (res.code == 200) {
+          if (res.data.isAudit != 1) {
+            this.$message.error("当前直播间未经审核");
+            this.loading = false
+            return
+          }
+          this.isAudit = true
+          this.status = res.data.status
+          if(res.data.status == 4){
+            this.liveType = 3
+            this.videoUrl = res.data.videoUrl;
+          }else {
+            if (res.data.status != 2) {
+              this.$message.error("当前直播间未直播");
+              this.loading = false
+              return
+            }
+            if (res.data.liveType == 1) {
+              this.livingUrl = res.data.flvHlsUrl
+              this.livingUrl = this.livingUrl.replace("flv","m3u8")
+              this.$nextTick(() => {
+                this.initPlayer()
+              })
+              this.startTime = new Date(res.data.startTime).getTime()
+              this.processInterval = setInterval(this.updateLiveProgress, 1000);
+            } else {
+              this.liveType = 2
+              this.videoUrl = res.data.videoUrl;
+              this.$nextTick(() => {
+                this.initVideoPlayer(res.data.startTime)
+              })
+            }
+          }
+          this.loading = false
+        } else {
+          this.$message.error(res.msg)
+          this.loading = false
+        }
+        this.liveInfo = res.data
+      })
+    },
+    handleClickLottery(){
+      this.$router.push({
+        name: 'LiveLotteryConf',
+        query: {
+          liveId: this.liveId
+        }
+      })
+    },
+    handleClickRed(){
+      this.$router.push({
+        name: 'LiveRedConf',
+        query: {
+          liveId: this.liveId
+        }
+      })
+    },
+    getLiveUrl(){
+      getLivingUrl(this.liveId).then(res=>{
+        if(res.code === 200){
+          this.livingUrl = res.livingUrl
+          this.initPlayer()
+        }
+      })
+    },
+    initPlayer(){
+      var isUrl = this.livingUrl === null || this.livingUrl.trim() === ''
+      if (isUrl) {
+        console.error('直播地址为空,无法初始化播放器')
+        return
+      }
+      if (Hls.isSupported() && !isUrl) {
+        const videoElement = this.$refs.livingPlayer
+        if (!videoElement) {
+          console.error('找不到 video 元素')
+          return
+        }
+        this.hls = new Hls();
+        this.hls.attachMedia(videoElement);
+        this.hls.on(Hls.Events.MEDIA_ATTACHED, () => {
+          this.hls.loadSource(this.livingUrl);
+          this.hls.on(Hls.Events.STREAM_LOADED, (event, data) => {
+            videoElement.play();
+          });
+        });
+        this.hls.on(Hls.Events.ERROR, (event, data) => {
+          console.error('HLS 错误:', data);
+        });
+      } else {
+        console.error('浏览器不支持 HLS')
+      }
+    },
+    handleClick(tab) {
+      console.log("click",tab.name)
+      console.log("liveId", this.liveId)
+    },
+    getLiveVideo() {
+      getLiveVideoByLiveId(this.liveId).then(res => {
+        this.liveVideo = res.data
+      })
+    },
+    getList() {
+      this.resetParams()
+      this.loadUserList()
+      this.loadMsgList()
+    },
+    resetParams() {
+      this.userList= []
+      this.userParams = {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: this.liveId
+      }
+      this.msgList = []
+      this.msgParams = {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: this.liveId
+      }
+    },
+    loadUserList() {
+      if(this.liveId == null)  return
+      // 直播间用户
+      watchUserList({
+        liveId: this.liveId,
+        pageNum: this.userParams.pageNum,
+        pageSize: this.userParams.pageSize
+      }).then(response => {
+        let {code,rows,total} = response
+        if (code === 200) {
+          let totalPage = (total % this.userParams.pageSize == 0) ? Math.floor(total / this.userParams.pageSize) : Math.floor(total / this.userParams.pageSize + 1);
+          rows.forEach(row => {
+            if (!this.userList.some(u => u.userId === row.userId)) {
+              this.userList.push(row)
+            }
+          })
+
+          // 没加载完继续加载
+          if (this.userParams.pageNum < totalPage) {
+            this.userParams.pageNum = parseInt(this.userParams.pageNum) + 1;
+            this.loadUserList()
+          }
+        }
+      })
+    },
+    loadMsgList() {
+      // 直播间消息
+      listLiveMsg({
+        liveId:this.liveId,
+        pageNum: this.msgParams.pageNum,
+        pageSize: this.msgParams.pageSize
+      }).then(response => {
+          let {code, rows,total} = response;
+          if (code === 200) {
+            let totalPage = (total % this.msgParams.pageSize == 0) ? Math.floor(total / this.msgParams.pageSize) : Math.floor(total / this.msgParams.pageSize + 1);
+            rows.forEach(row => {
+              if (!this.msgList.some(m => m.msgId === row.msgId)) {
+
+                let user = this.userList.find(u => u.userId === row.userId)
+                if (user) {
+                  row.msgStatus = user.msgStatus
+                } else {
+                  row.msgStatus = 0
+                }
+
+                this.msgList.push(row)
+
+                // 移动到底部
+                this.$nextTick(() => {
+                  setTimeout(() => {
+                    this.$refs.manageRightRef.wrap.scrollTop = this.$refs.manageRightRef.wrap.scrollHeight - this.$refs.manageRightRef.wrap.clientHeight
+                  }, 200)
+                })
+              }
+            })
+
+            // 没加载完继续加载
+            if (this.msgParams.pageNum < totalPage) {
+              this.msgParams.pageNum = parseInt(this.msgParams.pageNum) + 1;
+              this.loadMsgList()
+            }
+
+            // 同步更新消息列表中相同用户的状态
+            this.userList.forEach(u => {
+              this.msgList.filter(m => m.userId === u.userId).forEach(m => m.msgStatus = u.msgStatus)
+            })
+          }
+        })
+
+      // 添加滚动监听
+      this.$nextTick(() => {
+        this.$refs.manageRightRef.wrap.addEventListener("scroll", this.manageRightScroll)
+      })
+    },
+    manageRightScroll() {
+      this.saveChatScrollPosition();
+    },
+    blockUser(u){
+      this.$confirm('是否确认封禁用户账号为:"' + u.nickName + '-' + u.userId + '"?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        let msg = {
+          msg: "",
+          liveId: this.liveId,
+          userId: u.userId,
+          userType: 0,
+          cmd: 'blockUser',
+          avatar: this.$store.state.user.user.avatar,
+          nickName: this.$store.state.user.user.nickName
+        }
+        this.socket.send(JSON.stringify(msg))
+        return blockUser(u.userId);
+      }).then(() => {
+        this.msgSuccess("封禁成功");
+      }).catch(() => {});
+    },
+    changeUserState(u) {
+      // 修改状态
+      changeUserStatus({liveId: u.liveId, userId: u.userId}).then(response => {
+        let { code } = response;
+        if (200 === code) {
+          u.msgStatus = u.msgStatus === 0 ? 1 : 0
+          // 同步更新消息列表中相同用户的状态
+          this.msgList.forEach(msg => {
+            if (msg.userId === u.userId) {
+              msg.msgStatus = u.msgStatus;
+            }
+          });
+
+          this.userList.forEach(user => {
+            if (user.userId === u.userId) {
+              user.msgStatus = u.msgStatus;
+            }
+          });
+
+          let msg = u.msgStatus === 0 ? "已解禁" : "已禁言"
+          this.msgSuccess(msg);
+          return
+        }
+        this.msgError("操作失败");
+      })
+    },
+    connectWebSocket() {
+      this.$store.dispatch('initLiveWs', {
+        liveWsUrl: this.liveWsUrl,
+        liveId: this.liveId,
+        userId: this.userId
+      })
+      this.socket = this.$store.state.liveWs[this.liveId]
+      this.socket.onmessage = (event) => this.handleWsMessage(event)
+    },
+    handleWsMessage(event) {
+      let { code, data } = JSON.parse(event.data)
+      if (code === 200) {
+        let { cmd } = data
+        if (cmd === 'sendMsg') {
+          let message = JSON.parse(data.data)
+
+          let user = this.userList.find(u => u.userId === message.userId)
+          if (user) {
+            message.msgStatus = user.msgStatus
+          } else {
+            message.msgStatus = 0
+          }
+          delete message.params
+          this.msgList.push(message)
+          // 移动到底部
+          this.$nextTick(() => {
+            setTimeout(() => {
+              this.$refs.manageRightRef.wrap.scrollTop = this.$refs.manageRightRef.wrap.scrollHeight - this.$refs.manageRightRef.wrap.clientHeight
+            }, 200)
+          })
+        }
+        else if (cmd === 'entry' || cmd === 'out') {
+          this.loadUserList()
+          let user = data
+          if(this.userList.length > 0){
+            this.userList = this.userList.filter(u => u.userId !== user.userId)
+          }
+          this.userList.push(user)
+        } else if (cmd === 'live_start') {
+
+        } else if (cmd === 'live_end') {
+
+        }
+      }
+    },
+    sendMessage() {
+      // 发送前简单校验
+      if (this.newMsg.trim() === '') {
+        return;
+      }
+
+      let msg = {
+        msg: this.newMsg,
+        liveId: this.liveId,
+        userId: this.userId,
+        userType: 1,
+        cmd: 'sendMsg',
+        avatar: this.$store.state.user.user.avatar,
+        nickName: this.$store.state.user.user.nickName
+      }
+
+      this.socket.send(JSON.stringify(msg))
+
+      this.newMsg = '';
+    }
+  },
+  destroyed() {
+    this.hls?.destroy();
+    clearInterval(this.processInterval)
+  }
+}
+</script>
+
+<style scoped>
+.talk-list{
+  display: flex;
+}
+  .live-console {
+    width: 90vw;
+    padding: 10px 0;
+  }
+  .live-console .live-console-col {
+    height: 88vh;
+    margin-left: 5px;
+    padding: 0 10px;
+    background-color: white;
+    border-radius: 4px;
+  }
+  /*隐藏水平滚动条*/
+  ::v-deep .el-scrollbar__wrap {
+    overflow-x: hidden;
+  }
+  /* 消息输入区域 */
+  .chat-input {
+    display: flex;
+    padding: 10px;
+    border-top: 1px solid #ebeef5;
+    background-color: #fff;
+    min-height: 120px;
+  }
+
+  .chat-input .el-input {
+    flex: 1;
+    margin-right: 10px;
+  }
+
+  .chat-input .el-textarea__inner {
+    resize: none;
+    min-height: 100px;
+  }
+  ::v-deep .el-textarea__inner {
+    border: none !important;
+    box-shadow: none !important;
+    resize: none !important;
+  }
+  ::v-deep .el-textarea__inner:focus {
+    border: none !important;
+    box-shadow: none !important;
+  }
+
+</style>

+ 760 - 0
src/views/live/liveData/index.vue

@@ -0,0 +1,760 @@
+<template>
+  <div class="app-container">
+    <div class="title">近期直播</div>
+    <div class="live-container">
+      <div class="live-card" v-for="live in displayLives" :key="live.id">
+        <!-- 直播状态 -->
+        <div class="status">已结束</div>
+
+        <!-- 直播信息 -->
+        <div class="content">
+          <img :src="live.image" alt="直播封面" class="cover-image" />
+          <div class="info">
+            <h3 class="live-title">{{ live.title }}</h3>
+            <p class="time">开播时间: {{ live.time }}</p>
+          </div>
+        </div>
+
+        <!-- 直播数据 -->
+        <div class="stats">
+          <div class="stat-item">
+            <p class="label">直播间浏览量</p>
+            <p class="value">{{ live.views }}</p>
+          </div>
+          <div class="stat-item">
+            <p class="label">直播间访客数</p>
+            <p class="value">{{ live.visitors }}</p>
+          </div>
+        </div>
+      </div>
+    </div>
+    <!-- 直播趋势统计 -->
+    <div class="trend-section">
+      <div class="trend-header">
+        <h3>直播趋势</h3>
+        <div class="filter-container">
+        <!-- 时间范围选择(下拉框) -->
+          <span class="filter-label">时间筛选:</span>
+          <el-select v-model="selectedTimeRange" placeholder="选择时间范围" @change="changeTimeRange" style="width: 180px">
+            <el-option label="自然天" value="day"></el-option>
+            <el-option label="自然周" value="week"></el-option>
+            <el-option label="自然月" value="month"></el-option>
+          </el-select>
+
+          <!-- 日期选择器 -->
+          <!-- 选择日期 -->
+          <el-date-picker
+            v-model="selectedDate"
+            :type="datePickerType"
+            :format="selectedTimeRange === 'week' ? weekRange : dateFormat"
+            :value-format="valueFormat"
+            placeholder="选择日期"
+            style="width: 280px"
+            @change="changeDate"
+          ></el-date-picker>
+        </div>
+      </div>
+
+      <div class="trend-cards">
+        <div
+          class="trend-card"
+          v-for="item in trendData"
+          :key="item.id"
+          :class="{ 'active': selectedMetric.id === item.id }"
+          @click="changeMetric(item)"
+        >
+          <div class="trend-header">
+            <p class="trend-title">{{ item.title }}</p>
+            <el-tooltip class="item" effect="dark" :content="item.tip" placement="top">
+              <i class="el-icon-info"></i>
+            </el-tooltip>
+          </div>
+          <p class="trend-value">{{ item.value }}</p>
+          <p class="trend-change" :class="{ 'up': computedChange(item) > 0, 'down': computedChange(item) < 0 }">
+            {{ changeLabel }} {{ computedChange(item) }}%
+          </p>
+        </div>
+      </div>
+
+      <!-- 直播趋势折线图 -->
+      <div id="liveChart" class="chart"></div>
+    </div>
+    <div class="top10-section">
+      <h3>直播TOP10排行榜</h3>
+      <div class="ranking-container">
+          <!-- 红榜 -->
+          <div class="ranking-section red-rank">
+            <span class="rank-title">红榜</span>
+            <div class="rank-filters">
+              <button
+                v-for="item in redRankTypes"
+                :key="item.value"
+                :class="{ active: selectedRank === item.value }"
+                @click="selectRank(item.value)"
+              >
+                {{ item.label }}
+              </button>
+            </div>
+          </div>
+
+          <!-- 黑榜 -->
+          <div class="ranking-section black-rank">
+            <div class="rank-filters">
+              <button
+                v-for="item in blackRankTypes"
+                :key="item.value"
+                :class="{ active: selectedRank === item.value }"
+                @click="selectRank(item.value)"
+              >
+                {{ item.label }}
+              </button>
+            </div>
+            <span class="rank-title">黑榜</span>
+          </div>
+      </div>
+      <el-table :data="top10List" border style="width: 100%">
+        <el-table-column prop="rank" label="排名" width="80"></el-table-column>
+        <el-table-column prop="name" label="直播名称">
+          <template #default="scope">
+            <div class="live-name">
+              <img :src="scope.row.cover" class="live-cover" alt="封面">
+              <span class="live-title">{{ scope.row.name }}</span>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="pv" label="直播间浏览量(PV)"></el-table-column>
+        <el-table-column prop="uv" label="直播间访客数(UV)"></el-table-column>
+        <el-table-column prop="watchPV" label="累计观看人次(PV)"></el-table-column>
+        <el-table-column prop="watchUV" label="累计观看人数(UV)"></el-table-column>
+        <el-table-column prop="avgTime" label="人均观看时长"></el-table-column>
+        <el-table-column prop="maxOnline" label="最高在线人数"></el-table-column>
+      </el-table>
+    </div>
+  </div>
+</template>
+
+
+<script>
+  import * as echarts from "echarts";
+  import { listLive, getLive, delLive, addLive, updateLive, exportLive } from "@/api/live/live";
+  import Editor from '@/components/Editor/wang';
+
+  export default {
+    name: "Live",
+    components: { Editor },
+    data() {
+      return {
+        top10List: [
+          {
+            rank: 1,
+            name: "御君方年末会员福利专场!",
+            cover:"https://cos.his.cdwjyyh.com/fs/20250304/710ea5b1896749b58438b76baf881d05.jpeg",
+            pv: 88332,
+            uv: 32674,
+            watchPV: 41866,
+            watchUV: 24714,
+            avgTime: "00:13:12",
+            maxOnline: 4317,
+          },
+          {
+            rank: 2,
+            name: "立秋养生大作战",
+            cover:"https://cos.his.cdwjyyh.com/fs/20250304/710ea5b1896749b58438b76baf881d05.jpeg",
+            pv: 55092,
+            uv: 15066,
+            watchPV: 33522,
+            watchUV: 12343,
+            avgTime: "01:18:30",
+            maxOnline: 3160,
+          },
+          {
+            rank: 3,
+            name: "寒露养生大挑战:防寒防燥防疾病",
+            cover:"https://cos.his.cdwjyyh.com/fs/20250304/710ea5b1896749b58438b76baf881d05.jpeg",
+            pv: 36044,
+            uv: 12205,
+            watchPV: 26056,
+            watchUV: 11086,
+            avgTime: "01:16:08",
+            maxOnline: 3232,
+          },
+        ],
+        selectedRank: 'highFlow',
+        redRankTypes: [
+          { label: '高流量', value: 'highFlow' },
+          { label: '高观看', value: 'highView' },
+          { label: '高时长', value: 'highTime' },
+        ],
+        blackRankTypes: [
+          { label: '低时长', value: 'lowTime' },
+          { label: '低观看', value: 'lowView' },
+          { label: '低流量', value: 'lowFlow' },
+        ],
+        selectedTimeRange: "day", // 默认选中“自然天”
+        datePickerType: "date", // 默认 date 类型
+        weekRange: "", // 存储选择周的时间范围
+        selectedDate: new Date().toISOString().split("T")[0], // 默认今天
+        lives: [
+          {
+            id: 1,
+            image: "https://cos.his.cdwjyyh.com/fs/20250117/d9e3b268e3834a2497e0bb1f900eac90.jpg",
+            title: "李悦的直播",
+            time: "2024-10-10 15:00:00",
+            views: 352821,
+            visitors: 14505,
+          },
+          {
+            id: 2,
+            image: "https://cos.his.cdwjyyh.com/fs/20250117/d9e3b268e3834a2497e0bb1f900eac90.jpg",
+            title: "小付的直播",
+            time: "2024-10-12 18:00:00",
+            views: 284210,
+            visitors: 10234,
+          },
+          {
+            id: 3,
+            image: "https://cos.his.cdwjyyh.com/fs/20250117/d9e3b268e3834a2497e0bb1f900eac90.jpg",
+            title: "生活妙招分享",
+            time: "2024-11-05 20:00:00",
+            views: 182401,
+            visitors: 8734,
+          },
+          {
+            id: 4,
+            image: "https://cos.his.cdwjyyh.com/fs/20250117/d9e3b268e3834a2497e0bb1f900eac90.jpg",
+            title: "家庭健康指南",
+            time: "2024-12-01 14:00:00",
+            views: 254321,
+            visitors: 12345,
+          },
+          {
+            id: 5,
+            image: "https://cos.his.cdwjyyh.com/fs/20250117/d9e3b268e3834a2497e0bb1f900eac90.jpg",
+            title: "额外的直播",
+            time: "2024-12-15 19:00:00",
+            views: 100000,
+            visitors: 5000,
+          }
+        ],
+        trendData: [
+          {
+            id: "views",
+            title: "直播间浏览量",
+            tip: "直播间总浏览量",
+            value: 352421,
+            dailyChange:1,
+            weeklyChange:2,
+            monthlyChange:3,
+            change: 5.2,
+            dates: ["02-02", "02-04", "02-06", "02-08", "02-10"],
+            data: [10, 20, 15, 25, 30],
+          },
+          {
+            id: "visitors",
+            title: "直播间访客数",
+            tip: "直播间访客数",
+            value: 14505,
+            dailyChange:1,
+            weeklyChange:2,
+            monthlyChange:3,
+            change: 5.2,
+            dates: ["02-02", "02-04", "02-06", "02-08", "02-10"],
+            data: [5, 8, 6, 10, 12],
+          },
+          {
+            id: "streams",
+            title: "创建直播数",
+            tip: "每日直播场次",
+            value: 20,
+            dailyChange:1,
+            weeklyChange:2,
+            monthlyChange:3,
+            change: 5.2,
+            dates: ["02-02", "02-04", "02-06", "02-08", "02-10"],
+            data: [1, 2, 1, 3, 2],
+          },
+          {
+            id: "pv",
+            title: "累计观看人次(PV)",
+            tip: "累计观看人次",
+            value: 5000,
+            dailyChange:1,
+            weeklyChange:2,
+            monthlyChange:3,
+            change: 5.2,
+            dates: ["02-02", "02-04", "02-06", "02-08", "02-10"],
+            data: [0, 0, 1, 0, 0],
+          },
+          {
+            id: "uv",
+            title: "累计观看人数(UV)",
+            tip: "累计观看人数",
+            value: 3000,
+            dailyChange:1,
+            weeklyChange:2,
+            monthlyChange:3,
+            change: 5.2,
+            dates: ["02-02", "02-04", "02-06", "02-08", "02-10"],
+            data: [0, 0, 0, 1, 0],
+          },
+        ],
+        selectedMetric: {}, // 选中的卡片数据
+        chart: null, // ECharts 实例
+      };
+    },
+    computed: {
+      changeLabel() {
+        switch (this.selectedTimeRange) {
+          case 'day': return '比前一天';
+          case 'week': return '比上周';
+          case 'month': return '比上月';
+          default: return '变化';
+        }
+      },
+      displayLives() {
+        return this.lives.slice(0, 4); // 最多只显示前 4 条数据
+      },
+      /*datePickerType() {
+        return this.selectedTimeRange === "day"
+          ? "date"
+          : this.selectedTimeRange === "week"
+            ? "week"
+            : "month";
+      },*/
+      dateFormat() {
+        return this.selectedTimeRange === "day"
+          ? "yyyy-MM-dd"
+          : this.selectedTimeRange === "week"
+            ? "yyyy-MM-dd 至 yyyy-MM-dd"
+            : "yyyy-MM";
+      },
+      valueFormat() {
+        return this.selectedTimeRange === "day"
+          ? "yyyy-MM-dd"
+          : this.selectedTimeRange === "week"
+            ? "yyyy-MM-dd"
+            : "yyyy-MM";
+      },
+    },
+    created() {
+      //this.getList();
+    },
+    mounted() {
+      this.selectedMetric = this.trendData[0]; // 默认选中第一个
+      this.initChart(); // 初始化折线图
+    },
+    methods: {
+      changeDate(value) {
+        if (this.selectedTimeRange === "week" && value) {
+          /*console.log("🟢 监听到 selectedWeek 变化:", newVal);*/
+          this.weekRange = this.getWeekRange(value);
+        } else {
+          this.weekRange = "";
+        }
+        console.log("选择的时间:", value, "筛选方式:", this.selectedTimeRange);
+      },
+      getWeekRange(selectedWeek) {
+        console.log("🔹 selectedWeek 输入值:", selectedWeek); // 检查传入值
+        let date = new Date(selectedWeek);
+
+        if (isNaN(date.getTime())) {
+          console.error("Invalid Date:", selectedWeek);
+          return "日期错误";
+        }
+
+        let dayOfWeek = date.getDay(); // 0(星期天)- 6(星期六)
+
+        // 计算周一
+        let startDate = new Date(date); // 创建一个新的 Date 实例
+        startDate.setDate(date.getDate() - dayOfWeek + (dayOfWeek === 0 ? -6 : 1));
+
+        // 计算周日(确保 `endDate` 是新实例)
+        let endDate = new Date(startDate.getTime()); // 复制 `startDate`
+        endDate.setDate(startDate.getDate() + 6);
+
+        console.log("周一:", this.formatDate(startDate));
+        console.log("周日:", this.formatDate(endDate));
+
+        return `${this.formatDate(startDate)} 至 ${this.formatDate(endDate)}`;
+      },
+      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}`;
+      },
+      computedChange(item) {
+        switch (this.selectedTimeRange) {
+          case 'day': return item.dailyChange;
+          case 'week': return item.weeklyChange;
+          case 'month': return item.monthlyChange;
+          default: return 0;
+        }
+      },
+      selectRank(type) {
+        this.selectedRank = type; // 只允许一个按钮被选中
+        console.log(`选中的排行方式: ${type}`);
+      },
+      fetchRankingData() {
+        // 这里根据 `selectedRedRank` 和 `selectedBlackRank` 来请求不同的排行榜数据
+        console.log(`获取排行榜数据: 红榜-${this.selectedRedRank}, 黑榜-${this.selectedBlackRank}`);
+      },
+      // 切换时间范围
+      changeTimeRange() {
+        // 根据选中的时间范围修改 datePicker 类型
+        if (this.selectedTimeRange === "day") {
+          this.datePickerType = "date";
+        } else if (this.selectedTimeRange === "month") {
+          this.datePickerType = "month";
+        } else if (this.selectedTimeRange === "week") {
+          this.datePickerType = "week";
+        }
+        this.selectedDate = null; // 重置已选日期
+      },
+      // 切换时间(但目前只是选日期,没有请求后端)
+      /*changeDate() {
+        console.log("选择日期:", this.selectedDate);
+        // 这里可以做后端请求:this.fetchTrendData();
+      },*/
+      // 获取直播趋势数据
+      async fetchTrendData() {
+        try {
+          const response = await axios.get("/api/trend-data", { params: { date: this.selectedDate } });
+          this.trendData = response.data;
+
+          // 默认选择第一个指标
+          if (this.trendData.length > 0) {
+            this.changeMetric(this.trendData[0]);
+          }
+        } catch (error) {
+          console.error("获取直播数据失败:", error);
+        }
+      },
+      // 切换日期时更新数据
+      updateTrendData() {
+        console.log(`更新 ${this.selectedDate} 的直播数据`);
+        // 这里可以加接口请求,获取新的数据
+        this.updateChart();
+      },
+      // 切换指标
+      // changeMetric(metric) {
+      //   this.selectedMetric = metric;
+      //   this.updateChart();
+      // },
+      // updateTrendData() {
+      //   console.log("选择的时间:", this.selectedDate);
+      //   this.trendData = this.trendData.map(item => ({
+      //     ...item,
+      //     value: Math.floor(Math.random() * 50),
+      //     change: (Math.random() * 10 - 5).toFixed(2)
+      //   }));
+      //   this.updateChart();
+      // },
+      initChart() {
+        let chartDom = document.getElementById("liveChart");
+        if (!chartDom) return;
+        this.chart = echarts.init(chartDom);
+        this.updateChart();
+      },
+      // 更新折线图
+      updateChart() {
+        if (!this.chart) return;
+
+        let options = {
+          tooltip: { trigger: "axis", backgroundColor: "rgba(0, 0, 0, 0.7)", textStyle: { color: "#fff" } },
+          grid: { left: "5%", right: "5%", bottom: "10%", top: "10%", containLabel: true },
+          xAxis: { type: "category", data: this.selectedMetric.dates || [], axisLine: { lineStyle: { color: "#ddd" } } },
+          yAxis: { type: "value", splitLine: { lineStyle: { type: "dashed", color: "#ddd" } } },
+          series: [
+            {
+              name: this.selectedMetric.title,
+              data: this.selectedMetric.data || [],
+              type: "line",
+              smooth: true,
+              symbol: "circle",
+              symbolSize: 8,
+              itemStyle: { color: "#007BFF", borderColor: "#fff", borderWidth: 2 },
+              lineStyle: { width: 3, color: "#007BFF" },
+              areaStyle: {
+                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                  { offset: 0, color: "rgba(0, 123, 255, 0.5)" },
+                  { offset: 1, color: "rgba(0, 123, 255, 0)" },
+                ]),
+              },
+              emphasis: {
+                focus: "series",
+                label: { show: true, formatter: "{c}", fontSize: 14, color: "#333", backgroundColor: "#fff", padding: [4, 6] },
+              },
+              animationDuration: 1200,
+              animationEasing: "quadraticOut",
+            },
+          ],
+        };
+
+        this.chart.setOption(options);
+      },
+      changeMetric(metric) {
+        this.selectedMetric = metric;
+        this.updateChart();
+      },
+    }
+  };
+</script>
+
+<style scoped>
+  .app-container {
+    padding: 20px;
+  }
+
+  .title {
+    font-size: 18px;
+    font-weight: bold;
+    margin-bottom: 10px;
+  }
+  .live-container {
+    display: flex;
+    gap: 15px; /* 控制卡片之间的间距 */
+    overflow-x: auto; /* 允许横向滚动 */
+    padding-bottom: 10px;
+  }
+
+  /* 卡片样式 */
+  .live-card {
+    width: 380px;
+    height: 225px;
+    background: rgb(250,250,250);
+    border-radius: 10px;
+    padding: 15px;
+    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
+    display: flex;
+    flex-direction: column;
+    align-items: flex-start;
+  }
+
+  /* 直播状态 */
+  .status {
+    background: #d3d3d3;
+    color: #333;
+    font-size: 14px;
+    padding: 4px 8px;
+    border-radius: 5px;
+    display: inline-block;
+
+
+  }
+
+  /* 直播信息部分 */
+  .content {
+    background: rgb(250,250,250);
+    display: flex;
+    gap: 10px;
+    align-items: center;
+    width: 90%;
+    margin-top: 0px;
+  }
+
+  /* 直播封面图片 */
+  .cover-image {
+    width: 70px;
+    height: 70px;
+    border-radius: 10px;
+    object-fit: cover;
+  }
+
+  /* 直播文本信息 */
+  .info {
+    flex: 1;
+  }
+
+  .live-title {
+    font-size: 16px;
+    font-weight: bold;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    max-width: 250px; /* 防止标题过长 */
+  }
+
+  .time {
+    font-size: 14px;
+    color: #666;
+  }
+
+  /* 直播数据部分 */
+  .stats {
+    display: flex;
+    justify-content: space-between;
+    width: 100%;
+    flex-shrink: 0;
+    margin-top: -40px;
+  }
+
+  .stat-item {
+    text-align: center;
+    flex: 1;
+  }
+
+  .label {
+    font-size: 14px;
+    color: #888;
+  }
+
+  .value {
+    font-size: 18px;
+    font-weight: bold;
+    color: #333;
+  }
+  /* 直播趋势 */
+  .trend-section {
+    margin-top: 30px;
+  }
+  .trend-header {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+  }
+  .trend-cards {
+    display: flex;
+    gap: 15px;
+  }
+  .trend-card {
+    width: 280px;
+    hight: 100px;
+    border: 1px solid #ddd;
+    border-radius: 8px;
+    padding: 16px;
+    transition: all 0.3s;
+    position: relative;
+  }
+
+  .trend-card.active {
+    border-color: #007bff; /* 选中时边框变蓝 */
+    box-shadow: 0px 0px 10px rgba(0, 123, 255, 0.3);
+  }
+
+  .trend-card.active::after {
+    content: "✔";
+    position: absolute;
+    bottom: 8px;
+    right: 8px;
+    color: white;
+    background: #007bff;
+    border-radius: 50%;
+    width: 20px;
+    height: 20px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    font-size: 14px;
+    font-weight: bold;
+  }
+  .trend-value {
+    font-size: 24px;
+    font-weight: bold;
+  }
+
+  /* 折线图 */
+  .chart {
+    width: 100%;
+    height: 300px;
+    margin-top: 20px;
+  }
+  .top10-section {
+    margin-top: 20px;
+    background: #fff;
+    padding: 16px;
+    border-radius: 8px;
+    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+  }
+  .live-name {
+    display: flex;
+    align-items: center;
+  }
+
+  .live-cover {
+    width: 80px;  /* 直播封面宽度 */
+    height: 45px; /* 直播封面高度 */
+    border-radius: 4px;
+    margin-right: 10px;
+    object-fit: cover;
+  }
+
+  .live-title {
+    font-size: 14px;
+    color: #333;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+  }
+  .ranking-tabs {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    padding: 10px 20px;
+  }
+
+  .ranking-container {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin: 10px 0;
+    border-radius: 8px;
+    overflow: hidden;
+  }
+
+  .ranking-section {
+    display: flex;
+    align-items: center;
+    width: 50%;
+    padding: 10px 15px;
+  }
+
+  .red-rank {
+    background: linear-gradient(90deg, #ff6b6b, #ff8e8e);
+    justify-content: flex-start;
+  }
+
+  .black-rank {
+    background: linear-gradient(90deg, #4a4a4a, #6b6b6b);
+    justify-content: flex-end;
+  }
+
+  .rank-title {
+    font-size: 18px;
+    font-weight: bold;
+    color: white;
+    margin: 0 15px;
+  }
+
+  .rank-filters {
+    display: flex;
+  }
+
+  button {
+    background: rgba(255, 255, 255, 0.2);
+    border: 1px solid rgba(255, 255, 255, 0.5);
+    color: white;
+    font-size: 14px;
+    padding: 5px 12px;
+    margin: 0 5px;
+    border-radius: 15px;
+    cursor: pointer;
+    transition: all 0.3s ease;
+  }
+
+  button.active {
+    background: white;
+    color: #ff4d4f;
+  }
+  .filter-container {
+    display: flex;
+    align-items: center;
+    gap: 8px; /* 控制两个组件的间距 */
+  }
+
+  .filter-label {
+    font-weight: bold;
+    white-space: nowrap; /* 防止换行 */
+  }
+</style>
+

+ 426 - 0
src/views/live/liveGoods/index.vue

@@ -0,0 +1,426 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" class="live-goods-css" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="商品名称" prop="keywords" >
+        <el-input
+          v-model="queryParams.keywords"
+          placeholder="请输入商品名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="上下架" prop="status" >
+        <el-input
+          v-model="queryParams.status"
+          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>
+
+    <div class="selection-toolbar">
+      <el-checkbox :indeterminate="isIndeterminate" v-model="allChecked" @change="toggleSelectAll">
+        {{ multipleSelection.length > 0 ? `已选 ${multipleSelection.length} 条` : '选中本页' }}
+      </el-checkbox>
+      <el-button  plain size="mini" @click="handleShelf">上架</el-button>
+      <el-button  plain size="mini" @click="handleUnshelf">下架</el-button>
+      <el-button  plain size="mini" @click="handleDeleteSelected">删除</el-button>
+      <el-button  plain type="mini" icon="el-icon-plus" @click="handleAddLiveGoods">添加商品</el-button>
+    </div>
+
+    <el-table
+      ref="goodTable"
+      :data="goodsLiveList"
+      style="width: 100%"
+      v-loading="loading"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55"></el-table-column>
+      <!-- 题干列:显示试题的主要内容 -->
+      <el-table-column
+        prop="goodsId"
+        label="商品id"
+        show-overflow-tooltip
+      ></el-table-column>
+
+      <el-table-column
+        label="商品图片"
+      >
+        <template slot-scope="scope">
+          <img
+            :src="scope.row.imgUrl"
+            style="display: block; max-width: 100%; width: 100px; height: 100px"
+          />
+        </template>
+
+      </el-table-column>
+
+      <el-table-column
+        prop="productName"
+        label="商品名称"
+      ></el-table-column>
+
+      <el-table-column
+        prop="price"
+        label="价格"
+      ></el-table-column>
+
+      <el-table-column
+        prop="stock"
+        label="库存"
+      ></el-table-column>
+
+      <el-table-column
+        prop="sales"
+        label="销量"
+      ></el-table-column>
+
+      <el-table-column
+        prop="status"
+        label="上下架"
+      >
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.status == 1">上架</el-tag>
+          <el-tag v-if="scope.row.status == 0">下架</el-tag>
+        </template>
+      </el-table-column>
+
+      <!-- 操作列:包含编辑和删除按钮 -->
+      <el-table-column
+        label="操作"
+        width="180"
+        fixed="right"
+      >
+        <template slot-scope="scope">
+          <el-button
+            type="text"
+            size="small"
+            style="color: #F56C6C;"
+            @click="handleGoodDelete(scope.row)"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页组件:用于分页展示试题列表 -->
+    <pagination
+      v-show="goodsLiveTotal > 0"
+      :total="goodsLiveTotal"
+      :page.sync="goodsParams.pageNum"
+      :limit.sync="goodsParams.pageSize"
+      @pagination="getLiveGoodsList"
+      style="margin-top: 20px;"
+    />
+
+    <!-- 添加商品弹窗 -->
+    <el-dialog
+      title="添加商品"
+      :visible.sync="goodsDialogVisible"
+      width="800px"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+    >
+      <div class="dialog-content">
+        <div style="text-align: right; margin-bottom: 20px;">
+          <el-input
+            v-model="searchTitle"
+            placeholder="请输入产品名称"
+            style="width: 300px;"
+            @input="handleGoodsSearch"
+          ></el-input>
+        </div>
+
+        <el-table
+          :data="goodsList"
+          style="width: 100%"
+          v-loading="goodsLoading"
+          @selection-change="handleGoodsChange"
+          @row-click="handleGoodsRowClick"
+          row-key="id"
+        >
+          <el-table-column
+            type="selection"
+            width="55"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="storeName"
+            label="商铺名称"
+            class-name="clickable-column"
+          ></el-table-column>
+          <el-table-column
+            prop="productName"
+            label="产品"
+            class-name="clickable-column"
+          ></el-table-column>
+          <el-table-column
+            prop="price"
+            label="价格"
+            class-name="clickable-column"
+          ></el-table-column>
+          <el-table-column
+            prop="stock"
+            label="库存"
+            class-name="clickable-column"
+          ></el-table-column>
+        </el-table>
+
+        <pagination
+          v-show="goodsTotal > 0"
+          :total="goodsTotal"
+          :page.sync="queryGoodParams.pageNum"
+          :limit.sync="queryGoodParams.pageSize"
+          @pagination="getStoreProductLists"
+          style="margin-top: 20px;"
+        />
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <div style="display: flex; justify-content: space-between; align-items: center;">
+          <span class="selected-count">当前已选择 <span style="color: #00BFFF; font-style: italic;">{{ selectedGoods.length }}</span> 商品</span>
+          <div>
+            <el-button @click="goodsDialogVisible = false">取 消</el-button>
+            <el-button type="primary" @click="confirmAddGoods">确 定</el-button>
+          </div>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listLiveGoods, getLiveGoods, delLiveGoods, addLiveGoods, handleShelfOrUn, handleDeleteSelected } from "@/api/live/liveGoods";
+
+export default {
+  data() {
+    return {
+      liveId: '',
+      loading: true,
+      searchTitle: '',
+      queryGoodParams: {
+        pageNum: 1,
+        pageSize: 10,
+        productName: null,
+        liveId: null
+      },
+      // 显示搜索条件
+      showSearch: true,
+      goodsLiveList: [],
+      goodsLiveTotal: 0,
+      goodsParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null
+      },
+      goodsList: [],
+      goodsTotal: 0,
+      selectedGoods: [],
+      goodsLoading: false,
+      goodsDialogVisible: false,
+      multipleSelection: [],
+      allChecked: false,
+      isIndeterminate: false,
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        keywords: null,
+        status: null,
+        liveId: null,
+        desc: null,
+        createTime: null,
+        updateTime: null,
+      },
+    };
+  },
+  created() {
+    this.liveId = this.$route.query.liveId
+    this.goodsParams.liveId = this.liveId
+    this.queryParams.liveId = this.liveId
+    this.getLiveGoodsList();
+  },
+  methods: {
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.loading = true
+      listLiveGoods(this.queryParams).then(response => {
+        this.goodsLiveList = response.rows
+        this.goodsLiveTotal = response.total
+        this.loading = false
+      })
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.$refs.queryForm.resetFields();
+    },
+    handleShelf(){
+      this.handleShelfOrUn(1)
+    },
+    handleUnshelf(){
+      this.handleShelfOrUn(0)
+    },
+    handleShelfOrUn(type){
+      if (this.multipleSelection.length > 0) {
+        const goodsList = this.getSelectedList();
+        handleShelfOrUn({"goodsIds":goodsList,"status":type,"liveId":this.liveId}).then(res=>{
+          this.dealResult(res)
+        })
+      } else {
+        this.$message.info("请选择下架商品!")
+      }
+    },
+    handleDeleteSelected(){
+      if (this.multipleSelection.length > 0) {
+        const goodsList = this.getSelectedList();
+        handleDeleteSelected({"goodsIds":goodsList}).then(res=>{
+          this.dealResult(res)
+        })
+      } else {
+        this.$message.info("请选择被删除的商品!")
+      }
+    },
+    dealResult(res){
+      if (res.code == 200) {
+        this.getLiveGoodsList();
+        this.$refs.goodTable.clearSelection();
+      } else {
+        this.$message.error(res.msg);
+      }
+    },
+    getSelectedList(){
+      var goodsList = []
+      this.multipleSelection.forEach(item => {
+        goodsList.push(item.goodsId);
+      })
+      return goodsList;
+    },
+    // 全选或取消全选
+    toggleSelectAll(val) {
+      this.checked = val; // 更新 checkbox 的状态
+      if (val) {
+        // 如果 checkbox 被选中,则全选
+        this.toggleSelection(this.goodsLiveList);
+      } else {
+        // 如果 checkbox 被取消选中,则取消全选
+        this.toggleSelection();
+      }
+    },
+    toggleSelection(rows) {
+      if (rows && !this.isIndeterminate) {
+        rows.forEach(row => {
+          this.$refs.goodTable.toggleRowSelection(row);
+        });
+      } else {
+        this.$refs.goodTable.clearSelection();
+      }
+    },
+    // 多选框选中数据
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+      // 根据选择项的数量更新 checkbox 的状态
+      this.allChecked = val.length === this.goodsLiveList.length;
+      this.isIndeterminate = val.length > 0 && val.length < this.goodsLiveList.length;
+    },
+
+    getLiveGoodsList() {
+      this.loading = true
+      listLiveGoods(this.goodsParams).then(response => {
+        this.goodsLiveList = response.rows
+        this.goodsLiveTotal = response.total
+        this.loading = false
+      })
+    },
+    handleAddLiveGoods(){
+      this.goodsDialogVisible = true;
+      this.getStoreProductLists()
+    },
+    handleGoodsSearch(){
+      this.queryGoodParams.pageNum = 1
+      this.queryGoodParams.productName = this.searchTitle
+      this.getStoreProductLists()
+    },
+    handleGoodsChange(goods) {
+      this.selectedGoods = goods
+    },
+    confirmAddGoods(){
+      if (this.selectedGoods.length === 0) {
+        this.$message({
+          message: '请选择要添加的商品',
+          type: 'warning'
+        })
+        return
+      }
+      addLiveGoods({
+        liveId: this.liveId,
+        productsId: this.selectedGoods.map(item => item.productId).join(',')
+      }).then(response => {
+        this.goodsDialogVisible = false
+        this.getLiveGoodsList()
+      })
+    },
+    handleGoodDelete(row){
+      delLiveGoods(row.goodsId).then(response => {
+        this.getLiveGoodsList()
+      })
+    },
+    /** 处理行点击事件 */
+    handleGoodsRowClick(row, column) {
+      // 如果点击的是复选框列,不进行处理
+      if (column.type === 'selection') {
+        return
+      }
+
+      // 获取表格实例
+      const table = this.$refs.goodsTable[0]
+      if (!table) {
+        return
+      }
+
+      // 判断当前行是否已经被选中
+      const isSelected = this.selectedGoods.some(item => item.id === row.id)
+
+      // 切换选中状态
+      table.toggleRowSelection(row, !isSelected)
+    },
+    getStoreProductLists() {
+      this.queryGoodParams.liveId = this.liveId
+      listStoreProduct(this.queryGoodParams).then(response => {
+        this.goodsList = response.rows
+        this.goodsTotal = response.total
+        this.loading = false
+      })
+    }
+
+  }
+};
+</script>
+
+
+<style scoped>
+.selection-toolbar {
+  display: flex;
+  align-items: center;
+  margin-bottom: 10px;
+  padding-left: 10px;
+}
+
+.selection-toolbar .el-checkbox {
+  margin-right: 10px;
+}
+
+/* 调整 checkbox 内部输入框的对齐 */
+.selection-toolbar .el-checkbox .el-checkbox__inner {
+  top: 8px; /* 根据实际需求调整 */
+}
+
+.live-goods-css {
+  padding-left: 10px;
+  padding-top: 30px;
+}
+</style>

+ 301 - 0
src/views/live/liveMsg/index.vue

@@ -0,0 +1,301 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="直播ID" prop="liveId">
+        <el-input
+          v-model="queryParams.liveId"
+          placeholder="请输入直播ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="用户ID" prop="userId">
+        <el-input
+          v-model="queryParams.userId"
+          placeholder="请输入用户ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="消息" prop="msg">
+        <el-input
+          v-model="queryParams.msg"
+          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-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['live:liveMsg:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['live:liveMsg:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['live:liveMsg:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['live:liveMsg:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveMsgList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="id" align="center" prop="msgId" />
+      <el-table-column label="直播ID" align="center" prop="liveId" />
+      <el-table-column label="用户ID" align="center" prop="userId" />
+      <el-table-column label="消息" align="center" prop="msg" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['live:liveMsg:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['live:liveMsg:remove']"
+          >删除</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="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="直播ID" prop="liveId">
+          <el-input v-model="form.liveId" placeholder="请输入直播ID" />
+        </el-form-item>
+        <el-form-item label="用户ID" prop="userId">
+          <el-input v-model="form.userId" placeholder="请输入用户ID" />
+        </el-form-item>
+        <el-form-item label="消息" prop="msg">
+          <el-input v-model="form.msg" placeholder="请输入消息" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listLiveMsg, getLiveMsg, delLiveMsg, addLiveMsg, updateLiveMsg, exportLiveMsg } from "@/api/live/liveMsg";
+
+export default {
+  name: "LiveMsg",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 直播讨论表格数据
+      liveMsgList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null,
+        userId: null,
+        msg: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询直播讨论列表 */
+    getList() {
+      this.loading = true;
+      listLiveMsg(this.queryParams).then(response => {
+        this.liveMsgList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        msgId: null,
+        liveId: null,
+        userId: null,
+        msg: null,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.msgId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加直播讨论";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const msgId = row.msgId || this.ids
+      getLiveMsg(msgId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改直播讨论";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.msgId != null) {
+            updateLiveMsg(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLiveMsg(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const msgIds = row.msgId || this.ids;
+      this.$confirm('是否确认删除直播讨论编号为"' + msgIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveMsg(msgIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有直播讨论数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveMsg(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 2605 - 0
src/views/live/liveOrder/index.vue

@@ -0,0 +1,2605 @@
+<template>
+  <div class="app-container">
+    <el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px">
+
+      <!-- <el-form-item label="订单号" prop="orderCode">
+        <el-input
+          v-model="queryParams.orderCode"
+          clearable
+          placeholder="请输入订单号"
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item> -->
+      <el-form-item label="订单号" prop="orderCodes">
+        <div class="tag-input-container">
+          <!-- 标签显示区域 -->
+          <div class="tags-wrapper" @click="focusInput">
+            <!-- 已添加的订单号标签 -->
+            <el-tag
+              v-for="(code, index) in queryParams.orderCodes"
+              :key="index"
+              closable
+              size="small"
+              @close="removeOrderCode(index)"
+              class="order-tag"
+              :class="{ 'tag-error': false }"
+            >
+              {{ code }}
+            </el-tag>
+
+            <!-- 输入框 -->
+            <el-input
+              ref="tagInput"
+              v-model="currentInput"
+              v-show="inputVisible || queryParams.orderCodes.length === 0"
+              :placeholder="queryParams.orderCodes.length === 0 ? '请输入订单号,按回车或逗号分隔' : '继续输入...'"
+              size="small"
+              class="tag-input"
+              @keydown.native="handleKeyDown"
+              @keyup.native="handleKeyUp"
+              @blur="handleInputConfirm"
+              @focus="inputVisible = true"
+              clearable
+            />
+
+            <!-- 添加按钮(当没有输入时显示) -->
+            <el-button
+              v-if="!inputVisible && queryParams.orderCodes.length > 0"
+              class="button-new-tag"
+              size="small"
+              @click="showInput"
+              icon="el-icon-plus"
+              type="text"
+            >
+              添加订单号
+            </el-button>
+          </div>
+
+          <!-- 输入提示 -->
+          <div class="input-tips">
+            <span class="tip-text">
+              支持:回车、逗号、空格分隔 |
+              已添加 {{ queryParams.orderCodes.length }} 个订单号
+              <span v-if="maxOrderCodes > 0"> (最多{{ maxOrderCodes }}个)</span>
+            </span>
+          </div>
+        </div>
+      </el-form-item>
+
+      <el-form-item label="运单号" prop="deliveryId">
+        <el-input
+          v-model="queryParams.deliveryId"
+          clearable
+          placeholder="请输入运单号"
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="手机号" prop="userPhone">
+        <el-input
+          v-model="queryParams.userPhone"
+          clearable
+          placeholder="请输入手机号"
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="收件人" prop="realName">
+        <el-input
+
+          v-model="queryParams.realName"
+          clearable
+          placeholder="请输入收件人姓名"
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="产品" prop="productName">
+        <el-input
+
+          v-model="queryParams.productName"
+          clearable
+          placeholder="请输入产品名"
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <!--      <el-form-item label="订单类型" prop="orderType">
+               <el-select   v-model="queryParams.orderType" placeholder="请选择订单类型" clearable size="small" >
+               <el-option
+                      v-for="item in orderTypeOptions"
+                      :key="item.dictValue"
+                      :label="item.dictLabel"
+                      :value="item.dictValue"
+                    />
+              </el-select>
+            </el-form-item>-->
+      <!--      <el-form-item label="上传凭证" prop="isUpload">
+               <el-select   v-model="queryParams.isUpload" placeholder="请选择" clearable size="small" >
+                <el-option key="0"  label="未上传" value="0" />
+                   <el-option key="1"  label="已上传" value="1" />
+              </el-select>
+            </el-form-item>-->
+      <el-form-item label="物流状态" prop="deliveryStatus">
+        <el-select v-model="queryParams.deliveryStatus" clearable placeholder="请选择物流状态" size="small">
+          <el-option
+            v-for="item in deliveryStatusOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="结算状态" prop="deliveryPayStatus">
+        <el-select v-model="queryParams.deliveryPayStatus" clearable placeholder="请选择物流结算状态"
+                   size="small" style="width: 200px"
+        >
+          <el-option
+            v-for="item in deliveryPayStatusOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="支付方式" prop="payType">
+        <el-select v-model="queryParams.payType" clearable placeholder="请选择支付方式" size="small"
+                   style="width: 200px"
+        >
+          <el-option
+            v-for="item in payTypeOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="下单时间" prop="createTimeRange">
+        <el-date-picker
+          v-model="createTimeRange"
+          clearable end-placeholder="结束日期"
+          size="small"
+          start-placeholder="开始日期"
+          style="width:205.4px"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="支付时间" prop="payTimeRange">
+        <el-date-picker
+          v-model="payTimeRange"
+          clearable end-placeholder="结束日期"
+          size="small"
+          start-placeholder="开始日期"
+          style="width:205.4px"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="发货时间" prop="deliverySendTimeRange">
+        <el-date-picker
+          v-model="deliverySendTimeRange"
+          clearable end-placeholder="结束日期"
+          size="small"
+          start-placeholder="开始日期"
+          style="width:205.4px"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="回单时间" prop="deliveryImportTimeRange">
+        <el-date-picker
+          v-model="deliveryImportTimeRange"
+          clearable end-placeholder="结束日期"
+          size="small"
+          start-placeholder="开始日期"
+          style="width:205.4px"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="小程序" prop="coursePlaySourceConfigId">
+        <el-select v-model="queryParams.coursePlaySourceConfigId" placeholder="请选择所属小程序" clearable size="small">
+          <el-option
+            v-for="dict in appMallOptions"
+            :key="dict.id"
+            :label="dict.name + '(' + dict.appid + ')'"
+            :value="dict.id"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="代服账户" prop="erpAccount" v-if="SFDFopen">
+        <el-select v-model="queryParams.erpAccount" style="width: 215px" placeholder="ERP账户" clearable size="small">
+          <el-option
+            v-for="dict in erpAccountQueryList"
+            :key="dict"
+            :label="dict"
+            :value="dict"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="代服电话" prop="erpPhoneNumber" v-if="SFDFopen">
+        <el-input
+          v-model="queryParams.erpPhoneNumber"
+          placeholder="ERP电话"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button icon="el-icon-search" size="mini" type="cyan" @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="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['store:storeOrder:add']"
+        >创建订单</el-button>
+      </el-col> -->
+      <el-col :span="1.5">
+        <el-button v-hasPermi="['store:storeOrder:importExpress']" icon="el-icon-upload2" plain size="mini" type="info"
+                   @click="handleImport"
+        >导入银行回单
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['store:healthStoreOrder:export']"
+          icon="el-icon-download"
+          size="mini"
+          type="warning"
+          @click="handleExport"
+        >导出订单
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['store:healthStoreOrder:exportItems']"
+          icon="el-icon-download"
+          size="mini"
+          type="warning"
+          @click="handleExportItems"
+        >导出订单明细
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['store:healthStoreOrder:export:details']"
+          icon="el-icon-download"
+          size="mini"
+          type="warning"
+          @click="handleExportDetails"
+        >导出订单(明文)
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          v-hasPermi="['store:healthStoreOrder:exportItems:details']"
+          icon="el-icon-download"
+          size="mini"
+          type="warning"
+          @click="handleExportItemsDetails"
+        >导出订单明细(明文)
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          icon="el-icon-s-order"
+          size="mini"
+          type="warning"
+          @click="openDeliveryNote"
+        >批量导入物流单号
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleOrderDelete"
+          v-hasPermi="['store:storeOrder:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6"> <!--待推送erp-->
+        <el-tooltip content="默认erp推送手机号" placement="top">
+          <el-button
+            type="warning"
+            plain
+            icon="el-icon-phone"
+            size="mini"
+            @click="handleErpPhone"
+            v-hasPermi="['store:storeOrder:erpphone']"
+          >推送手机号码</el-button>
+        </el-tooltip>
+      </el-col>
+      <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6">
+        <el-tooltip content="批量设置erp推送手机号" placement="top">
+          <el-button
+            type="warning"
+            plain
+            icon="el-icon-phone"
+            size="mini"
+
+            @click="setErpPhone"
+            v-hasPermi="['his:storeOrder:createErpOrder']"
+          >设置推送手机</el-button>
+        </el-tooltip>
+      </el-col>
+      <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6">
+        <el-tooltip content="批量设置erp账户" placement="top">
+          <el-button
+            type="warning"
+            plain
+            icon="el-icon-s-cooperation"
+            size="mini"
+            @click="showErpAccountSetDialog"
+            v-hasPermi="['his:storeOrder:createErpOrder']"
+          >数据分捡</el-button>
+        </el-tooltip>
+      </el-col>
+      <el-col :span="1.5" v-if="SFDFopen && orderStatus == 6">
+        <el-tooltip content="批量推送erp" placement="top">
+          <el-button
+            type="warning"
+            plain
+            icon="el-icon-s-cooperation"
+            size="mini"
+            @click="showErpAccountDialog"
+            v-hasPermi="['his:storeOrder:createErpOrder']"
+          >创建erp</el-button>
+        </el-tooltip>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          disabled
+          plain
+          type="primary"
+          size="mini"
+        >应付金额: {{ payPriceTotal}}</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          disabled
+          plain
+          type="primary"
+          size="mini"
+        >实付金额: {{payMoneyTotal}}</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          disabled
+          plain
+          type="primary"
+          size="mini"
+        >物流代收金额: {{payRemainTotal }}</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          disabled
+          plain
+          type="primary"
+          size="mini"
+        >订单量/金额: {{ total }}/{{payPriceTotal }}</el-button>
+      </el-col>
+
+
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+      <el-tab-pane label="全部订单" name="00"></el-tab-pane>
+      <el-tab-pane label="待支付" name="0"></el-tab-pane>
+      <el-tab-pane label="待推送" name="6"></el-tab-pane>
+      <el-tab-pane label="待发货" name="1"></el-tab-pane>
+      <el-tab-pane label="待收货" name="2"></el-tab-pane>
+      <el-tab-pane label="交易完成" name="3"></el-tab-pane>
+      <el-tab-pane label="退款中" name="-1"></el-tab-pane>
+      <el-tab-pane label="已退款" name="-2"></el-tab-pane>
+      <el-tab-pane label="已取消" name="-3"></el-tab-pane>
+    </el-tabs>
+    <el-table ref="orderTable" v-loading="loading" :data="storeOrderList" border height="500" @selection-change="handleSelectionChange"
+              @sort-change="handleSortChange" :default-sort="{prop: 'createTime', order: 'descending'}">
+      <el-table-column align="center" type="selection" width="55"/>
+      <el-table-column align="center" label="订单号" prop="orderCode" width="200px"/>
+      <el-table-column label="ERP电话" align="center" prop="erpPhone" width="120px" v-if="SFDFopen"/>
+      <el-table-column label="ERP账号" align="center" prop="erpAccount" width="120px" v-if="SFDFopen"/>
+      <el-table-column label="小程序名称" align="center" prop="miniProgramName"/>
+      <el-table-column align="center" label="用户昵称" prop="nickname" width="150px">
+        <template slot-scope="scope">
+          <span>{{ scope.row.nickname }} </span>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="收件人" prop="realName" width="150px">
+        <template slot-scope="scope">
+          <span>{{ scope.row.realName }} </span>
+        </template>
+      </el-table-column>
+      <!-- <el-table-column label="商品" align="center" width="300px" >
+          <template slot-scope="scope">
+              <div  v-for="(item, index) in scope.row.items" class="items"  >
+                <img class="pic" :src="JSON.parse(item.jsonInfo).image" />
+                <div class="goods-content">
+                  <div class="goods-title">{{ JSON.parse(item.jsonInfo).productName}}</div>
+                  <div class="sku">{{ JSON.parse(item.jsonInfo).sku}}</div>
+                  <div class="price">¥{{JSON.parse(item.jsonInfo).price}}×{{item.num}}</div>
+                </div>
+
+              </div>
+          </template>
+      </el-table-column> -->
+      <el-table-column align="center" label="订单金额" prop="totalPrice">
+        <template slot-scope="scope">
+          <span v-if="scope.row.totalPrice!=null">{{ scope.row.totalPrice.toFixed(2) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="应付金额" align="center" prop="payPrice" width="100px" sortable="custom" :sort-orders="['ascending', 'descending']">
+        <template slot="header" slot-scope="scope">
+          <span >应收金额</span>
+          <el-tooltip content="按应收金额排序" placement="top"/>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="下单时间" prop="createTime"/>
+      <!-- <el-table-column label="支付状态" align="center" prop="paid" /> -->
+      <el-table-column align="center" label="支付时间" prop="payTime" width="180">
+      </el-table-column>
+      <el-table-column align="center" label="发货时间" prop="deliverySendTime"/>
+      <el-table-column align="center" label="支付方式" prop="payType">
+        <template slot-scope="scope">
+          <el-tag v-for="(item, index) in payTypeOptions" v-if="scope.row.payType==item.dictValue" prop="payType">
+            {{ item.dictLabel }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <!--      <el-table-column label="订单类型" align="center" prop="orderType" >
+                <template slot-scope="scope">
+                    <el-tag prop="status" v-for="(item, index) in orderTypeOptions"    v-if="scope.row.orderType==item.dictValue">{{item.dictLabel}}</el-tag>
+                </template>
+            </el-table-column>-->
+      <el-table-column align="center" label="状态" prop="status">
+        <template slot-scope="scope">
+          <el-tag v-for="(item, index) in statusOptions" v-if="scope.row.status==item.dictValue" prop="status">
+            {{ item.dictLabel }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="物流状态" prop="deliveryStatus">
+        <template slot-scope="scope">
+          <el-tag v-for="(item, index) in deliveryStatusOptions" v-if="scope.row.deliveryStatus==item.dictValue"
+                  prop="status"
+          >{{ item.dictLabel }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="物流结算状态" prop="deliveryPayStatus">
+        <template slot-scope="scope">
+          <el-tag v-for="(item, index) in deliveryPayStatusOptions" v-if="scope.row.deliveryPayStatus==item.dictValue"
+                  prop="status"
+          >{{ item.dictLabel }}
+          </el-tag>
+        </template>
+      </el-table-column>
+
+      <el-table-column align="center" fixed="right" label="操作" width="80px">
+        <template slot-scope="scope">
+          <el-button
+            v-hasPermi="['store:storeOrder:query']"
+            size="mini"
+            type="text"
+            @click="handleDetails(scope.row)"
+          >查看
+          </el-button>
+          <!-- <el-button
+            size="mini"
+            type="text"
+            @click="handleGenPayUrl(scope.row)"
+            v-hasPermi="['store:storeOrder:genPayUrl']"
+          >生成付款链接</el-button> -->
+        </template>
+      </el-table-column>
+    </el-table>
+    <div>
+      商品数量合计:{{ productInfo }}
+    </div>
+    <!-- 排序状态显示 -->
+    <div v-if="currentSort.prop" class="sort-info">
+      <el-tag size="small" type="info" closable @close="clearSort">
+        <i class="el-icon-sort"></i>
+        当前排序:{{ getSortLabel(currentSort.prop) }}
+        {{ currentSort.order === 'ascending' ? '升序' : '降序' }}
+      </el-tag>
+      <el-button
+        type="text"
+        size="mini"
+        @click="clearSort"
+        style="margin-left: 8px; color: #909399;"
+      >
+      </el-button>
+    </div>
+
+    <pagination
+      v-show="total>0"
+      :limit.sync="queryParams.pageSize"
+      :page.sync="queryParams.pageNum"
+      :total="total"
+      @pagination="getList"
+    />
+    <el-drawer
+      :title="show.title"
+      :visible.sync="show.open" size="75%"
+    >
+      <product-order ref="order"/>
+    </el-drawer>
+
+
+    <el-dialog v-if="open" :title="title" :visible.sync="open" append-to-body width="1000px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <el-form-item label="会员信息" prop="userId">
+          <el-row>
+            <el-col>
+              <el-input v-model="phone" placeholder="请输入会员手机号" style="width:240px;cursor:pointer">
+              </el-input>
+              <el-button plain style="margin-left:10px;" @click="searchUser()">查询</el-button>
+              <el-button icon="el-icon-plus" plain style="margin-left:10px;" type="primary" @click="handleAddUser()">
+                添加会员
+              </el-button>
+            </el-col>
+          </el-row>
+          <el-table v-loading="userloading" :data="users" border style="margin-top:5px;">
+            <el-table-column align="center" label="ID" prop="userId"/>
+            <el-table-column align="center" label="会员头像" width="80">
+              <template slot-scope="scope">
+                <el-popover
+                  placement="right"
+                  title=""
+                  trigger="hover"
+                >
+                  <img slot="reference" :src="scope.row.avatar" width="50">
+                  <img :src="scope.row.avatar" style="max-width: 120px;">
+                </el-popover>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="昵称" prop="nickname"/>
+            <el-table-column align="center" label="手机号" prop="phone"/>
+            <el-table-column align="center" label="状态" prop="status">
+              <template slot-scope="scope">
+                <el-tag v-for="(item, index) in userStatusOptions" v-if="scope.row.status==item.dictValue"
+                        prop="status"
+                >{{ item.dictLabel }}
+                </el-tag>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-form-item>
+        <el-form-item label="收货信息" prop="addressId">
+          <el-row>
+            <el-col>
+              <el-button icon="el-icon-plus" plain type="primary" @click="handleAddUserAddress()">添加收货地址
+              </el-button>
+            </el-col>
+          </el-row>
+          <el-radio-group v-model="form.addressId" style="width:100%">
+            <el-table v-loading="addressloading" :data="address" border style="margin-top:5px;">
+              <el-table-column align="center" label="ID">
+                <template slot-scope="scope">
+                  <el-radio :label="scope.row.id"></el-radio>
+                </template>
+              </el-table-column>
+              <el-table-column align="center" label="收货人姓名" prop="realName"/>
+              <el-table-column align="center" label="收货人电话" prop="phone"/>
+              <el-table-column align="center" label="地址" prop="detail">
+                <template slot-scope="scope">
+                  {{ scope.row.province }} {{ scope.row.city }} {{ scope.row.district }} {{ scope.row.detail }}
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="商品列表">
+          <el-row>
+            <el-col>
+              <el-button icon="el-icon-plus" plain type="primary" @click="handleAddProduct">添加商品</el-button>
+            </el-col>
+          </el-row>
+          <el-table :key="tablekey" :data="products" border style="margin-top:5px;" width="100%">
+            <el-table-column align="center" label="商品编号" prop="barCode"/>
+            <el-table-column align="center" label="商品图片" width="100">
+              <template slot-scope="scope">
+                <el-popover
+                  placement="right"
+                  title=""
+                  trigger="hover"
+                >
+                  <img slot="reference" :src="scope.row.image" width="50">
+                  <img :src="scope.row.image" style="max-width: 50px;">
+                </el-popover>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="商品名称" prop="productName" show-overflow-tooltip/>
+            <el-table-column align="center" label="商品规格" prop="sku"/>
+            <el-table-column align="center" label="库存" prop="stock"/>
+            <el-table-column align="center" label="单价" prop="price"/>
+            <el-table-column :key="tablekey" align="center" label="数量" prop="count" width="200px">
+              <template slot-scope="scope">
+                <div>
+                  <el-input-number v-model="scope.row.count" :max="scope.row.stock" :min="1"
+                                   size="mini" @change="handleProductCountChange(scope.row)"
+                  ></el-input-number>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="小计" prop="money"/>
+            <el-table-column align="center" label="操作" width="100px">
+              <template slot-scope="scope">
+                <el-button
+                  icon="el-icon-delete"
+                  size="mini"
+                  type="text"
+                  @click="handleDelete(scope.row)"
+                >删除
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <el-row>
+            <el-col>
+              <span>商品合计:{{ products.length }}</span><span style="margin-left:10px;"
+            >商品总价:{{ totalMoney.toFixed(2) }}</span>
+            </el-col>
+          </el-row>
+        </el-form-item>
+        <el-form-item label="订单备注" prop="mark">
+          <el-input v-model="form.mark" placeholder="" rows="2" type="textarea"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog v-if="product.open" :title="product.title" :visible.sync="product.open" append-to-body width="1000px">
+      <product-select @selectProduct="selectProduct"/>
+    </el-dialog>
+    <el-dialog v-if="user.open" :title="user.title" :visible.sync="user.open" append-to-body width="500px">
+      <add-user @addUser="addUser"/>
+    </el-dialog>
+    <el-dialog v-if="userAddress.open" :title="userAddress.title" :visible.sync="userAddress.open" append-to-body
+               width="800px"
+    >
+      <add-user-address ref="addUserAddress" @addUserAddress="addUserAddress"/>
+    </el-dialog>
+    <el-dialog v-if="payQr.open" :title="payQr.title" :visible.sync="payQr.open" append-to-body width="240px">
+      <div style="padding-bottom:15px;">
+        <div ref="qrCodeUrl" class="qrcode"></div>
+      </div>
+    </el-dialog>
+
+    <el-dialog :title="upload.title" :visible.sync="upload.open" append-to-body width="400px">
+      <el-upload ref="upload" :action="upload.url + '?updateSupport=' + upload.updateSupport" :auto-upload="false" :disabled="upload.isUploading"
+                 :headers="upload.headers" :limit="1"
+                 :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" accept=".xlsx, .xls" drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+        <div slot="tip" class="el-upload__tip">
+          <!-- <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的数据 -->
+          <el-link style="font-size:12px" type="info" @click="importTemplate">下载模板</el-link>
+        </div>
+        <div slot="tip" class="el-upload__tip" style="color:red">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :visible.sync="importMsgOpen"
+               append-to-body title="导入结果" width="500px"
+    >
+      <h1>{{importMsg}}</h1>
+    </el-dialog>
+
+    <!-- 批量发货 -->
+    <el-dialog
+      :before-close="handleClose"
+      :visible.sync="deliveryNoteOpen"
+      center
+      title="批量发货"
+      width="35%"
+    >
+      <span slot="footer" class="dialog-footer">
+        <!-- 小程序Appid选择 -->
+        <!--        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">-->
+        <!--          <el-form-item label="小程序:" prop="miniAppId">-->
+        <!--        <el-select-->
+        <!--          v-model="ruleForm.miniAppId"-->
+        <!--          clearable-->
+        <!--          placeholder="请选择发货小程序"-->
+        <!--          style="width: 100%"-->
+        <!--        >-->
+        <!--          <el-option-->
+        <!--            v-for="item in miniAppList"-->
+        <!--            :key="item.appId"-->
+        <!--            :label="item.appName"-->
+        <!--            :value="item.appId"-->
+        <!--          />-->
+        <!--        </el-select>-->
+        <!--      </el-form-item>-->
+        <!--        </el-form>-->
+
+        <el-upload ref="upload" :action="orderUpload.url" :auto-upload="false" :disabled="orderUpload.isUploading" :headers="orderUpload.headers"
+                   :limit="1" :on-progress="handleFileUploadProgress"
+                   :on-success="handleFileSuccess" accept=".xlsx, .xls" drag
+        >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+        <div slot="tip" class="el-upload__tip">
+          <el-link style="font-size:12px" type="info" @click="importDeliveryNoteTemplate">下载模板</el-link>
+        </div>
+        <div slot="tip" class="el-upload__tip" style="color:red">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+        <el-divider></el-divider>
+        <el-button @click="deliveryNoteOpen = false">取 消</el-button>
+        <el-button type="primary" @click="submitDeliveryNote">确 定</el-button>
+      </span>
+    </el-dialog>
+
+    <!-- 设置推送手机对话框 -->
+    <el-dialog :title="erpPhone.title" :visible.sync="erpPhone.open" width="600px" append-to-body>
+      <div style="margin-bottom: 20px;">
+        <el-button type="primary" size="small" @click="handleAddPhone">新增手机号</el-button>
+      </div>
+      <el-table :data="phoneList" border style="width: 100%">
+        <el-table-column prop="phone" label="手机号" align="center">
+          <template slot-scope="scope">
+            <el-input
+              v-if="scope.row.editing"
+              v-model="scope.row.phone"
+              placeholder="请输入手机号"
+              @blur="validatePhone(scope.row)"
+              @keyup.enter.native="handleSavePhone(scope.$index)"
+            />
+            <span v-else>{{ scope.row.phone }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="300">
+          <template slot-scope="scope">
+            <el-button
+              v-if="scope.row.editing"
+              type="success"
+              size="mini"
+              @click="handleSavePhone(scope.$index)"
+            >保存</el-button>
+            <el-button
+              v-if="scope.row.editing"
+              type="info"
+              size="mini"
+              @click="handleCancelEdit(scope.$index)"
+            >取消</el-button>
+            <el-button
+              v-if="!scope.row.editing"
+              type="primary"
+              size="mini"
+              @click="handleEditPhone(scope.$index)"
+            >修改</el-button>
+            <el-button
+              type="danger"
+              size="mini"
+              @click="handleDeletePhone(scope.$index)"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="handleSavePhoneList">确 定</el-button>
+        <el-button @click="handleCancelPhoneDialog">取 消</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog :title="erpPhone.title" :visible.sync="setPhoneOpen" width="600px" append-to-body>
+      <el-select v-model="erpPhoneValue" multiple placeholder="请选择">
+        <el-option
+          v-for="item in phoneList"
+          :key="item.phone"
+          :label="item.phone"
+          :value="item.phone">
+        </el-option>
+      </el-select>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitErpPhone">确 定</el-button>
+        <el-button @click="handleCancelErpPhone">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- ERP账户选择对话框 -->
+    <el-dialog :title="erpAccountDialog.title" :visible.sync="erpAccountDialog.open" width="600px" append-to-body>
+      <div v-loading="erpAccountDialog.loading">
+        <el-form :model="erpAccountForm" label-width="100px">
+          <el-form-item label="ERP账户" required>
+            <el-select
+              v-model="erpAccountForm.selectedAccount"
+              placeholder="请选择ERP账户"
+              style="width: 100%"
+              filterable
+            >
+              <el-option
+                v-for="account in erpAccountList"
+                :key="account"
+                :label="account"
+                :value="account"
+              >
+                <span style="float: left">{{ account}}</span>
+                <span style="float: right; color: #8492a6; font-size: 13px">{{ account.accountCode }}</span>
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-form>
+
+        <!-- 订单统计信息 -->
+        <div class="order-summary" v-if="orderSummary">
+          <el-divider content-position="left">订单统计</el-divider>
+          <el-row :gutter="20">
+            <el-col :span="8">
+              <div class="summary-item">
+                <span class="label">选中订单数:</span>
+                <span class="value">{{ orderSummary.selectedCount }}</span>
+              </div>
+            </el-col>
+            <el-col :span="8">
+              <div class="summary-item">
+                <span class="label">总金额:</span>
+                <span class="value">¥{{ orderSummary.totalAmount }}</span>
+              </div>
+            </el-col>
+            <el-col :span="8">
+              <div class="summary-item">
+                <span class="label">查询条件订单:</span>
+                <span class="value">{{ orderSummary.queryCount }}</span>
+              </div>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancelErpAccountDialog">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="confirmCreateErpOrder"
+          :disabled="!erpAccountForm.selectedAccount"
+          :loading="erpAccountDialog.submitting"
+        >确认</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 导出字段选择对话框 -->
+    <el-dialog :title="exportFieldDialog.title" :visible.sync="exportFieldDialog.open" width="800px" append-to-body>
+      <div v-loading="exportFieldDialog.loading">
+        <div style="margin-bottom: 20px;">
+          <el-button type="primary" size="small" @click="selectAllFields">全选</el-button>
+          <el-button type="default" size="small" @click="unselectAllFields">全不选</el-button>
+          <el-button type="success" size="small" @click="selectDefaultFields">选择常用</el-button>
+        </div>
+
+        <div class="field-selection-container">
+          <el-row :gutter="20">
+            <el-col :span="8" v-for="field in exportFieldOptions" :key="field.key">
+              <el-checkbox
+                v-model="field.checked"
+                :label="field.label"
+                style="margin-bottom: 12px; width: 100%;"
+              >
+                {{ field.label }}
+              </el-checkbox>
+            </el-col>
+          </el-row>
+        </div>
+
+        <div class="field-count-info" style="margin-top: 20px; padding: 10px; background: #f5f7fa; border-radius: 4px;">
+          <i class="el-icon-info"></i>
+          <span v-if="getSelectedFieldsCount() > 0">
+            已选择 <span style="color: #409EFF; font-weight: bold;">{{ getSelectedFieldsCount() }}</span> 个字段
+          </span>
+          <span v-else style="color: #E6A23C; font-weight: bold;">
+            <i class="el-icon-warning"></i>
+            未选择任何字段,将导出所有字段
+          </span>
+        </div>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancelExportFieldDialog">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="confirmExportFields"
+        >确认导出</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  importDeliveryNoteExpressTemplate,
+  importTemplate,
+  exportHealthStoreOrderItems,
+  createUserOrder,
+  listHealthStoreOrder,
+  getStoreOrder,
+  delStoreOrder,
+  exportHealthStoreOrder, exportHealthStoreOrderDetails, exportHealthStoreOrderItemsDetails,getErpAccount,
+  queryErpPhone,
+  saveErpPhone,editErpPhone,batchCreateErpOrder,batchSetErpOrder
+} from '@/api/live/liveOrder'
+import { getUserList } from '@/api/hisStore/user'
+import { getAddressList } from '@/api/hisStore/userAddress'
+import productOrder from '@/views/hisStore/components/productOrder'
+import productSelect from '@/views/hisStore/components/productSelect'
+import addUser from '@/views/hisStore/components/addUser'
+import addUserAddress from '@/views/hisStore/components/addUserAddress'
+import { getToken } from '@/utils/auth'
+import QRCode from 'qrcodejs2'
+import { getCompanyList } from '@/api/company/company'
+
+import { treeselect } from '@/api/company/companyDept'
+import Treeselect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import { getConfigByKey } from '@/api/system/config'
+import {list as getAppMallOptions} from '@/api/course/coursePlaySourceConfig';
+
+export default {
+  components: { productOrder, productSelect, addUser, addUserAddress, Treeselect },
+  name: 'HisHealthStoreOrderList',
+  watch: {
+    // 监听deptId
+    'deptId': 'currDeptChange'
+  },
+  data() {
+    return {
+      orderStatus:null,
+      productInfo:"",
+      payPriceTotal:"0",
+      payMoneyTotal:"0",
+      payRemainTotal:"0",
+      // 新增排序相关数据
+      currentSort: {
+        prop: null,
+        order: null
+      },
+
+      // 排序字段映射
+      sortFieldMap: {
+        'companyUserName': '员工',
+        'packageName': '套餐名称',
+        'payPrice': '应收金额',
+        'payMoney': '实收金额',
+        'createTime': '下单时间'
+      },
+      erpSettingType:'set',
+      SFDFopen:false,
+      // 最大订单号数量限制
+      maxOrderCodes: {
+        type: Number,
+        default: 50
+      },
+      // 输入框是否可见
+      inputVisible: false,
+
+      // 无效订单号对话框
+      showInvalidDialog: false,
+      // 当前输入值
+      currentInput: '',
+      deptOpen:true,
+      // ERP账户相关数据
+      erpAccountDialog: {
+        open: false,
+        title: "选择ERP账户",
+        loading: false,
+        submitting: false
+      },
+      erpAccountList: [], // ERP账户列表
+      erpAccountQueryList:[], // ERP账户查询条件列表
+      erpAccountForm: {
+        selectedAccount: [] // 选中的账户ID
+      },
+      orderSummary: null, // 订单统计信息
+      erpPhoneValue:[],
+      setPhoneOpen:false,
+      erpPhone:{
+        open:false,
+        title:"设置推送手机号"
+      },
+      phoneList: [], // 手机号列表
+      originalPhoneList: [], // 原始手机号列表,用于取消时恢复
+      exportFieldDialog: {
+        open: false,
+        title: "选择导出字段",
+        loading: false,
+        type:null
+      },
+      // 可选择的导出字段列表
+      exportFieldOptions: [
+        { key: 'orderCode', label: '订单号', checked: true },
+        { key: 'miniProgramName', label: '小程序名称', checked: true },
+        { key: 'patientName', label: '就诊人', checked: true },
+        { key: 'productName', label: '编号', checked: true },
+        { key: 'barCode', label: '药品信息', checked: false },
+        { key: 'payMoney', label: '实收金额', checked: true },
+        { key: 'payRemain', label: '物流代收金额', checked: false },
+        { key: 'payType', label: '支付方式', checked: true },
+        { key: 'createTime', label: '下单时间', checked: true },
+        { key: 'payTime', label: '支付时间', checked: true },
+        { key: 'status', label: '订单状态', checked: true },
+        { key: 'userName', label: '收货人姓名', checked: true },
+        { key: 'userPhone', label: '收货人电话', checked: true },
+        { key: 'userAddress', label: '详细地址', checked: true },
+        { key: 'deliveryCode', label: '快递公司编号', checked: false },
+        { key: 'deliveryName', label: '快递公司', checked: false },
+        { key: 'deliverySn', label: '快递单号', checked: false },
+        { key: 'remark', label: '备注', checked: false },
+        { key: 'erpPhone', label: 'ERP电话', checked: false },
+        { key: 'erpAccount', label: 'ERP账号', checked: false },
+
+      ],
+      appMallOptions:[],
+
+      importMsgOpen: false,
+      importMsg: '',
+      deliveryPayStatusOptions: [],
+      deliveryStatusOptions: [],
+      companys: [],
+      deptOptions: [],
+      companyId: undefined,
+      deptId: undefined,
+      orderTypeOptions: [],
+      payTypeOptions: [],
+      payQr: {
+        open: false,
+        title: '付款二维码'
+      },
+      user: {
+        open: false,
+        title: '创建会员'
+      },
+      userAddress: {
+        open: false,
+        title: '创建收货地址'
+      },
+      tablekey: false,
+      totalMoney: 0.00,
+      products: [],
+      product: {
+        open: false,
+        title: '商品选择'
+      },
+      userStatusOptions: [],
+      phone: null,
+      address: [],
+      addressloading: false,
+      userloading: false,
+      users: [],
+      show: {
+        open: false,
+        title: '订单详情'
+      },
+      activeName: '00',
+      statusOptions: [],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 订单表格数据
+      storeOrderList: [],
+      // 弹出层标题
+      title: '',
+      // 是否显示弹出层
+      open: false,
+      createTimeRange: [],
+      payTimeRange: [],
+      deliveryImportTimeRange: [],
+      deliverySendTimeRange: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orderCode: null,
+        orderCodes:[],
+        extendOrderId: null,
+        userId: null,
+        realName: null,
+        userPhone: null,
+        userAddress: null,
+        cartId: null,
+        freightPrice: null,
+        totalNum: null,
+        totalPrice: null,
+        totalPostage: null,
+        payPrice: null,
+        payPostage: null,
+        deductionPrice: null,
+        couponId: null,
+        couponPrice: null,
+        paid: null,
+        payTime: null,
+        payType: null,
+        status: null,
+        refundStatus: null,
+        refundReasonWapImg: null,
+        refundReasonWapExplain: null,
+        refundReasonTime: null,
+        refundReasonWap: null,
+        refundReason: null,
+        refundPrice: null,
+        deliverySn: null,
+        deliveryName: null,
+        deliveryType: null,
+        deliveryId: null,
+        gainIntegral: null,
+        useIntegral: null,
+        payIntegral: null,
+        backIntegral: null,
+        mark: null,
+        isDel: null,
+        cost: null,
+        verifyCode: null,
+        storeId: null,
+        shippingType: null,
+        isChannel: null,
+        isRemind: null,
+        isSysDel: null,
+        deptId: null
+
+      },
+      // 表单参数
+      form: {
+        addressId: null,
+        userId: null
+      },
+      // 表单校验
+      rules: {
+        userId: [
+          { required: true, message: '会员信息不能为空' }
+        ],
+        addressId: [
+          { required: true, message: '收货信息不能为空' }
+        ],
+        miniAppId: [
+          { required: true, message: '发货小程序不能为空' }
+        ],
+      },
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: '',
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: 'Bearer ' + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + '/store/storeOrder/importExpress'
+      },
+      orderUpload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: '',
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: 'Bearer ' + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + '/store/store/storeOrder/importDeliveryNoteExpress',
+      },
+      deliveryNoteOpen: false,
+      miniAppList: [],
+      ruleForm:{
+        miniAppId: null,
+      },
+    }
+  },
+  created() {
+    getCompanyList().then(response => {
+      this.companys = response.data
+      if (this.companys != null && this.companys.length > 0) {
+        this.companyId = this.companys[0].companyId
+        this.getTreeselect()
+      }
+    })
+    this.getDicts('store_order_type').then((response) => {
+      this.orderTypeOptions = response.data
+    })
+    this.getDicts('user_status').then((response) => {
+      this.userStatusOptions = response.data
+    })
+    this.getDicts('store_pay_type').then((response) => {
+      this.payTypeOptions = response.data
+    })
+    this.getDicts('store_order_status').then((response) => {
+      this.statusOptions = response.data
+    })
+    this.getDicts('store_order_delivery_status').then((response) => {
+      this.deliveryStatusOptions = response.data
+    })
+    this.getDicts('store_delivery_pay_status').then((response) => {
+      this.deliveryPayStatusOptions = response.data
+    })
+
+    this.getList()
+    this.getErpAccountList();
+    this.getAppMallOptions();
+  },
+  methods: {
+    // 新增排序处理方法
+    handleSortChange({ column, prop, order }) {
+      console.log('排序变化:', { column, prop, order });
+
+      // 更新当前排序状态
+      this.currentSort = {
+        prop: prop,
+        order: order
+      };
+
+      // 更新查询参数
+      if (order) {
+        this.queryParams.sortField = prop;
+        this.queryParams.sortOrder = order === 'ascending' ? 'asc' : 'desc';
+      } else {
+        this.queryParams.sortField = null;
+        this.queryParams.sortOrder = null;
+      }
+
+      // 重新查询数据
+      this.queryParams.pageNum = 1; // 重置到第一页
+      this.getList();
+
+      // 显示排序提示
+      if (order) {
+        const fieldLabel = this.getSortLabel(prop);
+        const orderLabel = order === 'ascending' ? '升序' : '降序';
+        this.$message.success(`已按${fieldLabel}${orderLabel}排序`);
+      }
+    },
+
+    // 获取排序字段的中文标签
+    getSortLabel(prop) {
+      return this.sortFieldMap[prop] || prop;
+    },
+
+    // 清除排序
+    clearSort() {
+      this.currentSort = {
+        prop: null,
+        order: null
+      };
+      this.queryParams.sortField = null;
+      this.queryParams.sortOrder = null;
+      this.queryParams.pageNum = 1;
+      // 重置表格排序状态 - 关键代码
+      this.$nextTick(() => {
+        if (this.$refs.orderTable) {
+          this.$refs.orderTable.clearSort();
+        }
+      });
+      this.getList();
+      this.$message.success('已清除排序');
+    },
+    // 处理键盘按下事件
+    handleKeyDown(event) {
+      const { key, target } = event
+
+      // 处理退格键删除标签
+      if (key === 'Backspace' && !target.value && this.queryParams.orderCodes.length > 0) {
+        event.preventDefault()
+        this.removeOrderCode(this.queryParams.orderCodes.length - 1)
+      }
+
+      // 处理分隔符
+      if ([',', ',', ' ', 'Enter'].includes(key)) {
+        event.preventDefault()
+        this.handleInputConfirm()
+      }
+    },
+
+    // 处理键盘抬起事件(实时分割输入)
+    handleKeyUp(event) {
+      const value = event.target.value
+
+      // 检查是否包含分隔符
+      if (/[,,\s]/.test(value)) {
+        this.handleInputConfirm()
+      }
+    },
+
+    // 确认输入
+    handleInputConfirm() {
+      const inputValue = this.currentInput.trim()
+
+      if (inputValue) {
+        // 分割多个订单号
+        const codes = inputValue.split(/[,,\s]+/).filter(code => code.trim())
+
+        codes.forEach(code => {
+          this.addOrderCode(code.trim())
+        })
+      }
+
+      this.currentInput = ''
+    },
+
+    // 添加订单号
+    addOrderCode(code) {
+      if (!code) return
+
+      // 检查数量限制
+      if (this.maxOrderCodes > 0 && this.queryParams.orderCodes.length >= this.maxOrderCodes) {
+        this.$message.warning(`最多只能添加 ${this.maxOrderCodes} 个订单号`)
+        return
+      }
+
+      // 检查重复
+      if (this.queryParams.orderCodes.includes(code)) {
+        this.$message.warning(`订单号 "${code}" 已存在`)
+        return
+      }
+
+      // 添加到列表
+      this.queryParams.orderCodes.push(code)
+
+    },
+
+    // 删除订单号
+    removeOrderCode(index) {
+      this.queryParams.orderCodes.splice(index, 1)
+    },
+    // 清空所有标签
+    clearAllTags() {
+      this.$confirm('确认清空所有订单号吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.queryParams.orderCodes = []
+        this.$message.success('已清空所有订单号')
+      })
+    },
+    // 显示输入框
+    showInput() {
+      this.inputVisible = true
+      this.$nextTick(() => {
+        this.$refs.tagInput.focus()
+      })
+    },
+    // 删除订单号
+    removeOrderCode(index) {
+      this.queryParams.orderCodes.splice(index, 1)
+    },
+    // 聚焦输入框
+    focusInput() {
+      if (!this.inputVisible) {
+        this.showInput()
+      }
+    },
+    // 设置erp账户
+    showErpAccountSetDialog() {
+      this.erpAccountDialog.open = true;
+      this.erpSettingType = 'set'
+      this.calculateOrderSummary();
+    },
+    //显示ERP账户选择对话框
+    showErpAccountDialog() {
+      this.erpAccountDialog.open = true;
+      this.erpSettingType = 'push'
+      this.calculateOrderSummary();
+    },
+
+    //获取ERP账户列表
+    async getErpAccountList() {
+      try {
+        const response = await getErpAccount();
+        if (response.code === 200) {
+          const list = response.data || [];
+          this.erpAccountList = [...list];
+          this.erpAccountQueryList = [...list, '未分拣'];
+          // 设置默认值:第一条真实账户
+          if (list.length && !this.queryParams.erpAccount) {
+            this.$set(this.queryParams, 'erpAccount', list[0]);
+            this.getList();
+          }
+        } else {
+          this.$message.error(response.msg || '获取ERP账户列表失败');
+          this.erpAccountList = [];
+        }
+
+      } catch (error) {
+        console.error('获取ERP账户列表失败:', error);
+        this.$message.error('获取ERP账户列表失败');
+        this.erpAccountList = [];
+      } finally {
+        this.erpAccountDialog.loading = false;
+      }
+    },
+
+    // 新增:计算订单统计信息
+    calculateOrderSummary() {
+      let selectedCount = 0;
+      let totalAmount = 0;
+      let queryCount = this.total || 0;
+
+      if (this.ids.length > 0) {
+        // 如果有选中的订单,统计选中的订单
+        selectedCount = this.ids.length;
+        this.storeOrderList.forEach(order => {
+          if (this.ids.includes(order.orderId)) {
+            totalAmount += parseFloat(order.payMoney || 0);
+          }
+        });
+      } else {
+        // 如果没有选中订单,统计当前查询条件下的所有订单
+        selectedCount = queryCount;
+        this.storeOrderList.forEach(order => {
+          totalAmount += parseFloat(order.payMoney || 0);
+        });
+      }
+
+      this.orderSummary = {
+        selectedCount,
+        totalAmount: totalAmount.toFixed(2),
+        queryCount
+      };
+    },
+
+    //确认创建ERP订单
+    confirmCreateErpOrder() {
+      if (!this.erpAccountForm.selectedAccount) {
+        this.$message.warning('请选择ERP账户');
+        return;
+      }
+      console.log("-----------------",this.erpSettingType)
+      if(this.erpSettingType == 'set'){
+        this.$confirm(
+          `确认将订单设置ERP账户为"${this.erpAccountForm.selectedAccount}"吗?`,
+          '确认',
+          {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }
+        ).then(() => {
+          this.executSetErpOrder();
+        });
+      } else if(this.erpSettingType == 'push'){
+        this.$confirm(
+          `确认将订单推送到ERP账户"${this.erpAccountForm.selectedAccount}"吗?`,
+          '确认推送',
+          {
+            confirmButtonText: '确定推送',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }
+        ).then(() => {
+          this.executeCreateErpOrder();
+        });
+      }
+    },
+
+    async executSetErpOrder() {
+      this.erpAccountDialog.submitting = true;
+
+      try {
+        let param = {
+          loginAccount: this.erpAccountForm.selectedAccount
+        };
+
+        if (this.ids.length > 0) {
+          // 如果有选中的订单,只推送选中的
+          param.orderIds = this.ids;
+        } else {
+          // 如果没有选中订单,推送查询条件下的所有订单
+          if (this.payTypeArr.length > 0) {
+            this.queryParams.payType = this.payTypeArr.toString();
+          } else {
+            this.queryParams.payType = null;
+          }
+          if (this.scheduleIdArr.length > 0) {
+            this.queryParams.scheduleId = this.scheduleIdArr.toString();
+          } else {
+            this.queryParams.scheduleId = null;
+          }
+          if (this.buyTypeArr.length > 0) {
+            this.queryParams.orderBuyType = this.buyTypeArr.toString();
+          } else {
+            this.queryParams.orderBuyType = null;
+          }
+          if (this.channelArr.length > 0) {
+            this.queryParams.orderChannel = this.channelArr.toString();
+          } else {
+            this.queryParams.orderChannel = null;
+          }
+          if (this.qwSubjectArr.length > 0) {
+            this.queryParams.qwSubject = this.qwSubjectArr.toString();
+          } else {
+            this.queryParams.qwSubject = null;
+          }
+
+          // 合并查询参数
+          param = { ...param, ...this.queryParams };
+        }
+
+        const response = await batchSetErpOrder(param);
+        if (response.code === 200) {
+          this.$message.success('订单ERP账号设置成功');
+          this.cancelErpAccountDialog();
+          this.getErpAccountList(); // 刷新列表
+          this.getList();
+        } else {
+          this.$message.error(response.msg || 'ERP账号设置失败');
+        }
+      } catch (error) {
+        console.error('ERP账号设置失败:', error);
+        this.$message.error('ERP账号设置失败');
+      } finally {
+        this.erpAccountDialog.submitting = false;
+      }
+    },
+
+    //执行创建ERP订单
+    async executeCreateErpOrder() {
+      this.erpAccountDialog.submitting = true;
+
+      try {
+        let param = {
+          loginAccount: this.erpAccountForm.selectedAccount
+        };
+
+        if (this.ids.length > 0) {
+          // 如果有选中的订单,只推送选中的
+          param.orderIds = this.ids;
+        } else {
+          // 如果没有选中订单,推送查询条件下的所有订单
+          if (this.payTypeArr.length > 0) {
+            this.queryParams.payType = this.payTypeArr.toString();
+          } else {
+            this.queryParams.payType = null;
+          }
+          if (this.scheduleIdArr.length > 0) {
+            this.queryParams.scheduleId = this.scheduleIdArr.toString();
+          } else {
+            this.queryParams.scheduleId = null;
+          }
+          if (this.buyTypeArr.length > 0) {
+            this.queryParams.orderBuyType = this.buyTypeArr.toString();
+          } else {
+            this.queryParams.orderBuyType = null;
+          }
+          if (this.channelArr.length > 0) {
+            this.queryParams.orderChannel = this.channelArr.toString();
+          } else {
+            this.queryParams.orderChannel = null;
+          }
+          if (this.qwSubjectArr.length > 0) {
+            this.queryParams.qwSubject = this.qwSubjectArr.toString();
+          } else {
+            this.queryParams.qwSubject = null;
+          }
+
+          // 合并查询参数
+          param = { ...param, ...this.queryParams };
+        }
+
+        const response = await batchCreateErpOrder(param);
+        if (response.code === 200) {
+          this.$message.success('ERP订单创建成功');
+          this.cancelErpAccountDialog();
+          this.getErpAccountList(); // 刷新列表
+          this.getList();
+        } else {
+          this.$message.error(response.msg || 'ERP订单创建失败');
+        }
+      } catch (error) {
+        console.error('创建ERP订单失败:', error);
+        this.$message.error('创建ERP订单失败');
+      } finally {
+        this.erpAccountDialog.submitting = false;
+      }
+    },
+
+    // 新增:取消ERP账户选择对话框
+    cancelErpAccountDialog() {
+      this.erpAccountDialog.open = false;
+      this.erpAccountForm.selectedAccount = null;
+      this.orderSummary = null;
+      this.erpAccountList = [];
+    },
+    handleCancelErpPhone(){
+      this.erpPhoneValue = [];
+      this.setPhoneOpen = false;
+    },
+    submitErpPhone(){
+      let param = {};
+      if(this.ids.length>0){
+        param = {orderIds:this.ids,erpPhone:this.erpPhoneValue};
+      } else {
+        if(this.payTypeArr.length>0){
+          this.queryParams.payType=this.payTypeArr.toString();
+        }
+        else{
+          this.queryParams.payType=null
+        }
+        if(this.scheduleIdArr.length>0){
+          this.queryParams.scheduleId=this.scheduleIdArr.toString();
+        }
+        else{
+          this.queryParams.scheduleId=null
+        }
+        if(this.buyTypeArr.length>0){
+          this.queryParams.orderBuyType=this.buyTypeArr.toString();
+        }
+        else{
+          this.queryParams.orderbuyType=null
+        }
+        if(this.channelArr.length>0){
+          this.queryParams.orderChannel=this.channelArr.toString();
+        }
+        else{
+          this.queryParams.orderChannel=null
+        }
+        if(this.qwSubjectArr.length>0){
+          this.queryParams.qwSubject=this.qwSubjectArr.toString();
+        }
+        else{
+          this.queryParams.qwSubject=null
+        }
+        param = this.queryParams;
+        param.erpPhone=this.erpPhoneValue;
+      }
+
+      editErpPhone(param).then(response=>{
+        this.msgSuccess("修改成功");
+        this.setPhoneOpen = false;
+        this.getList();
+      })
+    },
+    setErpPhone(){
+      this.getErpPhoneList();
+      this.setPhoneOpen = true;
+    },
+    // 设置推送手机相关方法
+    handleErpPhone(){
+      //查询配置手机号
+      this.getErpPhoneList();
+      this.erpPhone.open = true
+    },
+    getErpPhoneList(){
+      queryErpPhone().then(response =>{
+        if(response.data && response.data != null && response.data.length >0){
+          const phones = response.data.filter(phone => phone.trim());
+          this.phoneList = phones.map(phone => ({
+            phone: phone.trim(),
+            editing: false,
+            originalPhone: phone.trim()
+          }));
+        }
+
+        // 保存原始数据用于取消操作
+        this.originalPhoneList = this.phoneList;
+      });
+    },
+    // 新增手机号
+    handleAddPhone() {
+      this.phoneList.push({
+        phone: '',
+        editing: true,
+        originalPhone: '',
+        isNew: true
+      });
+    },
+    // 编辑手机号
+    handleEditPhone(index) {
+      this.$set(this.phoneList[index], 'editing', true);
+      this.$set(this.phoneList[index], 'originalPhone', this.phoneList[index].phone);
+    },
+    // 保存手机号
+    handleSavePhone(index) {
+      const phone = this.phoneList[index].phone.trim();
+      if (!phone) {
+        this.$message.error('手机号不能为空');
+        return;
+      }
+      if (!this.validatePhoneFormat(phone)) {
+        this.$message.error('请输入正确的手机号格式');
+        return;
+      }
+      // 检查是否重复
+      const duplicateIndex = this.phoneList.findIndex((item, idx) =>
+        idx !== index && item.phone === phone
+      );
+      if (duplicateIndex !== -1) {
+        this.$message.error('手机号已存在');
+        return;
+      }
+      this.$set(this.phoneList[index], 'editing', false);
+      this.$set(this.phoneList[index], 'isNew', false);
+    },
+    // 取消编辑
+    handleCancelEdit(index) {
+      if (this.phoneList[index].isNew) {
+        // 如果是新增的,直接删除
+        this.phoneList.splice(index, 1);
+      } else {
+        // 如果是编辑的,恢复原值
+        this.$set(this.phoneList[index], 'phone', this.phoneList[index].originalPhone);
+        this.$set(this.phoneList[index], 'editing', false);
+      }
+    },
+    // 删除手机号
+    handleDeletePhone(index) {
+      this.$confirm('确认删除该手机号?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.phoneList.splice(index, 1);
+        this.$message.success('删除成功');
+      });
+    },
+    // 验证手机号格式
+    validatePhoneFormat(phone) {
+      const phoneRegex = /^1[3-9]\d{9}$/;
+      return phoneRegex.test(phone);
+    },
+    // 验证手机号
+    validatePhone(row) {
+      if (row.phone && !this.validatePhoneFormat(row.phone)) {
+        this.$message.error('请输入正确的手机号格式');
+      }
+    },
+    // 保存手机号列表
+    handleSavePhoneList() {
+      // 检查是否有正在编辑的项
+      const editingItem = this.phoneList.find(item => item.editing);
+      if (editingItem) {
+        this.$message.error('请先保存正在编辑的手机号');
+        return;
+      }
+
+      // 检查是否有空的手机号
+      const emptyPhone = this.phoneList.find(item => !item.phone.trim());
+      if (emptyPhone) {
+        this.$message.error('存在空的手机号,请删除或填写完整');
+        return;
+      }
+
+      // 构造手机号列表
+      const phoneList = this.phoneList.map(item => item.phone);
+
+      // 调用保存接口
+      saveErpPhone(phoneList).then(response => {
+        if (response.code === 200) {
+          this.$message.success('保存成功');
+          this.erpPhone.open = false;
+        } else {
+          this.$message.error(response.msg || '保存失败');
+        }
+        this.getList();
+      }).catch(() => {
+        this.$message.error('保存失败');
+      });
+    },
+    // 取消手机号对话框
+    handleCancelPhoneDialog() {
+      // 恢复原始数据
+      this.phoneList = JSON.parse(JSON.stringify(this.originalPhoneList));
+      this.erpPhone.open = false;
+    },
+
+    // 获取小程序选项列表
+    getAppMallOptions() {
+      getAppMallOptions({pageNum:1,pageSize:100,isMall:1}).then(response => {
+        this.appMallOptions = response.rows;
+      })
+    },
+    // 获取已选择字段数量
+    getSelectedFieldsCount() {
+      return this.exportFieldOptions.filter(field => field.checked).length;
+    },
+
+    // 取消导出字段选择
+    cancelExportFieldDialog() {
+      this.exportFieldDialog.open = false;
+      this.exportFieldDialog.type = null;
+    },
+    // 选择常用字段
+    selectDefaultFields() {
+      // 先全不选
+      this.unselectAllFields();
+      // 然后选择常用字段
+      const defaultFields = ['orderCode', 'prescribeCode', 'companyName', 'companyUserNickName',
+        'storeName', 'miniProgramName', 'userName', 'userPhone', 'userAddress', 'totalPrice',
+        'totalNum', 'payPrice', 'payMoney', 'createTime', 'payTime',
+        'payType', 'status', 'packageName', 'patientName'];
+      this.exportFieldOptions.forEach(field => {
+        if (defaultFields.includes(field.key)) {
+          field.checked = true;
+        }
+      });
+    },
+
+    // 确认导出字段
+    confirmExportFields() {
+      // 获取已选择的字段
+      const selectedFieldsArray = this.exportFieldOptions.filter(field => field.checked);
+
+      let selectedFields = '';
+      if (selectedFieldsArray.length === 0) {
+        // 如果没有选择任何字段,则导出全部字段(不传filter参数)
+        selectedFields = null;
+      } else {
+        // 如果选择了字段,则只导出选中的字段
+        selectedFields = selectedFieldsArray.map(field => field.key).join(',');
+      }
+
+      // 关闭弹窗
+      this.exportFieldDialog.open = false;
+
+      // 执行导出操作
+      this.doExportOrder(selectedFields);
+    },
+
+    // 执行导出操作
+    doExportOrder(selectedFields) {
+
+      if (this.queryParams.status == '00') {
+        this.queryParams.status = null
+      }
+      if (this.createTimeRange != null && this.createTimeRange.length == 2) {
+        this.queryParams.createTimeRange = this.createTimeRange[0] + '--' + this.createTimeRange[1]
+      } else {
+        this.queryParams.createTimeRange = null
+      }
+      if (this.payTimeRange != null && this.payTimeRange.length == 2) {
+        this.queryParams.payTimeRange = this.payTimeRange[0] + '--' + this.payTimeRange[1]
+      } else {
+        this.queryParams.payTimeRange = null
+      }
+      if (this.deliveryImportTimeRange != null && this.deliveryImportTimeRange.length == 2) {
+        this.queryParams.deliveryImportTimeRange = this.deliveryImportTimeRange[0] + '--' + this.deliveryImportTimeRange[1]
+      } else {
+        this.queryParams.deliveryImportTimeRange = null
+      }
+      if (this.deliverySendTimeRange != null && this.deliverySendTimeRange.length == 2) {
+        this.queryParams.deliverySendTimeRange = this.deliverySendTimeRange[0] + '--' + this.deliverySendTimeRange[1]
+      } else {
+        this.queryParams.deliverySendTimeRange = null
+      }
+      const queryParams = this.addDateRange(this.queryParams, this.dateRange)
+      // 根据是否选择字段显示不同的确认消息
+      let confirmMessage = '';
+      if (selectedFields === null) {
+        confirmMessage = '没有选择字段,将导出所有字段的订单数据,确认继续?';
+      } else {
+        const fieldCount = selectedFields.split(',').length;
+        confirmMessage = `确认导出选中的 ${fieldCount} 个字段的订单数据?`;
+      }
+      this.$confirm('是否确认导出所有订单数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(()=> {
+        this.exportLoading = true;
+        // 构建请求参数
+        const requestParams = {...queryParams};
+        // 只有当selectedFields不为null时才添加filter参数
+        if (selectedFields !== null) {
+          requestParams.filter = selectedFields;
+        }
+        console.log(requestParams)
+        if(this.exportFieldDialog.type == 1){
+          return exportHealthStoreOrder(requestParams)
+        } else if (this.exportFieldDialog.type == 2){
+          return exportHealthStoreOrderDetails(requestParams)
+        }
+      }).then(response => {
+        this.download(response.msg)
+      }).catch(function() {
+      })
+
+    },
+
+    // 导出字段选择相关方法
+    // 全选字段
+    selectAllFields() {
+      this.exportFieldOptions.forEach(field => {
+        field.checked = true;
+      });
+    },
+    // 全不选字段
+    unselectAllFields() {
+      this.exportFieldOptions.forEach(field => {
+        field.checked = false;
+      });
+    },
+
+
+
+    handleGenPayUrl(row) {
+      this.payQr.open = true
+      setTimeout(() => {
+        var qrcode = new QRCode(this.$refs.qrCodeUrl, {
+          text: config.payQRUrl + row.id, // 需要转换为二维码的内容
+          width: 200,
+          height: 200,
+          colorDark: '#000000',
+          colorLight: '#ffffff',
+          correctLevel: QRCode.CorrectLevel.H
+        })
+      }, 200)
+    },
+    handleAddUser() {
+      this.user.open = true
+    },
+    handleAddUserAddress() {
+      if (this.form.userId == null) {
+        this.msgError('请选择会员')
+        return
+      }
+      this.userAddress.open = true
+      setTimeout(() => {
+        this.$refs.addUserAddress.init(this.form.userId)
+      }, 500)
+    },
+    addUser() {
+      this.user.open = false
+    },
+    addUserAddress() {
+      this.userAddress.open = false
+      //获取地址
+      this.getAddressList(this.form.userId)
+    },
+    compute() {
+      this.totalMoney = 0
+      var that = this
+      this.products.forEach(function(value) {
+        that.totalMoney += value.money
+      })
+      console.log(that.totalMoney)
+    },
+    handleProductCountChange(row) {
+      this.tablekey = !this.tablekey
+      console.log(row)
+      row.money = row.count * row.price
+      this.$forceUpdate()
+      this.compute()
+    },
+    selectProduct(row) {
+      console.log(row)
+      for (var i = 0; i < this.products.length; i++) {
+        if (this.products[i].id == row.id) {
+          return
+        }
+      }
+      row.count = 1
+      row.money = row.count * row.price
+      this.products.push(row)
+      this.compute()
+    },
+    handleAddProduct() {
+      this.product.open = true
+    },
+    searchUser() {
+      if (this.phone == null || this.phone == '') {
+        return
+      }
+      var data = { phone: this.phone }
+      this.userloading = true
+      this.users = []
+      this.address = []
+      getUserList(data).then(response => {
+        this.users = response.data
+        this.userloading = false
+        if (this.users != null && this.users.length == 1) {
+          this.form.userId = this.users[0].userId
+          this.getAddressList(this.form.userId)
+        }
+      })
+    },
+    getAddressList(userId) {
+      var data = { userId: userId }
+      this.addressloading = true
+      this.address = []
+      getAddressList(data).then(response => {
+        this.address = response.data
+        this.addressloading = false
+      })
+    },
+    handleDetails(row) {
+      this.show.open = true
+      const orderId = row.id
+      setTimeout(() => {
+        this.$refs.order.getOrder(orderId)
+      }, 500)
+    },
+    handleClick(tab, event) {
+      this.orderStatus = tab.name;
+      this.activeName = tab.name
+      this.queryParams.status = tab.name
+      console.log(this.queryParams.status)
+      this.getList()
+    },
+    /** 查询订单列表 */
+    getList() {
+      this.loading = true
+      if (this.queryParams.status == '00') {
+        this.queryParams.status = null
+      }
+
+      if (this.createTimeRange != null && this.createTimeRange.length == 2) {
+        this.queryParams.createTimeRange = this.createTimeRange[0] + '--' + this.createTimeRange[1]
+      } else {
+        this.queryParams.createTimeRange = null
+      }
+
+      if (this.payTimeRange != null && this.payTimeRange.length == 2) {
+        this.queryParams.payTimeRange = this.payTimeRange[0] + '--' + this.payTimeRange[1]
+      } else {
+        this.queryParams.payTimeRange = null
+      }
+      if (this.deliveryImportTimeRange != null && this.deliveryImportTimeRange.length == 2) {
+        this.queryParams.deliveryImportTimeRange = this.deliveryImportTimeRange[0] + '--' + this.deliveryImportTimeRange[1]
+      } else {
+        this.queryParams.deliveryImportTimeRange = null
+      }
+      if (this.deliverySendTimeRange != null && this.deliverySendTimeRange.length == 2) {
+        this.queryParams.deliverySendTimeRange = this.deliverySendTimeRange[0] + '--' + this.deliverySendTimeRange[1]
+      } else {
+        this.queryParams.deliverySendTimeRange = null
+      }
+
+      // 处理订单号数组
+      if (this.queryParams.orderCodes && this.queryParams.orderCodes.length > 0) {
+        this.queryParams.orderCodeList = this.queryParams.orderCodes.join(',');
+      } else {
+        this.queryParams.orderCodeList = null;
+      }
+
+      listHealthStoreOrder(this.queryParams).then(response => {
+        this.storeOrderList = response.rows
+        this.total = response.total
+        if(this.total>0){
+          this.payPriceTotal = response.payPriceTotal;
+          this.payMoneyTotal = response.payMoneyTotal;
+          this.payRemainTotal = response.payRemainTotal;
+          this.productInfo = response.productInfo;
+        } else {
+          this.payPriceTotal = "0"
+          this.payMoneyTotal = "0"
+          this.payRemainTotal = "0"
+          this.productInfo = response.productInfo;
+        }
+        this.loading = false
+        if(response.msg == 'knt'){
+          this.SFDFopen = true;
+        } else{
+          this.SFDFopen = false;
+        }
+        // 如果有排序,显示排序结果提示
+        if (this.currentSort.prop) {
+          const fieldLabel = this.getSortLabel(this.currentSort.prop);
+          const orderLabel = this.currentSort.order === 'ascending' ? '升序' : '降序';
+          console.log(`数据已按${fieldLabel}${orderLabel}加载`);
+        }
+      }).catch(error => {
+        console.error('查询失败:', error);
+        this.loading = false;
+        this.$message.error('查询数据失败');
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        addressId: null,
+        userId: null
+
+      }
+      this.resetForm('form')
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1
+      this.getList()
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm('queryForm')
+      // 清除排序
+      this.currentSort = {
+        prop: null,
+        order: null
+      };
+      this.queryParams.sortField = null;
+      this.queryParams.sortOrder = null;
+      // 重置表格排序状态 - 关键代码
+      this.$nextTick(() => {
+        if (this.$refs.orderTable) {
+          this.$refs.orderTable.clearSort();
+        }
+      });
+      this.handleQuery()
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset()
+      this.open = true
+      this.title = '创建订单'
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset()
+      const id = row.id || this.ids
+      getStoreOrder(id).then(response => {
+        this.form = response.data
+        this.open = true
+        this.title = '修改订单'
+      })
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs['form'].validate(valid => {
+        this.form.products = this.products
+        if (valid) {
+          console.log(this.form)
+          createUserOrder(this.form).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess('创建成功')
+              this.open = false
+              this.getList()
+            }
+          })
+
+        }
+      })
+    },
+    /** 删除按钮操作 */
+    handleOrderDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除当前选择的订单数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return delStoreOrder(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      this.products.splice(this.products.findIndex(item => item.id === row.id), 1)
+      this.compute()
+
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      // 打开字段选择对话框
+      this.exportFieldDialog.open = true;
+      this.exportFieldDialog.type = 1;
+    },
+    handleExportItems() {
+      if (this.queryParams.status == '00') {
+        this.queryParams.status = null
+      }
+      if (this.createTimeRange != null && this.createTimeRange.length == 2) {
+        this.queryParams.createTimeRange = this.createTimeRange[0] + '--' + this.createTimeRange[1]
+      } else {
+        this.queryParams.createTimeRange = null
+      }
+      if (this.payTimeRange != null && this.payTimeRange.length == 2) {
+        this.queryParams.payTimeRange = this.payTimeRange[0] + '--' + this.payTimeRange[1]
+      } else {
+        this.queryParams.payTimeRange = null
+      }
+      if (this.deliveryImportTimeRange != null && this.deliveryImportTimeRange.length == 2) {
+        this.queryParams.deliveryImportTimeRange = this.deliveryImportTimeRange[0] + '--' + this.deliveryImportTimeRange[1]
+      } else {
+        this.queryParams.deliveryImportTimeRange = null
+      }
+      if (this.deliverySendTimeRange != null && this.deliverySendTimeRange.length == 2) {
+        this.queryParams.deliverySendTimeRange = this.deliverySendTimeRange[0] + '--' + this.deliverySendTimeRange[1]
+      } else {
+        this.queryParams.deliverySendTimeRange = null
+      }
+      const queryParams = this.addDateRange(this.queryParams, this.dateRange)
+      this.$confirm('是否确认导出所有订单明细数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function() {
+        return exportHealthStoreOrderItems(queryParams)
+      }).then(response => {
+        this.download(response.msg)
+      }).catch(function() {
+      })
+    },
+    /** 导出按钮操作 */
+    handleExportDetails() {
+      // 打开字段选择对话框
+      this.exportFieldDialog.open = true;
+      this.exportFieldDialog.type = 2;
+    },
+    handleExportItemsDetails() {
+      if (this.queryParams.status == '00') {
+        this.queryParams.status = null
+      }
+      if (this.createTimeRange != null && this.createTimeRange.length == 2) {
+        this.queryParams.createTimeRange = this.createTimeRange[0] + '--' + this.createTimeRange[1]
+      } else {
+        this.queryParams.createTimeRange = null
+      }
+      if (this.payTimeRange != null && this.payTimeRange.length == 2) {
+        this.queryParams.payTimeRange = this.payTimeRange[0] + '--' + this.payTimeRange[1]
+      } else {
+        this.queryParams.payTimeRange = null
+      }
+      if (this.deliveryImportTimeRange != null && this.deliveryImportTimeRange.length == 2) {
+        this.queryParams.deliveryImportTimeRange = this.deliveryImportTimeRange[0] + '--' + this.deliveryImportTimeRange[1]
+      } else {
+        this.queryParams.deliveryImportTimeRange = null
+      }
+      if (this.deliverySendTimeRange != null && this.deliverySendTimeRange.length == 2) {
+        this.queryParams.deliverySendTimeRange = this.deliverySendTimeRange[0] + '--' + this.deliverySendTimeRange[1]
+      } else {
+        this.queryParams.deliverySendTimeRange = null
+      }
+      const queryParams = this.addDateRange(this.queryParams, this.dateRange)
+      this.$confirm('是否确认导出所有订单明细数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function() {
+        return exportHealthStoreOrderItemsDetails(queryParams)
+      }).then(response => {
+        this.download(response.msg)
+      }).catch(function() {
+      })
+    },
+    handleImport() {
+      this.upload.title = '导入银行回单'
+      this.upload.open = true
+    },
+    submitFileForm() {
+      this.$refs.upload.submit()
+    },
+    importTemplate() {
+      importTemplate().then((response) => {
+        this.download(response.msg)
+      })
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false
+      this.upload.isUploading = false
+      this.$refs.upload.clearFiles()
+      this.importMsgOpen = true
+      this.importMsg = response.msg
+      // this.$alert(response.msg, '导入结果', {
+      //     dangerouslyUseHTMLString: true
+      //   });
+      this.getList()
+    },
+
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      var that = this
+      var param = { companyId: this.companyId }
+      treeselect(param).then((response) => {
+        this.deptOptions = response.data
+        console.log(this.deptOptions)
+        if (response.data != null && response.data.length > 0) {
+          //this.queryParams.deptId=response.data[0].id;
+        }
+      })
+    },
+    companyChange(val) {
+      console.log(val)
+      this.companyId = val
+      this.getTreeselect()
+    },
+    currDeptChange(val) {
+      console.log(val)
+      this.queryParams.deptId = val
+      this.getList()
+    },
+    //打开发货单
+    openDeliveryNote() {
+      this.deliveryNoteOpen = true
+      // this.getAppList();
+    },
+    handleClose(done) {
+      this.$confirm('确认关闭?')
+        .then(_ => {
+          done()
+        })
+        .catch(_ => {
+        })
+    },
+    //发货单模板下载
+    importDeliveryNoteTemplate() {
+      importDeliveryNoteExpressTemplate().then((response) => {
+        this.download(response.msg)
+      })
+    },
+    getAppList() {
+      this.miniAppList = []
+      const key = 'courseMa.config'
+      getConfigByKey(key).then(response => {
+        const { code, data } = response
+        if (code === 200) {
+          let value = data?.configValue
+          if (value) {
+            const appList = JSON.parse(value)
+            this.miniAppList = appList.filter(v => v.type === '1').map(v => {
+              return { appId: v.appid, appName: v.name }
+            })
+          }
+        }
+      })
+    },
+    // 提交发货单
+    submitDeliveryNote() {
+      const uploadFiles = this.$refs.upload.uploadFiles;
+      if (uploadFiles.length === 0) {
+        this.$message.error('请选择要上传的文件');
+        return;
+      }
+      this.$refs.upload.submit();
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+.items {
+  margin: 5px 0px;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: flex-start;
+
+  .pic {
+    width: 60px;
+    height: 60px;
+  }
+
+  .goods-content {
+    margin-left: 10px;
+    max-width: 200px;
+    text-align: left;
+
+    .goods-title {
+
+      overflow: hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+      -o-text-overflow: ellipsis;
+    }
+  }
+}
+
+.el-message-box__message p {
+  max-height: 400px;
+  overflow: scroll;
+}
+
+.import-msg {
+  height: 500px;
+  overflow: auto;
+}
+</style>
+<style>
+.el-descriptions-item__label.is-bordered-label {
+  font-weight: normal;
+}
+
+</style>
+<style scoped>
+.tag-input-order-search {
+  padding: 20px;
+  background: #fff;
+  border-radius: 4px;
+}
+
+.tag-input-container {
+  min-width: 445px;
+}
+
+.tags-wrapper {
+  min-height: 32px;
+  padding: 4px 8px;
+  border: 1px solid #dcdfe6;
+  border-radius: 4px;
+  cursor: text;
+  display: flex;
+  flex-wrap: wrap;
+  align-items: center;
+  gap: 4px;
+  transition: border-color 0.2s;
+}
+
+.tags-wrapper:hover {
+  border-color: #c0c4cc;
+}
+
+.tags-wrapper:focus-within {
+  border-color: #409eff;
+  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
+}
+
+.order-tag {
+  margin: 2px;
+  flex-shrink: 0;
+}
+
+.tag-error {
+  background-color: #fef0f0;
+  border-color: #fbc4c4;
+  color: #f56c6c;
+}
+
+.tag-input {
+  border: none;
+  outline: none;
+  flex: 1;
+  min-width: 120px;
+}
+
+.tag-input >>> .el-input__inner {
+  border: none;
+  padding: 0;
+  height: 24px;
+  line-height: 24px;
+}
+
+.button-new-tag {
+  height: 24px;
+  line-height: 22px;
+  padding: 0 8px;
+  margin: 2px;
+}
+
+.input-tips {
+  margin-top: 4px;
+  font-size: 12px;
+  color: #909399;
+}
+
+/* 新增排序相关样式 */
+.sort-info {
+  margin-top: 10px;
+  padding: 8px 0;
+}
+
+/* 表格布局优化 */
+.el-table {
+  min-width: 100%;
+  table-layout: fixed;
+}
+
+.el-table .el-table__body-wrapper {
+  overflow-x: auto;
+}
+
+.tip-text {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+}
+
+.quick-actions {
+  margin-top: 12px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 8px 0;
+  border-top: 1px solid #ebeef5;
+}
+
+.stats-info {
+  font-size: 12px;
+  color: #909399;
+  display: flex;
+  align-items: center;
+  gap: 4px;
+}
+
+.invalid-codes-list {
+  margin: 16px 0;
+  max-height: 200px;
+  overflow-y: auto;
+}
+
+.invalid-tag {
+  margin: 4px;
+}
+
+.debug-preview {
+  margin-top: 20px;
+}
+
+.debug-content {
+  font-size: 12px;
+}
+
+.debug-content code {
+  display: block;
+  background: #f5f5f5;
+  padding: 8px;
+  border-radius: 4px;
+  margin: 4px 0 12px 0;
+  white-space: pre-wrap;
+}
+
+/* 响应式设计 */
+@media (max-width: 768px) {
+  .tag-input-container {
+    min-width: auto;
+    width: 100%;
+  }
+
+  .tags-wrapper {
+    min-height: 40px;
+  }
+
+  .quick-actions {
+    flex-direction: column;
+    align-items: flex-start;
+    gap: 8px;
+  }
+}
+</style>

+ 328 - 0
src/views/live/liveOrderLogs/index.vue

@@ -0,0 +1,328 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="操作类型" prop="changeType">
+        <el-select v-model="queryParams.changeType" placeholder="请选择操作类型" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="操作备注" prop="changeMessage">
+        <el-input
+          v-model="queryParams.changeMessage"
+          placeholder="请输入操作备注"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="操作时间" prop="changeTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.changeTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择操作时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="操作员" prop="operator">
+        <el-input
+          v-model="queryParams.operator"
+          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-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['live:liveOrderLogs:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['live:liveOrderLogs:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['live:liveOrderLogs:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['live:liveOrderLogs:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveOrderLogsList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="操作员" align="center" prop="logsId" />
+      <el-table-column label="订单id" align="center" prop="orderId" />
+      <el-table-column label="操作类型" align="center" prop="changeType" />
+      <el-table-column label="操作备注" align="center" prop="changeMessage" />
+      <el-table-column label="操作时间" align="center" prop="changeTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.changeTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作员" align="center" prop="operator" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['live:liveOrderLogs:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['live:liveOrderLogs:remove']"
+          >删除</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="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="操作类型" prop="changeType">
+          <el-select v-model="form.changeType" placeholder="请选择操作类型">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="操作备注" prop="changeMessage">
+          <el-input v-model="form.changeMessage" placeholder="请输入操作备注" />
+        </el-form-item>
+        <el-form-item label="操作时间" prop="changeTime">
+          <el-date-picker clearable size="small"
+            v-model="form.changeTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择操作时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="操作员" prop="operator">
+          <el-input v-model="form.operator" placeholder="请输入操作员" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listLiveOrderLogs, getLiveOrderLogs, delLiveOrderLogs, addLiveOrderLogs, updateLiveOrderLogs, exportLiveOrderLogs } from "@/api/live/liveOrderLogs";
+
+export default {
+  name: "LiveOrderLogs",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 订单操作记录表格数据
+      liveOrderLogsList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orderId: null,
+        changeType: null,
+        changeMessage: null,
+        changeTime: null,
+        operator: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        orderId: [
+          { required: true, message: "订单id不能为空", trigger: "blur" }
+        ],
+        changeType: [
+          { required: true, message: "操作类型不能为空", trigger: "change" }
+        ],
+        changeMessage: [
+          { required: true, message: "操作备注不能为空", trigger: "blur" }
+        ],
+        changeTime: [
+          { required: true, message: "操作时间不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询订单操作记录列表 */
+    getList() {
+      this.loading = true;
+      listLiveOrderLogs(this.queryParams).then(response => {
+        this.liveOrderLogsList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        logsId: null,
+        orderId: null,
+        changeType: null,
+        changeMessage: null,
+        changeTime: null,
+        operator: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.logsId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加订单操作记录";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const logsId = row.logsId || this.ids
+      getLiveOrderLogs(logsId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改订单操作记录";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.logsId != null) {
+            updateLiveOrderLogs(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLiveOrderLogs(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const logsIds = row.logsId || this.ids;
+      this.$confirm('是否确认删除订单操作记录编号为"' + logsIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveOrderLogs(logsIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有订单操作记录数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveOrderLogs(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 313 - 0
src/views/live/liveOrderStatus/index.vue

@@ -0,0 +1,313 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="操作类型" prop="changeType">
+        <el-select v-model="queryParams.changeType" placeholder="请选择操作类型" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="操作备注" prop="changeMessage">
+        <el-input
+          v-model="queryParams.changeMessage"
+          placeholder="请输入操作备注"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="操作时间" prop="changeTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.changeTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择操作时间">
+        </el-date-picker>
+      </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">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['live:liveOrderStatus:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['live:liveOrderStatus:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['live:liveOrderStatus:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['live:liveOrderStatus:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveOrderStatusList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="操作时间" align="center" prop="id" />
+      <el-table-column label="订单id" align="center" prop="orderId" />
+      <el-table-column label="操作类型" align="center" prop="changeType" />
+      <el-table-column label="操作备注" align="center" prop="changeMessage" />
+      <el-table-column label="操作时间" align="center" prop="changeTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.changeTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['live:liveOrderStatus:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['live:liveOrderStatus:remove']"
+          >删除</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="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="操作类型" prop="changeType">
+          <el-select v-model="form.changeType" placeholder="请选择操作类型">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="操作备注" prop="changeMessage">
+          <el-input v-model="form.changeMessage" placeholder="请输入操作备注" />
+        </el-form-item>
+        <el-form-item label="操作时间" prop="changeTime">
+          <el-date-picker clearable size="small"
+            v-model="form.changeTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择操作时间">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listLiveOrderStatus, getLiveOrderStatus, delLiveOrderStatus, addLiveOrderStatus, updateLiveOrderStatus, exportLiveOrderStatus } from "@/api/live/liveOrderStatus";
+
+export default {
+  name: "LiveOrderStatus",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 订单操作记录表格数据
+      liveOrderStatusList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orderId: null,
+        changeType: null,
+        changeMessage: null,
+        changeTime: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        orderId: [
+          { required: true, message: "订单id不能为空", trigger: "blur" }
+        ],
+        changeType: [
+          { required: true, message: "操作类型不能为空", trigger: "change" }
+        ],
+        changeMessage: [
+          { required: true, message: "操作备注不能为空", trigger: "blur" }
+        ],
+        changeTime: [
+          { required: true, message: "操作时间不能为空", trigger: "blur" }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询订单操作记录列表 */
+    getList() {
+      this.loading = true;
+      listLiveOrderStatus(this.queryParams).then(response => {
+        this.liveOrderStatusList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        orderId: null,
+        changeType: null,
+        changeMessage: null,
+        changeTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加订单操作记录";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getLiveOrderStatus(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改订单操作记录";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateLiveOrderStatus(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLiveOrderStatus(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除订单操作记录编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveOrderStatus(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有订单操作记录数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveOrderStatus(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 350 - 0
src/views/live/liveOrderitems/index.vue

@@ -0,0 +1,350 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="商品ID" prop="goodsId">
+        <el-input
+          v-model="queryParams.goodsId"
+          placeholder="请输入商品ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="订单ID" prop="orderId">
+        <el-input
+          v-model="queryParams.orderId"
+          placeholder="请输入订单ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="商品名" prop="goodsName">
+        <el-input
+          v-model="queryParams.goodsName"
+          placeholder="请输入商品名"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="单价" prop="price">
+        <el-input
+          v-model="queryParams.price"
+          placeholder="请输入单价"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="数量" prop="num">
+        <el-input
+          v-model="queryParams.num"
+          placeholder="请输入数量"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="状态 1正常 2已退款" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择状态 1正常 2已退款" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </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>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['live:liveOrderitems:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['live:liveOrderitems:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['live:liveOrderitems:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['live:liveOrderitems:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveOrderitemsList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="ID" align="center" prop="id" />
+      <el-table-column label="商品ID" align="center" prop="goodsId" />
+      <el-table-column label="订单ID" align="center" prop="orderId" />
+      <el-table-column label="商品JSON" align="center" prop="goodsJson" />
+      <el-table-column label="商品名" align="center" prop="goodsName" />
+      <el-table-column label="单价" align="center" prop="price" />
+      <el-table-column label="数量" align="center" prop="num" />
+      <el-table-column label="状态 1正常 2已退款" align="center" prop="status" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['live:liveOrderitems:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['live:liveOrderitems:remove']"
+          >删除</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="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="商品ID" prop="goodsId">
+          <el-input v-model="form.goodsId" placeholder="请输入商品ID" />
+        </el-form-item>
+        <el-form-item label="订单ID" prop="orderId">
+          <el-input v-model="form.orderId" placeholder="请输入订单ID" />
+        </el-form-item>
+        <el-form-item label="商品JSON" prop="goodsJson">
+          <el-input v-model="form.goodsJson" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="商品名" prop="goodsName">
+          <el-input v-model="form.goodsName" placeholder="请输入商品名" />
+        </el-form-item>
+        <el-form-item label="单价" prop="price">
+          <el-input v-model="form.price" placeholder="请输入单价" />
+        </el-form-item>
+        <el-form-item label="数量" prop="num">
+          <el-input v-model="form.num" placeholder="请输入数量" />
+        </el-form-item>
+        <el-form-item label="状态 1正常 2已退款">
+          <el-radio-group v-model="form.status">
+            <el-radio label="1">请选择字典生成</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listLiveOrderitems, getLiveOrderitems, delLiveOrderitems, addLiveOrderitems, updateLiveOrderitems, exportLiveOrderitems } from "@/api/live/liveOrderitems";
+
+export default {
+  name: "LiveOrderitems",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 订单商品表格数据
+      liveOrderitemsList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        goodsId: null,
+        orderId: null,
+        goodsJson: null,
+        goodsName: null,
+        price: null,
+        num: null,
+        status: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询订单商品列表 */
+    getList() {
+      this.loading = true;
+      listLiveOrderitems(this.queryParams).then(response => {
+        this.liveOrderitemsList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        goodsId: null,
+        orderId: null,
+        goodsJson: null,
+        goodsName: null,
+        price: null,
+        num: null,
+        status: 0,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加订单商品";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getLiveOrderitems(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改订单商品";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateLiveOrderitems(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLiveOrderitems(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除订单商品编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveOrderitems(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有订单商品数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveOrderitems(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 324 - 0
src/views/live/liveQuestion/index.vue

@@ -0,0 +1,324 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="用户ID" prop="userId">
+        <el-input
+          v-model="queryParams.userId"
+          placeholder="请输入用户ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="问题内容" prop="question">
+        <el-input
+          v-model="queryParams.question"
+          placeholder="请输入问题内容"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="回复" prop="reply">
+        <el-input
+          v-model="queryParams.reply"
+          placeholder="请输入回复"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="回复时间" prop="replyTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.replyTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择回复时间">
+        </el-date-picker>
+      </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">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['live:liveQuestion:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['live:liveQuestion:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['live:liveQuestion:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['live:liveQuestion:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveQuestionList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="ID" align="center" prop="questionId" />
+      <el-table-column label="用户ID" align="center" prop="userId" />
+      <el-table-column label="问题内容" align="center" prop="question" />
+      <el-table-column label="回复" align="center" prop="reply" />
+      <el-table-column label="回复时间" align="center" prop="replyTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.replyTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['live:liveQuestion:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['live:liveQuestion:remove']"
+          >删除</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="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="用户ID" prop="userId">
+          <el-input v-model="form.userId" placeholder="请输入用户ID" />
+        </el-form-item>
+        <el-form-item label="问题内容" prop="question">
+          <el-input v-model="form.question" placeholder="请输入问题内容" />
+        </el-form-item>
+        <el-form-item label="回复" prop="reply">
+          <el-input v-model="form.reply" placeholder="请输入回复" />
+        </el-form-item>
+        <el-form-item label="回复时间" prop="replyTime">
+          <el-date-picker clearable size="small"
+            v-model="form.replyTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择回复时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listLiveQuestion, getLiveQuestion, delLiveQuestion, addLiveQuestion, updateLiveQuestion, exportLiveQuestion } from "@/api/live/liveQuestion";
+
+export default {
+  name: "LiveQuestion",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 问答表格数据
+      liveQuestionList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userId: null,
+        question: null,
+        reply: null,
+        replyTime: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询问答列表 */
+    getList() {
+      this.loading = true;
+      listLiveQuestion(this.queryParams).then(response => {
+        this.liveQuestionList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        questionId: null,
+        userId: null,
+        question: null,
+        reply: null,
+        replyTime: null,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.questionId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加问答";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const questionId = row.questionId || this.ids
+      getLiveQuestion(questionId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改问答";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.questionId != null) {
+            updateLiveQuestion(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLiveQuestion(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const questionIds = row.questionId || this.ids;
+      this.$confirm('是否确认删除问答编号为"' + questionIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveQuestion(questionIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有问答数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveQuestion(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 293 - 0
src/views/live/liveVideo/index.vue

@@ -0,0 +1,293 @@
+<template>
+  <div class="app-container">
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['live:liveVideo:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['live:liveVideo:remove']"
+        >删除</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveVideoList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="编号" align="center" prop="videoId" />
+      <el-table-column label="视频名称" align="center" prop="remark" />
+      <el-table-column label="视频地址" align="center" prop="videoUrl">
+        <template slot-scope="scope">
+          <video
+            :src="scope.row.videoUrl"
+            controls
+            controlsList="nodownload"
+            class="video-player"
+            @contextmenu.prevent
+            type="application/x-mpegURL"
+          ></video>
+        </template>
+      </el-table-column>
+      <el-table-column label="时长" align="center" prop="duration" :formatter="formatDuration"/>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改直播视频对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <live-video-upload
+          :type = "1"
+          :isPrivate = "isPrivate"
+          :fileKey.sync = "form.fileKey"
+          :fileSize.sync = "form.fileSize"
+          :videoUrl.sync="form.videoUrl"
+          :fileName.sync="form.fileName"
+          :line_1.sync="form.lineOne"
+          :thumbnail.sync="form.thumbnail"
+          :uploadType.sync="form.uploadType"
+          :isTranscode.sync="form.isTranscode"
+          :transcodeFileKey.sync="form.transcodeFileKey"
+          @video-duration="handleVideoDuration"
+          @change="handleVideoChange"
+          ref="videoUpload"
+          append-to-body
+        />
+
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listLiveVideo, getLiveVideo, delLiveVideo, addLiveVideo, updateLiveVideo, exportLiveVideo } from "@/api/live/liveVideo";
+import LiveVideoUpload from "@/components/LiveVideoUpload/index.vue";
+
+export default {
+  name: "LiveVideo",
+  components: { LiveVideoUpload },
+  data() {
+    return {
+      //字典
+      videoTypeOptions: [],
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 直播视频表格数据
+      liveVideoList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: -1,
+        videoUrl: null,
+        videoType: -1,
+        sort: null,
+      },
+      // 表单参数
+      form: {
+        uploadType: 1,
+        isTranscode:0,
+        transcodeFileKey:null
+      },
+      // 表单校验
+      rules: {
+      },
+      isPrivate:null,
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    handleVideoDuration(duration) {
+      this.form.duration = duration;
+    },
+    handleVideoChange(videoUrl,lineOne){
+      this.videoUrl = videoUrl;
+      this.form.videoUrl = videoUrl;
+      console.log(this.videoUrl)
+    },
+    // 操作日志类型字典翻译
+    formatDuration(row, column) {
+      if(row.duration == null) return "00:00"
+      const h = Math.floor(row.duration / 3600);
+      const m = Math.floor((row.duration % 3600) / 60);
+      const s = Math.floor(row.duration % 60);
+
+      // 补零处理
+      const format = (num) => num.toString().padStart(2, '0');
+
+      return h > 0
+        ? `${h}:${format(m)}:${format(s)}`
+        : `${format(m)}:${format(s)}`;
+    },
+    /** 查询直播视频列表 */
+    getList() {
+      this.loading = true;
+      listLiveVideo(this.queryParams).then(response => {
+        this.liveVideoList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    videoTypeFormatter(row, column) {
+      return this.selectDictLabel(this.videoTypeOptions, row.status);
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        videoId: null,
+        liveId: null,
+        videoUrl: null,
+        videoType: null,
+        sort: null,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.videoId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加直播视频";
+      this.videoUrl = '';
+      setTimeout(() => {
+        this.$refs.videoUpload.reset();
+      }, 500);
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const videoId = row.videoId || this.ids
+      getLiveVideo(videoId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改直播视频";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          this.form.videoType = -1;
+          this.form.liveId = -1;
+          this.form.remark = this.form.fileName;
+          if(this.form.videoUrl == null || this.form.videoUrl == "") {
+            this.msgError("请上传视频");
+            return;
+          }
+          addLiveVideo(this.form).then(response => {
+            this.msgSuccess("新增成功");
+            this.open = false;
+            this.getList();
+            this.reset();
+          });
+
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const videoIds = row.videoId || this.ids;
+      this.$confirm('是否确认删除直播视频编号为"' + videoIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveVideo(videoIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有直播视频数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveVideo(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>
+
+<style scoped>
+.video-player {
+  width: 100%;
+  height: 100%;
+  object-fit: cover;
+}
+</style>

+ 51 - 0
src/views/live/liveWatchUser/index.vue

@@ -0,0 +1,51 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="直播ID" prop="liveId">
+        <el-input
+          v-model="queryParams.liveId"
+          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>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+
+<script>
+
+export default {
+  name: 'LiveWatchUser',
+  data() {
+    return {
+      showSearch: true,
+      queryForm: null,
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10
+      }
+    }
+  },
+  created() {
+
+  },
+  methods: {
+    handleQuery() {
+      console.log(this.queryParams);
+    },
+    resetQuery() {
+      console.log(this.queryParams);
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>