Ver Fonte

Merge branch 'master' into bjcz_his_scrm

# Conflicts:
#	src/api/user/fsUser.js
#	src/views/company/companyMoneyLogs/index.vue
#	src/views/course/courseWatchLog/index.vue
#	src/views/course/courseWatchLog/watchLog.vue
#	src/views/member/mylist.vue
#	src/views/qw/sopTemp/index.vue
xw há 6 dias atrás
pai
commit
4097a9430b
100 ficheiros alterados com 8681 adições e 563 exclusões
  1. 22 0
      .env.prod-fzbt
  2. 3 0
      .env.prod-gzzdy
  3. 3 0
      .env.prod-heyantang
  4. 6 6
      .env.prod-hnyth
  5. 26 0
      .env.prod-shdn
  6. 1 1
      .env.prod-sxjz
  7. 26 0
      .env.prod-xcsw
  8. 6 0
      .env.prod-ylrz
  9. 26 0
      .env.prod-zlwh
  10. 2 2
      Dockerfile
  11. 5 2
      package.json
  12. 53 0
      src/api/company/addwx.js
  13. 43 0
      src/api/company/aiWorkflow.js
  14. 53 0
      src/api/company/callphone.js
  15. 56 0
      src/api/company/companyAccount.js
  16. 8 0
      src/api/company/companyUser.js
  17. 24 0
      src/api/company/companyVoiceRobotic.js
  18. 110 0
      src/api/company/companyWorkflow.js
  19. 62 0
      src/api/company/sendmsg.js
  20. 7 0
      src/api/fastGpt/fastGptRole.js
  21. 76 0
      src/api/hisStore/store.js
  22. 25 0
      src/api/hisStore/storeOrder.js
  23. 62 0
      src/api/hisStore/storeOrderItem.js
  24. 8 0
      src/api/live/liveData.js
  25. 9 0
      src/api/live/liveMsg.js
  26. 8 0
      src/api/qw/sopTemp.js
  27. 10 0
      src/api/qw/user.js
  28. 18 0
      src/api/user/fsUser.js
  29. BIN
      src/assets/logo/xcsw.png
  30. BIN
      src/assets/logo/yth.png
  31. BIN
      src/assets/logo/zlwh.png
  32. 2 3
      src/components/HeaderSearch/index.vue
  33. 38 0
      src/router/index.js
  34. 2 2
      src/views/adv/conversionLog/index.vue
  35. 24 1
      src/views/adv/promotionAccount/index.vue
  36. 98 19
      src/views/adv/site/index.vue
  37. 409 0
      src/views/company/aiWorkflow/index.vue
  38. 7 0
      src/views/company/companyClient/index.vue
  39. 1 1
      src/views/company/companyConfig/index.vue
  40. 29 12
      src/views/company/companyMoneyLogs/index.vue
  41. 9 9
      src/views/company/companyProfit/index.vue
  42. 1 1
      src/views/company/companyRecharge/doRecharge.vue
  43. 4 1
      src/views/company/companyRecharge/index.vue
  44. 9 1
      src/views/company/companyUser/index.vue
  45. 1822 0
      src/views/company/companyUser/myCompanyUserIndex.vue
  46. 5 5
      src/views/company/companyVoicePackageOrder/buy.vue
  47. 814 0
      src/views/company/companyVoiceRobotic/index-old.vue
  48. 147 51
      src/views/company/companyVoiceRobotic/index.vue
  49. 181 0
      src/views/company/companyWorkflow/design.scss
  50. 732 0
      src/views/company/companyWorkflow/design.vue
  51. 499 0
      src/views/company/companyWorkflow/index.vue
  52. 11 4
      src/views/company/components/selectQwUser.vue
  53. 42 4
      src/views/course/courseAnswerlogs/index.vue
  54. 44 5
      src/views/course/courseAnswerlogs/myCourseAnswerlogs.vue
  55. 11 0
      src/views/course/courseFinishTempParent/deptIndex.vue
  56. 11 0
      src/views/course/courseFinishTempParent/myIndex.vue
  57. 71 1
      src/views/course/courseUserStatistics/qw/index.vue
  58. 100 19
      src/views/course/courseWatchLog/deptWatchLog.vue
  59. 140 38
      src/views/course/courseWatchLog/index.vue
  60. 2 2
      src/views/course/courseWatchLog/qw/statistics.vue
  61. 187 36
      src/views/course/courseWatchLog/watchLog.vue
  62. 9 0
      src/views/course/userCourse/index.vue
  63. 1 1
      src/views/course/userCoursePeriod/index.vue
  64. 76 0
      src/views/crm/components/aiAddWxLog.vue
  65. 113 0
      src/views/crm/components/aiCallVoiceLog.vue
  66. 80 0
      src/views/crm/components/aiSendMsgLog.vue
  67. 55 4
      src/views/crm/components/customerDetails.vue
  68. 15 15
      src/views/crm/components/duplicateCustomer.vue
  69. 19 19
      src/views/crm/components/lineCustomerDetails.vue
  70. 401 3
      src/views/fastGpt/fastGptRole/fastGptRoleUpdate.vue
  71. 163 35
      src/views/gw/gwAccount/index.vue
  72. 940 59
      src/views/hisStore/components/productOrder.vue
  73. 10 0
      src/views/hisStore/storeAfterSales/list.vue
  74. 60 3
      src/views/hisStore/storeOrder/list.vue
  75. 59 5
      src/views/index.vue
  76. 71 4
      src/views/live/live/index.vue
  77. 26 5
      src/views/live/liveAfteraSales/index.vue
  78. 3 0
      src/views/live/liveConfig/liveRedConf.vue
  79. 48 60
      src/views/live/order/index.vue
  80. 9 9
      src/views/live/order/liveDetail.vue
  81. 8 3
      src/views/live/order/storeDetail.vue
  82. 8 3
      src/views/live/order/userDetail.vue
  83. 26 26
      src/views/member/list.vue
  84. 18 23
      src/views/member/mylist.vue
  85. 13 5
      src/views/qw/externalContact/index.vue
  86. 10 0
      src/views/qw/externalContact/myExternalContact.vue
  87. 18 10
      src/views/qw/friendWelcome/deptFriendWelcome.vue
  88. 14 5
      src/views/qw/friendWelcome/indexNew.vue
  89. 4 4
      src/views/qw/friendWelcome/myIndexNew.vue
  90. 15 7
      src/views/qw/friendWelcome/myWelcome.vue
  91. 10 0
      src/views/qw/groupChatTransfer/index.vue
  92. 3 1
      src/views/qw/groupChatTransferLog/index.vue
  93. 10 0
      src/views/qw/groupChatTransferOnJob/index.vue
  94. 2 2
      src/views/qw/qwChat/qq.vue
  95. 1 0
      src/views/qw/sop/sop.vue
  96. 62 24
      src/views/qw/sop/updateSop.vue
  97. 1 1
      src/views/qw/sopLogs/sopLogsList.vue
  98. 10 0
      src/views/qw/sopTemp/deptIndex.vue
  99. 70 1
      src/views/qw/sopTemp/index.vue
  100. 10 0
      src/views/qw/sopTemp/myIndex.vue

+ 22 - 0
.env.prod-fzbt

@@ -0,0 +1,22 @@
+# 页面标题
+VUE_APP_TITLE =福州白兔SCRM销售端
+# 公司名称
+VUE_APP_COMPANY_NAME =福州高新区白兔健康咨询有限公司
+# ICP备案号
+VUE_APP_ICP_RECORD =闽ICP备2024081011号-3
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/myhk.png
+
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 2
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-gzzdy

@@ -23,3 +23,6 @@ VUE_APP_PROJECT_FROM=gzzdy
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
+
+# 郑多燕
+VUE_APP_FS_USER_INFO = 'gzzdy'

+ 3 - 0
.env.prod-heyantang

@@ -20,3 +20,6 @@ VUE_APP_COURSE_DEFAULT = 1
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
+
+# 直播webSocket地址
+VUE_APP_LIVE_WS_URL = wss://liveapp.yytcdta.com/ws

+ 6 - 6
.env.prod-knt2 → .env.prod-hnyth

@@ -1,13 +1,13 @@
 # 页面标题
-VUE_APP_TITLE = 康年堂SCRM销售端
+VUE_APP_TITLE = 养天和SCRM销售端
 # 公司名称
-VUE_APP_COMPANY_NAME = 陕西康年堂医药连锁有限公司
+VUE_APP_COMPANY_NAME = 湖南养天和中医馆有限公司
 # ICP备案号
-VUE_APP_ICP_RECORD = 陕ICP备2023011686号-5
+VUE_APP_ICP_RECORD = 湘ICP备18014714号-16
 # ICP网站访问地址
 VUE_APP_ICP_URL =https://beian.miit.gov.cn
 # 网站LOG
-VUE_APP_LOG_URL =@/assets/logo/knt.jpg
+VUE_APP_LOG_URL =@/assets/logo/yth.png
 
 # 生产环境配置
 ENV = 'production'
@@ -20,7 +20,7 @@ VUE_CLI_BABEL_TRANSPILE_MODULES = true
 
 
 #项目所属
-VUE_APP_PROJECT_FROM=knt
+VUE_APP_PROJECT_FROM=hnyth
 
 #默认 1、会员 2、企微
-VUE_APP_COURSE_DEFAULT = 1
+VUE_APP_COURSE_DEFAULT = 2

+ 26 - 0
.env.prod-shdn

@@ -0,0 +1,26 @@
+# 页面标题
+VUE_APP_TITLE =淄博德宁健康科技有限责任公司SCRM销售端
+# 公司名称
+VUE_APP_COMPANY_NAME =淄博德宁健康科技有限责任公司
+# ICP备案号
+VUE_APP_ICP_RECORD =鲁ICP备2024100689号-2
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/jnlzjk.png
+
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 2
+
+#项目所属
+VUE_APP_PROJECT_FROM=shdn
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 1 - 1
.env.prod-sxjz

@@ -16,7 +16,7 @@ ENV = 'production'
 VUE_APP_BASE_API = '/prod-api'
 
 #默认 1、会员 2、企微
-VUE_APP_COURSE_DEFAULT = 1
+VUE_APP_COURSE_DEFAULT = 2
 
 #项目所属
 VUE_APP_PROJECT_FROM=sxjz

+ 26 - 0
.env.prod-xcsw

@@ -0,0 +1,26 @@
+# 页面标题
+VUE_APP_TITLE =星辰生物SCRM销售端
+# 公司名称
+VUE_APP_COMPANY_NAME =福州市星海星辰生物科技有限公司
+# ICP备案号
+VUE_APP_ICP_RECORD =闽ICP备2025092516号-13
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/xcsw.png
+
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 2
+
+#项目所属
+VUE_APP_PROJECT_FROM=xcsw
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 6 - 0
.env.prod-ylrz

@@ -21,3 +21,9 @@ VUE_APP_PROJECT_FROM=ylrz
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
+# 直播webSocket地址
+VUE_APP_LIVE_WS_URL = wss://websocket.scrm.ylrzcloud.com/ws
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 1
+

+ 26 - 0
.env.prod-zlwh

@@ -0,0 +1,26 @@
+# 页面标题
+VUE_APP_TITLE =SCRM销售端
+# 公司名称
+VUE_APP_COMPANY_NAME =泽林文化
+# ICP备案号
+VUE_APP_ICP_RECORD =京ICP备2024100370号-1
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/zlwh.png
+
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 1
+
+#项目所属
+VUE_APP_PROJECT_FROM=bjczwh
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 2 - 2
Dockerfile

@@ -1,7 +1,7 @@
 
 
 #基于官方 NGINX 镜像部署(精简镜像)
-FROM nginx:alpine
+FROM swr.cn-east-2.myhuaweicloud.com/library/nginx:alpine
 
 # 复制本地打包好的 dist 目录到 NGINX 静态资源目录
 COPY ./dist /usr/share/nginx/html
@@ -13,4 +13,4 @@ COPY ./nginx.conf /etc/nginx/nginx.conf
 #EXPOSE 80
 
 # 启动 NGINX(前台运行,避免容器启动后退出)
-CMD ["nginx", "-g", "daemon off;"]
+CMD ["nginx", "-g", "daemon off;"]

+ 5 - 2
package.json

@@ -19,7 +19,7 @@
     "build:prod-sxjz": "vue-cli-service build --mode prod-sxjz",
     "build:prod-jnmy": "vue-cli-service build --mode prod-jnmy",
     "build:prod-knt": "vue-cli-service build --mode prod-knt",
-    "build:prod-knt2": "vue-cli-service build --mode prod-knt2",
+    "build:prod-hnyth": "vue-cli-service build --mode prod-hnyth",
     "build:prod-hdt": "vue-cli-service build --mode prod-hdt",
     "build:prod-yzt": "vue-cli-service build --mode prod-yzt",
     "build:prod-xfk": "vue-cli-service build --mode prod-xfk",
@@ -55,6 +55,9 @@
     "build:prod-yxj": "vue-cli-service build --mode prod-yxj",
     "build:prod-bjzm": "vue-cli-service build --mode prod-bjzm",
     "build:prod-gzzdy": "vue-cli-service build --mode prod-gzzdy",
+    "build:prod-shdn": "vue-cli-service build --mode prod-shdn",
+    "build:prod-xcsw": "vue-cli-service build --mode prod-xcsw",
+    "build:prod-zlwh": "vue-cli-service build --mode prod-zlwh",
     "preview": "node build/index.js --preview",
     "lint": "eslint --ext .js,.vue src",
     "test:unit": "jest --clearCache && vue-cli-service test:unit",
@@ -154,9 +157,9 @@
     "husky": "1.3.1",
     "lint-staged": "8.1.5",
     "mockjs": "1.0.1-beta3",
-    "node-sass": "4.14.1",
     "plop": "2.3.0",
     "runjs": "4.3.2",
+    "sass": "^1.97.1",
     "sass-loader": "8.0.2",
     "script-ext-html-webpack-plugin": "2.1.3",
     "script-loader": "0.7.2",

