소스 검색

Merge remote-tracking branch 'origin/master'

吴树波 3 주 전
부모
커밋
24241ebf80
41개의 변경된 파일5641개의 추가작업 그리고 196개의 파일을 삭제
  1. 25 0
      .env.prod-jsbk
  2. 1 0
      package.json
  3. 70 0
      src/api/company/companyAiWorkflowServer.js
  4. 30 16
      src/api/company/companyVoiceRobotic.js
  5. 33 0
      src/api/company/easyCall.js
  6. 8 0
      src/api/crm/customer.js
  7. 111 0
      src/api/hisStore/storeOrder.js
  8. 17 0
      src/api/live/liveData.js
  9. 12 3
      src/api/qw/qwUser.js
  10. 9 0
      src/api/qw/sopLogs.js
  11. 53 0
      src/api/wx/sopUserLogsWx.js
  12. 8 0
      src/api/wx/wxSop.js
  13. 18 0
      src/api/wx/wxSopLogs.js
  14. BIN
      src/assets/logo/jsbk.jpg
  15. 37 3
      src/router/index.js
  16. 11 0
      src/views/company/companyClient/index.vue
  17. 55 0
      src/views/company/companyUser/index.vue
  18. 289 55
      src/views/company/companyVoiceRobotic/index.vue
  19. 20 3
      src/views/company/companyWorkflow/design.scss
  20. 150 13
      src/views/company/companyWorkflow/design.vue
  21. 7 13
      src/views/company/companyWorkflow/index.vue
  22. 3 3
      src/views/components/QwUserSelect.vue
  23. 221 0
      src/views/components/QwUserSelectTwo.vue
  24. 73 5
      src/views/crm/components/CustomerSelect.vue
  25. 1 1
      src/views/crm/components/aiCallVoiceLog.vue
  26. 20 0
      src/views/hisStore/components/productOrder.vue
  27. 2702 0
      src/views/hisStore/storeOrder/healthStoreList.vue
  28. 275 0
      src/views/live/liveData/indexCompany.vue
  29. 7 0
      src/views/qw/externalContact/deptIndex.vue
  30. 7 0
      src/views/qw/externalContact/index.vue
  31. 7 0
      src/views/qw/externalContact/myExternalContact.vue
  32. 1 1
      src/views/qw/sop/sop.vue
  33. 35 5
      src/views/qw/sopLogs/sopLogsList.vue
  34. 95 3
      src/views/qw/sopTemp/updateSopTemp.vue
  35. 157 57
      src/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue
  36. 28 9
      src/views/qw/sopUserLogsInfo/sendMsgSopOpenTool.vue
  37. 90 3
      src/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue
  38. 188 0
      src/views/wx/sopUserLogsWx/detail.vue
  39. 351 0
      src/views/wx/sopUserLogsWx/sopUserLogsScheduleWx.vue
  40. 121 3
      src/views/wx/wxSop/index.vue
  41. 295 0
      src/views/wx/wxSop/sopLogsList.vue

+ 25 - 0
.env.prod-jsbk

@@ -0,0 +1,25 @@
+# 页面标题
+VUE_APP_TITLE =济世百康客服系统
+# 公司名称
+VUE_APP_COMPANY_NAME =辽宁济世百康大药房有限公司
+# ICP备案号
+VUE_APP_ICP_RECORD =辽ICP备2025055445号-16
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/jsbk.jpg
+
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 1
+
+#项目所属
+VUE_APP_PROJECT_FROM=jsbk
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 1 - 0
package.json

@@ -59,6 +59,7 @@
     "build:prod-xcsw": "vue-cli-service build --mode prod-xcsw",
     "build:prod-zlwh": "vue-cli-service build --mode prod-zlwh",
     "build:prod-mengniu": "vue-cli-service build --mode prod-mengniu",
+    "build:prod-jsbk": "vue-cli-service build --mode prod-jsbk",
     "preview": "node build/index.js --preview",
     "lint": "eslint --ext .js,.vue src",
     "test:unit": "jest --clearCache && vue-cli-service test:unit",

+ 70 - 0
src/api/company/companyAiWorkflowServer.js

@@ -0,0 +1,70 @@
+import request from '@/utils/request'
+
+// 查询cid服务列表
+export function listServer(query) {
+  return request({
+    url: '/company/cid/server/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询cid服务详细
+export function getServer(id) {
+  return request({
+    url: '/company/cid/server/' + id,
+    method: 'get'
+  })
+}
+
+// 新增cid服务
+export function addServer(data) {
+  return request({
+    url: '/company/cid/server',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改cid服务
+export function updateServer(data) {
+  return request({
+    url: '/company/cid/server',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除cid服务
+export function delServer(id) {
+  return request({
+    url: '/company/cid/server/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出cid服务
+export function exportServer(query) {
+  return request({
+    url: '/company/cid/server/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 绑定cid服务
+export function bindCidServer(data) {
+  return request({
+    url: '/company/cid/server/bindCidServer',
+    method: 'post',
+    data: data
+  })
+}
+
+export function unbindCidServer(data) {
+  return request({
+    url: '/company/cid/server/unbindCidServer',
+    method: 'post',
+    data: data
+  })
+}

+ 30 - 16
src/api/company/companyVoiceRobotic.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 查询机器人外呼任务列表
 export function listRobotic(query) {
   return request({
-    url: 'company/companyVoiceRobotic/list',
+    url: '/company/companyVoiceRobotic/list',
     method: 'get',
     params: query
   })
@@ -11,7 +11,7 @@ export function listRobotic(query) {
 // 查询机器人外呼任务列表
 export function listAll(query) {
   return request({
-    url: 'company/companyVoiceRobotic/listAll',
+    url: '/company/companyVoiceRobotic/listAll',
     method: 'get',
     params: query
   })
@@ -19,7 +19,7 @@ export function listAll(query) {
 // 查询机器人外呼任务列表
 export function calleesList(query) {
   return request({
-    url: 'company/companyVoiceRobotic/calleesList',
+    url: '/company/companyVoiceRobotic/calleesList',
     method: 'get',
     params: query
   })
@@ -28,7 +28,7 @@ export function calleesList(query) {
 // 查询机器人外呼任务详细
 export function getRobotic(id) {
   return request({
-    url: 'company/companyVoiceRobotic/' + id,
+    url: '/company/companyVoiceRobotic/' + id,
     method: 'get'
   })
 }
@@ -36,7 +36,7 @@ export function getRobotic(id) {
 // 新增机器人外呼任务
 export function addRobotic(data) {
   return request({
-    url: 'company/companyVoiceRobotic',
+    url: '/company/companyVoiceRobotic',
     method: 'post',
     data: data
   })
@@ -45,7 +45,7 @@ export function addRobotic(data) {
 // 修改机器人外呼任务
 export function updateRobotic(data) {
   return request({
-    url: 'company/companyVoiceRobotic',
+    url: '/company/companyVoiceRobotic',
     method: 'put',
     data: data
   })
@@ -54,7 +54,7 @@ export function updateRobotic(data) {
 // 删除机器人外呼任务
 export function delRobotic(id) {
   return request({
-    url: 'company/companyVoiceRobotic/' + id,
+    url: '/company/companyVoiceRobotic/' + id,
     method: 'delete'
   })
 }
@@ -62,7 +62,7 @@ export function delRobotic(id) {
 // 导出机器人外呼任务
 export function exportRobotic(query) {
   return request({
-    url: 'company/companyVoiceRobotic/export',
+    url: '/company/companyVoiceRobotic/export',
     method: 'get',
     params: query
   })
@@ -71,14 +71,14 @@ export function exportRobotic(query) {
 // 导出机器人外呼任务
 export function getTypes() {
   return request({
-    url: 'company/companyVoiceRobotic/getTypes',
+    url: '/company/companyVoiceRobotic/getTypes',
     method: 'get'
   })
 }
 // 导出机器人外呼任务
 export function statusList(ids) {
   return request({
-    url: 'company/companyVoiceRobotic/statusList',
+    url: '/company/companyVoiceRobotic/statusList',
     method: 'get',
     params: {ids}
   })
@@ -86,7 +86,7 @@ export function statusList(ids) {
 // 导出机器人外呼任务
 export function startRobotic(taskId) {
   return request({
-    url: 'company/companyVoiceRobotic/startRobotic',
+    url: '/company/companyVoiceRobotic/startRobotic',
     method: 'get',
     params: {taskId}
   })
@@ -94,7 +94,7 @@ export function startRobotic(taskId) {
 // 导出机器人外呼任务
 export function stopRobotic(taskId) {
   return request({
-    url: 'company/companyVoiceRobotic/stopRobotic',
+    url: '/company/companyVoiceRobotic/stopRobotic',
     method: 'get',
     params: {taskId}
   })
@@ -102,7 +102,7 @@ export function stopRobotic(taskId) {
 // 导出机器人外呼任务
 export function companyUserList(params) {
   return request({
-    url: 'company/companyVoiceRobotic/companyUserList',
+    url: '/company/companyVoiceRobotic/companyUserList',
     method: 'get',
     params
   })
@@ -111,7 +111,7 @@ export function companyUserList(params) {
 // 导出机器人外呼任务
 export function wxList(params) {
   return request({
-    url: 'company/companyVoiceRobotic/wxList',
+    url: '/company/companyVoiceRobotic/wxList',
     method: 'get',
     params
   })
@@ -120,7 +120,7 @@ export function wxList(params) {
 
 export function taskRun(params) {
   return request({
-    url: 'company/companyVoiceRobotic/taskRun',
+    url: '/company/companyVoiceRobotic/taskRun',
     method: 'get',
     params
   })
@@ -135,7 +135,7 @@ export function getSmsTempList() {
 
 export function getCIDGroupList(params) {
   return request({
-    url: 'company/companyVoiceRobotic/getCIDGroupList',
+    url: '/company/companyVoiceRobotic/getCIDGroupList',
     method: 'get',
     params
   })
@@ -149,3 +149,17 @@ export function getExecRecords(roboticId) {
     params: { roboticId }
   })
 }
+export function wxListQw(params) {
+  return request({
+    url: 'company/companyVoiceRobotic/wxListQw',
+    method: 'get',
+    params
+  })
+}
+export function getCurrentCompanyId() {
+  return request({
+    url: '/company/companyVoiceRobotic/getCurrentCompanyId',
+    method: 'get'
+  })
+}
+

+ 33 - 0
src/api/company/easyCall.js

@@ -0,0 +1,33 @@
+import request from '@/utils/request'
+
+// 获取外呼网关列表(外呼线路)
+export function getGatewayList() {
+  return request({
+    url: '/company/easyCall/gateway/list',
+    method: 'get'
+  })
+}
+
+// 获取大模型配置列表(大模型底座)
+export function getLlmAccountList() {
+  return request({
+    url: '/company/easyCall/llmAccount/list',
+    method: 'get'
+  })
+}
+
+// 获取音色列表
+export function getVoiceCodeList() {
+  return request({
+    url: '/company/easyCall/voiceCode/list',
+    method: 'get'
+  })
+}
+
+// 获取技能组列表(tts厂商)
+export function getBusiGroupList() {
+  return request({
+    url: '/company/easyCall/busiGroup/list',
+    method: 'get'
+  })
+}

+ 8 - 0
src/api/crm/customer.js

@@ -22,6 +22,14 @@ export function listCustomerAll(query) {
     params: query
   })
 }
+export function listNoPage(query) {
+  return request({
+    url: '/crm/customer/listNoPage',
+    method: 'get',
+    params: query
+  })
+}
+
 export function getCustomerList(query) {
   return request({
     url: '/crm/customer/getCustomerList',

+ 111 - 0
src/api/hisStore/storeOrder.js

@@ -186,3 +186,114 @@ export function queryUserOtherOrderPage(query) {
   })
 }
 
+// 查询直播订单列表(仅 orderType=2,分公司负责人查全公司,销售查自己)- fs-company 接口
+export function listHealthLiveStoreOrder(data) {
+  return request({
+    url: '/store/storeOrder/healthLiveList',
+    method: 'post',
+    data: data
+  })
+}
+
+// 以下为健康商城/直播订单页所需接口(可走网关到 store 或 company)
+export function importTemplate() {
+  return request({
+    url: '/store/store/storeOrder/importTemplate',
+    method: 'get'
+  })
+}
+
+export function importDeliveryNoteExpressTemplate() {
+  return request({
+    url: '/store/store/storeOrder/importDeliveryNoteExpressTemplate',
+    method: 'get'
+  })
+}
+
+export function exportHealthStoreOrderItems(query) {
+  return request({
+    url: '/store/storeOrder/healthExportItems',
+    method: 'get',
+    params: query
+  })
+}
+
+export function exportHealthStoreOrder(data) {
+  return request({
+    url: '/store/storeOrder/healthExport',
+    method: 'post',
+    data: data
+  })
+}
+
+export function exportHealthStoreOrderDetails(data) {
+  return request({
+    url: '/store/storeOrder/healthExportDetails',
+    method: 'post',
+    data: data
+  })
+}
+
+export function exportHealthStoreOrderItemsDetails(query) {
+  return request({
+    url: '/store/storeOrder/healthExportItemsDetails',
+    method: 'get',
+    params: query
+  })
+}
+
+export function getErpAccount() {
+  return request({
+    url: '/store/store/storeOrder/getErpAccount',
+    method: 'get'
+  })
+}
+
+export function healthExportShippingOrder(query) {
+  return request({
+    url: '/store/store/storeOrder/healthExportShippingOrder',
+    method: 'get',
+    params: query
+  })
+}
+
+export function queryErpPhone(query) {
+  return request({
+    url: '/store/store/storeOrder/queryErpPhone',
+    method: 'get',
+    params: query
+  })
+}
+
+export function saveErpPhone(data) {
+  return request({
+    url: '/store/store/storeOrder/saveErpPhone',
+    method: 'post',
+    data: data
+  })
+}
+
+export function editErpPhone(data) {
+  return request({
+    url: '/store/store/storeOrder/editErpPhone',
+    method: 'post',
+    data: data
+  })
+}
+
+export function batchCreateErpOrder(data) {
+  return request({
+    url: '/store/store/storeOrder/batchCreateErpOrder',
+    method: 'post',
+    data: data
+  })
+}
+
+export function batchSetErpOrder(data) {
+  return request({
+    url: '/store/store/storeOrder/batchSetErpOrder',
+    method: 'post',
+    data: data
+  })
+}
+

+ 17 - 0
src/api/live/liveData.js

@@ -104,3 +104,20 @@ export function exportLiveData(query) {
   })
 }
 
+// 分公司直播数据统计列表
+export function listLiveDataCompany(data) {
+  return request({
+    url: '/liveData/liveData/listLiveDataCompany',
+    method: 'post',
+    data: data
+  })
+}
+
+// 导出分公司直播数据统计
+export function exportLiveDataCompany(data) {
+  return request({
+    url: '/liveData/liveData/exportLiveDataCompany',
+    method: 'post',
+    data: data
+  })
+}

+ 12 - 3
src/api/qw/qwUser.js

@@ -8,11 +8,20 @@ export function getQwUserAll() {
   })
 }
 
-// 根据条件查询企微用户列表
-export function getQwList(params) {
+// 查销售所在企业
+export function queryQwList(params) {
   return request({
-    url: '/qw/user/qwList',
+    url: '/qw/user/queryQwList',
     method: 'get',
     params: params
   })
 }
+//查全部
+export function getUserList(params) {
+  return request({
+    url: '/qw/user/userList',
+    method: 'get',
+    params: params
+  })
+}
+

+ 9 - 0
src/api/qw/sopLogs.js

@@ -77,3 +77,12 @@ export function generateShortLink(data) {
     data: data
   })
 }
+
+//生成直播短链
+export function generateLiveShortLink(data) {
+  return request({
+    url: '/qw/sopLogs/generateLiveShortLink',
+    method: 'post',
+    data: data
+  })
+}

+ 53 - 0
src/api/wx/sopUserLogsWx.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询个微SOP营期列表
+export function listSopUserLogsWx(query) {
+  return request({
+    url: '/wxSop/sopUserLogsWx/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询个微SOP营期详细
+export function getSopUserLogsWx(id) {
+  return request({
+    url: '/wxSop/sopUserLogsWx/' + id,
+    method: 'get'
+  })
+}
+
+// 删除个微SOP营期
+export function delSopUserLogsWx(ids) {
+  return request({
+    url: '/wxSop/sopUserLogsWx/' + ids,
+    method: 'delete'
+  })
+}
+
+// 导出个微SOP营期
+export function exportSopUserLogsWx(query) {
+  return request({
+    url: '/wxSop/sopUserLogsWx/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 批量修改个微SOP营期时间
+export function updateLogDate(data) {
+  return request({
+    url: '/wxSop/sopUserLogsWx/updateLogDate',
+    method: 'post',
+    data: data
+  })
+}
+
+// 查询个微SOP营期详情(客户列表)
+export function getSopUserLogsDetail(sopUserId, query) {
+  return request({
+    url: '/wxSop/sopUserLogsWx/detail/' + sopUserId,
+    method: 'get',
+    params: query
+  })
+}

+ 8 - 0
src/api/wx/wxSop.js

@@ -50,4 +50,12 @@ export function exportWxSop(query) {
     method: 'get',
     params: query
   })
+}
+
+// 批量执行个微SOP
+export function updateWxStatus(ids) {
+  return request({
+    url: '/qw/sop/updateWxStatus/' + ids,
+    method: 'get'
+  })
 }

+ 18 - 0
src/api/wx/wxSopLogs.js

@@ -50,4 +50,22 @@ export function exportWxSopLogs(query) {
     method: 'get',
     params: query
   })
+}
+
+// 查询个微SOP执行详情列表
+export function listWxSopLogsCVO(query) {
+  return request({
+    url: '/wx/wxSopLogs/listCVO',
+    method: 'get',
+    params: query
+  })
+}
+
+// 导出个微SOP执行详情
+export function exportWxSopLogsCVO(query) {
+  return request({
+    url: '/wx/wxSopLogs/exportCVO',
+    method: 'post',
+    params: query
+  })
 }

BIN
src/assets/logo/jsbk.jpg


+ 37 - 3
src/router/index.js

@@ -249,6 +249,40 @@ export const constantRoutes = [
     ]
   },
 
+  {
+    path: '/wxSop/sopUserLogsWx',
+    component: Layout,
+    hidden: true,
+    children: [
+      {
+        path: 'sopUserLogsScheduleWx/:id',
+        component: () => import('@/views/wx/sopUserLogsWx/sopUserLogsScheduleWx.vue'),
+        name: 'sopUserLogsScheduleWx',
+        meta: { title: '个微SOP营期', activeMenu: '/wx/wxSop' }
+      },
+      {
+        path: 'detail',
+        component: () => import('@/views/wx/sopUserLogsWx/detail.vue'),
+        name: 'sopUserLogsDetailWx',
+        meta: { title: '个微SOP营期详情', activeMenu: '/wx/wxSop' }
+      }
+    ]
+  },
+
+  {
+    path: '/wxSop/wxSop',
+    component: Layout,
+    hidden: true,
+    children: [
+      {
+        path: 'sopLogsList/:id',
+        component: () => import('@/views/wx/wxSop/sopLogsList.vue'),
+        name: 'WxSopLogsList',
+        meta: { title: '个微SOP执行详情', activeMenu: '/wx/wxSop' }
+      }
+    ]
+  },
+
   {
     path: '/watch/deviceInfo/details',
     component: Layout,
@@ -285,7 +319,7 @@ export const constantRoutes = [
   ]
 },,
   {
-  path: '/company/companyWorkflow',
+  path: '/companyWx/companyWorkflow',
   component: () => import('@/layout/index'),
   hidden: true,
   children: [
@@ -299,13 +333,13 @@ export const constantRoutes = [
       path: 'design',
       component: () => import('@/views/company/companyWorkflow/design'),
       name: 'AiWorkflowDesign',
-      meta: { title: 'AI外呼工作流设计', activeMenu: '/company/companyWorkflow' }
+      meta: { title: 'AI外呼工作流设计', activeMenu: '/companyWx/companyWorkflow' }
     },
     {
       path: 'design/:id',
       component: () => import('@/views/company/companyWorkflow/design'),
       name: 'AiWorkflowEdit',
-      meta: { title: '编辑AI外呼工作流', activeMenu: '/company/companyWorkflow' }
+      meta: { title: '编辑AI外呼工作流', activeMenu: '/companyWx/companyWorkflow' }
     }
   ]
   },

+ 11 - 0
src/views/company/companyClient/index.vue

@@ -38,6 +38,11 @@
           <el-option v-for="item in diaLogList" :label="item.name" :value="item.id"/>
         </el-select>
       </el-form-item>
+      <el-form-item label="加微类型" prop="isWeCom">
+        <el-select v-model="queryParams.isWeCom" filterable clearable>
+          <el-option v-for="item in weComList" :label="item.name" :value="item.id"/>
+        </el-select>
+      </el-form-item>
       <el-form-item label="销售" prop="roboticWxId">
         <el-select v-model="queryParams.roboticWxId" filterable clearable>
           <el-option v-for="item in accountList" :label="item.companyUserName + '-' + item.wxNickName"
@@ -108,6 +113,11 @@
       <el-table-column label="个微昵称" align="center" prop="nickName"/>
       <el-table-column label="手机号" align="center" prop="phone"/>
       <el-table-column label="话术" align="center" prop="dialogName"/>
+      <el-table-column label="加微类型" align="center" prop="isWeCom">
+        <template slot-scope="scope">
+             <el-tag v-for="item in weComList" v-if="scope.row.isWeCom == item.id">{{item.name}}</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="客户意向度" align="center">
         <template slot-scope="scope">
           <el-tag v-for="item in levelList" v-if="scope.row.intention == item.dictValue">{{item.dictLabel}}</el-tag>
@@ -218,6 +228,7 @@ export default {
   components: {qwUserSelect, CountTo},
   data() {
     return {
+      weComList:[{id:1,name:"个微"},{id:2,name:"企微"}],
       // 遮罩层
       loading: true,
       // 选中数组

+ 55 - 0
src/views/company/companyUser/index.vue

@@ -256,6 +256,26 @@
                 @click="handleBindUser(scope.row)"
               >绑定用户</el-button>
 
+              <el-button
+              v-if="!!scope.row.cidServerId"
+                size="mini"
+                type="text"
+                icon="el-icon-s-platform"
+                plain
+                :loading="bindCidServerLoading"
+                @click="handleUnbindCidServer(scope.row)"
+              >取消绑定cid服务</el-button>
+              <el-button
+              v-else
+                size="mini"
+                type="text"
+                icon="el-icon-s-platform"
+                plain
+                :loading="bindCidServerLoading"
+                @click="handleBindCidServer(scope.row)"
+              >绑定cid服务</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>
@@ -719,11 +739,13 @@ import { getConfigByKey } from "@/api/company/companyConfig";
 import axios from "axios";
 import {addCodeUrl} from "../../../api/company/companyUser";
 import selectDoctor from "@/views/qw/user/selectDoctor.vue";
+import {bindCidServer,unbindCidServer} from "@/api/company/companyAiWorkflowServer"
 export default {
   name: "User",
   components: {selectDoctor, Treeselect ,selectUser},
   data() {
     return {
+      bindCidServerLoading:false,
       doctor: {
         open: false,
         title: '绑定医生'
@@ -1708,6 +1730,39 @@ export default {
       // 查询已绑定的用户
       this.loadBoundUsers(row.userId);
     },
+    //用户绑定cidserver服务器
+    handleBindCidServer(row){
+      let param = {
+        userId : row.userId,
+        companyId :  row.companyId
+      }
+      this.bindCidServerLoading = true;
+        bindCidServer(param).then(res=>{
+          console.log(res);
+          this.bindCidServerLoading = false;
+          this.$message.success('绑定成功');
+          this.getList();
+        }).catch(res=>{
+          this.bindCidServerLoading = false;
+          console.log(res)
+        })
+    },
+    //用户解绑cidserver服务器
+    handleUnbindCidServer(row){
+      let param = {
+        userId : row.userId,
+        companyId :  row.companyId
+      }
+      this.bindCidServerLoading = true;
+      unbindCidServer(param).then(res=>{
+        this.bindCidServerLoading = false;
+        this.$message.success('解绑成功');
+        this.getList();
+      }).catch(res=>{
+        this.bindCidServerLoading = false; 
+        console.log(res)
+      });
+    },
     /** 查询已绑定的用户 */
     loadBoundUsers(companyUserId) {
       getBoundUsers(companyUserId).then(response => {

+ 289 - 55
src/views/company/companyVoiceRobotic/index.vue

@@ -10,14 +10,14 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="机器人" prop="robot">
+      <!-- <el-form-item label="机器人" prop="robot">
         <el-select v-model="queryParams.robot" filterable clearable>
           <el-option v-for="item in robotList" :label="item.name + '('+item.num+')'" :value="item.id"/>
         </el-select>
-      </el-form-item>
-      <el-form-item label="话术" prop="dialogId">
-        <el-select v-model="queryParams.dialogId" filterable clearable>
-          <el-option v-for="item in dialogList" :label="item.name" :value="item.id"/>
+      </el-form-item> -->
+      <el-form-item label="任务类型" prop="taskType">
+        <el-select v-model="queryParams.taskType" filterable clearable>
+          <el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id"/>
         </el-select>
       </el-form-item>
       <el-form-item>
@@ -85,6 +85,18 @@
           <el-tag v-if="scope.row.addType == 1">意向</el-tag>
         </template>
       </el-table-column>
+      <el-table-column label="添加类型" align="center" prop="isWeCom">
+        <template slot-scope="scope">
+          <!-- <el-tag v-if="scope.row.isWeCom == 1">个微</el-tag> -->
+          <el-tag v-if="scope.row.isWeCom == 2">企微</el-tag>
+        </template>
+      </el-table-column>
+       <el-table-column label="任务类型" align="center" prop="taskType">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.taskType == 1">普通任务</el-tag>
+          <el-tag v-if="scope.row.taskType == 2">场景任务</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="任务状态" align="center">
         <template slot-scope="scope">
             <el-tag v-if="scope.row.taskStatus == 0">未启动</el-tag>
@@ -117,7 +129,7 @@
           <el-button
             size="mini"
             type="text"
-            @click="wxOpen(scope.row.id)"
+            @click="wxOpen(scope.row.id,scope.row.isWeCom)"
             v-hasPermi="['system:companyVoiceRobotic:list']"
           >加微管理</el-button>
           <el-button
@@ -133,13 +145,13 @@
             v-if="scope.row.taskStatus == 0"
             @click="taskRunFun(scope.row.id)"
           >启动任务</el-button>
-          <el-button
+          <!-- <el-button
             size="mini"
             type="text"
             v-if="statusObj.hasOwnProperty(scope.row.taskId) && (statusObj[scope.row.taskId].runningStatus == 0 || statusObj[scope.row.taskId].runningStatus == 3)"
             @click="startRoboticFun(scope.row.taskId)"
             v-hasPermi="['system:companyVoiceRobotic:list']"
-          >开启外呼任务</el-button>
+          >开启外呼任务</el-button> -->
           <el-button
             size="mini"
             type="text"
@@ -171,7 +183,19 @@
     <el-drawer size="45%" :title="title" :visible.sync="open" width="500px" append-to-body class="task-form-drawer">
       <div class="drawer-content">
         <el-form ref="form" :model="form" :rules="rules" label-width="90px" class="task-form">
-          <div class="form-section">
+            <div class="form-section" >
+               <div class="section-title">
+                <i class="el-icon-document"></i>
+                <span>任务类型</span>
+              </div>
+             <el-form-item label="任务类型" prop="taskType">
+              <el-select v-model="form.taskType" filterable placeholder="请选择任务类型" @change="taskTypeChange()">
+                <el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id"/>
+              </el-select>
+            </el-form-item>
+             </div>
+         
+          <div class="form-section" v-if="form.taskType === 1" >
             <div class="section-title">
               <i class="el-icon-document"></i>
               <span>基本信息</span>
@@ -192,38 +216,94 @@
                 <el-option v-for="item in workflowList" :key="item.value" :label="item.label" :value="item.value"/>
               </el-select>
             </el-form-item>
-              <!-- <el-form-item label="运行时间" required>
+            <el-form-item label="运行时间" required>
                 <el-col :span="11">
-                  <el-form-item prop="runTimeRangeStart">
+                  <el-form-item prop="runtimeRangeStart">
                      <el-time-select
                   placeholder="任务运行开始时间"
                    style="width: 100%;"
-                  v-model="form.runTimeRangeStart"
+                  v-model="form.runtimeRangeStart"
+                  key="runtimeRangeStart"
                   :picker-options="{
-                    start: '07:30',
-                    step: '00:10',
-                    end: '20:00'
+                    start: '07:00',
+                    step: '00:30',
+                    end: '22:00'
                   }">
                 </el-time-select>
                   </el-form-item>
                 </el-col>
                 <el-col class="line" :span="2" style="text-align: center">-</el-col>
                 <el-col :span="11">
-                  <el-form-item prop="runTimeRangeEnd">
+                  <el-form-item prop="runtimeRangeEnd">
                      <el-time-select
                       style="width: 100%;"
                   placeholder="任务运行结束时间"
-                  v-model="form.runTimeRangeEnd"
+                  v-model="form.runtimeRangeEnd"
+                  key="runtimeRangeEnd"
                   :picker-options="{
-                    start: '08:30',
-                    step: '00:10',
-                    end: '21:00',
-                    minTime: startTime
+                    start: '07:00',
+                    step: '00:30',
+                    end: '22:00',
+                    minTime: form.runtimeRangeStart
                   }">
                 </el-time-select>
                   </el-form-item>
                 </el-col>
-              </el-form-item> -->
+              </el-form-item>
+          </div>
+          <!-- 场景任务 -->
+          <div class="form-section" v-if="form.taskType === 2" >
+            <div class="section-title">
+              <i class="el-icon-document"></i>
+              <span>基本信息</span>
+            </div>
+            <el-form-item label="任务名称" prop="name">
+              <el-input v-model="form.name" placeholder="请输入任务名称" clearable/>
+            </el-form-item>
+            <el-form-item label="任务流程" prop="companyAiWorkflowId">
+              <el-select v-model="form.companyAiWorkflowId" filterable placeholder="请选择任务流程">
+                <el-option v-for="item in workflowList" :key="item.value" :label="item.label" :value="item.value"/>
+              </el-select>
+            </el-form-item>
+             <el-form-item label="场景类型" prop="sceneType">
+              <el-select v-model="form.sceneType" filterable placeholder="请选择场景类型">
+                <el-option v-for="opt in sceneList" :key="opt.dictValue" :label="opt.dictLabel" :value="opt.dictValue"/>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="适用时间" required>
+                <el-col :span="11">
+                  <el-form-item prop="availableStartTime">
+                     <el-time-select
+                  placeholder="场景适用开始时间"
+                   style="width: 100%;"
+                  v-model="form.availableStartTime"
+                  key="availableStartTime"
+                  :picker-options="{
+                    start: '00:00',
+                    step: '00:30',
+                    end: '24:00'
+                  }">
+                </el-time-select>
+                  </el-form-item>
+                </el-col>
+                <el-col class="line" :span="2" style="text-align: center">-</el-col>
+                <el-col :span="11">
+                  <el-form-item prop="availableEndTime">
+                   <el-time-select
+                  style="width: 100%;"
+                  placeholder="场景适用结束时间"
+                  v-model="form.availableEndTime"
+                  key="availableEndTime"
+                  :picker-options="{
+                    start: '00:00',
+                    step: '00:30',
+                    end: '24:00'
+                  }">
+                </el-time-select>
+                  </el-form-item>
+                </el-col>
+              </el-form-item>
+          
           </div>
 
           <div class="form-section">
@@ -249,8 +329,21 @@
             <div class="section-title">
               <i class="el-icon-user-solid"></i>
               <span>分配账号</span>
-              <el-button type="primary" size="mini" icon="el-icon-plus" @click="addQwUser" plain>添加</el-button>
             </div>
+            <el-form-item label="添加类型" prop="isWeCom">
+              <el-radio-group v-model="form.isWeCom">
+                <!-- <el-radio :label="1" border>
+                  <i class="el-icon-pie-chart"></i>
+                  个微
+                </el-radio> -->
+                <el-radio :label="2" border>
+                  <i class="el-icon-star-on"></i>
+                  企微
+                </el-radio>
+              </el-radio-group>
+            </el-form-item>
+            <el-button type="primary" size="mini" icon="el-icon-plus" @click="addQwUser" plain>添加</el-button>
+
             <div class="account-list" v-if="form.qwUser && form.qwUser.length">
               <div v-for="(item, index) in form.qwUser" :key="index" class="account-item">
                 <el-row :gutter="12">
@@ -261,7 +354,7 @@
                   </el-col>
                   <el-col :span="form.addType == 1 ? 7 : 10">
                     <el-button icon="el-icon-user" @click="openQwUserSelect(index)" size="small" style="width: 100%;">
-                      选择企微
+                      选择账号
                       <el-tag v-if="item.companyUserId && item.companyUserId.length" type="success" size="mini" style="margin-left: 6px;">
                         {{ item.companyUserId.length }}
                       </el-tag>
@@ -316,7 +409,11 @@
       </div>
     </el-drawer>
     <customer-select @success="selectFun" ref="customer"/>
-    <qw-user-select @success="selectQwUserFun" ref="qwUserSelect"/>
+    <component
+      :is="getCurrentComponent()"
+      @success="selectQwUserFun"
+      ref="dynamicQwUserSelect"
+    />
 
     <el-drawer title="呼叫客户列表" size="60%" :visible.sync="callees.show" width="800px" append-to-body>
       <el-table v-loading="callees.loading" :data="callees.list">
@@ -347,7 +444,7 @@
         @pagination="getCalleesList"
       />
     </el-drawer>
-    <el-drawer title="加微详情" size="60%" :visible.sync="wx.show" append-to-body>
+    <el-drawer title="加微详情" size="60%" :visible.sync="wx.show" append-to-body>
       <el-table v-loading="wx.loading" :data="wx.list">
         <el-table-column label="意向等级" align="center" prop="intention"/>
         <el-table-column label="微信昵称" align="center" prop="wxNickName"/>
@@ -367,6 +464,25 @@
         @pagination="getWxList"
       />
     </el-drawer>
+    <el-drawer title="加企微详情" size="60%" :visible.sync="qw.show" append-to-body>
+      <el-table v-loading="qw.loading" :data="qw.list">
+        <el-table-column label="意向等级" align="center" prop="intention"/>
+        <el-table-column label="企微昵称" align="center" prop="wxNickName"/>
+        <el-table-column label="企微id" align="center" prop="wxNo"/>
+        <el-table-column label="手机号" align="center" prop="phone"/>
+        <el-table-column label="话术" align="center" prop="dialogName"/>
+        <el-table-column label="分配数量" align="center" prop="num"/>
+        <el-table-column label="添加数量" align="center" prop="addNum"/>
+      </el-table>
+
+      <pagination
+        v-show="qw.total>0"
+        :total="qw.total"
+        :page.sync="qw.queryParams.pageNum"
+        :limit.sync="qw.queryParams.pageSize"
+        @pagination="getWxListQw"
+      />
+    </el-drawer>
 
     <!-- 执行日志对话框 -->
     <el-drawer
@@ -532,21 +648,27 @@ import {
   getTypes,
   getSmsTempList,
   getCIDGroupList,
-  getExecRecords
+  getExecRecords,
+  getCurrentCompanyId
 } from "@/api/company/companyVoiceRobotic";
 import draggable from 'vuedraggable'
 import { listAll } from '@/api/company/wxDialog';
 import customerSelect from '@/views/crm/components/CustomerSelect.vue';
 import qwUserSelect from '@/views/components/QwUserSelect.vue';
+import qwUserSelectTwo from '@/views/components/QwUserSelectTwo.vue';
 import customerDetails from "@/views/crm/components/customerDetails.vue";
 import {getDicts} from "@/api/system/dict/data";
 import { optionList } from '@/api/company/companyWorkflow'
+import {wxListQw} from "../../../api/company/companyVoiceRobotic";
 
 export default {
   name: "Robotic",
-  components: { draggable, customerDetails, customerSelect, qwUserSelect},
+  components: { draggable, customerDetails, customerSelect, qwUserSelect,qwUserSelectTwo},
   data() {
     return {
+      taskType:1,
+      taskTypeList:[{id:1,name:"普通任务"},{id:2,name:"场景任务"}],
+      currentCompanyId:null,
       // 遮罩层
       loading: true,
       CIDGroupList:[],
@@ -598,12 +720,15 @@ export default {
         weekDay2: null,
         startTime2: null,
         endTime2: null,
-        createUser: null
+        createUser: null,
+        taskType:null
       },
       // 表单参数
-      form: {},
-      taskFlowList: [{key: "cellPhone", value: "外呼"}, {key: "sendMsg", value: "发短信"}, {key: "addWx", value: "加微"}],
-      taskFlowMap: {cellPhone: "外呼", sendMsg: "发短信", addWx: "加微"},
+      form: {
+        taskType:1
+      },
+      taskFlowList: [{key: "cellPhone", value: "外呼"}, {key: "qwAddWx", value: "企微加微"}, {key: "sendMsg", value: "发短信"}, {key: "addWx", value: "加微"}],
+      taskFlowMap: {cellPhone: "外呼", sendMsg: "发短信", addWx: "加微", qwAddWx: "企微加微"},
       statusObj: {},
       levelList: {},
       robotList: [],
@@ -639,6 +764,17 @@ export default {
           pageSize: 10,
         },
       },
+      qw: {
+        show: false,
+        list: [],
+        loading: false,
+        total: 0,
+        queryParams: {
+          id: null,
+          pageNum: 1,
+          pageSize: 10,
+        },
+      },
       execLogs: {
         show: false,
         loading: false,
@@ -652,23 +788,32 @@ export default {
       },
       // 表单校验
       rules: {
+        taskType:[
+           { required: true, message: '请选择任务类型', trigger: 'change' },
+        ],
         name: [
             { required: true, message: '请输入任务名称', trigger: 'blur' },
           ],
         companyAiWorkflowId: [
             { required: true, message: '请选择流程', trigger: 'change' }
           ],
-        // runTimeRangeStart:[
-        //      { required: true, message: '请选择任务运行开始时间', trigger: 'change' }
-        //   ],
-        // runTimeRangeEnd:[
-        //      { required: true, message: '请选择任务运行结束时间', trigger: 'change' }
-        //   ]
+        runtimeRangeStart:[
+             { required: true, message: '请选择任务运行开始时间', trigger: 'change' }
+          ],
+        runtimeRangeEnd:[
+             { required: true, message: '请选择任务运行结束时间', trigger: 'change' }
+          ]
       },
-      smsTempList:[]
+      smsTempList:[],
+      sceneList:[]
     };
   },
   created() {
+    getCurrentCompanyId().then(res=>{
+        this.currentCompanyId = res.companyId;
+    }).catch(res=>{
+      console.log(res);
+    })
     getTypes().then(e => {
       this.robotList = e.robot;
       this.dialogList = e.dialog;
@@ -685,6 +830,10 @@ export default {
     getDicts("customer_intention_level").then(e => {
       this.levelList = e.data;
     })
+    getDicts("task_scene_type").then(e => {
+      console.log(e);
+      this.sceneList = e.data;
+    })
     this.getList();
     this.getSmsTempDropList();
 
@@ -697,6 +846,32 @@ export default {
       console.log(res);
     });
   },
+  watch: {
+    // 监听添加类型的切换,清空选择器数据
+    'form.isWeCom': {
+      handler(newVal, oldVal) {
+        // 只有当值真正发生变化时才执行清空操作
+        if (newVal !== oldVal && oldVal !== undefined) {
+          // 清空 qwUser 数组中的选择数据
+          if (this.form.qwUser && this.form.qwUser.length > 0) {
+            this.form.qwUser.forEach(item => {
+              item.companyUserId = []; // 清空已选择的账号ID
+            });
+          }
+
+          // 清空选择器列表数据
+          this.selectQwUserList = [];
+
+          // 重置当前选择索引
+          this.thisQwUserIndex = 0;
+
+          // 强制更新视图
+          this.$forceUpdate();
+        }
+      },
+      immediate: false
+    }
+  },
   methods: {
     getSmsTempDropList(){
       getSmsTempList().then(res=>{
@@ -764,8 +939,12 @@ export default {
         userNames: [],
         userTableList: [],
         companyAiWorkflowId: null,
-        // runTimeRangeStart:null,
-        // runTimeRangeEnd:null
+        runtimeRangeStart:null,
+        runtimeRangeEnd:null,
+        isWeCom: 1,
+        taskType:1,
+        availableStartTime :null,
+        availableEndTime: null
       };
       this.resetForm("form");
     },
@@ -788,8 +967,11 @@ export default {
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
+      optionList().then(e => {
+      this.workflowList = e.data;
+      })
       this.open = true;
-      this.title = "添加机器人外呼任务";
+      this.title = "添加任务";
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -808,13 +990,13 @@ export default {
           if (this.form.weekDay && this.form.weekDay.length > 0) {
             this.form.weekDay1 = this.form.weekDay.join(",")
           }
-          
+
           // 验证加微方案
           if(!this.form.qwUser || this.form.qwUser.length == 0){
             this.msgError("请添加分配账号");
             return;
           }
-          
+
           // 验证每个账号是否选择了企微和话术
           for(let i = 0; i < this.form.qwUser.length; i++) {
             const account = this.form.qwUser[i];
@@ -827,7 +1009,7 @@ export default {
             //   return;
             // }
           }
-          
+
           let list = [];
           this.form.qwUser.forEach(l => {
             list = list.concat(l.companyUserId.map(e => {return {intention: l.intention, companyUserId: e,wxDialogId: l.wxDialogId,smsTempId:l.smsTempId}}))
@@ -896,14 +1078,18 @@ export default {
       });
     },
     openSelect() {
+      if(!!this.currentCompanyId){
+      this.$refs.customer.setRowsDesignatedCompany(this.form.userTableList || [],this.currentCompanyId);
+      }else{
       this.$refs.customer.setRows(this.form.userTableList || []);
+      }
     },
-    openQwUserSelect(index) {
-      this.thisQwUserIndex = index;
-      this.$nextTick(() => {
-        this.$refs.qwUserSelect.setRows(this.selectQwUserList[index]);
-      })
-    },
+    // openQwUserSelect(index) {
+    //   this.thisQwUserIndex = index;
+    //   this.$nextTick(() => {
+    //     this.$refs.qwUserSelect.setRows(this.selectQwUserList[index]);
+    //   })
+    // },
     selectFun(e) {
       this.form.userIds = e.ids;
       this.form.userNames = e.names;
@@ -928,10 +1114,25 @@ export default {
         this.callees.loading = false;
       });
     },
-    wxOpen(id){
-      this.wx.show = true;
-      this.wx.queryParams.id = id;
-      this.getWxList();
+    wxOpen(id, isWeCom) {
+      console.log("isWeCom="+isWeCom)
+      if (isWeCom === 2) {
+        this.qw.show = true;
+        this.qw.queryParams.id = id;
+        this.getWxListQw();
+      } else {
+        this.wx.show = true;
+        this.wx.queryParams.id = id;
+        this.getWxList();
+      }
+    },
+    getWxListQw() {
+      this.qw.loading = true;
+      wxListQw(this.qw.queryParams).then(response => {
+        this.qw.list = response.rows;
+        this.qw.total = response.total;
+        this.qw.loading = false;
+      });
     },
     getWxList() {
       this.wx.loading = true;
@@ -1058,10 +1259,43 @@ export default {
       const remainSeconds = seconds % 60;
       return minutes + 'm' + remainSeconds + 's';
     },
+    // 获取当前应该使用的组件
+    getCurrentComponent() {
+      return this.form.isWeCom === 2 ? 'qwUserSelectTwo' : 'qwUserSelect';
+    },
+
+    openQwUserSelect(index) {
+      this.thisQwUserIndex = index;
+      this.$nextTick(() => {
+        // 根据 isWeCom 的值选择对应的组件引用
+        const componentRef = this.form.isWeCom === 2 ? this.$refs.dynamicQwUserSelect : this.$refs.dynamicQwUserSelect;
+        if (componentRef && typeof componentRef.setRows === 'function') {
+          componentRef.setRows(this.selectQwUserList[index]);
+        }
+      })
+    },
     // 获取头像颜色
     getAvatarColor(index) {
       const colors = ['#1890ff', '#52c41a', '#faad14', '#722ed1', '#eb2f96'];
       return colors[index % colors.length];
+    },
+    /**
+     * 选择任务类型
+     */
+    taskTypeChange(){
+      console.log(this.form.taskType);
+      this.form.runtimeRangeStart=null;
+      this.form.runtimeRangeEnd= null;
+      this.form.userIds= [];
+      this.form.userNames= [];
+      this.form.userTableList= [];
+      this.form.companyAiWorkflowId = null;
+      this.form.name = null;
+      this.form.availableStartTime = null;
+      this.form.availableEndTime = null;
+      this.$nextTick(() => {
+      this.$refs.form.clearValidate();
+      })
     }
   }
 };

+ 20 - 3
src/views/company/companyWorkflow/design.scss

@@ -314,11 +314,28 @@
       .edge-group {
         cursor: pointer;
 
-        path {
+        // 交互路径 - 扩大点击区域
+        .edge-interaction {
+          pointer-events: stroke;
+        }
+
+        .edge-path {
           transition: all 0.2s;
+          pointer-events: none; // 让点击事件穿透到交互路径
+        }
 
-          &.selected {
-            stroke-width: 4;
+        // 悬停效果
+        &:hover {
+          .edge-path {
+            stroke-width: 3;
+            filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
+          }
+        }
+
+        // 选中效果
+        &.selected {
+          .edge-path {
+            stroke-width: 3;
             filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
           }
         }

+ 150 - 13
src/views/company/companyWorkflow/design.vue

@@ -110,14 +110,26 @@
               v-for="edge in edges"
               :key="edge.edgeKey"
               class="edge-group"
+              :class="{ selected: selectedEdge === edge }"
               @click.stop="selectEdge(edge)"
             >
+              <!-- 不可见的交互路径,用于扩大点击区域 -->
+              <path
+                :d="getEdgePath(edge)"
+                stroke="transparent"
+                stroke-width="16"
+                fill="none"
+                class="edge-interaction"
+                style="cursor: pointer"
+              />
+              <!-- 可见的连线路径 -->
               <path
                 :d="getEdgePath(edge)"
                 :stroke="edge.edgeColor || '#999'"
                 stroke-width="2"
                 fill="none"
                 :marker-end="selectedEdge === edge ? 'url(#arrowhead-selected)' : 'url(#arrowhead)'"
+                class="edge-path"
                 :class="{ selected: selectedEdge === edge }"
               />
               <text
@@ -277,7 +289,8 @@
               </el-form-item>
             </div>
 
-            <!-- AI外呼配置 -->
+            <!-- AI外呼配置(旧版天天外呼,已停用) -->
+            <!--
             <div v-if="selectedNode.nodeType == 'AI_CALL_TASK'" class="property-section">
               <div class="section-title">
                 <i class="el-icon-phone"></i>外呼配置
@@ -302,7 +315,6 @@
                   <el-option label="呼叫机器人后挂断" :value="7"/>
                 </el-select>
               </el-form-item>
-
               <div class="form-row">
                 <el-form-item label="呼叫倍率" class="half-width">
                   <el-select v-model="selectedNode.nodeConfig.multiplier" @change="handleConfigChange" placeholder="选择倍率">
@@ -314,14 +326,12 @@
                   </el-select>
                 </el-form-item>
               </div>
-
               <el-form-item label="自动重呼">
                 <el-radio-group v-model="selectedNode.nodeConfig.autoRecall" @change="handleConfigChange">
                   <el-radio :label="0">否</el-radio>
                   <el-radio :label="1">是</el-radio>
                 </el-radio-group>
               </el-form-item>
-
               <el-form-item label="重呼次数" v-if="selectedNode.nodeConfig.autoRecall == 1">
                 <el-select v-model="selectedNode.nodeConfig.recallTimes" @change="handleConfigChange" placeholder="选择重呼次数">
                   <el-option label="不自动重呼" :value="0"/>
@@ -333,6 +343,92 @@
                 </el-select>
               </el-form-item>
             </div>
+            -->
+
+            <!-- AI外呼配置(新版 EasyCallCenter365) -->
+            <div v-if="selectedNode.nodeType == 'AI_CALL_TASK'" class="property-section">
+              <div class="section-title">
+                <i class="el-icon-phone"></i>外呼配置
+              </div>
+              <el-form-item label="外呼模式">
+                <el-select
+                  v-model="selectedNode.nodeConfig.callMode"
+                  filterable
+                  placeholder="请选择外呼模式"
+                  @change="checkCallMode()"
+                >
+                  <el-option
+                    v-for="item in callMode"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-form-item>
+              <el-form-item label="外呼网关">
+                <el-select
+                  :disabled="editAiDisable"
+                  v-model="selectedNode.nodeConfig.gatewayId"
+                  filterable
+                  placeholder="请选择外呼网关"
+                  @change="handleConfigChange"
+                >
+                  <el-option
+                    v-for="item in easyCallGatewayList"
+                    :key="item.id"
+                    :label="item.gwDesc"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-form-item>
+              <el-form-item label="大模型">
+                <el-select
+                  :disabled="editAiDisable"
+                  v-model="selectedNode.nodeConfig.llmAccountId"
+                  filterable
+                  placeholder="请选择大模型"
+                  @change="handleConfigChange"
+                >
+                  <el-option
+                    v-for="item in easyCallLlmAccountList"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  />
+                </el-select>
+              </el-form-item>
+              <el-form-item label="音色">
+                <el-select
+                  :disabled="editAiDisable"
+                  v-model="selectedNode.nodeConfig.voiceCode"
+                  filterable
+                  placeholder="请选择音色"
+                  @change="handleConfigChange('handleVoice')"
+                >
+                  <el-option
+                    v-for="item in easyCallVoiceCodeList"
+                    :key="item.voiceCode"
+                    :label="item.voiceName"
+                    :value="item.voiceCode"
+                  />
+                </el-select>
+              </el-form-item>
+              <!-- <el-form-item label="技能组">
+                <el-select
+                  v-model="selectedNode.nodeConfig.busiGroupId"
+                  filterable
+                  placeholder="请选择技能组"
+                  @change="handleConfigChange"
+                >
+                  <el-option
+                    v-for="item in easyCallBusiGroupList"
+                    :key="item.groupId"
+                    :label="item.bizGroupName"
+                    :value="item.groupId"
+                  />
+                </el-select>
+              </el-form-item> -->
+            </div>
 
             <!-- AI短信配置 -->
             <div v-if="selectedNode.nodeType == 'AI_SEND_MSG_TASK'" class="property-section">
@@ -389,7 +485,7 @@
             </div>
 
             <!-- 条件判断 -->
-            <div v-if="edgeSourceNode.nodeType == 'AI_CALL_TASK' || edgeSourceNode.nodeType == 'AI_SEND_MSG_TASK' || edgeSourceNode.nodeType == 'AI_ADD_WX_TASK'" class="property-section">
+            <div v-if="edgeSourceNode.nodeType == 'AI_CALL_TASK' || edgeSourceNode.nodeType == 'AI_SEND_MSG_TASK' || edgeSourceNode.nodeType == 'AI_ADD_WX_TASK' || edgeSourceNode.nodeType == 'AI_QW_ADD_WX_TASK'"  class="property-section">
               <div class="section-title">
                 <i class="el-icon-set-up"></i>条件判断
                 <el-button type="success" size="mini" icon="el-icon-plus" @click="addCondition" class="add-condition-btn">新增条件</el-button>
@@ -428,7 +524,7 @@
               </div>
 
               <!-- 加微信任务条件 -->
-              <div v-if="edgeSourceNode.nodeType == 'AI_ADD_WX_TASK'" class="conditions-container">
+              <div v-if="edgeSourceNode.nodeType == 'AI_ADD_WX_TASK' || edgeSourceNode.nodeType == 'AI_QW_ADD_WX_TASK'" class="conditions-container">
                 <div v-for="(item, index) in selectedEdge.conditionExprObj" :key="index" class="condition-item">
                   <div class="condition-header">
                     <span class="condition-number">条件 {{ index + 1 }}</span>
@@ -514,13 +610,20 @@ import {
 } from "@/api/company/companyVoiceRobotic";
 import { getWorkflow, addWorkflow, updateWorkflow, getNodeTypes } from '@/api/company/companyWorkflow'
 import {getDicts} from "@/api/system/dict/data";
-
+import { getGatewayList, getLlmAccountList, getVoiceCodeList, getBusiGroupList } from '@/api/company/easyCall'
 import { listAll } from '@/api/company/wxDialog';
 export default {
   name: 'WorkflowDesign',
   data() {
     return {
-
+      callMode:[{
+        id:1,
+        name:"人工外呼"
+      },{
+        id:2,
+        name:"ai自动外呼"
+      }],
+      editAiDisable:true,
       wxDialogList: [],
       // 工作流ID
       workflowId: null,
@@ -595,6 +698,11 @@ export default {
       robotList: [],
       smsTempList: [],
       dialogList: [],
+      // EasyCallCenter365 外呼配置相关列表
+      easyCallGatewayList: [],     // 外呼线路(网关)列表
+      easyCallLlmAccountList: [],  // 大模型底座列表
+      easyCallVoiceCodeList: [],   // 音色列表
+      easyCallBusiGroupList: [],   // tts厂商(技能组)列表
     }
   },
   created() {
@@ -635,10 +743,20 @@ export default {
     },
 
     // 处理配置变化,强制更新视图
-    handleConfigChange() {
+    handleConfigChange(v) {
+      if( !!v && v === "handleVoice" ){
+       let voice =  this.easyCallVoiceCodeList.filter(e=>e.voiceCode == this.selectedNode.nodeConfig.voiceCode);
+       this.selectedNode.nodeConfig.voiceSource = voice[0].voiceSource;
+      }
       // 强制触发Vue响应式更新
       this.$forceUpdate()
     },
+    //选择外呼模式
+    checkCallMode(){
+      // callMode: 1=人工外呼, 2=AI自动外呼
+      // 人工外呼时禁用AI相关配置,AI外呼时启用
+      this.editAiDisable = this.selectedNode.nodeConfig.callMode !== 2;
+    },
 
     // 点击画布时聚焦
     onCanvasClick() {
@@ -678,6 +796,12 @@ export default {
         if (!this.selectedNode.nodeConfig.recallTimes && this.selectedNode.nodeConfig.recallTimes !== 0) {
           this.$set(this.selectedNode.nodeConfig, 'recallTimes', 0)
         }
+        // 初始化外呼模式,默认为人工外呼(1)
+        if (!this.selectedNode.nodeConfig.callMode) {
+          this.$set(this.selectedNode.nodeConfig, 'callMode', 1)
+        }
+        // 根据当前外呼模式设置AI配置的禁用状态
+        this.editAiDisable = this.selectedNode.nodeConfig.callMode !== 2;
 
         getTypes().then(e => {
           this.robotList = e.robot;
@@ -688,6 +812,19 @@ export default {
         }).catch(res=>{
           console.log(res);
         });
+        // 加载 EasyCallCenter365 四项基础数据
+        getGatewayList().then(res => {
+          this.easyCallGatewayList = res.data || []
+        })
+        getLlmAccountList().then(res => {
+          this.easyCallLlmAccountList = res.data || []
+        })
+        getVoiceCodeList().then(res => {
+          this.easyCallVoiceCodeList = res.data || []
+        })
+        getBusiGroupList().then(res => {
+          this.easyCallBusiGroupList = res.data || []
+        })
       }
       if (this.selectedNode.nodeType === 'AI_SEND_MSG_TASK') {
         getSmsTempList().then(res => {
@@ -813,8 +950,8 @@ export default {
 
       const categoryMap = {
         basic: { key: 'basic', name: '基础节点', types: [] },
-        logic: { key: 'logic', name: '逻辑节点', types: [] },
-        aiCell: { key: 'aiCell', name: '外呼节点', types: [] },
+        // logic: { key: 'logic', name: '逻辑节点', types: [] },
+        aiCell: { key: 'aiCell', name: '动作节点', types: [] },
       }
       this.nodeTypes.forEach(t => {
         // 如果节点类型没有颜色,使用默认颜色
@@ -870,7 +1007,7 @@ export default {
     },
     /** 返回列表 */
     goBack() {
-      this.$router.push('/company/companyWorkflow')
+      this.$router.push('/companyWx/companyWorkflow')
     },
     /** 放大 */
     zoomIn() {
@@ -1344,7 +1481,7 @@ export default {
         addWorkflow(data).then(res => {
           this.msgSuccess('保存成功')
           this.workflowId = res.data
-          this.$router.replace('/company/companyWorkflow/design/' + this.workflowId)
+          this.$router.replace('/companyWx/companyWorkflow/design/' + this.workflowId)
         })
       }
     }

+ 7 - 13
src/views/company/companyWorkflow/index.vue

@@ -44,7 +44,6 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['company:companyWorkflow:add']"
         >新增</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -55,7 +54,6 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['company:companyWorkflow:remove']"
         >删除</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -66,7 +64,6 @@
           size="mini"
           :loading="exportLoading"
           @click="handleExport"
-          v-hasPermi="['company:companyWorkflow:export']"
         >导出</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -105,7 +102,6 @@
             type="text"
             icon="el-icon-edit"
             @click="handleEdit(scope.row)"
-            v-hasPermi="['company:companyWorkflow:edit']"
           >设计</el-button>
           <el-button
             size="mini"
@@ -118,14 +114,12 @@
             type="text"
             icon="el-icon-document-copy"
             @click="handleCopy(scope.row)"
-            v-hasPermi="['company:companyWorkflow:add']"
           >复制</el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['company:companyWorkflow:remove']"
           >删除</el-button>
         </template>
       </el-table-column>
@@ -145,9 +139,9 @@
       <div class="current-sales">
         <div class="section-title">当前绑定销售</div>
         <div v-if="currentBindUserList && currentBindUserList.length > 0" class="bind-info">
-          <el-tag 
-            v-for="(user, index) in currentBindUserList" 
-            :key="index" 
+          <el-tag
+            v-for="(user, index) in currentBindUserList"
+            :key="index"
             type="success"
             style="margin-right: 8px; margin-bottom: 8px;"
           >
@@ -299,11 +293,11 @@ export default {
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.$router.push('/company/companyWorkflow/design')
+      this.$router.push('/companyWx/companyWorkflow/design')
     },
     /** 设计按钮操作 */
     handleEdit(row) {
-      this.$router.push('/company/companyWorkflow/design/' + row.workflowId)
+      this.$router.push('/companyWx/companyWorkflow/design/' + row.workflowId)
     },
     /** 复制按钮操作 */
     handleCopy(row) {
@@ -429,7 +423,7 @@ export default {
 
       const workflowId = this.currentWorkflow.workflowId
       const companyUserIds = this.selectedSalesList.map(item => item.userId || item.companyUserId)
-      
+
       this.doBindSales(workflowId, companyUserIds)
     },
     /** 执行绑定销售 */
@@ -491,7 +485,7 @@ export default {
 .el-table .disabled-row {
   background-color: #f5f5f5;
   color: #999;
-  
+
   &:hover > td {
     background-color: #f5f5f5 !important;
   }

+ 3 - 3
src/views/components/QwUserSelect.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-drawer size="75%" title="选择微账号" :visible.sync="shows" append-to-body destroy-on-close class="qw-user-select-drawer">
+  <el-drawer size="75%" title="选择微账号" :visible.sync="shows" append-to-body destroy-on-close class="qw-user-select-drawer">
     <div class="drawer-container">
       <!-- 搜索表单 -->
       <el-card shadow="never" class="search-card">
@@ -62,10 +62,10 @@
         </el-form>
       </el-card>
 
-      <!-- 微账号列表 -->
+      <!-- 微账号列表 -->
       <el-card shadow="never" class="table-card">
         <div slot="header" class="card-header">
-          <span>微账号列表</span>
+          <span>微账号列表</span>
           <el-tag v-if="selectedRows.length" type="success">已选择 {{ selectedRows.length }} 个账号</el-tag>
         </div>
         <el-table border v-loading="loading" :data="customerList" :row-key="getRowKeys" @selection-change="handleSelectionChange" size="small" ref="table" height="500">

+ 221 - 0
src/views/components/QwUserSelectTwo.vue

@@ -0,0 +1,221 @@
+<template>
+  <el-drawer size="75%" title="选择企微账号" :visible.sync="shows" append-to-body destroy-on-close class="qw-user-select-drawer">
+    <div class="drawer-container">
+      <!-- 搜索表单 -->
+      <el-card shadow="never" class="search-card">
+        <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="100px" class="search-form">
+          <el-row :gutter="16">
+            <el-col :span="6">
+            <el-form-item label="销售公司" prop="companyId">
+              <el-select v-model="queryParams.companyId" placeholder="销售公司" size="small" @change="handleCompanyChange">
+                <el-option
+                  v-for="dict in qwCompanyList"
+                  :key="dict.companyId"
+                  :label="dict.companyName"
+                  :value="dict.companyId"
+                />
+              </el-select>
+            </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="企微用户名" prop="qwUserName">
+                <el-input v-model="queryParams.qwUserName" placeholder="请输入企微用户名" clearable size="small" @keyup.enter.native="handleQuery"/>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="企微用户 ID" prop="qwUserId">
+                <el-input v-model="queryParams.qwUserId" placeholder="请输入企微用户 ID" clearable size="small" @keyup.enter.native="handleQuery"/>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item>
+                <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
+                <el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </el-card>
+
+      <!-- 企微账号列表 -->
+      <el-card shadow="never" class="table-card">
+        <div slot="header" class="card-header">
+          <span>企微账号列表</span>
+          <el-tag v-if="selectedRows.length" type="success">已选择 {{ selectedRows.length }} 个账号</el-tag>
+        </div>
+        <el-table border v-loading="loading" :data="qwUserList" :row-key="getRowKeys" @selection-change="handleSelectionChange" size="small" ref="table" height="500">
+          <el-table-column type="selection" width="55" align="center" :reserve-selection="true" />
+          <el-table-column label="企微用户名" align="center" prop="qwUserName"/>
+          <el-table-column label="企微用户id" align="center" prop="qwUserId"/>
+          <el-table-column label="vid" align="center" prop="vid"/>
+          <el-table-column label="uid" align="center" prop="uid"/>
+          <el-table-column label="ipad服务器id" align="center" prop="serverId"/>
+        </el-table>
+
+        <!-- 分页组件 -->
+        <pagination
+          v-show="total > 0"
+          :total="total"
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
+          @pagination="getList"
+          style="margin-top: 20px;"
+        />
+      </el-card>
+
+      <!-- 底部按钮 -->
+      <div class="footer-actions" style="    text-align: right;
+    margin: 20px;">
+        <el-button @click="shows = false">取 消</el-button>
+        <el-button type="primary" @click="submitForm">确定选择</el-button>
+      </div>
+    </div>
+  </el-drawer>
+</template>
+
+<script>
+import {queryQwList} from "../../api/qw/qwUser";
+import {listCompany} from "../../api/company/company";
+
+export default {
+  name: "QwUserSelectTwo",
+  data() {
+    return {
+      rows: [], // 已选择的行数据
+      selectedRows: [], // 已选择的行数据(别名)
+      shows: false,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 总条数
+      total: 0,
+      // 企微账号表格数据
+      qwUserList: [],
+      qwCompanyList: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        companyId: null,
+        qwUserName: null,
+        qwUserId: null
+      }
+    };
+  },
+  methods: {
+    // 获取企业数据
+    getCompanyData() {
+      listCompany().then(response => {
+        this.qwCompanyList = response.rows;
+        // 默认选中第一个企业
+        if (this.qwCompanyList && this.qwCompanyList.length > 0) {
+          this.queryParams.companyId = this.qwCompanyList[0].companyId;
+          // 重新加载页面数据
+          this.handleQuery();
+        }
+      });
+    },
+    // 企业改变时触发查询
+    handleCompanyChange() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    setRows(rows){
+      this.shows = true;
+      this.rows = rows || [];
+      this.selectedRows = rows || []; // 同步更新
+      this.getList();
+      // 获取企业列表并默认选中第一个
+      this.getCompanyData();
+    },
+    initSelect(){
+      let row = this.rows;
+      if(row && row.length > 0 && this.$refs.table){
+        row.forEach(row => {
+          this.$refs.table.toggleRowSelection(row, true);
+        })
+      }
+    },
+    getRowKeys(item){
+      return item.id;
+    },
+    /** 查询企微账号列表 */
+    getList() {
+      this.loading = true;
+      queryQwList(this.queryParams).then(response => {
+        if (this.$refs.table) {
+          this.$refs.table.clearSelection();
+        }
+
+        this.qwUserList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+        this.initSelect();
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.queryParams.pageNum = 1;
+      this.queryParams.pageSize = 10;
+      // 重置后选中第一个企业
+      if (this.qwCompanyList && this.qwCompanyList.length > 0) {
+        this.queryParams.companyId = this.qwCompanyList[0].companyId;
+      }
+      this.getList();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.rows = selection;
+      this.selectedRows = selection; // 同步更新
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    submitForm(){
+      this.$nextTick(() => {
+        this.$emit("success", {ids: this.ids, rows: this.rows})
+        this.shows = false;
+        this.$refs.table.clearSelection();
+      })
+    },
+  }
+};
+</script>
+<style scoped>
+  .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;
+  }
+  .app-container{padding: 0}
+  .dialog-footer{
+    position: absolute;
+    bottom: 0;
+    right: 20px;
+    background: #FFF;
+  }
+</style>

+ 73 - 5
src/views/crm/components/CustomerSelect.vue

@@ -3,7 +3,7 @@
     <div class="app-container">
       <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
         <el-form-item label="公司名" prop="companyId">
-          <el-select filterable  v-model="queryParams.companyId" placeholder="请选择公司名"  @change="companyChange" clearable size="small">
+          <el-select filterable  v-model="queryParams.companyId" :disabled="designatedCompany" placeholder="请选择公司名"  @change="companyChange" clearable size="small">
             <el-option
               v-for="item in companys"
               :key="item.companyId"
@@ -89,7 +89,18 @@
           <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
         </el-form-item>
       </el-form>
-
+      <el-row :gutter="10" class="mb8" v-if="designatedCompany">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          @click="checkWithCondition()"
+        >按筛选条件选中
+        </el-button>
+      </el-col>
+    </el-row>
       <el-table border v-loading="loading" :data="customerList" :row-key="getRowKeys" @selection-change="handleSelectionChange" size="mini" ref="table" height="450">
         <el-table-column type="selection" width="55" align="center" :reserve-selection="true" />
         <el-table-column label="ID" align="center" prop="customerId" />
@@ -104,7 +115,7 @@
         </el-table-column>
         <el-table-column label="微信号" align="center" prop="weixin" width="95"/>
         <el-table-column label="所在地" align="center" prop="address" />
-        <el-table-column label="标签" align="center" prop="tags" width="100" show-overflow-tooltip="true"/>
+        <el-table-column label="标签" align="center" prop="tags" width="100" :show-overflow-tooltip="true"/>
         <el-table-column  label="客户来源" align="center" prop="source">
           <template slot-scope="scope">
             <el-tag prop="source" v-for="(item, index) in sourceOptions"  :key="'source'+index"    v-if="scope.row.source==item.dictValue">{{item.dictLabel}}</el-tag>
@@ -153,7 +164,7 @@
 </template>
 
 <script>
-import { listCustomerAll  } from "@/api/crm/customer";
+import { listCustomerAll,listNoPage } from "@/api/crm/customer";
 import { getCompanyList } from "@/api/company/company";
 import customerDetails from '@/views/crm/components/customerDetails.vue';
 import editCustomerSource from '@/views/crm/components/editSource.vue';
@@ -168,6 +179,7 @@ export default {
   components: { customerDetails,editCustomerSource,Treeselect },
   data() {
     return {
+      designatedCompany:false,
       source:{
         title:"修改客户来源",
         open:false,
@@ -285,7 +297,7 @@ export default {
       this.companys = response.data;
     });
     this.getCitys();
-    // this.getList();
+    this.getList();
   },
   methods: {
     setRows(rows){
@@ -293,6 +305,14 @@ export default {
       this.rows = rows;
       this.initSelect();
     },
+    setRowsDesignatedCompany(rows,companyId){
+      this.designatedCompany = true;
+      this.shows = true;
+      this.rows = rows;
+      this.companyChange(companyId);
+      this.initSelect();
+      this.queryParams.companyId = companyId;
+    },
     initSelect(){
       if(this.rows && this.rows.length > 0){
         this.rows.forEach(row => {
@@ -436,12 +456,60 @@ export default {
           this.getList();
     },
     submitForm(){
+      console.log(this.ids);
       this.$nextTick(() => {
         this.$emit("success", {ids: this.ids, names: this.names, rows: this.rows})
         this.shows = false;
         this.$refs.table.clearSelection();
       })
     },
+    //按照筛选条件选择客户
+    checkWithCondition(){
+
+    let queryParamNoPage = {};
+    queryParamNoPage = this.queryParams;
+    if(this.receiveTimeRange!=null&&this.receiveTimeRange.length==2){
+        queryParamNoPage.receiveTimeRange=this.receiveTimeRange[0]+"--"+this.receiveTimeRange[1]
+      }
+      else{
+        queryParamNoPage.receiveTimeRange=null;
+      }
+      if(this.ctsTypeArr.length>0){
+        queryParamNoPage.customerType=this.ctsTypeArr.toString();
+      }
+      else{
+        queryParamNoPage.customerType=null
+      }
+
+      if(this.sourceArr.length>0){
+        queryParamNoPage.source=this.sourceArr.toString();
+      }
+      else{
+        queryParamNoPage.source=null
+      }
+      if(this.tagIds.length>0){
+        queryParamNoPage.tags=this.tagIds.toString();
+      }
+      else{
+        queryParamNoPage.tags=null
+      }
+      listNoPage(this.addDateRange(queryParamNoPage, this.dateRange)).then(response => {
+        let resList = response.rows; 
+        this.ids = [];
+        this.names = [];
+        this.rows = [];
+        if(!!resList){
+          this.ids = resList.map(item => item.customerId);
+          this.names = resList.map(item => item.customerName);
+          this.rows = resList;
+        }
+        this.$nextTick(() => {
+        this.$emit("success", {ids: this.ids, names: this.names, rows: this.rows})
+        this.shows = false;
+        this.$refs.table.clearSelection();
+      })
+      });
+    }
   }
 };
 </script>

+ 1 - 1
src/views/crm/components/aiCallVoiceLog.vue

@@ -101,7 +101,7 @@ export default {
                 });
             },
             handleRecordPath(url){
-                let path = 'http://118.24.138.129/recordFile/listen?file=' + url;
+                let path = 'http://129.28.164.235:8899/recordings/files?filename=' + url;
                 console.log(path);
                 return path;
             }

+ 20 - 0
src/views/hisStore/components/productOrder.vue

@@ -141,6 +141,26 @@
                   {{ order.remark }}
                 </span>
           </el-descriptions-item>
+          <el-descriptions-item label="销售名称" v-if="order!=null && order.orderType != 0">
+                <span >
+                  {{ order.companyUserName }}
+                </span>
+          </el-descriptions-item>
+          <el-descriptions-item label="销售公司" v-if="order!=null && order.orderType != 0">
+                <span >
+                  {{ order.companyName }}
+                </span>
+          </el-descriptions-item>
+          <el-descriptions-item label="所属营期" v-if="order!=null && order.orderType == 3">
+                <span >
+                  {{ order.periodName }}
+                </span>
+          </el-descriptions-item>
+          <el-descriptions-item label="所属小节" v-if="order!=null && order.orderType == 3">
+                <span >
+                  {{ order.videoName }}
+                </span>
+          </el-descriptions-item>
           <el-descriptions-item label="跟随阶段" v-if="company.companyId == 174">
               <span v-if="order!=null ">
                 <el-tag prop="orderVisit" v-for="(item, index) in customerUserStatusOptions"

+ 2702 - 0
src/views/hisStore/storeOrder/healthStoreList.vue

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

+ 275 - 0
src/views/live/liveData/indexCompany.vue

@@ -0,0 +1,275 @@
+<template>
+  <div class="el-container-md">
+    <!-- 筛选条件区域 -->
+    <el-form :model="queryParams" class="live-data-css" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="公司名" prop="companyIds">
+        <div class="company-select-wrapper">
+          <el-select
+            filterable
+            multiple
+            collapse-tags
+            v-model="queryParams.companyIds"
+            placeholder="请选择公司(可多选)"
+            @change="getList"
+            clearable
+            size="small"
+            style="min-width: 280px;"
+          >
+            <el-option
+              v-for="item in companys"
+              :key="item.companyId"
+              :label="item.companyName"
+              :value="item.companyId"
+            />
+          </el-select>
+          <el-button type="text" size="mini" @click="selectAllCompany">全选</el-button>
+          <el-button type="text" size="mini" @click="invertSelectCompany">反选</el-button>
+        </div>
+      </el-form-item>
+      <el-form-item label="时间范围" prop="dateRange">
+        <el-date-picker
+          v-model="dateRange"
+          type="daterange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          size="small"
+          value-format="yyyy-MM-dd"
+        ></el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <!-- 操作工具栏 -->
+    <div class="selection-toolbar">
+      <el-button plain type="primary" size="mini" icon="el-icon-download" :loading="exportLoading" @click="handleExport">导出</el-button>
+    </div>
+
+    <!-- 数据表格 -->
+    <el-table
+      ref="dataTable"
+      :data="dataList"
+      style="width: 100%"
+      v-loading="loading"
+    >
+      <el-table-column type="index" label="序号" width="55" align="center"></el-table-column>
+      <el-table-column prop="companyName" label="分公司名称" min-width="120" show-overflow-tooltip></el-table-column>
+      <el-table-column prop="totalAttendanceCount" label="总到课人数(去重)" width="140" align="center">
+        <template slot-scope="scope">{{ scope.row.totalAttendanceCount || 0 }}</template>
+      </el-table-column>
+      <el-table-column prop="totalCompleteCount" label="总完课人数(去重)" width="110" align="center">
+        <template slot-scope="scope">{{ scope.row.totalCompleteCount || 0 }}</template>
+      </el-table-column>
+      <el-table-column prop="totalCompleteRate" label="总完课率" width="100" align="center">
+        <template slot-scope="scope">{{ formatPercent(scope.row.totalCompleteRate) }}</template>
+      </el-table-column>
+      <el-table-column prop="liveAttendanceCount" label="直播课人数(去重)" width="140" align="center">
+        <template slot-scope="scope">{{ scope.row.liveAttendanceCount || 0 }}</template>
+      </el-table-column>
+      <el-table-column prop="liveCompleteCount" label="直播完课人数(去重)" width="120" align="center">
+        <template slot-scope="scope">{{ scope.row.liveCompleteCount || 0 }}</template>
+      </el-table-column>
+      <el-table-column prop="liveCompleteRate" label="直播完课率" width="110" align="center">
+        <template slot-scope="scope">{{ formatPercent(scope.row.liveCompleteRate) }}</template>
+      </el-table-column>
+      <el-table-column prop="replayAttendanceCount" label="回放课人数(去重)" width="140" align="center">
+        <template slot-scope="scope">{{ scope.row.replayAttendanceCount || 0 }}</template>
+      </el-table-column>
+      <el-table-column prop="replayCompleteCount" label="回放完课人数(去重)" width="150" align="center">
+        <template slot-scope="scope">{{ scope.row.replayCompleteCount || 0 }}</template>
+      </el-table-column>
+      <el-table-column prop="replayCompleteRate" label="回放完课率" width="110" align="center">
+        <template slot-scope="scope">{{ formatPercent(scope.row.replayCompleteRate) }}</template>
+      </el-table-column>
+      <el-table-column prop="gmv" label="GMV" width="120" align="center">
+        <template slot-scope="scope">{{ formatMoney(scope.row.gmv) }}</template>
+      </el-table-column>
+      <el-table-column prop="orderCount" label="订单数" width="90" align="center">
+        <template slot-scope="scope">{{ scope.row.orderCount || 0 }}</template>
+      </el-table-column>
+      <el-table-column prop="orderUserCount" label="下单人数" width="100" align="center">
+        <template slot-scope="scope">{{ scope.row.orderUserCount || 0 }}</template>
+      </el-table-column>
+      <el-table-column prop="employeeCount" label="现存员工人数(去重)" width="150" align="center">
+        <template slot-scope="scope">{{ scope.row.employeeCount || 0 }}</template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页组件 -->
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+      style="margin-top: 20px;"
+    />
+  </div>
+</template>
+
+<script>
+import { listLiveDataCompany, exportLiveDataCompany } from "@/api/live/liveData";
+import {getCompanyList} from "@/api/company/company";
+
+export default {
+  name: "LiveDataCompany",
+  data() {
+    return {
+      loading: true,
+      exportLoading: false,
+      showSearch: true,
+      dataList: [],
+      companys: [],
+      total: 0,
+      dateRange: [],
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        companyName: null,
+        companyIds: [],
+        startDate: null,
+        endDate: null
+      }
+    };
+  },
+  created() {
+    this.getList();
+    getCompanyList().then(response => {
+      this.companys = response.data || []
+    }).catch(error => {
+      console.error('获取公司列表失败:', error)
+      this.companys = []
+    })
+  },
+  methods: {
+    /** 获取列表数据 */
+    getList() {
+      this.loading = true;
+      if (this.dateRange && this.dateRange.length === 2) {
+        this.queryParams.startDate = this.dateRange[0];
+        this.queryParams.endDate = this.dateRange[1];
+      } else {
+        this.queryParams.startDate = null;
+        this.queryParams.endDate = null;
+      }
+      listLiveDataCompany(this.queryParams).then(response => {
+        if (response.code === 200) {
+          this.dataList = response.rows || [];
+          this.total = response.total || 0;
+        }
+        this.loading = false;
+      }).catch(() => {
+        this.loading = false;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      // 验证公司ID不能为空
+      if (!this.queryParams.companyIds || this.queryParams.companyIds.length === 0) {
+        this.$message.warning('请选择公司');
+        return;
+      }
+
+      // 验证时间范围不能为空
+      if (!this.dateRange || this.dateRange.length !== 2) {
+        this.$message.warning('请选择时间范围');
+        return;
+      }
+
+      // 验证时间范围不能超过31天
+      const startDate = new Date(this.dateRange[0]);
+      const endDate = new Date(this.dateRange[1]);
+      const diffTime = Math.abs(endDate - startDate);
+      const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
+      if (diffDays > 31) {
+        this.$message.warning('时间范围不能超过31天');
+        return;
+      }
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];
+      this.queryParams.companyName = null;
+      this.queryParams.companyIds = [];
+      this.queryParams.startDate = null;
+      this.queryParams.endDate = null;
+      this.$refs.queryForm.resetFields();
+      this.handleQuery();
+    },
+    /** 全选公司 */
+    selectAllCompany() {
+      this.queryParams.companyIds = this.companys.map(c => c.companyId);
+      this.getList();
+    },
+    /** 反选公司 */
+    invertSelectCompany() {
+      const selected = new Set(this.queryParams.companyIds || []);
+      this.queryParams.companyIds = this.companys
+        .filter(c => !selected.has(c.companyId))
+        .map(c => c.companyId);
+      this.getList();
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      if (this.dateRange && this.dateRange.length === 2) {
+        this.queryParams.startDate = this.dateRange[0];
+        this.queryParams.endDate = this.dateRange[1];
+      } else {
+        this.queryParams.startDate = null;
+        this.queryParams.endDate = null;
+      }
+      this.$confirm('是否确认导出分公司直播数据统计?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        const exportParam = { ...this.queryParams };
+        delete exportParam.pageNum;
+        delete exportParam.pageSize;
+        return exportLiveDataCompany(exportParam);
+      }).then(response => {
+        if (response.code === 200) {
+          this.download(response.msg);
+        }
+        this.exportLoading = false;
+      }).catch(() => {
+        this.exportLoading = false;
+      });
+    },
+    formatPercent(value) {
+      const num = Number(value || 0);
+      return `${num.toFixed(2)}%`;
+    },
+    formatMoney(value) {
+      const num = Number(value || 0);
+      return `¥${num.toFixed(2)}`;
+    }
+  }
+};
+</script>
+
+<style scoped>
+.selection-toolbar {
+  display: flex;
+  align-items: center;
+  margin-bottom: 10px;
+  padding-left: 10px;
+}
+
+.live-data-css {
+  padding-left: 10px;
+  padding-top: 30px;
+}
+
+.company-select-wrapper {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+}
+</style>

+ 7 - 0
src/views/qw/externalContact/deptIndex.vue

@@ -422,6 +422,13 @@
           <el-tag v-else type="info"> 未绑定</el-tag>
         </template>
       </el-table-column>
+      <el-table-column label="是否下载APP" width="100px" align="center" fixed="right">
+        <template slot-scope="scope">
+          <el-tag :type="scope.row.isDownloadApp === 1 ? 'success' : 'info'">
+            {{ scope.row.isDownloadApp === 1 ? '已下载' : '未下载' }}
+          </el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="修改" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
         <template slot-scope="scope">
           <el-button

+ 7 - 0
src/views/qw/externalContact/index.vue

@@ -470,6 +470,13 @@
           <el-tag v-else type="info"> 未绑定</el-tag>
         </template>
       </el-table-column>
+      <el-table-column label="是否下载APP" width="100px" align="center" fixed="right">
+        <template slot-scope="scope">
+          <el-tag :type="scope.row.isDownloadApp === 1 ? 'success' : 'info'">
+            {{ scope.row.isDownloadApp === 1 ? '已下载' : '未下载' }}
+          </el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="修改" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
         <template slot-scope="scope">
           <el-button

+ 7 - 0
src/views/qw/externalContact/myExternalContact.vue

@@ -454,6 +454,13 @@
           <el-tag v-else type="info"> 未绑定</el-tag>
         </template>
       </el-table-column>
+      <el-table-column label="是否下载APP" width="100px" align="center" fixed="right">
+        <template slot-scope="scope">
+          <el-tag :type="scope.row.isDownloadApp === 1 ? 'success' : 'info'">
+            {{ scope.row.isDownloadApp === 1 ? '已下载' : '未下载' }}
+          </el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="修改" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
         <template slot-scope="scope">
           <el-button

+ 1 - 1
src/views/qw/sop/sop.vue

@@ -764,7 +764,7 @@
                             <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
                           </el-form-item>
                           <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
-                            <el-input v-model="item.miniprogramAppid='wx503cf8ab31f83dd4' " disabled />
+                            <el-input v-model="item.miniprogramAppid='wxcfd4cd6e2375e42f' " disabled />
                           </el-form-item>
                           <el-form-item label="page路径" prop="miniprogramPage"  v-show="false" label-width="100px" style="margin-left: -30px">
                             <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径"  disabled />

+ 35 - 5
src/views/qw/sopLogs/sopLogsList.vue

@@ -187,7 +187,12 @@
                 <span v-if="item.contentType == 15">APP文本</span>
                 <span v-if="item.contentType == 16">APP语音</span>
                 <span v-if="item.contentType == 11">群公告</span>
-                <span v-if="item.contentType == 4"><el-button size="mini" type="primary" @click="generateShortLink(item)" style="margin-left: 330px;">生成短链</el-button></span>
+                <span v-if="item.contentType == 16">H5看课卡片</span>
+                <span v-if="item.contentType == 18">直播卡片</span>
+                <span v-if="item.contentType == 19">直播短链</span>
+                <span v-if="item.contentType == 4 || item.contentType == 17"><el-button size="mini" type="primary" @click="generateShortLink(item)" style="margin-left: 330px;">生成短链</el-button></span>
+                <span v-if="item.contentType == 18 || item.contentType == 19"><el-button size="mini" type="primary" @click="generateLiveShortLink(item)" style="margin-left: 330px;">复制短链</el-button></span>
+                <span v-if="item.contentType == 21">发看课短信</span>
               </div>
               <div v-if="item.sendStatus">
                 <span>发送状态:</span>
@@ -196,7 +201,7 @@
               </div>
             </div>
             <div v-if="item.sendStatus && item.sendStatus == 2">发送失败原因:<span style="color: #ff4949">{{item.sendRemarks}}</span></div>
-            <div v-if="item.contentType == 1 || item.contentType == 15" v-html="item.value"></div>
+            <div v-if="item.contentType == 1 || item.contentType == 15 || item.contentType == 19" v-html="item.value"></div>
             <div v-if="item.contentType == 2">
               <el-image
                 style="width: 100px; height: 100px"
@@ -220,7 +225,7 @@
                 </div>
               </div>
             </div>
-            <div v-if="item.contentType == 4 || item.contentType == 10" class="message-style">
+            <div v-if="item.contentType == 4 || item.contentType == 10 || item.contentType == 18 || item.contentType == 17" class="message-style">
                 <div style="display: flex; justify-content: space-between; width: 100%">
                   <span style="font-size: 13px; flex: 1">{{ item.miniprogramTitle }}</span>
                   <el-image
@@ -281,7 +286,22 @@
             <div v-if="item.contentType == 11">
               <div v-html="item.value"></div>
             </div>
-
+            <div v-if="item.contentType == 21">
+              <el-card class="box-card" style="margin-top: 1%">
+                <div slot="header" class="clearfix">
+                  <span>短信模板信息</span>
+                </div>
+                <el-form label-width="120px" style="margin-top: 1%">
+
+                  <el-form-item label="模板标题:">
+                    <span>{{ item.smsTemplateTitle || '无' }}</span>
+                  </el-form-item>
+                  <el-form-item label="模板内容:">
+                    <span>{{ item.value || '无' }}</span>
+                  </el-form-item>
+                </el-form>
+              </el-card>
+            </div>
           </el-card>
         </div>
       </div>
@@ -339,7 +359,7 @@ import {
   listQwSopLogsList,
   delQwSopLogs,
   editCourseQwSopLogs,
-  generateShortLink
+  generateShortLink,generateLiveShortLink
 } from '../../../api/qw/sopLogs'
 import {delSopUserLogsInfo} from "@/api/qw/sopUserLogsInfo";
 import userVideo from "@/views/qw/userVideo/userVideo";
@@ -653,6 +673,16 @@ export default {
       });
       this.shortLinkDialogVisible = true;
     },
+    generateLiveShortLink(val){
+      const param = {
+        linkStr:val.miniprogramPage,
+        appId:val.miniprogramAppid
+      };
+      generateLiveShortLink(param).then(res=>{
+        this.copyText = res.urlLink;
+      });
+      this.shortLinkDialogVisible = true;
+    },
     onCopy(){
       navigator.clipboard.writeText(this.copyText).then(() => {
         this.$message.success('复制成功')

+ 95 - 3
src/views/qw/sopTemp/updateSopTemp.vue

@@ -514,7 +514,7 @@
                                               </el-form-item>
                                             </el-card>
                                           </div>
-                                          <div v-if="setList.contentType == 12">
+                                          <div v-if="setList.contentType == 12 || setList.contentType == 18 || setList.contentType == 19">
                                             <el-card class="box-card miniprogram-card">
                                               <div slot="header" class="card-header-mini">
                                                 <i class="el-icon-video-camera"></i>
@@ -543,7 +543,7 @@
                                                 <ImageUpload  :disabled="content.type==20" v-model="setList.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
                                               </el-form-item>
                                               <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
-                                                <el-input v-model="setList.miniprogramAppid='wx503cf8ab31f83dd4' " disabled />
+                                                <el-input v-model="setList.miniprogramAppid='wxcfd4cd6e2375e42f' " disabled />
                                               </el-form-item>
                                               <el-form-item label="page路径" prop="miniprogramPage"  v-show="false" label-width="100px" style="margin-left: -30px">
                                                 <el-input v-model="setList.miniprogramPage" placeholder="小程序消息打开后的路径"  disabled />
@@ -688,6 +688,28 @@
                                               style="width: 90%;margin-top: 10px;"
                                             />
                                           </div>
+
+                                          <div v-if="setList.contentType == 21">
+                                            <el-card class="box-card">
+                                              <el-form-item label="短信模板" >
+                                                <el-select v-model="setList.smsTemplateId"
+                                                           placeholder="请选择短信模板" size="mini"
+                                                           @change="getSmsTemplateInfo(setList)" >
+                                                  <el-option
+                                                    v-for="template in smsTemplateList"
+                                                    :key="template.tempId"
+                                                    :label="template.title"
+                                                    :value="template.tempId"
+                                                  />
+                                                </el-select>
+                                              </el-form-item>
+                                              <el-form-item label="内容预览" v-if="setList.smsTemplateContent">
+                                                <div style="color: #666; font-size: 12px; padding: 8px; border: 1px solid #eee; border-radius: 4px; background-color: #f9f9f9; max-height: 100px; overflow-y: auto;">
+                                                  {{ setList.smsTemplateContent }}
+                                                </div>
+                                              </el-form-item>
+                                            </el-card>
+                                          </div>
                                         </el-form-item>
                                         <!--                                        <el-form-item label="添加短链"-->
                                         <!--                                                      v-if="content.type == 2 && setList.contentType == 1  ">-->
@@ -1773,6 +1795,7 @@ import {listToLiveNoEnd} from "@/api/live/live";
 import ImageUpload from "@/views/qw/sop/ImageUpload";
 import userVideo from "@/views/qw/userVideo/userVideo.vue";
 import {listReward} from "@/api/qw/luckyBag";
+import { getSmsTempList } from "@/api/company/companySmsTemp";
 import {
   getRoles,
 } from "@/api/qw/sop";
@@ -1817,7 +1840,7 @@ export default {
       ruleList: [],
       ids: [],
       // startTimeRange: [],
-      courseTypeList: ['1','2', '4','5','6', '7','8','9','10','14','15','11'],
+      courseTypeList: ['1','2', '4','5','6', '7','8','9','10','14','15','16','11'],
       sysFsSopWatchStatus: [],
       //消息内容类型 企微版
       sysQwSopContentType: [],
@@ -1826,6 +1849,7 @@ export default {
 
       //类别
       sysQwSopSettingType: [],
+      smsTemplateList: [],
 
       courseList: [],
       videoList: [],
@@ -1933,6 +1957,8 @@ export default {
     this.formType = this.$route.params && this.$route.params.type;
     console.info(this.form)
     this.handleUpdate(id);
+
+    this.loadSmsTemplates();
   },
   methods: {
     getLuckyBagStatus(content) {
@@ -1944,6 +1970,53 @@ export default {
         content.luckyBagDataStatus = null;
       }
     },
+
+    // 获取短信模板信息
+    getSmsTemplateInfo(content) {
+      // 如果短信模板列表为空,先加载数据
+      if (this.smsTemplateList.length === 0) {
+        getSmsTempList().then(response => {
+          this.smsTemplateList = response.rows || response.data || [];
+          // 加载完成后再次调用自身来处理选中项
+          this.processSelectedSmsTemplate(content);
+        }).catch(error => {
+          console.error('加载短信模板失败:', error);
+          this.$message.error('加载短信模板失败');
+        });
+      } else {
+        // 直接处理选中项
+        this.processSelectedSmsTemplate(content);
+      }
+    },
+
+    // 处理选中的短信模板
+    processSelectedSmsTemplate(content) {
+      const selectedTemplate = this.smsTemplateList.find(item => item.tempId === content.smsTemplateId);
+      if (selectedTemplate) {
+        // 自动填充模板内容预览
+        this.$set(content, 'smsTemplateContent', selectedTemplate.content || selectedTemplate.templateContent || '');
+      } else {
+        // 清空相关内容
+        this.$set(content, 'smsTemplateContent', '');
+      }
+    },
+
+    // 加载短信模板列表
+    loadSmsTemplates() {
+      if (this.smsTemplateList.length > 0) {
+        return; // 如果已经有数据,不再重复加载
+      }
+
+      getSmsTempList().then(response => {
+        this.smsTemplateList = response.rows || response.data || [];
+        if (this.smsTemplateList.length === 0) {
+          this.$message.info('暂无可用的短信模板');
+        }
+      }).catch(error => {
+        console.error('加载短信模板失败:', error);
+        this.$message.error('加载短信模板失败');
+      });
+    },
     liveChange(content) {
       // content.liveId 是选中的直播间 ID(liveId)
       const selectedLive = this.liveList.find(live => live.liveId === content.liveId);
@@ -2261,6 +2334,17 @@ export default {
             if (data.content[j].setting[k].contentType == 4 && (data.content[j].setting[k].miniprogramTitle != null || data.content[j].setting[k].miniprogramTitle != "")) {
               data.content[j].setting[k].miniprogramTitle = this.truncateTextByByteLength(data.content[j].setting[k].miniprogramTitle, 60)
             }
+            // 处理短信模板数据映射
+            if (data.content[j].setting[k].contentType == 21 && data.content[j].setting[k].smsTemplateId) {
+              // 根据选中的短信模板ID查找对应的模板信息
+              const selectedTemplate = this.smsTemplateList.find(template => template.tempId === data.content[j].setting[k].smsTemplateId);
+              if (selectedTemplate) {
+                // 设置短信模板的相关字段
+                this.$set(data.content[j].setting[k], 'smsTemplateCode', selectedTemplate.tempCode || '');
+                this.$set(data.content[j].setting[k], 'smsTemplateTitle', selectedTemplate.title || '');
+              }
+            }
+
           }
         }
       }
@@ -2412,6 +2496,10 @@ export default {
                 this.$message.error("视频号信息不能为空")
                 return false;
               }
+              if (data.content[j].setting[k].contentType == 21 && (data.content[j].setting[k].smsTemplateId == null || data.content[j].setting[k].smsTemplateId == "")) {
+                this.$message.error("短信模板不能为空")
+                return false;
+              }
             }
           } else if (data.content[j].type == 4) {
             if (data.content[j].aiTouch == null || data.content[j].aiTouch == '') {
@@ -2478,6 +2566,10 @@ export default {
                 this.$message.error("视频号信息不能为空")
                 return false;
               }
+              if (set.contentType == 21 && (set.smsTemplateId == null || set.smsTemplateId == "")) {
+                this.$message.error("短信模板不能为空")
+                return false;
+              }
             }
           }
         }

+ 157 - 57
src/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue

@@ -93,7 +93,7 @@
                         <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
                       </el-form-item>
                       <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
-                        <el-input v-model="item.miniprogramAppid='wx503cf8ab31f83dd4' " disabled />
+                        <el-input v-model="item.miniprogramAppid='wxcfd4cd6e2375e42f' " disabled />
                       </el-form-item>
                       <el-form-item label="page路径" prop="miniprogramPage"  v-show="false" label-width="100px" style="margin-left: -30px">
                         <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径"  disabled />
@@ -101,7 +101,7 @@
                     </el-card>
                   </div> -->
                   <el-form-item label="内容" style="margin-bottom: 2%" >
-                    <div v-if="item.contentType == 12">
+                    <div v-if="item.contentType == 12 || item.contentType == 18 || item.contentType == 19">
                       <el-card class="box-card">
                         <el-form-item label="直播间" >
                           <el-select  v-model="item.liveId"
@@ -125,7 +125,7 @@
                           <ImageUpload :disabled="liveDisabled()" v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
                         </el-form-item>
                         <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
-                          <el-input v-model="item.miniprogramAppid='wx503cf8ab31f83dd4' " disabled />
+                          <el-input v-model="item.miniprogramAppid='wxcfd4cd6e2375e42f' " disabled />
                         </el-form-item>
                         <el-form-item label="page路径" prop="miniprogramPage"  v-show="false" label-width="100px" style="margin-left: -30px">
                           <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径"  disabled />
@@ -179,7 +179,7 @@
                         </el-form-item>
                       </el-card>
                     </div>
-                    <div v-if="item.contentType == 4 || item.contentType == 10 ">
+                    <div v-if="item.contentType == 4 || item.contentType == 10  || item.contentType == 17 ">
                       <el-card class="box-card">
                         <el-form-item label="标题" prop="miniprogramTitle">
                           <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字"  />
@@ -261,7 +261,7 @@
                           <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
                         </el-form-item>
                         <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
-                          <el-input v-model="item.miniprogramAppid='wx503cf8ab31f83dd4' " disabled />
+                          <el-input v-model="item.miniprogramAppid='wxcfd4cd6e2375e42f' " disabled />
                         </el-form-item>
                         <el-form-item label="page路径" prop="miniprogramPage"  v-show="false" label-width="100px" style="margin-left: -30px">
                           <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径"  disabled />
@@ -331,6 +331,27 @@
                       </el-card>
                     </div>
 
+                    <div v-if="item.contentType == 21">
+                      <el-card class="box-card">
+                        <el-form-item label="短信模板" >
+                          <el-select v-model="item.smsTemplateId"
+                                     placeholder="请选择短信模板" size="mini"
+                                     @change="getSmsTemplateInfo(item)" >
+                            <el-option
+                              v-for="template in smsTemplateList"
+                              :key="template.tempId"
+                              :label="template.title"
+                              :value="template.tempId"
+                            />
+                          </el-select>
+                        </el-form-item>
+                        <el-form-item label="内容预览" v-if="item.smsTemplateContent">
+                          <div style="color: #666; font-size: 12px; padding: 8px; border: 1px solid #eee; border-radius: 4px; background-color: #f9f9f9; max-height: 100px; overflow-y: auto;">
+                            {{ item.smsTemplateContent }}
+                          </div>
+                        </el-form-item>
+                      </el-card>
+                    </div>
 
                   </el-form-item>
 
@@ -404,6 +425,7 @@ import {courseList, videoList} from "@/api/qw/sop";
 import userVideo from "@/views/qw/userVideo/userVideo";
 import {listToLiveNoEnd} from "@/api/live/live";
 import {listReward} from "@/api/qw/luckyBag";
+import { getSmsTempList } from "@/api/company/companySmsTemp";
 
 
 export default {
@@ -485,6 +507,7 @@ export default {
         open:false,
         ids:null,
       },
+      smsTemplateList: [],
       // 表单参数
       form: {},
       setting:[{contentType:'1', value: '',}],
@@ -533,6 +556,7 @@ export default {
     listReward(this.queryParams1).then(response => {
       this.luckyBagList = response.rows;
     });
+    this.loadSmsTemplates();
   },
   methods: {
     getLuckyBagStatus(content) {
@@ -596,7 +620,7 @@ export default {
               this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
             }
 
-            if ( this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ){
+            if ( this.setting[i].contentType == 4 || this.setting[i].contentType == 10  || this.setting[i].contentType == 17 ){
               this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
             }
           }
@@ -627,7 +651,7 @@ export default {
 
             }
 
-            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ){
+            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10  || this.setting[i].contentType == 17 ){
               this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
 
               if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
@@ -853,7 +877,7 @@ export default {
               this.$set(this.setting[i], 'linkTitle', selectedCourse.dictLabel);
               this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
             }
-            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ){
+            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17 ){
               this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
             }
 
@@ -878,7 +902,7 @@ export default {
                 this.$set(this.setting[i], 'linkImageUrl', selectedVideo.dictImgUrl);
               }
             }
-            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10){
+            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17){
               this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
 
               if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
@@ -906,6 +930,54 @@ export default {
       };
       this.resetForm("msgForm");
     },
+
+    // 获取短信模板信息(类似福袋的处理方式)
+    getSmsTemplateInfo(content) {
+      // 如果短信模板列表为空,先加载数据
+      if (this.smsTemplateList.length === 0) {
+        getSmsTempList().then(response => {
+          this.smsTemplateList = response.rows || response.data || [];
+          // 加载完成后再次调用自身来处理选中项
+          this.processSelectedSmsTemplate(content);
+        }).catch(error => {
+          console.error('加载短信模板失败:', error);
+          this.$message.error('加载短信模板失败');
+        });
+      } else {
+        // 直接处理选中项
+        this.processSelectedSmsTemplate(content);
+      }
+    },
+
+    // 处理选中的短信模板
+    processSelectedSmsTemplate(content) {
+      const selectedTemplate = this.smsTemplateList.find(item => item.tempId === content.smsTemplateId);
+      if (selectedTemplate) {
+        // 自动填充模板内容预览
+        this.$set(content, 'smsTemplateContent', selectedTemplate.content || selectedTemplate.templateContent || '');
+      } else {
+        // 清空相关内容
+        this.$set(content, 'smsTemplateContent', '');
+      }
+    },
+
+    // 加载短信模板列表
+    loadSmsTemplates() {
+      if (this.smsTemplateList.length > 0) {
+        return; // 如果已经有数据,不再重复加载
+      }
+
+      getSmsTempList().then(response => {
+        this.smsTemplateList = response.rows || response.data || [];
+        if (this.smsTemplateList.length === 0) {
+          this.$message.info('暂无可用的短信模板');
+        }
+      }).catch(error => {
+        console.error('加载短信模板失败:', error);
+        this.$message.error('加载短信模板失败');
+      });
+    },
+
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
@@ -920,40 +992,40 @@ export default {
 
 
 
-          if (this.msgForm.draftStrategy==1){
+          if (this.msgForm.draftStrategy==1) {
 
-          if(!!hasLiveSetting && (this.msgForm.courseId!=null && this.msgForm.courseId!='')){
+            if (!!hasLiveSetting && (this.msgForm.courseId != null && this.msgForm.courseId != '')) {
               return this.$message.error("直播间不能选取课程");
-          }
-          if(!!hasLiveSetting && (this.msgForm.videoId!=null && this.msgForm.videoId!='')){
+            }
+            if (!!hasLiveSetting && (this.msgForm.videoId != null && this.msgForm.videoId != '')) {
               return this.$message.error("直播间不能选取课节");
-          }
-
-            this.msgForm.setting=JSON.stringify(this.setting)
+            }
 
-        let jsonSetting = JSON.parse(this.msgForm.setting);
-          let hasLiveSetting = false;
-          console.log(jsonSetting)
-          for(let index=0;index < jsonSetting.length;index++){
-           if(!!jsonSetting[index] && jsonSetting[index].contentType == "12") {
-            if(!!hasLiveSetting){
-               return this.$message.error("发送直播间只能一次只能发送一条");
+            this.msgForm.setting = JSON.stringify(this.setting)
+
+            let jsonSetting = JSON.parse(this.msgForm.setting);
+            let hasLiveSetting = false;
+            console.log(jsonSetting)
+            for (let index = 0; index < jsonSetting.length; index++) {
+              if (!!jsonSetting[index] && (jsonSetting[index].contentType == "12" || jsonSetting[index].contentType == "18" || jsonSetting[index].contentType == "19")) {
+                if (!!hasLiveSetting) {
+                  return this.$message.error("发送直播间只能一次只能发送一条");
+                }
+                hasLiveSetting = true;
+              }
             }
-            hasLiveSetting = true;
-           }
-          }
             if (this.setting.length <= 0) {
               return this.$message.error("请添加规则")
             }
-            if ((this.msgForm.courseId===null || this.msgForm.courseId==='') && !hasLiveSetting && this.msgForm.liveId===null){
+            if ((this.msgForm.courseId === null || this.msgForm.courseId === '') && !hasLiveSetting && this.msgForm.liveId === null) {
               return this.$message.error("课程不能为空")
             }
 
-            if ((this.msgForm.videoId===null || this.msgForm.videoId==='') && !hasLiveSetting && this.msgForm.liveId===null){
+            if ((this.msgForm.videoId === null || this.msgForm.videoId === '') && !hasLiveSetting && this.msgForm.liveId === null) {
               return this.$message.error("课节不能为空")
             }
 
-            if (this.msgForm.courseType===null || this.msgForm.courseType===''){
+            if (this.msgForm.courseType === null || this.msgForm.courseType === '') {
               return this.$message.error("消息类型不能为空")
             }
 
@@ -964,23 +1036,23 @@ export default {
               if (this.setting[i].contentType == 2 && (this.setting[i].imgUrl == null || this.setting[i].imgUrl == "")) {
                 return this.$message.error("图片不能为空")
               }
-              if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9  ) && (this.setting[i].linkTitle == null || this.setting[i].linkTitle == "")) {
+              if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9) && (this.setting[i].linkTitle == null || this.setting[i].linkTitle == "")) {
                 return this.$message.error("链接标题不能为空")
               }
-              if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ) && (this.setting[i].linkDescribe == null || this.setting[i].linkDescribe == "")) {
+              if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9) && (this.setting[i].linkDescribe == null || this.setting[i].linkDescribe == "")) {
                 return this.$message.error("链接描述不能为空")
               }
-              if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ) && (this.setting[i].linkImageUrl == null || this.setting[i].linkImageUrl == "")) {
+              if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9) && (this.setting[i].linkImageUrl == null || this.setting[i].linkImageUrl == "")) {
                 return this.$message.error("链接图片不能为空")
               }
-              if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 )&& this.setting[i].type == 1 && (this.setting[i].linkUrl == null || this.setting[i].linkUrl == "")) {
+              if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9) && this.setting[i].type == 1 && (this.setting[i].linkUrl == null || this.setting[i].linkUrl == "")) {
                 return this.$message.error("链接地址不能为空")
               }
 
-              if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ) && (this.setting[i].miniprogramTitle == null || this.setting[i].miniprogramTitle == "")) {
+              if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17) && (this.setting[i].miniprogramTitle == null || this.setting[i].miniprogramTitle == "")) {
                 return this.$message.error("小程序消息标题不能为空")
               }
-              if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ) && (this.setting[i].miniprogramPicUrl == null || this.setting[i].miniprogramPicUrl == "")) {
+              if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17) && (this.setting[i].miniprogramPicUrl == null || this.setting[i].miniprogramPicUrl == "")) {
                 return this.$message.error("小程序封面地址不能为空")
               }
 
@@ -1001,32 +1073,60 @@ export default {
               if (this.setting[i].contentType == 14 && (this.setting[i].luckyBagId == null || this.setting[i].luckyBagId === "")) {
                 return this.$message.error("福袋不能为空")
               }
-              if(this.setting[i].contentType == 12 && (this.setting[i].liveId==null || this.setting[i].liveId == "")){
+              if (this.setting[i].contentType == 12 && (this.setting[i].liveId == null || this.setting[i].liveId == "")) {
                 return this.$message.error("直播间不能为空");
               }
+              // 短信模板验证
+              if (this.setting[i].contentType == 21 && (this.setting[i].smsTemplateId == null || this.setting[i].smsTemplateId === "")) {
+                return this.$message.error("短信模板不能为空")
+              }else {
+                if (this.setting[i].contentType == 21 && this.setting[i].smsTemplateId) {
+                  // 根据选中的短信模板ID查找对应的模板信息
+                  const selectedTemplate = this.smsTemplateList.find(template => template.tempId === this.setting[i].smsTemplateId);
+                  if (selectedTemplate) {
+                    // 设置短信模板的相关字段
+                    this.$set(this.setting[i], 'smsTemplateCode', selectedTemplate.tempCode || '');
+                    this.$set(this.setting[i], 'smsTemplateTitle', selectedTemplate.title || '');
+                  }
+                }
+              }
             }
-          }
-
-
-
-          this.sendMsgOpen.open = false;
-
-          const loading = this.$loading({
-            lock: true,
-            text: '正在执行中请稍后~~请不要刷新页面!!',
-            spinner: 'el-icon-loading',
-            background: 'rgba(0, 0, 0, 0.7)'
-          });
-
-          sendMsgSopType(this.msgForm).then(response => {
-            this.msgSuccess("一键群发成功");
-            loading.close();
-            this.setting=[];
-            this.resetSendMsgSop();
-          }).finally(()=>{
-            loading.close();
-          });
 
+            // // 短信模板数据映射
+            // for (let j = 0; j < processedSetting.length; j++) {
+            //   const item = processedSetting[j];
+            //   if (item.contentType == 21 && item.smsTemplateId) {
+            //     // 根据选中的短信模板ID查找对应的模板信息
+            //     const selectedTemplate = this.smsTemplateList.find(template => template.tempId === item.smsTemplateId);
+            //     if (selectedTemplate) {
+            //       // 设置短信模板的相关字段
+            //       this.$set(item, 'smsTemplateCode', selectedTemplate.tempCode || '');
+            //       this.$set(item, 'smsTemplateTitle', selectedTemplate.title || '');
+            //     }
+            //   }
+            // }
+            // // 重新序列化处理后的数据
+            // this.msgForm.setting = JSON.stringify(processedSetting);
+
+            this.msgForm.setting = JSON.stringify(this.setting)
+            this.sendMsgOpen.open = false;
+
+            const loading = this.$loading({
+              lock: true,
+              text: '正在执行中请稍后~~请不要刷新页面!!',
+              spinner: 'el-icon-loading',
+              background: 'rgba(0, 0, 0, 0.7)'
+            });
+
+            sendMsgSopType(this.msgForm).then(response => {
+              this.msgSuccess("一键群发成功");
+              loading.close();
+              this.setting = [];
+              this.resetSendMsgSop();
+            }).finally(() => {
+              loading.close();
+            });
+          }
         }
       });
     },

+ 28 - 9
src/views/qw/sopUserLogsInfo/sendMsgSopOpenTool.vue

@@ -104,7 +104,7 @@
                         </el-form-item>
                       </el-card>
                     </div>
-                    <div v-if="item.contentType == 4 || item.contentType == 10 ">
+                    <div v-if="item.contentType == 4 || item.contentType == 10 || item.contentType == 17">
                       <el-card class="box-card">
                         <el-form-item label="标题" prop="miniprogramTitle">
                           <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字"  />
@@ -204,7 +204,7 @@
                       </el-card>
                     </div>
 
-                    <div v-if="item.contentType == 12">
+                    <div v-if="item.contentType == 12 || item.contentType == 18 || item.contentType == 19">
                       <el-card class="box-card">
                         <el-form-item label="直播间" >
                           <el-select  v-model="item.liveId"
@@ -228,7 +228,7 @@
                           <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
                         </el-form-item>
                         <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
-                          <el-input v-model="item.miniprogramAppid='wx503cf8ab31f83dd4' " disabled />
+                          <el-input v-model="item.miniprogramAppid='wxcfd4cd6e2375e42f' " disabled />
                         </el-form-item>
                         <el-form-item label="page路径" prop="miniprogramPage"  v-show="false" label-width="100px" style="margin-left: -30px">
                           <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径"  disabled />
@@ -329,6 +329,7 @@ import ImageUpload from "@/views/qw/sop/ImageUpload.vue";
 import {courseList, videoList} from "@/api/qw/sop";
 import userVideo from "@/views/qw/userVideo/userVideo";
 import {listReward} from "@/api/qw/luckyBag";
+import {listToLiveNoEnd} from "@/api/live/live";
 
 
 export default {
@@ -405,6 +406,7 @@ export default {
       //插件版
       sysQwSopAiContentType:[],
 
+      liveList: [],
       sendMsgOpen:{
         title:'一键批量群发',
         open:false,
@@ -446,6 +448,9 @@ export default {
     this.getDicts("sys_fs_sop_watch_status").then(response => {
       this.sysFsSopWatchStatus = response.data;
     });
+    listToLiveNoEnd().then(response => {
+      this.liveList = response.rows;
+    });
 
     courseList().then(response => {
       this.courseList = response.list;
@@ -464,6 +469,20 @@ export default {
         content.luckyBagDataStatus = null;
       }
     },
+    liveChange(content) {
+      // content.liveId 是选中的直播间 ID(liveId)
+      const selectedLive = this.liveList.find(live => live.liveId === content.liveId);
+      if (selectedLive) {
+        // 从选中的直播间对象中提取标题和封面,赋值给当前内容的对应字段
+        // 假设直播间对象中标题字段为 liveTitle,封面字段为 coverImg(根据实际接口字段调整)
+        content.miniprogramTitle = selectedLive.liveName || ''; // 自动填充标题
+        content.miniprogramPicUrl = selectedLive.liveImgUrl || ''; // 自动填充封面
+      } else {
+        // 若未找到对应直播间,清空标题和封面(可选)
+        content.miniprogramTitle = '';
+        content.miniprogramPicUrl = '';
+      }
+    },
 
     qwUserVideoResult(val) {
 
@@ -502,7 +521,7 @@ export default {
               this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
             }
 
-            if ( this.setting[i].contentType == 4 || this.setting[i].contentType == 10  ){
+            if ( this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17){
               this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
             }
           }
@@ -532,7 +551,7 @@ export default {
               }
             }
 
-            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ){
+            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17){
               this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
 
               if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
@@ -760,7 +779,7 @@ export default {
               this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
 
             }
-            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10){
+            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17){
               this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
 
             }
@@ -787,7 +806,7 @@ export default {
               }
 
             }
-            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10){
+            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17){
               this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
 
               if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
@@ -865,10 +884,10 @@ export default {
                 return this.$message.error("链接地址不能为空")
               }
 
-              if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10) && (this.setting[i].miniprogramTitle == null || this.setting[i].miniprogramTitle == "")) {
+              if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10  || this.setting[i].contentType == 17) && (this.setting[i].miniprogramTitle == null || this.setting[i].miniprogramTitle == "")) {
                 return this.$message.error("小程序消息标题不能为空")
               }
-              if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10) && (this.setting[i].miniprogramPicUrl == null || this.setting[i].miniprogramPicUrl == "")) {
+              if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10 || this.setting[i].contentType == 17) && (this.setting[i].miniprogramPicUrl == null || this.setting[i].miniprogramPicUrl == "")) {
                 return this.$message.error("小程序封面地址不能为空")
               }
 

+ 90 - 3
src/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue

@@ -407,7 +407,7 @@
                         placeholder="输入要转为语音的内容" style="width: 90%;margin-top: 10px;"
                         @input="handleInputVideoText(item.value,item)"/>
                     </div>
-                    <div v-if="item.contentType == 12">
+                    <div v-if="item.contentType == 12 || item.contentType == 18 || item.contentType == 19">
                       <!--                                           <div >-->
                       <el-card class="box-card">
                         <el-form-item label="直播间" >
@@ -432,7 +432,7 @@
                           <ImageUpload :disabled="liveDisabled()" v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
                         </el-form-item>
                         <el-form-item label="appid" prop="miniprogramAppid" v-show="false">
-                          <el-input v-model="item.miniprogramAppid='wx503cf8ab31f83dd4' " disabled />
+                          <el-input v-model="item.miniprogramAppid='wxcfd4cd6e2375e42f' " disabled />
                         </el-form-item>
                         <el-form-item label="page路径" prop="miniprogramPage"  v-show="false" label-width="100px" style="margin-left: -30px">
                           <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径"  disabled />
@@ -501,6 +501,27 @@
                       </el-card>
                     </div>
 
+                    <div v-if="item.contentType == 21">
+                      <el-card class="box-card">
+                        <el-form-item label="短信模板" >
+                          <el-select v-model="item.smsTemplateId"
+                                     placeholder="请选择短信模板" size="mini"
+                                     @change="getSmsTemplateInfo(item)" >
+                            <el-option
+                              v-for="template in smsTemplateList"
+                              :key="template.tempId"
+                              :label="template.title"
+                              :value="template.tempId"
+                            />
+                          </el-select>
+                        </el-form-item>
+                        <el-form-item label="内容预览" v-if="item.smsTemplateContent">
+                          <div style="color: #666; font-size: 12px; padding: 8px; border: 1px solid #eee; border-radius: 4px; background-color: #f9f9f9; max-height: 100px; overflow-y: auto;">
+                            {{ item.smsTemplateContent }}
+                          </div>
+                        </el-form-item>
+                      </el-card>
+                    </div>
                   </el-form-item>
 
                   <el-form-item label="添加短链" v-if="item.contentType == 1 || item.contentType == 15"  >
@@ -631,6 +652,7 @@ import userVideo from "@/views/qw/userVideo/userVideo.vue";
 import PaginationMore from "../../../components/PaginationMore/index.vue";
 import {listToLiveNoEnd} from "@/api/live/live";
 import {listReward} from "@/api/qw/luckyBag";
+import { getSmsTempList } from "@/api/company/companySmsTemp";
 
 export default {
   name: "sopUserLogsInfoDetails",
@@ -708,6 +730,7 @@ export default {
 
       tagGroupList: [],
 
+      smsTemplateList: [],
       tagTotal:0,
 
       //标签
@@ -792,6 +815,7 @@ export default {
       this.luckyBagList = response.rows;
     });
 
+    this.loadSmsTemplates();
   },
   methods: {
     getLuckyBagStatus(content) {
@@ -1365,6 +1389,53 @@ export default {
       this.resetForm("queryForm");
       this.handleQuery();
     },
+    // 获取短信模板信息(类似福袋的处理方式)
+    getSmsTemplateInfo(content) {
+      // 如果短信模板列表为空,先加载数据
+      if (this.smsTemplateList.length === 0) {
+        getSmsTempList().then(response => {
+          this.smsTemplateList = response.rows || response.data || [];
+          // 加载完成后再次调用自身来处理选中项
+          this.processSelectedSmsTemplate(content);
+        }).catch(error => {
+          console.error('加载短信模板失败:', error);
+          this.$message.error('加载短信模板失败');
+        });
+      } else {
+        // 直接处理选中项
+        this.processSelectedSmsTemplate(content);
+      }
+    },
+
+    // 处理选中的短信模板
+    processSelectedSmsTemplate(content) {
+      const selectedTemplate = this.smsTemplateList.find(item => item.tempId === content.smsTemplateId);
+      if (selectedTemplate) {
+        // 自动填充模板内容预览
+        this.$set(content, 'smsTemplateContent', selectedTemplate.content || selectedTemplate.templateContent || '');
+      } else {
+        // 清空相关内容
+        this.$set(content, 'smsTemplateContent', '');
+      }
+    },
+
+    // 加载短信模板列表
+    loadSmsTemplates() {
+      if (this.smsTemplateList.length > 0) {
+        return; // 如果已经有数据,不再重复加载
+      }
+
+      getSmsTempList().then(response => {
+        this.smsTemplateList = response.rows || response.data || [];
+        if (this.smsTemplateList.length === 0) {
+          this.$message.info('暂无可用的短信模板');
+        }
+      }).catch(error => {
+        console.error('加载短信模板失败:', error);
+        this.$message.error('加载短信模板失败');
+      });
+    },
+
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
@@ -1405,7 +1476,7 @@ export default {
           let hasLiveSetting = false;
           let jsonSetting = JSON.parse(this.msgForm.setting);
           for(let index=0;index < jsonSetting.length;index++){
-           if(!!jsonSetting[index] && jsonSetting[index].contentType == "12") {
+           if(!!jsonSetting[index] && (jsonSetting[index].contentType == "12" || jsonSetting[index].contentType == "18" || jsonSetting[index].contentType == "19") ) {
             if(!!hasLiveSetting){
                return this.$message.error("发送直播间只能一次只能发送一条");
             }
@@ -1468,9 +1539,25 @@ export default {
             }
             if (this.setting[i].contentType == 7 && (this.setting[i].value == null || this.setting[i].value == "")) {
               return this.$message.error("语音不能为空")
+            }// 短信模板验证
+            if (this.setting[i].contentType == 21 && (this.setting[i].smsTemplateId == null || this.setting[i].smsTemplateId === "")) {
+              return this.$message.error("短信模板不能为空")
+            }else {
+              if (this.setting[i].contentType == 21 && this.setting[i].smsTemplateId) {
+                // 根据选中的短信模板ID查找对应的模板信息
+                const selectedTemplate = this.smsTemplateList.find(template => template.tempId === this.setting[i].smsTemplateId);
+                if (selectedTemplate) {
+                  // 设置短信模板的相关字段
+                  this.$set(this.setting[i], 'smsTemplateCode', selectedTemplate.tempCode || '');
+                  this.$set(this.setting[i], 'smsTemplateTitle', selectedTemplate.title || '');
+                }
+              }
             }
           }
 
+          // 重新序列化处理后的数据
+          this.msgForm.setting=JSON.stringify(this.setting)
+
           this.sendMsgOpen.open = false;
 
           const loading = this.$loading({

+ 188 - 0
src/views/wx/sopUserLogsWx/detail.vue

@@ -0,0 +1,188 @@
+<template>
+  <div class="app-container">
+    <!-- SOP信息卡片 -->
+    <div style="margin-bottom: 10px">
+      <el-card>
+        <span class="custom-style" style="display: block; margin-bottom: 10px">SOP编号:{{ queryParams.sopId }}</span>
+        <span class="custom-style" style="display: block;">营期编号:{{ queryParams.sopUserId }}</span>
+      </el-card>
+    </div>
+
+    <!-- 搜索表单 -->
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="联系人ID" prop="wxContactId">
+        <el-input
+          v-model="queryParams.wxContactId"
+          placeholder="请输入联系人ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="小程序ID" prop="fsUserId">
+        <el-input
+          v-model="queryParams.fsUserId"
+          placeholder="请输入小程序ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="客户评级" prop="grade">
+        <el-select v-model="queryParams.grade" placeholder="请选择客户评级" clearable size="small">
+          <el-option label="无" :value="0" />
+          <el-option label="A" :value="1" />
+          <el-option label="B" :value="2" />
+          <el-option label="C" :value="3" />
+          <el-option label="D" :value="4" />
+          <el-option label="E" :value="5" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
+          <el-option label="正常" :value="0" />
+          <el-option label="禁用" :value="1" />
+        </el-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>
+
+    <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+
+    <!-- 客户列表表格 -->
+    <el-table border v-loading="loading" :data="customerList">
+      <el-table-column type="index" label="序号" width="60" align="center" />
+      <el-table-column label="用户ID" align="center" prop="customerId" width="180" />
+      <el-table-column label="总完课天数" align="center" prop="finishCout" width="110" />
+      <el-table-column label="最近完课时间" align="center" prop="finishTime" width="160">
+        <template slot-scope="scope">
+          <span v-if="scope.row.finishTime">{{ parseTime(scope.row.finishTime) }}</span>
+          <span v-else style="color: #999;">-</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="连续完课天数" align="center" prop="finishCourseDays" width="110" />
+      <el-table-column label="客户标签" align="center" prop="tagNames" min-width="150" show-overflow-tooltip />
+      <el-table-column label="客户评级" align="center" prop="grade" width="90">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.grade === 0" type="info">无</el-tag>
+          <el-tag v-else-if="scope.row.grade === 1" type="success">A</el-tag>
+          <el-tag v-else-if="scope.row.grade === 2" type="primary">B</el-tag>
+          <el-tag v-else-if="scope.row.grade === 3" type="warning">C</el-tag>
+          <el-tag v-else-if="scope.row.grade === 4" type="danger">D</el-tag>
+          <el-tag v-else-if="scope.row.grade === 5" type="danger">E</el-tag>
+          <el-tag v-else type="info">-</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="7天未看课" align="center" prop="isDaysNotStudy" width="100">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.isDaysNotStudy === 0" type="success">否</el-tag>
+          <el-tag v-else-if="scope.row.isDaysNotStudy === 1" type="warning">是</el-tag>
+          <el-tag v-else type="info">-</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" align="center" prop="status" width="80">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.status === 0" type="success">正常</el-tag>
+          <el-tag v-else-if="scope.row.status === 1" type="warning">禁用</el-tag>
+          <el-tag v-else type="info">未知</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="createTime" width="160">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime) }}</span>
+        </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 { getSopUserLogsDetail } from "@/api/wx/sopUserLogsWx";
+
+export default {
+  name: "SopUserLogsDetailWx",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 客户列表数据
+      customerList: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        sopId: null,
+        sopUserId: null,
+        wxContactId: null,
+        fsUserId: null,
+        grade: null,
+        status: null
+      }
+    };
+  },
+  created() {
+    // 从路由参数获取sopUserId和sopId
+    const sopUserId = this.$route.params.sopUserId || this.$route.query.sopUserId;
+    const sopId = this.$route.params.sopId || this.$route.query.sopId;
+    
+    if (sopUserId) {
+      this.queryParams.sopUserId = sopUserId;
+    }
+    if (sopId) {
+      this.queryParams.sopId = sopId;
+    }
+    
+    // 加载数据
+    this.getList();
+  },
+  methods: {
+    /** 查询客户列表 */
+    getList() {
+      this.loading = true;
+      getSopUserLogsDetail(this.queryParams.sopUserId, this.queryParams).then(response => {
+        console.log('个微SOP营期详情接口返回数据:', response);
+        this.customerList = response.rows || [];
+        this.total = response.total || 0;
+        this.loading = false;
+      }).catch(error => {
+        console.error('查询个微SOP营期详情失败:', error);
+        this.loading = false;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    }
+  }
+};
+</script>
+
+<style scoped>
+.custom-style {
+  font-size: 14px;
+  color: #606266;
+}
+</style>

+ 351 - 0
src/views/wx/sopUserLogsWx/sopUserLogsScheduleWx.vue

@@ -0,0 +1,351 @@
+<template>
+  <div class="app-container">
+    <!-- SOP信息卡片 -->
+    <div style="margin-bottom: 10px">
+      <el-card>
+        <span class="custom-style" style="display: block; margin-bottom: 10px">SOP规则名称:{{ sopName }}</span>
+        <span class="custom-style" style="display: block; margin-bottom: 10px">SOP规则编号:{{ queryParams.sopId }}</span>
+        <span class="custom-style" style="display: block;">模板编号:{{ tempId }}</span>
+      </el-card>
+    </div>
+
+    <!-- 搜索表单 -->
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="执行账号" prop="accountId">
+        <el-input
+          v-model="queryParams.accountId"
+          placeholder="请输入执行账号ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="营期时间" prop="startTime">
+        <el-date-picker 
+          clearable 
+          size="small"
+          v-model="queryParams.startTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择营期时间"
+        />
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
+          <el-option label="正常" :value="0" />
+          <el-option label="暂停" :value="1" />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <!-- 操作按钮栏 -->
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-tooltip class="item" effect="dark" content="删除营期后将不再给该营期发送消息,删除后不可恢复" placement="top">
+          <el-button
+            type="danger"
+            icon="el-icon-delete"
+            size="mini"
+            :disabled="multiple"
+            @click="handleDelete"
+            v-hasPermi="['wx:sopUserLogsWx:remove']"
+          >批量删除营期</el-button>
+        </el-tooltip>
+      </el-col>
+      <el-col :span="1.5">
+        <el-tooltip class="item" effect="dark" content="修改选择的营期时间" placement="top">
+          <el-button
+            type="primary"
+            icon="el-icon-edit"
+            size="mini"
+            :disabled="multiple"
+            @click="handleUpdateTime"
+          >批量修改营期时间</el-button>
+        </el-tooltip>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <!-- 提示信息 -->
+    <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px">
+      <i class="el-icon-info"></i>
+      【天数】:列表中的天数代表插件助手会发送任务模板里的第几天的消息
+    </div>
+
+    <!-- 营期数据表格 -->
+    <el-table border v-loading="loading" :data="sopUserLogsWxList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="营期编号" align="center" prop="id" width="100" />
+      <el-table-column label="SOP任务ID" align="center" prop="sopId" width="120" />
+      <el-table-column label="执行账号ID" align="center" prop="accountId" width="150" />
+      <el-table-column label="执行账号名称" align="center" prop="accountName" width="150">
+        <template slot-scope="scope">
+          <span v-if="scope.row.accountName">{{ scope.row.accountName }}</span>
+          <span v-else style="color: #999;">未匹配</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="营期时间" align="center" prop="startTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="天数" align="center" prop="countDays" width="100" />
+      <el-table-column label="状态" align="center" prop="status" width="120">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.status === 0" type="success">正常</el-tag>
+          <el-tag v-else-if="scope.row.status === 1" type="warning">暂停</el-tag>
+          <el-tag v-else type="info">未知</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-view"
+            @click="handleDetail(scope.row)"
+          >详情</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['wx:sopUserLogsWx:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页组件 -->
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 批量修改营期时间对话框 -->
+    <el-dialog title="批量修改营期时间" :visible.sync="updateTimeOpen" width="500px" append-to-body>
+      <el-form ref="updateTimeForm" :model="updateTimeForm" :rules="updateTimeRules" label-width="120px">
+        <el-form-item label="选择营期时间" prop="newStartTime">
+          <el-date-picker 
+            clearable 
+            size="small"
+            v-model="updateTimeForm.newStartTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择新的营期时间"
+            style="width: 100%;"
+          />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitUpdateTime">确 定</el-button>
+        <el-button @click="updateTimeOpen = false">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { 
+  listSopUserLogsWx, 
+  getSopUserLogsWx, 
+  delSopUserLogsWx, 
+  exportSopUserLogsWx,
+  updateLogDate
+} from "@/api/wx/sopUserLogsWx";
+
+export default {
+  name: "SopUserLogsScheduleWx",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 营期表格数据
+      sopUserLogsWxList: [],
+      // SOP名称
+      sopName: '',
+      // 模板ID
+      tempId: '',
+      // 批量修改营期时间对话框
+      updateTimeOpen: false,
+      // 批量修改营期时间表单
+      updateTimeForm: {
+        ids: [],
+        newStartTime: null
+      },
+      // 批量修改营期时间表单校验
+      updateTimeRules: {
+        newStartTime: [
+          { required: true, message: "请选择新的营期时间", trigger: "change" }
+        ]
+      },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        sopId: null,
+        accountId: null,
+        startTime: null,
+        status: null
+      }
+    };
+  },
+  created() {
+    // 从路由参数获取SOP ID
+    const sopId = this.$route.params.id;
+    if (sopId) {
+      this.queryParams.sopId = sopId;
+      this.sopName = this.$route.query.name || '';
+      this.tempId = this.$route.query.tempId || '';
+    }
+    
+    // 加载数据
+    this.getList();
+  },
+  methods: {
+    /** 查询营期列表 */
+    getList() {
+      this.loading = true;
+      listSopUserLogsWx(this.queryParams).then(response => {
+        console.log('个微SOP营期接口返回数据:', response);
+        this.sopUserLogsWxList = response.rows || [];
+        this.total = response.total || 0;
+        this.loading = false;
+      }).catch(error => {
+        console.error('查询个微SOP营期失败:', error);
+        this.loading = false;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 多选框选中数据 */
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
+    },
+    /** 打开批量修改营期时间对话框 */
+    handleUpdateTime() {
+      this.updateTimeForm = {
+        ids: this.ids,
+        newStartTime: null
+      };
+      this.updateTimeOpen = true;
+      this.$nextTick(() => {
+        this.$refs["updateTimeForm"].clearValidate();
+      });
+    },
+    /** 提交批量修改营期时间 */
+    submitUpdateTime() {
+      this.$refs["updateTimeForm"].validate(valid => {
+        if (valid) {
+          const loading = this.$loading({
+            lock: true,
+            text: '正在修改中,请稍候...',
+            spinner: 'el-icon-loading',
+            background: 'rgba(0, 0, 0, 0.7)'
+          });
+          
+          updateLogDate({
+            ids: this.updateTimeForm.ids.join(','),
+            newStartTime: this.updateTimeForm.newStartTime
+          }).then(response => {
+            console.log('批量修改个微SOP营期时间返回数据:', response);
+            this.msgSuccess("修改成功");
+            this.updateTimeOpen = false;
+            this.getList();
+          }).catch(error => {
+            console.error('批量修改个微SOP营期时间失败:', error);
+            this.msgError("修改失败");
+          }).finally(() => {
+            loading.close();
+          });
+        }
+      });
+    },
+    /** 跳转到营期详情页面 */
+    handleDetail(row) {
+      this.$router.push({
+        path: '/wxSop/sopUserLogsWx/detail',
+        query: {
+          sopUserId: row.id,
+          sopId: row.sopId
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids.join(',');
+      this.$confirm('删除营期后将不再给该营期发送消息,删除后不可恢复。是否确认删除营期编号为"' + ids + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        return delSopUserLogsWx(ids);
+      }).then(response => {
+        console.log('删除个微SOP营期返回数据:', response);
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(error => {
+        if (error !== 'cancel') {
+          console.error('删除个微SOP营期失败:', error);
+        }
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.$confirm('是否确认导出所有个微SOP营期数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportSopUserLogsWx(this.queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {
+        this.exportLoading = false;
+      });
+    }
+  }
+};
+</script>
+
+<style scoped>
+.custom-style {
+  font-size: 14px;
+  color: #606266;
+}
+</style>

+ 121 - 3
src/views/wx/wxSop/index.vue

@@ -82,10 +82,30 @@
           v-hasPermi="['wx:wxSop:add']"
         >新增</el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-video-play"
+          size="mini"
+          :disabled="multiple"
+          @click="handleBatchExecute"
+          v-hasPermi="['qw:sop:batchExecuteWx']"
+        >批量执行个微SOP</el-button>
+      </el-col>
     </el-row>
 
     <el-table border v-loading="loading" :data="wxSopList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="id" align="center" prop="id" />
+      <el-table-column label="状态" align="center" prop="status" width="120">
+        <template slot-scope="scope">
+          <el-tag type="info" v-if="scope.row.status === 0">停止</el-tag>
+          <el-tag type="success" v-else-if="scope.row.status === 1">启用</el-tag>
+          <el-tag type="warning" v-else-if="scope.row.status === 2">执行中</el-tag>
+          <el-tag v-else>未知</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="名称" align="center" prop="name" />
       <el-table-column label="筛选方式" align="center" prop="filterType">
         <template slot-scope="scope">
@@ -119,8 +139,23 @@
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remark" />
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="280">
         <template slot-scope="scope">
+          <el-button
+            v-if="scope.row.status === 2 || scope.row.status === 0"
+            size="mini"
+            type="text"
+            icon="el-icon-tickets"
+            @click="handleViewSchedule(scope.row)"
+            v-hasPermi="['wx:wxSop:list']"
+          >营期</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-view"
+            @click="handleViewDetail(scope.row)"
+            v-hasPermi="['wx:wxSop:list']"
+          >执行详情</el-button>
           <el-button
             size="mini"
             type="text"
@@ -330,7 +365,7 @@
 </template>
 
 <script>
-import { listWxSop, getWxSop, delWxSop, addWxSop, updateWxSop, exportWxSop } from "@/api/wx/wxSop";
+import { listWxSop, getWxSop, delWxSop, addWxSop, updateWxSop, exportWxSop, updateWxStatus } from "@/api/wx/wxSop";
 import { listSopTemp } from "@/api/qw/sopTemp";
 import Tip from "@/components/Tip";
 import QwUserSelect from "@/views/components/QwUserSelect.vue";
@@ -566,6 +601,26 @@ export default {
         accountIds: f.accountIds || null
       };
     },
+    /** 查看营期按钮操作 */
+    handleViewSchedule(row) {
+      this.$router.push({
+        path: '/wxSop/sopUserLogsWx/sopUserLogsScheduleWx/' + row.id,
+        query: {
+          name: row.name,
+          tempId: row.tempId
+        }
+      });
+    },
+    /** 查看执行详情按钮操作 */
+    handleViewDetail(row) {
+      this.$router.push({
+        path: '/wxSop/wxSop/sopLogsList/' + row.id,
+        query: {
+          name: row.name,
+          tempId: row.tempId
+        }
+      });
+    },
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
@@ -580,7 +635,70 @@ export default {
           this.msgSuccess("删除成功");
         }).catch(() => {});
     },
-    /** 导出按钮操作 */
+    /** 批量执行个微SOP */
+    handleBatchExecute() {
+      if (this.ids.length === 0) {
+        this.$message.warning("请至少选择一条记录");
+        return;
+      }
+
+      // 过滤出启用状态的SOP
+      const enabledSops = this.wxSopList.filter(item => 
+        this.ids.includes(item.id) && item.status === 1
+      );
+
+      if (enabledSops.length === 0) {
+        this.$message.warning("所选SOP中没有启用状态的记录,只能执行启用状态的SOP");
+        return;
+      }
+
+      const enabledIds = enabledSops.map(item => item.id);
+      const notEnabledCount = this.ids.length - enabledIds.length;
+
+      let confirmMsg = `是否确认批量执行所选的${enabledIds.length}条个微SOP?`;
+      if (notEnabledCount > 0) {
+        confirmMsg += `\n注意:已自动过滤${notEnabledCount}条非启用状态的记录`;
+      }
+
+      this.$confirm(confirmMsg, "批量执行确认", {
+        confirmButtonText: "确定执行",
+        cancelButtonText: "取消",
+        type: "warning",
+        distinguishCancelAndClose: true
+      }).then(() => {
+        this.loading = true;
+        return updateWxStatus(enabledIds.join(","));
+      }).then(response => {
+        this.loading = false;
+        
+        console.log('批量执行个微SOP接口返回数据:', response);
+        
+        // 解析后端返回的统计信息
+        if (response && response.msg) {
+          const successCount = response.data?.successCount || enabledIds.length;
+          const failCount = response.data?.failCount || 0;
+          
+          let msg = `批量执行完成!`;
+          msg += `\n成功:${successCount}条`;
+          if (failCount > 0) {
+            msg += `\n失败:${failCount}条`;
+          }
+          
+          this.msgSuccess(msg);
+        } else {
+          this.msgSuccess(`已成功执行${enabledIds.length}条个微SOP`);
+        }
+        
+        // 刷新列表
+        this.getList();
+      }).catch(error => {
+        this.loading = false;
+        if (error !== 'cancel' && error !== 'close') {
+          console.error('批量执行个微SOP失败:', error);
+          this.msgError("批量执行失败,请稍后重试");
+        }
+      });
+    },
     handleExport() {
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有个微SOP数据项?', "警告", {

+ 295 - 0
src/views/wx/wxSop/sopLogsList.vue

@@ -0,0 +1,295 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
+      <el-form-item label="个微账号昵称" prop="accountName">
+        <el-input
+          v-model="queryParams.accountName"
+          placeholder="请输入个微账号昵称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="客户昵称" prop="wxContactName">
+        <el-input
+          v-model="queryParams.wxContactName"
+          placeholder="请输入客户昵称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="发送状态" prop="sendStatus">
+        <el-select v-model="queryParams.sendStatus" placeholder="请选择发送状态" clearable size="small">
+          <el-option
+            v-for="dict in sendStatusOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="发送类型" prop="sendType">
+        <el-select v-model="queryParams.sendType" placeholder="请选择发送类型" clearable size="small">
+          <el-option
+            v-for="dict in sysQwSopType"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="消息类型" prop="type">
+        <el-select v-model="queryParams.type" placeholder="请选择消息类型" clearable size="small">
+          <el-option label="个人" :value="0" />
+          <el-option label="群" :value="1" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="预计发送时间" prop="scheduleTime">
+        <el-date-picker
+          clearable
+          size="small"
+          v-model="scheduleTime"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          placeholder="选择预计发送时间"
+          @change="handleScheduleTimeChange"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['wx:wxSopLogs:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="wxSopLogsList">
+      <el-table-column label="编号" align="center" prop="id" width="80" />
+      <el-table-column label="个微账号昵称" align="center" prop="accountName" />
+      <el-table-column label="客户昵称" align="center" prop="wxContactName" />
+      <el-table-column label="客户标签" align="center" prop="tagNames" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <span v-if="scope.row.tagNames">{{ scope.row.tagNames }}</span>
+          <span v-else style="color: #909399;">-</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="发送状态" align="center" prop="sendStatus" width="100">
+        <template slot-scope="scope">
+          <el-tag type="info" v-if="scope.row.sendStatus === 0">待发送</el-tag>
+          <el-tag type="success" v-else-if="scope.row.sendStatus === 1">发送成功</el-tag>
+          <el-tag type="danger" v-else-if="scope.row.sendStatus === 2">发送失败</el-tag>
+          <el-tag type="warning" v-else-if="scope.row.sendStatus === 3">消息作废</el-tag>
+          <el-tag v-else>未知</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="发送类型" align="center" prop="sendType" width="100">
+        <template slot-scope="scope">
+          <dict-tag :options="sysQwSopType" :value="scope.row.sendType"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="生成类型" align="center" prop="generateType" width="100">
+        <template slot-scope="scope">
+          <el-tag type="success" v-if="scope.row.generateType === 0">自动</el-tag>
+          <el-tag type="primary" v-else-if="scope.row.generateType === 1">手动</el-tag>
+          <el-tag v-else>未知</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="生成时间" align="center" prop="createTime" width="165" />
+      <el-table-column label="实际发送时间" align="center" prop="realSendTime" width="165">
+        <template slot-scope="scope">
+          <span v-if="scope.row.realSendTime">{{ scope.row.realSendTime }}</span>
+          <span v-else style="color: #909399;">-</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="消息过期时间" align="center" prop="expirationTime" width="165">
+        <template slot-scope="scope">
+          <span v-if="scope.row.expirationTime">{{ scope.row.expirationTime }}</span>
+          <span v-else style="color: #909399;">-</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="发送备注" align="center" prop="sendRemark" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <span v-if="scope.row.sendRemark">{{ scope.row.sendRemark }}</span>
+          <span v-else style="color: #909399;">-</span>
+        </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 { listWxSopLogsCVO, exportWxSopLogsCVO } from "@/api/wx/wxSopLogs";
+
+export default {
+  name: "WxSopLogsList",
+  props: {
+    rowDetailFrom: {
+      type: Object,
+      default: () => ({})
+    }
+  },
+  watch: {
+    rowDetailFrom: {
+      handler(newVal) {
+        // 当formData变化时重新查询
+        this.getList(newVal);
+      },
+      deep: true
+    }
+  },
+  data() {
+    return {
+      // 时间选择
+      scheduleTime: null,
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 个微SOP执行详情表格数据
+      wxSopLogsList: [],
+      // 发送状态字典
+      sendStatusOptions: [
+        { dictValue: '0', dictLabel: '待发送', listClass: 'default' },
+        { dictValue: '1', dictLabel: '发送成功', listClass: 'success' },
+        { dictValue: '2', dictLabel: '发送失败', listClass: 'danger' },
+        { dictValue: '3', dictLabel: '消息作废', listClass: 'warning' }
+      ],
+      // 企微SOP发送类型
+      sysQwSopType: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        sopId: null,
+        accountName: null,
+        wxContactName: null,
+        sendStatus: null,
+        sendType: null,
+        type: null,
+        scheduleStartTime: null,
+        scheduleEndTime: null
+      }
+    };
+  },
+  created() {
+    this.getList(this.rowDetailFrom);
+    
+    // 发送消息类型
+    this.getDicts("sys_qw_sop_course_type").then(response => {
+      this.sysQwSopType = response.data;
+    });
+  },
+  methods: {
+    /** 查询个微SOP执行详情列表 */
+    getList(val) {
+      this.queryParams.sopId = val?.id || this.rowDetailFrom?.id;
+      this.loading = true;
+
+      listWxSopLogsCVO(this.queryParams).then(response => {
+        console.log('个微SOP执行详情接口返回数据:', response);
+        this.wxSopLogsList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      }).catch(error => {
+        console.error('查询个微SOP执行详情失败:', error);
+        this.loading = false;
+      });
+    },
+
+    handleScheduleTimeChange(val) {
+      if (val) {
+        this.queryParams.scheduleStartTime = this.formatDateTime(val[0]);
+        this.queryParams.scheduleEndTime = this.formatDateTime(val[1]);
+      } else {
+        this.queryParams.scheduleStartTime = null;
+        this.queryParams.scheduleEndTime = null;
+      }
+    },
+
+    // 格式化日期为 yyyy-MM-dd HH:mm:ss 的北京时间
+    formatDateTime(date) {
+      if (!date) return null;
+
+      const options = {
+        timeZone: 'Asia/Shanghai',
+        year: 'numeric',
+        month: '2-digit',
+        day: '2-digit',
+        hour: '2-digit',
+        minute: '2-digit',
+        second: '2-digit',
+        hour12: false,
+      };
+
+      const formattedDate = new Intl.DateTimeFormat('zh-CN', options).format(new Date(date));
+      const [datePart, timePart] = formattedDate.replace(',', '').split(' ');
+      return `${datePart} ${timePart}`;
+    },
+
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList(this.rowDetailFrom);
+    },
+
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.queryParams.scheduleStartTime = null;
+      this.queryParams.scheduleEndTime = null;
+      this.scheduleTime = null;
+      this.handleQuery();
+    },
+
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有个微SOP执行详情数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportWxSopLogsCVO(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {
+        this.exportLoading = false;
+      });
+    }
+  }
+};
+</script>
+
+<style scoped>
+</style>