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

Merge remote-tracking branch 'refs/remotes/origin/master' into cqtyt-master

xgb 1 неделя назад
Родитель
Сommit
1e5d0f4e11

+ 40 - 0
.env.prod-yxj

@@ -0,0 +1,40 @@
+# 页面标题
+VUE_APP_TITLE =易行健总管理系统
+# 首页菜单标题
+VUE_APP_TITLE_INDEX =易行健管理系统
+# 公司名称
+VUE_APP_COMPANY_NAME =重庆云联融智科技有限公司
+# ICP备案号
+VUE_APP_ICP_RECORD =渝ICP备2024031984号-1
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/yxj.jpg
+# 存储桶配置
+VUE_APP_OBS_ACCESS_KEY_ID = K2UTJGIN7UTZJR2XMXYG
+# 存储桶配置
+VUE_APP_OBS_SECRET_ACCESS_KEY = sbyeNJLbcYmH6copxeFP9pAoksM4NIT9Zw4x0SRX
+# 存储桶配置
+VUE_APP_OBS_SERVER = https://obs.cn-north-4.myhuaweicloud.com
+# 存储桶配置
+VUE_APP_OBS_BUCKET = whyxj-hw079058881
+# 存储桶配置
+VUE_APP_COS_BUCKET = ysj-1323137866
+# 存储桶配置
+VUE_APP_COS_REGION = ap-chongqing
+# 线路一地址
+VUE_APP_VIDEO_LINE_1 = https://yxjtcpv.ylrzcloud.com
+# 线路二地址
+VUE_APP_VIDEO_LINE_2 = https://whyxjobs.ylrztop.com
+
+# 开发环境配置
+ENV = 'development'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 2
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 1 - 0
package.json

@@ -46,6 +46,7 @@
     "build:prod-czt": "vue-cli-service build --mode prod-czt",
     "build:prod-hat": "vue-cli-service build --mode prod-hat",
     "build:prod-ddgy": "vue-cli-service build --mode prod-ddgy",
+    "build:prod-yxj": "vue-cli-service build --mode prod-yxj",
     "preview": "node build/index.js --preview",
     "lint": "eslint --ext .js,.vue src"
   },

+ 8 - 1
src/api/company/companyConfig.js

@@ -9,6 +9,13 @@ export function listCompanyConfig(query) {
   })
 }
 