+ 53 - 0
src/api/company/addwx.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询调用日志_加微信列表
+export function listAddwx(query) {
+  return request({
+    url: '/company/addwxLog/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// // 查询调用日志_加微信详细
+// export function getAddwx(logId) {
+//   return request({
+//     url: '/company/addwx/' + logId,
+//     method: 'get'
+//   })
+// }
+
+// // 新增调用日志_加微信
+// export function addAddwx(data) {
+//   return request({
+//     url: '/company/addwx',
+//     method: 'post',
+//     data: data
+//   })
+// }
+
+// // 修改调用日志_加微信
+// export function updateAddwx(data) {
+//   return request({
+//     url: '/company/addwx',
+//     method: 'put',
+//     data: data
+//   })
+// }
+
+// // 删除调用日志_加微信
+// export function delAddwx(logId) {
+//   return request({
+//     url: '/company/addwx/' + logId,
+//     method: 'delete'
+//   })
+// }
+
+// // 导出调用日志_加微信
+// export function exportAddwx(query) {
+//   return request({
+//     url: '/company/addwx/export',
+//     method: 'get',
+//     params: query
+//   })
+// }

+ 43 - 0
src/api/company/aiWorkflow.js

@@ -0,0 +1,43 @@
+import request from '@/utils/request'
+
+/**
+ * 获取我的节点语音列表(分页)
+ * @param {Object} query - 查询参数
+ * @param {number} query.pageNum - 页码
+ * @param {number} query.pageSize - 每页数量
+ * @param {string} query.workflowName - 工作流名称(可选)
+ * @param {string} query.nodeName - 节点名称(可选)
+ * @param {string} query.nodeType - 节点类型(可选)
+ */
+export function getMyNodes(query) {
+  return request({
+    url: '/company/aiWorkflow/myNodes',
+    method: 'get',
+    params: query
+  })
+}
+
+/**
+ * 上传节点语音
+ * @param {Object} data - 上传数据
+ * @param {number} data.nodeId - 节点ID
+ * @param {string} data.voiceUrl - 语音URL
+ */
+export function uploadNodeVoice(data) {
+  return request({
+    url: '/company/aiWorkflow/uploadVoice',
+    method: 'post',
+    data: data
+  })
+}
+
+/**
+ * 删除节点语音
+ * @param {number} nodeId - 节点ID
+ */
+export function deleteNodeVoice(nodeId) {
+  return request({
+    url: '/company/aiWorkflow/deleteVoice/' + nodeId,
+    method: 'delete'
+  })
+}

+ 53 - 0
src/api/company/callphone.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询调用日志_ai打电话列表
+export function listCallphone(query) {
+  return request({
+    url: '/company/callphoneLog/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// // 查询调用日志_ai打电话详细
+// export function getCallphone(logId) {
+//   return request({
+//     url: '/company/callphone/' + logId,
+//     method: 'get'
+//   })
+// }
+
+// // 新增调用日志_ai打电话
+// export function addCallphone(data) {
+//   return request({
+//     url: '/company/callphone',
+//     method: 'post',
+//     data: data
+//   })
+// }
+
+// // 修改调用日志_ai打电话
+// export function updateCallphone(data) {
+//   return request({
+//     url: '/company/callphone',
+//     method: 'put',
+//     data: data
+//   })
+// }
+
+// // 删除调用日志_ai打电话
+// export function delCallphone(logId) {
+//   return request({
+//     url: '/company/callphone/' + logId,
+//     method: 'delete'
+//   })
+// }
+
+// // 导出调用日志_ai打电话
+// export function exportCallphone(query) {
+//   return request({
+//     url: '/company/callphone/export',
+//     method: 'get',
+//     params: query
+//   })
+// }

+ 56 - 0
src/api/company/companyAccount.js

@@ -68,3 +68,59 @@ export function exportCompanyAccount(query) {
     params: query
   })
 }
+// 导出个微账号
+export function getWxQrCode(query) {
+  return request({
+    url: '/company/companyWx/getWxQrCode',
+    method: 'get',
+    params: query
+  })
+}
+
+// 导出个微账号
+export function getLoginStatus(query) {
+  return request({
+    url: '/company/companyWx/getLoginStatus',
+    method: 'get',
+    params: query
+  })
+}
+// 导出个微账号
+export function bindService(query) {
+  return request({
+    url: '/company/companyWx/bindService',
+    method: 'get',
+    params: query
+  })
+}
+// 导出个微账号
+export function wakeUpLogin(query) {
+  return request({
+    url: '/company/companyWx/wakeUpLogin',
+    method: 'get',
+    params: query
+  })
+}
+// 导出个微账号
+export function updateWxInfo(query) {
+  return request({
+    url: '/company/companyWx/updateWxInfo',
+    method: 'get',
+    params: query
+  })
+}
+// 导出个微账号
+export function wxLoginOut(query) {
+  return request({
+    url: '/company/companyWx/wxLoginOut',
+    method: 'get',
+    params: query
+  })
+}
+export function syncWx(query) {
+  return request({
+    url: '/company/companyWx/syncWx',
+    method: 'get',
+    params: query
+  })
+}

+ 8 - 0
src/api/company/companyUser.js

@@ -17,6 +17,14 @@ export function qwList(query) {
     params: query
   })
 }
+// 查询企微用户列表
+export function myQwList(query) {
+  return request({
+    url: '/company/user/myQwList',
+    method: 'get',
+    params: query
+  })
+}
 export function getList(query) {
   return request({
     url: '/company/user/getList',

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

@@ -116,3 +116,27 @@ export function wxList(params) {
     params
   })
 }
+
+
+export function taskRun(params) {
+  return request({
+    url: 'company/companyVoiceRobotic/taskRun',
+    method: 'get',
+    params
+  })
+}
+
+export function getSmsTempList() {
+  return request({
+    url: '/company/companySmsTemp/getSmsTempList',
+    method: 'get'
+  })
+}
+
+export function getCIDGroupList(params) {
+  return request({
+    url: 'company/companyVoiceRobotic/getCIDGroupList',
+    method: 'get',
+    params
+  })
+}

+ 110 - 0
src/api/company/companyWorkflow.js

@@ -0,0 +1,110 @@
+import request from '@/utils/request'
+
+// 查询AI工作流列表
+export function listWorkflow(query) {
+  return request({
+    url: '/company/companyWorkflow/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询AI工作流详细
+export function getWorkflow(workflowId) {
+  return request({
+    url: '/company/companyWorkflow/' + workflowId,
+    method: 'get'
+  })
+}
+
+// 新增AI工作流
+export function addWorkflow(data) {
+  return request({
+    url: '/company/companyWorkflow/save',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改AI工作流
+export function updateWorkflow(data) {
+  return request({
+    url: '/company/companyWorkflow/save',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改AI工作流状态
+export function updateWorkflowStatus(workflowId, status) {
+  return request({
+    url: '/company/companyWorkflow/status/' + workflowId + '/' + status,
+    method: 'put'
+  })
+}
+
+// 删除AI工作流
+export function delWorkflow(workflowId) {
+  return request({
+    url: '/company/companyWorkflow/' + workflowId,
+    method: 'delete'
+  })
+}
+
+// 复制AI工作流
+export function copyWorkflow(workflowId) {
+  return request({
+    url: '/company/companyWorkflow/copy/' + workflowId,
+    method: 'post'
+  })
+}
+
+// 获取节点类型列表
+export function getNodeTypes() {
+  return request({
+    url: '/company/companyWorkflow/nodeTypes',
+    method: 'get'
+  })
+}
+
+// 导出AI工作流
+export function exportWorkflow(query) {
+  return request({
+    url: '/company/companyWorkflow/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 根据workflowId获取绑定的销售列表
+export function getBindCompanyUserByWorkflowId(workflowId) {
+  return request({
+    url: '/company/companyWorkflow/getBindCompanyUserByWorkflowId/' + workflowId,
+    method: 'get'
+  })
+}
+
+// 获取销售列表
+export function listCompanyUser() {
+  return request({
+    url: '/company/companyWorkflow/listCompanyUser',
+    method: 'get'
+  })
+}
+
+// 检查销售是否已被绑定
+export function checkCompanyUserBeUsed(companyUserId) {
+  return request({
+    url: '/company/companyWorkflow/checkCompanyUserBeUsed/' + companyUserId,
+    method: 'get'
+  })
+}
+
+// 更新工作流绑定销售
+export function updateWorkflowBindCompanyUser(data) {
+  return request({
+    url: '/company/companyWorkflow/updateWorkflowBindCompanyUser',
+    method: 'post',
+    data: data
+  })
+}

+ 62 - 0
src/api/company/sendmsg.js

@@ -0,0 +1,62 @@
+import request from '@/utils/request'
+
+// 查询调用日志_发送短信列表
+export function listSendmsg(query) {
+  return request({
+    url: '/company/sendmsgLog/list',
+    method: 'get',
+    params: query
+  })
+}
+
+
+export function listByCallerIdAndRoboticId(query) {
+  return request({
+    url: '/company/sendmsgLog/listByCallerIdAndRoboticId',
+    method: 'get',
+    params: query
+  })
+}
+
+// // 查询调用日志_发送短信详细
+// export function getSendmsg(logId) {
+//   return request({
+//     url: '/company/sendmsg/' + logId,
+//     method: 'get'
+//   })
+// }
+
+// // 新增调用日志_发送短信
+// export function addSendmsg(data) {
+//   return request({
+//     url: '/company/sendmsg',
+//     method: 'post',
+//     data: data
+//   })
+// }
+
+// // 修改调用日志_发送短信
+// export function updateSendmsg(data) {
+//   return request({
+//     url: '/company/sendmsg',
+//     method: 'put',
+//     data: data
+//   })
+// }
+
+// // 删除调用日志_发送短信
+// export function delSendmsg(logId) {
+//   return request({
+//     url: '/company/sendmsg/' + logId,
+//     method: 'delete'
+//   })
+// }
+
+// // 导出调用日志_发送短信
+// export function exportSendmsg(query) {
+//   return request({
+//     url: '/company/sendmsg/export',
+//     method: 'get',
+//     params: query
+//   })
+// }

+ 7 - 0
src/api/fastGpt/fastGptRole.js

@@ -23,6 +23,13 @@ export function getAllRoleType() {
   })
 }
 
+export function getAllCourseList() {
+  return request({
+    url: '/fastGpt/fastGptRole/getAllCourseList',
+    method: 'get'
+  })
+}
+
 
 // 查询应用详细getAllRoleType
 export function getFastGptRole(roleId) {

+ 76 - 0
src/api/hisStore/store.js

@@ -0,0 +1,76 @@
+import request from '@/utils/request'
+
+// 查询店铺管理列表
+export function listStore(query) {
+  return request({
+    url: '/store/his/store/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询店铺管理详细
+export function getStore(storeId) {
+  return request({
+    url: '/store/his/store/' + storeId,
+    method: 'get'
+  })
+}
+
+
+// 新增店铺管理
+export function addStore(data) {
+  return request({
+    url: '/store/his/store',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改店铺管理
+export function updateStore(data) {
+  return request({
+    url: '/store/his/store',
+    method: 'put',
+    data: data
+  })
+}
+// 修改店铺管理
+export function audit(data) {
+  return request({
+    url: '/store/his/store/audit',
+    method: 'put',
+    data: data
+  })
+}
+// 删除店铺管理
+export function delStore(storeId) {
+  return request({
+    url: '/store/his/store/' + storeId,
+    method: 'delete'
+  })
+}
+
+export function refreshPasWod(storeId) {
+  return request({
+    url: '/store/his/store/refresh/'+ storeId,
+    method: 'put'
+  })
+}
+
+// 导出店铺管理
+export function exportStore(query) {
+  return request({
+    url: '/store/his/store/export',
+    method: 'get',
+    params: query
+  })
+}
+
+//getStoreAuditLog
+export function getStoreAuditLog(storeId) {
+  return request({
+    url: '/store/his/store/auditLog/'+ storeId,
+    method: 'get'
+  })
+}

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

@@ -153,3 +153,28 @@ export function getCreateOrderType() {
   })
 }
 
+// 订单确认审核
+export function auditStoreOrder(data) {
+  return request({
+    url: '/store/store/storeOrder/batchAudit',
+    method: 'post',
+    data: data
+  })
+}
+// 修改订单ItemJson
+export function updateStoreOrderItemJson(id,backendEditProductType) {
+  return request({
+    url: '/store/store/storeOrder/updateStoreOrderItemJson/'+id + "/" + backendEditProductType,
+    method: 'get'
+  })
+}
+
+// 修改订单代收金额
+export function editPayDelivery(data) {
+  return request({
+    url: '/store/store/storeOrder/editPayDelivery',
+    method: 'put',
+    data: data
+  })
+}
+

+ 62 - 0
src/api/hisStore/storeOrderItem.js

@@ -0,0 +1,62 @@
+import request from '@/utils/request'
+
+// 查询订单详情列表
+export function listStoreOrderItem(query) {
+  return request({
+    url: '/store/store/storeOrderItem/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询订单详情详细
+export function getStoreOrderItem(itemId) {
+  return request({
+    url: '/store/store/storeOrderItem/' + itemId,
+    method: 'get'
+  })
+}
+
+// 新增订单详情
+export function addStoreOrderItem(data) {
+  return request({
+    url: '/store/store/storeOrderItem',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改订单详情
+export function updateStoreOrderItem(data) {
+  return request({
+    url: '/store/store/storeOrderItem',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除订单详情
+export function delStoreOrderItem(itemId) {
+  return request({
+    url: '/store/store/storeOrderItem/' + itemId,
+    method: 'delete'
+  })
+}
+
+// 导出订单详情
+export function exportStoreOrderItem(query) {
+  return request({
+    url: '/store/store/storeOrderItem/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 修改订单数量
+export function updateNumStoreOrderItem(data) {
+  return request({
+    url: '/store/store/storeOrderItem/updateNum',
+    method: 'put',
+    data: data
+  })
+}

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

@@ -96,3 +96,11 @@ export function exportLiveUserDetail(liveId) {
   })
 }
 
+export function exportLiveData(query) {
+  return request({
+    url: '/liveData/liveData/export',
+    method: 'get',
+    params: query
+  })
+}
+

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

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

+ 8 - 0
src/api/qw/sopTemp.js

@@ -166,3 +166,11 @@ export function getSelectableRange() {
     method: 'get'
   })
 }
+
+export function batchOpenOrCloseOfficial(data) {
+  return request({
+    url: '/qw/sopTemp/batchOpenOrCloseOfficial',
+    method: 'post',
+    data: data
+  })
+}

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

@@ -417,3 +417,13 @@ export function companyQwUserlist(params) {
     params: params
   })
 }
+
+/**
+ * 修改ai客服上下线
+ */
+export function updateFastGptRoleStatusById(id) {
+  return request({
+    url: '/qw/user/updateFastGptRoleStatusById/' + id,
+    method: 'get'
+  })
+}

+ 18 - 0
src/api/user/fsUser.js

@@ -27,6 +27,14 @@ export function getUser(userId) {
   })
 }
 
+// 项目会员信息
+export function getMemberUser(id) {
+  return request({
+    url: '/user/fsUser/member/' + id,
+    method: 'get'
+  })
+}
+
 // 新增用户
 export function addUser(data) {
   return request({
@@ -44,6 +52,16 @@ export function updateUser(data) {
     data: data
   })
 }
+
+// 修改用户
+export function updateMemberUser(data) {
+  return request({
+    url: '/user/fsUser/member',
+    method: 'put',
+    data: data
+  })
+}
+
 // 会员解绑
 export function delCompanyUser(ids) {
   return request({

BIN
src/assets/logo/xcsw.png


BIN
src/assets/logo/yth.png


BIN
src/assets/logo/zlwh.png


+ 2 - 3
src/components/HeaderSearch/index.vue

@@ -166,8 +166,7 @@ export default {
     border-radius: 0;
     display: inline-block;
     vertical-align: middle;
-
-    /deep/ .el-input__inner {
+    .el-input__inner {
       border-radius: 0;
       border: 0;
       padding-left: 0;
@@ -176,7 +175,7 @@ export default {
       border-bottom: 1px solid #d9d9d9;
       vertical-align: middle;
     }
-  }
+}
 
   &.show {
     .header-search-select {

+ 38 - 0
src/router/index.js

@@ -277,6 +277,44 @@ export const constantRoutes = [
       isIndependentPage: true // 标记为“独立页”
     }
   },
+  {
+  path: '/company/aiWorkflow',
+  component: Layout,
+  hidden: true,
+  children: [
+    {
+      path: 'index',
+      component: () => import('@/views/company/aiWorkflow/index'),
+      name: 'AiWorkflow',
+      meta: { title: 'AI工作流', activeMenu: '/company/aiWorkflow' }
+    }
+  ]
+},,
+  {
+  path: '/company/companyWorkflow',
+  component: () => import('@/layout/index'),
+  hidden: true,
+  children: [
+    {
+      path: '',
+      component: () => import('@/views/company/companyWorkflow/index'),
+      name: 'AiWorkflow',
+      meta: { title: 'AI外呼工作流', icon: 'workflow' }
+    },
+    {
+      path: 'design',
+      component: () => import('@/views/company/companyWorkflow/design'),
+      name: 'AiWorkflowDesign',
+      meta: { title: 'AI外呼工作流设计', activeMenu: '/company/companyWorkflow' }
+    },
+    {
+      path: 'design/:id',
+      component: () => import('@/views/company/companyWorkflow/design'),
+      name: 'AiWorkflowEdit',
+      meta: { title: '编辑AI外呼工作流', activeMenu: '/company/companyWorkflow' }
+    }
+  ]
+  },
 
 ]
 

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

@@ -61,14 +61,14 @@
       <el-table-column label="系统回传事件" align="center" prop="sysConversionEvent" min-width="150" show-overflow-tooltip />
       <el-table-column label="广告商回传类型" align="center" prop="advConversionEvent" min-width="150" show-overflow-tooltip />
       <el-table-column label="站点ID" align="center" prop="siteId" width="100" />
-      <el-table-column label="着陆页" align="center" prop="landingUrl" min-width="200" show-overflow-tooltip>
+      <!-- <el-table-column label="着陆页" align="center" prop="landingUrl" min-width="200" show-overflow-tooltip>
         <template slot-scope="scope">
           <el-link v-if="scope.row.landingUrl" :href="scope.row.landingUrl" target="_blank" type="primary">
             {{ scope.row.landingUrl }}
           </el-link>
           <span v-else>-</span>
         </template>
-      </el-table-column>
+      </el-table-column> -->
       <el-table-column label="回传时间" align="center" prop="updateTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.updateTime) }}</span>

+ 24 - 1
src/views/adv/promotionAccount/index.vue

@@ -217,7 +217,7 @@
                 clearable
               />
             </el-form-item>
-            <el-form-item v-if="form.advertiserId !== 10002" label="应用授权链接" prop="authUrl" class="slide-fade">
+            <el-form-item v-if="form.advertiserId !== 10002 && form.advertiserId !== 10004" label="应用授权链接" prop="authUrl" class="slide-fade">
               <el-input 
                 v-model="form.authUrl" 
                 placeholder="请输入应用授权链接"
@@ -225,6 +225,14 @@
                 clearable
               />
             </el-form-item>
+            <el-form-item v-if="form.advertiserId == 10001" label="百度账户用户名" prop="extendedField" class="slide-fade">
+              <el-input 
+                v-model="form.extendedField" 
+                placeholder="请输入百度账户用户名"
+                prefix-icon="el-icon-connection"
+                clearable
+              />
+            </el-form-item>
           </template>
         </div>
       </el-form>
@@ -286,6 +294,15 @@ export default {
         10005: 'https://probe.bjmantis.net/msp/prmt/help/api/VIVO.pdf',
         10006: 'https://probe.bjmantis.net/msp/prmt/help/api/AIQIYI.pdf'
       },
+      // 回调地址映射
+      callbackUrlUrls: {
+        10001: 'https://advscrm.yytcdta.com/callBack/baidu/getAuthCode',
+        10002: 'https://advscrm.yytcdta.com/callBack/oceanEngine/getAuthCode',
+        10003: 'https://advscrm.yytcdta.com/callBack/tencent/getAuthCode',
+        10004: 'https://advscrm.yytcdta.com/callBack/oppo/getAuthCode',
+        10005: 'https://advscrm.yytcdta.com/callBack/vivo/getAuthCode',
+        10006: 'https://advscrm.yytcdta.com/callBack/iqiyi/getAuthCode'
+      },
       // 表单校验
       rules: {
         promotionType: [
@@ -420,6 +437,8 @@ export default {
       this.reset();
       this.isEdit = true;
       const id = row.id || this.ids[0];
+      // 修改时也需要加载广告商列表以确保 el-select 能正确回显名称而非 ID
+      this.getAdvertiserOptions();
       getPromotionAccount(id).then(response => {
         this.form = response.data;
         this.open = true;
@@ -472,6 +491,10 @@ export default {
         if (advertiser) {
           this.form.advertiserName = advertiser.advertiserName;
         }
+        // 新增时给回调地址给个默认值
+        if (!this.isEdit) {
+          this.form.callbackUrl = this.callbackUrlUrls[advertiserId] || "";
+        }
       }
     },
     /** 打开API帮助文档 */

+ 98 - 19
src/views/adv/site/index.vue

@@ -506,14 +506,17 @@
           </div>
         </el-form-item>
         <el-form-item label="二维码">
-          <div id="qrcode" class="qrcode-container"></div>
-          <el-button 
-            type="primary" 
-            size="small"
-            icon="el-icon-download"
-            @click="downloadQrcode"
-            style="margin-top: 10px;"
-          >下载</el-button>
+          <div class="qrcode-wrapper">
+            <div id="qrcode" class="qrcode-container"></div>
+            <div class="qrcode-action">
+              <el-button 
+                type="primary" 
+                size="small"
+                icon="el-icon-download"
+                @click="downloadQrcode"
+              >下载二维码</el-button>
+            </div>
+          </div>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -647,6 +650,12 @@ export default {
             }, 
             trigger: "change" 
           }
+        ],
+        allocationRule: [
+          { required: true, message: "请选择企微分配规则", trigger: "change" }
+        ],
+        allocationRuleId: [
+          { required: true, message: "请选择具体的分配汇总规则", trigger: "change" }
         ]
       }
     };
@@ -885,18 +894,43 @@ export default {
         this.msgError('投放链接为空');
         return;
       }
-      navigator.clipboard.writeText(this.launchUrl).then(() => {
-        this.msgSuccess('复制成功');
-      }).catch(() => {
-        // 平台不支持新API,改成传统方法
+      
+      // 优先使用 Clipboard API
+      if (navigator.clipboard && navigator.clipboard.writeText) {
+        navigator.clipboard.writeText(this.launchUrl).then(() => {
+          this.msgSuccess('复制成功');
+        }).catch(err => {
+          console.error('Clipboard API 复制失败:', err);
+          this.fallbackCopyText(this.launchUrl);
+        });
+      } else {
+        // 环境不支持,使用传统方法
+        this.fallbackCopyText(this.launchUrl);
+      }
+    },
+    /** 传统复制方法 (Fallback) */
+    fallbackCopyText(text) {
+      try {
         const textarea = document.createElement('textarea');
-        textarea.value = this.launchUrl;
+        textarea.value = text;
+        // 确保 textarea 不可见且不影响布局
+        textarea.style.position = 'fixed';
+        textarea.style.left = '-9999px';
+        textarea.style.top = '0';
         document.body.appendChild(textarea);
         textarea.select();
-        document.execCommand('copy');
+        const successful = document.execCommand('copy');
         document.body.removeChild(textarea);
-        this.msgSuccess('复制成功');
-      });
+        
+        if (successful) {
+          this.msgSuccess('复制成功');
+        } else {
+          this.msgError('复制失败,请手动选择复制');
+        }
+      } catch (err) {
+        console.error('传统复制方法异常:', err);
+        this.msgError('复制异常');
+      }
     },
     /** 下载二维码 */
     downloadQrcode() {
@@ -1617,20 +1651,65 @@ export default {
   display: flex;
   gap: 10px;
   align-items: center;
+  background: #f8f9fa;
+  padding: 8px;
+  border-radius: 8px;
+  border: 1px solid #eef0f2;
   
   .url-input {
     flex: 1;
+    ::v-deep .el-input__inner {
+      background: transparent;
+      border-color: transparent;
+      font-family: monospace;
+      font-size: 13px;
+      color: #764ba2;
+    }
   }
 }
 
+.qrcode-wrapper {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  padding: 10px 0;
+  width: 100%;
+}
+
 .qrcode-container {
+  background: #fff;
+  padding: 15px;
+  border-radius: 12px;
+  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
+  border: 1px solid #f0f0f0;
+  margin-bottom: 15px;
   display: flex;
   justify-content: center;
-  padding: 20px 0;
+  align-items: center;
+  transition: all 0.3s ease;
+  
+  &:hover {
+    transform: translateY(-5px);
+    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
+  }
   
   canvas {
-    border: 1px solid #e0e0e0;
-    border-radius: 4px;
+    display: block;
+    max-width: 100%;
+  }
+}
+
+.qrcode-action {
+  .el-button {
+    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
+    border: none;
+    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
+    
+    &:hover {
+      transform: translateY(-2px);
+      box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
+    }
   }
 }
 </style>

+ 409 - 0
src/views/company/aiWorkflow/index.vue

@@ -0,0 +1,409 @@
+<template>
+  <div class="app-container">
+    <!-- 搜索表单 -->
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="工作流名称" prop="workflowName">
+        <el-input
+          v-model="queryParams.workflowName"
+          placeholder="请输入工作流名称"
+          clearable
+          size="small"
+          style="width: 200px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="节点名称" prop="nodeName">
+        <el-input
+          v-model="queryParams.nodeName"
+          placeholder="请输入节点名称"
+          clearable
+          size="small"
+          style="width: 200px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="节点类型" prop="nodeType">
+        <el-select
+          v-model="queryParams.nodeType"
+          placeholder="请选择节点类型"
+          clearable
+          size="small"
+          style="width: 200px"
+        >
+          <el-option
+            v-for="item in nodeTypeOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <!-- 工具栏 -->
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-refresh"
+          size="mini"
+          @click="getList"
+        >刷新</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <!-- 数据表格 -->
+    <el-table v-loading="loading" :data="nodeList" border>
+      <el-table-column label="节点ID" align="center" prop="nodeId" width="80" />
+      <el-table-column label="工作流名称" align="center" prop="workflowName" min-width="150" :show-overflow-tooltip="true" />
+      <el-table-column label="节点标识" align="center" prop="nodeKey" width="120" :show-overflow-tooltip="true" />
+      <el-table-column label="节点名称" align="center" prop="nodeName" min-width="150" :show-overflow-tooltip="true" />
+      <el-table-column label="节点类型" align="center" prop="nodeType" width="100">
+        <template slot-scope="scope">
+          <el-tag :type="getNodeTypeTag(scope.row.nodeType)">
+            {{ getNodeTypeLabel(scope.row.nodeType) }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="语音状态" align="center" width="100">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.voiceUrl" type="success">已录制</el-tag>
+          <el-tag v-else type="info">未录制</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="语音" align="center" width="200">
+        <template slot-scope="scope">
+          <audio
+            v-if="scope.row.voiceUrl"
+            :src="scope.row.voiceUrl"
+            controls
+            style="height: 30px; width: 180px;"
+          ></audio>
+          <span v-else>-</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <!-- <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-microphone"
+            @click="handleRecord(scope.row)"
+          >{{ scope.row.voiceUrl ? '重新录制' : '录制语音' }}</el-button>
+          <el-button
+            v-if="scope.row.voiceUrl"
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDeleteVoice(scope.row)"
+          >删除语音</el-button> -->
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页 -->
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 录制语音对话框 -->
+    <el-dialog
+      :title="'录制语音 - ' + currentNode.nodeName"
+      :visible.sync="recordDialogVisible"
+      width="500px"
+      append-to-body
+      @close="handleRecordDialogClose"
+    >
+      <div class="record-container">
+        <div class="record-info">
+          <p><strong>工作流:</strong>{{ currentNode.workflowName }}</p>
+          <p><strong>节点:</strong>{{ currentNode.nodeName }}</p>
+        </div>
+
+        <div class="record-controls">
+          <!-- 录音状态显示 -->
+          <div class="record-status">
+            <span v-if="isRecording" class="recording-indicator">
+              <i class="el-icon-loading"></i> 正在录音... {{ recordingTime }}s
+            </span>
+            <span v-else-if="audioBlob">录音完成</span>
+            <span v-else>点击开始录音</span>
+          </div>
+
+          <!-- 录音按钮 -->
+          <div class="record-buttons">
+            <el-button
+              v-if="!isRecording"
+              type="primary"
+              icon="el-icon-microphone"
+              circle
+              size="large"
+              @click="startRecording"
+            ></el-button>
+            <el-button
+              v-else
+              type="danger"
+              icon="el-icon-video-pause"
+              circle
+              size="large"
+              @click="stopRecording"
+            ></el-button>
+          </div>
+
+          <!-- 录音预览 -->
+          <div v-if="audioUrl" class="record-preview">
+            <audio :src="audioUrl" controls style="width: 100%;"></audio>
+            <el-button
+              type="text"
+              icon="el-icon-refresh"
+              @click="resetRecording"
+            >重新录制</el-button>
+          </div>
+        </div>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="recordDialogVisible = false">取 消</el-button>
+        <el-button
+          type="primary"
+          :disabled="!audioBlob"
+          :loading="uploading"
+          @click="submitVoice"
+        >上 传</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+
+<script>
+import { getMyNodes, uploadNodeVoice, deleteNodeVoice } from '@/api/company/aiWorkflow'
+
+export default {
+  name: 'AiWorkflow',
+  data() {
+    return {
+      // 遮罩层
+      loading: false,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 节点列表
+      nodeList: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        workflowName: undefined,
+        nodeName: undefined,
+        nodeType: undefined
+      },
+      // 节点类型选项
+      nodeTypeOptions: [
+        { value: 'start', label: '开始' },
+        { value: 'end', label: '结束' },
+        { value: 'condition', label: '条件' },
+        { value: 'action', label: '动作' },
+        { value: 'ai', label: 'AI' },
+        { value: 'delay', label: '延迟' },
+        { value: 'http', label: 'HTTP' }
+      ],
+      // 录制对话框
+      recordDialogVisible: false,
+      currentNode: {},
+      // 录音相关
+      isRecording: false,
+      mediaRecorder: null,
+      audioChunks: [],
+      audioBlob: null,
+      audioUrl: null,
+      recordingTime: 0,
+      recordingTimer: null,
+      uploading: false
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    /** 查询节点列表 */
+    getList() {
+      this.loading = true
+      getMyNodes(this.queryParams).then(response => {
+        
+        this.nodeList = response.data || []
+        this.total = response.total || 0
+        this.loading = false
+      }).catch(() => {
+        this.loading = false
+      })
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1
+      this.getList()
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm('queryForm')
+      this.handleQuery()
+    },
+    /** 获取节点类型标签颜色 */
+    getNodeTypeTag(type) {
+      const tagMap = {
+        start: 'success',
+        end: 'info',
+        condition: 'warning',
+        action: 'primary',
+        ai: '',
+        delay: 'info',
+        http: 'primary'
+      }
+      return tagMap[type] || ''
+    },
+    /** 获取节点类型标签文字 */
+    getNodeTypeLabel(type) {
+      const item = this.nodeTypeOptions.find(opt => opt.value === type)
+      return item ? item.label : type
+    },
+    /** 录制语音 */
+    handleRecord(row) {
+      this.currentNode = { ...row }
+      this.resetRecording()
+      this.recordDialogVisible = true
+    },
+    /** 开始录音 */
+    async startRecording() {
+      try {
+        const stream = await navigator.mediaDevices.getUserMedia({ audio: true })
+        this.mediaRecorder = new MediaRecorder(stream)
+        this.audioChunks = []
+
+        this.mediaRecorder.ondataavailable = (event) => {
+          this.audioChunks.push(event.data)
+        }
+
+        this.mediaRecorder.onstop = () => {
+          this.audioBlob = new Blob(this.audioChunks, { type: 'audio/wav' })
+          this.audioUrl = URL.createObjectURL(this.audioBlob)
+          stream.getTracks().forEach(track => track.stop())
+        }
+
+        this.mediaRecorder.start()
+        this.isRecording = true
+        this.recordingTime = 0
+        this.recordingTimer = setInterval(() => {
+          this.recordingTime++
+        }, 1000)
+      } catch (error) {
+        this.$message.error('无法访问麦克风,请检查权限设置')
+        console.error('录音错误:', error)
+      }
+    },
+    /** 停止录音 */
+    stopRecording() {
+      if (this.mediaRecorder && this.isRecording) {
+        this.mediaRecorder.stop()
+        this.isRecording = false
+        clearInterval(this.recordingTimer)
+      }
+    },
+    /** 重置录音 */
+    resetRecording() {
+      this.stopRecording()
+      this.audioBlob = null
+      this.audioUrl = null
+      this.recordingTime = 0
+    },
+    /** 录制对话框关闭 */
+    handleRecordDialogClose() {
+      this.resetRecording()
+    },
+    /** 上传语音 */
+    async submitVoice() {
+      if (!this.audioBlob) {
+        this.$message.warning('请先录制语音')
+        return
+      }
+
+      this.uploading = true
+      try {
+        // 创建FormData上传文件
+        const formData = new FormData()
+        formData.append('file', this.audioBlob, `voice_${this.currentNode.nodeId}.wav`)
+        formData.append('nodeId', this.currentNode.nodeId)
+
+        await uploadNodeVoice(formData)
+        this.$message.success('语音上传成功')
+        this.recordDialogVisible = false
+        this.getList()
+      } catch (error) {
+        this.$message.error('语音上传失败')
+      } finally {
+        this.uploading = false
+      }
+    },
+    /** 删除语音 */
+    handleDeleteVoice(row) {
+      this.$confirm('确认删除该节点的语音吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        return deleteNodeVoice(row.nodeId)
+      }).then(() => {
+        this.$message.success('删除成功')
+        this.getList()
+      }).catch(() => {})
+    }
+  }
+}
+</script>
+
+<style scoped>
+.record-container {
+  padding: 20px;
+}
+.record-info {
+  margin-bottom: 20px;
+  padding: 10px;
+  background: #f5f7fa;
+  border-radius: 4px;
+}
+.record-info p {
+  margin: 5px 0;
+}
+.record-controls {
+  text-align: center;
+}
+.record-status {
+  margin-bottom: 20px;
+  font-size: 14px;
+  color: #606266;
+}
+.recording-indicator {
+  color: #f56c6c;
+}
+.record-buttons {
+  margin-bottom: 20px;
+}
+.record-buttons .el-button {
+  width: 60px;
+  height: 60px;
+  font-size: 24px;
+}
+.record-preview {
+  margin-top: 20px;
+}
+</style>

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

@@ -47,6 +47,7 @@
       <el-form-item label="是否添加" prop="isAdd">
         <el-select v-model="queryParams.isAdd" clearable>
           <el-option label="否" :value="0"/>
+          <el-option label="待通过" :value="2"/>
           <el-option label="是" :value="1"/>
         </el-select>
       </el-form-item>
@@ -107,9 +108,15 @@
       <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">
+        <template slot-scope="scope">
+          <el-tag v-for="item in levelList" v-if="scope.row.intention == item.dictValue">{{item.dictLabel}}</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="是否添加" align="center" prop="isAdd">
         <template slot-scope="scope">
           <el-tag type="danger" v-if="scope.row.isAdd == 0">否</el-tag>
+          <el-tag type="warning" v-if="scope.row.isAdd == 2">待通过</el-tag>
           <el-tag type="success" v-if="scope.row.isAdd == 1">是</el-tag>
         </template>
       </el-table-column>

+ 1 - 1
src/views/company/companyConfig/index.vue

@@ -184,7 +184,7 @@
         </el-tab-pane>
         <el-tab-pane label="配置销售会员审核" name="companyUserConfig">
           <el-form ref="companyUserConfig" label-width="140px">
-            <el-form-item label="会员是否默认黑名单">
+            <el-form-item label="会员是否小黑屋"><!--会员是否默认黑名单-->
               <el-row>
                 <el-switch v-model="userIsDefaultBlack"></el-switch>
               </el-row>

+ 29 - 12
src/views/company/companyMoneyLogs/index.vue

@@ -74,9 +74,16 @@
           type="warning"
           icon="el-icon-download"
           size="mini"
-          @click="handleExport(1)"
+          @click="handleExport(1, 0)"
           v-hasPermi="['company:companyMoneyLogs:export1']"
         >导出商城订单明细</el-button>
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport(1, 1)"
+          v-hasPermi="['company:companyMoneyLogs:export1']"
+        >导出直播订单明细</el-button>
       </el-col>
 
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -88,7 +95,7 @@
       <el-table-column label="金额" align="center" prop="money" />
       <el-table-column label="余额" align="center" prop="balance" />
 
-      <el-table-column label="商城订单号" align="center" prop="orderCode"  v-if="queryParams.logsType==3 || queryParams.logsType==4 ||queryParams.logsType==5 || queryParams.logsType==6"  />
+      <el-table-column label="订单号" align="center" prop="orderCode"  v-if="queryParams.logsType==3 || queryParams.logsType==4 ||queryParams.logsType==5 || queryParams.logsType==6"  />
       <el-table-column label="支付类型" align="center" prop="payTypeCode"  v-if="queryParams.logsType==3 || queryParams.logsType==4 ||queryParams.logsType==5 || queryParams.logsType==6 " />
 
       <el-table-column label="备注" align="center" prop="remark" />
@@ -151,7 +158,7 @@
     <!-- 导出字段选择对话框 -->
     <el-dialog title="选择导出字段" :visible.sync="exportDialogVisible" width="600px" append-to-body>
       <div style="margin-bottom: 15px;">
-        <el-checkbox 
+        <el-checkbox
           :indeterminate="exportFieldOptions.some(item => item.checked) && !exportFieldOptions.every(item => item.checked)"
           :value="exportFieldOptions.every(item => item.checked)"
           @change="handleCheckAllChange"
@@ -159,8 +166,8 @@
       </div>
       <el-row :gutter="20">
         <el-col :span="8" v-for="field in exportFieldOptions" :key="field.field">
-          <el-checkbox 
-            v-model="field.checked" 
+          <el-checkbox
+            v-model="field.checked"
             :label="field.label"
             style="margin-bottom: 10px;"
           ></el-checkbox>
@@ -185,6 +192,9 @@ export default {
   },
   data() {
     return {
+      taskId:null,
+      time:null,
+      exportLoading: false,
       show:{
         open:false,
         title:"订单详情"
@@ -312,6 +322,7 @@ export default {
     resetQuery() {
       this.resetForm("queryForm");
       this.queryParams.createTimeRange = null;
+      this.createTimeRange = []; // 清空日期范围选择器的值
       this.handleQuery();
     },
     // 多选框选中数据
@@ -383,35 +394,36 @@ export default {
     /** 确认导出 */
     confirmExport() {
       var that = this;
-      
+
       // 获取选中的字段
       const selectedFields = this.exportFieldOptions
         .filter(item => item.checked)
         .map(item => item.field);
-      
+
       if (selectedFields.length === 0) {
         this.msgWarning('请至少选择一个导出字段');
         return;
       }
-      
+
       if(this.createTimeRange!=null&&this.createTimeRange.length==2){
         this.queryParams.createTimeRange=this.createTimeRange[0]+"--"+this.createTimeRange[1]
       }
       else{
         this.queryParams.createTimeRange=null;
       }
-      
+
       const queryParams = this.queryParams;
       queryParams.type = this.currentExportType;
       queryParams.filter = selectedFields.join(','); // 使用filter参数传递字段列表
-      
+
       this.exportDialogVisible = false;
-      
+
       this.$confirm('是否确认导出所有企业账户记录数据项?', "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"
         }).then(function() {
+          that.exportLoading = true;
           return exportCompanyMoneyLogs(queryParams);
         }).then(response => {
           if(response.code==200){
@@ -428,8 +440,13 @@ export default {
               }
             });
           },10000);
+        } else {
+          that.msgError(response.msg);
+          that.exportLoading = false;
         }
-        }).catch(function() {});
+        }).catch(function() {
+          that.exportLoading = false;
+        });
     },
     /** 全选/取消全选导出字段 */
     handleCheckAllChange(val) {

+ 9 - 9
src/views/company/companyProfit/index.vue

@@ -4,9 +4,9 @@
       <el-form-item label="" v-if="company!=null" >
           <span style="font-weight:bold;" >{{company.companyName}}</span>
       </el-form-item>
-      <el-form-item label="推广佣金" v-if="company!=null" >
-          <span style="font-size:20px;color:red;">{{company.tuiMoney.toFixed(2)}}</span>元
-      </el-form-item>
+<!--      <el-form-item label="推广佣金" v-if="company!=null" >-->
+<!--          <span style="font-size:20px;color:red;">{{company.tuiMoney.toFixed(2)}}</span>元-->
+<!--      </el-form-item>-->
       <el-form-item label="可提现金额" v-if="company!=null" >
           <span style="font-size:20px;color:red;">{{company.money.toFixed(2)}}</span>元
       </el-form-item>
@@ -36,7 +36,7 @@
           v-hasPermi="['company:companyProfit:profit']"
         >提现</el-button>
       </el-col>
-     
+
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -91,7 +91,7 @@
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -118,7 +118,7 @@
         <el-form-item label="银行开户名" prop="bankUserName">
           <el-input v-model="form.bankUserName" placeholder="请输入银行开户名" />
         </el-form-item>
-      
+
        </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -188,8 +188,8 @@ export default {
         bankUserName: [
           { required: true, message: "银行开户名不能为空", trigger: "blur" }
         ],
-       
-        
+
+
       }
     };
   },
@@ -199,7 +199,7 @@ export default {
     });
     this.getCompanyInfo();
     this.getList();
-    
+
   },
   methods: {
     getCompanyInfo(){

+ 1 - 1
src/views/company/companyRecharge/doRecharge.vue

@@ -228,7 +228,7 @@ export default {
   .radio-img{
     margin-right: 10px;
   }
-  /deep/.el-radio{
+  .el-radio{
     display: flex;
     align-items: center;
     .el-radio__label{

+ 4 - 1
src/views/company/companyRecharge/index.vue

@@ -83,7 +83,7 @@
           <dict-tag :options="businessTypeOptions" :value="scope.row.businessType"/>
         </template>
       </el-table-column>
-      <el-table-column label="凭证照片" align="center" prop="images" >
+      <el-table-column label="凭证照片" align="center" prop="imgs" >
         <template slot-scope="scope">
           <div v-if="scope.row.imgs != null && scope.row.imgs != undefined && scope.row.imgs != ''">
             <el-image
@@ -195,6 +195,9 @@
         <el-form-item label="充值金额" prop="money">
           <el-input-number v-model="redRechargeForm.money" :min="0.01" placeholder="请输入充值金额"/>
         </el-form-item>
+        <el-form-item label="凭证" prop="imgs">
+          <image-upload v-model="redRechargeForm.imgs" :limit="9" />
+        </el-form-item>
         <el-form-item label="备注" prop="remark">
           <el-input v-model="redRechargeForm.remark" placeholder="请输入备注"/>
         </el-form-item>

+ 9 - 1
src/views/company/companyUser/index.vue

@@ -13,6 +13,9 @@
       <!--用户数据-->
       <el-col :span="22" :xs="24">
         <el-form  :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+          <el-form-item label="ID" prop="userId">
+            <el-input v-model="queryParams.userId" placeholder="请输入员工ID" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
+          </el-form-item>
           <el-form-item label="员工后台昵称" prop="nickName">
             <el-input v-model="queryParams.nickName" placeholder="请输入员工后台昵称" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
           </el-form-item>
@@ -847,6 +850,7 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        userId: null,
         userName: null,
         phonenumber: null,
         status: null,
@@ -1436,7 +1440,11 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
 
-      const userIds = row.userId || this.ids;
+      // 确保 userIds 始终是数组
+      let userIds = row.userId || this.ids;
+      if (!Array.isArray(userIds)) {
+        userIds = [userIds];
+      }
 
       // 筛选出 userType 为 '00' 的 userId
       const excludedUserIds = this.userList

+ 1822 - 0
src/views/company/companyUser/myCompanyUserIndex.vue

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

+ 5 - 5
src/views/company/companyVoicePackageOrder/buy.vue

@@ -61,7 +61,7 @@
 <script>
 import { getVoicePackagelist, buy} from "@/api/company/companyVoicePackageOrder";
 import { getCompanyInfo,getCompanyVoice } from "@/api/company/company";
- 
+
 export default {
   name: "CompanyRecharge",
   data() {
@@ -79,7 +79,7 @@ export default {
       },
       // 表单校验
       rules: {
-        
+
          packageId: [
           { required: true, message: "套餐不能为空", trigger: "blur" },
         ],
@@ -137,7 +137,7 @@ export default {
     width:200px;
     margin: 0px 10px;
     cursor: pointer;
-    
+
   }
   .active{
     border: 1px solid #13c2c2;;
@@ -151,7 +151,7 @@ export default {
 .radio{
   display: flex;
   align-items: center;
-   
+
 
 }
 .radio-item{
@@ -159,7 +159,7 @@ export default {
   .radio-img{
     margin-right: 10px;
   }
-  /deep/.el-radio{
+  .el-radio{
     display: flex;
     align-items: center;
     .el-radio__label{

+ 814 - 0
src/views/company/companyVoiceRobotic/index-old.vue

@@ -0,0 +1,814 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="任务名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入任务名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <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-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['system:companyVoiceRobotic:add']"
+        >新增
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['system:companyVoiceRobotic:edit']"
+        >修改
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['system:companyVoiceRobotic:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['system:companyVoiceRobotic:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-refresh"
+          size="mini"
+          @click="updateStatusFun"
+          v-hasPermi="['system:companyVoiceRobotic:list']"
+        >更新状态
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="roboticList" @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="name"/>
+      <el-table-column label="三方名称" align="center" prop="taskName"/>
+      <el-table-column label="三方ID" align="center" prop="taskId"/>
+      <el-table-column label="机器人" align="center" prop="robot">
+        <template slot-scope="scope">
+          <p v-for="(item, index) in robotList" v-if="scope.row.robot && scope.row.robot == item.id">{{ item.name }}</p>
+        </template>
+      </el-table-column>
+      <el-table-column label="话术" align="center" prop="dialogId">
+        <template slot-scope="scope">
+          <p v-for="(item, index) in dialogList" v-if="scope.row.dialogId && scope.row.dialogId == item.id">
+            {{ item.name }}</p>
+        </template>
+      </el-table-column>
+      <el-table-column label="加微方式" align="center" prop="dialogId">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.addType == 0">平均</el-tag>
+          <el-tag v-if="scope.row.addType == 1">意向</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="工作日" align="center" prop="weekDay1">
+        <template slot-scope="scope">
+          <el-tag v-for="(item, index) in weekList"
+                  v-if="scope.row.weekDay1 && scope.row.weekDay1.indexOf(item.value) != -1">{{ item.label }}
+          </el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="开始时间" align="center" prop="startTime1"/>
+      <el-table-column label="结束时间" align="center" prop="endTime1"/>
+      <el-table-column label="未分配数量" align="center">
+        <template slot-scope="scope">
+          <el-tag :type="Number(scope.row.num) > 0 ?'danger' : ''">{{scope.row.num}}个</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="当前状态" align="center">
+        <template slot-scope="scope">
+          <div v-loading="loadingStatus">
+            <p v-if="statusObj.hasOwnProperty(scope.row.taskId)">
+              <el-tag v-if="statusObj[scope.row.taskId].runningStatus == 0">未启动</el-tag>
+              <el-tag v-if="statusObj[scope.row.taskId].runningStatus == 1">运行中</el-tag>
+              <el-tag v-if="statusObj[scope.row.taskId].runningStatus == 2">已暂停</el-tag>
+              <el-tag v-if="statusObj[scope.row.taskId].runningStatus == 3">已停止</el-tag>
+            </p>
+            <p v-if="!statusObj.hasOwnProperty(scope.row.taskId)">
+              <el-tag>空</el-tag>
+            </p>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            @click="calleesOpen(scope.row.id)"
+            v-hasPermi="['system:companyVoiceRobotic:list']"
+          >客户列表
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            @click="wxOpen(scope.row.id)"
+            v-hasPermi="['system:companyVoiceRobotic:list']"
+          >加微统计
+          </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
+            size="mini"
+            type="text"
+            v-if="statusObj.hasOwnProperty(scope.row.taskId) && (statusObj[scope.row.taskId].runningStatus == 1 || statusObj[scope.row.taskId].runningStatus == 2)"
+            @click="stopRoboticFun(scope.row.taskId)"
+            v-hasPermi="['system:companyVoiceRobotic:list']"
+          >停止任务
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            @click="addRoboticFun(scope.row)"
+            v-hasPermi="['system:companyVoiceRobotic:edit']"
+          >追加个微
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['system:companyVoiceRobotic: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-drawer size="75%" :title="title" :visible.sync="open" width="500px" append-to-body>
+      <div class="app-container">
+        <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+          <el-form-item label="任务名称" prop="name">
+            <el-input v-model="form.name" placeholder="请输入任务名称"/>
+          </el-form-item>
+          <el-form-item label="机器人" prop="robot">
+            <el-select v-model="form.robot" filterable>
+              <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="form.dialogId" filterable>
+              <el-option v-for="item in dialogList" :label="item.name" :value="item.id"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="拨打客户" prop="userIds">
+            <el-button @click="openSelect">选择客户({{ form.userIds ? form.userIds.length : 0 }})</el-button>
+          </el-form-item>
+          <el-form-item label="加微方式" prop="addType">
+            <el-radio v-model="form.addType" :label="0">平均</el-radio>
+            <el-radio v-model="form.addType" :label="1">意向</el-radio>
+          </el-form-item>
+          <el-form-item label="分配账号">
+            <el-button @click="addQwUser">添加</el-button>
+            <el-row :gutter="24" v-for="(item, index) in form.qwUser" style="margin-top: 5px">
+              <el-col :span="5">
+                <el-select v-model="item.intention" placeholder="意向等级" filterable clearable>
+                  <el-option v-for="item in levelList" :label="item.dictLabel" :value="item.dictLabel"/>
+                </el-select>
+              </el-col>
+              <el-col :span="4">
+                <el-button @click="openQwUserSelect(index)">
+                  选择个微({{ item.companyUserId ? item.companyUserId.length : 0 }})
+                </el-button>
+              </el-col>
+              <el-col :span="5">
+                <el-select v-model="item.wxDialogId" placeholder="话术" filterable>
+                  <el-option v-for="item in wxDialogList" :label="item.name" :value="item.id"/>
+                </el-select>
+              </el-col>
+              <el-col :span="3">
+                <el-button type="danger" icon="el-icon-delete" circle @click="removeQwUser(index)"></el-button>
+              </el-col>
+            </el-row>
+          </el-form-item>
+          <el-form-item label="模式" prop="mode">
+            <el-select v-model="form.mode">
+              <el-option label="呼叫机器人后挂断" :value="7"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="呼叫倍率" prop="multiplier">
+            <el-select v-model="form.multiplier">
+              <el-option :value="1"/>
+              <el-option :value="2"/>
+              <el-option :value="3"/>
+              <el-option :value="4"/>
+              <el-option :value="5"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="自动重呼" prop="autoRecall">
+            <el-radio v-model="form.autoRecall" label="0">否</el-radio>
+            <el-radio v-model="form.autoRecall" label="1">是</el-radio>
+          </el-form-item>
+          <el-form-item label="重呼次数" prop="recallTimes" v-if="form.autoRecall == 1">
+            <el-select v-model="form.recallTimes">
+              <el-option label="不自动重呼" :value="0"/>
+              <el-option :value="1"/>
+              <el-option :value="2"/>
+              <el-option :value="3"/>
+              <el-option :value="4"/>
+              <el-option :value="5"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="工作日" prop="weekDay">
+            <el-select v-model="form.weekDay" multiple style="width: 100%">
+              <el-option v-for="item in weekList" :label="item.label" :value="item.value"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="开始时间" prop="startTime1">
+            <el-time-select
+              v-model="form.startTime1"
+              format="HH:mm"
+              value-format="HH:mm:00"
+              :picker-options="{
+                  start: '00:00',
+                  end: '23:59',
+                  step: '00:30',
+                }"
+              placeholder="请选择开始时间">
+            </el-time-select>
+          </el-form-item>
+          <el-form-item label="结束时间" prop="endTime1">
+            <el-time-select
+              v-model="form.endTime1"
+              format="HH:mm"
+              value-format="HH:mm:00"
+              :picker-options="{
+                  start: '00:00',
+                  end: '23:59',
+                  step: '00:30',
+                  minTime: form.startTime1
+                }"
+              placeholder="请选择结束时间">
+            </el-time-select>
+          </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>
+      </div>
+    </el-drawer>
+    <customer-select @success="selectFun" ref="customer"/>
+    <qw-user-select @success="selectQwUserFun" ref="qwUserSelect"/>
+    <qw-user-select @success="selectQwUserFunTow" ref="qwUserSelectTow"/>
+
+    <el-drawer title="呼叫客户列表" size="60%" :visible.sync="callees.show" width="800px" append-to-body>
+      <el-table v-loading="callees.loading" :data="callees.list">
+        <el-table-column label="电话号码" align="center" prop="phone"/>
+        <el-table-column label="客户名称" align="center" prop="userName"/>
+        <el-table-column label="客户ID" align="center" prop="userId"/>
+        <el-table-column label="是否回调" align="center">
+          <template slot-scope="scope">
+            <el-tag v-if="scope.row.result == 0">否</el-tag>
+            <el-tag v-if="scope.row.result == 1">是</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column label="意向等级" align="center" prop="intention"/>
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              @click="openCustomer(scope.row.userId)"
+            >客户信息详情
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination
+        v-show="callees.total>0"
+        :total="callees.total"
+        :page.sync="callees.queryParams.pageNum"
+        :limit.sync="callees.queryParams.pageSize"
+        @pagination="getCalleesList"
+      />
+    </el-drawer>
+    <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"/>
+        <el-table-column label="微信号" align="center" prop="wxNo"/>
+        <el-table-column label="手机号" align="center" prop="phone"/>
+        <el-table-column label="员工名称" align="center" prop="companyUserName"/>
+        <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="wx.total>0"
+        :total="wx.total"
+        :page.sync="wx.queryParams.pageNum"
+        :limit.sync="wx.queryParams.pageSize"
+        @pagination="getWxList"
+      />
+    </el-drawer>
+    <el-drawer size="75%" title="客户详情" :visible.sync="customerDetailShow" append-to-body>
+      <customer-details ref="customerDetails"/>
+    </el-drawer>
+
+
+    <!-- 添加或修改添加个微信账号对话框 -->
+    <el-dialog title="追加个微" :visible.sync="openAdd" width="75%" append-to-body>
+      <el-form ref="form" :model="formOpen" label-width="80px">
+        <el-form-item label="分配账号">
+          <el-button @click="addQwUserTow">添加</el-button>
+          <el-row :gutter="24" v-for="(item, index) in formOpen.qwUser" style="margin-top: 5px">
+            <el-col :span="5">
+              <el-select v-model="item.intention" placeholder="意向等级" filterable clearable>
+                <el-option v-for="item in levelList" :label="item.dictLabel" :value="item.dictLabel"/>
+              </el-select>
+            </el-col>
+            <el-col :span="5">
+              <el-button @click="openQwUserSelectTow(index)">
+                选择企微({{ item.companyUserId ? item.companyUserId.length : 0 }})
+              </el-button>
+            </el-col>
+            <el-col :span="5">
+              <el-select v-model="item.wxDialogId" placeholder="话术" filterable>
+                <el-option v-for="item in wxDialogList" :label="item.name" :value="item.id"/>
+              </el-select>
+            </el-col>
+            <el-col :span="3">
+              <el-button type="danger" icon="el-icon-delete" circle
+                         @click="removeQwUser(index)"></el-button>
+            </el-col>
+          </el-row>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFormTow">确 定</el-button>
+        <el-button @click="openAdd = false">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  listRobotic,
+  getRobotic,
+  delRobotic,
+  addRobotic,
+  updateRobotic,
+  exportRobotic,
+  calleesList,
+  statusList,
+  startRobotic,
+  stopRobotic,
+  addScheme,
+  companyUserList,
+  wxList,
+  getTypes
+} from "@/api/company/companyVoiceRobotic";
+import {listAll} from '@/api/company/wxDialog';
+import customerSelect from '@/views/crm/components/CustomerSelect.vue';
+import qwUserSelect from '@/views/components/QwUserSelect.vue';
+import customerDetails from "@/views/crm/components/customerDetails.vue";
+import {clearTime} from "element-ui";
+import {getDicts} from "@/api/system/dict/data";
+
+export default {
+  name: "Robotic",
+  components: {customerDetails, customerSelect, qwUserSelect},
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      weekList: [
+        {label: "星期一", value: 1},
+        {label: "星期二", value: 2},
+        {label: "星期三", value: 3},
+        {label: "星期四", value: 4},
+        {label: "星期五", value: 5},
+        {label: "星期六", value: 6},
+        {label: "星期日", value: 0},
+      ],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      loadingStatus: true,
+      // 总条数
+      total: 0,
+      // 机器人外呼任务表格数据
+      roboticList: [],
+      userTableList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      openAdd: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        taskName: null,
+        taskId: null,
+        robot: null,
+        dialogId: null,
+        mode: null,
+        multiplier: null,
+        autoRecall: null,
+        recallTimes: null,
+        cidGroupId: null,
+        weekDay1: null,
+        startTime1: null,
+        endTime1: null,
+        weekDay2: null,
+        startTime2: null,
+        endTime2: null,
+        createUser: null
+      },
+      // 表单参数
+      form: {},
+      formOpen: {},
+      statusObj: {},
+      levelList: {},
+      robotList: [],
+      dialogList: [],
+      wxDialogList: [],
+      qwUserList: [],
+      selectQwUserList: [],
+      thisQwUserIndex: 0,
+      updateTime: null,
+      customer: {
+        show: false,
+      },
+      customerDetailShow: false,
+      callees: {
+        show: false,
+        list: [],
+        loading: false,
+        total: 0,
+        queryParams: {
+          id: null,
+          pageNum: 1,
+          pageSize: 10,
+        },
+      },
+      wx: {
+        show: false,
+        list: [],
+        loading: false,
+        total: 0,
+        queryParams: {
+          id: null,
+          pageNum: 1,
+          pageSize: 10,
+        },
+      },
+      // 表单校验
+      rules: {}
+    };
+  },
+  created() {
+    getTypes().then(e => {
+      this.robotList = e.robot;
+      this.dialogList = e.dialog;
+    })
+    listAll().then(e => {
+      this.wxDialogList = e.data;
+    })
+    companyUserList().then(e => {
+      this.qwUserList = e.data;
+    })
+    getDicts("customer_intention_level").then(e => {
+      this.levelList = e.data;
+    })
+    this.getList();
+  },
+  methods: {
+    /** 查询机器人外呼任务列表 */
+    getList() {
+      this.loading = true;
+      listRobotic(this.queryParams).then(response => {
+        this.roboticList = response.rows;
+        this.roboticList.forEach(e => {
+          if (e.weekDay1) {
+            e.weekDay = e.weekDay1.split(",")
+          }
+        })
+        this.total = response.total;
+        this.loading = false;
+        this.updateStatusFun();
+      });
+    },
+    updateStatusFun() {
+      if (!this.roboticList) {
+        return;
+      }
+      this.loadingStatus = true;
+      statusList(this.roboticList.map(e => e.taskId).join()).then(e => {
+        this.loadingStatus = false;
+        this.statusObj = e.data;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        name: null,
+        taskName: null,
+        taskId: null,
+        robot: null,
+        dialogId: null,
+        mode: null,
+        multiplier: null,
+        autoRecall: null,
+        recallTimes: null,
+        cidGroupId: null,
+        weekDay1: null,
+        startTime1: null,
+        addType: 0,
+        endTime1: null,
+        weekDay2: null,
+        startTime2: null,
+        endTime2: null,
+        createTime: null,
+        qwUser: [],
+        createUser: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加机器人外呼任务";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getRobotic(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改机器人外呼任务";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.weekDay && this.form.weekDay.length > 0) {
+            this.form.weekDay1 = this.form.weekDay.join(",")
+          }
+          let list = [];
+          this.form.qwUser.forEach(l => {
+            list = list.concat(l.companyUserId.map(e => {
+              return {intention: l.intention, companyUserId: e, wxDialogId: l.wxDialogId}
+            }))
+          })
+          this.form.qwUserList = list;
+          if (!this.form.qwUserList || this.form.qwUserList.length == 0) {
+            this.msgError("请选者加微方案");
+            return;
+          }
+          if (this.form.id != null) {
+            updateRobotic(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          } else {
+            addRobotic(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          }
+        }
+      });
+    },
+    /** 提交按钮 */
+    submitFormTow() {
+      let list = [];
+      this.formOpen.qwUser.forEach(l => {
+        list = list.concat(l.companyUserId.map(e => {
+          return {intention: l.intention, companyUserId: e, wxDialogId: l.wxDialogId}
+        }))
+      })
+      this.formOpen.qwUserList = list;
+      if (!this.formOpen.qwUserList || this.formOpen.qwUserList.length == 0) {
+        this.msgError("请选者加微方案");
+        return;
+      }
+      addScheme(this.formOpen).then(response => {
+        if (response.code === 200) {
+          this.msgSuccess("修改成功");
+          this.open = false;
+          this.getList();
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除机器人外呼任务编号为"' + ids + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return delRobotic(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(function () {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有机器人外呼任务数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return exportRobotic(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      }).catch(function () {
+      });
+    },
+    openSelect() {
+      this.$refs.customer.setRows(this.form.userTableList);
+    },
+    openQwUserSelectTow(index) {
+      this.thisQwUserIndex = index;
+      this.$nextTick(() => {
+        this.$refs.qwUserSelectTow.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;
+      this.form.userTableList = e.rows;
+      this.$forceUpdate()
+    },
+    selectQwUserFunTow(e) {
+      console.info(this.formOpen.qwUser[this.thisQwUserIndex])
+      this.formOpen.qwUser[this.thisQwUserIndex].companyUserId = e.ids;
+      console.info(this.formOpen)
+      this.selectQwUserList[this.thisQwUserIndex] = e.rows;
+      this.$forceUpdate()
+    },
+    selectQwUserFun(e) {
+      this.form.qwUser[this.thisQwUserIndex].companyUserId = e.ids;
+      this.selectQwUserList[this.thisQwUserIndex] = e.rows;
+      this.$forceUpdate()
+    },
+    calleesOpen(id) {
+      this.callees.show = true;
+      this.callees.queryParams.id = id;
+      this.getCalleesList();
+    },
+    getCalleesList() {
+      this.callees.loading = true;
+      calleesList(this.callees.queryParams).then(response => {
+        this.callees.list = response.rows;
+        this.callees.total = response.total;
+        this.callees.loading = false;
+      });
+    },
+    wxOpen(id) {
+      this.wx.show = true;
+      this.wx.queryParams.id = id;
+      this.getWxList();
+    },
+    getWxList() {
+      this.wx.loading = true;
+      wxList(this.wx.queryParams).then(response => {
+        this.wx.list = response.rows;
+        this.wx.total = response.total;
+        this.wx.loading = false;
+      });
+    },
+    openCustomer(id) {
+      this.customerDetailShow = true;
+      this.$nextTick(() => {
+        this.$refs.customerDetails.getDetails(id);
+      })
+    },
+    startRoboticFun(id) {
+      startRobotic(id).then(e => {
+        this.updateStatusFun();
+      })
+    },
+    stopRoboticFun(id) {
+      stopRobotic(id).then(e => {
+        this.updateStatusFun();
+      })
+    },
+    addQwUserTow(row) {
+      this.formOpen.qwUser.push({});
+    },
+    addRoboticFun(row) {
+      this.openAdd = true;
+      this.formOpen = {id: row.id, qwUser: []};
+    },
+    addQwUser() {
+      this.form.qwUser.push({});
+    },
+    removeQwUser(index) {
+      this.form.qwUser.splice(index, 1)
+    }
+  }
+};
+</script>

+ 147 - 51
src/views/company/companyVoiceRobotic/index.vue

@@ -93,14 +93,32 @@
           <el-tag v-if="scope.row.addType == 1">意向</el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="星期" align="center" prop="weekDay1">
+<!--      <el-table-column label="星期" align="center" prop="weekDay1">-->
+<!--        <template slot-scope="scope">-->
+<!--          <el-tag v-for="(item, index) in weekList"   v-if="scope.row.weekDay1 && scope.row.weekDay1.indexOf(item.value) != -1">{{item.label}}</el-tag>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
+<!--      <el-table-column label="开始时间" align="center" prop="startTime1"/>-->
+<!--      <el-table-column label="结束时间" align="center" prop="endTime1"/>-->
+      <el-table-column label="任务流程" align="center" width="230">
         <template slot-scope="scope">
-          <el-tag v-for="(item, index) in weekList"   v-if="scope.row.weekDay1 && scope.row.weekDay1.indexOf(item.value) != -1">{{item.label}}</el-tag>
+          <div v-if="scope.row.taskFlow" v-model="scope.row.taskFlow.split(',')" class="flow-parent">
+            <div v-for="(item, index) in scope.row.taskFlow.split(',')">
+              <el-tag :type="scope.row.runTaskFlow != null && scope.row.runTaskFlow.split(',').indexOf(item) != -1 ? 'success' : 'warning'">{{ taskFlowMap[item] }}</el-tag>
+              <i class="el-icon-arrow-right" v-if="index != 2"></i>
+            </div>
+          </div>
         </template>
       </el-table-column>
-      <el-table-column label="开始时间" align="center" prop="startTime1"/>
-      <el-table-column label="结束时间" align="center" prop="endTime1"/>
-      <el-table-column label="当前状态" align="center">
+      <el-table-column label="任务状态" align="center">
+        <template slot-scope="scope">
+            <el-tag v-if="scope.row.taskStatus == 0">未启动</el-tag>
+            <el-tag v-if="scope.row.taskStatus == 1" type="warning">执行中</el-tag>
+            <el-tag v-if="scope.row.taskStatus == 2" type="danger">执行中断</el-tag>
+            <el-tag v-if="scope.row.taskStatus == 3" type="success">执行完成</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="外呼状态" align="center">
         <template slot-scope="scope">
           <div v-loading="loadingStatus">
             <p v-if="statusObj.hasOwnProperty(scope.row.taskId)">
@@ -127,13 +145,19 @@
             @click="wxOpen(scope.row.id)"
             v-hasPermi="['system:companyVoiceRobotic:list']"
           >加微管理</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            v-if="scope.row.taskStatus == 0"
+            @click="taskRunFun(scope.row.id)"
+          >启动任务</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"
@@ -177,18 +201,34 @@
             <el-select v-model="form.dialogId" filterable>
               <el-option v-for="item in dialogList" :label="item.name" :value="item.id"/>
             </el-select>
+          </el-form-item>
+           <el-form-item label="主叫分组" prop="cidGroupId">
+            <el-select v-model="form.cidGroupId" filterable>
+              <el-option v-for="item in CIDGroupList" :label="item.name" :value="item.id"/>
+            </el-select>
           </el-form-item>
           <el-form-item label="拨打客户" prop="userIds">
             <el-button @click="openSelect">选择客户({{ form.userIds ? form.userIds.length : 0 }})</el-button>
           </el-form-item>
+          <el-form-item label="任务流程" prop="taskFlow">
+            <draggable v-model="taskFlowList" @end="" class="flow-parent">
+              <div class="flow-child" v-for="item in taskFlowList">
+                <el-tag>{{ item.value }}</el-tag>
+                <i class="el-icon-arrow-right"></i>
+              </div>
+            </draggable>
+          </el-form-item>
           <el-form-item label="加微方式" prop="addType">
             <el-radio v-model="form.addType" :label="0">平均</el-radio>
             <el-radio v-model="form.addType" :label="1">意向</el-radio>
           </el-form-item>
+          <el-form-item label="加微等待时间" prop="addWxTime" >
+              <el-input style="width:240px"  v-model="form.addWxTime" placeholder="加微等待时间"/>
+          </el-form-item>
           <el-form-item label="分配账号">
             <el-button @click="addQwUser">添加</el-button>
             <el-row :gutter="24" v-for="(item, index) in form.qwUser" style="margin-top: 5px">
-              <el-col :span="5">
+              <el-col :span="5" v-if="form.addType == 1">
                 <el-select v-model="item.intention" placeholder="意向等级" filterable clearable>
                   <el-option v-for="item in levelList" :label="item.dictLabel" :value="item.dictValue"/>
                 </el-select>
@@ -201,6 +241,11 @@
                   <el-option v-for="item in wxDialogList" :label="item.name" :value="item.id"/>
                 </el-select>
               </el-col>
+              <el-col :span="5">
+                <el-select v-model="item.smsTempId" placeholder="短信模板" filterable>
+                  <el-option v-for="item in smsTempList" :label="item.title" :value="item.tempId"/>
+                </el-select>
+              </el-col>
               <el-col :span="3">
                 <el-button type="danger" icon="el-icon-delete" circle @click="removeQwUser(index)"></el-button>
               </el-col>
@@ -221,8 +266,8 @@
             </el-select>
           </el-form-item>
           <el-form-item label="自动重呼" prop="autoRecall">
-            <el-radio v-model="form.autoRecall" label="0">否</el-radio>
-            <el-radio v-model="form.autoRecall" label="1">是</el-radio>
+            <el-radio v-model="form.autoRecall" :label="0">否</el-radio>
+            <el-radio v-model="form.autoRecall" :label="1">是</el-radio>
           </el-form-item>
           <el-form-item label="重呼次数" prop="recallTimes" v-if="form.autoRecall == 1">
             <el-select v-model="form.recallTimes">
@@ -234,38 +279,6 @@
               <el-option :value="5"/>
             </el-select>
           </el-form-item>
-          <el-form-item label="星期" prop="weekDay">
-            <el-select v-model="form.weekDay" multiple style="width: 100%">
-              <el-option v-for="item in weekList" :label="item.label" :value="item.value"/>
-            </el-select>
-          </el-form-item>
-          <el-form-item label="开始时间" prop="startTime1">
-            <el-time-select
-              v-model="form.startTime1"
-              format="HH:mm"
-              value-format="HH:mm:00"
-              :picker-options="{
-                  start: '00:00',
-                  end: '23:59',
-                  step: '00:30',
-                }"
-              placeholder="请选择开始时间">
-            </el-time-select>
-          </el-form-item>
-          <el-form-item label="结束时间" prop="endTime1">
-            <el-time-select
-              v-model="form.endTime1"
-              format="HH:mm"
-              value-format="HH:mm:00"
-              :picker-options="{
-                  start: '00:00',
-                  end: '23:59',
-                  step: '00:30',
-                  minTime: form.startTime1
-                }"
-              placeholder="请选择结束时间">
-            </el-time-select>
-          </el-form-item>
         </el-form>
         <div slot="footer" class="dialog-footer">
           <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -281,12 +294,17 @@
         <el-table-column label="电话号码" align="center" prop="phone"/>
         <el-table-column label="客户名称" align="center" prop="userName"/>
         <el-table-column label="客户ID" align="center" prop="userId"/>
+        <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>
+          </template>
+        </el-table-column>
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
           <template slot-scope="scope">
             <el-button
               size="mini"
               type="text"
-              @click="openCustomer(scope.row.userId)"
+              @click="openCustomer(scope.row.userId,scope.row.idToString,scope.row.roboticId)"
             >客户信息详情</el-button>
           </template>
         </el-table-column>
@@ -340,8 +358,12 @@ import {
   stopRobotic,
   companyUserList,
   wxList,
-  getTypes
+  taskRun,
+  getTypes,
+  getSmsTempList,
+  getCIDGroupList
 } 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';
@@ -351,11 +373,12 @@ import {getDicts} from "@/api/system/dict/data";
 
 export default {
   name: "Robotic",
-  components: {customerDetails, customerSelect, qwUserSelect},
+  components: { draggable, customerDetails, customerSelect, qwUserSelect},
   data() {
     return {
       // 遮罩层
       loading: true,
+      CIDGroupList:[],
       // 选中数组
       ids: [],
       weekList: [
@@ -407,6 +430,8 @@ export default {
       },
       // 表单参数
       form: {},
+      taskFlowList: [{key: "cellPhone", value: "外呼"}, {key: "sendMsg", value: "发短信"}, {key: "addWx", value: "加微"}],
+      taskFlowMap: {cellPhone: "外呼", sendMsg: "发短信", addWx: "加微"},
       statusObj: {},
       levelList: {},
       robotList: [],
@@ -443,7 +468,8 @@ export default {
         },
       },
       // 表单校验
-      rules: {}
+      rules: {},
+      smsTempList:[]
     };
   },
   created() {
@@ -461,8 +487,26 @@ export default {
       this.levelList = e.data;
     })
     this.getList();
+    this.getSmsTempDropList();
+
+    getCIDGroupList().then(res=>{
+      console.log("----------------------")
+      console.log(res);
+      this.CIDGroupList = res.data;
+    }).catch(res=>{
+      console.log("catch_____+++++++")
+      console.log(res);
+    });
   },
   methods: {
+    getSmsTempDropList(){
+      getSmsTempList().then(res=>{
+        this.smsTempList = res.data;
+        console.log(this.smsTempList);
+      }).catch(res=>{
+        console.log(res);
+      })
+    },
     /** 查询机器人外呼任务列表 */
     getList() {
       this.loading = true;
@@ -502,9 +546,9 @@ export default {
         taskId: null,
         robot: null,
         dialogId: null,
-        mode: null,
-        multiplier: null,
-        autoRecall: null,
+        mode: 7,
+        multiplier: 3,
+        autoRecall: 0,
         recallTimes: null,
         cidGroupId: null,
         weekDay1: null,
@@ -561,13 +605,22 @@ export default {
           }
           let list = [];
           this.form.qwUser.forEach(l => {
-            list = list.concat(l.companyUserId.map(e => {return {intention: l.intention, companyUserId: e,wxDialogId: l.wxDialogId}}))
+            list = list.concat(l.companyUserId.map(e => {return {intention: l.intention, companyUserId: e,wxDialogId: l.wxDialogId,smsTempId:l.smsTempId}}))
           })
           this.form.qwUserList = list;
+          console.log(this.form);
+          if(this.form.addType != 0 ){
+           let firstTask = this.taskFlowList[0];
+            if(firstTask.key != "cellPhone"){
+              this.msgError("【意向】加微方式下,任务流程第一步必须为外呼!");
+              return;
+            }
+          }
           if(!this.form.qwUserList || this.form.qwUserList.length == 0){
             this.msgError("请选者加微方案");
             return;
           }
+          this.form.taskFlow = this.taskFlowList.map(e => e.key).join();
           if (this.form.id != null) {
             updateRobotic(this.form).then(response => {
               if (response.code === 200) {
@@ -663,10 +716,10 @@ export default {
         this.wx.loading = false;
       });
     },
-    openCustomer(id) {
+    openCustomer(id,calleesId,roboticId) {
       this.customerDetailShow=true;
       this.$nextTick(() => {
-        this.$refs.customerDetails.getDetails(id);
+        this.$refs.customerDetails.getDetails(id,calleesId,roboticId);
       })
     },
     startRoboticFun(id){
@@ -674,6 +727,11 @@ export default {
         this.updateStatusFun();
       })
     },
+    taskRunFun(id){
+      taskRun({id}).then(e => {
+        this.getList();
+      })
+    },
     stopRoboticFun(id){
       stopRobotic(id).then(e => {
         this.updateStatusFun();
@@ -688,3 +746,41 @@ export default {
   }
 };
 </script>
+<style>
+.flow-parent{
+  display: flex;
+  flex-wrap: nowrap;
+}
+.flow-child{
+  position: relative;
+  width: 150px;
+  cursor: move;
+}
+.flow-child:last-child i{
+  display: none;
+}
+.flow-child:last-child::after{
+  display: none;
+}
+.flow-child i{
+  right: 20px;
+  top: 50%;
+  transform: translateY(-50%);
+  position: absolute;
+  font-weight: bold;
+}
+.flow-child::after{
+  content: "";
+  border-top: 1px solid #000;
+  height: 1px;
+  width: 50px;
+  right: 26px;
+  top: 50%;
+  transform: translateY(-50%);
+  position: absolute;
+}
+.sortable-ghost{
+  //background: #FFF !important;
+  background: rgb(217, 236, 255) !important;
+}
+</style>

+ 181 - 0
src/views/company/companyWorkflow/design.scss

@@ -0,0 +1,181 @@
+.workflow-designer {
+  height: 100vh;
+  display: flex;
+  flex-direction: column;
+  background: #f5f5f5;
+
+  .toolbar {
+    height: 50px;
+    background: #fff;
+    border-bottom: 1px solid #e8e8e8;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 0 16px;
+
+    .toolbar-left, .toolbar-right {
+      display: flex;
+      align-items: center;
+    }
+  }
+
+  .main-content {
+    flex: 1;
+    display: flex;
+    overflow: hidden;
+  }
+
+  .node-panel {
+    width: 220px;
+    background: #fff;
+    border-right: 1px solid #e8e8e8;
+    overflow-y: auto;
+
+    .panel-title {
+      padding: 12px 16px;
+      font-weight: 600;
+      border-bottom: 1px solid #e8e8e8;
+    }
+
+    .node-category {
+      .category-title {
+        padding: 8px 16px;
+        font-size: 12px;
+        color: #999;
+        background: #fafafa;
+      }
+
+      .node-list {
+        padding: 8px;
+      }
+
+      .node-item {
+        display: flex;
+        align-items: center;
+        padding: 8px 12px;
+        margin-bottom: 8px;
+        background: #fff;
+        border: 1px solid #e8e8e8;
+        border-radius: 4px;
+        cursor: grab;
+        transition: all 0.2s;
+
+        &:hover {
+          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+        }
+
+        i {
+          font-size: 18px;
+          margin-right: 8px;
+        }
+
+        span {
+          font-size: 13px;
+        }
+      }
+    }
+  }
+
+  .canvas-container {
+    flex: 1;
+    position: relative;
+    overflow: auto;
+
+    .canvas-svg {
+      min-width: 100%;
+      min-height: 100%;
+      cursor: grab;
+
+      &.dragging-canvas {
+        cursor: grabbing;
+      }
+
+      .node-group {
+        cursor: move;
+
+        rect {
+          transition: stroke-width 0.2s;
+
+          &.selected {
+            stroke-width: 3;
+          }
+        }
+
+        .node-content {
+          display: flex;
+          align-items: center;
+          height: 100%;
+          padding: 0 10px;
+          overflow: hidden;
+
+          i {
+            font-size: 16px;
+            margin-right: 6px;
+            flex-shrink: 0;
+          }
+
+          .node-name {
+            font-size: 12px;
+            color: #333;
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            flex: 1;
+            min-width: 0;
+          }
+        }
+
+        .anchor {
+          opacity: 0;
+          cursor: crosshair;
+          transition: opacity 0.2s;
+        }
+
+        &:hover .anchor {
+          opacity: 1;
+        }
+      }
+
+      .edge-group {
+        cursor: pointer;
+
+        path {
+          transition: stroke-width 0.2s;
+
+          &.selected {
+            stroke-width: 3;
+          }
+        }
+      }
+    }
+  }
+
+  .property-panel {
+    width: 280px;
+    background: #fff;
+    border-left: 1px solid #e8e8e8;
+    overflow-y: auto;
+
+    .panel-title {
+      padding: 12px 16px;
+      font-weight: 600;
+      border-bottom: 1px solid #e8e8e8;
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+
+      .el-icon-close {
+        cursor: pointer;
+        color: #999;
+
+        &:hover {
+          color: #333;
+        }
+      }
+    }
+
+    .el-form {
+      padding: 16px;
+    }
+  }
+}

+ 732 - 0
src/views/company/companyWorkflow/design.vue

@@ -0,0 +1,732 @@
+<template>
+  <div class="workflow-designer">
+    <!-- 顶部工具栏 -->
+    <div class="toolbar">
+      <div class="toolbar-left">
+        <el-button icon="el-icon-back" size="small" @click="goBack">返回</el-button>
+        <el-divider direction="vertical" />
+        <el-input v-model="form.workflowName" placeholder="工作流名称" size="small" style="width: 200px" />
+        <el-select v-model="form.workflowType" placeholder="类型" size="small" style="width: 120px; margin-left: 10px">
+          <el-option
+            v-for="dict in workflowTypeOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </div>
+      <div class="toolbar-right">
+        <el-input
+          v-model="form.workflowDesc"
+          placeholder="工作流描述"
+          size="small"
+          style="width: 200px; margin-right: 10px"
+        />
+        <el-divider direction="vertical" />
+        <el-button icon="el-icon-zoom-in" size="small" @click="zoomIn">放大</el-button>
+        <el-button icon="el-icon-zoom-out" size="small" @click="zoomOut">缩小</el-button>
+        <el-button icon="el-icon-rank" size="small" @click="fitView">适应</el-button>
+        <el-divider direction="vertical" />
+        <el-button type="primary" icon="el-icon-check" size="small" @click="handleSave">保存</el-button>
+      </div>
+    </div>
+
+    <div class="main-content">
+      <!-- 左侧节点面板 -->
+      <div class="node-panel">
+        <div class="panel-title">节点类型</div>
+        <div class="node-category" v-for="category in nodeCategories" :key="category.key">
+          <div class="category-title">{{ category.name }}</div>
+          <div class="node-list">
+            <div
+              class="node-item"
+              v-for="nodeType in category.types"
+              :key="nodeType.typeCode"
+              draggable="true"
+              @dragstart="onDragStart($event, nodeType)"
+              :style="{ borderColor: nodeType.typeColor }"
+            >
+              <i :class="nodeType.typeIcon" :style="{ color: nodeType.typeColor }"></i>
+              <span>{{ nodeType.typeName }}</span>
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <!-- 中间画布区域 -->
+      <div
+        class="canvas-container"
+        ref="canvasContainer"
+        tabindex="0"
+        @drop="onDrop"
+        @dragover.prevent
+        @click="onCanvasClick"
+        @mousedown="onCanvasMouseDown"
+        @keydown.delete="handleDelete"
+        @keydown.backspace="handleDelete"
+      >
+        <svg class="canvas-svg" ref="canvasSvg" :width="canvasSize.width" :height="canvasSize.height"
+          :class="{ 'dragging-canvas': isDraggingCanvas }">
+          <!-- 网格背景 -->
+          <defs>
+            <pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse">
+              <path d="M 20 0 L 0 0 0 20" fill="none" stroke="#e0e0e0" stroke-width="0.5"/>
+            </pattern>
+          </defs>
+          <rect :width="canvasSize.width" :height="canvasSize.height" fill="url(#grid)" />
+
+          <!-- 连线 -->
+          <g class="edges-layer" :transform="`translate(${canvasOffset.x}, ${canvasOffset.y}) scale(${scale})`">
+            <g
+              v-for="edge in edges"
+              :key="edge.edgeKey"
+              class="edge-group"
+              @click.stop="selectEdge(edge)"
+            >
+              <path
+                :d="getEdgePath(edge)"
+                :stroke="edge.edgeColor || '#999'"
+                stroke-width="2"
+                fill="none"
+                :class="{ selected: selectedEdge === edge }"
+              />
+              <text
+                v-if="edge.edgeLabel"
+                :x="getEdgeLabelPos(edge).x"
+                :y="getEdgeLabelPos(edge).y"
+                text-anchor="middle"
+                font-size="12"
+                fill="#666"
+              >{{ edge.edgeLabel }}</text>
+            </g>
+          </g>
+
+          <!-- 临时连线 -->
+          <g :transform="`translate(${canvasOffset.x}, ${canvasOffset.y}) scale(${scale})`">
+            <path
+              v-if="tempEdge"
+              :d="tempEdge.path"
+              stroke="#1890ff"
+              stroke-width="2"
+              fill="none"
+              stroke-dasharray="5,5"
+            />
+          </g>
+
+          <!-- 节点 -->
+          <g class="nodes-layer" :transform="`translate(${canvasOffset.x}, ${canvasOffset.y}) scale(${scale})`">
+            <g
+              v-for="node in nodes"
+              :key="node.nodeKey"
+              class="node-group"
+              :transform="`translate(${node.posX}, ${node.posY})`"
+              @mousedown="onNodeMouseDown($event, node)"
+              @click.stop="selectNode(node)"
+            >
+              <rect
+                :width="nodeWidth"
+                :height="node.height || 36"
+                rx="6"
+                ry="6"
+                :fill="getNodeBgColor(node)"
+                :stroke="node.nodeColor || '#1890ff'"
+                stroke-width="2"
+                :class="{ selected: selectedNode === node }"
+              />
+              <foreignObject :width="nodeWidth" :height="node.height || 36">
+                <div class="node-content" xmlns="http://www.w3.org/1999/xhtml" :title="node.nodeName">
+                  <i :class="node.nodeIcon" :style="{ color: node.nodeColor }"></i>
+                  <span class="node-name">{{ node.nodeName }}</span>
+                </div>
+              </foreignObject>
+              <!-- 连接点 -->
+              <circle :cx="nodeWidth / 2" cy="0" r="5" fill="#fff" stroke="#1890ff" stroke-width="2"
+                class="anchor top" @mousedown.stop="startConnect($event, node, 'top')" />
+              <circle :cx="nodeWidth / 2" :cy="node.height || 36" r="5" fill="#fff" stroke="#1890ff" stroke-width="2"
+                class="anchor bottom" @mousedown.stop="startConnect($event, node, 'bottom')" />
+              <circle cx="0" :cy="(node.height || 36) / 2" r="5" fill="#fff" stroke="#1890ff" stroke-width="2"
+                class="anchor left" @mousedown.stop="startConnect($event, node, 'left')" />
+              <circle :cx="nodeWidth" :cy="(node.height || 36) / 2" r="5" fill="#fff" stroke="#1890ff" stroke-width="2"
+                class="anchor right" @mousedown.stop="startConnect($event, node, 'right')" />
+            </g>
+          </g>
+        </svg>
+      </div>
+
+      <!-- 右侧属性面板 -->
+      <div class="property-panel" v-if="selectedNode || selectedEdge">
+        <div class="panel-title">
+          {{ selectedNode ? '节点属性' : '连线属性' }}
+          <i class="el-icon-close" @click="clearSelection"></i>
+        </div>
+
+        <!-- 节点属性 -->
+        <el-form v-if="selectedNode" label-width="80px" size="small">
+          <el-form-item label="节点内容">
+            <el-input
+              v-model="selectedNode.nodeName"
+              type="textarea"
+              :autosize="{ minRows: 1, maxRows: 6 }"
+            />
+          </el-form-item>
+          <div v-if="selectedNode.nodeType == 'http'">
+            <el-form-item label="URL地址">
+              <el-input v-model="selectedNode.nodeConfig.url" />
+            </el-form-item>
+          </div>
+          <el-form-item label="节点类型">
+            <el-input :value="getNodeTypeName(selectedNode.nodeType)" disabled />
+          </el-form-item>
+          <el-form-item label="节点颜色">
+            <el-color-picker v-model="selectedNode.nodeColor" />
+          </el-form-item>
+          <el-form-item label="X坐标">
+            <el-input-number v-model="selectedNode.posX" :min="0" />
+          </el-form-item>
+          <el-form-item label="Y坐标">
+            <el-input-number v-model="selectedNode.posY" :min="0" />
+          </el-form-item>
+          <el-form-item>
+            <el-button type="danger" size="mini" @click="deleteNode">删除节点</el-button>
+          </el-form-item>
+        </el-form>
+
+        <!-- 连线属性 -->
+        <el-form v-if="selectedEdge" label-width="80px" size="small">
+          <el-form-item label="连线标签">
+            <el-input v-model="selectedEdge.edgeLabel" />
+          </el-form-item>
+          <el-form-item label="连线颜色">
+            <el-color-picker v-model="selectedEdge.edgeColor" />
+          </el-form-item>
+          <el-form-item label="条件表达式">
+            <el-input v-model="selectedEdge.conditionExpr" type="textarea" :rows="3" />
+          </el-form-item>
+          <el-form-item>
+            <el-button type="danger" size="mini" @click="deleteEdge">删除连线</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getWorkflow, addWorkflow, updateWorkflow, getNodeTypes } from '@/api/company/companyWorkflow'
+
+export default {
+  name: 'WorkflowDesign',
+  data() {
+    return {
+      // 工作流ID
+      workflowId: null,
+      // 表单数据
+      form: {
+        workflowName: '新建工作流',
+        workflowDesc: '',
+        workflowType: '1',
+        canvasData: ''
+      },
+      // 节点列表
+      nodes: [],
+      // 连线列表
+      edges: [],
+      // 节点类型列表
+      nodeTypes: [],
+      // 节点分类
+      nodeCategories: [],
+      // 选中的节点
+      selectedNode: null,
+      // 选中的连线
+      selectedEdge: null,
+      // 缩放比例
+      scale: 1,
+      // 画布偏移
+      canvasOffset: { x: 0, y: 0 },
+      // 拖拽中的节点
+      draggingNode: null,
+      // 拖拽偏移
+      dragOffset: { x: 0, y: 0 },
+      // 是否正在连线
+      connecting: false,
+      // 连线起点
+      connectStart: null,
+      // 临时连线
+      tempEdge: null,
+      // 画布尺寸
+      canvasSize: { width: 2000, height: 2000 },
+      // 节点固定宽度
+      nodeWidth: 120,
+      // 是否正在拖动画布
+      isDraggingCanvas: false,
+      // 画布拖动起始点
+      canvasDragStart: { x: 0, y: 0 },
+      // 工作流类型字典
+      workflowTypeOptions: [
+        { dictValue: '1', dictLabel: '对话流程' },
+        { dictValue: '2', dictLabel: '任务流程' },
+        { dictValue: '3', dictLabel: '审批流程' }
+      ]
+    }
+  },
+  created() {
+    this.workflowId = this.$route.params.id
+    this.loadNodeTypes()
+    if (this.workflowId) {
+      this.loadWorkflow()
+    }
+  },
+  mounted() {
+    // 确保容器可获取焦点
+    this.$nextTick(() => {
+      this.$refs.canvasContainer.focus()  // 这里应该是 canvasContainer 不是 container
+    })
+
+    // 添加全局键盘事件监听
+    // window.addEventListener('keydown', this.handleGlobalKeydown)
+    document.addEventListener('mousemove', this.onMouseMove)
+    document.addEventListener('mouseup', this.onMouseUp)
+  },
+  beforeDestroy() {
+    // window.removeEventListener('keydown', this.handleGlobalKeydown)
+    document.removeEventListener('mousemove', this.onMouseMove)
+    document.removeEventListener('mouseup', this.onMouseUp)
+  },
+  methods: {
+    // 聚焦画布容器
+    focusCanvasContainer() {
+      this.$refs.canvasContainer.focus()
+    },
+
+    // 点击画布时聚焦
+    onCanvasClick() {
+      this.clearSelection()
+      this.focusCanvasContainer()
+    },
+
+    // 点击节点时聚焦
+    selectNode(node) {
+      this.selectedNode = node
+      this.selectedNode.nodeConfig = JSON.parse(node.nodeConfig)
+      this.selectedEdge = null
+      this.focusCanvasContainer()
+    },
+
+    // 点击连线时聚焦
+    selectEdge(edge) {
+      this.selectedEdge = edge
+      this.selectedNode = null
+      this.focusCanvasContainer()
+    },
+
+    // 局部键盘事件
+    handleDelete(event) {
+      event.preventDefault() // 阻止默认行为(如浏览器后退)
+      this.deleteSelected()
+    },
+
+    // 全局键盘事件
+    // handleGlobalKeydown(event) {
+    //   // 检查是否按下了退格键或删除键
+    //   if ((event.key === 'Backspace' || event.key === 'Delete') && !this.isInputFocused()) {
+    //     event.preventDefault()
+    //     this.deleteSelected()
+    //   }
+    // },
+
+    // 删除选中项的逻辑
+    deleteSelected() {
+      if (this.selectedNode) {
+        this.deleteSelectedNode()
+      } else if (this.selectedEdge) {
+        this.deleteSelectedEdge()
+      }
+    },
+
+    // 删除选中节点
+    deleteSelectedNode() {
+      if (!this.selectedNode) return
+      // 确认对话框
+      this.$confirm('是否确认删除该节点?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        const key = this.selectedNode.nodeKey
+        this.nodes = this.nodes.filter(n => n.nodeKey !== key)
+        // 同时删除与该节点相关的连线
+        this.edges = this.edges.filter(e =>
+          e.sourceNodeKey !== key && e.targetNodeKey !== key)
+        this.selectedNode = null
+      }).catch(() => {})
+    },
+
+    // 删除选中连线
+    deleteSelectedEdge() {
+      if (!this.selectedEdge) return
+
+      this.$confirm('是否确认删除该连线?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.edges = this.edges.filter(e => e.edgeKey !== this.selectedEdge.edgeKey)
+        this.selectedEdge = null
+      }).catch(() => {})
+    },
+
+    // 检查是否有输入框获得焦点
+    isInputFocused() {
+      const activeElement = document.activeElement
+      // 注意:节点名称输入框也需要排除
+      const isEditable = ['INPUT', 'TEXTAREA', 'SELECT'].includes(activeElement.tagName)
+      // 额外检查是否是节点名称输入框
+      const isNodeInput = activeElement.classList && activeElement.classList.contains('node-name-input')
+      return isEditable || isNodeInput
+    },
+
+    /** 加载节点类型 */
+    loadNodeTypes() {
+      getNodeTypes().then(res => {
+        this.nodeTypes = res.data || []
+        this.groupNodeTypes()
+      }).catch(() => {
+        // 如果接口未实现,使用默认节点类型
+        this.nodeTypes = [
+          { typeCode: 'start', typeName: '开始', typeCategory: 'basic', typeIcon: 'el-icon-video-play', typeColor: '#52c41a' },
+          { typeCode: 'end', typeName: '结束', typeCategory: 'basic', typeIcon: 'el-icon-video-pause', typeColor: '#ff4d4f' },
+          { typeCode: 'condition', typeName: '条件判断', typeCategory: 'logic', typeIcon: 'el-icon-question', typeColor: '#faad14' },
+          { typeCode: 'parallel', typeName: '并行网关', typeCategory: 'logic', typeIcon: 'el-icon-share', typeColor: '#722ed1' },
+          { typeCode: 'ai_chat', typeName: 'AI对话', typeCategory: 'ai', typeIcon: 'el-icon-chat-dot-round', typeColor: '#1890ff' },
+          { typeCode: 'ai_analysis', typeName: 'AI分析', typeCategory: 'ai', typeIcon: 'el-icon-data-analysis', typeColor: '#13c2c2' },
+          { typeCode: 'http', typeName: 'HTTP请求', typeCategory: 'integration', typeIcon: 'el-icon-link', typeColor: '#eb2f96' },
+          { typeCode: 'database', typeName: '数据库', typeCategory: 'integration', typeIcon: 'el-icon-coin', typeColor: '#fa8c16' }
+        ]
+        this.groupNodeTypes()
+      })
+    },
+    /** 节点类型分组 */
+    groupNodeTypes() {
+      const categoryMap = {
+        basic: { key: 'basic', name: '基础节点', types: [] },
+        logic: { key: 'logic', name: '逻辑节点', types: [] },
+        ai: { key: 'ai', name: 'AI节点', types: [] },
+        ai: { key: 'ai-cell', name: '外呼几点', types: [] },
+        integration: { key: 'integration', name: '集成节点', types: [] }
+      }
+      this.nodeTypes.forEach(t => {
+        const cat = categoryMap[t.typeCategory] || categoryMap.basic
+        cat.types.push(t)
+      })
+      this.nodeCategories = Object.values(categoryMap).filter(c => c.types.length > 0)
+    },
+    /** 加载工作流 */
+    loadWorkflow() {
+      getWorkflow(this.workflowId).then(res => {
+        const data = res.data
+        this.form = {
+          workflowName: data.workflowName,
+          workflowDesc: data.workflowDesc,
+          workflowType: String(data.workflowType),
+          canvasData: data.canvasData
+        }
+        this.nodes = data.nodes || []
+        this.edges = data.edges || []
+      })
+    },
+    /** 返回列表 */
+    goBack() {
+      this.$router.push('/company/companyWorkflow')
+    },
+    /** 放大 */
+    zoomIn() {
+      this.scale = Math.min(2, this.scale + 0.1)
+    },
+    /** 缩小 */
+    zoomOut() {
+      this.scale = Math.max(0.5, this.scale - 0.1)
+    },
+    /** 适应画布 */
+    fitView() {
+      this.scale = 1
+      this.canvasOffset = { x: 0, y: 0 }
+      this.focusCanvasContainer()
+    },
+    /** 生成唯一Key */
+    generateKey() {
+      return 'node_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9)
+    },
+    /** 拖拽开始 */
+    onDragStart(e, nodeType) {
+      e.dataTransfer.setData('nodeType', JSON.stringify(nodeType))
+    },
+    /** 放置节点 */
+    onDrop(e) {
+      const nodeTypeStr = e.dataTransfer.getData('nodeType')
+      if (!nodeTypeStr) return
+      const nodeType = JSON.parse(nodeTypeStr)
+      const rect = this.$refs.canvasContainer.getBoundingClientRect()
+      const x = (e.clientX - rect.left - this.canvasOffset.x) / this.scale
+      const y = (e.clientY - rect.top - this.canvasOffset.y) / this.scale
+
+      const newNode = {
+        nodeKey: this.generateKey(),
+        nodeName: nodeType.typeName,
+        nodeType: nodeType.typeCode,
+        nodeIcon: nodeType.typeIcon,
+        nodeColor: nodeType.typeColor,
+        posX: Math.round(x - 50),
+        posY: Math.round(y - 20),
+        height: 40,
+        nodeConfig: nodeType.defaultConfig || '{}'
+      }
+      this.nodes.push(newNode)
+      this.selectNode(newNode)
+      this.focusCanvasContainer()
+      // 检测并扩展画布
+      this.checkAndExpandCanvas(newNode)
+    },
+
+    /** 画布鼠标按下 */
+    onCanvasMouseDown(e) {
+      // 只响应左键且点击在空白区域
+      if (e.button !== 0) return
+      if (e.target.tagName === 'rect' && e.target.getAttribute('fill') === 'url(#grid)') {
+        this.isDraggingCanvas = true
+        this.canvasDragStart = {
+          x: e.clientX,
+          y: e.clientY,
+          scrollLeft: this.$refs.canvasContainer.scrollLeft,
+          scrollTop: this.$refs.canvasContainer.scrollTop
+        }
+        e.preventDefault()
+      }
+    },
+
+    /** 清除选中 */
+    clearSelection() {
+      this.selectedNode = null
+      this.selectedEdge = null
+    },
+    /** 节点鼠标按下 */
+    onNodeMouseDown(e, node) {
+      if (e.target.classList.contains('anchor')) return
+      this.draggingNode = node
+      const rect = this.$refs.canvasContainer.getBoundingClientRect()
+      const scrollLeft = this.$refs.canvasContainer.scrollLeft
+      const scrollTop = this.$refs.canvasContainer.scrollTop
+      this.dragOffset = {
+        x: (e.clientX - rect.left + scrollLeft - this.canvasOffset.x) / this.scale - node.posX,
+        y: (e.clientY - rect.top + scrollTop - this.canvasOffset.y) / this.scale - node.posY
+      }
+      this.selectNode(node)
+    },
+    /** 鼠标移动 */
+    onMouseMove(e) {
+      // 拖动画布
+      if (this.isDraggingCanvas) {
+        const dx = e.clientX - this.canvasDragStart.x
+        const dy = e.clientY - this.canvasDragStart.y
+        this.$refs.canvasContainer.scrollLeft = this.canvasDragStart.scrollLeft - dx
+        this.$refs.canvasContainer.scrollTop = this.canvasDragStart.scrollTop - dy
+        return
+      }
+      // 拖动节点
+      if (this.draggingNode) {
+        const rect = this.$refs.canvasContainer.getBoundingClientRect()
+        const scrollLeft = this.$refs.canvasContainer.scrollLeft
+        const scrollTop = this.$refs.canvasContainer.scrollTop
+        const x = (e.clientX - rect.left + scrollLeft - this.canvasOffset.x) / this.scale - this.dragOffset.x
+        const y = (e.clientY - rect.top + scrollTop - this.canvasOffset.y) / this.scale - this.dragOffset.y
+        this.draggingNode.posX = Math.max(0, Math.round(x))
+        this.draggingNode.posY = Math.max(0, Math.round(y))
+        // 检测并扩展画布
+        this.checkAndExpandCanvas(this.draggingNode)
+      }
+      // 连线
+      if (this.connecting && this.connectStart) {
+        const rect = this.$refs.canvasContainer.getBoundingClientRect()
+        const scrollLeft = this.$refs.canvasContainer.scrollLeft
+        const scrollTop = this.$refs.canvasContainer.scrollTop
+        const endX = (e.clientX - rect.left + scrollLeft - this.canvasOffset.x) / this.scale
+        const endY = (e.clientY - rect.top + scrollTop - this.canvasOffset.y) / this.scale
+        this.tempEdge = {
+          path: this.calcPath(this.connectStart.x, this.connectStart.y, endX, endY)
+        }
+      }
+    },
+    /** 检测并扩展画布 */
+    checkAndExpandCanvas(node) {
+      const nodeHeight = node.height || 36
+      const padding = 200 // 边缘预留空间
+      const expandStep = 500 // 每次扩展的大小
+
+      const nodeRight = node.posX + this.nodeWidth
+      const nodeBottom = node.posY + nodeHeight
+
+      // 检测右边缘
+      if (nodeRight + padding > this.canvasSize.width) {
+        this.canvasSize.width += expandStep
+      }
+      // 检测下边缘
+      if (nodeBottom + padding > this.canvasSize.height) {
+        this.canvasSize.height += expandStep
+      }
+    },
+    /** 鼠标松开 */
+    onMouseUp(e) {
+      // 停止拖动画布
+      if (this.isDraggingCanvas) {
+        this.isDraggingCanvas = false
+        this.focusCanvasContainer()
+        return
+      }
+      // 停止连线
+      if (this.connecting) {
+        const targetNode = this.findNodeAtPoint(e.clientX, e.clientY)
+        if (targetNode && targetNode.nodeKey !== this.connectStart.nodeKey) {
+          this.createEdge(this.connectStart.nodeKey, targetNode.nodeKey,
+            this.connectStart.anchor, 'top')
+        }
+        this.connecting = false
+        this.connectStart = null
+        this.tempEdge = null
+      }
+      this.draggingNode = null
+    },
+    /** 开始连线 */
+    startConnect(e, node, anchor) {
+      this.connecting = true
+      const anchorPos = this.getAnchorPos(node, anchor)
+      this.connectStart = {
+        nodeKey: node.nodeKey,
+        anchor: anchor,
+        x: anchorPos.x,
+        y: anchorPos.y
+      }
+      this.selectNode(node)
+    },
+    /** 获取锚点位置 */
+    getAnchorPos(node, anchor) {
+      const w = this.nodeWidth
+      const h = node.height || 36
+      switch (anchor) {
+        case 'top': return { x: node.posX + w / 2, y: node.posY }
+        case 'bottom': return { x: node.posX + w / 2, y: node.posY + h }
+        case 'left': return { x: node.posX, y: node.posY + h / 2 }
+        case 'right': return { x: node.posX + w, y: node.posY + h / 2 }
+        default: return { x: node.posX + w / 2, y: node.posY + h }
+      }
+    },
+    /** 查找点击位置的节点 */
+    findNodeAtPoint(clientX, clientY) {
+      const rect = this.$refs.canvasContainer.getBoundingClientRect()
+      const scrollLeft = this.$refs.canvasContainer.scrollLeft
+      const scrollTop = this.$refs.canvasContainer.scrollTop
+      const x = (clientX - rect.left + scrollLeft - this.canvasOffset.x) / this.scale
+      const y = (clientY - rect.top + scrollTop - this.canvasOffset.y) / this.scale
+      return this.nodes.find(n => {
+        const w = this.nodeWidth
+        const h = n.height || 36
+        return x >= n.posX && x <= n.posX + w && y >= n.posY && y <= n.posY + h
+      })
+    },
+    /** 创建连线 */
+    createEdge(sourceKey, targetKey, sourceAnchor, targetAnchor) {
+      const exists = this.edges.find(e =>
+        e.sourceNodeKey === sourceKey && e.targetNodeKey === targetKey)
+      if (exists) return
+
+      this.edges.push({
+        edgeKey: 'edge_' + Date.now(),
+        sourceNodeKey: sourceKey,
+        targetNodeKey: targetKey,
+        sourceAnchor: sourceAnchor,
+        targetAnchor: targetAnchor,
+        edgeType: 'smoothstep',
+        edgeColor: '#999999'
+      })
+    },
+    /** 获取连线路径 */
+    getEdgePath(edge) {
+      const sourceNode = this.nodes.find(n => n.nodeKey === edge.sourceNodeKey)
+      const targetNode = this.nodes.find(n => n.nodeKey === edge.targetNodeKey)
+      if (!sourceNode || !targetNode) return ''
+
+      const start = this.getAnchorPos(sourceNode, edge.sourceAnchor || 'bottom')
+      const end = this.getAnchorPos(targetNode, edge.targetAnchor || 'top')
+      return this.calcPath(start.x, start.y, end.x, end.y)
+    },
+    /** 计算贝塞尔曲线路径 */
+    calcPath(x1, y1, x2, y2) {
+      const midY = (y1 + y2) / 2
+      return `M ${x1} ${y1} C ${x1} ${midY}, ${x2} ${midY}, ${x2} ${y2}`
+    },
+    /** 获取连线标签位置 */
+    getEdgeLabelPos(edge) {
+      const sourceNode = this.nodes.find(n => n.nodeKey === edge.sourceNodeKey)
+      const targetNode = this.nodes.find(n => n.nodeKey === edge.targetNodeKey)
+      if (!sourceNode || !targetNode) return { x: 0, y: 0 }
+      const start = this.getAnchorPos(sourceNode, edge.sourceAnchor || 'bottom')
+      const end = this.getAnchorPos(targetNode, edge.targetAnchor || 'top')
+      return { x: (start.x + end.x) / 2, y: (start.y + end.y) / 2 }
+    },
+    /** 获取节点背景色 */
+    getNodeBgColor(node) {
+      const color = node.nodeColor || '#1890ff'
+      return color + '15'
+    },
+
+    /** 获取节点类型名称 */
+    getNodeTypeName(typeCode) {
+      const t = this.nodeTypes.find(n => n.typeCode === typeCode)
+      return t ? t.typeName : typeCode
+    },
+    /** 删除节点(按钮触发) */
+    deleteNode() {
+      this.deleteSelectedNode()
+    },
+    /** 删除连线(按钮触发) */
+    deleteEdge() {
+      this.deleteSelectedEdge()
+    },
+    /** 保存工作流 */
+    handleSave() {
+      if (!this.form.workflowName) {
+        this.msgWarning('请输入工作流名称')
+        return
+      }
+      const nodes = JSON.parse(JSON.stringify(this.nodes))
+      nodes.filter(node => typeof node.nodeConfig == 'object').forEach(node => {
+        console.log(typeof node.nodeConfig)
+        node.nodeConfig = JSON.stringify(node.nodeConfig);
+      })
+      const data = {
+        workflowId: this.workflowId,
+        workflowName: this.form.workflowName,
+        workflowDesc: this.form.workflowDesc,
+        workflowType: this.form.workflowType,
+        canvasData: JSON.stringify({ scale: this.scale, offset: this.canvasOffset }),
+        nodes: nodes,
+        edges: this.edges
+      }
+
+      if (this.workflowId) {
+        updateWorkflow(data).then(() => {
+          this.msgSuccess('保存成功')
+        })
+      } else {
+        addWorkflow(data).then(res => {
+          this.msgSuccess('保存成功')
+          this.workflowId = res.data
+          this.$router.replace('/company/companyWorkflow/design/' + this.workflowId)
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+@import './design.scss';
+</style>

+ 499 - 0
src/views/company/companyWorkflow/index.vue

@@ -0,0 +1,499 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
+      <el-form-item label="工作流名称" prop="workflowName">
+        <el-input
+          v-model="queryParams.workflowName"
+          placeholder="请输入工作流名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="工作流类型" prop="workflowType">
+        <el-select v-model="queryParams.workflowType" placeholder="请选择类型" clearable size="small">
+          <el-option
+            v-for="dict in workflowTypeOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
+          <el-option
+            v-for="dict in statusOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['company:companyWorkflow:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['company:companyWorkflow:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['company:companyWorkflow:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" border :data="workflowList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="ID" align="center" prop="workflowId" width="80" />
+      <el-table-column label="工作流名称" align="center" prop="workflowName" min-width="150" show-overflow-tooltip />
+      <el-table-column label="描述" align="center" prop="workflowDesc" min-width="200" show-overflow-tooltip />
+      <el-table-column label="类型" align="center" prop="workflowType" width="100">
+        <template slot-scope="scope">
+          <dict-tag :options="workflowTypeOptions" :value="scope.row.workflowType"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" align="center" prop="status" width="80">
+        <template slot-scope="scope">
+          <el-switch
+            v-model="scope.row.status"
+            :active-value="1"
+            :inactive-value="0"
+            @change="handleStatusChange(scope.row)"
+          />
+        </template>
+      </el-table-column>
+      <el-table-column label="版本" align="center" prop="version" width="60" />
+      <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-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="200">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleEdit(scope.row)"
+            v-hasPermi="['company:companyWorkflow:edit']"
+          >设计</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-user"
+            @click="handleBindSales(scope.row)"
+          >绑定销售</el-button>
+          <el-button
+            size="mini"
+            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>
+    </el-table>
+
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 绑定销售弹窗 -->
+    <el-dialog title="绑定销售" :visible.sync="bindSalesOpen" width="500px" append-to-body>
+      <!-- 当前绑定的销售 -->
+      <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" 
+            type="success"
+            style="margin-right: 8px; margin-bottom: 8px;"
+          >
+            {{ user.userName || user.user_name }}({{ user.nickName || user.nick_name }})
+          </el-tag>
+        </div>
+        <div v-else class="no-bind">
+          <el-tag type="info">暂未绑定销售</el-tag>
+        </div>
+      </div>
+
+      <!-- 可选销售列表 -->
+      <div class="sales-list">
+        <div class="section-title">选择销售</div>
+        <el-input
+          v-model="salesSearchKey"
+          placeholder="搜索昵称"
+          size="small"
+          prefix-icon="el-icon-search"
+          clearable
+          style="margin-bottom: 10px"
+        />
+        <el-table
+          :data="filteredCompanyUserList"
+          v-loading="salesLoading"
+          border
+          height="300"
+          :row-key="getSalesRowKey"
+          :row-class-name="salesRowClassName"
+          @selection-change="handleSalesSelectionChange"
+          ref="salesTable"
+        >
+          <el-table-column type="selection" width="55" align="center" :selectable="checkSelectable" :reserve-selection="true" />
+          <el-table-column label="用户名" align="center" prop="userName" />
+          <el-table-column label="昵称" align="center" prop="nickName" />
+        </el-table>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="handleBindSalesCancel">取 消</el-button>
+        <el-button type="primary" :disabled="selectedSalesList.length === 0" @click="confirmBindSales">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listWorkflow, delWorkflow, updateWorkflowStatus, copyWorkflow, exportWorkflow, getBindCompanyUserByWorkflowId, listCompanyUser, updateWorkflowBindCompanyUser } from '@/api/company/companyWorkflow'
+
+export default {
+  name: 'CompanyWorkflow',
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 工作流表格数据
+      workflowList: [],
+      // 工作流类型字典
+      workflowTypeOptions: [
+        { dictValue: '1', dictLabel: '对话流程' },
+        { dictValue: '2', dictLabel: '任务流程' },
+        { dictValue: '3', dictLabel: '审批流程' }
+      ],
+      // 状态字典
+      statusOptions: [
+        { dictValue: '1', dictLabel: '启用' },
+        { dictValue: '0', dictLabel: '禁用' }
+      ],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        workflowName: null,
+        workflowType: null,
+        status: null
+      },
+      // 绑定销售弹窗
+      bindSalesOpen: false,
+      // 销售列表加载
+      salesLoading: false,
+      // 当前操作的工作流
+      currentWorkflow: null,
+      // 当前绑定的用户列表
+      currentBindUserList: [],
+      // 销售列表
+      companyUserList: [],
+      // 选中的销售列表
+      selectedSalesList: [],
+      // 销售搜索关键字
+      salesSearchKey: ''
+    }
+  },
+  computed: {
+    // 过滤后的销售列表
+    filteredCompanyUserList() {
+      if (!this.salesSearchKey) {
+        return this.companyUserList
+      }
+      const key = this.salesSearchKey.toLowerCase()
+      return this.companyUserList.filter(item => {
+        return (item.nickName && item.nickName.toLowerCase().includes(key))
+      })
+    }
+  },
+  created() {
+    this.getList()
+    // 如果有字典配置,可以使用以下方式获取
+    // this.getDicts("ai_workflow_type").then(response => {
+    //   this.workflowTypeOptions = response.data
+    // })
+  },
+  methods: {
+    /** 查询工作流列表 */
+    getList() {
+      this.loading = true
+      listWorkflow(this.queryParams).then(response => {
+        this.workflowList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1
+      this.getList()
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm('queryForm')
+      this.handleQuery()
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.workflowId)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.$router.push('/company/companyWorkflow/design')
+    },
+    /** 设计按钮操作 */
+    handleEdit(row) {
+      this.$router.push('/company/companyWorkflow/design/' + row.workflowId)
+    },
+    /** 复制按钮操作 */
+    handleCopy(row) {
+      this.$confirm('是否确认复制该工作流?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        return copyWorkflow(row.workflowId)
+      }).then(() => {
+        this.getList()
+        this.msgSuccess('复制成功')
+      }).catch(() => {})
+    },
+    /** 状态修改 */
+    handleStatusChange(row) {
+      const text = row.status === 1 ? '启用' : '停用'
+      this.$confirm('确认要"' + text + '"该工作流吗?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        return updateWorkflowStatus(row.workflowId, row.status)
+      }).then(() => {
+        this.msgSuccess(text + '成功')
+      }).catch(() => {
+        row.status = row.status === 1 ? 0 : 1
+      })
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const workflowIds = row.workflowId || this.ids
+      this.$confirm('是否确认删除工作流编号为"' + workflowIds + '"的数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        return delWorkflow(workflowIds)
+      }).then(() => {
+        this.getList()
+        this.msgSuccess('删除成功')
+      }).catch(() => {})
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams
+      this.$confirm('是否确认导出所有工作流数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.exportLoading = true
+        return exportWorkflow(queryParams)
+      }).then(response => {
+        this.download(response.msg)
+        this.exportLoading = false
+      }).catch(() => {})
+    },
+    /** 绑定销售按钮操作 */
+    handleBindSales(row) {
+      this.currentWorkflow = row
+      this.currentBindUserList = []
+      this.selectedSalesList = []
+      this.salesSearchKey = ''
+      this.bindSalesOpen = true
+      this.salesLoading = true
+      console.log(11111)
+      // 获取当前绑定的销售列表
+      getBindCompanyUserByWorkflowId(row.workflowId).then(res => {
+        this.currentBindUserList = res.data.data || []
+      }).catch(() => {})
+      console.log(this.currentBindUserList)
+      // 获取销售列表
+      listCompanyUser().then(res => {
+        this.companyUserList = res.data || res.rows || []
+        this.salesLoading = false
+      }).catch(() => {
+        this.salesLoading = false
+      })
+    },
+    /** 销售勾选变化 */
+    handleSalesSelectionChange(selection) {
+      this.selectedSalesList = selection
+    },
+    /** 获取销售行key */
+    getSalesRowKey(row) {
+      return row.userId || row.companyUserId || row.id
+    },
+    /** 取消绑定销售弹窗 */
+    handleBindSalesCancel() {
+      this.bindSalesOpen = false
+      this.selectedSalesList = []
+      this.$refs.salesTable && this.$refs.salesTable.clearSelection()
+    },
+    /** 销售行样式 */
+    salesRowClassName({ row }) {
+      if (this.isCurrentBindUser(row)) {
+        return 'disabled-row'
+      }
+      return ''
+    },
+    /** 判断是否为当前绑定用户 */
+    isCurrentBindUser(row) {
+      if (!this.currentBindUserList || this.currentBindUserList.length === 0) {
+        return false
+      }
+      const rowUserId = row.userId || row.companyUserId || row.user_id
+      return this.currentBindUserList.some(user => {
+        const bindUserId = user.userId || user.companyUserId || user.user_id
+        return bindUserId == rowUserId
+      })
+    },
+    /** 检查是否可选 */
+    checkSelectable(row) {
+      return !this.isCurrentBindUser(row)
+    },
+    /** 确认绑定销售 */
+    confirmBindSales() {
+      if (this.selectedSalesList.length === 0) {
+        this.msgWarning('请选择要绑定的销售')
+        return
+      }
+
+      const workflowId = this.currentWorkflow.workflowId
+      const companyUserIds = this.selectedSalesList.map(item => item.userId || item.companyUserId)
+      
+      this.doBindSales(workflowId, companyUserIds)
+    },
+    /** 执行绑定销售 */
+    doBindSales(workflowId, companyUserIds) {
+      updateWorkflowBindCompanyUser({
+        workflowId: workflowId,
+        companyUserIds: companyUserIds
+      }).then(() => {
+        this.msgSuccess('绑定成功')
+        this.bindSalesOpen = false
+        this.getList()
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.current-sales {
+  margin-bottom: 20px;
+  padding-bottom: 15px;
+  border-bottom: 1px solid #eee;
+
+  .section-title {
+    font-weight: 600;
+    margin-bottom: 10px;
+    color: #333;
+  }
+
+  .bind-info {
+    .el-tag {
+      font-size: 14px;
+      padding: 8px 15px;
+      height: auto;
+      line-height: 1.5;
+      white-space: normal;
+    }
+  }
+
+  .no-bind {
+    .el-tag {
+      font-size: 14px;
+      padding: 8px 15px;
+      height: auto;
+    }
+  }
+}
+
+.sales-list {
+  .section-title {
+    font-weight: 600;
+    margin-bottom: 10px;
+    color: #333;
+  }
+}
+</style>
+
+<style lang="scss">
+.el-table .disabled-row {
+  background-color: #f5f5f5;
+  color: #999;
+  
+  &:hover > td {
+    background-color: #f5f5f5 !important;
+  }
+}
+</style>

+ 11 - 4
src/views/company/components/selectQwUser.vue

@@ -46,7 +46,7 @@
       @selection-change="handleSelectionChange"
     >
       <!-- 添加多选列 -->
-      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column type="selection" width="55" align="center" :selectable="checkSelectable" />
       <el-table-column label="企微昵称" align="center" prop="qwUserName" />
       <el-table-column label="企微账号" align="center" prop="qwUserId" />
       <el-table-column label="企微所属部门" align="center" prop="departmentName" />
@@ -129,6 +129,10 @@ export default {
     updateCorpId(){
       this.getList();
     },
+    // 检查是否可选择(状态不为1的用户才可选择)
+    checkSelectable(row, index) {
+      return row.status !== 1;
+    },
     /** 查询客户列表 */
     getList() {
       this.loading = true;
@@ -148,9 +152,10 @@ export default {
     // 设置预选中的项
     setPreSelectedItems() {
       if (this.preSelectedUserIds.length > 0 && this.customerList.length > 0) {
-        // 找到需要预选中的行
+        // 找到需要预选中的行,排除状态为1的用户
         const selectedRows = this.customerList.filter(row =>
-          this.preSelectedUserIds.includes(row.id)
+          this.preSelectedUserIds.includes(row.id) &&
+          row.status !== 1
         );
 
         // 设置选中状态
@@ -164,7 +169,9 @@ export default {
 
     // 多选处理
     handleSelectionChange(selection) {
-      this.selectedUsers = selection;
+      this.selectedUsers = selection.filter(item =>
+        item.status !== 1
+      );
     },
 
     // 批量绑定选择

+ 42 - 4
src/views/course/courseAnswerlogs/index.vue

@@ -134,7 +134,10 @@
       <el-table-column label="小节名称" align="center" prop="videoName" />
       <el-table-column label="是否全部正确" align="center" prop="isRight" >
         <template slot-scope="scope">
-          <dict-tag :options="sysCompanyOr" :value="scope.row.isRight"></dict-tag>
+            <dict-tag :options="sysCompanyOr" :value="scope.row.isRight" style="margin-bottom: 5px;"></dict-tag>
+            <el-button type="text" size="mini" @click="showContentDialog(scope.row.questionJson)">
+              查看详情
+            </el-button>
         </template>
       </el-table-column>
       <el-table-column label="销售名称" align="center" prop="companyUserName" />
@@ -151,13 +154,32 @@
       @pagination="getList"
     />
 
+    <el-dialog :visible.sync="contentDialog.isDialogVisible" title="消息详情" width="30%" append-to-body>
+      <div>
+        <div v-for="(item, index) in contentDialog.json || []" :key="index">
+          <el-card class="box-card" style="margin-top: 2%">
+            <div>题目:<span style="color: #0464f4">{{item.title}}</span></div>
+            <div>答题:<span style="color: #000000">{{item.answer}}</span></div>
+            <div>是否答题正确:
+              <span :style="{color: item.status === 1 ? 'green' : 'red'}">
+                {{ item.status === 1 ? '正确' : '错误' }}
+            </span>
+            </div>
+          </el-card>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="contentDialog.isDialogVisible = false">关闭</el-button>
+      </span>
+    </el-dialog>
+
   </div>
 </template>
 
 <script>
-import { listLogs, getLogs, delLogs, addLogs, updateLogs, exportLogs } from "@/api/course/courseAnswerlogs";
-import { courseList, videoList } from '@/api/course/courseRedPacketLog'
-import { getCompanyList } from '@/api/company/company'
+import {addLogs, delLogs, exportLogs, getLogs, listLogs, updateLogs} from "@/api/course/courseAnswerlogs";
+import {courseList, videoList} from '@/api/course/courseRedPacketLog'
+import {getCompanyList} from '@/api/company/company'
 
 export default {
   name: "Logs",
@@ -190,6 +212,13 @@ export default {
 
       // 答题日志表格数据
       logsList: [],
+
+      //发送的消息
+      contentDialog:{
+        isDialogVisible:false,
+        json: [],
+      },
+
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -258,6 +287,15 @@ export default {
       });
     },
 
+    showContentDialog(questionJson){
+      // 解析 JSON 字符串为 JavaScript 对象
+      // 替换非法换行符等控制字符
+      const sanitizedJson = questionJson.replace(/[\u0000-\u001F\u007F]/g, '');
+      this.contentDialog.json = JSON.parse(sanitizedJson);
+
+      this.contentDialog.isDialogVisible = true;
+    },
+
     timeChange(){
       if(this.createTime!=null){
         this.queryParams.sTime=this.createTime[0];

+ 44 - 5
src/views/course/courseAnswerlogs/myCourseAnswerlogs.vue

@@ -125,7 +125,10 @@
       <el-table-column label="小节名称" align="center" prop="videoName" />
       <el-table-column label="是否全部正确" align="center" prop="isRight" >
         <template slot-scope="scope">
-          <dict-tag :options="sysCompanyOr" :value="scope.row.isRight"></dict-tag>
+            <dict-tag :options="sysCompanyOr" :value="scope.row.isRight" style="margin-bottom: 5px;"></dict-tag>
+            <el-button type="text" size="mini" @click="showContentDialog(scope.row.questionJson)">
+              查看详情
+            </el-button>
         </template>
       </el-table-column>
       <el-table-column label="销售名称" align="center" prop="companyUserName" />
@@ -142,14 +145,32 @@
       @pagination="getList"
     />
 
+    <el-dialog :visible.sync="contentDialog.isDialogVisible" title="消息详情" width="30%" append-to-body>
+      <div>
+        <div v-for="(item, index) in contentDialog.json || []" :key="index">
+          <el-card class="box-card" style="margin-top: 2%">
+            <div>题目:<span style="color: #0464f4">{{item.title}}</span></div>
+            <div>答题:<span style="color: #000000">{{item.answer}}</span></div>
+            <div>是否答题正确:
+              <span :style="{color: item.status === 1 ? 'green' : 'red'}">
+                {{ item.status === 1 ? '正确' : '错误' }}
+            </span>
+            </div>
+          </el-card>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="contentDialog.isDialogVisible = false">关闭</el-button>
+      </span>
+    </el-dialog>
+
+
   </div>
 </template>
 
 <script>
-import { myListLogs, getLogs, delLogs, addLogs, updateLogs, exportLogs, exportMyLogs } from "@/api/course/courseAnswerlogs";
-import { courseList, videoList } from '@/api/course/courseRedPacketLog'
-import {allListTagGroup} from "@/api/qw/tagGroup";
-import {listTag} from "@/api/qw/tag";
+import {addLogs, delLogs, exportMyLogs, getLogs, myListLogs, updateLogs} from "@/api/course/courseAnswerlogs";
+import {courseList, videoList} from '@/api/course/courseRedPacketLog'
 import {getMyQwUserList} from "@/api/qw/user";
 
 export default {
@@ -206,6 +227,13 @@ export default {
       createTime:null,
       // 表单参数
       form: {},
+
+      //发送的消息
+      contentDialog:{
+        isDialogVisible:false,
+        json: [],
+      },
+
       // 表单校验
       rules: {
       }
@@ -308,6 +336,17 @@ export default {
       this.queryParams.eTime=null;
       this.handleQuery();
     },
+
+    showContentDialog(questionJson){
+      // 解析 JSON 字符串为 JavaScript 对象
+      // 替换非法换行符等控制字符
+      const sanitizedJson = questionJson.replace(/[\u0000-\u001F\u007F]/g, '');
+      this.contentDialog.json = JSON.parse(sanitizedJson);
+
+      this.contentDialog.isDialogVisible = true;
+    },
+
+
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.logId)

+ 11 - 0
src/views/course/courseFinishTempParent/deptIndex.vue

@@ -1,6 +1,15 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="模板编号" prop="id">
+        <el-input
+          v-model="queryParams.id"
+          placeholder="请输入模板编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -75,6 +84,7 @@
 
     <el-table border v-loading="loading" :data="courseFinishTempParentList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="模板编号" align="center" prop="id" />
       <el-table-column label="名称" align="center" prop="name" />
       <el-table-column label="课程" align="center" prop="courseId">
         <template slot-scope="scope">
@@ -601,6 +611,7 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        id: null,
         name: null,
         courseId: null,
       },

+ 11 - 0
src/views/course/courseFinishTempParent/myIndex.vue

@@ -1,6 +1,15 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="模板编号" prop="id">
+        <el-input
+          v-model="queryParams.id"
+          placeholder="请输入模板编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item label="名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -75,6 +84,7 @@
 
     <el-table border v-loading="loading" :data="courseFinishTempParentList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="模板编号" align="center" prop="id" />
       <el-table-column label="名称" align="center" prop="name" />
       <el-table-column label="课程" align="center" prop="courseId">
         <template slot-scope="scope">
@@ -598,6 +608,7 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        id: null,
         name: null,
         courseId: null,
       },

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

@@ -49,6 +49,18 @@
         />
       </el-form-item>
 
+      <!--企微主体选择框 -->
+      <el-form-item label="企微主体" prop="corpId">
+        <el-select v-model="queryParams.corpId" placeholder="企微主体" size="small" @change="updateCorpId()" clearable>
+          <el-option
+            v-for="dict in myQwCompanyList"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+
       <el-form-item label="添加时间" prop="createTime">
         <el-date-picker
           v-model="createTime"
@@ -61,6 +73,18 @@
           end-placeholder="结束日期"
           @change="change"
         ></el-date-picker>
+      </el-form-item>
+       <el-form-item label="添加方式" prop="addWays" v-if="showCompanyField">
+        <el-select v-model="addWays" placeholder="请选择添加方式" size="small" multiple
+    collapse-tags
+    style="width: 100%;" clearable>
+          <el-option
+            v-for="dict in myAddWayList"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
       </el-form-item>
       <el-form-item>
         <el-button
@@ -346,6 +370,22 @@
           </span>
         </template>
       </el-table-column>
+
+      <!-- 重粉数 -->
+      <el-table-column label="重粉数" align="center" prop="repeatCount">
+        <template slot-scope="scope">
+          <span>{{ scope.row.repeatCount }}</span>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor((scope.row.repeatCount / scope.row.line) * 100),
+            }"
+          >
+            ({{ ((scope.row.repeatCount / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
     </el-table>
 
     <pagination-more
@@ -375,10 +415,12 @@ import { treeselect } from "@/api/company/companyDept";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import { getCompanyUserListLikeName } from "@/api/company/companyUser";
+import { getMyQwCompanyList } from '@/api/qw/user';
 import { getTask } from "@/api/common";
+import PaginationMore from "@/components/PaginationMore/index.vue";
 export default {
   name: "CourseWatchLog",
-  components: { Treeselect },
+  components: {PaginationMore, Treeselect },
   data() {
     return {
       activeName: "00",
@@ -433,14 +475,25 @@ export default {
         eTime: null,
         scheduleStartTime: null,
         scheduleEndTime: null,
+        corpId: null, // 企微主体ID
+        addWays:[],
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {},
       scheduleTime: null,
+      myQwCompanyList: [], // 存储企微主体选项列表
+      myAddWayList:[],
+      addWays:[],
     };
   },
+  computed: {
+    // 计算属性判断是否显示
+    showCompanyField() {
+      return process.env.VUE_APP_TITLE_INDEX === '恒春来';
+    },
+  },
   created() {
     courseList().then((response) => {
       this.courseLists = response.list;
@@ -449,10 +502,21 @@ export default {
     this.getDicts("sys_course_watch_log_type").then((response) => {
       this.logTypeOptions = response.data;
     });
+    this.getDicts("sys_qw_externalContact_addWay").then((response) => {
+      this.myAddWayList = response.data;
+    });
     this.getTreeselect();
     this.getList();
+    // --- 获取企微主体列表 ---
+    getMyQwCompanyList().then(response => {
+      this.myQwCompanyList = response.data;
+    });
   },
   methods: {
+    updateCorpId() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
     getSummaries(param) {
       let totalNum = 0;
       const { columns, data } = param;
@@ -627,6 +691,9 @@ export default {
         this.$message.warning("请选择添加时间");
         return;
       }
+      if( this.addWays.length>0){
+        this.queryParams.addWays = this.addWays.join(',');
+      }
       this.queryParams.pageNum = 1;
       this.getList();
     },
@@ -639,6 +706,9 @@ export default {
       this.queryParams.eTime = null;
       this.queryParams.scheduleStartTime = null;
       this.queryParams.scheduleEndTime = null;
+      this.queryParams.corpId = null; // 重置企微主体选择
+      this.queryParams.addWays = [];
+      this.addWays = [];
       this.handleQuery();
     },
     // 多选框选中数据

+ 100 - 19
src/views/course/courseWatchLog/deptWatchLog.vue

@@ -1,6 +1,17 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="部门" prop="deptId">
+        <treeselect style="width: 220px" :clearable="false"  v-model="queryParams.deptId"  :options="deptOptions" clearable :show-count="true" placeholder="仅显示销售所在部门层级"  />
+      </el-form-item>
+      <el-form-item label="记录编号" prop="logId">
+        <el-input
+          v-model="queryParams.logId"
+          placeholder="请输入记录编号"
+          clearable
+          size="small"
+        />
+      </el-form-item>
       <el-form-item label="看课方式" prop="sendType">
         <el-select v-model="queryParams.sendType" placeholder="选择看课方式"  clearable size="small" @change="handleSendTypeChange">
           <el-option
@@ -204,16 +215,16 @@
         />
       </el-form-item> -->
        <el-form-item label="最新更新时间" prop="updateTime">
-        <el-date-picker
-          v-model="updateTimeText"
-          type="daterange"
-          range-separator="至"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          value-format="yyyy-MM-dd"
-          style="width: 240px"
+         <el-date-picker
+           v-model="updateTimeText"
+           type="datetimerange"
+           range-separator="至"
+           start-placeholder="开始日期"
+           end-placeholder="结束日期"
+           value-format="yyyy-MM-dd HH:mm:ss"
            @change="updateChange"
-        />
+           :default-time="['00:00:00', '23:59:59']"
+         />
       </el-form-item>
       <!-- 进线时间 -->
       <!-- <el-form-item label="进线时间" prop="qecCreateTime">
@@ -261,6 +272,22 @@
         </el-date-picker>
       </el-form-item>
 
+      <!-- 记录类型 - 仅在全部选项卡时显示 -->
+      <el-form-item label="记录类型" prop="logType" v-if="activeName === '00'">
+        <el-select
+          v-model="queryParams.logType"
+          placeholder="请选择记录类型"
+          clearable
+          size="small"
+          filterable>
+          <el-option
+            v-for="dict in logTypeOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -384,11 +411,12 @@
         <el-table-column label="课程名称" align="center" prop="courseName"/>
         <el-table-column label="小节名称" align="center" prop="videoName"/>
         <el-table-column label="是否全部正确" align="center" prop="isRightText"/>
-<!--        <el-table-column label="是否全部正确" align="center" prop="isRight">-->
-<!--          <template slot-scope="scope">-->
-<!--            <dict-tag :options="sysCompanyOr" :value="scope.row.isRight"></dict-tag>-->
-<!--          </template>-->
-<!--        </el-table-column>-->
+        <template slot-scope="scope">
+          <dict-tag :options="sysCompanyOr" :value="scope.row.isRight" style="margin-bottom: 5px;"></dict-tag>
+          <el-button type="text" size="mini" @click="showContentDialog(scope.row.questionJson)">
+            查看详情
+          </el-button>
+        </template>
         <el-table-column label="销售名称" align="center" prop="companyUserName"/>
         <el-table-column label="企微员工名称" align="center" prop="qwUserName"/>
         <el-table-column label="公司名称" align="center" prop="companyName"/>
@@ -460,24 +488,56 @@
       />
     </el-drawer>
 
+
+    <el-dialog :visible.sync="contentDialog.isDialogVisible" title="消息详情" width="30%" append-to-body>
+      <div>
+        <div v-for="(item, index) in contentDialog.json || []" :key="index">
+          <el-card class="box-card" style="margin-top: 2%">
+            <div>题目:<span style="color: #0464f4">{{item.title}}</span></div>
+            <div>答题:<span style="color: #000000">{{item.answer}}</span></div>
+            <div>是否答题正确:
+              <span :style="{color: item.status === 1 ? 'green' : 'red'}">
+                {{ item.status === 1 ? '正确' : '错误' }}
+            </span>
+            </div>
+          </el-card>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="contentDialog.isDialogVisible = false">关闭</el-button>
+      </span>
+    </el-dialog>
+
+
   </div>
 </template>
 
 <script>
-import { deptListCourseWatchLog, getCourseWatchLog, delCourseWatchLog, addCourseWatchLog, updateCourseWatchLog, exportCourseWatchLog } from "@/api/course/courseWatchLog";
+import {
+  addCourseWatchLog,
+  delCourseWatchLog,
+  deptListCourseWatchLog,
+  exportCourseWatchLog,
+  getCourseWatchLog,
+  updateCourseWatchLog
+} from "@/api/course/courseWatchLog";
 import {courseList, myListCourseRedPacketLog, videoList} from '@/api/course/courseRedPacketLog'
 import {myListLogs} from "@/api/course/courseAnswerlogs";
-import { getCompanyUserListLikeName } from "@/api/company/companyUser";
+import {getCompanyUserListLikeName} from "@/api/company/companyUser";
 import {getTask} from "@/api/common";
 import Vue from 'vue'
 import Calendar from 'vue-mobile-calendar'
 import {infoSop} from "@/api/qw/sop";
-import {getMyQwUserList} from "@/api/qw/user";
+import {myDeptTreeselect} from "../../../api/company/companyDept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
 Vue.use(Calendar)
 
 
 export default {
   name: "CourseWatchLog",
+  components: {Treeselect},
   data() {
     return {
       companyName:process.env.VUE_APP_COURSE_COMPANY_NAME,
@@ -515,11 +575,18 @@ export default {
       showUpdateCalendar: false,
       showQecCalendar: false,
 
-
+      deptOptions:[],
       activeName:"00",
       courseLists:[],
       videoList:[],
       logTypeOptions:[],
+
+      //发送的消息
+      contentDialog:{
+        isDialogVisible:false,
+        json: [],
+      },
+
       // 遮罩层
       loading: true,
       // 导出遮罩层
@@ -580,6 +647,7 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        logId: null,
         userId: null,
         nickName: null,
         videoId: null,
@@ -628,7 +696,9 @@ export default {
     courseList().then(response => {
       this.courseLists = response.list;
     });
-
+    myDeptTreeselect().then(response => {
+      this.deptOptions = response.data;
+    });
     this.getDicts("sys_course_watch_log_type").then(response => {
       this.logTypeOptions = response.data;
     });
@@ -641,6 +711,17 @@ export default {
     this.loading=false;
   },
   methods: {
+
+    showContentDialog(questionJson){
+      // 解析 JSON 字符串为 JavaScript 对象
+      // 替换非法换行符等控制字符
+      const sanitizedJson = questionJson.replace(/[\u0000-\u001F\u007F]/g, '');
+      this.contentDialog.json = JSON.parse(sanitizedJson);
+
+      this.contentDialog.isDialogVisible = true;
+    },
+
+
     setToday(){
       const today = new Date();
       const todayStart = new Date(today);

+ 140 - 38
src/views/course/courseWatchLog/index.vue

@@ -1,6 +1,14 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="记录编号" prop="logId">
+        <el-input
+          v-model="queryParams.logId"
+          placeholder="请输入记录编号"
+          clearable
+          size="small"
+        />
+      </el-form-item>
       <el-form-item label="看课方式" prop="sendType">
         <el-select v-model="queryParams.sendType" placeholder="选择看课方式"  clearable size="small" @change="handleSendTypeChange">
           <el-option
@@ -11,16 +19,16 @@
           />
         </el-select>
       </el-form-item>
-      <!--        <el-form-item label="项目" prop="project">-->
-      <!--          <el-select  v-model="queryParams.project" placeholder="请选择项目" clearable size="small" >-->
-      <!--            <el-option-->
-      <!--              v-for="item in projectOptions"-->
-      <!--              :key="item.dictValue"-->
-      <!--              :label="item.dictLabel"-->
-      <!--              :value="item.dictValue"-->
-      <!--            />-->
-      <!--          </el-select>-->
-      <!--        </el-form-item>-->
+<!--        <el-form-item label="项目" prop="project">-->
+<!--          <el-select  v-model="queryParams.project" placeholder="请选择项目" clearable size="small" >-->
+<!--            <el-option-->
+<!--              v-for="item in projectOptions"-->
+<!--              :key="item.dictValue"-->
+<!--              :label="item.dictLabel"-->
+<!--              :value="item.dictValue"-->
+<!--            />-->
+<!--          </el-select>-->
+<!--        </el-form-item>-->
       <el-form-item label="会员昵称" prop="nickName" v-if="queryParams.sendType == 1">
         <el-input
           v-model="queryParams.nickName"
@@ -238,17 +246,17 @@
           :key="updateCalendarKey"
         />
       </el-form-item> -->
-      <el-form-item label="最新更新时间" prop="updateTime">
-        <el-date-picker
-          v-model="updateTimeText"
-          type="daterange"
-          range-separator="至"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          value-format="yyyy-MM-dd"
-          style="width: 240px"
-          @change="updateChange"
-        />
+       <el-form-item label="最新更新时间" prop="updateTime">
+         <el-date-picker
+           v-model="updateTimeText"
+           type="datetimerange"
+           range-separator="至"
+           start-placeholder="开始日期"
+           end-placeholder="结束日期"
+           value-format="yyyy-MM-dd HH:mm:ss"
+           @change="updateChange"
+           :default-time="['00:00:00', '23:59:59']"
+         />
       </el-form-item>
       <!-- 进线时间 -->
       <!-- <el-form-item label="进线时间" prop="qecCreateTime">
@@ -296,21 +304,37 @@
         </el-date-picker>
       </el-form-item>
 
-      <!--      <el-form-item label="是否注册" prop="isVip">-->
-      <!--        <el-select-->
-      <!--          filterable-->
-      <!--          v-model="queryParams.isVip"-->
-      <!--          placeholder="请选择是否注册"-->
-      <!--          clearable size="small">-->
-      <!--          <el-option-->
-      <!--            v-for="dict in isVipList"-->
-      <!--            :key="dict.dictValue"-->
-      <!--            :label="dict.dictLabel"-->
-      <!--            :value="dict.dictValue"-->
-      <!--          />-->
-      <!--        </el-select>-->
-      <!--      </el-form-item>-->
-
+<!--      <el-form-item label="是否注册" prop="isVip">-->
+<!--        <el-select-->
+<!--          filterable-->
+<!--          v-model="queryParams.isVip"-->
+<!--          placeholder="请选择是否注册"-->
+<!--          clearable size="small">-->
+<!--          <el-option-->
+<!--            v-for="dict in isVipList"-->
+<!--            :key="dict.dictValue"-->
+<!--            :label="dict.dictLabel"-->
+<!--            :value="dict.dictValue"-->
+<!--          />-->
+<!--        </el-select>-->
+<!--      </el-form-item>-->
+
+      <!-- 记录类型 - 仅在全部选项卡时显示 -->
+      <el-form-item label="记录类型" prop="logType" v-if="activeName === '00'">
+        <el-select
+          v-model="queryParams.logType"
+          placeholder="请选择记录类型"
+          clearable
+          size="small"
+          filterable>
+          <el-option
+            v-for="dict in logTypeOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -481,7 +505,10 @@
         <el-table-column label="小节名称" align="center" prop="videoName"/>
         <el-table-column label="是否全部正确" align="center" prop="isRight">
           <template slot-scope="scope">
-            <dict-tag :options="sysCompanyOr" :value="scope.row.isRight"></dict-tag>
+            <dict-tag :options="sysCompanyOr" :value="scope.row.isRight" style="margin-bottom: 5px;"></dict-tag>
+            <el-button type="text" size="mini" @click="showContentDialog(scope.row.questionJson)">
+              查看详情
+            </el-button>
           </template>
         </el-table-column>
         <el-table-column label="销售名称" align="center" prop="companyUserName"/>
@@ -704,11 +731,38 @@
       </div>
     </el-dialog>
 
+    <el-dialog :visible.sync="contentDialog.isDialogVisible" title="消息详情" width="30%" append-to-body>
+      <div>
+        <div v-for="(item, index) in contentDialog.json || []" :key="index">
+          <el-card class="box-card" style="margin-top: 2%">
+            <div>题目:<span style="color: #0464f4">{{item.title}}</span></div>
+            <div>答题:<span style="color: #000000">{{item.answer}}</span></div>
+            <div>是否答题正确:
+              <span :style="{color: item.status === 1 ? 'green' : 'red'}">
+                {{ item.status === 1 ? '正确' : '错误' }}
+            </span>
+            </div>
+          </el-card>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="contentDialog.isDialogVisible = false">关闭</el-button>
+      </span>
+    </el-dialog>
+
   </div>
 </template>
 
 <script>
-import { listCourseWatchLog, getCourseWatchLog, delCourseWatchLog, addCourseWatchLog, updateCourseWatchLog, exportCourseWatchLog } from "@/api/course/courseWatchLog";
+import {
+  listCourseWatchLog,
+  getCourseWatchLog,
+  delCourseWatchLog,
+  addCourseWatchLog,
+  updateCourseWatchLog,
+  exportCourseWatchLog }
+  from "@/api/course/courseWatchLog";
+import {listPeriodLabel} from "@/api/course/userCoursePeriod";
 import {courseList, qwCourseList, listCourseRedPacketLog, videoList, qwVideoList, periodList} from '@/api/course/courseRedPacketLog'
 import {listLogs} from "@/api/course/courseAnswerlogs";
 import {allListTagGroup} from "../../../api/qw/tagGroup";
@@ -722,6 +776,7 @@ import {getQwList} from "@/api/qw/qwUser";
 import {treeselect} from "@/api/company/companyDept";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
 Vue.use(Calendar)
 
 export default {
@@ -876,6 +931,7 @@ export default {
         pageNum: 1,
         pageSize: 10,
         project: null,
+        logId: null,
         userId: null,
         nickName: null,
         videoId: null,
@@ -910,6 +966,13 @@ export default {
       // 表单校验
       rules: {
       },
+
+      //发送的消息
+      contentDialog:{
+        isDialogVisible:false,
+        json: [],
+      },
+
       // 员工选项列表
       companyUserOptionsParams: {
         name: undefined,
@@ -968,6 +1031,17 @@ export default {
     this.loading=false;
   },
   methods: {
+
+    showContentDialog(questionJson){
+      // 解析 JSON 字符串为 JavaScript 对象
+      // 替换非法换行符等控制字符
+      const sanitizedJson = questionJson.replace(/[\u0000-\u001F\u007F]/g, '');
+      this.contentDialog.json = JSON.parse(sanitizedJson);
+
+      this.contentDialog.isDialogVisible = true;
+    },
+
+
     getTreeselect() {
       treeselect().then((response) => {
         this.deptOptions = response.data;
@@ -1941,6 +2015,34 @@ export default {
   }
 };
 </script>
+<style>
+/** 移动端展示 **/
+@media screen and (max-width: 500px) {
+  .el-picker-panel__sidebar {
+    width: 100%;
+  }
+  .el-picker-panel {
+    width: 400px!important;
+  }
+  .el-picker-panel__content {
+    width: 100%;
+  }
+  .el-picker-panel__body{
+    margin-left: 0!important;
+    display: flex;
+    flex-direction: column;
+    min-width: auto!important;
+  }
+  .el-picker-panel__sidebar {
+    position: relative;
+  }
+  .el-picker-panel__body-wrapper {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+  }
+}
+</style>
 <style scoped>
 /* CSS 样式 */
 .tag-container {

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

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

+ 187 - 36
src/views/course/courseWatchLog/watchLog.vue

@@ -1,6 +1,14 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="记录编号" prop="logId">
+        <el-input
+          v-model="queryParams.logId"
+          placeholder="请输入记录编号"
+          clearable
+          size="small"
+        />
+      </el-form-item>
       <el-form-item label="看课方式" prop="sendType">
         <el-select v-model="queryParams.sendType" placeholder="选择看课方式"  clearable size="small" @change="handleSendTypeChange">
           <el-option
@@ -213,13 +221,13 @@
       <el-form-item label="最新更新时间" prop="updateTime">
         <el-date-picker
           v-model="updateTimeText"
-          type="daterange"
+          type="datetimerange"
           range-separator="至"
           start-placeholder="开始日期"
           end-placeholder="结束日期"
-          value-format="yyyy-MM-dd"
-          style="width: 240px"
-          @change="updateChange"
+          value-format="yyyy-MM-dd HH:mm:ss"
+           @change="updateChange"
+          :default-time="['00:00:00', '23:59:59']"
         />
       </el-form-item>
       <!-- 进线时间 -->
@@ -267,21 +275,51 @@
         </el-date-picker>
       </el-form-item>
 
-      <!--      <el-form-item label="是否注册" prop="isVip">-->
-      <!--        <el-select-->
-      <!--          filterable-->
-      <!--          v-model="queryParams.isVip"-->
-      <!--          placeholder="请选择是否注册"-->
-      <!--          clearable size="small">-->
-      <!--          <el-option-->
-      <!--            v-for="dict in isVipList"-->
-      <!--            :key="dict.dictValue"-->
-      <!--            :label="dict.dictLabel"-->
-      <!--            :value="dict.dictValue"-->
-      <!--          />-->
-      <!--        </el-select>-->
-      <!--      </el-form-item>-->
-
+<!--      <el-form-item label="是否注册" prop="isVip">-->
+<!--        <el-select-->
+<!--          filterable-->
+<!--          v-model="queryParams.isVip"-->
+<!--          placeholder="请选择是否注册"-->
+<!--          clearable size="small">-->
+<!--          <el-option-->
+<!--            v-for="dict in isVipList"-->
+<!--            :key="dict.dictValue"-->
+<!--            :label="dict.dictLabel"-->
+<!--            :value="dict.dictValue"-->
+<!--          />-->
+<!--        </el-select>-->
+<!--      </el-form-item>-->
+      <!-- 记录类型 - 仅在全部选项卡时显示 -->
+      <el-form-item label="记录类型" prop="logType" v-if="activeName === '00'">
+        <el-select
+          v-model="queryParams.logType"
+          placeholder="请选择记录类型"
+          clearable
+          size="small"
+          filterable>
+          <el-option
+            v-for="dict in logTypeOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="会员状态" prop="externalStatus">
+        <el-select
+          v-model="queryParams.externalStatus"
+          placeholder="请选择会员状态"
+          clearable
+          size="small"
+          filterable>
+          <el-option
+            v-for="dict in externalStatusOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -357,22 +395,34 @@
       :key="tableKey">
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="记录编号" align="center" prop="logId"/>
-      <el-table-column label="客户昵称" align="center" prop="externalUserName" v-if="queryParams.sendType == 2"/>
+      <el-table-column label="客户昵称" align="center" prop="externalUserName" v-if="queryParams.sendType == 2">
+        <template slot-scope="scope">
+          <span>{{ scope.row.externalUserName }}</span>
+          <i
+            ref="copyIcon"
+            class="el-icon-document-copy"
+            style="margin-left: 5px; cursor: pointer; color: #409EFF;"
+            @click="copyText(scope.row.externalUserName, $event)"
+            title="点击复制"
+          ></i>
+        </template>
+
+      </el-table-column>
 
       &lt;!&ndash;
       <el-table-column label="会员ID" align="center" prop="userId" v-if="queryParams.sendType == 1"/>
       &ndash;&gt;
-      <!--     <el-table-column label="客户头像" align="center" prop="externalUserAvatar" v-if="queryParams.sendType == 2">-->
-      <!--       <template slot-scope="scope">-->
-      <!--         <el-popover-->
-      <!--           placement="right"-->
-      <!--           title=""-->
-      <!--           trigger="hover">-->
-      <!--           <img slot="reference" :src="scope.row.externalUserAvatar" style="width: 50px;height: 50px">-->
-      <!--           <img :src="scope.row.externalUserAvatar" style="max-width: 200px;max-height: 200px">-->
-      <!--         </el-popover>-->
-      <!--       </template>-->
-      <!--     </el-table-column>-->
+<!--     <el-table-column label="客户头像" align="center" prop="externalUserAvatar" v-if="queryParams.sendType == 2">-->
+<!--       <template slot-scope="scope">-->
+<!--         <el-popover-->
+<!--           placement="right"-->
+<!--           title=""-->
+<!--           trigger="hover">-->
+<!--           <img slot="reference" :src="scope.row.externalUserAvatar" style="width: 50px;height: 50px">-->
+<!--           <img :src="scope.row.externalUserAvatar" style="max-width: 200px;max-height: 200px">-->
+<!--         </el-popover>-->
+<!--       </template>-->
+<!--     </el-table-column>-->
       <el-table-column label="头像" align="center">
         <template slot-scope="scope">
           <img
@@ -432,6 +482,11 @@
           </el-tag>
         </template>
       </el-table-column>
+      <el-table-column label="会员状态" align="center" prop="externalStatus">
+        <template slot-scope="scope">
+          <dict-tag :options="externalStatusOptions" :value="scope.row.externalStatus"/>
+        </template>
+      </el-table-column>
       <el-table-column
         fixed="right"
         label="操作"
@@ -474,7 +529,10 @@
         <el-table-column label="小节名称" align="center" prop="videoName"/>
         <el-table-column label="是否全部正确" align="center" prop="isRight">
           <template slot-scope="scope">
-            <dict-tag :options="sysCompanyOr" :value="scope.row.isRight"></dict-tag>
+            <dict-tag :options="sysCompanyOr" :value="scope.row.isRight" style="margin-bottom: 5px;"></dict-tag>
+            <el-button type="text" size="mini" @click="showContentDialog(scope.row.questionJson)">
+              查看详情
+            </el-button>
           </template>
         </el-table-column>
         <el-table-column label="销售名称" align="center" prop="companyUserName"/>
@@ -686,15 +744,36 @@
       </div>
     </el-dialog>
 
+    <el-dialog :visible.sync="contentDialog.isDialogVisible" title="消息详情" width="30%" append-to-body>
+      <div>
+        <div v-for="(item, index) in contentDialog.json || []" :key="index">
+          <el-card class="box-card" style="margin-top: 2%">
+            <div>题目:<span style="color: #0464f4">{{item.title}}</span></div>
+            <div>答题:<span style="color: #000000">{{item.answer}}</span></div>
+            <div>是否答题正确:
+              <span :style="{color: item.status === 1 ? 'green' : 'red'}">
+                {{ item.status === 1 ? '正确' : '错误' }}
+            </span>
+            </div>
+          </el-card>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="contentDialog.isDialogVisible = false">关闭</el-button>
+      </span>
+    </el-dialog>
+
+
   </div>
 </template>
 
 <script>
+import ClipboardJS from 'clipboard';
 import {
   addCourseWatchLog,
   delCourseWatchLog,
-  exportCourseWatchLog,
-  getCourseWatchLog, myExportCourseWatchLog,
+  getCourseWatchLog,
+  myExportCourseWatchLog,
   myListCourseWatchLog,
   updateCourseWatchLog
 } from "@/api/course/courseWatchLog";
@@ -702,11 +781,12 @@ import {courseList, qwCourseList, myListCourseRedPacketLog, videoList, qwVideoLi
 import {myListLogs} from "@/api/course/courseAnswerlogs";
 import {getMyQwUserList} from "@/api/qw/user";
 import {searchTags} from "../../../api/qw/tag";
-import {addTagByWatch, delTagByWatch,batchUpdateExternalContactNotes,batchUpdateExternalContactNotesByWatchLog} from "../../../api/qw/externalContact";
+import {addTagByWatch, batchUpdateExternalContactNotesByWatchLog, delTagByWatch} from "../../../api/qw/externalContact";
 import {allListTagGroup} from "../../../api/qw/tagGroup";
 import Vue from 'vue'
 import Calendar from 'vue-mobile-calendar'
 import {infoSop} from "@/api/qw/sop";
+
 Vue.use(Calendar)
 
 export default {
@@ -746,7 +826,11 @@ export default {
       resultDialogVisible: false,
       resultMessage: '',
       resultTitle:'',
-
+      //发送的消息
+      contentDialog:{
+        isDialogVisible:false,
+        json: [],
+      },
       activeName:"2",
       pickerOptions: {
         disabledDate(time) {
@@ -768,6 +852,7 @@ export default {
       videoList: [],
       myQwUserList: [],
       logTypeOptions: [],
+      externalStatusOptions:[],
       // 遮罩层
       loading: true,
       // 导出遮罩层
@@ -859,6 +944,7 @@ export default {
         videoId: null,
         nickName: null,
         logType: 2,
+        externalStatus:null,
         qwExternalContactId: null,
         externalUserName:null,
         duration: null,
@@ -910,6 +996,13 @@ export default {
     this.getDicts("sys_course_project").then(response => {
       this.projectOptions = response.data;
     });
+    this.getDicts("sys_qw_external_contact_status").then(response => {
+      this.externalStatusOptions = response.data;
+    });
+       // 查询营期名称
+    listPeriodLabel().then(response => {
+      this.scheduleLists = response.rows;
+    });
     // 设置默认当天时间 xgb 防止频繁查询大量数据
     this.setToday();
 
@@ -920,6 +1013,21 @@ export default {
 
   },
   methods: {
+    copyText(text, event) {
+      const clipboard = new ClipboardJS(event.currentTarget, {
+        text: () => text,
+      });
+
+      clipboard.on('success', (e) => {
+        this.$message.success('复制成功');
+        clipboard.destroy();
+      });
+
+      clipboard.on('error', (e) => {
+        this.$message.error('复制失败,请手动复制');
+        clipboard.destroy();
+      });
+    },
     setToday(){
       const today = new Date();
       const todayStart = new Date(today-60*60*24*7*1000);
@@ -931,6 +1039,14 @@ export default {
       this.queryParams.sTime = this.formatDate(todayStart);
       this.queryParams.eTime = this.formatDate(todayEnd);
     },
+    showContentDialog(questionJson){
+      // 解析 JSON 字符串为 JavaScript 对象
+      // 替换非法换行符等控制字符
+      const sanitizedJson = questionJson.replace(/[\u0000-\u001F\u007F]/g, '');
+      this.contentDialog.json = JSON.parse(sanitizedJson);
+
+      this.contentDialog.isDialogVisible = true;
+    },
 
     handleSendTypeChange() {
       // 重置相关参数
@@ -1331,6 +1447,7 @@ export default {
         userId: null,
         videoId: null,
         logType: null,
+        externalStatus:null,
         createTime: null,
         updateTime: null,
         qwExternalContactId: null,
@@ -1897,3 +2014,37 @@ export default {
   color: #606266;
 }
 </style>
+<style scoped>
+.el-icon-document-copy:hover {
+  color: #66b1ff; /* 悬停时的颜色 */
+}
+</style>
+
+<style>
+/** 移动端展示 **/
+@media screen and (max-width: 500px) {
+  .el-picker-panel__sidebar {
+    width: 100%;
+  }
+  .el-picker-panel {
+    width: 400px!important;
+  }
+  .el-picker-panel__content {
+    width: 100%;
+  }
+  .el-picker-panel__body{
+    margin-left: 0!important;
+    display: flex;
+    flex-direction: column;
+    min-width: auto!important;
+  }
+  .el-picker-panel__sidebar {
+    position: relative;
+  }
+  .el-picker-panel__body-wrapper {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+  }
+}
+</style>

+ 9 - 0
src/views/course/userCourse/index.vue

@@ -1,6 +1,14 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="课程ID" prop="courseId">
+        <el-input
+          v-model="queryParams.courseId"
+          placeholder="请输入课程ID"
+          clearable
+          size="small"
+        />
+      </el-form-item>
       <el-form-item label="课堂分类" prop="cateId">
         <el-select v-model="queryParams.cateId" placeholder="请选择" clearable size="small"  @change="getQuerySubCateList(queryParams.cateId)">
           <el-option
@@ -177,6 +185,7 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        courseId: null,
         cateId: null,
         subCateId:null,
         title: null,

+ 1 - 1
src/views/course/userCoursePeriod/index.vue

@@ -605,7 +605,7 @@ export default {
     },
     /** 处理单独注册会员开关 */
     handlePeriodUserOpenReminder(data, open) {
-      const actionText = open === '0' ? '开启' : '关闭';
+      const actionText = open === '1' ? '开启' : '关闭';
       this.$confirm(`确定要${actionText}【${data.periodName}】的看课休息暂停功能吗?`, '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',

+ 76 - 0
src/views/crm/components/aiAddWxLog.vue

@@ -0,0 +1,76 @@
+<template>
+    <div>
+        <el-table border v-loading="loading" :data="list" >
+            <el-table-column label="ID" align="center" prop="logId" />
+            <el-table-column label="公司名" align="center" prop="companyName" />
+            <el-table-column label="客户名称" align="center" prop="wxClientName" />
+            <el-table-column label="加微微信" align="center" prop="wxAccountName" />
+            <el-table-column label="加微时间" align="center" prop="runTime" ></el-table-column>
+            <el-table-column label="状态" align="center" prop="status" >
+                <template slot-scope="scope">
+                    <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
+                </template>
+            </el-table-column>
+            <!-- <el-table-column label="备注" align="center" prop="remark" /> -->
+        </el-table>
+        <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+        />
+
+    </div>
+</template>
+  
+<script>
+import { listAddwx } from "@/api/company/addwx.js";
+
+import {getDicts} from "@/api/system/dict/data";
+export default {
+        name: "aiAddWxLog",
+        data() {
+            return {
+                statusOptions:[],
+                // 遮罩层
+                loading: true,
+                // 总条数
+                total: 0,
+                list: [],
+                // 查询参数
+                queryParams: {
+                    pageNum: 1,
+                    pageSize: 10,
+                    customerId: null,
+                    roboticId:null
+                },
+            };
+        },
+        created() {
+            getDicts("ai_call_task_status").then((response) => {
+                this.statusOptions = response.data;
+            });
+          
+        },
+        methods: {
+            getData(customerId,roboticId){
+                this.queryParams.roboticId=roboticId;
+                this.queryParams.customerId=customerId;
+                this.queryParams.pageNum=1;
+                this.getList();
+            },
+            getList(){
+                this.loading = true;
+                listAddwx(this.queryParams).then(response => {
+                    this.list = response.rows;
+                    this.total = response.total;
+                    this.loading = false;
+                });
+            },
+        }
+    };
+</script>
+<style lang="scss" scoped> 
+</style>
+ 

+ 113 - 0
src/views/crm/components/aiCallVoiceLog.vue

@@ -0,0 +1,113 @@
+<template>
+    <div>
+        <el-table border v-loading="loading" :data="list" >
+            <el-table-column label="ID" align="center" prop="logId" />
+            <el-table-column label="公司名" align="center" prop="companyName" />
+            <el-table-column label="员工姓名" align="center" prop="companyUserName" />
+            <el-table-column label="录制地址" align="center"  show-overflow-tooltip prop="recordPath" width="350">
+                <template slot-scope="scope">
+                    <audio  v-if="scope.row.recordPath!=null"   controls :src="handleRecordPath(scope.row.recordPath)"></audio>
+                </template>
+            </el-table-column>
+            <el-table-column label="呼入时间" align="center" prop="callCreateTime" width="180">
+                <template slot-scope="scope">
+                <span>{{ parseTime(scope.row.callCreateTime) }}</span>
+                </template>
+            </el-table-column>
+            <el-table-column label="应答时间" align="center" prop="callAnswerTime" width="180">
+                <template slot-scope="scope">
+                <span>{{ parseTime(scope.row.callAnswerTime) }}</span>
+                </template>
+            </el-table-column>
+            <el-table-column label="主叫" align="center" prop="callerNum" />
+            <el-table-column label="被叫" align="center" prop="calleeNum" />
+            <el-table-column label="时长(秒)" align="center" prop="callTime" width="180">
+                <template slot-scope="scope">
+                <span v-if="scope.row.recordPath!=null">{{ scope.row.callTime}}秒 </span>
+                </template>
+            </el-table-column>
+            <el-table-column label="意向度" align="center" prop="intention" width="180">
+                <template slot-scope="scope">
+                    <el-tag v-for="item in levelList" v-if="scope.row.intention == item.dictValue">{{item.dictLabel}}</el-tag>
+                </template>
+            </el-table-column>
+            <!-- <el-table-column label="主叫显示号" align="center" prop="displayCallerNumber" />
+            <el-table-column label="被叫显示号" align="center" prop="displayCalleeNumber" /> -->
+            <el-table-column label="状态" align="center" prop="status" >
+                <template slot-scope="scope">
+                    <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
+                </template>
+            </el-table-column>
+            <!-- <el-table-column label="备注" align="center" prop="remark" /> -->
+        </el-table>
+        <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+        />
+
+    </div>
+</template>
+  
+<script>
+import { listCompanyVoiceLogs, getCompanyVoiceLogs, delCompanyVoiceLogs, addCompanyVoiceLogs, updateCompanyVoiceLogs, exportCompanyVoiceLogs } from "@/api/company/companyVoiceLogs";
+import { listCallphone } from "@/api/company/callphone";
+
+import {getDicts} from "@/api/system/dict/data";
+export default {
+        name: "aiCallVoiceLog",
+        data() {
+            return {
+                statusOptions:[],
+                levelList:[],
+                // 遮罩层
+                loading: true,
+                // 总条数
+                total: 0,
+                list: [],
+                // 查询参数
+                queryParams: {
+                    pageNum: 1,
+                    pageSize: 10,
+                    customerId: null,
+                    callerId:null
+                },
+            };
+        },
+        created() {
+            getDicts("ai_call_task_status").then((response) => {
+                this.statusOptions = response.data;
+            });
+            getDicts("customer_intention_level").then(e => {
+                this.levelList = e.data;
+            })
+          
+        },
+        methods: {
+            getData(customerId,calleesId){
+                this.queryParams.customerId=customerId;
+                this.queryParams.callerId=calleesId;
+                this.queryParams.pageNum=1;
+                this.getList();
+            },
+            getList(){
+                this.loading = true;
+                listCallphone(this.queryParams).then(response => {
+                    this.list = response.rows;
+                    this.total = response.total;
+                    this.loading = false;
+                });
+            },
+            handleRecordPath(url){
+                let path = 'http://118.24.138.129/recordFile/listen?file=' + url;
+                console.log(path);
+                return path;
+            }
+        }
+    };
+</script>
+<style lang="scss" scoped> 
+</style>
+ 

+ 80 - 0
src/views/crm/components/aiSendMsgLog.vue

@@ -0,0 +1,80 @@
+<template>
+    <div>
+        <el-table border v-loading="loading" :data="list" >
+            <el-table-column label="ID" align="center" prop="logId" />
+            <el-table-column label="公司名" align="center" prop="companyName" />
+            <el-table-column label="员工姓名" align="center" prop="companyUserName" />
+            
+            <el-table-column label="发送时间" align="center" prop="runTime" />
+            <el-table-column label="内容长度" align="center" prop="contentLen" />
+            <el-table-column label="短信模板" align="center" prop="smsTempName" />
+            <el-table-column label="状态" align="center" prop="status" >
+                <template slot-scope="scope">
+                    <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
+                </template>
+            </el-table-column>
+            <!-- <el-table-column label="备注" align="center" prop="remark" /> -->
+        </el-table>
+        <pagination
+        v-show="total>0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+        />
+
+    </div>
+</template>
+  
+<script>
+import { listCompanyVoiceLogs, getCompanyVoiceLogs, delCompanyVoiceLogs, addCompanyVoiceLogs, updateCompanyVoiceLogs, exportCompanyVoiceLogs } from "@/api/company/companyVoiceLogs";
+import { listByCallerIdAndRoboticId } from "@/api/company/sendmsg";
+
+export default {
+        name: "aiSendMsgLog",
+        data() {
+            return {
+                statusOptions:[],
+                // 遮罩层
+                loading: true,
+                // 总条数
+                total: 0,
+                list: [],
+                // 查询参数
+                queryParams: {
+                    pageNum: 1,
+                    pageSize: 10,
+                    customerId: null,
+                    callerId:null,
+                    roboticId:null,
+                },
+            };
+        },
+        created() {
+            this.getDicts("ai_call_task_status").then((response) => {
+                this.statusOptions = response.data;
+            });
+          
+        },
+        methods: {
+            getData(customerId,calleesId,roboticId){
+                this.queryParams.customerId=customerId;
+                this.queryParams.callerId=calleesId;
+                this.queryParams.roboticId = roboticId;
+                this.queryParams.pageNum=1;
+                this.getList();
+            },
+            getList(){
+                this.loading = true;
+                listByCallerIdAndRoboticId(this.queryParams).then(response => {
+                    this.list = response.rows;
+                    this.total = response.total;
+                    this.loading = false;
+                });
+            },
+        }
+    };
+</script>
+<style lang="scss" scoped> 
+</style>
+ 

+ 55 - 4
src/views/crm/components/customerDetails.vue

@@ -72,8 +72,8 @@
             </el-descriptions-item>
 
             <el-descriptions-item label="标签" label-class-name="my-label">
-                <span v-if="item!=null">
-                    {{item.tags}}
+                <span v-if="item!=null && item.tags != null">
+                    <el-tag v-for="tag in item.tags.split(',')" size="mini">{{ tag }}</el-tag>
                 </span>
                 <!-- <el-button size="mini" icon="el-icon-edit"></el-button> -->
             </el-descriptions-item>
@@ -108,6 +108,24 @@
                 </span>
                 <!-- <el-button size="mini" icon="el-icon-edit"></el-button> -->
             </el-descriptions-item>
+          <el-descriptions-item label="购买渠道" label-class-name="my-label">
+                <span v-if="item!=null">
+                    {{item.platformName || ''}}
+                </span>
+
+          </el-descriptions-item>
+          <el-descriptions-item label="购买商品" label-class-name="my-label">
+                <span v-if="item!=null">
+                    {{item.goodsName || ''}} - {{item.goodsSpecification || ''}}
+                </span>
+
+          </el-descriptions-item>
+          <el-descriptions-item label="购买店铺" label-class-name="my-label">
+                <span v-if="item!=null">
+                    {{item.shopName || ''}}
+                </span>
+
+          </el-descriptions-item>
             <el-descriptions-item label="消费金额" label-class-name="my-label">
                 <span v-if="item!=null">
                     {{item.payMoney}}
@@ -176,6 +194,15 @@
             <el-tab-pane label="历史订单" name="hisOrder">
                 <customer-his-order-list ref="hisOrder"></customer-his-order-list>
             </el-tab-pane>
+            <el-tab-pane label="AI通话记录" name="aiVoiceLogs">
+                <ai-call-voice-log ref="aiVoiceRef"></ai-call-voice-log>
+            </el-tab-pane>
+             <el-tab-pane label="AI加微记录" name="aiAddWxLogs">
+                <ai-add-wx-log ref="aiAddWxRef"></ai-add-wx-log>
+            </el-tab-pane>
+             <el-tab-pane label="AI短信记录" name="aiSendMsgLogs">
+                <ai-send-msg-log ref="aiSendMsgRef"></ai-send-msg-log>
+            </el-tab-pane>
         </el-tabs>
 
         <el-dialog :title="addTag.title" :visible.sync="addTag.open" width="600px" append-to-body>
@@ -213,6 +240,9 @@
     import duplicateCustomer from '../components/duplicateCustomer.vue';
     import customerContacts from './customerContacts.vue';
     import customerHisOrderList from '../components/customerHisOrderList.vue';
+    import aiCallVoiceLog from './aiCallVoiceLog';
+    import aiAddWxLog from './aiAddWxLog';
+    import aiSendMsgLog from './aiSendMsgLog';
     import { getCustomerDetails1,updateCustomer,getCustomer1 } from "@/api/crm/customer";
     import addTag from './addTag.vue';
     import addRemark from './addRemark.vue';
@@ -220,9 +250,12 @@
     import addOrEditCustomer from '../components/addOrEditCustomer.vue';
     export default {
         name: "customer",
-        components: {customerHisOrderList,addOrEditCustomer,addSms,addTag,addRemark, customerContacts,customerVisitList,customerLogsList,customerVoiceLogsList,customerStoreOrderList,customerSmsLogsList,duplicateCustomer },
+        components: {customerHisOrderList,addOrEditCustomer,addSms,addTag,addRemark, customerContacts,customerVisitList,customerLogsList,
+        customerVoiceLogsList,customerStoreOrderList,customerSmsLogsList,duplicateCustomer,aiCallVoiceLog,aiAddWxLog,aiSendMsgLog },
         data() {
             return {
+                calleesId:null,
+                roboticId:null,
                 customer:{
                     open:false,
                     title:"修改客户"
@@ -374,8 +407,26 @@
                 if(tab.name=="hisOrder"){
                     this.$refs.hisOrder.getData(this.item.customerId);
                 }
+                if(tab.name=="aiVoiceLogs"){
+                    console.log(this.item.customerId);
+                    this.$refs.aiVoiceRef.getData(this.item.customerId,this.calleesId);
+                } else if(tab.name=="aiAddWxLogs"){
+                    console.log(this.item.customerId);
+                    this.$refs.aiAddWxRef.getData(this.item.customerId,this.roboticId);
+                } else if(tab.name=="aiSendMsgLogs"){
+                    console.log(this.item.customerId);
+                    this.$refs.aiSendMsgRef.getData(this.item.customerId,this.calleesId,this.roboticId);
+                }
             },
-            getDetails(customerId) {
+            getDetails(customerId,calleesId,roboticId) {
+                if(!!calleesId){
+                    this.calleesId = calleesId;
+                    console.log(this.calleesId);
+                }
+                if(!!roboticId){
+                    this.roboticId = roboticId;
+                    console.log(this.roboticId);
+                }
                 var data={customerId:customerId}
                 this.customerId=customerId;
                 var that=this;

+ 15 - 15
src/views/crm/components/duplicateCustomer.vue

@@ -74,7 +74,7 @@
                 </span>
                 <!-- <el-button size="mini" icon="el-icon-edit"></el-button> -->
             </el-descriptions-item>
-           
+
             <el-descriptions-item label="进线日期" label-class-name="my-label">
                 <span v-if="item!=null">
                     {{item.registerDate}}
@@ -147,7 +147,7 @@
                 </span>
                 <!-- <el-button size="mini" icon="el-icon-edit"></el-button> -->
             </el-descriptions-item>
-           
+
         </el-descriptions>
 
         <el-tabs style="margin-top:15px;"  z-index = "99" type="border-card" v-model="activeName" @tab-click="handleClick">
@@ -160,7 +160,7 @@
             <el-tab-pane label="订单记录" name="storeOrder">
                 <customer-store-order-list ref="storeOrder"></customer-store-order-list>
             </el-tab-pane>
-           
+
             <el-tab-pane label="通话记录" name="voiceLogs">
                 <customer-voice-logs-list ref="voiceLogs"></customer-voice-logs-list>
             </el-tab-pane>
@@ -171,7 +171,7 @@
                 <customer-logs-list ref="logs"></customer-logs-list>
             </el-tab-pane>
         </el-tabs>
-       
+
         <el-dialog :title="addTag.title" :visible.sync="addTag.open" width="600px" append-to-body>
             <add-tag ref="tag" @close="closeTag()"></add-tag>
         </el-dialog>
@@ -192,7 +192,7 @@
 
     </div>
 </template>
-  
+
 <script>
     import { listCustomerExt } from "@/api/crm/customerExt";
     import customerVisitList from '../components/customerVisitList.vue';
@@ -255,7 +255,7 @@
                 item:null,
                 showDuplicate:false,
                 dCustomerId:null,
-                 
+
             };
         },
         created() {
@@ -277,10 +277,10 @@
             this.getDicts("crm_customer_is_receive").then((response) => {
                 this.receiveOptions = response.data;
             });
-            
+
         },
         mounted(){
-           
+
         },
         methods: {
             handleEdit() {
@@ -310,7 +310,7 @@
                 setTimeout(() => {
                     that.$refs.sms.reset(this.item.customerId,mobile);
                 }, 500);
-                
+
             },
             closeRemark(){
                 this.addRemark.open=false;
@@ -333,7 +333,7 @@
                 setTimeout(() => {
                     that.$refs.tag.reset(this.item);
                 }, 500);
-                
+
             },
             handleClick(tab, event) {
                 if(tab.name=="contacts"){
@@ -378,14 +378,14 @@
                                     item.value=element.value
                                 }
                             });
-                           
+
                         });
                     }
                     this.activeName="visit"
                     setTimeout(() => {
                         that.$refs.visit.getData(customerId);
                     }, 500);
-                    
+
                 });
             },
         }
@@ -396,7 +396,7 @@
     height: 100%;
     background-color: #fff;
     padding: 0px 20px;
-        
+
 }
 .customer-title{
     margin-bottom: 15px;
@@ -412,5 +412,5 @@
   .el-descriptions-item__label.is-bordered-label{
     font-weight: normal;
   }
-  
-</style>
+
+</style>

+ 19 - 19
src/views/crm/components/lineCustomerDetails.vue

@@ -80,7 +80,7 @@
                 </span>
                 <!-- <el-button size="mini" icon="el-icon-edit"></el-button> -->
             </el-descriptions-item>
-           
+
             <el-descriptions-item label="进线日期" label-class-name="my-label">
                 <span v-if="item!=null">
                     {{item.registerDate}}
@@ -153,7 +153,7 @@
                 </span>
                 <!-- <el-button size="mini" icon="el-icon-edit"></el-button> -->
             </el-descriptions-item>
-           
+
         </el-descriptions>
 
         <el-tabs style="margin-top:15px;"  z-index = "99" type="border-card" v-model="activeName" @tab-click="handleClick">
@@ -166,7 +166,7 @@
             <el-tab-pane label="订单记录" name="storeOrder">
                 <customer-store-order-list ref="storeOrder"></customer-store-order-list>
             </el-tab-pane>
-           
+
             <el-tab-pane label="通话记录" name="voiceLogs">
                 <customer-voice-logs-list ref="voiceLogs"></customer-voice-logs-list>
             </el-tab-pane>
@@ -180,7 +180,7 @@
                 <customer-his-order-list ref="hisOrder"></customer-his-order-list>
             </el-tab-pane>
         </el-tabs>
-       
+
         <el-dialog :title="addTag.title" :visible.sync="addTag.open" width="600px" append-to-body>
             <add-tag ref="tag" @close="closeTag()"></add-tag>
         </el-dialog>
@@ -205,7 +205,7 @@
 
     </div>
 </template>
-  
+
 <script>
     import { listCustomerExt } from "@/api/crm/customerExt";
     import customerVisitList from '../components/customerVisitList.vue';
@@ -270,7 +270,7 @@
                 repetition:null,
                 showDuplicate:false,
                 dCustomerId:null,
-                 
+
             };
         },
         created() {
@@ -292,10 +292,10 @@
             this.getDicts("crm_customer_is_receive").then((response) => {
                 this.receiveOptions = response.data;
             });
-            
+
         },
         mounted(){
-           
+
         },
         methods: {
             handleShow(repetition){
@@ -328,7 +328,7 @@
                 setTimeout(() => {
                     that.$refs.sms.reset(this.item.customerId,mobile);
                 }, 500);
-                
+
             },
             closeRemark(){
                 this.addRemark.open=false;
@@ -351,7 +351,7 @@
                 setTimeout(() => {
                     that.$refs.tag.reset(this.item);
                 }, 500);
-                
+
             },
             handleClick(tab, event) {
                 if(tab.name=="contacts"){
@@ -371,7 +371,7 @@
                 }
                 if(tab.name=="smsLogs"){
                     this.$refs.smsLogs.getData(this.item.customerId);
-                }  
+                }
                 if(tab.name=="hisOrder"){
                     this.$refs.hisOrder.getData(this.item.customerId);
                 }
@@ -400,25 +400,25 @@
                                     item.value=element.value
                                 }
                             });
-                           
+
                         });
                     }
                     this.activeName="visit"
                     setTimeout(() => {
                         that.$refs.visit.getData(customerId);
                     }, 500);
-                    
+
                 });
             },
             initDuplicate(isDuplicate,dCustomerId){
-                 
+
                 this.showDuplicate=isDuplicate;
                 this.dCustomerId=dCustomerId;
             },
             handleDuplicate(){
                 this.duplicate.open=true;
                 var that=this;
-               
+
                 setTimeout(() => {
                     that.$refs.duplicateCustomer.getDetails(that.dCustomerId);
                 }, 200);
@@ -427,7 +427,7 @@
                 this.duplicate.open=false;
                 this.getDetails(this.customerId)
             }
-        
+
         }
     };
 </script>
@@ -436,7 +436,7 @@
     height: 100%;
     background-color: #fff;
     padding: 0px 20px;
-        
+
 }
 .customer-title{
     margin-bottom: 15px;
@@ -452,5 +452,5 @@
   .el-descriptions-item__label.is-bordered-label{
     font-weight: normal;
   }
-  
-</style>
+
+</style>

+ 401 - 3
src/views/fastGpt/fastGptRole/fastGptRoleUpdate.vue

@@ -72,6 +72,95 @@
         </div>
       </el-form-item>
 
+      <el-form-item label="AI是否发送新客先导课" prop="sendCourseStatus">
+        <el-switch
+          v-model="form.sendCourseStatus"
+          :active-value="1"
+          :inactive-value="0"
+          active-text="是"
+          inactive-text="否"
+          active-color="#13ce66"
+          inactive-color="#ff4949"
+        />
+        <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
+          <i class="el-icon-info"></i>
+          AI与客户聊天中是否发送新客先导课,默认关闭,开启后,与客户聊天会发送新客先导课
+        </div>
+      </el-form-item>
+
+      <el-form-item label="新客先导课" prop="courseId">
+        <el-popover
+          placement="bottom"
+          width="300"
+          trigger="click"
+          :visible="coursePopoverVisible"
+          @show="onCoursePopoverShow"
+        >
+          <div class="course-select-popover">
+            <el-input
+              v-if="courseFilterable"
+              placeholder="输入关键字过滤"
+              v-model="courseFilterText"
+              size="mini"
+              clearable
+              class="course-filter-input"
+            >
+            </el-input>
+
+            <div class="course-list-container" :style="{ height: courseListHeight + 'px' }">
+              <div
+                ref="courseVirtualList"
+                class="course-virtual-list"
+                @scroll="handleCourseScroll"
+                :style="{ height: courseListHeight + 'px', overflow: 'auto' }"
+              >
+                <div
+                  class="course-virtual-content"
+                  :style="{
+                    height: courseTotalHeight + 'px',
+                    position: 'relative',
+                    paddingTop: courseOffsetY + 'px'
+                  }"
+                >
+                  <div
+                    v-for="(item, index) in courseVisibleItems"
+                    :key="`${item.videoId}-${index}`"
+                    :style="{
+                      height: courseItemHeight + 'px',
+                      display: 'flex',
+                      alignItems: 'center',
+                      padding: '0 10px'
+                    }"
+                    :class="[
+                      'course-virtual-item',
+                      {
+                        'is-selected': form.courseId === item.videoId,
+                        'is-disabled': item.disabled
+                      }
+                    ]"
+                    @click="handleCourseItemClick(item)"
+                  >
+                    <span class="course-label" :title="item.title">{{ item.title }}</span>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+
+          <el-button slot="reference" style="min-width: 150px; max-width: 300px;">
+            {{ form.courseId ? getCourseTitle(form.courseId) : '请选择课程' }}
+            <i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+        </el-popover>
+
+        <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
+          <i class="el-icon-info"></i>
+          选择课程:客户添加聊天后会根据聊天内容发送这节课程
+        </div>
+      </el-form-item>
+
+
+
       <el-form-item label="客服头像" prop="avatar">
         <ImageUpload v-model="form.avatar" type="image" :num="1" :width="150" :height="150" style="margin-top: 1%;" />
       </el-form-item>
@@ -237,7 +326,7 @@
 </template>
 
 <script>
-import { listFastGptRole, getFastGptRole, delFastGptRole, addFastGptRole, updateFastGptRole, exportFastGptRole,getAllRoleType } from "@/api/fastGpt/fastGptRole";
+import { listFastGptRole, getFastGptRole, delFastGptRole, addFastGptRole, updateFastGptRole, exportFastGptRole,getAllRoleType,getAllCourseList } from "@/api/fastGpt/fastGptRole";
 import {allListTagGroup} from "@/api/qw/tagGroup";
 import {listTag} from "@/api/qw/tag";
 import {
@@ -264,6 +353,23 @@ export default {
       exportLoading: false,
       //AI客服类型
       typeOptions: [],
+
+      // 课程选择相关数据
+      coursePopoverVisible: false,
+      courseFilterText: '',
+      courseFilterable: true,
+      courseListHeight: 300, // 课程列表高度
+      courseItemHeight: 36, // 每个课程项的高度
+      courseStartIndex: 0,
+      courseEndIndex: 0,
+      courseScrollTop: 0,
+      courseVisibleItemCount: 0,
+      courseFlattenedNodes: [], // 扁平化的课程数据
+      courseNodeMap: new Map(), // 课程节点映射
+      courseUpdateTimer: null,
+      courseScrollRAF: null,
+      courseFilterDebounced: null,
+
       //AI模型
       modeOptions: [],
       //渠道类型
@@ -337,7 +443,11 @@ export default {
         channelType: null,
         logistics: null,
         forbidStatus: null,
+        sendCourseStatus: null,
+        courseId: null,
       },
+      // ... 其他数据
+      courseListLoaded: false,
       // 表单参数
       form: {
       },
@@ -434,9 +544,35 @@ export default {
       deep: true
     }
   },
-  created() {
-
+  computed: {
+    courseTotalHeight() {
+      return this.courseVisibleNodes.length * this.courseItemHeight;
+    },
+    courseOffsetY() {
+      return this.courseStartIndex * this.courseItemHeight;
+    },
+    courseVisibleNodes() {
+      let nodes = this.courseFlattenedNodes;
+      if (this.courseFilterText.trim()) {
+        nodes = this.applyCourseFilter(nodes);
+      }
+      return nodes;
+    },
+    courseVisibleItems() {
+      return this.courseVisibleNodes.slice(this.courseStartIndex, this.courseEndIndex);
+    }
+  },
+  beforeDestroy() {
+    // 清理定时器
+    if (this.courseUpdateTimer) clearTimeout(this.courseUpdateTimer);
+    if (this.courseScrollRAF) cancelAnimationFrame(this.courseScrollRAF);
+  },
+  async created() {
     this.handleUpdate();
+    await this.loadCourseList();
+    this.courseListLoaded = true
+    // 初始化课程选择相关数据
+    this.initCourseData();
     //客服类型
     // this.getDicts("chat_role_type").then((response) => {
     //   this.typeOptions = response.data;
@@ -457,7 +593,269 @@ export default {
       this.typeOptions = response.data;
     });
   },
+  mounted() {
+    this.$nextTick(() => {
+      // 确保 DOM 已渲染完成
+      this.initScrollListener();
+    });
+  },
   methods: {
+    // 初始化课程选择相关数据
+    initCourseData() {
+      this.courseVisibleItemCount = Math.ceil(this.courseListHeight / this.courseItemHeight) + 5;
+
+      // 防抖函数
+      this.handleCourseFilterDebounced = this.debounce(this.filterCourseTextChange, 300);
+    },
+
+    // 防抖函数
+    debounce(func, wait) {
+      let timeout;
+      return function executedFunction(...args) {
+        const later = () => {
+          clearTimeout(timeout);
+          func(...args);
+        };
+        clearTimeout(timeout);
+        timeout = setTimeout(later, wait);
+      };
+    },
+
+    // 处理课程数据
+    processCourseData(data) {
+      if (!Array.isArray(data)) {
+        this.courseFlattenedNodes = [];
+        this.courseNodeMap.clear();
+        return;
+      }
+
+      const flattened = [];
+      const nodeMap = new Map();
+
+      data.forEach((item, index) => {
+        const courseItem = {
+          videoId: item.videoId && typeof item.videoId === 'string' ? item.videoId : String(item.videoId || Math.random()),
+          title: item.title && typeof item.title === 'string' ? item.title : String(item.title || item.name || item.videoId || '未命名课程'),
+          originalData: item,
+          disabled: false
+        };
+
+        flattened.push(courseItem);
+        nodeMap.set(courseItem.videoId, courseItem);
+      });
+
+      this.courseFlattenedNodes = flattened;
+      this.courseNodeMap = nodeMap;
+    },
+
+    // 应用课程过滤
+    applyCourseFilter(nodesToFilter) {
+      const searchText = this.courseFilterText.toLowerCase().trim();
+      if (!searchText) return nodesToFilter;
+
+      return nodesToFilter.filter(node =>
+        node.title.toLowerCase().includes(searchText)
+      );
+    },
+
+    // 计算可见范围
+    calculateCourseVisibleRange() {
+      const containerHeight = this.courseListHeight;
+      const totalItems = this.courseVisibleNodes.length;
+
+      const newStartIndex = Math.floor(this.courseScrollTop / this.courseItemHeight);
+      const visibleCountInViewport = Math.ceil(containerHeight / this.courseItemHeight);
+
+      const buffer = 5;
+      this.courseStartIndex = Math.max(0, newStartIndex - buffer);
+      this.courseEndIndex = Math.min(totalItems, newStartIndex + visibleCountInViewport + buffer);
+    },
+
+    // 滚动处理
+    handleCourseScroll(e) {
+      const newScrollTop = e.target.scrollTop;
+      if (newScrollTop !== this.courseScrollTop) {
+        this.courseScrollTop = newScrollTop;
+        if (!this.courseScrollRAF) {
+          this.courseScrollRAF = requestAnimationFrame(() => {
+            this.calculateCourseVisibleRange();
+            this.courseScrollRAF = null;
+          });
+        }
+      }
+    },
+
+    // 重置滚动
+    resetCourseScroll() {
+      this.courseScrollTop = 0;
+      if (this.$refs.courseVirtualList) {
+        this.$refs.courseVirtualList.scrollTop = 0;
+      }
+      this.$nextTick(() => {
+        this.calculateCourseVisibleRange();
+      });
+    },
+
+    // 课程过滤文本变化
+    filterCourseTextChange() {
+      this.resetCourseScroll();
+    },
+
+    // 课程项点击
+    handleCourseItemClick(course) {
+      if (course.disabled) return;
+      this.form.courseId = course.videoId;
+      this.coursePopoverVisible = false;
+    },
+
+    // 课程弹出框显示
+    onCoursePopoverShow() {
+      this.$nextTick(() => {
+        this.resetCourseScroll();
+        if (this.courseFilterable && this.$refs.courseVirtualList) {
+          const inputEl = this.$refs.courseVirtualList.parentElement.querySelector('.course-filter-input input');
+          if (inputEl) inputEl.focus();
+        }
+      });
+    },
+
+    // 初始化滚动监听器
+    initScrollListener() {
+      this.$nextTick(() => {
+        const container = this.$refs.courseSelectContainer;
+        if (container) {
+          // 移除之前的事件监听器,避免重复绑定
+          container.removeEventListener('scroll', this.handleScroll);
+
+          // 添加新的滚动事件监听器
+          container.addEventListener('scroll', this.handleScroll);
+
+          // 添加初始调试信息
+          console.log('滚动监听器已初始化');
+          console.log('容器总高度:', container.scrollHeight);
+          console.log('可见高度:', container.clientHeight);
+          console.log('课程总数:', this.allCourseOptions.length);
+          console.log('当前显示:', this.displayCourseOptions.length);
+        }
+      });
+    },
+    getCourseTitle(videoId) {
+      if (!videoId) return '请选择课程';
+
+      console.log(videoId);
+      // 优先从处理后的课程数据中查找
+      const course = this.courseNodeMap.get(String(videoId));
+      if (course) {
+        return course.title;
+      }
+
+      // 如果在虚拟滚动数据中找不到,尝试从原始数据中查找
+      const originalCourse = this.allCourseOptions.find(item => item.videoId === videoId);
+      return originalCourse ? originalCourse.title : '未找到对应课程';
+    },
+    // 滚动处理函数
+    // 滚动处理函数 - 改进检测逻辑
+    // 滚动处理函数 - 改进检测逻辑
+    handleScroll(event) {
+      const container = event.target;
+      const { scrollTop, scrollHeight, clientHeight } = container;
+
+      // 更精确的滚动到底部检测
+      const threshold = 5; // 阈值调整为5px
+      if (scrollTop + clientHeight >= scrollHeight - threshold &&
+        !this.loadingMore &&
+        this.hasMore) {
+        this.loadMoreCourses();
+      }
+    },
+
+    // 修复滚动加载方法,添加更详细的日志
+    // 修复后的滚动加载方法
+    async loadMoreCourses() {
+      if (this.loadingMore || !this.hasMore) {
+        console.log('加载条件不满足:', { loadingMore: this.loadingMore, hasMore: this.hasMore });
+        return;
+      }
+
+      console.log('开始加载更多课程');
+      this.loadingMore = true;
+
+      try {
+        // 短暂延迟以避免频繁请求
+        await new Promise(resolve => setTimeout(resolve, 300));
+
+        // 使用全部课程列表
+        const sourceList = this.allCourseOptions;
+
+        // 修复分页逻辑:从 (currentPage - 1) * pageSize 开始
+        const start = (this.currentPage - 1) * this.pageSize;
+        const end = start + this.pageSize;
+        const moreCourses = sourceList.slice(start, end);
+
+        console.log('加载的课程范围:', { start, end, count: moreCourses.length });
+
+        if (moreCourses.length > 0) {
+          // 添加新课程到显示列表(注意:使用 concat 或扩展运算符避免重复添加)
+          this.displayCourseOptions = [...this.displayCourseOptions, ...moreCourses];
+          this.currentPage++; // 递增页码
+          // 检查是否还有更多课程
+          this.hasMore = end < sourceList.length;
+          console.log('更新后的课程列表长度:', this.displayCourseOptions.length, '还有更多:', this.hasMore);
+        } else {
+          // 没有更多课程时停止加载
+          this.hasMore = false;
+          console.log('没有更多课程可加载');
+        }
+      } catch (error) {
+        console.error('加载更多课程失败:', error);
+        this.hasMore = false;
+      } finally {
+        this.loadingMore = false;
+      }
+    },
+
+    async loadCourseList() {
+      try {
+        const response = await getAllCourseList();
+        if (Array.isArray(response.data)) {
+          this.courseOptions = response.data
+            .filter(item => item !== null && item !== undefined)
+            .map(item => ({
+              ...item,
+              videoId: item.videoId && typeof item.videoId === 'string' ? item.videoId : String(item.videoId || Math.random()),
+              title: item.title && typeof item.title === 'string' ? item.title : String(item.title || item.name || item.videoId || '未命名课程')
+            }));
+
+          this.allCourseOptions = [...this.courseOptions];
+          // 重置分页参数 - 从第一页开始
+          this.currentPage = 1;
+          // 默认展示前100条
+          this.displayCourseOptions = this.courseOptions.slice(0, this.pageSize);
+          this.hasMore = this.courseOptions.length > this.pageSize;
+
+          // 处理课程数据为虚拟滚动格式
+          this.processCourseData(this.courseOptions);
+        } else {
+          console.warn('getAllCourseList 返回的数据不是数组格式:', response.data);
+          this.courseOptions = [];
+          this.displayCourseOptions = [];
+          this.allCourseOptions = [];
+          this.hasMore = false;
+          this.courseFlattenedNodes = [];
+          this.courseNodeMap.clear();
+        }
+      } catch (error) {
+        console.error('课程列表加载失败:', error);
+        this.courseOptions = [];
+        this.displayCourseOptions = [];
+        this.allCourseOptions = [];
+        this.hasMore = false;
+        this.courseFlattenedNodes = [];
+        this.courseNodeMap.clear();
+      }
+    },
+
+
     /** 查询应用列表 */
     getList() {
       this.loading = true;

+ 163 - 35
src/views/gw/gwAccount/index.vue

@@ -31,7 +31,7 @@
       </el-form-item>
       <el-form-item label="员工" prop="companyUserId">
         <el-select v-model="queryParams.companyUserId" clearable>
-          <el-option v-for="item in qwUserList" :label="item.qwUserName" :value="item.id" />
+          <el-option v-for="item in qwUserList" :label="item.nickName" :value="item.userId" />
         </el-select>
       </el-form-item>
       <el-form-item>
@@ -49,46 +49,41 @@
           @click="handleAdd"
           v-hasPermi="['company:companyWx:add']"
         >新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['company:companyWx:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['company:companyWx:remove']"
-        >删除</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['company:companyWx:export']"
-        >导出</el-button>
       </el-col>
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
     <el-table v-loading="loading" :data="companyAccountList" @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="wxNickName" />
+      <el-table-column label="头像" width="150" align="center">
+        <template slot-scope="scope">
+          <img :src="scope.row.headImgUrl" style="height: 80px">
+        </template>
+      </el-table-column>
       <el-table-column label="微信号" align="center" prop="wxNo" />
       <el-table-column label="手机号" align="center" prop="phone" />
-      <el-table-column label="员工" align="center" prop="companyUserName" />
+      <el-table-column label="员工" align="center">
+        <template slot-scope="scope">
+          <el-tag>{{scope.row.companyUserName}}</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="登录状态" align="center">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.loginStatus == 1" type="success">在线</el-tag>
+          <el-tag v-else type="danger">离线</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="在线/离线时间" align="center">
+        <template slot-scope="scope">
+          <el-tag type="danger" v-if="scope.row.loginStatus == 0">{{scope.row.outTime}}</el-tag>
+          <el-tag type="success" v-if="scope.row.loginStatus == 1">{{scope.row.loginTime}}</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="离线备注" align="center" prop="outRemark">
+        <template slot-scope="scope">
+          <p v-if="scope.row.loginStatus == 0">{{scope.row.outRemark}}</p>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -98,6 +93,48 @@
             @click="handleUpdate(scope.row)"
             v-hasPermi="['company:companyWx:edit']"
           >修改</el-button>
+          <el-button
+            v-if="scope.row.serverStatus == 0"
+            size="mini"
+            type="text"
+            @click="bind(scope.row)"
+          >获取PAD</el-button>
+          <el-button
+            v-if="scope.row.serverStatus == 1 && scope.row.loginStatus == 0"
+            size="mini"
+            type="text"
+            @click="login(scope.row, 'ipad')"
+          >登录IPAD</el-button>
+          <el-button
+            v-if="scope.row.serverStatus == 1 && scope.row.loginStatus == 0"
+            size="mini"
+            type="text"
+            @click="login(scope.row, 'mac')"
+          >登录Mac</el-button>
+          <el-button
+            v-if="scope.row.serverStatus == 1 && scope.row.loginStatus == 0"
+            size="mini"
+            type="text"
+            @click="wkUp(scope.row)"
+          >唤醒登录</el-button>
+          <el-button
+            v-if="scope.row.serverStatus == 1 && scope.row.loginStatus == 1"
+            size="mini"
+            type="text"
+            @click="updateWxInfoFun(scope.row.id)"
+          >更新微信信息</el-button>
+          <el-button
+            v-if="scope.row.serverStatus == 1 && scope.row.loginStatus == 1"
+            size="mini"
+            type="text"
+            @click="wxLoginOutFun(scope.row.id)"
+          >退出微信</el-button>
+          <el-button
+            v-if="scope.row.serverStatus == 1 && scope.row.loginStatus == 1"
+            size="mini"
+            type="text"
+            @click="syncWxFun(scope.row.id)"
+          >同步通讯录</el-button>
           <el-button
             size="mini"
             type="text"
@@ -140,12 +177,46 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 添加或修改个微账号对话框 -->
+    <el-dialog title="扫码登录" :visible.sync="loginData.open" width="500px" append-to-body>
+    </el-dialog>
+    <el-dialog
+      title="扫码登录"
+      :visible.sync="loginData.open"
+      width="600px"
+      append-to-body
+      custom-class="qr-login-dialog"
+    >
+      <div class="qr-login-container" style="text-align: center;">
+          <el-image
+            :src="loginData.url"
+            style="display: block; margin: 0 auto; width: 300px; height: 300px;"
+          />
+        <p class="qr-login-instructions">使用微信扫码授权登录</p>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { listCompanyAccount, getCompanyAccount, delCompanyAccount, addCompanyAccount, updateCompanyAccount, exportCompanyAccount, companyListAll } from "@/api/company/companyAccount";
-import {getAllUserlist} from "@/api/company/companyUser";
+import {
+  listCompanyAccount,
+  getCompanyAccount,
+  delCompanyAccount,
+  addCompanyAccount,
+  updateCompanyAccount,
+  exportCompanyAccount,
+  companyListAll,
+  getWxQrCode,
+  getLoginStatus,
+  wakeUpLogin,
+  syncWx,
+  updateWxInfo,
+  wxLoginOut,
+  bindService
+} from '@/api/company/companyAccount'
+import { qrCodeStatus } from '@/api/qw/user'
 
 
 export default {
@@ -164,8 +235,13 @@ export default {
       showSearch: true,
       // 总条数
       total: 0,
+      loginData:{
+        open: false,
+        url: null
+      },
       // 个微账号表格数据
       companyAccountList: [],
+      loginQwInterval: null,
       qwUserList: [],
       // 弹出层标题
       title: "",
@@ -242,6 +318,58 @@ export default {
       this.open = true;
       this.title = "添加个微账号";
     },
+    login(row, ipadOrMac){
+      getWxQrCode({accountId: row.id, ipadOrMac}).then(e => {
+        this.loginData.open = true;
+        this.loginData.url = e.data;
+        this.loginStatus(row.id);
+      });
+    },
+    wkUp(row){
+      wakeUpLogin({accountId: row.id}).then(e => {
+        this.loginStatus(row.id);
+      });
+    },
+    loginStatus(id){
+      this.loginQwInterval = setInterval(() => {
+        this.getLoginStatusFun(id);
+      }, 3000);
+    },
+    getLoginStatusFun(id){
+      getLoginStatus({accountId: id}).then(res => {
+        if(res.data){
+          this.loginData.open = false;
+          this.getList();
+          clearInterval(this.loginQwInterval);
+        }
+      });
+    },
+    updateWxInfoFun(id){
+      updateWxInfo({accountId: id}).then(res => {
+        if(res.data){
+          this.loginData.open = false;
+          this.getList();
+          clearInterval(this.loginQwInterval);
+        }
+      });
+    },
+    wxLoginOutFun(id){
+      wxLoginOut({accountId: id}).then(res => {
+        if(res.data){
+          this.getList();
+        }
+      });
+    },
+    syncWxFun(id){
+      syncWx({accountId: id}).then(res => {
+        this.msgSuccess("正在同步......");
+      });
+    },
+    bind(row){
+      bindService({accountId: row.id}).then(e => {
+        this.getList();
+      })
+    },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();

+ 940 - 59
src/views/hisStore/components/productOrder.vue

@@ -11,7 +11,7 @@
       <div>
 
       <el-card shadow="never" style="margin-top: 15px">
-      <div class="operate-container"  v-if="order!=null">
+      <div class="operate-container"  v-show="order!=null">
         <span  style="margin-left: 20px" class="color-danger">订单状态:
            <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="order.status==item.dictValue">{{item.dictLabel}}</el-tag>
         </span>
@@ -156,13 +156,34 @@
 
       <div style="margin-top: 20px">
         <span class="font-small">商品信息</span>
+        <el-button
+          class="select-product-btn"
+          @click="openProductSelection"
+          icon="el-icon-shopping-cart-2"
+          size="small"
+          type="primary"
+          v-hasPermi="['store:storeOrderItem:add']" >
+          新增商品
+        </el-button>
+        <el-button
+          class="remove-product-btn"
+          @click="removeSelectedProduct"
+          icon="el-icon-delete"
+          size="small"
+          type="danger"
+          v-hasPermi="['store:storeOrderItem:remove']">
+          移除商品
+        </el-button>
       </div>
       <el-table
+        ref="itemsTable"
         border
         v-if="items!=null"
         :data="items"
         size="small"
-        style="width: 100%;margin-top: 20px" >
+        style="width: 100%;margin-top: 20px"
+        @selection-change="handleItemsSelectionChange">
+        <el-table-column type="selection" width="55" align="center" />
         <el-table-column label="商品图片" width="150" align="center">
           <template slot-scope="scope">
             <img :src="JSON.parse(scope.row.jsonInfo).image" style="height: 80px">
@@ -185,7 +206,20 @@
         </el-table-column>
         <el-table-column label="数量" width="180" align="center">
           <template slot-scope="scope">
-            {{scope.row.num}}
+            <div class="quantity-cell">
+              <div class="quantity-display">
+                <span class="quantity-value">{{scope.row.num}}</span>
+              </div>
+              <el-button
+                size="mini"
+                type="default"
+                icon="el-icon-edit"
+                class="edit-quantity-btn"
+                @click="showQuantityEdit(scope)"
+                v-hasPermi="['store:storeOrderItem:updateNum']">
+                修改数量
+              </el-button>
+            </div>
           </template>
         </el-table-column>
         <el-table-column label="小计"  align="center">
@@ -201,7 +235,7 @@
       <div style="margin: 60px 0px 20px 0px">
         <span class="font-small">费用信息</span>
       </div>
-      <el-descriptions   :column="4" border  >
+      <el-descriptions  v-if="zdyInfo !== 'gzzdy'"  :column="4" border  >
           <el-descriptions-item label="商品合计"  >
               <span v-if="order!=null">
                 ¥{{order.totalPrice.toFixed(2)}}
@@ -239,6 +273,43 @@
           </el-descriptions-item>
       </el-descriptions>
 
+      <el-descriptions v-if="zdyInfo === 'gzzdy'"   :column="4" border  >
+        <el-descriptions-item label="商品合计"  >
+            <span v-if="order!=null">
+              ¥{{order.totalPrice.toFixed(2)}}
+            </span>
+        </el-descriptions-item>
+        <el-descriptions-item label="应付金额"  >
+            <span v-if="order!=null">
+              ¥{{order.payPrice.toFixed(2)}}
+            </span>
+        </el-descriptions-item>
+        <el-descriptions-item label="实付金额"  >
+            <span v-if="order!=null">
+              ¥{{order.payMoney.toFixed(2)}}
+            </span>
+        </el-descriptions-item>
+        <el-descriptions-item label="代收金额"  >
+            <span v-if="order!=null">
+              ¥{{order.payDelivery.toFixed(2)}}
+            </span>
+          <el-button
+            size="mini"
+            type="primary"
+            plain
+            class="edit-quantity-btn"
+            @click="editPayDeliveryHandle()"
+            v-hasPermi="['store:storeOrder:editPayDelivery']">
+            修改
+          </el-button>
+        </el-descriptions-item>
+        <el-descriptions-item label="优惠券"  >
+            <span v-if="order!=null">
+              ¥{{order.couponPrice.toFixed(2)}}
+            </span>
+        </el-descriptions-item>
+      </el-descriptions>
+
       <div style="margin-top: 20px">
         <svg-icon icon-class="marker" style="color: #606266"></svg-icon>
         <span class="font-small">支付信息</span>
@@ -368,9 +439,9 @@
              <el-select @change="provinceChange" v-model="editAddressForm.provinceId" placeholder="请选择">
                 <el-option
                   v-for="item in province"
-                  :key="item.cityId"
-                  :label="item.name"
-                  :value="item.cityId">
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
                 </el-option>
               </el-select>
           </el-col>
@@ -378,9 +449,9 @@
             <el-select @change="cityChange" v-model="editAddressForm.cityId" placeholder="请选择">
                 <el-option
                   v-for="item in city"
-                  :key="item.cityId"
-                  :label="item.name"
-                  :value="item.cityId">
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
                 </el-option>
               </el-select>
           </el-col>
@@ -388,9 +459,9 @@
              <el-select @change="districtChange" v-model="editAddressForm.districtId" placeholder="请选择">
                 <el-option
                   v-for="item in district"
-                  :key="item.cityId"
-                  :label="item.name"
-                  :value="item.cityId">
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
                 </el-option>
               </el-select>
           </el-col>
@@ -485,25 +556,322 @@
     <el-dialog :title="addSms.title" :visible.sync="addSms.open" width="800px" append-to-body>
         <add-sms ref="sms" @close="closeSms()"></add-sms>
     </el-dialog>
+
+    <!-- 数量修改弹窗 -->
+    <el-dialog :title="quantityDialog.title" :visible.sync="quantityDialog.open" width="500px" append-to-body>
+      <el-form ref="quantityForm" :model="quantityForm" :rules="quantityRules" label-width="100px">
+        <el-form-item label="商品名称">
+          <span class="dialog-product-name">{{quantityForm.productName}}</span>
+        </el-form-item>
+
+        <el-form-item label="当前单价">
+          <el-tag type="info" size="medium">¥{{ quantityForm.price ? quantityForm.price.toFixed(2) : '0.00' }}</el-tag>
+        </el-form-item>
+
+        <el-form-item label="当前数量">
+          <el-tag type="info" size="medium">{{ quantityForm.originalNum }}</el-tag>
+        </el-form-item>
+
+        <el-form-item label="新数量" prop="newNum">
+          <el-input-number
+            v-model="quantityForm.newNum"
+            :min="1"
+            :max="999999"
+            controls-position="right"
+            style="width: 200px">
+          </el-input-number>
+        </el-form-item>
+
+        <el-form-item label="总金额">
+          <el-tag type="danger" size="medium">
+            ¥{{ (quantityForm.newNum * quantityForm.price).toFixed(2) }}
+          </el-tag>
+        </el-form-item>
+      </el-form>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="quantityDialog.open = false">取 消</el-button>
+        <el-button type="primary" @click="submitQuantityForm">确 定</el-button>
+      </div>
+    </el-dialog>
+    <!-- 新增商品弹窗 -->
+    <el-dialog :title="productOrderDialog.title" :visible.sync="productOrderDialog.open" width="1800px" append-to-body>
+      <div class="app-container">
+        <el-form :model="productOrderQueryParams" ref="productOrderQueryForm" :inline="true" label-width="68px">
+          <el-form-item label="商品分类" prop="cateId">
+            <treeselect  v-model="productOrderQueryParams.cateId"  style="width:205.4px" :options="categoryOptions" :normalizer="normalizer" placeholder="请选择分类" />
+          </el-form-item>
+          <el-form-item label="商品名称" prop="productName">
+            <el-input
+              v-model="productOrderQueryParams.productName"
+              placeholder="请输入商品名称"
+              clearable
+              size="small"
+              @keyup.enter.native="productOrderHandleQuery"
+            />
+          </el-form-item>
+          <el-form-item label="商品编号" prop="barCode">
+            <el-input
+              v-model="productOrderQueryParams.barCode"
+              placeholder="请输入商品编号"
+              clearable
+              size="small"
+              @keyup.enter.native="productOrderHandleQuery"
+            />
+          </el-form-item>
+          <el-form-item label="商品类型" prop="productType">
+            <el-select   v-model="productOrderQueryParams.productType" placeholder="请选择商品类型" clearable size="small" >
+              <el-option
+                v-for="item in productTypeOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="所属公司">
+            <el-select style="width: 240px" v-model="companyId" multiple placeholder="请选择企业" clearable size="small" >
+              <el-option
+                v-for="item in companyOptions"
+                :key="item.companyId"
+                :label="item.companyName"
+                :value="item.companyId"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="所属店铺" v-if="this.isStores">
+            <el-select style="width: 240px" v-model="productOrderQueryParams.storeIds" placeholder="请选择店铺" clearable size="small" >
+              <el-option
+                v-for="item in storeOptions"
+                :key="item.storeId"
+                :label="item.storeName"
+                :value="item.storeId"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="cyan" icon="el-icon-search" size="mini" @click="productOrderHandleQuery">搜索</el-button>
+            <el-button icon="el-icon-refresh" size="mini" @click="productOrderResetQuery">重置</el-button>
+          </el-form-item>
+        </el-form>
+
+        <el-table
+          ref="productOrderTable"
+          height="500"
+          border
+          v-loading="productOrderLoading"
+          :data="storeProductList"
+          @selection-change="handleProductSelectionChange">
+          <el-table-column type="selection" width="55" align="center" />
+          <el-table-column label="ID" align="center" prop="productId" />
+          <el-table-column label="商品图片" align="center" width="120">
+            <template slot-scope="scope">
+              <el-popover
+                placement="right"
+                title=""
+                trigger="hover">
+                <img slot="reference" :src="scope.row.image" width="100">
+                <img :src="scope.row.image" style="max-width: 150px;">
+              </el-popover>
+            </template>
+          </el-table-column>
+          <el-table-column label="商品名称" show-overflow-tooltip align="center" prop="productName" />
+          <el-table-column label="分类" align="center" prop="cateName" />
+          <el-table-column label="所属公司" align="center" prop="companyName" />
+          <el-table-column label="所属店铺" align="center" prop="storeName" v-if="this.isStores"/>
+          <el-table-column label="售价" align="center" prop="price" >
+            <template slot-scope="scope" >
+              <span v-if="scope.row.price!=null">{{scope.row.price.toFixed(2)}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="原价" align="center" prop="otPrice" >
+            <template slot-scope="scope" >
+              <span v-if="scope.row.otPrice!=null">{{scope.row.otPrice.toFixed(2)}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="销量" align="center" prop="sales" />
+          <el-table-column label="库存" align="center" prop="stock" />
+          <el-table-column label="类型" align="center" prop="productType" >
+            <template slot-scope="scope">
+              <el-tag prop="productType" v-for="(item, index) in productTypeOptions"    v-if="scope.row.productType==item.dictValue">{{item.dictLabel}}</el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column label="状态" align="center" prop="isShow" >
+            <template slot-scope="scope">
+              <el-tag :type="getStatusType(scope.row)" prop="status">
+                {{ getStatusText(scope.row) }}
+              </el-tag>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <pagination
+          v-show="total>0"
+          :total="total"
+          :page.sync="productOrderQueryParams.pageNum"
+          :limit.sync="productOrderQueryParams.pageSize"
+          @pagination="productOrderGetList"
+        />
+
+        <div style="text-align: center; margin-top: 20px;">
+          <el-button
+            type="primary"
+            size="medium"
+            icon="el-icon-plus"
+            @click="handleBatchAdd"
+            v-hasPermi="['store:storeOrderItem:add']"
+            :disabled="!ids || ids.length === 0">
+            批量添加商品
+          </el-button>
+        </div>
+      </div>
+    </el-dialog>
+
+    <!--  修改代收金额  -->
+    <el-dialog :title="editPayDelivery.title" :visible.sync="editPayDelivery.open" width="500px" append-to-body>
+      <el-form ref="payDeliveryForm" :model="payDeliveryForm" :rules="payDeliveryRules" label-width="150px">
+        <el-form-item label="代收金额(元)" prop="payDelivery">
+          <el-input-number
+            v-model="payDeliveryForm.payDelivery"
+            :min="0.01"
+            :precision="2"
+            :step="0.01"
+            size="small"
+            style="width: 150px"
+          >
+          </el-input-number>
+        </el-form-item>
+      </el-form>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="editPayDelivery.open = false">取 消</el-button>
+        <el-button type="primary" @click="submitPayDeliveryForm">确 定</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
 <script>
+import {
+  getExpress,
+  getStoreOrder,
+  getStoreOrderAddress,
+  updateStoreOrder,
+  updateStoreOrderItemJson,
+  bindCustomer,
+  uploadCredentials,
+  getUserPhone,
+  editPayDelivery
+} from "@/api/hisStore/storeOrder";
+import {listStoreProduct} from "@/api/hisStore/storeProduct";
 import {updateUser,getUser } from "@/api/users/user";
 import { getTcmScheduleList } from "@/api/company/tcmScheduleReport";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {getAllStoreProductCategory} from "@/api/hisStore/storeProductCategory";
+import Editor from '@/components/Editor/wang';
+import singleImg from '@/components/Material/single'
+import {getCompanyList} from "@/api/company/company";
+import {listStore} from '@/api/hisStore/store';
+import {addStoreOrderItem, delStoreOrderItem, updateNumStoreOrderItem} from "../../../api/hisStore/storeOrderItem";
 import {getCustomerListBySearch } from "@/api/crm/customer";
 import ImageUpload from '@/components/ImageUpload'
 import Material from '@/components/Material'
-import {bindCustomer,getExpress, listStoreOrder, getStoreOrder, delStoreOrder, addStoreOrder, updateStoreOrder, exportStoreOrder,uploadCredentials, getStoreOrderAddress,getUserPhone} from "@/api/hisStore/storeOrder";
 import {getCitys} from "@/api/hisStore/city";
 import customerDetails from '../../crm/components/customerDetails.vue';
 import addSms from '../../crm/components/addSms.vue';
 export default {
   name: "order",
-  components: {customerDetails,
-    ImageUpload,Material ,addSms},
+  components: {customerDetails,ImageUpload,Material ,addSms,Treeselect,Editor,singleImg},
   data() {
     return {
+      zdyInfo: process.env.VUE_APP_FS_USER_INFO,
+      // 遮罩层
+      productOrderLoading: true,
+      isStores: true,
+      companyId: null,
+      storeId: null,
+      isAudit: null,
+      storeForm: {isAudit:1,status:1},
+      // 总条数
+      total: 0,
+      // 商品表格数据
+      storeProductList: [],
+      productTypeOptions:[],
+      productTuiCateOptions:[],
+      isDisplayOptions:[],
+      isGoodOptions:[],
+      isNewOptions:[],
+      isBestOptions:[],
+      isHotOptions:[],
+      isShowOptions:[],
+      categoryOptions:[],
+      // 企业列表
+      companyOptions:[],
+      storeOptions:[],
+      // 选中的商品列表
+      selectedItems: [],
+      // 批量添加时选中的商品ID列表
+      ids: [],
+      // 是否单选
+      single: true,
+      // 是否多选
+      multiple: true,
+      // 查询参数
+      productOrderQueryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        productName: null,
+        productType: null,
+        isShow: "1",
+        barCode:null,
+        companyIds: null,
+        storeIds: null,
+        drugRegCertNo: null,
+        commonName: null,
+        dosageForm: null,
+        unitPrice: null,
+        batchNumber: null,
+        mah: null,
+        mahAddress: null,
+        manufacturer: null,
+        manufacturerAddress: null,
+        indications: null,
+        dosage: null,
+        adverseReactions: null,
+        contraindications: null,
+        precautions: null,
+        excludeProductIds:[],
+      },
+      productOrderDialog:{
+        title:"商品选择",
+        open:false,
+      },
+      // 数量修改弹窗相关数据
+      quantityDialog: {
+        title: "修改商品数量",
+        open: false,
+      },
+      quantityForm: {
+        itemId: null,
+        productName: null,
+        price: null,
+        //新数量
+        newNum: null,
+        //原始数量
+        originalNum: null
+      },
+      quantityRules: {
+        newNum: [
+          { required: true, message: "数量不能为空", trigger: "blur" },
+          { type: 'number', min: 1, message: "数量至少为1", trigger: "blur" },
+          { type: 'number', max: 999999, message: "数量不能超过999999", trigger: "blur" }
+        ]
+      },
+      // 删除商品相关
+      removeProductLoading: false,
+
       customerUserStatusOptions:[],
       scheduleOptions:[],
       dialogVisibleImage: false,
@@ -602,7 +970,21 @@ export default {
       express:[],
       traces:[],
       payments:[],
-      auditLogs: []
+      auditLogs: [],
+      // 修改代收金额相关参数
+      editPayDelivery: {
+        title: "修改代收金额",
+        open: false,
+      },
+      payDeliveryForm: {
+        id: null,
+        payDelivery: 0.00
+      },
+      payDeliveryRules: {
+        payDelivery: [
+          { required: true, message: "代收金额不能为空", trigger: "blur" },
+        ]
+      },
     };
   },
   created() {
@@ -631,6 +1013,283 @@ export default {
     }
   },
   methods: {
+    // 显示修改数量弹窗
+    showQuantityEdit(scope) {
+      this.quantityForm.itemId = scope.row.itemId;
+      // 解析商品信息并处理可能的错误
+      let parsedJsonInfo;
+      try {
+        parsedJsonInfo = JSON.parse(scope.row.jsonInfo);
+      } catch (error) {
+        console.error('解析商品信息失败:', error);
+        parsedJsonInfo = {};
+      }
+
+      this.quantityForm.productName = parsedJsonInfo.productName || '';
+      this.quantityForm.originalNum = scope.row.num || 0;
+      this.quantityForm.newNum = scope.row.num || 0;
+
+      // 处理价格,确保不会为null
+      const price = parsedJsonInfo.price || 0;
+      this.quantityForm.price = parseFloat(price) || 0;
+      this.quantityDialog.open = true;
+    },
+
+    // 提交数量修改
+    submitQuantityForm() {
+      this.$refs["quantityForm"].validate(valid => {
+        if (valid) {
+          // 验证数量是否发生变化
+          if (this.quantityForm.newNum === this.quantityForm.originalNum) {
+            this.msgInfo("数量未发生变化,无需修改");
+            return;
+          }
+
+          updateNumStoreOrderItem(this.quantityForm).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess("数量修改成功");
+              updateStoreOrderItemJson(this.order.id,1);
+              this.quantityDialog.open = false;
+              this.getOrder(this.order.id);
+            }else{
+              this.msgError(response.message);
+            }
+          }).catch(error => {
+            this.$message.error('请求失败: ' + error.message)
+          });
+        }
+      });
+    },
+
+    openProductSelection(){
+      this.productOrderDialog.open=true;
+
+      // 将已有的productId存入查询参数,用于后端过滤 (返回数组格式)
+      this.productOrderQueryParams.excludeProductIds = this.items.map(item => item.productId).filter(productId => productId);
+
+      // 加载字典和其他数据
+      this.getDicts("store_product_tui_cate").then((response) => {
+        this.productTuiCateOptions = response.data;
+      });
+      this.getDicts("store_product_enable").then((response) => {
+        this.isNewOptions = response.data;
+        this.isBestOptions = response.data;
+        this.isHotOptions = response.data;
+        this.isGoodOptions=response.data;
+        this.isDisplayOptions=response.data;
+      });
+      this.getDicts("store_product_type").then((response) => {
+        this.productTypeOptions = response.data;
+        if(!this.isMedicalMall &&
+          this.productTypeOptions.length === 4){
+          //删除后两项
+          this.productTypeOptions.splice(2,2);
+        }
+      });
+      this.getDicts("store_product_is_show").then((response) => {
+        this.isShowOptions = response.data;
+      });
+      getCompanyList().then(response => {
+        this.companyOptions = response.data;
+      });
+
+      listStore(this.storeForm).then(response => {
+        this.storeOptions = response.rows;
+      });
+      this.getTreeselect();
+      this.productOrderGetList();
+    },
+
+    /** 商品表格选择变化 */
+    handleItemsSelectionChange(selection) {
+      this.selectedItems = selection;
+    },
+
+    /** 移除选中的商品 */
+    removeSelectedProduct() {
+      if (this.selectedItems.length === 0) {
+        this.msgInfo("请先选择要移除的商品");
+        return;
+      }
+
+      const that = this;
+      this.$confirm('确定要移除选中的 ' + this.selectedItems.length + ' 个商品吗?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        that.removeProductLoading = true;
+        // 收集所有要删除的商品ID
+        const deletePromises = that.selectedItems.map(item => {
+          return delStoreOrderItem(item.itemId);
+        });
+
+        // 并行删除所有选中的商品
+        Promise.all(deletePromises).then(responses => {
+          // 检查所有删除操作是否成功
+          const allSuccess = responses.every(response => response.code === 200);
+          if (allSuccess) {
+            that.msgSuccess("商品移除成功");
+            // 清除选择并刷新订单数据
+            that.selectedItems = [];
+            updateStoreOrderItemJson(this.order.id,1);
+            that.getOrder(that.order.id);
+          } else {
+            that.msgError("商品移除失败: " + (responses.message));
+          }
+        }).catch(error => {
+          that.msgError("移除商品失败: " + (error.message || "网络错误"));
+        })
+      }).catch(() => {
+        // 用户取消操作
+      });
+    },
+
+    /** 查询商品列表 */
+    productOrderGetList() {
+      this.productOrderLoading = true;
+      listStoreProduct(this.productOrderQueryParams).then(response => {
+        this.storeProductList = response.rows;
+        this.total = response.total;
+        this.productOrderLoading = false;
+      }).catch(error => {
+        console.error('获取商品列表失败:', error);
+        this.productOrderLoading = false;
+        this.storeProductList = [];
+        this.total = 0;
+      });
+    },
+
+    /** 批量添加商品到订单 */
+    handleBatchAdd() {
+      if (!this.order || !this.order.id) {
+        this.msgInfo("请先选择订单");
+        return;
+      }
+
+      if (!this.ids || this.ids.length === 0) {
+        this.msgInfo("请先选择要添加的商品");
+        return;
+      }
+
+      const that = this;
+      this.$confirm(`确定要将选中的 ${this.ids.length} 个商品添加到订单中吗?`, "确认添加", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "info"
+      }).then(() => {
+        // 获取选中的商品列表
+        const selectedProducts = this.storeProductList.filter(product =>
+          this.ids.includes(product.productId)
+        );
+
+        // 创建批量添加的订单项数据
+        const batchAddPromises = selectedProducts.map(product => {
+          const orderItemData = {
+            orderId: this.order.id,
+            orderCode: this.order.orderCode,
+            cartId: null,
+            productId: product.productId,
+            num: 1, // 默认数量为1
+            jsonInfo: JSON.stringify({
+              image: product.image,
+              productId: product.productId,
+              num: 1, // 默认数量为1
+              productName: product.productName,
+              barCode: product.barCode,
+              price: product.price,
+              sku: product.sku || '默认'
+            })
+          };
+          return addStoreOrderItem(orderItemData);
+        });
+
+        // 并行添加所有选中的商品
+        Promise.all(batchAddPromises)
+          .then(responses => {
+            // 检查所有添加操作是否成功
+            const allSuccess = responses.every(response => response.code === 200);
+            if (allSuccess) {
+              that.msgSuccess(`成功添加 ${responses.length} 个商品`);
+
+              // 更新过滤列表,包含新添加的商品ID
+              const newIds = selectedProducts.map(p => p.productId);
+              const currentIds = this.productOrderQueryParams.excludeProductIds || [];
+              const updatedIds = [...new Set([...currentIds, ...newIds])]; // 去重
+              this.productOrderQueryParams.excludeProductIds = updatedIds;
+              updateStoreOrderItemJson(this.order.id,1);
+              this.productOrderDialog.open = false;
+              that.getOrder(that.order.id);
+            } else {
+              const failedCount = responses.filter(r => r.code !== 200).length;
+              that.msgError(`添加失败 ${failedCount} 个商品`);
+            }
+          })
+          .catch(error => {
+            that.msgError("批量添加商品失败: " + (error.message || "网络错误"));
+          });
+      }).catch(() => {
+        // 用户取消操作
+      });
+    },
+
+    // 多选框选中数据
+    handleProductSelectionChange(selection) {
+      this.ids = selection.map(item => item.productId).filter(id => id); // 过滤空值
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length
+    },
+    /** 搜索按钮操作 */
+    productOrderHandleQuery() {
+      this.productOrderQueryParams.pageNum = 1;
+      this.productOrderQueryParams.isShow = 1;
+      this.productOrderQueryParams.companyIds = this.companyId +''
+      this.productOrderGetList();
+    },
+    /** 重置按钮操作 */
+    productOrderResetQuery() {
+      this.resetForm("productOrderQueryForm");
+      // 重置所属公司
+      this.companyId = null;
+      // 重置所属店铺
+      this.productOrderQueryParams.storeIds = null;
+      this.productOrderQueryParams.isShow = 1;
+      this.productOrderQueryParams.companyIds = null;
+      this.productOrderGetList();
+    },
+
+    /** 转换商品分类数据结构 */
+    normalizer(node) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.cateId,
+        label: node.cateName,
+        children: node.children
+      };
+    },
+    getStatusType(row) {
+      if (row.isAudit == 0) {
+        return 'warning';
+      }
+      // 根据你的业务逻辑返回不同的类型,如:success, danger, info等
+      return row.isShow == 1 ? 'success' : 'info';
+    },
+    getStatusText(row) {
+      if (row.isAudit == 0) {
+        return '待审核';
+      }
+      const option = this.isShowOptions.find(item => item.dictValue == row.isShow);
+      return option ? option.dictLabel : '未知状态';
+    },
+    getTreeselect() {
+      getAllStoreProductCategory().then(response => {
+        this.categoryOptions = [];
+        this.categoryOptions=this.handleTree(response.data, "cateId", "pid");
+      });
+    },
+
     closeSms(){
       this.addSms.open=false;
     },
@@ -715,6 +1374,7 @@ export default {
     },
     showExpress(){
       this.expressDialog.open=true;
+      this.traces = [];
       getExpress(this.orderId).then(response => {
           this.express = response.data;
           if(this.express!=null&&this.express.Traces!=null){
@@ -725,67 +1385,121 @@ export default {
 
     },
     districtChange(val){
-      var item=this.citys.find((item)=>{
-        return item.cityId==val&&item.level==2;
+      var item=this.district.find((item)=>{
+        return item.value==val;
       })
-      this.editAddressForm.district=item.name;
+
+      this.editAddressForm.district=item.label;
 
     },
     cityChange(val){
-      this.district=this.citys.filter(item => item.parentId===val )
+      // this.district=this.citys.filter(item => item.value===val )
       this.editAddressForm.districtId=null;
-      var item=this.citys.find((item)=>{
-        return item.cityId==val&&item.level==1;
+      var item=this.city.find((item)=>{
+        return item.value==val;
       })
-      this.editAddressForm.city=item.name;
+      console.log(item)
+      this.district = item.children;
+      this.editAddressForm.city=item.label;
 
 
     },
     provinceChange(val){
-      this.city=this.citys.filter(item => item.parentId===val )
+      // this.city=this.citys.filter(item => item.value===val )
       this.district=[];
       this.editAddressForm.cityId=null;
       this.editAddressForm.districtId=null;
       var item=this.citys.find((item)=>{
-        return item.cityId==val&&item.level==0;
+        return item.value==val;
       })
-      this.editAddressForm.province=item.name;
+      this.city = item.children;
+      this.editAddressForm.province=item.label;
     },
-    getCityList(){
-      getCitys().then(res => {
-          this.citys=res.data;
-          this.province=res.data.filter(item => item.level===0 )
-        })
+    async getCityList() {
+      try {
+        const res = await getCitys();
+        this.citys = res.data;
+        this.province = res.data.filter(item => item.pid === 0);
+        // 可选:返回数据以便链式调用
+        return res.data;
+      } catch (error) {
+        console.error('获取城市列表失败:', error);
+      }
     },
-    handleEditAddress() {
-        this.getCityList();
-        this.editAddressForm.id=this.order.id;
-        this.editAddressForm.realName=this.order.realName;
-        this.editAddressForm.userPhone=this.order.userPhone;
-        var address=this.order.userAddress.split(' ')
-        var province=this.citys.find((item)=>{
-          return item.name==address[0]&&item.level==0;
-        })
-        if(province!=null){
-          this.editAddressForm.provinceId=province.cityId;
-          this.city=this.citys.filter(item => item.parentId===province.cityId&&item.level==1 )
-        }
-        var city=this.citys.find((item)=>{
-          return item.name==address[1]&&item.level==1;
-        })
+    async handleEditAddress() {
+      // 等待城市数据加载完成
+      await this.getCityList();
 
-        if(city!=null){
-          this.editAddressForm.cityId=city.cityId;
-          this.district=this.citys.filter(item => item.parentId===city.cityId&&item.level==2 )
-        }
-        var district=this.citys.find((item)=>{
-          return item.name==address[2]&&item.level==2;
-        })
-        if(district!=null){
-          this.editAddressForm.districtId=district.cityId;
-        }
+      // 初始化表单数据
+      this.editAddressForm.id = this.order.id;
+      this.editAddressForm.realName = this.order.realName;
+      this.editAddressForm.userPhone = this.order.userPhone;
+
+      // 初始化表单中的地址字段
+      this.editAddressForm.provinceId = '';
+      this.editAddressForm.cityId = '';
+      this.editAddressForm.districtId = '';
+      this.editAddressForm.detail = '';
+
+      // 初始化级联数据
+      this.city = [];
+      this.district = [];
 
+      // 检查是否有地址数据
+      if (!this.order?.userAddress) {
         this.editAddress.open = true;
+        return;
+      }
+
+      // 分割地址
+      const addressParts = this.order.userAddress.trim().split(/\s+/);
+
+      // 如果地址格式不正确,将整个地址作为详情
+      if (addressParts.length < 4) {
+        this.editAddressForm.detail = this.order.userAddress;
+        this.editAddress.open = true;
+        return;
+      }
+
+      // 解析省份
+      const provinceName = addressParts[0];
+      const province = this.citys?.find(item => item.label === provinceName);
+
+      if (province) {
+        this.editAddressForm.provinceId = province.value;
+
+        // 获取城市列表
+        if (Array.isArray(province.children)) {
+          this.city = province.children.filter(item => item.pid === province.value);
+
+          // 解析城市
+          const cityName = addressParts[1];
+          const city = this.city.find(item => item.label === cityName);
+
+          if (city) {
+            this.editAddressForm.cityId = city.value;
+
+            // 获取区县列表
+            if (Array.isArray(city.children)) {
+              this.district = city.children.filter(item => item.pid === city.value);
+
+              // 解析区县
+              const districtName = addressParts[2];
+              const district = this.district.find(item => item.label === districtName);
+
+              if (district) {
+                this.editAddressForm.districtId = district.value;
+              }
+            }
+          }
+        }
+      }
+
+      // 详细地址是剩余部分
+      this.editAddressForm.detail = addressParts.slice(3).join(' ');
+
+      // 打开编辑对话框
+      this.editAddress.open = true;
     },
     /** 提交按钮 */
     submitEditAddressForm() {
@@ -866,7 +1580,31 @@ export default {
             this.customerInfo=response.customer;
             this.auditLogs = response.auditLogs;
         });
-     }
+     },
+    editPayDeliveryHandle() {
+      this.payDeliveryForm.id =  this.orderId;
+      this.payDeliveryForm.payDelivery = this.order.payDelivery || 0.00;
+      this.editPayDelivery.open = true;
+    },
+    // 提交修改代收金额
+    submitPayDeliveryForm() {
+      this.$refs["payDeliveryForm"].validate(valid => {
+        if (valid) {
+          editPayDelivery(this.payDeliveryForm).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess("修改成功");
+              this.editPayDelivery.open = false;
+              this.getOrder(this.order.id);
+            }else{
+              this.msgError(response.message);
+            }
+          }).catch(error => {
+            this.$message.error('请求失败: ' + error.message)
+          });
+        }
+      });
+    },
+
   }
 };
 </script>
@@ -919,4 +1657,147 @@ export default {
   font-size: 14px;
   color: #303133;
 }
+.container {
+  position: relative;
+}
+.select-product-btn {
+  float: right;
+  margin-top: -5px;
+  margin-right: 15px;
+  background: linear-gradient(135deg, #409EFF, #337AB7);
+  border: none;
+  color: white;
+  border-radius: 6px;
+  padding: 8px 16px;
+  font-weight: 500;
+  box-shadow: 0 3px 6px rgba(64, 158, 255, 0.2);
+  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
+}
+
+.select-product-btn:hover {
+  background: linear-gradient(135deg, #66b1ff, #409EFF);
+  transform: translateY(-2px);
+  box-shadow: 0 5px 12px rgba(64, 158, 255, 0.35);
+}
+
+.select-product-btn:active {
+  transform: translateY(0);
+  box-shadow: 0 2px 4px rgba(64, 158, 255, 0.2);
+}
+
+.select-product-btn:focus {
+  outline: none;
+  box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.3);
+}
+
+.select-product-btn:disabled {
+  background: linear-gradient(135deg, #a0cfff, #b3d8ff);
+  cursor: not-allowed;
+  transform: none;
+  box-shadow: none;
+}
+
+.remove-product-btn {
+  float: right;
+  margin-top: -5px;
+  margin-right: 15px;
+  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
+  border: none;
+  color: white;
+  border-radius: 6px;
+  padding: 8px 16px;
+  font-weight: 500;
+  box-shadow: 0 3px 6px rgba(255, 107, 107, 0.15);
+  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
+}
+
+.remove-product-btn:hover {
+  background: linear-gradient(135deg, #ff5252, #e74c3c);
+  transform: translateY(-2px);
+  box-shadow: 0 5px 12px rgba(255, 107, 107, 0.25);
+}
+
+.remove-product-btn:active {
+  transform: translateY(0);
+  box-shadow: 0 2px 4px rgba(255, 107, 107, 0.2);
+}
+
+.remove-product-btn:focus {
+  outline: none;
+  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.3);
+}
+
+.remove-product-btn:disabled {
+  background: linear-gradient(135deg, #ffcccc, #f8d7da);
+  cursor: not-allowed;
+  transform: none;
+  box-shadow: none;
+}
+
+.quantity-cell {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 100%;
+  padding: 0 5px;
+}
+
+.quantity-display {
+  display: flex;
+  align-items: center;
+  gap: 4px; /* 缩小数量与按钮之间的间距 */
+}
+
+.quantity-value {
+  font-weight: 600;
+  color: #606266;
+  background-color: #f5f7fa;
+  padding: 4px 8px;
+  border-radius: 4px;
+  min-width: 40px;
+  text-align: center;
+}
+
+.edit-quantity-btn {
+  margin-left: 4px; /* 缩小左边距 */
+  padding: 4px 8px;
+  border: 1px solid #dcdfe6;
+  border-radius: 4px;
+  color: #409eff;
+  background: transparent;
+  cursor: pointer;
+  transition: all 0.2s ease;
+}
+
+.edit-quantity-btn:hover {
+  background-color: #ecf5ff;
+  border-color: #b3d8ff;
+  color: #66b1ff;
+  transform: translateY(-1px);
+}
+
+.edit-quantity-btn i {
+  margin-right: 2px;
+  font-size: 12px;
+}
+
+.edit-quantity-btn:hover {
+  background-color: #ecf5ff;
+  border-color: #b3d8ff;
+  color: #66b1ff;
+  transform: translateY(-1px);
+}
+
+.edit-quantity-btn i {
+  margin-right: 2px;
+  font-size: 12px;
+}
+.dialog-product-name {
+  font-weight: 500;
+  color: #303133;
+  word-break: break-all;
+  max-width: 350px;
+  display: inline-block;
+  vertical-align: middle;
+}
 </style>

+ 10 - 0
src/views/hisStore/storeAfterSales/list.vue

@@ -90,6 +90,15 @@
               />
         </el-select>
       </el-form-item>
+
+      <el-form-item label="银行交易流水" prop="bankTransactionId" label-width="100">
+          <el-input
+            v-model="queryParams.bankTransactionId"
+            placeholder="请输入银行交易流水"
+            clearable
+            size="small"
+            @keyup.enter.native="handleQuery"/>
+       </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -216,6 +225,7 @@ export default {
         shipperCode: null,
         deliverySn: null,
         deliveryName: null,
+        bankTransactionId: null,
         status: null,
         salesStatus: null,
         isDel: null,

+ 60 - 3
src/views/hisStore/storeOrder/list.vue

@@ -154,6 +154,12 @@
                     />
             </el-select>
         </el-form-item>
+          <el-form-item label="是否审核" prop="isAudit">
+            <el-select   v-model="queryParams.isAudit" placeholder="请选择" clearable size="small" >
+              <el-option key="1"  label="是" value="1" />
+              <el-option key="0"  label="否" value="0" />
+            </el-select>
+          </el-form-item>
           <el-form-item>
             <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -186,6 +192,17 @@
               v-hasPermi="['store:storeOrder:exportItems']"
             >导出订单明细</el-button>
           </el-col>
+          <!-- <el-col :span="1.5">
+            <el-button
+              type="success"
+              icon="el-icon-s-check"
+              size="mini"
+              :disabled="multiple"
+              @click="handleOrderAudit"
+              v-hasPermi="['store:storeOrder:batchAudit']"
+            >确认审核
+            </el-button>
+          </el-col> -->
         <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
         <el-tabs type="card" v-model="activeName" @tab-click="handleClick">
@@ -236,6 +253,11 @@
                   <span v-if="scope.row.payPrice!=null">{{scope.row.payPrice.toFixed(2)}}</span>
               </template>
           </el-table-column>
+          <el-table-column label="代收金额" align="center" 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="createTime" />
           <!-- <el-table-column label="支付状态" align="center" prop="paid" /> -->
           <el-table-column label="支付时间" align="center" prop="payTime" width="180">
@@ -270,6 +292,13 @@
               <span v-else class="no-products">暂无商品</span>
             </template>
           </el-table-column>
+          <el-table-column label="是否审核" align="center" prop="isAudit" width="100px">
+            <template slot-scope="scope">
+              <el-tag :type="scope.row.isAudit == 1 ? 'success' : 'info'" size="small">
+                {{ scope.row.isAudit == 1 ? '是' : '否' }}
+              </el-tag>
+            </template>
+          </el-table-column>
           <el-table-column label="状态" align="center" prop="status" >
               <template slot-scope="scope">
                   <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
@@ -295,6 +324,12 @@
                 @click="handleDetails(scope.row)"
                 v-hasPermi="['store:storeOrder:query']"
               >查看</el-button>
+              <el-button
+                size="mini"
+                type="text"
+                @click="handleOrderAudit(scope.row)"
+                v-hasPermi="['store:storeOrder:batchAudit']"
+              >确认审核</el-button>
            <!--    <el-button
                 size="mini"
                 type="text"
@@ -472,7 +507,7 @@
 </template>
 
 <script>
-import {exportStoreOrderItems, createUserOrder,listStoreOrder, getStoreOrder, delStoreOrder, addStoreOrder, updateStoreOrder, exportStoreOrder } from "@/api/hisStore/storeOrder";
+import {exportStoreOrderItems, createUserOrder,listStoreOrder, getStoreOrder, delStoreOrder, addStoreOrder, updateStoreOrder, exportStoreOrder, auditStoreOrder } from "@/api/hisStore/storeOrder";
 import { getUserList } from "@/api/users/user";
 import { getAddressList } from "@/api/users/userAddress";
 import { getTcmScheduleList } from "@/api/company/tcmScheduleReport";
@@ -609,7 +644,8 @@ export default {
         shippingType: null,
         isChannel: null,
         isRemind: null,
-        isSysDel: null
+        isSysDel: null,
+        isAudit:null,
       },
       // 表单参数
       form: {
@@ -964,7 +1000,28 @@ export default {
         }).then(response => {
           this.download(response.msg);
         }).catch(function() {});
-    }
+    },
+
+    /** 订单确认审核 */
+    handleOrderAudit(row){
+      // if (this.ids.length === 0) {
+      //   this.$message.warning('请至少勾选一条订单进行审核');
+      //   return;
+      // }
+      const ids = [row.id];
+      this.$confirm('是否确认审核选中的订单?', "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        return auditStoreOrder({ orderIds: ids, isAudit: 1 });
+      }).then((response) => {
+        this.getList();
+        this.msgSuccess(response.msg || "审核成功");
+      }).catch(() => {
+      });
+    },
+
   }
 };
 </script>

+ 59 - 5
src/views/index.vue

@@ -240,9 +240,21 @@
             <el-radio-button label="本周"></el-radio-button>
             <el-radio-button label="本月"></el-radio-button>
             <el-radio-button label="上月"></el-radio-button>
+            <el-radio-button label="指定日期" v-if="showCompanyField"></el-radio-button>
           </el-radio-group>
+          <el-date-picker
+      v-if="queryTime === '指定日期'"
+      v-model="specificDate"
+      type="date"
+      placeholder="请选择日期"
+      :picker-options="pickerOptions"
+      format="yyyy-MM-dd"
+      value-format="yyyy-MM-dd"
+      size="medium"
+      style=" width: 150px;"
+      @change="handleAnalysis"
+    ></el-date-picker>
         </div>
-
         <div class="action-group">
           <el-radio-group v-model="userTypeText" @change="handleUserType">
             <el-radio-button label="会员"></el-radio-button>
@@ -1018,9 +1030,44 @@ export default {
       // 商品总数
       goodsTotalNum: 0,
       // 今日商品总数
-      todayGoodsNum: 0
+      todayGoodsNum: 0,
+      // 指定选择的日期
+      specificDate:null,
+      pickerOptions: {
+        disabledDate(time) {
+          // 可选:限制只能选择今天及以前的日期
+          return time.getTime() > Date.now();
+        },
+        // // 快捷选择
+        // shortcuts: [{
+        //   text: '今天',
+        //   onClick(picker) {
+        //     picker.$emit('pick', new Date());
+        //   }
+        // }, {
+        //   text: '昨天',
+        //   onClick(picker) {
+        //     const date = new Date();
+        //     date.setTime(date.getTime() - 3600 * 1000 * 24);
+        //     picker.$emit('pick', date);
+        //   }
+        // }, {
+        //   text: '一周前',
+        //   onClick(picker) {
+        //     const date = new Date();
+        //     date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
+        //     picker.$emit('pick', date);
+        //   }
+        // }]
+      }
     }
   },
+  computed: {
+    // 计算属性判断是否显示
+    showCompanyField() {
+      return process.env.VUE_APP_TITLE_INDEX === '恒春来';
+    },
+  },
   mounted() {
     this.$nextTick(() => {
       this.initViewerChart()
@@ -1349,7 +1396,11 @@ export default {
         param.startTime = this.formatDate(lastMonth.startOf('month'));
         param.endTime = this.formatDate(lastMonth.endOf('month'));
         type = 4;
-      } else {
+      }else if(this.queryTime === '指定日期'){
+        param.startTime = this.formatDate(this.specificDate);
+        param.endTime = this.formatDate(this.specificDate);
+        type = 5;
+      }else {
         console.warn(`未知的 queryTime: ${this.queryTime}, 默认使用今日`);
         param.startTime = this.formatDate(today);
         param.endTime = this.formatDate(today);
@@ -1360,7 +1411,10 @@ export default {
     },
     // 分析概览
     handleAnalysis(e) {
-
+      if(this.queryTime === '指定日期' && this.specificDate === null ){
+        return;
+      }
+      if(this.queryTime != '指定日期')this.specificDate = null;
       let param = this.getParam();
       analysisPreview(param).then(res => {
         if (res.code === 200) {
@@ -1387,7 +1441,7 @@ export default {
       } else if (this.selectedDiv === 2) {
         this.handleAnswerRedPackViewerChart()
         this.handleAnswerRedPackMoneyViewerChart()
-      }
+      }     
     },
     handleAnswerRedPackViewerChart(){
       let param = this.getParam();

+ 71 - 4
src/views/live/live/index.vue

@@ -151,6 +151,7 @@
           <el-tag v-else>总台</el-tag>
         </template>
       </el-table-column>
+
       <el-table-column label="直播类型" align="center" prop="liveType">
         <template slot-scope="scope">
           <el-tag type="danger" v-if="scope.row.liveType == 1">直播</el-tag>
@@ -257,6 +258,12 @@
               >
                 <i class="el-icon-service"></i> 查看二维码
               </el-dropdown-item>
+<!--              <el-dropdown-item-->
+<!--                @click.native="handleExportComments(scope.row)"-->
+<!--                :disabled="exportingComments[scope.row.liveId]"-->
+<!--              >-->
+<!--                <i class="el-icon-download"></i> 导出评论-->
+<!--              </el-dropdown-item>-->
             </el-dropdown-menu>
           </el-dropdown>
 
@@ -304,9 +311,14 @@
           </el-radio-group>
         </el-form-item>
         <el-form-item label="直播类型" prop="liveType">
-          <el-radio-group v-model="form.liveType" :disabled="isViewOnly">
-<!--            <el-radio :label="1">直播</el-radio>-->
-            <el-radio :label="2">录播</el-radio>
+          <el-radio-group v-model="form.liveType">
+            <el-radio
+              v-for="item in liveTypeDictList"
+              :key="item.dictValue"
+              :label="parseInt(item.dictValue)"
+            >
+              {{ item.dictLabel }}
+            </el-radio>
           </el-radio-group>
         </el-form-item>
 <!--        <el-form-item label="直播达人" prop="talentId">-->
@@ -427,6 +439,7 @@ import {
   finishLive,
   startLive, copyLive,generateCode
 } from "@/api/live/live";
+import { exportLiveMsgComments } from "@/api/live/liveMsg";
 import Editor from '@/components/Editor/wang';
 import user from '@/store/modules/user';
 import VideoUpload from "@/components/LiveVideoUpload/single.vue";
@@ -436,6 +449,7 @@ export default {
   components: { Editor,VideoUpload },
   data() {
     return {
+      liveTypeDictList: [],
       // 是否只读
       isViewOnly:false,
       baseUrl: process.env.VUE_APP_BASE_API,
@@ -530,11 +544,17 @@ export default {
       videoUrl: "",
       qrcodeDialogVisible: false,  // 弹窗显示状态:默认隐藏
       currentQrcodeUrl: "",        // 当前要展示的二维码地址
-      defaultImg: "https://via.placeholder.com/400x400?text=二维码加载失败"  // 占位图
+      defaultImg: "https://via.placeholder.com/400x400?text=二维码加载失败",  // 占位图
+      // 导出评论状态:key为liveId,value为是否正在导出
+      exportingComments: {}
     };
   },
   created() {
     this.getList();
+    // 新增:获取直播类型字典
+    this.getDicts("live_type").then((response) => {
+      this.liveTypeDictList = response.data;
+    });
   },
   watch: {
     'form.startTime': {
@@ -977,7 +997,54 @@ export default {
         this.download(response.msg);
         this.exportLoading = false;
       }).catch(() => {});
+    },
+    /** 导出评论按钮操作 */
+    handleExportComments(row) {
+      const liveId = row.liveId;
+      // 检查是否正在导出
+      if (this.exportingComments[liveId]) {
+        this.$message.warning("正在导出中,请勿重复操作");
+        return;
+      }
+
+      // 检查是否有其他直播间正在导出
+      const hasExporting = Object.values(this.exportingComments).some(status => status === true);
+      if (hasExporting) {
+        this.$message.warning("当前已有导出任务进行中,请等待完成后再试");
+        return;
+      }
+
+      this.$confirm('是否确认导出该直播间的评论数据?', "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "info"
+      }).then(() => {
+        // 设置导出状态
+        this.$set(this.exportingComments, liveId, true);
+
+        exportLiveMsgComments(liveId).then(response => {
+          // 创建blob对象
+          const blob = new Blob([response], { type: 'application/vnd.ms-excel' });
+          // 创建下载链接
+          const url = window.URL.createObjectURL(blob);
+          const link = document.createElement('a');
+          link.href = url;
+          link.setAttribute('download', `直播评论_${row.liveName || liveId}_${new Date().getTime()}.xlsx`);
+          document.body.appendChild(link);
+          link.click();
+          document.body.removeChild(link);
+          window.URL.revokeObjectURL(url);
+
+          this.$message.success("导出成功");
+        }).catch(error => {
+          this.$message.error(error.msg || "导出失败");
+        }).finally(() => {
+          // 清除导出状态
+          this.$set(this.exportingComments, liveId, false);
+        });
+      }).catch(() => {});
     }
+
   }
 };
 </script>

+ 26 - 5
src/views/live/liveAfteraSales/index.vue

@@ -99,6 +99,14 @@
           @keyup.enter.native="handleQuery"/>
       </el-form-item>
 
+      <el-form-item label="银行交易流水" prop="bankTransactionId" label-width="100">
+          <el-input
+            v-model="queryParams.bankTransactionId"
+            placeholder="请输入银行交易流水"
+            clearable
+            size="small"
+            @keyup.enter.native="handleQuery"/>
+       </el-form-item>
 
       <el-form-item label="提交时间" prop="createTime">
         <el-date-picker
@@ -250,6 +258,7 @@ export default {
         shipperCode: null,
         deliverySn: null,
         deliveryName: null,
+        bankTransactionId: null,
         status: null,
         salesStatus: null,
         isDel: null,
@@ -308,7 +317,13 @@ export default {
     /** 查询售后记录列表 */
     getList() {
       this.loading = true;
-      listLiveAfterSales(this.queryParams).then(response => {
+      const params = { ...this.queryParams };
+      // 处理日期范围
+      if (this.dateRange && this.dateRange.length === 2) {
+        params.createTimeBegin = this.dateRange[0];
+        params.createTimeEnd = this.dateRange[1];
+      }
+      listLiveAfterSales(params).then(response => {
         this.liveAfterSalesList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -356,6 +371,7 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
+      this.dateRange = [];
       this.resetForm("queryForm");
       this.handleQuery();
     },
@@ -417,20 +433,25 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
+      const params = { ...this.queryParams };
+      // 处理日期范围
+      if (this.dateRange && this.dateRange.length === 2) {
+        params.createTimeBegin = this.dateRange[0];
+        params.createTimeEnd = this.dateRange[1];
+      }
       this.$confirm('是否确认导出所有售后记录数据项?', "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"
         }).then(() => {
           this.exportLoading = true;
-          return exportLiveAfterSales(queryParams);
+          return exportLiveAfterSales(params);
         }).then(response => {
           this.download(response.msg);
           this.exportLoading = false;
         }).catch(() => {
-        this.exportLoading = false;
-      });
+          this.exportLoading = false;
+        });
     },
     getTreeselect() {
       var param={companyId:this.companyId}

+ 3 - 0
src/views/live/liveConfig/liveRedConf.vue

@@ -355,6 +355,9 @@ export default {
         redId: row.redId,
         redStatus: status,
         totalLots: row.totalLots,
+        totalSend: row.totalSend,
+        redType: row.redType,
+        redNum: row.redNum,
         liveId: this.liveId,
         status: status,
         duration: row.duration

+ 48 - 60
src/views/live/order/index.vue

@@ -1,20 +1,6 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
-      <el-form-item label="公司名" prop="companyId">
-        <el-select filterable v-model="queryParams.companyId" placeholder="请选择公司名" @change="companyChange" clearable size="small">
-          <el-option
-            v-for="item in companys"
-            :key="item.companyId"
-            :label="item.companyName"
-            :value="item.companyId"
-          />
-        </el-select>
-      </el-form-item>
-
-      <el-form-item>
-        <treeselect style="width: 220px" :clearable="false" v-model="queryParams.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
-      </el-form-item>
 
       <el-form-item label="订单类型" prop="orderTypeFilter">
         <el-select v-model="queryParams.orderTypeFilter" placeholder="请选择订单类型" clearable size="small">
@@ -159,37 +145,37 @@
 <!--        </el-select>-->
 <!--      </el-form-item>-->
 
-      <el-form-item label="结算状态" prop="deliveryPayStatus">
-        <el-select v-model="queryParams.deliveryPayStatus" placeholder="请选择物流结算状态" clearable size="small">
-          <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="deliveryPayStatus">-->
+<!--        <el-select v-model="queryParams.deliveryPayStatus" placeholder="请选择物流结算状态" clearable size="small">-->
+<!--          <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="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="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="productSpec">
-        <el-input
-          v-model="queryParams.productSpec"
-          placeholder="请输入商品规格"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
+<!--      <el-form-item label="商品规格" prop="productSpec">-->
+<!--        <el-input-->
+<!--          v-model="queryParams.productSpec"-->
+<!--          placeholder="请输入商品规格"-->
+<!--          clearable-->
+<!--          size="small"-->
+<!--          @keyup.enter.native="handleQuery"-->
+<!--        />-->
+<!--      </el-form-item>-->
 
 <!--      <el-form-item label="商品数量" prop="totalNum">-->
 <!--        <el-input-->
@@ -251,16 +237,16 @@
 <!--        />-->
 <!--      </el-form-item>-->
 
-      <el-form-item label="档期归属" prop="scheduleId">
-        <el-select filterable style="width: 215px" v-model="queryParams.scheduleId" placeholder="请选择档期" clearable size="small">
-          <el-option
-            v-for="item in scheduleOptions"
-            :key="item.id"
-            :label="item.name"
-            :value="item.id"
-          />
-        </el-select>
-      </el-form-item>
+<!--      <el-form-item label="档期归属" prop="scheduleId">-->
+<!--        <el-select filterable style="width: 215px" v-model="queryParams.scheduleId" placeholder="请选择档期" clearable size="small">-->
+<!--          <el-option-->
+<!--            v-for="item in scheduleOptions"-->
+<!--            :key="item.id"-->
+<!--            :label="item.name"-->
+<!--            :value="item.id"-->
+<!--          />-->
+<!--        </el-select>-->
+<!--      </el-form-item>-->
 
       <el-form-item label="代服账户" prop="erpAccount" v-if="SFDFopen">
         <el-select v-model="queryParams.erpAccount" style="width: 215px" placeholder="ERP账户" clearable size="small">
@@ -291,9 +277,11 @@
           v-model="createTimeRange"
           type="datetimerange"
           value-format="yyyy-MM-dd HH:mm:ss"
+          format="yyyy-MM-dd HH:mm:ss"
           range-separator="至"
           start-placeholder="开始日期"
           end-placeholder="结束日期"
+          :default-time="['00:00:00', '23:59:59']"
           @change="handleOrderTimeChange"
         />
       </el-form-item>
@@ -306,8 +294,11 @@
           v-model="payTimeRange"
           type="datetimerange"
           value-format="yyyy-MM-dd HH:mm:ss"
+          format="yyyy-MM-dd HH:mm:ss"
           start-placeholder="开始日期"
           end-placeholder="结束日期"
+          :default-time="['00:00:00', '23:59:59']"
+          @change="handlePayTimeChange"
         />
       </el-form-item>
 
@@ -913,13 +904,10 @@ export default {
       this.getList()
     },
     handleOrderTimeChange(value) {
-      if (value && value.length === 2) {
-        this.queryParams.createTimeStart = value[0]
-        this.queryParams.createTimeEnd = value[1]
-      } else {
-        this.queryParams.createTimeStart = null
-        this.queryParams.createTimeEnd = null
-      }
+
+    },
+    handlePayTimeChange(value) {
+
     },
     /** 导出订单 */
     handleExport() {

+ 9 - 9
src/views/live/order/liveDetail.vue

@@ -73,6 +73,10 @@
           <el-descriptions-item label=" 公众号/渠道" ><span v-if="item!=null">{{item.channel}}</span></el-descriptions-item>
           <el-descriptions-item label=" 渠道" ><span v-if="item!=null"><dict-tag :options="channelOptions" :value="item.orderChannel"/></span></el-descriptions-item>
           <el-descriptions-item label=" 企微主体" ><span v-if="item!=null"><dict-tag :options="qwSubjectOptions" :value="item.qwSubject"/></span></el-descriptions-item>
+          <el-descriptions-item label="物流公司编码" ><span v-if="item!=null">{{item.deliveryCode}}</span></el-descriptions-item>
+          <el-descriptions-item label="物流公司名称" ><span v-if="item!=null">{{item.deliveryName}}</span></el-descriptions-item>
+          <el-descriptions-item label="物流单号" ><span v-if="item!=null">{{item.deliverySn}}</span></el-descriptions-item>
+          <el-descriptions-item label="发货时间" ><span v-if="item!=null">{{item.deliverySendTime}}</span></el-descriptions-item>
         </el-descriptions>
       </el-card>
     </div>
@@ -710,17 +714,15 @@ export default {
 
     //修改订单状态
     submitEditForm(){
+      var that = this;
       this.$refs["editForm"].validate(valid => {
         if (valid) {
           updateLiveOrder(this.editForm).then(response => {
             if (response.code === 200) {
               this.msgSuccess("操作成功");
               this.edit.open = false;
-              getLiveOrder(this.item.orderId).then(response => {
-                this.item=response.data
-                that.getlogList(this.item.orderId);
-                that.$parent.$parent.getList();
-              });
+              // 刷新当前页面数据
+              this.getDetails(this.item.orderId, this.nickName, this.storeName);
             }
           });
         }
@@ -982,10 +984,8 @@ export default {
             if (response.code === 200) {
               this.msgSuccess("操作成功");
               this.editDy.open = false;
-              getLiveOrder(this.item.orderId).then(response => {
-                this.item = response.data;
-                this.$parent.$parent.getList();
-              });
+              // 刷新当前页面数据
+              this.getDetails(this.item.orderId, this.nickName, this.storeName);
             }
           })
         }

+ 8 - 3
src/views/live/order/storeDetail.vue

@@ -81,9 +81,9 @@
 <!--            <el-descriptions-item label="订单类型"  >
               <el-tag prop="orderType" v-for="(item, index) in orderTypeOptions"    v-if="order!=null&&order.orderType==item.dictValue">{{item.dictLabel}}</el-tag>
             </el-descriptions-item>-->
-            <el-descriptions-item label="物流公司编"  >
+            <el-descriptions-item label="物流公司编"  >
                 <span v-if="order!=null">
-                  {{order.deliverySn}}
+                  {{order.deliveryCode || order.deliverySn}}
                 </span>
             </el-descriptions-item>
             <el-descriptions-item label="物流公司名称"  >
@@ -93,7 +93,12 @@
             </el-descriptions-item>
             <el-descriptions-item label="物流单号"  >
                 <span v-if="order!=null">
-                  {{order.deliveryId}}
+                  {{order.deliverySn || order.deliveryId}}
+                </span>
+            </el-descriptions-item>
+            <el-descriptions-item label="发货时间"  >
+                <span v-if="order!=null">
+                  {{order.deliverySendTime}}
                 </span>
             </el-descriptions-item>
             <el-descriptions-item label="物流状态"  >

+ 8 - 3
src/views/live/order/userDetail.vue

@@ -81,9 +81,9 @@
 <!--            <el-descriptions-item label="订单类型"  >
               <el-tag prop="orderType" v-for="(item, index) in orderTypeOptions"    v-if="order!=null&&order.orderType==item.dictValue">{{item.dictLabel}}</el-tag>
             </el-descriptions-item>-->
-            <el-descriptions-item label="物流公司编"  >
+            <el-descriptions-item label="物流公司编"  >
                 <span v-if="order!=null">
-                  {{order.deliverySn}}
+                  {{order.deliveryCode || order.deliverySn}}
                 </span>
             </el-descriptions-item>
             <el-descriptions-item label="物流公司名称"  >
@@ -93,7 +93,12 @@
             </el-descriptions-item>
             <el-descriptions-item label="物流单号"  >
                 <span v-if="order!=null">
-                  {{order.deliveryId}}
+                  {{order.deliverySn || order.deliveryId}}
+                </span>
+            </el-descriptions-item>
+            <el-descriptions-item label="发货时间"  >
+                <span v-if="order!=null">
+                  {{order.deliverySendTime}}
                 </span>
             </el-descriptions-item>
             <el-descriptions-item label="物流状态"  >

+ 26 - 26
src/views/member/list.vue

@@ -182,6 +182,7 @@
     <!-- User Table -->
     <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange" border>
       <el-table-column type="selection" width="55" align="center" />
+<!--      <el-table-column label="项目会员id" align="center" prop="id" />-->
       <el-table-column label="ID" align="center" prop="userId" />
       <el-table-column label="项目" align="center" prop="projectId">
         <template slot-scope="scope">
@@ -343,7 +344,16 @@
 </template>
 
 <script>
-import { listUser, getUser, addUser, updateUser, delUser, exportUser, auditUser } from "@/api/user/fsUser";
+import {
+  listUser,
+  getMemberUser,
+  addUser,
+  updateUser,
+  delUser,
+  exportUser,
+  auditUser,
+  updateMemberUser
+} from '@/api/user/fsUser'
 import {getUserList} from "@/api/company/companyUser";
 import userDetails from '@/views/store/components/userDetails.vue';
 export default {
@@ -354,6 +364,7 @@ export default {
       show:{
         open:false,
       },
+      rowInfo:null,
       cusTransfer: {
         targetUserId: [{required: true, message: '请选择转移至销售', trigger: 'change'}],
         content: [{required: true, message: '请选择转移至销售', trigger: 'change'}]
@@ -603,9 +614,10 @@ export default {
 
     /** 修改按钮操作 */
     handleUpdate(row) {
+      this.rowInfo=row;
       this.reset();
-      const userId = row.userId || this.ids[0];
-      getUser(userId).then(response => {
+      const id = row.id;
+      getMemberUser(id).then(response => {
         this.form = response.data;
 
         // 处理标签数据,将字符串转为数组
@@ -622,30 +634,18 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          // 处理标签数据,将数组转为字符串
-          if (this.form.tagIds && Array.isArray(this.form.tagIds)) {
-            this.form.tagIds = this.form.tagIds.join(',');
-          }
-
-          if (this.form.userId != null) {
-            //手机号不能修改 置空
-            this.form.phone = null;
-            updateUser(this.form).then(response => {
-              if (response.code === 200) {
-                this.$message.success("修改成功");
-                this.open = false;
-                this.getList();
-              }
-            });
-          } else {
-            addUser(this.form).then(response => {
-              if (response.code === 200) {
-                this.$message.success("新增成功");
-                this.open = false;
-                this.getList();
-              }
-            });
+          const updateForm={
+            id: this.rowInfo.id,
+            status: this.form.status,
+            remark: this.form.remark
           }
+          updateMemberUser(updateForm).then(response => {
+            if (response.code === 200) {
+              this.$message.success("修改成功");
+              this.open = false;
+              this.getList();
+            }
+          });
         }
       });
     },

+ 18 - 23
src/views/member/mylist.vue

@@ -388,11 +388,14 @@
 import {
   myListUser,
   getUser,
+  listUser,
   addUser,
   updateUser,
   delUser,
   exportUser,
   auditUser,
+  getMemberUser,
+  updateMemberUser,
   delCompanyUser
 } from '@/api/user/fsUser'
 import {transferUser} from "@/api/users/user";
@@ -411,6 +414,7 @@ export default {
         title:"会员详情",
         open:false,
       },
+      rowInfo:null,
       cusTransfer: {
         targetUserId: [{required: true, message: '请选择转移至销售', trigger: 'change'}],
         content: [{required: true, message: '请选择转移至销售', trigger: 'change'}]
@@ -694,9 +698,10 @@ export default {
 
     /** 修改按钮操作 */
     handleUpdate(row) {
+      this.rowInfo=row;
       this.reset();
-      const userId = row.userId || this.ids[0];
-      getUser(userId).then(response => {
+      const id = row.id;
+      getMemberUser(id).then(response => {
         this.form = response.data;
 
         // 处理标签数据,将字符串转为数组
@@ -713,28 +718,18 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          // 处理标签数据,将数组转为字符串
-          if (this.form.tagIds && Array.isArray(this.form.tagIds)) {
-            this.form.tagIds = this.form.tagIds.join(',');
-          }
-
-          if (this.form.userId != null) {
-            updateUser(this.form).then(response => {
-              if (response.code === 200) {
-                this.$message.success("修改成功");
-                this.open = false;
-                this.getList();
-              }
-            });
-          } else {
-            addUser(this.form).then(response => {
-              if (response.code === 200) {
-                this.$message.success("新增成功");
-                this.open = false;
-                this.getList();
-              }
-            });
+          const updateForm={
+            id: this.rowInfo.id,
+            status: this.form.status,
+            remark: this.form.remark
           }
+          updateMemberUser(updateForm).then(response => {
+            if (response.code === 200) {
+              this.$message.success("修改成功");
+              this.open = false;
+              this.getList();
+            }
+          });
         }
       });
     },

+ 13 - 5
src/views/qw/externalContact/index.vue

@@ -50,7 +50,7 @@
             class="suggestion-item"
             @click="selectQwUser(item.dictValue,item.dictLabel)"
           >
-            {{ item.dictLabel }}
+            {{ item.dictLabel }} ({{(item.dictValue)}})
           </div>
         </div>
       </el-form-item>
@@ -482,6 +482,7 @@
         </template>
       </el-table-column>
       <el-table-column label="企业id" align="center" prop="corpId" />
+      <el-table-column label="广告业务ID" align="center" prop="traceId" />
       <el-table-column label="重粉看课历史" width="100px" align="center" fixed="right">
         <template slot-scope="scope">
           <div v-if="scope.row.fsUserId">
@@ -743,7 +744,7 @@
     <el-dialog title="批量移除标签" :visible.sync="tagDelOpen" width="800px" append-to-body>
       <div>搜索标签:
         <el-input v-model="queryTagParams.name" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="getPageListTagGroup()">搜索</el-button>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchTags(queryTagParams.name)">搜索</el-button>
         <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
       </div>
       <el-form ref="form" :model="addTagForm"  label-width="80px">
@@ -1750,7 +1751,6 @@ export default {
           if(this.tagGroupList[i].tag[x].isSelected==true){
             this.addTagForm.tagIds.push(this.tagGroupList[i].tag[x].tagId)
           }
-
         }
       }
       if(this.addTagForm.tagIds==[]||this.addTagForm.tagIds==null||this.addTagForm.tagIds==""){
@@ -1760,10 +1760,18 @@ export default {
       this.addTagForm.corpId=this.queryParams.corpId
       this.addTagForm.userIds=this.ids;
       this.addTagForm.filter = this.tagFilter;
-      let obj = JSON.parse(JSON.stringify(this.queryParams))
-      if(obj.tagIds !== null && obj.tagIds !== undefined && obj.tagIds !== ''){
+
+      // 修改这里:正确处理参数对象
+      let obj = JSON.parse(JSON.stringify(this.queryParams));
+
+      // 将逗号分隔的字符串转换为数组
+      if(obj.tagIds && typeof obj.tagIds === 'string') {
         obj.tagIds = obj.tagIds.split(",");
       }
+      if(obj.outTagIds && typeof obj.outTagIds === 'string') {
+        obj.outTagIds = obj.outTagIds.split(",");
+      }
+
       this.addTagForm.param = obj;
 
       let loadingRock = this.$loading({

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

@@ -11,6 +11,15 @@
                 />
               </el-select>
       </el-form-item>
+      <el-form-item label="企微客户ID" prop="id">
+        <el-input
+          v-model="queryParams.id"
+          placeholder="请输入企微客户ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item label="客户名称" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -1199,6 +1208,7 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        id:  null,
         userId: null,
         qwUserName:null,
         externalUserId: null,

+ 18 - 10
src/views/qw/friendWelcome/deptFriendWelcome.vue

@@ -11,6 +11,14 @@
             />
           </el-select>
       </el-form-item>
+      <el-form-item label="id" prop="id">
+        <el-input
+          v-model="queryParams.id"
+          placeholder="请输入ID"
+          clearable
+          size="small"
+        />
+      </el-form-item>
       <el-form-item label="使用的成员" >
         <el-select v-model="queryParams.qwUserIds" filterable  clearable placeholder="公司员工"   size="small">
           <el-option
@@ -26,17 +34,17 @@
           <el-option v-for="dict in allowSelectOptions" :key="dict.dictValue" :label="dict.dictLabel"  :value="dict.dictValue"/>
         </el-select>
       </el-form-item>
-      <el-form-item label="创建时间" prop="createdTime">
+      <el-form-item label="创建时间" prop="createTime">
         <el-date-picker clearable size="small"
-          v-model="queryParams.createdTime"
+          v-model="queryParams.createTime"
           type="date"
           value-format="yyyy-MM-dd"
           placeholder="选择创建时间">
         </el-date-picker>
       </el-form-item>
-      <el-form-item label="更新时间" prop="updateTieme">
+      <el-form-item label="更新时间" prop="updateTime">
         <el-date-picker clearable size="small"
-          v-model="queryParams.updateTieme"
+          v-model="queryParams.updateTime"
           type="date"
           value-format="yyyy-MM-dd"
           placeholder="选择更新时间">
@@ -402,7 +410,7 @@
         <div v-if="welcomeItem.type==='link'">
 
           <el-form-item label="选择课程">
-            <el-select  v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini"  @change="courseChange(fileFrom,welcomeItem.index,welcomeItem.itemIndex)">
+            <el-select  v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini" filterable  @change="courseChange(fileFrom,welcomeItem.index,welcomeItem.itemIndex)">
               <el-option
                 v-for="dict in courseList"
                 :key="dict.dictValue"
@@ -410,7 +418,7 @@
                 :value="parseInt(dict.dictValue)"
               />
             </el-select>
-            <el-select  v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" @change="videoIdChange(fileFrom, welcomeItem.index, welcomeItem.itemIndex,welcomeItem.type)" >
+            <el-select  v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" filterable @change="videoIdChange(fileFrom, welcomeItem.index, welcomeItem.itemIndex,welcomeItem.type)" >
               <el-option
                 v-for="dict in videoList"
                 :key="dict.dictValue"
@@ -457,7 +465,7 @@
         <div v-if="welcomeItem.type==='miniprogram'">
 
           <el-form-item label="选择课程">
-            <el-select  v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini"  @change="courseChange(fileFrom,welcomeItem.index,welcomeItem.itemIndex)">
+            <el-select  v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini" filterable  @change="courseChange(fileFrom,welcomeItem.index,welcomeItem.itemIndex)">
               <el-option
                 v-for="dict in courseList"
                 :key="dict.dictValue"
@@ -465,7 +473,7 @@
                 :value="parseInt(dict.dictValue)"
               />
             </el-select>
-            <el-select  v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" @change="videoIdChange(fileFrom, welcomeItem.index, welcomeItem.itemIndex,welcomeItem.type)" >
+            <el-select  v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" filterable @change="videoIdChange(fileFrom, welcomeItem.index, welcomeItem.itemIndex,welcomeItem.type)" >
               <el-option
                 v-for="dict in videoList"
                 :key="dict.dictValue"
@@ -1077,8 +1085,8 @@ export default {
         companyId: null,
         //默认欢迎语附件
         attachments: [],
-        createdTime: null,
-        updateTieme: null,
+        createTime: null,
+        updateTime: null,
         isSendMsg:'1',
         welcomeText: '',
         isDayparting: '2',

+ 14 - 5
src/views/qw/friendWelcome/indexNew.vue

@@ -11,6 +11,14 @@
             />
           </el-select>
       </el-form-item>
+      <el-form-item label="id" prop="id">
+        <el-input
+          v-model="queryParams.id"
+          placeholder="请输入ID"
+          clearable
+          size="small"
+        />
+      </el-form-item>
       <el-form-item label="使用的成员" >
         <el-select filterable v-model="queryParams.qwUserIds" filterable  clearable placeholder="公司员工"   size="small">
           <el-option
@@ -430,7 +438,7 @@
         <div v-if="welcomeItem.type==='link'">
 
           <el-form-item label="选择课程">
-            <el-select  v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini"  @change="courseChange(fileFrom,welcomeItem.index,welcomeItem.itemIndex)">
+            <el-select  v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini" filterable  @change="courseChange(fileFrom,welcomeItem.index,welcomeItem.itemIndex)">
               <el-option
                 v-for="dict in courseList"
                 :key="dict.dictValue"
@@ -438,7 +446,7 @@
                 :value="parseInt(dict.dictValue)"
               />
             </el-select>
-            <el-select  v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" @change="videoIdChange(fileFrom, welcomeItem.index, welcomeItem.itemIndex,welcomeItem.type)" >
+            <el-select  v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" filterable @change="videoIdChange(fileFrom, welcomeItem.index, welcomeItem.itemIndex,welcomeItem.type)" >
               <el-option
                 v-for="dict in videoList"
                 :key="dict.dictValue"
@@ -485,7 +493,7 @@
         <div v-if="welcomeItem.type==='miniprogram'">
 
           <el-form-item label="选择课程" prop="miniprogramCourseId">
-            <el-select  v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini"  @change="courseChange(fileFrom,welcomeItem.index,welcomeItem.itemIndex)">
+            <el-select  v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini" filterable @change="courseChange(fileFrom,welcomeItem.index,welcomeItem.itemIndex)">
               <el-option
                 v-for="dict in courseList"
                 :key="dict.dictValue"
@@ -493,7 +501,7 @@
                 :value="parseInt(dict.dictValue)"
               />
             </el-select>
-            <el-select  v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" @change="videoIdChange(fileFrom, welcomeItem.index, welcomeItem.itemIndex,welcomeItem.type)" >
+            <el-select  v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" filterable @change="videoIdChange(fileFrom, welcomeItem.index, welcomeItem.itemIndex,welcomeItem.type)" >
               <el-option
                 v-for="dict in videoList"
                 :key="dict.dictValue"
@@ -664,6 +672,7 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        id: null,
         qwUserIds: [],
         companyId: null,
         welcomeText: null,
@@ -1089,7 +1098,7 @@ export default {
             return false;
           }
         });
-     
+
     },
 
     //取消附件

+ 4 - 4
src/views/qw/friendWelcome/myIndexNew.vue

@@ -430,7 +430,7 @@
         <div v-if="welcomeItem.type==='link'">
 
           <el-form-item label="选择课程">
-            <el-select v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini"
+            <el-select v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini" filterable
                        @change="courseChange(fileFrom,welcomeItem.index,welcomeItem.itemIndex)">
               <el-option
                 v-for="dict in courseList"
@@ -439,7 +439,7 @@
                 :value="parseInt(dict.dictValue)"
               />
             </el-select>
-            <el-select v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;"
+            <el-select v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" filterable
                        @change="videoIdChange(fileFrom, welcomeItem.index, welcomeItem.itemIndex,welcomeItem.type)">
               <el-option
                 v-for="dict in videoList"
@@ -489,7 +489,7 @@
         <div v-if="welcomeItem.type==='miniprogram'">
 
           <el-form-item label="选择课程">
-            <el-select v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini"
+            <el-select v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini" filterable
                        @change="courseChange(fileFrom,welcomeItem.index,welcomeItem.itemIndex)">
               <el-option
                 v-for="dict in courseList"
@@ -498,7 +498,7 @@
                 :value="parseInt(dict.dictValue)"
               />
             </el-select>
-            <el-select v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;"
+            <el-select v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" filterable
                        @change="videoIdChange(fileFrom, welcomeItem.index, welcomeItem.itemIndex,welcomeItem.type)">
               <el-option
                 v-for="dict in videoList"

+ 15 - 7
src/views/qw/friendWelcome/myWelcome.vue

@@ -11,6 +11,14 @@
             />
           </el-select>
       </el-form-item>
+      <el-form-item label="id" prop="id">
+        <el-input
+          v-model="queryParams.id"
+          placeholder="请输入ID"
+          clearable
+          size="small"
+        />
+      </el-form-item>
       <el-form-item label="使用的成员" >
         <el-select v-model="queryParams.qwUserIds" filterable  clearable placeholder="公司员工"   size="small">
           <el-option
@@ -427,7 +435,7 @@
         <div v-if="welcomeItem.type==='link'">
 
           <el-form-item label="选择课程">
-            <el-select  v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini"  @change="courseChange(fileFrom,welcomeItem.index,welcomeItem.itemIndex)">
+            <el-select  v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini" filterable  @change="courseChange(fileFrom,welcomeItem.index,welcomeItem.itemIndex)">
               <el-option
                 v-for="dict in courseList"
                 :key="dict.dictValue"
@@ -435,7 +443,7 @@
                 :value="parseInt(dict.dictValue)"
               />
             </el-select>
-            <el-select  v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" @change="videoIdChange(fileFrom, welcomeItem.index, welcomeItem.itemIndex,welcomeItem.type)" >
+            <el-select  v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" filterable @change="videoIdChange(fileFrom, welcomeItem.index, welcomeItem.itemIndex,welcomeItem.type)" >
               <el-option
                 v-for="dict in videoList"
                 :key="dict.dictValue"
@@ -482,7 +490,7 @@
         <div v-if="welcomeItem.type==='miniprogram'">
 
           <el-form-item label="选择课程" prop="miniprogramCourseId">
-            <el-select  v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini"  @change="courseChange(fileFrom,welcomeItem.index,welcomeItem.itemIndex)">
+            <el-select  v-model="fileFrom.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini" filterable  @change="courseChange(fileFrom,welcomeItem.index,welcomeItem.itemIndex)">
               <el-option
                 v-for="dict in courseList"
                 :key="dict.dictValue"
@@ -490,7 +498,7 @@
                 :value="parseInt(dict.dictValue)"
               />
             </el-select>
-            <el-select  v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" @change="videoIdChange(fileFrom, welcomeItem.index, welcomeItem.itemIndex,welcomeItem.type)" >
+            <el-select  v-model="fileFrom.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" filterable @change="videoIdChange(fileFrom, welcomeItem.index, welcomeItem.itemIndex,welcomeItem.type)" >
               <el-option
                 v-for="dict in videoList"
                 :key="dict.dictValue"
@@ -550,7 +558,7 @@ export default {
   components: { ImageUpload, qwUserList,ImageUploadWeclome},
   data() {
     return {
-      
+
       uploadUrl: process.env.VUE_APP_BASE_API + "/common/uploadOSS2",
       // 遮罩层
       loading: true,
@@ -1089,9 +1097,9 @@ export default {
           console.log('error submit!!');
           return false;
         }
-          
+
       });
-      
+
     },
 
     //取消附件

+ 10 - 0
src/views/qw/groupChatTransfer/index.vue

@@ -38,6 +38,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="员工账号" prop="userName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入员工账号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -138,6 +147,7 @@ export default {
         name: null,
         ownerName: null,
         qwName: null,
+        userName: null,
         pageNum: 1,
         pageSize: 10
       },

+ 3 - 1
src/views/qw/groupChatTransferLog/index.vue

@@ -70,7 +70,9 @@ export default {
       total: 0,
       queryParams: {
         corpId: null,
-        name: null
+        name: null,
+        pageNum: 1,
+        pageSize: 10
       },
       myQwCompanyList: [],
       transferLogList: [],

+ 10 - 0
src/views/qw/groupChatTransferOnJob/index.vue

@@ -38,6 +38,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="员工账号" prop="userName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入员工账号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -139,6 +148,7 @@ export default {
         name: null,
         ownerName: null,
         qwName: null,
+        userName:null,
         pageNum: 1,
         pageSize: 10
       },

+ 2 - 2
src/views/qw/qwChat/qq.vue

@@ -802,11 +802,11 @@ export default {
         padding: 0 8px;
     }
 
-    /deep/.el-dialog__headerbtn{
+    .el-dialog__headerbtn{
          top:10px;
     }
 
-    /deep/.el-dialog:not(.is-fullscreen) {
+  .el-dialog:not(.is-fullscreen) {
         margin-top: 0 !important;
     }
 

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

@@ -819,6 +819,7 @@
                         <el-card class="box-card">
                           <el-form-item label="直播间" >
                             <el-select  v-model="item.liveId"
+                                        filterable
                                         placeholder="请选择直播间" size="mini"
                                         @change="liveChange(item)" >
                               <el-option

+ 62 - 24
src/views/qw/sop/updateSop.vue

@@ -365,7 +365,19 @@
                 closable
                 :disable-transitions="false"
                 @close="handleClosegroupUser(id)">
-                <span v-for="list in companyUserList" :key="list.qwUserId" v-if="list.id==id">{{list.qwUserName}}</span>
+                <template>
+                  <!-- 匹配到对应项:展示用户名 -->
+                  <span
+                    v-for="list in companyUserList"
+                    :key="list.qwUserId"
+                    v-if="list.id == id">
+                      {{ list.qwUserName }}
+                  </span>
+                  <!-- 未匹配到任何项:直接展示userSelectList里的id(因为list无id,无法展示list.id) -->
+                  <span v-if="!companyUserList.some(list => list.qwUserId == id)">
+                    {{ id }}
+                  </span>
+                </template>
               </el-tag>
             </div>
           </el-form-item>
@@ -651,32 +663,58 @@ export default {
       // }
       // 找到对应的员工信息
       const user = this.companyUserList.find((list) => list.id == id);
-      console.log(user)
-      if (!user) return;
-      // 确认删除提醒
-      this.$confirm('确定要删除员工"'+user.qwUserName+'"吗?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning',
-      })
-        .then(() => {
-          // 用户点击确定
-          const index = this.userSelectList.findIndex((t) => t === id);
-          if (index !== -1) {
-            this.userSelectList.splice(index, 1);
-          }
-          this.$message({
-            type: 'success',
-            message: '删除成功',
+
+      if (!user){
+        const qwUser = this.companyQwUserList.find((list) => list.id == id);
+        // 确认删除提醒
+        this.$confirm('确定要删除未绑定公司的企微员工"'+qwUser.qwUserName+'"吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        }).then(() => {
+            // 用户点击确定
+            const index = this.userSelectList.findIndex((t) => t === id);
+            if (index !== -1) {
+              this.userSelectList.splice(index, 1);
+            }
+            this.$message({
+              type: 'success',
+              message: '删除成功',
+            });
+          })
+          .catch(() => {
+            // 用户点击取消
+            this.$message({
+              type: 'info',
+              message: '已取消删除',
+            });
           });
+      }else{
+        // 确认删除提醒
+        this.$confirm('确定要删除员工"'+user.qwUserName+'"吗?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
         })
-        .catch(() => {
-          // 用户点击取消
-          this.$message({
-            type: 'info',
-            message: '已取消删除',
+          .then(() => {
+            // 用户点击确定
+            const index = this.userSelectList.findIndex((t) => t === id);
+            if (index !== -1) {
+              this.userSelectList.splice(index, 1);
+            }
+            this.$message({
+              type: 'success',
+              message: '删除成功',
+            });
+          })
+          .catch(() => {
+            // 用户点击取消
+            this.$message({
+              type: 'info',
+              message: '已取消删除',
+            });
           });
-        });
+      }
     },
     // 取消按钮
     cancel() {

+ 1 - 1
src/views/qw/sopLogs/sopLogsList.vue

@@ -29,7 +29,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="发送类型" prop="sendType" >
+      <el-form-item label="发送类型" prop="sendType" label-width="100px" >
         <el-select v-model="queryParams.sendType" placeholder="请选择发送类型" clearable size="small">
           <el-option
             v-for="dict in sysQwSopType"

+ 10 - 0
src/views/qw/sopTemp/deptIndex.vue

@@ -1,6 +1,15 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="模板编号" prop="id">
+        <el-input
+          v-model="queryParams.id"
+          placeholder="请输入模板编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item label="模板标题" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -477,6 +486,7 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        id: null,
         name: null,
         setting: null,
         status: '1',

+ 70 - 1
src/views/qw/sopTemp/index.vue

@@ -169,6 +169,7 @@
             size="mini"
             type="text"
             icon="el-icon-connection"
+
             @click="copyTemplate(scope.row)"
             v-hasPermi="['qw:sopTemp:edit']"
           >复制模板
@@ -199,6 +200,15 @@
             v-hasPermi="['qw:sopTemp:edit']"
           >管理规则
           </el-button>
+          <el-button
+            v-if="scope.row.sendType == 11"
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleBatchOfficial(scope.row)"
+            v-hasPermi="['qw:sopTemp:edit']"
+          >开关官方群发
+          </el-button>
           <el-button
             v-if="scope.row.templateType != 1 && scope.row.sendType == 5"
             size="mini"
@@ -371,6 +381,20 @@
       </div>
     </el-dialog>
 
+    <el-dialog title="批量编辑官方群发" :visible.sync="official.open" width="500px" append-to-body>
+       <el-form :model="officialForm" ref="officialForm" :inline="true">
+         <el-form-item  label="官方群发" prop="isOfficial">
+            <el-radio-group v-model="officialForm.isOfficial">
+              <el-radio :label="0">关</el-radio>
+              <el-radio :label="1">开</el-radio>
+            </el-radio-group>
+         </el-form-item>
+       </el-form>
+      <div slot="footer" class="dialog-footer" style="display: flex;justify-content: flex-end;">
+        <el-button type="primary" @click="updateOfficial" :loading="official.loading">保 存</el-button>
+      </div>
+    </el-dialog>
+
     <el-dialog :title="shareOptions.title" :visible.sync="shareOptions.open" width="800px" append-to-body>
 
       <el-form :model="queryCompanyParams" ref="queryCompanyForm" :inline="true" v-show="showSearch" label-width="68px">
@@ -447,7 +471,8 @@ import {
   redList,
   shareSopTemp,
   updateRedPackage,
-  updateTemp
+  updateTemp,
+  batchOpenOrCloseOfficial
 } from "@/api/qw/sopTemp";
 import { getCompanyList, listCompany } from '@/api/company/company'
 import {courseList, getRoles} from "@/api/qw/sop";
@@ -460,6 +485,14 @@ export default {
   components: {Treeselect},
   data() {
     return {
+      officialForm:{
+        tempId:null,
+        isOfficial:null,
+      },
+      official:{
+        open:false,
+        loading:false,
+      },
       // 遮罩层
       loading: true,
       companysloading: false,
@@ -807,6 +840,17 @@ export default {
       this.$router.push(url)
       // }
     },
+    /**
+     * 批量编辑官方群发
+     */
+    handleBatchOfficial(row){
+        this.officialForm={
+           tempId:null,
+           isOfficial:null
+        }
+        this.officialForm.tempId = row.id;
+        this.official.open = true;
+    },
     /** 修改按钮操作 */
     handleUpdateRed(row) {
       this.redData.open = true;
@@ -852,6 +896,9 @@ export default {
           this.title = "修改";
         }
         this.form = response.data;
+        if(!!this.form && !!this.form.project){
+          this.form.project = String(this.form.project);
+        }
         if (!this.form.IsAtAll) {
         this.form.IsAtAll = "1"; // 默认值
     }
@@ -974,6 +1021,28 @@ export default {
         let len = old - val;
         this.form.timeList.splice(Math.max(this.form.timeList.length - len, 0), len);
       }
+    },
+    updateOfficial(){
+      if(!!this.officialForm){
+        if(this.officialForm.tempId == null || this.officialForm.tempId == '' || this.officialForm.tempId == undefined){
+            this.$message.error("参数错误");
+            return;
+        }
+        if(this.officialForm.isOfficial === null || this.officialForm.isOfficial === undefined){
+            this.$message.error("请选择官方群发操作结果");
+            return;
+        }
+      }else{
+          this.$message.error("参数错误");
+      }
+      this.official.loading = true;
+      batchOpenOrCloseOfficial(this.officialForm).then(res=>{
+         this.msgSuccess("保存成功");
+      this.official.loading = false;
+      this.official.open = false;
+      }).catch(res=>{
+      this.official.loading = false;
+      });
     }
   }
 };

+ 10 - 0
src/views/qw/sopTemp/myIndex.vue

@@ -1,6 +1,15 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="模板编号" prop="id">
+        <el-input
+          v-model="queryParams.id"
+          placeholder="请输入模板编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item label="模板标题" prop="name">
         <el-input
           v-model="queryParams.name"
@@ -459,6 +468,7 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        id: null,
         name: null,
         setting: null,
         status: '1',

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff