瀏覽代碼

Merge remote-tracking branch 'origin/master' into 企微聊天

ct 6 天之前
父節點
當前提交
c0dcde9bef
共有 79 個文件被更改,包括 5457 次插入518 次删除
  1. 3 0
      .env.development
  2. 3 0
      .env.prod-bjczwh
  3. 3 0
      .env.prod-bjyjb
  4. 3 0
      .env.prod-bly
  5. 3 0
      .env.prod-bnkc
  6. 3 0
      .env.prod-cqtyt
  7. 3 0
      .env.prod-cqxzt
  8. 3 0
      .env.prod-czt
  9. 3 0
      .env.prod-ddgy
  10. 4 0
      .env.prod-drk
  11. 4 0
      .env.prod-fby
  12. 4 0
      .env.prod-hat
  13. 3 0
      .env.prod-hcl
  14. 4 0
      .env.prod-hdt
  15. 22 0
      .env.prod-heyantang
  16. 3 0
      .env.prod-hst
  17. 4 0
      .env.prod-hyt
  18. 3 0
      .env.prod-hzyy
  19. 4 0
      .env.prod-jkj
  20. 4 1
      .env.prod-jnlzjk
  21. 3 0
      .env.prod-jnmy
  22. 22 0
      .env.prod-jnsyj
  23. 4 0
      .env.prod-jzzx
  24. 4 0
      .env.prod-knt
  25. 26 0
      .env.prod-knt2
  26. 3 0
      .env.prod-kyt
  27. 4 0
      .env.prod-lmjy
  28. 3 0
      .env.prod-myhk
  29. 3 0
      .env.prod-nmgyt
  30. 4 0
      .env.prod-qdtst
  31. 4 0
      .env.prod-sft
  32. 3 0
      .env.prod-sxjz
  33. 4 0
      .env.prod-syysy
  34. 3 0
      .env.prod-test
  35. 4 0
      .env.prod-whhm
  36. 3 0
      .env.prod-xfk
  37. 4 0
      .env.prod-ylrz
  38. 4 0
      .env.prod-yzt
  39. 3 0
      .env.prod-zkzh
  40. 3 0
      .env.prod-zsjk
  41. 3 0
      .env.production
  42. 3 0
      package.json
  43. 9 0
      src/api/company/redPacket.js
  44. 37 1
      src/api/course/courseFinishTempParent.js
  45. 9 0
      src/api/course/userCourseVideo.js
  46. 8 0
      src/api/qw/qwDept.js
  47. 9 0
      src/api/qw/user.js
  48. 18 0
      src/api/wechat.js
  49. 二進制
      src/assets/logo/cdhyt.jpg
  50. 8 8
      src/views/company/companyPost/index.vue
  51. 18 2
      src/views/company/companyUser/index.vue
  52. 59 2
      src/views/company/companyUser/profile/index.vue
  53. 181 22
      src/views/components/course/userCourseCatalogDetails.vue
  54. 996 0
      src/views/course/courseFinishTempParent/deptIndex.vue
  55. 993 0
      src/views/course/courseFinishTempParent/myIndex.vue
  56. 10 2
      src/views/course/courseUserStatistics/qw/index.vue
  57. 63 1
      src/views/course/courseUserStatistics/qw/my.vue
  58. 51 6
      src/views/course/courseWatchLog/deptWatchLog.vue
  59. 47 2
      src/views/course/courseWatchLog/index.vue
  60. 61 1
      src/views/course/courseWatchLog/qw/statistics.vue
  61. 45 4
      src/views/course/courseWatchLog/watchLog.vue
  62. 0 7
      src/views/crm/customer/full.vue
  63. 43 4
      src/views/index.vue
  64. 1 1
      src/views/qw/contactWay/group.vue
  65. 92 67
      src/views/qw/friendWelcome/indexNew.vue
  66. 92 66
      src/views/qw/friendWelcome/myWelcome.vue
  67. 80 4
      src/views/qw/sop/addSop.vue
  68. 120 38
      src/views/qw/sop/deptSop.vue
  69. 107 25
      src/views/qw/sop/mySop.vue
  70. 508 168
      src/views/qw/sop/updateSop.vue
  71. 120 53
      src/views/qw/sopTemp/updateSopTemp.vue
  72. 12 0
      src/views/qw/sopUserLogs/sopUserLogsSchedule.vue
  73. 21 0
      src/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue
  74. 23 0
      src/views/qw/sopUserLogsInfo/sendMsgSopOpenTool.vue
  75. 29 1
      src/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue
  76. 42 18
      src/views/qw/user/cuDeptIdIndex.vue
  77. 55 14
      src/views/qw/user/index.vue
  78. 1272 0
      src/views/qw/user/myIndex.vue
  79. 15 0
      src/views/users/user/transfer.vue

+ 3 - 0
.env.development

@@ -26,6 +26,9 @@ VUE_APP_PATIENT_INFO = '客户信息'
 # 添加病人
 VUE_APP_ADD_PATIENT = '添加信息'
 
+#项目所属
+VUE_APP_PROJECT_FROM=dev
+
 #1、正常搜索下拉框 2、查询出200条数据,然后搜索这200条以内的
 VUE_APP_COURSE_COMPANY_NAME = 2
 

+ 3 - 0
.env.prod-bjczwh

@@ -19,5 +19,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+#项目所属
+VUE_APP_PROJECT_FROM=bjczwh
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-bjyjb

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+#项目所属
+VUE_APP_PROJECT_FROM=bjyjb
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-bly

@@ -15,5 +15,8 @@ ENV = 'production'
 #FS管理系统/生产环境
 VUE_APP_BASE_API = '/prod-api'
 
+#项目所属
+VUE_APP_PROJECT_FROM=bly
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-bnkc

@@ -19,5 +19,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+#项目所属
+VUE_APP_PROJECT_FROM=bnkc
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-cqtyt

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+#项目所属
+VUE_APP_PROJECT_FROM=cqtyt
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-cqxzt

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+#项目所属
+VUE_APP_PROJECT_FROM=cqxzt
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-czt

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 2
 
+#项目所属
+VUE_APP_PROJECT_FROM=czt
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-ddgy

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+#项目所属
+VUE_APP_PROJECT_FROM=ddgy
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4 - 0
.env.prod-drk

@@ -18,5 +18,9 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+
+#项目所属
+VUE_APP_PROJECT_FROM=drk
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4 - 0
.env.prod-fby

@@ -18,6 +18,10 @@ VUE_APP_BASE_API = '/prod-api'
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
 
+
+#项目所属
+VUE_APP_PROJECT_FROM=fby
+
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 2
 

+ 4 - 0
.env.prod-hat

@@ -18,5 +18,9 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 2
 
+
+#项目所属
+VUE_APP_PROJECT_FROM=hat
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-hcl

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+#项目所属
+VUE_APP_PROJECT_FROM=hcl
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4 - 0
.env.prod-hdt

@@ -18,5 +18,9 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+
+#项目所属
+VUE_APP_PROJECT_FROM=hat
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 22 - 0
.env.prod-heyantang

@@ -0,0 +1,22 @@
+# 页面标题
+VUE_APP_TITLE =成都鹤颜堂健康管理
+# 公司名称
+VUE_APP_COMPANY_NAME =成都御养堂健康管理有限公司
+# ICP备案号
+VUE_APP_ICP_RECORD =蜀ICP备2024054506号-51
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/cdhyt.jpg
+
+# 生产环境配置
+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-hst

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 2
 
+#项目所属
+VUE_APP_PROJECT_FROM=hst
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4 - 0
.env.prod-hyt

@@ -18,5 +18,9 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+
+#项目所属
+VUE_APP_PROJECT_FROM=hyt
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-hzyy

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 2
 
+#项目所属
+VUE_APP_PROJECT_FROM=hzyy
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4 - 0
.env.prod-jkj

@@ -15,5 +15,9 @@ ENV = 'production'
 # FS管理系统/开发环境
 VUE_APP_BASE_API = '/prod-api'
 
+
+#项目所属
+VUE_APP_PROJECT_FROM=jkj
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4 - 1
.env.prod-jnlzjk

@@ -17,7 +17,10 @@ VUE_APP_BASE_API = '/prod-api'
 
 
 #默认 1、会员 2、企微
-VUE_APP_COURSE_DEFAULT = 1
+VUE_APP_COURSE_DEFAULT = 2
+
+#项目所属
+VUE_APP_PROJECT_FROM=jnlzjk
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-jnmy

@@ -18,6 +18,9 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 2
 
+#项目所属
+VUE_APP_PROJECT_FROM=jnmy
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
 

+ 22 - 0
.env.prod-jnsyj

@@ -0,0 +1,22 @@
+# 页面标题
+VUE_APP_TITLE =互联网医院管理系统
+# 公司名称
+VUE_APP_COMPANY_NAME =济南顺亿景互联网医院有限公司
+# ICP备案号
+VUE_APP_ICP_RECORD =蜀ICP备2024052643号
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/jnmy.png
+
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 2
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4 - 0
.env.prod-jzzx

@@ -18,5 +18,9 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 2
 
+
+#项目所属
+VUE_APP_PROJECT_FROM=jzzx
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4 - 0
.env.prod-knt

@@ -18,5 +18,9 @@ VUE_APP_BASE_API = '/prod-api'
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
 
+
+#项目所属
+VUE_APP_PROJECT_FROM=knt
+
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1

+ 26 - 0
.env.prod-knt2

@@ -0,0 +1,26 @@
+# 页面标题
+VUE_APP_TITLE = 康年堂SCRM销售端
+# 公司名称
+VUE_APP_COMPANY_NAME = 陕西康年堂医药连锁有限公司
+# ICP备案号
+VUE_APP_ICP_RECORD = 陕ICP备2023011686号-5
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/knt.jpg
+
+# 生产环境配置
+ENV = 'production'
+
+#FS管理系统/生产环境
+VUE_APP_BASE_API = '/prod-api'
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true
+
+
+#项目所属
+VUE_APP_PROJECT_FROM=knt
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 1

+ 3 - 0
.env.prod-kyt

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 2
 
+#项目所属
+VUE_APP_PROJECT_FROM=kyt
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4 - 0
.env.prod-lmjy

@@ -18,5 +18,9 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+
+#项目所属
+VUE_APP_PROJECT_FROM=lmjy
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-myhk

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 2
 
+#项目所属
+VUE_APP_PROJECT_FROM=myhk
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-nmgyt

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 2
 
+#项目所属
+VUE_APP_PROJECT_FROM=nmgyt
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4 - 0
.env.prod-qdtst

@@ -18,5 +18,9 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+
+#项目所属
+VUE_APP_PROJECT_FROM=qdtst
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4 - 0
.env.prod-sft

@@ -21,5 +21,9 @@ VUE_APP_COURSE_DEFAULT = 1
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
 
+
+#项目所属
+VUE_APP_PROJECT_FROM=sft
+
 #1、正常搜索下拉框 2、查询出200条数据,然后搜索这200条以内的
 VUE_APP_COURSE_COMPANY_NAME = 2

+ 3 - 0
.env.prod-sxjz

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+#项目所属
+VUE_APP_PROJECT_FROM=sxjz
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4 - 0
.env.prod-syysy

@@ -18,5 +18,9 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+
+#项目所属
+VUE_APP_PROJECT_FROM=syysy
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-test

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+#项目所属
+VUE_APP_PROJECT_FROM=test
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4 - 0
.env.prod-whhm

@@ -18,5 +18,9 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1
 
+
+#项目所属
+VUE_APP_PROJECT_FROM=whhm
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-xfk

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 2
 
+#项目所属
+VUE_APP_PROJECT_FROM=xfk
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4 - 0
.env.prod-ylrz

@@ -15,5 +15,9 @@ ENV = 'production'
 # FS管理系统/开发环境
 VUE_APP_BASE_API = '/prod-api'
 
+
+#项目所属
+VUE_APP_PROJECT_FROM=ylrz
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 4 - 0
.env.prod-yzt

@@ -18,5 +18,9 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 2
 
+
+#项目所属
+VUE_APP_PROJECT_FROM=yzt
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.prod-zkzh

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
 
+#项目所属
+VUE_APP_PROJECT_FROM=zkzh
+
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 1

+ 3 - 0
.env.prod-zsjk

@@ -18,5 +18,8 @@ VUE_APP_BASE_API = '/prod-api'
 #默认 1、会员 2、企微
 VUE_APP_COURSE_DEFAULT = 2
 
+#项目所属
+VUE_APP_PROJECT_FROM=zsjk
+
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 0
.env.production

@@ -9,3 +9,6 @@ ENV = 'production'
 
 #FS管理系统/生产环境
 VUE_APP_BASE_API = '/prod-api'
+
+#项目所属
+VUE_APP_PROJECT_FROM=production

+ 3 - 0
package.json

@@ -17,6 +17,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-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",
@@ -31,6 +32,7 @@
     "build:prod-zkzh": "vue-cli-service build --mode prod-zkzh",
     "build:prod-nmgyt": "vue-cli-service build --mode prod-nmgyt",
     "build:prod-cqtyt": "vue-cli-service build --mode prod-cqtyt",
+    "build:prod-heyantang": "vue-cli-service build --mode prod-heyantang",
     "build:prod-bly": "vue-cli-service build --mode prod-bly",
     "build:prod-qdtst": "vue-cli-service build --mode prod-qdtst",
     "build:prod-bjczwh": "vue-cli-service build --mode prod-bjczwh",
@@ -46,6 +48,7 @@
     "build:prod-hat": "vue-cli-service build --mode prod-hat",
     "build:prod-ddgy": "vue-cli-service build --mode prod-ddgy",
     "build:prod-czt": "vue-cli-service build --mode prod-czt",
+    "build:prod-jnsyj": "vue-cli-service build --mode prod-jnsyj",
     "preview": "node build/index.js --preview",
     "lint": "eslint --ext .js,.vue src",
     "test:unit": "jest --clearCache && vue-cli-service test:unit",

+ 9 - 0
src/api/company/redPacket.js

@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+export function redPacketInfo(query) {
+  return request({
+    url: '/his/redPacket/info',
+    method: 'get',
+    params: query
+  })
+}

+ 37 - 1
src/api/course/courseFinishTempParent.js

@@ -9,6 +9,24 @@ export function listCourseFinishTempParent(query) {
   })
 }
 
+export function myListCourseFinishTempParent(query) {
+  return request({
+    url: '/course/courseFinishTempParent/myList',
+    method: 'get',
+    params: query
+  })
+}
+
+
+export function deptListCourseFinishTempParent(query) {
+  return request({
+    url: '/course/courseFinishTempParent/deptList',
+    method: 'get',
+    params: query
+  })
+}
+
+
 // 查询完课模板详细
 export function getCourseFinishTempParent(id) {
   return request({
@@ -50,4 +68,22 @@ export function exportCourseFinishTempParent(query) {
     method: 'get',
     params: query
   })
-}
+}
+
+export function myExportCourseFinishTempParent(query) {
+  return request({
+    url: '/course/courseFinishTempParent/myExport',
+    method: 'get',
+    params: query
+  })
+}
+
+
+
+export function deptExportCourseFinishTempParent(query) {
+  return request({
+    url: '/course/courseFinishTempParent/deptExport',
+    method: 'get',
+    params: query
+  })
+}

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

@@ -39,6 +39,15 @@ export function addUserCourseVideo(data) {
   })
 }
 
+// 更新课程小节
+export function updateUserCourseVideoUpdate(data) {
+  return request({
+    url: '/course/userCourseVideo/update',
+    method: 'post',
+    data: data
+  })
+}
+
 // 修改课堂视频
 export function updateUserCourseVideo(data) {
   return request({

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

@@ -59,3 +59,11 @@ export function exportQwDept(query) {
     params: query
   })
 }
+
+export function treeselect(query) {
+  return request({
+    url: '/qw/qwDept/treeselect',
+    method: 'get',
+    params: query
+  })
+}

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

@@ -9,6 +9,15 @@ export function staffListUser(query) {
   })
 }
 