+export function getConfigByKey(configKey) {
+  return request({
+    url: '/company/companyConfig/getConfigByKey/' + configKey,
+    method: 'get'
+  })
+}
+
 // 查询参数配置详细
 export function getCompanyConfig(configId) {
   return request({
@@ -50,4 +57,4 @@ export function exportCompanyConfig(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 192 - 0
src/api/company/companyUserAll.js

@@ -0,0 +1,192 @@
+import request from '@/utils/request'
+import { praseStrEmpty } from "@/utils/common";
+
+// 查询企微用户列表
+export function qwList(query) {
+  return request({
+    url: '/company/CompanyUserAll/qwList',
+    method: 'get',
+    params: query
+  })
+}
+export function getList(query) {
+  return request({
+    url: '/company/CompanyUserAll/getList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询用户详细
+export function getUser(userId) {
+  return request({
+    url: '/company/CompanyUserAll/' + praseStrEmpty(userId),
+    method: 'get'
+  })
+}
+
+// 查询用户详细
+export function addInfo(companyId) {
+  return request({
+    url: '/company/CompanyUserAll/addInfo/' +companyId,
+    method: 'get'
+  })
+}
+
+
+// 新增用户
+export function addUser(data) {
+  return request({
+    url: '/company/CompanyUserAll',
+    method: 'post',
+    data: data
+  })
+}
+
+//创建二维码
+export function addCodeUrl(data) {
+  return request({
+    url: '/company/CompanyUserAll/addCodeUrl',
+    method: 'post',
+    data: data
+  })
+}
+
+
+// 修改用户
+export function updateUser(data) {
+  return request({
+    url: '/company/CompanyUserAll',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除用户
+export function delUser(userIds) {
+  return request({
+    url: '/company/CompanyUserAll/' + userIds,
+    method: 'delete'
+  })
+}
+
+// 导出用户
+export function exportUser(query) {
+  return request({
+    url: '/company/CompanyUserAll/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 用户密码重置
+export function resetUserPwd(userId, password) {
+  const data = {
+    userId,
+    password
+  }
+  return request({
+    url: '/company/CompanyUserAll/resetPwd',
+    method: 'put',
+    data: data
+  })
+}
+
+// 用户状态修改
+export function changeUserStatus(userId, status) {
+  const data = {
+    userId,
+    status
+  }
+  return request({
+    url: '/company/CompanyUserAll/changeStatus',
+    method: 'put',
+    data: data
+  })
+}
+
+// 下载用户导入模板
+export function importTemplate() {
+  return request({
+    url: '/company/CompanyUserAll/importTemplate',
+    method: 'get'
+  })
+}
+
+/**
+ * 获取地区
+ */
+export function getCitysAreaList(query) {
+  return request({
+    url: '/company/CompanyUserAll/getCitysAreaList',
+    method: 'get',
+    params: query
+  })
+}
+
+/**
+ * 批量修改 销售的所属区域(临时的)
+ */
+export function updateCompanyUserAreaList(data) {
+  return request({
+    url: '/company/CompanyUserAll/updateCompanyUserAreaList',
+    method: 'post',
+    data: data
+  })
+}
+
+
+//生成域名
+export function generateSubDomain(query){
+  return request({
+    url: '/company/CompanyUserAll/generateSubDomain',
+    method: 'get',
+    params: query
+  })
+}
+
+// 设置是否需要单独注册会员
+export function setIsRegisterMember(status, data) {
+  return request({
+    url: '/company/CompanyUserAll/setRegister',
+    method: 'put',
+    params: status,
+    data: data
+  })
+}
+
+// 开关是否允许所有方式注册会员
+export function isAllowedAllRegister(status, data) {
+  return request({
+    url: '/company/CompanyUserAll/allowedAllRegister',
+    method: 'put',
+    params: status,
+    data: data
+  })
+}
+
+// 绑定医生
+export function bindDoctorId(data) {
+  return request({
+    url: '/company/CompanyUserAll/bindDoctorId',
+    method: 'post',
+    data: data
+  })
+}
+
+//解绑医生
+export function unBindDoctorId(userId) {
+  return request({
+    url: '/company/CompanyUserAll/unBindDoctorId/'+userId,
+    method: 'get'
+  })
+}
+
+//批量修改用户的角色
+export function updateBatchUserRoles(data) {
+  return request({
+    url: '/company/CompanyUserAll/updateBatchUserRoles',
+    method: 'post',
+    data: data
+  })
+}

+ 9 - 0
src/api/course/userCourse.js

@@ -98,3 +98,12 @@ export function pullOff(courseIds) {
     method: 'post'
   })
 }
+
+// 修改课堂配置
+export function editConfig(data) {
+  return request({
+    url: '/course/userCourse/editConfig',
+    method: 'post',
+    data: data
+  })
+}

+ 152 - 0
src/api/doctor/doctor.js

@@ -0,0 +1,152 @@
+import request from '@/utils/request'
+
+// 查询医生管理列表
+export function listDoctor(query) {
+  return request({
+    url: '/his/doctor/list',
+    method: 'get',
+    params: query
+  })
+}
+
+export function getUserList(name) {
+  return request({
+    url: '/his/doctor/user/list',
+    method: 'get',
+    params: name
+  })
+}
+export function getFollowDoctorList(query) {
+  return request({
+    url: '/his/doctor/followDoctorList',
+    method: 'get',
+    params: query
+  })
+}
+export function getAllFollowDoctorList(query) {
+  return request({
+    url: '/his/doctor/allFollowDoctorList',
+    method: 'get',
+    params: query
+  })
+}
+export function docList() {
+  return request({
+    url: '/his/doctor/doc/list',
+    method: 'get',
+
+  })
+}
+// 查询医生名称列表
+export function listdocuser(query) {
+  return request({
+    url: '/his/doctor/userdoc/list',
+    method: 'get',
+    params: query
+  })
+}
+export function getDoctorPrice(doctorId) {
+  return request({
+    url: '/his/price/getDoctorPrice/' + doctorId,
+    method: 'get'
+  })
+}
+
+
+export function editPassWord(data) {
+  return request({
+    url: '/his/doctor/editPassWord',
+    method: 'put',
+    data: data
+  })
+}
+
+export function editDoctorPrice(data) {
+  return request({
+    url: '/his/price/editDoctorPrice',
+    method: 'post',
+    data: data
+  })
+}
+// 查询医生管理详细
+export function getDoctor(doctorId) {
+  return request({
+    url: '/his/doctor/' + doctorId,
+    method: 'get'
+  })
+}
+// 新增医生管理
+export function addDoctor(data) {
+  return request({
+    url: '/his/doctor',
+    method: 'post',
+    data: data
+  })
+}
+export function editFollow(data) {
+  return request({
+    url: '/his/doctor/editFollow',
+    method: 'put',
+    data: data
+  })
+}
+// 修改医生管理
+export function updateDoctor(data) {
+  return request({
+    url: '/his/doctor',
+    method: 'put',
+    data: data
+  })
+}
+
+// 修改医生管理
+export function editPrice(data) {
+  return request({
+    url: '/his/doctor/editDoctorPrice',
+    method: 'put',
+    data: data
+  })
+}
+
+// 修改医生管理
+export function updateAuditDoctor(data) {
+  return request({
+    url: '/his/doctor/editDoctor',
+    method: 'put',
+    data: data
+  })
+}
+
+
+// 删除医生管理
+export function delDoctor(doctorId) {
+  return request({
+    url: '/his/doctor/' + doctorId,
+    method: 'delete'
+  })
+}
+
+// 导出医生管理
+export function getWxaCodeUnLimit() {
+  return request({
+    url: '/his/doctor/getWxaCodeUnLimit',
+    method: 'get',
+  })
+}
+// 导出医生管理
+export function exportDoctor(query) {
+  return request({
+    url: '/his/doctor/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询医生管理列表
+export function listDoctorVO(query) {
+  return request({
+    url: '/his/doctor/getDocVoList',
+    method: 'get',
+    params: query
+  })
+}

+ 24 - 0
src/api/his/company.js

@@ -29,6 +29,14 @@ export function deduct(data) {
     data: data
   })
 }
+
+export function redDeduct(data) {
+  return request({
+    url: '/his/company/redDeduct',
+    method: 'post',
+    data: data
+  })
+}
 export function recharge(data) {
   return request({
     url: '/his/company/recharge',
@@ -36,6 +44,15 @@ export function recharge(data) {
     data: data
   })
 }
+// 红包充值
+export function redRecharge(data) {
+  return request({
+    url: '/his/company/redRecharge',
+    method: 'post',
+    data: data
+  })
+}
+
 
 // 新增诊所管理
 export function addCompany(data) {
@@ -87,3 +104,10 @@ export function setDiv(data) {
     data: data
   })
 }
+export function exitMiniProgram(data) {
+  return request({
+    url: '/his/company/exitMiniProgram',
+    method: 'post',
+    data: data
+  })
+}

+ 16 - 0
src/api/his/integralOrder.js

@@ -87,3 +87,19 @@ export function cancelOrder(orderCode) {
     data: {orderCode}
   })
 }
+//申请退款
+export function mandatoryRefunds(orderCode) {
+  return request({
+    url: '/his/integralOrder/mandatoryRefunds',
+    method: 'post',
+    data: {orderCode}
+  })
+}
+
+// 确认收货
+export function finishOrder(orderCode) {
+  return request({
+    url: '/his/integralOrder/finishOrder/' + orderCode,
+    method: 'get'
+  })
+}

+ 17 - 0
src/api/qw/qwDept.js

@@ -0,0 +1,17 @@
+import request from '@/utils/request'
+
+// 同步企业微信部门
+export function syncDept(companyId) {
+  return request({
+    url: '/qw/qwDept/syncDept/'+companyId,
+    method: 'get'
+  })
+}
+
+export function treeselect(query) {
+  return request({
+    url: '/qw/qwDept/treeselect',
+    method: 'get',
+    params: query
+  })
+}

+ 7 - 0
src/api/qw/user.js

@@ -67,6 +67,13 @@ export function getQwUserByIds(ids) {
   })
 }
 
+export function addQwUserName(id) {
+  return request({
+    url: '/qw/user/syncName/' + id,
+    method: 'post',
+  })
+}
+
 // 新增企微用户
 export function addUser(data) {
   return request({

+ 53 - 0
src/api/statistics/statistics.js

@@ -323,3 +323,56 @@ export function thisMonthRecvCount(param){
     params: param
   })
 }
+
+/**
+ * 综合统计
+ * @returns {*}
+ */
+export function getStatisticsData(data) {
+  return request({
+    url: '/statistic/manage/statisticMain',
+    method: 'post',
+    data: data  // 使用 data 而不是 params
+  })
+}
+
+/**
+ * 获取下拉
+ * @returns {*}
+ */
+export function getSearchCompanyInfo(param){
+  return request({
+    url: '/statistic/manage/getSearchCompanyInfo',
+    method: 'get',
+    params: param
+  })
+}
+
+/**
+ * 获取下拉
+ * @returns {*}
+ */
+export function getSearchDeptInfo(param){
+  return request({
+    url: '/statistic/manage/getSearchDeptInfo',
+    method: 'get',
+    params: param
+  })
+}
+
+/**
+ * 获取下拉
+ * @returns {*}
+ */
+export function getSearchUserInfo(param){
+  return request({
+    url: '/statistic/manage/getSearchUserInfo',
+    method: 'get',
+    params: param
+  })
+}
+
+
+
+
+

BIN
src/assets/logo/yxj.jpg


+ 1692 - 0
src/views/company/companyUser/indexAll.vue

@@ -0,0 +1,1692 @@
+<template>
+  <div class="app-container">
+    <el-row :gutter="20">
+      <!--部门数据-->
+      <el-col :span="3" :xs="24">
+        <div class="head-container">
+          <el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small" prefix-icon="el-icon-search" style="margin-bottom: 20px" />
+        </div>
+        <div class="head-container">
+          <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false" :filter-node-method="filterNode" ref="tree"  @node-click="handleNodeClick" />
+        </div>
+      </el-col>
+      <!--用户数据-->
+      <el-col :span="21" :xs="24">
+        <el-form  :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+          <el-form-item label="员工后台昵称" prop="nickName">
+            <el-input v-model="queryParams.nickName" placeholder="请输入员工后台昵称" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
+          </el-form-item>
+          <el-form-item label="手机号码" prop="phonenumber">
+            <el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
+          </el-form-item>
+          <el-form-item label="状态" prop="status">
+            <el-select v-model="queryParams.status" placeholder="员工状态" clearable size="small" style="width: 240px" @change="handleQuery">
+              <el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="企微状态" prop="qwStatus">
+            <el-select v-model="queryParams.qwStatus" placeholder="企微绑定状态" clearable size="small" style="width: 240px"  @change="handleQuery">
+              <el-option v-for="dict in qwStatusOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
+            </el-select>
+          </el-form-item>
+
+          <el-form-item label="创建时间">
+            <el-date-picker v-model="dateRange" size="small" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
+          </el-form-item>
+          <el-form-item>
+            <el-button  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  plain type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['company:user:add']">新增</el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button  plain type="success" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['company:user:edit']">修改</el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button  plain type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['company:user:remove']">删除</el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button  plain type="info" icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['company:user:import']">导入</el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button  plain type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['company:user:export']">导出</el-button>
+          </el-col>
+          <el-col :span="1.5">
+           <el-button
+             type="primary"
+             plain
+             size="mini"
+             @click="synOpen=true"
+             v-hasPermi="['qw:user:sync']"
+           >同步企微员工和部门</el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              plain
+              size="mini"
+              @click="synNameOpen=true"
+              v-hasPermi="['qw:user:sync']"
+            >同步企微员工名称</el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              plain
+              size="mini"
+              :disabled="multiple"
+              @click="handerCompanyUserAreaList"
+            >批量设置销售所属区域</el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              plain
+              size="mini"
+              :disabled="multiple"
+              @click="handleSetRegister"
+            >设置单独注册会员</el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              plain
+              size="mini"
+              :disabled="multiple"
+              @click="handleAllowedAllRegister"
+            >允许注册会员开关</el-button>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              plain
+              size="mini"
+              @click="handleBindCompanyUserCode"
+            >生成注册/绑定销售二维码</el-button>
+          </el-col>
+          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+        </el-row>
+
+        <el-table  height="500" border v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
+          <el-table-column type="selection" width="50" align="center" />
+          <el-table-column label="ID" align="center" prop="userId" :show-overflow-tooltip="true" />
+          <el-table-column label="员工后台账号" align="center" prop="userName" :show-overflow-tooltip="true" width="100" />
+          <el-table-column label="员工后台昵称" align="center" prop="nickName" :show-overflow-tooltip="true" 员工后台  width="100"/>
+          <el-table-column label="部门" align="center" prop="deptName" :show-overflow-tooltip="true" />
+          <el-table-column label="手机号码" align="center" prop="phonenumber" width="120" />
+          <el-table-column label="账户角色" align="center" :show-overflow-tooltip="true" width="150">
+            <template slot-scope="scope">
+              <span v-if="scope.row.roleNames && scope.row.roleNames.length > 0">
+                {{ scope.row.roleNames.join('、') }}
+              </span>
+              <span v-else>-</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="二维码" align="center" prop="qrCodeWeixin">
+            <template slot-scope="scope">
+              <!-- 显示已上传的二维码 -->
+              <el-image
+                v-if="scope.row.qrCodeWeixin"
+                style="width: 80px; height: 80px; margin-bottom: 5px; display: block; margin-left: auto; margin-right: auto;"
+                :src="scope.row.qrCodeWeixin"
+                :preview-src-list="[scope.row.qrCodeWeixin]"
+                fit="contain">
+                <div slot="error" class="image-slot">
+                  <i class="el-icon-picture-outline"></i>
+                </div>
+              </el-image>
+              <!-- 上传组件 -->
+              <el-upload
+                class="avatar-uploader"
+                action="#"
+                :show-file-list="false"
+                :http-request="(options) => handleCustomUpload(options, scope.row)"
+                :before-upload="(file) => beforeImageUpload(file, scope.row)"
+              >
+                <el-button size="small" type="primary" :loading="scope.row.uploading">
+                  {{ scope.row.qrCodeWeixin ? '更换图片' : '上传图片' }}
+                  <i class="el-icon-upload el-icon--right"></i>
+                </el-button>
+              </el-upload>
+              <div v-if="scope.row.uploadError" class="el-upload__tip" style="color: red;">
+                {{ scope.row.uploadError }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column label="状态" align="center">
+            <template slot-scope="scope">
+              <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
+            </template>
+          </el-table-column>
+          <el-table-column label="企微状态" align="center">
+            <template slot-scope="scope">
+              <dict-tag :options="qwStatusOptions" :value="scope.row.qwStatus"/>
+            </template>
+          </el-table-column>
+          <el-table-column label="绑定的企微号" align="center">
+            <template slot-scope="scope">
+              <div v-if="scope.row.qwUsers && scope.row.qwUsers.length > 0">
+                <div v-for="user in scope.row.qwUsers" :key="user.id">
+                  <el-tag size="mini">{{ user.qwUserName }}</el-tag>
+                </div>
+              </div>
+              <div v-else>
+                <dict-tag :options="qwStatusOptions" :value="scope.row.qwStatus"/>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column label="区域" align="center" prop="addressId">
+          </el-table-column>
+          <el-table-column label="创建时间"  sortable align="center" prop="createTime" width="160">
+            <template slot-scope="scope">
+              <span>{{ parseTime(scope.row.createTime) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="是否单独注册会员" align="center" prop="isNeedRegisterMember" width="80px">
+            <template slot-scope="scope">
+              <el-tag
+                :type="scope.row.isNeedRegisterMember === 1 ? 'success' : 'info'">{{scope.row.isNeedRegisterMember === 1 ? '是' : '否' }}</el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column label="允许注册会员" align="center" prop="isNeedRegisterMember" width="80px">
+            <template slot-scope="scope">
+              <el-tag
+                :type="scope.row.isAllowedAllRegister === 1 ? 'success' : 'info'">{{scope.row.isAllowedAllRegister === 1 ? '是' : '否' }}</el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-connection"
+                plain
+                v-if="scope.row.doctorId!=null"
+                @click="handleUpdateDoctor(scope.row)"
+              >换绑医生</el-button>
+              <el-button
+                size="mini"
+                type="text"
+                plain
+                icon="el-icon-link"
+                v-else
+                @click="handleUpdateDoctor(scope.row)"
+              >绑定医生</el-button>
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-unlock"
+                plain
+                v-if="scope.row.doctorId!=null"
+                @click="handleUnBindUserId(scope.row)"
+              >解绑医生</el-button>
+              <el-button
+                v-if="scope.row.qwStatus == 0"
+                size="mini"
+                type="text"
+                icon="el-icon-edit"
+                @click="qwBind(scope.row)"
+                v-hasPermi="['qw:user:bind']"
+              >绑定企微</el-button>
+
+              <el-button
+                v-else
+                size="mini"
+                type="text"
+                icon="el-icon-edit"
+                @click="qwBind(scope.row)"
+                v-hasPermi="['qw:user:bind']"
+              >查或换绑企微</el-button>
+
+              <el-button v-if="scope.row.userType !== '00'" size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['company:user:edit']">修改</el-button>
+              <el-button v-if="scope.row.userType !== '00'" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['company:user:remove']">删除</el-button>
+              <el-button size="mini" type="text" icon="el-icon-key" @click="handleResetPwd(scope.row)" v-hasPermi="['company:user:resetPwd']">重置密码</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-col>
+    </el-row>
+
+    <!-- 批量修改角色对话框 -->
+    <el-dialog title="批量修改角色" :visible.sync="batchRoleDialogVisible" width="500px" append-to-body>
+      <el-form :model="batchRoleForm" label-width="80px">
+        <el-form-item label="选择角色">
+          <el-select v-model="selectedRoleIds" multiple placeholder="请选择角色" style="width: 100%;">
+            <el-option
+              v-for="item in roleOptions"
+              :key="item.roleId"
+              :label="item.roleName"
+              :value="item.roleId">
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="batchRoleDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitBatchRoles">确 定</el-button>
+      </div>
+    </el-dialog>
+
+    <!--当点击查或换绑微信时候弹出此框-->
+    <el-dialog title="绑定企微账号"  :visible.sync="qwOpen" width="800px" append-to-body >
+      <el-form ref="form" :model="form"  label-width="80px" >
+        <el-form-item label="查询"  prop="companyUserId">
+          <el-button type="primary" icon="el-icon-search"  @click="selectQwUser()"  size="mini">搜索账号</el-button>
+        </el-form-item>
+        <el-form-item label="企微账号"  prop="companyUserId">
+          <el-tag
+            style="margin-left: 5px"
+            size="medium"
+            :key="id"
+            v-for="id in qwUser"
+            closable
+            :disable-transitions="false"
+            @close="handleClosegroupUser(id)">
+            <span v-for="list in qwUserList" :key="list.qwUserId" v-if="list.id==id">{{list.qwUserName}}({{list.corpName}})
+            </span>
+          </el-tag>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="qwSubmitForm">绑 定</el-button>
+        <el-button @click="qwCancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog title="选择企微主体" :visible.sync="synOpen" width="800px" append-to-body>
+      <el-form   label-width="80px">
+        <el-form-item label="企微公司" prop="corpId">
+          <el-select v-model="synform.corpId" placeholder="企微公司"  >
+            <el-option
+              v-for="dict in myQwCompanyList"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="synSubmitForm">确 定</el-button>
+        <el-button @click="synOpen=false">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog title="选择企微主体" :visible.sync="synNameOpen" width="800px" append-to-body>
+      <el-form   label-width="80px">
+        <el-form-item label="企微公司" prop="corpId">
+          <el-select v-model="synNameform.corpId" placeholder="企微公司"  >
+            <el-option
+              v-for="dict in myQwCompanyList"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="synNameSubmitForm">确 定</el-button>
+        <el-button @click="synNameOpen=false">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 添加或修改参数配置对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-row>
+          <el-col :span="12">
+<!--            <el-form-item label="员工账号" prop="userName">-->
+<!--              <el-input v-model="form.userName" placeholder="请输入员工后台账号" />-->
+<!--            </el-form-item>-->
+            <el-form-item label="员工姓名" prop="nickName">
+              <el-input v-model="form.nickName" placeholder="请输入员工后台昵称" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="归属部门" prop="deptId">
+              <treeselect v-model="form.deptId" :options="deptOptionsByCompanyId" :show-count="true" placeholder="请选择归属部门" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="手机号码" prop="phonenumber">
+              <el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="邮箱" prop="email">
+              <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="员工账号" prop="userName">
+              <el-input v-model="form.userName" placeholder="请输入员工工号" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
+              <el-input v-model="form.password" placeholder="请输入用户密码" type="password" show-password />
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="员工性别">
+              <el-select v-model="form.sex" placeholder="请选择">
+                <el-option v-for="dict in sexOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="状态">
+              <el-radio-group v-model="form.status">
+                <el-radio v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictValue">{{dict.dictLabel}}</el-radio>
+              </el-radio-group>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="岗位">
+              <el-select v-model="form.postIds" multiple placeholder="请选择">
+                <el-option v-for="item in postOptions" :key="item.postId" :label="item.postName" :value="item.postId" :disabled="item.status == 1"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="12">
+            <el-form-item label="角色">
+              <el-select v-model="form.roleIds" multiple placeholder="请选择">
+                <el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.status == 1"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+        </el-row>
+         <el-row>
+          <el-col :span="12">
+            <el-form-item label="身份证号">
+              <el-input v-model="form.idCard" placeholder="请输入身份证号" maxlength="18" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="销售区域" prop="addressId">
+              <el-select v-model="form.addressId"  filterable placeholder="请选择所属销售的区域" style="width: 200px;">
+                <el-option
+                  v-for="item in citysAreaList"
+                  :key="item.cityId"
+                  :label="item.cityName"
+                  :value="item.cityId"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+<!--        <el-row>-->
+<!--          <el-col :span="24">-->
+<!--            <el-form-item label="数据权限">-->
+<!--              <el-radio-group v-model="form.userType">-->
+<!--                <el-radio v-for="dict in userTypeOptions" :key="dict.dictValue" :label="dict.dictValue">{{dict.dictLabel}}</el-radio>-->
+<!--              </el-radio-group>-->
+<!--            </el-form-item>-->
+<!--          </el-col>-->
+<!--        </el-row>-->
+<!--        <el-row>
+          <el-col :span="24">
+            <el-form-item label="看课域名">
+              <el-input
+                v-model="form.domain"
+                style="width: 250px"
+                placeholder="请生成域名"
+                @change="onDomainBlur"
+                disabled
+              ></el-input>
+              <el-button type="primary" style="margin-left: 20px" @click="generateDomain">生成域名</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>-->
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="备注">
+              <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </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="title" :visible.sync="bindCompanyOpen" width="700px" append-to-body>
+      <el-form ref="formBindCompany" :model="formBindCompany" :rules="bindCompanyRules" label-width="80px">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="企微主体" prop="corpId">
+              <el-select v-model="formBindCompany.corpId" placeholder="企微主体" size="small">
+                <el-option
+                  v-for="dict in myQwCompanyList"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="销售公司" prop="companyId">
+              <el-select filterable  v-model="formBindCompany.companyId" placeholder="请选择销售公司"  clearable size="small" @change="formBindCompanyChange">
+                <el-option
+                  v-for="item in companys"
+                  :key="item.companyId"
+                  :label="item.companyName"
+                  :value="item.companyId"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <div v-if="formBindCompany.companyId!=null">
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="归属部门" prop="deptId">
+                <treeselect v-model="formBindCompany.deptId" :options="deptOptionsByCompanyId" :show-count="true" placeholder="请选择归属部门" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="角色" prop="roleIds">
+                <el-select v-model="formBindCompany.roleIds" multiple placeholder="请选择">
+                  <el-option v-for="item in roleBindOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId "></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="销售区域" prop="addressId">
+              <el-select v-model="formBindCompany.addressId"  filterable placeholder="请选择所属销售的区域" style="width: 200px;">
+                <el-option
+                  v-for="item in citysAreaList"
+                  :key="item.cityId"
+                  :label="item.cityName"
+                  :value="item.cityId"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitBingCompanyForm">确 定</el-button>
+        <el-button @click="cancelBind">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 修改 selectUser 组件的引用 -->
+    <el-dialog :title="user.title" :visible.sync="user.open" width="1000px" append-to-body>
+      <selectUser ref="selectUser" @bindQwUser="bindQwUser" @close="handleSelectUserClose"/>
+    </el-dialog>
+
+    <el-dialog :title="companyUserArea.title" :visible.sync="companyUserArea.open" width="300px" append-to-body>
+      <el-select v-model="addressId"  filterable placeholder="请选择所属销售的区域" style="width: 200px;">
+        <el-option
+          v-for="item in citysAreaList"
+          :key="item.cityId"
+          :label="item.cityName"
+          :value="item.cityId"
+        ></el-option>
+      </el-select>
+      <div slot="footer" style="text-align: center;">
+        <el-button type="primary" @click="submitFormArea(addressId)">确 定</el-button>
+        <el-button @click="cancelArea">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 设置单独注册会员弹窗 -->
+    <!-- 设置单独注册会员 -->
+    <el-dialog title="设置单独注册会员" :visible.sync="registerOpen" width="400px" append-to-body>
+      <el-form ref="registerForm" :model="registerForm" label-width="160px">
+        <el-form-item label="是否开启单独注册">
+          <el-switch v-model="registerForm.status" :active-value="true" :inactive-value="false"></el-switch>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" @click="submitRegisterForm">确 定</el-button>
+          <el-button @click="registerOpen = false">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
+
+    <!-- 允许注册会员 -->
+    <el-dialog title="允许注册会员" :visible.sync="allowedAllRegisterOpen" width="400px" append-to-body>
+      <el-form ref="allowedAllRegisterForm" :model="allowedAllRegisterForm" label-width="160px">
+        <el-form-item label="是否允许注册会员">
+          <el-switch v-model="allowedAllRegisterForm.status" :active-value="true" :inactive-value="false"></el-switch>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button type="primary" @click="submitAllowedAllRegisterForm">确 定</el-button>
+          <el-button @click="allowedAllRegisterOpen = false">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
+
+    <el-dialog :title="bindCompanyUrl.title" v-if="bindCompanyUrl.open"  :visible.sync="bindCompanyUrl.open" width="450px"  append-to-body>
+      <div style="padding-bottom:15px;" >
+        <img :src="bindCompanyUrl.url" width="400px">
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="downloadImage(bindCompanyUrl.url, bindCompanyUrl.name+'.png')">下载二维码</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <div class="el-upload__tip" slot="tip">
+          </div>
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
+        </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 :title="doctor.title" :visible.sync="doctor.open" width="800px" append-to-body>
+      <selectDoctor ref="selectDoctor" @bindCompanyUserDoctorId="bindCompanyUserDoctorId"></selectDoctor>
+    </el-dialog>
+
+    <el-dialog title="请选择要新增的销售公司" :visible.sync="companyIdOpen.open" width="400px" append-to-body>
+      <el-form>
+        <el-form-item label="公司名" prop="companyId">
+          <el-select filterable  v-model="companyIdOpen.companyId" placeholder="请选择公司名"  clearable size="small">
+            <el-option
+              v-for="item in companys"
+              :key="item.companyId"
+              :label="item.companyName"
+              :value="item.companyId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryCompanyId">确定</el-button>
+          <el-button icon="el-icon-refresh" size="mini" @click="resetQueryCompanyId">取消</el-button>
+        </el-form-item>
+      </el-form>
+
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import {
+  qwList,
+  delUser,
+  addUser,
+  getUser,
+  updateUser,
+  exportUser,
+  resetUserPwd,
+  importTemplate,
+  getCitysAreaList,
+  changeUserStatus,
+  generateSubDomain,
+  setIsRegisterMember,
+  updateCompanyUserAreaList,
+  isAllowedAllRegister, unBindDoctorId, bindDoctorId, updateBatchUserRoles, addCodeUrl, addInfo
+} from '@/api/company/companyUserAll'
+import { getToken } from "@/utils/auth";
+import { treeselect } from "@/api/company/companyDept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {bindQwUser, addQwUser, getQwUserByIds,addQwUserName} from '@/api/qw/user';
+import { syncDept } from '@/api/qw/qwDept';
+import {getMyQwCompanyList } from "@/api/qw/user";
+import  selectUser  from "@/views/company/components/selectQwUser.vue";
+import { getConfigByKey } from "@/api/company/companyConfig";
+import axios from "axios";
+import selectDoctor from "@/views/qw/user/selectDoctor.vue";
+import { getCompanyList } from '@/api/company/company'
+export default {
+  name: "User",
+  components: {selectDoctor, Treeselect ,selectUser},
+  data() {
+    return {
+      companyIdOpen:{
+        open:null,
+        companyId:null,
+      },
+      companys:[],
+      doctor: {
+        open: false,
+        title: '绑定医生'
+      },
+      doctorForm: {
+        userId: null,
+        doctorId: null
+      },
+      uploadUrl: process.env.VUE_APP_BASE_API+"/company/CompanyUserAll/common/uploadOSS",
+      // 遮罩层
+      loading: false,
+      qwUserList:[],
+      qwUserId:[],
+      myQwCompanyList:[],
+      qwUser:[],
+      user:{
+        open:false,
+        title:"搜索企业"
+      },
+      // 选中数组
+      ids: [],
+
+      //允许注册会员
+      isAllowedAllRegister: [],
+
+      //是否单独注册
+      isNeedRegisterMember: [],
+      synform:{corpId:null},
+      synOpen:false,
+      synNameform:{corpId:null},
+      synNameOpen:false,
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 用户表格数据
+      userList: null,
+      // 弹出层标题
+      title: "",
+      // 部门树选项
+      deptOptions: undefined,
+      deptOptionsByCompanyId: undefined,
+      // 是否显示弹出层
+      open: false,
+      bindCompanyOpen: false,
+      qwOpen:false,
+      // 部门名称
+      deptName: undefined,
+      // 日期范围
+      dateRange: [],
+      // 状态数据字典
+      statusOptions: [],
+      // 性别状态字典
+      sexOptions: [],
+      // 岗位选项
+      postOptions: [],
+      // 角色选项
+      roleOptions: [],
+      roleBindOptions: [],
+      userTypeOptions:[
+        { "dictLabel": "临时管理员","dictValue": "02"},
+        { "dictLabel": "普通用户","dictValue": "01"}
+      ],
+      qwForm:{
+        id:null,
+        companyUserId:null,
+      },
+      companyUserArea:{
+        open:false,
+        title:"分配区域",
+      },
+      //选择的区域
+      addressId:null,
+
+      citysAreaList:[],
+      // 表单参数
+      form: {},
+      formBindCompany: {},
+
+      bindCompanyUrl:{
+        open:false,
+        title:"绑定/注册销售二维码",
+        name:null,
+        url:null,
+      },
+
+      form1: {},
+      defaultProps: {
+        children: "children",
+        label: "label",
+      },
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/company/CompanyUserAll/importCompanyUser",
+      },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userName: null,
+        companyId:null,
+        phonenumber: null,
+        status: null,
+        deptId: null,
+        qwStatus:null,
+      },
+      qwStatusOptions:[],
+      registerOpen: false,
+      registerForm: {
+        status: false,
+      },
+      // 表单校验
+      rules: {
+        userName: [
+          { required: true, message: "员工工号不能为空", trigger: "blur" },
+        ],
+        nickName: [
+          { required: true, message: "员工姓名不能为空", trigger: "blur" },
+        ],
+        deptId: [
+          { required: true, message: "归属部门不能为空", trigger: "blur" },
+        ],
+        addressId: [
+          { required: true, message: "销售所属区域不能为空", trigger: "blur" },
+        ],
+        password: [
+          { required: true, message: "员工密码不能为空", trigger: "blur" },
+          {
+            pattern: /^(?=.*[A-Za-z])(?=.*\d)(?=.*[^A-Za-z0-9]).{8,20}$/,
+            message: "密码长度为 8-20 位,必须包含字母、数字和特殊字符",
+            trigger: ["blur", "change"],
+          }
+        ],
+        idCard: [
+          { required: true, message: "身份证号不能为空", trigger: "blur" },
+        ],
+        // email: [
+        //   { required: true, message: "邮箱地址不能为空", trigger: "blur" },
+        //   {
+        //     type: "email",
+        //     message: "'请输入正确的邮箱地址",
+        //     trigger: ["blur", "change"],
+        //   },
+        // ],
+        phonenumber: [
+          { required: true, message: "手机号码不能为空", trigger: "blur" },
+          {
+            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
+            message: "请输入正确的手机号码",
+            trigger: "blur",
+          },
+        ],
+      },
+      // 表单校验
+      bindCompanyRules: {
+        companyId: [
+          { required: true, message: "销售公司不能为空", trigger: "blur" },
+        ],
+        deptId: [
+          { required: true, message: "归属部门不能为空", trigger: "blur" },
+        ],
+        addressId: [
+          { required: true, message: "销售所属区域不能为空", trigger: "blur" },
+        ],
+        roleIds: [
+          { required: true, message: "角色不能为空", trigger: "blur" },
+        ],
+        corpId: [
+          { required: true, message: "角色不能为空", trigger: "blur" },
+        ],
+      },
+      // 是否允许注册会员开关
+      allowedAllRegisterOpen: false,
+      allowedAllRegisterForm: {
+        status: true
+      },
+      // 在 data() 中添加
+      batchRoleDialogVisible: false,
+      selectedRoleIds: [],
+      batchRoleForm: {
+        userIds: [],
+        roleIds: []
+      },
+    };
+  },
+  watch: {
+    // 根据名称筛选部门树
+    deptName(val) {
+      this.$refs.tree.filter(val);
+    },
+  },
+  created() {
+    this.getList();
+    this.getTreeselect();
+    getCompanyList().then(response => {
+      this.companys = response.data;
+    });
+    this.getDicts("sys_normal_disable").then((response) => {
+      this.statusOptions = response.data;
+    });
+    this.getDicts("company_user_sex").then((response) => {
+      this.sexOptions = response.data;
+    });
+    this.getDicts("sys_qw_user_status").then(response => {
+          this.qwStatusOptions = response.data;
+    });
+    getConfigByKey("his.login").then(response => {
+      this.form1 =JSON.parse(response.data.configValue);
+    });
+    getCitysAreaList().then(res=>{
+      this.citysAreaList=res.data;
+    })
+    getMyQwCompanyList().then(response => {
+      this.myQwCompanyList = response.data;
+    });
+  },
+  methods: {
+    onDomainBlur() {
+      if (this.form.domain != null) {
+        let value = this.form.domain.trim();
+
+        // 强制只保留第一个 http://
+        const httpCount = (value.match(/http:\/\//g) || []).length;
+        if (httpCount > 1) {
+          value = value.replace(/(http:\/\/)+/, 'http://'); // 只留第一个
+        }
+
+        // 如果不是 http:// 开头,自动补充
+        if (!value.startsWith('http://')) {
+          value = 'http://' + value.replace(/^https?:\/\//, ''); // 去掉其他 http(s):// 再补
+        }
+
+        this.form.domain = value; // 重新赋值,保证输入正确
+
+        // 正则校验最终格式,提醒用户
+        const domainPattern = /^http:\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/;
+        if (!domainPattern.test(this.form.domain)) {
+          return this.$message.error('请输入正确格式的域名,如:http://xxx.xxx.com');
+        }
+      }
+    },
+
+    // 添加处理 selectUser 关闭的方法
+    handleSelectUserClose() {
+      this.user.open = false
+      // 如果 selectUser 组件有 clearSelection 方法,也可以调用
+      if (this.$refs.selectUser && typeof this.$refs.selectUser.clearSelection === 'function') {
+        this.$refs.selectUser.clearSelection()
+      }
+    },
+
+    // edit G start
+    // 修改 selectQwUser 方法
+    selectQwUser() {
+      this.user.open = true;
+      // 在下次DOM更新后设置已选中的项
+      this.$nextTick(() => {
+        if (this.$refs.selectUser && this.qwUserList.length > 0) {
+          // 将已选中的用户传递给子组件
+          this.$refs.selectUser.setSelectedUsers(this.qwUserList);
+        }
+      });
+    },
+
+    // 修改 bindQwUser 方法
+    bindQwUser(row) {
+      // this.user.open = false; // 暂时注释掉这行,改为在 handleBatchBind 中处理
+      if (!this.qwUserList.some(item => item.id == row.id)) {
+        this.qwUserList.push(row)
+      }
+      if (!this.qwUser.some(item => item == row.id)) {
+        this.qwUser.push(row.id)
+      }
+    },
+
+    // 修改 qwBind 方法
+    qwBind(row) {
+      this.qwUser = [];
+      this.qwUserList = [];
+      this.qwForm.companyUserId = row.userId;
+      getUser(row.userId).then((response) => {
+        if (response.data.qwUserId != null) {
+          // 保存已绑定的企微用户ID列表
+          this.qwUser = ((response.data.qwUserId).split(",").map(Number));
+          getQwUserByIds(this.qwUser).then(res => {
+            this.qwUserList = res.data;
+          });
+        }
+        // 先打开"绑定企微账号"对话框
+        this.qwOpen = true;
+      });
+    },
+
+    // 添加批量角色更新提交方法
+    submitBatchRoles() {
+      // 验证选择的角色
+      if (!this.selectedRoleIds || this.selectedRoleIds.length === 0) {
+        this.$message.warning("请至少选择一个角色");
+        return;
+      }
+
+      // 调用API批量更新用户角色
+      updateBatchUserRoles({ userIds: this.ids, roleIds: this.selectedRoleIds })
+        .then(response => {
+          if (response.code === 200) {
+            this.$message.success("批量修改角色成功");
+            this.batchRoleDialogVisible = false;
+            this.getList(); // 刷新列表
+          }
+        });
+    },
+    // edit G end
+
+    /** 查询用户列表 */
+    getList() {
+      this.loading = true;
+      qwList(this.addDateRange(this.queryParams, this.dateRange)).then(
+        (response) => {
+          this.userList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        }
+      );
+    },
+
+    handleClosegroupUser(list) {
+      const index = this.qwUser.findIndex(t => t === list);
+      if (index !== -1) {
+        this.qwUser.splice(index, 1);
+      }
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then((response) => {
+        this.deptOptions = response.data;
+      });
+    },
+
+    getTreeselectByCompanyId(companyId) {
+      treeselect({companyId}).then((response) => {
+        this.deptOptionsByCompanyId = response.data;
+      });
+    },
+
+    // 筛选节点
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.label.indexOf(value) !== -1;
+    },
+    // 节点单击事件
+    handleNodeClick(data) {
+      this.queryParams.deptId = data.id;
+      this.queryParams.companyId=data.companyId;
+      this.getList();
+    },
+    // 用户状态修改
+    handleStatusChange(row) {
+      let text = row.status === "0" ? "启用" : "停用";
+      this.$confirm(
+        '确认要"' + text + '""' + row.userName + '"用户吗?',
+        "警告",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }
+      )
+        .then(function() {
+          return changeUserStatus(row.userId, row.status);
+        })
+        .then(() => {
+          this.msgSuccess(text + "成功");
+        })
+        .catch(function() {
+          row.status = row.status === "0" ? "1" : "0";
+        });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    cancelBind() {
+      this.bindCompanyOpen = false;
+      this.resetBindCompany();
+    },
+
+    submitFormArea(address) {
+      const uIds = this.ids;
+
+      if (address == null) {
+        this.$message.error("请选择地区");
+        return;
+      }
+      updateCompanyUserAreaList({ userIds: uIds, addressId: address }).then(res => {
+        this.companyUserArea.open = false;
+        this.getList();
+        this.msgSuccess("操作成功");
+
+      })
+
+    },
+    cancelArea() {
+      this.companyUserArea.open = false;
+      this.addressId = null;
+    },
+    qwCancel() {
+      this.qwOpen = false;
+      this.qwUserId = null;
+    },
+
+    handerCompanyUserAreaList() {
+      this.companyUserArea.open = true;
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        userId: undefined,
+        deptId: undefined,
+        userName: undefined,
+        nickName: undefined,
+        password: undefined,
+        idCard: undefined,
+        phonenumber: undefined,
+        userType: "01",
+        email: undefined,
+        sex: undefined,
+        status: "0",
+        remark: undefined,
+        domain: null,
+        postIds: [],
+        roleIds: [],
+      };
+      this.resetForm("form");
+    },
+
+    resetBindCompany() {
+      this.formBindCompany = {
+        deptId: null,
+        addressId: null,
+        roleIds: [],
+        companyId: null,
+      };
+      this.resetForm("formBindCompany");
+    },
+
+    /** 搜索按钮操作 */
+    handleQueryCompanyId() {
+      if (this.companyIdOpen.companyId == null) {
+        return this.$message.warning("请选择公司");
+      }
+      this.reset();
+      this.getTreeselectByCompanyId(this.companyIdOpen.companyId);
+      addInfo(this.companyIdOpen.companyId).then((response) => {
+        this.postOptions = response.posts;
+        this.roleOptions = response.roles;
+        this.open = true;
+        this.title = "添加员工";
+        this.form.password = this.form1.loginPassword;
+      });
+    },
+
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.companyIdOpen.open=true;
+    },
+
+    /** 重置按钮操作 */
+    resetQueryCompanyId() {
+      this.companyIdOpen.companyId=null;
+      this.companyIdOpen.open=false;
+    },
+
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.page = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map((item) => item.userId);
+      this.isNeedRegisterMember = selection.map((item) => item.isNeedRegisterMember);
+      this.isAllowedAllRegister = selection.map((item) => item.isAllowedAllRegister);
+      this.single = selection.length != 1;
+      this.multiple = !selection.length;
+    },
+
+
+    handleBindCompanyUserCode() {
+      this.reset();
+      this.getTreeselect();
+
+      this.bindCompanyOpen = true;
+      this.title = "创建 新增/绑定销售 的二维码";
+
+    },
+
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const userId = row.userId || this.ids;
+      getUser(userId).then((response) => {
+        this.getTreeselectByCompanyId(response.data.companyId);
+        setTimeout(() => {
+          this.form = response.data;
+          this.postOptions = response.posts;
+          this.roleOptions = response.roles;
+          this.form.postIds = response.postIds;
+          this.form.roleIds = response.roleIds;
+          this.open = true;
+          this.title = "修改员工";
+          this.form.password = "";
+        }, 200);
+      });
+    },
+    /** 重置密码按钮操作 */
+    handleResetPwd(row) {
+      this.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        inputPlaceholder: "8-20 位,包含字母、数字和特殊字符",
+        inputValidator: (value) => {
+          const pattern = /^(?=.*[A-Za-z])(?=.*\d)(?=.*[^A-Za-z0-9]).{8,20}/;
+          const hasChinese = /[\u4e00-\u9fa5]/.test(value);
+          const hasFullWidth = /[!-~]/.test(value);
+
+          if (hasChinese) return '不能包含中文字符';
+          if (hasFullWidth) return '不能包含全角符号,请使用英文输入法';
+          if (!pattern.test(value)) return '密码格式错误:需包含字母、数字和英文特殊字符,长度为 8-20 位';
+
+          return true;
+        }
+      })
+        .then(({ value }) => {
+          resetUserPwd(row.userId, value).then((response) => {
+            if (response.code === 200) {
+              this.msgSuccess("修改成功,新密码是:" + value);
+            }
+          });
+        })
+        .catch(() => {
+        });
+    },
+    /** 提交按钮 */
+    submitForm: function() {
+
+      // this.onDomainBlur();
+
+      // const domainPattern = /^http:\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/;
+      // if (this.form.domain!=null && !domainPattern.test(this.form.domain)) {
+      //   this.$message.error('请输入正确格式的域名,如:http://xxx.xxx.com');
+      //   return;
+      // }
+
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (this.form.userId != undefined) {
+            updateUser(this.form).then((response) => {
+              if (response.code === 200) {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          } else {
+            addUser(this.form).then((response) => {
+              if (response.code === 200) {
+                this.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          }
+        }
+      });
+    },
+
+    downloadImage(imageSrc, fileName) {
+      const link = document.createElement('a');
+      link.href = imageSrc;
+      link.download = fileName || '绑定或新增销售.png';
+      document.body.appendChild(link);
+      link.click();
+      document.body.removeChild(link);
+    },
+
+    formBindCompanyChange(){
+
+
+        if (this.formBindCompany.companyId == null) {
+          return this.$message.warning("请选择公司");
+        }
+
+        this.getTreeselectByCompanyId(this.formBindCompany.companyId);
+
+        addInfo(this.formBindCompany.companyId).then((response) => {
+
+          this.formBindCompany.deptId= null;
+          this.formBindCompany.roleIds=[];
+
+          this.postOptions = response.posts;
+          this.roleBindOptions = response.roles;
+
+
+        });
+
+    },
+
+    submitBingCompanyForm: function() {
+
+      this.$refs["formBindCompany"].validate((valid) => {
+        if (valid) {
+
+          let loadingRock = this.$loading({
+            lock: true,
+            text: '生成二维码中~~请不要刷新页面!!',
+            spinner: 'el-icon-loading',
+            background: 'rgba(0, 0, 0, 0.7)'
+          });
+
+          addCodeUrl(this.formBindCompany).then((response) => {
+            this.bindCompanyOpen = false;
+            this.bindCompanyUrl.url = response.data.url
+            this.bindCompanyUrl.open = true;
+            this.bindCompanyUrl.name = "绑定或新增 销售二维码";
+          }).finally(res => {
+            loadingRock.close();
+          })
+        }
+      });
+    },
+    /**
+     * 同步企业微信员工
+     */
+    synSubmitForm() {
+      this.synOpen = false;
+      this.loading = true;
+      /*this.msgSuccess("");
+
+      let loadingRock = this.$loading({
+        lock: true,
+        text: '同步中.....请等待.....请不要重复点击!!',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });*/
+
+      addQwUser(this.synform.corpId).then(response => {
+        //this.msgSuccess("同步成功");
+        this.msgSuccess("正在同步中...");
+        this.getList();
+        this.synOpen = false;
+      }).finally(() => {
+        this.loading = false;
+        this.synOpen = false;
+        //loadingRock.close();
+      });
+    },
+
+    synNameSubmitForm() {
+      this.synNameOpen = false;
+      this.loading = true;
+
+      addQwUserName(this.synNameform.corpId).then(response => {
+        // this.msgSuccess("同步成功");
+        this.msgSuccess("正在同步中...");
+        this.getList();
+        this.synNameOpen = false;
+      }).finally(() => {
+        this.loading = false;
+        this.synNameOpen = false;
+        //loadingRock.close();
+      });
+    },
+    /**
+     * 同步企业微信部门
+     */
+    qwSyncDept() {
+      syncDept().then(response => {
+        this.msgSuccess("同步成功");
+        this.getList();
+      }).catch(() => {
+        this.msgError("同步失败:" + response.msg);
+      })
+    },
+
+    qwSubmitForm() {
+      let loadingRock = this.$loading({
+        lock: true,
+        text: '绑定中.....同步客户信息中.....',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      this.qwForm.id = (this.qwUser).join(',');
+      bindQwUser(this.qwForm).then(response => {
+        this.msgSuccess("绑定成功");
+        this.qwOpen = false;
+        this.getList();
+        this.qwUserId = null;
+        this.qwUser = [];
+      }).finally(res => {
+        loadingRock.close()
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+
+      const userIds = row.userId || this.ids;
+
+      // 筛选出 userType 为 '00' 的 userId
+      const excludedUserIds = this.userList
+        .filter(user => user.userType == '00')
+        .map(user => user.userId);
+
+      // 从 userIds 中剔除这些 userId
+      const finalUserIds = userIds.filter(userId =>
+        !excludedUserIds.includes(userId)
+      );
+
+      if (finalUserIds.length === 0) {
+        return this.msgInfo("除管理员外无其他的账号,请重新选择");
+      }
+
+      this.$confirm(
+        '是否确认删除员工编号为"' + finalUserIds + '"的数据项?【注意:删除后绑定的企业微信相关信息可能会错乱!!】',
+        "警告",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }
+      )
+        .then(function() {
+          return delUser(finalUserIds);
+        })
+        .then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+        .catch(function() {
+        });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm("是否确认导出所有用户数据项?", "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(function() {
+          return exportUser(queryParams);
+        })
+        .then((response) => {
+          this.download(response.msg);
+        })
+        .catch(function() {
+        });
+    },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = "用户导入";
+      this.upload.open = true;
+    },
+    /** 下载模板操作 */
+    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.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+      this.getList();
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
+    generateDomain() {
+      let queryParams;
+      if (this.form.userId) {
+        queryParams = {
+          'userId': this.form.userId,
+        }
+      }
+      generateSubDomain(queryParams).then(response => {
+        this.form.domain = response.data
+      });
+    },
+    /** 设置单独注册会员按钮操作 */
+    handleSetRegister() {
+      this.registerOpen = true;
+
+      if (this.isNeedRegisterMember && this.isNeedRegisterMember.some(item => item === 0)) {
+        this.registerForm.status = false;
+      } else {
+        this.registerForm.status = true;
+      }
+    },
+    /** 提交设置单独注册会员 */
+    submitRegisterForm() {
+      setIsRegisterMember({ status: this.registerForm.status }, this.ids).then(response => {
+        if (response.code === 200) {
+          this.msgSuccess("设置成功");
+          this.registerOpen = false;
+          this.getList();
+        }
+      });
+    },
+
+    /** 开关是否允许所有方式注册会员 */
+    handleAllowedAllRegister() {
+      this.allowedAllRegisterOpen = true;
+      if (this.isAllowedAllRegister && this.isAllowedAllRegister.some(item => item === 0)) {
+        this.allowedAllRegisterForm.status = false;
+      } else {
+        this.allowedAllRegisterForm.status = true;
+      }
+      // this.allowedAllRegisterForm.status = true;
+    },
+    // 提交
+    submitAllowedAllRegisterForm() {
+      isAllowedAllRegister({ status: this.allowedAllRegisterForm.status }, this.ids).then(response => {
+        if (response.code === 200) {
+          this.msgSuccess("操作成功");
+          this.allowedAllRegisterOpen = false;
+          this.getList();
+        }
+      });
+    },
+    /**
+     * 上传文件之前的钩子,参数为上传的文件,若返回 false 或者返回 Promise且被 reject,则停止上传。
+     * @param {File} file - 用户选择的文件对象
+     * @param {Object} row - 当前行的数据对象
+     */
+    beforeImageUpload(file, row) {
+      // 清除之前的错误信息
+      this.$set(row, 'uploadError', '');
+      const isJPG = file.type === 'image/jpeg';
+      const isPNG = file.type === 'image/png';
+      const isGIF = file.type === 'image/gif'; // 根据需要添加更多格式
+      const isValidFormat = isJPG || isPNG || isGIF;
+      const isLt2M = file.size / 1024 / 1024 < 2; // 限制图片大小为 2MB
+      if (!isValidFormat) {
+        const errorMsg = '上传二维码图片只能是 JPG/PNG/GIF 格式!';
+        this.$message.error(errorMsg);
+        this.$set(row, 'uploadError', errorMsg); // 在行内显示错误
+        return false;
+      }
+      if (!isLt2M) {
+        const errorMsg = '上传二维码图片大小不能超过 2MB!';
+        this.$message.error(errorMsg);
+        this.$set(row, 'uploadError', errorMsg); // 在行内显示错误
+        return false;
+      }
+      return true; // 校验通过,允许上传
+    },
+    /**
+     * 自定义上传方法
+     * @param {Object} options - Element UI upload 组件传递的参数,包含 file, onSuccess, onError, onProgress 等
+     * @param {Object} row - 当前行的数据对象
+     */
+    async handleCustomUpload(options, row) {
+
+      const file = options.file;
+      const formData = new FormData();
+      formData.append('file', file);
+
+      formData.append('userId', row.userId)
+
+      this.$set(row, 'uploading', true);
+      this.$set(row, 'uploadError', '');
+      try {
+        const response = await axios.post(this.uploadUrl, formData, {
+          headers: {
+            'Content-Type': 'multipart/form-data',
+          },
+          onUploadProgress: progressEvent => {
+            const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total);
+            console.log(`上传进度: ${percentCompleted}%`);
+          }
+        });
+        if (response.data && (response.data.url || (response.data.data && response.data.data.url))) {
+          const imageUrl = response.data.url || response.data.data.url;
+          this.$set(row, 'qrCodeWeixin', imageUrl); // 更新行数据中的图片URL
+          this.$message.success('图片上传成功!');
+          options.onSuccess(response.data, file); // 通知el-upload上传成功 (虽然我们自定义了,但调用一下也无妨)
+        } else {
+          const errorMsg = response.data.message || '图片上传失败,服务器未返回有效URL';
+          this.$message.error(errorMsg);
+          this.$set(row, 'uploadError', errorMsg);
+          options.onError(new Error(errorMsg), file); // 通知el-upload上传失败
+        }
+      } catch (error) {
+        console.error('上传失败:', error);
+        let errorMsg = '图片上传失败';
+        if (error.response && error.response.data && error.response.data.message) {
+          errorMsg = error.response.data.message;
+        } else if (error.message) {
+          errorMsg = error.message;
+        }
+        this.$message.error(errorMsg);
+        this.$set(row, 'uploadError', errorMsg);
+        options.onError(error, file); // 通知el-upload上传失败
+      } finally {
+        this.$set(row, 'uploading', false); // 无论成功失败,结束上传状态
+      }
+    },
+    requestUpload() {
+    },
+    beforeUpload() {
+      console.log(file.type)
+      const isPic =
+        file.type === 'image/jpeg' ||
+        file.type === 'image/png' ||
+        file.type === 'image/gif' ||
+        file.type === 'image/jpg' ||
+        file.type === 'audio/mpeg'
+      const isLt2M = file.size / 1024 / 1024 < 2
+      if (!isPic) {
+        this.$message.error('上传图片只能是 JPG、JPEG、PNG、GIF 格式!')
+        return false
+      }
+      if (!isLt2M) {
+        this.$message.error('上传头像图片大小不能超过 2MB!')
+      }
+      return isPic && isLt2M
+    },
+    handleUpdateDoctor(row) {
+      this.doctor.title = "绑定医生"
+      this.doctor.open = true;
+      this.doctorForm.userId = row.userId;
+    },
+    bindCompanyUserDoctorId(row) {
+      console.log(row)
+      this.doctorForm.doctorId = row;
+      bindDoctorId(this.doctorForm).then(res => {
+        if (res.code == 200) {
+          this.$message.success('绑定成功')
+        } else {
+          this.$message.error('绑定失败:', res.msg)
+        }
+        this.getList()
+        this.doctor.open = false;
+      })
+    },
+    handleUnBindUserId(val) {
+      this.$confirm(
+        '确认解绑医生:<span style="color: green;">' + val.nickName + '' +
+        '</span> 的医生?',
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
+        }
+      ).then(() => {
+        return unBindDoctorId(val.userId);
+      }).then(response => {
+        this.getList();
+        this.msgSuccess("解绑成功");
+      }).finally(res => {
+        this.getList();
+      })
+    },
+  },
+}
+</script>

+ 253 - 0
src/views/company/components/selectQwUser.vue

@@ -0,0 +1,253 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <!-- 现有表单内容保持不变 -->
+      <el-form-item label="企微主体" prop="corpId">
+        <el-select v-model="queryParams.corpId" placeholder="企微主体" size="small" @change="updateCorpId()">
+          <el-option
+            v-for="dict in myQwCompanyList"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="企微账号" prop="qwUserId">
+        <el-input
+          v-model="queryParams.qwUserId"
+          placeholder="请输入企微账号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="企微昵称" prop="qwUserName">
+        <el-input
+          v-model="queryParams.qwUserName"
+          placeholder="请输入企微昵称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </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-table
+      height="500"
+      border
+      v-loading="loading"
+      :data="customerList"
+      ref="customerList"
+      @selection-change="handleSelectionChange"
+    >
+      <!-- 添加多选列 -->
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="企微昵称" align="center" prop="qwUserName" />
+      <el-table-column label="企微账号" align="center" prop="qwUserId" />
+      <el-table-column label="企微所属部门" align="center" prop="departmentName" />
+      <el-table-column label="状态" align="center" prop="status" >
+        <template slot-scope="scope">
+          <dict-tag :options="qwStatusOptions" :value="scope.row.status"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="企微主体" align="center" prop="corpName" />
+    </el-table>
+
+    <div style="margin-top: 10px; text-align: right;">
+      <el-button type="primary" @click="handleBatchBind">确定</el-button>
+      <el-button @click="cancelSelect">取消选择</el-button>
+    </div>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { userList,getMyQwCompanyList } from '@/api/qw/user'
+
+export default {
+  name: "miniCustomer",
+  components: {},
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      myQwCompanyList:[],
+      qwStatusOptions:[],
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 员工表格数据
+      customerList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        qwUserId: null,
+        corpId: null,
+        qwUserName: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {},
+      // 多选数据
+      selectedUsers: [],
+      // 已选中的用户ID列表(用于初始化选中状态)
+      preSelectedUserIds: []
+    };
+  },
+  created() {
+    this.getDicts("sys_qw_user_status").then(response => {
+      this.qwStatusOptions = response.data;
+    });
+    getMyQwCompanyList().then(response => {
+      this.myQwCompanyList = response.data;
+      if(this.myQwCompanyList!=null){
+        this.queryParams.corpId=this.myQwCompanyList[0].dictValue
+        this.getList();
+      }
+    });
+  },
+  methods: {
+    updateCorpId(){
+      this.getList();
+    },
+    /** 查询客户列表 */
+    getList() {
+      this.loading = true;
+
+      userList(this.queryParams).then(response => {
+        this.customerList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+
+        // 在数据加载完成后设置已选中项
+        this.$nextTick(() => {
+          this.setPreSelectedItems();
+        });
+      });
+    },
+
+    // 设置预选中的项
+    setPreSelectedItems() {
+      if (this.preSelectedUserIds.length > 0 && this.customerList.length > 0) {
+        // 找到需要预选中的行
+        const selectedRows = this.customerList.filter(row =>
+          this.preSelectedUserIds.includes(row.id)
+        );
+
+        // 设置选中状态
+        this.$nextTick(() => {
+          selectedRows.forEach(row => {
+            this.$refs.customerList.toggleRowSelection(row, true);
+          });
+        });
+      }
+    },
+
+    // 多选处理
+    handleSelectionChange(selection) {
+      this.selectedUsers = selection;
+    },
+
+    // 批量绑定选择
+    handleBatchBind() {
+      if (this.selectedUsers.length === 0) {
+        this.$message.warning("请至少选择一个用户");
+        return;
+      }
+
+      // 发送所有选中的用户数据
+      this.selectedUsers.forEach(user => {
+        this.$emit("bindQwUser", user);
+      });
+
+      // 清空选择
+      this.clearSelection();
+      this.$emit('close'); // 通知父组件关闭对话框
+    },
+
+    // 添加一个新的方法用于清除选择
+    clearSelection() {
+      this.selectedUsers = [];
+      this.preSelectedUserIds = [];
+      if (this.$refs.customerList) {
+        this.$refs.customerList.clearSelection();
+      }
+    },
+
+    // 设置已选中的用户(由父组件调用)
+    setSelectedUsers(users) {
+      this.preSelectedUserIds = users.map(user => user.id);
+      this.selectedUsers = [...users];
+
+      // 如果数据已经加载,直接设置选中状态
+      if (this.customerList.length > 0) {
+        this.setPreSelectedItems();
+      }
+    },
+
+    // 取消选择
+    cancelSelect() {
+      this.$refs.customerList.clearSelection();
+      this.selectedUsers = [];
+    },
+
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+      this.clearSelection(); // 清除选择
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.queryParams.corpId= this.myQwCompanyList[0].dictValue;
+      this.handleQuery();
+    },
+  }
+};
+</script>
+
+<style>
+.el-tag + .el-tag {
+  margin-left: 10px;
+}
+.button-new-tag {
+  margin-left: 10px;
+  height: 32px;
+  line-height: 30px;
+  padding-top: 0;
+  padding-bottom: 0;
+}
+.input-new-tag {
+  width: 90px;
+  margin-left: 10px;
+  vertical-align: bottom;
+}
+.el-dialog__wrapper{
+  z-index: 100000;
+}
+</style>

+ 29 - 57
src/views/components/course/userCourseCatalogDetails.vue

@@ -43,7 +43,6 @@
     <el-table border v-loading="loading" :data="userCourseVideoList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="视频ID" align="center" prop="videoId" />
-      <!--      <el-table-column label="轮次" align="center" prop="round" />-->
       <el-table-column label="小节名称" align="center" show-overflow-tooltip prop="title" />
       <el-table-column label="视频文件名称" align="center" show-overflow-tooltip prop="fileName">
       </el-table-column>
@@ -95,32 +94,9 @@
         <el-form-item label="视频描述" prop="description">
           <el-input v-model="form.description" type="textarea" :rows="2" placeholder="请输入内容" />
         </el-form-item>
-        <!--        <el-form-item label="轮次" prop="round">-->
-        <!--          <el-input v-model="form.round"  placeholder="请输入内容" />-->
-        <!--        </el-form-item>-->
         <el-form-item label="课程排序" prop="courseSort">
           <el-input-number v-model="form.courseSort" :min="1"></el-input-number>
         </el-form-item>
-        <!--        <el-form-item label="看课时间" prop="timeRange" v-if="isPrivate === 1">-->
-        <!--          <el-time-picker-->
-        <!--            is-range-->
-        <!--            v-model="form.timeRange"-->
-        <!--            range-separator="至"-->
-        <!--            start-placeholder="开始时间"-->
-        <!--            value-format="HH:mm:ss"-->
-        <!--            end-placeholder="结束时间"-->
-        <!--            placeholder="选择时间范围">-->
-        <!--          </el-time-picker>-->
-        <!--        </el-form-item>-->
-        <!--        <el-form-item label="领取红包时间" prop="lastJoinTime" v-if="isPrivate === 1">-->
-        <!--          <el-time-picker-->
-        <!--            v-model="form.lastJoinTime"-->
-        <!--            :selectableRange="form.timeRange"-->
-        <!--            value-format="HH:mm:ss"-->
-        <!--            placeholder="选择时间范围">-->
-        <!--          </el-time-picker>-->
-        <!--          <p style="color: red;margin: 0;font-size: 12px">超过领取红包时间,只允许看课,不允许领取红包</p>-->
-        <!--        </el-form-item>-->
 
         <el-form-item label="视频缩略图" prop="thumbnail">
           <el-upload v-model="form.thumbnail" class="avatar-uploader" :action="uploadUrl" :show-file-list="false"
@@ -139,7 +115,6 @@
         <el-form-item label="课题选择" prop="questionBankId">
           <el-button size="small" type="primary" @click="chooseQuestionBank">选取课题</el-button>
           <el-table border width="100%" style="margin-top:5px;" :data="form.questionBankList">
-
             <el-table-column label="问题" align="center" prop="title">
               <template slot-scope="scope">
                 <el-tooltip class="item" effect="dark" :content="scope.row.title" placement="top">
@@ -199,7 +174,7 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item v-if="form.isProduct === 1"  label="结束售卖时间" prop="listingStartTime">
+            <el-form-item v-if="form.isProduct === 1" label="结束售卖时间" prop="listingStartTime">
               <el-input-number v-model="form.listingEndTime" :min="0" label="结束售卖时间"></el-input-number>
             </el-form-item>
           </el-col>
@@ -359,7 +334,7 @@ import draggable from 'vuedraggable'
 
 export default {
   name: "userCourseCatalog",
-  components: { VideoUpload, QuestionBank, CourseWatchComment, CourseProduct,draggable},
+  components: { VideoUpload, QuestionBank, CourseWatchComment, CourseProduct, draggable },
   data() {
     return {
       duration: null,
@@ -383,7 +358,6 @@ export default {
       videoUrl: "",
       uploadTypeOptions: [
         { dictLabel: "线路一", dictValue: 2 },
-
         { dictLabel: "线路二", dictValue: 3 },
       ],
       uploadLoading: false,
@@ -429,7 +403,7 @@ export default {
         open: false,
         loading: true,
         form: {},
-        select: [],
+        select: [], // 按用户选择顺序存储视频ID
         total: 0,
         queryParams: {
           pageNum: 1,
@@ -453,11 +427,11 @@ export default {
       single: true,
       // 非多个禁用
       multiple: true,
-      loading3:false,
-      openVideoSort:false,
+      loading3: false,
+      openVideoSort: false,
       // 表单参数
       form: {
-        courseProducts:[]
+        courseProducts: []
       },
       updateBatchData: {
         open: false,
@@ -546,7 +520,7 @@ export default {
 
     },
 
-    courseProductResult(val){
+    courseProductResult(val) {
       this.form.courseProducts = this.form.courseProducts || [];
       for (var i = 0; i < this.form.courseProducts.length; i++) {
         if (this.form.courseProducts[i].id == val.id) {
@@ -599,7 +573,6 @@ export default {
       } else if (this.form.uploadType == 3) {
         this.videoUrl = this.form.lineThree;
       }
-      // console.log("选择的video=======>>>>>>>",this.videoUrl)
     },
     // 视频库课题
     handleSelectProjects(projectIds) {
@@ -625,7 +598,7 @@ export default {
     },
     formatDuration(seconds) {
       if (seconds === null || seconds === undefined) {
-        return '未上传视频'; // 或者您可以根据具体需求返回其他默认值
+        return '未上传视频';
       }
       const hours = Math.floor(seconds / 3600);
       const minutes = Math.floor((seconds % 3600) / 60);
@@ -642,8 +615,7 @@ export default {
       if (res.code == 200) {
         this.form.thumbnail = res.url;
         this.$forceUpdate()
-      }
-      else {
+      } else {
         this.msgError(res.msg);
       }
     },
@@ -739,9 +711,18 @@ export default {
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
-    // 多选框选中数据
+    // 视频库多选框选中数据(按用户点击顺序记录)
     handVideoleSelectionChange(selection) {
-      this.addBatchData.select = selection.map(item => item.id);
+      // 提取当前选中的所有ID
+      const selectedIds = selection.map(item => item.id);
+      // 处理新增选中项:保留用户点击顺序
+      selectedIds.forEach(id => {
+        if (!this.addBatchData.select.includes(id)) {
+          this.addBatchData.select.push(id);
+        }
+      });
+      // 处理取消选中项:移除已取消的ID
+      this.addBatchData.select = this.addBatchData.select.filter(id => selectedIds.includes(id));
     },
     handleAdd() {
       this.reset();
@@ -816,13 +797,6 @@ export default {
             });
             return
           }
-          // if(this.form.uploadType==null){
-          //   this.$message({
-          //     message: '请选择播放线路!',
-          //     type: 'warning'
-          //   });
-          //   return
-          // }
           if (this.form.questionBankList !== null) {
             this.form.questionBankId = this.form.questionBankList.map(item => item.id).join(',');
           }
@@ -880,15 +854,15 @@ export default {
       }).catch(() => { });
     },
 
-    handleCourseSort(){
+    handleCourseSort() {
 
       getVideoListByCourseIdAll(this.queryParams.courseId).then(response => {
 
         response.rows.forEach((item) => item.newCourseSort = item.courseSort);
         this.userCourseVideoSortList = response.rows.sort((a, b) => a.courseSort - b.courseSort);
-        if (this.userCourseVideoSortList==null || this.userCourseVideoSortList.length==0){
+        if (this.userCourseVideoSortList == null || this.userCourseVideoSortList.length == 0) {
           this.$message.error("暂无课节天数")
-        }else {
+        } else {
           this.openVideoSort = true;
         }
       })
@@ -904,19 +878,15 @@ export default {
     },
 
     saveSorts() {
-
-      console.log("this.userCourseVideoSortList",this.userCourseVideoSortList)
       let list = this.userCourseVideoSortList.filter(e => e.courseSort != e.newCourseSort).map(e => {
-        return {courseSort: e.newCourseSort, videoId: e.videoId}
+        return { courseSort: e.newCourseSort, videoId: e.videoId }
       })
-      console.log("this.userCourseVideoSortList",this.userCourseVideoSortList)
       this.loading3 = true;
-      console.log("list",list)
       sortCourseVideo(list).then(e => {
         this.getList();
       }).finally(() => {
-        this.userCourseVideoSortList=[];
-        this.openVideoSort=false;
+        this.userCourseVideoSortList = [];
+        this.openVideoSort = false;
       })
     },
 
@@ -926,6 +896,8 @@ export default {
       this.addBatchData.form = {
         courseId: this.courseId,
       };
+      // 重置选择顺序数组
+      this.addBatchData.select = [];
       this.resourceList();
     },
     getRootTypeList() {
@@ -959,7 +931,7 @@ export default {
         });
         return
       }
-      this.addBatchData.form.ids = this.addBatchData.select;
+      this.addBatchData.form.ids = this.addBatchData.select; // 按用户选择顺序提交
       batchSaveVideo(this.addBatchData.form).then(response => {
         this.addBatchData.open = false;
         this.getList();

+ 691 - 292
src/views/components/his/integralOrderDetails.vue

@@ -1,348 +1,747 @@
 <template>
-    <div style="background-color: #f0f2f5; padding-bottom: 20px; min-height: 100%; " >
-      <div style="padding: 20px; background-color: #fff;">
-         积分订单详情
+  <div style="background-color: #f0f2f5; padding-bottom: 20px; min-height: 100%; ">
+    <div style="padding: 20px; background-color: #fff;">
+      积分订单详情
+    </div>
+    <div class="contentx" v-if="item != null">
+      <div class="desct"> 积分订单信息</div>
+      <div class="order-status" v-if="item != null && item.status != 5">
+        <el-steps :active="getStepActive(item.status)" align-center finish-status="success">
+          <el-step title="待支付"></el-step>
+          <el-step title="待发货"></el-step>
+          <el-step title="待收货"></el-step>
+          <el-step title="已完成"></el-step>
+        </el-steps>
       </div>
-<div class="contentx" v-if="item!=null">
-        <div class="desct"> 积分订单信息</div>
-        <div class="order-status" v-if="item!=null && item.status != 5" >
-                  <el-steps  :active="item.status==4?0:item.status" align-center finish-status="success">
-                    <el-step title="待支付"></el-step>
-                    <el-step title="待发货"></el-step>
-                    <el-step title="待收货"></el-step>
-                    <el-step title="已完成"></el-step>
-                  </el-steps>
+      <el-card shadow="never" style="margin-top: 15px">
+        <div class="operate-container" v-if="item != null">
+          <span style="margin-left: 20px" class="color-danger">订单状态:
+            <el-tag prop="status" v-for="(ite, index) in statusOptions" v-if="item.status == ite.dictValue">{{
+              ite.dictLabel }}</el-tag>
+          </span>
+          <div class="operate-button-container" v-if="item.status == 1" v-hasPermi="['his:integralOrder:sendGoods']">
+            <!-- <el-button size="mini" @click="sendVisible=true" >发货</el-button> -->
+            <el-button size="mini" @click="showSend()">发货</el-button>
+          </div>
+          <div class="operate-button-container" v-if="item.deliverySn != null"
+            v-hasPermi="['his:integralOrder:express']">
+            <el-button size="mini" @click="showExpress()">查看物流</el-button>
+          </div>
+
+          <div class="operate-button-container" v-if="item.status!=-1" v-hasPermi="['his:integralOrder:edit']">
+            <el-button size="mini" @click="updateOrder()">修改订单</el-button>
+          </div>
+
+          <div class="operate-button-container" v-if="item.status==2">
+            <el-button size="mini" @click="handleFinishOrder">确认收货</el-button>
+          </div>
+          <div class="operate-button-container" v-if="item.status>1" v-hasPermi="['his:integralOrder:cancel']">
+            <el-button size="mini" @click="applyRefund">申请退款</el-button>
+          </div>
         </div>
-         <el-card shadow="never" style="margin-top: 15px">
-           <div class="operate-container"  v-if="item!=null">
-             <span style="margin-left: 20px" class="color-danger">订单状态:
-                <el-tag prop="status" v-for="(ite, index) in statusOptions"    v-if="item.status==ite.dictValue">{{ite.dictLabel}}</el-tag>
-             </span>
-             <div class="operate-button-container"  v-if="item.status==1" v-hasPermi="['his:integralOrder:sendGoods']">
-                <!-- <el-button size="mini" @click="sendVisible=true" >发货</el-button> -->
-                <el-button size="mini" @click="showSend()" >发货</el-button>
-             </div>
-            <div class="operate-button-container"   v-if="item.deliverySn!=null" v-hasPermi="['his:integralOrder:express']">
-              <el-button size="mini" @click="showExpress()" >查看物流</el-button>
-            </div>
+        <div class="desct">
+          基本信息
+        </div>
+        <el-descriptions title="" :column="3" border>
+          <el-descriptions-item label="订单编号"><span v-if="item != null">{{ item.orderCode
+              }}</span></el-descriptions-item>
+          <el-descriptions-item label="会员ID"><span v-if="item != null">{{ item.userId }}</span></el-descriptions-item>
+          <el-descriptions-item label="会员"><span v-if="item.nickName != null">{{ item.nickName }}({{ item.phone
+              }})</span></el-descriptions-item>
+          <el-descriptions-item label="用户名称"><span v-if="item != null">{{ item.userName }}</span></el-descriptions-item>
+          <el-descriptions-item label="用户电话"><span v-if="item != null">{{ item.userPhone }}</span>
+            <el-button icon="el-icon-search" size="mini" @click="handlePhone()" style="margin-left: 20px;" circle
+              v-hasPermi="['his:integralOrder:queryPhone']"></el-button>
+          </el-descriptions-item>
+          <el-descriptions-item label="用户地址"><span v-if="item != null">{{ item.userAddress
+              }}</span></el-descriptions-item>
+          <el-descriptions-item label="支付积分"><span v-if="item != null">{{ item.integral }}</span></el-descriptions-item>
+          <el-descriptions-item label="状态"><span v-if="item != null"> <dict-tag :options="statusOptions"
+                :value="item.status" /></span></el-descriptions-item>
+          <el-descriptions-item label="快递公司编号"><span v-if="item != null">{{ item.deliveryCode
+              }}</span></el-descriptions-item>
+          <el-descriptions-item label="快递名称"><span v-if="item != null">{{ item.deliveryName
+              }}</span></el-descriptions-item>
+          <el-descriptions-item label="快递单号"><span v-if="item != null">{{ item.deliverySn
+              }}</span></el-descriptions-item>
+          <el-descriptions-item label="发货时间"><span v-if="item != null">{{ item.deliveryTime
+              }}</span></el-descriptions-item>
+          <el-descriptions-item label="提交时间"><span v-if="item != null">{{ item.createTime
+              }}</span></el-descriptions-item>
+        </el-descriptions>
+      </el-card>
 
-            <div class="operate-button-container"  v-hasPermi="['his:integralOrder:edit']">
-              <el-button size="mini" @click="updateOrder()" >修改订单</el-button>
-            </div>
-           </div>
-           <div class="desct">
-            基本信息
-           </div>
-           <el-descriptions title="" :column="3" border>
-             <el-descriptions-item label="订单编号"><span v-if="item!=null">{{item.orderCode}}</span></el-descriptions-item>
-              <el-descriptions-item label="会员ID"><span v-if="item!=null">{{item.userId}}</span></el-descriptions-item>
-             <el-descriptions-item label="会员"><span v-if="item.nickName!=null">{{item.nickName}}({{item.phone}})</span></el-descriptions-item>
-             <el-descriptions-item label="用户名称"><span v-if="item!=null">{{item.userName}}</span></el-descriptions-item>
-             <el-descriptions-item label="用户电话"><span v-if="item!=null">{{item.userPhone}}</span>
-              <el-button icon="el-icon-search" size="mini" @click="handlePhone()" style="margin-left: 20px;" circle v-hasPermi="['his:integralOrder:queryPhone']"></el-button>
-            </el-descriptions-item>
-              <el-descriptions-item label="用户地址"><span v-if="item!=null">{{item.userAddress}}</span></el-descriptions-item>
-             <el-descriptions-item label="支付积分"><span v-if="item!=null">{{item.integral}}</span></el-descriptions-item>
-             <el-descriptions-item label="状态"><span v-if="item!=null"> <dict-tag :options="statusOptions" :value="item.status"/></span></el-descriptions-item>
-             <el-descriptions-item label="快递公司编号"><span v-if="item!=null">{{item.deliveryCode}}</span></el-descriptions-item>
-             <el-descriptions-item label="快递名称"><span v-if="item!=null">{{item.deliveryName}}</span></el-descriptions-item>
-             <el-descriptions-item label="快递单号"><span v-if="item!=null">{{item.deliverySn}}</span></el-descriptions-item>
-             <el-descriptions-item label="发货时间"><span v-if="item!=null">{{item.deliveryTime}}</span></el-descriptions-item>
-             <el-descriptions-item label="提交时间"><span v-if="item!=null">{{item.createTime}}</span></el-descriptions-item>
-           </el-descriptions>
-         </el-card>
+    </div>
+    <div class="contentx" v-if="item != null" style="padding-bottom: 70px;">
+      <div class="desct">
+        商品信息
+      </div>
+      <el-table border v-if="prod != null" :data="prod" size="small" style="margin-top: 20px">
+        <el-table-column label="商品图片" align="center">
+          <template slot-scope="scope">
+            <img :src="scope.row.imgUrl" style="height: 80px">
+          </template>
+        </el-table-column>
+        <el-table-column label="商品名称" align="center">
+          <template slot-scope="scope">
+            <p>{{ scope.row.goodsName }}</p>
+          </template>
+        </el-table-column>
+        <el-table-column label="积分" align="center">
+          <template slot-scope="scope">
+            <p>¥{{ scope.row.integral }}</p>
+          </template>
+        </el-table-column>
+        <el-table-column label="金额" align="center">
+          <template slot-scope="scope">
+            <p>¥{{ scope.row.cash || 0 }}</p>
+          </template>
+        </el-table-column>
 
+      </el-table>
     </div>
-      <div class="contentx" v-if="item!=null" style="padding-bottom: 70px;">
-       <div class="desct">
-           商品信息
-          </div>
-       <el-table
-              border
-              v-if="prod!=null"
-              :data="prod"
-              size="small"
-              style="margin-top: 20px" >
-              <el-table-column label="商品图片"  align="center">
-                <template slot-scope="scope">
-                  <img :src="scope.row.imgUrl" style="height: 80px">
-                </template>
-              </el-table-column>
-              <el-table-column label="商品名称"  align="center">
-                <template slot-scope="scope">
-                  <p>{{scope.row.goodsName}}</p>
-                </template>
-              </el-table-column>
-              <el-table-column label="积分" align="center">
+    <el-dialog width="50%" title="发货" :visible.sync="sendVisible" append-to-body @close="sendCancel">
+      <el-form ref="form" :model="form" label-width="120px">
+        <el-form-item label="快递名称" prop="deliveryName">
+          <el-select v-model="selectedExpress" placeholder="请选择快递名称" value-key="name">
+            <el-option v-for="item in expressOption" :key="item.name" :label="item.name" :value="item">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="快递公司编号" prop="deliveryCode">
+          <el-input v-model="form.deliveryCode" placeholder="请输入快递公司编号" disabled />
+
+        </el-form-item>
+
+        <el-form-item label="快递单号" prop="deliverySn">
+          <el-input v-model="form.deliverySn" placeholder="请输入快递单号" />
+        </el-form-item>
+
+        <!-- 代服账号选择表格 -->
+        <el-form-item label="代服账号选择" prop="selectedAccount" required>
+          <div style="border: 1px solid #e6ebf5; border-radius: 4px; padding: 10px;">
+            <el-table ref="accountTable" :data="tableData" highlight-current-row
+              @current-change="handleAccountSelectionChange" style="width: 100%" size="small" max-height="400">
+              <!-- 固定高度,超出滚动 -->
+
+              <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
+              <el-table-column prop="loginAccount" label="登录账号" align="center" width="120"
+                show-overflow-tooltip></el-table-column>
+              <el-table-column prop="monthlyCard" label="月结账号" align="center" width="120"
+                show-overflow-tooltip></el-table-column>
+              <el-table-column prop="expressProductCode" label="物流产品" align="center" width="120" show-overflow-tooltip>
                 <template slot-scope="scope">
-                  <p>¥{{scope.row.integral}}</p>
+                  <dict-tag :options="expressOptions" :value="scope.row.expressProductCode" />
                 </template>
               </el-table-column>
-              <el-table-column label="金额" align="center">
-               <template slot-scope="scope">
-                 <p>¥{{scope.row.cash || 0}}</p>
-               </template>
-              </el-table-column>
+              <el-table-column prop="senderName" label="寄件人姓名" align="center" width="100"></el-table-column>
+              <el-table-column prop="senderPhone" label="寄件人手机" align="center" width="120"></el-table-column>
+              <el-table-column prop="senderProvince" label="寄件人省" align="center" width="100"
+                show-overflow-tooltip></el-table-column>
+              <el-table-column prop="senderCity" label="寄件人市" align="center" width="100"
+                show-overflow-tooltip></el-table-column>
+              <el-table-column prop="senderDistrict" label="寄件人区" align="center" width="100"
+                show-overflow-tooltip></el-table-column>
+              <el-table-column prop="senderAddress" label="寄件人地址" align="center" min-width="150"
+                show-overflow-tooltip></el-table-column>
 
             </el-table>
-       </div>
-      <el-dialog
-           width="50%"
-           title="发货"
-           :visible.sync="sendVisible"
-           append-to-body @close="sendCancel">
-        <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-          <el-form-item label="快递名称" prop="deliveryName">
-            <el-select v-model="selectedExpress" placeholder="请选择快递名称" value-key="name">
-              <el-option
-                v-for="item in expressOption"
-                :key="item.name"
-                :label="item.name"
-                :value="item">
-              </el-option>
-            </el-select>
-          </el-form-item>
-          <el-form-item label="快递公司编号" prop="deliveryCode">
-            <el-input v-model="form.deliveryCode" placeholder="请输入快递公司编号" disabled />
-            
-          </el-form-item>
-          
-          <el-form-item label="快递单号" prop="deliverySn">
-            <el-input v-model="form.deliverySn" placeholder="请输入快递单号" />
-          </el-form-item>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-                          <el-button type="primary" @click="sendGoods">确 定</el-button>
-                          <el-button @click="sendCancel">取 消</el-button>
-        </div>
 
-          </el-dialog>
+            <!-- 分页 -->
+            <el-pagination small layout="prev, pager, next" :total="total" :page-size="queryParams.pageSize"
+              :current-page="queryParams.pageNum" @current-change="handlePageChange"
+              style="margin-top: 10px; text-align: center;">
+            </el-pagination>
 
-          <el-dialog :title="expressDialog.title" :visible.sync="expressDialog.open" width="600px" append-to-body>
-            <el-table style="margin-top: 20px;width: 100%"
-                      ref="orderHistoryTable"
-                      :data="traces" border>
-              <el-table-column label="操作时间"  width="160" align="center">
-                <template slot-scope="scope">
-                  {{scope.row.AcceptTime}}
-                </template>
-              </el-table-column>
-               <el-table-column label="位置" align="center">
-                <template slot-scope="scope">
-                  {{scope.row.Location}}
-                </template>
-              </el-table-column>
-              <el-table-column label="描述" align="center">
+            <div style="margin-top: 10px; color: #909399; font-size: 12px; text-align: center;">
+              提示:点击表格行选择代服账号
+            </div>
+
+            <!-- 显示选中信息 -->
+            <div v-if="selectedRow" style="margin-top: 10px; padding: 8px; background: #f5f7fa; border-radius: 4px;">
+              <span style="color: #67C23A;">已选择:</span>
+              <span>{{ selectedRow.loginAccount }} ({{ selectedRow.senderName }})</span>
+            </div>
+          </div>
+        </el-form-item>
+
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="sendGoods">确 定</el-button>
+        <el-button @click="sendCancel">取 消</el-button>
+      </div>
+
+    </el-dialog>
+
+    <el-dialog :title="expressDialog.title" :visible.sync="expressDialog.open" width="600px" append-to-body>
+      <el-table style="margin-top: 20px;width: 100%" ref="orderHistoryTable" :data="traces" border>
+        <el-table-column label="操作时间" width="160" align="center">
+          <template slot-scope="scope">
+            {{ scope.row.AcceptTime }}
+          </template>
+        </el-table-column>
+        <el-table-column label="位置" align="center">
+          <template slot-scope="scope">
+            {{ scope.row.Location }}
+          </template>
+        </el-table-column>
+        <el-table-column label="描述" align="center">
+          <template slot-scope="scope">
+            {{ scope.row.AcceptStation }}
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
+
+    <el-dialog :title="editOrder.title" :visible.sync="editOrder.open" width="600px" append-to-body>
+      <el-form ref="editForm" :model="editForm" :rules="editRules" label-width="100px">
+        <el-form-item label="订单状态" prop="status">
+          <el-select v-model="editForm.status" placeholder="请选择状态" clearable size="small" filterable>
+            <el-option v-for="dict in statusOptions" :key="dict.dictValue" :label="dict.dictLabel"
+              :value="dict.dictValue" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="详情地址" prop="userAddress">
+          <el-input v-model="editForm.userAddress" placeholder="请输入" />
+        </el-form-item>
+
+        <!-- 修改:快递信息改为下拉选择 -->
+        <el-form-item label="快递名称" prop="deliveryName">
+          <el-select v-model="editSelectedExpress" placeholder="请选择快递名称" value-key="name" clearable>
+            <el-option v-for="item in expressOption" :key="item.name" :label="item.name" :value="item">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="快递公司编号" prop="deliveryCode">
+          <el-input v-model="editForm.deliveryCode" placeholder="快递公司编号" disabled />
+        </el-form-item>
+        <el-form-item label="快递单号" prop="deliverySn">
+          <el-input v-model="editForm.deliverySn" placeholder="请输入快递单号" />
+        </el-form-item>
+
+        <!-- 代服账号选择表格 - 使用同一个数据源 -->
+        <el-form-item label="代服账号" prop="loginAccount">
+          <div style="border: 1px solid #e6ebf5; border-radius: 4px; padding: 10px;">
+            <el-table ref="editAccountTable" :data="tableData" highlight-current-row
+              @current-change="handleEditAccountSelectionChange" style="width: 100%" size="small" max-height="300">
+
+              <!-- 列定义与发货弹窗相同 -->
+              <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
+              <el-table-column prop="loginAccount" label="登录账号" align="center" width="120"
+                show-overflow-tooltip></el-table-column>
+              <el-table-column prop="monthlyCard" label="月结账号" align="center" width="120"
+                show-overflow-tooltip></el-table-column>
+              <el-table-column prop="expressProductCode" label="物流产品" align="center" width="120" show-overflow-tooltip>
                 <template slot-scope="scope">
-                  {{scope.row.AcceptStation}}
+                  <dict-tag :options="expressOptions" :value="scope.row.expressProductCode" />
                 </template>
               </el-table-column>
+              <el-table-column prop="senderName" label="寄件人姓名" align="center" width="100"></el-table-column>
+              <el-table-column prop="senderPhone" label="寄件人手机" align="center" width="120"></el-table-column>
+              <el-table-column prop="senderProvince" label="寄件人省" align="center" width="100"
+                show-overflow-tooltip></el-table-column>
+              <el-table-column prop="senderCity" label="寄件人市" align="center" width="100"
+                show-overflow-tooltip></el-table-column>
+              <el-table-column prop="senderDistrict" label="寄件人区" align="center" width="100"
+                show-overflow-tooltip></el-table-column>
+              <el-table-column prop="senderAddress" label="寄件人地址" align="center" min-width="150"
+                show-overflow-tooltip></el-table-column>
+
             </el-table>
-          </el-dialog>
-
-          <el-dialog :title="editOrder.title" :visible.sync="editOrder.open" width="600px" append-to-body>
-            <el-form ref="editForm" :model="editForm" :rules="editRules" label-width="100px">
-              <el-form-item label="订单状态" prop="status" >
-                <el-select v-model="editForm.status" placeholder="请选择状态" clearable size="small" filterable>
-                    <el-option
-                      v-for="dict in statusOptions "
-                      :key="dict.dictValue"
-                      :label="dict.dictLabel"
-                      :value="dict.dictValue"
-                    />
-                  </el-select>
-                </el-form-item>
-              <el-form-item label="详情地址" prop="userAddress"  >
-                <el-input v-model="editForm.userAddress" placeholder="请输入" />
-              </el-form-item>
-              <el-form-item label="备注" prop="remark"  >
-                <el-input v-model="editForm.remark" placeholder="请输入备注" />
-              </el-form-item>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-              <el-button type="primary" @click="submitEditForm">确 定</el-button>
+
+            <!-- 分页 - 使用同一个分页数据 -->
+            <el-pagination small layout="prev, pager, next" :total="total" :page-size="queryParams.pageSize"
+              :current-page="queryParams.pageNum" @current-change="handlePageChange"
+              style="margin-top: 10px; text-align: center;">
+            </el-pagination>
+
+            <div style="margin-top: 10px; color: #909399; font-size: 12px; text-align: center;">
+              提示:点击表格行选择代服账号
             </div>
-          </el-dialog>
-    </div>
+
+            <!-- 显示选中信息 -->
+            <div v-if="editSelectedRow"
+              style="margin-top: 10px; padding: 8px; background: #f5f7fa; border-radius: 4px;">
+              <span style="color: #67C23A;">已选择:</span>
+              <span>{{ editSelectedRow.loginAccount }} ({{ editSelectedRow.senderName }})</span>
+            </div>
+          </div>
+        </el-form-item>
+
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="editForm.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitEditForm">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-import {getExpress, listIntegralOrder, sendgoods,getIntegralOrder, delIntegralOrder, addIntegralOrder, updateIntegralOrder, exportIntegralOrder,getOrderUserPhone } from "@/api/his/integralOrder";
-import {getExpressList } from "@/api/his/express";
-  export default {
-    name: "integralOrder",
-    data() {
-      return {
-        selectedExpress:null,
-        expressOption:[],
-        expressDialog:{
-          title:"物流信息",
-          open:false,
-        },
-        editOrder:{
-          title:"修改订单",
-          open:false,
-        },
-        editForm:{
-          orderId:null,
-          status:null,
-          userAddress:null,
-          remark:"",
-        },
-        editRules:{},
-        item:null,
-        express:null,
-        traces:[],
-        rules:{
-      deliveryCode: [
-        { required: true, message: '请输入快递公司编号', trigger: 'blur' }
-      ],
-      deliveryName: [
-        { required: true, message: '请输入快递名称', trigger: 'blur' }
-      ],
-      deliverySn: [
-        { required: true, message: '请输入快递单号', trigger: 'blur' }
-      ]
+import { getExpress,mandatoryRefunds,finishOrder, listIntegralOrder, sendgoods, getIntegralOrder, delIntegralOrder, addIntegralOrder, updateIntegralOrder, exportIntegralOrder, getOrderUserPhone } from "@/api/his/integralOrder";
+import { getExpressList } from "@/api/his/express";
+import { listAccount } from "@/api/his/dfAccount";
+export default {
+  name: "integralOrder",
+  data() {
+    return {
+      selectedExpress: null,
+      expressOption: [],
+      expressDialog: {
+        title: "物流信息",
+        open: false,
+      },
+      editOrder: {
+        title: "修改订单",
+        open: false,
+      },
+      editForm: {
+        orderId: null,
+        status: null,
+        userAddress: null,
+        remark: "",
+        loginAccount: null,
+        // 新增快递相关字段
+        deliveryName: null,
+        deliveryCode: null,
+        deliverySn: null
+      },
+      editRules: {
+        deliveryName: [
+          { required: false, message: '请输入快递名称', trigger: 'blur' }
+        ],
+        deliveryCode: [
+          { required: false, message: '请输入快递公司编号', trigger: 'blur' }
+        ],
+        deliverySn: [
+          { required: false, message: '请输入快递单号', trigger: 'blur' }
+        ]
+      },
+      item: null,
+      express: null,
+      traces: [],
+      rules: {
+        deliveryCode: [
+          { required: true, message: '请输入快递公司编号', trigger: 'blur' }
+        ],
+        deliveryName: [
+          { required: true, message: '请输入快递名称', trigger: 'blur' }
+        ],
+        deliverySn: [
+          { required: true, message: '请输入快递单号', trigger: 'blur' }
+        ],
+        selectedAccount: [  // 添加这一项
+          { required: true, message: '请选择代服账号', trigger: 'change' }
+        ]
+      },
+      sendVisible: false,
+      form: {
+        deliveryCode: null,
+        deliveryName: null,
+        deliverySn: null,
+        orderId: null,
+        loginAccount: null  // 在 form 中也添加这个字段
+      },
+      tableData: [], // 清空模拟数据,改为空数组
+      selectedRow: null,
+      editSelectedRow: null, // 修改订单弹窗选中的行
+      queryParams: { // 查询参数
+        pageNum: 1,
+        pageSize: 10
+      },
+      total: 0, // 总条数,
+      expressOptions: [], // 物流产品字典
+      editSelectedExpress: null,
+    }
+  },
+  created() {
+    this.getDicts("sys_integral_order_status").then(response => {
+      this.statusOptions = response.data;
+    });
+    this.getDicts("df_account_express").then(response => {
+      this.expressOptions = response.data;
+    });
+  },
+  watch: {
+    selectedExpress(newVal) {
+      console.log('选中的快递:', newVal); // 调试用
+      if (newVal && newVal.name && newVal.code) {
+        this.form.deliveryName = newVal.name;
+        this.form.deliveryCode = newVal.code;
+      } else {
+        this.form.deliveryName = '';
+        this.form.deliveryCode = '';
+      }
     },
-        sendVisible:false,
-        form: {
-          deliveryCode: null,
-          deliveryName:null,
-          deliverySn:null,
-          orderId:null,
+    // 新增:修改订单弹窗的快递选择监听
+    editSelectedExpress(newVal) {
+      console.log('修改订单弹窗选中的快递:', newVal);
+      if (newVal && newVal.name && newVal.code) {
+        this.editForm.deliveryName = newVal.name;
+        this.editForm.deliveryCode = newVal.code;
+      } else {
+        this.editForm.deliveryName = '';
+        this.editForm.deliveryCode = '';
+      }
+    },
+    'editOrder.open': function (newVal) {
+      if (!newVal) {
+        // 修改订单弹窗关闭时清理选择状态
+        this.editSelectedRow = null;
+        if (this.$refs.editAccountTable) {
+          this.$refs.editAccountTable.setCurrentRow();
         }
       }
     },
-    created() {
-      this.getDicts("sys_integral_order_status").then(response => {
-        this.statusOptions = response.data;
-      });
+    'expressDialog.open': function (newVal) {
+      if (!newVal) {
+        // 查看物流弹窗关闭时清理数据
+        this.express = null;
+        this.traces = [];
+      }
     },
-    watch: {
-      selectedExpress(newVal) {
-        if (newVal) {
-          this.form.deliveryName = newVal.name;
-          this.form.deliveryCode = newVal.code;
-        } else {
-          this.form.deliveryName = '';
-          this.form.deliveryCode = '';
+  },
+  methods: {
+    getStepActive(status) {
+      const statusMap = {
+        4: 1, // 待支付 -> 激活第1步(显示到待支付)
+        1: 2, // 待发货 -> 激活第2步(显示到待发货)
+        2: 3, // 待收货 -> 激活第3步(显示到待收货)
+        3: 4  // 已完成 -> 激活第4步(全部完成)
+      };
+      return statusMap[status] || 0;
+    },
+    handlePhone() {
+      const orderId = this.item.orderId;
+      getOrderUserPhone(orderId).then(response => {
+        this.item.userPhone = response.userPhone;
+      })
+    },
+    async updateOrder() {
+      this.editOrder.open = true;
+      this.editForm.orderId = this.item.orderId;
+      this.editForm.remark = this.item.remark;
+      this.editForm.status = this.item.status.toString();
+      this.editForm.userAddress = this.item.userAddress.toString();
+      this.editForm.loginAccount = this.item.loginAccount;
+
+      // 设置快递字段的初始值
+      this.editForm.deliveryName = this.item.deliveryName;
+      this.editForm.deliveryCode = this.item.deliveryCode;
+      this.editForm.deliverySn = this.item.deliverySn;
+
+      // 重置选择状态
+      this.editSelectedRow = null;
+      this.editSelectedExpress = null;
+
+      try {
+        // 1. 先确保快递选项数据已加载
+        if (this.expressOption.length === 0) {
+          await getExpressList().then(response => {
+            this.expressOption = response.data;
+          });
+        }
+
+        // 2. 设置选中的快递(在快递数据加载完成后)
+        if (this.item.deliveryName && this.expressOption.length > 0) {
+          const currentExpress = this.expressOption.find(item =>
+            item.name === this.item.deliveryName
+          );
+          if (currentExpress) {
+            this.editSelectedExpress = currentExpress;
+          }
         }
+
+        // 3. 等待代服账号数据加载完成
+        await this.getAccountList();
+
+        // 4. 在数据都加载完成后尝试选中对应的行
+        if (this.item.loginAccount) {
+          this.$nextTick(() => {
+            this.selectCurrentAccount();
+          });
+        }
+      } catch (error) {
+        console.error('加载数据失败:', error);
       }
     },
-    methods: {
-      handlePhone(){
-        const orderId = this.item.orderId;
-        getOrderUserPhone(orderId).then(response =>{
-            this.item.userPhone = response.userPhone;
-        })
-      },
-      updateOrder(){
-        this.editOrder.open=true;
-        this.editForm.orderId=this.item.orderId;
-        this.editForm.remark=this.item.remark;
-        this.editForm.status = this.item.status.toString();
-        this.editForm.userAddress = this.item.userAddress.toString();
-      },
-     //修改订单状态
-     submitEditForm(){
-        this.$refs["editForm"].validate(valid => {
+    // 选中当前账号(修改订单弹窗使用)
+    selectCurrentAccount() {
+      if (!this.item.loginAccount || !this.tableData || this.tableData.length === 0) {
+        console.log('无法选中账号:数据未就绪');
+        return;
+      }
+
+      const currentAccount = this.tableData.find(item =>
+        item.loginAccount === this.item.loginAccount
+      );
+
+      if (currentAccount) {
+        this.editSelectedRow = currentAccount;
+        this.$nextTick(() => {
+          if (this.$refs.editAccountTable) {
+            this.$refs.editAccountTable.setCurrentRow(currentAccount);
+            console.log('成功选中代服账号:', currentAccount.loginAccount);
+          }
+        });
+      } else {
+        console.log('未找到对应的代服账号:', this.item.loginAccount);
+      }
+    },
+    //修改订单状态
+    submitEditForm() {
+      this.$refs["editForm"].validate(valid => {
         if (valid) {
           updateIntegralOrder(this.editForm).then(response => {
             if (response.code === 200) {
               this.msgSuccess("操作成功");
               this.editOrder.open = false;
               this.getDetails(this.item.orderId);
-              }
-            });
-          }
-        });
-      },
-      sendCancel(){
-           this.sendVisible = false;
-           this.form={
-             deliveryCode: null,
-             deliveryName:null,
-             deliverySn:null,
-             orderId:null,
-           }
-      },
-      showSend(){
-        //获取快递公司信息
-        getExpressList().then(response=>{
-          this.expressOption = response.data;
-        })
-        console.log(this.expressOption)
-        this.sendVisible = true
-      },
-      showExpress(){
-        this.expressDialog.open=true;
-        getExpress(this.item.orderId).then(response => {
-            this.express = response.data;
-            if(this.express!=null&&this.express.Traces!=null){
-                this.traces=this.express.Traces
             }
+          });
+        }
+      });
+    },
+    sendCancel() {
+      this.sendVisible = false;
+      this.form = {
+        deliveryCode: null,
+        deliveryName: null,
+        deliverySn: null,
+        orderId: null,
+        loginAccount: null
+      };
+      this.selectedExpress = null;
+      this.selectedRow = null;
+      if (this.$refs.accountTable) {
+        this.$refs.accountTable.setCurrentRow();
+      }
+    },
+    showSend() {
+      // 重置表单和选择状态
+      this.form = {
+        deliveryCode: null,
+        deliveryName: null,
+        deliverySn: null,
+        orderId: null,
+        loginAccount: null
+      };
+      this.selectedExpress = null;
+      this.selectedRow = null;
+
+      // 获取快递公司信息
+      getExpressList().then(response => {
+        this.expressOption = response.data;
+      });
+
+      // 获取代服账号列表
+      this.getAccountList();
+
+      this.sendVisible = true;
+    },
+    showExpress() {
+      this.expressDialog.open = true;
+      getExpress(this.item.orderId).then(response => {
+        this.express = response.data;
+        if (this.express != null && this.express.Traces != null) {
+          this.traces = this.express.Traces
+        }
+      });
+    },
+    sendGoods() {
+      // 手动验证所有必填字段
+      if (!this.selectedRow) {
+        this.msgError('请选择代服账号');
+        return;
+      }
+
+      if (!this.form.deliveryName || !this.form.deliveryCode) {
+        this.msgError('请选择快递公司');
+        return;
+      }
+
+      if (!this.form.deliverySn) {
+        this.msgError('请输入快递单号');
+        return;
+      }
+
+      // 所有验证通过,直接发送
+      this.form.orderId = this.item.orderId;
+      sendgoods(this.form).then(response => {
+        this.msgSuccess("发货成功");
+        this.sendVisible = false;
+        getIntegralOrder(this.item.orderId).then(response => {
+          this.item = response.data;
+          this.$parent.$parent.getList();
         });
-      },
-    sendGoods(){
-        this.form.orderId=this.item.orderId;
-        sendgoods(this.form).then(response => {
-              this.msgSuccess("修改成功");
-              this.sendVisible = false;
-              getIntegralOrder(this.item.orderId).then(response => {
-                  this.item = response.data;
-                  this.$parent.$parent.getList();
-              });
-
-              this.form={
-              deliveryCode: null,
-              deliveryName:null,
-              deliverySn:null,
-              orderId:null,
-            }
+
+        this.form = {
+          deliveryCode: null,
+          deliveryName: null,
+          deliverySn: null,
+          orderId: null,
+          loginAccount: null
+        };
+        this.selectedRow = null;
+      });
+    },
+    getDetails(orderId) {
+      this.item = null;
+      getIntegralOrder(orderId).then(response => {
+        this.item = response.data;
+        this.prod = [JSON.parse(this.item.itemJson)][0];
+      });
+    },
+    // 代服账号选择变化
+    handleAccountSelectionChange(currentRow, oldRow) {
+      this.selectedRow = currentRow;
+      if (currentRow) {
+        this.form.loginAccount = currentRow.loginAccount;
+      }
+    },
+    // 修改订单弹窗的代服账号选择
+    handleEditAccountSelectionChange(currentRow, oldRow) {
+      this.editSelectedRow = currentRow;
+      if (currentRow) {
+        this.editForm.loginAccount = currentRow.loginAccount;
+      }
+    },
+    // 获取代服账号列表
+    getAccountList() {
+      return new Promise((resolve, reject) => {
+        listAccount(this.queryParams).then(response => {
+          this.tableData = response.rows || response.data || [];
+          this.total = response.total || 0;
+          resolve(this.tableData); // 数据加载完成
+        }).catch(error => {
+          this.tableData = [];
+          reject(error);
         });
-      },
-      getDetails(orderId) {
-        this.item=null;
-        getIntegralOrder(orderId).then(response => {
-            this.item = response.data;
-            this.prod=[JSON.parse(this.item.itemJson)][0];
+      });
+    },
+    handlePageChange(page) {
+      this.queryParams.pageNum = page;
+      this.getAccountList();
+    },
+    // 取消订单
+    applyRefund() {
+      this.$confirm('确定要取消该订单吗?取消后订单将无法恢复。', '取消订单确认', {
+        confirmButtonText: '确定取消',
+        cancelButtonText: '再想想',
+        type: 'warning',
+        confirmButtonClass: 'el-button--danger'
+      }).then(() => {
+        this.cancelOrder();
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消操作'
         });
-      },
-    }
+      });
+    },
+
+    // 执行取消订单请求
+    cancelOrder() {
+      const orderCode = this.item.orderCode;
+      mandatoryRefunds(orderCode).then(response => {
+        if (response.code === 200) {
+          this.msgSuccess("取消订单成功");
+          // 刷新订单详情
+          this.getDetails(this.item.orderId);
+          // 刷新父组件列表(如果有)
+          if (this.$parent && this.$parent.$parent && this.$parent.$parent.getList) {
+            this.$parent.$parent.getList();
+          }
+        } else {
+          this.msgError(response.msg || "取消订单失败");
+        }
+      }).catch(error => {
+        this.msgError("取消订单失败");
+        console.error('取消订单失败:', error);
+      });
+    },
+    // 完成订单
+    handleFinishOrder() {
+      this.$confirm('确定要完成该订单吗?完成后订单状态将变为已完成。', '完成订单确认', {
+        confirmButtonText: '确定完成',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        // 用户点击确定
+        this.executeFinishOrder();
+      }).catch(() => {
+        // 用户点击取消
+        this.$message({
+          type: 'info',
+          message: '已取消操作'
+        });
+      });
+    },
+    
+    // 执行完成订单请求
+    executeFinishOrder() {
+      const orderCode = this.item.orderCode;
+      console.log("请问请问",orderCode)
+      finishOrder(orderCode).then(response => {
+        if (response.code === 200) {
+          this.msgSuccess("订单完成成功");
+          // 刷新订单详情
+          this.getDetails(this.item.orderId);
+          // 刷新父组件列表(如果有)
+          if (this.$parent && this.$parent.$parent && this.$parent.$parent.getList) {
+            this.$parent.$parent.getList();
+          }
+        } else {
+          this.msgError(response.msg || "订单完成失败");
+        }
+      }).catch(error => {
+        this.msgError("订单完成失败");
+        console.error('完成订单失败:', error);
+      });
+    },
   }
+}
 </script>
 <style>
-  .contentx{
-      height: 100%;
-      background-color: #fff;
-      padding: 0px 20px 20px;
+.contentx {
+  height: 100%;
+  background-color: #fff;
+  padding: 0px 20px 20px;
 
 
-      margin: 20px;
-  }
-  .el-descriptions-item__label.is-bordered-label{
-    font-weight: normal;
-  }
-  .el-descriptions-item__content {
-    max-width: 150px;
-    min-width: 100px;
-  }
-  .desct{
-      padding-top: 20px;
-      padding-bottom: 20px;
-      color: #524b4a;
-      font-weight: bold;
-    }
+  margin: 20px;
+}
+
+.el-descriptions-item__label.is-bordered-label {
+  font-weight: normal;
+}
+
+.el-descriptions-item__content {
+  max-width: 150px;
+  min-width: 100px;
+}
+
+.desct {
+  padding-top: 20px;
+  padding-bottom: 20px;
+  color: #524b4a;
+  font-weight: bold;
+}
+
 .operate-container {
   background: #F2F6FC;
   height: 60px;
   margin: -20px -20px 0;
   line-height: 60px;
 }
-.order-content{
+
+.order-content {
   margin: 10px;
 
 }
+
 .operate-button-container {
   float: right;
   margin-right: 20px

+ 3 - 5
src/views/course/courseTrafficLog/index.vue

@@ -52,6 +52,7 @@
       <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 type="warning" plain icon="el-icon-download" size="mini" :loading="exportLoading" @click="handleExport" >导出</el-button>
       </el-form-item>
     </el-form>
 
@@ -211,10 +212,7 @@ export default {
       this.getList();
     },
     formatTrafficData(traffic) {
-      if (traffic < 1024) return `${traffic} B`;
-      if (traffic < 1024 ** 2) return `${(traffic / 1024).toFixed(2)} KB`;
-      if (traffic < 1024 ** 3) return `${(traffic / 1024 ** 2).toFixed(2)} MB`;
-      return `${(traffic / 1024 ** 3).toFixed(2)} GB`;
+      return `${(traffic / (1024 ** 3)).toFixed(4)} GB`;
     },
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.logId);
@@ -228,7 +226,7 @@ export default {
       }).finally(() => {
         this.exportLoading = false;
       });
-    }
+    },
   }
 };
 </script>

+ 145 - 18
src/views/course/courseWatchLog/index.vue

@@ -44,9 +44,23 @@
           @change="handleScheduleTimeChange">
         </el-date-picker>
       </el-form-item>
+<!--      <el-form-item label="创建时间" prop="createTime">-->
+<!--        <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd"-->
+<!--                        type="daterange"-->
+<!--                        :required="true"-->
+<!--                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="createChange"></el-date-picker>-->
+<!--      </el-form-item>-->
       <el-form-item label="创建时间" prop="createTime">
-        <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange"
-                        range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="createChange"></el-date-picker>
+        <el-date-picker
+          v-model="createTime"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          @change="createChange"
+          :default-time="['00:00:00', '23:59:59']"
+        />
       </el-form-item>
       <el-form-item label="最新更新时间" prop="updateTime">
         <el-date-picker v-model="updateTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange"
@@ -237,8 +251,13 @@ export default {
       this.userSourceTypeOptions = response.data;
     })
 
+    // 设置默认当天时间 xgb 防止频繁查询大量数据
+    this.setToday();
+
     this.getList();
 
+    this.loading = false;
+
 
   },
   computed: {
@@ -252,6 +271,42 @@ export default {
     }
   },
   methods: {
+
+    setToday(){
+      const today = new Date();
+      const todayStart = new Date(today);
+      todayStart.setHours(0, 0, 0, 0);
+      const todayEnd = new Date(today);
+      todayEnd.setHours(23, 59, 59, 999);
+
+      this.createTime = [this.formatDate(todayStart), this.formatDate(todayEnd)];
+      this.queryParams.sTime = this.formatDate(todayStart);
+      this.queryParams.eTime = this.formatDate(todayEnd);
+    },
+    formatDate(date) {
+      if (!date) return ''
+
+      // 确保 date 是 Date 对象
+      let dateObj = date
+      if (typeof date === 'string') {
+        dateObj = new Date(date)
+      }
+
+      // 如果转换失败,返回空字符串
+      if (!(dateObj instanceof Date) || isNaN(dateObj.getTime())) {
+        return ''
+      }
+
+      // 使用更安全的格式化方法
+      const year = dateObj.getFullYear()
+      const month = String(dateObj.getMonth() + 1).padStart(2, '0')
+      const day = String(dateObj.getDate()).padStart(2, '0')
+      const hours = String(dateObj.getHours()).padStart(2, '0')
+      const minutes = String(dateObj.getMinutes()).padStart(2, '0')
+      const seconds = String(dateObj.getSeconds()).padStart(2, '0')
+
+      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
+    },
     handleClear(){
       this.queryUserLoading = false;
       this.fsUserList = [];
@@ -290,21 +345,58 @@ export default {
         this.videoList=response.list
       });
     },
-    createChange() {
-      if (this.createTime != null) {
-        this.queryParams.sTime = this.createTime[0];
-        this.queryParams.eTime = this.createTime[1];
+    checkDateRangeLimit(dateRange) {
+      if (dateRange && dateRange.length >= 2) {
+        const startDate = new Date(dateRange[0]);
+        const endDate = new Date(dateRange[1]);
+
+        // 设置时间为当天开始,避免时间部分影响计算
+        startDate.setHours(0, 0, 0, 0);
+        endDate.setHours(0, 0, 0, 0);
+
+        const timeDiff = Math.abs(endDate - startDate);
+        const diffDays = Math.ceil(timeDiff / (1000 * 60 * 60 * 24));
+
+        if (diffDays > 31) { // maxDays-1 因为包含起始日
+          this.$message.warning('时间区间不能超过一个月');
+          return false;
+        }
+      }
+      return true;
+    },
+    createChange(createTime) {
+      if (createTime && createTime.length >= 2) {
+        if(!this.checkDateRangeLimit(createTime)){
+          this.createTime = null;
+          this.queryParams.sTime=null;
+          this.queryParams.eTime=null;
+          return;
+        }
+
+        // this.createTimeText = this.formatDateRange(createTime);
+        this.queryParams.sTime = this.formatDate(createTime[0]) || null;
+        this.queryParams.eTime = this.formatDate(createTime[1]) || null;
       } else {
+        this.createTimeText = '';
         this.queryParams.sTime = null;
         this.queryParams.eTime = null;
       }
     },
 
-    updateChange(){
-      if (this.updateTime != null) {
-        this.queryParams.upSTime = this.updateTime[0];
-        this.queryParams.upETime = this.updateTime[1];
+    updateChange(updateTime){
+      if (updateTime && updateTime.length >= 2) {
+        if(!this.checkDateRangeLimit(updateTime)){
+          this.updateTime = null;
+          this.queryParams.upSTime=null;
+          this.queryParams.upETime=null;
+          return;
+        }
+
+        // this.updateTime = this.formatDateRange(updateTime);
+        this.queryParams.upSTime = updateTime[0] || null;
+        this.queryParams.upETime = updateTime[1] || null;
       } else {
+        this.updateTime = [];
         this.queryParams.upSTime = null;
         this.queryParams.upETime = null;
       }
@@ -320,6 +412,14 @@ export default {
     },
     /** 查询短链课程看课记录列表 */
     getList() {
+
+      // xgb 看课数据量太大必须限制时间if (this.isEmptyArray(this.createTime) &&
+      if (this.isEmptyArray(this.createTime) &&
+        this.isEmptyArray(this.updateTime) &&
+        this.isEmptyArray(this.scheduleTime)) {
+        this.$message.warning('请选择创建时间或营期时间或最新更新时间');
+        return;
+      }
       this.loading = true;
       if(this.queryParams.logType == "10"){
         this.queryParams.logType = null;
@@ -329,7 +429,10 @@ export default {
         this.courseWatchLogList = response.rows;
         this.total = response.total;
         this.loading = false;
-      });
+      }).catch(() => {
+          this.loading = false;
+        }
+      );
     },
     // 取消按钮
     cancel() {
@@ -366,17 +469,21 @@ export default {
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
-      this.createTime = null;
+      // this.createTime = null;
       this.scheduleTime = null;
-      this.queryParams.sTime = null;
-      this.queryParams.eTime = null;
+      // this.queryParams.sTime = null;
+      // this.queryParams.eTime = null;
       this.queryParams.upSTime = null;
       this.queryParams.upETime = null;
       this.queryParams.scheduleStartTime = null;
       this.queryParams.scheduleEndTime = null;
       this.scheduleTime=null;
       this.updateTime=null;
+      // 重置时间当天
+      this.setToday();
+
       this.handleQuery();
+
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
@@ -434,8 +541,19 @@ export default {
           this.msgSuccess("删除成功");
         }).catch(() => {});
     },
+    // 添加辅助方法
+    isEmptyArray(arr) {
+      return !arr || arr.length === 0;
+    },
     /** 导出按钮操作 */
     handleExport() {
+      // xgb 看课数据量太大必须限制时间
+      if (this.isEmptyArray(this.createTime) &&
+        this.isEmptyArray(this.updateTime) &&
+        this.isEmptyArray(this.scheduleTime)) {
+        this.$message.warning('请选择创建时间或营期时间或最新更新时间');
+        return;
+      }
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
           confirmButtonText: "确定",
@@ -449,11 +567,20 @@ export default {
           this.exportLoading = false;
         }).catch(() => {});
     },
-    handleScheduleTimeChange(val) {
-      if (val) {
-        this.queryParams.scheduleStartTime = val[0];
-        this.queryParams.scheduleEndTime = val[1];
+    handleScheduleTimeChange(scheduleTime) {
+      if (scheduleTime && scheduleTime.length >= 2) {
+        if(!this.checkDateRangeLimit(scheduleTime)){
+          this.scheduleTime = null;
+          this.queryParams.scheduleStartTime=null;
+          this.queryParams.scheduleStartTime=null;
+          return;
+        }
+
+        // this.scheduleTime = this.formatDateRange(scheduleTime);
+        this.queryParams.scheduleStartTime = scheduleTime[0] || null;
+        this.queryParams.scheduleEndTime = scheduleTime[1] || null;
       } else {
+        this.scheduleTime = [];
         this.queryParams.scheduleStartTime = null;
         this.queryParams.scheduleEndTime = null;
       }

+ 184 - 2
src/views/course/userCourse/index.vue

@@ -169,6 +169,14 @@
             v-hasPermi="['course:userCourse:remove']"
           >删除
           </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            v-if="scope.row.isPrivate === 1"
+            v-has-permi="['course:userCourse:editConfig']"
+            @click="configCourse(scope.row)"
+          >过程页配置
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -275,6 +283,69 @@
       </div>
     </el-dialog>
 
+    <!-- 过程页配置 -->
+    <el-dialog
+      :visible.sync="configDialog.dialogVisible"
+      title="过程页配置"
+      append-to-body
+      width="1200px"
+    >
+      <el-form :model="configDialog.form" :rules="configDialog.rules" ref="configForm" label-width="110px">
+        <el-form-item label="过程页图片" prop="coverImg">
+          <ImageUpload v-model="configDialog.form.coverImg" :height="150" :limit="1" :width="150" type="image"/>
+          <i class="el-icon-warning"/>
+          <span style="color: rgb(153, 169, 191)"> 不配置将使用课程默认图片</span>
+        </el-form-item>
+        <el-form-item label="首播电视台" prop="tvEnable">
+          <el-switch v-model="configDialog.form.tvEnable" active-color="#13ce66"/>
+        </el-form-item>
+        <el-form-item prop="tv" v-if="configDialog.form.tvEnable">
+          <el-input v-model="configDialog.form.tv" clearable></el-input>
+          <i class="el-icon-warning"/>
+          <span style="color: rgb(153, 169, 191)"> 多个首播电视台,请用英文逗号隔开</span>
+        </el-form-item>
+        <el-form-item label="网络播放平台" prop="networkEnable">
+          <el-switch v-model="configDialog.form.networkEnable" active-color="#13ce66"/>
+        </el-form-item>
+        <el-form-item prop="network" v-if="configDialog.form.networkEnable">
+          <el-input v-model="configDialog.form.network" clearable></el-input>
+          <i class="el-icon-warning"/>
+          <span style="color: rgb(153, 169, 191)"> 多个网络播放平台,请用英文逗号隔开</span>
+        </el-form-item>
+        <el-form-item label="制作单位" prop="unitEnable">
+          <el-switch v-model="configDialog.form.unitEnable" active-color="#13ce66"/>
+        </el-form-item>
+        <el-form-item prop="unit" v-if="configDialog.form.unitEnable">
+          <el-input v-model="configDialog.form.unit" clearable></el-input>
+          <i class="el-icon-warning"/>
+          <span style="color: rgb(153, 169, 191)"> 多个制作单位,请用英文逗号隔开</span>
+        </el-form-item>
+        <el-form-item label="专家顾问团队" prop="teamEnable">
+          <el-switch v-model="configDialog.form.teamEnable" active-color="#13ce66"/>
+        </el-form-item>
+        <el-form-item prop="team" v-if="configDialog.form.teamEnable">
+          <el-input v-model="configDialog.form.team" clearable></el-input>
+          <i class="el-icon-warning"/>
+          <span style="color: rgb(153, 169, 191)"> 多个专家顾问,请用英文逗号隔开</span>
+        </el-form-item>
+        <el-form-item label="支持单位" prop="supportEnable">
+          <el-switch v-model="configDialog.form.supportEnable" active-color="#13ce66"/>
+        </el-form-item>
+        <el-form-item prop="support" v-if="configDialog.form.supportEnable">
+          <el-input v-model="configDialog.form.support" clearable></el-input>
+          <i class="el-icon-warning"/>
+          <span style="color: rgb(153, 169, 191)"> 多个支持单位,请用英文逗号隔开</span>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary"
+                   :loading="configDialog.updating"
+                   :disabled="configDialog.updating"
+                   @click="submitConfigForm">确 定</el-button>
+        <el-button @click="cancelConfig">取 消</el-button>
+      </div>
+    </el-dialog>
+
     <el-drawer
       :with-header="false"
       size="75%"
@@ -295,7 +366,8 @@ import {
   updateIsShow,
   copyUserCourse,
   putOn,
-  pullOff, updateUserCourseRedPage
+  pullOff, updateUserCourseRedPage,
+  editConfig
 } from '@/api/course/userCourse'
 
 import {getSelectableRange} from "@/api/qw/sopTemp";
@@ -445,6 +517,41 @@ export default {
         redPacketMoney: [
           {required: true, message: "红包金额不能为空", trigger: "blur"}
         ],
+      },
+      configDialog: {
+        dialogVisible: false,
+        updating: false,
+        form: {
+          id: null,
+          coverImg: null,
+          tvEnable: 0,
+          tv: null,
+          networkEnable: 0,
+          network: null,
+          unitEnable: 0,
+          unit: null,
+          teamEnable: 0,
+          team: null,
+          supportEnable: 0,
+          support: null
+        },
+        rules: {
+          tv: [
+            { required: true, message: '首播电视台不能为空', trigger: 'blur' }
+          ],
+          network: [
+            { required: true, message: '网络播放平台不能为空', trigger: 'blur' }
+          ],
+          unit: [
+            { required: true, message: '制作单位不能为空', trigger: 'blur' }
+          ],
+          team: [
+            { required: true, message: '专家顾问团队不能为空', trigger: 'blur' }
+          ],
+          support: [
+            { required: true, message: '支持单位不能为空', trigger: 'blur' }
+          ],
+        }
       }
     };
   },
@@ -802,7 +909,82 @@ export default {
         this.msgSuccess("下架成功");
       }).catch(function () {
       });
-    }
+    },
+    configCourse(row) {
+      if (row.configJson) {
+        this.configDialog.form = {
+          tvEnable: 0,
+          networkEnable: 0,
+          unitEnable: 0,
+          teamEnable: 0,
+          supportEnable: 0,
+          ...JSON.parse(row.configJson)
+        }
+      }
+      this.configDialog.form.id = row.courseId
+      this.configDialog.dialogVisible = true;
+      this.configDialog.updating = false
+    },
+    submitConfigForm() {
+      this.$refs['configForm'].validate(valid => {
+        if (!valid) {
+          this.msgError('请完善配置内容')
+          return
+        }
+
+        if (this.configDialog.updating) {
+          return
+        }
+        this.configDialog.updating = true
+
+        const content = {
+          coverImg: this.configDialog.form.coverImg,
+          tvEnable: this.configDialog.form.tvEnable,
+          tv: this.configDialog.form.tv?.replace(",",","),
+          networkEnable: this.configDialog.form.networkEnable,
+          network: this.configDialog.form.network?.replace(",",","),
+          unitEnable: this.configDialog.form.unitEnable,
+          unit: this.configDialog.form.unit?.replace(",",","),
+          teamEnable: this.configDialog.form.teamEnable,
+          team: this.configDialog.form.team?.replace(",",","),
+          supportEnable: this.configDialog.form.supportEnable,
+          support: this.configDialog.form.support?.replace(",",","),
+        }
+
+        const params = {
+          id: this.configDialog.form.id,
+          configJson: JSON.stringify(content)
+        }
+
+        editConfig(params).then(() => {
+          this.msgSuccess('修改成功')
+          this.configDialog.dialogVisible = false;
+          this.getList()
+        }).finally(() => {
+          setTimeout(() => {
+            this.configDialog.updating = false
+          }, 500)
+        })
+      })
+    },
+    cancelConfig() {
+      this.configDialog.form = {
+        id: null,
+        coverImg: null,
+        tvEnable: 0,
+        tv: null,
+        networkEnable: 0,
+        network: null,
+        unitEnable: 0,
+        unit: null,
+        teamEnable: 0,
+        team: null,
+        supportEnable: 0,
+        support: null
+      }
+      this.resetForm('configForm')
+      this.configDialog.dialogVisible = false;
+    },
   }
 };
 </script>

+ 2 - 1
src/views/course/userVideo/index.vue

@@ -658,8 +658,9 @@ export default {
         isAudit:1
       },
       this.auditDialog.open=true;
-      this.auditForm.videoIds = row.videoId || this.ids;
+      this.auditForm.videoIds = row.videoId ? [row.videoId] : this.ids;
     },
+
     handleClickX(){
       this.getList()
     },

+ 249 - 11
src/views/his/company/index.vue

@@ -94,6 +94,17 @@
         >导出
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="multiple"
+          @click="handleMiniProgram"
+        >批量修改小程序
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -111,6 +122,7 @@
       </el-table-column>
 
       <el-table-column label="余额" align="center" prop="money"/>
+      <el-table-column label="红包余额" align="center" prop="redPackageMoney"/>
       <el-table-column label="企业类型" align="center" prop="companyType">
         <template slot-scope="scope">
           <dict-tag :options="companyTypeOptions" :value="scope.row.companyType"/>
@@ -176,6 +188,22 @@
             v-hasPermi="['his:company:deduct']"
           >扣款
           </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleRedRecharge(scope.row)"
+            v-hasPermi="['his:company:redRecharge']"
+          >红包充值
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleRedDeduct(scope.row)"
+            v-hasPermi="['his:company:redDeduct']"
+          >红包扣款
+          </el-button>
           <el-button
             size="mini"
             type="text"
@@ -459,6 +487,27 @@
       </div>
     </el-dialog>
 
+    <el-dialog :title="redRecharge.title" :visible.sync="redRecharge.open" width="500px" append-to-body>
+      <el-form ref="redRechargeForm" :rules="redRechargeRules" :model="redRechargeForm" label-width="80px">
+        <el-form-item label="公司">
+          <el-input v-model="redRechargeForm.companyName" disabled/>
+        </el-form-item>
+        <el-form-item label="余额">
+          <el-input v-model="redRechargeForm.balance" disabled/>
+        </el-form-item>
+        <el-form-item label="充值金额" prop="money">
+          <el-input-number v-model="redRechargeForm.money" :min="0.01" placeholder="请输入充值金额"/>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="redRechargeForm.remark" placeholder="请输入备注"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitRedRechargeForm" :disabled="redSubmit">确 定</el-button>
+        <el-button @click="redRecharge.open=false">取 消</el-button>
+      </div>
+    </el-dialog>
+
     <el-dialog :title="deduct.title" :visible.sync="deduct.open" width="500px" append-to-body>
       <el-form ref="deductForm" :rules="deductRules" :model="deductForm" label-width="80px">
         <el-form-item label="公司">
@@ -480,12 +529,33 @@
       </div>
     </el-dialog>
 
+    <el-dialog :title="redDeduct.title" :visible.sync="redDeduct.open" width="500px" append-to-body>
+      <el-form ref="redDeductForm" :rules="redDeductRules" :model="redDeductForm" label-width="80px">
+        <el-form-item label="公司">
+          <el-input v-model="redDeductForm.companyName" disabled/>
+        </el-form-item>
+        <el-form-item label="余额">
+          <el-input v-model="redDeductForm.balance" disabled/>
+        </el-form-item>
+        <el-form-item label="扣款金额" prop="money">
+          <el-input-number v-model="redDeductForm.money" :min="0.01" placeholder="请输入扣款金额"/>
+        </el-form-item>
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="redDeductForm.remark" placeholder="请输入备注"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitRedDeductForm">确 定</el-button>
+        <el-button @click="redDeduct.open=false">取 消</el-button>
+      </div>
+    </el-dialog>
+
     <el-dialog :title="revenue.title" :visible.sync="revenue.open" width="800px" append-to-body>
       <el-form ref="revenueForm"  :model="revenueForm" label-width="150px">
         <el-form-item label="公司">
           <el-input v-model="revenueForm.companyName" disabled/>
         </el-form-item>
-       
+
         <el-form-item label="开启分账">
           <el-switch
             v-model="revenueForm.divFlag"
@@ -496,7 +566,7 @@
           >
           </el-switch>
         </el-form-item>
-        
+
         <el-form-item label="分账模式" v-if="revenueForm.divFlag == 1">
           <el-radio v-model="revenueForm.delayAcctFlag" label="N">实时分账</el-radio>
           <el-radio v-model="revenueForm.delayAcctFlag" label="Y">延时分账</el-radio>
@@ -528,7 +598,7 @@
                   添加新接收方
                 </el-button>
               </el-tooltip>
-              
+
             </el-form-item>
 
             <div v-for="(account, index) in revenueForm.acctInfos" :key="index"
@@ -553,25 +623,88 @@
               <el-form-item label="账户号" :prop="`acctInfos.${index}.acctId`" >
                 <el-input v-model="account.acctId"  placeholder="可指定账户号,仅支持基本户、现金户,不填默认为基本户;示例值:F00598600"></el-input>
               </el-form-item>
-              
+
               <el-form-item label="分账百分比%" v-if="revenueForm.percentageFlag == 'Y'" :prop="`acctInfos.${index}.percentageDiv`"  >
                 <el-input-number v-model="account.percentageDiv" :precision="2" :step="0.1" :min="0" :max="100" placeholder="示例值:23.50,表示23.50%。acct_infos中全部分账百分比之和必须为100.00%。"></el-input-number>
               </el-form-item>
               <el-form-item label="分账金额" v-if="revenueForm.percentageFlag == 'N'" :prop="`acctInfos.${index}.divAmt`"  >
                 <el-input-number v-model="account.divAmt" :precision="2" :step="1" :min="0.01" placeholder="单位元,需保留小数点后两位,示例值:1.00 ,最低传入0.01"></el-input-number>
               </el-form-item>
-              
+
             </div>
           </div>
 
-       
-       
+
+
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitRevenueForm">确 定</el-button>
         <el-button @click="revenue.open=false">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 批量修改小程序 -->
+    <el-dialog :title="miniProgram.title" :visible.sync="miniProgram.open" width="700px" append-to-body>
+
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <el-form-item label="小程序点播配置" prop="courseMiniAppId">
+          <el-select
+            v-model="form.courseMiniAppId"
+            placeholder="请选择小程序"
+            clearable
+            size="small"
+          >
+            <el-option
+              v-for="item in miniAppList"
+              :key="item.appId"
+              :label="item.appName"
+              :value="item.appId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="主要小程序" prop="miniAppMaster">
+          <el-select
+            v-model="form.miniAppMaster"
+            multiple
+            :multiple-limit="1"
+            placeholder="请选择"
+            clearable
+            size="small"
+          >
+            <el-option
+              v-for="item in miniAppList"
+              :key="item.appId"
+              :label="item.appName"
+              :value="item.appId"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="备用小程序" prop="miniAppServer">
+          <el-select
+            v-model="form.miniAppServer"
+            multiple
+            :multiple-limit="1"
+            placeholder="请选择"
+            clearable
+            size="small"
+          >
+            <el-option
+              v-for="item in miniAppList"
+              :key="item.appId"
+              :label="item.appName"
+              :value="item.appId"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+
+
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitMiniProgramForm">确 定</el-button>
+        <el-button @click="cancelMiniProgram">取 消</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -583,11 +716,13 @@ import {
   addCompany,
   updateCompany,
   recharge,
+  redRecharge,
   deduct,
+  redDeduct,
   exportCompany,
   resetPwd,
   getDivConfig,
-  setDiv
+  setDiv, exitMiniProgram
 } from '@/api/his/company'
 import { getFollowDoctorList } from '@/api/his/doctor'
 import { docList } from '@/api/his/doctor'
@@ -602,24 +737,33 @@ export default {
   name: 'Company',
   data() {
     return {
+      redSubmit: false,
       //分账参数
       revenue:{
           open: false,
           title: '分账配置'
       },
       revenueForm:{
-        acctInfos: [] 
+        acctInfos: []
       },
       // 表单参数
       deductForm: {
         money: 0
       },
+      // 表单参数
+      redDeductForm: {
+        money: 0
+      },
       doctorIds: [],
       doctor: [],
       recharge: {
         open: false,
         title: '后台充值'
       },
+      redRecharge: {
+        open: false,
+        title: '红包充值'
+      },
       // 遮罩层
       loading: true,
       // 导出遮罩层
@@ -662,6 +806,10 @@ export default {
       rechargeForm: {
         money: 0
       },
+      // 红包充值表单参数
+      redRechargeForm: {
+        money: 0
+      },
       followDoctorList: [],
       cateList: [],
       // 表单参数
@@ -733,18 +881,38 @@ export default {
           { required: true, message: '扣款金额不能为空', trigger: 'blur' }
         ]
       },
+      // 表单校验
+      redDeductRules: {
+        money: [
+          { required: true, message: '扣款金额不能为空', trigger: 'blur' }
+        ]
+      },
       rechargeRules: {
         money: [
           { required: true, message: '扣款金额不能为空', trigger: 'blur' }
         ]
       },
+      redRechargeRules: {
+        money: [
+          { required: true, message: '扣款金额不能为空', trigger: 'blur' }
+        ]
+      },
       deduct: {
         open: false,
         title: '后台扣款'
       },
+      redDeduct: {
+        open: false,
+        title: '红包扣款'
+      },
       maAppList: [],
       miniAppList: [],
-      customAppList: []
+      customAppList: [],
+      //分账参数
+      miniProgram:{
+        open: false,
+        title: '批量修改小程序'
+      },
     }
   },
   created() {
@@ -831,6 +999,15 @@ export default {
       this.rechargeForm.money = null
       this.recharge.open = true
     },
+    // 红包充值
+    handleRedRecharge(row) {
+      this.redSubmit=false
+      this.redRechargeForm.companyId = row.companyId
+      this.redRechargeForm.companyName = row.companyName
+      this.redRechargeForm.balance = row.money
+      this.redRechargeForm.money = null
+      this.redRecharge.open = true
+    },
     handleDeduct(row) {
       const companyId = row.companyId
       this.deductForm.companyId = row.companyId
@@ -839,6 +1016,13 @@ export default {
       this.deductForm.money = null
       this.deduct.open = true
     },
+    handleRedDeduct(row) {
+      this.redDeductForm.companyId = row.companyId
+      this.redDeductForm.companyName = row.companyName
+      this.redDeductForm.balance = row.money
+      this.redDeductForm.money = null
+      this.redDeduct.open = true
+    },
     /** 提交按钮 */
     submitRechargeForm() {
       this.$refs['rechargeForm'].validate(valid => {
@@ -853,6 +1037,21 @@ export default {
         }
       })
     },
+    /** 红包充值提交按钮 */
+    submitRedRechargeForm() {
+      this.$refs['redRechargeForm'].validate(valid => {
+        if (valid) {
+          this.redSubmit=true
+          redRecharge(this.redRechargeForm).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess(response.msg)
+              this.redRecharge.open = false
+              this.getList()
+            }
+          })
+        }
+      })
+    },
     submitRevenueForm(){
       var param = this.revenueForm;
       console.log("--------------",param)
@@ -881,6 +1080,20 @@ export default {
         }
       })
     },
+    /** 提交按钮 */
+    submitRedDeductForm() {
+      this.$refs['redDeductForm'].validate(valid => {
+        if (valid) {
+          redDeduct(this.redDeductForm).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess(response.msg)
+              this.redDeduct.open = false
+              this.getList()
+            }
+          })
+        }
+      })
+    },
 
     getList() {
       this.loading = true
@@ -1099,7 +1312,32 @@ export default {
     padNumFormatter(row){
       // console.log(row.maxPadNum.type)
       return row.maxPadNum === -1 ? '不限' : row.maxPadNum
-    }
+    },
+    handleMiniProgram() {
+      this.getAppList(null);
+      this.miniProgram.open = true;
+      this.form = {
+        ...this.form,
+        courseMiniAppId:null,
+        miniAppMaster: null,
+        miniAppServer: null
+      };
+    },
+    // 取消按钮
+    cancelMiniProgram() {
+      this.miniProgram.open = false;
+      this.reset()
+    },
+    submitMiniProgramForm(){
+      this.form.ids = this.ids;
+      exitMiniProgram(this.form).then(response => {
+        if (response.code === 200) {
+          this.miniProgram.open = false;
+          this.msgSuccess('修改小程序成功')
+          this.getList()
+        }
+      });
+    },
   }
 }
 </script>

+ 23 - 1
src/views/his/companyDeduct/index.vue

@@ -19,6 +19,16 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="业务类型" prop="businessType">
+        <el-select v-model="queryParams.businessType" placeholder="请选择支付类型" clearable size="small">
+          <el-option
+            v-for="dict in businessTypeOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="创建时间" prop="createTime">
         <el-date-picker clearable size="small"
           v-model="queryParams.createTime"
@@ -59,6 +69,11 @@
       <el-table-column label="金额" align="center" prop="money" />
       <el-table-column label="余额" align="center" prop="balance" />
       <el-table-column label="提交人" align="center" prop="createUserNickName" />
+      <el-table-column label="业务类型" align="center" prop="businessType">
+        <template slot-scope="scope">
+          <dict-tag :options="businessTypeOptions" :value="scope.row.businessType"/>
+        </template>
+      </el-table-column>
       <el-table-column label="审核状态" align="center" prop="isAudit">
         <template slot-scope="scope">
           <dict-tag :options="isAuditOptions" :value="scope.row.isAudit"/>
@@ -146,6 +161,8 @@ export default {
       open: false,
       // 审核状态字典
       isAuditOptions: [],
+      // 业务类型 0-普通 1-红包充值
+      businessTypeOptions:[],
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -154,6 +171,7 @@ export default {
         companyName: null,
         createTime: null,
         isAudit: 0,
+        businessType:null, // 业务类型
       },
       // 表单参数
       form: {},
@@ -166,10 +184,13 @@ export default {
     };
   },
   created() {
-    this.getList();
     this.getDicts("sys_company_isaudit").then(response => {
       this.isAuditOptions = response.data;
     });
+    this.getDicts("sys_company_deduct_business_type").then(response => {
+      this.businessTypeOptions = response.data;
+    });
+    this.getList();
   },
   methods: {
     /** 查询扣款管理列表 */
@@ -211,6 +232,7 @@ export default {
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
+      this.queryParams.businessType=null;
       this.handleQuery();
     },
     // 多选框选中数据

+ 22 - 0
src/views/his/companyRecharge/index.vue

@@ -29,6 +29,16 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="业务类型" prop="businessType">
+        <el-select v-model="queryParams.businessType" placeholder="请选择支付类型" clearable size="small">
+          <el-option
+            v-for="dict in businessTypeOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
           <el-option
@@ -90,6 +100,11 @@
           <dict-tag :options="payTypeOptions" :value="scope.row.payType"/>
         </template>
       </el-table-column>
+      <el-table-column label="业务类型" align="center" prop="businessType">
+        <template slot-scope="scope">
+          <dict-tag :options="businessTypeOptions" :value="scope.row.businessType"/>
+        </template>
+      </el-table-column>
       <el-table-column label="审核状态" align="center" prop="isAudit">
         <template slot-scope="scope">
           <dict-tag :options="isAuditOptions" :value="scope.row.isAudit"/>
@@ -182,6 +197,8 @@ export default {
       statusOptions: [],
       // 支付类型 1微信 2支付宝 3人工转账字典
       payTypeOptions: [],
+      // 业务类型 0-普通 1-红包充值
+      businessTypeOptions:[],
       // 审核状态 0待审核 1已审核字典
       isAuditOptions: [],
       // 查询参数
@@ -193,6 +210,7 @@ export default {
         status: null,
         payType: null,
         isAudit: 0,
+        businessType:null, // 业务类型
       },
       // 表单参数
       form: {},
@@ -215,6 +233,9 @@ export default {
     this.getDicts("sys_company_isaudit").then(response => {
       this.isAuditOptions = response.data;
     });
+    this.getDicts("sys_company_pay_business_type").then(response => {
+      this.businessTypeOptions = response.data;
+    });
   },
   methods: {
     /** 查询充值管理列表 */
@@ -264,6 +285,7 @@ export default {
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
+      this.queryParams.businessType=null;
       this.handleQuery();
     },
     // 多选框选中数据

+ 420 - 0
src/views/his/statistics/comprehensiveStatistics.vue

@@ -0,0 +1,420 @@
+<template>
+  <div class="app-container">
+    <div class="app-content">
+      <div class="title">综合统计看板</div>
+
+      <el-form class="search-form" :inline="true" label-width="90px">
+
+        <!-- 时间范围选择 -->
+        <el-form-item label="时间范围">
+          <el-date-picker
+            v-model="dateRange"
+            type="daterange"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            value-format="yyyy-MM-dd"
+            :picker-options="pickerOptions">
+          </el-date-picker>
+        </el-form-item>
+
+        <!-- 统计维度选择 -->
+        <el-form-item label="统计维度">
+          <el-select v-model="queryParams.dimension" placeholder="请选择统计维度" @change="handleDimensionChange" clearable>
+            <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="选择公司" v-if="queryParams.dimension">
+          <el-select
+            v-model="queryParams.companyId"
+            placeholder="请选择公司"
+            @change="handleCompanyChange"
+            clearable
+            :disabled="!queryParams.dimension">
+            <el-option
+              v-for="company in companyList"
+              :key="company.companyId"
+              :label="company.companyName"
+              :value="company.companyId">
+            </el-option>
+          </el-select>
+        </el-form-item>
+
+        <!-- 部门选择 -->
+        <el-form-item label="选择部门" v-if="showDepartmentSelect">
+          <el-select
+            v-model="queryParams.deptId"
+            placeholder="请选择部门"
+            @change="handleDeptChange"
+            clearable
+            :disabled="!queryParams.companyId">
+            <el-option
+              v-for="dept in deptList"
+              :key="dept.deptId"
+              :label="dept.deptName"
+              :value="dept.deptId">
+            </el-option>
+          </el-select>
+        </el-form-item>
+
+        <!-- 人员选择 -->
+        <el-form-item label="选择人员" v-if="showUserSelect">
+          <el-select
+            v-model="queryParams.userId"
+            placeholder="请选择人员"
+            clearable
+            :disabled="!queryParams.deptId">
+            <el-option
+              v-for="user in userList"
+              :key="user.userId"
+              :label="user.userName"
+              :value="user.userId">
+            </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-form-item>
+      </el-form>
+    </div>
+
+    <!-- 数据表格 -->
+    <div class="table-section">
+      <el-table :data="paginatedTableData" border style="width: 100%" height="400">
+        <el-table-column prop="companyName" label="公司名称" />
+        <el-table-column prop="deptName" label="部门名称" />
+        <el-table-column prop="userName" label="人员姓名" />
+        <el-table-column prop="lineNum" label="进线数" />
+        <el-table-column prop="activeNum" label="激活数" />
+        <el-table-column prop="completeNum" label="完课数" />
+        <el-table-column prop="answerNum" label="答题数" />
+        <el-table-column prop="redPacketNum" label="红包领取数" />
+      </el-table>
+
+      <el-pagination
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="currentPage"
+        :page-sizes="[10, 20, 50, 100]"
+        :page-size="pageSize"
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="tableData.length"
+        style="margin-top: 20px; text-align: right;">
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getStatisticsData, getSearchUserInfo, getSearchCompanyInfo, getSearchDeptInfo } from "@/api/statistics/statistics";
+
+export default {
+  data() {
+    return {
+      companyList: [],
+      deptList: [],
+      userList: [],
+      rawData: [],
+      tableData: [],
+      currentPage: 1,
+      pageSize: 20,
+      dateRange: [],
+      pickerOptions: {
+        shortcuts: [{
+          text: '最近一周',
+          onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+            picker.$emit('pick', [start, end]);
+          }
+        }, {
+          text: '最近一个月',
+          onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+            picker.$emit('pick', [start, end]);
+          }
+        }, {
+          text: '最近三个月',
+          onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+            picker.$emit('pick', [start, end]);
+          }
+        }]
+      },
+      queryParams: {
+        dimension: null,
+        companyId: null,
+        deptId: null,
+        userId: null
+      }
+    };
+  },
+
+  computed: {
+    paginatedTableData() {
+      const start = (this.currentPage - 1) * this.pageSize;
+      const end = start + this.pageSize;
+      return this.tableData.slice(start, end);
+    },
+
+    showDepartmentSelect() {
+      return this.queryParams.dimension &&
+        (this.queryParams.dimension === 3 || this.queryParams.dimension === 1) &&
+        this.queryParams.companyId;
+    },
+
+    showUserSelect() {
+      return this.queryParams.dimension === 1 &&
+        this.queryParams.companyId &&
+        this.queryParams.deptId;
+    }
+  },
+
+  mounted() {
+    // 设置默认时间为当天
+    const today = new Date();
+    this.dateRange = [today, today];
+    // 默认设置统计维度为公司
+    this.queryParams.dimension = 2;
+    this.loadData();
+  },
+
+  methods: {
+    loadData() {
+      // 使用 getSearchCompanyInfo 获取公司下拉数据
+      getSearchCompanyInfo().then(response => {
+        this.companyList = response.data || [];
+
+        // 默认选择第一个公司(如果存在)
+        if (this.companyList.length > 0) {
+          this.queryParams.companyId = this.companyList[0].companyId;
+          // 加载该公司的部门数据
+          return this.loadDeptData(this.queryParams.companyId);
+        }
+      }).then(() => {
+        // 在公司和部门默认选择完成后,请求统计数据
+        return this.fetchStatisticsData();
+      }).catch(error => {
+        console.error('数据加载失败:', error);
+        this.$message.error('数据加载失败');
+      });
+    },
+
+    loadDeptData(companyId) {
+      return getSearchDeptInfo({ id: companyId }).then(response => {
+        this.deptList = response.data || [];
+
+        // 默认选择第一个部门(如果存在)
+        if (this.deptList.length > 0) {
+          this.queryParams.deptId = this.deptList[0].deptId;
+        }
+      }).catch(error => {
+        console.error('部门数据加载失败:', error);
+        this.$message.error('部门数据加载失败');
+      });
+    },
+
+    fetchStatisticsData() {
+      // 构造请求参数对象
+      const params = {
+        dimension: this.queryParams.dimension,
+        startTime: this.formatDate(this.dateRange[0]),
+        endTime: this.formatDate(this.dateRange[1])
+      };
+
+      // 根据维度设置id参数
+      if (this.queryParams.dimension === 1 && this.queryParams.userId) {
+        params.id = this.queryParams.userId;
+      } else if (this.queryParams.dimension === 2 && this.queryParams.companyId) {
+        params.id = this.queryParams.companyId;
+      } else if (this.queryParams.dimension === 3 && this.queryParams.deptId) {
+        params.id = this.queryParams.deptId;
+      }
+
+      // 以POST方式发送请求体
+      return getStatisticsData(params).then(response => {
+        this.rawData = response.data || [];
+        this.tableData = [...this.rawData];
+        this.currentPage = 1;
+      }).catch(error => {
+        console.error('统计数据加载失败:', error);
+        this.$message.error('统计数据加载失败');
+      });
+    },
+
+    formatDate(date) {
+      if (!date) return '';
+      const d = new Date(date);
+      const year = d.getFullYear();
+      const month = String(d.getMonth() + 1).padStart(2, '0');
+      const day = String(d.getDate()).padStart(2, '0');
+      return `${year}-${month}-${day}`;
+    },
+
+    handleCompanyChange(companyId) {
+      this.queryParams.deptId = null;
+      this.queryParams.userId = null;
+      this.deptList = [];
+      this.userList = [];
+
+      if (!companyId) return;
+
+      // 使用 getSearchDeptInfo 获取部门下拉数据
+      getSearchDeptInfo({ id: companyId }).then(response => {
+        this.deptList = response.data || [];
+
+        // 默认选择第一个部门(如果存在)
+        // 仅在部门维度或个人维度下默认选择第一个部门
+        if (this.deptList.length > 0 &&
+          (this.queryParams.dimension === 3 || this.queryParams.dimension === 1)) {
+          this.queryParams.deptId = this.deptList[0].deptId;
+
+          // 如果是个人维度,还需要加载用户数据
+          if (this.queryParams.dimension === 1 && this.queryParams.deptId) {
+            this.loadUserData(this.queryParams.deptId);
+          }
+        }
+      }).catch(error => {
+        console.error('部门数据加载失败:', error);
+        this.$message.error('部门数据加载失败');
+      });
+    },
+
+    // 新增加载用户数据的方法
+    loadUserData(deptId) {
+      if (!deptId) return;
+
+      getSearchUserInfo({ id: deptId }).then(response => {
+        this.userList = response.data || [];
+
+        // 可以选择默认选中第一个用户
+        if (this.userList.length > 0) {
+          // this.queryParams.userId = this.userList[0].userId;
+        }
+      }).catch(error => {
+        console.error('人员数据加载失败:', error);
+        this.$message.error('人员数据加载失败');
+      });
+    },
+
+    handleDeptChange(deptId) {
+      this.queryParams.userId = null;
+      this.userList = [];
+
+      if (!deptId) return;
+
+      // 使用 getSearchUserInfo 获取人员下拉数据
+      getSearchUserInfo({ id: deptId }).then(response => {
+        this.userList = response.data || [];
+
+        // 在个人维度下,默认选择第一个用户(可选)
+        if (this.userList.length > 0 && this.queryParams.dimension === 1) {
+          // this.queryParams.userId = this.userList[0].userId;
+        }
+      }).catch(error => {
+        console.error('人员数据加载失败:', error);
+        this.$message.error('人员数据加载失败');
+      });
+    },
+
+    handleQuery() {
+      // 触发统计数据请求
+      this.fetchStatisticsData();
+    },
+
+    handleDimensionChange() {
+      // 重置后续选择项
+      this.queryParams.companyId = null;
+      this.queryParams.deptId = null;
+      this.queryParams.userId = null;
+      this.deptList = [];
+      this.userList = [];
+    },
+
+    resetQuery() {
+      this.queryParams = {
+        dimension: null,
+        companyId: null,
+        deptId: null,
+        userId: null
+      };
+      // 重置时间为当天
+      const today = new Date();
+      this.dateRange = [today, today];
+      this.deptList = [];
+      this.userList = [];
+      this.tableData = [...this.rawData];
+      this.currentPage = 1;
+    },
+
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+    },
+
+    handleCurrentChange(val) {
+      this.currentPage = val;
+    }
+  }
+};
+</script>
+
+<style scoped>
+.app-container {
+  border: 1px solid #e6e6e6;
+  padding: 12px;
+  background-color: #f5f7fa;
+}
+
+.app-content {
+  background-color: white;
+  padding: 20px;
+  border-radius: 4px;
+  margin-bottom: 20px;
+}
+
+.title {
+  text-align: center;
+  font-size: 24px;
+  font-weight: bold;
+  color: #333;
+  margin-bottom: 20px;
+}
+
+.search-form {
+  display: flex;
+  justify-content: center;
+  flex-wrap: wrap;
+}
+
+.search-form .el-form-item {
+  margin-bottom: 10px;
+}
+
+.table-section {
+  background-color: white;
+  padding: 20px;
+  border-radius: 4px;
+}
+
+.table-section .el-table {
+  width: 100% !important;
+}
+
+@media (min-width: 1200px) {
+  .table-section {
+    padding: 20px 50px;
+  }
+}
+</style>

+ 46 - 2
src/views/his/user/index.vue

@@ -66,6 +66,17 @@
                  />
         </el-select>
       </el-form-item>
+
+      <el-form-item label="推广员" prop="isPromoter">
+        <el-select v-model="queryParams.isPromoter" placeholder="请选择推广员" clearable size="small">
+          <el-option
+            v-for="dict in userIsPromoterOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="注册时间" prop="createTime">
                 <el-date-picker v-model="createTime" size="small" style="width: 230px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="change"></el-date-picker>
       </el-form-item>
@@ -171,7 +182,7 @@
     />
 
     <!-- 添加或修改用户对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+    <el-dialog :title="title" :visible.sync="open" width="800px" 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="请输入用户昵称" />
@@ -197,7 +208,36 @@
             />
           </el-select>
         </el-form-item>
-
+        <el-form-item label="会员昵称" prop="nickname">
+          <el-input v-model="form.nickname" placeholder="请输入用户昵称" />
+        </el-form-item>
+        <el-form-item label="手机号码" prop="phone">
+          <el-input v-model="form.phone" disabled placeholder="请输入手机号码" />
+        </el-form-item>
+        <el-form-item label="进线日期" prop="registerDate">
+          <el-date-picker clearable size="small"
+                          v-model="form.registerDate"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="选择进线日期">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="推线编码" prop="registerCode">
+          <el-input v-model="form.registerCode" placeholder="请输入推线编码" />
+        </el-form-item>
+        <el-form-item label="渠道来源" prop="source">
+          <el-input v-model="form.source" placeholder="请输入渠道来源" />
+        </el-form-item>
+        <el-form-item label="是否为推广员" prop="isPromoter">
+          <el-select style="width: 200px" v-model="form.isPromoter" placeholder="请选择" clearable size="small" >
+            <el-option
+              v-for="item in userIsPromoterOptions"
+              :key="item.dictValue"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+            />
+          </el-select>
+        </el-form-item>
         <el-form-item label="用户备注" prop="remark" >
           <el-input v-model="form.remark" placeholder="请输入用户备注" type="textarea"/>
         </el-form-item>
@@ -245,6 +285,7 @@ export default {
   components: {userDetails,userDetailsByNew},
   data() {
     return {
+      userIsPromoterOptions:[],
       companyName: null,
       companyUserNickName: null,
       companyOptions: [],
@@ -354,6 +395,9 @@ export default {
     this.getDicts("user_level").then(response => {
       this.userLevelOptions = response.data;
     });
+    this.getDicts("user_is_promoter").then((response) => {
+      this.userIsPromoterOptions = response.data;
+    });
 
   },
   methods: {

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

@@ -268,10 +268,10 @@ export default {
     this.getDicts("common_status").then((response) => {
       this.statusOptions = response.data;
     });
-    this.getDicts("adv_adv_type").then((response) => {
+    this.getDicts("sys_adv_type").then((response) => {
       this.advTypeOptions = response.data;
     });
-    this.getDicts("adv_show_type").then((response) => {
+    this.getDicts("sys_adv_show").then((response) => {
       this.showTypeOptions = response.data;
     });
     this.getList();

+ 6 - 6
src/views/hisStore/express/index.vue

@@ -23,7 +23,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['store:express:add']"
+          v-hasPermi="['his:express:add']"
         >新增</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -33,7 +33,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['store:express:edit']"
+          v-hasPermi="['his:express:edit']"
         >修改</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -43,7 +43,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['store:express:remove']"
+          v-hasPermi="['his:express:remove']"
         >删除</el-button>
       </el-col>
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -63,21 +63,21 @@
             type="text"
             icon="el-icon-edit"
             @click="handleAllot(scope.row)"
-            v-hasPermi="['store:express:allot']"
+            v-hasPermi="['his:express:allot']"
           >分配公司</el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['store:express:edit']"
+            v-hasPermi="['his:express:edit']"
           >修改</el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['store:express:remove']"
+            v-hasPermi="['his:express:remove']"
           >删除</el-button>
         </template>
       </el-table-column>

+ 8 - 6
src/views/hisStore/storeProduct/index.vue

@@ -1076,6 +1076,7 @@ export default {
       },
       // 表单参数
       form: {},
+      storeForm: {isAudit:1,status:1},
       // 表单校验
       rules: {
         image: [
@@ -1163,9 +1164,9 @@ export default {
         precautions: [
           { required: true, message: "注意事项不能为空", trigger: "blur" }
         ],
-        storeId :[
-          { required: true, message: "所属店铺不能为空", trigger: "blur"}
-        ],
+        // storeId :[
+        //   { required: true, message: "所属店铺不能为空", trigger: "blur"}
+        // ],
       }
     };
   },
@@ -1200,7 +1201,7 @@ export default {
     getCompanyList().then(response => {
       this.companyOptions = response.data;
     });
-    listStore().then(response => {
+    listStore(this.storeForm).then(response => {
       this.storeOptions = response.rows;
     });
     this.getTreeselect();
@@ -1215,7 +1216,7 @@ export default {
       const option = this.isShowOptions.find(item => item.dictValue == row.isShow);
       return option ? option.dictLabel : '未知状态';
     },
-    
+
     getStatusType(row) {
       console.log(row)
       if (row.isAudit == 0) {
@@ -1308,7 +1309,8 @@ export default {
     },
     //生成SKU
     generate () {
-      genFormatAttr(this.form.productId, { attrs: this.attrs }).then(res => {
+      var prodoct = this.form.productId?this.form.productId:0;
+      genFormatAttr(prodoct, { attrs: this.attrs }).then(res => {
         if(this.form.specType === 0){
           this.oneFormValidate = res.value;
           this.form.header = res.header;

+ 152 - 0
src/views/qw/user/selectDoctor.vue

@@ -0,0 +1,152 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="医生名称" prop="doctorName">
+        <el-input
+          style="width:220px"
+          v-model="queryParams.doctorName"
+          placeholder="请输入医生名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="医生手机" prop="mobile">
+        <el-input
+        style="width:220px"
+          v-model="queryParams.mobile"
+          placeholder="请输入医生手机"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </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-table  height="500" border v-loading="loading" :data="doctorList" ref="doctorList" >
+      <el-table-column label="医生名称" align="center" prop="doctorName" />
+      <el-table-column label="手机号码" align="center" prop="mobile" />
+      <el-table-column label="操作"   align="center" fixed="right" width="120px" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="medium"
+            type="primary"
+            plain
+            @click="handleBind(scope.row)"
+          >绑定</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+
+  </div>
+</template>
+
+<script>
+import { listDoctorVO } from "@/api/doctor/doctor";
+
+export default {
+  name: "miniCustomer",
+  components: {},
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 客户表格数据
+      doctorList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userId: null,
+        doctorName: null,
+        mobile: null,
+      },
+      // 表单参数
+      form: {
+      },
+      // 表单校验
+      rules: {
+      },
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+
+    /** 查询客户列表 */
+    getList() {
+      this.loading = true;
+
+      listDoctorVO(this.queryParams).then(response => {
+        this.doctorList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+
+    //绑定选择
+    handleBind(row){
+      this.$emit("bindCompanyUserDoctorId",row.doctorId)
+      this.$refs.doctorList.clearSelection();
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+
+  }
+};
+</script>
+<style>
+  .el-tag + .el-tag {
+    margin-left: 10px;
+  }
+  .button-new-tag {
+    margin-left: 10px;
+    height: 32px;
+    line-height: 30px;
+    padding-top: 0;
+    padding-bottom: 0;
+  }
+  .input-new-tag {
+    width: 90px;
+    margin-left: 10px;
+    vertical-align: bottom;
+  }
+  .el-dialog__wrapper{
+    z-index: 100000;
+  }
+</style>

+ 32 - 1
src/views/system/config/config.vue

@@ -1128,7 +1128,15 @@
           <el-form-item label="汇付大额退款回调地址" prop="hfOnlineRefundNotifyUrl">
             <el-input v-model="form17.hfOnlineRefundNotifyUrl" label="汇付大额退款回调地址"></el-input>
           </el-form-item>
-          -->
+
+          <el-form-item  label="下单归属" prop="orderAttribution">
+            <el-tooltip class="item" effect="dark" content="销售制单下单归属" placement="top-end">
+              <el-radio-group v-model="form17.orderAttribution">
+                <el-radio :label="1">多销售</el-radio>
+                <el-radio :label="2">单销售</el-radio>
+              </el-radio-group>
+            </el-tooltip>
+          </el-form-item>
 
           <div class="footer">
             <el-button type="primary" @click="submitForm17">提 交</el-button>
@@ -1236,6 +1244,15 @@
           </el-form-item>
 
 
+          <!--   红包余额是否扣减开关      -->
+          <el-form-item label="红包余额是否扣减开关">
+            <el-radio-group v-model="form18.isRedPackageBalanceDeduction">
+              <el-radio label="1">开</el-radio>
+              <el-radio label="0">关</el-radio>
+            </el-radio-group>
+          </el-form-item>
+
+
           <el-form-item label="禁止发送时间段">
             <el-row v-for="(item, index) in form18.disabledTimeList" style="margin-top: 10px">
               <el-time-picker
@@ -1316,6 +1333,16 @@
             >
             </el-switch>
           </el-form-item>
+
+          <span style="color: red;font-size: 12px;">(打开后,每家公司客户仅允许绑定一个销售,打开前请关闭 是否单销售观看 按钮)</span>
+          <el-form-item label="是否允许不同公司销售观看" prop="moreCompanyCourse" label-width="120">
+            <el-switch
+              v-model="form18.moreCompanyCourse"
+              active-color="#13ce66"
+              inactive-color="#ff4949"
+            >
+            </el-switch>
+          </el-form-item>
           <el-form-item label="是否允许用户暂停" prop="isAllowUserPause" label-width="120">
             <el-switch
               v-model="form18.isAllowUserPause"
@@ -1737,6 +1764,10 @@
           </div>
         </el-form>
       </el-tab-pane>
+
+      <el-tab-pane label="公司销售角色默认生成配置" name="companymenu.config">
+        <companyMenuConfig></companyMenuConfig>
+      </el-tab-pane>
       <el-tab-pane label="APP推广" name="app.config">
         <el-form ref="form25" :model="form25" :rules="rules25" label-width="160px">
           <el-form-item label="APP推广图片" prop="images">