+export function myStaffListUser(query) {
+  return request({
+    url: '/qw/user/myStaffList',
+    method: 'get',
+    params: query
+  })
+}
+
+
 export function myDepartListUser(query) {
   return request({
     url: '/qw/user/myDepartList',

+ 18 - 0
src/api/wechat.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+// 获取绑定二维码
+export function getWechatBindQrcode() {
+  return request({
+    url: '/wechat/bind/qrcode',
+    method: 'get'
+  });
+}
+
+// 检测绑定状态
+export function checkWechatBindStatus(sceneId) {
+  return request({
+    url: '/wechat/bind/status',
+    method: 'get',
+    params: { sceneId }
+  });
+}

二進制
src/assets/logo/cdhyt.jpg


+ 8 - 8
src/views/company/companyPost/index.vue

@@ -43,7 +43,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['system:post:add']"
+          v-hasPermi="['company:post:add']"
         >新增</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -54,7 +54,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['system:post:edit']"
+          v-hasPermi="['company:post:edit']"
         >修改</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -65,7 +65,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['system:post:remove']"
+          v-hasPermi="['company:post:remove']"
         >删除</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -75,7 +75,7 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['system:post:export']"
+          v-hasPermi="['company:post:export']"
         >导出</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -100,19 +100,19 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:post:edit']"
+            v-hasPermi="['company:post:edit']"
           >修改</el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['system:post:remove']"
+            v-hasPermi="['company:post:remove']"
           >删除</el-button>
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
       v-show="total>0"
       :total="total"
@@ -327,4 +327,4 @@ export default {
     }
   }
 };
-</script>
+</script>

+ 18 - 2
src/views/company/companyUser/index.vue

@@ -1342,9 +1342,25 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
+
       const userIds = row.userId || this.ids;
+
+      // 筛选出 userType 为 '00' 的 userId
+      const excludedUserIds = this.userList
+        .filter(user => user.userType == '00')
+        .map(user => user.userId);
+
+      // 从 userIds 中剔除这些 userId
+      const finalUserIds = userIds.filter(userId =>
+        !excludedUserIds.includes(userId)
+      );
+
+      if (finalUserIds.length === 0) {
+        return this.msgInfo("除管理员外无其他的账号,请重新选择");
+      }
+
       this.$confirm(
-        '是否确认删除员工编号为"' + userIds + '"的数据项?【注意:删除后绑定的企业微信相关信息可能会错乱!!】',
+        '是否确认删除员工编号为"' + finalUserIds + '"的数据项?【注意:删除后绑定的企业微信相关信息可能会错乱!!】',
         "警告",
         {
           confirmButtonText: "确定",
@@ -1353,7 +1369,7 @@ export default {
         }
       )
         .then(function() {
-          return delUser(userIds);
+          return delUser(finalUserIds);
         })
         .then(() => {
           this.getList();

+ 59 - 2
src/views/company/companyUser/profile/index.vue

@@ -36,6 +36,16 @@
                 <div class="pull-right">{{ user.createTime }}</div>
               </li>
             </ul>
+            <div class="text-center" style="margin-top: 20px;" v-if="needWxTemplateMsg">
+              <div v-if="user.wechatBindStatus">
+                <el-tag type="success">已绑定服务号通知</el-tag>
+              </div>
+              <div v-else>
+                <el-button type="primary" @click="openWechatBindDialog">
+                  订阅服务号通知
+                </el-button>
+              </div>
+            </div>
           </div>
         </el-card>
       </el-col>
@@ -55,6 +65,20 @@
         </el-card>
       </el-col>
     </el-row>
+    <el-dialog
+      title="订阅服务号通知"
+      :visible.sync="bindDialogVisible"
+      width="360px"
+      :close-on-click-modal="false"
+    >
+      <div class="text-center">
+        <img v-if="wechatQrcode" :src="wechatQrcode" style="width: 260px; height: 260px;" />
+        <p style="margin-top: 10px;">请使用微信扫码绑定服务号通知</p>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="bindDialogVisible = false">关闭</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -63,7 +87,7 @@ import userAvatar from "./userAvatar";
 import userInfo from "./userInfo";
 import resetPwd from "./resetPwd";
 import { getUserProfile } from "@/api/company/companyUser";
-
+import { getWechatBindQrcode, checkWechatBindStatus } from "@/api/wechat";
 export default {
   name: "Profile",
   components: { userAvatar, userInfo, resetPwd },
@@ -72,10 +96,17 @@ export default {
       user: {},
       roleGroup: {},
       postGroup: {},
-      activeTab: "userinfo"
+      activeTab: "userinfo",
+      bindDialogVisible: false,
+      wechatQrcode: "",
+      wechatBindTimer: null,
+      needWxTemplateMsg: false,
     };
   },
   created() {
+    if (process.env.VUE_APP_COMPANY_NAME ==="河北红德堂医药连锁有限公司保定第五十七分公司"){
+      this.needWxTemplateMsg = true
+    }
     this.getUser();
   },
   methods: {
@@ -85,7 +116,33 @@ export default {
         this.roleGroup = response.roleGroup;
         this.postGroup = response.postGroup;
       });
+    },
+    openWechatBindDialog() {
+      getWechatBindQrcode().then(res => {
+        console.log(res)
+        this.wechatQrcode = res.data.qrcodeUrl;
+        this.bindDialogVisible = true;
+        this.startCheckWechatBind(res.data.sceneId);
+      });
+    },
+    startCheckWechatBind(sceneId) {
+      // 清除旧定时器
+      if (this.wechatBindTimer) clearInterval(this.wechatBindTimer);
+
+      this.wechatBindTimer = setInterval(() => {
+        checkWechatBindStatus(sceneId).then(res => {
+          if (res.data === true) {
+            this.$message.success("绑定成功!");
+            clearInterval(this.wechatBindTimer);
+            this.bindDialogVisible = false;
+            this.getUser(); // 刷新绑定状态
+          }
+        });
+      }, 2000);
     }
+  },
+  beforeDestroy() {
+    if (this.wechatBindTimer) clearInterval(this.wechatBindTimer);
   }
 };
 </script>

+ 181 - 22
src/views/components/course/userCourseCatalogDetails.vue

@@ -33,6 +33,9 @@
       <el-table-column label="上传时间" align="center" prop="createTime" />
       <el-table-column label="默认红包" align="center" prop="redPacketMoney" />
       <el-table-column label="公司红包" align="center" prop="companyRedPacketMoney" />
+      <el-table-column label="标签组名称" align="center" prop="tagGroupName" />
+      <el-table-column label="看课标签" align="center" prop="watchingTagName" />
+      <el-table-column label="完课标签" align="center" prop="watchedTagName" />
 
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
@@ -49,12 +52,10 @@
             @click="updateMoney(scope.row)"
           >设置红包金额</el-button>
 
-<!--          <el-button-->
-<!--            size="mini"-->
-<!--            type="text"-->
-<!--            @click="openDialog(scope.row)"-->
-<!--            v-hasPermi="['course:courseLink:create']"-->
-<!--          >生成应急短链</el-button>-->
+          <el-button size="mini"
+                     type="text" @click="openTagDialog(scope.row)">
+            绑定看课标签
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -72,6 +73,7 @@
       :visible.sync="open" append-to-body>
       <userCourseVideoDetails  ref="userCourseVideoDetails" />
     </el-drawer>
+
     <el-dialog title="设置红包金额" :visible.sync="moneyOpen" width="600px" append-to-body>
       <el-form ref="form"  label-width="100px">
         <el-form-item label="红包金额" prop="corpId">
@@ -108,34 +110,107 @@
         <el-button type="primary" @click="confirm">确认</el-button>
       </div>
     </el-dialog>
-<!--    <el-dialog title="设置红包金额" :visible.sync="moneyOpen" width="600px" append-to-body>-->
-<!--      <el-form ref="form"  label-width="100px">-->
-<!--        <el-form-item label="红包金额" prop="corpId">-->
-<!--          <el-input-number v-model="redPacketMoneyForm.redPacketMoney" :min="0.1" :max="200" :step="0.1" ></el-input-number>-->
-<!--        </el-form-item>-->
-<!--      </el-form>-->
-<!--      <div slot="footer" class="dialog-footer">-->
-<!--        <el-button @click="cancel">取 消</el-button>-->
-<!--      </div>-->
-<!--    </el-dialog>-->
+
+    <!-- 弹框 -->
+    <el-dialog
+      title="绑定看课标签"
+      :visible.sync="tagDialogVisible"
+      width="500px"
+      @closed="resetDialog"
+      append-to-body
+    >
+      <el-form :model="tagDialog" label-width="120px">
+        <!-- 标签组选择 -->
+        <el-form-item label="标签组" required>
+          <el-select
+            v-model="tagDialog.groupId"
+            placeholder="请选择标签组"
+            @change="onGroupChange"
+            filterable
+          >
+            <el-option
+              v-for="group in tagGroups"
+              :key="group.groupId"
+              :label="group.name"
+              :value="group.groupId"
+            />
+          </el-select>
+        </el-form-item>
+        <!-- 看课标签选择 -->
+        <el-form-item label="看课标签" required>
+          <el-select
+            v-model="tagDialog.watchTagId"
+            placeholder="请选择看课标签"
+            :disabled="!tagDialog.groupId"
+            @change="handleWatchingChange"
+            filterable
+          >
+            <el-option
+              v-for="tag in tagsInGroup"
+              :key="tag.tagId"
+              :label="tag.name"
+              :value="tag.tagId"
+            />
+          </el-select>
+        </el-form-item>
+        <!-- 完课标签选择 -->
+        <el-form-item label="完课标签" required>
+          <el-select
+            v-model="tagDialog.finishTagId"
+            placeholder="请选择完课标签"
+            :disabled="!tagDialog.groupId"
+            @change="handleWatchedChange"
+            filterable>
+            <el-option
+              v-for="tag in tagsInGroup"
+              :key="tag.tagId"
+              :label="tag.name"
+              :value="tag.tagId"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="cancelDialog">取消</el-button>
+        <el-button type="primary" @click="submitTagBinding">确定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { updatePacketMoney,getSort,getVideoListByCourseId,delUserCourseVideo,getUserCourseVideo,addUserCourseVideo,updateUserCourseVideo } from "@/api/course/userCourseVideo";
+import {getVideoListByCourseId, updatePacketMoney, updateUserCourseVideoUpdate} from "@/api/course/userCourseVideo";
 import userCourseVideoDetails from '../../components/course/userCourseVideoDetails.vue';
-import { createLinkUrl } from "@/api/course/sopCourseLink";
-import { userList } from "@/api/qw/user";
+import {createLinkUrl} from "@/api/course/sopCourseLink";
+import {listTagGroup} from "@/api/qw/tagGroup";
 
-import request from '@/utils/request'
-
-  export default {
+export default {
     name: "userCourseCatalog",
     components: {
       userCourseVideoDetails
     },
+    props: {
+      video: {
+        type: Object,
+        required: true,
+      },
+    },
     data() {
       return {
+        currentRow: null,
+        // 假设这里有当前课程小节的数据传入,里面含id等
+        tagDialogVisible: false,
+        tagGroups: [],
+        tagsInGroup: [],
+        tagDialog: {
+          videoId: null,
+          groupId: null,
+          watchTagId: null,
+          finishTagId: null,
+          tgId: null,
+          watchingTgId: null,
+          watchedTgId: null
+        },
         linkForm:{
           days:null,
           courseId:null,
@@ -218,6 +293,90 @@ import request from '@/utils/request'
       });
     },
     methods: {
+      handleWatchingChange(tagId){
+        this.tagDialog.watchingTgId = this.tagsInGroup.find(e => e.tagId === tagId)?.id;
+      },
+      handleWatchedChange(tagId){
+        this.tagDialog.watchedTgId = this.tagsInGroup.find(e => e.tagId === tagId)?.id;
+      },
+      openTagDialog(row) {
+        this.currentRow = row;
+        this.tagDialogVisible = true;
+        this.tagDialog.videoId = row.videoId;
+        this.tagDialog.groupId = this.currentRow.tagGroupId;
+        this.tagDialog.watchTagId = this.currentRow.watchingTagId;
+        this.tagDialog.finishTagId = this.currentRow.watchedTagId;
+
+
+        // 查询所有的标签组
+        listTagGroup({
+          pageNum: 1,
+          pageSize: 1000
+        }).then((res) => {
+          if(res.code === 200) {
+            this.tagGroups = res.rows;
+
+            let tagGroup = this.tagGroups.find(e=>e.groupId === this.currentRow.tagGroupId);
+            this.tagsInGroup = tagGroup.tag || [];
+          }
+        });
+      },
+      updateTagsInGroup(groupId) {
+        let tagGroup = this.tagGroups.find(e=> e.groupId === groupId);
+
+        this.tagsInGroup = tagGroup.tag || [];
+        // 切换组时清空标签选择
+        this.tagDialog.watchTagId = null;
+        this.tagDialog.finishTagId = null;
+        this.tagDialog.tgId = tagGroup.id;
+      },
+      onGroupChange(groupId) {
+        this.updateTagsInGroup(groupId);
+      },
+      cancelDialog() {
+        this.tagDialogVisible = false;
+        this.resetDialog();
+      },
+      resetDialog() {
+        this.tagDialog = {
+          videoId: null,
+          groupId: null,
+          watchTagId: null,
+          finishTagId: null,
+        };
+        this.tagGroups = [];
+        this.tagsInGroup = [];
+      },
+      submitTagBinding() {
+        // 使用表单校验
+        if(!this.tagDialog.groupId){
+          this.$message.warning("标签组必选!");
+          return;
+        }
+        if(!this.tagDialog.watchTagId){
+          this.$message.warning("看课标签必选!");
+          return;
+        }
+        if(!this.tagDialog.finishTagId){
+          this.$message.warning("完课标签必选!");
+          return;
+        }
+        this.currentRow.tagGroupId = this.tagDialog.groupId;
+        this.currentRow.watchingTagId = this.tagDialog.watchTagId;
+        this.currentRow.watchedTagId = this.tagDialog.finishTagId;
+
+        this.currentRow.watchingTgId = this.tagDialog.watchingTgId;
+        this.currentRow.watchedTgId = this.tagDialog.watchedTgId;
+        this.currentRow.tgId = this.tagDialog.tgId;
+
+        updateUserCourseVideoUpdate(this.currentRow).then(res=>{
+          this.$message.success("绑定成功");
+          this.resetDialog();
+          this.currentRow = null;
+          this.tagDialogVisible = false;
+          this.getList();
+        })
+      },
       // 打开弹框
       openDialog(row) {
         this.linkForm.courseId = row.courseId;

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

@@ -0,0 +1,996 @@
+<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="courseId">
+        <el-select v-model="queryParams.courseId" clearable placeholder="请选择课程" style=" margin-right: 10px;" size="mini">
+          <el-option
+            v-for="dict in courseList"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="parseInt(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="['course:courseFinishTempParent:deptAdd']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['course:courseFinishTempParent:deptEdit']"
+        >修改</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="['course:courseFinishTempParent:deptRemove']"
+        >删除</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="['course:courseFinishTempParent:deptExport']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <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="name" />
+      <el-table-column label="课程" align="center" prop="courseId">
+        <template slot-scope="scope">
+          <el-tag v-for="dict in courseList" v-if="dict.dictValue == scope.row.courseId">{{dict.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"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['course:courseFinishTempParent:deptEdit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            @click="jump(scope.row.id)"
+          >模板列表</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['course:courseFinishTempParent:deptRemove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改完课模板对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入名称" />
+        </el-form-item>
+        <el-form-item label="状态" v-if="!form.id">
+          <el-radio-group v-model="form.status">
+            <el-radio
+              v-for="dict in statusOptions"
+              :key="dict.dictValue"
+              :label="parseInt(dict.dictValue)"
+            >{{ dict.dictLabel }}
+            </el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="课程" prop="courseId">
+          <el-select v-model="form.courseId" :disabled="form.id != null" placeholder="请选择课程" style=" margin-right: 10px;" size="mini">
+            <el-option
+              v-for="dict in courseList"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="parseInt(dict.dictValue)"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="规则" prop="setting" v-if="!form.id">
+          <div v-for="(item, index) in setting" :key="index"
+               style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;">
+            <el-row>
+              <el-col :span="22">
+                <el-form :model="item" label-width="70px">
+                  <el-form-item label="内容类别" style="margin: 2%">
+                    <el-radio-group v-model="item.contentType">
+                      <el-radio :label="item.dictValue" v-for="item in sysQwSopAiContentType">{{ item.dictLabel }}
+                      </el-radio>
+                    </el-radio-group>
+                  </el-form-item>
+                  <el-form-item label="内容" style="margin-bottom: 2%">
+                    <el-input v-if="item.contentType == 1 " v-model="item.value" type="textarea" :rows="3"
+                              placeholder="内容" style="width: 90%;margin-top: 10px;"/>
+
+                    <ImageUpload v-if="item.contentType == 2 " v-model="item.imgUrl" type="image" :num="1" :width="150"
+                                 :height="150"/>
+
+                    <div v-if="item.contentType == 3 ">
+                      <el-card class="box-card">
+                        <el-form-item label="链接标题:" label-width="100px">
+                          <el-input v-model="item.linkTitle" placeholder="请输入链接标题" style="width: 90%;"/>
+                        </el-form-item>
+                        <el-form-item label="链接描述:" label-width="100px">
+                          <el-input type="textarea" :rows="3" v-model="item.linkDescribe" placeholder="请输入链接描述"
+                                    style="width: 90%;margin-top: 1%;"/>
+                        </el-form-item>
+                        <el-form-item label="链接封面:" label-width="100px">
+                          <ImageUpload v-model="item.linkImageUrl" type="image" :num="1" :file-size="2" :width="150"
+                                       :height="150" style="margin-top: 1%;"/>
+                        </el-form-item>
+                        <el-form-item label="链接地址:" label-width="100px">
+                          <el-input v-model="item.linkUrl" placeholder="请输入链接地址" style="width: 90%;"/>
+                        </el-form-item>
+                      </el-card>
+                    </div>
+                    <div v-if="item.contentType == 4">
+                      <el-card class="box-card">
+
+                        <el-form-item label="选择课程">
+                          <el-select
+                            v-model="item.courseId"
+                            placeholder="请选择课程"
+                            style="margin-right: 10px"
+                            size="mini"
+                            @change="handleRuleCourseChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in courseList"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                          <el-select
+                            v-model="item.videoId"
+                            placeholder="请选择小节"
+                            size="mini"
+                            style="margin-right: 10px"
+                            filterable
+                            remote
+                            :remote-method="(query) => remoteMethodRuleVideo(query, item)"
+                            :loading="videoOptionsLoading"
+                            @change="handleRuleVideoChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in videoOptions || []"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                        </el-form-item>
+
+                        <el-card class="box-card" style="margin-top: 10px">
+                          <el-form-item label="标题" prop="miniprogramTitle">
+                            <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字" />
+                          </el-form-item>
+                          <el-form-item label="封面" prop="miniprogramPicUrl">
+                            <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
+                          </el-form-item>
+                        </el-card>
+                      </el-card>
+                    </div>
+                    <div v-if="item.contentType == 5 ">
+
+                      <el-form-item label="上传文件:" prop="fileUrl" label-width="100px">
+                        <el-upload
+                          v-model="item.fileUrl"
+                          class="avatar-uploader"
+                          :action="uploadUrl"
+                          :show-file-list="false"
+                          :on-success="(res, file) => handleAvatarSuccessFile(res, file, item)"
+                          :before-upload="beforeAvatarUploadFile">
+                          <i class="el-icon-plus avatar-uploader-icon"></i>
+                        </el-upload>
+                        <el-link v-if="item.fileUrl" type="primary" :href="downloadUrl(item.fileUrl)" download>
+                          {{ item.fileUrl }}
+                        </el-link>
+                      </el-form-item>
+
+                    </div>
+
+                    <div v-if="item.contentType == 6 ">
+                      <el-form-item label="上传视频:" prop="videoUrl" label-width="100px">
+                        <el-upload
+                          v-model="item.videoUrl"
+                          class="avatar-uploader"
+                          :action="uploadUrl"
+                          :show-file-list="false"
+                          :on-success="(res, file) => handleAvatarSuccessVideo(res, file, item)"
+                          :before-upload="beforeAvatarUploadVideo">
+                          <i class="el-icon-plus avatar-uploader-icon"></i>
+                        </el-upload>
+                        <video v-if="item.videoUrl"
+                               :src="item.videoUrl"
+                               controls style="width: 200px;height: 100px">
+                        </video>
+                      </el-form-item>
+                    </div>
+                    <div v-if="item.contentType == 7 ">
+                      <el-input
+                        v-model="item.value"
+                        type="textarea" :rows="3" maxlength="66" show-word-limit
+                        placeholder="输入要转为语音的内容" style="width: 90%;margin-top: 10px;"
+                        @input="handleInputVideoText(item.value,item)"/>
+                    </div>
+                    <div v-if="item.contentType == 8">
+                      <el-button type="primary"
+                                 style="margin-bottom: 1%"
+                                 @click="hanldeSelectVideoNum(setting,index)">
+                        选择视频号
+                      </el-button>
+                      <el-card class="box-card" v-if="item.coverUrl">
+                        <el-form-item label="封面标题:" label-width="100px">
+                          <el-input v-model="item.nickname"
+                                    style="width: 90%;margin-bottom: 1%" disabled/>
+                        </el-form-item>
+                        <el-form-item label="头像:" label-width="100px">
+                          <el-image
+                            v-if="item.avatar != null"
+                            :src="item.avatar"
+                            :preview-src-list="[item.avatar]"
+                            :style="{ width: '50px', height: '50px' }"
+                          ></el-image>
+                        </el-form-item>
+                        <el-form-item label="封面:" label-width="100px">
+                          <el-image
+                            v-if="item.coverUrl != null"
+                            :src="item.coverUrl"
+                            :preview-src-list="[item.coverUrl]"
+                            :style="{ width: '200px', height: '200px' }"
+                          ></el-image>
+
+                        </el-form-item>
+                        <el-form-item label="简介:" label-width="100px">
+                          <el-input type="textarea" :rows="3"
+                                    v-model="item.desc"
+                                    style="width: 90%;margin-top: 1%;" disabled/>
+                        </el-form-item>
+                        <el-form-item label="视频地址:" label-width="100px"
+                                      style="margin-top: 1%">
+                          <el-input v-model="item.url"
+                                    style="width: 90%;" disabled/>
+                        </el-form-item>
+                      </el-card>
+                    </div>
+
+                  </el-form-item>
+                </el-form>
+              </el-col>
+              <el-col :span="1" :offset="1">
+                <i class="el-icon-delete" @click="delSetList(index, 0)" style="margin-top: 20px;"
+                   v-if="setting.length>1"></i>
+              </el-col>
+            </el-row>
+          </div>
+          <el-link type="primary" class="el-icon-plus" :underline="false" @click='addSetList(0)'>
+            添加内容
+          </el-link>
+        </el-form-item>
+        <el-form-item label="群聊恭喜规则" prop="setting" v-if="!form.id">
+          <div v-for="(item, index) in chatSetting" :key="index"
+               style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;">
+            <el-row>
+              <el-col :span="22">
+                <el-form :model="item" label-width="70px">
+                  <el-form-item label="内容类别" style="margin: 2%">
+                    <el-radio-group v-model="item.contentType">
+                      <el-radio :label="item.dictValue" v-for="item in sysQwSopAiContentType">{{ item.dictLabel }}
+                      </el-radio>
+                    </el-radio-group>
+                  </el-form-item>
+                  <el-form-item label="内容" style="margin-bottom: 2%">
+                    <el-input v-if="item.contentType == 1 " v-model="item.value" type="textarea" :rows="3"
+                              placeholder="内容" style="width: 90%;margin-top: 10px;"/>
+
+                    <ImageUpload v-if="item.contentType == 2 " v-model="item.imgUrl" type="image" :num="1" :width="150"
+                                 :height="150"/>
+
+                    <div v-if="item.contentType == 3 ">
+                      <el-card class="box-card">
+                        <el-form-item label="链接标题:" label-width="100px">
+                          <el-input v-model="item.linkTitle" placeholder="请输入链接标题" style="width: 90%;"/>
+                        </el-form-item>
+                        <el-form-item label="链接描述:" label-width="100px">
+                          <el-input type="textarea" :rows="3" v-model="item.linkDescribe" placeholder="请输入链接描述"
+                                    style="width: 90%;margin-top: 1%;"/>
+                        </el-form-item>
+                        <el-form-item label="链接封面:" label-width="100px">
+                          <ImageUpload v-model="item.linkImageUrl" type="image" :num="1" :file-size="2" :width="150"
+                                       :height="150" style="margin-top: 1%;"/>
+                        </el-form-item>
+                        <el-form-item label="链接地址:" label-width="100px">
+                          <el-input v-model="item.linkUrl" placeholder="请输入链接地址" style="width: 90%;"/>
+                        </el-form-item>
+                      </el-card>
+                    </div>
+                    <div v-if="item.contentType == 4">
+                      <el-card class="box-card">
+
+                        <el-form-item label="选择课程">
+                          <el-select
+                            v-model="item.courseId"
+                            placeholder="请选择课程"
+                            style="margin-right: 10px"
+                            size="mini"
+                            @change="handleRuleCourseChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in courseList"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                          <el-select
+                            v-model="item.videoId"
+                            placeholder="请选择小节"
+                            size="mini"
+                            style="margin-right: 10px"
+                            filterable
+                            remote
+                            :remote-method="(query) => remoteMethodRuleVideo(query, item)"
+                            :loading="videoOptionsLoading"
+                            @change="handleRuleVideoChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in videoOptions || []"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                        </el-form-item>
+
+                        <el-card class="box-card" style="margin-top: 10px">
+                          <el-form-item label="标题" prop="miniprogramTitle">
+                            <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字" />
+                          </el-form-item>
+                          <el-form-item label="封面" prop="miniprogramPicUrl">
+                            <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
+                          </el-form-item>
+                        </el-card>
+                      </el-card>
+                    </div>
+                    <div v-if="item.contentType == 5 ">
+
+                      <el-form-item label="上传文件:" prop="fileUrl" label-width="100px">
+                        <el-upload
+                          v-model="item.fileUrl"
+                          class="avatar-uploader"
+                          :action="uploadUrl"
+                          :show-file-list="false"
+                          :on-success="(res, file) => handleAvatarSuccessFile(res, file, item)"
+                          :before-upload="beforeAvatarUploadFile">
+                          <i class="el-icon-plus avatar-uploader-icon"></i>
+                        </el-upload>
+                        <el-link v-if="item.fileUrl" type="primary" :href="downloadUrl(item.fileUrl)" download>
+                          {{ item.fileUrl }}
+                        </el-link>
+                      </el-form-item>
+
+                    </div>
+
+                    <div v-if="item.contentType == 6 ">
+                      <el-form-item label="上传视频:" prop="videoUrl" label-width="100px">
+                        <el-upload
+                          v-model="item.videoUrl"
+                          class="avatar-uploader"
+                          :action="uploadUrl"
+                          :show-file-list="false"
+                          :on-success="(res, file) => handleAvatarSuccessVideo(res, file, item)"
+                          :before-upload="beforeAvatarUploadVideo">
+                          <i class="el-icon-plus avatar-uploader-icon"></i>
+                        </el-upload>
+                        <video v-if="item.videoUrl"
+                               :src="item.videoUrl"
+                               controls style="width: 200px;height: 100px">
+                        </video>
+                      </el-form-item>
+                    </div>
+                    <div v-if="item.contentType == 7 ">
+                      <el-input
+                        v-model="item.value"
+                        type="textarea" :rows="3" maxlength="66" show-word-limit
+                        placeholder="输入要转为语音的内容" style="width: 90%;margin-top: 10px;"
+                        @input="handleInputVideoText(item.value,item)"/>
+                    </div>
+                    <div v-if="item.contentType == 8">
+                      <el-button type="primary"
+                                 style="margin-bottom: 1%"
+                                 @click="hanldeSelectVideoNum(setting,index)">
+                        选择视频号
+                      </el-button>
+                      <el-card class="box-card" v-if="item.coverUrl">
+                        <el-form-item label="封面标题:" label-width="100px">
+                          <el-input v-model="item.nickname"
+                                    style="width: 90%;margin-bottom: 1%" disabled/>
+                        </el-form-item>
+                        <el-form-item label="头像:" label-width="100px">
+                          <el-image
+                            v-if="item.avatar != null"
+                            :src="item.avatar"
+                            :preview-src-list="[item.avatar]"
+                            :style="{ width: '50px', height: '50px' }"
+                          ></el-image>
+                        </el-form-item>
+                        <el-form-item label="封面:" label-width="100px">
+                          <el-image
+                            v-if="item.coverUrl != null"
+                            :src="item.coverUrl"
+                            :preview-src-list="[item.coverUrl]"
+                            :style="{ width: '200px', height: '200px' }"
+                          ></el-image>
+
+                        </el-form-item>
+                        <el-form-item label="简介:" label-width="100px">
+                          <el-input type="textarea" :rows="3"
+                                    v-model="item.desc"
+                                    style="width: 90%;margin-top: 1%;" disabled/>
+                        </el-form-item>
+                        <el-form-item label="视频地址:" label-width="100px"
+                                      style="margin-top: 1%">
+                          <el-input v-model="item.url"
+                                    style="width: 90%;" disabled/>
+                        </el-form-item>
+                      </el-card>
+                    </div>
+
+                  </el-form-item>
+                </el-form>
+              </el-col>
+              <el-col :span="1" :offset="1">
+                <i class="el-icon-delete" @click="delSetList(index,1)" style="margin-top: 20px;"
+                   v-if="setting.length>1"></i>
+              </el-col>
+            </el-row>
+          </div>
+          <el-link type="primary" class="el-icon-plus" :underline="false" @click='addSetList(1)'>
+            添加内容
+          </el-link>
+        </el-form-item>
+        <el-form-item label="全选销售" prop="isAllCompanyUser" v-if="!form.id">
+          <el-switch
+            v-model="form.isAllCompanyUser"
+            active-color="#13ce66"
+            inactive-color="#ff4949"
+            :active-value="1"
+            :inactive-value="2">
+          </el-switch>
+          <span v-if="form.isAllCompanyUser == '1'" style="margin-left: 10px;color: #13ce66">是</span>
+          <span v-else style="margin-left: 10px;color: #ff4949">否</span>
+        </el-form-item>
+        <el-form-item label="所属销售" prop="companyUserIds" v-if="!form.id && form.isAllCompanyUser == '2'">
+          <el-select v-model="companyUserIds" remote multiple placeholder="请选择" filterable style="width: 100%;">
+            <el-option
+              v-for="dict in userList"
+              :key="dict.userId"
+              :label="dict.nickName"
+              :value="dict.userId.toString()">
+            </el-option>
+          </el-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>
+    </el-dialog>
+    <el-dialog :title="videoNumOptions.title" :visible.sync="videoNumOptions.open" width="1500px" append-to-body>
+      <userVideo ref="QwUserVideo" @videoResult="qwUserVideoResult"></userVideo>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listCourseFinishTempParent, getCourseFinishTempParent, delCourseFinishTempParent, addCourseFinishTempParent, updateCourseFinishTempParent, exportCourseFinishTempParent } from "@/api/course/courseFinishTempParent";
+import {courseList, videoList} from '@/api/qw/sop'
+import ImageUpload from '@/views/qw/sop/ImageUpload.vue'
+import { getUserList } from '@/api/company/companyUser'
+import userVideo from "@/views/qw/userVideo/userVideo.vue";
+import {
+  deptExportCourseFinishTempParent,
+  deptListCourseFinishTempParent
+} from "../../../api/course/courseFinishTempParent";
+
+
+export default {
+  name: "CourseFinishTempParent",
+  components: { ImageUpload ,userVideo},
+  data() {
+    return {
+      videoOptionsLoading: false,
+      videoOptions: [],
+      videoLoading: false,
+      videoNumOptions: {
+        title: '选择视频号',
+        open: false,
+        content: null,
+        contentIndex: null,
+      },
+      voiceLoading: false,
+      uploadUrl: process.env.VUE_APP_BASE_API + "/common/uploadOSS2",
+      uploadUrlByVoice: process.env.VUE_APP_BASE_API + "/common/uploadOSSByHOOKVoice",
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 完课模板表格数据
+      courseFinishTempParentList: [],
+      companyUserIds: [],
+      courseList: [],
+      userList: [],
+      // 状态字典
+      statusOptions: [],
+      allowSelect: [],
+      sysFsSopWatchStatus: [],
+      sysQwSopAiContentType: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 模板表格数据
+      setting: [],
+      chatSetting: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        courseId: null,
+      },
+      // 表单参数
+      form: {companyUserIds: [],},
+      // 表单校验
+      rules: {
+        name:[
+          { required: true, message: "名称不能为空", trigger: "blur" }
+        ],
+        courseId:[
+          { required: true, message: "课程不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getDicts("sys_company_status").then(response => {
+      this.statusOptions = response.data;
+    });//复用一下
+    this.getDicts("sys_qw_allow_select").then(response => {
+      this.allowSelect = response.data;
+    });
+
+    this.getDicts("sys_fs_sop_watch_status").then(response => {
+      this.sysFsSopWatchStatus = response.data;
+    });
+
+    this.getDicts("sys_qwSopAi_contentType").then(response => {
+      this.sysQwSopAiContentType = response.data;
+    });
+    getUserList().then(response => {
+      this.userList = response.data;
+    });
+    courseList().then(response => {
+      this.courseList = response.list;
+    });
+    this.getList();
+  },
+  methods: {
+    // 处理规则中课程变化
+    handleRuleCourseChange(item) {
+      // 为当前规则项单独加载视频列表
+      videoList(item.courseId).then((response) => {
+        // 只保存视频列表,不保存整个响应对象
+        this.videoOptions = response.list;
+
+        this.$set(item, 'videoId', null); // Reset video selection when course changes
+
+        // 自动设置封面为课程封面
+        const selectedCourse = this.courseList.find(
+          course => parseInt(course.dictValue) === item.courseId
+        );
+        if (selectedCourse) {
+          this.$set(item, 'miniprogramPicUrl', selectedCourse.dictImgUrl);
+        }
+      });
+    },
+
+
+    // 处理规则中视频变化
+    handleRuleVideoChange(item) {
+      if (!item.videoId) return;
+
+      // 自动设置标题为视频标题
+      const selectedVideo = (this.videoOptions || []).find(
+        video => parseInt(video.dictValue) === item.videoId
+      );
+      if (selectedVideo) {
+        this.$set(item, 'miniprogramTitle', selectedVideo.dictLabel);
+      }
+    },
+
+    // 远程搜索规则中的视频
+    remoteMethodRuleVideo(query, item) {
+      if (!item.courseId) {
+        this.$message.warning('请先选择课程');
+        this.videoOptions = [];
+        reject();
+        return;
+      }
+
+      this.videoOptionsLoading = true;
+      const data = query ? { title: query } : {};
+
+      videoList(item.courseId, data).then((response) => {
+        this.videoOptions =  response.list;
+        this.videoOptionsLoading =  false;
+        resolve(response);
+      }).catch((error) => {
+        this.videoOptionsLoading = false;
+        reject(error);
+      });
+    },
+    remoteMethodVideo(query) {
+      if (!this.form.courseId) {
+        this.$message.warning('请先选择课程');
+        this.videoList = []; // 清空小节列表
+        return;
+      }
+      if (query !== '') {
+        this.videoLoading = true;
+        // 这里调用接口搜索小节,假设 videoList 方法支持搜索参数
+        var data = {
+          title:query
+        }
+        videoList(this.form.courseId, data).then((response) => {
+          this.videoList = response.list;
+          this.videoLoading = false;
+        });
+      } else {
+        // 如果查询为空,则加载全部
+        videoList(this.form.courseId).then((response) => {
+          this.videoList = response.list;
+        });
+      }
+    },
+    /** 查询完课模板列表 */
+    getList() {
+      this.loading = true;
+      deptListCourseFinishTempParent(this.queryParams).then(response => {
+        this.courseFinishTempParentList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        status: 1,
+        name: null,
+        setting: [],
+        chatSetting: [],
+        courseId: null,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        companyUserIds: null,
+        remark: null,
+        isAllCompanyUser: 2
+      };
+      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 = "添加完课模板";
+    },
+    //选择视频号
+    hanldeSelectVideoNum(content, index) {
+      this.videoNumOptions.content = content;
+      this.videoNumOptions.contentIndex = index;
+      this.videoNumOptions.open = true;
+    },
+
+    qwUserVideoResult(val) {
+
+      // 根据选中的内容,将返回的数据更新到相应的表单项
+      const content = this.videoNumOptions.content;
+      const setList = content[this.videoNumOptions.contentIndex];
+      setList.nickname = val.nickname;
+      setList.avatar = val.avatar;
+      setList.coverUrl = val.coverUrl;
+      setList.thumbUrl = val.thumbUrl;
+      setList.desc = val.desc;
+      setList.url = val.url;
+      setList.extras = val.extras;
+      setList.videoId = val.id;
+      console.info(setList)
+
+      this.videoNumOptions.open = false;
+
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getCourseFinishTempParent(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改完课模板";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateCourseFinishTempParent(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            if (this.form.isAllCompanyUser == null) {
+              this.form.isAllCompanyUser = 2;
+            }
+            this.form.companyUserIds = this.companyUserIds.toString()
+
+
+            const processedSetting = this.setting.map(item => {
+              const newItem = {...item};
+              if (newItem.videoOptions) {
+                delete newItem.videoOptions;
+              }
+              if (newItem.videoLoading !== undefined) {
+                delete newItem.videoLoading;
+              }
+              return newItem;
+            });
+
+            this.form.setting = JSON.stringify(processedSetting);
+            this.form.chatSetting = JSON.stringify(this.chatSetting)
+
+            if (this.setting.length <= 0) {
+              return this.$message("请添加规则")
+            }
+            for (let i = 0; i < this.setting.length; i++) {
+              if (this.setting[i].contentType == 1 && (this.setting[i].value == null || this.setting[i].value == "")) {
+                return this.$message.error("内容不能为空")
+              }
+              if (this.setting[i].contentType == 2 && (this.setting[i].imgUrl == null || this.setting[i].imgUrl == "")) {
+                return this.$message.error("图片不能为空")
+              }
+              if (this.setting[i].contentType == 3 && (this.setting[i].linkTitle == null || this.setting[i].linkTitle == "")) {
+                return this.$message.error("链接标题不能为空")
+              }
+              if (this.setting[i].contentType == 3 && (this.setting[i].linkDescribe == null || this.setting[i].linkDescribe == "")) {
+                return this.$message.error("链接描述不能为空")
+              }
+              if (this.setting[i].contentType == 3 && (this.setting[i].linkImageUrl == null || this.setting[i].linkImageUrl == "")) {
+                return this.$message.error("链接图片不能为空")
+              }
+              if (this.setting[i].contentType == 3 && this.setting[i].type == 1 && (this.setting[i].linkUrl == null || this.setting[i].linkUrl == "")) {
+                return this.$message.error("链接地址不能为空")
+              }
+              if (this.setting[i].contentType == 5 && (this.setting[i].fileUrl == null || this.setting[i].fileUrl == "")) {
+                return this.$message.error("文件不能为空")
+              }
+              if (this.setting[i].contentType == 6 && (this.setting[i].videoUrl == null || this.setting[i].videoUrl == "")) {
+                return this.$message.error("视频不能为空")
+              }
+              if (this.setting[i].contentType == 7 && (this.setting[i].value == null || this.setting[i].value == "")) {
+                return this.$message.error("语音不能为空")
+              }
+            }
+            addCourseFinishTempParent(this.form).then(response => {
+              // this.loading = true
+              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 delCourseFinishTempParent(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有完课模板数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return deptExportCourseFinishTempParent(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    },
+
+
+    handleAvatarSuccessFile(res, file, item) {
+      if (res.code === 200) {
+        // 使用 $set 确保响应式更新
+        this.$set(item, 'fileUrl', res.url);
+      } else {
+        this.msgError(res.msg);
+      }
+    },
+
+    beforeAvatarUploadFile(file) {
+      const isLt1M = file.size / 1024 / 1024 < 10;
+      if (!isLt1M) {
+        this.$message.error('上传大小不能超过 10MB!');
+      }
+      return isLt1M;
+    },
+    //下载文件
+    downloadUrl(materialUrl) {
+      // 直接返回文件 URL
+      return materialUrl;
+    },
+    handleInputVideoText(value, content) {
+      // 允许的字符:中文、英文(大小写)、数字和指定标点符号(,。!?)
+      const regex = /^[\u4e00-\u9fa5,。!?,!?]+$/;
+
+      // 删除不符合条件的字符
+      const filteredValue = value.split('').filter(char => regex.test(char)).join('');
+
+      this.$set(content, 'value', filteredValue);
+
+    },
+    handleAvatarSuccessVideo(res, file, item) {
+      if (res.code == 200) {
+        // 使用 $set 确保响应式更新
+        this.$set(item, 'videoUrl', res.url);
+      } else {
+        this.msgError(res.msg);
+      }
+    },
+
+    beforeAvatarUploadVideo(file) {
+      const isLt30M = file.size / 1024 / 1024 < 10;
+      const isMP4 = file.type === 'video/mp4';
+
+      if (!isMP4) {
+        this.$message.error('仅支持上传 MP4 格式的视频文件!');
+        return false;
+      }
+
+      if (!isLt30M) {
+        this.$message.error('上传大小不能超过 10MB!');
+        return false;
+      }
+
+      return true;
+    },
+
+    delSetList(index, type) {
+      if (type == 0) {
+        this.setting.splice(index, 1)
+      } else {
+        this.chatSetting.splice(index, 1)
+      }
+    },
+    addSetList(type) {
+      const newSetting = {
+        contentType: '1',
+        value: '',
+      };
+      // 将新设置项添加到 content.setting 数组中
+      if (type == 0) {
+        this.setting.push(newSetting);
+      } else {
+        this.chatSetting.push(newSetting);
+      }
+    },
+    jump(id){
+      this.$router.push('/qw/conversion/courseFinishTemp/' + id)
+    },
+  },
+};
+</script>

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

@@ -0,0 +1,993 @@
+<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="courseId">
+        <el-select v-model="queryParams.courseId" clearable placeholder="请选择课程" style=" margin-right: 10px;" size="mini">
+          <el-option
+            v-for="dict in courseList"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="parseInt(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="['course:courseFinishTempParent:myAdd']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['course:courseFinishTempParent:myEdit']"
+        >修改</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="['course:courseFinishTempParent:myRemove']"
+        >删除</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="['course:courseFinishTempParent:myExport']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <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="name" />
+      <el-table-column label="课程" align="center" prop="courseId">
+        <template slot-scope="scope">
+          <el-tag v-for="dict in courseList" v-if="dict.dictValue == scope.row.courseId">{{dict.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"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['course:courseFinishTempParent:myEdit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            @click="jump(scope.row.id)"
+          >模板列表</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['course:courseFinishTempParent:myRemove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改完课模板对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入名称" />
+        </el-form-item>
+        <el-form-item label="状态" v-if="!form.id">
+          <el-radio-group v-model="form.status">
+            <el-radio
+              v-for="dict in statusOptions"
+              :key="dict.dictValue"
+              :label="parseInt(dict.dictValue)"
+            >{{ dict.dictLabel }}
+            </el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="课程" prop="courseId">
+          <el-select v-model="form.courseId" :disabled="form.id != null" placeholder="请选择课程" style=" margin-right: 10px;" size="mini">
+            <el-option
+              v-for="dict in courseList"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="parseInt(dict.dictValue)"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="规则" prop="setting" v-if="!form.id">
+          <div v-for="(item, index) in setting" :key="index"
+               style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;">
+            <el-row>
+              <el-col :span="22">
+                <el-form :model="item" label-width="70px">
+                  <el-form-item label="内容类别" style="margin: 2%">
+                    <el-radio-group v-model="item.contentType">
+                      <el-radio :label="item.dictValue" v-for="item in sysQwSopAiContentType">{{ item.dictLabel }}
+                      </el-radio>
+                    </el-radio-group>
+                  </el-form-item>
+                  <el-form-item label="内容" style="margin-bottom: 2%">
+                    <el-input v-if="item.contentType == 1 " v-model="item.value" type="textarea" :rows="3"
+                              placeholder="内容" style="width: 90%;margin-top: 10px;"/>
+
+                    <ImageUpload v-if="item.contentType == 2 " v-model="item.imgUrl" type="image" :num="1" :width="150"
+                                 :height="150"/>
+
+                    <div v-if="item.contentType == 3 ">
+                      <el-card class="box-card">
+                        <el-form-item label="链接标题:" label-width="100px">
+                          <el-input v-model="item.linkTitle" placeholder="请输入链接标题" style="width: 90%;"/>
+                        </el-form-item>
+                        <el-form-item label="链接描述:" label-width="100px">
+                          <el-input type="textarea" :rows="3" v-model="item.linkDescribe" placeholder="请输入链接描述"
+                                    style="width: 90%;margin-top: 1%;"/>
+                        </el-form-item>
+                        <el-form-item label="链接封面:" label-width="100px">
+                          <ImageUpload v-model="item.linkImageUrl" type="image" :num="1" :file-size="2" :width="150"
+                                       :height="150" style="margin-top: 1%;"/>
+                        </el-form-item>
+                        <el-form-item label="链接地址:" label-width="100px">
+                          <el-input v-model="item.linkUrl" placeholder="请输入链接地址" style="width: 90%;"/>
+                        </el-form-item>
+                      </el-card>
+                    </div>
+                    <div v-if="item.contentType == 4">
+                      <el-card class="box-card">
+
+                        <el-form-item label="选择课程">
+                          <el-select
+                            v-model="item.courseId"
+                            placeholder="请选择课程"
+                            style="margin-right: 10px"
+                            size="mini"
+                            @change="handleRuleCourseChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in courseList"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                          <el-select
+                            v-model="item.videoId"
+                            placeholder="请选择小节"
+                            size="mini"
+                            style="margin-right: 10px"
+                            filterable
+                            remote
+                            :remote-method="(query) => remoteMethodRuleVideo(query, item)"
+                            :loading="videoOptionsLoading"
+                            @change="handleRuleVideoChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in videoOptions || []"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                        </el-form-item>
+
+                        <el-card class="box-card" style="margin-top: 10px">
+                          <el-form-item label="标题" prop="miniprogramTitle">
+                            <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字" />
+                          </el-form-item>
+                          <el-form-item label="封面" prop="miniprogramPicUrl">
+                            <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
+                          </el-form-item>
+                        </el-card>
+                      </el-card>
+                    </div>
+                    <div v-if="item.contentType == 5 ">
+
+                      <el-form-item label="上传文件:" prop="fileUrl" label-width="100px">
+                        <el-upload
+                          v-model="item.fileUrl"
+                          class="avatar-uploader"
+                          :action="uploadUrl"
+                          :show-file-list="false"
+                          :on-success="(res, file) => handleAvatarSuccessFile(res, file, item)"
+                          :before-upload="beforeAvatarUploadFile">
+                          <i class="el-icon-plus avatar-uploader-icon"></i>
+                        </el-upload>
+                        <el-link v-if="item.fileUrl" type="primary" :href="downloadUrl(item.fileUrl)" download>
+                          {{ item.fileUrl }}
+                        </el-link>
+                      </el-form-item>
+
+                    </div>
+
+                    <div v-if="item.contentType == 6 ">
+                      <el-form-item label="上传视频:" prop="videoUrl" label-width="100px">
+                        <el-upload
+                          v-model="item.videoUrl"
+                          class="avatar-uploader"
+                          :action="uploadUrl"
+                          :show-file-list="false"
+                          :on-success="(res, file) => handleAvatarSuccessVideo(res, file, item)"
+                          :before-upload="beforeAvatarUploadVideo">
+                          <i class="el-icon-plus avatar-uploader-icon"></i>
+                        </el-upload>
+                        <video v-if="item.videoUrl"
+                               :src="item.videoUrl"
+                               controls style="width: 200px;height: 100px">
+                        </video>
+                      </el-form-item>
+                    </div>
+                    <div v-if="item.contentType == 7 ">
+                      <el-input
+                        v-model="item.value"
+                        type="textarea" :rows="3" maxlength="66" show-word-limit
+                        placeholder="输入要转为语音的内容" style="width: 90%;margin-top: 10px;"
+                        @input="handleInputVideoText(item.value,item)"/>
+                    </div>
+                    <div v-if="item.contentType == 8">
+                      <el-button type="primary"
+                                 style="margin-bottom: 1%"
+                                 @click="hanldeSelectVideoNum(setting,index)">
+                        选择视频号
+                      </el-button>
+                      <el-card class="box-card" v-if="item.coverUrl">
+                        <el-form-item label="封面标题:" label-width="100px">
+                          <el-input v-model="item.nickname"
+                                    style="width: 90%;margin-bottom: 1%" disabled/>
+                        </el-form-item>
+                        <el-form-item label="头像:" label-width="100px">
+                          <el-image
+                            v-if="item.avatar != null"
+                            :src="item.avatar"
+                            :preview-src-list="[item.avatar]"
+                            :style="{ width: '50px', height: '50px' }"
+                          ></el-image>
+                        </el-form-item>
+                        <el-form-item label="封面:" label-width="100px">
+                          <el-image
+                            v-if="item.coverUrl != null"
+                            :src="item.coverUrl"
+                            :preview-src-list="[item.coverUrl]"
+                            :style="{ width: '200px', height: '200px' }"
+                          ></el-image>
+
+                        </el-form-item>
+                        <el-form-item label="简介:" label-width="100px">
+                          <el-input type="textarea" :rows="3"
+                                    v-model="item.desc"
+                                    style="width: 90%;margin-top: 1%;" disabled/>
+                        </el-form-item>
+                        <el-form-item label="视频地址:" label-width="100px"
+                                      style="margin-top: 1%">
+                          <el-input v-model="item.url"
+                                    style="width: 90%;" disabled/>
+                        </el-form-item>
+                      </el-card>
+                    </div>
+
+                  </el-form-item>
+                </el-form>
+              </el-col>
+              <el-col :span="1" :offset="1">
+                <i class="el-icon-delete" @click="delSetList(index, 0)" style="margin-top: 20px;"
+                   v-if="setting.length>1"></i>
+              </el-col>
+            </el-row>
+          </div>
+          <el-link type="primary" class="el-icon-plus" :underline="false" @click='addSetList(0)'>
+            添加内容
+          </el-link>
+        </el-form-item>
+        <el-form-item label="群聊恭喜规则" prop="setting" v-if="!form.id">
+          <div v-for="(item, index) in chatSetting" :key="index"
+               style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;">
+            <el-row>
+              <el-col :span="22">
+                <el-form :model="item" label-width="70px">
+                  <el-form-item label="内容类别" style="margin: 2%">
+                    <el-radio-group v-model="item.contentType">
+                      <el-radio :label="item.dictValue" v-for="item in sysQwSopAiContentType">{{ item.dictLabel }}
+                      </el-radio>
+                    </el-radio-group>
+                  </el-form-item>
+                  <el-form-item label="内容" style="margin-bottom: 2%">
+                    <el-input v-if="item.contentType == 1 " v-model="item.value" type="textarea" :rows="3"
+                              placeholder="内容" style="width: 90%;margin-top: 10px;"/>
+
+                    <ImageUpload v-if="item.contentType == 2 " v-model="item.imgUrl" type="image" :num="1" :width="150"
+                                 :height="150"/>
+
+                    <div v-if="item.contentType == 3 ">
+                      <el-card class="box-card">
+                        <el-form-item label="链接标题:" label-width="100px">
+                          <el-input v-model="item.linkTitle" placeholder="请输入链接标题" style="width: 90%;"/>
+                        </el-form-item>
+                        <el-form-item label="链接描述:" label-width="100px">
+                          <el-input type="textarea" :rows="3" v-model="item.linkDescribe" placeholder="请输入链接描述"
+                                    style="width: 90%;margin-top: 1%;"/>
+                        </el-form-item>
+                        <el-form-item label="链接封面:" label-width="100px">
+                          <ImageUpload v-model="item.linkImageUrl" type="image" :num="1" :file-size="2" :width="150"
+                                       :height="150" style="margin-top: 1%;"/>
+                        </el-form-item>
+                        <el-form-item label="链接地址:" label-width="100px">
+                          <el-input v-model="item.linkUrl" placeholder="请输入链接地址" style="width: 90%;"/>
+                        </el-form-item>
+                      </el-card>
+                    </div>
+                    <div v-if="item.contentType == 4">
+                      <el-card class="box-card">
+
+                        <el-form-item label="选择课程">
+                          <el-select
+                            v-model="item.courseId"
+                            placeholder="请选择课程"
+                            style="margin-right: 10px"
+                            size="mini"
+                            @change="handleRuleCourseChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in courseList"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                          <el-select
+                            v-model="item.videoId"
+                            placeholder="请选择小节"
+                            size="mini"
+                            style="margin-right: 10px"
+                            filterable
+                            remote
+                            :remote-method="(query) => remoteMethodRuleVideo(query, item)"
+                            :loading="videoOptionsLoading"
+                            @change="handleRuleVideoChange(item)"
+                          >
+                            <el-option
+                              v-for="dict in videoOptions || []"
+                              :key="dict.dictValue"
+                              :label="dict.dictLabel"
+                              :value="parseInt(dict.dictValue)"
+                            />
+                          </el-select>
+                        </el-form-item>
+
+                        <el-card class="box-card" style="margin-top: 10px">
+                          <el-form-item label="标题" prop="miniprogramTitle">
+                            <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字" />
+                          </el-form-item>
+                          <el-form-item label="封面" prop="miniprogramPicUrl">
+                            <ImageUpload v-model="item.miniprogramPicUrl" type="image" :num="10" :width="150" :height="150" />
+                          </el-form-item>
+                        </el-card>
+                      </el-card>
+                    </div>
+                    <div v-if="item.contentType == 5 ">
+
+                      <el-form-item label="上传文件:" prop="fileUrl" label-width="100px">
+                        <el-upload
+                          v-model="item.fileUrl"
+                          class="avatar-uploader"
+                          :action="uploadUrl"
+                          :show-file-list="false"
+                          :on-success="(res, file) => handleAvatarSuccessFile(res, file, item)"
+                          :before-upload="beforeAvatarUploadFile">
+                          <i class="el-icon-plus avatar-uploader-icon"></i>
+                        </el-upload>
+                        <el-link v-if="item.fileUrl" type="primary" :href="downloadUrl(item.fileUrl)" download>
+                          {{ item.fileUrl }}
+                        </el-link>
+                      </el-form-item>
+
+                    </div>
+
+                    <div v-if="item.contentType == 6 ">
+                      <el-form-item label="上传视频:" prop="videoUrl" label-width="100px">
+                        <el-upload
+                          v-model="item.videoUrl"
+                          class="avatar-uploader"
+                          :action="uploadUrl"
+                          :show-file-list="false"
+                          :on-success="(res, file) => handleAvatarSuccessVideo(res, file, item)"
+                          :before-upload="beforeAvatarUploadVideo">
+                          <i class="el-icon-plus avatar-uploader-icon"></i>
+                        </el-upload>
+                        <video v-if="item.videoUrl"
+                               :src="item.videoUrl"
+                               controls style="width: 200px;height: 100px">
+                        </video>
+                      </el-form-item>
+                    </div>
+                    <div v-if="item.contentType == 7 ">
+                      <el-input
+                        v-model="item.value"
+                        type="textarea" :rows="3" maxlength="66" show-word-limit
+                        placeholder="输入要转为语音的内容" style="width: 90%;margin-top: 10px;"
+                        @input="handleInputVideoText(item.value,item)"/>
+                    </div>
+                    <div v-if="item.contentType == 8">
+                      <el-button type="primary"
+                                 style="margin-bottom: 1%"
+                                 @click="hanldeSelectVideoNum(setting,index)">
+                        选择视频号
+                      </el-button>
+                      <el-card class="box-card" v-if="item.coverUrl">
+                        <el-form-item label="封面标题:" label-width="100px">
+                          <el-input v-model="item.nickname"
+                                    style="width: 90%;margin-bottom: 1%" disabled/>
+                        </el-form-item>
+                        <el-form-item label="头像:" label-width="100px">
+                          <el-image
+                            v-if="item.avatar != null"
+                            :src="item.avatar"
+                            :preview-src-list="[item.avatar]"
+                            :style="{ width: '50px', height: '50px' }"
+                          ></el-image>
+                        </el-form-item>
+                        <el-form-item label="封面:" label-width="100px">
+                          <el-image
+                            v-if="item.coverUrl != null"
+                            :src="item.coverUrl"
+                            :preview-src-list="[item.coverUrl]"
+                            :style="{ width: '200px', height: '200px' }"
+                          ></el-image>
+
+                        </el-form-item>
+                        <el-form-item label="简介:" label-width="100px">
+                          <el-input type="textarea" :rows="3"
+                                    v-model="item.desc"
+                                    style="width: 90%;margin-top: 1%;" disabled/>
+                        </el-form-item>
+                        <el-form-item label="视频地址:" label-width="100px"
+                                      style="margin-top: 1%">
+                          <el-input v-model="item.url"
+                                    style="width: 90%;" disabled/>
+                        </el-form-item>
+                      </el-card>
+                    </div>
+
+                  </el-form-item>
+                </el-form>
+              </el-col>
+              <el-col :span="1" :offset="1">
+                <i class="el-icon-delete" @click="delSetList(index,1)" style="margin-top: 20px;"
+                   v-if="setting.length>1"></i>
+              </el-col>
+            </el-row>
+          </div>
+          <el-link type="primary" class="el-icon-plus" :underline="false" @click='addSetList(1)'>
+            添加内容
+          </el-link>
+        </el-form-item>
+        <el-form-item label="全选销售" prop="isAllCompanyUser" v-if="!form.id">
+          <el-switch
+            v-model="form.isAllCompanyUser"
+            active-color="#13ce66"
+            inactive-color="#ff4949"
+            :active-value="1"
+            :inactive-value="2">
+          </el-switch>
+          <span v-if="form.isAllCompanyUser == '1'" style="margin-left: 10px;color: #13ce66">是</span>
+          <span v-else style="margin-left: 10px;color: #ff4949">否</span>
+        </el-form-item>
+        <el-form-item label="所属销售" prop="companyUserIds" v-if="!form.id && form.isAllCompanyUser == '2'">
+          <el-select v-model="companyUserIds" remote multiple placeholder="请选择" filterable style="width: 100%;">
+            <el-option
+              v-for="dict in userList"
+              :key="dict.userId"
+              :label="dict.nickName"
+              :value="dict.userId.toString()">
+            </el-option>
+          </el-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>
+    </el-dialog>
+    <el-dialog :title="videoNumOptions.title" :visible.sync="videoNumOptions.open" width="1500px" append-to-body>
+      <userVideo ref="QwUserVideo" @videoResult="qwUserVideoResult"></userVideo>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { myListCourseFinishTempParent, getCourseFinishTempParent, delCourseFinishTempParent, addCourseFinishTempParent, updateCourseFinishTempParent, exportCourseFinishTempParent } from "@/api/course/courseFinishTempParent";
+import {courseList, videoList} from '@/api/qw/sop'
+import ImageUpload from '@/views/qw/sop/ImageUpload.vue'
+import { getUserList } from '@/api/company/companyUser'
+import userVideo from "@/views/qw/userVideo/userVideo.vue";
+import {myExportCourseFinishTempParent} from "../../../api/course/courseFinishTempParent";
+
+
+export default {
+  name: "CourseFinishTempParent",
+  components: { ImageUpload ,userVideo},
+  data() {
+    return {
+      videoOptionsLoading: false,
+      videoOptions: [],
+      videoLoading: false,
+      videoNumOptions: {
+        title: '选择视频号',
+        open: false,
+        content: null,
+        contentIndex: null,
+      },
+      voiceLoading: false,
+      uploadUrl: process.env.VUE_APP_BASE_API + "/common/uploadOSS2",
+      uploadUrlByVoice: process.env.VUE_APP_BASE_API + "/common/uploadOSSByHOOKVoice",
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 完课模板表格数据
+      courseFinishTempParentList: [],
+      companyUserIds: [],
+      courseList: [],
+      userList: [],
+      // 状态字典
+      statusOptions: [],
+      allowSelect: [],
+      sysFsSopWatchStatus: [],
+      sysQwSopAiContentType: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 模板表格数据
+      setting: [],
+      chatSetting: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        courseId: null,
+      },
+      // 表单参数
+      form: {companyUserIds: [],},
+      // 表单校验
+      rules: {
+        name:[
+          { required: true, message: "名称不能为空", trigger: "blur" }
+        ],
+        courseId:[
+          { required: true, message: "课程不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getDicts("sys_company_status").then(response => {
+      this.statusOptions = response.data;
+    });//复用一下
+    this.getDicts("sys_qw_allow_select").then(response => {
+      this.allowSelect = response.data;
+    });
+
+    this.getDicts("sys_fs_sop_watch_status").then(response => {
+      this.sysFsSopWatchStatus = response.data;
+    });
+
+    this.getDicts("sys_qwSopAi_contentType").then(response => {
+      this.sysQwSopAiContentType = response.data;
+    });
+    getUserList().then(response => {
+      this.userList = response.data;
+    });
+    courseList().then(response => {
+      this.courseList = response.list;
+    });
+    this.getList();
+  },
+  methods: {
+    // 处理规则中课程变化
+    handleRuleCourseChange(item) {
+      // 为当前规则项单独加载视频列表
+      videoList(item.courseId).then((response) => {
+        // 只保存视频列表,不保存整个响应对象
+        this.videoOptions = response.list;
+
+        this.$set(item, 'videoId', null); // Reset video selection when course changes
+
+        // 自动设置封面为课程封面
+        const selectedCourse = this.courseList.find(
+          course => parseInt(course.dictValue) === item.courseId
+        );
+        if (selectedCourse) {
+          this.$set(item, 'miniprogramPicUrl', selectedCourse.dictImgUrl);
+        }
+      });
+    },
+
+
+    // 处理规则中视频变化
+    handleRuleVideoChange(item) {
+      if (!item.videoId) return;
+
+      // 自动设置标题为视频标题
+      const selectedVideo = (this.videoOptions || []).find(
+        video => parseInt(video.dictValue) === item.videoId
+      );
+      if (selectedVideo) {
+        this.$set(item, 'miniprogramTitle', selectedVideo.dictLabel);
+      }
+    },
+
+    // 远程搜索规则中的视频
+    remoteMethodRuleVideo(query, item) {
+      if (!item.courseId) {
+        this.$message.warning('请先选择课程');
+        this.videoOptions = [];
+        reject();
+        return;
+      }
+
+      this.videoOptionsLoading = true;
+      const data = query ? { title: query } : {};
+
+      videoList(item.courseId, data).then((response) => {
+        this.videoOptions =  response.list;
+        this.videoOptionsLoading =  false;
+        resolve(response);
+      }).catch((error) => {
+        this.videoOptionsLoading = false;
+        reject(error);
+      });
+    },
+    remoteMethodVideo(query) {
+      if (!this.form.courseId) {
+        this.$message.warning('请先选择课程');
+        this.videoList = []; // 清空小节列表
+        return;
+      }
+      if (query !== '') {
+        this.videoLoading = true;
+        // 这里调用接口搜索小节,假设 videoList 方法支持搜索参数
+        var data = {
+          title:query
+        }
+        videoList(this.form.courseId, data).then((response) => {
+          this.videoList = response.list;
+          this.videoLoading = false;
+        });
+      } else {
+        // 如果查询为空,则加载全部
+        videoList(this.form.courseId).then((response) => {
+          this.videoList = response.list;
+        });
+      }
+    },
+    /** 查询完课模板列表 */
+    getList() {
+      this.loading = true;
+      myListCourseFinishTempParent(this.queryParams).then(response => {
+        this.courseFinishTempParentList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        status: 1,
+        name: null,
+        setting: [],
+        chatSetting: [],
+        courseId: null,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        companyUserIds: null,
+        remark: null,
+        isAllCompanyUser: 2
+      };
+      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 = "添加完课模板";
+    },
+    //选择视频号
+    hanldeSelectVideoNum(content, index) {
+      this.videoNumOptions.content = content;
+      this.videoNumOptions.contentIndex = index;
+      this.videoNumOptions.open = true;
+    },
+
+    qwUserVideoResult(val) {
+
+      // 根据选中的内容,将返回的数据更新到相应的表单项
+      const content = this.videoNumOptions.content;
+      const setList = content[this.videoNumOptions.contentIndex];
+      setList.nickname = val.nickname;
+      setList.avatar = val.avatar;
+      setList.coverUrl = val.coverUrl;
+      setList.thumbUrl = val.thumbUrl;
+      setList.desc = val.desc;
+      setList.url = val.url;
+      setList.extras = val.extras;
+      setList.videoId = val.id;
+      console.info(setList)
+
+      this.videoNumOptions.open = false;
+
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getCourseFinishTempParent(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改完课模板";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateCourseFinishTempParent(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            if (this.form.isAllCompanyUser == null) {
+              this.form.isAllCompanyUser = 2;
+            }
+            this.form.companyUserIds = this.companyUserIds.toString()
+
+
+            const processedSetting = this.setting.map(item => {
+              const newItem = {...item};
+              if (newItem.videoOptions) {
+                delete newItem.videoOptions;
+              }
+              if (newItem.videoLoading !== undefined) {
+                delete newItem.videoLoading;
+              }
+              return newItem;
+            });
+
+            this.form.setting = JSON.stringify(processedSetting);
+            this.form.chatSetting = JSON.stringify(this.chatSetting)
+
+            if (this.setting.length <= 0) {
+              return this.$message("请添加规则")
+            }
+            for (let i = 0; i < this.setting.length; i++) {
+              if (this.setting[i].contentType == 1 && (this.setting[i].value == null || this.setting[i].value == "")) {
+                return this.$message.error("内容不能为空")
+              }
+              if (this.setting[i].contentType == 2 && (this.setting[i].imgUrl == null || this.setting[i].imgUrl == "")) {
+                return this.$message.error("图片不能为空")
+              }
+              if (this.setting[i].contentType == 3 && (this.setting[i].linkTitle == null || this.setting[i].linkTitle == "")) {
+                return this.$message.error("链接标题不能为空")
+              }
+              if (this.setting[i].contentType == 3 && (this.setting[i].linkDescribe == null || this.setting[i].linkDescribe == "")) {
+                return this.$message.error("链接描述不能为空")
+              }
+              if (this.setting[i].contentType == 3 && (this.setting[i].linkImageUrl == null || this.setting[i].linkImageUrl == "")) {
+                return this.$message.error("链接图片不能为空")
+              }
+              if (this.setting[i].contentType == 3 && this.setting[i].type == 1 && (this.setting[i].linkUrl == null || this.setting[i].linkUrl == "")) {
+                return this.$message.error("链接地址不能为空")
+              }
+              if (this.setting[i].contentType == 5 && (this.setting[i].fileUrl == null || this.setting[i].fileUrl == "")) {
+                return this.$message.error("文件不能为空")
+              }
+              if (this.setting[i].contentType == 6 && (this.setting[i].videoUrl == null || this.setting[i].videoUrl == "")) {
+                return this.$message.error("视频不能为空")
+              }
+              if (this.setting[i].contentType == 7 && (this.setting[i].value == null || this.setting[i].value == "")) {
+                return this.$message.error("语音不能为空")
+              }
+            }
+            addCourseFinishTempParent(this.form).then(response => {
+              // this.loading = true
+              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 delCourseFinishTempParent(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有完课模板数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return myExportCourseFinishTempParent(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    },
+
+
+    handleAvatarSuccessFile(res, file, item) {
+      if (res.code === 200) {
+        // 使用 $set 确保响应式更新
+        this.$set(item, 'fileUrl', res.url);
+      } else {
+        this.msgError(res.msg);
+      }
+    },
+
+    beforeAvatarUploadFile(file) {
+      const isLt1M = file.size / 1024 / 1024 < 10;
+      if (!isLt1M) {
+        this.$message.error('上传大小不能超过 10MB!');
+      }
+      return isLt1M;
+    },
+    //下载文件
+    downloadUrl(materialUrl) {
+      // 直接返回文件 URL
+      return materialUrl;
+    },
+    handleInputVideoText(value, content) {
+      // 允许的字符:中文、英文(大小写)、数字和指定标点符号(,。!?)
+      const regex = /^[\u4e00-\u9fa5,。!?,!?]+$/;
+
+      // 删除不符合条件的字符
+      const filteredValue = value.split('').filter(char => regex.test(char)).join('');
+
+      this.$set(content, 'value', filteredValue);
+
+    },
+    handleAvatarSuccessVideo(res, file, item) {
+      if (res.code == 200) {
+        // 使用 $set 确保响应式更新
+        this.$set(item, 'videoUrl', res.url);
+      } else {
+        this.msgError(res.msg);
+      }
+    },
+
+    beforeAvatarUploadVideo(file) {
+      const isLt30M = file.size / 1024 / 1024 < 10;
+      const isMP4 = file.type === 'video/mp4';
+
+      if (!isMP4) {
+        this.$message.error('仅支持上传 MP4 格式的视频文件!');
+        return false;
+      }
+
+      if (!isLt30M) {
+        this.$message.error('上传大小不能超过 10MB!');
+        return false;
+      }
+
+      return true;
+    },
+
+    delSetList(index, type) {
+      if (type == 0) {
+        this.setting.splice(index, 1)
+      } else {
+        this.chatSetting.splice(index, 1)
+      }
+    },
+    addSetList(type) {
+      const newSetting = {
+        contentType: '1',
+        value: '',
+      };
+      // 将新设置项添加到 content.setting 数组中
+      if (type == 0) {
+        this.setting.push(newSetting);
+      } else {
+        this.chatSetting.push(newSetting);
+      }
+    },
+    jump(id){
+      this.$router.push('/qw/conversion/courseFinishTemp/' + id)
+    },
+  },
+};
+</script>

+ 10 - 2
src/views/course/courseUserStatistics/qw/index.vue

@@ -11,7 +11,8 @@
         <treeselect
           style="width: 220px"
           :clearable="false"
-          v-model="queryParams.deptId"
+          v-model="queryParams.deptIds"
+          multiple
           :options="deptOptions"
           clearable
           :show-count="true"
@@ -453,6 +454,7 @@ export default {
   },
   methods: {
     getSummaries(param) {
+      let totalNum = 0;
       const { columns, data } = param;
       const sums = [];
       columns.forEach((column, index) => {
@@ -471,7 +473,13 @@ export default {
               return prev;
             }
           }, 0);
-
+          //第三列计数为进线数量和
+          if(index === 3){
+            totalNum = sums[index];
+          }
+          if(index > 3 && totalNum != 0){
+              sums[index] = sums[index] + "("+ ((sums[index] / totalNum) * 100).toFixed(2)  + "%)"
+          }
           if (
             column.property === "firstOnline" ||
             column.property === "firstOver" ||

+ 63 - 1
src/views/course/courseUserStatistics/qw/my.vue

@@ -19,7 +19,14 @@
       </el-form-item>
     </el-form>
 
-    <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange"  show-summary height="600">
+    <el-table 
+    border 
+    v-loading="loading" 
+    :data="courseWatchLogList"
+    @selection-change="handleSelectionChange" 
+    :show-summary="true"
+    :summary-method="getSummaries"
+    ref="table1">
       <el-table-column type="selection" width="55" align="center" />
         <el-table-column label="企微员工名称" align="center" prop="qwUserName" />
 
@@ -205,6 +212,56 @@ export default {
     });
   },
   methods: {
+     getSummaries(param) {
+      let totalNum = 0;
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = "总计";
+          return;
+        }
+
+        const values = data.map((item) => Number(item[column.property]));
+        if (!values.every((value) => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          //第三列计数为进线数量和
+          if(index === 3){
+            totalNum = sums[index];
+          }
+          if(index > 3 && totalNum != 0){
+              sums[index] = sums[index] + "("+ ((sums[index] / totalNum) * 100).toFixed(2)  + "%)"
+          }
+          if (
+            column.property === "firstOnline" ||
+            column.property === "firstOver" ||
+            column.property === "d1Online" ||
+            column.property === "d1Over" ||
+            column.property === "sign" ||
+            column.property === "interact" ||
+            column.property === "a" ||
+            column.property === "b" ||
+            column.property === "c" ||
+            column.property === "d" ||
+            column.property === "e" ||
+            column.property === "black" ||
+            column.property === "los" ||
+            column.property === "del"
+          ) {
+          }
+        } else {
+          sums[index] = "";
+        }
+      });
+      return sums;
+    },
     courseChange(row){
       this.queryParams.videoId=null;
       if(row === ''){
@@ -241,6 +298,11 @@ export default {
         this.total = response.total;
         this.loading = false;
       });
+       this.$nextTick(() => {
+        setTimeout(() => {
+          this.$refs.table1?.doLayout();
+        }, 2000);
+      });
     },
     // 取消按钮
     cancel() {

+ 51 - 6
src/views/course/courseWatchLog/deptWatchLog.vue

@@ -383,11 +383,12 @@
         </el-table-column>
         <el-table-column label="课程名称" align="center" prop="courseName"/>
         <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>
-          </template>
-        </el-table-column>
+        <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>-->
         <el-table-column label="销售名称" align="center" prop="companyUserName"/>
         <el-table-column label="企微员工名称" align="center" prop="qwUserName"/>
         <el-table-column label="公司名称" align="center" prop="companyName"/>
@@ -627,13 +628,30 @@ export default {
     courseList().then(response => {
       this.courseLists = response.list;
     });
-    this.getList();
+
     this.getDicts("sys_course_watch_log_type").then(response => {
       this.logTypeOptions = response.data;
     });
+
+    // 设置默认当天时间 xgb 防止频繁查询大量数据
+    this.setToday();
+
+    this.getList();
     this.getCompanyUserListLikeName(true);
+    this.loading=false;
   },
   methods: {
+    setToday(){
+      const today = new Date();
+      const todayStart = new Date(today);
+      todayStart.setHours(0, 0, 0, 0);
+      const todayEnd = new Date(today);
+      todayEnd.setHours(23, 59, 59, 999);
+
+      this.createTimeText = [this.formatDate(todayStart), this.formatDate(todayEnd)];
+      this.queryParams.sTime = this.formatDate(todayStart);
+      this.queryParams.eTime = this.formatDate(todayEnd);
+    },
     handleSendTypeChange() {
       this.handleQuery(); // 重新查询列表
     },
@@ -685,6 +703,12 @@ export default {
     },
     /** 查询短链课程看课记录列表 */
     getList() {
+      // xgb 看课数据量太大必须限制时间
+      if (!this.createTimeText) {
+        this.$message.warning('请选择创建时间');
+        return;
+      }
+
       this.loading = true;
       if(this.queryParams.logType == "10"){
         this.queryParams.logType = null;
@@ -753,6 +777,8 @@ export default {
       // 统一重置日历组件
       this.resetCalendars();
 
+      this.setToday();
+
       this.handleQuery();
     },
     // 多选框选中数据
@@ -813,6 +839,11 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
+      if (!this.createTimeText) {
+        this.$message.warning('请选择创建时间');
+        return;
+      }
+
       const that = this
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
@@ -888,6 +919,19 @@ export default {
     // 创建时间
     createChange(createTime) {
       if (createTime && createTime.length >= 2) {
+        const startDate = new Date(createTime[0]);
+        const endDate = new Date(createTime[1]);
+        const timeDiff = Math.abs(endDate.getTime() - startDate.getTime());
+        const diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
+
+        // 限制时间区间为一个月
+        if (diffDays > 31) {
+          this.$message.warning('创建时间区间不能超过一个月');
+          this.createTimeText = null;
+          this.queryParams.sTime = null;
+          this.queryParams.eTime = null;
+          return;
+        }
         // this.createTimeText = this.formatDateRange(createTime);
         this.queryParams.sTime = this.formatDate(createTime[0]) || null;
         this.queryParams.eTime = this.formatDate(createTime[1]) || null;
@@ -1039,6 +1083,7 @@ export default {
           this.companyUserOptionsLoading = false;
         });
       }else {
+        this.companyUserOptionsParams.pageSize=10;
         getCompanyUserListLikeName(this.companyUserOptionsParams).then(response => {
           this.companyUserOptions = [...this.companyUserOptions, ...response.data.list]
           this.companyUserOptionsParams.hasNextPage = response.data.hasNextPage

+ 47 - 2
src/views/course/courseWatchLog/index.vue

@@ -815,16 +815,34 @@ export default {
     courseList().then(response => {
       this.courseLists = response.list;
     });
-    this.getList();
+
     this.getDicts("sys_course_watch_log_type_new").then(response => {
       this.logTypeOptions = response.data;
     });
     this.getDicts("sys_course_project").then(response => {
       this.projectOptions = response.data;
     });
+
+    // 设置默认当天时间 xgb 防止频繁查询大量数据
+    this.setToday();
+
+    this.getList();
     this.getCompanyUserListLikeName(true);
+
+    this.loading=false;
   },
   methods: {
+    setToday(){
+      const today = new Date();
+      const todayStart = new Date(today);
+      todayStart.setHours(0, 0, 0, 0);
+      const todayEnd = new Date(today);
+      todayEnd.setHours(23, 59, 59, 999);
+
+      this.createTimeText = [this.formatDate(todayStart), this.formatDate(todayEnd)];
+      this.queryParams.sTime = this.formatDate(todayStart);
+      this.queryParams.eTime = this.formatDate(todayEnd);
+    },
     /**
      * 处理所属销售下拉框显示状态变化
      */
@@ -916,13 +934,14 @@ export default {
     getCompanyUserListLikeName(isAll) {
 
       if (isAll){
-
+        this.companyUserOptionsParams.pageSize = 200;
         getCompanyUserListLikeName(this.companyUserOptionsParams).then(response => {
           this.companyUserOptionsByAll = [...this.companyUserOptions, ...response.data.list]
           this.companyUserOptionsParams.hasNextPage = response.data.hasNextPage
           this.companyUserOptionsLoading = false;
         });
       }else {
+        this.companyUserOptionsParams.pageSize = 10;
         getCompanyUserListLikeName(this.companyUserOptionsParams).then(response => {
           this.companyUserOptions = [...this.companyUserOptions, ...response.data.list]
           this.companyUserOptionsParams.hasNextPage = response.data.hasNextPage
@@ -1018,6 +1037,20 @@ export default {
     // 创建时间
     createChange(createTime) {
       if (createTime && createTime.length >= 2) {
+        const startDate = new Date(createTime[0]);
+        const endDate = new Date(createTime[1]);
+        const timeDiff = Math.abs(endDate.getTime() - startDate.getTime());
+        const diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
+
+        // 限制时间区间为一个月
+        if (diffDays > 31) {
+          this.$message.warning('创建时间区间不能超过一个月');
+          this.createTimeText = null;
+          this.queryParams.sTime = null;
+          this.queryParams.eTime = null;
+          return;
+        }
+
         // this.createTimeText = this.formatDateRange(createTime);
         this.queryParams.sTime = this.formatDate(createTime[0]) || null;
         this.queryParams.eTime = this.formatDate(createTime[1]) || null;
@@ -1155,6 +1188,12 @@ export default {
     },
     /** 查询短链课程看课记录列表 */
     getList() {
+      // xgb 看课数据量太大必须限制时间
+      if (!this.createTimeText) {
+        this.$message.warning('请选择创建时间');
+        return;
+      }
+
       this.loading = true;
       if(this.queryParams.logType == "10"){
         this.queryParams.logType = null;
@@ -1222,6 +1261,8 @@ export default {
       this.queryParams.scheduleEndTime = null;
       this.queryParams.sopId = null; // 重置SOP ID
 
+      this.setToday();
+
       // 重置SOP搜索
       this.handleSopClear();
 
@@ -1288,6 +1329,10 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
+      if (!this.createTimeText) {
+        this.$message.warning('请选择创建时间');
+        return;
+      }
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
           confirmButtonText: "确定",

+ 61 - 1
src/views/course/courseWatchLog/qw/statistics.vue

@@ -54,7 +54,7 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange"  show-summary>
+    <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange"  show-summary :summary-method="getSummaries" >
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="企微员工名称" align="center" prop="qwUserName" />
       <el-table-column label="发课时间" align="center" prop="createTime"/>
@@ -159,6 +159,66 @@ export default {
     });
   },
   methods: {
+     getSummaries(param) {
+      let totalNum = 0;
+      const { columns, data } = param;
+      const sums = [];
+      let totalOnline = 0;
+      let totalFinishCourse = 0;
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = "总计";
+          return;
+        }
+        const values = data.map((item) => Number(item[column.property]));
+        if (!values.every((value) => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          if(index > 3 && totalNum != 0){
+              sums[index] = sums[index] + "("+ ((sums[index] / totalNum) * 100).toFixed(2)  + "%)"
+          }
+          if( column.property=="videoName"){
+            sums[index] = "";
+          }
+          if (
+            column.property === "type3" ||
+            column.property === "type1" ||
+            column.property === "type2" ||
+            column.property === "type4" ||
+            column.property === "sendNumber" ||
+            column.property === "isUserWaitNumber" ||
+            column.property === "noUserWaitNumber" ||
+            column.property === "onLineRate" ||
+            column.property === "finishedRate" ||
+            column.property === "redAmount" 
+          ) {
+          }
+        } else {
+          sums[index] = "";
+          if(index === 12 || index === 13){
+            //  let numbers = data.map(item => {
+            //   return parseFloat(item[column.property].replace('%', '')) || 0; // 处理空值或无效值
+            // });
+            // let sumRates = numbers.reduce((acc, curr) => acc + curr, 0);
+            // console.log("index:" + index + " rates:" + sumRates + " data.length:" + data.length);
+            if(index === 12 && !!sums[9]){
+              let sumsNum = sums[6] + sums[7] + sums[8];
+              sums[index] = (sumsNum * 100 / sums[9]).toFixed(2) + '%';
+            } else if(index === 13 && !!sums[9]){
+              sums[index] =  (sums[7] * 100 / sums[9]).toFixed(2) + '%';
+            }
+          } 
+        }
+      });
+      console.log(sums);
+      return sums;
+    },
     courseChange(row){
       this.queryParams.videoId=null;
       if(row === ''){

+ 45 - 4
src/views/course/courseWatchLog/watchLog.vue

@@ -788,7 +788,7 @@ export default {
     courseList().then(response => {
       this.courseLists = response.list;
     });
-    this.getList();
+
     this.getDicts("sys_course_watch_log_type_new").then(response => {
       this.logTypeOptions = response.data;
     });
@@ -796,14 +796,30 @@ export default {
     this.getDicts("sys_company_or").then(response => {
       this.sysCompanyOr = response.data;
     });
-    getMyQwUserList().then(response => {
-      this.myQwUserList = response.data;
-    });
     this.getDicts("sys_course_project").then(response => {
       this.projectOptions = response.data;
     });
+    // 设置默认当天时间 xgb 防止频繁查询大量数据
+    this.setToday();
+
+    this.getList();
+    getMyQwUserList().then(response => {
+      this.myQwUserList = response.data;
+    });
+
   },
   methods: {
+    setToday(){
+      const today = new Date();
+      const todayStart = new Date(today);
+      todayStart.setHours(0, 0, 0, 0);
+      const todayEnd = new Date(today);
+      todayEnd.setHours(23, 59, 59, 999);
+
+      this.createTimeText = [this.formatDate(todayStart), this.formatDate(todayEnd)];
+      this.queryParams.sTime = this.formatDate(todayStart);
+      this.queryParams.eTime = this.formatDate(todayEnd);
+    },
 
     handleSendTypeChange() {
       // 重置相关参数
@@ -902,6 +918,20 @@ export default {
     // 创建时间
     createChange(createTime) {
       if (createTime && createTime.length >= 2) {
+        const startDate = new Date(createTime[0]);
+        const endDate = new Date(createTime[1]);
+        const timeDiff = Math.abs(endDate.getTime() - startDate.getTime());
+        const diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
+
+        // 限制时间区间为一个月
+        if (diffDays > 31) {
+          this.$message.warning('创建时间区间不能超过一个月');
+          this.createTimeText = null;
+          this.queryParams.sTime = null;
+          this.queryParams.eTime = null;
+          return;
+        }
+
         // this.createTimeText = this.formatDateRange(createTime);
         this.queryParams.sTime = this.formatDate(createTime[0]) || null;
         this.queryParams.eTime = this.formatDate(createTime[1]) || null;
@@ -1027,6 +1057,11 @@ export default {
 
     /** 查询短链课程看课记录列表 */
     getList() {
+      // xgb 看课数据量太大必须限制时间
+      if (!this.createTimeText) {
+        this.$message.warning('请选择创建时间');
+        return;
+      }
       this.loading = true;
       let param = JSON.parse(JSON.stringify(this.queryParams));
       if (param.logType == "10") {
@@ -1100,6 +1135,8 @@ export default {
       // 统一重置日历组件
       this.resetCalendars();
 
+      this.setToday();
+
       this.handleQuery();
     },
     // 多选框选中数据
@@ -1161,6 +1198,10 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
+      if (!this.createTimeText) {
+        this.$message.warning('请选择创建时间');
+        return;
+      }
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
         confirmButtonText: "确定",

+ 0 - 7
src/views/crm/customer/full.vue

@@ -487,13 +487,6 @@ export default {
           this.citys=res.data;
         })
     },
-    handleShow(row){
-      var that=this;
-      that.show.open=true;
-      setTimeout(() => {
-          that.$refs.customerDetails.getDetails(row.customerId);
-      }, 200);
-    },
     /** 查询客户列表 */
     getList() {
       this.loading = true;

+ 43 - 4
src/views/index.vue

@@ -3,7 +3,7 @@
     <!-- 数据概览 (Data Overview) -->
     <el-card class="overview-section" shadow="never">
       <el-row :gutter="20">
-        <el-col :xs="24" :sm="24" :md="16" :lg="16" :xl="16" class="companybox">
+        <el-col :xs="24" :sm="24" :md="16" :lg="12" :xl="12" class="companybox">
           <img src="../assets/images/topbg.png" alt="" class="topimg">
           <img src="../assets/images/topbg.png" alt="" class="bottomimg">
           <div class="companyboxtitle">
@@ -54,8 +54,7 @@
           </div>
         </el-col>
 
-
-        <el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8" class="propertyboxtitle">
+        <el-col :xs="24" :sm="24" :md="6" :lg="6" :xl="6" class="propertyboxtitle">
           <div class="property_title">
             资产概览
           </div>
@@ -83,6 +82,33 @@
           </div>
 
         </el-col>
+
+
+        <el-col :xs="24" :sm="24" :md="6" :lg="6" :xl="6" class="propertyboxtitle">
+          <div class="property_title">
+            红包概览
+          </div>
+          <div class="propertyboxflex">
+            <div class="property-card propertyline">
+              <div class="property-title">
+                <i class="el-icon-money"></i>
+                红包余额 (元)
+              </div>
+              <div class="card-value highlight">
+                <count-to :decimals="2"  :start-val="0" :end-val="redBalance" :duration="3600" class="card-panel-num" />
+              </div>
+            </div>
+            <div class="property-card">
+              <div class="property-title">
+                <span>今日余额变化 (元)</span>
+              </div>
+              <div class="card-value highlight">
+                <count-to :decimals="2" :start-val="0" :end-val="redTodayComsumption" :duration="3600" class="card-panel-num" />
+              </div>
+            </div>
+          </div>
+
+        </el-col>
       </el-row>
 
       <le-row :gutter="20">
@@ -528,8 +554,9 @@ import {
   authorizationInfo,
   dealerAggregated, deaMemberTopTen, rechargeComsumption, rewardMoneyTopTen, rewardMoneyTrend,
   smsBalance, thisMonthOrderCount, thisMonthRecvCount, trafficLog,
-  watchCourseTopTen, watchEndPlayTrend,getWatchCourseStatisticsData
+  watchCourseTopTen, watchEndPlayTrend,getWatchCourseStatisticsData,
 } from "@/api/statistics/statistics";
+import {redPacketInfo} from "@/api/company/redPacket";
 import dayjs from 'dayjs';
 
 
@@ -975,6 +1002,8 @@ export default {
       todayComsumption: 0,
       yesterdayComsumption: 0,
       balance: 0,
+      redBalance:0,
+      redTodayComsumption:0,
       autoRefreshInterval: null,
       // 今日新增用户数
       todayIncreaseUserNum: 0,
@@ -1140,6 +1169,16 @@ export default {
         }
       });
 
+      // 获取红包概览
+      redPacketInfo().then(res=>{
+        if(res.code === 200){
+          if(res.data){
+            this.redBalance = res.data.redBalance;
+            this.redTodayComsumption = res.data.redTodayComsumption;
+          }
+        }
+      })
+
       trafficLog().then(res=>{
         if(res.code === 200) {
           this.todayTraffic = res.data.today;

+ 1 - 1
src/views/qw/contactWay/group.vue

@@ -16,7 +16,7 @@
     <el-table v-loading="loading" :data="materialGroupList"
               @row-click="changeCurrentRow"
               :row-style="rowStyle"
-              :cell-style="setSellStyle" >
+              :cell-style="setSellStyle" height="600px">
       <!-- 保留的列 -->
       <el-table-column label="组名" align="center" prop="groupName" >
         <template slot-scope="scope">

+ 92 - 67
src/views/qw/friendWelcome/indexNew.vue

@@ -484,7 +484,7 @@
         </div>
         <div v-if="welcomeItem.type==='miniprogram'">
 
-          <el-form-item label="选择课程">
+          <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-option
                 v-for="dict in courseList"
@@ -532,7 +532,7 @@
         </div>
       </el-form>
       <div slot="footer" class="dialog-footer" style="text-align: center">
-        <el-button type="primary" @click="confirmUpload">确定</el-button>
+        <el-button type="primary" @click="confirmUpload('fileFrom')">确定</el-button>
         <el-button type="primary" @click="cancelUpload">取消</el-button>
       </div>
     </el-dialog>
@@ -593,6 +593,24 @@ export default {
         linkTitle:[ { required: true, message: "图文标题不能为空", trigger: "submit" }],
         linkUrl:[ { required: true, message: "图文链接不能为空", trigger: "submit" }],
         miniprogramTitle:[ { required: true, message: "图文链接不能为空", trigger: "submit" }],
+        miniprogramCourseId:[
+          {
+            required: true,
+            validator: (rule, value, callback) => {
+              // 检查id是否为空
+              if (!this.fileFrom.courseId) {
+                return callback(new Error('请选择课程'));
+              }
+              // 检查ddId是否为空
+              if (!this.fileFrom.videoId) {
+                return callback(new Error('请选择小节'));
+              }
+              // 校验通过
+              callback();
+            },
+            trigger: 'change' // 下拉选择变化时触发校验
+          }
+        ]
       },
 
 
@@ -999,72 +1017,79 @@ export default {
 
     //提交附件
     confirmUpload(fileFrom) {
-      const { type, index, itemIndex } = this.welcomeItem;
-      let attachment = {};
-      if (type === 'image') {
-        attachment = {
-          msgtype: 'image',
-          image: {
-            pic_url: this.fileFrom.imagePicUrl
-          }
-        };
-      } else if (type === 'video') {
-        attachment = {
-          msgtype: 'video',
-          video: {
-            url:this.fileFrom.videoUrl,
-          }
-        };
-      } else if (type === 'link') {
-        attachment = {
-          msgtype: 'link',
-          link: {
-            title: this.fileFrom.linkTitle,
-            picurl: this.fileFrom.linkPicUrl,
-            desc: this.fileFrom.linkDesc,
-            url: this.fileFrom.linkUrl,
-            courseId:this.fileFrom.courseId,
-            videoId:this.fileFrom.videoId,
-            expiresDays:this.fileFrom.expiresDays,
-          }
-        };
-      }else if (type==='miniprogram'){
-        attachment = {
-          msgtype: 'miniprogram',
-          miniprogram: {
-            title: this.fileFrom.miniprogramTitle,
-            pic_media_id: "待查询",
-            appid: "wx73f85f8d62769119",
-            page: this.fileFrom.miniprogramPage,
-            courseId:this.fileFrom.courseId,
-            videoId:this.fileFrom.videoId,
-            expiresDays:this.fileFrom.expiresDays,
-          }
-        };
-      }
-
-      if (itemIndex === -1) {
-        // 默认欢迎语附件处理
-        if (index < this.form.attachments.length) {
-          // 存在附件则更新
-          this.form.attachments.splice(index, 1, attachment);
-        } else {
-          // 不存在附件则插入
-          this.form.attachments.push(attachment);
-        }
-
-      } else {
-        // 分时段欢迎语附件处理
-        if (index < this.form.daypartingItemlist[itemIndex].attachments.length) {
-          // 存在附件则更新
-          this.form.daypartingItemlist[itemIndex].attachments.splice(index, 1, attachment);
-        } else {
-          // 不存在附件则插入
-          this.form.daypartingItemlist[itemIndex].attachments.push(attachment);
-        }
-      }
+     this.$refs[fileFrom].validate((valid) => {
+          if (valid) {
+            const { type, index, itemIndex } = this.welcomeItem;
+            let attachment = {};
+            if (type === 'image') {
+              attachment = {
+                msgtype: 'image',
+                image: {
+                  pic_url: this.fileFrom.imagePicUrl
+                }
+              };
+            } else if (type === 'video') {
+              attachment = {
+                msgtype: 'video',
+                video: {
+                  url:this.fileFrom.videoUrl,
+                }
+              };
+            } else if (type === 'link') {
+              attachment = {
+                msgtype: 'link',
+                link: {
+                  title: this.fileFrom.linkTitle,
+                  picurl: this.fileFrom.linkPicUrl,
+                  desc: this.fileFrom.linkDesc,
+                  url: this.fileFrom.linkUrl,
+                  courseId:this.fileFrom.courseId,
+                  videoId:this.fileFrom.videoId,
+                  expiresDays:this.fileFrom.expiresDays,
+                }
+              };
+            }else if (type==='miniprogram'){
+              attachment = {
+                msgtype: 'miniprogram',
+                miniprogram: {
+                  title: this.fileFrom.miniprogramTitle,
+                  pic_media_id: "待查询",
+                  appid: "wx73f85f8d62769119",
+                  page: this.fileFrom.miniprogramPage,
+                  courseId:this.fileFrom.courseId,
+                  videoId:this.fileFrom.videoId,
+                  expiresDays:this.fileFrom.expiresDays,
+                }
+              };
+            }
 
-      this.resetFileFrom();
+            if (itemIndex === -1) {
+              // 默认欢迎语附件处理
+              if (index < this.form.attachments.length) {
+                // 存在附件则更新
+                this.form.attachments.splice(index, 1, attachment);
+              } else {
+                // 不存在附件则插入
+                this.form.attachments.push(attachment);
+              }
+
+            } else {
+              // 分时段欢迎语附件处理
+              if (index < this.form.daypartingItemlist[itemIndex].attachments.length) {
+                // 存在附件则更新
+                this.form.daypartingItemlist[itemIndex].attachments.splice(index, 1, attachment);
+              } else {
+                // 不存在附件则插入
+                this.form.daypartingItemlist[itemIndex].attachments.push(attachment);
+              }
+            }
+            this.resetFileFrom();
+          } else {
+            console.log('error submit!!');
+            return false;
+          }
+        });
+     
     },
 
     //取消附件

+ 92 - 66
src/views/qw/friendWelcome/myWelcome.vue

@@ -481,7 +481,7 @@
         </div>
         <div v-if="welcomeItem.type==='miniprogram'">
 
-          <el-form-item label="选择课程">
+          <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-option
                 v-for="dict in courseList"
@@ -529,7 +529,7 @@
         </div>
       </el-form>
       <div slot="footer" class="dialog-footer" style="text-align: center">
-        <el-button type="primary" @click="confirmUpload">确定</el-button>
+        <el-button type="primary" @click="confirmUpload('fileFrom')">确定</el-button>
         <el-button type="primary" @click="cancelUpload">取消</el-button>
       </div>
     </el-dialog>
@@ -591,6 +591,24 @@ export default {
         linkTitle:[ { required: true, message: "图文标题不能为空", trigger: "submit" }],
         linkUrl:[ { required: true, message: "图文链接不能为空", trigger: "submit" }],
         miniprogramTitle:[ { required: true, message: "图文链接不能为空", trigger: "submit" }],
+        miniprogramCourseId:[
+          {
+            required: true,
+            validator: (rule, value, callback) => {
+              // 检查id是否为空
+              if (!this.fileFrom.courseId) {
+                return callback(new Error('请选择课程'));
+              }
+              // 检查ddId是否为空
+              if (!this.fileFrom.videoId) {
+                return callback(new Error('请选择小节'));
+              }
+              // 校验通过
+              callback();
+            },
+            trigger: 'change' // 下拉选择变化时触发校验
+          }
+        ]
       },
 
 
@@ -999,73 +1017,81 @@ export default {
 
     //提交附件
     confirmUpload(fileFrom) {
+    this.$refs[fileFrom].validate((valid) => {
+      if (valid) {
+        const { type, index, itemIndex } = this.welcomeItem;
+            let attachment = {};
+            if (type === 'image') {
+              attachment = {
+                msgtype: 'image',
+                image: {
+                  pic_url: this.fileFrom.imagePicUrl
+                }
+              };
+            } else if (type === 'video') {
+              attachment = {
+                msgtype: 'video',
+                video: {
+                  url:this.fileFrom.videoUrl,
+                }
+              };
+            } else if (type === 'link') {
+              attachment = {
+                msgtype: 'link',
+                link: {
+                  title: this.fileFrom.linkTitle,
+                  picurl: this.fileFrom.linkPicUrl,
+                  desc: this.fileFrom.linkDesc,
+                  url: this.fileFrom.linkUrl,
+                  courseId:this.fileFrom.courseId,
+                  videoId:this.fileFrom.videoId,
+                  expiresDays:this.fileFrom.expiresDays,
+                }
+              };
+            }else if (type==='miniprogram'){
+              attachment = {
+                msgtype: 'miniprogram',
+                miniprogram: {
+                  title: this.fileFrom.miniprogramTitle,
+                  pic_media_id: "待查询",
+                  appid: "wx73f85f8d62769119",
+                  page: this.fileFrom.miniprogramPage,
+                  courseId:this.fileFrom.courseId,
+                  videoId:this.fileFrom.videoId,
+                  expiresDays:this.fileFrom.expiresDays,
+                }
+              };
+            }
 
-      const { type, index, itemIndex } = this.welcomeItem;
-      let attachment = {};
-      if (type === 'image') {
-        attachment = {
-          msgtype: 'image',
-          image: {
-            pic_url: this.fileFrom.imagePicUrl
-          }
-        };
-      } else if (type === 'video') {
-        attachment = {
-          msgtype: 'video',
-          video: {
-            url:this.fileFrom.videoUrl,
-          }
-        };
-      } else if (type === 'link') {
-        attachment = {
-          msgtype: 'link',
-          link: {
-            title: this.fileFrom.linkTitle,
-            picurl: this.fileFrom.linkPicUrl,
-            desc: this.fileFrom.linkDesc,
-            url: this.fileFrom.linkUrl,
-            courseId:this.fileFrom.courseId,
-            videoId:this.fileFrom.videoId,
-            expiresDays:this.fileFrom.expiresDays,
-          }
-        };
-      }else if (type==='miniprogram'){
-        attachment = {
-          msgtype: 'miniprogram',
-          miniprogram: {
-            title: this.fileFrom.miniprogramTitle,
-            pic_media_id: "待查询",
-            appid: "wx73f85f8d62769119",
-            page: this.fileFrom.miniprogramPage,
-            courseId:this.fileFrom.courseId,
-            videoId:this.fileFrom.videoId,
-            expiresDays:this.fileFrom.expiresDays,
-          }
-        };
-      }
-
-      if (itemIndex === -1) {
-        // 默认欢迎语附件处理
-        if (index < this.form.attachments.length) {
-          // 存在附件则更新
-          this.form.attachments.splice(index, 1, attachment);
-        } else {
-          // 不存在附件则插入
-          this.form.attachments.push(attachment);
-        }
+            if (itemIndex === -1) {
+              // 默认欢迎语附件处理
+              if (index < this.form.attachments.length) {
+                // 存在附件则更新
+                this.form.attachments.splice(index, 1, attachment);
+              } else {
+                // 不存在附件则插入
+                this.form.attachments.push(attachment);
+              }
+
+            } else {
+              // 分时段欢迎语附件处理
+              if (index < this.form.daypartingItemlist[itemIndex].attachments.length) {
+                // 存在附件则更新
+                this.form.daypartingItemlist[itemIndex].attachments.splice(index, 1, attachment);
+              } else {
+                // 不存在附件则插入
+                this.form.daypartingItemlist[itemIndex].attachments.push(attachment);
+              }
+            }
 
-      } else {
-        // 分时段欢迎语附件处理
-        if (index < this.form.daypartingItemlist[itemIndex].attachments.length) {
-          // 存在附件则更新
-          this.form.daypartingItemlist[itemIndex].attachments.splice(index, 1, attachment);
-        } else {
-          // 不存在附件则插入
-          this.form.daypartingItemlist[itemIndex].attachments.push(attachment);
+            this.resetFileFrom();
+        }else {
+          console.log('error submit!!');
+          return false;
         }
-      }
-
-      this.resetFileFrom();
+          
+      });
+      
     },
 
     //取消附件

+ 80 - 4
src/views/qw/sop/addSop.vue

@@ -70,7 +70,55 @@
           </div>
           <Tip title="企业微信员工账号" />
         </el-form-item>
-        <el-form-item label="群聊" prop="chatIds" v-if="form.filterMode == 2">
+        <el-form-item label="是否自动创建群" prop="autoGroup" v-if="form.filterMode == 2">
+          <el-radio-group v-model="form.autoGroup">
+            <el-radio
+              :label="0"
+            >否
+            </el-radio>
+            <el-radio
+              :label="1"
+            >是
+            </el-radio>
+          </el-radio-group>
+          <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="autoGroup" v-if="form.filterMode == 2 && form.autoGroup == 1">
+          <el-radio-group v-model="form.autoUserReg">
+            <el-radio
+              :label="0"
+            >否
+            </el-radio>
+            <el-radio
+              :label="1"
+            >是
+            </el-radio>
+          </el-radio-group>
+          <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="chatIds" v-if="form.filterMode == 2 && form.autoGroup == 1">
+          <el-select multiple filterable clearable v-model="form.autoGroupLevelArray">
+            <el-option v-for="item in levelList" :key="item.value" :label="item.label" :value="item.value"/>
+          </el-select>
+          <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="chatIds" v-if="form.filterMode == 2 && form.autoGroup == 1">
+          <el-input v-model="form.groupName" maxlength="10" placeholder="请输入群聊名称" />
+          <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="chatIds" v-if="form.filterMode == 2 && form.autoGroup == 0">
           <el-select multiple filterable clearable v-model="form.chatIds">
             <el-option v-for="item in qwGroupList" :key="item.chatId" :label="item.name" :value="item.chatId"/>
           </el-select>
@@ -526,7 +574,14 @@ export default {
       companyUserLists: [],
       // 状态字典
       statusOptions: [],
-
+      levelList: [
+        {value: 1, label: "A"},
+        {value: 2, label: "B"},
+        {value: 3, label: "C"},
+        {value: 4, label: "D"},
+        {value: 5, label: "E"},
+        {value: -1, label: "未评级"}
+      ],
       //企微SOP发送类型
       sysQwSopType: [],
       projectOptions: [],
@@ -544,6 +599,11 @@ export default {
         isFixed: 0,
         isRegister: 0,
         type: 2,
+        autoGroup:0,
+        autoUserReg:0,
+        autoGroupLevelArray:[],
+        autoGroupLevel:null,
+        groupName:null,
         filterType: 2,
         expiryTime: 4,
         isAutoSop: 1,
@@ -888,6 +948,11 @@ export default {
         filterType: 2,
         expiryTime: 4,
         qwUserIds: null,
+        autoGroup:0,
+        autoGroupLevelArray:[],
+        autoGroupLevel:null,
+        groupName:null,
+        autoUserReg:0,
         corpId: null,
         setting: null,
         createBy: null,
@@ -942,10 +1007,21 @@ export default {
         if (valid) {
           if (this.form.type == 2 && this.form.filterMode == 2) {
             this.form.sendType = 11;
-            if (this.form.chatIds.length <= 0) {
-              return this.$message.error("请选择群聊")
+            if(this.form.autoGroup == 0){
+              if (this.form.chatIds.length <= 0) {
+                return this.$message.error("请选择群聊")
+              }
+            }
+            if(this.form.autoGroup == 1){
+              if (this.form.autoGroupLevelArray.length <= 0) {
+                return this.$message.error("请选择评级")
+              }
+              if (this.form.groupName == null) {
+                return this.$message.error("请输入群聊名称")
+              }
             }
             this.form.chatId = this.form.chatIds.join();
+            this.form.autoGroupLevel = this.form.autoGroupLevelArray.join();
           } else {
             if (this.userSelectList.length <= 0) {
               return this.$message.error("请选择员工")

+ 120 - 38
src/views/qw/sop/deptSop.vue

@@ -104,6 +104,18 @@
         >删除
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleSopLogsDelete"
+          v-hasPermi="['qw:sopLogs:removeAll']"
+        >批量删除执行任务
+        </el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button
           type="success"
@@ -128,6 +140,18 @@
         >批量执行SOP
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-tooltip class="item" effect="dark" content="此功能用于给 选中的 SOP任务营期 内【所有的】客户发送 消息【或者发送草稿-/-清楚草稿】" placement="top">
+          <el-button
+            type="warning"
+            icon="el-icon-s-promotion"
+            size="mini"
+            :disabled="multiple"
+            @click="handleCampSendMsg"
+            v-hasPermi="['qw:sopUserLogsInfo:msgSop']"
+          >SOP营期一键群发(或草稿)</el-button>
+        </el-tooltip>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <el-table v-loading="loading" border :data="sopList" @selection-change="handleSelectionChange">
@@ -313,6 +337,7 @@
       @pagination="getList"
     />
 
+    <send-msg-sop-open-tool ref="sendMsgSopOpenTool" ></send-msg-sop-open-tool>
     <!-- 添加或修改企微sop对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
@@ -734,7 +759,20 @@
                       </el-card>
                     </div>
                     <div v-if="item.contentType == 4">
-
+                      <el-card class="box-card">
+                        <el-form-item label="标题" prop="miniprogramTitle">
+                          <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字"  />
+                        </el-form-item>
+                        <el-form-item label="封面" prop="miniprogramPicUrl">
+                          <ImageUpload v-model="item.miniprogramPicUrl"  type="image" :num="10" :width="150" :height="150" />
+                        </el-form-item>
+                        <el-form-item label="appid" prop="miniprogramAppid" v-show="false" >
+                          <el-input v-model="item.miniprogramAppid" disabled />
+                        </el-form-item>
+                        <el-form-item label="page路径" prop="miniprogramPage" v-show="false" label-width="100px" style="margin-left: -30px" >
+                          <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径"  disabled />
+                        </el-form-item>
+                      </el-card>
                     </div>
                     <div v-if="item.contentType == 5 ">
 
@@ -853,7 +891,7 @@
 import {
   addSop,
   courseList,
-  delSop,
+  delSop, delSopLogs,
   exportSop,
   getSopVoiceList, listDeptSop,
   listSop,
@@ -873,10 +911,11 @@ import sopLogsDetails from '@/views/qw/sopLogs/sopLogsList.vue'
 import {listTag,} from "@/api/qw/tag";
 import {getMyQwCompanyList} from "@/api/qw/user";
 import {allList} from "@/api/qw/groupChat";
+import SendMsgSopOpenTool from '@/views/qw/sopUserLogsInfo/sendMsgSopOpenTool.vue'
 
 export default {
   name: "Sop",
-  components: {CustomerGroupDetails, qwUserList, ImageUpload, sopLogsDetails},
+  components: {CustomerGroupDetails, qwUserList, ImageUpload, sopLogsDetails, SendMsgSopOpenTool},
   data() {
     return {
       // 存储每一行的展开状态
@@ -1071,6 +1110,16 @@ export default {
     }
   },
   methods: {
+    /**
+     * SOP任务营期一键群发
+     */
+    handleCampSendMsg(){
+
+      setTimeout(() => {
+        this.$refs.sendMsgSopOpenTool.oneClickGroupSending(this.ids,2,this.queryParams.corpId);
+      }, 500);
+
+    },
     voice(id) {
       this.voiceForm.queryParams.id = id;
       getSopVoiceList(this.voiceForm.queryParams).then(res => {
@@ -1342,9 +1391,9 @@ export default {
       });
     },
 
-    addSetList() {
+    addSetList(){
       const newSetting = {
-        contentType: '1',
+        contentType:'1',
         value: '',
       };
       // 将新设置项添加到 content.setting 数组中
@@ -1355,7 +1404,7 @@ export default {
     handleContentTypeChange() {
 
       //如果是链接的才上
-      if (this.msgForm.courseId != null) {
+      if (this.msgForm.courseId != null ) {
         const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === this.msgForm.courseId);
         for (let i = 0; i < this.setting.length; i++) {
           //响应式直接给链接的标题/封面上值
@@ -1363,6 +1412,9 @@ export default {
             this.$set(this.setting[i], 'linkTitle', selectedCourse.dictLabel);
             this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
           }
+          if (selectedCourse && this.setting[i].contentType == 4 && this.msgForm.courseId != null) {
+            this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
+          }
 
         }
 
@@ -1373,12 +1425,20 @@ export default {
 
         for (let i = 0; i < this.setting.length; i++) {
           //响应式直接给链接的描述上值
-          if (selectedVideo && this.setting[i].contentType == 3 && this.msgForm.videoId != null) {
-            this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+          if (selectedVideo && this.msgForm.videoId != null) {
+            console.log(2, this.setting[i].contentType)
+            if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9) {
+              this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+            }
+            if (this.setting[i].contentType == 4) {
+              this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
+            }
+
           }
         }
       }
 
+
     },
     videoIdChange() {
       if (this.msgForm.videoId != null) {
@@ -1387,8 +1447,16 @@ export default {
 
         for (let i = 0; i < this.setting.length; i++) {
           //响应式直接给链接的描述上值
-          if (selectedVideo && this.setting[i].contentType == 3 && this.msgForm.videoId != null) {
-            this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+          if (selectedVideo && this.msgForm.videoId != null) {
+            if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9) {
+              this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+            }
+
+            if (this.setting[i].contentType == 4) {
+              this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
+            }
+
+
           }
         }
       }
@@ -1420,7 +1488,7 @@ export default {
         createBy: null,
         createTime: null,
         isAutoSop: null,
-        autoSopTime: { autoSopType: 2, autoStartTime: '00:00', autoEndTime: '24:00', autoSopSend: 2 },
+        autoSopTime: {autoSopType: 2, autoStartTime: '00:00', autoEndTime: '24:00', autoSopSend: 2},
       };
       this.resetForm("form");
       this.tags = null;
@@ -1469,7 +1537,7 @@ export default {
         tempId: row.tempId,
         filterMode: row.filterMode,
         corpId: row.corpId,
-        type:1,
+        type: 1,
       }
       // 使用 params 传递参数
       this.$router.push({
@@ -1496,7 +1564,7 @@ export default {
         this.msgError(res.msg);
       }
     },
-    beforeAvatarUploadFile(file) {
+    beforeAvatarUploadFile(file){
       const isLt1M = file.size / 1024 / 1024 < 10;
       if (!isLt1M) {
         this.$message.error('上传大小不能超过 10MB!');
@@ -1510,7 +1578,7 @@ export default {
     },
 
     handleAvatarSuccessVideo(res, file, item) {
-      if (res.code == 200) {
+      if(res.code==200){
         // 使用 $set 确保响应式更新
         this.$set(item, 'videoUrl', res.url);
       } else {
@@ -1518,7 +1586,7 @@ export default {
       }
     },
 
-    beforeAvatarUploadVideo(file) {
+    beforeAvatarUploadVideo(file){
       const isLt30M = file.size / 1024 / 1024 < 10;
       const isMP4 = file.type === 'video/mp4';
 
@@ -1535,7 +1603,7 @@ export default {
       return true;
     },
 
-    handleInputVideoText(value, content) {
+    handleInputVideoText(value,content){
       // 允许的字符:中文、英文(大小写)、数字和指定标点符号(,。!?)
       const regex = /^[\u4e00-\u9fa5,。!?,!?]+$/;
 
@@ -1626,7 +1694,7 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
-      }).then(function() {
+      }).then(function () {
         return delSop(ids);
       }).then(() => {
         this.getList();
@@ -1634,6 +1702,17 @@ export default {
       }).catch(() => {
       });
     },
+    /** 删除按钮操作 */
+    handleSopLogsDelete() {
+      this.$confirm('是否确认删除企微sop编号为"' + this.ids + '"的所有发送任务(执行记录)数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => delSopLogs(this.ids)).then(() => {
+        this.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
     /**
      * 批量执行SOP任务
      */
@@ -1706,32 +1785,32 @@ export default {
     /**
      * 一键群发
      */
-    handleSendMsg(row) {
+    handleSendMsg(row){
       this.sendMsgOpen.open = true;
       this.sendMsgOpen.id = row.id;
       this.sendMsgOpen.row = row;
       this.msgForm.chatIds = row.chatId.split(",");
     },
-    submitMsgForm() {
+    submitMsgForm(){
       this.$refs["msgForm"].validate(valid => {
         if (valid) {
-          this.msgForm.setting = JSON.stringify(this.setting)
-          this.msgForm.sopId = this.sendMsgOpen.row.id;
-          this.msgForm.corpId = this.sendMsgOpen.row.corpId;
-          this.msgForm.filterMode = this.sendMsgOpen.row.filterMode;
+          this.msgForm.setting=JSON.stringify(this.setting)
+          this.msgForm.sopId=this.sendMsgOpen.row.id;
+          this.msgForm.corpId=this.sendMsgOpen.row.corpId;
+          this.msgForm.filterMode=this.sendMsgOpen.row.filterMode;
 
           if (this.setting.length <= 0) {
             return this.$message.error("请添加规则")
           }
-          if (this.msgForm.courseId === null || this.msgForm.courseId === '') {
+          if (this.msgForm.courseId===null || this.msgForm.courseId===''){
             return this.$message.error("课程不能为空")
           }
 
-          if (this.msgForm.videoId === null || this.msgForm.videoId === '') {
+          if (this.msgForm.videoId===null || this.msgForm.videoId===''){
             return this.$message.error("课节不能为空")
           }
 
-          if (this.msgForm.courseType === null || this.msgForm.courseType === '') {
+          if (this.msgForm.courseType===null || this.msgForm.courseType===''){
             return this.$message.error("消息类型不能为空")
           }
 
@@ -1777,19 +1856,19 @@ export default {
           sendMsgSop(this.msgForm).then(response => {
             this.msgSuccess("一键群发成功");
             loading.close();
-            this.setting = [];
+            this.setting=[];
             this.msgForm = {
-              videoId: null,
-              courseId: null,
-              courseType: null,
-              setting: null,
-              isRegister: 2,
-              sendType: 1,
-              filterMode: 2,
+              videoId:null,
+              courseId:null,
+              courseType:null,
+              setting:null,
+              isRegister:2,
+              sendType:1,
+              filterMode:2,
 
             }
             this.getList();
-          }).finally(() => {
+          }).finally(()=>{
             loading.close();
           });
 
@@ -1805,6 +1884,9 @@ export default {
             this.$set(this.setting[i], 'linkTitle', selectedCourse.dictLabel);
             this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
           }
+          if (selectedCourse && this.setting[i].contentType == 4 && this.msgForm.courseId != null) {
+            this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
+          }
 
         }
 
@@ -1813,12 +1895,12 @@ export default {
         this.videoList = response.list;
       });
     },
-    cancelMsgForm() {
+    cancelMsgForm(){
       this.sendMsgOpen.open = false;
       this.resetSendMsgSop();
     },
-    delSetList(index) {
-      this.setting.splice(index, 1)
+    delSetList(index){
+      this.setting.splice(index,1)
     },
   }
 };

+ 107 - 25
src/views/qw/sop/mySop.vue

@@ -104,6 +104,18 @@
         >删除
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleSopLogsDelete"
+          v-hasPermi="['qw:sopLogs:removeAll']"
+        >批量删除执行任务
+        </el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button
           type="success"
@@ -128,6 +140,18 @@
         >批量执行SOP
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-tooltip class="item" effect="dark" content="此功能用于给 选中的 SOP任务营期 内【所有的】客户发送 消息【或者发送草稿-/-清楚草稿】" placement="top">
+          <el-button
+            type="warning"
+            icon="el-icon-s-promotion"
+            size="mini"
+            :disabled="multiple"
+            @click="handleCampSendMsg"
+            v-hasPermi="['qw:sopUserLogsInfo:msgSop']"
+          >SOP营期一键群发(或草稿)</el-button>
+        </el-tooltip>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <el-table v-loading="loading" border :data="sopList" @selection-change="handleSelectionChange">
@@ -313,6 +337,7 @@
       @pagination="getList"
     />
 
+    <send-msg-sop-open-tool ref="sendMsgSopOpenTool" ></send-msg-sop-open-tool>
     <!-- 添加或修改企微sop对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
@@ -734,7 +759,20 @@
                       </el-card>
                     </div>
                     <div v-if="item.contentType == 4">
-
+                      <el-card class="box-card">
+                        <el-form-item label="标题" prop="miniprogramTitle">
+                          <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字"  />
+                        </el-form-item>
+                        <el-form-item label="封面" prop="miniprogramPicUrl">
+                          <ImageUpload v-model="item.miniprogramPicUrl"  type="image" :num="10" :width="150" :height="150" />
+                        </el-form-item>
+                        <el-form-item label="appid" prop="miniprogramAppid" v-show="false" >
+                          <el-input v-model="item.miniprogramAppid" disabled />
+                        </el-form-item>
+                        <el-form-item label="page路径" prop="miniprogramPage" v-show="false" label-width="100px" style="margin-left: -30px" >
+                          <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径"  disabled />
+                        </el-form-item>
+                      </el-card>
                     </div>
                     <div v-if="item.contentType == 5 ">
 
@@ -853,7 +891,7 @@
 import {
   addSop,
   courseList,
-  delSop,
+  delSop, delSopLogs,
   exportSop,
   getSopVoiceList, listMySop,
   listSop,
@@ -873,10 +911,11 @@ import sopLogsDetails from '@/views/qw/sopLogs/sopLogsList.vue'
 import {listTag,} from "@/api/qw/tag";
 import {getMyQwCompanyList} from "@/api/qw/user";
 import {allList} from "@/api/qw/groupChat";
+import SendMsgSopOpenTool from '@/views/qw/sopUserLogsInfo/sendMsgSopOpenTool.vue'
 
 export default {
   name: "Sop",
-  components: {CustomerGroupDetails, qwUserList, ImageUpload, sopLogsDetails},
+  components: {CustomerGroupDetails, qwUserList, ImageUpload, sopLogsDetails, SendMsgSopOpenTool},
   data() {
     return {
       // 存储每一行的展开状态
@@ -1071,6 +1110,16 @@ export default {
     }
   },
   methods: {
+    /**
+     * SOP任务营期一键群发
+     */
+    handleCampSendMsg(){
+
+      setTimeout(() => {
+        this.$refs.sendMsgSopOpenTool.oneClickGroupSending(this.ids,2,this.queryParams.corpId);
+      }, 500);
+
+    },
     voice(id) {
       this.voiceForm.queryParams.id = id;
       getSopVoiceList(this.voiceForm.queryParams).then(res => {
@@ -1342,9 +1391,9 @@ export default {
       });
     },
 
-    addSetList() {
+    addSetList(){
       const newSetting = {
-        contentType: '1',
+        contentType:'1',
         value: '',
       };
       // 将新设置项添加到 content.setting 数组中
@@ -1355,7 +1404,7 @@ export default {
     handleContentTypeChange() {
 
       //如果是链接的才上
-      if (this.msgForm.courseId != null) {
+      if (this.msgForm.courseId != null ) {
         const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === this.msgForm.courseId);
         for (let i = 0; i < this.setting.length; i++) {
           //响应式直接给链接的标题/封面上值
@@ -1363,6 +1412,9 @@ export default {
             this.$set(this.setting[i], 'linkTitle', selectedCourse.dictLabel);
             this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
           }
+          if (selectedCourse && this.setting[i].contentType == 4 && this.msgForm.courseId != null) {
+            this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
+          }
 
         }
 
@@ -1373,12 +1425,20 @@ export default {
 
         for (let i = 0; i < this.setting.length; i++) {
           //响应式直接给链接的描述上值
-          if (selectedVideo && this.setting[i].contentType == 3 && this.msgForm.videoId != null) {
-            this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+          if (selectedVideo && this.msgForm.videoId != null) {
+            console.log(2, this.setting[i].contentType)
+            if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9) {
+              this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+            }
+            if (this.setting[i].contentType == 4) {
+              this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
+            }
+
           }
         }
       }
 
+
     },
     videoIdChange() {
       if (this.msgForm.videoId != null) {
@@ -1387,8 +1447,16 @@ export default {
 
         for (let i = 0; i < this.setting.length; i++) {
           //响应式直接给链接的描述上值
-          if (selectedVideo && this.setting[i].contentType == 3 && this.msgForm.videoId != null) {
-            this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+          if (selectedVideo && this.msgForm.videoId != null) {
+            if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9) {
+              this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+            }
+
+            if (this.setting[i].contentType == 4) {
+              this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
+            }
+
+
           }
         }
       }
@@ -1420,7 +1488,7 @@ export default {
         createBy: null,
         createTime: null,
         isAutoSop: null,
-        autoSopTime: { autoSopType: 2, autoStartTime: '00:00', autoEndTime: '24:00', autoSopSend: 2 },
+        autoSopTime: {autoSopType: 2, autoStartTime: '00:00', autoEndTime: '24:00', autoSopSend: 2},
       };
       this.resetForm("form");
       this.tags = null;
@@ -1496,7 +1564,7 @@ export default {
         this.msgError(res.msg);
       }
     },
-    beforeAvatarUploadFile(file) {
+    beforeAvatarUploadFile(file){
       const isLt1M = file.size / 1024 / 1024 < 10;
       if (!isLt1M) {
         this.$message.error('上传大小不能超过 10MB!');
@@ -1510,7 +1578,7 @@ export default {
     },
 
     handleAvatarSuccessVideo(res, file, item) {
-      if (res.code == 200) {
+      if(res.code==200){
         // 使用 $set 确保响应式更新
         this.$set(item, 'videoUrl', res.url);
       } else {
@@ -1518,7 +1586,7 @@ export default {
       }
     },
 
-    beforeAvatarUploadVideo(file) {
+    beforeAvatarUploadVideo(file){
       const isLt30M = file.size / 1024 / 1024 < 10;
       const isMP4 = file.type === 'video/mp4';
 
@@ -1535,7 +1603,7 @@ export default {
       return true;
     },
 
-    handleInputVideoText(value, content) {
+    handleInputVideoText(value,content){
       // 允许的字符:中文、英文(大小写)、数字和指定标点符号(,。!?)
       const regex = /^[\u4e00-\u9fa5,。!?,!?]+$/;
 
@@ -1626,7 +1694,7 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"
-      }).then(function() {
+      }).then(function () {
         return delSop(ids);
       }).then(() => {
         this.getList();
@@ -1634,6 +1702,17 @@ export default {
       }).catch(() => {
       });
     },
+    /** 删除按钮操作 */
+    handleSopLogsDelete() {
+      this.$confirm('是否确认删除企微sop编号为"' + this.ids + '"的所有发送任务(执行记录)数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => delSopLogs(this.ids)).then(() => {
+        this.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
     /**
      * 批量执行SOP任务
      */
@@ -1706,32 +1785,32 @@ export default {
     /**
      * 一键群发
      */
-    handleSendMsg(row) {
+    handleSendMsg(row){
       this.sendMsgOpen.open = true;
       this.sendMsgOpen.id = row.id;
       this.sendMsgOpen.row = row;
       this.msgForm.chatIds = row.chatId.split(",");
     },
-    submitMsgForm() {
+    submitMsgForm(){
       this.$refs["msgForm"].validate(valid => {
         if (valid) {
-          this.msgForm.setting = JSON.stringify(this.setting)
-          this.msgForm.sopId = this.sendMsgOpen.row.id;
-          this.msgForm.corpId = this.sendMsgOpen.row.corpId;
-          this.msgForm.filterMode = this.sendMsgOpen.row.filterMode;
+          this.msgForm.setting=JSON.stringify(this.setting)
+          this.msgForm.sopId=this.sendMsgOpen.row.id;
+          this.msgForm.corpId=this.sendMsgOpen.row.corpId;
+          this.msgForm.filterMode=this.sendMsgOpen.row.filterMode;
 
           if (this.setting.length <= 0) {
             return this.$message.error("请添加规则")
           }
-          if (this.msgForm.courseId === null || this.msgForm.courseId === '') {
+          if (this.msgForm.courseId===null || this.msgForm.courseId===''){
             return this.$message.error("课程不能为空")
           }
 
-          if (this.msgForm.videoId === null || this.msgForm.videoId === '') {
+          if (this.msgForm.videoId===null || this.msgForm.videoId===''){
             return this.$message.error("课节不能为空")
           }
 
-          if (this.msgForm.courseType === null || this.msgForm.courseType === '') {
+          if (this.msgForm.courseType===null || this.msgForm.courseType===''){
             return this.$message.error("消息类型不能为空")
           }
 
@@ -1805,6 +1884,9 @@ export default {
             this.$set(this.setting[i], 'linkTitle', selectedCourse.dictLabel);
             this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
           }
+          if (selectedCourse && this.setting[i].contentType == 4 && this.msgForm.courseId != null) {
+            this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
+          }
 
         }
 

+ 508 - 168
src/views/qw/sop/updateSop.vue

@@ -1,85 +1,151 @@
 <template>
   <div class="app-container">
     <div style="margin: 30px;" v-if="handleType==1"> 修改sop任务</div>
-    <div style="margin: 30px;" v-if="handleType==2"> 查看sop任务
-      <div style="float: right">
-<!--        <el-button-->
-<!--          type="primary"-->
-<!--          @click="handleUpdateTags()"-->
-<!--          v-hasPermi="['qw:sop:remove']"-->
-<!--        >修改标签</el-button>-->
-        <el-button
-          type="primary"
-          @click="handleUpdateQwUser()"
-          v-hasPermi="['qw:sop:updateSopQwUser']"
-        >修改员工</el-button>
-        <el-button
-          type="primary"
-          @click="handleUpdateSopTemp()"
-          v-hasPermi="['qw:sop:updateSopTemp']"
-        >修改模板</el-button>
-      </div>
-
-      <el-divider></el-divider>
-      <el-alert
-        title="注意事项"
-        type="warning"
-        description="【持续生成记录中的状态】 的SOP任务仅能查看,不能修改(ps:可以在外面修改【过期时间】和【新客户自动创建sop】)"
-        :closable="false"
-        show-icon>
-      </el-alert>
-    </div>
-
+    <div style="margin: 30px;" v-if="handleType==2"> 查看sop任务</div>
     <div style="margin-top: 10px;margin-left: 50px;margin-right: 100px;margin-bottom: 60px;">
 
-      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="140px">
         <el-form-item label="规则名称" prop="name">
-          <el-input v-model="form.name" placeholder="请输入规则名称" />
+          <el-input v-model="form.name" placeholder="请输入规则名称"/>
         </el-form-item>
-        <el-form-item label="状态" prop="status">
-            <dict-tag :options="statusOptions" :value="form.status"></dict-tag>
-        </el-form-item>
-<!--        <el-form-item label="状态">-->
-<!--          <el-radio-group v-model="form.status">-->
-<!--            <el-radio-->
-<!--              v-for="dict in statusOptions"-->
-<!--              :label="dict.dictValue"-->
-<!--            >{{dict.dictLabel}}</el-radio>-->
-<!--          </el-radio-group>-->
-<!--        </el-form-item>-->
         <el-form-item label="类别" prop="type">
-          <el-radio-group v-model="form.type">
+          <el-radio-group v-model="form.type" @change="clearUser">
+            <!--            <el-radio-->
+            <!--              :label="1"-->
+            <!--            >个微-->
+            <!--            </el-radio>-->
+
+            <el-radio
+              :label="2"
+            >企微
+            </el-radio>
+          </el-radio-group>
+          <Tip title="针对于企业微信平台" />
+        </el-form-item>
+
+
+        <el-form-item label="筛选方式" prop="filterMode">
+          <el-radio-group v-model="form.filterMode">
             <el-radio
               :label="1"
-            >个微</el-radio>
+            >标签
+            </el-radio>
             <el-radio
               :label="2"
-            >企微</el-radio>
+            >群聊
+            </el-radio>
           </el-radio-group>
-          <Tip title="针对于企业微信平台" />
+          <Tip :title="'标签:根据企微客户的标签筛选客户进入SOP'" />
         </el-form-item>
-        <el-form-item label="小转天数" prop="minConversionDay">
-          <el-input class="el-input" v-model="form.minConversionDay" placeholder="请输入" style="width: 300px">
-            <template slot="append">天</template>
-          </el-input>
+        <el-form-item label="小转天数" prop="minConversionDay" v-if="form.filterMode == 1">
+          <!--          <el-input class="el-input" type="" v-model="form.minConversionDay" placeholder="请输入" />-->
+          <el-input-number v-model="form.minConversionDay" :min="1" :max="100"></el-input-number>
           <Tip title="第一次提醒销售,去联系客户,在【催课看板】处显示,哪些需要联系的客户" />
         </el-form-item>
-        <el-form-item label="大转天数" prop="maxConversionDay">
-          <el-input class="el-input" v-model="form.maxConversionDay" placeholder="请输入" style="width: 300px">
-            <template slot="append">天</template>
-          </el-input>
+        <el-form-item label="大转天数" prop="maxConversionDay" v-if="form.filterMode == 1">
+          <!--          <el-input class="el-input" v-model="form.maxConversionDay" placeholder="请输入" />-->
+          <el-input-number v-model="form.maxConversionDay" :min="1" :max="100"></el-input-number>
           <Tip title="第二次提醒销售,去联系客户,在【催课看板】处显示,哪些需要联系的客户" />
         </el-form-item>
-
-        <div v-if="form.type==2">
-
+        <el-form-item label="选择员工" prop="qwUserIds" style="margin-top: 2%" v-if="form.filterMode == 2">
+          <div>
+            <el-button
+              size="medium"
+              icon="el-icon-circle-plus-outline"
+              plain
+              @click="handlelistUser(form.type,form.sendType, true)">请选择使用员工
+            </el-button>
+          </div>
+          <div>
+            <el-tag
+              style="margin-left: 5px"
+              size="medium"
+              :key="id"
+              v-for="id in userSelectList"
+              closable
+              :disable-transitions="false"
+              @close="handleClosegroupUser(id)">
+              <span v-for="list in companyQwUserList" :key="list.qwUserId"
+                    v-if="list.id==id">{{ list.qwUserName }}</span>
+            </el-tag>
+          </div>
+          <Tip title="企业微信员工账号" />
+        </el-form-item>
+        <el-form-item label="是否自动创建群" prop="autoGroup" v-if="form.filterMode == 2">
+          <el-radio-group v-model="form.autoGroup">
+            <el-radio
+              :label="0"
+            >否
+            </el-radio>
+            <el-radio
+              :label="1"
+            >是
+            </el-radio>
+          </el-radio-group>
+          <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="autoGroup" v-if="form.filterMode == 2 && form.autoGroup == 1">
+          <el-radio-group v-model="form.autoUserReg">
+            <el-radio
+              :label="0"
+            >否
+            </el-radio>
+            <el-radio
+              :label="1"
+            >是
+            </el-radio>
+          </el-radio-group>
+          <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="chatIds" v-if="form.filterMode == 2 && form.autoGroup == 1">
+          <el-select multiple filterable clearable v-model="form.autoGroupLevelArray">
+            <el-option v-for="item in levelList" :key="item.value" :label="item.label" :value="item.value"/>
+          </el-select>
+          <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="chatIds" v-if="form.filterMode == 2 && form.autoGroup == 1">
+          <el-input v-model="form.groupName" maxlength="10" placeholder="请输入群聊名称" />
+          <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="chatIds" v-if="form.filterMode == 2 && form.autoGroup == 0">
+          <el-select multiple filterable clearable v-model="form.chatIds">
+            <el-option v-for="item in qwGroupList" :key="item.chatId" :label="item.name" :value="item.chatId"/>
+          </el-select>
+          <Tip title="选择的企业微信员工下面的群聊" />
+        </el-form-item>
+        <el-form-item label="客户评级" prop="isRating" style="margin-top: 2%" v-if="form.filterMode == 1">
+          <el-switch
+            v-model="form.isRating"
+            active-color="#13ce66"
+            inactive-color="#ff4949"
+            :active-value="1"
+            :inactive-value="2">
+          </el-switch>
+          <span v-if="form.isRating == '1'" style="margin-left: 10px;color: #13ce66">已开启</span>
+          <span v-if="form.isRating == '2'" style="margin-left: 10px;color: #ff4949">已关闭</span>
+          <Tip title="根据客户的【看课记录】进行评级,新进客户前4天不评级,第5天开始 根据客户近7天的看课记录进行评级 ABCD级" />
+        </el-form-item>
+        <div v-if="form.type==2 && form.filterMode == 1">
           <el-form-item label="推送方式 ">
             <el-radio-group v-model="form.sendType" @input="handleSendTypeChange">
               <el-radio
                 v-for="dict in sysQwSopType"
                 :key="dict.dictValue"
                 :label="parseInt(dict.dictValue)"
-              >{{dict.dictLabel}}</el-radio>
+              >{{ dict.dictLabel }}
+              </el-radio>
             </el-radio-group>
             <Tip title="选择模板类型" />
           </el-form-item>
@@ -89,7 +155,8 @@
                 size="medium"
                 icon="el-icon-circle-plus-outline"
                 plain
-                @click="handlelistUser(form.type,form.sendType)">请选择使用员工</el-button>
+                @click="handlelistUser(form.type,form.sendType, false)">请选择使用员工
+              </el-button>
             </div>
             <div>
               <el-tag
@@ -97,69 +164,127 @@
                 size="medium"
                 :key="id"
                 v-for="id in userSelectList"
+                closable
                 :disable-transitions="false"
                 @close="handleClosegroupUser(id)">
-                <span v-for="list in companyUserList" :key="list.qwUserId" v-if="list.id==id">{{list.qwUserName}}</span>
+                <span v-for="list in companyQwUserList" :key="list.qwUserId"
+                      v-if="list.id==id">{{ list.qwUserName }}</span>
               </el-tag>
             </div>
+            <Tip title="选择的企业微信员工下面的群聊" />
           </el-form-item>
           <el-form-item label="标签规则" prop="filterType">
             <el-radio-group v-model="form.filterType">
               <el-radio
                 :label="1"
-              >含全部标签</el-radio>
+              >含全部标签
+              </el-radio>
               <el-radio
                 :label="2"
-              >含任意标签</el-radio>
+              >含任意标签
+              </el-radio>
             </el-radio-group>
+            <Tip :title="'含全部标签:客户要完全一对一匹配上选择标签,ps:多一个少一个都不行 \r\n含任意标签:客户只要有一个标签匹配上即可'" />
           </el-form-item>
           <el-form-item label="选择的标签" prop="tags">
-            <el-select v-model="tags" remote multiple placeholder="请选择" filterable  style="width: 100%;">
-              <el-option
-                v-for="dict in tagList"
-                :label="dict.name"
-                :value="dict.tagId">
-              </el-option>
-            </el-select>
-
+            <!--            <el-select v-model="tags" remote multiple placeholder="请选择" filterable  style="width: 100%;">-->
+            <!--              <el-option-->
+            <!--                v-for="dict in tagList"-->
+            <!--                :label="dict.name"-->
+            <!--                :value="dict.tagId">-->
+            <!--              </el-option>-->
+            <!--            </el-select>-->
+            <div @click="hangleChangeTags()"
+                 style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;width: 390px">
+              <div style="min-height: 35px; max-height: 200px; overflow-y: auto;">
+                <el-tag type="success"
+                        closable
+                        :disable-transitions="false"
+                        v-for="list in this.tagsIdsChangeSelectList"
+                        :key="list.tagId"
+                        @close="handleCloseTags(list)"
+                        style="margin: 3px;"
+                >{{ list.name }}
+                </el-tag>
+              </div>
+            </div>
+            <Tip title="选择进入SOP任务的标签" />
           </el-form-item>
           <el-form-item label="排除的标签" prop="excludeTags">
-            <el-select v-model="excludeTags" remote multiple placeholder="请选择" filterable  style="width: 100%;">
-              <el-option
-                v-for="dict in tagList"
-                :label="dict.name"
-                :value="dict.tagId">
-              </el-option>
-            </el-select>
+            <!--            <el-select v-model="excludeTags" remote multiple placeholder="请选择" filterable  style="width: 100%;">-->
+            <!--              <el-option-->
+            <!--                v-for="dict in tagList"-->
+            <!--                :label="dict.name"-->
+            <!--                :value="dict.tagId">-->
+            <!--              </el-option>-->
+            <!--            </el-select>-->
+            <div @click="hangleChangeOutTags()"
+                 style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;width: 390px">
+              <div style="min-height: 35px; max-height: 200px; overflow-y: auto;">
+                <el-tag type="success"
+                        closable
+                        :disable-transitions="false"
+                        v-for="list in this.outTagsIdsChangeSelectList"
+                        :key="list.tagId"
+                        @close="handleCloseOutTags(list)"
+                        style="margin: 3px;"
+                >{{ list.name }}
+                </el-tag>
+              </div>
+            </div><Tip title="选择不想进入SOP的标签" />
           </el-form-item>
         </div>
         <div v-if="form.type==1">
           <el-form-item label="推送方式 ">
             <el-tag type="success" v-model="form.sendType=2">AI插件</el-tag>
           </el-form-item>
+          <el-form-item label="选择员工" prop="qwUserIds" style="margin-top: 2%">
+            <div>
+              <el-button
+                size="medium"
+                icon="el-icon-circle-plus-outline"
+                plain
+                @click="handleCompanyUser(form.type,form.sendType)">请选择使用员工
+              </el-button>
+            </div>
+            <div>
+              <el-tag
+                style="margin-left: 5px"
+                size="medium"
+                :key="userId"
+                v-for="userId in userSelectList"
+                closable
+                :disable-transitions="false"
+                @close="handleClosegroupUser(userId)">
+                <span v-for="list in companyUserLists " :key="list.userId"
+                      v-if="list.userId==userId">{{ list.nickName }}</span>
+              </el-tag>
+            </div>
+          </el-form-item>
           <el-form-item label="标签规则" prop="filterType">
             <el-radio-group v-model="form.filterType">
               <el-radio
                 :label="1"
-              >含全部分组</el-radio>
+              >含全部分组
+              </el-radio>
               <el-radio
                 :label="2"
-              >含任意分组</el-radio>
+              >含任意分组
+              </el-radio>
             </el-radio-group>
           </el-form-item>
           <el-form-item label="选择的分组" prop="tags">
-            <el-select v-model="tags" remote multiple placeholder="请选择" filterable  style="width: 100%;">
+            <el-select v-model="tags" remote multiple placeholder="请选择" filterable style="width: 100%;">
               <el-option
                 v-for="dict in wxUserGroupList"
                 :label="dict.groupName"
-                :value="dict.groupId.toString()">
+                :value="dict.groupId">
               </el-option>
             </el-select>
 
           </el-form-item>
         </div>
-
-        <el-form-item label="是否固定营期" prop="isFixed" v-if="form.type != 3">
+        <el-form-item label="是否固定营期" prop="isFixed" v-if="form.type != 3 && form.filterMode == 1">
           <el-radio-group v-model="form.isFixed">
             <el-radio
               :label="1"
@@ -180,35 +305,31 @@
                           value-format="yyyy-MM-dd"
                           placeholder="选择开始时间">
           </el-date-picker>
+          <Tip title="SOP开始发送时间" />
         </el-form-item>
-
-        <el-form-item label="是否只发送注册用户" prop="isRegister" v-if="form.type != 3">
-          <el-radio-group v-model="form.isRegister">
-            <el-radio
-              :label="1"
-            >是
-            </el-radio>
-            <el-radio
-              :label="0"
-            >否
-            </el-radio>
-          </el-radio-group>
-          <Tip title="是否只发送在平台注册了会员的客户" />
+        <el-form-item label="任务过期时间" prop="expiryTime">
+          <el-row>
+            <el-input-number v-model="form.expiryTime" :min="1" :max="100"></el-input-number>
+            (小时)
+          </el-row>
+          <Tip title="任务生成的代发送消息,如果超过此设置的时间还未发送,自动作废" />
         </el-form-item>
-
-        <el-form-item v-if="form.sendType==2 || form.sendType==4" label="自动添加SOP" prop="autoSopTime" >
+        <el-form-item v-if="(form.sendType==2 || form.sendType==4 || form.sendType==11) && form.type != 3 && form.isFixed == 0 && form.filterMode == 1" label="自动添加SOP"
+                      prop="autoSopTime.autoSopType">
           <el-radio-group v-model="form.autoSopTime.autoSopType">
             <el-radio
               :label="1"
-            >当天开始</el-radio>
+            >当天开始
+            </el-radio>
             <el-radio
               :label="2"
-            >次日开始</el-radio>
+            >次日开始
+            </el-radio>
           </el-radio-group>
           <Tip :title="'这个选项仅作用于【新客户】进线时或【给客户打标签时】,是进入当日的营期 还是 次日的营期'" />
         </el-form-item>
         <div style="display: flex; align-items: center; flex-wrap: nowrap;">
-          <div v-if="form.autoSopTime.autoSopType==1" style="display: flex; align-items: center">
+          <div v-if="form.autoSopTime.autoSopType==1 && form.isFixed == 0" style="display: flex; align-items: center">
             <el-form-item
               label="起始时间"
               prop="autoStartTime"
@@ -242,40 +363,47 @@
                 }">
               </el-time-select>
             </el-form-item>
-            <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
-              <i class="el-icon-info"></i>
-              起始时间-结束时间之内的进线客户,进入【当日营期】,时间之外的,进入【次日营期】
-            </div>
+            <Tip :title="'起始时间-结束时间之内的进线客户,进入【当日营期】,时间之外的,进入【次日营期】'" />
           </div>
         </div>
-        <el-form-item label="任务过期时间" prop="expiryTime">
-          <el-row>
-            <el-input-number  v-model="form.expiryTime"  :min="1" :max="100" ></el-input-number>
-            (小时)
-          </el-row>
-          <Tip title="发送sop任务消息的过期时间,超过这个时间,消息将不再发送(作废),比如:9点的消息,设置3个小时过期,12点之后还未发送 则这条消息将过期且不再发送" />
+        <!--        <el-form-item v-if="form.autoSopTime.autoSopType==1" label="过期消息是否发送" prop="autoSopSend"-->
+        <!--                      label-width="130px">-->
+        <!--          <el-radio-group v-model="form.autoSopTime.autoSopSend">-->
+        <!--            <el-radio-->
+        <!--              :label="1"-->
+        <!--            >是-->
+        <!--            </el-radio>-->
+        <!--            <el-radio-->
+        <!--              :label="2"-->
+        <!--            >否-->
+        <!--            </el-radio>-->
+        <!--          </el-radio-group>-->
+        <!--        </el-form-item>-->
+
+
+        <el-form-item label="是否只发送注册用户" prop="isRegister" v-if="form.type != 3 && form.filterMode == 1">
+          <el-radio-group v-model="form.isRegister">
+            <el-radio
+              :label="1"
+            >是
+            </el-radio>
+            <el-radio
+              :label="0"
+            >否
+            </el-radio>
+          </el-radio-group>
+          <Tip title="是否只发送在平台注册了会员的客户" />
         </el-form-item>
+
         <el-form-item label="模板" prop="tempId">
-          <div @click="selectListSopTemp(form.sendType,0)" style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;">
-            <el-tag type="success" style="margin: 3px;"
-                    :disable-transitions="false"
-                    v-for="list in tempList"
-                    :key="list.id"
-                    v-if="list.id === form.tempId">
-              {{ form.tempName || list.name }}
+          <div @click="selectListSopTemp(form.sendType)"
+               style="cursor: pointer; border: 1px solid #e6e6e6; background-color: white; overflow: hidden; flex-grow: 1;">
+            <el-tag v-if="form.tempId" type="success" style="margin: 3px;">
+              {{ form.tempName }}
             </el-tag>
-
-            <!-- 如果 form.tempId 没有值,显示 '请选择模板' -->
-            <span v-if="!form.tempId" style="margin: 3px; color: #999;">请选择模板</span>
+            <span v-else style="margin: 3px; color: #999;">请点我选择模板</span>
           </div>
-<!--          <el-select v-model="form.tempId"  @focus="selectListSopTemp(form.sendType)" placeholder="请选择模板" v-loading="tempListLoading"   >-->
-<!--            <el-option-->
-<!--              v-for="dict in tempList"-->
-<!--              :label="dict.name"-->
-<!--              :value="dict.id">-->
-<!--            </el-option>-->
-<!--            <div v-if="tempListLoading" slot="prefix" class="select-prefix">正在查询相应模板...</div>-->
-<!--          </el-select>-->
+          <Tip title="选择想要发送的模板规则" />
         </el-form-item>
 
         <el-form-item label="开启评论/弹幕" prop="openCommentStatus">
@@ -286,50 +414,73 @@
           </el-radio-group>
         </el-form-item>
       </el-form>
-      <div slot="footer" class="dialog-footer" style="float: right;" >
-        <el-button v-if="handleType==1" type="primary" @click="submitForm">确 定</el-button>
-        <el-button v-if="handleType==1" @click="cancel">取 消</el-button>
-
+      <div slot="footer" class="dialog-footer" style="display: flex;justify-content: flex-end;">
+        <el-button v-if="false" type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
       </div>
-      <el-dialog :custom-class="'fixed-dialog'" :title="listUser.title" :visible.sync="listUser.open" width="700px" append-to-body>
+      <el-dialog :title="listUser.title" :visible.sync="listUser.open" width="700px" append-to-body>
         <qwUserList ref="QwUserList" @selectUserList="selectUserList"></qwUserList>
       </el-dialog>
-      <el-dialog title="选择模板"  :visible.sync="tempOpen" append-to-body  >
-        <sop-temp ref="SopTempComments" @sopTemp="sopTemp" @submitUpdateTemp="submitUpdateTemp"></sop-temp>
+
+      <el-dialog :title="companyUser.title" :visible.sync="companyUser.open" width="700px" append-to-body>
+        <company-user-list ref="companyUserList" @selectCompanyUserList="selectCompanyUserList"></company-user-list>
       </el-dialog>
-      <!--  修改模板  -->
-      <el-dialog :title="updateQwUserDialog.title" :visible.sync="updateQwUserDialog.open" width="500px" append-to-body>
-        <el-form ref="form" :model="form" label-width="100px">
-          <el-form-item label="选择员工" prop="qwUserIds" style="margin-top: 2%">
-            <div>
-              <el-button
-                size="medium"
-                icon="el-icon-circle-plus-outline"
-                plain
-                @click="handlelistUser(form.type,form.sendType)">请选择使用员工</el-button>
-            </div>
-            <div>
-              <el-tag
-                style="margin-left: 5px"
-                size="medium"
-                :key="id"
-                v-for="id in userSelectList"
-                closable
-                :disable-transitions="false"
-                @close="handleClosegroupUser(id)">
-                <span v-for="list in companyUserList" :key="list.qwUserId" v-if="list.id==id">{{list.qwUserName}}</span>
-              </el-tag>
+
+      <el-dialog title="选择模板" :visible.sync="tempOpen" append-to-body>
+        <sop-temp ref="SopTempComments" @sopTemp="sopTemp"></sop-temp>
+      </el-dialog>
+
+      <!--  选择/排除标签   -->
+      <el-dialog :title="changeTagDialog.title" :visible.sync="changeTagDialog.open" 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="handleSearchTags">搜索</el-button>
+          <el-button type="primary" icon="el-icon-plus" size="mini" @click="cancelSearchTags">重置</el-button>
+        </div>
+        <div v-for="item in tagGroupList" :key="item.id">
+          <div style="font-size: 20px;margin-top: 20px;margin-bottom: 20px;">
+            <span class="name-background">{{ item.name }}</span>
+          </div>
+          <!-- 添加外层滚动容器 -->
+          <div class="scroll-wrapper">
+            <div class="tag-container">
+              <a
+                v-for="tagItem in item.tag"
+                class="tag-box"
+                @click="tagSelection(tagItem)"
+                :class="{ 'tag-selected': tagItem.isSelected }"
+              >
+                {{ tagItem.name }}
+              </a>
             </div>
-          </el-form-item>
-        </el-form>
-        <div slot="footer" class="dialog-footer" >
-          <el-button  type="primary" @click="submitUpdateQwUser">确 定</el-button>
-          <el-button  @click="cancel">取 消</el-button>
+          </div>
+          <!--          <div class="tag-container">-->
+          <!--            <a-->
+          <!--              v-for="tagItem in item.tag"-->
+          <!--              class="tag-box"-->
+          <!--              @click="tagSelection(tagItem)"-->
+          <!--              :class="{ 'tag-selected': tagItem.isSelected }"-->
+          <!--            >-->
+          <!--              {{ tagItem.name }}-->
+          <!--            </a>-->
+          <!--          </div>-->
         </div>
-      </el-dialog>
 
+        <pagination
+          v-show="total>0"
+          :total="total"
+          :page.sync="queryTagParams.pageNum"
+          :limit.sync="queryTagParams.pageSize"
+          @pagination="cancelSearchTags"
+        />
+        <div slot="footer" class="dialog-footer">
+          <el-button v-if="false" type="primary" @click="tagSubmitForm(changeTagDialog.type)">确 定</el-button>
+          <el-button @click="tagCancel(changeTagDialog.type)">取消</el-button>
+        </div>
+      </el-dialog>
     </div>
-
   </div>
 </template>
 
@@ -341,18 +492,28 @@ import qwUserList from '@/views/qw/user/qwUserList.vue'
 import ImageUpload from "@/views/qw/sop/ImageUpload";
 import CustomerGroupDetails from '@/views/qw/groupMsg/customerGroupDetails.vue'
 import sopLogsDetails from '@/views/qw/sopLogs/sopLogsList.vue'
-import { listTag, getTag, } from "@/api/qw/tag";
-import { getMyQwUserList,getMyQwCompanyList } from "@/api/qw/user";
+import {listTag, getTag, searchTags,} from "@/api/qw/tag";
+import { getMyQwUserList,getMyQwCompanyList,getQwUserByIds } from "@/api/qw/user";
 import {sopListWxUserGroup} from "@/api/wxUser/wxUserGroup";
 import source from "echarts/src/data/Source";
 import SopTemp from "@/views/qw/sopTemp/sopTemp.vue";
 import Tip from "../../../components/Tip/index.vue";
+import companyUserList from "@/views/company/companyUser/companyUserList.vue";
+import {allListTagGroup} from "@/api/qw/tagGroup";
 // import { ElMessageBox } from 'element-plus';
 export default {
   name: "updateSop",
-  components: {Tip, SopTemp, CustomerGroupDetails, qwUserList,ImageUpload,sopLogsDetails},
+  components: {companyUserList, Tip, SopTemp, CustomerGroupDetails, qwUserList,ImageUpload,sopLogsDetails},
   data() {
     return {
+      levelList: [
+        {value: 1, label: "A"},
+        {value: 2, label: "B"},
+        {value: 3, label: "C"},
+        {value: 4, label: "D"},
+        {value: 5, label: "E"},
+        {value: -1, label: "未评级"},
+      ],
       updateQwUserDialog:{
         title:"修改成员",
         open:false
@@ -399,17 +560,43 @@ export default {
 
       //个微客户的分组
       wxUserGroupList:[],
+      tagsIdsChangeSelectList: null,
+      //排除的标签
+      outTagsIdsChangeSelectList: null,
+      //添加的标签
+      addTagsIdsChangeSelectList: null,
 
       sopLogsDialog:{
         title:'',
         open:false,
         sopLogsForm:[],
       },
+      queryTagParams: {
+        pageNum: 1,
+        pageSize: 5,
+        total: 0,
+        name: null,
+        corpId: null,
+      },
+      //标签组
+      tagGroupList: [],
+      //标签
+      changeTagDialog: {
+        title: "",
+        open: false,
+        type: null,
+      },
+      companyUser: {
+        title: "",
+        open: false
+      },
+      companyQwUserList: [],
       // 表单参数
       form: {
         status: 1,
         sendType:2,
         type: 2,
+        autoGroupLevelArray:[],
         filterType:2,
         autoSopTime:{},
       },
@@ -462,6 +649,146 @@ export default {
     }
   },
   methods: {
+    handleSearchTags() {
+
+      if (!this.queryTagParams.name){
+        return this.$message.error("请输入要搜索的标签")
+      }
+      searchTags(this.queryTagParams).then(response => {
+        this.tagGroupList = response.rows;
+        this.total = response.total;
+      });
+
+    },
+    cancelSearchTags() {
+      allListTagGroup(this.queryTagParams).then(response => {
+        this.tagGroupList = response.rows;
+        this.total = response.total;
+      });
+
+      listTag(this.queryTagParams).then(response => {
+        this.tagList = response.rows;
+      });
+    },
+    //标签的选择
+    tagSelection(row) {
+      row.isSelected = !row.isSelected;
+      this.$forceUpdate();
+    },
+    //确定选择标签
+    tagSubmitForm(type) {
+
+      if (type == 1) {
+        for (let i = 0; i < this.tagGroupList.length; i++) {
+          for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
+            if (this.tagGroupList[i].tag[x].isSelected === true) {
+
+              if (!this.tagsIdsChangeSelectList) {
+                this.tagsIdsChangeSelectList = [];
+              }
+
+              // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
+              let tagExists = this.tagsIdsChangeSelectList.some(
+                tag => tag.id === this.tagGroupList[i].tag[x].id
+              );
+
+              // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
+              if (!tagExists) {
+                this.tagsIdsChangeSelectList.push(this.tagGroupList[i].tag[x]);
+              }
+            }
+          }
+        }
+        if (!this.tagsIdsChangeSelectList || this.tagsIdsChangeSelectList.length === 0) {
+          return this.$message('请选择标签');
+        }
+
+      } else if (type == 2) {
+
+        for (let i = 0; i < this.tagGroupList.length; i++) {
+          for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
+            if (this.tagGroupList[i].tag[x].isSelected === true) {
+
+              if (!this.outTagsIdsChangeSelectList) {
+                this.outTagsIdsChangeSelectList = [];
+              }
+
+              // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
+              let tagExists = this.outTagsIdsChangeSelectList.some(
+                tag => tag.id === this.tagGroupList[i].tag[x].id
+              );
+
+              // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
+              if (!tagExists) {
+                this.outTagsIdsChangeSelectList.push(this.tagGroupList[i].tag[x]);
+              }
+            }
+          }
+        }
+        if (!this.outTagsIdsChangeSelectList || this.outTagsIdsChangeSelectList.length === 0) {
+          return this.$message('请选择标签');
+        }
+
+      }
+      this.changeTagDialog.open = false;
+    },
+
+    //取消选择标签
+    tagCancel() {
+      this.changeTagDialog.open = false;
+    },
+
+    //选择标签
+    hangleChangeTags() {
+
+      this.changeTagDialog.title = "选择标签"
+      this.changeTagDialog.open = true;
+      this.changeTagDialog.type = 1;
+
+      // 获取 tagListFormIndex 中的所有 tagId,用于快速查找
+      const selectedTagIds = new Set(
+        (this.tagsIdsChangeSelectList || []).map(tagItem => tagItem?.tagId)
+      );
+      for (let i = 0; i < this.tagGroupList.length; i++) {
+        for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
+          this.tagGroupList[i].tag[x].isSelected = selectedTagIds.has(this.tagGroupList[i].tag[x].tagId);
+        }
+      }
+
+    },
+    //选择排除标签
+    hangleChangeOutTags() {
+      this.changeTagDialog.title = "选择排除的标签"
+      this.changeTagDialog.open = true;
+      this.changeTagDialog.type = 2;
+
+      // 获取 tagListFormIndex 中的所有 tagId,用于快速查找
+      const selectedTagIds = new Set(
+        (this.outTagsIdsChangeSelectList || []).map(tagItem => tagItem?.tagId)
+      );
+      for (let i = 0; i < this.tagGroupList.length; i++) {
+        for (let x = 0; x < this.tagGroupList[i].tag.length; x++) {
+          this.tagGroupList[i].tag[x].isSelected = selectedTagIds.has(this.tagGroupList[i].tag[x].tagId);
+        }
+      }
+    },
+    //销售员工
+    selectCompanyUserList(list) {
+
+      this.companyUser.open = false;
+      list.forEach(obj => {
+        if (!this.userSelectList.some(item => item == obj.userId)) {
+          this.userSelectList.push(obj.userId);
+        }
+      });
+    },
+    //选择销售员工时
+    handleCompanyUser(type, sendType) {
+
+      this.companyUser.title = "选择销售"
+      this.companyUser.open = true;
+
+    },
     submitUpdateQwUser(){
       this.form.qwUserIds = this.userSelectList.join(",");
       const data ={
@@ -644,6 +971,14 @@ export default {
         if (this.form.setting!=null){
           this.setting=JSON.parse(this.form.setting);
         }
+        if(this.form.autoGroupLevel != null){
+          this.form.autoGroupLevelArray = this.form.autoGroupLevel.split(",").map(Number);
+        }
+        if(this.form.qwUserIds != null){
+          getQwUserByIds(this.form.qwUserIds).then(res => {
+            this.companyQwUserList = res.data;
+          })
+        }
 
         listSopTemp({id:this.form.tempId}).then(response => {
           this.tempList = response.rows;
@@ -666,6 +1001,7 @@ export default {
         type: 2,
         filterType:2,
         qwUserIds: null,
+        autoGroupLevelArray:[],
         corpId: null,
         setting: null,
         createBy: null,
@@ -681,6 +1017,10 @@ export default {
       this.resetForm("queryForm");
       this.handleQuery();
     },
+    clearUser() {
+      this.userSelectList = [];
+      this.tags = null;
+    },
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)

+ 120 - 53
src/views/qw/sopTemp/updateSopTemp.vue

@@ -663,7 +663,7 @@
   cursor: pointer;
 }
 
-/deep/ .el-badge__content.is-fixed {
+.custom-input /deep/ .el-badge__content.is-fixed {
   top: 10px !important;
   right: 0 !important;
   width: 8px;
@@ -708,6 +708,9 @@ export default {
   components: {ImageUpload, userVideo, draggable},
   data() {
     return {
+      tabDataCache: {}, // tab数据缓存
+      tabLoadingStates: {}, // tab加载状态跟踪
+      projectFrom:process.env.VUE_APP_PROJECT_FROM,
       addTag: [{
         addTag: [],
         inputVisible: false,
@@ -977,46 +980,95 @@ export default {
     leave(index, oldIndex) {
       const newData = this.setting[index]
       if (newData.dayNum && newData.id) {
+        // 检查是否有缓存数据
+        if (this.tabDataCache[newData.id]) {
+          // 使用缓存数据
+          this.applyCachedData(index, newData, this.tabDataCache[newData.id]);
+          // 预加载下一个tab数据
+          this.preloadNextTab(index);
+          return true;
+        }
+
+        // 防止重复请求同一tab数据
+        if (this.tabLoadingStates[newData.id]) {
+          return false;
+        }
+
+        this.tabLoadingStates[newData.id] = true;
         this.loading = true;
+
         selectRulesInfo(newData.id).then(res => {
-          this.$nextTick(() => {
-            this.loading = false;
-            this.videoList = [];
-            this.addTag = [];
-            this.$set(this.setting, index, {
-              ...newData,
-              voice: res.data.voice,
-              content: res.data.list || [{type: this.defaultContentType, contentType: '1', setting: [{contentType: '1', value: ""}]}]
-            });
+          // 缓存当前tab数据
+          this.tabDataCache[newData.id] = res.data;
+          this.applyCachedData(index, newData, res.data);
+          this.loading = false;
+          this.tabLoadingStates[newData.id] = false;
+
+          // 预加载下一个tab数据
+          this.preloadNextTab(index);
+        }).catch(() => {
+          this.loading = false;
+          this.tabLoadingStates[newData.id] = false;
+        });
+      }
+      return false;
+    },
 
-            for (let j = 0; j < this.setting[index].content.length; j++) {
+    // 应用缓存数据到tab
+    applyCachedData(index, newData, cachedData) {
+      this.$nextTick(() => {
+        this.videoList = [];
+        this.addTag = [];
+        this.$set(this.setting, index, {
+          ...newData,
+          voice: cachedData.voice,
+          content: cachedData.list || [{type: this.defaultContentType, contentType: '1', setting: [{contentType: '1', value: ""}]}]
+        });
 
-              if (this.setting[index].content[j].addTag != null) {
-                this.setting[index].content[j].addTag = JSON.parse(this.setting[index].content[j].addTag)
-              }
-              if (this.setting[index].content[j].delTag != null) {
-                this.setting[index].content[j].delTag = JSON.parse(this.setting[index].content[j].delTag)
-              }
-              this.videoList.push([])
-              this.addTag.push({
-                addTag: [],
-                inputVisible: false,
-                inputValue: '',
-                delTag: [],
-                delTagVisible: false,
-                delTagValue: ''
-              })
-              if (this.setting[index].content[j].type == 2) {
-                if (this.setting[index].content[j].hasOwnProperty('courseId')) {
-                  this.courseChange(this.setting[index].content[j], index, j);
-                }
-              }
-            }
+        for (let j = 0; j < this.setting[index].content.length; j++) {
+          if (this.setting[index].content[j].addTag != null) {
+            this.setting[index].content[j].addTag = JSON.parse(this.setting[index].content[j].addTag)
+          }
+          if (this.setting[index].content[j].delTag != null) {
+            this.setting[index].content[j].delTag = JSON.parse(this.setting[index].content[j].delTag)
+          }
+          this.videoList.push([])
+          this.addTag.push({
+            addTag: [],
+            inputVisible: false,
+            inputValue: '',
+            delTag: [],
+            delTagVisible: false,
+            delTagValue: ''
           })
-        });
-      }
+          if (this.setting[index].content[j].type == 2) {
+            if (this.setting[index].content[j].hasOwnProperty('courseId')) {
+              this.courseChange(this.setting[index].content[j], index, j);
+            }
+          }
+        }
+      })
+    },
 
+    // 预加载下一个tab数据
+    preloadNextTab(currentIndex) {
+      const nextIndex = (parseInt(currentIndex) + 1) % this.setting.length;
+      if (nextIndex !== parseInt(currentIndex) && this.setting[nextIndex] && this.setting[nextIndex].id) {
+        const nextTabId = this.setting[nextIndex].id;
+
+        // 如果下一个tab数据还没有缓存且未在加载中,则预加载
+        if (!this.tabDataCache[nextTabId] && !this.tabLoadingStates[nextTabId]) {
+          this.tabLoadingStates[nextTabId] = true;
+          selectRulesInfo(nextTabId).then(res => {
+            this.tabDataCache[nextTabId] = res.data;
+            this.tabLoadingStates[nextTabId] = false;
+          }).catch(() => {
+            this.tabLoadingStates[nextTabId] = false;
+          });
+        }
+      }
     },
+
     save() {
       let data = this.setting[this.tabIndex];
       let check = this.checkData(data);
@@ -1082,6 +1134,7 @@ export default {
         this.loading = false;
       });
     },
+
     checkData(data) {
       if (this.form.sendType != 4) {
 
@@ -1286,12 +1339,10 @@ export default {
           content[contentIndex].setting.push(newSetting);
         }
       }
-
-
     },
+
     delSetList(index, contentIndex, setIndex) {
       this.setting[index].content[contentIndex].setting.splice(setIndex, 1)
-
     },
 
     addContent(index) {
@@ -1340,7 +1391,6 @@ export default {
         dayNum: (this.form.gap * this.setting.length) + 1,
         content
       })
-
     },
     delSetting(index) {
       const newData = this.setting[index]
@@ -1357,7 +1407,6 @@ export default {
       } else {
         this.del(index);
       }
-
     },
     del(index) {
       if (index == 0) {
@@ -1410,18 +1459,13 @@ export default {
 
     //修改
     courseChangeUpdate(content, index, countIndex) {
-
       this.$set(content, 'videoId', null);
       // 查找选中的课程对应的 label
       const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === content.courseId);
       for (let i = 0; i < content.setting.length; i++) {
-
-
         this.$set(content.setting[i], 'linkTitle', null);
         this.$set(content.setting[i], 'linkDescribe', null);
         this.$set(content.setting[i], 'linkImageUrl', null);
-
-
         //如果是链接的才上
         if (selectedCourse && content.type == 2 && content.courseId != null) {
           //响应式直接给链接的标题/封面上值
@@ -1433,31 +1477,22 @@ export default {
           if (content.setting[i].contentType == 4 || content.setting[i].contentType == 10) {
             this.$set(content.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
           }
-
-
         }
       }
-
-
       this.courseUpdate(content, index, countIndex);
     },
     handleInputVideoText(value, content) {
       // 允许的字符:中文、英文(大小写)、数字和指定标点符号(,。!?)
       const regex = /^[\u4e00-\u9fa5,。!?,!?]+$/;
-
       // 删除不符合条件的字符
       const filteredValue = value.split('').filter(char => regex.test(char)).join('');
-
       this.$set(content, 'value', filteredValue);
-
     },
     courseUpdate(content, index, countIndex) {
       videoList(content.courseId).then(response => {
         // this.$set(this.videoList, countIndex, response.list); // 响应式设置videoList
         this.videoList.splice(countIndex, 1, response.list);
-
       });
-
     },
     toggleSalesCall(itemIndex, contentIndex, setIndex) {
       // 获取目标对象
@@ -1567,6 +1602,7 @@ export default {
       //如果是链接的才上
       if (content.courseId != null && content.type == 2) {
         const selectedCourse = this.courseList.find(course => parseInt(course.dictValue) === content.courseId);
+
         for (let i = 0; i < content.setting.length; i++) {
           //响应式直接给链接的标题/封面上值
           if (selectedCourse && content.type == 2 && content.courseId != null) {
@@ -1593,9 +1629,19 @@ export default {
 
             if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9) {
               this.$set(content.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+
+              if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+                this.$set(content.setting[i], 'linkImageUrl', selectedVideo.dictImgUrl);
+              }
+
             }
             if (content.setting[i].contentType == 4 || content.setting[i].contentType == 10 ) {
               this.$set(content.setting[i], 'miniprogramTitle', this.truncateTextByByteLength(selectedVideo.dictLabel, 60));
+
+              if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+                this.$set(content.setting[i], 'miniprogramPicUrl', selectedVideo.dictImgUrl);
+              }
+
             }
           }
         }
@@ -1627,9 +1673,20 @@ export default {
 
           if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9) {
             this.$set(content.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+
+            if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+              this.$set(content.setting[i], 'linkImageUrl', selectedVideo.dictImgUrl);
+            }
+
           }
+
           if (content.setting[i].contentType == 4 || content.setting[i].contentType == 10) {
             this.$set(content.setting[i], 'miniprogramTitle', this.truncateTextByByteLength(selectedVideo.dictLabel, 60));
+
+            if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+              this.$set(content.setting[i], 'miniprogramPicUrl', selectedVideo.dictImgUrl);
+            }
+
           }
 
 
@@ -1783,6 +1840,9 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(id) {
       getSopTemp(id).then(response => {
+        this.tabDataCache = {}; // 清空缓存
+        this.tabLoadingStates = {}; // 清空加载状态
+
         this.videoList = []
         this.form = response.data;
         this.setting = this.form.list || [];
@@ -1823,6 +1883,13 @@ export default {
             });
           }
         });
+        // 默认加载第一个 tab 的数据
+        if (this.setting && this.setting.length > 0) {
+          this.tabIndex = "0";
+          this.$nextTick(() => {
+            this.leave(0);
+          });
+        }
         // this.addTag.push({
         //   addTag: [],
         //   inputVisible: false,

+ 12 - 0
src/views/qw/sopUserLogs/sopUserLogsSchedule.vue

@@ -84,6 +84,18 @@
         </el-tooltip>
       </el-col>
 
+      <el-col :span="1.5">
+        <el-tooltip class="item" effect="dark" content="修改选择的群聊营期时间" placement="top">
+          <el-button
+            type="danger"
+            icon="el-icon-edit"
+            size="medium"
+            :disabled="multiple"
+            @click="updateGroupTime"
+          >批量修改营期时间</el-button>
+        </el-tooltip>
+      </el-col>
+
       <el-col :span="1.5">
         <el-tooltip class="item" effect="dark" content="删除营期之后,将不会在给原营期的客户发送消息,ps:删除之后不可恢复" placement="top">
           <el-button

+ 21 - 0
src/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue

@@ -281,6 +281,7 @@ export default {
   components: {ImageUpload,userVideo},
   data() {
     return {
+      projectFrom:process.env.VUE_APP_PROJECT_FROM,
       videoNumOptions: {
         title: '选择视频号',
         open: false,
@@ -448,10 +449,21 @@ export default {
           if (selectedVideo && this.msgForm.videoId != null) {
             if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ){
               this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+
+              if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+                this.$set(this.setting[i], 'linkImageUrl', selectedVideo.dictImgUrl);
+              }
+
             }
 
             if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ){
               this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
+
+              if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+                this.$set(this.setting[i], 'miniprogramPicUrl', selectedVideo.dictImgUrl);
+
+              }
+
             }
 
 
@@ -691,9 +703,18 @@ export default {
 
             if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9){
               this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+
+              if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+                this.$set(this.setting[i], 'linkImageUrl', selectedVideo.dictImgUrl);
+              }
             }
             if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10){
               this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
+
+              if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+                this.$set(this.setting[i], 'miniprogramPicUrl', selectedVideo.dictImgUrl);
+              }
+
             }
 
           }

+ 23 - 0
src/views/qw/sopUserLogsInfo/sendMsgSopOpenTool.vue

@@ -281,6 +281,7 @@ export default {
   components: {ImageUpload,userVideo},
   data() {
     return {
+      projectFrom:process.env.VUE_APP_PROJECT_FROM,
       videoNumOptions: {
         title: '选择视频号',
         open: false,
@@ -449,13 +450,23 @@ export default {
           if (selectedVideo && this.msgForm.videoId != null) {
             if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ){
               this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+
+              if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+                this.$set(this.setting[i], 'linkImageUrl', selectedVideo.dictImgUrl);
+              }
             }
 
             if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ){
               this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
+
+              if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+                this.$set(this.setting[i], 'miniprogramPicUrl', selectedVideo.dictImgUrl);
+              }
+
             }
 
 
+
           }
         }
       }
@@ -671,9 +682,11 @@ export default {
             if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9){
               this.$set(this.setting[i], 'linkTitle', selectedCourse.dictLabel);
               this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
+
             }
             if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10){
               this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
+
             }
 
 
@@ -692,9 +705,19 @@ export default {
 
             if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9){
               this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+
+              if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+                this.$set(this.setting[i], 'linkImageUrl', selectedVideo.dictImgUrl);
+              }
+
             }
             if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10){
               this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
+
+              if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+                this.$set(this.setting[i], 'miniprogramPicUrl', selectedVideo.dictImgUrl);
+              }
+
             }
 
           }

+ 29 - 1
src/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue

@@ -559,6 +559,9 @@ export default {
   components: {PaginationMore, userVideo, ImageUpload},
   data() {
     return {
+
+      projectFrom:process.env.VUE_APP_PROJECT_FROM,
+
       statusOptions:[],
       //上传语音的遮罩层
       voiceLoading :false,
@@ -888,10 +891,19 @@ export default {
           if (selectedVideo && this.msgForm.videoId != null) {
             if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ){
               this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+
+              if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+                this.$set(this.setting[i], 'linkImageUrl', selectedVideo.dictImgUrl);
+              }
             }
 
             if (this.setting[i].contentType == 4){
               this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
+
+              if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+                this.$set(this.setting[i], 'miniprogramPicUrl', selectedVideo.dictImgUrl);
+
+              }
             }
 
 
@@ -1109,7 +1121,6 @@ export default {
               this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
             }
 
-
           }
 
         }
@@ -1125,9 +1136,26 @@ export default {
 
             if (this.setting[i].contentType == 3 || this.setting[i].contentType == 9){
               this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
+
+              if (this.msgForm.videoId != null) {
+                const  selectedVideo = this.videoList.find(course => parseInt(course.dictValue) === this.msgForm.videoId);
+
+                if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+                  this.$set(this.setting[i], 'linkImageUrl', selectedVideo.dictImgUrl);
+                }
+
+              }
             }
             if (this.setting[i].contentType == 4){
               this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
+              if (this.msgForm.videoId != null) {
+                const  selectedVideo = this.videoList.find(course => parseInt(course.dictValue) === this.msgForm.videoId);
+
+                if (this.projectFrom == 'sxjz' && selectedVideo.dictImgUrl) {
+                  this.$set(this.setting[i], 'miniprogramPicUrl', selectedVideo.dictImgUrl);
+                }
+
+              }
             }
 
           }

+ 42 - 18
src/views/qw/user/cuDeptIdIndex.vue

@@ -12,6 +12,9 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="企微部门">
+        <treeselect :clearable="false"  v-model="queryParams.deptId"  :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+      </el-form-item>
       <el-form-item label="企微账号" prop="qwUserId">
         <el-input
           v-model="queryParams.qwUserId"
@@ -77,6 +80,7 @@
       <el-table-column label="企微账号" align="center" prop="qwUserId" />
       <el-table-column label="企微昵称" align="center" prop="qwUserName" />
       <el-table-column label="员工称呼" align="center" prop="welcomeText" />
+      <el-table-column label="部门" align="center" prop="departmentName" />
       <el-table-column label="员工状态" align="center" prop="isDel">
         <template slot-scope="scope">
           <el-tag v-if="scope.row.isDel == 0" type="success">正常</el-tag>
@@ -105,28 +109,12 @@
       <el-table-column label="vid" align="center" prop="vid" />
       <el-table-column label="uid" align="center" prop="uid" />
       <el-table-column label="serverId" align="center" prop="serverId" />
-     <el-table-column label="ai状态" align="center" prop="loginStatus">
+     <el-table-column label="ipad状态" align="center" prop="loginStatus">
         <template slot-scope="scope">
           <el-tag v-if="scope.row.ipadStatus == 1" type="success">在线</el-tag>
           <el-tag v-else type="danger">离线</el-tag>
         </template>
       </el-table-column>
-<!--      <el-table-column label="插件状态" align="center" prop="toolStatus">-->
-<!--        <template slot-scope="scope">-->
-<!--          <el-tag v-if="scope.row.toolStatus == 1" type="success">在线</el-tag>-->
-<!--          <el-tag v-else type="danger">离线</el-tag>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-<!--      <el-table-column label="插件版本" align="center" prop="version"/>-->
-      <el-table-column label="服务器地址" align="center" prop="loginCodeUrl">
-        <template slot-scope="scope">
-          <el-tooltip class="item" effect="dark" :content="scope.row.loginCodeUrl" placement="top">
-            <div style="display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; text-overflow: ellipsis;">
-              <span>{{ scope.row.loginCodeUrl }}</span>
-            </div>
-          </el-tooltip>
-        </template>
-      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
         <template slot-scope="scope">
           <el-button
@@ -476,12 +464,16 @@ import {
   qwBindCloudHost, qwUnbindCloudHost, handleAuthAppKey, handleInputAuthAppKey, selectCloudAP, myDepartListUser
 } from '../../../api/qw/user'
 import fastGptRole from "@/views/fastGpt/fastGptRole/fastGptRole";
+import { treeselect } from "@/api/qw/qwDept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
 export default {
   name: "cuDeptIdIndex",
-  components: { fastGptRole},
+  components: { Treeselect, fastGptRole},
   data() {
     return {
+      deptOptions:[], // 企微部门
       updateIp:{
         open:false,
         title: "修改云主机IP"
@@ -583,6 +575,7 @@ export default {
         qwUserId: null,
         corpId: null,
         qwUserName: null,
+        deptId:null,
       },
 	  qwUserId:null,
       companyUserList:[],
@@ -611,6 +604,10 @@ export default {
       this.myQwCompanyList = response.data;
       if(this.myQwCompanyList!=null){
         this.queryParams.corpId=this.myQwCompanyList[0].dictValue;
+        // 查询部门下拉树结构
+        if(this.queryParams.corpId){
+          this.getTreeselect()
+        }
         this.getList();
       }
     });
@@ -628,6 +625,25 @@ export default {
     },
   },
   methods: {
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      var that=this;
+      let query = {
+        corpId: this.queryParams.corpId
+      }
+      // 企微主体不能为空
+      if(!query.corpId){
+        this.$message.error("请选择企微主体");
+        return;
+      }
+      treeselect(query).then((response) => {
+        this.deptOptions = response.data;
+        console.log(this.deptOptions)
+        if(response.data!=null&&response.data.length>0){
+          this.queryParams.deptId=response.data[0].id;
+        }
+      });
+    },
     getList() {
       this.loading = true;
       myDepartListUser(this.queryParams).then(response => {
@@ -1005,6 +1021,7 @@ export default {
         qwUserId: null,
         corpId: null,
         qwUserName: null,
+
       };
       this.resetForm("form");
 
@@ -1056,6 +1073,7 @@ export default {
     resetQuery() {
       this.resetForm("queryForm");
       this.queryParams.corpId=this.myQwCompanyList[0].dictValue;
+      this.queryParams.deptId = this.deptOptions[0] && this.deptOptions[0].id;
       this.handleQuery();
     },
     // 多选框选中数据
@@ -1136,4 +1154,10 @@ export default {
   width: 80%;
 }
 
+.vue-treeselect{
+  width: 217px;
+  height: 36px;
+}
+
+
 </style>

+ 55 - 14
src/views/qw/user/index.vue

@@ -12,6 +12,9 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="企微部门">
+        <treeselect :clearable="false"  v-model="queryParams.deptId"  :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
+      </el-form-item>
       <el-form-item label="企微账号" prop="qwUserId">
         <el-input
           v-model="queryParams.qwUserId"
@@ -89,6 +92,8 @@
       <el-table-column label="企微账号" align="center" prop="qwUserId" />
       <el-table-column label="企微昵称" align="center" prop="qwUserName" />
       <el-table-column label="员工称呼" align="center" prop="welcomeText" />
+      // 部门
+      <el-table-column label="部门" align="center" prop="departmentName" />
       <el-table-column label="员工状态" align="center" prop="isDel">
         <template slot-scope="scope">
           <el-tag v-if="scope.row.isDel == 0" type="success">正常</el-tag>
@@ -117,7 +122,7 @@
       <el-table-column label="vid" align="center" prop="vid" />
       <el-table-column label="uid" align="center" prop="uid" />
       <el-table-column label="serverId" align="center" prop="serverId" />
-      <el-table-column label="ai状态" align="center" prop="loginStatus">
+      <el-table-column label="ipad状态" align="center" prop="loginStatus">
         <template slot-scope="scope">
           <el-tag v-if="scope.row.ipadStatus == 1" type="success">在线</el-tag>
           <el-tag v-else type="danger">离线</el-tag>
@@ -130,15 +135,15 @@
       <!--        </template>-->
       <!--      </el-table-column>-->
       <!--      <el-table-column label="插件版本" align="center" prop="version"/>-->
-      <el-table-column label="服务器地址" align="center" prop="loginCodeUrl">
-        <template slot-scope="scope">
-          <el-tooltip class="item" effect="dark" :content="scope.row.loginCodeUrl" placement="top">
-            <div style="display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; text-overflow: ellipsis;">
-              <span>{{ scope.row.loginCodeUrl }}</span>
-            </div>
-          </el-tooltip>
-        </template>
-      </el-table-column>
+<!--      <el-table-column label="服务器地址" align="center" prop="loginCodeUrl">-->
+<!--        <template slot-scope="scope">-->
+<!--          <el-tooltip class="item" effect="dark" :content="scope.row.loginCodeUrl" placement="top">-->
+<!--            <div style="display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; text-overflow: ellipsis;">-->
+<!--              <span>{{ scope.row.loginCodeUrl }}</span>-->
+<!--            </div>-->
+<!--          </el-tooltip>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
 
       <el-table-column label="自动发课" align="center" prop="isAuto">
         <template slot-scope="scope">
@@ -555,12 +560,16 @@ import {
   qwBindCloudHost, qwUnbindCloudHost, handleAuthAppKey, handleInputAuthAppKey, selectCloudAP, staffListUser, exportStaff
 } from '../../../api/qw/user'
 import fastGptRole from "@/views/fastGpt/fastGptRole/fastGptRole";
+import { treeselect } from "@/api/qw/qwDept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 
 export default {
   name: "cuDeptIdIndex",
-  components: { fastGptRole},
+  components: { fastGptRole,Treeselect},
   data() {
     return {
+      deptOptions:[], // 企微部门
       isAutoOptions:[],
       updateIp:{
         open:false,
@@ -670,6 +679,7 @@ export default {
         qwUserId: null,
         corpId: null,
         qwUserName: null,
+        deptId:null,
       },
       qwUserId:null,
       companyUserList:[],
@@ -698,13 +708,16 @@ export default {
     });
     getMyQwCompanyList().then(response => {
       this.myQwCompanyList = response.data;
-      if(this.myQwCompanyList!=null){
+      if(this.myQwCompanyList && this.myQwCompanyList.length>0){
         this.queryParams.corpId=this.myQwCompanyList[0].dictValue;
+        // 查询部门下拉树结构
+        if(this.queryParams.corpId){
+          this.getTreeselect()
+        }
         this.getList();
       }
     });
-
-
+    this.loading = false;
   },
   watch: {
     // 监听弹窗的可见性变化
@@ -717,6 +730,25 @@ export default {
     },
   },
   methods: {
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      var that=this;
+      let query = {
+        corpId: this.queryParams.corpId
+      }
+      // 企微主体不能为空
+      if(!query.corpId){
+        this.$message.error("请选择企微主体");
+        return;
+      }
+      treeselect(query).then((response) => {
+        this.deptOptions = response.data;
+        console.log(this.deptOptions)
+        if(response.data!=null&&response.data.length>0){
+          this.queryParams.deptId=response.data[0].id;
+        }
+      });
+    },
     getList() {
       this.loading = true;
       staffListUser(this.queryParams).then(response => {
@@ -728,6 +760,7 @@ export default {
     },
     updateCorpId() {
       this.reset();
+      this.getTreeselect();
       this.getList();
     },
     changeVideoStatus(val){
@@ -1166,6 +1199,7 @@ export default {
     resetQuery() {
       this.resetForm("queryForm");
       this.queryParams.corpId = this.myQwCompanyList[0].dictValue;
+      this.queryParams.deptId = this.deptOptions[0] && this.deptOptions[0].id;
       this.handleQuery();
     },
     // 多选框选中数据
@@ -1262,4 +1296,11 @@ export default {
   width: 80%;
 }
 
+.vue-treeselect{
+  width: 217px;
+  height: 36px;
+}
+
 </style>
+
+

+ 1272 - 0
src/views/qw/user/myIndex.vue

@@ -0,0 +1,1272 @@
+<template>
+
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="企微主体" prop="corpId">
+        <el-select v-model="queryParams.corpId" placeholder="企微主体" size="small" @change="updateCorpId()">
+          <el-option
+            v-for="dict in myQwCompanyList"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="企微账号" prop="qwUserId">
+        <el-input
+          v-model="queryParams.qwUserId"
+          placeholder="请输入企微账号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="企微昵称" prop="qwUserName">
+        <el-input
+          v-model="queryParams.qwUserName"
+          placeholder="请输入企微昵称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="授权码" prop="appKey">
+        <el-input
+          v-model="queryParams.appKey"
+          placeholder="请输入授权码"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="员工状态" prop="isDel">
+        <el-select v-model="queryParams.isDel" placeholder="请选择员工状态" clearable>
+          <el-option
+            v-for="item in optionsStatus"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          :disabled="multiple"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          @click="updateSendType"
+        >修改发送方式
+        </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="['qw:user:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="userList" @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="qwUserId" />
+      <el-table-column label="企微昵称" align="center" prop="qwUserName" />
+      <el-table-column label="员工称呼" align="center" prop="welcomeText" />
+      <el-table-column label="员工状态" align="center" prop="isDel">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.isDel == 0" type="success">正常</el-tag>
+          <el-tag v-else type="error">离职</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="联系我二维码" align="center" prop="contactWay" >
+        <template slot-scope="scope">
+          <el-image
+            v-if="scope.row.contactWay!=null"
+            style="width: 100px; height: 100px"
+            :src="scope.row.contactWay"
+            fit="contain"
+            @click="openImageViewer(scope.row.contactWay)"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="绑定的AI客服" align="center" prop="fastGptRoleName" />
+      <el-table-column label="授权码" align="center" prop="appKey" />
+      <el-table-column label="发送方式" align="center" prop="sendMsgType">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.sendMsgType == 0">方式一</el-tag>
+          <el-tag v-if="scope.row.sendMsgType == 1" type="success">方式二</el-tag>
+          <el-tag v-if="scope.row.sendMsgType == 2" type="warning">掉线通知</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="vid" align="center" prop="vid" />
+      <el-table-column label="uid" align="center" prop="uid" />
+      <el-table-column label="serverId" align="center" prop="serverId" />
+      <el-table-column label="ipad状态" align="center" prop="loginStatus">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.ipadStatus == 1" type="success">在线</el-tag>
+          <el-tag v-else type="danger">离线</el-tag>
+        </template>
+      </el-table-column>
+      <!--      <el-table-column label="插件状态" align="center" prop="toolStatus">-->
+      <!--        <template slot-scope="scope">-->
+      <!--          <el-tag v-if="scope.row.toolStatus == 1" type="success">在线</el-tag>-->
+      <!--          <el-tag v-else type="danger">离线</el-tag>-->
+      <!--        </template>-->
+      <!--      </el-table-column>-->
+      <!--      <el-table-column label="插件版本" align="center" prop="version"/>-->
+<!--      <el-table-column label="服务器地址" align="center" prop="loginCodeUrl">-->
+<!--        <template slot-scope="scope">-->
+<!--          <el-tooltip class="item" effect="dark" :content="scope.row.loginCodeUrl" placement="top">-->
+<!--            <div style="display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; text-overflow: ellipsis;">-->
+<!--              <span>{{ scope.row.loginCodeUrl }}</span>-->
+<!--            </div>-->
+<!--          </el-tooltip>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
+
+      <el-table-column label="自动发课" align="center" prop="isAuto">
+        <template slot-scope="scope">
+          <dict-tag :options="isAutoOptions" :value="scope.row.isAuto"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-user-solid"
+            plain
+            @click="handleAppellation(scope.row)"
+          >
+            修改员工称呼
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-user-solid"
+            plain
+            @click="handleAutoRemark(scope.row)"
+          >
+            完课备注修改
+          </el-button>
+
+          <el-button
+            v-if="scope.row.serverStatus==1&&scope.row.ipadStatus!=1"
+            size="mini"
+            type="text"
+            icon="el-icon-sunny"
+            plain
+            @click="handleLoginQwCode(scope.row)"
+            v-hasPermi="['qw:user:login']"
+          >
+            登录企微
+          </el-button>
+          <el-button
+            v-if="scope.row.serverStatus==1&&scope.row.ipadStatus==1"
+            size="mini"
+            type="text"
+            icon="el-icon-moon"
+            plain
+            @click="handleLoginOutQwStatus(scope.row)"
+            v-hasPermi="['qw:user:login']"
+          >
+            退出企微
+          </el-button>
+          <el-button
+            v-if="scope.row.ipadStatus==1"
+            size="mini"
+            type="text"
+            icon="el-icon-moon"
+            plain
+            @click="handleTwoCode(scope.row)"
+            v-hasPermi="['qw:user:login']">
+            二次验证
+          </el-button>
+          <el-button
+            v-if="scope.row.serverStatus!=1"
+            size="mini"
+            type="text"
+            icon="el-icon-moon"
+            plain
+            @click="handleGetQwIpad(scope.row)"
+            v-hasPermi="['qw:user:login']"
+          >
+            获取Ai主机
+          </el-button>
+          <el-button
+            v-if="scope.row.serverStatus==1 && scope.row.ipadStatus!=1"
+            size="mini"
+            type="text"
+            icon="el-icon-moon"
+            plain
+            @click="handleDelQwIpad(scope.row)"
+            v-hasPermi="['qw:user:login']"
+          >
+            解绑Ai主机
+          </el-button>
+          <el-button
+            v-if="scope.row.isAuto=='00'"
+            size="mini"
+            type="text"
+            icon="el-icon-moon"
+            plain
+            @click="handleUpdateIsAuto(scope.row,'01')"
+            v-hasPermi="['qw:user:isauto']"
+          >
+            启用插件
+          </el-button>
+          <el-button
+            v-if="scope.row.isAuto=='01'"
+            size="mini"
+            type="text"
+            icon="el-icon-moon"
+            plain
+            @click="handleUpdateIsAuto(scope.row,'00')"
+            v-hasPermi="['qw:user:isauto']"
+          >
+            禁用插件
+          </el-button>
+        </template>
+      </el-table-column>
+      <el-table-column label="主机" align="center" class-name="small-padding fixed-width" width="110px" fixed="right">
+        <template slot-scope="scope">
+
+          <el-button
+            v-if="scope.row.appKey==null"
+            size="mini"
+            type="text"
+            icon="el-icon-s-check"
+            plain
+            v-hasPermi="['qw:user:authAppKey']"
+            @click="uploadAuthorizeKey2(scope.row)"
+          >授权key
+          </el-button>
+          <el-button
+            v-if="scope.row.loginCodeUrl==null && scope.row.appKey !=null"
+            size="mini"
+            type="text"
+            icon="el-icon-sunny"
+            plain
+            @click="handleBindCloudHost(scope.row)"
+            v-hasPermi="['qw:user:loginIp']"
+          >
+            绑定主机
+          </el-button>
+          <!--          <el-button-->
+          <!--            v-if="scope.row.loginCodeUrl!=null"-->
+          <!--            size="mini"-->
+          <!--            type="text"-->
+          <!--            icon="el-icon-video-camera-solid"-->
+          <!--            plain-->
+          <!--            @click="handleCloudAP(scope.row.loginCodeUrl)"-->
+          <!--            v-hasPermi="['qw:user:cloudAP']"-->
+          <!--          >-->
+          <!--            获取主机帐密-->
+          <!--          </el-button>-->
+          <el-button
+            v-if="scope.row.loginCodeUrl!=null"
+            size="mini"
+            type="text"
+            icon="el-icon-moon"
+            plain
+            @click="handleUnbindCloudHost(scope.row)"
+            v-hasPermi="['qw:user:loginIpOut']"
+          >
+            解除主机
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            :icon="scope.row.videoGetStatus == 0 ? 'el-icon-circle-check' : 'el-icon-remove-outline'"
+            plain
+            @click="changeVideoStatus(scope.row)"
+          >
+            {{ scope.row.videoGetStatus == 0 ? "开启" : "禁用" }}视频号接收
+          </el-button>
+        </template>
+      </el-table-column>
+      <el-table-column label="AI客服" align="center" class-name="small-padding fixed-width" width="100px" fixed="right">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-connection"
+            plain
+            v-if="scope.row.fastGptRoleName!=null"
+            @click="bindFastGptRole(scope.row)"
+          >换绑AI客服</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            plain
+            icon="el-icon-link"
+            v-else
+            @click="bindFastGptRole(scope.row)"
+          >绑定AI客服</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-unlock"
+            plain
+            v-if="scope.row.fastGptRoleName!=null"
+            @click="relieveFastGptRole(scope.row)"
+          >解绑AI客服</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"
+    />
+
+    <!-- 绑定AI客服-->
+    <el-dialog :title="bindAiTitle" :visible.sync="bindAiOpen" width="1200px" append-to-body>
+      <fast-gpt-role ref="fastGptRole" @refreshFastGptList="refreshFastGptList" ></fast-gpt-role>
+    </el-dialog>
+
+    <!--    <el-dialog :visible.sync="updateIp.open" width="600px" append-to-body>-->
+    <!--      <el-form ref="updateIpForm" :model="updateIpForm" :rules="updateIpRule" label-width="100px">-->
+    <!--        <el-form-item label="新云主机IP" prop="Ip">-->
+    <!--          <el-input v-model="updateIpForm.newIp" placeholder="请输入新IP" />-->
+    <!--        </el-form-item>-->
+    <!--      </el-form>-->
+    <!--      <div slot="footer" class="dialog-footer" >-->
+    <!--        <el-button type="primary" @click="submitUpdateIpForm">确 定</el-button>-->
+    <!--      </div>-->
+    <!--    </el-dialog>-->
+
+    <el-dialog title="云主机信息" :visible.sync="cloudAPOpen.open" append-to-body>
+      <el-card class="box-card">
+        <div slot="header" class="clearfix">
+          <span>账号:{{cloudAPOpen.admin}}</span>
+        </div>
+        <div slot="header" class="clearfix">
+          <span>密码:{{cloudAPOpen.passWord}}</span>
+        </div>
+      </el-card>
+    </el-dialog>
+
+    <el-dialog :title="callOpen.title" :visible.sync="callOpen.open" width="500px" append-to-body>
+      <el-form ref="callOpenFrom" :model="callOpenFrom" :rules="callOpenRule" label-width="110px">
+        <el-form-item label="员工称呼" prop="welcomeText">
+          <el-input v-model="callOpenFrom.welcomeText" placeholder="请输入员工称呼" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer" >
+        <el-button type="primary" @click="submitCallOpenFrom">确 定</el-button>
+      </div>
+    </el-dialog>
+
+
+    <el-dialog :title="editRemarkOpen.title" :visible.sync="editRemarkOpen.open" width="500px" append-to-body>
+      <el-form ref="callOpenFrom" :model="editRemarkOpen" label-width="110px">
+        <el-radio-group v-model="editRemarkOpen.isSendMsg">
+          <el-card>
+            <el-row :gutter="20">
+              <el-col>
+                <el-radio
+                  :label="1"
+                  style="font-size: 16px; margin: 10px 0;"
+                >添加【完课备注】在最【旧备注-(前面)】</el-radio>
+              </el-col>
+              <el-col>
+                <el-radio
+                  :label="2"
+                  style="font-size: 16px; margin: 10px 0;"
+                >添加【完课备注】在最【旧备注-(后面)】</el-radio>
+              </el-col>
+              <el-col>
+                <el-radio
+                  :label="3"
+                  style="font-size: 16px; margin: 10px 0;"
+                >使用简洁版备注【*日期完】,在【旧备注-前面】</el-radio>
+              </el-col>
+              <el-col>
+                <el-radio
+                  :label="4"
+                  style="font-size: 16px; margin: 10px 0;"
+                >使用简洁版备注【*日期完】,在【旧备注-后面】</el-radio>
+              </el-col>
+              <el-col>
+                <el-radio
+                  :label="5"
+                  style="font-size: 16px; margin: 10px 0;"
+                >不用完课备注</el-radio>
+              </el-col>
+            </el-row>
+          </el-card>
+        </el-radio-group>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitEditRemarkOpenFrom">确 定</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog title="授权key" :visible.sync="authorizeKeyOpen" width="500px" append-to-body>
+      <el-form ref="authorizeKeyFrom" :model="authorizeKeyFrom" :rules="authorizeKeyRule" label-width="110px">
+        <el-form-item label="授权的key值" prop="appKey">
+          <el-input v-model="authorizeKeyFrom.appKey" placeholder="请输入授权key" type="Number"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer" >
+        <el-button type="primary" @click="submitAuthorizeKeyForm">确 定</el-button>
+      </div>
+    </el-dialog>
+    <!--二维码   -->
+    <el-dialog
+      title="企微二次认证"
+      :visible.sync="qwLoginTwo.open"
+      width="600px"
+      append-to-body
+      custom-class="qr-login-dialog"
+    >
+      <div class="qr-login-container">
+        <div class="image-wrapper" v-loading="imageLoading" >
+          <el-image
+            :src="'data:image/png;base64,' +qwLoginTwo.codeUrl"
+            style="display: block; margin: 0 auto; width: 300px; height: 300px;"
+          />
+        </div>
+        <p class="qr-login-instructions">二次验证二维码</p>
+      </div>
+      <div slot="footer" class="dialog-footer" >
+        <el-button type="primary" @click="qwLoginTwo.open=false">确 定</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog
+      :title="qwLogin.title"
+      :visible.sync="qwLogin.open"
+      width="600px"
+      append-to-body
+      custom-class="qr-login-dialog"
+    >
+      <div class="qr-login-container">
+        <div class="image-wrapper" v-loading="imageLoading" >
+          <el-image
+            :src="'data:image/png;base64,' +qwLogin.codeUrl"
+            style="display: block; margin: 0 auto; width: 300px; height: 300px;"
+          />
+        </div>
+        <p class="qr-login-instructions">使用企业微信扫码授权登录</p>
+      </div>
+    </el-dialog>
+
+    <el-dialog
+      title="输入企微验证码"
+      :visible.sync="qwCode.open"
+      width="600px"
+      append-to-body>
+      <el-form  :model="qwCode"  label-width="80px" @submit.native.prevent="handleSubmit">
+        <el-form-item label="验证码" prop="companyName">
+          <el-input v-model="qwCode.code" placeholder="输入企微6位验证码" />
+        </el-form-item>
+      </el-form>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitCodeForm">确 定</el-button>
+
+      </div>
+    </el-dialog>
+
+
+
+    <!-- 大图预览对话框 -->
+    <el-dialog
+      :visible.sync="dialogVisible"
+      :modal="false"
+      width="1200"
+      append-to-body>
+      <img
+        :src="this.dialogImageUrl"
+        style="display: block; max-width: 100%; margin: 0 auto"
+      />
+    </el-dialog>
+    <el-dialog
+      :visible.sync="updateSendOpen"
+      width="1000px"
+      append-to-body>
+      <el-form label-width="80px">
+        <p>是否修改企微账号发送方式:
+          <el-tag style="margin-left: 10px" v-for="name in names">{{ name }}</el-tag>
+        </p>
+        <el-form-item label="发送方式" prop="type">
+          <el-radio-group v-model="type">
+            <el-radio
+              :label="0"
+            >方式一
+            </el-radio>
+            <el-radio
+              :label="1"
+            >方式二
+            </el-radio>
+            <el-radio
+              :label="2"
+            >掉线通知
+            </el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitUpdateSendTypeForm">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  updateIsAuto,
+  updateUser,
+  getMyQwCompanyList,
+  relieveFastGptRoleById,
+  loginQwIpad,
+  loginQwCodeMsg,
+  twoCode,
+  twoCodeStatus,
+  qrCodeStatus,
+  updateSendType,
+  getQwIpad,
+  delQwIpad,
+  qrCodeVerify,
+  outLoginQwIpad,
+  changeVideoStatus,
+  handleAllocateRemoteHost,
+  qwBindCloudHost,
+  qwUnbindCloudHost,
+  handleAuthAppKey,
+  handleInputAuthAppKey,
+  selectCloudAP,
+  staffListUser,
+  exportStaff,
+  myStaffListUser
+} from '../../../api/qw/user'
+import fastGptRole from "@/views/fastGpt/fastGptRole/fastGptRole";
+
+export default {
+  name: "myIndex",
+  components: { fastGptRole},
+  data() {
+    return {
+      isAutoOptions:[],
+      updateIp:{
+        open:false,
+        title: "修改云主机IP"
+      },
+      updateIpForm:{
+        id:null,
+        newIp:null,
+      },
+      authorizeKeyOpen:false,
+      authorizeKeyFrom:{
+        id:null,
+        appKey:null,
+        qwUserId:null,
+        qwUserName:null
+      },
+      updateIpRule:{},
+      newIp:null,
+      //放大图片
+      dialogImageUrl:null,
+      dialogVisible:false,
+      optionsStatus: [{
+        value: 0,
+        label: '正常'
+      }, {
+        value: 2,
+        label: '离职'
+      }],
+      // 遮罩层
+      loading: true,
+      names: [],
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      updateSendOpen: false,
+      // 总条数
+      total: 0,
+      //公司列表
+      myQwCompanyList:[],
+      // 企微用户表格数据
+      userList: [],
+      allowSelectOptions:[],
+      // 弹出层标题
+      bindAiTitle: "",
+      bindAiOpen: false,
+      qwLogin:{
+        title:"",
+        open:false,
+        codeUrl:null,
+        code:null,
+        appKey:null,
+      },
+      qwLoginTwo:{
+        title:"",
+        open:false,
+        codeUrl:null,
+        code:null,
+        appKey:null,
+      },
+      qwCode:{
+        title:"",
+        open:false,
+        code:null,
+      },
+      cloudAPOpen:{
+        open:false,
+        admin:null,
+        passWord:null,
+      },
+      callOpen:{
+        open:false,
+        title: '修改员工称呼',
+
+      },
+      callOpenFrom:{
+        id:null,
+        welcomeText:null,
+      },
+      isAutoForm:{
+        id:null,
+        isAuto:null,
+      },
+
+      editRemarkOpen: {
+        open: false,
+        title: '修改员工自动给完课客户打备注的规则',
+        id:null,
+        isSendMsg:null,
+      },
+
+      twoCodeInterval:null,
+      type: 0,
+      loginQwInterval:null,
+
+      imageLoading: true, // 控制加载状态
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        qwUserId: null,
+        corpId: null,
+        qwUserName: null,
+      },
+      qwUserId:null,
+      companyUserList:[],
+      // 表单参数
+      form: {
+        isSendMsg: '2',
+      },
+      authorizeKeyRule:{
+        appKey:[{required:true,message:"授权码不能为空",trigger:"blur"}]
+      },
+      callOpenRule:{
+        welcomeText:[{required:true,message:"员工称呼不能为空",trigger:"blur"}]
+      },
+      // 表单校验
+      rules: {
+      },
+      //欢迎语表单校验
+      weclomeRules:{
+        welcomeText:[{required:true,message:"消息文本不能为空",trigger:"blur"}]
+      },
+    };
+  },
+  created() {
+    this.getDicts("qw_user_is_auto").then(response => {
+      this.isAutoOptions = response.data;
+    });
+    getMyQwCompanyList().then(response => {
+      this.myQwCompanyList = response.data;
+      if(this.myQwCompanyList!=null){
+        this.queryParams.corpId=this.myQwCompanyList[0].dictValue;
+        this.getList();
+      }
+    });
+
+
+  },
+  watch: {
+    // 监听弹窗的可见性变化
+    'qwLogin.open'(newVal) {
+      if (!newVal) {
+        // 如果弹窗关闭,清除定时器
+        clearInterval(this.loginQwInterval);
+
+      }
+    },
+  },
+  methods: {
+    getList() {
+      this.loading = true;
+      myStaffListUser(this.queryParams).then(response => {
+        this.userList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+
+    },
+    updateCorpId() {
+      this.reset();
+      this.getList();
+    },
+    changeVideoStatus(val){
+      changeVideoStatus(val.id).then(res => {
+        this.$message.success("修改状态成功");
+        this.getList()
+      })
+    },
+
+    //绑定AI客服
+    bindFastGptRole(row) {
+      this.bindAiTitle = "绑定AI客服";
+      this.bindAiOpen = true;
+      setTimeout(() => {
+        this.$refs.fastGptRole.handleBindAiData(row)
+      }, 200);
+
+    },
+    handleAppellation(val) {
+      this.callOpen.open = true;
+      this.callOpenFrom.welcomeText = val.welcomeText;
+      this.callOpenFrom.id = val.id;
+    },
+
+    handleAutoRemark(val) {
+      this.editRemarkOpen.open = true;
+      this.editRemarkOpen.id = val.id;
+      this.editRemarkOpen.isSendMsg = val.isSendMsg;
+    },
+    //登录
+    handleLoginQwCode(val) {
+      if (val.appKey == null || val.appKey === '') {
+        return this.$message.warning("没有授权码,无法登录企业微信,请授权");
+      }
+      loginQwIpad({qwUserId: val.id}).then(res => {
+        this.qwUserId = val.id;
+        this.qwLogin.code = null;
+        this.imageLoading = false;
+        console.log(res)
+        if (res.msg == "success") {
+          this.qwLogin.codeUrl = res.qrCode64
+          this.qwLogin.open = true;
+          this.loginQwPolling();
+        } else {
+          this.$message.success(res.msg);
+          this.getList()
+        }
+
+      })
+    },
+
+    handleTwoCode(val) {
+
+      twoCode({qwUserId: val.id}).then(res => {
+        console.log(res)
+        this.qwLoginTwo.open = true;
+        this.qwLoginTwo.codeUrl = res.qrCode
+
+      });
+
+
+    },
+    twoCodePolling() {
+      this.twoCodeInterval = setInterval(() => {
+        twoCodeStatus({qwUserId: this.qwUserId}).then(res => {
+          console.log(res)
+
+          if (res.msg == 104001) {
+            this.$message.success('登录成功');
+            this.clearDl()
+            clearInterval(this.loginQwInterval);
+          } else if (res.msg == 100004) {
+            this.clearDl()
+          }
+        });
+      }, 3000);
+    },
+    loginQwPolling() {
+      this.loginQwInterval = setInterval(() => {
+        qrCodeStatus({qwUserId: this.qwUserId}).then(res => {
+          console.log(res)
+          if (res.msg == 22) {
+            this.$message.success('账号企业不一致请重新扫码登录');
+            this.clearDl();
+          }
+          if (res.msg == 104001) {
+            this.$message.success('登录成功');
+            this.clearDl()
+
+          } else if (res.msg == 100004) {
+            this.qwCode.open = true;
+            clearInterval(this.loginQwInterval);
+          }
+        });
+      }, 3000);
+    },
+    submitCodeForm() {
+
+      qrCodeVerify({code: this.qwCode.code, qwUserId: this.qwUserId}).then(res => {
+        console.log(res)
+
+        this.$message.success('验证成功账号信息确认中。。。。');
+        this.qwCode.open = false;
+        this.loginQwInterval = setTimeout(() => {
+          qrCodeStatus({qwUserId: this.qwUserId}).then(res => {
+            console.log(res);
+            if (res.msg == 23) {
+              this.$message.error('账号不一致请重新扫码登录');
+              this.clearDl();
+            }
+            if (res.msg == 22) {
+              this.$message.error('账号企业不一致请重新扫码登录');
+              this.clearDl();
+            }
+            if (res.msg == 104001) {
+              this.$message.success('登录成功');
+              this.clearDl();
+            }
+          });
+        }, 4000);
+      });
+    },
+
+    clearDl() {
+      this.qwCode.open = false;
+      this.qwLogin.open = false;
+      clearInterval(this.loginQwInterval);
+      this.getList()
+    },
+
+
+    //退出
+    handleLoginOutQwStatus(val) {
+      outLoginQwIpad({qwUserId: val.id}).then(res => {
+
+        this.$message.success("退出登录成功");
+        this.getList()
+      })
+
+    },
+
+
+    handleGetQwIpad(val) {
+      getQwIpad({qwUserId: val.id}).then(res => {
+        this.$message.success("获取主机成功");
+        this.getList();
+      }).catch(error => {
+        console.log(error);
+        if (error.code === 501) {
+          this.$confirm(
+            '当前区域没有多余的名额,将为你分配异地名额,会导致企业微信需要扫脸重新登录,并且半个小时后需要进行验证',
+            '提示',
+            {
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              type: 'warning',
+              dangerouslyUseHTMLString: true
+            }
+          ).then(() => {
+            return handleAllocateRemoteHost({qwUserId: val.id});
+          }).then(res => {
+            this.$message.success('异地主机分配成功');
+            this.getList();
+          }).catch(() => {
+            this.$message.info('已取消异地主机分配');
+          });
+        } else {
+          this.$message.error('获取主机失败');
+        }
+      });
+    },
+    handleDelQwIpad(val) {
+      delQwIpad({qwUserId: val.id}).then(res => {
+        this.$message.success("解绑主机成功");
+        this.getList()
+      })
+    },
+
+    handleUpdateIsAuto(val,code) {
+      this.isAutoForm={
+        id:val.id,
+        isAuto:code
+      }
+      updateIsAuto(this.isAutoForm).then(res => {
+        if (code==='00'){
+          this.$message.success('禁用成功');
+        }else {
+          this.$message.success('启用成功');
+        }
+        this.getList();
+      });
+
+
+    },
+    //传验证码
+    handleLoginQwCodeMsg() {
+      loginQwCodeMsg({appKey: this.qwLogin.appKey, code: this.qwLogin.code}).then(res => {
+        this.qwLogin.open = false;
+        this.$message.success("登录成功");
+      })
+    },
+
+    validateCode() {
+      // 只允许输入数字并限制长度为6
+      this.qwLogin.code = this.qwLogin.code.replace(/\D/g, "").slice(0, 6);
+    },
+
+    handleCloudAP(urlAP) {
+
+      selectCloudAP({ipAddress: urlAP}).then(res => {
+        this.cloudAPOpen.open = true
+        this.cloudAPOpen.admin = res.data.apAdmin;
+        this.cloudAPOpen.passWord = res.data.apPassword;
+      })
+    },
+
+    handleUnbindCloudHost(val) {
+
+      const appKey = val.appKey;
+
+      this.$confirm(
+        '确定要给企微账号:<span style="color: green;">' + val.qwUserId + '' +
+        '</span><br>企微昵称:<span style="color: red;">【' + val.qwUserName + '】</span>' +
+        '</span><br><span style="color: orange;">解绑【Ps:解绑后此云主机可能会分配给他人】</span></span>',
+        "警告",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
+        }
+      ).then(() => {
+        return qwUnbindCloudHost(appKey);
+      }).then(response => {
+        this.$message.success('解绑成功');
+      }).finally(res => {
+        this.getList();
+      })
+
+    },
+
+
+    handleAuthorizeKey(val) {
+      this.authorizeKeyFrom.id = val.id;
+      this.authorizeKeyFrom.qwUserId = val.qwUserId;
+      this.authorizeKeyFrom.qwUserName = val.qwUserName;
+      this.authorizeKeyOpen = true;
+
+    },
+
+    submitAuthorizeKeyForm() {
+      this.$refs["authorizeKeyFrom"].validate(valid => {
+        if (valid) {
+          if (this.authorizeKeyFrom.id != null && this.authorizeKeyFrom.appKey != null) {
+            this.uploadAuthorizeKey();
+          }
+        }
+      });
+    },
+    submitCallOpenFrom() {
+
+      this.$refs["callOpenFrom"].validate(valid => {
+        if (valid) {
+
+          if (this.callOpenFrom.id != null && this.callOpenFrom.welcomeText != null) {
+            updateUser(this.callOpenFrom).then(res => {
+              this.$message.success('修改成功');
+              this.callOpen.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+
+    submitEditRemarkOpenFrom() {
+      if (this.editRemarkOpen.id != null && this.editRemarkOpen.isSendMsg != null) {
+        updateUser(this.editRemarkOpen).then(res => {
+          this.$message.success('修改成功');
+          this.editRemarkOpen.open = false;
+          this.getList();
+        });
+      } else {
+        this.$message.error("请选择条件")
+      }
+    },
+
+
+    uploadAuthorizeKey() {
+      this.$confirm(
+        '确定要给企微账号:<span style="color: green;">' + this.authorizeKeyFrom.qwUserId + '' +
+        '</span><br>企微昵称:<span style="color: red;">【' + this.authorizeKeyFrom.qwUserName + '】</span>' +
+        '</span><br>授权key:<span style="color: #04adf6;">【' + this.authorizeKeyFrom.appKey + '】</span>?',
+        "警告",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
+        }
+      ).then(() => {
+        this.authorizeKeyOpen = false;
+        return handleInputAuthAppKey(this.authorizeKeyFrom);
+      }).then(response => {
+        this.msgSuccess("授权key完成");
+      }).finally(res => {
+        this.resetAuthorizeKeyFrom();
+        this.getList();
+      })
+
+    },
+
+    uploadAuthorizeKey2(val) {
+      const id = val.id;
+      this.$confirm(
+        '确定要给企微账号:<span style="color: green;">' + val.qwUserId + '' +
+        '</span><br>企微昵称:<span style="color: red;">【' + val.qwUserName + '】</span>' +
+        '</span><br>授权key</span>?',
+        "警告",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
+        }
+      ).then(() => {
+        return handleAuthAppKey({id: id});
+      }).then(response => {
+        this.msgSuccess("授权key完成");
+      }).finally(res => {
+        this.resetAuthorizeKeyFrom();
+        this.getList();
+      })
+    },
+
+    handleBindCloudHost(val) {
+
+      if (val.appKey == null || val.appKey == '') {
+        return this.$message.warning('没有授权码,无法绑定主机,请联系管理员');
+      }
+
+      const appKey = val.appKey;
+
+      this.$confirm(
+        '确定要给企微账号:<span style="color: green;">' + val.qwUserId + '' +
+        '</span><br>企微昵称:<span style="color: red;">【' + val.qwUserName + '】</span>' +
+        '</span><br><span style="color: dodgerblue;">绑定云主机?</span></span>',
+        "警告",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
+        }
+      ).then(() => {
+        return qwBindCloudHost(appKey);
+      }).then(response => {
+        this.$message.success('绑定成功,请登录云主机进行配置~~');
+      }).finally(res => {
+        this.getList();
+      })
+
+
+    },
+
+    openImageViewer(url) {
+      // 打开大图预览对话框
+      this.dialogImageUrl = url
+      this.dialogVisible = true;
+    },
+    //刷新页面
+    refreshFastGptList() {
+      this.bindAiOpen = false;
+      this.getList();
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        qwUserId: null,
+        corpId: null,
+        qwUserName: null,
+      };
+      this.resetForm("form");
+
+    },
+
+    //重置授权
+    resetAuthorizeKeyFrom() {
+      this.authorizeKeyFrom = {
+        id: null,
+        appKey: null,
+        qwUserId: null,
+        qwUserName: null
+      };
+    },
+    //重置登录
+    resetQwLogin() {
+      this.qwLogin = {
+        title: "",
+        open: false,
+        codeUrl: null,
+        code: null,
+        corpId: null,
+        qwUserId: null,
+      }
+      this.qwLogin.open = false;
+      this.loading = false;
+      this.getList();
+    },
+    //解绑AI客服
+    relieveFastGptRole(row) {
+      this.$confirm('是否确认解绑AI客服?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return relieveFastGptRoleById(row.id);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("解绑成功");
+      })
+
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.queryParams.corpId = this.myQwCompanyList[0].dictValue;
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.names = selection.map(item => item.qwUserName)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+
+
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+
+            // updateUser(this.form).then(response => {
+            //   this.msgSuccess("绑定成功");
+            //   this.open = false;
+            //   this.getList();
+            //
+            // });
+          } else {
+            // addUser(this.form).then(response => {
+            //   this.msgSuccess("新增成功");
+            //   this.open = false;
+            //   this.getList();
+            // });
+          }
+        }
+      });
+    },
+
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有企微员工数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportStaff(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {
+      });
+    },
+    updateSendType() {
+      this.updateSendOpen = true;
+    },
+    cleanUpdateSendType() {
+      this.updateSendOpen = false;
+    },
+    submitUpdateSendTypeForm(){
+      updateSendType({ids: this.ids, type: this.type}).then(e => {
+        this.updateSendOpen = false;
+        this.$message.success("修改成功");
+        this.getList();
+      });
+    },
+  }
+};
+</script>
+<style>
+.text-container {
+  max-height: 7.5em; /* 设置最大高度为6行,根据字体大小调整 */
+  overflow-y: auto; /* 内容超出时显示滚动条 */
+  line-height: 1.5em; /* 行高设置,确保每行高度一致 */
+}
+
+.qr-login-dialog .el-dialog__body {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  text-align: center;
+  padding: 20px;
+}
+
+.qr-login-container {
+  width: 100%;
+}
+
+.qr-login-instructions {
+  font-size: 14px;
+  color: #666;
+  margin: 10px 0;
+}
+
+.verification-code-input {
+  margin-top: 15px;
+  width: 80%;
+}
+
+</style>

+ 15 - 0
src/views/users/user/transfer.vue

@@ -12,6 +12,16 @@
           </el-option>
         </el-select>
       </el-form-item>
+      <el-form-item label="项目" prop="projectId">
+        <el-select  v-model="queryParams.projectId" 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="会员ID" prop="userId">
         <el-input
           style="width: 200px"
@@ -74,6 +84,11 @@
       </el-table-column>
       <el-table-column label="会员ID" align="center" prop="userId" />
       <el-table-column label="昵称" align="center" prop="nickname" />
+      <el-table-column label="头像" align="center">
+        <template slot-scope="scope">
+          <img  :src="scope.row.avatar" style="width:50px;height:50px" />
+        </template>
+      </el-table-column>
       <el-table-column label="所属销售" align="center" prop="companyUserNickName" />
       <el-table-column label="手机号码" align="center" prop="phone" />
       <el-table-column label="状态" align="center" prop="statusText" >